|
@@ -166,8 +166,31 @@ function getDaglText(data) {
|
|
|
return def ? def.name : '';
|
|
|
}
|
|
|
|
|
|
+
|
|
|
$(document).ready(() => {
|
|
|
let detail, searchLedger, checkedChanges;
|
|
|
+ const checkOption = {
|
|
|
+ sibling: { enable: 0 },
|
|
|
+ empty_code: { enable: 0 },
|
|
|
+ calc: {
|
|
|
+ enable: 1,
|
|
|
+ fields: ['contract_qty', 'qc_qty'],
|
|
|
+ },
|
|
|
+ zero: { enable: 0 },
|
|
|
+ tp: {
|
|
|
+ enable: 1,
|
|
|
+ fields: [
|
|
|
+ {qty: 'contract_qty', tp: 'contract_tp'},
|
|
|
+ {qty: 'qc_qty', tp: 'qc_tp'},
|
|
|
+ ],
|
|
|
+ filter: function (node) {
|
|
|
+ return node.is_tp;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ over: {
|
|
|
+ enable: 1, isTz: checkTzMeasureType(),
|
|
|
+ }
|
|
|
+ };
|
|
|
// 界面布局
|
|
|
autoFlashHeight();
|
|
|
// 初始化 台账树结构 数据结构
|
|
@@ -204,7 +227,7 @@ $(document).ready(() => {
|
|
|
if (node.end_contract_qty) {
|
|
|
node.end_correct_tp = ZhCalc.add(node.end_qc_tp, ZhCalc.mul(node.end_contract_qty, node.unit_price, tenderInfo.decimal.tp));
|
|
|
} else {
|
|
|
- node.end_correct_tp = node.end_gather;
|
|
|
+ node.end_correct_tp = node.end_gather_tp;
|
|
|
}
|
|
|
}
|
|
|
node.end_gather_percent = ZhCalc.mul(ZhCalc.div(node.end_gather_tp, node.end_final_tp), 100, 2);
|
|
@@ -231,6 +254,16 @@ $(document).ready(() => {
|
|
|
};
|
|
|
const stagePos = new StagePosData(stagePosSetting);
|
|
|
|
|
|
+ const reloadCooperationHtml = function () {
|
|
|
+ const html = [];
|
|
|
+ for (const p of stageTree.pwd) {
|
|
|
+ html.push('<tr>', `<td>${p.node.code}</td>`, `<td>${p.node.name}</td>`);
|
|
|
+ html.push('<td>', p.check ? `已解锁:${p.pwd}` : `<a name="ledger-unlock" lid="${p.ledger_id}" href="javascript: void(0);">解锁</a>`, '</td>');
|
|
|
+ html.push('</tr>');
|
|
|
+ }
|
|
|
+ $('#cooperationList').html(html.join(''));
|
|
|
+ };
|
|
|
+
|
|
|
class Changes {
|
|
|
constructor(obj) {
|
|
|
const self = this;
|
|
@@ -507,12 +540,12 @@ $(document).ready(() => {
|
|
|
const slSpread = SpreadJsObj.createNewSpread($('#stage-ledger')[0]);
|
|
|
customizeStageTreeSetting(ledgerSpreadSetting, customColDisplay());
|
|
|
// 数量变更列,添加按钮
|
|
|
- const col = _.find(ledgerSpreadSetting.cols, {field: 'qc_qty'});
|
|
|
- col.readOnly = true;
|
|
|
- col.cellType = 'activeImageBtn';
|
|
|
- col.normalImg = '#ellipsis-icon';
|
|
|
- col.indent = 5;
|
|
|
- col.showImage = function (data) {
|
|
|
+ const qcCol = _.find(ledgerSpreadSetting.cols, {field: 'qc_qty'});
|
|
|
+ qcCol.readOnly = true;
|
|
|
+ qcCol.cellType = 'activeImageBtn';
|
|
|
+ qcCol.normalImg = '#ellipsis-icon';
|
|
|
+ qcCol.indent = 5;
|
|
|
+ qcCol.showImage = function (data) {
|
|
|
if (!data || (data.children && data.children.length > 0) || !(data.b_code && data.b_code !== '')) {
|
|
|
return false;
|
|
|
} else {
|
|
@@ -520,8 +553,10 @@ $(document).ready(() => {
|
|
|
return !(nodePos && nodePos.length > 0);
|
|
|
}
|
|
|
};
|
|
|
+ const ratioCol = ledgerSpreadSetting.cols.find(x => {return x.field === 'end_gather_percent' || x.field === 'end_correct_percent'});
|
|
|
+ ratioCol.field = tenderInfo.display.stage.correct ? 'end_correct_percent' : 'end_gather_percent';
|
|
|
ledgerSpreadSetting.imageClick = function (data) {
|
|
|
- if (data.children && data.children.length > 0) return;
|
|
|
+ if (data.children && data.children.length > 0 || data.lock) return;
|
|
|
|
|
|
const nodePos = stagePos.getLedgerPos(data.id);
|
|
|
if (nodePos && nodePos.length > 0) return;
|
|
@@ -570,6 +605,40 @@ $(document).ready(() => {
|
|
|
sjsSettingObj.setPropValue(ledgerSpreadSetting, ['gxby'], 'getValue', getGxbyText);
|
|
|
sjsSettingObj.setPropValue(ledgerSpreadSetting, ['dagl'], 'getValue', getDaglText);
|
|
|
if (thousandth) sjsSettingObj.setTpThousandthFormat(ledgerSpreadSetting);
|
|
|
+ ledgerSpreadSetting.headColWidth = [50];
|
|
|
+ ledgerSpreadSetting.rowHeader = [
|
|
|
+ {
|
|
|
+ rowHeaderType: 'tag',
|
|
|
+ setting: {
|
|
|
+ indent: 14,
|
|
|
+ tagSize: 0.8,
|
|
|
+ tagFont: '8px 微软雅黑',
|
|
|
+ getColor: function (index, data) {
|
|
|
+ if (!data) return;
|
|
|
+ return billsTag.getBillsTagsColor(data.id);
|
|
|
+ },
|
|
|
+ getTagHtml: function (index, data) {
|
|
|
+ if (!data) return;
|
|
|
+ const getHtml = function (list) {
|
|
|
+ if (!list || list.length === 0) return '';
|
|
|
+ const html = [];
|
|
|
+ for (const l of list) {
|
|
|
+ html.push('<div class="row mr-1">');
|
|
|
+ html.push(`<div class="col-auto pr-1 ${l.tagClass}">`, '<i class="fa fa-tag"></i>', '</div>');
|
|
|
+ html.push('<div class="col p-0">', '<p>', l.comment, '</p>', '</div>');
|
|
|
+ html.push('</div>');
|
|
|
+ }
|
|
|
+ return html.join('');
|
|
|
+ };
|
|
|
+ return getHtml(billsTag.getBillsTagsInfo(data.id));
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ ledgerSpreadSetting.readOnly = function (data) {
|
|
|
+ if (!data) return false;
|
|
|
+ return data.lock || false;
|
|
|
+ };
|
|
|
SpreadJsObj.initSheet(slSpread.getActiveSheet(), ledgerSpreadSetting);
|
|
|
slSpread.getActiveSheet().frozenColumnCount(5);
|
|
|
slSpread.getActiveSheet().options.frozenlineColor = '#93b5e4';
|
|
@@ -589,6 +658,7 @@ $(document).ready(() => {
|
|
|
};
|
|
|
posSpreadSetting.imageClick = function (data) {
|
|
|
const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
+ if (node.lock) return;
|
|
|
changesObj.loadChanges({bills: node, pos: data});
|
|
|
};
|
|
|
posSpreadSetting.getColor = function (sheet, data, row, col, defaultColor) {
|
|
@@ -605,7 +675,9 @@ $(document).ready(() => {
|
|
|
if (def && def.color) return def.color;
|
|
|
}
|
|
|
}
|
|
|
- return data && data.end_contract_qty > data.quantity ? '#f8d7da' : defaultColor;
|
|
|
+ if (checkTzMeasureType()) {
|
|
|
+ return data && data.end_contract_qty > data.quantity ? '#f8d7da' : defaultColor;
|
|
|
+ }
|
|
|
};
|
|
|
sjsSettingObj.setGridSelectStyle(posSpreadSetting);
|
|
|
if (thousandth) sjsSettingObj.setTpThousandthFormat(posSpreadSetting);
|
|
@@ -613,6 +685,21 @@ $(document).ready(() => {
|
|
|
sjsSettingObj.setPropValue(posSpreadSetting, ['dagl'], 'getValue', getDaglText);
|
|
|
SpreadJsObj.initSheet(spSpread.getActiveSheet(), posSpreadSetting);
|
|
|
|
|
|
+ const billsTag = $.billsTag({
|
|
|
+ selector: '#bills-tag',
|
|
|
+ relaSpread: slSpread,
|
|
|
+ updateUrl: window.location.pathname + '/tag',
|
|
|
+ afterModify: function (nodes) {
|
|
|
+ SpreadJsObj.repaintNodesRowHeader(slSpread.getActiveSheet(), nodes);
|
|
|
+ },
|
|
|
+ afterLocated: function () {
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
+ },
|
|
|
+ afterShow: function () {
|
|
|
+ slSpread.refresh();
|
|
|
+ if (spSpread) spSpread.refresh();
|
|
|
+ },
|
|
|
+ });
|
|
|
const errorList = $.cs_errorList({
|
|
|
tabSelector: '#error-list-tab',
|
|
|
selector: '#error-list',
|
|
@@ -626,14 +713,13 @@ $(document).ready(() => {
|
|
|
if (spSpread) spSpread.refresh();
|
|
|
},
|
|
|
});
|
|
|
-
|
|
|
const checkList = $.ledger_checkList({
|
|
|
id: 'check-list',
|
|
|
tabSelector: '#check-list-tab',
|
|
|
selector: '#check-list',
|
|
|
relaSpread: slSpread,
|
|
|
storeKey: 'stage-check-' + window.location.pathname.split('/')[2] + '-' + window.location.pathname.split('/')[4],
|
|
|
- checkType: ledgerCheckType,
|
|
|
+ checkType: getCheckType(checkOption),
|
|
|
afterLocated: function () {
|
|
|
stagePosSpreadObj.loadCurPosData();
|
|
|
},
|
|
@@ -794,7 +880,7 @@ $(document).ready(() => {
|
|
|
const datas = [], dgnDatas = [], mainDatas = [];
|
|
|
for (let iRow = sel.row; iRow < sel.row + sel.rowCount; iRow++) {
|
|
|
const node = sortData[iRow];
|
|
|
- if (node) {
|
|
|
+ if (node && !node.lock) {
|
|
|
const data = { lid: node.id }, dgnData = { id: node.id }, mainData = { id: node.id };
|
|
|
let filter = true, filterDgn = true, filterMain = true;
|
|
|
for (const iCol of validCols) {
|
|
@@ -1197,11 +1283,11 @@ $(document).ready(() => {
|
|
|
});
|
|
|
}
|
|
|
stageTreeSpreadObj.loadExprToInput(slSpread.getActiveSheet());
|
|
|
- //let check_correct = false;
|
|
|
+ let addTagShare = true;
|
|
|
$.contextMenu({
|
|
|
selector: '#stage-ledger',
|
|
|
build: function ($trigger, e) {
|
|
|
- e.data.items.correct_percent.selected = check_correct;
|
|
|
+ addTagShare = true;
|
|
|
const target = SpreadJsObj.safeRightClickSelection($trigger, e, slSpread);
|
|
|
return target.hitTestType === spreadNS.SheetArea.viewport || target.hitTestType === spreadNS.SheetArea.rowHeader;
|
|
|
},
|
|
@@ -1238,22 +1324,82 @@ $(document).ready(() => {
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
- // 'correct_percent': {
|
|
|
- // name: '使用数量矫正完成率',
|
|
|
- // type: 'checkbox',
|
|
|
- // events: {
|
|
|
- // change: function (e) {
|
|
|
- // check_correct = e.data.commands.correct_percent.$input[0].checked;
|
|
|
- // const sheet = slSpread.getActiveSheet();
|
|
|
- // const col = sheet.zh_setting.cols.find(x => {
|
|
|
- // return x.field === 'end_gather_percent' || x.field === 'end_correct_percent'
|
|
|
- // });
|
|
|
- // col.field = check_correct ? 'end_correct_percent' : 'end_gather_percent';
|
|
|
- // SpreadJsObj.reLoadColsData(sheet, [col]);
|
|
|
- // e.data.$menu.hide();
|
|
|
- // }
|
|
|
- // },
|
|
|
- // }
|
|
|
+ tag: {
|
|
|
+ name: '书签',
|
|
|
+ items: {
|
|
|
+ tagShare: {
|
|
|
+ name: '参与人可见',
|
|
|
+ type: 'checkbox',
|
|
|
+ selected: true,
|
|
|
+ events: {
|
|
|
+ change: function () {
|
|
|
+ addTagShare = this.checked;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ tagSpr: '--------------',
|
|
|
+ tagPrimary: {
|
|
|
+ icon: 'fa-tag text-primary mt-2 mb-2',
|
|
|
+ name: '靛青',
|
|
|
+ callback: function (key, opt, menu, e) {
|
|
|
+ const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
+ postData(window.location.pathname + '/tag', {add: { color: '#007bff', lid: node.id, share: addTagShare }}, function (data) {
|
|
|
+ if (data.add) data.add.node = node;
|
|
|
+ billsTag.updateDatasAndShow(data);
|
|
|
+ SpreadJsObj.repaintNodesRowHeader(slSpread.getActiveSheet(), node);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ tagSuccess: {
|
|
|
+ icon: 'fa-tag text-success mt-2 mb-2',
|
|
|
+ name: '果绿',
|
|
|
+ callback: function (key, opt) {
|
|
|
+ const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
+ postData(window.location.pathname + '/tag', {add: { color: '#28a745', lid: node.id, share: addTagShare }}, function (data) {
|
|
|
+ if (data.add) data.add.node = node;
|
|
|
+ billsTag.updateDatasAndShow(data);
|
|
|
+ SpreadJsObj.repaintNodesRowHeader(slSpread.getActiveSheet(), node);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ tagDanger: {
|
|
|
+ icon: 'fa-tag text-danger mt-2 mb-2',
|
|
|
+ name: '朱砂',
|
|
|
+ callback: function (key, opt) {
|
|
|
+ const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
+ postData(window.location.pathname + '/tag', {add: { color: '#dc3545', lid: node.id, share: addTagShare }}, function (data) {
|
|
|
+ if (data.add) data.add.node = node;
|
|
|
+ billsTag.updateDatasAndShow(data);
|
|
|
+ SpreadJsObj.repaintNodesRowHeader(slSpread.getActiveSheet(), node);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ tagWarning: {
|
|
|
+ icon: 'fa-tag text-warning mt-2 mb-2',
|
|
|
+ name: '姜黄',
|
|
|
+ callback: function (key, opt) {
|
|
|
+ const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
+ postData(window.location.pathname + '/tag', {add: { color: '#da9500', lid: node.id, share: addTagShare }}, function (data) {
|
|
|
+ if (data.add) data.add.node = node;
|
|
|
+ billsTag.updateDatasAndShow(data);
|
|
|
+ SpreadJsObj.repaintNodesRowHeader(slSpread.getActiveSheet(), node);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ tagInfo: {
|
|
|
+ icon: 'fa-tag text-info mt-2 mb-2',
|
|
|
+ name: '天蓝',
|
|
|
+ callback: function (key, opt) {
|
|
|
+ const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
+ postData(window.location.pathname + '/tag', {add: { color: '#17a2b8', lid: node.id, share: addTagShare }}, function (data) {
|
|
|
+ if (data.add) data.add.node = node;
|
|
|
+ billsTag.updateDatasAndShow(data);
|
|
|
+ SpreadJsObj.repaintNodesRowHeader(slSpread.getActiveSheet(), node);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -1284,7 +1430,9 @@ $(document).ready(() => {
|
|
|
* 加载计量单元 根据当前台账选择节点
|
|
|
*/
|
|
|
loadCurPosData: function () {
|
|
|
- const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
+ const sheet = slSpread.getActiveSheet();
|
|
|
+ const node = SpreadJsObj.getSelectObject(sheet);
|
|
|
+ spSpread.getActiveSheet().zh_setting.readOnly = node.lock;
|
|
|
if (node) {
|
|
|
const posData = stagePos.ledgerPos[itemsPre + node.id] || [];
|
|
|
SpreadJsObj.loadSheetData(spSpread.getActiveSheet(), 'data', posData);
|
|
@@ -1556,6 +1704,8 @@ $(document).ready(() => {
|
|
|
}
|
|
|
},
|
|
|
deletePress: function (sheet) {
|
|
|
+ if (sheet.zh_setting.readOnly) return;
|
|
|
+
|
|
|
if (sheet.zh_setting && sheet.zh_data) {
|
|
|
const sortData = sheet.zh_data;
|
|
|
if (!sortData || sortData.length === 0) { return; }
|
|
@@ -1670,12 +1820,19 @@ $(document).ready(() => {
|
|
|
});
|
|
|
|
|
|
// 加载计量单元数据 - 暂时统一加载,如有需要,切换成动态加载并缓存
|
|
|
- postData(window.location.pathname + '/load', { filter: 'ledger;pos;detail;change' }, function (result) {
|
|
|
+ postData(window.location.pathname + '/load', { filter: 'ledger;pos;detail;change;tag;cooperation' }, function (result) {
|
|
|
// 加载树结构
|
|
|
stageTree.loadDatas(result.ledgerData);
|
|
|
// stageTree.loadCurStageData(curStageData);
|
|
|
// stageTree.loadPreStageData(preStageData);
|
|
|
treeCalc.calculateAll(stageTree);
|
|
|
+ // 加载解锁相关
|
|
|
+ if (result.cooperation) {
|
|
|
+ stageTree.loadPwd(result.cooperation, 'bills-p-' + userID + '-' + window.location.pathname.split('/')[2]);
|
|
|
+ $('#cooperationCount').html(stageTree.pwd.length || '');
|
|
|
+ if (stageTree.pwd.length > 0) $('#cooperationCount').parent().show();
|
|
|
+ reloadCooperationHtml();
|
|
|
+ }
|
|
|
// 加载部位明细
|
|
|
stagePos.loadDatas(result.posData);
|
|
|
stagePos.calculateAll();
|
|
@@ -1686,6 +1843,11 @@ $(document).ready(() => {
|
|
|
// 加载中间计量
|
|
|
stageIm.init(stage, imType, tenderInfo.decimal);
|
|
|
stageIm.loadData(result.ledgerData, result.posData, result.detailData, result.changeData);
|
|
|
+
|
|
|
+ for (const t of result.tags) {
|
|
|
+ t.node = stageTree.datas.find(x => {return x.id === t.lid});
|
|
|
+ }
|
|
|
+ billsTag.loadDatas(result.tags);
|
|
|
errorList.loadHisErrorData();
|
|
|
checkList.loadHisCheckData();
|
|
|
}, null, true);
|
|
@@ -1757,6 +1919,9 @@ $(document).ready(() => {
|
|
|
return !checkTzMeasureType();
|
|
|
},
|
|
|
disabled: function (key, opt) {
|
|
|
+ const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
+ if (!node || node.lock) return true;
|
|
|
+
|
|
|
const sheet = spSpread.getActiveSheet();
|
|
|
if (sheet.zh_data && !readOnly) {
|
|
|
const selection = sheet.getSelections();
|
|
@@ -1793,7 +1958,7 @@ $(document).ready(() => {
|
|
|
},
|
|
|
disabled: function (key, opt) {
|
|
|
const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
- return _.isNil(node) || _.isNil(node.b_code) || node.b_code === '';
|
|
|
+ return _.isNil(node) || _.isNil(node.b_code) || node.b_code === '' || node.lock;
|
|
|
},
|
|
|
callback: function (key, opt) {
|
|
|
mergePeg.show();
|
|
@@ -1805,6 +1970,10 @@ $(document).ready(() => {
|
|
|
const data = spSpread.getActiveSheet().zh_data;
|
|
|
return data && data.length > 0;
|
|
|
},
|
|
|
+ disabled: function (key, opt) {
|
|
|
+ const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
+ return node.lock;
|
|
|
+ },
|
|
|
callback: function (key, opt) {
|
|
|
$('#cbr-ratio').val('');
|
|
|
$('#apply2sibling')[0].checked = false;
|
|
@@ -2634,11 +2803,14 @@ $(document).ready(() => {
|
|
|
if (newValue !== '') {
|
|
|
update[field] = newValue;
|
|
|
if (data.custom_define.indexOf(field) === -1) update.custom_define.push(field);
|
|
|
+ return true;
|
|
|
}
|
|
|
} else if (newValue !== org[field]){
|
|
|
update[field] = newValue;
|
|
|
if (data.custom_define.indexOf(field) === -1) update.custom_define.push(field);
|
|
|
+ return true;
|
|
|
}
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
const data = SpreadJsObj.getSelectObject(self.spread.getActiveSheet());
|
|
@@ -2655,30 +2827,34 @@ $(document).ready(() => {
|
|
|
updateData.pos_name = data.pos_name;
|
|
|
updateData.custom_define = [];
|
|
|
}
|
|
|
- check('bw', $('#bw-name'), data, updateData);
|
|
|
- check('peg', $('#peg'), data, updateData);
|
|
|
- check('xm', $('#xm-name'), data, updateData);
|
|
|
- check('position', $('#position'), data, updateData);
|
|
|
- check('jldy', $('#jldy'), data, updateData);
|
|
|
- check('drawing_code', $('#drawing-code'), data, updateData);
|
|
|
- check('calc_memo', $('#calc-memo'), data, updateData);
|
|
|
+ let infoUpdate = false;
|
|
|
+ infoUpdate = check('bw', $('#bw-name'), data, updateData) || infoUpdate;
|
|
|
+ infoUpdate = check('peg', $('#peg'), data, updateData) || infoUpdate;
|
|
|
+ infoUpdate = check('xm', $('#xm-name'), data, updateData) || infoUpdate;
|
|
|
+ infoUpdate = check('position', $('#position'), data, updateData) || infoUpdate;
|
|
|
+ infoUpdate = check('jldy', $('#jldy'), data, updateData) || infoUpdate;
|
|
|
+ infoUpdate = check('drawing_code', $('#drawing-code'), data, updateData) || infoUpdate;
|
|
|
+ infoUpdate = check('calc_memo', $('#calc-memo'), data, updateData) || infoUpdate;
|
|
|
updateData.custom_define = updateData.custom_define.join(',');
|
|
|
- postData(window.location.pathname + '/detail/save', updateData, function (result) {
|
|
|
- stageIm.loadUpdateDetailData(result);
|
|
|
- self.reLoadDetailData();
|
|
|
- if (self.updateImageData && !self.updateImageData.uuid) {
|
|
|
- self.updateImageData.uuid = result.uuid;
|
|
|
+ if (infoUpdate) {
|
|
|
+ postData(window.location.pathname + '/detail/save', updateData, function (result) {
|
|
|
+ stageIm.loadUpdateDetailData(result);
|
|
|
+ self.reLoadDetailData();
|
|
|
+ if (!self.updateImageData) return;
|
|
|
+
|
|
|
+ if (!self.updateImageData.uuid) self.updateImageData.uuid = result.uuid;
|
|
|
postData(window.location.pathname + '/detail/merge-img', self.updateImageData, function (result) {
|
|
|
stageIm.loadUpdateDetailData(result);
|
|
|
self.reLoadDetailData();
|
|
|
});
|
|
|
- }
|
|
|
- });
|
|
|
- if (self.updateImageData && self.updateImageData.uuid) {
|
|
|
+ });
|
|
|
+ } else if (self.updateImageData) {
|
|
|
postData(window.location.pathname + '/detail/merge-img', self.updateImageData, function (result) {
|
|
|
stageIm.loadUpdateDetailData(result);
|
|
|
self.reLoadDetailData();
|
|
|
});
|
|
|
+ } else {
|
|
|
+ self.reLoadDetailData();
|
|
|
}
|
|
|
});
|
|
|
// 取消
|
|
@@ -2789,7 +2965,7 @@ $(document).ready(() => {
|
|
|
$('#edit-img-ok').click(function () {
|
|
|
// 记录上传的图片的信息
|
|
|
const items = $('.img-item');
|
|
|
- const img_remark = $('#text-edit').val()
|
|
|
+ const img_remark = $('#text-edit').val();
|
|
|
const data = SpreadJsObj.getSelectObject(self.spread.getActiveSheet());
|
|
|
if (items.length > 0) {
|
|
|
const itemInfo = [];
|
|
@@ -2820,6 +2996,13 @@ $(document).ready(() => {
|
|
|
const updateData = {updateType: 'update', lid: data.lid, pid: data.pid};
|
|
|
if (data.uuid) {
|
|
|
updateData.uuid = data.uuid;
|
|
|
+ } else {
|
|
|
+ updateData.code = data.code;
|
|
|
+ updateData.name = data.name;
|
|
|
+ updateData.unit = data.unit;
|
|
|
+ updateData.unit_price = data.unit_price;
|
|
|
+ updateData.pid = data.pid;
|
|
|
+ updateData.pos_name = data.pos_name;
|
|
|
}
|
|
|
|
|
|
updateData.img = canvas.toDataURL('image/png');
|
|
@@ -3060,8 +3243,29 @@ $(document).ready(() => {
|
|
|
if (changeBills.gcl_id) {
|
|
|
const node = stageTree.nodes.find(x => {return x.id === changeBills.gcl_id});
|
|
|
SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), node.ledger_id);
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
} else {
|
|
|
- toastr.warning('该清单无法定位');
|
|
|
+ const cb = {
|
|
|
+ b_code: changeBills.code || '',
|
|
|
+ name: changeBills.name || '',
|
|
|
+ unit: changeBills.unit || '',
|
|
|
+ unit_price: changeBills.unit_price || 0,
|
|
|
+ };
|
|
|
+ for (const node of stageTree.nodes) {
|
|
|
+ if (node.children && node.children.length > 0) continue;
|
|
|
+
|
|
|
+ const b = {
|
|
|
+ b_code: node.b_code || '',
|
|
|
+ name: node.name || '',
|
|
|
+ unit: node.unit || '',
|
|
|
+ unit_price: node.unit_price || 0,
|
|
|
+ };
|
|
|
+ if (_.isMatch(cb, b)) {
|
|
|
+ SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), node.ledger_id);
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
disabled: function (key, opt) {
|
|
@@ -3586,25 +3790,7 @@ $(document).ready(() => {
|
|
|
ledgerPos: stagePos,
|
|
|
checkList: checkList,
|
|
|
decimal: tenderInfo.decimal,
|
|
|
- checkOption: {
|
|
|
- sibling: { enable: 0 },
|
|
|
- empty_code: { enable: 0 },
|
|
|
- calc: {
|
|
|
- enable: 1,
|
|
|
- fields: ['contract_qty', 'qc_qty'],
|
|
|
- },
|
|
|
- zero: { enable: 0 },
|
|
|
- tp: {
|
|
|
- enable: 1,
|
|
|
- fields: [
|
|
|
- {qty: 'contract_qty', tp: 'contract_tp'},
|
|
|
- {qty: 'qc_qty', tp: 'qc_tp'},
|
|
|
- ],
|
|
|
- filter: function (node) {
|
|
|
- return node.is_tp;
|
|
|
- }
|
|
|
- },
|
|
|
- }
|
|
|
+ checkOption: checkOption,
|
|
|
};
|
|
|
if (!checkTzMeasureType()) {
|
|
|
stageCheckerSetting.checkOption.calc.fields.push('sgfh_qty', 'sjcl_qty', 'qtcl_qty', 'quantity');
|
|
@@ -3615,7 +3801,16 @@ $(document).ready(() => {
|
|
|
{qty: 'quantity', tp: 'total_price'},
|
|
|
);
|
|
|
}
|
|
|
- LedgerChecker(stageCheckerSetting);
|
|
|
+ $('#ledger-check2').click(() => {
|
|
|
+ const result = ledgerCheck2(stageCheckerSetting);
|
|
|
+ check2Viewing({
|
|
|
+ extra: ZhCalc.div(stageTree.datas.length + stagePos.datas.length, 10000, 0),
|
|
|
+ randomWait: true,
|
|
|
+ prefix: 'check2-',
|
|
|
+ checks: result,
|
|
|
+ checkList: checkList,
|
|
|
+ })
|
|
|
+ });
|
|
|
|
|
|
const dataChecker = DataChecker({
|
|
|
checkUrl: window.location.pathname + '/check',
|
|
@@ -3766,10 +3961,39 @@ $(document).ready(() => {
|
|
|
}
|
|
|
stageTreeSpreadObj.measureByBatch(posName, ratio, apply2sibling);
|
|
|
});
|
|
|
- $('#correct_percent').click(function () {
|
|
|
- const sheet = slSpread.getActiveSheet();
|
|
|
- const col = sheet.zh_setting.cols.find(x => {return x.field === 'end_gather_percent' || x.field === 'end_correct_percent'});
|
|
|
- col.field = this.checked ? 'end_correct_percent' : 'end_gather_percent';
|
|
|
- SpreadJsObj.reLoadColsData(sheet, [sheet.zh_setting.cols.indexOf(col)]);
|
|
|
+
|
|
|
+ $('body').on('click', '[name=ledger-unlock]', function() {
|
|
|
+ $('#cooperation').modal('hide');
|
|
|
+ const lid = this.getAttribute('lid');
|
|
|
+ if (!lid) return;
|
|
|
+
|
|
|
+ const p = stageTree.pwd.find(x => {return x.ledger_id == lid});
|
|
|
+ if (!p) return;
|
|
|
+
|
|
|
+ $('#unlock-info').html(`${p.node.code} ${p.node.name} 解锁密码<b class="text-danger">*</b>`);
|
|
|
+ $('#unlock-pwd').val('').removeClass('is-invalid');
|
|
|
+ $('.invalid-feedback', '#unlock').hide();
|
|
|
+ $('.alert-warning', '#unlock').hide();
|
|
|
+ $('#unlock-ok').attr('lid', lid);
|
|
|
+ $('#unlock').modal('show');
|
|
|
+ });
|
|
|
+ $('#unlock-ok').click(function () {
|
|
|
+ const lid = this.getAttribute('lid');
|
|
|
+ if (!lid) return;
|
|
|
+
|
|
|
+ const p = stageTree.pwd.find(x => {return x.ledger_id == lid});
|
|
|
+ if (!p) return;
|
|
|
+
|
|
|
+ if (p.pwd === $('#unlock-pwd').val()) {
|
|
|
+ const refresh = stageTree.lockNode(p, false);
|
|
|
+ SpreadJsObj.reloadRowsReadonly(slSpread.getActiveSheet(), refresh);
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
+ $('#unlock').modal('hide');
|
|
|
+ reloadCooperationHtml();
|
|
|
+ } else {
|
|
|
+ $('#unlock-pwd').addClass('is-invalid');
|
|
|
+ $('.invalid-feedback', '#unlock').show();
|
|
|
+ $('.alert-warning', '#unlock').show();
|
|
|
+ }
|
|
|
})
|
|
|
});
|