|
@@ -320,14 +320,12 @@ $(document).ready(() => {
|
|
|
for (const c of self.displayChanges) {
|
|
|
if (c.uamount) {
|
|
|
const vamount = (!c.vamount || checkZero(c.vamount)) ? 0 : c.vamount;
|
|
|
- if (vamount > 0 && c.uamount < 0) {
|
|
|
- toastr.error('变更令:' + c.code + ' 下,请勿进行负变更');
|
|
|
- return;
|
|
|
- } else if (vamount < 0 && c.uamount > 0) {
|
|
|
- toastr.error('变更令:' + c.code + ' 下,请勿进行正变更');
|
|
|
- return;
|
|
|
- }
|
|
|
- if ((vamount > 0 && c.uamount > vamount) || (vamount < 0 && c.uamount < vamount)) {
|
|
|
+ if (vamount === 0) {
|
|
|
+ if ((c.b_amount > 0 && c.uamount > c.b_amount) || (c.b_amount < 0 && c.uamount < b_amount)) {
|
|
|
+ toastr.error('变更令:' + c.code + ' 超计,请修改本期计量后,再提交');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else if ((vamount > 0 && c.uamount > vamount) || (vamount < 0 && c.uamount < vamount)) {
|
|
|
toastr.error('变更令:' + c.code + ' 超计,请修改本期计量后,再提交');
|
|
|
return;
|
|
|
}
|
|
@@ -3312,4 +3310,76 @@ $(document).ready(() => {
|
|
|
$('#hide-all').hide();
|
|
|
return false;
|
|
|
});
|
|
|
+
|
|
|
+ $('#exportExcel').click(function () {
|
|
|
+ const data = [];
|
|
|
+ const setting = {
|
|
|
+ cols: [
|
|
|
+ {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', cellType: 'tree'},
|
|
|
+ {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@'},
|
|
|
+ {title: '计量单元', colSpan: '1', rowSpan: '2', field: 'pos_code', hAlign: 0, width: 70, formatter: '@'},
|
|
|
+ {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@'},
|
|
|
+ {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, 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: 'quantity', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'contract_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'contract_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '本期数量变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '本期完成计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'gather_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'gather_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '截止本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_contract_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_contract_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '截止本期数量变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_qc_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_qc_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '截止本期完成计量|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|完成率(%)', colSpan: '|1', rowSpan: '|1', field: 'end_gather_percent', hAlign: 2, width: 80, type: 'Number'},
|
|
|
+ {title: '合同|项目节数量1', colSpan: '2|1', rowSpan: '1|1', field: 'deal_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|项目节数量2', colSpan: '|1', rowSpan: '|1', field: 'deal_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '变更|项目节数量1', colSpan: '2|1', rowSpan: '1|1', field: 'c_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|项目节数量2', colSpan: '|1', rowSpan: '|1', field: 'c_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '经济指标', colSpan: '1', rowSpan: '2', field: 'final_dgn_price', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '本期批注', colSpan: '1', rowSpan: '2', field: 'postil', hAlign: 0, width: 100, formatter: '@', cellType: 'autoTip'},
|
|
|
+ {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@'},
|
|
|
+ {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
|
|
|
+ ],
|
|
|
+ headRows: 2,
|
|
|
+ headRowHeight: [25, 25],
|
|
|
+ defaultRowHeight: 21,
|
|
|
+ headerFont: 'bold 10px 微软雅黑',
|
|
|
+ font: '10px 微软雅黑'
|
|
|
+ };
|
|
|
+ for (const node of stageTree.nodes) {
|
|
|
+ data.push({
|
|
|
+ code: node.code, b_code: node.b_code, name: node.name, unit: node.unit,
|
|
|
+ unit_price: node.unit_price, quantity: node.quantity, total_price: node.total_price,
|
|
|
+ contract_qty: node.contract_qty, contract_tp: node.contract_tp,
|
|
|
+ qc_qty: node.qc_qty, qc_tp: node.qc_tp,
|
|
|
+ gather_qty: node.gather_qty, gather_tp: node.gather_tp,
|
|
|
+ end_contract_qty: node.end_contract_qty, end_contract_tp: node.end_contract_tp,
|
|
|
+ end_qc_qty: node.end_qc_qty, end_qc_tp: node.end_qc_tp,
|
|
|
+ end_gather_qty: node.end_gather_qty, end_gather_tp: node.end_gather_tp, end_gather_percent: node.end_gather_percent,
|
|
|
+ deal_dgn_qty1: node.deal_dgn_qty1, deal_dgn_qty2: node.deal_dgn_qty2,
|
|
|
+ c_dgn_qty1: node.c_dgn_qty1, c_dgn_qty2: node.c_dgn_qty2,
|
|
|
+ final_dgn_price: node.final_dgn_price,
|
|
|
+ postil: node.postil, drawing_code: node.drawing_code, memo: node.memo,
|
|
|
+ });
|
|
|
+ const posRange = stagePos.getLedgerPos(node.id);
|
|
|
+ if (posRange && posRange.length > 0) {
|
|
|
+ for (const [i, p] of posRange.entries()) {
|
|
|
+ data.push({
|
|
|
+ pos_code: (i + 1) + '', name: p.name,
|
|
|
+ quantity: p.quantity,
|
|
|
+ contract_qty: p.contract_qty, qc_qty: p.qc_qty, gather_qty: p.gather_qty,
|
|
|
+ end_contract_qty: p.end_contract_qty, end_qc_qty: p.end_qc_qty, end_gather_qty: p.end_gather_qty,
|
|
|
+ drawing_code: p.drawing_code, memo: p.memo
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ SpreadExcelObj.exportSimpleXlsxSheet(setting, data, $('.sidebar-title').attr('data-original-title') + "计量台账.xlsx");
|
|
|
+ });
|
|
|
});
|