yxk_pc_mdh/gyhl/static/js/63.bf5f59214f0d605954fd.js

1 line
33 KiB
JavaScript

webpackJsonp([63],{"3/ny":function(e,t){},"9rhq":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("wKQW"),o={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(" "),179!=e.auditStatus?a("el-button",{attrs:{type:"primary",disabled:e.isDisabled},on:{click:function(t){return e.save("form")}}},[e._v("保存")]):e._e(),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.clear}},[e._v("新增")]),e._v(" "),e.btnDelDisabled&&178==e.auditStatus?a("el-button",{attrs:{type:"primary"},on:{click:e.audit}},[e._v("审核")]):e._e(),e._v(" "),e.btnDelDisabled&&179==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,rules:e.ruleForm}},[a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"客户名称",prop:"clientName"}},[a("btn-input",{attrs:{valueText:e.formData.clientName,valueId:e.formData.clientId,chooseVisible:e.chooseClientrVisible,showBtn:179!=e.auditStatus&&0==e.model.childList.length},on:{"update:valueText":function(t){return e.$set(e.formData,"clientName",t)},"update:value-text":function(t){return e.$set(e.formData,"clientName",t)},"update:valueId":function(t){return e.$set(e.formData,"clientId",t)},"update:value-id":function(t){return e.$set(e.formData,"clientId",t)},"update:chooseVisible":function(t){e.chooseClientrVisible=t},"update:choose-visible":function(t){e.chooseClientrVisible=t}}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"收款日期",prop:"outTime"}},[a("el-date-picker",{attrs:{type:"date",format:"yyyy-MM-dd","range-separator":"—",placeholder:"选择日期","value-format":"yyyy-MM-dd",clearable:"",disabled:179==e.auditStatus},model:{value:e.formData.outTime,callback:function(t){e.$set(e.formData,"outTime",t)},expression:"formData.outTime"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"收款人",prop:"operatorName"}},[a("btn-input",{attrs:{valueText:e.formData.operatorName,valueId:e.formData.operator,chooseVisible:e.chooseUserVisible,showBtn:179!=e.auditStatus},on:{"update:valueText":function(t){return e.$set(e.formData,"operatorName",t)},"update:value-text":function(t){return e.$set(e.formData,"operatorName",t)},"update:valueId":function(t){return e.$set(e.formData,"operator",t)},"update:value-id":function(t){return e.$set(e.formData,"operator",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:"prType"}},[a("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:e.formData.prType,callback:function(t){e.$set(e.formData,"prType",t)},expression:"formData.prType"}},e._l(e.typeList1,function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id,disabled:179==e.auditStatus}})}),1)],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"应收总额"}},[a("el-input",{attrs:{readonly:"",placeholder:"自动生成"},model:{value:e.formData.amount,callback:function(t){e.$set(e.formData,"amount",t)},expression:"formData.amount"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"收款单号"}},[a("el-input",{attrs:{readonly:"",placeholder:"自动生成"},model:{value:e.formData.prCode,callback:function(t){e.$set(e.formData,"prCode",t)},expression:"formData.prCode"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"发票日期"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{disabled:179==e.auditStatus,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:"发票号码"}},[a("el-input",{attrs:{disabled:179==e.auditStatus},model:{value:e.formData.invoiceCode,callback:function(t){e.$set(e.formData,"invoiceCode",t)},expression:"formData.invoiceCode"}})],1)],1)]),e._v(" "),a("el-divider",{attrs:{"content-position":"left"}},[a("div",[e._v("关联单据")])]),e._v(" "),a("el-form",{ref:"formChild",attrs:{rules:e.model.rules,model:e.model}},[a("el-form-item",{staticClass:"childlist",attrs:{prop:"childList"}},[a("div",{staticClass:"sys-operate",staticStyle:{"margin-bottom":"10px"}},[e.btnDisabled&&179!=e.auditStatus?a("el-button",{attrs:{type:"primary"},on:{click:e.ChooseImportShow}},[e._v("新增")]):e._e(),e._v(" "),179!=e.auditStatus?a("el-button",{attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:function(t){return e.removePart()}}},[e._v("删除")]):e._e()],1),e._v(" "),a("el-table",{attrs:{data:e.model.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:"contractCode",label:"源单编号",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"thisSourceTypeName",label:"源单类型",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"receivableDate",label:"应收日期",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"receivableAmount",label:"应收金额(元)",align:"center",width:"140","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"receivedAmount",label:"已收金额(元)",align:"center",width:"140","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"thisAmount",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:"childList."+t.$index+".thisAmount",rules:e.model.rules.thisAmount}},[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{size:"small","controls-position":"right",disabled:179==e.auditStatus},model:{value:t.row.thisAmount,callback:function(a){e.$set(t.row,"thisAmount",a)},expression:"scope.row.thisAmount"}})],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"unpayAmount",label:"未收金额(元)",width:"140",align:"center","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.sum1(t.row.receivableAmount,t.row.receivedAmount,t.$index))+"\n ")]}}])}),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:"childList."+t.$index+".accountNumber",rules:e.model.rules.accountNumber}},[a("el-select",{staticStyle:{width:"100%"},attrs:{disabled:179==e.auditStatus,clearable:"",placeholder:"请选择"},model:{value:t.row.accountNumber,callback:function(a){e.$set(t.row,"accountNumber",a)},expression:"scope.row.accountNumber"}},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:"childList."+t.$index+".settlementType",rules:e.model.rules.settlementType}},[a("el-select",{attrs:{disabled:179==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:"paymentTypeName",align:"center",width:"220",label:"收支类型"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("btn-input",{attrs:{valueText:t.row.paymentTypeName,valueId:t.row.paymentType,chooseVisible:e.choosePaymentTypeVisible,currentIndex:e.currentIndex,index:t.$index,showBtn:179!=e.auditStatus},on:{"update:valueText":function(a){return e.$set(t.row,"paymentTypeName",a)},"update:value-text":function(a){return e.$set(t.row,"paymentTypeName",a)},"update:valueId":function(a){return e.$set(t.row,"paymentType",a)},"update:value-id":function(a){return e.$set(t.row,"paymentType",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:"remarks",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:!(178==e.auditStatus||!e.editId)},model:{value:t.row.remarks,callback:function(a){e.$set(t.row,"remarks",a)},expression:"scope.row.remarks"}})]}}])})],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"remarks"}},[a("el-input",{attrs:{type:"textarea",autosize:{minRows:4},placeholder:"请简要填写备注内容",disabled:179==e.auditStatus},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.formData.createUserName))]),e._v(" "),a("el-col",{attrs:{span:7}},[e._v("制单时间:"+e._s(e.formData.createTime))]),e._v(" "),a("el-col",{attrs:{span:5}},[e._v("审核人:"+e._s(e.formData.auditorName))]),e._v(" "),a("el-col",{attrs:{span:7}},[e._v("审核时间:"+e._s(e.formData.auditTime))])],1):e._e()],1),e._v(" "),a("DialogChooseSingleClientr",{attrs:{visible:e.chooseClientrVisible},on:{"update:visible":function(t){e.chooseClientrVisible=t},change:e.getClientr}}),e._v(" "),a("DialogChooseSingleUser",{attrs:{visible:e.chooseUserVisible},on:{"update:visible":function(t){e.chooseUserVisible=t},change:e.getUser}}),e._v(" "),a("DialogChooseContract",{attrs:{visible:e.chooseContractVisible,prType:e.formData.prType,clientName:e.formData.clientName,clientId:e.formData.clientId},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 r=function(e){a("eOG8"),a("3/ny")},s=a("VU/8")(i.a,o,!1,r,"data-v-2e20faf8",null);t.default=s.exports},eOG8:function(e,t){},rTfM:function(e,t,a){"use strict";a("GKmE");var i=a("bzuE"),o={props:{id:{type:String,default:""},clientId:"",prType:"",clientName:"",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)},sourceTypeId:function(e){204!=e&&295!=e||(this.sourceType=e,this.searchSubset())},time:function(e){e?(this.searchData_Subset.startTime=e[0],this.searchData_Subset.endTime=e[1]):(this.searchData_Subset.startTime="",this.searchData_Subset.endTime="")}},data:function(){return{subsetList:[],subsetAll:[],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:204,sourceType:204,deviceType:[{id:204,name:"销售订单"},{id:295,name:"其他应收"}],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.clientId&&(this.searchData_Subset.clientId=this.clientId,this.searchData_Subset.clientName=this.clientName,this.searchData_Subset.prType=this.prType),this.dialogLoading=!0,this.time?(this.searchData_Subset.startTime=this.time[0],this.searchData_Subset.endTime=this.time[1]):(this.searchData_Subset.startTime="",this.searchData_Subset.endTime=""),204==this.sourceType?this.$api.paymentReceivedAPI.payList(this.searchData_Subset).then(function(t){e.dialogLoading=!1,0===t.code&&(console.log(t.data),e.subsetList=t.data?t.data.datas:[],e.subsetTotal=t.data?t.data.totalRows:0)}):this.$api.paymentReceivedAPI.listForIncoming(this.searchData_Subset).then(function(t){e.dialogLoading=!1,0===t.code&&(console.log(t.data),e.subsetList=t.data?t.data.datas:[],t.data.datas.forEach(function(a){e.$set(a,"contractCode",a.code),t.data.datas.forEach(function(t){e.$set(t,"receivableDate",t.accrualDate),e.$set(t,"receivableAmount",t.receivablePayablesAmount),e.$set(t,"receivedAmount",t.paidReceivedAmount?t.paidReceivedAmount:0),e.$set(t,"unpayAmount",t.noReceiptPaymentAmount),e.$set(t,"contractCode",t.code),e.$set(t,"clientName",t.supplierClientName),e.$set(t,"itemId",t.id),e.$set(t,"contractCode",t.code),e.$set(t,"thisSourceType",t.sourceType),e.$set(t,"thisSourceTypeName",t.sourceTypeName)}),e.$set(a,"contractCode",a.code)}),e.subsetTotal=t.data?t.data.totalRows:0)})},ckSubsetAll:function(e){this.subsetAll=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.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()}}},r={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("el-form-item",{staticClass:"form-inline",attrs:{label:"源单类型"}},[a("el-select",{model:{value:e.sourceTypeId,callback:function(t){e.sourceTypeId=t},expression:"sourceTypeId"}},e._l(e.deviceType,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),a("div",{staticClass:"flex"},[a("el-form-item",{attrs:{label:"客户"}},[a("el-input",{staticStyle:{width:"250px"},attrs:{placeholder:"请选择",readonly:""},model:{value:e.clientName,callback:function(t){e.clientName=t},expression:"clientName"}})],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)],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:"contractCode",label:"单据编号",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"clientName",label:"客户名称",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"receivableDate",label:"应收日期",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"receivableAmount",label:"应收金额(元)",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"receivedAmount",label:"已收金额(元)",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"unpayAmount",label:"未收金额(元)",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"remarks",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")(o,r,!1,null,null,null);t.a=s.exports},wKQW: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__components_Dialog_dialogChooseSinglePaymentType__=__webpack_require__("iglq"),__WEBPACK_IMPORTED_MODULE_5__dialogChooseContract__=__webpack_require__("rTfM"),__WEBPACK_IMPORTED_MODULE_6_vuex__=__webpack_require__("NYxO"),__WEBPACK_IMPORTED_MODULE_7__components_System_dialogChooseSingleClient__=__webpack_require__("iGlD"),__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseSingleUser__=__webpack_require__("3MlD"),__WEBPACK_IMPORTED_MODULE_9__utils_config_js__=__webpack_require__("bzuE");__webpack_exports__.a={inject:["reload"],components:{btnInput:__WEBPACK_IMPORTED_MODULE_3__components_btnInput_vue__.a,DialogChooseSingleUser:__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseSingleUser__.a,DialogChooseSingleClientr:__WEBPACK_IMPORTED_MODULE_7__components_System_dialogChooseSingleClient__.a,DialogChooseContract:__WEBPACK_IMPORTED_MODULE_5__dialogChooseContract__.a,dialogChooseSinglePaymentType:__WEBPACK_IMPORTED_MODULE_4__components_Dialog_dialogChooseSinglePaymentType__.a},data:function(){var e;return e={formData:{outTime:"",operatorName:"",operator:"",clientName:"",clientId:""},currentIndex:0,auditStatus:"",config:__WEBPACK_IMPORTED_MODULE_9__utils_config_js__.a,typeList1:[],accountNumberList:[],settlementTypeList:[],btnDisabled:!0,itemIds:[],editId:"",availableCount:0,totalCount:0,currentChildIndex:"",choosePaymentTypeVisible:!1,btnOtherDisabled:!0,btnDelDisabled:!1,isDisabled:!1,chooseOperatorVisible:!1,ChooseMaterielVisible:!1,chooseClientrVisible:!1,ChooseStockVisible:!1,chooseContractVisible:!1,chooseUserVisible:!1,loading:!1,materielId:""},__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()(e,"currentIndex",""),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()(e,"ruleForm",{clientName:[{required:!0,message:"请选择客户",trigger:"change"}],outTime:[{required:!0,message:"请选择出库时间",trigger:"change"}],operatorName:[{required:!0,message:"请选择收款人",trigger:"change"}],prType:[{required:!0,message:"请选择收款类型",trigger:"change"}]}),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()(e,"model",{rules:{thisAmount:{required:!0,message:"本次收款必填",trigger:"change"}},childList:[]}),__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,"printDetail",{deptName:"",outTime:"",outCode:""}),__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.formData.id=this.$route.query.id,this.editId=this.$route.query.id,this.getDetail();else{var e=new Date;this.$set(this.formData,"outTime",e.getFullYear()+"-"+this.settime(e.getMonth()+1)+"-"+this.settime(e.getDate()))}this.initData()},watch:{editId:{handler:function(e,t){this.btnDelDisabled=""!=e&&void 0!=e}},model:{handler:function(e){e.childList.length>0?this.btnDisabled=!1:this.btnDisabled=!0},deep:!0},formData:{handler:function(e){var t=this;console.log(e.prType),console.log(this.model.childList),225==e.prType&&this.model.childList.forEach(function(e){console.log(e),t.$set(e,"thisAmount",-1*e.thisAmount)})},deep:!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:"receipt_type"}).then(function(t){console.log(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.model.childList[this.currentChildIndex],"paymentType",e.id),this.$set(this.model.childList[this.currentChildIndex],"paymentTypeName",e.name)},getDetail:function(){var e=this,t=this;this.loading=!0,this.$nextTick().then(function(){e.$api.paymentReceivedAPI.detailOfReceived({id:e.formData.id}).then(function(a){e.loading=!1,t.$set(t.formData,"auditStatus",a.data.receivedDetail.auditSign?a.data.receivedDetail.auditSign:""),t.auditStatus=e.formData.auditStatus,t.$set(t.formData,"clientName",a.data.receivedDetail.cusSupName?a.data.receivedDetail.cusSupName:""),t.$set(t.formData,"clientId",a.data.receivedDetail.cusSupId?a.data.receivedDetail.cusSupId:""),t.$set(t.formData,"outTime",a.data.receivedDetail.prDate?a.data.receivedDetail.prDate:""),t.$set(t.formData,"operatorName",a.data.receivedDetail.payee?a.data.receivedDetail.payee:""),t.$set(t.formData,"prType",a.data.receivedDetail.prType?a.data.receivedDetail.prType:""),t.$set(t.formData,"prCode",a.data.receivedDetail.prCode?a.data.receivedDetail.prCode:""),t.$set(t.formData,"remarks",a.data.receivedDetail.remarks?a.data.receivedDetail.remarks:""),t.$set(t.formData,"invoiceDate",a.data.receivedDetail.invoiceDate?a.data.receivedDetail.invoiceDate:""),t.$set(t.formData,"invoiceCode",a.data.receivedDetail.invoiceCode?a.data.receivedDetail.invoiceCode:""),t.$set(t.formData,"amount",a.data.allReceivablePayablesAmount?a.data.allReceivablePayablesAmount:0),t.$set(t.formData,"createUserName",a.data.receivedDetail.createByName?a.data.receivedDetail.createByName:""),t.$set(t.formData,"createTime",a.data.receivedDetail.createTime?a.data.receivedDetail.createTime:""),t.$set(t.formData,"auditTime",a.data.receivedDetail.auditTime?a.data.receivedDetail.auditTime:""),t.$set(t.formData,"auditorName",a.data.receivedDetail.auditorName?a.data.receivedDetail.auditorName:""),t.model.childList=a.data.detailOfItem,t.model.childList.forEach(function(e){e.contractCode=e.sourceCode?e.sourceCode:"",e.receivableDate=e.dueDate?e.dueDate:"",e.receivableAmount=e.receivablePayablesAmount?e.receivablePayablesAmount:0,e.receivedAmount=e.paidReceivedAmount?e.paidReceivedAmount:0,e.unpayAmount=e.noReceiptPaymentAmount?e.noReceiptPaymentAmount:0,e.newId=e.id?e.id:"",e.thisSourceTypeName=e.sourceTypeName?e.sourceTypeName:""}),e.printDetail.deptName=a.data.receivedDetail.deptName,e.printDetail.outTime=a.data.receivedDetail.outTime,e.printDetail.outCode=a.data.receivedDetail.outCode,e.printList=JSON.parse(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(e.model.childList))})})},clear:function(){this.$route.query.id&&(this.formData.id=void 0,this.editId=void 0),this.auditStatus="",this.model.childList=[],this.formData={},this.itemIds=[],this.$refs.form.resetFields();var e=new Date;this.$set(this.formData,"outTime",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/paymentReceived",query:{t:Date.now()}}),this.clear()},save:function(e){var t=this;this.$refs[e].validate(function(e){if(e){if(0==t.model.childList.length)return void t.$message({message:"请选关联单据",type:"warning"});var a=void 0;if(t.$refs.formChild.validate(function(e,t){a=e}),!a)return void t.$message({message:"有必填项未填写",type:"warning"});var i=!0;if(t.model.childList.forEach(function(e){0==e.thisAmount&&(i=!1)}),!i)return void t.$message({message:"本次收款不能为0",type:"warning"});var o=!0;if(t.model.childList.forEach(function(e){e.thisAmount>e.unpayAmount&&(o=!1)}),o)if(t.formData.id){var r=[];if(t.model.childList.forEach(function(e){225==t.formData.prType?e.thisAmount=-1*e.thisAmount:e.thisAmount=e.thisAmount;var a=__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()({id:e.newId,sourceType:e.thisSourceType,sourceCode:e.contractCode,sourceId:e.itemId,sourcePayItemId:e.itemId,thisAmount:e.thisAmount.toFixed(__WEBPACK_IMPORTED_MODULE_9__utils_config_js__.a.amountFixedTo),accountNumber:e.accountNumber?e.accountNumber:"",settlementType:e.settlementType,remarks:e.remarks?e.remarks:"",paymentType:e.paymentType?e.paymentType:""},"remarks",e.remarks);r.push(a),t.formData.item=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(r)}),t.isDisabled)return;t.isDisabled=!0,t.$api.paymentReceivedAPI.addAndChange({id:t.formData.id,invoiceDate:t.formData.invoiceDate?t.formData.invoiceDate:"",invoiceCode:t.formData.invoiceCode?t.formData.invoiceCode:"",remarks:t.formData.remarks?t.formData.remarks:"",cusSupId:t.formData.clientId,prDate:t.formData.outTime,payee:t.formData.operatorName,prType:t.formData.prType,paymentBodys:t.formData.item,deleItemIds:t.itemIds}).then(function(e){t.isDisabled=!1,0===e.code?t.$message({message:e.msg,type:"success"}):t.$message({message:e.msg,type:"error"})})}else{var s=[];if(t.model.childList.forEach(function(e){225==t.formData.prType?e.thisAmount=-1*e.thisAmount:e.thisAmount=e.thisAmount,console.log(e);var a=__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()({sourceType:e.thisSourceType,sourceCode:e.contractCode,sourceId:e.itemId,sourcePayItemId:e.itemId,thisAmount:e.thisAmount.toFixed(__WEBPACK_IMPORTED_MODULE_9__utils_config_js__.a.amountFixedTo),accountNumber:e.accountNumber?e.accountNumber:"",settlementType:e.settlementType,remarks:e.remarks?e.remarks:"",paymentType:e.paymentType?e.paymentType:""},"remarks",e.remarks);s.push(a),t.formData.item=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(s)}),t.isDisabled)return;t.isDisabled=!0,t.$api.paymentReceivedAPI.addAndChange({invoiceDate:t.formData.invoiceDate?t.formData.invoiceDate:"",invoiceCode:t.formData.invoiceCode?t.formData.invoiceCode:"",remarks:t.formData.remarks?t.formData.remarks:"",cusSupId:t.formData.clientId,prDate:t.formData.outTime,payee:t.formData.operatorName,prType:t.formData.prType,paymentBodys:t.formData.item}).then(function(e){t.isDisabled=!1,0===e.code?(t.$message({message:e.msg,type:"success"}),t.editId=e.id,window.location.href=t.changeURLArg("id",e.id)):t.$message({message:e.msg,type:"error"})})}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},sum1:function(e,t,a){var i=e-t;return i=i.toFixed(__WEBPACK_IMPORTED_MODULE_9__utils_config_js__.a.amountFixedTo),this.$set(this.model.childList[a],"unpayAmount",i),i},audit:function(){var e=this,t=this.formData.id;this.$confirm("确认审核吗?","提示",{type:"warning"}).then(function(){e.$api.paymentReceivedAPI.audit({id:t}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getDetail()):e.$message({message:t.msg,type:"error"})})})},disAudit:function(){var e=this,t=this.formData.id;this.$confirm("确认反审核吗?","提示",{type:"warning"}).then(function(){e.$api.paymentReceivedAPI.reverseAudit({id:t}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getDetail()):e.$message({message:t.msg,type:"error"})})})},getUser:function(e){e&&(this.formData.operatorName=e.name,this.formData.operator=e.id,this.formData.deptName=e.deptName,this.formData.deptId=e.deptId)},getClientr:function(e){e&&(this.formData.clientName=e.client_name,this.formData.clientId=e.id)},getOperator:function(e){e&&(this.formData.operatorName=e.name,this.formData.operator=e.id)},ChooseImportShow:function(){this.formData.clientId?this.chooseContractVisible=!0:this.$message({message:"请先选择客户",type:"warning"})},getSalesOutStock:function(e){var t=this;if(console.log(e),e){var a=0;e.forEach(function(e){t.$set(e,"thisAmount",0),t.$set(e,"accountNumber",""),t.$set(e,"settlementType",""),t.$set(e,"statementNumber",""),a+=e.receivableAmount-e.receivedAmount,t.formData.amount=a,t.model.childList.push(e)})}},removePart:function(){var e=this;if(this.chooseParts){var t=[],a=0;this.chooseParts.forEach(function(i){a+=i.receivableAmount-i.receivedAmount,t.push(i.id);var o=e.model.childList.findIndex(function(e){if(e.id==i.id)return!0});e.formData.amount=e.formData.amount-a,e.model.childList.splice(o,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,o=0;o<a.length;o++)i+=a[o].count;this.printTotal.count=i;var r=0,s=0;if(a.length>1)for(var n=0;n<a.length;n++)n<a.length-1&&(r=a[n].count*a[n].unitPrice+a[n+1].count*a[n+1].unitPrice,s=a[n].count*a[n].sellUnitPrice+a[n+1].count*a[n+1].sellUnitPrice);else 1==a.length&&(r=a[0].count*a[0].unitPrice,s=a[0].count*a[0].sellUnitPrice);this.printTotal.amount=r,this.printTotal.sellAmount=s;for(var l=[],c=0;c<a.length;c++)a[c].count&&a[c].sellUnitPrice&&a[c].count*a[c].sellUnitPrice;return t.forEach(function(e,t){if(0!==t)if(4==t||5==t||6==t||7==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]="合计"}),l}})}}});