1 line
28 KiB
JavaScript
1 line
28 KiB
JavaScript
webpackJsonp([64],{"4nuK":function(e,t,a){"use strict";var i=a("bzuE"),r={props:{id:{type:String,default:""},supplierId:"",supplierName:"",visible:{type:Boolean,default:!1}},watch:{visible:function(e,t){e!==t&&(e&&this.initData(),this.innerVisible=e,this.$nextTick(function(){this.$refs.tb.clearSelection()}))},innerVisible:function(e,t){e!==t&&this.$emit("update:visible",e)},time:function(e){e?(this.searchData_Subset.dueStartDate=e[0],this.searchData_Subset.dueEndDate=e[1]):(this.searchData_Subset.dueStartDate="",this.searchData_Subset.dueEndDate="")}},data:function(){return{subsetList:[],subsetArr:[],subsetTotal:0,searchData_Subset:{pageno:1,pagesize:5,isDialog:1,closeStatus:0,auditSign:179},time:"",contractDate:"",callBackData:[],innerVisible:this.visible,loading:!1,dialogLoading:!1,sourceTypeId:205,sourceType:205,deviceDept:[],addVisible:!1,config:i.a}},computed:{},mounted:function(){},methods:{getRowKey:function(e){return e.itemId},clickRow:function(e){this.$refs.tb.toggleRowSelection(e)},initData:function(){this.searchSubset()},searchSubset:function(){var e=this;this.supplierId&&(this.searchData_Subset.supplierName=this.supplierName,this.searchData_Subset.supplierId=this.supplierId),this.dialogLoading=!0,this.time?(this.searchData_Subset.dueStartDate=this.time[0],this.searchData_Subset.dueEndDate=this.time[1]):(this.searchData_Subset.dueStartDate="",this.searchData_Subset.dueEndDate=""),this.$api.paymentOrderAPI.findToPaymentOrder(this.searchData_Subset).then(function(t){e.dialogLoading=!1,0==t.code&&(e.subsetList=t.data?t.data.records:[],e.subsetTotal=t.data?t.data.total:0)})},ckSubsetAll:function(e){this.subsetArr=e},subsetSizeChange:function(e){this.searchData_Subset.pagesize=e,this.searchSubset()},subsetCurrentChange:function(e){this.searchData_Subset.pageno=e,this.searchSubset()},submit:function(e){var t=[];this.subsetArr.length>0&&this.subsetArr.forEach(function(e){t.push(e)}),this.$emit("change",t),this.innerVisible=!1},resetFields:function(){this.$refs.form&&this.$refs.form.resetFields()}}},n={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:"900px"},on:{"update:visible":function(t){e.innerVisible=t}}},[a("div",[a("el-form",{attrs:{inline:""}},[a("div",{staticClass:"flex"},[a("el-form-item",{attrs:{label:"供应商"}},[a("el-input",{staticStyle:{width:"250px"},attrs:{placeholder:"请选择",readonly:""},model:{value:e.supplierName,callback:function(t){e.supplierName=t},expression:"supplierName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"单据日期"}},[a("el-date-picker",{attrs:{type:"datetimerange",format:"yyyy-MM-dd HH:mm:ss","value-format":"yyyy-MM-dd HH:mm:ss","range-separator":"—","start-placeholder":"开始时间","end-placeholder":"结束时间"},model:{value:e.time,callback:function(t){e.time=t},expression:"time"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return 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:"supplierName",label:"供应商",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"code",label:"单据编号",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"dueDate",label:"应付日期",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"payAmount",label:"申请付款金额(元)",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"paymentOrderAmount",label:"已付金额(元)",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"paymentOrderSurplusAmount",label:"未付金额(元)",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"remark",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",size:"small",loading:e.loading},on:{click:function(t){return e.submit()}}},[e._v("确定")]),e._v(" "),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){e.innerVisible=!1}}},[e._v(e._s(e.config.cancelText))])],1)])},staticRenderFns:[]},s=a("VU/8")(r,n,!1,null,null,null);t.a=s.exports},URd2:function(e,t){},d5aP:function(e,t){},l3hb:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("qq0v"),r={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(" "),1!=e.auditStatus?a("el-button",{attrs:{type:"primary",disabled:e.isDisabled},on:{click:function(t){return e.save()}}},[e._v("保存")]):e._e(),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.clear}},[e._v("新增")]),e._v(" "),0==e.auditStatus?a("el-button",{attrs:{type:"primary"},on:{click:e.audit}},[e._v("审核")]):e._e(),e._v(" "),1==e.auditStatus?a("el-button",{attrs:{type:"primary"},on:{click:e.disAudit}},[e._v("反审核")]):e._e()],1),e._v(" "),a("div",{staticClass:"sys-form"},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"form",attrs:{"label-width":"120px","inline-message":!0,model:e.formData.paymentOrder,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.paymentOrder.supplierName,valueId:e.formData.paymentOrder.supplierId,chooseVisible:e.chooseSupplierVisible,showBtn:1!=e.auditStatus&&0==e.formData.paymentOrderItemList.length},on:{"update:valueText":function(t){return e.$set(e.formData.paymentOrder,"supplierName",t)},"update:value-text":function(t){return e.$set(e.formData.paymentOrder,"supplierName",t)},"update:valueId":function(t){return e.$set(e.formData.paymentOrder,"supplierId",t)},"update:value-id":function(t){return e.$set(e.formData.paymentOrder,"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:"payDate"}},[a("el-date-picker",{attrs:{type:"date",format:"yyyy-MM-dd","range-separator":"—",placeholder:"选择日期","value-format":"yyyy-MM-dd",clearable:"",disabled:1==e.auditStatus},model:{value:e.formData.paymentOrder.payDate,callback:function(t){e.$set(e.formData.paymentOrder,"payDate",t)},expression:"formData.paymentOrder.payDate"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"付款人",prop:"payerName"}},[a("btn-input",{attrs:{valueText:e.formData.paymentOrder.payerName,valueId:e.formData.paymentOrder.payerId,chooseVisible:e.chooseUserVisible,showBtn:1!=e.auditStatus},on:{"update:valueText":function(t){return e.$set(e.formData.paymentOrder,"payerName",t)},"update:value-text":function(t){return e.$set(e.formData.paymentOrder,"payerName",t)},"update:valueId":function(t){return e.$set(e.formData.paymentOrder,"payerId",t)},"update:value-id":function(t){return e.$set(e.formData.paymentOrder,"payerId",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:"paymentType"}},[a("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:e.formData.paymentOrder.paymentType,callback:function(t){e.$set(e.formData.paymentOrder,"paymentType",t)},expression:"formData.paymentOrder.paymentType"}},e._l(e.typeList1,function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id,disabled:1==e.auditStatus}})}),1)],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"发票日期"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{disabled:1==e.auditStatus,type:"date",placeholder:"选择发票日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd"},model:{value:e.formData.paymentOrder.invoiceDate,callback:function(t){e.$set(e.formData.paymentOrder,"invoiceDate",t)},expression:"formData.paymentOrder.invoiceDate"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"发票号码"}},[a("el-input",{attrs:{disabled:1==e.auditStatus},model:{value:e.formData.paymentOrder.invoiceCode,callback:function(t){e.$set(e.formData.paymentOrder,"invoiceCode",t)},expression:"formData.paymentOrder.invoiceCode"}})],1)],1)]),e._v(" "),a("div",{staticStyle:{float:"right"}},[e._v("付款单号:"+e._s(e.formData.paymentOrder.code))]),e._v(" "),a("el-divider",{attrs:{"content-position":"left"}},[a("div",[e._v("关联单据")])]),e._v(" "),a("el-form",{ref:"formChild",attrs:{rules:e.formData.rules,model:e.formData.paymentOrderItemList}},[a("el-form-item",{staticClass:"childlist",attrs:{prop:"paymentOrderItemList"}},[a("div",{staticClass:"sys-operate",staticStyle:{"margin-bottom":"10px"}},[e.btnDisabled&&1!=e.auditStatus?a("el-button",{attrs:{type:"primary"},on:{click:e.ChooseImportShow}},[e._v("新增")]):e._e(),e._v(" "),1!=e.auditStatus?a("el-button",{attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:function(t){return e.removePart()}}},[e._v("删除\n ")]):e._e()],1),e._v(" "),a("el-table",{attrs:{data:e.formData.paymentOrderItemList,"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:"payApplyAmount",label:"申请付款金额(元)",width:"140",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"payAmount",align:"center",width:"180",label:"实付金额(元)","label-class-name":"required_head"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{attrs:{prop:"paymentOrderItemList."+t.$index+".payAmount",rules:e.formData.rules.payAmount}},[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,size:"small","controls-position":"right",disabled:1==e.auditStatus},model:{value:t.row.payAmount,callback:function(a){e.$set(t.row,"payAmount",a)},expression:"scope.row.payAmount"}})],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"accountNumber",align:"center",width:"250",label:"付款账号"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{attrs:{prop:"paymentOrderItemList."+t.$index+".accountNumber",rules:e.formData.rules.accountNumber}},[a("el-select",{staticStyle:{width:"100%"},attrs:{disabled:1==e.auditStatus,clearable:"",placeholder:"请选择"},model:{value:t.row.fundInitializationId,callback:function(a){e.$set(t.row,"fundInitializationId",a)},expression:"scope.row.fundInitializationId"}},e._l(e.accountNumberList,function(e){return a("el-option",{key:e.id,attrs:{label:e.accountNumber,value:e.id}})}),1)],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"settlementType",align:"center",width:"140",label:"结算方式"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{attrs:{prop:"paymentOrderItemList."+t.$index+".settlementType",rules:e.formData.rules.settlementType}},[a("el-select",{attrs:{disabled:1==e.auditStatus,clearable:"",placeholder:"请选择"},model:{value:t.row.settlementType,callback:function(a){e.$set(t.row,"settlementType",a)},expression:"scope.row.settlementType"}},e._l(e.settlementTypeList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"incomePayTypeName",align:"center",width:"220",label:"收支类型"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("btn-input",{attrs:{valueText:t.row.incomePayTypeName,valueId:t.row.incomePayTypeId,chooseVisible:e.choosePaymentTypeVisible,currentIndex:e.currentIndex,index:t.$index,showBtn:1!=e.auditStatus},on:{"update:valueText":function(a){return e.$set(t.row,"incomePayTypeName",a)},"update:value-text":function(a){return e.$set(t.row,"incomePayTypeName",a)},"update:valueId":function(a){return e.$set(t.row,"incomePayTypeId",a)},"update:value-id":function(a){return e.$set(t.row,"incomePayTypeId",a)},"update:chooseVisible":function(t){e.choosePaymentTypeVisible=t},"update:choose-visible":function(t){e.choosePaymentTypeVisible=t},"update:currentIndex":function(t){e.currentIndex=t},"update:current-index":function(t){e.currentIndex=t}}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"remark",align:"center",width:"220",label:"备注"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input",{staticStyle:{width:"100%"},attrs:{type:"textarea",autosize:{minRows:1},clearable:"",disabled:1==e.auditStatus},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:"sourceCode",label:"源单编号",align:"center","show-overflow-tooltip":""}})],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"remarks"}},[a("el-input",{attrs:{type:"textarea",autosize:{minRows:4},placeholder:"请简要填写备注内容",disabled:1==e.auditStatus},model:{value:e.formData.paymentOrder.remarks,callback:function(t){e.$set(e.formData.paymentOrder,"remarks",t)},expression:"formData.paymentOrder.remarks"}})],1),e._v(" "),a("el-form-item",{staticClass:"remarkstyle",attrs:{label:"附件","label-width":"50px"}},[e.advanceQueryDialogVisible?a("upload",{attrs:{title:"",label_width:"0",attachment:e.uploadAttachment,disabled:e.uplaodDisabled},on:{"update:attachment":function(t){e.uploadAttachment=t}}}):e._e()],1)],1),e._v(" "),e.consumingStockId?a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:5}},[e._v("制单人:"+e._s(e.formData.paymentOrder.createUserName))]),e._v(" "),a("el-col",{attrs:{span:7}},[e._v("制单时间:"+e._s(e.formData.paymentOrder.createTime))]),e._v(" "),a("el-col",{attrs:{span:5}},[e._v("审核人:"+e._s(e.formData.paymentOrder.auditorName))]),e._v(" "),a("el-col",{attrs:{span:7}},[e._v("审核时间:"+e._s(e.formData.paymentOrder.auditTime))])],1):e._e()],1),e._v(" "),a("dialogChooseSingleSupplier",{attrs:{visible:e.chooseSupplierVisible},on:{"update:visible":function(t){e.chooseSupplierVisible=t},change:e.getSupplier}}),e._v(" "),a("DialogChooseSingleUser",{attrs:{visible:e.chooseUserVisible},on:{"update:visible":function(t){e.chooseUserVisible=t},change:e.getUser}}),e._v(" "),a("DialogChooseSalesContract",{attrs:{visible:e.chooseContractVisible,supplierName:e.formData.paymentOrder.supplierName,supplierId:e.formData.paymentOrder.supplierId},on:{"update:visible":function(t){e.chooseContractVisible=t},change:e.getSalesOutStock}}),e._v(" "),a("dialogChooseSinglePaymentType",{attrs:{visible:e.choosePaymentTypeVisible},on:{"update:visible":function(t){e.choosePaymentTypeVisible=t},change:e.getPaymentType}})],1)},staticRenderFns:[]};var n=function(e){a("URd2"),a("d5aP")},s=a("VU/8")(i.a,r,!1,n,"data-v-ad83840a",null);t.default=s.exports},qq0v:function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify__=__webpack_require__("mvHQ"),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify__),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__=__webpack_require__("Dd8w"),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty__=__webpack_require__("bOdI"),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty__),__WEBPACK_IMPORTED_MODULE_3__components_btnInput_vue__=__webpack_require__("ysqt"),__WEBPACK_IMPORTED_MODULE_4__dialogChooseSalesContract__=__webpack_require__("4nuK"),__WEBPACK_IMPORTED_MODULE_5__components_Dialog_dialogChooseSinglePaymentType__=__webpack_require__("iglq"),__WEBPACK_IMPORTED_MODULE_6_vuex__=__webpack_require__("NYxO"),__WEBPACK_IMPORTED_MODULE_7__components_System_dialogChooseSingleSuppliers__=__webpack_require__("FnMF"),__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseSingleUser__=__webpack_require__("3MlD"),__WEBPACK_IMPORTED_MODULE_9__utils_config_js__=__webpack_require__("bzuE"),__WEBPACK_IMPORTED_MODULE_10__components_System_upload__=__webpack_require__("veZ4");__webpack_exports__.a={inject:["reload"],components:{btnInput:__WEBPACK_IMPORTED_MODULE_3__components_btnInput_vue__.a,DialogChooseSingleUser:__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseSingleUser__.a,dialogChooseSingleSupplier:__WEBPACK_IMPORTED_MODULE_7__components_System_dialogChooseSingleSuppliers__.a,DialogChooseSalesContract:__WEBPACK_IMPORTED_MODULE_4__dialogChooseSalesContract__.a,dialogChooseSinglePaymentType:__WEBPACK_IMPORTED_MODULE_5__components_Dialog_dialogChooseSinglePaymentType__.a,upload:__WEBPACK_IMPORTED_MODULE_10__components_System_upload__.a},data:function(){var e;return e={editId:"",formData:{paymentOrder:{supplierName:"",payerName:"",payDate:"",paymentTypeName:"",code:"",invoiceDate:"",invoiceCode:"",totalPayApplyAmount:0,totalPayAmount:0},paymentOrderItemList:[],rules:{payAmount:{required:!0,message:"本次付款必填",trigger:"change"}}},ruleForm:{supplierName:[{required:!0,message:"请选择供应商",trigger:"change"}],payDate:[{required:!0,message:"请选择付款时间",trigger:"change"}],payerName:[{required:!0,message:"请选择付款人",trigger:"change"}],paymentType:[{required:!0,message:"请选择付款类型",trigger:"change"}]},currentIndex:0,auditStatus:"",uplaodDisabled:1,config:__WEBPACK_IMPORTED_MODULE_9__utils_config_js__.a,typeList1:[],accountNumberList:[],settlementTypeList:[],urrentChildIndex:"",btnDisabled:!0,itemIds:[],consumingStockId:"",availableCount:0,totalCount:0,choosePaymentTypeVisible:!1,btnOtherDisabled:!0,btnDelDisabled:!1,chooseOperatorVisible:!1,ChooseMaterielVisible:!1,chooseSupplierVisible:!1,ChooseStockVisible:!1,chooseContractVisible:!1,chooseUserVisible:!1,loading:!1,isDisabled:!1,materielId:""},__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()(e,"currentIndex",""),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()(e,"uploadAttachment",[]),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()(e,"advanceQueryDialogVisible",!0),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()(e,"printTotal",{count:"",amount:""}),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()(e,"printList",[]),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()(e,"printForm",[{title:"物料代码",prop_:"materielSerialNo"},{title:"物料名称",prop_:"materielName"},{title:"规格型号",prop_:"specification"},{title:"单位",prop_:"unitUomName"},{title:"批号",prop_:"batch"},{title:"数量",prop_:"count"},{title:"单价",prop_:"unitPrice"},{title:"金额",prop_:"amount"},{title:"仓库",prop_:"facName"},{title:"库位",prop_:"locationName"}]),e},mounted:function(){if(this.$route.query.id)this.editId=this.$route.query.id,this.consumingStockId=this.$route.query.id,this.getDetail();else{var e=new Date;this.$set(this.formData.paymentOrder,"payDate",e.getFullYear()+"-"+this.settime(e.getMonth()+1)+"-"+this.settime(e.getDate()))}this.initData()},watch:{consumingStockId:{handler:function(e,t){this.btnDelDisabled=""!=e&&void 0!=e}},"formData.paymentOrderItemList":function(e){e.length>0?this.btnDisabled=!1:this.btnDisabled=!0},currentIndex:function(e){this.currentChildIndex=e}},methods:__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_6_vuex__.d)({removeTagNav:"tagNav/removeTagNav"}),{settime:function(e){return 1==e.toString().length?"0"+e.toString():e},initData:function(){var e=this;this.$api.salesAPI.listContractType({type:"type_of_payment"}).then(function(t){e.typeList1=t.datas}),this.$api.salesAPI.listContractType({type:"settlement_method"}).then(function(t){e.settlementTypeList=t.datas}),this.$api.fundInitializationAPI.list({pageno:1,pagesize:1e3,usingStart:0}).then(function(t){t.data?e.accountNumberList=t.data.datas:e.accountNumberList=[]})},showOperate:function(e,t){this.currentChildIndex=t,this.choosePaymentTypeVisible=!0},getPaymentType:function(e){console.log(e),this.$set(this.formData.paymentOrderItemList[this.currentChildIndex],"incomePayTypeId",e.id),this.$set(this.formData.paymentOrderItemList[this.currentChildIndex],"incomePayTypeName",e.name)},getDetail:function(){var e=this;this.loading=!0,this.$nextTick().then(function(){e.$api.paymentOrderAPI.detailOfReceived(e.editId).then(function(t){if(e.loading=!1,e.$set(e.formData,"paymentOrderItemList",t.data.paymentOrderItemList),e.$set(e.formData,"paymentOrder",t.data.paymentOrder),e.auditStatus=t.data.paymentOrder.auditSign,1==t.data.paymentOrder.auditSign&&(e.uplaodDisabled=2),t.data.uploadAttachment&&t.data.uploadAttachment.length>0)for(var a=0;a<t.data.uploadAttachment.length;a++){var i={fileName:t.data.uploadAttachment[a].fileName,filePath:t.data.uploadAttachment[a].filePath};e.uploadAttachment.push(i)}})})},clear:function(){this.$route.query.id&&(this.editId=void 0,this.consumingStockId=void 0),this.auditStatus="",this.uplaodDisabled=1,this.advanceQueryDialogVisible=!0,this.uploadAttachment=[],this.formData={paymentOrder:{supplierName:"",payerName:"",payDate:"",paymentTypeName:"",code:"",invoiceDate:"",invoiceCode:"",totalPayApplyAmount:0,totalPayAmount:0},paymentOrderItemList:[],rules:{payAmount:{required:!0,message:"本次付款必填",trigger:"change"}}},this.itemIds=[];var e=new Date;this.$set(this.formData.paymentOrder,"payDate",e.getFullYear()+"-"+this.settime(e.getMonth()+1)+"-"+this.settime(e.getDate()))},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/finance/commutation/paymentOrder",query:{t:Date.now()}}),this.clear()},save:function(){var e=this;if(0!=this.formData.paymentOrderItemList.length){var t=!0;if(this.formData.paymentOrderItemList.forEach(function(e){0==e.payAmount&&(t=!1)}),t){var a=!0;if(this.formData.paymentOrderItemList.forEach(function(e){e.payAmount>e.unpayAmount&&(a=!1)}),a){if(this.isDisabled)return;this.isDisabled=!0;var i=[];this.uploadAttachment.forEach(function(e){var t={fileName:e.fileName,filePath:e.filePath};i.push(t)}),this.formData.uploadAttachment=i,this.$api.paymentOrderAPI.addAndChange(this.formData).then(function(t){e.isDisabled=!1,0===t.code?(e.$message({message:t.msg,type:"success"}),e.consumingStockId=t.id,e.editId=t.data,window.location.href=e.changeURLArg("id",t.data),e.getDetail()):e.$message({message:t.msg,type:"error"})})}else this.$message({message:"本次付款金额不能大于未付款金额",type:"warning"})}else this.$message({message:"本次付款不能为0",type:"warning"})}else this.$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},audit:function(){var e=this,t=this.editId,a=[];a.push(t),this.$confirm("确认审核吗?","提示",{type:"warning"}).then(function(){e.$api.paymentOrderAPI.audit({ids:a}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getDetail(),e.uplaodDisabled=2):e.$message({message:t.msg,type:"error"})})})},disAudit:function(){var e=this,t=this.editId,a=[];a.push(t),this.$confirm("确认反审核吗?","提示",{type:"warning"}).then(function(){e.$api.paymentOrderAPI.reverseAudit({ids:a}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getDetail(),e.uplaodDisabled=1):e.$message({message:t.msg,type:"error"})})})},getUser:function(e){e&&(this.formData.paymentOrder.payerName=e.name,this.formData.paymentOrder.payerId=e.id,this.formData.paymentOrder.deptName=e.deptName,this.formData.paymentOrder.deptId=e.deptId)},getSupplier:function(e){e?(this.$set(this.formData.paymentOrder,"supplierId",e.id),this.$set(this.formData.paymentOrder,"supplierName",e.name)):(this.$set(this.formData.paymentOrder,"supplierId",""),this.$set(this.formData.paymentOrder,"supplierName",""))},getOperator:function(e){e&&(this.formData.paymentOrder.payerName=e.name,this.formData.paymentOrder.payerId=e.id)},ChooseImportShow:function(){this.formData.paymentOrder.supplierId?this.chooseContractVisible=!0:this.$message({message:"请先选择供应商",type:"warning"})},getSalesOutStock:function(e){var t=this;if(console.log(e,1),e){e.forEach(function(e){delete e.remark,t.$set(e,"payApplyAmount",e.payAmount),t.$set(e,"payAmount",0),t.$set(e,"accountNumber",""),t.$set(e,"sourceCode",e.code),t.$set(e,"settlementType",""),t.$set(e,"statementNumber",""),t.$set(e,"remark",""),t.$set(e,"sourceId",e.id),t.$set(e,"sourceType","付款申请"),t.formData.paymentOrderItemList.push(e)})}},removePart:function(){var e=this;if(this.chooseParts){var t=[];this.chooseParts.forEach(function(a){a.payAmount-a.amountPaid,t.push(a.id);var i=e.formData.paymentOrderItemList.findIndex(function(e){if(e.id==a.id)return!0});e.formData.paymentOrderItemList.splice(i,1),e.itemIds=t})}},handlePartChange:function(e){this.chooseParts=e,console.log(this.chooseParts),this.setBtn(e)},setBtn:function(e){var t=!0,a=!0;e.length>0?(a=!1,1==e.length&&(t=!1)):(t=!0,a=!0),this.btnDelDisabled=a,this.btnOtherDisabled=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 e=document.getElementById("print_content").innerHTML;return document.body.innerHTML="<html><head><title>打印</title></head><body>"+e+"</body></html>",window.print(),window.location.reload(),!1})},getSummaries:function(e){for(var t=e.columns,a=e.data,i=0,r=0;r<a.length;r++)i+=a[r].count;this.printTotal.count=i;var n=0,s=0;if(a.length>1)for(var o=0;o<a.length;o++)o<a.length-1&&(n=a[o].count*a[o].unitPrice+a[o+1].count*a[o+1].unitPrice,s=a[o].count*a[o].sellUnitPrice+a[o+1].count*a[o+1].sellUnitPrice);else 1==a.length&&(n=a[0].count*a[0].unitPrice,s=a[0].count*a[0].sellUnitPrice);this.printTotal.amount=n,this.printTotal.sellAmount=s;for(var l=[],u=0;u<a.length;u++)a[u].count&&a[u].sellUnitPrice&&a[u].count*a[u].sellUnitPrice;return t.forEach(function(e,t){if(0!==t)if(1==t||2==t){var i=a.map(function(t){return Number(t[e.property])});i.every(function(e){return isNaN(e)})?l[t]="":l[t]=i.reduce(function(e,t){var a=Number(t);return isNaN(a)?e:e+t},0)}else l[t]="";else l[t]="合计"}),this.formData.paymentOrder.totalPayApplyAmount=l[1],this.formData.paymentOrder.totalPayAmount=l[2],l}})}}}); |