@@ -1080,16 +1080,40 @@ | |||||
}) | }) | ||||
}, | }, | ||||
getFileList(){ | getFileList(){ | ||||
let oData= { | |||||
let oData1= { | |||||
tableId: this.$route.query.id, | tableId: this.$route.query.id, | ||||
tableName: "t_yinnong_transfer", | tableName: "t_yinnong_transfer", | ||||
bizPath: "upload", | bizPath: "upload", | ||||
fileType: "0", | |||||
fileType: "1", | |||||
} | } | ||||
attachmentList(oData).then(res => { | |||||
attachmentList(oData1).then(res => { | |||||
res.rows.map(r => { | res.rows.map(r => { | ||||
let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL | let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL | ||||
this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})}) | |||||
this.fileList1.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})}) | |||||
}) | |||||
}) | |||||
let oData2= { | |||||
tableId: this.$route.query.id, | |||||
tableName: "t_yinnong_transfer", | |||||
bizPath: "upload", | |||||
fileType: "2", | |||||
} | |||||
attachmentList(oData2).then(res => { | |||||
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,{})}) | |||||
}) | |||||
}) | |||||
let oData3= { | |||||
tableId: this.$route.query.id, | |||||
tableName: "t_yinnong_transfer", | |||||
bizPath: "upload", | |||||
fileType: "3", | |||||
} | |||||
attachmentList(oData3).then(res => { | |||||
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,{})}) | |||||
}) | }) | ||||
}) | }) | ||||
}, | }, | ||||
@@ -616,7 +616,7 @@ | |||||
return; | return; | ||||
} | } | ||||
} | } | ||||
if(this.uploadFiles==null||this.uploadFiles.length==0){ | |||||
if((this.uploadFiles1==null||this.uploadFiles1.length==0)&&(this.uploadFiles2==null||this.uploadFiles2.length==0)&&(this.uploadFiles3==null||this.uploadFiles3.length==0)){ | |||||
Dialog.confirm({ | Dialog.confirm({ | ||||
title: '提示', | title: '提示', | ||||
message: '此申请单中未上传任何附件,是否确认提交?', | message: '此申请单中未上传任何附件,是否确认提交?', | ||||
@@ -662,7 +662,6 @@ | |||||
}) | }) | ||||
}else{ | }else{ | ||||
addCash(this.form).then((response) => { | addCash(this.form).then((response) => { | ||||
console.log(this.uploadFiles) | |||||
this.uploadFiles1.map(rr => { | this.uploadFiles1.map(rr => { | ||||
const params = new FormData(); | const params = new FormData(); | ||||
params.append("tableId", response.data.id); | params.append("tableId", response.data.id); | ||||
@@ -762,39 +761,7 @@ | |||||
return; | return; | ||||
} | } | ||||
} | } | ||||
if(this.uploadFiles==null||this.uploadFiles.length==0){ | |||||
addCash(this.form).then((response) => { | 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 if(this.form.capitalExpenditureType==4){ | |||||
this.infoForm.transferId = response.data.id | |||||
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{ | |||||
addCash(this.form).then((response) => { | |||||
console.log(this.uploadFiles) | |||||
this.uploadFiles1.map(rr => { | this.uploadFiles1.map(rr => { | ||||
const params = new FormData(); | const params = new FormData(); | ||||
params.append("tableId", response.data.id); | params.append("tableId", response.data.id); | ||||
@@ -853,7 +820,6 @@ | |||||
},2000) | },2000) | ||||
} | } | ||||
}); | }); | ||||
} | |||||
}, | }, | ||||
payeeSelectChange(select, i) { | payeeSelectChange(select, i) { | ||||
let obj = {}; | let obj = {}; | ||||
@@ -406,7 +406,6 @@ | |||||
} | } | ||||
listProject(queryParams).then(response => { | listProject(queryParams).then(response => { | ||||
_this.projectList = response.rows; | _this.projectList = response.rows; | ||||
console.log(response) | |||||
for (let i = 0; i < response.rows.length; i++) { | for (let i = 0; i < response.rows.length; i++) { | ||||
//_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id}); | //_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id}); | ||||
_this.$set(_this.projectList[i],"text",response.rows[i].projectName) | _this.$set(_this.projectList[i],"text",response.rows[i].projectName) | ||||
@@ -414,7 +413,6 @@ | |||||
} | } | ||||
}); | }); | ||||
listInfo(this.queryContractionParams).then(response => { | listInfo(this.queryContractionParams).then(response => { | ||||
console.log(response) | |||||
_this.infoList = response.rows; | _this.infoList = response.rows; | ||||
for (let i = 0; i < response.rows.length; i++) { | for (let i = 0; i < response.rows.length; i++) { | ||||
//_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code}); | //_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code}); | ||||
@@ -547,7 +545,6 @@ | |||||
this.showcapital = false; | this.showcapital = false; | ||||
}, | }, | ||||
onConfirmFundType(data){ | onConfirmFundType(data){ | ||||
console.log(data) | |||||
this.projectForm.projectFundType = data.value; | this.projectForm.projectFundType = data.value; | ||||
this.projectFundType = data.text; | this.projectFundType = data.text; | ||||
this.showFundType = false; | this.showFundType = false; | ||||
@@ -781,7 +778,6 @@ | |||||
total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2) | total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2) | ||||
}); | }); | ||||
this.$set(this.form, "expenditureAmount", total); | this.$set(this.form, "expenditureAmount", total); | ||||
console.log(this.form.expenditureAmount,this.form.payerAccount) | |||||
if(parseFloat(this.form.payerAccount)<parseFloat(this.form.expenditureAmount)){ | if(parseFloat(this.form.payerAccount)<parseFloat(this.form.expenditureAmount)){ | ||||
this.$notify({ type: 'danger', message: '申请使用金额不能大于可用余额!' }); | this.$notify({ type: 'danger', message: '申请使用金额不能大于可用余额!' }); | ||||
return false; | return false; | ||||
@@ -819,7 +815,6 @@ | |||||
} | } | ||||
} | } | ||||
addCash(this.form).then((response) => { | addCash(this.form).then((response) => { | ||||
console.log(this.uploadFiles) | |||||
this.uploadFiles1.map(rr => { | this.uploadFiles1.map(rr => { | ||||
const params = new FormData(); | const params = new FormData(); | ||||
params.append("tableId", response.data.id); | params.append("tableId", response.data.id); | ||||
@@ -740,7 +740,7 @@ | |||||
this.$set(this.form, "bankTypeList", this.chargeItme); | this.$set(this.form, "bankTypeList", this.chargeItme); | ||||
this.$set(this.form, "accountTypeList", this.chargeItme); | this.$set(this.form, "accountTypeList", this.chargeItme); | ||||
this.$set(this.form, "transferStatusList", this.chargeItme); | this.$set(this.form, "transferStatusList", this.chargeItme); | ||||
if((this.uploadFiles==null||this.uploadFiles.length==0)&&(this.fileList==null||this.fileList.length==0)){ | |||||
if((this.uploadFiles1==null||this.uploadFiles1.length==0)&&(this.uploadFiles2==null||this.uploadFiles2.length==0)&&(this.uploadFiles3==null||this.uploadFiles3.length==0)){ | |||||
Dialog.confirm({ | Dialog.confirm({ | ||||
title: '提示', | title: '提示', | ||||
message: '此申请单中未上传任何附件,是否确认提交?', | message: '此申请单中未上传任何附件,是否确认提交?', | ||||
@@ -785,17 +785,39 @@ | |||||
}) | }) | ||||
}else { | }else { | ||||
updateCash(this.form).then((response) => { | updateCash(this.form).then((response) => { | ||||
console.log(this.uploadFiles) | |||||
this.uploadFiles.map(rr => { | |||||
const params = new FormData(); | |||||
params.append("tableId", this.form.id); | |||||
params.append("tableName", "t_yinnong_cash"); | |||||
params.append("bizPath", "yinnong"); | |||||
params.append("fileType", "1"); | |||||
params.append("file", rr); | |||||
commonAttach(params).then((r) => { | |||||
}) | |||||
}) | |||||
if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){ | |||||
this.uploadFiles1.map(rr => { | |||||
const params = new FormData(); | |||||
params.append("tableId", this.form.id); | |||||
params.append("tableName", "t_yinnong_cash"); | |||||
params.append("bizPath", "yinnong"); | |||||
params.append("fileType", "1"); | |||||
params.append("file", rr); | |||||
commonAttach(params).then((r) => { | |||||
}) | |||||
})} | |||||
if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){ | |||||
this.uploadFiles2.map(rr => { | |||||
const params = new FormData(); | |||||
params.append("tableId", this.form.id); | |||||
params.append("tableName", "t_yinnong_cash"); | |||||
params.append("bizPath", "yinnong"); | |||||
params.append("fileType", "2"); | |||||
params.append("file", rr); | |||||
commonAttach(params).then((r) => { | |||||
}) | |||||
})} | |||||
if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){ | |||||
this.uploadFiles3.map(rr => { | |||||
const params = new FormData(); | |||||
params.append("tableId", this.form.id); | |||||
params.append("tableName", "t_yinnong_cash"); | |||||
params.append("bizPath", "yinnong"); | |||||
params.append("fileType", "3"); | |||||
params.append("file", rr); | |||||
commonAttach(params).then((r) => { | |||||
}) | |||||
})} | |||||
this.chargeItme.map(res => { | this.chargeItme.map(res => { | ||||
res.cashId = this.form.id | res.cashId = this.form.id | ||||
addCashdetail(res).then(r => { | addCashdetail(res).then(r => { | ||||
@@ -867,84 +889,72 @@ | |||||
} | } | ||||
} | } | ||||
this.projectForm.outId = this.form.id | this.projectForm.outId = this.form.id | ||||
if(this.uploadFiles==null||this.uploadFiles.length==0){ | |||||
updateCash(this.form).then((response) => { | |||||
this.chargeItme.map(res => { | |||||
res.cashId = this.form.id | |||||
addCashdetail(res).then(r => { | |||||
}) | |||||
}) | |||||
if(this.form.capitalExpenditureType==2){ | |||||
this.projectForm.outId = this.form.id | |||||
this.$set(this.projectForm, "ynType", '2'); | |||||
addProjectto(this.projectForm).then(res => { | |||||
this.$toast.success('保存成功'); | |||||
setTimeout(function(){ | |||||
history.go(-1) | |||||
},2000) | |||||
updateCash(this.form).then((response) => { | |||||
if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){ | |||||
this.uploadFiles1.map(rr => { | |||||
const params = new FormData(); | |||||
params.append("tableId", this.form.id); | |||||
params.append("tableName", "t_yinnong_cash"); | |||||
params.append("bizPath", "yinnong"); | |||||
params.append("fileType", "1"); | |||||
params.append("file", rr); | |||||
commonAttach(params).then((r) => { | |||||
}) | }) | ||||
}else if(this.form.capitalExpenditureType==4){ | |||||
this.infoForm.transferId = this.form.id | |||||
addInfoto(this.infoForm).then(res => { | |||||
customSubmit(response.data.id).then(res => { | |||||
this.$toast.success('提交成功'); | |||||
setTimeout(function(){ | |||||
history.go(-1) | |||||
},2000) | |||||
}) | |||||
})} | |||||
if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){ | |||||
this.uploadFiles2.map(rr => { | |||||
const params = new FormData(); | |||||
params.append("tableId", this.form.id); | |||||
params.append("tableName", "t_yinnong_cash"); | |||||
params.append("bizPath", "yinnong"); | |||||
params.append("fileType", "2"); | |||||
params.append("file", rr); | |||||
commonAttach(params).then((r) => { | |||||
}) | }) | ||||
}else{ | |||||
this.$toast.success('保存成功'); | |||||
setTimeout(function(){ | |||||
history.go(-1) | |||||
},2000) | |||||
} | |||||
}); | |||||
}else { | |||||
updateCash(this.form).then((response) => { | |||||
console.log(this.uploadFiles) | |||||
this.uploadFiles.map(rr => { | |||||
})} | |||||
if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){ | |||||
this.uploadFiles3.map(rr => { | |||||
const params = new FormData(); | const params = new FormData(); | ||||
params.append("tableId", this.form.id); | params.append("tableId", this.form.id); | ||||
params.append("tableName", "t_yinnong_cash"); | params.append("tableName", "t_yinnong_cash"); | ||||
params.append("bizPath", "yinnong"); | params.append("bizPath", "yinnong"); | ||||
params.append("fileType", "1"); | |||||
params.append("fileType", "3"); | |||||
params.append("file", rr); | params.append("file", rr); | ||||
commonAttach(params).then((r) => { | commonAttach(params).then((r) => { | ||||
}) | }) | ||||
})} | |||||
this.chargeItme.map(res => { | |||||
res.cashId = this.form.id | |||||
addCashdetail(res).then(r => { | |||||
}) | }) | ||||
this.chargeItme.map(res => { | |||||
res.cashId = this.form.id | |||||
addCashdetail(res).then(r => { | |||||
}) | |||||
}) | |||||
if(this.form.capitalExpenditureType==2){ | |||||
this.projectForm.outId = this.form.id | |||||
this.$set(this.projectForm, "ynType", '2'); | |||||
addProjectto(this.projectForm).then(res => { | |||||
this.$toast.success('保存成功'); | |||||
setTimeout(function(){ | |||||
history.go(-1) | |||||
},2000) | |||||
}) | }) | ||||
if(this.form.capitalExpenditureType==2){ | |||||
this.projectForm.outId = this.form.id | |||||
this.$set(this.projectForm, "ynType", '2'); | |||||
addProjectto(this.projectForm).then(res => { | |||||
this.$toast.success('保存成功'); | |||||
}else if(this.form.capitalExpenditureType==4){ | |||||
this.infoForm.transferId = this.form.id | |||||
addInfoto(this.infoForm).then(res => { | |||||
customSubmit(response.data.id).then(res => { | |||||
this.$toast.success('提交成功'); | |||||
setTimeout(function(){ | setTimeout(function(){ | ||||
history.go(-1) | history.go(-1) | ||||
},2000) | },2000) | ||||
}) | }) | ||||
}else if(this.form.capitalExpenditureType==4){ | |||||
this.infoForm.transferId = this.form.id | |||||
addInfoto(this.infoForm).then(res => { | |||||
customSubmit(response.data.id).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) | |||||
} | |||||
}); | |||||
}, | }, | ||||
payeeSelectChange(select, i) { | payeeSelectChange(select, i) { | ||||