yxk_pc_mdh/gyhl/static/js/122.83270ad74ca14fbd7faa.js

1 line
39 KiB
JavaScript

webpackJsonp([122],{E30c:function(t,e){},LxA8:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=a("kPMA"),i={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"sys-box plan-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.back()}}},[t._v(t._s(t.config.cancelText))]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.change}},[t._v("保存")])],1),t._v(" "),a("div",{staticClass:"sys-form"},[a("el-form",{ref:"form",attrs:{"label-width":"120px",model:t.formData,rules:t.ruleForm}},[a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"供应商",prop:"supplierName"}},[a("el-input",{attrs:{placeholder:"供应商",clearable:"",readonly:""},model:{value:t.formData.supplierName,callback:function(e){t.$set(t.formData,"supplierName",e)},expression:"formData.supplierName"}},[178!=t.auditStatus&&t.editId?t._e():a("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:function(e){t.chooseSupplierVisible=!0}},slot:"append"})],1)],1),t._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"采购员",prop:"purchasePersonName"}},[a("el-input",{attrs:{placeholder:"采购员",readonly:""},model:{value:t.formData.purchasePersonName,callback:function(e){t.$set(t.formData,"purchasePersonName",e)},expression:"formData.purchasePersonName"}},[178!=t.auditStatus&&t.editId?t._e():a("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:function(e){t.chooseUserVisible=!0}},slot:"append"})],1)],1),t._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"合同类型",clearable:""}},[a("el-select",{attrs:{disabled:"",placeholder:"请选择"},model:{value:t.formData.contractType,callback:function(e){t.$set(t.formData,"contractType",e)},expression:"formData.contractType"}},t._l(t.contractTypeList,function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1)],1),t._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"合同日期",prop:"contractDate"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{readonly:"",type:"date",placeholder:"选择合同日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd"},model:{value:t.formData.contractDate,callback:function(e){t.$set(t.formData,"contractDate",e)},expression:"formData.contractDate"}})],1),t._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"合同有效期",prop:"contractExpireDate"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{readonly:"",type:"date",placeholder:"选择合同有效期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd"},model:{value:t.formData.contractExpireDate,callback:function(e){t.$set(t.formData,"contractExpireDate",e)},expression:"formData.contractExpireDate"}})],1),t._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"合同编号"}},[a("el-input",{attrs:{placeholder:"自动生成",readonly:""},model:{value:t.formData.contractCode,callback:function(e){t.$set(t.formData,"contractCode",e)},expression:"formData.contractCode"}})],1)],1)]),t._v(" "),a("el-form",{ref:"formChild",attrs:{rules:t.model.rules,model:t.model}},[178!=t.auditStatus&&t.editId?t._e():a("div",{staticClass:"sys-operate",staticStyle:{"margin-bottom":"10px"}},[a("el-button",{attrs:{type:"primary",disabled:0!=t.addTyp&&1!=t.addTyp&&0!=t.model.childList.length},on:{click:function(e){t.ChooseMaterielVisible=!0}}},[t._v("新增")]),t._v(" "),a("el-button",{attrs:{type:"primary",disabled:0!=t.addTyp&&2!=t.addTyp&&0!=t.model.childList.length},on:{click:function(e){t.ChooseImport=!0}}},[t._v("导入关联单据")]),t._v(" "),a("el-button",{attrs:{type:"primary",disabled:t.btnDelDisabled},on:{click:function(e){return t.removePart()}}},[t._v("删除")])],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.childListLoading,expression:"childListLoading"}],attrs:{data:t.model.childList,"show-summary":"","summary-method":t.getSummaries,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"},border:""},on:{"selection-change":t.handlePartChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"serialNo",label:"物料代码",align:"center","show-overflow-tooltip":"","label-class-name":"required_head"}}),t._v(" "),a("el-table-column",{attrs:{prop:"materielName",label:"物料名称",align:"center","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"specification",align:"center","show-overflow-tooltip":"",label:"规格型号"}}),t._v(" "),a("el-table-column",{staticClass:"form-inline",attrs:{label:"是否检验",prop:"isCheck",width:"60"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-checkbox",{staticClass:"child_check",attrs:{disabled:!(178==t.auditStatus||!t.editId),"true-label":t.truelabel,"false-label":t.falselabel},model:{value:e.row.isCheck,callback:function(a){t.$set(e.row,"isCheck",a)},expression:"scope.row.isCheck"}})]}}])}),t._v(" "),a("el-table-column",{staticClass:"form-inline",attrs:{label:"BOM编号",prop:"bomSerialNo",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input",{attrs:{readonly:""},model:{value:e.row.bomSerialNo,callback:function(a){t.$set(e.row,"bomSerialNo",a)},expression:"scope.row.bomSerialNo"}},[178!=t.auditStatus&&t.editId?t._e():a("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:function(a){return t.showBom(e.row,e.$index)}},slot:"append"})],1)]}}])}),t._v(" "),a("el-table-column",{staticClass:"form-inline",attrs:{label:"是否限额发料",prop:"isQuota",width:"60"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-checkbox",{staticClass:"child_check",attrs:{disabled:!(178==t.auditStatus||!t.editId),"true-label":t.truelabel,"false-label":t.falselabel},model:{value:e.row.isQuota,callback:function(a){t.$set(e.row,"isQuota",a)},expression:"scope.row.isQuota"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"unitUomName",align:"center","show-overflow-tooltip":"",label:"主计量单位"}}),t._v(" "),a("el-table-column",{attrs:{prop:"count",align:"center",width:"180",label:"主单位数量","label-class-name":"required_head"}}),t._v(" "),a("el-table-column",{attrs:{prop:"supportUom",align:"center",width:"140","show-overflow-tooltip":"",label:"辅助单位"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("unitSelect",{attrs:{unitUom:e.row.materielSupportUom,index:e.$index,disabled:!(178===t.auditStatus||!t.editId||t.canChange)},on:{getValue:t.getValue}})]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"convCoefficient",align:"center",width:"140",label:"换算系数"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,size:"small",precision:e.row.quantityAccuracy,"controls-position":"right",disabled:!(178===t.auditStatus||!t.editId||t.canChange)},on:{change:function(a){return t.changeCount2(e.row)}},model:{value:e.row.materielConv,callback:function(a){t.$set(e.row,"materielConv",a)},expression:"scope.row.materielConv"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"subQuoteCount",align:"center",width:"180",label:"加工数量","label-class-name":"required_head"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-form-item",{class:e.row.error_count?"error_count":"",attrs:{prop:"childList."+e.$index+".count",rules:t.model.rules.count}},[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,disabled:!(178===t.auditStatus||!t.editId||t.canChange),size:"small","controls-position":"right"},on:{change:function(a){return t.changeCount2(e.row)}},model:{value:e.row.subQuoteCount,callback:function(a){t.$set(e.row,"subQuoteCount",a)},expression:"scope.row.subQuoteCount"}})],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"taxUnitPrice",align:"center",width:"180",label:"含税单价(元)","label-class-name":"required_head"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-form-item",{attrs:{prop:"childList."+e.$index+".taxUnitPrice",rules:t.model.rules.taxUnitPrice}},[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,disabled:!(178==t.auditStatus||!t.editId||t.canChange),size:"small","controls-position":"right"},model:{value:e.row.taxUnitPrice,callback:function(a){t.$set(e.row,"taxUnitPrice",a)},expression:"scope.row.taxUnitPrice"}})],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",width:"120",label:"税率(%)","label-class-name":"required_head"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-form-item",{attrs:{prop:"childList."+e.$index+".taxRate",rules:t.model.rules.taxRate}},[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,disabled:!(178==t.auditStatus||!t.editId),size:"small","controls-position":"right"},model:{value:e.row.taxRate,callback:function(a){t.$set(e.row,"taxRate",a)},expression:"scope.row.taxRate"}})],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"taxAmount",align:"center",width:"140",label:"含税金额(元)","label-class-name":"required_head"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t.setCalculate(e.row.subQuoteCount,e.row.taxUnitPrice,e.row.taxRate,"taxAmount")))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"unitPrice",align:"center",width:"140",label:"不含税单价(元)"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t.setCalculate(e.row.subQuoteCount,e.row.taxUnitPrice,e.row.taxRate,"unitPrice")))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"amount",align:"center",width:"140",label:"不含税金额(元)"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t.setCalculate(e.row.subQuoteCount,e.row.taxUnitPrice,e.row.taxRate,"amount")))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"taxes",align:"center",width:"140",label:"税额(元)"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t.setCalculate(e.row.subQuoteCount,e.row.taxUnitPrice,e.row.taxRate,"taxes")))])]}}])}),t._v(" "),a("el-table-column",{staticClass:"form-inline",attrs:{label:"交货日期",prop:"deliveryDate",width:"250"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-form-item",[a("el-date-picker",{attrs:{disabled:!(178==t.auditStatus||!t.editId),format:"yyyy-MM-dd HH:mm:ss","value-format":"yyyy-MM-dd HH:mm:ss",type:"datetime",clearable:""},model:{value:e.row.deliveryDate,callback:function(a){t.$set(e.row,"deliveryDate",a)},expression:"scope.row.deliveryDate"}})],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"sourceTypeName",align:"center",label:"源单类型",width:"100px"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.sourceTypeName?a("div",{staticStyle:{color:"#3a8ee6"}},[t._v(t._s(e.row.sourceTypeName))]):t._e()]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"sourceCode","show-overflow-tooltipalign":"",label:"源单单号"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticStyle:{color:"#3a8ee6"}},[t._v(t._s(e.row.sourceCode))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"remarks",align:"center",width:"200",label:"备注"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{disabled:!(178==t.auditStatus||!t.editId),size:"small"},model:{value:e.row.remarks,callback:function(a){t.$set(e.row,"remarks",a)},expression:"scope.row.remarks"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"closeStatusName",align:"center",label:"行关闭状态","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"itemCloseTime",align:"center",label:"行关闭时间","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{prop:"itemCloseReason",align:"center",label:"行关闭原因","show-overflow-tooltip":""}})],1)],1),t._v(" "),a("el-divider"),t._v(" "),a("el-row",{attrs:{gutter:0}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content bg-purple"},[t._v("已开票金额:"+t._s(t.formData.invoicedAmount)+"元")])]),t._v(" "),a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content bg-purple"},[t._v("未开票金额: "),a("span",{staticStyle:{color:"red"}},[t._v(t._s(t.formData.uninvoicedAmount))]),t._v("元")])])],1),t._v(" "),a("el-divider",{attrs:{"content-position":"left"}},[t._v("合同付款条件")]),t._v(" "),a("el-form",{ref:"formChild2",attrs:{rules:t.model2.rules,model:t.model2}},[a("el-form-item",{staticClass:"childlist"},[178!=t.auditStatus&&t.editId?t._e():a("div",{staticClass:"sys-operate",staticStyle:{"margin-bottom":"10px"}},[a("el-button",{attrs:{type:"primary"},on:{click:t.addChild2}},[t._v("新增")]),t._v(" "),a("el-button",{attrs:{type:"primary",disabled:t.btnDelDisabled2},on:{click:function(e){return t.removePart2()}}},[t._v("删除")])],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.childListLoading,expression:"childListLoading"}],attrs:{data:t.model2.childList,"show-summary":"","summary-method":t.getSummaries2,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"},border:""},on:{"selection-change":t.handlePartChange2}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),t._v(" "),a("el-table-column",{staticClass:"form-inline",attrs:{label:"应付日期",width:"210",prop:"payableDate","label-class-name":"required_head"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-form-item",{attrs:{prop:"childList."+e.$index+".payableDate",rules:t.model2.rules.payableDate}},[a("el-date-picker",{staticStyle:{width:"190px"},attrs:{disabled:!(178==t.auditStatus||!t.editId||t.canChange),format:"yyyy-MM-dd HH:mm:ss","value-format":"yyyy-MM-dd HH:mm:ss",type:"datetime",clearable:""},model:{value:e.row.payableDate,callback:function(a){t.$set(e.row,"payableDate",a)},expression:"scope.row.payableDate"}})],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"payableAmount",align:"center",width:"150",label:"应付金额(元)"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,disabled:!(178==t.auditStatus||!t.editId||t.canChange),size:"small","controls-position":"right"},model:{value:e.row.payableAmount,callback:function(a){t.$set(e.row,"payableAmount",a)},expression:"scope.row.payableAmount"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"paidAmount",align:"center",width:"150",label:"已付金额(元)"}}),t._v(" "),a("el-table-column",{attrs:{prop:"unpaidAmount",align:"center",width:"150",label:"未付金额(元)"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",[t._v(t._s(t.setCalculateunpaidAmount(e.row.payableAmount,e.row.paidAmount)))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"remarks",align:"center",label:"备注"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{disabled:!(178==t.auditStatus||!t.editId),size:"small"},model:{value:e.row.remarks,callback:function(a){t.$set(e.row,"remarks",a)},expression:"scope.row.remarks"}})]}}])})],1)],1)],1)],1),t._v(" "),a("dialogImportOutsourcingContract",{attrs:{visible:t.ChooseImport},on:{"update:visible":function(e){t.ChooseImport=e},change:t.getImport}}),t._v(" "),a("dialogChooseParts",{attrs:{visible:t.ChooseMaterielVisible},on:{"update:visible":function(e){t.ChooseMaterielVisible=e},change:t.getMateriel}}),t._v(" "),a("dialogChooseSingleBom",{attrs:{visible:t.chooseBomVisible},on:{"update:visible":function(e){t.chooseBomVisible=e},change:t.getBom}}),t._v(" "),a("dialogChooseSingleUser",{attrs:{visible:t.chooseUserVisible},on:{"update:visible":function(e){t.chooseUserVisible=e},change:t.getUser}}),t._v(" "),a("dialogChooseSingleSupplier",{attrs:{visible:t.chooseSupplierVisible},on:{"update:visible":function(e){t.chooseSupplierVisible=e},change:t.getSupplier}}),t._v(" "),a("div",{staticStyle:{margin:"0 auto",display:"none"},attrs:{id:"print_content"}},[a("printOutsourcingContract",{attrs:{printDetail:t.printDetail,printList:t.printList,printForm:t.printForm,printTotal:t.printTotal,printList2:t.printList2,printForm2:t.printForm2,printTotal2:t.printTotal2,printDirection:!0},on:{"update:printDetail":function(e){t.printDetail=e},"update:print-detail":function(e){t.printDetail=e}}})],1)],1)},staticRenderFns:[]};var s=function(t){a("E30c"),a("VIyh")},r=a("VU/8")(o.a,i,!1,s,"data-v-67736e9e",null);e.default=r.exports},VIyh:function(t,e){},kPMA: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_vuex__=__webpack_require__("NYxO"),__WEBPACK_IMPORTED_MODULE_7__components_System_dialogChooseSingleUser__=__webpack_require__("3MlD"),__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseSingleBom__=__webpack_require__("Pzdv"),__WEBPACK_IMPORTED_MODULE_9__components_System_dialogChooseSingleSuppliers__=__webpack_require__("FnMF"),__WEBPACK_IMPORTED_MODULE_10__components_System_dialogChooseParts_vue__=__webpack_require__("CdUU"),__WEBPACK_IMPORTED_MODULE_11__contract_dialogImportOutsourcingContract__=__webpack_require__("IH/o"),__WEBPACK_IMPORTED_MODULE_12__contract_printOutsourcingContract_vue__=__webpack_require__("Em+a"),__WEBPACK_IMPORTED_MODULE_13__utils_config_js__=__webpack_require__("bzuE"),__WEBPACK_IMPORTED_MODULE_14__components_UnitSelect__=__webpack_require__("Sd19"),__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_exports__.a={inject:["reload"],components:{dialogChooseParts:__WEBPACK_IMPORTED_MODULE_10__components_System_dialogChooseParts_vue__.a,dialogChooseSingleUser:__WEBPACK_IMPORTED_MODULE_7__components_System_dialogChooseSingleUser__.a,dialogChooseSingleSupplier:__WEBPACK_IMPORTED_MODULE_9__components_System_dialogChooseSingleSuppliers__.a,printOutsourcingContract:__WEBPACK_IMPORTED_MODULE_12__contract_printOutsourcingContract_vue__.a,dialogImportOutsourcingContract:__WEBPACK_IMPORTED_MODULE_11__contract_dialogImportOutsourcingContract__.a,dialogChooseSingleBom:__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseSingleBom__.a,unitSelect:__WEBPACK_IMPORTED_MODULE_14__components_UnitSelect__.a},data:function(){return{addTyp:0,userInfo:"",config:__WEBPACK_IMPORTED_MODULE_13__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)(),contractType:265},currentChildIndex:"",chooseBomVisible:!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:[]},childListLoading:!1,truelabel:1,falselabel:0,ChooseImport:!1,ChooseMaterielVisible:!1,chooseUserVisible:!1,chooseSupplierVisible:!1,btnDelDisabled:!0,btnDelDisabled2:!0,headDetail:{},printDetail:{unit_name0:"",address0:"",company_phone0:"",unit_name:"",address:"",company_phone:""},printTotal:{count:"",amount:""},printList:[],printForm:[{title:"物料代码",prop_:"serialNo"},{title:"物料名称",prop_:"materielName"},{title:"规格型号",prop_:"specification"},{title:"单位",prop_:"unitUomName"},{title:"加工数量",prop_:"count"},{title:"加工单价",prop_:"unitPrice"},{title:"金额",prop_:"amount"},{title:"交货日期",prop_:"deliveryDate"}],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_6_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.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.name,t.printDetail.address0=e.address,t.printDetail.company_phone0=e.mobile)})},methods:__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_6_vuex__.d)({removeTagNav:"tagNav/removeTagNav"}),{changeCount:function(t){if(t.error_count){for(var e=0,a=0;a<this.model.childList.length;a++)t.error_count&&t.sourceId==this.model.childList[a].sourceId&&(e=parseFloat(e)+parseFloat(this.model.childList[a].count));parseFloat(t.sourceCount)>=e&&this.model.childList.forEach(function(e){e.sourceId==t.sourceId&&delete e.error_count})}},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){t.childListLoading=!1,0===e.code&&(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.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:"")}),t.model2.childList=e.outsourcingContractPayList,t.model2.childList.forEach(function(e){t.$set(e,"onlyId",e.id+"_"+Math.random())}),t.printList=JSON.parse(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_json_stringify___default()(t.model.childList)),t.printList2=JSON.parse(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_json_stringify___default()(t.model2.childList)),t.printDetail.contractDate=e.outsourcingContract.contractDate.split(" ")[0],t.printDetail.contractExpireDate=e.outsourcingContract.contractExpireDate.split(" ")[0],t.printDetail.contractCode=e.outsourcingContract.contractCode,t.$api.supplierAPI.groupDetail(t.formData.supplierId).then(function(e){0==e.code&&(t.printDetail.unit_name=e.data[0].unit_name,t.printDetail.address=e.data[0].address,t.printDetail.company_phone=e.data[0].company_phone,t.$forceUpdate())}).catch(function(t){}))})}).catch(function(e){t.childListLoading=!1})},showBom:function(t,e){this.currentChildIndex=e,this.chooseBomVisible=!0},getUser:function(t){t?(this.$set(this.formData,"purchasePersonName",t.name),this.$set(this.formData,"purchasePerson",t.id),this.$set(this.formData,"deptName",t.deptName),this.$set(this.formData,"deptId",t.deptId)):(this.$set(this.formData,"purchasePersonName",""),this.$set(this.formData,"purchasePerson",""),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",""))},getSummaries:function(t){for(var e=t.columns,a=t.data,o=0,i=0;i<a.length;i++)o+=a[i].count;this.printTotal.count=o.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.countFixedTo);for(var s=0,r=0;r<a.length;r++)parseFloat(a[r].taxUnitPrice)*parseFloat(a[r].subQuoteCount)&&(s+=parseFloat(a[r].taxUnitPrice)*parseFloat(a[r].subQuoteCount));this.formData.uninvoicedAmount=(s-this.formData.invoicedAmount).toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo),this.printTotal.taxAmount=s.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo);for(var n=0,l=0;l<a.length;l++)parseFloat(a[l].subQuoteCount)*(parseFloat(a[l].taxUnitPrice)/(1+parseFloat(a[l].taxRate)/100))&&(n+=parseFloat(a[l].subQuoteCount)*(parseFloat(a[l].taxUnitPrice)/(1+parseFloat(a[l].taxRate)/100)));this.printTotal.amount=n.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo);for(var _=0,c=0;c<a.length;c++)parseFloat(a[c].subQuoteCount)*(parseFloat(a[c].taxUnitPrice)/(1+parseFloat(a[c].taxRate)/100))*(parseFloat(a[c].taxRate)/100)&&(_+=parseFloat(a[c].subQuoteCount)*(parseFloat(a[c].taxUnitPrice)/(1+parseFloat(a[c].taxRate)/100))*(parseFloat(a[c].taxRate)/100));this.printTotal.taxes=_.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo);var u=[];return e.forEach(function(t,e){if(14!==e)if(16!==e)if(17!==e)if(0!==e)if(8===e||11===e||14===e||16===e||17===e){var o=a.map(function(e){return Number(e[t.property])});o.every(function(t){return isNaN(t)})?u[e]="":u[e]=o.reduce(function(t,e){var a=Number(e);return isNaN(a)?t:t+e},0),8!==e&&11!==e||u[e]&&(u[e]=u[e].toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.countFixedTo))}else u[e]="";else u[e]="合计";else u[e]=_.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo);else u[e]=n.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo);else u[e]=s.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo)}),u},getSummaries2:function(t){for(var e=this,a=t.columns,o=t.data,i=[],s=0,r=0;r<o.length;r++)s+=parseFloat(parseFloat(o[r].payableAmount)-parseFloat(o[r].paidAmount));return a.forEach(function(t,a){if(0!==a)if(2==a||3==a||4==a)if(4!=a){for(var r=0,n=0;n<o.length;n++)r+=o[n].payableAmount;e.printTotal2.payableAmount=r.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo);var l=o.map(function(e){return Number(e[t.property])});l.every(function(t){return isNaN(t)})?i[a]="":i[a]=l.reduce(function(t,e){var a=Number(e);return isNaN(a)?t:t+e},0),2!=a||i[a]&&(i[a]=i[a].toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo))}else i[a]=s.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo);else i[a]="";else i[a]="合计"}),i},setCalculate:function(t,e,a,o){return t&&e?"unitPrice"==o?(parseFloat(e)/(1+parseFloat(a)/100)).toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.priceFixedTo):"taxAmount"==o?(parseFloat(e)*parseFloat(t)).toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo):"amount"==o?(parseFloat(t)*(parseFloat(e)/(1+parseFloat(a)/100))).toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo):"taxes"==o?(parseFloat(t)*(parseFloat(e)/(1+parseFloat(a)/100))*(parseFloat(a)/100)).toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo):void 0:0},setCalculateunpaidAmount:function(t,e){return(parseFloat(t)-parseFloat(e)).toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo)},getMateriel:function(t){var e=this;t&&t.forEach(function(t){e.$set(t,"isCheck",0),e.$set(t,"taxUnitPrice",0),e.$set(t,"count",0),e.$set(t,"materielName",t.name?t.name:0),e.$set(t,"materielId",t.id),e.$set(t,"onlyId",t.id+"_"+Date.now()),e.$set(t,"taxRate",t.taxPercent?t.taxPercent:0),delete t.id,e.model.childList.push(t),e.addTyp=1})},getBom:function(t){t&&(this.$set(this.model.childList[this.currentChildIndex],"bomSerialNo",t.bomSerialno),this.$set(this.model.childList[this.currentChildIndex],"bomId",t.bomId))},addChild2:function(){var t={payableAmount:0,paidAmount:0,unpaidAmount:0,onlyId:Date.now()};this.model2.childList.push(t)},getImport:function(t){var e=this;t&&t.forEach(function(t){var a="",o="",i="",s=0;t.materielName?(a=t.materielName,o=t.materielSerialNo,i=t.code,s=t.count):t.materialName&&(a=t.materialName,o=t.materialSerialNo,i=t.feedingNo,s=t.count),e.$set(t,"taxRate",t.taxRate?t.taxRate:0),e.$set(t,"isCheck",0),e.$set(t,"deliveryDate",""),e.$set(t,"taxUnitPrice",0),e.$set(t,"count",s),e.$set(t,"materielName",a),e.$set(t,"serialNo",o),e.$set(t,"materielId",t.materielId),e.$set(t,"onlyId",t.id+"_"+Date.now()),e.$set(t,"sourceId",t.id),e.$set(t,"sourceCode",i),t.thisSourceType&&(e.$set(t,"sourceTypeName",t.thisSourceTypeName?t.thisSourceTypeName:""),e.$set(t,"sourceType",t.thisSourceType)),delete t.id,e.model.childList.push(t),e.addTyp=2})},initialize:function(){var t=this;__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.all([this.$api.gylCommonAPI.getDictsByType({type:"outsourcing_contract_type"})]).then(function(e){var a=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_slicedToArray___default()(e,1)[0];0===a.code&&(t.contractTypeList=a.datas)}).catch(function(t){})},auditStatusChange:function(){var t=this;this.$confirm("确定审核吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(){t.$api.outsourcingAPI.outsourcingContractAudit({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("确定反审核吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(){t.$api.outsourcingAPI.outsourcingContractReverseAudit({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:"已取消"})})},close:function(){var t=this;this.$confirm("确定"+this.config.closeContractText+"吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(){t.$api.outsourcingAPI.outsourcingContractClose({id:t.editId}).then(function(e){0===e.code?(t.$message({type:"success",message:e.msg}),t.getDetail()):t.$message({message:e.msg,type:"error"})})}).catch(function(){t.$message({type:"info",message:"已取消"})})},disClose:function(){var t=this;this.$confirm("确定"+this.config.openContractText+"吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(){t.$api.outsourcingAPI.outsourcingContractReverseClose({id:t.editId}).then(function(e){0===e.code?(t.$message({type:"success",message:e.msg}),t.getDetail()):t.$message({message:e.msg,type:"error"})})}).catch(function(){t.$message({type:"info",message:"已取消"})})},change:function(){var t=this,e=void 0,a=void 0;this.$refs.formChild.validate(function(t,a){e=t}),this.$refs.formChild2.validate(function(t,e){a=t}),this.$refs.form.validate(function(o){if(!o)return!1;if(0!=t.model.childList.length)if(0!=t.model2.childList.length)if(e&&a){var i=!0,s=0;if(t.model2.childList.forEach(function(t){s+=t.payableAmount,t.payableAmount<parseFloat(t.paidAmount)&&(i=!1)}),i)if(s==t.printTotal.taxAmount)if(t.printTotal.taxAmount<t.formData.invoicedAmount)t.$message({message:"含税总金额不能小于已开票金额",type:"warning"});else{var r=[],n=[];t.model.childList.forEach(function(e){var a={materielId:e.materielId,isCheck:e.isCheck?e.isCheck:0,isQuota:e.isQuota?e.isQuota:0,count:e.count.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.countFixedTo),supportUom:e.materielSupportUom,convCoefficient:e.materielConv,processCount:e.subQuoteCount.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.countFixedTo),taxUnitPrice:e.taxUnitPrice.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.priceFixedTo),taxRate:e.taxRate.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.taxRateFixedTo),taxAmount:t.setCalculate(e.subQuoteCount,e.taxUnitPrice,e.taxRate,"taxAmount"),unitPrice:t.setCalculate(e.subQuoteCount,e.taxUnitPrice,e.taxRate,"unitPrice"),amount:t.setCalculate(e.subQuoteCount,e.taxUnitPrice,e.taxRate,"amount"),taxes:t.setCalculate(e.subQuoteCount,e.taxUnitPrice,e.taxRate,"taxes"),deliveryDate:e.deliveryDate?e.deliveryDate:"",remarks:e.remarks?e.remarks:""};e.bomId&&(a.bomId=e.bomId),e.sourceId&&(a.sourceId=e.sourceId,a.sourceType=e.sourceType?e.sourceType:"",a.sourceCode=e.sourceCode?e.sourceCode:""),e.id&&(a.id=e.id),r.push(a)}),t.model2.childList.forEach(function(t){var e={payableAmount:t.payableAmount.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo),paidAmount:t.paidAmount.toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo),unpaidAmount:(parseFloat(t.payableAmount)-parseFloat(t.paidAmount)).toFixed(__WEBPACK_IMPORTED_MODULE_13__utils_config_js__.a.amountFixedTo),remarks:t.remarks?t.remarks:""};t.id&&(e.id=t.id),t.payableDate&&(e.payableDate=t.payableDate),n.push(e)});var l={uninvoicedAmount:t.formData.uninvoicedAmount,id:t.editId,bodyItem:__WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_json_stringify___default()(r),bodyPay:__WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_json_stringify___default()(n),payIds:t.payIds};t.$api.outsourcingAPI.outsourcingContractEdit(l).then(function(e){0===e.code?(t.$message({message:e.msg,type:"success"}),t.removeTagNav({path:t.$route.path,title:t.$route.meta.name}),t.$router.push({path:"/outsourcing/outsourcing_contract_index",query:{t:Date.now()}})):500===e.code&&e.data?(t.$message({message:e.msg,type:"error"}),t.model.childList.forEach(function(a){a.sourceId&&a.sourceId==e.data.sourceId&&(t.$set(a,"error_count",!0),t.$set(a,"sourceCount",e.data.sourceCount))})):(t.back(),t.$message({message:e.msg,type:"error"}))})}else t.$message({message:"含税总金额必须等于应付总金额",type:"warning"});else t.$message({message:"应付金额不能小于已付金额",type:"warning"})}else t.$message({message:"有必填项未填写",type:"warning"});else t.$message({message:"请添加合同付款条件",type:"error"});else t.$message({message:"请添加物料",type:"error"})})},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={invoicedAmount:0,uninvoicedAmount:0,contractDate:Object(__WEBPACK_IMPORTED_MODULE_5__utils_tools_js__.c)(),contractType:265},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),this.$set(this.formData,"invoicedAmount",0),this.$set(this.formData,"uninvoicedAmount",0),this.$set(this.formData,"contractDate",Object(__WEBPACK_IMPORTED_MODULE_5__utils_tools_js__.c)()),this.headDetail={},this.auditStatus="",this.initiate_auditStatus="",this.model.childList=[],this.model2.childList=[],this.itemIds=[],this.payIds=[],this.editId&&(this.editId=void 0),this.$refs.form.resetFields()},lookChange:function(){this.$router.push({path:"/outsourcing/outsourcing_contract_alteration",query:{t:Date.now()}})},removePart:function(){var t=this;this.chooseParts&&this.chooseParts.forEach(function(e){var a=t.model.childList.findIndex(function(a){if(a.onlyId==e.onlyId)return a.id&&t.itemIds.push(a.id),!0});t.model.childList.splice(a,1)})},removePart2:function(){var t=this;this.chooseParts2&&this.chooseParts2.forEach(function(e){var a=t.model2.childList.findIndex(function(a){if(a.onlyId==e.onlyId)return a.id&&t.payIds.push(a.id),!0});t.model2.childList.splice(a,1)})},setBtn:function(t){var e=!0;e=!(t.length>0),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="<html><head><title>打印</title></head><body>"+t+"</body></html>",window.print(),window.location.reload(),!1})},changeCount2:function(t){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:{closeStatus:function(t){0==t&&179==this.auditStatus?this.canChange=!0:1==t&&(this.canChange=!1)},auditStatus:function(t,e){if(179==t&&0==this.closeStatus){var a=new Date;if(178==e){var o=a.getFullYear()+"-"+(a.getMonth()+1)+"-"+a.getDate()+" "+a.getHours()+":"+a.getMinutes()+":"+a.getSeconds();this.headDetail.auditorName=this.userInfo.name,this.headDetail.auditTime=o}this.canChange=!0}else 178==t&&(this.canChange=!1)}}}}});