|
@@ -271,19 +271,22 @@ export function setTemplateDataDisable(list: Array<any>, fieldList: Array<any>)
|
|
* @param arr 相关产品
|
|
* @param arr 相关产品
|
|
* @returns Boolean
|
|
* @returns Boolean
|
|
*/
|
|
*/
|
|
-export function judgmentaAmounteEqual(mob: any, arr: any[] = []) {
|
|
|
|
- let flag = true;
|
|
|
|
|
|
+export function judgmentaAmounteEqual(mob: any, arr: any) {
|
|
|
|
+ if(!arr || arr.length <= 0) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ let flag = false;
|
|
const amounte = mob.amountOfMoney || 0;
|
|
const amounte = mob.amountOfMoney || 0;
|
|
const totalAmounte = arr.reduce((pre: number, cur: any) => pre + (cur.totalPrice || 0), 0);
|
|
const totalAmounte = arr.reduce((pre: number, cur: any) => pre + (cur.totalPrice || 0), 0);
|
|
|
|
|
|
- if (amounte !== totalAmounte) {
|
|
|
|
|
|
+ if (amounte != totalAmounte) {
|
|
ElNotification.closeAll();
|
|
ElNotification.closeAll();
|
|
ElNotification({
|
|
ElNotification({
|
|
title: '提示',
|
|
title: '提示',
|
|
message: `商机金额${amounte > totalAmounte ? '大于' : '小于'}产品总金额,请修改`,
|
|
message: `商机金额${amounte > totalAmounte ? '大于' : '小于'}产品总金额,请修改`,
|
|
type: 'warning',
|
|
type: 'warning',
|
|
});
|
|
});
|
|
- flag = false;
|
|
|
|
|
|
+ flag = true;
|
|
}
|
|
}
|
|
|
|
|
|
return flag;
|
|
return flag;
|