(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7f2737ea"],{"2ef6":function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t._self._c;return e("div",[e("el-row",[e("el-col",{attrs:{span:24}},[e("el-card",{staticClass:"box-card"},[e("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[t._v("资产订单")])]),e("div",{staticClass:"form-container"},[e("el-form",{attrs:{model:t.assetInventoryInInfo,"label-width":"100px"}},[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:12}},[e("el-form-item",{attrs:{label:"选择仓库"}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择仓库"},model:{value:t.assetInventoryInInfo.shId,callback:function(e){t.$set(t.assetInventoryInInfo,"shId",e)},expression:"assetInventoryInInfo.shId"}},t._l(t.assetInventoryInInfo.shopHouses,(function(t){return e("el-option",{key:t.shId,attrs:{label:t.shName,value:t.shId}})})),1)],1)],1),e("el-col",{attrs:{span:12}},[e("el-form-item",{attrs:{label:"盘点日期"}},[e("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",placeholder:"选择日期时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.assetInventoryInInfo.invTime,callback:function(e){t.$set(t.assetInventoryInInfo,"invTime",e)},expression:"assetInventoryInInfo.invTime"}})],1)],1)],1),e("el-row",[e("el-col",{attrs:{span:24}},[e("el-form-item",{attrs:{label:"盘点说明"}},[e("el-input",{attrs:{type:"textarea",rows:3,placeholder:"请输入盘点说明",maxlength:"250"},model:{value:t.assetInventoryInInfo.remark,callback:function(e){t.$set(t.assetInventoryInInfo,"remark",e)},expression:"assetInventoryInInfo.remark"}})],1)],1)],1)],1)],1)])],1)],1),e("el-row",{staticStyle:{"margin-top":"20px"}},[e("el-col",{attrs:{span:24}},[e("el-card",{staticClass:"box-card"},[e("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[t._v("盘点商品")]),e("el-button",{staticStyle:{float:"right"},attrs:{type:"primary",size:"small"},on:{click:t._openChooseProductModal}},[e("i",{staticClass:"el-icon-plus"}),t._v("选择商品 ")])],1),e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.assetInventoryInInfo.inoutOrderProducts,border:""}},[e("el-table-column",{attrs:{prop:"productId",label:"编号",align:"center"}}),e("el-table-column",{attrs:{prop:"prodName",label:"名称",align:"center"}}),e("el-table-column",{attrs:{prop:"defaultSpecValue.specName",label:"规格",align:"center"}}),e("el-table-column",{attrs:{prop:"defaultSpecValue.price",label:"单价",align:"center"}}),e("el-table-column",{attrs:{prop:"quantity",label:"账面数量",align:"center"}}),e("el-table-column",{attrs:{label:"盘点数量",align:"center"},scopedSlots:t._u([{key:"default",fn:function(n){return[e("el-input",{attrs:{type:"number"},on:{blur:function(e){return t._computeData(n.row)}},model:{value:n.row.invQuantity,callback:function(e){t.$set(n.row,"invQuantity",t._n(e))},expression:"scope.row.invQuantity"}})]}}])}),e("el-table-column",{attrs:{label:"将过期",align:"center"},scopedSlots:t._u([{key:"default",fn:function(n){return[e("el-input",{attrs:{type:"number"},on:{blur:function(e){return t._computeData(n.row)}},model:{value:n.row.willExpire,callback:function(e){t.$set(n.row,"willExpire",t._n(e))},expression:"scope.row.willExpire"}})]}}])}),e("el-table-column",{attrs:{label:"耗损",align:"center"},scopedSlots:t._u([{key:"default",fn:function(n){return[e("el-input",{attrs:{type:"number"},on:{blur:function(e){return t._computeData(n.row)}},model:{value:n.row.attrition,callback:function(e){t.$set(n.row,"attrition",t._n(e))},expression:"scope.row.attrition"}})]}}])}),e("el-table-column",{attrs:{prop:"invProfit",label:"盘盈",align:"center"}}),e("el-table-column",{attrs:{prop:"invLoss",label:"盘亏",align:"center"}}),e("el-table-column",{attrs:{prop:"invProfitMoney",label:"盘盈金额",align:"center"}}),e("el-table-column",{attrs:{prop:"invLossMoney",label:"盘亏金额",align:"center"}}),e("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:t._u([{key:"default",fn:function(n){return[e("el-button",{attrs:{type:"text",size:"small"},on:{click:function(e){return t._deleteProduct(n.row)}}},[t._v("删除")])]}}])})],1)],1)],1)],1),e("el-row",{staticStyle:{"margin-top":"20px"}},[e("el-col",{attrs:{span:24}},[e("div",{staticStyle:{float:"right"}},[e("el-button",{staticStyle:{"margin-right":"20px"},attrs:{type:"warning"},on:{click:t._goBack}},[t._v("取消")]),e("el-button",{attrs:{type:"primary"},on:{click:t._doAssetInventory}},[t._v("提交")])],1)])],1),e("choose-product-and-spec",{ref:"chooseProductModal",on:{chooseProduct:t.handleChooseProduct}})],1)},s=[],a=n("7323"),l=n("85a3"),r=n("3d57"),i={components:{ChooseProductAndSpec:r["a"]},data(){return{assetInventoryInInfo:{shId:"",invTime:"",shopHouses:[],inoutOrderProducts:[],remark:"",shopId:Object(a["f"])()}}},created(){this._listShopHouses()},methods:{_doAssetInventory(){const t=this.assetInventoryInInfo.inoutOrderProducts;t.length<1?this.$message.warning("请选择商品"):(t.forEach(t=>{t.valueId=t.defaultSpecValue.valueId,t.specName=t.defaultSpecValue.specName}),Object(l["saveAssetInventory"])(this.assetInventoryInInfo).then(t=>{this.$message.success(t.msg),this._goBack()}).catch(t=>{this.$message.error(t)}))},_openChooseProductModal(){this.assetInventoryInInfo.shId?this.$refs.chooseProductModal.open({shId:this.assetInventoryInInfo.shId}):this.$message.warning("请先选择仓库")},handleChooseProduct(t){t.invProfit=0,t.invLoss=0,t.invProfitMoney=0,t.invLossMoney=0,t.invQuantity=0,t.willExpire=0,t.attrition=0,t.quantity=t.defaultSpecValue.stock,this.assetInventoryInInfo.inoutOrderProducts.push(t)},_goBack(){this.$router.go(-1)},_deleteProduct(t){const e=this.assetInventoryInInfo.inoutOrderProducts.indexOf(t);e>-1&&this.assetInventoryInInfo.inoutOrderProducts.splice(e,1)},_listShopHouses(){Object(l["f"])({page:1,row:100,shopId:this.assetInventoryInInfo.shopId}).then(t=>{this.assetInventoryInInfo.shopHouses=t.data}).catch(t=>{console.log("请求失败处理",t)})},_computeData(t){t.invProfit=parseInt(t.invQuantity)-parseInt(t.quantity),t.invProfit<0&&(t.invProfit=0),t.invLoss=parseInt(t.quantity)-parseInt(t.invQuantity),t.invLoss<0&&(t.invLoss=0),t.invProfitMoney=t.invProfit*parseFloat(t.defaultSpecValue.price),t.invLossMoney=t.invLoss*parseFloat(t.defaultSpecValue.price),this.$forceUpdate()}}},c=i,u=(n("6e03"),n("2877")),d=Object(u["a"])(c,o,s,!1,null,"8cacd0da",null);e["default"]=d.exports},"3d57":function(t,e,n){"use strict";var o=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:"选择商品",visible:t.dialogVisible,width:"70%","before-close":t.handleClose},on:{"update:visible":function(e){t.dialogVisible=e}}},[e("div",{staticClass:"product-select-container"},[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:8}},[e("div",{staticClass:"product-category"},[e("el-tree",{attrs:{data:t.categoryData,props:t.defaultProps},on:{"node-click":t.handleNodeClick}})],1)]),e("el-col",{attrs:{span:16}},[e("div",{staticClass:"product-list"},[e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.productList,border:""},on:{"selection-change":t.handleSelectionChange}},[e("el-table-column",{attrs:{type:"selection",width:"55"}}),e("el-table-column",{attrs:{prop:"productId",label:"商品编号"}}),e("el-table-column",{attrs:{prop:"prodName",label:"商品名称"}}),e("el-table-column",{attrs:{prop:"defaultSpecValue.specName",label:"规格"}}),e("el-table-column",{attrs:{prop:"defaultSpecValue.stock",label:"库存"}})],1)],1)])],1)],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.confirmSelection}},[t._v("确 定")])],1)])},s=[],a={name:"ChooseProductAndSpec",data(){return{dialogVisible:!1,categoryData:[],productList:[],selectedProducts:[],defaultProps:{children:"children",label:"name"}}},methods:{open(){this.dialogVisible=!0},handleClose(t){this.$confirm("确认关闭?").then(e=>{console.log(e),t()}).catch(t=>{console.log(t)})},handleNodeClick(t){console.log(t)},handleSelectionChange(t){this.selectedProducts=t},confirmSelection(){0!==this.selectedProducts.length?(this.$emit("chooseProductAndSpec",this.selectedProducts),this.dialogVisible=!1):this.$message.warning("请至少选择一件商品")}}},l=a,r=(n("6676"),n("2877")),i=Object(r["a"])(l,o,s,!1,null,"364dda58",null);e["a"]=i.exports},6676:function(t,e,n){"use strict";n("80a7")},"6e03":function(t,e,n){"use strict";n("f974")},"80a7":function(t,e,n){},"85a3":function(t,e,n){"use strict";n.d(e,"c",(function(){return s})),n.d(e,"f",(function(){return a})),n.d(e,"a",(function(){return l}));var o=n("b775");function s(t){return new Promise((e,n)=>{Object(o["a"])({url:"/assetInventory/queryAssetInventory",method:"get",params:t}).then(t=>{const n=t.data;e(n)}).catch(t=>{n(t)})})}function a(t){return new Promise((e,n)=>{Object(o["a"])({url:"/shopHouse.queryShopHouse",method:"get",params:t}).then(t=>{const n=t.data;e(n)}).catch(t=>{n(t)})})}function l(t){return new Promise((e,n)=>{Object(o["a"])({url:"/assetInventory/deleteAssetInventory",method:"post",data:t}).then(t=>{const n=t.data;e(n)}).catch(t=>{n(t)})})}},f974:function(t,e,n){}}]); //# sourceMappingURL=chunk-7f2737ea.c00b16da.js.map