| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557 |
- <% if (!ctx.material.readOnly) { %>
- <!--新增分项价格指数-->
- <div class="modal fade" id="choose2" data-backdrop="static">
- <div class="modal-dialog modal-lg" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">新增分项价格指数</h5>
- </div>
- <div class="modal-body">
- <!-- <div class="custom-control custom-checkbox mb-2">-->
- <!-- <input type="checkbox" class="custom-control-input" id="im-gather-check">-->
- <!-- <label class="custom-control-label" for="im-gather-check">汇总计量节点</label>-->
- <!-- </div>-->
- <div class="d-inline-block mb-2">
- <div class="dropdown">
- <button class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- <i class="fa fa-list-ol"></i> 显示层级
- </button>
- <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
- <a class="dropdown-item" name="showLevel" tag="1" href="javascript: void(0);">第一层</a>
- <a class="dropdown-item" name="showLevel" tag="2" href="javascript: void(0);">第二层</a>
- <a class="dropdown-item" name="showLevel" tag="3" href="javascript: void(0);">第三层</a>
- <a class="dropdown-item" name="showLevel" tag="4" href="javascript: void(0);">第四层</a>
- <a class="dropdown-item" name="showLevel" tag="5" href="javascript: void(0);">第五层</a>
- <a class="dropdown-item" name="showLevel" tag="last" href="javascript: void(0);">最底层</a>
- <a class="dropdown-item" name="showLevel" tag="leafXmj" href="javascript: void(0);">只显示项目节</a>
- </div>
- </div>
- </div>
- <div class="modal-height-500" id="gather-spread">
- </div>
- <div class="popover bs-popover-right" role="tooltip" id="gather-confirm" style="display: none">
- <div class="arrow" style="top:30px"></div>
- <div class="popover-body">
- <p id="gather-confirm-hint">父项已勾选,继续将取消父项勾选。</p>
- <p class="mb-0 d-flex justify-content-end" id="gather-confirm-btn">
- <button class="btn btn-sm btn-secondary" id="gather-confirm-cancel">取消</button> <button class="btn btn-sm btn-success" id="gather-confirm-ok">继续</button>
- </p>
- </div>
- </div>
- <div class="popover bs-popover-right" role="tooltip" id="gather-tip" style="display: none">
- <style>
- #gather-tip>.arrow::after {
- border-right-color: #ffc107;
- }
- </style>
- <div class="arrow" style="top:6px"></div>
- <div class="popover-body bg-warning">
- <span id="gather-tip-hint">父项已勾选,继续将取消父项勾选。</span>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
- <% if (!ctx.material.readOnly && ctx.material.user_id === ctx.session.sessionUser.accountId) { %>
- <button type="button" class="btn btn-primary btn-sm" id="choose2-ok">确定</button>
- <% } %>
- </div>
- </div>
- </div>
- </div>
- <script>
- const pre_nodes = JSON.parse(unescape('<%- escape(JSON.stringify(ctx.material.pre_exponent_node)) %>'));
- $(function () {
- const gatherConfirmPopover = {
- reBind: function (obj, eventName, fun) {
- obj.unbind(eventName);
- obj.bind(eventName, fun);
- },
- check: function (pos, hint, okCallback) {
- const confirmObj = $('#gather-confirm'), hintObj = $('#gather-confirm-hint');
- const okObj = $('#gather-confirm-ok'), cancelObj = $('#gather-confirm-cancel');
- this.reBind(cancelObj, 'click', function () {
- confirmObj.hide();
- });
- this.reBind(okObj, 'click', function () {
- okCallback();
- confirmObj.hide();
- });
- hintObj.text(hint);
- confirmObj.css("top", pos.y).css("left", pos.x).show();
- },
- showTip: function (pos, hint) {
- const confirmObj = $('#gather-tip'), hintObj = $('#gather-tip-hint');
- hintObj.text(hint);
- confirmObj.css("top", pos.y).css("left", pos.x).show();
- setTimeout(function () {
- confirmObj.hide();
- }, 2000);
- }
- };
- let gsSpread = null;
- const gsTreeSetting = {
- id: 'ledger_id',
- pid: 'ledger_pid',
- order: 'order',
- level: 'level',
- rootId: -1,
- keys: ['id', 'tender_id', 'ledger_id'],
- stageId: 'id',
- };
- gsTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty'];
- gsTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp', 'contract_pc_tp', 'qc_pc_tp', 'pc_tp'];
- // gsTreeSetting.updateFields = [];
- // gsTreeSetting.calcFields = [];
- if (isStageSelf) {
- for (const ms of materialStageData) {
- gsTreeSetting.updateFields.push(ms.sid + '_contract_qty', ms.sid + '_contract_tp',
- ms.sid + '_qc_qty', ms.sid + '_qc_tp', ms.sid + '_qc_minus_qty');
- gsTreeSetting.calcFields.push(ms.sid + '_deal_tp', ms.sid + '_total_price', ms.sid + '_contract_tp',
- ms.sid + '_qc_tp', ms.sid + '_gather_tp',
- ms.sid + '_contract_pc_tp', ms.sid + '_qc_pc_tp', ms.sid + '_pc_tp');
- }
- }
- // else {
- // gsTreeSetting.updateFields.push(materialSids + '_contract_qty', materialSids + '_contract_tp',
- // materialSids + '_qc_qty', materialSids + '_qc_tp', materialSids + '_qc_minus_qty');
- // gsTreeSetting.calcFields.push(materialSids + '_deal_tp', materialSids + '_total_price', materialSids + '_contract_tp',
- // materialSids + '_qc_tp', materialSids + '_gather_tp',
- // materialSids + '_contract_pc_tp', materialSids + '_qc_pc_tp', materialSids + '_pc_tp');
- // }
- gsTreeSetting.calcFun = function (node) {
- if (node.children && node.children.length === 0) {
- node.gather_qty = ZhCalc.add(node.contract_qty, node.qc_qty);
- if (isStageSelf) {
- for (const ms of materialStageData) {
- node[ms.sid + '_gather_qty'] = ZhCalc.add(node[ms.sid + '_contract_qty'], node[ms.sid + '_qc_qty']);
- }
- }
- }
- node.gather_tp = ZhCalc.sum([node.contract_tp, node.qc_tp, node.pc_tp]);
- if (isStageSelf) {
- for (const ms of materialStageData) {
- node[ms.sid + '_gather_tp'] = ZhCalc.sum([node[ms.sid + '_contract_tp'], node[ms.sid + '_qc_tp'], node[ms.sid + '_pc_tp']]);
- }
- }
- };
- const gsTree = createNewPathTree('stage', gsTreeSetting);
- // 显示树结构信息
- $('#choose2').on('shown.bs.modal', function () {
- if (!gsSpread) {
- postData(window.location.pathname + '/save', {type: 'load', filter: 'ledger'}, function (result) {
- gsTree.loadDatas(result.ledgerData);
- treeCalc.calculateAll(gsTree);
- gsSpread = SpreadJsObj.createNewSpread($('#gather-spread')[0]);
- const setting = {
- cols: [
- {title: '', colSpan: '1', rowSpan: '1', field: 'check', hAlign: 1, width: 50, formatter: '@', readOnly: true, cellType: 'checkbox'},
- {title: '项目节编号', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 150, formatter: '@', readOnly: true, cellType: 'tree'},
- {title: '清单编号', colSpan: '1', rowSpan: '1', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
- {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
- {title: '单位', colSpan: '1', rowSpan: '1', field: 'unit', hAlign: 1, width: 60, formatter: '@', readOnly: true},
- ],
- headRows: 1,
- emptyRows: 0,
- headRowHeight: [32],
- defaultRowHeight: 21,
- headerFont: '12px 微软雅黑',
- font: '12px 微软雅黑',
- };
- sjsSettingObj.setFxTreeStyle(setting, sjsSettingObj.FxTreeStyle.jz);
- SpreadJsObj.initSheet(gsSpread.getActiveSheet(), setting);
- gsSpread.bind(spreadNS.Events.ButtonClicked, function (e, info) {
- function checkParent(node, field = 'check') {
- const parent = gsTree.getParent(node);
- if (parent) {
- return parent[field] ? parent[field] : checkParent(parent, field);
- } else {
- return false;
- }
- }
- function checkChildren(node, field = 'check') {
- for (const child of node.children) {
- if (child[field]) {
- return true;
- } else if (checkChildren(child, field)) {
- return true;
- }
- }
- return false;
- }
- const sheet = info.sheet, cellType = sheet.getCellType(info.row, info.col);
- if (cellType instanceof spreadNS.CellTypes.CheckBox) {
- if (sheet.isEditing()) {
- sheet.endEdit(true);
- }
- }
- if (info.sheet.zh_setting) {
- const col = info.sheet.zh_setting.cols[info.col];
- if (col.field !== 'check') {
- return;
- }
- const sortData = info.sheet.zh_dataType === 'tree' ? info.sheet.zh_tree.nodes : info.sheet.zh_data;
- const node = sortData[info.row];
- if (!node.check) {
- if (checkParent(node, 'pre_check')) {
- const rect = info.sheet.getCellRect(info.row, info.col);
- gatherConfirmPopover.showTip({
- x: rect.x + rect.width / 2 + 25,
- y: rect.y + rect.height / 2 + 27,
- }, '该项的父项上期已勾选调用,无法勾选该项。');
- SpreadJsObj.reLoadRowsData(info.sheet, [gsTree.nodes.indexOf(node)]);
- return;
- }
- if (checkChildren(node, 'pre_check')) {
- const rect = info.sheet.getCellRect(info.row, info.col);
- gatherConfirmPopover.showTip({
- x: rect.x + rect.width / 2 + 25,
- y: rect.y + rect.height / 2 + 27,
- }, '该项的子项上期已勾选调用,无法勾选该项。');
- SpreadJsObj.reLoadRowsData(info.sheet, [gsTree.nodes.indexOf(node)]);
- return;
- }
- if (checkParent(node)) {
- const rect = info.sheet.getCellRect(info.row, info.col);
- gatherConfirmPopover.check({
- x: rect.x + rect.width / 2 + 25,
- y: rect.y + rect.height / 2 + 3,
- }, '父项已勾选,继续将取消父项勾选。', function () {
- node.check = true;
- const parents = gsTree.getFullPathNodes(gsTree.getParent(node).full_path);
- const rows = [gsTree.nodes.indexOf(node)];
- for (const p of parents) {
- if (p.check) {
- p.check = false;
- rows.push(gsTree.nodes.indexOf(p));
- }
- }
- SpreadJsObj.reLoadRowsData(info.sheet, rows);
- });
- } else if (checkChildren(node)) {
- const rect = info.sheet.getCellRect(info.row, info.col);
- gatherConfirmPopover.check({
- x: rect.x + rect.width / 2 + 25,
- y: rect.y + rect.height / 2 + 3,
- }, '子项已勾选,继续将取消子项勾选。', function () {
- node.check = true;
- const posterity = gsTree.getPosterity(node);
- const rows = [gsTree.nodes.indexOf(node)];
- for (const p of posterity) {
- if (p.check) {
- rows.push(gsTree.nodes.indexOf(p));
- p.check = false;
- }
- }
- SpreadJsObj.reLoadRowsData(info.sheet, rows);
- });
- } else {
- node.check = true;
- SpreadJsObj.reLoadRowsData(info.sheet, [gsTree.nodes.indexOf(node)]);
- }
- } else {
- if (node.pre_check) {
- const rect = info.sheet.getCellRect(info.row, info.col);
- gatherConfirmPopover.showTip({
- x: rect.x + rect.width / 2 + 25,
- y: rect.y + rect.height / 2 + 27,
- }, '该项上期已勾选调用,无法去除勾选。');
- SpreadJsObj.reLoadRowsData(info.sheet, [gsTree.nodes.indexOf(node)]);
- return;
- }
- node.check = false;
- SpreadJsObj.reLoadRowsData(info.sheet, [gsTree.nodes.indexOf(node)]);
- }
- }
- });
- const pre_gatherNodes = pre_nodes ? _.map(pre_nodes.split(',')) : [];
- const gatherNodes = exponent_nodes ? _.map(exponent_nodes.split(',')) : [];
- for (const node of gsTree.datas) {
- node.check = gatherNodes.indexOf(node.id + '') !== -1;
- node.pre_check = pre_gatherNodes.indexOf(node.id + '') !== -1;
- }
- SpreadJsObj.loadSheetData(gsSpread.getActiveSheet(), SpreadJsObj.DataType.Tree, gsTree);
- console.log(gsTree);
- gsTree.expandByLevel(4);
- SpreadJsObj.refreshTreeRowVisible(gsSpread.getActiveSheet());
- // SpreadJsObj.resetFieldReadOnly(self.gsSpread.getActiveSheet, 'check', !$('#im-gather-check')[0].checked);
- (function (select, sheet) {
- $(select).click(function () {
- if (!sheet.zh_tree) return;
- const tag = $(this).attr('tag');
- const tree = sheet.zh_tree;
- setTimeout(() => {
- showWaitingView();
- switch (tag) {
- case "1":
- case "2":
- case "3":
- case "4":
- case "5":
- tree.expandByLevel(parseInt(tag));
- SpreadJsObj.refreshTreeRowVisible(sheet);
- break;
- case "last":
- tree.expandByCustom(() => { return true; });
- SpreadJsObj.refreshTreeRowVisible(sheet);
- break;
- case "leafXmj":
- tree.expandToLeafXmj();
- SpreadJsObj.refreshTreeRowVisible(sheet);
- break;
- }
- closeWaitingView();
- }, 100);
- });
- })('a[name=showLevel]', gsSpread.getActiveSheet());
- });
- } else {
- const gatherNodes = exponent_nodes ? _.map(exponent_nodes.split(',')) : [];
- const pre_gatherNodes = pre_nodes ? _.map(pre_nodes.split(',')) : [];
- for (const node of gsTree.datas) {
- node.check = gatherNodes.indexOf(node.id + '') !== -1;
- node.pre_check = pre_gatherNodes.indexOf(node.id + '') !== -1;
- }
- SpreadJsObj.reLoadColsData(gsSpread.getActiveSheet(), [0]);
- }
- });
- // 提交 高级设置
- $('#choose2-ok').click(() => {
- if (!gsTree) { return; }
- const nodes = [];
- for (const node of gsTree.nodes) {
- if (node.check) {
- nodes.push(node);
- }
- }
- // 和exponent_nodes对比新增和移除,新增的告诉后台,比得出最新标段(不含新增分项)这条数据的调差基数
- const nodeData = [];
- const tpData = {};
- if (showStageExponent) {
- for (const ms of materialStageData) {
- tpData[ms.sid + '_tp'] = {
- contract_tp: 0,
- qc_tp: 0,
- gather_tp: 0,
- };
- }
- } else {
- tpData['all'] = {
- contract_tp: 0,
- qc_tp: 0,
- gather_tp: 0,
- };
- }
- const gatherNodes = exponent_nodes ? _.map(exponent_nodes.split(',')) : [];
- const pre_gatherNodes = pre_nodes ? _.map(pre_nodes.split(',')) : [];
- const newNodes = _.map(nodes, 'id');
- console.log(gatherNodes, newNodes);
- if (_.isEqual(_.sortBy(gatherNodes), _.sortBy(newNodes))) {
- toastr.warning('未做任何修改');
- return;
- }
- // 比较nodes和gatherNodes得出新增和移除的
- const delNodes = _.difference(gatherNodes, newNodes);
- const addNodes = _.difference(newNodes, gatherNodes);
- for (const node of nodes) {
- const isAdd = addNodes.indexOf(node.id + '') !== -1;
- if (showStageExponent) {
- for (const ms of materialStageData) {
- const key = ms.sid + '_tp';
- tpData[key].contract_tp = ZhCalc.add(tpData[key].contract_tp, node[ms.sid + '_contract_tp'] || 0);
- tpData[key].qc_tp = ZhCalc.add(tpData[key].qc_tp, node[ms.sid + '_qc_tp'] || 0);
- tpData[key].gather_tp = ZhCalc.add(tpData[key].gather_tp, node[ms.sid + '_gather_tp'] || 0);
- if (isAdd) {
- nodeData.push({
- code: node.code || node.b_code,
- node: node.id,
- name: node.name,
- ms_id: ms.id,
- contract_tp: node[ms.sid + '_contract_tp'] || 0,
- qc_tp: node[ms.sid + '_qc_tp'] || 0,
- gather_tp: node[ms.sid + '_gather_tp'] || 0,
- ex_calc: setExCalc(exponent_nodes ? null : _.find(ex_calcList, {ms_id: ms.id}).ex_calc, node[ms.sid + '_contract_tp'], node[ms.sid + '_qc_tp'], node[ms.sid + '_gather_tp']),
- });
- }
- }
- } else {
- const key = 'all';
- tpData[key].contract_tp = ZhCalc.add(tpData[key].contract_tp, node.contract_tp || 0);
- tpData[key].qc_tp = ZhCalc.add(tpData[key].qc_tp, node.qc_tp || 0);
- tpData[key].gather_tp = ZhCalc.add(tpData[key].gather_tp, node.gather_tp || 0);
- if (isAdd) {
- nodeData.push({
- code: node.code || node.b_code,
- node: node.id,
- name: node.name,
- ms_id: null,
- contract_tp: node.contract_tp || 0,
- qc_tp: node.qc_tp || 0,
- gather_tp: node.gather_tp || 0,
- ex_calc: setExCalc(exponent_nodes ? null : ex_calc, node.contract_tp, node.qc_tp, node.gather_tp),
- });
- }
- }
- }
- // 标段(不含新增分项)调差基数数据更新或新增
- const baseNodes = _.filter(materialExponentNodeData, { name: '标段', node: '-1' });
- // 总金额 - tpData 里金额就是不含新增分项金额,先获取总金额
- const totalTp = {};
- for (const node of gsTree.children) {
- if (showStageExponent) {
- for (const ms of materialStageData) {
- const key = ms.sid + '_tp';
- if (!totalTp[key]) {
- totalTp[key] = {
- contract_tp: 0,
- qc_tp: 0,
- gather_tp: 0,
- };
- }
- totalTp[key].contract_tp = ZhCalc.add(totalTp[key].contract_tp, node[ms.sid + '_contract_tp'] || 0);
- totalTp[key].qc_tp = ZhCalc.add(totalTp[key].qc_tp, node[ms.sid + '_qc_tp'] || 0);
- totalTp[key].gather_tp = ZhCalc.add(totalTp[key].gather_tp, node[ms.sid + '_gather_tp'] || 0);
- }
- } else {
- const key = 'all';
- if (!totalTp[key]) {
- totalTp[key] = {
- contract_tp: 0,
- qc_tp: 0,
- gather_tp: 0,
- };
- }
- totalTp[key].contract_tp = ZhCalc.add(totalTp[key].contract_tp, node.contract_tp || 0);
- totalTp[key].qc_tp = ZhCalc.add(totalTp[key].qc_tp, node.qc_tp || 0);
- totalTp[key].gather_tp = ZhCalc.add(totalTp[key].gather_tp, node.gather_tp || 0);
- }
- }
- if (showStageExponent) {
- for (const ms of materialStageData) {
- const node_tp = newNodes.length > 0 ? tpData[ms.sid + '_tp'] : { contract_tp: 0, qc_tp: 0, gather_tp: 0 };
- const total_tp = totalTp[ms.sid + '_tp'];
- const contract_tp = ZhCalc.sub(total_tp.contract_tp, node_tp.contract_tp);
- const qc_tp = ZhCalc.sub(total_tp.qc_tp, node_tp.qc_tp);
- const gather_tp = ZhCalc.sub(total_tp.gather_tp, node_tp.gather_tp);
- const baseSid = _.find(baseNodes, { ms_id: ms.id });
- if (baseSid) {
- let ex_calc = null;
- if (exponent_nodes) {
- ex_calc = _.find(ex_calcList, { ms_id: ms.id, mn_id: baseSid.id }).ex_calc;
- } else {
- ex_calc = _.find(ex_calcList, { ms_id: ms.id }).ex_calc;
- }
- baseSid.contract_tp = contract_tp;
- baseSid.qc_tp = qc_tp;
- baseSid.gather_tp = gather_tp;
- baseSid.ex_calc = setExCalc(ex_calc, contract_tp, qc_tp, gather_tp);
- } else {
- baseNodes.push({
- code: '不含新增分项',
- name: '标段',
- node: '-1',
- ms_id: ms.id,
- ex_calc: setExCalc(exponent_nodes ? null : _.find(ex_calcList, { ms_id: ms.id }).ex_calc, contract_tp, qc_tp, gather_tp),
- contract_tp,
- qc_tp,
- gather_tp,
- });
- }
- }
- } else {
- const node_tp = newNodes.length > 0 ? tpData['all'] : { contract_tp: 0, qc_tp: 0, gather_tp: 0 };
- const total_tp = totalTp['all'];
- const contract_tp = ZhCalc.sub(total_tp.contract_tp, node_tp.contract_tp);
- const qc_tp = ZhCalc.sub(total_tp.qc_tp, node_tp.qc_tp);
- const gather_tp = ZhCalc.sub(total_tp.gather_tp, node_tp.gather_tp);
- if (baseNodes.length > 0) {
- baseNodes[0].contract_tp = contract_tp;
- baseNodes[0].qc_tp = qc_tp;
- baseNodes[0].gather_tp = gather_tp;
- baseNodes[0].ex_calc = setExCalc(baseNodes[0].ex_calc, contract_tp, qc_tp, gather_tp);
- } else {
- baseNodes.push({
- code: '不含新增分项',
- name: '标段',
- node: '-1',
- ms_id: null,
- ex_calc: setExCalc(ex_calc, contract_tp, qc_tp, gather_tp),
- contract_tp,
- qc_tp,
- gather_tp,
- });
- }
- }
- console.log(baseNodes, nodeData);
- postData(window.location.pathname + '/save', { type:'update_node', updateData: { baseNodes, addNodes: nodeData, delNodes, exponent_node: newNodes } }, function (result) {
- window.location.reload();
- });
- });
- function setExCalc(old_ex_calc, contract_tp, qc_tp, gather_tp) {
- const insert_ex_calc = [
- {
- code: 'bqht',
- text: '所选分项合同计量金额',
- value: contract_tp || 0,
- select: false,
- },
- {
- code: 'bqbg',
- text: '所选分项变更计量金额',
- value: qc_tp || 0,
- select: false,
- },
- {
- code: 'bqwc',
- text: '所选分项完成计量金额',
- value: gather_tp || 0,
- select: true,
- },
- {
- code: 'zdy',
- text: '自定义金额',
- value: gather_tp || 0,
- result: '',
- select: false,
- },
- ];
- const gatherNodes = exponent_nodes ? _.map(exponent_nodes.split(',')) : [];
- if (gatherNodes.length !== 0) {
- // 判断是否更新new_ex_calc的select为true值
- const selectItem = _.find(old_ex_calc, { select: true });
- if (selectItem) {
- const set_selectItem = _.find(insert_ex_calc, { code: selectItem.code });
- if (set_selectItem && !set_selectItem.select) {
- const oldSelectItem = _.find(insert_ex_calc, { select: true });
- if (oldSelectItem) {
- oldSelectItem.select = false;
- }
- set_selectItem.select = true;
- }
- }
- // 自定义金额要赋值
- if (old_ex_calc) {
- const zdyItem = _.find(old_ex_calc, { code: 'zdy' });
- if (zdyItem) {
- const insertZdyItem = _.find(insert_ex_calc, { code: 'zdy' });
- if (zdyItem.result) {
- insertZdyItem.result = zdyItem.result;
- insertZdyItem.value = zdyItem.value;
- }
- }
- }
- }
- return insert_ex_calc;
- }
- });
- </script>
- <% } %>
- <% include ./audit_modal.ejs %>
|