1 |
- webpackJsonp([2],{"32al":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o("Xxa5"),a=o.n(n),s=o("exGp"),i=o.n(s),r=o("Dd8w"),d=o.n(r),c=o("NYxO"),l=(o("jQQ7"),o("dO7o")),u=(o("hky6"),o("dClm")),m=o("CIZm"),p=o("Pfph"),h={name:"goodsExchangeAdd",data:function(){return{typeList:[{real_name:"销售出库",id:"销售出库"},{real_name:"租赁出库",id:"租赁出库"},{real_name:"借用出库",id:"借用出库"},{real_name:"其他出库",id:"其他出库"}],adminList:[],dialogVisible:!1,warehouseList:[],deptList:[],deptListAll:[],orderList:[],id:"",type:"",goodsExchangeAddForm:{order_list:[{order_id:"1752156400898293761",order_item_list:[{batch_list:[{batch_id:0,batch_sn:"",out_num:0,remain_num:0,warehouse_entry_sn:""}],num:0,order_item_id:0,product_id:0,product_name:"string",product_sn:"string",product_specification:"string",product_unit:"string"}],order_sn:""}],type:""},goodsExchangeAddFormRule:{warehouse_id:[{required:!0,message:"请选择出库仓库",trigger:"change"}],type:[{required:!0,message:"请选择出库类型",trigger:"change"}]},warehouseProduct:null,scanDialogVisible:!1,scanGoodsForm:{},routeName:"",sttorageType:"",goodsVisible:!1,goodsData:[],goodsList:[],product_list:[]}},mounted:function(){this.routeName=this.$route.name,this.sttorageType=this.$route.params.type,this.GET_WarehouseList(),this.GET_DeptList()},watch:{$route:{immediate:!0,handler:function(e){"goodsExchangeEdit"===this.$route.name?this.type="edit":"goodsExchangeAudit"===this.$route.name?this.type="audit":"goodsExchangeReturn"===this.$route.name?this.type="return":"goodsExchangeAdd"===this.$route.name?(this.type="add",this.GET_WarehouseList({dept_id:this.user.dept_id}),this.$set(this.goodsExchangeAddForm,"change_time",(new Date).getTime())):"goodsExchangeDetail"===this.$route.name&&(this.type="detail"),this.$route.params.id&&(this.id=this.$route.params.id,this.GET_goodsExchangeAddDetail()),this.GET_AdministratorList()}}},computed:d()({},Object(c.b)(["user"])),methods:{handleSelectionChange:function(e){var t=this;this.goodsList=e.map(function(e){return e.product_id=e.id,e.goods_id=e.id,e.product_name=e.name,e.product_sn=e.sn,e.product_specification=e.goods_style,e.batch_list=t.goodsExchangeAddForm.order_list[0].order_item_list[0].batch_list,e})},submitGoosData:function(){this.goodsList.length>=1?(this.goodsExchangeAddForm.order_list[0].order_item_list=this.goodsList,this.product_list=this.goodsList,this.goodsVisible=!1):this.$message.error("请选择商品信息")},closeGoosData:function(){this.goodsVisible=!1},printIng:function(){},toSearch:function(){l.f({barcode:this.scanGoodsForm.bar_code}).then(function(e){console.log(e)})},scanCode:function(){var e=this;this.scanDialogVisible=!0,this.$nextTick(function(){e.$refs.input.focus()})},GET_AdministratorList:function(){var e=this;p.h({page_no:1,page_size:9999,user_state:0}).then(function(t){e.adminList=t.data})},cleanGoodsList:function(){this.goodsExchangeAddForm.order_list[0].order_item_list=[],this.product_list=[]},changewarehouseList:function(e){this.$set(this.goodsExchangeAddForm,"warehouse_id",""),this.GET_WarehouseList({dept_id:e}),this.cleanGoodsList()},handlePassGoodsExchange:function(){var e=this;!1===this.goodsExchangeAddForm.check_amount_same?this.$confirm(this.goodsExchangeAddForm.diff_amount_message,"提示",{type:"warning"}).then(function(){e.$confirm("确定通过吗?","提示",{type:"warning"}).then(function(){l.a(e.id,{status:"PASS"}).then(function(){e.$message.success("已通过!");var t=e.$route.params.callback;"function"==typeof t&&t(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"goodsExchange"})})}).catch(function(){})}).catch(function(){}):this.$confirm("确定通过吗?","提示",{type:"warning"}).then(function(){l.a(e.id,{status:"PASS"}).then(function(){e.$message.success("已通过!");var t=e.$route.params.callback;"function"==typeof t&&t(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"goodsExchange"})})}).catch(function(){})},handleRejectGoodsExchange:function(){var e=this;this.$confirm("确定拒绝吗?","提示",{type:"warning"}).then(function(){l.a(e.id,{status:"REJECT",reject_reason:e.goodsExchangeAddForm.reject_reason}).then(function(){e.$message.success("已拒绝!"),e.dialogVisible=!1;var t=e.$route.params.callback;"function"==typeof t&&t(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"goodsExchange"})})}).catch(function(){})},GET_WarehouseList:function(e){var t=this;u.C().then(function(e){t.warehouseList=e})},submitgoodsExchangeAddForm:function(){var e=this;this.$refs.goodsExchangeAddForm.validate(function(t){if(t){e.goodsExchangeAddForm.id;var o=e.MixinClone(e.goodsExchangeAddForm);if(o.warehouse_consignee_id=e.deptListAll.id,o.out_time=Date.parse(new Date),o.order_list[0].order_item_list[0].batch_list[0].out_num=e.product_list[0].num,o.staff_name=e.goodsExchangeAddForm.distribution_name,o.warehouse_id&&(o.warehouse_name=e.warehouseList.find(function(e){return e.id===o.warehouse_id}).name),o.handled_by_id&&(o.handled_by=e.adminList.find(function(e){return e.id===o.handled_by_id}).real_name),o.change_time=Math.floor(o.change_time/1e3),!o.order_list[0].order_item_list.length)return void e.$message.error("请选择商品!");"goodsExchangeEdit"===e.$route.name?l.n(o).then(function(t){e.$message.success("修改成功!");var o=e.$route.params.callback;"function"==typeof o&&o(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"goodsExchange"})}):"goodsExchangeAdd"===e.$route.name&&(console.log(o),l.n(o).then(function(){e.$message.success("添加成功!");var t=e.$route.params.callback;"function"==typeof t&&t(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"goodsExchange"})}))}})},returngoodsExchangeAddForm:function(){var e=this,t=this.goodsExchangeAddForm.id,o=this.MixinClone(this.goodsExchangeAddForm);param,o.staff_name=this.goodsExchangeAddForm.distribution_name,o.warehouse_name=this.warehouseList.find(function(e){return e.id===o.warehouse_id}).name,o.change_time=Math.floor(o.change_time/1e3),o.product_list=o.product_list.map(function(e){return e.product_sn=e.product_sn,e.product_name=e.product_name,e.specification=e.product_specification,e.product_id=e.product_id,e.unit=e.unit,e.stock_sn=e.sn,e.stock_num=e.remain_num,e.cost_price=e.product_cost_price,e}),l.k(t,o).then(function(){e.$message.success("换货成功!");var t=e.$route.params.callback;"function"==typeof t&&t(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"goodsExchange"})})},handleSelectWarehouseEntryBatch:function(){var e=this;return i()(a.a.mark(function t(){return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:l.f().then(function(t){e.goodsData=t.data,e.goodsVisible=!0});case 1:case"end":return t.stop()}},t,e)}))()},handleSelectOrderSn:function(){var e=this;return i()(a.a.mark(function t(){var o,n;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$EnPickerOrder({orderApi:"admin/erp/order",selectedIds:[e.goodsExchangeAddForm.order_sn],limit:1});case 2:o=t.sent,e.$set(e.goodsExchangeAddForm,"distribution_name",o[0].distribution_name),n=o.map(function(e){return e.sn}),e.$set(e.goodsExchangeAddForm,"order_sn",n.join(",")),e.GET_WarehouseOutProduct();case 7:case"end":return t.stop()}},t,e)}))()},GET_WarehouseOutProduct:function(){var e=this;return i()(a.a.mark(function t(){var o;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,m.a({order_sn:e.goodsExchangeAddForm.order_sn});case 2:o=t.sent,e.goodsExchangeAddForm.return_list=o.data.map(function(e){return e.amount=e.product_price,e.product_sn=e.product_sn,e.product_name=e.product_name,e.specification=e.product_specification,e.product_id=e.product_id,e.unit=e.product_unit,e.num=e.return_num,e.stock_sn=e.warehouse_entry_sn,e.cost_price=e.product_cost_price,e});case 4:case"end":return t.stop()}},t,e)}))()},GET_DeptList:function(){var e=this;l.h().then(function(t){e.deptListAll=t,e.deptListAll.password=""})},handleChangeWareHouse:function(e){},GET_goodsExchangeAddDetail:function(){var e=this;this.$nextTick(function(){l.e(e.id).then(function(t){e.goodsExchangeAddForm=t,e.GET_WarehouseList({dept_id:t.dept_id}),e.goodsExchangeAddForm.change_time=Math.floor(1e3*e.goodsExchangeAddForm.change_time),e.goodsExchangeAddForm.distribution_name=t.staff_name,e.product_list=t.product_list.map(function(e){return e.entry_price=e.amount,e.product_specification=e.specification,e.product_unit=e.unit,e.warehouse_entry_sn=e.stock_sn,e}),e.goodsExchangeAddForm.return_list=t.return_list.map(function(e){return e.product_price=e.amount,e.product_specification=e.specification,e.product_unit=e.unit,e.return_num=e.num,e.warehouse_entry_sn=e.stock_sn,e})})})}}},_=o("XyMi");var g=function(e){o("4rzw")},f=Object(_.a)(h,function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"bg-in-stock"},[o("el-form",{ref:"goodsExchangeAddForm",staticClass:"change-form",attrs:{model:e.goodsExchangeAddForm,rules:e.goodsExchangeAddFormRule,"label-width":"160px",inline:""}},[o("el-form-item",{staticClass:"change-form-item",attrs:{prop:"warehouse_id",label:"出库仓库"}},[o("el-select",{attrs:{disabled:"detail"===e.type||"audit"===e.type},model:{value:e.goodsExchangeAddForm.warehouse_id,callback:function(t){e.$set(e.goodsExchangeAddForm,"warehouse_id",t)},expression:"goodsExchangeAddForm.warehouse_id"}},e._l(e.warehouseList,function(e){return o("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),o("el-form-item",{staticClass:"change-form-item",attrs:{label:"类型",prop:"type"}},[o("el-select",{attrs:{filterable:"","allow-create":"",clearable:"","default-first-option":"",disabled:"detail"===e.type||"audit"===e.type},model:{value:e.goodsExchangeAddForm.type,callback:function(t){e.$set(e.goodsExchangeAddForm,"type",t)},expression:"goodsExchangeAddForm.type"}},e._l(e.typeList,function(e){return o("el-option",{key:e.id,attrs:{label:e.real_name,value:e.id}})}),1)],1),e._v(" "),o("el-form-item",{staticClass:"change-form-item",attrs:{label:"订单",prop:"order_sn"}},[o("el-input",{ref:"order",attrs:{disabled:"detail"===e.type||"audit"===e.type},model:{value:e.goodsExchangeAddForm.order_list[0].order_sn,callback:function(t){e.$set(e.goodsExchangeAddForm.order_list[0],"order_sn",t)},expression:"goodsExchangeAddForm.order_list[0].order_sn"}})],1),e._v(" "),o("el-form-item",{staticClass:"change-form-item",staticStyle:{width:"61%"},attrs:{label:"备注",prop:"change_desc"}},[o("el-input",{staticStyle:{flex:"1"},attrs:{type:"textarea",disabled:"detail"===e.type||"audit"===e.type,maxlength:"250",autosize:{minRows:3,maxRows:4},placeholder:"请输入"},model:{value:e.goodsExchangeAddForm.change_desc,callback:function(t){e.$set(e.goodsExchangeAddForm,"change_desc",t)},expression:"goodsExchangeAddForm.change_desc"}})],1),e._v(" "),o("div",{staticClass:"mx"},[o("h3",[e._v("商品明细")]),e._v(" "),"detail"!==e.type&&"audit"!==e.type?o("el-button",{staticClass:"button",attrs:{size:"mini",type:"primary"},on:{click:e.scanCode}},[e._v("扫码出库")]):e._e(),e._v(" "),"detail"!==e.type&&"audit"!==e.type?o("el-button",{staticClass:"button",attrs:{size:"mini",type:"primary"},on:{click:e.handleSelectWarehouseEntryBatch}},[e._v("选择")]):e._e()],1),e._v(" "),o("div",{staticStyle:{width:"100%",display:"block"}},[o("el-form-item",{staticStyle:{width:"100%"}},[o("el-table",{staticStyle:{width:"100%","margin-top":"20px"},attrs:{data:e.product_list,border:"","cell-style":{textAlign:"center"},"header-cell-style":{textAlign:"center"}}},[o("el-table-column",{attrs:{label:"商品编号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.sn)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"商品名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.name)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"条码"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.product_barcode)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"序列号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.sn_code)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"规格型号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.specification)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"单位"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.unit)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"订单数量"}}),e._v(" "),o("el-table-column",{attrs:{label:"出库数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-input",{attrs:{type:"number",min:0,maxlength:20,disabled:"detail"===e.type||"audit"===e.type},model:{value:t.row.num,callback:function(o){e.$set(t.row,"num",o)},expression:"scope.row.num"}})]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"库存数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.already_num)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"差异"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.num-t.row.already_num||0)+"\n ")]}}])}),e._v(" "),"detail"!==e.type&&"audit"!==e.type?o("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(o){return e.product_list.splice(t.$index,1)}}},[e._v("删除")])]}}],null,!1,3652951734)}):e._e()],1)],1)],1)],1),e._v(" "),o("div",{staticClass:"footer"},["audit"!==e.type&&"detail"!==e.type?o("el-button",{attrs:{type:"primary"},on:{click:e.submitgoodsExchangeAddForm}},[e._v("保存\n ")]):e._e(),e._v(" "),"audit"==e.type?o("el-button",{on:{click:e.printIng}},[e._v("打印")]):e._e(),e._v(" "),o("el-button",{on:{click:function(t){return e.$router.back()}}},[e._v("返回")])],1),e._v(" "),o("el-dialog",{attrs:{title:"提示",visible:e.dialogVisible,width:"30%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[o("el-form",{ref:"goodsExchangeAddForm",staticStyle:{width:"900px"},attrs:{model:e.goodsExchangeAddForm,"label-width":"120px",inline:""}},[o("el-form-item",{attrs:{label:"驳回原因",prop:"reject_reason"}},[o("el-input",{attrs:{type:"textarea",minlength:0,maxlength:100},model:{value:e.goodsExchangeAddForm.reject_reason,callback:function(t){e.$set(e.goodsExchangeAddForm,"reject_reason",t)},expression:"goodsExchangeAddForm.reject_reason"}})],1)],1),e._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),e._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.handleRejectGoodsExchange()}}},[e._v("确 定")])],1)],1),e._v(" "),o("el-dialog",{attrs:{title:"扫码出库",visible:e.scanDialogVisible,width:"30%"},on:{"update:visible":function(t){e.scanDialogVisible=t}}},[o("el-form",{ref:"scanGoodsForm",attrs:{model:e.scanGoodsForm,"label-width":"120px",inline:""}},[o("el-form-item",{attrs:{label:"条码",prop:"bar_code"}},[o("el-input",{ref:"input",attrs:{minlength:0,maxlength:100},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.toSearch()}},model:{value:e.scanGoodsForm.bar_code,callback:function(t){e.$set(e.scanGoodsForm,"bar_code",t)},expression:"scanGoodsForm.bar_code"}})],1),e._v(" "),o("el-form-item",{attrs:{label:"序列号",prop:"sn_code"}},[o("el-input",{attrs:{minlength:0,maxlength:100},model:{value:e.scanGoodsForm.sn_code,callback:function(t){e.$set(e.scanGoodsForm,"sn_code",t)},expression:"scanGoodsForm.sn_code"}})],1)],1),e._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"})],1),e._v(" "),o("el-dialog",{attrs:{title:"出库商品",visible:e.goodsVisible,width:"1000px"},on:{"update:visible":function(t){e.goodsVisible=t},close:e.closeGoosData}},[o("el-table",{staticStyle:{width:"100%"},attrs:{data:e.goodsData,border:""},on:{"selection-change":e.handleSelectionChange}},[o("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),o("el-table-column",{attrs:{prop:"sn",label:"商品编号"}}),e._v(" "),o("el-table-column",{attrs:{prop:"bar_code",label:"商品条码"}}),e._v(" "),o("el-table-column",{attrs:{prop:"sn_code",label:"序列号"}}),e._v(" "),o("el-table-column",{attrs:{prop:"name",label:"商品名称"}}),e._v(" "),o("el-table-column",{attrs:{prop:"goods_style",label:"规格型号"}}),e._v(" "),o("el-table-column",{attrs:{prop:"goods_unit",label:"单位"}}),e._v(" "),o("el-table-column",{attrs:{prop:"product_list.stock_num",label:"库存数量"}})],1),e._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:e.closeGoosData}},[e._v("取 消")]),e._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitGoosData()}}},[e._v("确 定")])],1)],1)],1)},[],!1,g,"data-v-3ccd10c6",null);t.default=f.exports},"4rzw":function(e,t,o){var n=o("RI4h");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);o("rjj0")("4d6ed17b",n,!0)},RI4h:function(e,t,o){(e.exports=o("FZ+f")(!1)).push([e.i,'\n@charset "UTF-8";\n/** 底部步骤 */\n.footer[data-v-3ccd10c6] {\n width: 100%;\n padding: 10px;\n bottom: 0px;\n text-align: center;\n z-index: 999;\n}\n.mx[data-v-3ccd10c6] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n width: 100%;\n}\n.mx .button[data-v-3ccd10c6] {\n margin-left: 10px;\n}\n.change-form[data-v-3ccd10c6] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: start;\n -ms-flex-pack: start;\n justify-content: flex-start;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n min-width: 900px;\n}\n.change-form .change-form-item[data-v-3ccd10c6] {\n width: 30%;\n margin: 0 10px 20px 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n}\n.change-form[data-v-3ccd10c6] .el-form-item__content {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n width: 100%;\n}\n.change-form[data-v-3ccd10c6] .el-date-editor,\n .change-form[data-v-3ccd10c6] .el-cascader,\n .change-form[data-v-3ccd10c6] .el-select {\n width: 100%;\n}\n.bg-in-stock[data-v-3ccd10c6] {\n background-color: #fff;\n margin: 10px;\n padding: 25px;\n}\n.goods-info[data-v-3ccd10c6] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.goods-info .goods-name-box[data-v-3ccd10c6] {\n text-align: left;\n}\n.goods-info .goods-name-box .goods-name[data-v-3ccd10c6] {\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n line-height: 16px;\n}\n.goods-info .goods-name-box .specs[data-v-3ccd10c6] {\n color: #999999;\n}\n[data-v-3ccd10c6] .el-input--suffix .el-input__inner {\n padding-right: 10px;\n}\n[data-v-3ccd10c6] .error-input .el-input__inner {\n border: 1px solid red;\n}\n',""])}});
|