|
@@ -714,7 +714,7 @@
|
|
|
form.value.verifyStatus === 2 &&
|
|
|
(form.value.verifyComment == null || form.value.verifyComment === "")
|
|
|
) {
|
|
|
- proxy.$modal.msgError("请输入审核意见");
|
|
|
+ proxy.$modal.msgError("请输入驳回原因");
|
|
|
return;
|
|
|
}
|
|
|
// if (
|
|
@@ -725,45 +725,47 @@
|
|
|
// return;
|
|
|
// }
|
|
|
// 应收款金额 和明细比较 如果大于应收内容 提示 当前的合同提过的收款申请总金额超过当前合同金额,不可提交,如有需要请跟财务人员联系
|
|
|
- const res = await getCollectionDetail(form.value.contractId);
|
|
|
- if (res.data == null || res.data.length == 0) {
|
|
|
- const amount = form.value.arriveAmount;
|
|
|
- if (amount > form.value.contractAmount) {
|
|
|
- proxy.$modal.msgError("当前的合同提过的收款申请总金额超过当前合同金额,不可提交,请联系财务人员。");
|
|
|
- return false;
|
|
|
- }
|
|
|
- for (let i = 0; i < form.value.details.length; i++) {
|
|
|
- let item = form.value.details[i];
|
|
|
- if (item.arriveAmount != null && item.amount < item.arriveAmount) {
|
|
|
- proxy.$modal.msgError("当前的" + item.taskTypeName + "收款申请总金额超过当前服务金额,不可提交,请联系财务人员。");
|
|
|
+ if(form.value.verifyStatus === 1){
|
|
|
+ const res = await getCollectionDetail(form.value.contractId);
|
|
|
+ if (res.data == null || res.data.length == 0) {
|
|
|
+ const amount = form.value.arriveAmount;
|
|
|
+ if (amount > form.value.contractAmount) {
|
|
|
+ proxy.$modal.msgError("当前的合同提过的收款申请总金额超过当前合同金额,不可提交,请联系财务人员。");
|
|
|
return false;
|
|
|
}
|
|
|
- }
|
|
|
- } else {
|
|
|
- const countAmount = res.data.map((item) => item.status === 1&&item.arriveAmount).reduce((total, number) => {
|
|
|
- return total + number;
|
|
|
- });
|
|
|
- const amount = countAmount + form.value.arriveAmount;
|
|
|
- if (amount > form.value.contractAmount) {
|
|
|
- proxy.$modal.msgError("当前的合同提过的收款申请总金额超过当前合同金额,不可提交,请联系财务人员。");
|
|
|
- return false;
|
|
|
- }
|
|
|
- for (let i = 0; i < form.value.details.length; i++) {
|
|
|
- let item = form.value.details[i];
|
|
|
- let countAmount = 0;
|
|
|
- for (let j = 0; j < res.data.length; j++) {
|
|
|
- let match = res.data[j];
|
|
|
- if (item.taskTypeId == match.taskTypeId) {
|
|
|
- countAmount += match.arriveAmount;
|
|
|
+ for (let i = 0; i < form.value.details.length; i++) {
|
|
|
+ let item = form.value.details[i];
|
|
|
+ if (item.arriveAmount != null && item.amount < item.arriveAmount) {
|
|
|
+ proxy.$modal.msgError("当前的" + item.taskTypeName + "收款申请总金额超过当前服务金额,不可提交,请联系财务人员。");
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
- if (item.amount < match.add(item.arriveAmount)) {
|
|
|
- proxy.$modal.msgError("当前的" + item.taskTypeName + "收款申请总金额超过当前服务金额,不可提交,请联系财务人员。");
|
|
|
+ } else {
|
|
|
+ const countAmount = res.data.map((item) => item.status === 1&&item.arriveAmount).reduce((total, number) => {
|
|
|
+ return total + number;
|
|
|
+ });
|
|
|
+ const amount = countAmount + form.value.arriveAmount;
|
|
|
+ if (amount > form.value.contractAmount) {
|
|
|
+ proxy.$modal.msgError("当前的合同提过的收款申请总金额超过当前合同金额,不可提交,请联系财务人员。");
|
|
|
return false;
|
|
|
}
|
|
|
- if ((rowNum((Number(item.amount) || 0) - (Number(item.arrived) || 0))) < item.arriveAmount) {
|
|
|
- proxy.$modal.msgError("当前的" + item.taskTypeName + "本次收款金额超过待收款金额,不可提交,请联系财务人员。");
|
|
|
- return false;
|
|
|
+ for (let i = 0; i < form.value.details.length; i++) {
|
|
|
+ let item = form.value.details[i];
|
|
|
+ let countAmount = 0;
|
|
|
+ for (let j = 0; j < res.data.length; j++) {
|
|
|
+ let match = res.data[j];
|
|
|
+ if (item.taskTypeId == match.taskTypeId) {
|
|
|
+ countAmount += match.arriveAmount;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (item.amount < match.add(item.arriveAmount)) {
|
|
|
+ proxy.$modal.msgError("当前的" + item.taskTypeName + "收款申请总金额超过当前服务金额,不可提交,请联系财务人员。");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ((rowNum((Number(item.amount) || 0) - (Number(item.arrived) || 0))) < item.arriveAmount) {
|
|
|
+ proxy.$modal.msgError("当前的" + item.taskTypeName + "本次收款金额超过待收款金额,不可提交,请联系财务人员。");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|