webpackJsonp([123],{"9Hky":function(t,e){},MzFz:function(t,e){},bgdx:function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_slicedToArray__=__webpack_require__("d7EF"),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_slicedToArray___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_slicedToArray__),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise__=__webpack_require__("//Fk"),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise__),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_json_stringify__=__webpack_require__("mvHQ"),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_json_stringify___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_json_stringify__),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_object_assign__=__webpack_require__("woOf"),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_object_assign___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_object_assign__),__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends__=__webpack_require__("Dd8w"),__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends__),__WEBPACK_IMPORTED_MODULE_5__utils_tools_js__=__webpack_require__("GKmE"),__WEBPACK_IMPORTED_MODULE_6__components_btnInput_vue__=__webpack_require__("ysqt"),__WEBPACK_IMPORTED_MODULE_7_vuex__=__webpack_require__("NYxO"),__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseSingleUser__=__webpack_require__("3MlD"),__WEBPACK_IMPORTED_MODULE_9__components_System_dialogChooseSingleBom__=__webpack_require__("Pzdv"),__WEBPACK_IMPORTED_MODULE_10__components_System_dialogChooseSingleSuppliers__=__webpack_require__("FnMF"),__WEBPACK_IMPORTED_MODULE_11__components_System_dialogChooseParts_vue__=__webpack_require__("CdUU"),__WEBPACK_IMPORTED_MODULE_12__contract_dialogImportOutsourcingContract__=__webpack_require__("IH/o"),__WEBPACK_IMPORTED_MODULE_13__contract_printOutsourcingContract_vue__=__webpack_require__("Em+a"),__WEBPACK_IMPORTED_MODULE_14__utils_config_js__=__webpack_require__("bzuE"),__WEBPACK_IMPORTED_MODULE_15_js_cookie__=__webpack_require__("lbHh"),__WEBPACK_IMPORTED_MODULE_15_js_cookie___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15_js_cookie__),__WEBPACK_IMPORTED_MODULE_16__components_System_upload__=__webpack_require__("veZ4"),__WEBPACK_IMPORTED_MODULE_17__components_UnitSelect__=__webpack_require__("Sd19"),__WEBPACK_IMPORTED_MODULE_18__utils_tools__=__webpack_require__("GKmE"),__WEBPACK_IMPORTED_MODULE_19__api_sendBeanApi__=__webpack_require__("loXm"),__WEBPACK_IMPORTED_MODULE_20__components_DetailApproveFlow__=__webpack_require__("EB+w");__webpack_exports__.a={inject:["reload"],components:{DetailApproveFlow:__WEBPACK_IMPORTED_MODULE_20__components_DetailApproveFlow__.a,btnInput:__WEBPACK_IMPORTED_MODULE_6__components_btnInput_vue__.a,dialogChooseParts:__WEBPACK_IMPORTED_MODULE_11__components_System_dialogChooseParts_vue__.a,dialogChooseSingleUser:__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseSingleUser__.a,dialogChooseSingleSupplier:__WEBPACK_IMPORTED_MODULE_10__components_System_dialogChooseSingleSuppliers__.a,printOutsourcingContract:__WEBPACK_IMPORTED_MODULE_13__contract_printOutsourcingContract_vue__.a,dialogImportOutsourcingContract:__WEBPACK_IMPORTED_MODULE_12__contract_dialogImportOutsourcingContract__.a,dialogChooseSingleBom:__WEBPACK_IMPORTED_MODULE_9__components_System_dialogChooseSingleBom__.a,upload:__WEBPACK_IMPORTED_MODULE_16__components_System_upload__.a,unitSelect:__WEBPACK_IMPORTED_MODULE_17__components_UnitSelect__.a},data:function(){return{printDirection:1,printTypeList:[],progressList:[],approveState:-1,proId:"",proName:"",addTyp:0,userInfo:"",config:__WEBPACK_IMPORTED_MODULE_14__utils_config_js__.a,editId:"",auditStatus:"",initiate_auditStatus:"",closeStatus:"",canChange:!1,itemIds:[],payIds:[],formData:{invoicedAmount:0,uninvoicedAmount:0,contractDate:Object(__WEBPACK_IMPORTED_MODULE_5__utils_tools_js__.c)(),supplierName:"",supplierId:"",contractType:265},currentChildIndex:"",chooseBomVisible:!1,isDisabled:!1,chooseParts:[],chooseParts2:[],contractTypeList:[],ruleForm:{supplierName:[{required:!0,message:"请选择供应商",trigger:"change"}],purchasePersonName:[{required:!0,message:"请选择采购员",trigger:"change"}],deptName:[{required:!1,message:"请选择采购部门",trigger:"change"}],contractExpireDate:[{required:!0,message:"请选择合同有效期",trigger:"change"}],contractDate:[{required:!0,message:"请选择合同日期",trigger:"change"}]},model:{rules:{count:{required:!0,message:"加工数量必填",trigger:"change"},taxUnitPrice:{required:!0,message:"含税单价必填",trigger:"change"},taxAmount:{required:!0,message:"含税金额必填",trigger:"change"},taxRate:{required:!0,message:"税率必填",trigger:"change"}},childList:[]},model2:{rules:{payableDate:{required:!0,message:"应付日期必填",trigger:"change"}},childList:[]},rulesForm1:{closeReason:[{required:!0,message:"关闭原因必填",trigger:"blur"}]},formData1:{},uploadAttachment:[],contentAssocList:[],childListLoading:!1,currentIndex:0,truelabel:1,falselabel:0,advanceQueryDialogVisible:!0,ChooseImport:!1,ChooseMaterielVisible:!1,chooseUserVisible:!1,dialogLoading1:!1,dialogVisible:!1,chooseSupplierVisible:!1,btnDelDisabled:!0,btnDelDisabled2:!0,headDetail:{},printDetail:{unit_name0:"",address0:"",company_phone0:"",unit_name:"",address:"",company_phone:"",remarks:[]},printTotal:{count:"",amount:""},printList:[],printForm:[{title:"物料代码",prop_:"serialNo"},{title:"物料名称",prop_:"materielName"},{title:"规格型号",prop_:"specification"},{title:"辅助单位",prop_:"materielSupportUomName"},{title:"加工数量",prop_:"subQuoteCount"},{title:"加工单价",prop_:"taxUnitPrice"},{title:"金额",prop_:"taxAmount"},{title:"交货日期",prop_:"deliveryDatePrint"}],printTotal2:{payableAmount:""},printList2:[],printForm2:[{title:"应付日期",prop_:"payableDate"},{title:"应付金额",prop_:"payableAmount"},{title:"已付金额",prop_:"paidAmount"},{title:"未付金额",prop_:"unpaidAmount"},{title:"备注",prop_:"remarks"}]}},computed:__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_7_vuex__.c)({})),mounted:function(){var t=this;this.userInfo=JSON.parse(__WEBPACK_IMPORTED_MODULE_15_js_cookie___default.a.get("userInfo")),this.editId=this.$route.query.id,this.initialize(),this.getPrintTypeList(),this.editId?this.getDetail():(this.$set(this.formData,"purchasePersonName",this.userInfo.name),this.$set(this.formData,"purchasePerson",this.userInfo.userId),this.$set(this.formData,"deptName",this.userInfo.deptName),this.$set(this.formData,"deptId",this.userInfo.deptId)),"change"==this.$route.query.from&&(this.canChange=!0),this.$api.companyAPI.detail().then(function(e){0===e.code&&(t.printDetail.unit_name0=e.result.name,t.printDetail.address0=e.result.address,t.printDetail.company_phone0=e.result.mobile)})},methods:__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_7_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){})},submitApprove:function(){var t=this;if(this.$route.query.id){var e={mainId:this.$route.query.id,dataType:4};__WEBPACK_IMPORTED_MODULE_19__api_sendBeanApi__.a.submitApprove(e).then(function(e){0===e.code?t.$message.success("操作成功!"):t.$message.error(e.msg),t.getDetail()}).catch(function(t){console.log(t)})}},getCurrentId:function(t){this.proId=t.proId,this.proName=t.proName},closeLine:function(){this.itemIds=[],this.formData1={},this.dialogVisible=!0,void 0!==this.$refs.form1&&this.$refs.form1.resetFields()},save1:function(t){var e=this;this.$refs[t].validate(function(t){if(t){if(e.chooseParts){var a=[];e.chooseParts.forEach(function(t){a.push(t.id);var o=e.model.childList.findIndex(function(e){if(e.id==t.id)return!0});e.model.childList.splice(o,1),e.itemIds=a})}e.$api.outsourcingAPI.closeLine({ids:e.itemIds,closeReason:e.formData1.closeReason}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.dialogVisible=!1,e.getDetail()):e.$message({message:t.msg,type:"error"})}).catch(function(t){e.$message({message:res.msg,type:"success"})})}})},changeCount:function(t){if(t.subQuoteCount&&t.taxUnitPrice?t.taxAmount=parseFloat((parseFloat(t.subQuoteCount)*parseFloat(t.taxUnitPrice)).toFixed(__WEBPACK_IMPORTED_MODULE_14__utils_config_js__.a.amountFixedTo)):t.taxAmount=0,t.error_count){for(var e=0,a=0;a=e&&this.model.childList.forEach(function(e){e.sourceId==t.sourceId&&delete e.error_count})}},changeTaxAmount:function(t){t.subQuoteCount&&t.taxAmount?(t.taxUnitPrice=parseFloat((parseFloat(t.taxAmount)/parseFloat(t.subQuoteCount)).toFixed(__WEBPACK_IMPORTED_MODULE_14__utils_config_js__.a.priceFixedTo)),t.unitPrice=parseFloat((parseFloat(t.taxUnitPrice)/(1+t.taxRate/100)).toFixed(__WEBPACK_IMPORTED_MODULE_14__utils_config_js__.a.priceFixedTo))):t.taxUnitPrice=0},changeTaxUnitPrice:function(t){t.subQuoteCount&&t.taxUnitPrice?(t.unitPrice=parseFloat((t.taxUnitPrice/(1+t.taxRate/100)).toFixed(__WEBPACK_IMPORTED_MODULE_14__utils_config_js__.a.priceFixedTo)),t.taxAmount=parseFloat((t.subQuoteCount*t.taxUnitPrice).toFixed(__WEBPACK_IMPORTED_MODULE_14__utils_config_js__.a.amountFixedTo))):(t.unitPrice=0,t.taxAmount=0)},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/outsourcing/outsourcing_contract_index",query:{t:Date.now()}})},getDetail:function(){var t=this;this.childListLoading=!0,this.$nextTick().then(function(){t.$api.outsourcingAPI.outsourcingContractDetail({outsourcingContractId:t.editId}).then(function(e){if(t.childListLoading=!1,0===e.code){if(t.formData=__WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_object_assign___default()({},e.outsourcingContract),t.formData.invoicedAmount=t.formData.invoicedAmount?t.formData.invoicedAmount:0,t.formData.uninvoicedAmount=t.formData.uninvoicedAmount?t.formData.uninvoicedAmount:0,t.auditStatus=t.formData.auditSign,t.initiate_auditStatus=t.formData.auditSign,t.closeStatus=t.formData.closeStatus,t.$set(t.headDetail,"createByName",e.outsourcingContract.createByName),t.$set(t.headDetail,"createTime",e.outsourcingContract.createTime),t.$set(t.headDetail,"auditorName",e.outsourcingContract.auditorName),t.$set(t.headDetail,"auditTime",e.outsourcingContract.auditTime),t.$set(t.headDetail,"contractCode",e.outsourcingContract.contractCode),t.$set(t.headDetail,"closeStatusName",e.outsourcingContract.closeStatusName),t.approveState=e.outsourcingContract.approveState,0!==t.approveState&&(t.progressList=e.progressList),t.model.childList=e.outsourcingContractItemList,t.model.childList.forEach(function(e){t.$set(e,"onlyId",e.materielId+"_"+Math.random()),t.$set(e,"serialNo",e.materielSerialNo?e.materielSerialNo:""),e.deliveryDatePrint=Object(__WEBPACK_IMPORTED_MODULE_18__utils_tools__.i)(e.deliveryDate,"{y}-{m}-{d}")}),t.model2.childList=e.outsourcingContractPayList,t.model2.childList.forEach(function(e){t.$set(e,"onlyId",e.id+"_"+Math.random())}),e.uploadAttachment&&e.uploadAttachment.length>0){t.fileDocList=[];for(var a=0;a0){var i=[];t.uploadAttachment.forEach(function(t){var e={fileName:t.fileName,filePath:t.filePath};i.push(e)}),t.contentAssocList=__WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_json_stringify___default()(i),console.log(t.contentAssocList)}if(0!=t.model.childList.length)if(0!=t.model2.childList.length)if(e&&a){var r=!0;if(265==t.formData.contractType&&t.model.childList.forEach(function(t){t.bomId||(r=!1)}),r){var s=!0,n=0;if(t.model2.childList.forEach(function(t){n+=t.payableAmount,t.payableAmount0),this.btnDelDisabled=e},setBtn2:function(t){var e=!0;e=!(t.length>0),this.btnDelDisabled2=e},handlePartChange:function(t){this.chooseParts=t,this.setBtn(t)},handlePartChange2:function(t){this.chooseParts2=t,this.setBtn2(t)},print:function(){document.getElementById("print_content").style.display="block",this.printList=JSON.parse(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_json_stringify___default()(this.printList)),this.printList2=JSON.parse(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_json_stringify___default()(this.printList2)),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_2_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,e){e&&this.$message({message:"你已改变系数,库存可能会出现主辅单位数量和系数冲突,请确认后再修改!",type:"warning",duration:4e3}),isNaN(t.materielConv)||isNaN(t.subQuoteCount)?t.count=0:t.count=parseFloat((parseFloat(t.materielConv)*parseFloat(t.subQuoteCount)).toFixed(t.quantityAccuracy)),this.changeCount(t)},getValue:function(t){this.model.childList[t.index].materielSupportUom=t.value}}),watch:{formData:{handler:function(t,e){if(t)for(var a=t.remarks.split("\n"),o=0;o