2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5247fba2"],{"36ae":function(t,e,o){"use strict";o.r(e);var a=function(){var t=this,e=t._self._c;return e("div",{staticClass:"animated fadeInRight ecommerce"},[e("el-row",[e("el-col",{attrs:{span:24}},[e("el-card",{staticClass:"ibox"},[e("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[e("h5",[t._v("调拨物品")]),e("div",{staticClass:"ibox-tools"},[e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t._goBack}},[t._v("返回")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t._openAllocationOrderInModel}},[e("i",{staticClass:"el-icon-plus"}),t._v("选择物品 ")])],1)]),e("div",{staticClass:"ibox-content"},[e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.allocationOrderInInfo.productManages,border:""}},[e("el-table-column",{attrs:{prop:"coverPhoto",label:"商品图片",align:"center"},scopedSlots:t._u([{key:"default",fn:function(t){return[e("img",{staticStyle:{width:"60px",height:"60px","border-radius":"5px"},attrs:{src:t.row.coverPhoto}})]}}])}),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:"shName",label:"原仓库",align:"center"}}),e("el-table-column",{attrs:{label:"目标仓库",align:"center"}},[[e("el-select",{staticStyle:{width:"100%"},model:{value:t.allocationOrderInInfo.targetShId,callback:function(e){t.$set(t.allocationOrderInInfo,"targetShId",e)},expression:"allocationOrderInInfo.targetShId"}},[e("el-option",{attrs:{label:"请选择目标仓库",value:""}}),t._l(t.allocationOrderInInfo.shopHouses,(function(t){return e("el-option",{key:t.shId,attrs:{label:t.shName,value:t.shId}})}))],2)]],2),e("el-table-column",{attrs:{prop:"defaultSpecValue.specName",label:"规格",align:"center"}}),e("el-table-column",{attrs:{prop:"defaultSpecValue.stock",label:"库存",align:"center"}}),e("el-table-column",{attrs:{label:"数量",align:"center"},scopedSlots:t._u([{key:"default",fn:function(o){return[e("el-input",{attrs:{type:"number"},on:{keyup:t._caculTotalMount},model:{value:o.row.count,callback:function(e){t.$set(o.row,"count",t._n(e))},expression:"scope.row.count"}})]}}])}),e("el-table-column",{attrs:{label:"单价",align:"center"},scopedSlots:t._u([{key:"default",fn:function(o){return[e("el-input",{attrs:{type:"number"},on:{keyup:t._caculTotalMount},model:{value:o.row.price,callback:function(e){t.$set(o.row,"price",t._n(e))},expression:"scope.row.price"}})]}}])}),e("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:t._u([{key:"default",fn:function(o){return[e("el-button",{attrs:{type:"text"},on:{click:function(e){return t._deleteProduct(o.row)}}},[t._v("删除")])]}}])})],1)],1)])],1)],1),e("el-row",[e("el-col",{attrs:{span:24}},[e("el-card",{staticClass:"ibox"},[e("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[e("h5",[t._v("调拨说明")])]),e("div",{staticClass:"ibox-content"},[e("el-form",{attrs:{model:t.allocationOrderInInfo,"label-width":"100px"}},[e("el-form-item",{attrs:{label:"申请说明"}},[e("el-input",{attrs:{type:"textarea",placeholder:"必填,请填写申请说明"},model:{value:t.allocationOrderInInfo.remark,callback:function(e){t.$set(t.allocationOrderInInfo,"remark",e)},expression:"allocationOrderInInfo.remark"}})],1)],1)],1)])],1)],1),e("el-row",[e("el-col",{attrs:{span:22,offset:2}},[e("div",{staticStyle:{"margin-bottom":"10px","text-align":"right"}},[e("el-button",{attrs:{type:"primary"},on:{click:t._submitApply}},[t._v("提交")])],1)])],1),e("choose-product-and-spec",{ref:"chooseProductAndSpec"})],1)},n=[],r=o("7323"),l=o("ff63"),s=o("54cc"),c={name:"AllocationOrderIn",components:{ChooseProductAndSpec:s["a"]},data(){return{allocationOrderInInfo:{productManages:[],resourceSuppliers:[],shopHouses:[],total:0,records:1,remark:"",srcShId:"",srcShName:"",targetShId:"",targetShName:"",shopName:"",count:"",productId:"",specId:"",targetShopId:"",targetShopName:"",totalMount:0,moreCondition:!1,shopId:Object(r["f"])()}}},created(){this._listAllocationStorehouse(),this._initEvent()},methods:{_initEvent(){this.$on("allocationOrderIn","chooseProductAndSpec",t=>{this.allocationOrderInInfo.productManages.push(t),this.allocationOrderInInfo.shopId=t.shopId,this.allocationOrderInInfo.srcShId=t.shId,this.allocationOrderInInfo.srcShName=t.shName,this.allocationOrderInInfo.productId=t.productId,this.allocationOrderInInfo.specId=t.defaultSpecValue.specId,this._selectShopHouses(t.shId)})},_deleteProduct(t){let e=this.allocationOrderInInfo.productManages.indexOf(t);e>-1&&this.allocationOrderInInfo.productManages.splice(e,1)},_openAllocationOrderInModel(){this.$refs.chooseProductAndSpec.open()},_listAllocationStorehouse(t=1,e=100){const o={page:t,row:e};console.log(o)},_goBack(){this.$router.go(-1)},async _submitApply(){if(this.allocationOrderInInfo.productManages.length<1)return void this.$message.warning("请选择物品");if(!this.allocationOrderInInfo.targetShId)return void this.$message.warning("请选择目标仓库");if(""===this.allocationOrderInInfo.remark)return void this.$message.warning("申请说明不能为空");let t=!0;if(this.allocationOrderInInfo.productManages.forEach(e=>!e.count||e.count<=0?(this.$message.warning("请填写调拨数量"),void(t=!1)):parseInt(e.count)>parseInt(e.defaultSpecValue.stock)?(this.$message.warning(e.prodName+"库存不足"),void(t=!1)):void(this.allocationOrderInInfo.count=e.count)),t)try{const t=await Object(l["saveAllocationOrder"])(this.allocationOrderInInfo);this.$message.success(t.msg),this._goBack()}catch(e){this.$message.error(e)}},_caculTotalMount(){let t=0;this.allocationOrderInInfo.productManages.forEach(e=>{if(isNaN(e.count)||isNaN(e.price))throw this.allocationOrderInInfo.totalMount="请输入正确的数字",Error();t+=parseFloat(e.count)*parseFloat(e.price).toFixed(2)}),this.allocationOrderInInfo.totalMount=t.toFixed(2)},async _selectShopHouses(t){const e={shId:t,shopId:this.allocationOrderInInfo.shopId,flag:"1",page:1,row:50};try{const t=await Object(l["e"])(e);this.allocationOrderInInfo.shopHouses=t.data}catch(o){this.$message.error(o)}}}},i=c,d=(o("b13a"),o("2877")),u=Object(d["a"])(i,a,n,!1,null,"65bcc060",null);e["default"]=u.exports},"50b0":function(t,e,o){},"54cc":function(t,e,o){"use strict";var a=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:"选择商品",visible:t.dialogVisible,width:"70%"},on:{"update:visible":function(e){t.dialogVisible=e},close:t.handleClose}},[e("div",{staticClass:"product-select-container"},[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:24}},[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:"商品编号",width:"120"}}),e("el-table-column",{attrs:{prop:"prodName",label:"商品名称"}}),e("el-table-column",{attrs:{prop:"specName",label:"规格"}}),e("el-table-column",{attrs:{prop:"price",label:"单价"}}),e("el-table-column",{attrs:{prop:"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.handleConfirm}},[t._v("确 定")])],1)])},n=[],r=o("85a3"),l={name:"ChooseProductAndSpec",data(){return{dialogVisible:!1,productList:[],selectedProducts:[],params:{}}},methods:{open(t){this.params=t||{},this.dialogVisible=!0,this.loadProductList()},loadProductList(){Object(r["queryProductList"])(this.params).then(t=>{this.productList=t.data}).catch(t=>{console.error("加载商品列表失败:",t)})},handleSelectionChange(t){this.selectedProducts=t},handleConfirm(){0!==this.selectedProducts.length?(this.$emit("chooseProductAndSpec",this.selectedProducts),this.dialogVisible=!1):this.$message.warning("请至少选择一件商品")},handleClose(){this.selectedProducts=[],this.params={}}}},s=l,c=(o("80fa"),o("2877")),i=Object(c["a"])(s,a,n,!1,null,"561e2572",null);e["a"]=i.exports},"80fa":function(t,e,o){"use strict";o("50b0")},"85a3":function(t,e,o){"use strict";o.d(e,"c",(function(){return n})),o.d(e,"f",(function(){return r})),o.d(e,"a",(function(){return l}));var a=o("b775");function n(t){return new Promise((e,o)=>{Object(a["a"])({url:"/assetInventory/queryAssetInventory",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function r(t){return new Promise((e,o)=>{Object(a["a"])({url:"/shopHouse.queryShopHouse",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function l(t){return new Promise((e,o)=>{Object(a["a"])({url:"/assetInventory/deleteAssetInventory",method:"post",data:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}},"8c11":function(t,e,o){},b13a:function(t,e,o){"use strict";o("8c11")},ff63:function(t,e,o){"use strict";o.d(e,"d",(function(){return r})),o.d(e,"c",(function(){return l})),o.d(e,"g",(function(){return s})),o.d(e,"b",(function(){return c})),o.d(e,"a",(function(){return i})),o.d(e,"e",(function(){return d}));var a=o("b775"),n=o("7323");function r(t){return new Promise((e,o)=>{t.shopId=Object(n["f"])(),Object(a["a"])({url:"/allocationOrder/queryAllocationOrder",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function l(t){return new Promise((e,o)=>{t.shopId=Object(n["f"])(),Object(a["a"])({url:"/shopHouse.queryShopHouse",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function s(t){return new Promise((e,o)=>{t.shopId=Object(n["f"])(),Object(a["a"])({url:"/allocationOrder/updateAllocationOrder",method:"post",data:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function c(t){return new Promise((e,o)=>{t.shopId=Object(n["f"])(),Object(a["a"])({url:"/allocationOrder/deleteAllocationOrder",method:"post",data:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function i(t){return new Promise((e,o)=>{t.shopId=Object(n["f"])(),Object(a["a"])({url:"/allocationOrder/auditAllocationOrder",method:"post",data:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}function d(t){return new Promise((e,o)=>{t.shopId=Object(n["f"])(),Object(a["a"])({url:"/shopHouse.queryShopHouse",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}}}]);
|
|
//# sourceMappingURL=chunk-5247fba2.58480599.js.map
|