webpackJsonp([55],{NfA0:function(t,e,i){"use strict";var a=i("S8x/"),o=(i("TExn"),i("bzuE")),s={name:"",props:{printDetail:{type:Object,default:{}},printList:{type:Array,default:[]},printForm:{type:Array,default:[]},printTotal:{type:Object,default:{}},printDirection:{type:Boolean,default:!0}},data:function(){return{pageHeight:"",pageWidth:"",config:o.a}},component:{},mounted:function(){this.printDirection?(this.pageHeight=this.config.printHeightDirection0,this.pageWidth=this.config.printWidthDirection0):(this.pageHeight=this.config.printHeightDirection1,this.pageWidth=this.config.printWidthDirection1)},watch:{printList:{handler:function(t,e){Object(a.a)(t,this.printForm,this.printTotal,this.printDirection)},deep:!0}}},l={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"print_content",style:{width:t.pageWidth+"px"}},[i("div",{staticClass:"print_top"},[i("div",{staticClass:"head_out"},[i("h1",{staticStyle:{"text-align":"center"}},[t._v("库存调拨单")]),t._v(" "),t.printDetail?i("div",{staticClass:"head2"},[i("div",{staticClass:"head2_item"},[t._v("调拨日期:"+t._s(t.printDetail.allotTime))]),t._v(" "),i("div",{staticClass:"head2_item"},[t._v("单据编号:"+t._s(t.printDetail.allotCode))])]):t._e()]),t._v(" "),i("div",{staticClass:"table_content"})]),t._v(" "),i("div",{staticClass:"footer_out"},[i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:5}},[t._v("制单人:"+t._s(t.printDetail.createByName))]),t._v(" "),i("el-col",{attrs:{span:7}},[t._v("制单时间:"+t._s(t.printDetail.createTimePrint))]),t._v(" "),i("el-col",{attrs:{span:5}},[t._v("审核人:"+t._s(t.printDetail.auditorName))]),t._v(" "),i("el-col",{attrs:{span:7}},[t._v("审核时间:"+t._s(t.printDetail.auditTimePrint))])],1)],1)])},staticRenderFns:[]},n=i("VU/8")(s,l,!1,null,null,null);e.a=n.exports},as5C:function(t,e){},jUVs:function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify__=__webpack_require__("mvHQ"),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify__),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__=__webpack_require__("Dd8w"),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__),__WEBPACK_IMPORTED_MODULE_2__components_System_dialogChooseSingleLocation__=__webpack_require__("tiiE"),__WEBPACK_IMPORTED_MODULE_3__components_btnInput_vue__=__webpack_require__("ysqt"),__WEBPACK_IMPORTED_MODULE_4__warehouse_allot_printAllot_vue__=__webpack_require__("NfA0"),__WEBPACK_IMPORTED_MODULE_5_vuex__=__webpack_require__("NYxO"),__WEBPACK_IMPORTED_MODULE_6__components_System_dialogChooseSingleUser__=__webpack_require__("3MlD"),__WEBPACK_IMPORTED_MODULE_7__components_Dialog_dialogChooseSingleStock__=__webpack_require__("rfXi"),__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseParts_vue__=__webpack_require__("CdUU"),__WEBPACK_IMPORTED_MODULE_9__utils_config_js__=__webpack_require__("bzuE"),__WEBPACK_IMPORTED_MODULE_10__utils_tools__=__webpack_require__("GKmE");__webpack_exports__.a={inject:["reload"],components:{btnInput:__WEBPACK_IMPORTED_MODULE_3__components_btnInput_vue__.a,printAllot:__WEBPACK_IMPORTED_MODULE_4__warehouse_allot_printAllot_vue__.a,dialogChooseParts:__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseParts_vue__.a,DialogChooseSingleUser:__WEBPACK_IMPORTED_MODULE_6__components_System_dialogChooseSingleUser__.a,dialogChooseSingleStock:__WEBPACK_IMPORTED_MODULE_7__components_Dialog_dialogChooseSingleStock__.a,dialogChooseSingleLocation:__WEBPACK_IMPORTED_MODULE_2__components_System_dialogChooseSingleLocation__.a},data:function(){return{formData:{allotTime:"",allotUserName:"",allotUser:""},auditStatus:"",config:__WEBPACK_IMPORTED_MODULE_9__utils_config_js__.a,btnDisabled:!0,itemIds:[],fac_type_list:[],fac_location_list:[],warehouseRow:"",allotId:"",availableCount:0,totalCount:0,model:{rules:{sellUnitPrice:{required:!0,message:"单价必填",trigger:"change"},count:{required:!0,message:"入库数量必填",trigger:"change"},inFacility:{required:!0,message:"仓库必填",trigger:"change"}},childList:[]},ChooseLocationVisible:!1,btnOtherDisabled:!0,btnDelDisabled:!1,chooseOperatorVisible:!1,ChooseMaterielVisible:!1,chooseClientrVisible:!1,ChooseStockVisible:!1,ChooseConsumingStockVisible:!1,chooseUserVisible:!1,loading:!1,isDisabled:!1,materielId:"",currentIndex:"",ruleForm:{allotTime:[{required:!0,message:"请选择调拨时间",trigger:"change"}],allotUserName:[{required:!0,message:"请选择调拨人",trigger:"change"}]},printTotal:{count:"",amount:""},printList:[],printDetail:{allotTime:"",allotCode:""},printForm:[{title:"物料代码",prop_:"materielSerialNo"},{title:"物料名称",prop_:"materielName"},{title:"规格型号",prop_:"specification"},{title:"辅助单位",prop_:"supportUomName"},{title:"批号",prop_:"batch"},{title:"调拨数量(辅助单位)",prop_:"subQuoteCount"},{title:"调出仓库",prop_:"outFacilityName"},{title:"调出库位",prop_:"outLocationName"},{title:"调入仓库",prop_:"inFacilityName"},{title:"调入库位",prop_:"inLocationName"}]}},mounted:function(){if(this.initialize(),this.$route.query.id)this.formData.id=this.$route.query.id,this.allotId=this.$route.query.id;else{var t=new Date;this.$set(this.formData,"allotTime",t.getFullYear()+"-"+this.settime(t.getMonth()+1)+"-"+this.settime(t.getDate()))}this.allotId&&this.getDetail()},watch:{allotId:{handler:function(t,e){this.btnDelDisabled=""!=t&&void 0!=t}},model:{handler:function(t,e){var i=this;t.childList.forEach(function(t){void 0!=t.inFacility&&""!=t.inFacility||(i.$set(t,"inLocationName",""),i.$set(t,"inLocation",""))})},deep:!0}},methods:__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_5_vuex__.d)({removeTagNav:"tagNav/removeTagNav"}),{settime:function(t){return 1==t.toString().length?"0"+t.toString():t},initialize:function(){var t=this;this.$api.gylInventoryAPI.facilityList({pageno:1,pagesize:1e3,auditSign:179}).then(function(e){t.fac_type_list=e.data.datas?e.data.datas:""}).catch(function(t){console.log(t)}),this.$api.gylInventoryAPI.facilityLocationList({pageno:1,pagesize:1e3}).then(function(e){t.fac_location_list=e.data.datas?e.data.datas:""}).catch(function(t){console.log(t)})},getDetail:function(){var t=this,e=this;this.loading=!0,this.$nextTick().then(function(){t.$api.allotAPI.getDetail({id:t.allotId}).then(function(i){t.loading=!1,e.$set(e.formData,"auditStatus",i.allot.auditSign?i.allot.auditSign:""),e.auditStatus=t.formData.auditStatus,e.$set(e.formData,"allotUserName",i.allot.allotUserName?i.allot.allotUserName:""),e.$set(e.formData,"allotUser",i.allot.allotUser?i.allot.allotUser:""),e.$set(e.formData,"allotTime",i.allot.allotTime?i.allot.allotTime:""),e.$set(e.formData,"remarks",i.allot.remark?i.allot.remark:""),e.$set(e.formData,"deptId",i.allot.deptId?i.allot.deptId:""),e.$set(e.formData,"deptName",i.allot.deptName?i.allot.deptName:""),e.$set(e.formData,"reason",i.allot.reason?i.allot.reason:""),e.$set(e.formData,"createUserName",i.allot.createUserName?i.allot.createUserName:""),e.$set(e.formData,"createTime",i.allot.createTime?i.allot.createTime:""),e.$set(e.formData,"auditTime",i.allot.auditTime?i.allot.auditTime:""),e.$set(e.formData,"auditorName",i.allot.auditorName?i.allot.auditorName:""),e.model.childList=i.item,e.model.childList.forEach(function(i){e.$set(i,"btnName","已查询"),t.$set(i,"onlyId",i.materielId+"_"+Math.random()),i.materielSerialNo=i.materielSerialno?i.materielSerialno:"",i.availableCount=i.availableCount?i.availableCount:"",i.unitUomName=i.unitName?i.unitName:"",i.sellUnitPrice=i.price?i.price:0,i.newId=i.itemId?i.itemId:"",i.stockId=i.stockId?i.stockId:"",i.inFacility=i.inFacility?i.inFacility:"",e.$set(i,"inFacility",i.inFacility),e.$set(i,"inLocation",i.inLocation?i.inLocation:""),e.$set(i,"inLocationName",i.inLocationName?i.inLocationName:""),i.inLocation=i.inLocation?i.inLocation:"",i.inLocationName=i.inLocationName?i.inLocationName:"",i.inFacility=i.inFacility?i.inFacility:"",i.inLocation=i.inLocation?i.inLocation:""}),t.printDetail.createByName=t.formData.createUserName,t.printDetail.createTimePrint=Object(__WEBPACK_IMPORTED_MODULE_10__utils_tools__.i)(t.formData.createTime,"{y}-{m}-{d}"),t.printDetail.auditorName=t.formData.auditorName,t.printDetail.auditTimePrint=t.formData.auditTime?Object(__WEBPACK_IMPORTED_MODULE_10__utils_tools__.i)(t.formData.auditTime,"{y}-{m}-{d}"):"",t.printDetail.allotTime=/\d{4}-\d{1,2}-\d{1,2}/g.exec(i.allot.allotTime)[0],t.printDetail.allotCode=i.allot.allotCode,t.printList=JSON.parse(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(t.model.childList))})})},clear:function(){this.$route.query.id&&(this.formData.id=void 0,this.allotId=void 0),this.auditStatus="",this.model.childList=[],this.formData={},this.itemIds=[],this.$refs.form.resetFields();var t=new Date;this.$set(this.formData,"allotTime",t.getFullYear()+"-"+this.settime(t.getMonth()+1)+"-"+this.settime(t.getDate()))},changeWarehouse:function(t){this.$set(t,"inLocationName","选择仓位"),this.$set(t,"inLocation","")},chooseLocation:function(t){console.log(t),this.warehouseRow=t,this.ChooseLocationVisible=!0},getLocation:function(t){console.log(t),t?(this.$set(this.warehouseRow,"inLocation",t.id),this.$set(this.warehouseRow,"inLocationName",t.name)):(this.$set(this.warehouseRow,"inLocation",""),this.$set(this.warehouseRow,"inLocationName",""))},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/warehouse/allot",query:{t:Date.now()}}),this.clear()},save:function(t){var e=this;this.$refs[t].validate(function(t){if(t){if(0==e.model.childList.length)return void e.$message({message:"请选择物料",type:"warning"});var i=void 0;if(e.$refs.formChild.validate(function(t,e){i=t}),!i)return void e.$message({message:"有必填项未填写",type:"warning"});var a=!0,o=!0;if(e.model.childList.forEach(function(t){t.stockId||(a=!1),t.facilityId==t.inFacility&&t.facilityLocationId==t.inLocation&&(o=!1)}),!a)return void e.$message({message:"请查询库存",type:"warning"});if(!o)return void e.$message.error("请选择不同库存或库位!");var s=!0;if(e.model.childList.forEach(function(t){t.subQuoteCount<=0&&(s=!1)}),!s)return void e.$message({message:"领用数量必须大于0",type:"warning"});var l=!0;if(e.model.childList.forEach(function(t){t.count>t.availableCount&&(l=!1)}),l)if(e.formData.id){var n=[];if(e.model.childList.forEach(function(t){var i={id:t.newId,stockId:t.stockId,count:t.count.toFixed(t.quantityAccuracy),supportUom:t.supportUom,convCoefficient:t.convCoefficient,subCount:t.subQuoteCount?t.subQuoteCount.toFixed(t.quantityAccuracy):0,price:t.sellUnitPrice.toFixed(t.priceAccuracy)};t.inFacility&&(i.inFacility=t.inFacility),t.inLocation&&(i.inLocation=t.inLocation),n.push(i),e.formData.item=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(n)}),e.isDisabled)return;e.isDisabled=!0,e.$api.allotAPI.edit({id:e.formData.id,allotTime:e.formData.allotTime,allotUser:e.formData.allotUser,remark:e.formData.remarks,body:e.formData.item,itemIds:e.itemIds,deptId:e.formData.deptId?e.formData.deptId:"",reason:e.formData.reason?e.formData.reason:""}).then(function(t){e.isDisabled=!1,0===t.code?e.$message({message:t.msg,type:"success"}):e.$message({message:t.msg,type:"error"})})}else{var r=[];if(e.model.childList.forEach(function(t){console.log(t);var i={stockId:t.stockId,count:t.count.toFixed(t.quantityAccuracy),supportUom:t.supportUom,convCoefficient:t.convCoefficient,subCount:t.subQuoteCount?t.subQuoteCount.toFixed(t.quantityAccuracy):0,price:t.sellUnitPrice.toFixed(t.priceAccuracy)};t.inFacility&&(i.inFacility=t.inFacility),t.inLocation&&(i.inLocation=t.inLocation),r.push(i),e.formData.item=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(r)}),e.isDisabled)return;e.isDisabled=!0,e.$api.allotAPI.add({allotUser:e.formData.allotUser,allotTime:e.formData.allotTime,remark:e.formData.remarks,body:e.formData.item,itemIds:e.itemIds,deptId:e.formData.deptId?e.formData.deptId:"",reason:e.formData.reason?e.formData.reason:""}).then(function(t){e.isDisabled=!1,0===t.code?(e.$message({message:t.msg,type:"success"}),e.allotId=t.id,window.location.href=e.changeURLArg("id",t.id)):e.$message({message:t.msg,type:"error"})})}else e.$message({message:"调拨数量不能大于库存数量",type:"warning"})}})},changeURLArg:function changeURLArg(arg,arg_val){var url=window.location.href,pattern=arg+"=([^&]*)",replaceText=arg+"="+arg_val;if(url.match(pattern)){var tmp="/("+arg+"=)([^&]*)/gi";return tmp=url.replace(eval(tmp),replaceText),tmp}return url.match("[?]")?url+"&"+replaceText:url+"?"+replaceText},sum1:function(t,e,i){var a=t*e?t*e:0;return this.sellAmount=a,a=a.toFixed(__WEBPACK_IMPORTED_MODULE_9__utils_config_js__.a.amountFixedTo),this.$set(this.model.childList[i],"sellAmount",a),a},audit:function(){var t=this,e=this.formData.id;this.$confirm("确认审核吗?","提示",{type:"warning"}).then(function(){t.$api.allotAPI.audit({id:e}).then(function(e){0===e.code?(t.$message({message:e.msg,type:"success"}),t.getDetail()):t.$message({message:e.msg,type:"error"})})})},disAudit:function(){var t=this,e=this.formData.id;this.$confirm("确认反审核吗?","提示",{type:"warning"}).then(function(){t.$api.allotAPI.reverseAudit({id:e}).then(function(e){0===e.code?(t.$message({message:e.msg,type:"success"}),t.getDetail()):t.$message({message:e.msg,type:"error"})})})},getUser:function(t){t&&(this.formData.allotUserName=t.name,this.formData.allotUser=t.id,this.formData.deptName=t.deptName,this.formData.deptId=t.deptId)},getOperator:function(t){t&&(this.formData.operatorName=t.name,this.formData.operator=t.id)},getMateriel:function(t){var e=this;console.log(t),t&&t.forEach(function(t){e.$set(t,"btnName","查询"),e.$set(t,"subQuoteCount",0),e.$set(t,"count",0),delete t.convCoefficient,delete t.supportUomName,delete t.supportUom,e.$set(t,"sellUnitPrice",t.salePrice?t.salePrice:0),e.$set(t,"materielSerialNo",t.serialNo?t.serialNo:""),e.$set(t,"materielName",t.name?t.name:""),e.$set(t,"materielId",t.id),e.$set(t,"onlyId",t.id+"_"+Date.now()),e.model.childList.push(t)})},removePart:function(){var t=this;if(this.chooseParts){var e=[];this.chooseParts.forEach(function(i){console.log(i),e.push(i.itemId);var a=t.model.childList.findIndex(function(t){if(t.onlyId==i.onlyId&&t.id==i.id)return!0});t.model.childList.splice(a,1),t.itemIds=e})}},handlePartChange:function(t){this.chooseParts=t,console.log(this.chooseParts),this.setBtn(t)},setBtn:function(t){var e=!0,i=!0;t.length>0?(i=!1,1==t.length&&(e=!1)):(e=!0,i=!0),this.btnDelDisabled=i,this.btnOtherDisabled=e},print:function(){document.getElementById("print_content").style.display="block",this.printList=JSON.parse(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(this.printList)),this.$nextTick(function(){var t=document.getElementById("print_content").innerHTML;return document.body.innerHTML="打印"+t+"",window.print(),window.location.reload(),!1})},getSummaries:function(t){for(var e=t.columns,i=t.data,a=0,o=0;o1)for(var n=0;n