From 3b1bc57e5d129c0401ef827ea4993199ff46ff17 Mon Sep 17 00:00:00 2001 From: yujk <990961482@qq.com> Date: Wed, 13 Oct 2021 17:55:43 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=B6=E5=86=9C=E6=94=AF=E4=BB=98=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 91 ++- .../paymentApproval/approvalAdd.vue | 12 +- .../paymentApproval/approvalAdd10.vue | 7 +- .../paymentApproval/approvalAdd11.vue | 11 +- .../paymentApproval/approvalAdd12.vue | 181 ++++-- .../paymentApproval/approvalAdd2.vue | 7 +- .../paymentApproval/approvalAdd3.vue | 11 +- .../paymentApproval/approvalAdd4.vue | 221 +++++-- .../paymentApproval/approvalAdd5.vue | 8 +- .../paymentApproval/approvalApproval.vue | 60 +- .../paymentApproval/approvalApproval10.vue | 501 +++++++++++++++ .../paymentApproval/approvalApproval11.vue | 506 ++++++++++++++++ .../paymentApproval/approvalApproval12.vue | 569 ++++++++++++++++++ .../paymentApproval/approvalDetail.vue | 29 +- .../paymentApproval/approvalDetail10.vue | 2 +- .../paymentApproval/approvalDetail11.vue | 2 +- .../paymentApproval/approvalDetail2.vue | 31 +- .../paymentApproval/approvalDetail3.vue | 31 +- .../paymentApproval/approvalDetail4.vue | 31 +- .../paymentApproval/approvalDetail5.vue | 2 +- .../paymentApproval/approvalList2.vue | 4 +- .../paymentApproval/approvalList3.vue | 2 +- .../paymentApproval/approvalList4.vue | 2 +- .../paymentApproval/approvalModify.vue | 244 ++++++-- .../paymentApproval/approvalModify10.vue | 5 +- .../paymentApproval/approvalModify11.vue | 5 +- .../paymentApproval/approvalModify12.vue | 5 +- .../paymentApproval/approvalModify2.vue | 234 +++++-- .../paymentApproval/approvalModify3.vue | 237 ++++++-- .../paymentApproval/approvalModify4.vue | 310 ++++++---- .../paymentApproval/approvalModify5.vue | 27 +- .../paymentApproval/approvalProcess.vue | 5 +- .../paymentApproval/approvalProcess2.vue | 5 +- src/views/onlineHome/done.vue | 29 +- 34 files changed, 2918 insertions(+), 509 deletions(-) create mode 100644 src/views/onlineHome/bankAgriculture/paymentApproval/approvalApproval10.vue create mode 100644 src/views/onlineHome/bankAgriculture/paymentApproval/approvalApproval11.vue create mode 100644 src/views/onlineHome/bankAgriculture/paymentApproval/approvalApproval12.vue diff --git a/src/router/index.js b/src/router/index.js index 38f2e4a6..4a2bb654 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1027,7 +1027,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalList', name: 'approvalList', meta: { - title: '银农支付付款申请', + title: '常用转账列表', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalList'], resolve) @@ -1036,7 +1036,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalList2', name: 'approvalList2', meta: { - title: '信用卡转账', + title: '信用卡转账列表', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalList2'], resolve) @@ -1045,7 +1045,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalList3', name: 'approvalList3', meta: { - title: '虚拟挂账', + title: '虚拟挂账列表', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalList3'], resolve) @@ -1054,7 +1054,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalList4', name: 'approvalList4', meta: { - title: '虚拟转账', + title: '虚拟转账列表', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalList4'], resolve) @@ -1063,7 +1063,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalList5', name: 'approvalList5', meta: { - title: '母子转张', + title: '母子转账列表', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalList5'], resolve) @@ -1072,7 +1072,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalList10', name: 'approvalList10', meta: { - title: '资金提现', + title: '现金提现列表', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalList10'], resolve) @@ -1081,7 +1081,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalList11', name: 'approvalList11', meta: { - title: '资金使用', + title: '现金使用列表', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalList11'], resolve) @@ -1090,7 +1090,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalList12', name: 'approvalList12', meta: { - title: '汇票支出', + title: '汇票支出列表', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalList12'], resolve) @@ -1099,7 +1099,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalDetail', name: 'approvalDetail', meta: { - title: '银农支付付款申请', + title: '银农常用转账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalDetail'], resolve) @@ -1108,7 +1108,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalDetail2', name: 'approvalDetail2', meta: { - title: '银农支付付款申请', + title: '银农信用卡转账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalDetail2'], resolve) @@ -1117,7 +1117,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalDetail3', name: 'approvalDetail3', meta: { - title: '银农支付付款申请', + title: '银农虚拟挂账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalDetail3'], resolve) @@ -1126,7 +1126,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalDetail4', name: 'approvalDetail4', meta: { - title: '银农支付付款申请', + title: '银农虚拟转账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalDetail4'], resolve) @@ -1135,7 +1135,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalDetail5', name: 'approvalDetail5', meta: { - title: '银农支付付款申请', + title: '银农母子转账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalDetail5'], resolve) @@ -1144,7 +1144,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalDetail10', name: 'approvalDetail10', meta: { - title: '银农支付付款申请', + title: '银农现金提现申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalDetail10'], resolve) @@ -1153,7 +1153,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalDetail11', name: 'approvalDetail11', meta: { - title: '银农支付付款申请', + title: '银农现金使用申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalDetail11'], resolve) @@ -1162,7 +1162,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalDetail12', name: 'approvalDetail12', meta: { - title: '银农支付付款申请', + title: '银农汇票支出申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalDetail12'], resolve) @@ -1171,7 +1171,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalAdd', name: 'approvalAdd', meta: { - title: '添加常用转账付款申请', + title: '添加常用转账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd'], resolve) @@ -1180,7 +1180,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalAdd2', name: 'approvalAdd2', meta: { - title: '添加信用卡转账付款申请', + title: '添加信用卡转账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd2'], resolve) @@ -1189,7 +1189,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalAdd3', name: 'approvalAdd3', meta: { - title: '添加虚拟挂账付款申请', + title: '添加虚拟挂账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd3'], resolve) @@ -1198,7 +1198,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalAdd4', name: 'approvalAdd4', meta: { - title: '添加虚拟转账付款申请', + title: '添加虚拟转账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd4'], resolve) @@ -1207,7 +1207,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalAdd5', name: 'approvalAdd5', meta: { - title: '添加母子转账付款申请', + title: '添加母子转账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd5'], resolve) @@ -1216,7 +1216,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalAdd10', name: 'approvalAdd10', meta: { - title: '添加资金提现付款申请', + title: '添加现金提现申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd10'], resolve) @@ -1225,7 +1225,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalAdd11', name: 'approvalAdd11', meta: { - title: '添加资金使用付款申请', + title: '添加现金使用申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd11'], resolve) @@ -1234,7 +1234,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalAdd12', name: 'approvalAdd12', meta: { - title: '添加汇票支出付款申请', + title: '添加汇票支出申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd12'], resolve) @@ -1248,11 +1248,38 @@ export const constantRoutes = [ }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalApproval'], resolve) }, + { + path: '/onlineHome/approvalApproval10', + name: 'approvalApproval10', + meta: { + title: '付款审批', + hidden: true, + }, + component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalApproval10'], resolve) + },{ + path: '/onlineHome/approvalApproval11', + name: 'approvalApproval11', + meta: { + title: '付款审批', + hidden: true, + }, + component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalApproval11'], resolve) + }, + { + path: '/onlineHome/approvalApproval12', + name: 'approvalApproval12', + meta: { + title: '付款审批', + hidden: true, + }, + component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalApproval12'], resolve) + }, + { path: '/onlineHome/approvalModify', name: 'approvalModify', meta: { - title: '修改银农支付付款申请', + title: '修改常用转账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalModify'], resolve) @@ -1261,7 +1288,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalModify2', name: 'approvalModify2', meta: { - title: '修改银农支付付款申请', + title: '修改信用卡转账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalModify2'], resolve) @@ -1270,7 +1297,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalModify3', name: 'approvalModify3', meta: { - title: '修改银农支付付款申请', + title: '修改虚拟挂账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalModify3'], resolve) @@ -1279,7 +1306,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalModify4', name: 'approvalModify4', meta: { - title: '修改银农支付付款申请', + title: '修改虚拟转账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalModify4'], resolve) @@ -1288,7 +1315,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalModify5', name: 'approvalModify5', meta: { - title: '修改银农支付付款申请', + title: '修改母子转账申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalModify5'], resolve) @@ -1297,7 +1324,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalModify10', name: 'approvalModify10', meta: { - title: '修改银农支付付款申请', + title: '修改现金提现申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalModify10'], resolve) @@ -1306,7 +1333,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalModify11', name: 'approvalModify11', meta: { - title: '修改银农支付付款申请', + title: '修改现金使用申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalModify11'], resolve) @@ -1315,7 +1342,7 @@ export const constantRoutes = [ path: '/onlineHome/approvalModify12', name: 'approvalModify12', meta: { - title: '修改银农支付付款申请', + title: '修改汇票支出申请', hidden: true, }, component: (resolve) => require(['@/views/onlineHome/bankAgriculture/paymentApproval/approvalModify12'], resolve) diff --git a/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd.vue b/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd.vue index 8b29bff8..91179ff5 100644 --- a/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd.vue +++ b/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd.vue @@ -33,6 +33,7 @@ :min-date="minDate" :max-date="maxDate" @confirm="onConfirmLasj" + @cancel="showlasj = false" /> { + console.log(response) this.payerOptions = response.rows; response.rows.map((res,index) => { res['payerFrom'] = '1' @@ -436,12 +438,11 @@ this.queryParams.accountType = this.form.accountType this.queryParams.status = "0" listPayee(this.queryParams).then((response) => { + console.log(response) this.payeeList = response.rows; response.rows.map((res,index) => { - if(res.payeeType==1||res.payeeType==2){ this.payeeList[index].text = res.payee; this.payeeList[index].value = res.id; - } }) }); }, @@ -512,6 +513,7 @@ }, accountTypeChange(e){ this.payeeList = []; + this.chargeItme = []; this.queryParams.accountType = this.form.accountType this.queryParams.status = "0" listPayee(this.queryParams).then((response) => { @@ -555,7 +557,7 @@ return; } } - if(this.uploadFiles==null||this.uploadFiles.length==0){ + if((this.uploadFiles==null||this.uploadFiles.length==0)&&(this.fileList==null||this.fileList.length==0)){ Dialog.confirm({ title: '提示', message: '此申请单中未上传任何附件,是否确认提交?', diff --git a/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd10.vue b/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd10.vue index 2ecdd123..1ac0d145 100644 --- a/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd10.vue +++ b/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd10.vue @@ -7,7 +7,7 @@ @click-left="$router.back(-1)" > @@ -33,6 +33,7 @@ :min-date="minDate" :max-date="maxDate" @confirm="onConfirmLasj" + @cancel="showlasj = false" /> @@ -33,6 +33,7 @@ :min-date="minDate" :max-date="maxDate" @confirm="onConfirmLasj" + @cancel="showlasj = false" /> { - this.chargeItme.map(res => { - res.cashId = response.data.id - addCashdetail(res).then(r => { - if(this.form.capitalExpenditureType==2){ - this.projectForm.outId = response.data.id - this.$set(this.projectForm, "ynType", '3'); - addProjectto(this.projectForm).then(res => { - customSubmit(response.data.id).then(res => { + if(this.uploadFiles==null||this.uploadFiles.length==0){ + Dialog.confirm({ + title: '提示', + message: '此申请单中未上传任何附件,是否确认提交?', + }) + .then(() => { + addCash(this.form).then((response) => { + this.chargeItme.map(res => { + res.cashId = response.data.id + addCashdetail(res).then(r => { + if(this.form.capitalExpenditureType==2){ + this.projectForm.outId = response.data.id + this.$set(this.projectForm, "ynType", '2'); + addProjectto(this.projectForm).then(res => { + cashSubmit(response.data.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + history.go(-1) + },2000) + }) + }) + }else{ + cashSubmit(response.data.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + history.go(-1) + },2000) + }) + } + }) + }) + }); + }) + + }else{ + addCash(this.form).then((response) => { + console.log(this.uploadFiles) + this.uploadFiles.map(rr => { + const params = new FormData(); + params.append("tableId", response.data.id); + params.append("tableName", "t_yinnong_cash"); + params.append("bizPath", "upload"); + params.append("fileType", "0"); + params.append("file", rr); + commonAttach(params).then((r) => { + }) + }) + this.chargeItme.map(res => { + res.cashId = response.data.id + addCashdetail(res).then(r => { + if(this.form.capitalExpenditureType==2){ + this.projectForm.outId = response.data.id + this.$set(this.projectForm, "ynType", '2'); + addProjectto(this.projectForm).then(res => { + cashSubmit(response.data.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + history.go(-1) + },2000) + }) + }) + }else{ + cashSubmit(response.data.id).then(res => { this.$toast.success('提交成功'); setTimeout(function(){ history.go(-1) },2000) }) - }) - }else{ - customSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - } + } + }) }) - }) - }); + }); + } }, goUpdate(){ if(this.chargeItme.length<1){ @@ -630,28 +675,64 @@ return; } } - addCash(this.form).then((response) => { - this.chargeItme.map(res => { - res.cashId = response.data.id - addCashdetail(res).then(r => { - if(this.form.capitalExpenditureType==2){ - this.projectForm.outId = response.data.id - this.$set(this.projectForm, "ynType", '3'); - addProjectto(this.projectForm).then(res => { + if(this.uploadFiles==null||this.uploadFiles.length==0){ + addCash(this.form).then((response) => { + this.chargeItme.map(res => { + res.cashId = response.data.id + addCashdetail(res).then(r => { + if(this.form.capitalExpenditureType==2){ + this.projectForm.outId = response.data.id + this.$set(this.projectForm, "ynType", '2'); + addProjectto(this.projectForm).then(res => { + this.$toast.success('保存成功'); + setTimeout(function(){ + history.go(-1) + },2000) + }) + }else{ this.$toast.success('保存成功'); setTimeout(function(){ history.go(-1) },2000) - }) - }else{ - this.$toast.success('保存成功'); - setTimeout(function(){ - history.go(-1) - },2000) - } + } + }) }) - }) - }); + }); + }else{ + addCash(this.form).then((response) => { + console.log(this.uploadFiles) + this.uploadFiles.map(rr => { + const params = new FormData(); + params.append("tableId", response.data.id); + params.append("tableName", "t_yinnong_cash"); + params.append("bizPath", "upload"); + params.append("fileType", "0"); + params.append("file", rr); + commonAttach(params).then((r) => { + }) + }) + this.chargeItme.map(res => { + res.cashId = response.data.id + addCashdetail(res).then(r => { + if(this.form.capitalExpenditureType==2){ + this.projectForm.outId = response.data.id + this.$set(this.projectForm, "ynType", '2'); + addProjectto(this.projectForm).then(res => { + this.$toast.success('保存成功'); + setTimeout(function(){ + history.go(-1) + },2000) + }) + }else{ + this.$toast.success('保存成功'); + setTimeout(function(){ + history.go(-1) + },2000) + } + }) + }) + }); + } }, payeeSelectChange(select, i) { let obj = {}; @@ -752,16 +833,13 @@ } }, beforeRead(file) { - console.log(file) - console.log(this.fileList) - const params = new FormData(); - params.append("tableId", this.$route.query.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "upload"); - params.append("fileType", "0"); - params.append("file", file.file); - commonAttach(params).then((response) => { - console.log(response) + this.uploadFiles.push(file.file); + }, + deleteFile(file){ + this.uploadFiles.map((response,index) => { + if(file.file == response){ + this.uploadFiles.splice(index,1) + } }) }, getFileList(){ @@ -775,7 +853,6 @@ console.log(res) console.log(location.protocol+"//"+location.host+request.defaults.baseURL) res.rows.map(r => { - let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})}) console.log(r) diff --git a/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd2.vue b/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd2.vue index 461ade08..90a2552a 100644 --- a/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd2.vue +++ b/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd2.vue @@ -33,6 +33,7 @@ :min-date="minDate" :max-date="maxDate" @confirm="onConfirmLasj" + @cancel="showlasj = false" /> { console.log(response) @@ -568,7 +571,7 @@ return; } } - if(this.uploadFiles==null||this.uploadFiles.length==0){ + if((this.uploadFiles==null||this.uploadFiles.length==0)&&(this.fileList==null||this.fileList.length==0)){ Dialog.confirm({ title: '提示', message: '此申请单中未上传任何附件,是否确认提交?', diff --git a/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd4.vue b/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd4.vue index dd8625a0..e33885de 100644 --- a/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd4.vue +++ b/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd4.vue @@ -33,6 +33,7 @@ :min-date="minDate" :max-date="maxDate" @confirm="onConfirmLasj" + @cancel="showlasj = false" />

上传附件

- +
@@ -236,6 +237,7 @@ import { addTransfer , listPayee , updateTransfer , getProjectto , listProject , addProjectto , customSubmit , getAccount ,getQmyeFlow} from "@/api/onlineHome/bankAgriculture/paymentApproval"; import {attachmentList, commonAttach, listVaccount} from "../../../../api/onlineHome/bankAgriculture/paymentApproval"; import request from '@/utils/request' + import Dialog from "vant/lib/dialog"; export default { name: "approvalAdd4", data() { @@ -250,8 +252,8 @@ buttonType:'a', - minDate: new Date(), - maxDate: new Date(2050, 10, 1), + minDate: new Date(2000, 1, 1), + maxDate: new Date(2050, 12, 31), currentDate: new Date(), form:{}, fileList:[], @@ -291,7 +293,8 @@ outId:null, ynType:'1' }, - projectFundType:'' + projectFundType:'', + uploadFiles:[], }; }, created() { @@ -503,6 +506,7 @@ }, accountTypeChange(e){ this.payeeList = []; + this.chargeItme = []; this.queryParams.accountType = this.form.accountType this.queryParams.status = "0" listPayee(this.queryParams).then((response) => { @@ -546,31 +550,130 @@ 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); - addTransfer(this.form).then(response => { - this.projectForm.outId = response.data.id - this.$set(this.projectForm, "ynType", '1'); - if(this.form.capitalExpenditureType==2){ - addProjectto(this.projectForm).then(res => { - customSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) - }) - }) - }else{ - customSubmit(response.data.id).then(res => { - this.$toast.success('提交成功'); - setTimeout(function(){ - history.go(-1) - },2000) + if((this.uploadFiles==null||this.uploadFiles.length==0)&&(this.fileList==null||this.fileList.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.$set(this.projectForm, "ynType", '1'); + if(this.uploadFiles!=null&&this.uploadFiles.length>0){ + this.uploadFiles.map(rr => { + const params = new FormData(); + params.append("tableId", response.data.id); + params.append("tableName", "t_yinnong_transfer"); + params.append("bizPath", "upload"); + params.append("fileType", "0"); + params.append("file", rr); + commonAttach(params).then((r) => { + }) + }) + if(this.form.capitalExpenditureType==2){ + addProjectto(this.projectForm).then(res => { + customSubmit(response.data.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + history.go(-1) + },2000) + }) + }) + }else{ + customSubmit(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 => { + customSubmit(response.data.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + history.go(-1) + },2000) + }) + }) + }else{ + customSubmit(response.data.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + history.go(-1) + },2000) + }) + } + } + }); }) - } - }); + .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.$set(this.projectForm, "ynType", '1'); + if(this.uploadFiles!=null&&this.uploadFiles.length>0){ + this.uploadFiles.map(rr => { + const params = new FormData(); + params.append("tableId", response.data.id); + params.append("tableName", "t_yinnong_transfer"); + params.append("bizPath", "upload"); + params.append("fileType", "0"); + params.append("file", rr); + commonAttach(params).then((r) => { + }) + }) + if(this.form.capitalExpenditureType==2){ + addProjectto(this.projectForm).then(res => { + customSubmit(response.data.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + history.go(-1) + },2000) + }) + }) + }else{ + customSubmit(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 => { + customSubmit(response.data.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + history.go(-1) + },2000) + }) + }) + }else{ + customSubmit(response.data.id).then(res => { + this.$toast.success('提交成功'); + setTimeout(function(){ + history.go(-1) + },2000) + }) + } + } + }); + } + + }, goUpdate(){ if(this.chargeItme.length<1){ @@ -595,23 +698,51 @@ this.$set(this.form, "bankTypeList", this.chargeItme); this.$set(this.form, "accountTypeList", this.chargeItme); this.$set(this.form, "transferStatusList", this.chargeItme); - this.projectForm.outId = this.form.id + console.log(this.form) addTransfer(this.form).then((response) => { this.projectForm.outId = response.data.id this.$set(this.projectForm, "ynType", '1'); - if(this.form.capitalExpenditureType==2){ - addProjectto(this.projectForm).then(res => { + if(this.uploadFiles!=null&&this.uploadFiles.length>0){ + console.log(this.uploadFiles) + this.uploadFiles.map(rr => { + const params = new FormData(); + params.append("tableId", response.data.id); + params.append("tableName", "t_yinnong_transfer"); + params.append("bizPath", "upload"); + params.append("fileType", "0"); + params.append("file", rr); + commonAttach(params).then((r) => { + }) + }) + if(this.form.capitalExpenditureType==2){ + addProjectto(this.projectForm).then(res => { + this.$toast.success('保存成功'); + setTimeout(function(){ + history.go(-1) + },2000) + }) + }else{ 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(){ + history.go(-1) + },2000) + }) + }else{ + this.$toast.success('保存成功'); + setTimeout(function(){ + history.go(-1) + },2000) + } } + }); }, payeeSelectChange(select, i) { @@ -675,16 +806,13 @@ this.$set(this.form, "payerFrom", '1'); }, beforeRead(file) { - console.log(file) - console.log(this.fileList) - const params = new FormData(); - params.append("tableId", this.$route.query.id); - params.append("tableName", "t_yinnong_transfer"); - params.append("bizPath", "upload"); - params.append("fileType", "0"); - params.append("file", file.file); - commonAttach(params).then((response) => { - console.log(response) + this.uploadFiles.push(file.file); + }, + deleteFile(file){ + this.uploadFiles.map((response,index) => { + if(file.file == response){ + this.uploadFiles.splice(index,1) + } }) }, getFileList(){ @@ -698,7 +826,6 @@ console.log(res) console.log(location.protocol+"//"+location.host+request.defaults.baseURL) res.rows.map(r => { - let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})}) console.log(r) diff --git a/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd5.vue b/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd5.vue index 3a179ae2..91efce42 100644 --- a/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd5.vue +++ b/src/views/onlineHome/bankAgriculture/paymentApproval/approvalAdd5.vue @@ -33,6 +33,7 @@ :min-date="minDate" :max-date="maxDate" @confirm="onConfirmLasj" + @cancel="showlasj = false" />