webpackJsonp([40],{"+Lum":function(t,e){},Htpf: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_core_js_object_assign__=__webpack_require__("woOf"),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_assign___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_assign__),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends__=__webpack_require__("Dd8w"),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends__),__WEBPACK_IMPORTED_MODULE_3__utils_tools_js__=__webpack_require__("GKmE"),__WEBPACK_IMPORTED_MODULE_4__components_btnInput_vue__=__webpack_require__("ysqt"),__WEBPACK_IMPORTED_MODULE_5_vuex__=__webpack_require__("NYxO"),__WEBPACK_IMPORTED_MODULE_6__components_System_dialogChooseSingleUser__=__webpack_require__("3MlD"),__WEBPACK_IMPORTED_MODULE_7__components_System_dialogChooseSingleSuppliers__=__webpack_require__("FnMF"),__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseSingleLocation__=__webpack_require__("tiiE"),__WEBPACK_IMPORTED_MODULE_9__components_System_dialogChooseParts_vue__=__webpack_require__("CdUU"),__WEBPACK_IMPORTED_MODULE_10__outStock_printOutsourcingOutstock_vue__=__webpack_require__("mdE1"),__WEBPACK_IMPORTED_MODULE_11__outStock_dialogImportFeedingOutstock__=__webpack_require__("b2rX"),__WEBPACK_IMPORTED_MODULE_12__components_Dialog_dialogChooseSingleStock__=__webpack_require__("rfXi"),__WEBPACK_IMPORTED_MODULE_13__utils_config_js__=__webpack_require__("bzuE"),__WEBPACK_IMPORTED_MODULE_14_js_cookie__=__webpack_require__("lbHh"),__WEBPACK_IMPORTED_MODULE_14_js_cookie___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14_js_cookie__);__webpack_exports__.a={inject:["reload"],components:{btnInput:__WEBPACK_IMPORTED_MODULE_4__components_btnInput_vue__.a,dialogChooseSingleLocation:__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseSingleLocation__.a,dialogChooseParts:__WEBPACK_IMPORTED_MODULE_9__components_System_dialogChooseParts_vue__.a,dialogChooseSingleUser:__WEBPACK_IMPORTED_MODULE_6__components_System_dialogChooseSingleUser__.a,dialogChooseSingleSupplier:__WEBPACK_IMPORTED_MODULE_7__components_System_dialogChooseSingleSuppliers__.a,printOutsourcingOutstock:__WEBPACK_IMPORTED_MODULE_10__outStock_printOutsourcingOutstock_vue__.a,dialogImportFeedingOutstock:__WEBPACK_IMPORTED_MODULE_11__outStock_dialogImportFeedingOutstock__.a,dialogChooseSingleStock:__WEBPACK_IMPORTED_MODULE_12__components_Dialog_dialogChooseSingleStock__.a},data:function(){return{printDirection:1,printTypeList:[],userInfo:"",config:__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a,editId:"",auditStatus:"",initiate_auditStatus:"",itemIds:[],formData:{outTime:Object(__WEBPACK_IMPORTED_MODULE_3__utils_tools_js__.c)(),supplierName:"",supplierId:""},fac_type_list:[],fac_location_list:[],warehouseRow:"",ChooseImport:!1,ruleForm:{supplierName:[{required:!0,message:"请选择供应商",trigger:"change"}],outTime:[{required:!0,message:"请选择发料时间",trigger:"change"}],operatorName:[{required:!0,message:"请选择发料人",trigger:"change"}]},model:{rules:{count:[{required:!0,message:"请填写数量",trigger:"change"}]},childList:[]},ChooseMaterielVisible:!1,chooseUserVisible:!1,ChooseStockVisible:!1,chooseSupplierVisible:!1,ChooseLocationVisible:!1,btnDelDisabled:!0,isDisabled:!1,btnOtherDisabled:!0,materielId:"",currentIndex:"",headDetail:{},printTotal:{count:"",amount:""},printList:[],printDetail:{supplierName:"",outTime:"",outCode:"",createUserName:"",createTime:"",auditorName:"",auditTime:""},printForm:[{title:"物料代码",prop_:"serialNo"},{title:"物料名称",prop_:"materielName"},{title:"规格型号",prop_:"specification"},{title:"单位",prop_:"unitName"},{title:"批号",prop_:"batch"},{title:"数量",prop_:"count"},{title:"单价",prop_:"unitPrice"},{title:"金额",prop_:"amount"},{title:"仓库",prop_:"facilityName"},{title:"仓位",prop_:"facilityLocationName"}]}},computed:__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_5_vuex__.c)({})),mounted:function(){this.userInfo=JSON.parse(__WEBPACK_IMPORTED_MODULE_14_js_cookie___default.a.get("userInfo")),this.editId=this.$route.query.id,console.log(this.userInfo),this.editId?this.getDetail():(this.$set(this.formData,"operatorName",this.userInfo.name),this.$set(this.formData,"operator",this.userInfo.userId),this.$set(this.formData,"deptName",this.userInfo.deptName),this.$set(this.formData,"deptId",this.userInfo.deptId)),this.getPrintTypeList(),this.initialize()},methods:__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_5_vuex__.d)({removeTagNav:"tagNav/removeTagNav"}),{getPrintTypeList:function(){var t=this;this.$api.dictAPI.getDictsByType("print_type").then(function(e){0===e.code&&(t.printTypeList=e.datas)}).catch(function(t){})},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/outsourcing/outsourcing_outstock_index",query:{t:Date.now()}})},initialize:function(){},openDetails:function(t){this.ChooseStockVisible=!0,this.materielId=t.row.materielId,this.currentIndex=t.$index},ChooseImportShow:function(){this.formData.supplierId?this.ChooseImport=!0:this.$message({message:"请先选择供应商",type:"warning"})},chooseLocation:function(t){this.warehouseRow=t,this.ChooseLocationVisible=!0},changeWarehouse:function(t){this.$set(t,"warehLocationName","选择仓位"),this.$set(t,"warehLocation","")},getStock:function(t){t&&(this.$set(this.model.childList[this.currentIndex],"stockId",t.id),this.$set(this.model.childList[this.currentIndex],"btnName","已选择"),this.$set(this.model.childList[this.currentIndex],"maxCount",t.availableCount),this.$set(this.model.childList[this.currentIndex],"convCoefficient",t.convCoefficient),this.$set(this.model.childList[this.currentIndex],"supportUomName",t.supportUomName),this.$set(this.model.childList[this.currentIndex],"supportUom",t.supportUom),t.batch&&this.$set(this.model.childList[this.currentIndex],"batch",t.batch),this.$set(this.model.childList[this.currentIndex],"facilityName",t.facilityName),this.$set(this.model.childList[this.currentIndex],"facilityLocationName",t.facilityLocationName),this.changeCount2(this.model.childList[this.currentIndex]))},getUser:function(t){t?(this.$set(this.formData,"operatorName",t.name),this.$set(this.formData,"operator",t.id),this.$set(this.formData,"deptName",t.deptName),this.$set(this.formData,"deptId",t.deptId)):(this.$set(this.formData,"operatorName",""),this.$set(this.formData,"operator",""),this.$set(this.formData,"deptId",""))},getSupplier:function(t){t?(this.$set(this.formData,"supplierId",t.id),this.$set(this.formData,"supplierName",t.name)):(this.$set(this.formData,"supplierId",""),this.$set(this.formData,"supplierName",""))},setCalculate:function(t,e){return t&&e?(parseFloat(e)*parseFloat(t)).toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo):0},getSummaries:function(t){for(var e=t.columns,i=t.data,a=0,o=0;o0&&this.printList.length>0&&this.printList.forEach(function(t){i.fac_type_list.forEach(function(e){t.id==e.id&&i.$set(t,"warehouseName",e.name)})})},auditStatusChange:function(){var t=this;this.$confirm("确定审核吗?","提示",{type:"warning"}).then(function(){t.$api.outsourcingAPI.outsourcingStockOutAudit({id:t.editId}).then(function(e){0===e.code?(t.$message({type:"success",message:"审核成功!"}),t.getDetail()):t.$message({message:e.msg,type:"error"})})}).catch(function(){t.$message({type:"info",message:"已取消"})})},reverseAuditChange:function(){var t=this;this.$confirm("确定反审核吗?","提示",{type:"warning"}).then(function(){t.$api.outsourcingAPI.outsourcingStockOutReverseAudit({id:t.editId}).then(function(e){0===e.code?(t.$message({type:"success",message:"反审核成功!"}),t.getDetail()):t.$message({message:e.msg,type:"error"})})}).catch(function(){t.$message({type:"info",message:"已取消"})})},save:function(){var t=this,e=void 0;this.$refs.formChild.validate(function(t,i){e=t}),this.$refs.form.validate(function(i){if(!i)return!1;if(0!=t.model.childList.length)if(e){var a=!0;if(t.model.childList.forEach(function(t){t.subQuoteCount<=0&&(a=!1)}),a){var o=!0;if(t.model.childList.forEach(function(e){if(!e.stockId)return t.$message({message:"没有查询库存,不能保存",type:"warning"}),void(o=!1)}),o){var s=[];t.model.childList.forEach(function(e){var i={stockId:e.stockId,materielId:e.materielId,count:e.count.toFixed(e.quantityAccuracy),supportUom:e.supportUom,convCoefficient:e.convCoefficient,outCount:e.subQuoteCount?e.subQuoteCount.toFixed(e.quantityAccuracy):0,unitPrice:e.unitPrice?e.unitPrice.toFixed(e.priceAccuracy):0,amount:t.setPriceAll(e.subQuoteCount,e.unitPrice),purpose:e.purpose?e.purpose:""};e.batch&&(i.batch=e.batch),e.sourceId&&(i.sourceId=e.sourceId,i.sourceType=e.sourceType?e.sourceType:"",i.sourceCode=e.sourceCode?e.sourceCode:""),e.id&&(i.id=e.id),s.push(i)});var r={supplierId:t.formData.supplierId?t.formData.supplierId:"",outTime:t.formData.outTime,operator:t.formData.operator,deptId:t.formData.deptId,remarks:t.formData.remarks?t.formData.remarks:"",item:__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(s),itemIds:t.itemIds};if(t.editId&&(r.id=t.editId),t.editId){if(t.isDisabled)return;t.isDisabled=!0,t.$api.outsourcingAPI.outsourcingStockOutEdit(r).then(function(e){t.isDisabled=!1,0===e.code?(t.editId?t.getDetail():(t.editId=e.id,window.location.href=t.changeURLArg("id",e.id)),t.$message({message:e.msg,type:"success"})):t.$message({message:e.msg,type:"error"})})}else{if(t.isDisabled)return;t.isDisabled=!0,t.$api.outsourcingAPI.outsourcingStockOutAdd(r).then(function(e){t.isDisabled=!1,0===e.code?(t.editId?t.getDetail():(t.editId=e.id,window.location.href=t.changeURLArg("id",e.id)),t.$message({message:e.msg,type:"success"})):t.$message({message:e.msg,type:"error"})})}}}else t.$message({message:"发出数量必须大于0",type:"warning"})}else t.$message({message:"有必填项未填写",type:"warning"});else t.$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},new_save:function(){this.formData={outTime:Object(__WEBPACK_IMPORTED_MODULE_3__utils_tools_js__.c)(),operatorName:this.userInfo.name,operator:this.userInfo.userId,deptName:this.userInfo.deptName,deptId:this.userInfo.deptId},this.auditStatus="",this.initiate_auditStatus="",this.model.childList=[],this.itemIds=[],this.headDetail={},this.editId&&(this.editId=void 0),this.$refs.form.resetFields()},removePart:function(){var t=this;this.chooseParts&&this.chooseParts.forEach(function(e){var i=t.model.childList.findIndex(function(i){if(i.onlyId==e.onlyId)return i.id&&t.itemIds.push(i.id),!0});t.model.childList.splice(i,1)})},copy:function(){var t=this;this.chooseParts&&JSON.parse(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(this.chooseParts)).forEach(function(e){delete e.id,delete e.stockId,delete e.maxCount,delete e.batch,delete e.facilityName,delete e.facilityLocationName,t.$set(e,"onlyId",(new Date).getTime()),t.$set(e,"purpose",""),t.$set(e,"unitPrice",0),t.$set(e,"count",0),t.$set(e,"btnName","查询"),console.log(e),t.model.childList.push(e)})},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},handlePartChange:function(t){this.chooseParts=t,this.setBtn(t)},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})},printNew:function(t){var e=void 0;10184===t.id?(this.printDirection=0,e=""):10185===t.id?(this.printDirection=1,e=""):10186===t.id&&(this.printDirection=2,e=""),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+e,window.print(),window.location.reload(),!1})},changeCount2:function(t){isNaN(t.convCoefficient)||isNaN(t.subQuoteCount)?t.count=0:t.count=parseFloat((parseFloat(t.convCoefficient)*parseFloat(t.subQuoteCount)).toFixed(t.quantityAccuracy))}}),watch:{formData:{handler:function(t,e){""==t.operator&&(this.formData.deptName="",this.formData.deptId="")},deep:!0}}}},b2rX:function(t,e,i){"use strict";var a=i("GKmE"),o={props:{id:{type:String,default:""},supplierId:"",supplierName:"",purchaseType:"",visible:{type:Boolean,default:!1},enableMultiFeeding:{type:Boolean,default:!1}},watch:{visible:function(t,e){t!==e&&(t&&this.getList(),this.innerVisible=t,this.$nextTick(function(){this.$refs.tb.clearSelection()}))},innerVisible:function(t,e){t!==e&&this.$emit("update:visible",t)}},data:function(){return{subsetList:[],subsetAll:[],subsetTotal:0,searchData_Subset:{pageno:1,pagesize:5,name:"",auditSign:179,closeStatus:0},callBackData:[],innerVisible:this.visible,loading:!1,dialogLoading:!1,feedingList:[],addVisible:!1}},mounted:function(){},computed:{},methods:{getRowKey:function(t){return t.id},clickRow:function(t){this.$refs.tb.toggleRowSelection(t)},getList:function(){var t=this;this.dialogLoading=!0,this.searchData_Subset.createTime?(this.searchData_Subset.startTime=Object(a.b)(this.searchData_Subset.createTime[0]),this.searchData_Subset.endTime=Object(a.b)(this.searchData_Subset.createTime[1])):(this.searchData_Subset.startTime="",this.searchData_Subset.endTime=""),this.supplierId&&(this.searchData_Subset.supplierId=this.supplierId),this.$api.outsourcingAPI.outsourcingContractDialogFeedingList(this.searchData_Subset).then(function(e){t.dialogLoading=!1,0===e.code&&(t.subsetList=e.data?e.data.datas:[],t.subsetTotal=e.data?e.data.totalRows:0)})},searchSubset:function(){this.searchData_Subset.pageno=1,this.getList()},ckSubsetAll:function(t){this.subsetAll=t},subsetSizeChange:function(t){this.searchData_Subset.pagesize=t,this.getList()},subsetCurrentChange:function(t){this.searchData_Subset.pageno=t,this.getList()},submit:function(t){var e=[],i=!0;if(this.subsetAll.length>1)for(var a=0;a