Browse Source

变更原设计量可修改

ellisran 1 year ago
parent
commit
52ef554708

+ 62 - 46
app/public/js/change_information_approval.js

@@ -27,7 +27,7 @@ $(document).ready(() => {
             {title: '变更部位', colSpan: '1', rowSpan: '2', field: 'bwmx', hAlign: 0, width: 120, formatter: '@', readOnly: true, getValue: 'getValue.bwmx'},
             {title: '变更详情', colSpan: '1', rowSpan: '2', field: 'detail', hAlign: 0, width: 120, formatter: '@', readOnly: true},
             {title: '计量上限(%)', colSpan: '1', rowSpan: '2', field: 'delimit', hAlign: 2, width: 60, formatter: '@', readOnly: true, visible: openChangeState},
-            {title: '原设计|数量', colSpan: '2|1', rowSpan: '1|1', field: 'oamount', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.oamount', readOnly: true},
+            {title: '原设计|数量', colSpan: '2|1', rowSpan: '1|1', field: 'oamount2', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.oamount2', readOnly: 'readOnly.isSettle'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'oa_tp', hAlign: 2, width: 80, type: 'Number', getValue: 'getValue.oa_tp', readOnly: true},
             {title: '申请变更增(+)减(-)|数量', colSpan: '2|1', rowSpan: '1|1', field: 'camount', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.camount', readOnly: true},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'ca_tp', hAlign: 2, width: 80, type: 'Number', getValue: 'getValue.ca_tp', readOnly: true},
@@ -91,22 +91,22 @@ $(document).ready(() => {
                 return ZhCalc.round(data.unit_price, unitPriceUnit);
             },
             oa_tp: function (data) {
-                return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount, findDecimal(data.unit))), totalPriceUnit);
+                return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount2, findDecimal(data.unit))), totalPriceUnit);
             },
             ca_tp: function (data) {
                 return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.camount, findDecimal(data.unit))), totalPriceUnit);
             },
-            oamount: function (data) {
-                return ZhCalc.round(data.oamount, findDecimal(data.unit));
+            oamount2: function (data) {
+                return ZhCalc.round(data.oamount2, findDecimal(data.unit));
             },
             camount: function (data) {
                 return ZhCalc.round(data.camount, findDecimal(data.unit));
             },
             changed_amount: function (data) {
-                return ZhCalc.round(ZhCalc.add(data.oamount, data.spamount), findDecimal(data.unit));
+                return ZhCalc.round(ZhCalc.add(data.oamount2, data.spamount), findDecimal(data.unit));
             },
             changed_tp: function (data) {
-                return ZhCalc.add(ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount, findDecimal(data.unit))), totalPriceUnit),
+                return ZhCalc.add(ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount2, findDecimal(data.unit))), totalPriceUnit),
                     ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.spamount, findDecimal(data.unit))), totalPriceUnit));
             },
             bwmx: function (data) {
@@ -130,6 +130,7 @@ $(document).ready(() => {
             changeSpreadObj.countSum();
         },
         setAuditValue: function () {
+
             for (const c  of changeList) {
                 for (const j of aidList) {
                     c['audit_amount_' + j] = ZhCalc.round(c['audit_amount_' + j], findDecimal(c.unit));
@@ -171,6 +172,8 @@ $(document).ready(() => {
             changeSpreadObj.resetXmjSpread(data);
         },
         setRowValueAndSum: function (data, row, col) {
+            const oneSum = ZhCalc.round(ZhCalc.mul(data.unit_price, parseFloat(changeSpreadSheet.getValue(row, startLimit - 1))), totalPriceUnit);
+            changeSpreadSheet.setValue(row, startLimit, oneSum !== 0 ? oneSum : null);
             for (const j in aidList) {
                 const sum = ZhCalc.round(ZhCalc.mul(data.unit_price, parseFloat(changeSpreadSheet.getValue(row, startLimit + 3 + parseInt(j)*2))), totalPriceUnit);
                 changeSpreadSheet.setValue(row, startLimit + 4 + j*2, sum !== 0 ? sum : null);
@@ -181,13 +184,16 @@ $(document).ready(() => {
             // 用户的数据合计
             // 变更后数据合计
             let audit_sum = 0;
+            let oSum = 0;
             let changed_sum = 0;
             for(let i = 0; i < rowCount - 1; i++){
                 audit_sum = ZhCalc.add(audit_sum, changeSpreadSheet.getValue(i, col+1));
+                oSum = ZhCalc.add(oSum, changeSpreadSheet.getValue(i, startLimit));
                 changed_sum = ZhCalc.add(changed_sum, changeSpreadSheet.getValue(i, (startLimit + 4 + aidList.length*2)));
             }
 
             changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, col+1, audit_sum !== 0 ? audit_sum : null);
+            changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, startLimit, oSum !== 0 ? oSum : null);
             changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, (startLimit + 4 + aidList.length*2), changed_sum !== 0 ? changed_sum : null);
         },
         countSum: function() {
@@ -236,27 +242,33 @@ $(document).ready(() => {
                         return;
                     }
                     validText = ZhCalc.round(validText, findDecimal(select.unit)) || 0;
-                    // 判断是否 正数必须大于等于限制值,负数必须小于等于限制值,否则无法更改
-                    const usedInfo = _.find(changeUsedData, { cbid: select.id });
-                    if (usedInfo && validText >= 0 && validText < usedInfo.qty) {
-                        toastr.error('清单变更数值必须大于等于已调用值 ' + usedInfo.qty);
-                        SpreadJsObj.reLoadRowData(info.sheet, info.row);
-                        changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
-                        return;
-                    } else if (usedInfo && validText < 0 && validText > usedInfo.qty) {
-                        toastr.error('清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
-                        SpreadJsObj.reLoadRowData(info.sheet, info.row);
-                        changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
-                        return;
+                    if (col.field !== 'oamount2') {
+                        // 判断是否 正数必须大于等于限制值,负数必须小于等于限制值,否则无法更改
+                        const usedInfo = _.find(changeUsedData, {cbid: select.id});
+                        if (usedInfo && validText >= 0 && validText < usedInfo.qty) {
+                            toastr.error('清单变更数值必须大于等于已调用值 ' + usedInfo.qty);
+                            SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                            changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
+                            return;
+                        } else if (usedInfo && validText < 0 && validText > usedInfo.qty) {
+                            toastr.error('清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
+                            SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                            changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
+                            return;
+                        }
                     }
                 }
                 select[col.field] = validText;
-                select.spamount = ZhCalc.round(validText, findDecimal(select.unit)) || 0;
+                if (col.field !== 'oamount2') select.spamount = ZhCalc.round(validText, findDecimal(select.unit)) || 0;
 
                 const data = {
                     id: select.id,
-                    spamount: select.spamount,
                 };
+                if (col.field === 'oamount2') {
+                    data[col.field] = select[col.field];
+                } else {
+                    data.spamount = select.spamount;
+                }
                 console.log(data, select);
 
                 // 更新至服务器
@@ -266,7 +278,7 @@ $(document).ready(() => {
                     changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
                 }, function () {
                     select[col.field] = orgValue;
-                    select.spamount = orgValue;
+                    if (col.field !== 'oamount2') select.spamount = orgValue;
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     changeSpreadObj.setRowValueAndSum(select, info.row, info.col);
                 });
@@ -329,25 +341,31 @@ $(document).ready(() => {
                             continue;
                         }
                         validText = ZhCalc.round(validText, findDecimal(sortData[curRow].unit)) || 0;
-                        // 判断是否 正数必须大于等于限制值,负数必须小于等于限制值,否则无法更改
-                        const usedInfo = _.find(changeUsedData, { id: sortData[curRow].id });
-                        if (usedInfo && usedInfo.qty >= 0 && validText < usedInfo.qty) {
-                            toastr.error(hintRow ? '清单' + (hintRow+1) + '行变更数值必须大于等于已调用值 ' + usedInfo.qty : '清单变更数值必须大于等于已调用值 ' + usedInfo.qty);
-                            SpreadJsObj.reLoadRowData(info.sheet, curRow);
-                            changeSpreadObj.setRowValueAndSum(sortData[curRow], curRow, curCol);
-                            bPaste = false;
-                            continue;
-                        } else if (usedInfo && usedInfo.qty < 0 && validText > usedInfo.qty) {
-                            toastr.error(hintRow ? '清单' + (hintRow+1) + '行变更数值必须小于等于已调用值 ' + usedInfo.qty : '清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
-                            SpreadJsObj.reLoadRowData(info.sheet, curRow);
-                            changeSpreadObj.setRowValueAndSum(sortData[curRow], curRow, curCol);
-                            bPaste = false;
-                            continue;
+                        if (colSetting.field !== 'oamount2') {
+                            // 判断是否 正数必须大于等于限制值,负数必须小于等于限制值,否则无法更改
+                            const usedInfo = _.find(changeUsedData, {id: sortData[curRow].id});
+                            if (usedInfo && usedInfo.qty >= 0 && validText < usedInfo.qty) {
+                                toastr.error(hintRow ? '清单' + (hintRow + 1) + '行变更数值必须大于等于已调用值 ' + usedInfo.qty : '清单变更数值必须大于等于已调用值 ' + usedInfo.qty);
+                                SpreadJsObj.reLoadRowData(info.sheet, curRow);
+                                changeSpreadObj.setRowValueAndSum(sortData[curRow], curRow, curCol);
+                                bPaste = false;
+                                continue;
+                            } else if (usedInfo && usedInfo.qty < 0 && validText > usedInfo.qty) {
+                                toastr.error(hintRow ? '清单' + (hintRow + 1) + '行变更数值必须小于等于已调用值 ' + usedInfo.qty : '清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
+                                SpreadJsObj.reLoadRowData(info.sheet, curRow);
+                                changeSpreadObj.setRowValueAndSum(sortData[curRow], curRow, curCol);
+                                bPaste = false;
+                                continue;
+                            }
                         }
                     }
                     // cLData[colSetting.field] = validText;
                     sortData[curRow][colSetting.field] = validText;
-                    cLData.spamount = validText;
+                    if (colSetting.field === 'oamount2') {
+                        cLData[colSetting.field] = validText;
+                    } else {
+                        cLData.spamount = validText;
+                    }
                 }
                 if (bPaste) {
                     data.push(cLData);
@@ -644,16 +662,14 @@ function makePushBwmx(clinfo, listinfo, removeList, updateList) {
                     oneUpdate[key] = listinfo[key];
                     clinfo[key] = listinfo[key];
                     if (key === 'unit') {
-                        const oamount = ZhCalc.round(clinfo.oamount, findDecimal(listinfo[key]));
-                        if (oamount !== clinfo.oamount) {
-                            oneUpdate.oamount = oamount;
-                            clinfo.oamount = oamount;
-                        }
-                        const camount = ZhCalc.round(clinfo.camount, findDecimal(listinfo[key]));
-                        if (camount !== clinfo.camount) {
-                            oneUpdate.camount = camount;
-                            clinfo.camount = camount;
-                        }
+                        const changeKey = ['oamount', 'oamount2', 'camount'];
+                        changeKey.forEach(function (key) {
+                            const value = ZhCalc.round(clinfo[key], findDecimal(listinfo[key]));
+                            if (value !== clinfo[key]) {
+                                oneUpdate[key] = value;
+                                clinfo[key] = value;
+                            }
+                        });
                     }
                     // else if (key === 'unit_price') {
                     //     // 可能要更新总金额了

+ 19 - 19
app/public/js/change_information_set.js

@@ -102,7 +102,7 @@ $(document).ready(() => {
             {title: '变更部位', colSpan: '1', rowSpan: '2', field: 'bwmx', hAlign: 0, width: 120, formatter: '@', readOnly: 'readOnly.isEdit2'},
             {title: '变更详情', colSpan: '1', rowSpan: '2', field: 'detail', hAlign: 0, width: 120, formatter: '@', readOnly: false},
             {title: '计量上限(%)', colSpan: '1', rowSpan: '2', field: 'delimit', hAlign: 2, width: 60, type: 'Number', readOnly: false, visible: openChangeState},
-            {title: '原设计|数量', colSpan: '2|1', rowSpan: '1|1', field: 'oamount', hAlign: 2, width: 60, type: 'Number', readOnly: 'readOnly.isEdit', getValue: 'getValue.oamount'},
+            {title: '原设计|数量', colSpan: '2|1', rowSpan: '1|1', field: 'oamount2', hAlign: 2, width: 60, type: 'Number', readOnly: 'readOnly.isSettle', getValue: 'getValue.oamount2'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'oa_tp', hAlign: 2, width: 80, type: 'Number', readOnly: true, getValue: 'getValue.oa_tp'},
             {title: '申请变更增(+)减(-)|数量', colSpan: '2|1', rowSpan: '1|1', field: 'camount', hAlign: 2, width: 60, type: 'Number', readOnly: 'readOnly.isSettle', getValue: 'getValue.camount'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'ca_tp', hAlign: 2, width: 80, type: 'Number', readOnly: true, getValue: 'getValue.ca_tp'},
@@ -150,22 +150,22 @@ $(document).ready(() => {
                 return ZhCalc.round(data.unit_price, unitPriceUnit);
             },
             oa_tp: function (data) {
-                return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount, findDecimal(data.unit))), totalPriceUnit);
+                return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount2, findDecimal(data.unit))), totalPriceUnit);
             },
             ca_tp: function (data) {
                 return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.camount, findDecimal(data.unit))), totalPriceUnit);
             },
-            oamount: function (data) {
-                return ZhCalc.round(data.oamount, findDecimal(data.unit));
+            oamount2: function (data) {
+                return ZhCalc.round(data.oamount2, findDecimal(data.unit));
             },
             camount: function (data) {
                 return ZhCalc.round(data.camount, findDecimal(data.unit));
             },
             changed_amount: function (data) {
-                return ZhCalc.round(ZhCalc.add(data.oamount, data.camount), findDecimal(data.unit));
+                return ZhCalc.round(ZhCalc.add(data.oamount2, data.camount), findDecimal(data.unit));
             },
             changed_tp: function (data) {
-                return ZhCalc.add(ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount, findDecimal(data.unit))), totalPriceUnit),
+                return ZhCalc.add(ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount2, findDecimal(data.unit))), totalPriceUnit),
                     ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.camount, findDecimal(data.unit))), totalPriceUnit));
             },
             del_list: function (data) {
@@ -188,7 +188,7 @@ $(document).ready(() => {
         },
     };
     // 数字只判断几个值(unit_price, oamount, camount)
-    const numField = ['unit_price', 'oamount'];
+    const numField = ['unit_price', 'oamount2'];
     const changeSpreadObj = {
         makeSjsFooter: function () {
             // 增加汇总行并设为锁定禁止编辑状态
@@ -556,7 +556,7 @@ $(document).ready(() => {
                 }
                 if (col.field === 'unit') {
                     select.camount = ZhCalc.round(select.camount, findDecimal(validText)) || 0;
-                    select.oamount = ZhCalc.round(select.oamount, findDecimal(validText)) || 0;
+                    select.oamount2 = ZhCalc.round(select.oamount2, findDecimal(validText)) || 0;
                 }
                 select[col.field] = validText;
                 // console.log(select);
@@ -705,7 +705,7 @@ $(document).ready(() => {
                             unitdecimal = '';
                         }
                         cLData.camount = ZhCalc.round(sortData[curRow].camount, findDecimal(unitdecimal)) || 0;
-                        cLData.oamount = ZhCalc.round(sortData[curRow].oamount, findDecimal(unitdecimal)) || 0;
+                        cLData.oamount2 = ZhCalc.round(sortData[curRow].oamount2, findDecimal(unitdecimal)) || 0;
                     }
                     if (colSetting.field !== 'oa_tp' && colSetting.field !== 'ca_tp') {
                         cLData[colSetting.field] = validText;
@@ -2180,16 +2180,14 @@ function makePushBwmx(clinfo, listinfo, removeList, updateList, lidIsNumber) {
                     oneUpdate[key] = listinfo[key];
                     clinfo[key] = listinfo[key];
                     if (key === 'unit') {
-                        const oamount = ZhCalc.round(clinfo.oamount, findDecimal(listinfo[key]));
-                        if (oamount !== clinfo.oamount) {
-                            oneUpdate.oamount = oamount;
-                            clinfo.oamount = oamount;
-                        }
-                        const camount = ZhCalc.round(clinfo.camount, findDecimal(listinfo[key]));
-                        if (camount !== clinfo.camount) {
-                            oneUpdate.camount = camount;
-                            clinfo.camount = camount;
-                        }
+                        const changeKey = ['oamount', 'oamount2', 'camount'];
+                        changeKey.forEach(function (key) {
+                            const value = ZhCalc.round(clinfo[key], findDecimal(listinfo[key]));
+                            if (value !== clinfo[key]) {
+                                oneUpdate[key] = value;
+                                clinfo[key] = value;
+                            }
+                        });
                     }
                     // else if (key === 'unit_price') {
                     //     // 可能要更新总金额了
@@ -2365,6 +2363,7 @@ function remakeChangeSpread(cOrder = changeOrder) {
                 unit,
                 unit_price: price,
                 oamount,
+                oamount2: oamount,
                 camount: scnum,
                 camount_expr: '',
                 detail: '',
@@ -2384,6 +2383,7 @@ function remakeChangeSpread(cOrder = changeOrder) {
                 return (info.lid == lid || parseInt(info.lid) === parseInt(lindex)) && gcl_id == info.gcl_id && (!mx_id || (mx_id && info.mx_id && info.mx_id === mx_id)) && (info.bwmx === bwmx || info.bwmx === xmj_jldy);
             });
             if (radionInfo) {
+                trlist.oamount2 = radionInfo.oamount2;
                 trlist.camount = radionInfo.camount;
                 trlist.camount_expr = radionInfo.camount_expr;
                 trlist.detail = radionInfo.detail;

+ 6 - 6
app/public/js/change_information_show.js

@@ -18,7 +18,7 @@ $(document).ready(() => {
             {title: '变更部位', colSpan: '1', rowSpan: '2', field: 'bwmx', hAlign: 0, width: 120, formatter: '@'},
             {title: '变更详情', colSpan: '1', rowSpan: '2', field: 'detail', hAlign: 0, width: 120, formatter: '@'},
             {title: '计量上限(%)', colSpan: '1', rowSpan: '2', field: 'delimit', hAlign: 2, width: 60, formatter: '@', visible: openChangeState},
-            {title: '原设计|数量', colSpan: '2|1', rowSpan: '1|1', field: 'oamount', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.oamount'},
+            {title: '原设计|数量', colSpan: '2|1', rowSpan: '1|1', field: 'oamount2', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.oamount2'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'oa_tp', hAlign: 2, width: 80, type: 'Number', getValue: 'getValue.oa_tp'},
             {title: '申请变更增(+)减(-)|数量', colSpan: '2|1', rowSpan: '1|1', field: 'camount', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.camount'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'ca_tp', hAlign: 2, width: 80, type: 'Number', getValue: 'getValue.ca_tp'},
@@ -80,13 +80,13 @@ $(document).ready(() => {
                 return ZhCalc.round(data.unit_price, unitPriceUnit);
             },
             oa_tp: function (data) {
-                return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount, findDecimal(data.unit))), totalPriceUnit);
+                return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount2, findDecimal(data.unit))), totalPriceUnit);
             },
             ca_tp: function (data) {
                 return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.camount, findDecimal(data.unit))), totalPriceUnit);
             },
-            oamount: function (data) {
-                return ZhCalc.round(data.oamount, findDecimal(data.unit));
+            oamount2: function (data) {
+                return ZhCalc.round(data.oamount2, findDecimal(data.unit));
             },
             camount: function (data) {
                 return ZhCalc.round(data.camount, findDecimal(data.unit));
@@ -99,12 +99,12 @@ $(document).ready(() => {
             },
             changed_amount: function (data) {
                 // return ZhCalc.round(ZhCalc.add(data.oamount, data.spamount), findDecimal(data.unit));
-                return ZhCalc.round(ZhCalc.add(data.oamount, data.checked_amount), findDecimal(data.unit));
+                return ZhCalc.round(ZhCalc.add(data.oamount2, data.checked_amount), findDecimal(data.unit));
             },
             changed_tp: function (data) {
                 // return ZhCalc.add(ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount, findDecimal(data.unit))), totalPriceUnit),
                 //     ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.spamount, findDecimal(data.unit))), totalPriceUnit));
-                return ZhCalc.add(ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount, findDecimal(data.unit))), totalPriceUnit),
+                return ZhCalc.add(ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount2, findDecimal(data.unit))), totalPriceUnit),
                     ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.checked_amount, findDecimal(data.unit))), totalPriceUnit));
             },
         },

+ 2 - 0
app/service/change_audit_list.js

@@ -94,6 +94,7 @@ module.exports = app => {
                     unit: '',
                     unit_price: null,
                     oamount: 0,
+                    oamount2: 0,
                     camount: 0,
                     camount_expr: '',
                     samount: '',
@@ -159,6 +160,7 @@ module.exports = app => {
                         unit: '',
                         unit_price: null,
                         oamount: 0,
+                        oamount2: 0,
                         camount: 0,
                         camount_expr: '',
                         samount: '',

+ 5 - 0
sql/update.sql

@@ -13,6 +13,11 @@ MODIFY COLUMN `negative_tp` decimal(30, 8) NOT NULL DEFAULT 0.00000000 COMMENT '
 --修复转换值问题,并且需要再运行一次db_script/check_bills更新checked_price方法
 UPDATE `zh_change_audit_list` SET `checked_amount` = CONVERT(`samount`, DECIMAL(30, 8)) WHERE `samount` != '';
 
+ALTER TABLE `zh_change_audit_list`
+ADD COLUMN `oamount2` decimal(30, 8) NULL DEFAULT NULL COMMENT '原数量(可编辑)' AFTER `oamount`;
+
+UPDATE `zh_change_audit_list` SET `oamount2` = `oamount`;
+
 ALTER TABLE `zh_ledger_attachment`
 MODIFY COLUMN `tid` int(11) UNSIGNED NOT NULL COMMENT '标段id' AFTER `id`,
 ADD COLUMN `revise_id` varchar(36) NOT NULL COMMENT '修订id' AFTER `tid`,