|
@@ -15,6 +15,15 @@ function checkTzMeasureType () {
|
|
function transExpr(expr) {
|
|
function transExpr(expr) {
|
|
return $.trim(expr).replace('\t', '').replace('=', '').replace('%', '/100');
|
|
return $.trim(expr).replace('\t', '').replace('=', '').replace('%', '/100');
|
|
}
|
|
}
|
|
|
|
+function getExprInfo (field) {
|
|
|
|
+ const exprField = [
|
|
|
|
+ {qty: 'sgfh_qty', expr: 'sgfh_expr'},
|
|
|
|
+ {qty: 'sjcl_qty', expr: 'sjcl_expr'},
|
|
|
|
+ {qty: 'qtcl_qty', expr: 'qtcl_expr'},
|
|
|
|
+ {qty: 'contract_qty', expr: 'contract_expr'},
|
|
|
|
+ ];
|
|
|
|
+ return _.find(exprField, {qty: field});
|
|
|
|
+}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 从cookie中读取缓存的列显示设置,没有则取默认
|
|
* 从cookie中读取缓存的列显示设置,没有则取默认
|
|
@@ -136,7 +145,7 @@ $(document).ready(() => {
|
|
stageId: 'id',
|
|
stageId: 'id',
|
|
};
|
|
};
|
|
// 台账树结构计算相关设置
|
|
// 台账树结构计算相关设置
|
|
- stageTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'postil', 'used'];
|
|
|
|
|
|
+ stageTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'postil', 'used', 'contract_expr'];
|
|
stageTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp',
|
|
stageTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp',
|
|
'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp'];
|
|
'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp'];
|
|
stageTreeSetting.calcFun = function (node) {
|
|
stageTreeSetting.calcFun = function (node) {
|
|
@@ -160,7 +169,7 @@ $(document).ready(() => {
|
|
// 初始化 计量单元 数据结构
|
|
// 初始化 计量单元 数据结构
|
|
const stagePosSetting = {
|
|
const stagePosSetting = {
|
|
id: 'id', ledgerId: 'lid',
|
|
id: 'id', ledgerId: 'lid',
|
|
- updateFields: ['contract_qty', 'qc_qty', 'postil'],
|
|
|
|
|
|
+ updateFields: ['contract_qty', 'qc_qty', 'postil', 'contract_expr'],
|
|
};
|
|
};
|
|
stagePosSetting.calcFun = function (pos) {
|
|
stagePosSetting.calcFun = function (pos) {
|
|
pos.pre_gather_qty = ZhCalc.add(pos.pre_contract_qty, pos.pre_qc_qty);
|
|
pos.pre_gather_qty = ZhCalc.add(pos.pre_contract_qty, pos.pre_qc_qty);
|
|
@@ -536,7 +545,9 @@ $(document).ready(() => {
|
|
if (nodePos && nodePos.length > 0) {
|
|
if (nodePos && nodePos.length > 0) {
|
|
$('#bills-expr').val('').attr('readOnly', true);
|
|
$('#bills-expr').val('').attr('readOnly', true);
|
|
} else {
|
|
} else {
|
|
- $('#bills-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field]);
|
|
|
|
|
|
+ const exprInfo = getExprInfo(col.field);
|
|
|
|
+ const value = exprInfo && data[exprInfo.expr] ? data[exprInfo.expr] : data[col.field];
|
|
|
|
+ $('#bills-expr').val(value).attr('field', col.field).attr('org', data[col.field]);
|
|
if (col.field.indexOf('tp') >= 0) {
|
|
if (col.field.indexOf('tp') >= 0) {
|
|
$('#bills-expr').attr('readOnly', readOnly || cell.locked() || data.is_tp !== 1);
|
|
$('#bills-expr').attr('readOnly', readOnly || cell.locked() || data.is_tp !== 1);
|
|
} else {
|
|
} else {
|
|
@@ -618,6 +629,10 @@ $(document).ready(() => {
|
|
lid: node.id
|
|
lid: node.id
|
|
};
|
|
};
|
|
updateData.stage[col.field] = newValue;
|
|
updateData.stage[col.field] = newValue;
|
|
|
|
+ const exprInfo = getExprInfo(col.field);
|
|
|
|
+ if (exprInfo) {
|
|
|
|
+ updateData.stage[exprInfo.expr] = trimInvalidChar(info.editingText);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
postData(window.location.href + '/update', {bills: updateData}, function (data) {
|
|
postData(window.location.href + '/update', {bills: updateData}, function (data) {
|
|
@@ -687,6 +702,10 @@ $(document).ready(() => {
|
|
filterMain = false;
|
|
filterMain = false;
|
|
} else {
|
|
} else {
|
|
data[colSetting.field] = null;
|
|
data[colSetting.field] = null;
|
|
|
|
+ const exprInfo = getExprInfo(colSetting.field);
|
|
|
|
+ if (exprInfo) {
|
|
|
|
+ data[exprInfo.expr] = '';
|
|
|
|
+ }
|
|
filter = false;
|
|
filter = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -708,6 +727,7 @@ $(document).ready(() => {
|
|
} else {
|
|
} else {
|
|
stageIm.loadUpdateLedgerData(result);
|
|
stageIm.loadUpdateLedgerData(result);
|
|
}
|
|
}
|
|
|
|
+ stageTreeSpreadObj.loadExprToInput(sheet);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -786,6 +806,10 @@ $(document).ready(() => {
|
|
} else {
|
|
} else {
|
|
try {
|
|
try {
|
|
data[col.field] = math.evaluate(transExpr(text));
|
|
data[col.field] = math.evaluate(transExpr(text));
|
|
|
|
+ const exprInfo = getExprInfo(col.field);
|
|
|
|
+ if (exprInfo) {
|
|
|
|
+ data[exprInfo.expr] = text;
|
|
|
|
+ }
|
|
filter = false;
|
|
filter = false;
|
|
} catch(err) {
|
|
} catch(err) {
|
|
if (!bHint) {
|
|
if (!bHint) {
|
|
@@ -820,6 +844,7 @@ $(document).ready(() => {
|
|
} else {
|
|
} else {
|
|
stageIm.loadUpdateLedgerData(data);
|
|
stageIm.loadUpdateLedgerData(data);
|
|
}
|
|
}
|
|
|
|
+ stageTreeSpreadObj.loadExprToInput(sheet);
|
|
}, function () {
|
|
}, function () {
|
|
// todo
|
|
// todo
|
|
//stageTreeSpreadObj.refreshTreeNodes(slSpread.getActiveSheet(), filterNodes);
|
|
//stageTreeSpreadObj.refreshTreeNodes(slSpread.getActiveSheet(), filterNodes);
|
|
@@ -990,12 +1015,15 @@ $(document).ready(() => {
|
|
lid: select.id
|
|
lid: select.id
|
|
};
|
|
};
|
|
updateData.stage[field] = newValue;
|
|
updateData.stage[field] = newValue;
|
|
|
|
+ const exprInfo = getExprInfo(field);
|
|
|
|
+ if (exprInfo) {
|
|
|
|
+ updateData.stage[exprInfo.expr] = expr.val();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// 更新至服务器
|
|
// 更新至服务器
|
|
postData(window.location.pathname + '/update', {bills: updateData}, function (result) {
|
|
postData(window.location.pathname + '/update', {bills: updateData}, function (result) {
|
|
const nodes = stageTree.loadPostStageData(result);
|
|
const nodes = stageTree.loadPostStageData(result);
|
|
- expr.val(select[field]);
|
|
|
|
stageTreeSpreadObj.refreshTreeNodes(slSpread.getActiveSheet(), nodes);
|
|
stageTreeSpreadObj.refreshTreeNodes(slSpread.getActiveSheet(), nodes);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
@@ -1011,7 +1039,9 @@ $(document).ready(() => {
|
|
if (col && col.type === 'Number') {
|
|
if (col && col.type === 'Number') {
|
|
const data = SpreadJsObj.getSelectObject(sheet);
|
|
const data = SpreadJsObj.getSelectObject(sheet);
|
|
if (data) {
|
|
if (data) {
|
|
- $('#pos-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field])
|
|
|
|
|
|
+ const exprInfo = getExprInfo(col.field);
|
|
|
|
+ const value = exprInfo && data[exprInfo.expr] ? data[exprInfo.expr] : data[col.field];
|
|
|
|
+ $('#pos-expr').val(value).attr('field', col.field).attr('org', data[col.field])
|
|
.attr('row', sel.row).attr('readOnly', readOnly || cell.locked());
|
|
.attr('row', sel.row).attr('readOnly', readOnly || cell.locked());
|
|
} else {
|
|
} else {
|
|
$('#pos-expr').val('').attr('readOnly', true);
|
|
$('#pos-expr').val('').attr('readOnly', true);
|
|
@@ -1108,6 +1138,10 @@ $(document).ready(() => {
|
|
} else {
|
|
} else {
|
|
try {
|
|
try {
|
|
data.updateData[col.field] = math.evaluate(transExpr(newText));
|
|
data.updateData[col.field] = math.evaluate(transExpr(newText));
|
|
|
|
+ const exprInfo = getExprInfo(col.field);
|
|
|
|
+ if (exprInfo) {
|
|
|
|
+ data.updateData[exprInfo.expr] = newText;
|
|
|
|
+ }
|
|
} catch(err) {
|
|
} catch(err) {
|
|
toastr.error('输入的表达式非法');
|
|
toastr.error('输入的表达式非法');
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
@@ -1199,14 +1233,18 @@ $(document).ready(() => {
|
|
const colSetting = info.sheet.zh_setting.cols[curCol];
|
|
const colSetting = info.sheet.zh_setting.cols[curCol];
|
|
if (!colSetting) continue;
|
|
if (!colSetting) continue;
|
|
|
|
|
|
- newData[colSetting.field] = trimInvalidChar(info.sheet.getText(curRow, curCol));
|
|
|
|
|
|
+ const newValue = trimInvalidChar(info.sheet.getText(curRow, curCol));
|
|
if (colSetting.type === 'Number') {
|
|
if (colSetting.type === 'Number') {
|
|
- const num = _.toNumber(newData[colSetting.field]);
|
|
|
|
|
|
+ const num = _.toNumber(newValue);
|
|
if (num) {
|
|
if (num) {
|
|
newData[colSetting.field] = num;
|
|
newData[colSetting.field] = num;
|
|
} else {
|
|
} else {
|
|
try {
|
|
try {
|
|
- newData[colSetting.field] = math.evaluate(transExpr(newData[colSetting.field]));
|
|
|
|
|
|
+ newData[colSetting.field] = math.evaluate(transExpr(newValue));
|
|
|
|
+ const exprInfo = getExprInfo(colSetting.field);
|
|
|
|
+ if (exprInfo) {
|
|
|
|
+ newData[exprInfo.expr] = newValue;
|
|
|
|
+ }
|
|
} catch(err) {
|
|
} catch(err) {
|
|
toastr.error('输入的表达式非法');
|
|
toastr.error('输入的表达式非法');
|
|
stagePosSpreadObj.loadCurPosData();
|
|
stagePosSpreadObj.loadCurPosData();
|
|
@@ -1214,6 +1252,8 @@ $(document).ready(() => {
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ newData[colSetting.field] = newValue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
data.updateData.push(newData);
|
|
data.updateData.push(newData);
|
|
@@ -1228,20 +1268,26 @@ $(document).ready(() => {
|
|
for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
|
|
for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
|
|
const curCol = info.cellRange.col + iCol;
|
|
const curCol = info.cellRange.col + iCol;
|
|
const colSetting = info.sheet.zh_setting.cols[curCol];
|
|
const colSetting = info.sheet.zh_setting.cols[curCol];
|
|
- newData[colSetting.field] = trimInvalidChar(info.sheet.getText(curRow, curCol));
|
|
|
|
|
|
+ const newValue = trimInvalidChar(info.sheet.getText(curRow, curCol));
|
|
if (colSetting.type === 'Number') {
|
|
if (colSetting.type === 'Number') {
|
|
- const num = _.toNumber(newData[colSetting.field]);
|
|
|
|
|
|
+ const num = _.toNumber(newValue);
|
|
if (num) {
|
|
if (num) {
|
|
newData[colSetting.field] = num;
|
|
newData[colSetting.field] = num;
|
|
} else {
|
|
} else {
|
|
try {
|
|
try {
|
|
- newData[colSetting.field] = math.evaluate(transExpr(newData[colSetting.field]));
|
|
|
|
|
|
+ newData[colSetting.field] = math.evaluate(transExpr(newValue));
|
|
|
|
+ const exprInfo = getExprInfo(colSetting.field);
|
|
|
|
+ if (exprInfo) {
|
|
|
|
+ newData[exprInfo.expr] = newValue;
|
|
|
|
+ }
|
|
} catch(err) {
|
|
} catch(err) {
|
|
toastr.error('输入的表达式非法');
|
|
toastr.error('输入的表达式非法');
|
|
stagePosSpreadObj.loadCurPosData();
|
|
stagePosSpreadObj.loadCurPosData();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ newData[colSetting.field] = newValue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
data.updateData.push(newData);
|
|
data.updateData.push(newData);
|
|
@@ -1293,6 +1339,10 @@ $(document).ready(() => {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
data[colSetting.field] = null;
|
|
data[colSetting.field] = null;
|
|
|
|
+ const exprInfo = getExprInfo(colSetting.field);
|
|
|
|
+ if (exprInfo) {
|
|
|
|
+ data[exprInfo.expr] = '';
|
|
|
|
+ }
|
|
}
|
|
}
|
|
datas.push(data);
|
|
datas.push(data);
|
|
posSelects.push(node);
|
|
posSelects.push(node);
|
|
@@ -1419,6 +1469,10 @@ $(document).ready(() => {
|
|
} else {
|
|
} else {
|
|
try {
|
|
try {
|
|
data[field] = math.evaluate(transExpr(newValue));
|
|
data[field] = math.evaluate(transExpr(newValue));
|
|
|
|
+ const exprInfo = getExprInfo(field);
|
|
|
|
+ if (exprInfo) {
|
|
|
|
+ data[exprInfo.expr] = newValue;
|
|
|
|
+ }
|
|
} catch (err) {
|
|
} catch (err) {
|
|
toastr.error('输入的表达式非法');
|
|
toastr.error('输入的表达式非法');
|
|
return;
|
|
return;
|
|
@@ -1430,7 +1484,6 @@ $(document).ready(() => {
|
|
if (result.pos) {
|
|
if (result.pos) {
|
|
stagePos.updateDatas(result.pos.pos);
|
|
stagePos.updateDatas(result.pos.pos);
|
|
stagePos.loadCurStageData(result.pos.curStageData);
|
|
stagePos.loadCurStageData(result.pos.curStageData);
|
|
- expr.val(select[field]);
|
|
|
|
SpreadJsObj.reLoadRowData(posSheet, _.toNumber(row));
|
|
SpreadJsObj.reLoadRowData(posSheet, _.toNumber(row));
|
|
}
|
|
}
|
|
const refreshData = stageTree.loadPostStageData(result.ledger);
|
|
const refreshData = stageTree.loadPostStageData(result.ledger);
|
|
@@ -1758,6 +1811,9 @@ $(document).ready(() => {
|
|
this.detailObj = {
|
|
this.detailObj = {
|
|
selectionChanged: function (e, info) {
|
|
selectionChanged: function (e, info) {
|
|
self.reLoadDetailData();
|
|
self.reLoadDetailData();
|
|
|
|
+ if (!info.oldSelections || !info.oldSelections[0] || info.oldSelections[0].row !== info.newSelections[0].row) {
|
|
|
|
+ self.loadLocateInfo();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
editEnded: function(e, info) {
|
|
editEnded: function(e, info) {
|
|
if (info.sheet.zh_setting) {
|
|
if (info.sheet.zh_setting) {
|
|
@@ -1776,6 +1832,7 @@ $(document).ready(() => {
|
|
updateData.name = data.name;
|
|
updateData.name = data.name;
|
|
updateData.unit = data.unit;
|
|
updateData.unit = data.unit;
|
|
updateData.unit_price = data.unit_price;
|
|
updateData.unit_price = data.unit_price;
|
|
|
|
+ updateData.pid = data.pid;
|
|
updateData.pos_name = data.pos_name;
|
|
updateData.pos_name = data.pos_name;
|
|
}
|
|
}
|
|
if (data.custom_define.indexOf('doc_code') === -1) {
|
|
if (data.custom_define.indexOf('doc_code') === -1) {
|
|
@@ -1821,6 +1878,7 @@ $(document).ready(() => {
|
|
updateData.name = data.name;
|
|
updateData.name = data.name;
|
|
updateData.unit = data.unit;
|
|
updateData.unit = data.unit;
|
|
updateData.unit_price = data.unit_price;
|
|
updateData.unit_price = data.unit_price;
|
|
|
|
+ updateData.pid = data.pid;
|
|
updateData.pos_name = data.pos_name;
|
|
updateData.pos_name = data.pos_name;
|
|
}
|
|
}
|
|
if (data.custom_define.indexOf('doc_code') === -1) {
|
|
if (data.custom_define.indexOf('doc_code') === -1) {
|
|
@@ -1854,7 +1912,6 @@ $(document).ready(() => {
|
|
const updateData = {lid: data.lid};
|
|
const updateData = {lid: data.lid};
|
|
if (data.uuid) {
|
|
if (data.uuid) {
|
|
updateData.uuid = data.uuid;
|
|
updateData.uuid = data.uuid;
|
|
- updateData.custom_define = data.custom_define;
|
|
|
|
updateData.doc_code = '';
|
|
updateData.doc_code = '';
|
|
datas.push(updateData);
|
|
datas.push(updateData);
|
|
}
|
|
}
|
|
@@ -1893,6 +1950,7 @@ $(document).ready(() => {
|
|
updateData.name = data.name;
|
|
updateData.name = data.name;
|
|
updateData.unit = data.unit;
|
|
updateData.unit = data.unit;
|
|
updateData.unit_price = data.unit_price;
|
|
updateData.unit_price = data.unit_price;
|
|
|
|
+ updateData.pid = data.pid;
|
|
updateData.pos_name = data.pos_name;
|
|
updateData.pos_name = data.pos_name;
|
|
}
|
|
}
|
|
if (regRst) {
|
|
if (regRst) {
|
|
@@ -1929,6 +1987,7 @@ $(document).ready(() => {
|
|
|
|
|
|
this._initImTypeSetRela();
|
|
this._initImTypeSetRela();
|
|
this._initModifyDetail();
|
|
this._initModifyDetail();
|
|
|
|
+ this._initLocateRela();
|
|
// 草图相关
|
|
// 草图相关
|
|
this._initImageRela();
|
|
this._initImageRela();
|
|
this.reBuildImData();
|
|
this.reBuildImData();
|
|
@@ -2208,6 +2267,38 @@ $(document).ready(() => {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ _initLocateRela() {
|
|
|
|
+ const self = this;
|
|
|
|
+ $('#im-locate2bills').click(function () {
|
|
|
|
+ const curIndex = parseInt($('#im-locate-info')[0].innerText.split('/')[0]);
|
|
|
|
+ const select = SpreadJsObj.getSelectObject(self.spread.getActiveSheet());
|
|
|
|
+ if (select && select.source) {
|
|
|
|
+ SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), select.source[curIndex-1].id, true);
|
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ $('#im-locate-pre').click(function () {
|
|
|
|
+ const curIndex = parseInt($('#im-locate-info')[0].innerText.split('/')[0]);
|
|
|
|
+ const select = SpreadJsObj.getSelectObject(self.spread.getActiveSheet());
|
|
|
|
+ if (select && select.source) {
|
|
|
|
+ const targetIndex = math.max(curIndex-1, 1);
|
|
|
|
+ SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), select.source[targetIndex-1].id, true);
|
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
|
+ $('#im-locate-info')[0].innerText = targetIndex + '/' + select.source.length;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ $('#im-locate-next').click(function () {
|
|
|
|
+ const curIndex = parseInt($('#im-locate-info')[0].innerText.split('/')[0]);
|
|
|
|
+ const select = SpreadJsObj.getSelectObject(self.spread.getActiveSheet());
|
|
|
|
+ if (select && select.source) {
|
|
|
|
+ const targetIndex = math.min(curIndex+1, select.source.length);
|
|
|
|
+ SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), select.source[targetIndex-1].id, true);
|
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
|
+ $('#im-locate-info')[0].innerText = targetIndex + '/' + select.source.length;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ }
|
|
_initModifyDetail() {
|
|
_initModifyDetail() {
|
|
const self = this;
|
|
const self = this;
|
|
// 编辑
|
|
// 编辑
|
|
@@ -2243,12 +2334,13 @@ $(document).ready(() => {
|
|
updateData.name = data.name;
|
|
updateData.name = data.name;
|
|
updateData.unit = data.unit;
|
|
updateData.unit = data.unit;
|
|
updateData.unit_price = data.unit_price;
|
|
updateData.unit_price = data.unit_price;
|
|
|
|
+ updateData.pid = data.pid;
|
|
updateData.pos_name = data.pos_name;
|
|
updateData.pos_name = data.pos_name;
|
|
updateData.custom_define = [];
|
|
updateData.custom_define = [];
|
|
}
|
|
}
|
|
check('bw', $('#bw-name'), data, updateData);
|
|
check('bw', $('#bw-name'), data, updateData);
|
|
check('peg', $('#peg'), data, updateData);
|
|
check('peg', $('#peg'), data, updateData);
|
|
- check('xm', $('#xm'), data, updateData);
|
|
|
|
|
|
+ check('xm', $('#xm-name'), data, updateData);
|
|
check('position', $('#position'), data, updateData);
|
|
check('position', $('#position'), data, updateData);
|
|
check('jldy', $('#jldy'), data, updateData);
|
|
check('jldy', $('#jldy'), data, updateData);
|
|
check('drawing_code', $('#drawing-code'), data, updateData);
|
|
check('drawing_code', $('#drawing-code'), data, updateData);
|
|
@@ -2405,6 +2497,7 @@ $(document).ready(() => {
|
|
updateData.name = data.name;
|
|
updateData.name = data.name;
|
|
updateData.unit = data.unit;
|
|
updateData.unit = data.unit;
|
|
updateData.unit_price = data.unit_price;
|
|
updateData.unit_price = data.unit_price;
|
|
|
|
+ updateData.pid = data.pid;
|
|
updateData.pos_name = data.pos_name;
|
|
updateData.pos_name = data.pos_name;
|
|
}
|
|
}
|
|
if (data.custom_define.indexOf('calc_img') === -1) {
|
|
if (data.custom_define.indexOf('calc_img') === -1) {
|
|
@@ -2415,6 +2508,7 @@ $(document).ready(() => {
|
|
updateData.img = canvas.toDataURL('image/png');
|
|
updateData.img = canvas.toDataURL('image/png');
|
|
updateData.imgInfo = itemInfo;
|
|
updateData.imgInfo = itemInfo;
|
|
postData(window.location.pathname + '/detail/merge-img', updateData, function (result) {
|
|
postData(window.location.pathname + '/detail/merge-img', updateData, function (result) {
|
|
|
|
+ stageIm.loadUpdateDetailData(result);
|
|
data.calc_img = result.calc_img;
|
|
data.calc_img = result.calc_img;
|
|
data.calc_img_org = result.calc_img_org;
|
|
data.calc_img_org = result.calc_img_org;
|
|
const calcImgSrc = data && data.calc_img ? '/' + data.calc_img : '';
|
|
const calcImgSrc = data && data.calc_img ? '/' + data.calc_img : '';
|
|
@@ -2425,6 +2519,7 @@ $(document).ready(() => {
|
|
});
|
|
});
|
|
} else if (data.calc_img) {
|
|
} else if (data.calc_img) {
|
|
postData(window.location.pathname + '/detail/merge-img', {updateType: 'clear', lid: data.lid, pid: data.pid, uuid: data.uuid}, function (result) {
|
|
postData(window.location.pathname + '/detail/merge-img', {updateType: 'clear', lid: data.lid, pid: data.pid, uuid: data.uuid}, function (result) {
|
|
|
|
+ stageIm.loadUpdateDetailData(result);
|
|
data.calc_img = result.calc_img;
|
|
data.calc_img = result.calc_img;
|
|
data.calc_img_org = result.calc_img_org;
|
|
data.calc_img_org = result.calc_img_org;
|
|
const calcImgSrc = data && data.calc_img ? '/' + data.calc_img : '';
|
|
const calcImgSrc = data && data.calc_img ? '/' + data.calc_img : '';
|
|
@@ -2440,6 +2535,7 @@ $(document).ready(() => {
|
|
const imData = stageIm.buildImData();
|
|
const imData = stageIm.buildImData();
|
|
SpreadJsObj.loadSheetData(this.sheet, SpreadJsObj.DataType.Data, imData);
|
|
SpreadJsObj.loadSheetData(this.sheet, SpreadJsObj.DataType.Data, imData);
|
|
this.reLoadDetailData();
|
|
this.reLoadDetailData();
|
|
|
|
+ this.loadLocateInfo();
|
|
}
|
|
}
|
|
loadStageLedgerUpdateData(data) {
|
|
loadStageLedgerUpdateData(data) {
|
|
const imData = stageIm.loadUpdateLedgerData(data);
|
|
const imData = stageIm.loadUpdateLedgerData(data);
|
|
@@ -2456,6 +2552,15 @@ $(document).ready(() => {
|
|
SpreadJsObj.loadSheetData(this.sheet, SpreadJsObj.DataType.Data, imData);
|
|
SpreadJsObj.loadSheetData(this.sheet, SpreadJsObj.DataType.Data, imData);
|
|
this.reLoadDetailData();
|
|
this.reLoadDetailData();
|
|
}
|
|
}
|
|
|
|
+ loadLocateInfo() {
|
|
|
|
+ const select = SpreadJsObj.getSelectObject(this.sheet);
|
|
|
|
+ if (select && select.source.length > 1) {
|
|
|
|
+ $('#im-locate2bills').next().show();
|
|
|
|
+ } else {
|
|
|
|
+ $('#im-locate2bills').next().hide();
|
|
|
|
+ }
|
|
|
|
+ $('#im-locate-info')[0].innerText = '1/' + (select ? select.source.length : '0');
|
|
|
|
+ }
|
|
reLoadDetailData() {
|
|
reLoadDetailData() {
|
|
const data = SpreadJsObj.getSelectObject(this.spread.getActiveSheet());
|
|
const data = SpreadJsObj.getSelectObject(this.spread.getActiveSheet());
|
|
|
|
|
|
@@ -2649,7 +2754,7 @@ $(document).ready(() => {
|
|
searchEmpty: true,
|
|
searchEmpty: true,
|
|
resultSpreadSetting: {
|
|
resultSpreadSetting: {
|
|
cols: [
|
|
cols: [
|
|
- {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@'},
|
|
|
|
|
|
+ {title: '项目节编号', field: 'code', hAlign: 0, width: 90, formatter: '@'},
|
|
{title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
|
|
{title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
|
|
{title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@'},
|
|
{title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@'},
|
|
{title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@'},
|
|
{title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@'},
|