From bc7103c700a360cadad0fcf2e4d95a431a0c2e42 Mon Sep 17 00:00:00 2001 From: liuminjian <517059477@qq.com> Date: Sat, 17 Dec 2022 15:27:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E9=93=B6=E8=A1=8C=E5=8D=A1=E8=BD=AC=E8=B4=A6=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 4 +- .../paymentApproval/approvalAdd.vue | 1012 +++------------- .../paymentApproval/approvalModify.vue | 952 ++------------- .../paymentApproval/approvalAdd.vue | 1075 +++-------------- .../paymentApproval/approvalModify.vue | 1013 ++-------------- 5 files changed, 526 insertions(+), 3530 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 2bf7f509..d20b43f4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2202,7 +2202,7 @@ export const constantRoutes = [ meta: { title: '修改银行卡转账申请', hidden: true, - keepAlive: true + // keepAlive: true }, component: (resolve) => require(['@/views/yinnong/bankAgriculture/paymentApproval/approvalModify'], resolve) }, @@ -4387,7 +4387,7 @@ export const constantRoutes = [ meta: { title: '修改银行卡转账申请', hidden: true, - keepAlive: true + // keepAlive: true }, component: (resolve) => require(['@/views/sunVillage_info/bankAgriculture/paymentApproval/approvalModify'], resolve) }, diff --git a/src/views/sunVillage_info/bankAgriculture/paymentApproval/approvalAdd.vue b/src/views/sunVillage_info/bankAgriculture/paymentApproval/approvalAdd.vue index 55b27f47..6a2fc6e5 100644 --- a/src/views/sunVillage_info/bankAgriculture/paymentApproval/approvalAdd.vue +++ b/src/views/sunVillage_info/bankAgriculture/paymentApproval/approvalAdd.vue @@ -221,7 +221,7 @@

收款方信息

- 添加收款方 + 添加收款方
@@ -273,7 +273,6 @@ readonly clickable label="所属银行" - placeholder="" v-model="item.bankTypeText" input-align="right" placeholder="请输入所属银行" @@ -290,23 +289,26 @@ --> -

上传附件

-
+

上传附件

+
- + - + - +
- + + + + + + - - + 保存修改 - 保存并提交 @@ -320,7 +322,7 @@ import { addTransfer , listPayee , updateTransfer , getProjectto , listProject , addProjectto ,selectApprovalByTemplateId, customSubmit ,offlineCustomSubmit, getAccount ,getQmyeFlow , attach ,listInfo ,getInfoto ,addInfoto,listTemplate} from "@/api/onlineHome/bankAgriculture/paymentApproval"; import request from '@/utils/request' - import {attachmentList, commonAttach} from "../../../../api/onlineHome/bankAgriculture/paymentApproval"; + import {attachmentList, commonAttach,systemAttachment} from "../../../../api/onlineHome/bankAgriculture/paymentApproval"; import Dialog from "vant/lib/dialog"; export default { name: "approvalAdd", @@ -424,10 +426,8 @@ isAsc: "desc", }, projectFundType:'', - uploadFiles1:[], - uploadFiles2:[], - uploadFiles3:[], - nowDate:"" + nowDate:"", + isModifyOrder:false, //是已创建订单 false新建订单 true已创建订单 }; }, created() { @@ -562,10 +562,15 @@ } }, getChange(){ - if(this.buttonType == 'update'){ - this.goUpdate(); + if(this.buttonType == 'save'){ + //保存 + this.goSave(); }else if(this.buttonType == 'add'){ + //保存并提交 this.goAdd(); + }else if(this.buttonType == 'update'){ + //修改 + this.goUpdate(); } }, getDictionaries(){ @@ -766,8 +771,6 @@ this.$set(this.form, "expenditureAmount", total); }, goAdd(){ - let _this = this - if(this.chargeItme.length<1){ this.$notify({ type: 'danger', message: '请添加收款方信息' }); return; @@ -800,615 +803,86 @@ return; } } - if((this.uploadFiles1==null||this.uploadFiles1.length==0)&&(this.uploadFiles2==null||this.uploadFiles2.length==0)&&(this.uploadFiles3==null||this.uploadFiles3.length==0)){ + if(this.fileList1.length==0&&this.fileList2.length==0&&this.fileList3.length==0){ Dialog.confirm({ title: '提示', message: '此申请单中未上传任何附件,是否确认提交?', }) .then(() => { - this.$set(this.form, "payeeList", this.chargeItme); - this.$set(this.form, "bankTypeList", this.chargeItme); - this.$set(this.form, "accountTypeList", this.chargeItme); - this.$set(this.form, "transferStatusList", this.chargeItme); - addTransfer(this.form).then(response => { - this.projectForm.outId = response.data.id - this.infoForm.transferId = response.data.id - this.$set(this.projectForm, "ynType", '1'); - if(this.form.capitalExpenditureType==2){ - addProjectto(this.projectForm).then(res => { - if(this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - - }) - }else if(this.form.capitalExpenditureType==4){ - addInfoto(this.infoForm).then(res => { - if(this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - }); + this.saveRelease() }) .catch(() => { return false; }); }else{ - this.$set(this.form, "payeeList", this.chargeItme); - this.$set(this.form, "bankTypeList", this.chargeItme); - this.$set(this.form, "accountTypeList", this.chargeItme); - this.$set(this.form, "transferStatusList", this.chargeItme); - addTransfer(this.form).then(response => { - this.projectForm.outId = response.data.id - this.infoForm.transferId = response.data.id + this.saveRelease() + } + }, + saveRelease(){ + let _this = this; + this.$set(this.form, "payeeList", this.chargeItme); + this.$set(this.form, "bankTypeList", this.chargeItme); + this.$set(this.form, "accountTypeList", this.chargeItme); + this.$set(this.form, "transferStatusList", this.chargeItme); + updateTransfer(this.form).then(response => { + this.$set(this.projectForm, "ynType", '1'); - if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){ - this.uploadFiles1.map((rr1,idx1) => { - let params1 = new FormData(); - params1.append("tableId", response.data.id); - params1.append("tableName", "t_yinnong_transfer"); - params1.append("bizPath", "transfer"); - params1.append("fileType", "1"); - params1.append("file", rr1); - commonAttach(params1).then((r1) => { - if(idx1 == (_this.uploadFiles1.length-1)){ - if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){ - _this.uploadFiles2.map((rr2,idx2) => { - let params2 = new FormData(); - params2.append("tableId", response.data.id); - params2.append("tableName", "t_yinnong_transfer"); - params2.append("bizPath", "transfer"); - params2.append("fileType", "2"); - params2.append("file", rr2); - commonAttach(params2).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", response.data.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - } - }) - }) - }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", response.data.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 ==(_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - } - }) - }) - }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){ - this.uploadFiles2.map((rr2,idx2) => { - let params = new FormData(); - params.append("tableId", response.data.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "2"); - params.append("file", rr2); - commonAttach(params).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", response.data.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - } - }) - }) - }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){ - this.uploadFiles3.map((rr3,idx3) => { - let params = new FormData(); - params.append("tableId", response.data.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "3"); - params.append("file", rr3); - commonAttach(params).then((r) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - }) - }) - }else{ - if(this.form.capitalExpenditureType==2){ + if(this.form.capitalExpenditureType==2){ addProjectto(this.projectForm).then(res => { if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(this.form.capitalExpenditureType==4){ - addInfoto(this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { + customSubmit(this.form.id).then(res => { _this.$toast.success('提交成功'); setTimeout(function(){ - history.go(-1) - },2000) + _this.$router.push('/sunVillage_info/approvalList') + },1500) }) }else{ - offlineCustomSubmit(response.data.id).then(res => { + offlineCustomSubmit(this.form.id).then(res => { _this.$toast.success('提交成功'); setTimeout(function(){ - history.go(-1) - },2000) + _this.$router.push('/sunVillage_info/approvalList') + },1500) }) } }) - }else{ + } else if(this.form.capitalExpenditureType==4){ + addInfoto(this.infoForm).then(res => { if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { + customSubmit(this.form.id).then(res => { _this.$toast.success('提交成功'); setTimeout(function(){ - history.go(-1) - },2000) + _this.$router.push('/sunVillage_info/approvalList') + },1500) }) }else{ - offlineCustomSubmit(response.data.id).then(res => { + offlineCustomSubmit(this.form.id).then(res => { _this.$toast.success('提交成功'); setTimeout(function(){ - history.go(-1) - },2000) + _this.$router.push('/sunVillage_info/approvalList') + },1500) }) } + }) + }else{ + if(_this.form.approvalMode === '1'){ + customSubmit(this.form.id).then(res => { + _this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/sunVillage_info/approvalList') + },1500) + }) + }else{ + offlineCustomSubmit(this.form.id).then(res => { + _this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/sunVillage_info/approvalList') + },1500) + }) } } - }); - } + }) }, - goUpdate(){ + goSave(){ let _this = this if(this.chargeItme.length<1){ this.$notify({ type: 'danger', message: '请添加收款方信息' }); @@ -1450,245 +924,74 @@ this.projectForm.outId = response.data.id this.infoForm.transferId = response.data.id this.$set(this.projectForm, "ynType", '1'); - if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){ - this.uploadFiles1.map((rr1,idx1) => { - let params1 = new FormData(); - params1.append("tableId", response.data.id); - params1.append("tableName", "t_yinnong_transfer"); - params1.append("bizPath", "transfer"); - params1.append("fileType", "1"); - params1.append("file", rr1); - commonAttach(params1).then((r1) => { - if(idx1 == (_this.uploadFiles1.length-1)){ - if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){ - _this.uploadFiles2.map((rr2,idx2) => { - let params2 = new FormData(); - params2.append("tableId", response.data.id); - params2.append("tableName", "t_yinnong_transfer"); - params2.append("bizPath", "transfer"); - params2.append("fileType", "2"); - params2.append("file", rr2); - commonAttach(params2).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", response.data.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - } - }) - }) - }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", response.data.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 ==(_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - } - }) - }) - }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){ - this.uploadFiles2.map((rr2,idx2) => { - let params = new FormData(); - params.append("tableId", response.data.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "2"); - params.append("file", rr2); - commonAttach(params).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", response.data.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - } - }) + this.form.id = response.data.id; + this.isModifyOrder = true; + if(this.form.capitalExpenditureType==2){ + addProjectto(this.projectForm).then(res => { + // this.$toast.success('保存成功'); + // setTimeout(function(){ + // history.go(-1) + // },2000) }) - }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){ - this.uploadFiles3.map((rr3,idx3) => { - let params = new FormData(); - params.append("tableId", response.data.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "3"); - params.append("file", rr3); - commonAttach(params).then((r) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) + } else if(this.form.capitalExpenditureType==4){ + addInfoto(this.infoForm).then(res => { + // this.$toast.success('保存成功'); + // setTimeout(function(){ + // history.go(-1) + // },2000) }) }else{ - if(this.form.capitalExpenditureType==2){ + // this.$toast.success('保存成功'); + // setTimeout(function(){ + // history.go(-1) + // },2000) + } + }) + }, + goUpdate(){ + let _this = this + if(this.chargeItme.length<1){ + this.$notify({ type: 'danger', message: '请添加收款方信息' }); + return; + } + if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){ + this.$notify({ type: 'danger', message: '付款事由禁止包含!' }); + return; + } + if(this.form.capitalExpenditureType==2){ + if(this.projectForm.projectName==""||this.projectForm.projectName==null){ + this.$notify({ type: 'danger', message: '请选择项目名称!' }); + return; + } + if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){ + this.$notify({ type: 'danger', message: '请输入工程发票号!' }); + return; + } + } + if(this.form.capitalExpenditureType==4){ + if(this.infoForm.name==""||this.infoForm.name==null){ + this.$notify({ type: 'danger', message: '请选择合同名称!' }); + return; + } + if(this.infoForm.code==""||this.infoForm.code==null){ + this.$notify({ type: 'danger', message: '请输入合同编码!' }); + return; + } + if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){ + this.$notify({ type: 'danger', message: '请输入合同价款!' }); + return; + } + } + this.$set(this.form, "payeeList", this.chargeItme); + this.$set(this.form, "bankTypeList", this.chargeItme); + this.$set(this.form, "accountTypeList", this.chargeItme); + this.$set(this.form, "transferStatusList", this.chargeItme); + + updateTransfer(this.form).then(response => { + this.projectForm.outId = this.form.id + this.infoForm.transferId = this.form.id + this.$set(this.projectForm, "ynType", '1'); + if(this.form.capitalExpenditureType==2){ addProjectto(this.projectForm).then(res => { this.$toast.success('保存成功'); setTimeout(function(){ @@ -1708,8 +1011,8 @@ history.go(-1) },2000) } - } - }); + }) + }, payeeSelectChange(select, i) { let obj = {}; @@ -1856,35 +1159,22 @@ } } }, - beforeRead1(file) { - this.uploadFiles1.push(file.file); - }, - deleteFile1(file){ - this.uploadFiles1.map((response,index) => { - if(file.file == response){ - this.uploadFiles1.splice(index,1) - } - }) - }, - beforeRead2(file) { - this.uploadFiles2.push(file.file); - }, - deleteFile2(file){ - this.uploadFiles2.map((response,index) => { - if(file.file == response){ - this.uploadFiles2.splice(index,1) - } - }) - }, - beforeRead3(file) { - this.uploadFiles3.push(file.file); + beforeRead(obj) { + return (file) =>{ + let params1 = new FormData(); + params1.append("tableId", this.form.id); + params1.append("tableName", "t_yinnong_transfer"); + params1.append("bizPath", "transfer"); + params1.append("fileType", obj); + params1.append("file", file.file); + commonAttach(params1).then((r1) => { + file.id=r1.id; + file.fileUrl = r1.fileUrl; + }) + } }, - deleteFile3(file){ - this.uploadFiles3.map((response,index) => { - if(file.file == response){ - this.uploadFiles3.splice(index,1) - } - }) + deleteFile(file){ + systemAttachment(file.id).then((res) => {}); }, getFileList(){ let oData1= { diff --git a/src/views/sunVillage_info/bankAgriculture/paymentApproval/approvalModify.vue b/src/views/sunVillage_info/bankAgriculture/paymentApproval/approvalModify.vue index 6cc15ac8..1bccbd2e 100644 --- a/src/views/sunVillage_info/bankAgriculture/paymentApproval/approvalModify.vue +++ b/src/views/sunVillage_info/bankAgriculture/paymentApproval/approvalModify.vue @@ -291,11 +291,11 @@

上传附件

- + - + - +
@@ -758,9 +758,7 @@ return; } } - if((this.uploadFiles1==null||this.uploadFiles1.length==0)&& - (this.uploadFiles2==null||this.uploadFiles2.length==0)&& - (this.uploadFiles3==null||this.uploadFiles3.length==0)&& + if( this.fileList1.length==0&& this.fileList2.length==0&& this.fileList3.length==0){ @@ -769,597 +767,79 @@ message: '此申请单中未上传任何附件,是否确认提交?', }) .then(() => { - this.$set(this.form, "payeeList", this.chargeItme); - this.$set(this.form, "bankTypeList", this.chargeItme); - this.$set(this.form, "accountTypeList", this.chargeItme); - this.$set(this.form, "transferStatusList", this.chargeItme); - updateTransfer(this.form).then(response => { - this.projectForm.outId = this.form.id - this.infoForm.transferId = this.form.id - this.$set(this.projectForm, "ynType", '1'); - if(this.form.capitalExpenditureType==2){ - addProjectto(this.projectForm).then(res => { - if(this.form.approvalMode === '1'){ - customSubmit(this.form.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(this.form.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else if(this.form.capitalExpenditureType==4){ - addInfoto(this.infoForm).then(res => { - if(this.form.approvalMode === '1'){ - customSubmit(this.form.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(this.form.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(this.form.approvalMode === '1'){ - customSubmit(this.form.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(this.form.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - }); + this.saveRelease() }) .catch(() => { return false; }); }else{ - this.$set(this.form, "payeeList", this.chargeItme); - this.$set(this.form, "bankTypeList", this.chargeItme); - this.$set(this.form, "accountTypeList", this.chargeItme); - this.$set(this.form, "transferStatusList", this.chargeItme); - updateTransfer(this.form).then(response => { - this.projectForm.outId = _this.form.id - this.infoForm.transferId = _this.form.id - this.$set(this.projectForm, "ynType", '1'); - if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){ - this.uploadFiles1.map((rr1,idx1) => { - let params1 = new FormData(); - params1.append("tableId", _this.form.id); - params1.append("tableName", "t_yinnong_transfer"); - params1.append("bizPath", "transfer"); - params1.append("fileType", "1"); - params1.append("file", rr1); - commonAttach(params1).then((r1) => { - if(idx1 == (_this.uploadFiles1.length-1)){ - if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){ - _this.uploadFiles2.map((rr2,idx2) => { - let params2 = new FormData(); - params2.append("tableId", _this.form.id); - params2.append("tableName", "t_yinnong_transfer"); - params2.append("bizPath", "transfer"); - params2.append("fileType", "2"); - params2.append("file", rr2); - commonAttach(params2).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", _this.form.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - } - }) - }) - }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", _this.form.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 ==(_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - } - }) - }) - }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){ - this.uploadFiles2.map((rr2,idx2) => { - let params = new FormData(); - params.append("tableId", _this.form.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "2"); - params.append("file", rr2); - commonAttach(params).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", _this.form.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - } - }) - }) - }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){ - this.uploadFiles3.map((rr3,idx3) => { - let params = new FormData(); - params.append("tableId", _this.form.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "3"); - params.append("file", rr3); - commonAttach(params).then((r) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } + this.saveRelease() + } + }, + saveRelease(){ + let _this = this; + this.$set(this.form, "payeeList", this.chargeItme); + this.$set(this.form, "bankTypeList", this.chargeItme); + this.$set(this.form, "accountTypeList", this.chargeItme); + this.$set(this.form, "transferStatusList", this.chargeItme); + updateTransfer(this.form).then(response => { + this.projectForm.outId = this.form.id + this.infoForm.transferId = this.form.id + this.$set(this.projectForm, "ynType", '1'); + if(this.form.capitalExpenditureType==2){ + addProjectto(this.projectForm).then(res => { + if(this.form.approvalMode === '1'){ + customSubmit(this.form.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/sunVillage_info/approvalList') + },2000) }) - }) - }else{ - if(this.form.capitalExpenditureType==2){ - addProjectto(this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } + }else{ + offlineCustomSubmit(this.form.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/sunVillage_info/approvalList') + },2000) }) - } else if(this.form.capitalExpenditureType==4){ - addInfoto(this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } + } + }) + }else if(this.form.capitalExpenditureType==4){ + addInfoto(this.infoForm).then(res => { + if(this.form.approvalMode === '1'){ + customSubmit(this.form.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/sunVillage_info/approvalList') + },2000) }) }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } + offlineCustomSubmit(this.form.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/sunVillage_info/approvalList') + },2000) + }) } + }) + }else{ + if(this.form.approvalMode === '1'){ + customSubmit(this.form.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/sunVillage_info/approvalList') + },2000) + }) + }else{ + offlineCustomSubmit(this.form.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/sunVillage_info/approvalList') + },2000) + }) } - }); - } + } + }); }, goUpdate(){ let _this = this @@ -1403,265 +883,27 @@ this.projectForm.outId = this.form.id this.infoForm.transferId = this.form.id this.$set(this.projectForm, "ynType", '1'); - if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){ - this.uploadFiles1.map((rr1,idx1) => { - let params1 = new FormData(); - params1.append("tableId", _this.form.id); - params1.append("tableName", "t_yinnong_transfer"); - params1.append("bizPath", "transfer"); - params1.append("fileType", "1"); - params1.append("file", rr1); - commonAttach(params1).then((r1) => { - if(idx1 == (_this.uploadFiles1.length-1)){ - if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){ - _this.uploadFiles2.map((rr2,idx2) => { - let params2 = new FormData(); - params2.append("tableId", _this.form.id); - params2.append("tableName", "t_yinnong_transfer"); - params2.append("bizPath", "transfer"); - params2.append("fileType", "2"); - params2.append("file", rr2); - commonAttach(params2).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", _this.form.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - } - }) - }) - }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", _this.form.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 ==(_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - } - }) - }) - }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){ - this.uploadFiles2.map((rr2,idx2) => { - let params = new FormData(); - params.append("tableId", _this.form.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "2"); - params.append("file", rr2); - commonAttach(params).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", _this.form.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - } - }) - }) - }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){ - this.uploadFiles3.map((rr3,idx3) => { - let params = new FormData(); - params.append("tableId", _this.form.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "3"); - params.append("file", rr3); - commonAttach(params).then((r) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) - }) - }else{ + if(this.form.capitalExpenditureType==2){ addProjectto(this.projectForm).then(res => { this.$toast.success('保存成功'); setTimeout(function(){ - history.go(-1) + _this.$router.push('/sunVillage_info/approvalList') },2000) }) } else if(this.form.capitalExpenditureType==4){ addInfoto(this.infoForm).then(res => { this.$toast.success('保存成功'); setTimeout(function(){ - history.go(-1) + _this.$router.push('/sunVillage_info/approvalList') },2000) }) }else{ this.$toast.success('保存成功'); setTimeout(function(){ - history.go(-1) + _this.$router.push('/sunVillage_info/approvalList') },2000) } - } }); }, payeeSelectChange(select, i) { @@ -1787,48 +1029,24 @@ } } }, - beforeRead1(file) { - this.uploadFiles1.push(file.file); - }, - deleteFile1(file){ - this.uploadFiles1.map((response,index) => { - if(file.file == response){ - this.uploadFiles1.splice(index,1) - } - }) - if(file.id){ - systemAttachment(file.id).then((res) => { - }); - } - }, - beforeRead2(file) { - this.uploadFiles2.push(file.file); - }, - deleteFile2(file){ - this.uploadFiles2.map((response,index) => { - if(file.file == response){ - this.uploadFiles2.splice(index,1) - } - }) - if(file.id){ - systemAttachment(file.id).then((res) => { - }); + beforeRead(obj) { + return (file) =>{ + let params1 = new FormData(); + params1.append("tableId", this.form.id); + params1.append("tableName", "t_yinnong_transfer"); + params1.append("bizPath", "transfer"); + params1.append("fileType", obj); + params1.append("file", file.file); + commonAttach(params1).then((r1) => { + file.id=r1.id; + file.fileUrl = r1.fileUrl; + }) } }, - beforeRead3(file) { - this.uploadFiles3.push(file.file); - }, - deleteFile3(file){ - this.uploadFiles3.map((response,index) => { - if(file.file == response){ - this.uploadFiles3.splice(index,1) - } - }) - if(file.id){ - systemAttachment(file.id).then((res) => { - }); - } + deleteFile(file){ + systemAttachment(file.id).then((res) => {}); }, + getFileList(){ let oData1= { tableId: this.$route.query.id, diff --git a/src/views/yinnong/bankAgriculture/paymentApproval/approvalAdd.vue b/src/views/yinnong/bankAgriculture/paymentApproval/approvalAdd.vue index 79dc3703..1b75a5ed 100644 --- a/src/views/yinnong/bankAgriculture/paymentApproval/approvalAdd.vue +++ b/src/views/yinnong/bankAgriculture/paymentApproval/approvalAdd.vue @@ -221,7 +221,7 @@

收款方信息

- 添加收款方 + 添加收款方
@@ -273,7 +273,6 @@ readonly clickable label="所属银行" - placeholder="" v-model="item.bankTypeText" input-align="right" placeholder="请输入所属银行" @@ -290,23 +289,27 @@ -->
-

上传附件

-
+

上传附件

+
- + - + - +
- + + + + + + + - - + 保存修改 - 保存并提交 @@ -320,7 +323,7 @@ import { addTransfer , listPayee , updateTransfer , getProjectto , listProject , addProjectto ,selectApprovalByTemplateId, customSubmit ,offlineCustomSubmit, getAccount ,getQmyeFlow , attach ,listInfo ,getInfoto ,addInfoto,listTemplate} from "@/api/onlineHome/bankAgriculture/paymentApproval"; import request from '@/utils/request' - import {attachmentList, commonAttach} from "../../../../api/onlineHome/bankAgriculture/paymentApproval"; + import {attachmentList, commonAttach,systemAttachment} from "../../../../api/onlineHome/bankAgriculture/paymentApproval"; import Dialog from "vant/lib/dialog"; export default { name: "approvalAdd", @@ -424,10 +427,8 @@ isAsc: "desc", }, projectFundType:'', - uploadFiles1:[], - uploadFiles2:[], - uploadFiles3:[], - nowDate:"" + nowDate:"", + isModifyOrder:false, //是已创建订单 false新建订单 true已创建订单 }; }, created() { @@ -506,7 +507,6 @@ } listProject(queryParams).then(response => { _this.projectList = response.rows; - console.log(response) for (let i = 0; i < response.rows.length; i++) { //_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id}); _this.$set(_this.projectList[i],"text",response.rows[i].projectName) @@ -514,7 +514,6 @@ } }); listInfo(this.queryContractionParams).then(response => { - console.log(response) _this.infoList = response.rows; for (let i = 0; i < response.rows.length; i++) { //_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code}); @@ -564,10 +563,15 @@ } }, getChange(){ - if(this.buttonType == 'update'){ - this.goUpdate(); + if(this.buttonType == 'save'){ + //保存 + this.goSave(); }else if(this.buttonType == 'add'){ + //保存并提交 this.goAdd(); + }else if(this.buttonType == 'update'){ + //修改 + this.goUpdate(); } }, getDictionaries(){ @@ -583,7 +587,6 @@ }); }, getError(e){ - console.log(e) this.$notify({ type: 'danger', message: e.errors[0].message }); }, addChargeItme(index){ @@ -663,7 +666,6 @@ this.showcapital = false; }, onConfirmFundType(data){ - console.log(data) this.projectForm.projectFundType = data.value; this.projectFundType = data.text; this.showFundType = false; @@ -699,7 +701,6 @@ this.chargeItme[index].payeeId = data.value; this.chargeItme[index].showpayee = false; this.payeeSelectChange(data.value , index) - console.log(data) }, onConfirmBankType(data,index){ for (var i = 0 ; i < this.chargeItme.length ; i++){ @@ -755,7 +756,6 @@ }, // 钱计算 moneyChange(input) { - console.log(input) let obj = {}; obj = this.chargeItme.find((account) => { //model就是上面的数据源 @@ -768,7 +768,6 @@ this.$set(this.form, "expenditureAmount", total); }, goAdd(){ - let _this = this if(this.chargeItme.length<1){ this.$notify({ type: 'danger', message: '请添加收款方信息' }); @@ -802,615 +801,88 @@ return; } } - if((this.uploadFiles1==null||this.uploadFiles1.length==0)&&(this.uploadFiles2==null||this.uploadFiles2.length==0)&&(this.uploadFiles3==null||this.uploadFiles3.length==0)){ + if(this.fileList1.length==0&&this.fileList2.length==0&&this.fileList3.length==0){ Dialog.confirm({ title: '提示', message: '此申请单中未上传任何附件,是否确认提交?', }) .then(() => { - this.$set(this.form, "payeeList", this.chargeItme); - this.$set(this.form, "bankTypeList", this.chargeItme); - this.$set(this.form, "accountTypeList", this.chargeItme); - this.$set(this.form, "transferStatusList", this.chargeItme); - addTransfer(this.form).then(response => { - this.projectForm.outId = response.data.id - this.infoForm.transferId = response.data.id - this.$set(this.projectForm, "ynType", '1'); - if(this.form.capitalExpenditureType==2){ - addProjectto(this.projectForm).then(res => { - if(this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - - }) - }else if(this.form.capitalExpenditureType==4){ - addInfoto(this.infoForm).then(res => { - if(this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - }); + this.saveRelease() }) .catch(() => { return false; }); }else{ - this.$set(this.form, "payeeList", this.chargeItme); - this.$set(this.form, "bankTypeList", this.chargeItme); - this.$set(this.form, "accountTypeList", this.chargeItme); - this.$set(this.form, "transferStatusList", this.chargeItme); - addTransfer(this.form).then(response => { - this.projectForm.outId = response.data.id - this.infoForm.transferId = response.data.id - this.$set(this.projectForm, "ynType", '1'); - if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){ - this.uploadFiles1.map((rr1,idx1) => { - let params1 = new FormData(); - params1.append("tableId", response.data.id); - params1.append("tableName", "t_yinnong_transfer"); - params1.append("bizPath", "transfer"); - params1.append("fileType", "1"); - params1.append("file", rr1); - commonAttach(params1).then((r1) => { - if(idx1 == (_this.uploadFiles1.length-1)){ - if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){ - _this.uploadFiles2.map((rr2,idx2) => { - let params2 = new FormData(); - params2.append("tableId", response.data.id); - params2.append("tableName", "t_yinnong_transfer"); - params2.append("bizPath", "transfer"); - params2.append("fileType", "2"); - params2.append("file", rr2); - commonAttach(params2).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", response.data.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - } - }) - }) - }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", response.data.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 ==(_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - } - }) - }) - }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){ - this.uploadFiles2.map((rr2,idx2) => { - let params = new FormData(); - params.append("tableId", response.data.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "2"); - params.append("file", rr2); - commonAttach(params).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", response.data.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - } - }) - }) - }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){ - this.uploadFiles3.map((rr3,idx3) => { - let params = new FormData(); - params.append("tableId", response.data.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "3"); - params.append("file", rr3); - commonAttach(params).then((r) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } + this.saveRelease() + } + }, + saveRelease(){ + let _this = this; + this.$set(this.form, "payeeList", this.chargeItme); + this.$set(this.form, "bankTypeList", this.chargeItme); + this.$set(this.form, "accountTypeList", this.chargeItme); + this.$set(this.form, "transferStatusList", this.chargeItme); + updateTransfer(this.form).then(response => { + this.projectForm.outId = this.form.id + this.infoForm.transferId = this.form.id + this.$set(this.projectForm, "ynType", '1'); + if(this.form.capitalExpenditureType==2){ + addProjectto(this.projectForm).then(res => { + if(this.form.approvalMode === '1'){ + customSubmit(this.projectForm.outId).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) }) - }) - }else{ - if(this.form.capitalExpenditureType==2){ - addProjectto(this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } + }else{ + offlineCustomSubmit(this.projectForm.outId).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) }) - } else if(this.form.capitalExpenditureType==4){ - addInfoto(this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } + } + + }) + }else if(this.form.capitalExpenditureType==4){ + addInfoto(this.infoForm).then(res => { + if(this.form.approvalMode === '1'){ + customSubmit(this.projectForm.outId).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) }) }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(response.data.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } + offlineCustomSubmit(this.projectForm.outId).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) + }) } + }) + }else{ + if(this.form.approvalMode === '1'){ + customSubmit(this.projectForm.outId).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) + }) + }else{ + offlineCustomSubmit(this.projectForm.outId).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },2000) + }) } - }); - } + } + }) }, - goUpdate(){ + goSave(){ let _this = this if(this.chargeItme.length<1){ this.$notify({ type: 'danger', message: '请添加收款方信息' }); @@ -1449,270 +921,80 @@ this.$set(this.form, "accountTypeList", this.chargeItme); this.$set(this.form, "transferStatusList", this.chargeItme); addTransfer(this.form).then(response => { - this.projectForm.outId = response.data.id - this.infoForm.transferId = response.data.id + this.projectForm.outId = response.data.id; + this.infoForm.transferId = response.data.id; + this.form.id = response.data.id; this.$set(this.projectForm, "ynType", '1'); - if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){ - this.uploadFiles1.map((rr1,idx1) => { - let params1 = new FormData(); - params1.append("tableId", response.data.id); - params1.append("tableName", "t_yinnong_transfer"); - params1.append("bizPath", "transfer"); - params1.append("fileType", "1"); - params1.append("file", rr1); - commonAttach(params1).then((r1) => { - if(idx1 == (_this.uploadFiles1.length-1)){ - if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){ - _this.uploadFiles2.map((rr2,idx2) => { - let params2 = new FormData(); - params2.append("tableId", response.data.id); - params2.append("tableName", "t_yinnong_transfer"); - params2.append("bizPath", "transfer"); - params2.append("fileType", "2"); - params2.append("file", rr2); - commonAttach(params2).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", response.data.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - } - }) - }) - }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", response.data.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 ==(_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - } - }) + this.isModifyOrder = true; + if(this.form.capitalExpenditureType==2){ + addProjectto(this.projectForm).then(res => { + // this.$toast.success('保存成功'); + // setTimeout(function(){ + // history.go(-1) + // },2000) }) - }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){ - this.uploadFiles2.map((rr2,idx2) => { - let params = new FormData(); - params.append("tableId", response.data.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "2"); - params.append("file", rr2); - commonAttach(params).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", response.data.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - } - }) - }) - }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){ - this.uploadFiles3.map((rr3,idx3) => { - let params = new FormData(); - params.append("tableId", response.data.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "3"); - params.append("file", rr3); - commonAttach(params).then((r) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) + } else if(this.form.capitalExpenditureType==4){ + addInfoto(this.infoForm).then(res => { + // this.$toast.success('保存成功'); + // setTimeout(function(){ + // history.go(-1) + // },2000) }) }else{ - if(this.form.capitalExpenditureType==2){ - addProjectto(this.projectForm).then(res => { - this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(this.form.capitalExpenditureType==4){ - addInfoto(this.infoForm).then(res => { - this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } + // this.$toast.success('保存成功'); + // setTimeout(function(){ + // history.go(-1) + // },2000) } }); }, + goUpdate(){ + let _this = this; + if(this.chargeItme.length<1){ + this.$notify({ type: 'danger', message: '请添加收款方信息' }); + return; + } + if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){ + this.$notify({ type: 'danger', message: '转账附言禁止包含!' }); + return; + } + if(this.form.capitalExpenditureType==2){ + if(this.projectForm.projectName==""||this.projectForm.projectName==null){ + this.$notify({ type: 'danger', message: '请选择项目名称!' }); + return; + } + if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){ + this.$notify({ type: 'danger', message: '请输入工程发票号!' }); + return; + } + } + if(this.form.capitalExpenditureType==4){ + if(this.infoForm.name==""||this.infoForm.name==null){ + this.$notify({ type: 'danger', message: '请选择合同名称!' }); + return; + } + if(this.infoForm.code==""||this.infoForm.code==null){ + this.$notify({ type: 'danger', message: '请输入合同编码!' }); + return; + } + if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){ + this.$notify({ type: 'danger', message: '请输入合同价款!' }); + return; + } + } + this.$set(this.form, "payeeList", this.chargeItme); + this.$set(this.form, "bankTypeList", this.chargeItme); + this.$set(this.form, "accountTypeList", this.chargeItme); + this.$set(this.form, "transferStatusList", this.chargeItme); + updateTransfer(this.form).then(response => { + this.projectForm.outId = this.form.id + this.infoForm.transferId = this.form.id + this.$set(this.projectForm, "ynType", '1'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) + }) + }, payeeSelectChange(select, i) { let obj = {}; let fuzhitype = 0; @@ -1858,35 +1140,22 @@ } } }, - beforeRead1(file) { - this.uploadFiles1.push(file.file); - }, - deleteFile1(file){ - this.uploadFiles1.map((response,index) => { - if(file.file == response){ - this.uploadFiles1.splice(index,1) - } - }) - }, - beforeRead2(file) { - this.uploadFiles2.push(file.file); - }, - deleteFile2(file){ - this.uploadFiles2.map((response,index) => { - if(file.file == response){ - this.uploadFiles2.splice(index,1) - } - }) - }, - beforeRead3(file) { - this.uploadFiles3.push(file.file); + beforeRead(obj) { + return (file) =>{ + let params1 = new FormData(); + params1.append("tableId", this.projectForm.outId); + params1.append("tableName", "t_yinnong_transfer"); + params1.append("bizPath", "transfer"); + params1.append("fileType", obj); + params1.append("file", file.file); + commonAttach(params1).then((r1) => { + file.id=r1.id; + file.fileUrl = r1.fileUrl; + }) + } }, - deleteFile3(file){ - this.uploadFiles3.map((response,index) => { - if(file.file == response){ - this.uploadFiles3.splice(index,1) - } - }) + deleteFile(file){ + systemAttachment(file.id).then((res) => {}); }, getFileList(){ let oData1= { @@ -1938,10 +1207,8 @@ // 监听路由变化, 实现类似 小程序的 onShow 事件 if (to.path === '/yinnong/approvalAdd') { // do anything you want - console.log("aaa") if (this.$route.params.payeeForm){ this.chargeItme.push(this.$route.params.payeeForm) - console.log(this.$route.params.payeeForm) } } } diff --git a/src/views/yinnong/bankAgriculture/paymentApproval/approvalModify.vue b/src/views/yinnong/bankAgriculture/paymentApproval/approvalModify.vue index d803d79c..02762463 100644 --- a/src/views/yinnong/bankAgriculture/paymentApproval/approvalModify.vue +++ b/src/views/yinnong/bankAgriculture/paymentApproval/approvalModify.vue @@ -291,11 +291,11 @@

上传附件

- + - + - +
@@ -400,17 +400,15 @@ fileList1:[], fileList2:[], fileList3:[], - uploadFiles1:[], - uploadFiles2:[], - uploadFiles3:[], templateList:[], }; }, - created() { + mounted() { let queryParams={ pageNum: 1, pageSize: 100, } + this.getFileList(); listProject(queryParams).then(response => { this.projectList = response.rows; for (let i = 0; i < response.rows.length; i++) { @@ -445,8 +443,9 @@ }) }); this.getDictionaries(); - this.getFileList(); + }, + methods: { goFlow(){ @@ -528,7 +527,6 @@ response.rows[j].showPayee = false; } this.chargeItme = response.rows; - console.log(this.chargeItme) }); }); }, @@ -622,7 +620,6 @@ this.showcapital = false; }, onConfirmFundType(data){ - console.log(data) this.projectForm.projectFundType = data.value; this.projectFundType = data.text; this.showFundType = false; @@ -650,7 +647,6 @@ this.showcontract = false; }, onConfirmPayee(data,index){ - console.log(data) for (var i = 0 ; i < this.chargeItme.length ; i++){ this.chargeItme[i].showPayee = false; } @@ -712,7 +708,6 @@ }, // 钱计算 moneyChange(input) { - console.log(input) let obj = {}; obj = this.chargeItme.find((account) => { //model就是上面的数据源 @@ -758,9 +753,7 @@ return; } } - if((this.uploadFiles1==null||this.uploadFiles1.length==0)&& - (this.uploadFiles2==null||this.uploadFiles2.length==0)&& - (this.uploadFiles3==null||this.uploadFiles3.length==0)&& + if( this.fileList1.length==0&& this.fileList2.length==0&& this.fileList3.length==0){ @@ -769,597 +762,80 @@ message: '此申请单中未上传任何附件,是否确认提交?', }) .then(() => { - this.$set(this.form, "payeeList", this.chargeItme); - this.$set(this.form, "bankTypeList", this.chargeItme); - this.$set(this.form, "accountTypeList", this.chargeItme); - this.$set(this.form, "transferStatusList", this.chargeItme); - updateTransfer(this.form).then(response => { - this.projectForm.outId = this.form.id - this.infoForm.transferId = this.form.id - this.$set(this.projectForm, "ynType", '1'); - if(this.form.capitalExpenditureType==2){ - addProjectto(this.projectForm).then(res => { - if(this.form.approvalMode === '1'){ - customSubmit(this.form.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(this.form.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else if(this.form.capitalExpenditureType==4){ - addInfoto(this.infoForm).then(res => { - if(this.form.approvalMode === '1'){ - customSubmit(this.form.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(this.form.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(this.form.approvalMode === '1'){ - customSubmit(this.form.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(this.form.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - }); + this.saveRelease() }) .catch(() => { return false; }); }else{ - this.$set(this.form, "payeeList", this.chargeItme); - this.$set(this.form, "bankTypeList", this.chargeItme); - this.$set(this.form, "accountTypeList", this.chargeItme); - this.$set(this.form, "transferStatusList", this.chargeItme); - updateTransfer(this.form).then(response => { - this.projectForm.outId = _this.form.id - this.infoForm.transferId = _this.form.id - this.$set(this.projectForm, "ynType", '1'); - if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){ - this.uploadFiles1.map((rr1,idx1) => { - let params1 = new FormData(); - params1.append("tableId", _this.form.id); - params1.append("tableName", "t_yinnong_transfer"); - params1.append("bizPath", "transfer"); - params1.append("fileType", "1"); - params1.append("file", rr1); - commonAttach(params1).then((r1) => { - if(idx1 == (_this.uploadFiles1.length-1)){ - if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){ - _this.uploadFiles2.map((rr2,idx2) => { - let params2 = new FormData(); - params2.append("tableId", _this.form.id); - params2.append("tableName", "t_yinnong_transfer"); - params2.append("bizPath", "transfer"); - params2.append("fileType", "2"); - params2.append("file", rr2); - commonAttach(params2).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", _this.form.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - } - }) - }) - }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", _this.form.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 ==(_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - } - }) - }) - }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){ - this.uploadFiles2.map((rr2,idx2) => { - let params = new FormData(); - params.append("tableId", _this.form.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "2"); - params.append("file", rr2); - commonAttach(params).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", _this.form.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } - } - }) - }) - }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){ - this.uploadFiles3.map((rr3,idx3) => { - let params = new FormData(); - params.append("tableId", _this.form.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "3"); - params.append("file", rr3); - commonAttach(params).then((r) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - }) - }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } - } - } + this.saveRelease() + } + }, + saveRelease(){ + let _this = this; + this.$set(this.form, "payeeList", this.chargeItme); + this.$set(this.form, "bankTypeList", this.chargeItme); + this.$set(this.form, "accountTypeList", this.chargeItme); + this.$set(this.form, "transferStatusList", this.chargeItme); + + updateTransfer(this.form).then(response => { + this.projectForm.outId = this.form.id + this.infoForm.transferId = this.form.id + this.$set(this.projectForm, "ynType", '1'); + if(this.form.capitalExpenditureType==2){ + addProjectto(this.projectForm).then(res => { + if(this.form.approvalMode === '1'){ + customSubmit(this.form.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) }) - }) - }else{ - if(this.form.capitalExpenditureType==2){ - addProjectto(this.projectForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } + }else{ + offlineCustomSubmit(this.form.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) }) - } else if(this.form.capitalExpenditureType==4){ - addInfoto(this.infoForm).then(res => { - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } + } + }) + }else if(this.form.capitalExpenditureType==4){ + addInfoto(this.infoForm).then(res => { + if(this.form.approvalMode === '1'){ + customSubmit(this.form.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) }) }else{ - if(_this.form.approvalMode === '1'){ - customSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - offlineCustomSubmit(_this.form.id).then(res => { - _this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } + offlineCustomSubmit(this.form.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) + }) } + }) + }else{ + if(this.form.approvalMode === '1'){ + customSubmit(this.form.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) + }) + }else{ + offlineCustomSubmit(this.form.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) + }) } - }); - } + } + }); }, goUpdate(){ let _this = this @@ -1403,265 +879,28 @@ this.projectForm.outId = this.form.id this.infoForm.transferId = this.form.id this.$set(this.projectForm, "ynType", '1'); - if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){ - this.uploadFiles1.map((rr1,idx1) => { - let params1 = new FormData(); - params1.append("tableId", _this.form.id); - params1.append("tableName", "t_yinnong_transfer"); - params1.append("bizPath", "transfer"); - params1.append("fileType", "1"); - params1.append("file", rr1); - commonAttach(params1).then((r1) => { - if(idx1 == (_this.uploadFiles1.length-1)){ - if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){ - _this.uploadFiles2.map((rr2,idx2) => { - let params2 = new FormData(); - params2.append("tableId", _this.form.id); - params2.append("tableName", "t_yinnong_transfer"); - params2.append("bizPath", "transfer"); - params2.append("fileType", "2"); - params2.append("file", rr2); - commonAttach(params2).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", _this.form.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - } - }) - }) - }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", _this.form.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params3).then((r3) => { - if(idx3 ==(_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - } - }) - }) - }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){ - this.uploadFiles2.map((rr2,idx2) => { - let params = new FormData(); - params.append("tableId", _this.form.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "2"); - params.append("file", rr2); - commonAttach(params).then((r2) => { - if(idx2 == (_this.uploadFiles2.length-1)){ - if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){ - _this.uploadFiles3.map((rr3,idx3) => { - let params3 = new FormData(); - params3.append("tableId", _this.form.id); - params3.append("tableName", "t_yinnong_transfer"); - params3.append("bizPath", "transfer"); - params3.append("fileType", "3"); - params3.append("file", rr3); - commonAttach(params).then((r3) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) - }) - }else{ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - } - }) - }) - }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){ - this.uploadFiles3.map((rr3,idx3) => { - let params = new FormData(); - params.append("tableId", _this.form.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "transfer"); - params.append("fileType", "3"); - params.append("file", rr3); - commonAttach(params).then((r) => { - if(idx3 == (_this.uploadFiles3.length-1)){ - if(_this.form.capitalExpenditureType==2){ - addProjectto(_this.projectForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(_this.form.capitalExpenditureType==4){ - addInfoto(_this.infoForm).then(res => { - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ - _this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } - } - }) + + if(this.form.capitalExpenditureType==2){ + addProjectto(this.projectForm).then(res => { + this.$toast.success('保存成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) }) - }else{ - if(this.form.capitalExpenditureType==2){ - addProjectto(this.projectForm).then(res => { - this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } else if(this.form.capitalExpenditureType==4){ - addInfoto(this.infoForm).then(res => { - this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }else{ + } else if(this.form.capitalExpenditureType==4){ + addInfoto(this.infoForm).then(res => { this.$toast.success('保存成功'); setTimeout(function(){ - history.go(-1) - },2000) - } + _this.$router.push('/yinnong/approvalList') + },1000) + }) + }else{ + this.$toast.success('保存成功'); + setTimeout(function(){ + _this.$router.push('/yinnong/approvalList') + },1000) } + }); }, payeeSelectChange(select, i) { @@ -1740,7 +979,6 @@ this.$set(this.form, "enterpriseCode", obj.enterpriseCode); this.$set(this.form, "bankType", obj.bankType); this.$set(this.form, "payerFrom", '1'); - console.log(obj.bankType) if(obj.bankType==1){ this.form.accountType = "1" this.form.isPeers = null @@ -1787,48 +1025,24 @@ } } }, - beforeRead1(file) { - this.uploadFiles1.push(file.file); - }, - deleteFile1(file){ - this.uploadFiles1.map((response,index) => { - if(file.file == response){ - this.uploadFiles1.splice(index,1) - } - }) - if(file.id){ - systemAttachment(file.id).then((res) => { - }); - } - }, - beforeRead2(file) { - this.uploadFiles2.push(file.file); - }, - deleteFile2(file){ - this.uploadFiles2.map((response,index) => { - if(file.file == response){ - this.uploadFiles2.splice(index,1) - } - }) - if(file.id){ - systemAttachment(file.id).then((res) => { - }); + beforeRead(obj) { + return (file) =>{ + let params1 = new FormData(); + params1.append("tableId", this.form.id); + params1.append("tableName", "t_yinnong_transfer"); + params1.append("bizPath", "transfer"); + params1.append("fileType", obj); + params1.append("file", file.file); + commonAttach(params1).then((r1) => { + file.id=r1.id; + file.fileUrl = r1.fileUrl; + }) } }, - beforeRead3(file) { - this.uploadFiles3.push(file.file); - }, - deleteFile3(file){ - this.uploadFiles3.map((response,index) => { - if(file.file == response){ - this.uploadFiles3.splice(index,1) - } - }) - if(file.id){ - systemAttachment(file.id).then((res) => { - }); - } + deleteFile(file){ + systemAttachment(file.id).then((res) => {}); }, + getFileList(){ let oData1= { tableId: this.$route.query.id, @@ -1837,10 +1051,13 @@ fileType: "1", } attachmentList(oData1).then(res => { + let arr = []; res.rows.map(r => { - let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL - this.fileList1.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id}) + let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL; + arr.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id}) }) + this.fileList1 = arr; + this.$forceUpdate() }) let oData2= { tableId: this.$route.query.id, @@ -1849,10 +1066,13 @@ fileType: "2", } attachmentList(oData2).then(res => { + let arr = []; res.rows.map(r => { let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL - this.fileList2.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id}) + arr.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id}) }) + this.fileList2 = arr; + this.$forceUpdate() }) let oData3= { tableId: this.$route.query.id, @@ -1861,10 +1081,13 @@ fileType: "3", } attachmentList(oData3).then(res => { + let arr = []; res.rows.map(r => { let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL - this.fileList3.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id}) + arr.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id}) }) + this.fileList3 = arr; + this.$forceUpdate() }) }, goBack(){ @@ -1880,10 +1103,8 @@ // 监听路由变化, 实现类似 小程序的 onShow 事件 if (to.path === '/yinnong/approvalModify') { // do anything you want - console.log("aaa") if (this.$route.params.payeeForm){ this.chargeItme.push(this.$route.params.payeeForm) - console.log(this.$route.params.payeeForm) } } }