|
@@ -637,6 +637,8 @@ $(document).ready(() => {
|
|
|
function calcChangePrice() {
|
|
|
let positive_tp = 0;
|
|
|
let negative_tp = 0;
|
|
|
+ let valuation_tp = 0;
|
|
|
+ let unvaluation_tp = 0;
|
|
|
let new_tp = 0;
|
|
|
for (const c of changeList) {
|
|
|
if (c.spamount) {
|
|
@@ -647,6 +649,11 @@ function calcChangePrice() {
|
|
|
} else {
|
|
|
negative_tp = ZhCalc.add(negative_tp, price);
|
|
|
}
|
|
|
+ if (c.is_valuation) {
|
|
|
+ valuation_tp = ZhCalc.add(valuation_tp, price);
|
|
|
+ } else {
|
|
|
+ unvaluation_tp = ZhCalc.add(unvaluation_tp, price);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
const updateTpList = {};
|
|
@@ -663,11 +670,21 @@ function calcChangePrice() {
|
|
|
updateTpList.negative_tp = negative_tp;
|
|
|
updateFlag = true;
|
|
|
}
|
|
|
+ if (valuation_tp !== changeVp) {
|
|
|
+ updateTpList.valuation_tp = valuation_tp;
|
|
|
+ updateFlag = true;
|
|
|
+ }
|
|
|
+ if (unvaluation_tp !== changeUp) {
|
|
|
+ updateTpList.unvaluation_tp = unvaluation_tp;
|
|
|
+ updateFlag = true;
|
|
|
+ }
|
|
|
if (updateFlag) {
|
|
|
console.log(updateTpList);
|
|
|
postData(window.location.pathname + '/save', { type:'update_tp', updateData: updateTpList }, function () {
|
|
|
changePp = positive_tp;
|
|
|
changeNp = negative_tp;
|
|
|
+ changeVp = valuation_tp;
|
|
|
+ changeUp = unvaluation_tp;
|
|
|
changeTp = new_tp;
|
|
|
});
|
|
|
}
|