| 1 |
- {"code":"/*!\n * build: vue-admin-beautiful \n * copyright: chuzhixin 1204505056@qq.com \n * time: 2022-12-12 09:51:32\n */\n(window[\"webpackJsonp\"]=window[\"webpackJsonp\"]||[]).push([[\"chunk-31c47d26\"],{\"5dd5\":function(e,t,o){},7265:function(e,t,o){\"use strict\";o(\"a68f\")},a1c6:function(e,t,o){\"use strict\";o.r(t);var a=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o(\"ContainerTit\",{staticClass:\"AddReceipt\"},[o(\"div\",{staticClass:\"page-tip-div\",staticStyle:{margin:\"0\",position:\"relative\"}},[e._v(\" 温馨提示:1、退款时在金额输入框输入负数即可!2、收款时,在金额输入框输入正数即可!3、客户给商家预付货款时,在新增选择单据类型为预存收款后不用选择原单据号即可创建! \"),o(\"div\",{staticClass:\"btn-top-div\"},[e.$accessCheck(e.$Access.ReceiptListGetTempReceivedData)?o(\"el-button\",{attrs:{loading:e.loading,disabled:e.isLook||e.isEdit},on:{click:function(t){return e.temData(!0)}}},[e._v(\" 暂存 \")]):e._e(),e.isLook?e._e():o(\"el-button\",{attrs:{type:\"primary\",loading:e.loading},on:{click:function(t){return e.addData(!1)}}},[e._v(\" 保存并提交 \")])],1)]),o(\"el-form\",{ref:\"base_form\",attrs:{\"label-width\":\"120px\",model:e.form,size:\"small\",rules:e.rules,disabled:e.isLook}},[o(\"el-tabs\",{model:{value:e.activeName,callback:function(t){e.activeName=t},expression:\"activeName\"}},[o(\"el-tab-pane\",{staticStyle:{position:\"relative\"},attrs:{label:\"基础信息\",name:\"one\"}},[o(\"el-row\",{staticStyle:{\"padding-bottom\":\"13px\"}},[o(\"el-col\",{attrs:{span:24}},[o(\"p\",{staticClass:\"order_midden_left_text el-icon-arrow-right\",staticStyle:{\"padding-left\":\"20px\"}},[e._v(\" 收款信息 \")])]),o(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[o(\"el-form-item\",{staticStyle:{\"min-width\":\"400px\"},attrs:{label:\"收款单位\",prop:\"customerName\"}},[o(\"SelectCustomer\",{attrs:{clearable:!1,width:\"150\"},on:{change:e.customerSel},model:{value:e.form.customerName,callback:function(t){e.$set(e.form,\"customerName\",t)},expression:\"form.customerName\"}}),o(\"el-button\",{attrs:{size:\"mini\",type:\"text\"},on:{click:function(t){return e.$router.push(\"/Customer/CustomerAdmin/AddCustomer\")}}},[e._v(\" 【新建客户】 \")])],1)],1),o(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[o(\"el-form-item\",{attrs:{label:\"单据日期\",prop:\"brandId\"}},[[o(\"div\",{staticClass:\"block\"},[o(\"el-date-picker\",{staticStyle:{width:\"210px\"},attrs:{type:\"date\",placeholder:\"选择日期\",\"value-format\":\"timestamp\"},model:{value:e.form.receiptTime,callback:function(t){e.$set(e.form,\"receiptTime\",t)},expression:\"form.receiptTime\"}})],1)]],2)],1),o(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[o(\"el-form-item\",{staticStyle:{\"min-width\":\"400px\"},attrs:{label:\"所属店铺\",prop:\"shopName\"}},[o(\"SelectShop\",{attrs:{width:\"160\",clearable:!1,placeholder:\"选择商铺\"},on:{change:e.selShop},model:{value:e.form.shopId,callback:function(t){e.$set(e.form,\"shopId\",t)},expression:\"form.shopId\"}}),o(\"el-button\",{attrs:{size:\"mini\",type:\"text\"},on:{click:function(t){return e.$router.push(\"/SystemSettings/liansuoguanli/AddShop\")}}},[e._v(\" 【新建商铺】 \")])],1)],1),o(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[o(\"el-form-item\",{attrs:{label:\"当前应收\",prop:\"money\"}},[o(\"el-input\",{staticStyle:{width:\"210px\"},attrs:{disabled:\"\",placeholder:\"不可编辑\"},model:{value:e.form.money,callback:function(t){e.$set(e.form,\"money\",t)},expression:\"form.money\"}})],1)],1),o(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[o(\"el-form-item\",{attrs:{label:\"业务类型\"}},[o(\"el-select\",{staticStyle:{width:\"180px\"},attrs:{clearable:\"\",placeholder:\"选择类型\"},on:{change:e.typeChange},model:{value:e.form.financeTypeId,callback:function(t){e.$set(e.form,\"financeTypeId\",t)},expression:\"form.financeTypeId\"}},e._l(e.financeTypeList,(function(e,t){return o(\"el-option\",{key:t,attrs:{label:e.name,value:e.id}})})),1),0===e.financeTypeList.length?o(\"el-button\",{attrs:{size:\"mini\",type:\"text\"},on:{click:e.getAllFinanceType}},[e._v(\" 【刷新】 \")]):e._e(),0===e.financeTypeList.length?o(\"el-button\",{attrs:{size:\"mini\",type:\"text\"},on:{click:function(t){e.show_model=!0}}},[e._v(\" 【新建类型】 \")]):e._e()],1)],1),o(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[o(\"el-form-item\",{attrs:{label:\"收款人\"}},[e._v(\" \"+e._s(e.form.currentAccountName)+\" \")])],1)],1)],1)],1),o(\"div\",{staticClass:\"order_bottom\"},[o(\"p\",{staticClass:\"text\"},[e._v(\"收款单明细\")]),o(\"el-table\",{attrs:{data:e.form.accountList}},[o(\"el-table-column\",{attrs:{prop:\"accountId\",label:\"结算账户\",\"min-width\":\"160\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[o(\"el-input\",{staticStyle:{width:\"100%\"},attrs:{readonly:\"\",size:\"small\",placeholder:\"结算账户\"},model:{value:t.row.accountName,callback:function(o){e.$set(t.row,\"accountName\",o)},expression:\"scope.row.accountName\"}},[o(\"i\",{staticClass:\"el-input__icon el-icon-search\",attrs:{slot:\"suffix\"},on:{click:function(o){return e.openAccount(t.$index)}},slot:\"suffix\"})])]}}])}),o(\"el-table-column\",{attrs:{prop:\"money\",label:\"收款金额\",\"min-width\":\"120\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[o(\"el-input-number\",{staticStyle:{width:\"100%\"},attrs:{controls:!1,placeholder:\"收款金额\",size:\"small\",min:0},on:{blur:e.moneyBlur},model:{value:t.row.money,callback:function(o){e.$set(t.row,\"money\",o)},expression:\"scope.row.money\"}})]}}])}),o(\"el-table-column\",{attrs:{label:\"优惠金额\",\"min-width\":\"120\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[o(\"el-input-number\",{staticStyle:{width:\"100%\"},attrs:{controls:!1,placeholder:\"优惠金额\",size:\"small\",max:Number(t.row.money),min:0},model:{value:t.row.discountMoney,callback:function(o){e.$set(t.row,\"discountMoney\",o)},expression:\"scope.row.discountMoney\"}})]}}])}),o(\"el-table-column\",{attrs:{label:\"实际收款金额\",\"min-width\":\"120\",align:\"center\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[e._v(\" \"+e._s(e.$NP.minus(t.row.money||0,t.row.discountMoney||0))+\" \")]}}])}),o(\"el-table-column\",{attrs:{label:\"备注\",\"min-width\":\"200\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[o(\"el-input\",{staticStyle:{width:\"100%\"},attrs:{size:\"small\",placeholder:\"备注\"},model:{value:t.row.remark,callback:function(o){e.$set(t.row,\"remark\",o)},expression:\"scope.row.remark\"}})]}}])}),o(\"el-table-column\",{attrs:{prop:\"remark\",label:\"操作\",width:\"140\",align:\"center\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[o(\"el-button\",{attrs:{disabled:1===e.form.accountList.length,size:\"mini\",type:\"text\"},on:{click:function(o){return e.delAccount(t.$index)}}},[e._v(\" 删除 \")])]}}])})],1),o(\"div\",{staticClass:\"table-b-div\"},[o(\"div\",{staticClass:\"table-b-div-cont\",on:{click:e.addAccount}},[o(\"el-button\",{attrs:{type:\"text\",size:\"mini\"},on:{click:e.addAccount}},[o(\"i\",{staticClass:\"el-icon-plus\"}),e._v(\" 新增 \")])],1)])],1),o(\"div\",{staticClass:\"order_bottom\"},[o(\"p\",{staticClass:\"text\"},[e._v(\"核销明细\")]),o(\"div\",{staticClass:\"Enunciate\"},[o(\"div\",{staticClass:\"Enunciate_cont clearfix\"},[o(\"div\",{staticClass:\"float_left\"},[o(\"span\",[e._v(\" 未核销金额:\"+e._s(e.$_common.formattedNumber(e.offSetNotTotal))+\" \")]),o(\"span\",{staticStyle:{margin:\"0 20px\"}},[e._v(\" 本次核销金额:\"+e._s(e.$_common.formattedNumber(e.offSetTotal))+\" \")]),o(\"span\",[e._v(\" 核销差额:\"+e._s(e.$_common.formattedNumber(e.offSetTotal-e.moneyTotal))+\" \")])]),o(\"div\",{staticClass:\"float_right\"},[o(\"el-button\",{attrs:{size:\"mini\"},on:{click:e.offsetGet}},[e._v(\"自动核销\")])],1)])]),o(\"el-table\",{ref:\"multipleTable\",staticStyle:{width:\"100%\"},attrs:{data:e.tableData},on:{\"selection-change\":e.selectionChange}},[o(\"el-table-column\",{attrs:{type:\"selection\",width:\"55\",align:\"center\",fixed:\"left\"}}),o(\"el-table-column\",{attrs:{prop:\"receiptTypeId\",label:\"单据类型\",\"min-width\":\"100\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[e._v(\" \"+e._s(6===t.row.receiptTypeId?\"销售退货单\":1===t.row.receiptTypeId?\"销售订单\":\"\")+\" \")]}}])}),o(\"el-table-column\",{attrs:{prop:\"no\",label:\"单据编号\",\"min-width\":\"140\"}}),o(\"el-table-column\",{attrs:{prop:\"address\",label:\"单据日期\",\"min-width\":\"120\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[e._v(\" \"+e._s(e.$_common.formatDate(t.row.createTime))+\" \")]}}])}),o(\"el-table-column\",{attrs:{label:\"金额\",\"min-width\":\"100\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[e._v(\" \"+e._s(e.$_common.formattedNumber(t.row.receiveMoney))+\" \")]}}])}),o(\"el-table-column\",{attrs:{prop:\"address\",label:\"未核销金额\",\"min-width\":\"100\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[e._v(\" \"+e._s(e.$_common.formattedNumber(t.row.notOffsetMoney))+\" \")]}}])}),o(\"el-table-column\",{attrs:{prop:\"address\",label:\"本次核销金额\",\"min-width\":\"100\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[o(\"el-input-number\",{staticStyle:{width:\"100%\"},attrs:{controls:!1,placeholder:\"本次核销金额\",max:Number(t.row.notOffsetMoney),size:\"small\"},model:{value:t.row.offsetMoney,callback:function(o){e.$set(t.row,\"offsetMoney\",o)},expression:\"scope.row.offsetMoney\"}})]}}])}),o(\"el-table-column\",{attrs:{\"show-overflow-tooltip\":\"\",prop:\"originNo\",label:\"销售订单号\",\"min-width\":\"100\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[o(\"span\",{staticClass:\"click-div\",on:{click:function(o){return e.goOtherDetail(t.row.originId)}}},[e._v(\" \"+e._s(t.row.originNo)+\" \")])]}}])}),o(\"el-table-column\",{attrs:{prop:\"customerName\",label:\"往来单位名称\",\"min-width\":\"100\"}})],1)],1)],1),e.account_show?o(\"AccountType\",{attrs:{\"shop-id\":e.form.shopId,\"is-check\":!1,\"is-show\":e.account_show},on:{cancel:function(t){e.account_show=!1},confirm:e.accountsel}}):e._e(),e.receivable_show?o(\"Receivable\",{attrs:{id:e.form.customerId,\"is-check\":!1,\"is-show\":e.receivable_show},on:{cancel:function(t){e.receivable_show=!1},confirm:e.receivablesel}}):e._e(),o(\"el-dialog\",{attrs:{\"close-on-press-escape\":!1,\"close-on-click-modal\":!1,name:\"新增财务类型\",visible:e.show_model,width:\"40%\"},on:{\"update:visible\":function(t){e.show_model=t},close:function(t){e.show_model=!1}}},[o(\"el-form\",{ref:\"form\",attrs:{model:e.add_form,rules:e.add_rule,size:\"small\",\"label-width\":\"100px\"}},[o(\"el-form-item\",{attrs:{label:\"类型\",prop:\"name\"}},[o(\"el-input\",{attrs:{placeholder:\"请输入类型名称\"},model:{value:e.add_form.name,callback:function(t){e.$set(e.add_form,\"name\",t)},expression:\"add_form.name\"}})],1),o(\"el-form-item\",{attrs:{label:\"归属单据\",prop:\"link\"}},[o(\"el-select\",{attrs:{placeholder:\"请选择\"},model:{value:e.add_form.link,callback:function(t){e.$set(e.add_form,\"link\",t)},expression:\"add_form.link\"}},e._l(e.form_type,(function(e){return o(\"el-option\",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),o(\"el-form-item\",{attrs:{label:\"是否默认\",prop:\"defaultStatus\"}},[o(\"el-switch\",{attrs:{\"active-value\":5,\"inactive-value\":4},model:{value:e.add_form.isDefault,callback:function(t){e.$set(e.add_form,\"isDefault\",t)},expression:\"add_form.isDefault\"}})],1),o(\"el-form-item\",{attrs:{label:\"是否禁用\",prop:\"enableStatus\"}},[o(\"el-radio-group\",{model:{value:e.add_form.enableStatus,callback:function(t){e.$set(e.add_form,\"enableStatus\",t)},expression:\"add_form.enableStatus\"}},[o(\"el-radio\",{attrs:{label:4}},[e._v(\"是\")]),o(\"el-radio\",{attrs:{label:5}},[e._v(\"否\")])],1)],1)],1),o(\"span\",{staticClass:\"dialog-footer\",attrs:{slot:\"footer\"},slot:\"footer\"},[o(\"el-button\",{attrs:{size:\"small\"},on:{click:function(t){e.show_model=!1}}},[e._v(\"取 消\")]),o(\"el-button\",{attrs:{type:\"primary\",size:\"small\"},on:{click:e.addType}},[e._v(\" 确 定 \")])],1)],1)],1)},i=[],s=o(\"26f4\"),n=o(\"866f\"),c=o(\"d8dd\"),r=o(\"049b\"),l=o(\"d099\"),m=o(\"55bb\"),u=o(\"8156\"),d={name:\"AddReceipt\",components:{Receivable:s[\"default\"],AccountType:n[\"default\"],SelectCustomer:u[\"default\"],SelectShop:m[\"default\"]},data(){const e=(e,t,o)=>{t?o():o(new Error(\"请选择收款单位\"))},t=(e,t,o)=>{t?o():o(new Error(\"请选择原单据号\"))},o=(e,t,o)=>{t?o():o(new Error(\"请选择店铺\"))};return{tableData:[],form_type:[{label:\"应收单\",value:1},{label:\"应付单\",value:2}],show_model:!1,add_form:{name:\"\",link:\"\",isDefault:4,enableStatus:5},add_rule:{name:[{required:!0,message:\"请输入类型名称\"}],link:[{required:!0,message:\"请选择归属单据\"}]},loading:!1,account_index:0,financeTypeList:[],pay_type_list:[],code:\"\",account_show:!1,receivable_show:!1,no:\"\",form:{customerId:\"\",customerName:\"\",sourceNo:\"\",sourceNoMoney:\"\",currentAccountName:\"\",financeType:\"\",financeTypeId:\"\",shopId:\"\",money:\"\",shopName:\"\",receiptTime:\"\",createTime:\"\",accountList:[{accountId:\"\",accountNumber:\"\",accountName:\"\",money:\"\",discountMoney:\"\",finalMoney:\"\",payWay:\"\",remark:\"\"}]},rules:{customerName:[{required:!0,validator:e}],sourceNo:[{required:!0,validator:t}],shopName:[{required:!0,validator:o}]},account_id:\"\",isLook:!1,isEdit:!1,show_shop:!1,choose_data:[],check_money:0,id:\"\",time:\"\",delAccountList:[],flag:!1,activeName:\"one\"}},computed:{total(){if(this.form.accountList.length){if(1===this.form.accountList.length)return Number(this.form.accountList[0].money);{let e=0;return this.form.accountList.forEach(t=>{e=this.$NP.plus(e,Number(t.money))}),e}}return 0},moneyTotal(){if(this.form.accountList.length){if(1===this.form.accountList.length)return this.$NP.minus(Number(this.form.accountList[0].money),Number(this.form.accountList[0].discountMoney));{let e=0;return this.form.accountList.forEach(t=>{const o=this.$NP.minus(Number(t.money),Number(t.discountMoney));e=this.$NP.plus(e,o)}),e}}return 0},offSetTotal(){if(this.choose_data.length){if(1===this.choose_data.length)return Number(this.choose_data[0].offsetMoney);{let e=0;return this.choose_data.forEach(t=>{e=this.$NP.plus(e,Number(t.offsetMoney))}),e}}return 0},offSetNotTotal(){if(this.tableData.length){if(1===this.tableData.length)return Number(this.tableData[0].offsetMoney);{let e=0;return this.tableData.forEach(t=>{e=this.$NP.plus(e,Number(t.offsetMoney))}),e}}return 0}},created(){this.initial()},activated(){this.$_isInit()||this.initial()},methods:{async initial(){await this.getAllFinanceType(),await this.getAllPayment(),this.isLook=this.$route.path.indexOf(\"LookReceipt\")>-1,this.isEdit=this.$route.path.indexOf(\"editReceipt\")>-1,this.form.currentAccountName=this.userName,this.$route.params.createTime&&(this.form.createTime=this.$route.params.createTime),this.$route.params.id?(this.account_id=this.$route.params.id,await this.getReceivedInfo()):this.$route.query.id?(this.id=this.$route.query.id,this.time=this.$route.query.createTime,await this.getReceiveInfo()):await this.getTempReceivedData(),this.$route.query.customerId&&await this.getCustomerInfo(this.$route.query.customerId),this.form.receiptTime=(new Date).getTime()},goOtherDetail(e){this.$router.push(\"/order/manageO/OrderDetails/1/\"+e)},selectionChange(e){this.choose_data=e;let t=0;this.choose_data.forEach(e=>{t+=Number(e.offsetMoney)}),this.check_money=t},async getReceiveInfo(e){const{data:t}=await Object(l[\"getReceiveInfo\"])({id:this.id,createTime:this.time});if(this.id=t.id,this.form.customerId=t.customerId,this.form.customerName=t.customerName,this.form.sourceNo=t.no,this.form.sourceNoMoney=t.receiveMoney,this.form.shopName=t.shopName,this.form.shopId=t.shopId,6===t.receiptTypeId){const e=this.financeTypeList.find(e=>\"销售退货退款\"===e.name);this.form.financeTypeId=e.id,this.form.financeType=e.name}this.form.accountList=[{accountId:0,accountNumber:\"\",accountName:\"\",money:t.receiveMoney,discountMoney:\"\",finalMoney:\"\",payWay:\"\",remark:\"\"}],this.tableData=[{...t,offsetMoney:Number(t.notOffsetMoney)}],setTimeout(()=>{this.offsetGet()},200)},async getCustomerInfo(e){const{data:t}=await Object(r[\"getCustomerInfo\"])(e);this.form.money=t.money||0,this.form.customerId=t.id,this.form.customerName=t.name,await this.getAllReceive()},async getAllReceive(){let e={page:1,pageSize:999,customerId:this.form.customerId,offsetStatus:[3,4],moneyType:1};const{data:t}=await Object(l[\"getAllReceive\"])(e);this.tableData=t.map(e=>({...e,offsetMoney:Number(e.notOffsetMoney)}))},async addType(){this.$refs[\"form\"].validate(async e=>{if(e){let e={};e=this.is_edit?await Object(l[\"editFinanceType\"])(this.pay_id,{...this.add_form}):await Object(l[\"addFinanceType\"])({...this.add_form});this.show_model=!1}})},selShop(e,t){this.form.shopName=t[0].name},receivablesel(e){this.form.sourceNo=e[0].no,this.form.sourceNoMoney=e[0].receiveMoney,this.form.shopName=e[0].shopName,this.form.shopId=e[0].shopId},async getReceivedInfo(){const{data:e}=await Object(l[\"getReceivedInfo\"])({id:this.account_id,createTime:this.form.createTime});this.form={...e,receiptTime:1e3*e.receiptTime,accountList:e.accountList},e.offsetDate&&(this.tableData=e.offsetDate,this.choose_data=e.offsetDate,setTimeout(()=>{this.tableData.forEach(e=>{e.offsetMoney>0&&this.$refs.multipleTable.toggleRowSelection(e)})},200))},async temData(e){let t=this.choose_data.map(e=>({receiveReceiptId:e.id,offsetMoney:e.offsetMoney}));const o={...this.form,receiptTime:parseInt(this.form.receiptTime/1e3),tempSave:e,receiptOffsetData:t};this.loading=!0;await Object(l[\"addReceived\"])(o);this.loading=!1,this.$message({message:\"暂存成功\",type:\"success\"}),this.$closeCurrentGoEdit(\"/Finance/Receivable/ReceiptList\")},async addData(e){this.$refs[\"base_form\"].validate(async t=>{if(t){if(!e){this.flag&&(this.form.accountList=[...this.form.accountList,...this.delAccountList]);let e=!0;for(let t in this.form.accountList){let o=this.form.accountList[t];if(!o.accountId){e=!1,this.$message.warning(\"请选择结算账户\");break}if(!o.money){e=!1,this.$message.warning(\"请输入收款金额\");break}if(this.offSetTotal>this.total){e=!1,this.$message.warning(\"核销金额不能大于收款金额\");break}}if(!e)return}if(this.choose_data.length){let t=this.choose_data.map(e=>({receiveReceiptId:e.id,offsetMoney:e.offsetMoney,receiveCreateTime:e.createTime}));const o={...this.form,receiptTime:parseInt(this.form.receiptTime/1e3),tempSave:e,receiptOffsetData:t,sourceId:this.id};this.loading=!0;try{if(this.account_id){await Object(l[\"editReceived\"])(this.account_id,o)}else{await Object(l[\"addReceived\"])(o)}this.loading=!1,this.$message({type:\"success\",message:\"操作成功!\"}),this.$closeCurrentGoEdit(\"/Finance/Receivable/ReceiptList\")}catch{this.loading=!1}}else{1===this.form.financeTypeId&&(this.form.financeType=\"销售退货退款\"),2===this.form.financeTypeId&&(this.form.financeType=\"销售收款\"),3===this.form.financeTypeId&&(this.form.financeType=\"预存收款\");const t=this.$_common.deepClone(this.form);delete t.sourceNo;const o={...t,receiptTime:parseInt(this.form.receiptTime/1e3),tempSave:e,financeTypeId:this.form.financeTypeId,financeType:this.form.financeType};this.$confirm(\"确定要将该单据作为预收款吗?\",\"提示\",{confirmButtonText:\"确定\",cancelButtonText:\"取消\",type:\"warning\"}).then(async()=>{this.loading=!0;try{if(this.account_id){await Object(l[\"editReceived\"])(this.account_id,o)}else{await Object(l[\"addReceived\"])(o)}this.loading=!1,this.$message({type:\"success\",message:\"操作成功!\"}),this.$closeCurrentGoEdit(\"/Finance/Receivable/ReceiptList\")}catch{this.loading=!1}}).catch(()=>{this.loading=!1})}}})},async getTempReceivedData(){const{data:e}=await Object(l[\"getTempReceivedData\"])();\"{}\"!==JSON.stringify(e)&&(this.form={...e,receiptTime:1e3*e.receiptTime,accountList:e.accountList.map(e=>({...e,payWay:parseInt(e.payWay)}))},e.offsetDate&&(this.tableData=e.offsetDate,this.choose_data=e.offsetDate,setTimeout(()=>{this.tableData.forEach(e=>{this.$refs.multipleTable.toggleRowSelection(e)})},200)))},openAccount(e){this.account_index=e,this.form.shopId?this.account_show=!0:this.$message.warning(\"请选择所属店铺\")},accountsel(e){this.form.accountList[this.account_index].accountId=e[0].id,this.form.accountList[this.account_index].accountNumber=e[0].accountNumber,this.form.accountList[this.account_index].accountName=e[0].name},typeChange(e){const t=this.financeTypeList.find(t=>t.id===e);this.form.financeType=t.name},async getAllFinanceType(){const{data:e}=await Object(l[\"getAllFinanceTypeNoPage\"])(1);this.financeTypeList=e;const t=e.find(e=>\"销售收款\"===e.name);this.form.financeTypeId=t.id,this.form.financeType=t.name},addAccount(){this.form.accountList.push({accountId:\"\",accountNumber:\"\",accountName:\"\",money:\"\",discountMoney:\"\",finalMoney:\"\",payWay:\"\",remark:\"\"})},delAccount(e){this.account_id&&(this.flag=!0,this.form.accountList[e].accountId&&this.form.accountList[e].money&&(this.form.accountList[e].deleteStatus=4,this.delAccountList.push(this.form.accountList[e]))),console.log(this.delAccountList),this.form.accountList.splice(e,1)},async getAllPayment(){const e=await Object(c[\"getAllPayment\"])({page:1,pageSize:99});this.pay_type_list=e.data},customerSel(e,t){this.form.customerId=t[0].id,this.form.money=t[0].money,this.form.sourceNo=\"\",this.form.shopName=t[0].shopName,this.form.shopId=t[0].shopId||\"\",this.getAllReceive()},offsetGet(){let e=0;for(let t=0;t<this.tableData.length;t++){let o=this.tableData[t];if(e+=Number(o.offsetMoney),this.$refs.multipleTable.toggleRowSelection(o),e>this.moneyTotal||e===this.moneyTotal){o.offsetMoney=this.moneyTotal-(e-o.offsetMoney);break}}},moneyBlur(){this.offsetGet()}}},f=d,h=(o(\"ce7f\"),o(\"7265\"),o(\"2877\")),p=Object(h[\"a\"])(f,a,i,!1,null,\"a2d34afa\",null);t[\"default\"]=p.exports},a68f:function(e,t,o){},ce7f:function(e,t,o){\"use strict\";o(\"5dd5\")}}]);","extractedComments":[]}
|