|
@@ -233,10 +233,10 @@ $(document).ready(() => {
|
|
return ZhCalc.round(data.unit_price, unitPriceUnit);
|
|
return ZhCalc.round(data.unit_price, unitPriceUnit);
|
|
},
|
|
},
|
|
oa_tp: function (data) {
|
|
oa_tp: function (data) {
|
|
- return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), data.oamount), totalPriceUnit);
|
|
|
|
|
|
+ return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount, findDecimal(data.unit))), totalPriceUnit);
|
|
},
|
|
},
|
|
ca_tp: function (data) {
|
|
ca_tp: function (data) {
|
|
- return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), data.camount), totalPriceUnit);
|
|
|
|
|
|
+ return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.camount, findDecimal(data.unit))), totalPriceUnit);
|
|
},
|
|
},
|
|
oamount: function (data) {
|
|
oamount: function (data) {
|
|
return ZhCalc.round(data.oamount, findDecimal(data.unit));
|
|
return ZhCalc.round(data.oamount, findDecimal(data.unit));
|
|
@@ -248,7 +248,7 @@ $(document).ready(() => {
|
|
return ZhCalc.round(data.samount, findDecimal(data.unit));
|
|
return ZhCalc.round(data.samount, findDecimal(data.unit));
|
|
},
|
|
},
|
|
sa_tp: function (data) {
|
|
sa_tp: function (data) {
|
|
- return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), data.samount), totalPriceUnit);
|
|
|
|
|
|
+ return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.samount, findDecimal(data.unit))), totalPriceUnit);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
readOnly: {
|
|
readOnly: {
|
|
@@ -268,7 +268,7 @@ $(document).ready(() => {
|
|
setAuditValue: function () {
|
|
setAuditValue: function () {
|
|
for (const c of changeList) {
|
|
for (const c of changeList) {
|
|
for (const audit of change.listAudits) {
|
|
for (const audit of change.listAudits) {
|
|
- c['sa_tp_' + audit.aid] = ZhCalc.round(ZhCalc.mul(c['audit_amount_' + audit.aid], ZhCalc.round(c.unit_price, unitPriceUnit)), totalPriceUnit);
|
|
|
|
|
|
+ c['sa_tp_' + audit.aid] = ZhCalc.round(ZhCalc.mul(ZhCalc.round(c['audit_amount_' + audit.aid], findDecimal(c.unit)), ZhCalc.round(c.unit_price, unitPriceUnit)), totalPriceUnit);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -840,12 +840,15 @@ $(document).ready(() => {
|
|
}
|
|
}
|
|
|
|
|
|
// 计算最新的变更总额和change的total_price是否一致,不一致则更新
|
|
// 计算最新的变更总额和change的total_price是否一致,不一致则更新
|
|
- let new_tp = 0;
|
|
|
|
- for (const c of changeList) {
|
|
|
|
- new_tp = ZhCalc.add(new_tp, ZhCalc.round(ZhCalc.mul(c.spamount, ZhCalc.round(c.unit_price, unitPriceUnit)), totalPriceUnit));
|
|
|
|
- }
|
|
|
|
- if (change.total_price && change.total_price !== new_tp) {
|
|
|
|
- postData(preUrl + '/list/save', { type:'update_tp', updateData: new_tp }, function (result) {});
|
|
|
|
|
|
+ if (change.status !== auditConst.status.checked) {
|
|
|
|
+ let new_tp = 0;
|
|
|
|
+ for (const c of changeList) {
|
|
|
|
+ new_tp = ZhCalc.add(new_tp, ZhCalc.round(ZhCalc.mul(ZhCalc.round(c.spamount, findDecimal(c.unit)), ZhCalc.round(c.unit_price, unitPriceUnit)), totalPriceUnit));
|
|
|
|
+ }
|
|
|
|
+ if (change.total_price && change.total_price !== new_tp) {
|
|
|
|
+ postData(preUrl + '/list/save', {type: 'update_tp', updateData: new_tp}, function (result) {
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|