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"),r=o.n(s),i=o("Dd8w"),d=o.n(i),c=o("NYxO"),l=(o("jQQ7"),o("dO7o")),u=o("hky6"),m=o("dClm"),p=o("CIZm"),h=o("Pfph"),_={name:"goodsExchangeAdd",data:function(){return{typeList:[],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:""}],product_list:[],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(),this.outType()},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:{outType:function(){var e=this;u.v({dictType:"out_warehouse_type"}).then(function(t){e.typeList=t.data.filter(function(e){if("SALE_OUT"!==e.value&&"HAIL_OUT"!==e.value)return e})})},printIng:function(){},toSearch:function(){l.g({barcode:this.scanGoodsForm.bar_code}).then(function(e){})},scanCode:function(){var e=this;this.scanDialogVisible=!0,this.$nextTick(function(){e.$refs.input.focus()})},GET_AdministratorList:function(){var e=this;h.h({page_no:1,page_size:9999,user_state:0}).then(function(t){e.adminList=t.data})},GET_WarehouseList:function(e){var t=this;m.D().then(function(e){t.warehouseList=e})},saveGoodsExchangeAddForm:function(){var e=this;this.$refs.goodsExchangeAddForm.validate(function(t){if(t){var o=e.goodsExchangeAddForm.id,n=e.MixinClone(e.goodsExchangeAddForm);if(n.save_or_submit="save",n.warehouse_consignee_id=e.deptListAll.id,n.out_time=Date.parse(new Date),n.staff_name=e.goodsExchangeAddForm.distribution_name,n.warehouse_id&&(n.warehouse_name=e.warehouseList.find(function(e){return e.id===n.warehouse_id}).name),n.handled_by_id&&(n.handled_by=e.adminList.find(function(e){return e.id===n.handled_by_id}).real_name),n.change_time=Math.floor(n.change_time/1e3),!e.goodsExchangeAddForm.product_list.length)return;n.product_list.map(function(t){t.out_num