|
@@ -16,7 +16,7 @@ $(document).ready(() => {
|
|
|
{title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
|
|
|
{title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
|
|
|
{title: '本期到场|数量', colSpan: '2|1', rowSpan: '1|1', field: 'arrive_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
- {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'arrive_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'arrive_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
|
|
|
{title: '截止本期到场|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_arrive_qty', hAlign: 2, width: 60, type: 'Number', readOnly: true},
|
|
|
{title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_arrive_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
|
|
|
{title: '本期扣回|数量', colSpan: '2|1', rowSpan: '1|1', field: 'deduct_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
@@ -105,12 +105,44 @@ $(document).ready(() => {
|
|
|
this.calculateAll();
|
|
|
this.resortData();
|
|
|
}
|
|
|
+ sum () {
|
|
|
+ const result = {
|
|
|
+ arrive_tp: 0,
|
|
|
+ end_arrive_tp: 0,
|
|
|
+ deduct_tp: 0,
|
|
|
+ end_deduct_tp: 0,
|
|
|
+ };
|
|
|
+ for (const d of this.data) {
|
|
|
+ result.arrive_tp = ZhCalc.add(result.arrive_tp, d.arrive_tp);
|
|
|
+ result.end_arrive_tp = ZhCalc.add(result.end_arrive_tp, d.end_arrive_tp);
|
|
|
+ result.deduct_tp = ZhCalc.add(result.deduct_tp, d.deduct_tp);
|
|
|
+ result.end_deduct_tp = ZhCalc.add(result.end_deduct_tp, d.end_deduct_tp);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
const jgclObj = new Jgcl();
|
|
|
+ const refreshSum = function () {
|
|
|
+ const sum = jgclObj.sum();
|
|
|
+ const html = [];
|
|
|
+ const getTrHtml = function (name, value) {
|
|
|
+ return '<tr><td>' + name + '</td><td class="text-right">' + value + '</td></tr>';
|
|
|
+ };
|
|
|
+ html.push(getTrHtml('本期到场', sum.arrive_tp));
|
|
|
+ html.push(getTrHtml('截止本期到场', sum.end_arrive_tp));
|
|
|
+ html.push(getTrHtml('本期扣回', sum.deduct_tp));
|
|
|
+ html.push(getTrHtml('截止本期扣回', sum.end_deduct_tp));
|
|
|
+ /*html.push('本期到场:' + sum.arrive_tp + ';');
|
|
|
+ html.push('截止本期到场:' + sum.end_arrive_tp + ';');
|
|
|
+ html.push('本期扣回:' + sum.deduct_tp + ';');
|
|
|
+ html.push('截止本期扣回:' + sum.end_deduct_tp + ';');*/
|
|
|
+ $('#sum').html(html.join(' '));
|
|
|
+ };
|
|
|
|
|
|
postData(window.location.pathname + '/load', null, function (result) {
|
|
|
jgclObj.loadDatas(result);
|
|
|
SpreadJsObj.loadSheetData(jgclSheet, SpreadJsObj.DataType.Data, jgclObj.data);
|
|
|
+ refreshSum();
|
|
|
});
|
|
|
|
|
|
if (!readOnly) {
|
|
@@ -154,6 +186,7 @@ $(document).ready(() => {
|
|
|
postData(window.location.pathname + '/update', {updateType: 'update', updateData: datas}, function (result) {
|
|
|
jgclObj.loadUpdateData(result);
|
|
|
SpreadJsObj.reLoadSheetData(jgclSheet);
|
|
|
+ refreshSum();
|
|
|
}, function () {
|
|
|
SpreadJsObj.reLoadSheetData(jgclSheet);
|
|
|
});
|
|
@@ -188,6 +221,7 @@ $(document).ready(() => {
|
|
|
postData(window.location.pathname + '/update', {del: datas}, function (result) {
|
|
|
jgclObj.loadUpdateData(result);
|
|
|
SpreadJsObj.reLoadSheetData(jgclSheet);
|
|
|
+ refreshSum();
|
|
|
}, function () {
|
|
|
SpreadJsObj.reLoadSheetData(jgclSheet);
|
|
|
});
|
|
@@ -225,6 +259,7 @@ $(document).ready(() => {
|
|
|
postData(window.location.pathname + '/update', data, function (result) {
|
|
|
jgclObj.loadUpdateData(result);
|
|
|
SpreadJsObj.reLoadSheetData(info.sheet);
|
|
|
+ refreshSum();
|
|
|
}, function () {
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
});
|
|
@@ -308,6 +343,7 @@ $(document).ready(() => {
|
|
|
postData(window.location.pathname + '/update', updateData, function (result) {
|
|
|
jgclObj.loadUpdateData(result);
|
|
|
SpreadJsObj.reLoadSheetData(info.sheet);
|
|
|
+ refreshSum();
|
|
|
});
|
|
|
} else {
|
|
|
SpreadJsObj.reLoadSheetData(info.sheet);
|