yxk_pc_mdh/gyhl/static/js/58.6738aee3628e442536a2.js

1 line
32 KiB
JavaScript

webpackJsonp([58],{"0DSA":function(e,t,a){"use strict";var i=a("GKmE"),s={name:"dialogChooseFeedingItem",props:{id:{type:String,default:""},supplierId:{},supplierName:{},visible:{type:Boolean,default:!1},enableMultiFeeding:{type:Boolean,default:!1}},watch:{visible:function(e,t){e!==t&&(e&&this.getList(),this.innerVisible=e,this.$nextTick(function(){this.$refs.tb.clearSelection()}))},innerVisible:function(e,t){e!==t&&this.$emit("update:visible",e)}},data:function(){return{sourceTypeList:[{name:"采购订单",id:1}],sourceTypeId:1,subsetList:[],subsetAll:[],subsetTotal:0,searchData_Subset:{pageno:1,pagesize:5,name:"",auditSign:179},callBackData:[],innerVisible:this.visible,loading:!1,dialogLoading:!1,feedingList:[],addVisible:!1}},mounted:function(){},computed:{},methods:{getRowKey:function(e){return e.contractItemId+"_"+e.materielId},clickRow:function(e){this.$refs.tb.toggleRowSelection(e)},getList:function(){var e=this;this.supplierName&&(this.searchData_Subset.supplierName=this.supplierName),this.supplierId&&(this.searchData_Subset.supplierId=this.supplierId),this.dialogLoading=!0,this.searchData_Subset.createTime0?(this.searchData_Subset.createStartTime=Object(i.b)(this.searchData_Subset.createTime0[0]),this.searchData_Subset.createEndTime=Object(i.b)(this.searchData_Subset.createTime0[1])):(this.searchData_Subset.createStartTime="",this.searchData_Subset.createEndTime=""),this.searchData_Subset.dialogType=1,this.$api.gylPurchaseAPI.purchaseContractlistIntroduce(this.searchData_Subset).then(function(t){e.dialogLoading=!1,0===t.code&&(e.subsetList=t.data?t.data.datas:[],e.subsetTotal=t.data?t.data.totalRows:0)})},searchSubset:function(){this.searchData_Subset.pageno=1,this.getList()},ckSubsetAll:function(e){this.subsetAll=e},subsetSizeChange:function(e){this.searchData_Subset.pagesize=e,this.getList()},subsetCurrentChange:function(e){this.searchData_Subset.pageno=e,this.getList()},submit:function(e){var t=[];this.subsetAll.length>0&&this.subsetAll.forEach(function(e){t.push(e)}),this.$emit("change",t),this.innerVisible=!1},resetFields:function(){this.$refs.form&&this.$refs.form.resetFields()}}},o={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{directives:[{name:"dialogDrag",rawName:"v-dialogDrag"}],attrs:{center:"",title:"导入关联单据",visible:e.innerVisible,width:"1000px"},on:{"update:visible":function(t){e.innerVisible=t}}},[a("div",[a("el-form",{attrs:{inline:""}},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"源单类型",clearable:""}},[a("el-select",{staticStyle:{width:"150px"},attrs:{clearable:"",placeholder:"请选择"},model:{value:e.sourceTypeId,callback:function(t){e.sourceTypeId=t},expression:"sourceTypeId"}},e._l(e.sourceTypeList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:""}},[a("el-input",{staticStyle:{width:"250px"},attrs:{placeholder:"供应商模糊查询",clearable:"",disabled:""},model:{value:e.searchData_Subset.supplierName,callback:function(t){e.$set(e.searchData_Subset,"supplierName",t)},expression:"searchData_Subset.supplierName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"单据时间"}},[a("el-date-picker",{staticStyle:{width:"220px"},attrs:{type:"daterange",format:"yyyy-MM-dd","range-separator":"—","start-placeholder":"开始时间","end-placeholder":"结束时间"},model:{value:e.searchData_Subset.createTime0,callback:function(t){e.$set(e.searchData_Subset,"createTime0",t)},expression:"searchData_Subset.createTime0"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.searchSubset}},[e._v("查询")])],1)],1)],1),e._v(" "),a("div",{staticClass:"sys-table"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.dialogLoading,expression:"dialogLoading"}],ref:"tb",attrs:{"row-key":e.getRowKey,data:e.subsetList,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}},on:{"row-click":e.clickRow,"selection-change":e.ckSubsetAll}},[a("el-table-column",{attrs:{type:"selection","reserve-selection":!0,width:"55",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"createTime","show-overflow-tooltip":"",label:"单据时间",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"contractCode",label:"单据编号",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"supplierContractCode",label:"供应商合同编号",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"supplierName",label:"供应商",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"materielSerialNo",label:"物料代码",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"materielName",label:"物料名称",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"specification",label:"规格型号",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"unitUomName",label:"主计量单位",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"count",label:"数量(主单位)",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"quoteCount",label:"可执行数量(主单位)",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"supportUomName",label:"辅助单位",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"buyCount",label:"数量(辅助单位)",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"subQuoteCount",label:"可执行数量(辅助单位)",align:"center","show-overflow-tooltip":""}})],1)],1),e._v(" "),a("div",{staticClass:"sys-pagination"},[a("el-pagination",{attrs:{"current-page":e.searchData_Subset.pageno,"page-sizes":[5,10,20],"page-size":e.searchData_Subset.pagesize,layout:"total, sizes, prev, pager, next, jumper",total:e.subsetTotal},on:{"update:currentPage":function(t){return e.$set(e.searchData_Subset,"pageno",t)},"update:current-page":function(t){return e.$set(e.searchData_Subset,"pageno",t)},"size-change":e.subsetSizeChange,"current-change":e.subsetCurrentChange}})],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary",loading:e.loading},on:{click:function(t){return e.submit()}}},[e._v("确定")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.innerVisible=!1}}},[e._v("关闭")])],1)])},staticRenderFns:[]},r=a("VU/8")(s,o,!1,null,null,null);t.a=r.exports},"8EAa":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("HcwT"),s={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sys-box plan-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.back()}}},[e._v(e._s(e.config.cancelText))]),e._v(" "),178!=e.auditStatus&&e.editId?e._e():a("el-button",{directives:[{name:"has",rawName:"v-has",value:"purchase:purchase_invoice:save",expression:"'purchase:purchase_invoice:save'"}],attrs:{type:"primary",disabled:e.isDisabled},on:{click:function(t){return e.save("form")}}},[e._v("保存")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.new_save}},[e._v("新增")]),e._v(" "),e.editId&&178==e.auditStatus?a("el-button",{directives:[{name:"has",rawName:"v-has",value:"purchase:purchase_invoice:audit",expression:"'purchase:purchase_invoice:audit'"}],attrs:{type:"primary"},on:{click:function(t){return e.auditStatusChange()}}},[e._v("审核")]):e.editId&&179==e.auditStatus?a("el-button",{directives:[{name:"has",rawName:"v-has",value:"purchase:purchase_invoice:disAudit",expression:"'purchase:purchase_invoice:disAudit'"}],attrs:{type:"primary"},on:{click:function(t){return e.reverseAuditChange()}}},[e._v("反审核")]):e._e()],1),e._v(" "),a("div",{staticClass:"sys-form"},[a("el-form",{ref:"form",attrs:{"label-width":"120px",model:e.formData,rules:e.ruleForm}},[a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"供应商",prop:"supplierName"}},[a("btn-input",{attrs:{valueText:e.formData.supplierName,valueId:e.formData.supplierId,chooseVisible:e.chooseSupplierVisible,showBtn:178==e.auditStatus||!e.editId&&0==e.childList.length},on:{"update:valueText":function(t){return e.$set(e.formData,"supplierName",t)},"update:value-text":function(t){return e.$set(e.formData,"supplierName",t)},"update:valueId":function(t){return e.$set(e.formData,"supplierId",t)},"update:value-id":function(t){return e.$set(e.formData,"supplierId",t)},"update:chooseVisible":function(t){e.chooseSupplierVisible=t},"update:choose-visible":function(t){e.chooseSupplierVisible=t}}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"开票日期",prop:"invoiceDate"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{disabled:!(178==e.auditStatus||!e.editId),type:"date",placeholder:"选择开票日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd"},model:{value:e.formData.invoiceDate,callback:function(t){e.$set(e.formData,"invoiceDate",t)},expression:"formData.invoiceDate"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"收票人",prop:"drawer"}},[a("btn-input",{attrs:{valueText:e.formData.drawerName,valueId:e.formData.drawer,chooseVisible:e.chooseUserVisible,showBtn:178==e.auditStatus||!e.editId},on:{"update:valueText":function(t){return e.$set(e.formData,"drawerName",t)},"update:value-text":function(t){return e.$set(e.formData,"drawerName",t)},"update:valueId":function(t){return e.$set(e.formData,"drawer",t)},"update:value-id":function(t){return e.$set(e.formData,"drawer",t)},"update:chooseVisible":function(t){e.chooseUserVisible=t},"update:choose-visible":function(t){e.chooseUserVisible=t}}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"发票号码",prop:"invoiceNum"}},[a("el-input",{attrs:{placeholder:"原始单据号码"},model:{value:e.formData.invoiceNum,callback:function(t){e.$set(e.formData,"invoiceNum",t)},expression:"formData.invoiceNum "}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"票据类型",clearable:"",prop:"billType"}},[a("el-select",{attrs:{clearable:"",disabled:!(178==e.auditStatus||!e.editId),placeholder:"请选择"},model:{value:e.formData.billType,callback:function(t){e.$set(e.formData,"billType",t)},expression:"formData.billType"}},e._l(e.billList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"预计付款日期"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{disabled:!(178==e.auditStatus||!e.editId),type:"date",placeholder:"选择预计付款日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.formData.paymentDate,callback:function(t){e.$set(e.formData,"paymentDate",t)},expression:"formData.paymentDate"}})],1)],1)]),e._v(" "),a("el-divider",{attrs:{"content-position":"left"}},[e._v("关联单据")]),e._v(" "),a("el-form",[a("el-form-item",{staticClass:"childlist",attrs:{prop:"childList"}},[178!=e.auditStatus&&e.editId?e._e():a("div",{staticClass:"sys-operate",staticStyle:{"margin-bottom":"10px"}},[a("el-button",{attrs:{type:"primary"},on:{click:e.ChooseImportShow}},[e._v("导入关联单据")]),e._v(" "),a("el-button",{attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:function(t){return e.removePart()}}},[e._v("删除")])],1),e._v(" "),a("el-table",{attrs:{data:e.childList,"show-summary":"","summary-method":e.getSummaries,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"},border:""},on:{"selection-change":e.handlePartChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"serialNo",label:"物料代码",align:"center","show-overflow-tooltip":"","label-class-name":"required_head"}}),e._v(" "),a("el-table-column",{attrs:{prop:"materielName",label:"物料名称",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"specification",align:"center","show-overflow-tooltip":"",label:"规格型号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"unitUomName",align:"center","show-overflow-tooltip":"",label:"主计量单位"}}),e._v(" "),a("el-table-column",{attrs:{prop:"count",align:"center",label:"主单位数量","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"supportUomName",align:"center",label:"辅助单位","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"convCoefficient",align:"center",label:"换算系数"}}),e._v(" "),a("el-table-column",{attrs:{prop:"subQuoteCount",align:"center",width:"180",label:"数量","label-class-name":"required_head"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{class:t.row.error_count?"error_count":""},[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,disabled:!(178===e.auditStatus||!e.editId),size:"small",precision:t.row.quantityAccuracy,"controls-position":"right"},on:{change:function(a){return e.changeCount2(t.row)}},model:{value:t.row.subQuoteCount,callback:function(a){e.$set(t.row,"subQuoteCount",a)},expression:"scope.row.subQuoteCount"}})],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"unitPrice",align:"center",width:"180",label:"不含税单价(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,disabled:!(178==e.auditStatus||!e.editId),size:"small",precision:t.row.priceAccuracy,"controls-position":"right"},on:{change:function(a){return e.changeUnitPrice(t.row)}},model:{value:t.row.unitPrice,callback:function(a){e.$set(t.row,"unitPrice",a)},expression:"scope.row.unitPrice"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"taxUnitPrice",align:"center",width:"140",label:"含税单价(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e.setCalculate(t.row.subQuoteCount,t.row.unitPrice,t.row.taxRate,t.row.priceAccuracy,"taxUnitPrice")))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"taxRate",align:"center",width:"120",label:"税率(%)","label-class-name":"required_head"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,max:100,disabled:!(178==e.auditStatus||!e.editId),size:"small","controls-position":"right"},on:{change:function(a){return e.changeTaxRate(t.row,t.$index)}},model:{value:t.row.taxRate,callback:function(a){e.$set(t.row,"taxRate",a)},expression:"scope.row.taxRate"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"amount",align:"center",width:"180",label:"不含税金额(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,size:"small","controls-position":"right",disabled:!(178==e.auditStatus||!e.editId)},on:{change:function(a){return e.changeAmount(t.row)}},model:{value:t.row.amount,callback:function(a){e.$set(t.row,"amount",a)},expression:"scope.row.amount"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"taxes",align:"center",width:"140",label:"税额(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,size:"small","controls-position":"right",disabled:!(178==e.auditStatus||!e.editId)},model:{value:t.row.taxes,callback:function(a){e.$set(t.row,"taxes",a)},expression:"scope.row.taxes"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"taxAmount",align:"center",width:"140",label:"价格合计(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e.setCalculate(t.row.subQuoteCount,t.row.unitPrice,t.row.taxRate,t.row.priceAccuracy,"taxAmount")))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"remarks",width:"220",align:"center",label:"备注"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input",{staticStyle:{width:"100%"},attrs:{type:"textarea",autosize:{minRows:1},clearable:"",disabled:!(178==e.auditStatus||!e.editId)},model:{value:t.row.remarks,callback:function(a){e.$set(t.row,"remarks",a)},expression:"scope.row.remarks"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"sourceTypeName",align:"center",label:"源单类型",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.sourceTypeName?a("div",[e._v(e._s(t.row.sourceTypeName))]):a("div")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"sourceCode","show-overflow-tooltipalign":"",label:"源单单号"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticStyle:{color:"#3a8ee6"},on:{click:function(a){return e.goToLink(t.queryId)}}},[e._v(e._s(t.row.sourceCode))])]}}])})],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"remarks"}},[a("el-input",{attrs:{type:"textarea",disabled:!(178==e.auditStatus||!e.editId),autosize:{minRows:4},placeholder:"请简要填写备注内容"},model:{value:e.formData.remarks,callback:function(t){e.$set(e.formData,"remarks",t)},expression:"formData.remarks"}})],1)],1),e._v(" "),e.editId?a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:5}},[e._v("制单人:"+e._s(e.headDetail.createByName))]),e._v(" "),a("el-col",{attrs:{span:7}},[e._v("制单时间:"+e._s(e.headDetail.createTime))]),e._v(" "),179==e.initiate_auditStatus?a("el-col",{attrs:{span:5}},[e._v("审核人:"+e._s(e.headDetail.auditorName))]):e._e(),e._v(" "),179==e.initiate_auditStatus?a("el-col",{attrs:{span:7}},[e._v("审核时间:"+e._s(e.headDetail.auditTime))]):e._e()],1):e._e()],1),e._v(" "),a("dialogImportPurchaseInvoice",{attrs:{visible:e.ChooseImport,supplierName:e.formData.supplierName,supplierId:e.formData.supplierId},on:{"update:visible":function(t){e.ChooseImport=t},change:e.getImport}}),e._v(" "),a("dialogChooseSingleUser",{attrs:{visible:e.chooseUserVisible},on:{"update:visible":function(t){e.chooseUserVisible=t},change:e.getUser}}),e._v(" "),a("dialogChooseSingleSupplier",{attrs:{visible:e.chooseSupplierVisible,dataForm:e.formData},on:{"update:visible":function(t){e.chooseSupplierVisible=t},change:e.getSupplier}})],1)},staticRenderFns:[]};var o=function(e){a("gDJq"),a("hhMT")},r=a("VU/8")(i.a,s,!1,o,"data-v-50814a65",null);t.default=r.exports},HcwT: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_slicedToArray__=__webpack_require__("d7EF"),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_slicedToArray___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_slicedToArray__),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_promise__=__webpack_require__("//Fk"),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_promise___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_promise__),__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_dialogChooseSingleSuppliers__=__webpack_require__("FnMF"),__WEBPACK_IMPORTED_MODULE_10__components_System_dialogChooseParts_vue__=__webpack_require__("CdUU"),__WEBPACK_IMPORTED_MODULE_11__invoice_dialogImportPurchaseInvoice__=__webpack_require__("0DSA"),__WEBPACK_IMPORTED_MODULE_12__utils_config_js__=__webpack_require__("bzuE"),__WEBPACK_IMPORTED_MODULE_13_js_cookie__=__webpack_require__("lbHh"),__WEBPACK_IMPORTED_MODULE_13_js_cookie___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13_js_cookie__);__webpack_exports__.a={inject:["reload"],components:{btnInput:__WEBPACK_IMPORTED_MODULE_6__components_btnInput_vue__.a,dialogChooseParts:__WEBPACK_IMPORTED_MODULE_10__components_System_dialogChooseParts_vue__.a,dialogChooseSingleUser:__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseSingleUser__.a,dialogChooseSingleSupplier:__WEBPACK_IMPORTED_MODULE_9__components_System_dialogChooseSingleSuppliers__.a,dialogImportPurchaseInvoice:__WEBPACK_IMPORTED_MODULE_11__invoice_dialogImportPurchaseInvoice__.a},data:function(){return{billList:[],userInfo:"",config:__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a,editId:"",auditStatus:"",initiate_auditStatus:"",childList:[],itemIds:[],formData:{invoiceDate:Object(__WEBPACK_IMPORTED_MODULE_5__utils_tools_js__.c)(),supplierName:"",supplierId:"",drawerName:"",drawer:""},ChooseImport:!1,ruleForm:{supplierName:[{required:!0,message:"请选择供应商",trigger:"change"}],invoiceDate:[{required:!0,message:"请选择开票日期",trigger:"change"}],drawer:[{required:!0,message:"请填写收票人",trigger:"change"}],invoiceNum:[{required:!0,message:"请填写发票号码",trigger:"change"}],billType:[{required:!0,message:"请选择票据类型",trigger:"change"}]},ChooseMaterielVisible:!1,chooseUserVisible:!1,chooseSupplierVisible:!1,btnDelDisabled:!0,isDisabled:!1,headDetail:{}}},computed:__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_7_vuex__.c)({})),mounted:function(){this.initialize(),this.editId=this.$route.query.id,this.userInfo=JSON.parse(__WEBPACK_IMPORTED_MODULE_13_js_cookie___default.a.get("userInfo")),this.editId&&this.getDetail(),this.$route.query.dataForm&&(this.formData=JSON.parse(this.$route.query.dataForm))},methods:__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_7_vuex__.d)({removeTagNav:"tagNav/removeTagNav"}),{changeTaxRate:function(e){e.taxes=(e.subQuoteCount*e.unitPrice*(1+e.taxRate/100)-e.subQuoteCount*e.unitPrice).toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.amountFixedTo)},changeUnitPrice:function(e){e.subQuoteCount&&e.unitPrice?(e.amount=(e.subQuoteCount*e.unitPrice).toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.amountFixedTo),e.taxes=(e.subQuoteCount*e.unitPrice*(1+e.taxRate/100)-e.subQuoteCount*e.unitPrice).toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.amountFixedTo)):(e.amount=0,e.taxes=0)},changeAmount:function(e){e.subQuoteCount&&e.unitPrice?(e.unitPrice=(e.amount/e.subQuoteCount).toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.priceFixedTo),e.taxes=(e.subQuoteCount*e.unitPrice*(1+e.taxRate/100)-e.subQuoteCount*e.unitPrice).toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.amountFixedTo)):(e.taxes=0,e.unitPrice=0)},changeCount:function(e){if(e.subQuoteCount&&e.unitPrice?(e.amount=(e.subQuoteCount*e.unitPrice).toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.amountFixedTo),e.taxes=(e.subQuoteCount*e.unitPrice*(1+e.taxRate/100)-e.subQuoteCount*e.unitPrice).toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.amountFixedTo)):(e.amount=0,e.taxes=0),e.error_count){for(var t=0,a=0;a<this.childList.length;a++)e.error_count&&e.sourceId==this.childList[a].sourceId&&(t=parseFloat(t)+parseFloat(this.childList[a].count));parseFloat(e.sourceCount)>=t&&this.childList.forEach(function(t){t.sourceId==e.sourceId&&delete t.error_count})}},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/purchase/purchase_invoice_index",query:{t:Date.now()}})},initialize:function(){var e=this;__WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_promise___default.a.all([this.$api.gylCommonAPI.getDictsByType({type:"bill_type"})]).then(function(t){var a=__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_slicedToArray___default()(t,1)[0];0===a.code&&(e.billList=a.datas)}).catch(function(e){})},ChooseImportShow:function(){this.formData.supplierId?this.ChooseImport=!0:this.$message({message:"请先选择供应商",type:"warning"})},setCalculate:function(e,t,a,i,s){return e&&t?"taxAmount"==s?(parseFloat(t)*parseFloat(e)*(1+parseFloat(a)/100)).toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.amountFixedTo):"taxUnitPrice"==s?(parseFloat(t)*(1+parseFloat(a)/100)).toFixed(i):"amount"==s?(parseFloat(t)*parseFloat(e)).toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.amountFixedTo):"taxes"==s?(parseFloat(t)*parseFloat(e)*(1+parseFloat(a)/100)-parseFloat(t)*parseFloat(e)).toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.amountFixedTo):void 0:0},getUser:function(e){e?(this.$set(this.formData,"drawerName",e.name),this.$set(this.formData,"drawer",e.id)):(this.$set(this.formData,"drawer",""),this.$set(this.formData,"drawerName",""))},getSupplier:function(e){e?(this.$set(this.formData,"supplierId",e.id),this.$set(this.formData,"supplierName",e.name)):(this.$set(this.formData,"supplierId",""),this.$set(this.formData,"supplierName",""))},getSummaries:function(e){for(var t=e.columns,a=e.data,i=0;i<a.length;i++)a[i].count;for(var s=0;s<a.length;s++)a[s].count*a[s].unitPrice;for(var o=[],r=0,n=0;n<a.length;n++)a[n].subQuoteCount&&a[n].unitPrice&&(r+=parseFloat(a[n].unitPrice)*parseFloat(a[n].subQuoteCount)*(1+parseFloat(a[n].taxRate)/100));for(var l=0,u=0;u<a.length;u++)a[u].subQuoteCount&&a[u].unitPrice&&(l+=a[u].subQuoteCount*a[u].unitPrice);return t.forEach(function(e,t){if(0!==t)if(5===t||8===t||12===t||13===t||14===t)if(12!==t)if(13!==t)if(14!==t){var i=a.map(function(t){return Number(t[e.property])});i.every(function(e){return isNaN(e)})?o[t]="":o[t]=i.reduce(function(e,t){var a=Number(t);return isNaN(a)?e:e+t},0),5!==t&&8!==t||o[t]&&(o[t]=o[t].toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.countFixedTo))}else o[t]=r.toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.amountFixedTo);else o[t]=(parseFloat(r)-parseFloat(l)).toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.amountFixedTo);else o[t]=l.toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.amountFixedTo);else o[t]="";else o[t]="合计"}),o},setPriceAll:function(e,t){return e&&t?(parseFloat(e)*parseFloat(t)).toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.amountFixedTo):0},getMateriel:function(e){var t=this;e&&e.forEach(function(e){t.$set(e,"count",0),t.$set(e,"unitPrice",e.salePrice?e.salePrice:0),t.$set(e,"materielName",e.name?e.name:0),t.$set(e,"materielId",e.id),t.$set(e,"onlyId",e.id+"_"+Math.random()),delete e.id,t.childList.push(e)})},getImport:function(e){var t=this;e&&e.forEach(function(e){t.$set(e,"taxRate",e.taxRate?e.taxRate:0),t.$set(e,"unitUom",e.unitUom?e.unitUom:""),t.$set(e,"count",e.count?e.count:0),t.$set(e,"subQuoteCount",e.subQuoteCount?e.subQuoteCount:0),t.$set(e,"unitPrice",e.unitPrice?e.unitPrice:0),t.$set(e,"materielName",e.materielName),t.$set(e,"serialNo",e.materielSerialNo),t.$set(e,"materielId",e.materielId),t.$set(e,"onlyId",e.id+"_"+Math.random()),t.$set(e,"sourceId",e.contractItemId),t.$set(e,"sourceCode",e.contractCode),e.thisSourceType&&(t.$set(e,"sourceTypeName",e.thisSourceTypeName?e.thisSourceTypeName:""),t.$set(e,"sourceType",e.thisSourceType)),delete e.id,t.childList.push(e)})},getDetail:function(){var e=this;this.$api.gylPurchaseAPI.InvoiceDetailOfInvoice({id:this.editId}).then(function(t){0===t.code?(e.formData=__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_assign___default()({},t.detailOfHead),e.auditStatus=e.formData.auditSign,e.initiate_auditStatus=e.formData.auditSign,e.childList=t.detailOfBody,e.childList.forEach(function(t){e.$set(t,"onlyId",t.materielId+"_"+Math.random())}),e.$set(e.headDetail,"createByName",t.detailOfHead.createByName),e.$set(e.headDetail,"createTime",t.detailOfHead.createTime),e.$set(e.headDetail,"auditorName",t.detailOfHead.auditorName),e.$set(e.headDetail,"auditTime",t.detailOfHead.auditTime)):e.$message({message:t.msg,type:"error"})})},auditStatusChange:function(){var e=this;this.$confirm("确定审核吗?","提示",{type:"warning"}).then(function(){e.$api.gylPurchaseAPI.InvoiceAudit({id:e.editId}).then(function(t){0===t.code?(e.$message({type:"success",message:"审核成功!"}),e.getDetail()):e.$message({message:t.msg,type:"error"})})}).catch(function(){e.$message({type:"info",message:"已取消"})})},reverseAuditChange:function(){var e=this;this.$confirm("确定反审核吗?","提示",{type:"warning"}).then(function(){e.$api.gylPurchaseAPI.InvoiceReverseAudit({id:e.editId}).then(function(t){0===t.code?(e.$message({type:"success",message:"反审核成功!"}),e.getDetail()):e.$message({message:t.msg,type:"error"})})}).catch(function(){e.$message({type:"info",message:"已取消"})})},save:function(e){var t=this,a=[];this.childList.forEach(function(e){var i={materielId:e.materielId,count:e.count.toFixed(e.quantityAccuracy),supportUom:e.supportUom,convCoefficient:e.convCoefficient,purchaseCount:e.subQuoteCount?e.subQuoteCount.toFixed(e.quantityAccuracy):0,unitPrice:e.unitPrice?e.unitPrice.toFixed(e.priceAccuracy):0,taxUnitPrice:t.setCalculate(e.subQuoteCount,e.unitPrice,e.taxRate,e.priceAccuracy,"taxUnitPrice"),taxRate:e.taxRate?e.taxRate.toFixed(__WEBPACK_IMPORTED_MODULE_12__utils_config_js__.a.taxRateFixedTo):0,amount:t.setCalculate(e.subQuoteCount,e.unitPrice,e.taxRate,e.priceAccuracy,"amount"),taxes:t.setCalculate(e.subQuoteCount,e.unitPrice,e.taxRate,e.priceAccuracy,"taxes"),taxAmount:t.setCalculate(e.subQuoteCount,e.unitPrice,e.taxRate,e.priceAccuracy,"taxAmount"),remarks:e.remarks?e.remarks:""};e.sourceId&&(i.sourceId=e.sourceId,i.sourceType=e.sourceType?e.sourceType:"",i.sourceCode=e.sourceCode?e.sourceCode:""),e.id&&(i.id=e.id),a.push(i)});var i={supplierId:this.formData.supplierId,invoiceDate:this.formData.invoiceDate,paymentDate:this.formData.paymentDate?this.formData.paymentDate:"",drawer:this.formData.drawer,invoiceNum:this.formData.invoiceNum,billType:this.formData.billType,remarks:this.formData.remarks?this.formData.remarks:"",bodyItem:__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(a),itemIds:this.itemIds};this.editId&&(i.id=this.editId),this.$refs[e].validate(function(e){if(!e)return!1;if(0!=a.length){var s=!0;t.childList.forEach(function(e){e.subQuoteCount<=0&&(s=!1)}),s?t.isDisabled||(t.isDisabled=!0,t.$api.gylPurchaseAPI.InvoiceAddOrChange(i).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"})):500===e.code&&e.data?(t.$message({message:e.msg,type:"error"}),t.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.$message({message:e.msg,type:"error"})})):t.$message({message:"数量必须大于0",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={invoiceDate:Object(__WEBPACK_IMPORTED_MODULE_5__utils_tools_js__.c)()},this.auditStatus="",this.initiate_auditStatus="",this.childList=[],this.itemIds=[],this.headDetail={},this.editId&&(this.editId=void 0),this.$refs.form.resetFields()},removePart:function(){var e=this;this.chooseParts&&this.chooseParts.forEach(function(t){var a=e.childList.findIndex(function(a){if(a.onlyId==t.onlyId)return a.id&&e.itemIds.push(a.id),!0});e.childList.splice(a,1)})},setBtn:function(e){var t=!0;t=!(e.length>0),this.btnDelDisabled=t},handlePartChange:function(e){this.chooseParts=e,this.setBtn(e)},changeCount2:function(e){isNaN(e.convCoefficient)||isNaN(e.subQuoteCount)?e.count=0:e.count=parseFloat((parseFloat(e.convCoefficient)*parseFloat(e.subQuoteCount)).toFixed(e.quantityAccuracy)),this.changeCount(e)},goToLink:function(e){this.$router.push({path:"/purchase/purchase_contract_add",query:{id:e,t:Date.now()}})}}),watch:{}}},gDJq:function(e,t){},hhMT:function(e,t){}});