|
@@ -1758,6 +1758,9 @@ $(document).ready(() => {
|
|
|
this.detailObj = {
|
|
|
selectionChanged: function (e, info) {
|
|
|
self.reLoadDetailData();
|
|
|
+ if (!info.oldSelections || !info.oldSelections[0] || info.oldSelections[0].row !== info.newSelections[0].row) {
|
|
|
+ self.loadLocateInfo();
|
|
|
+ }
|
|
|
},
|
|
|
editEnded: function(e, info) {
|
|
|
if (info.sheet.zh_setting) {
|
|
@@ -1776,8 +1779,14 @@ $(document).ready(() => {
|
|
|
updateData.name = data.name;
|
|
|
updateData.unit = data.unit;
|
|
|
updateData.unit_price = data.unit_price;
|
|
|
+ updateData.pid = data.pid;
|
|
|
updateData.pos_name = data.pos_name;
|
|
|
}
|
|
|
+ if (data.custom_define.indexOf('doc_code') === -1) {
|
|
|
+ updateData.custom_define = data.custom_define;
|
|
|
+ updateData.custom_define.push('doc_code');
|
|
|
+ updateData.custom_define = updateData.custom_define.join(',');
|
|
|
+ }
|
|
|
updateData.doc_code = info.editingText === null ? '' : info.editingText;
|
|
|
postData(window.location.pathname + '/detail/save', updateData, function (result) {
|
|
|
stageIm.loadUpdateDetailData(result);
|
|
@@ -1816,8 +1825,14 @@ $(document).ready(() => {
|
|
|
updateData.name = data.name;
|
|
|
updateData.unit = data.unit;
|
|
|
updateData.unit_price = data.unit_price;
|
|
|
+ updateData.pid = data.pid;
|
|
|
updateData.pos_name = data.pos_name;
|
|
|
}
|
|
|
+ if (data.custom_define.indexOf('doc_code') === -1) {
|
|
|
+ updateData.custom_define = data.custom_define;
|
|
|
+ updateData.custom_define.push('doc_code');
|
|
|
+ updateData.custom_define = updateData.custom_define.join(',');
|
|
|
+ }
|
|
|
updateData.doc_code = info.sheet.getText(curRow, info.cellRange.col).replace('\n', '');
|
|
|
datas.push(updateData);
|
|
|
}
|
|
@@ -1882,6 +1897,7 @@ $(document).ready(() => {
|
|
|
updateData.name = data.name;
|
|
|
updateData.unit = data.unit;
|
|
|
updateData.unit_price = data.unit_price;
|
|
|
+ updateData.pid = data.pid;
|
|
|
updateData.pos_name = data.pos_name;
|
|
|
}
|
|
|
if (regRst) {
|
|
@@ -1889,6 +1905,11 @@ $(document).ready(() => {
|
|
|
} else {
|
|
|
updateData.doc_code = text.replace('\n', '');
|
|
|
}
|
|
|
+ if (data.custom_define.indexOf('doc_code') === -1) {
|
|
|
+ updateData.custom_define = data.custom_define;
|
|
|
+ updateData.custom_define.push('doc_code');
|
|
|
+ updateData.custom_define = updateData.custom_define.join(',');
|
|
|
+ }
|
|
|
datas.push(updateData);
|
|
|
}
|
|
|
}
|
|
@@ -1913,6 +1934,7 @@ $(document).ready(() => {
|
|
|
|
|
|
this._initImTypeSetRela();
|
|
|
this._initModifyDetail();
|
|
|
+ this._initLocateRela();
|
|
|
// 草图相关
|
|
|
this._initImageRela();
|
|
|
this.reBuildImData();
|
|
@@ -1953,7 +1975,7 @@ $(document).ready(() => {
|
|
|
$('#type-title-contract').text('本期合同计量数量');
|
|
|
$('#type-title-qc').text('本期变更计量数量');
|
|
|
}
|
|
|
- if (stage.im_type === imType.bb.value) {
|
|
|
+ if (stage.im_type === imType.bb.value || stage.im_type === imType.bw.value) {
|
|
|
$('#show-jldy').parent().show();
|
|
|
$('#jldy').parent().show();
|
|
|
$('#show-xm-name').parent().hide();
|
|
@@ -2037,7 +2059,7 @@ $(document).ready(() => {
|
|
|
$('#type-title-contract').text('本期合同计量数量');
|
|
|
$('#type-title-qc').text('本期变更计量数量');
|
|
|
}
|
|
|
- if (stage.im_type === imType.bb.value) {
|
|
|
+ if (stage.im_type === imType.bb.value || stage.im_type === imType.bw.value) {
|
|
|
$('#show-jldy').parent().show();
|
|
|
$('#jldy').parent().show();
|
|
|
$('#show-xm-name').parent().hide();
|
|
@@ -2071,7 +2093,7 @@ $(document).ready(() => {
|
|
|
defaultRowHeight: 21,
|
|
|
headerFont: '12px 微软雅黑',
|
|
|
font: '12px 微软雅黑',
|
|
|
- }
|
|
|
+ };
|
|
|
sjsSettingObj.setFxTreeStyle(setting, sjsSettingObj.FxTreeStyle.jz);
|
|
|
SpreadJsObj.initSheet(self.gsSpread.getActiveSheet(), setting);
|
|
|
self.gsSpread.bind(spreadNS.Events.ButtonClicked, function (e, info) {
|
|
@@ -2192,6 +2214,35 @@ $(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);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#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);
|
|
|
+ $('#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);
|
|
|
+ $('#im-locate-info')[0].innerText = targetIndex + '/' + select.source.length;
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
_initModifyDetail() {
|
|
|
const self = this;
|
|
|
// 编辑
|
|
@@ -2209,9 +2260,11 @@ $(document).ready(() => {
|
|
|
if (!org[field]) {
|
|
|
if (newValue !== '') {
|
|
|
update[field] = newValue;
|
|
|
+ if (data.custom_define.indexOf(field) === -1) update.custom_define.push(field);
|
|
|
}
|
|
|
} else if (newValue !== org[field]){
|
|
|
update[field] = newValue;
|
|
|
+ if (data.custom_define.indexOf(field) === -1) update.custom_define.push(field);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2219,19 +2272,31 @@ $(document).ready(() => {
|
|
|
const updateData = {lid: data.lid, pid: data.pid};
|
|
|
if (data.uuid) {
|
|
|
updateData.uuid = data.uuid;
|
|
|
+ updateData.custom_define = data.custom_define;
|
|
|
} 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.bw = $('#bw-name').val();
|
|
|
- updateData.peg = $('#peg').val();
|
|
|
- updateData.xm = $('#xm-name').val();
|
|
|
- updateData.position = $('#position').val();
|
|
|
- updateData.drawing_code = $('#drawing-code').val();
|
|
|
- updateData.calc_memo = $('#calc-memo').val();
|
|
|
+ updateData.custom_define = [];
|
|
|
+ }
|
|
|
+ check('bw', $('#bw-name'), data, updateData);
|
|
|
+ check('peg', $('#peg'), data, updateData);
|
|
|
+ check('xm', $('#xm'), 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);
|
|
|
+ updateData.custom_define = updateData.custom_define.join(',');
|
|
|
+ // updateData.bw = $('#bw-name').val();
|
|
|
+ // updateData.peg = $('#peg').val();
|
|
|
+ // updateData.xm = $('#xm-name').val();
|
|
|
+ // updateData.position = $('#position').val();
|
|
|
+ // updateData.jldy = $('#jldy').val();
|
|
|
+ // updateData.drawing_code = $('#drawing-code').val();
|
|
|
+ // updateData.calc_memo = $('#calc-memo').val();
|
|
|
postData(window.location.pathname + '/detail/save', updateData, function (result) {
|
|
|
stageIm.loadUpdateDetailData(result);
|
|
|
self.reLoadDetailData();
|
|
@@ -2376,8 +2441,14 @@ $(document).ready(() => {
|
|
|
updateData.name = data.name;
|
|
|
updateData.unit = data.unit;
|
|
|
updateData.unit_price = data.unit_price;
|
|
|
+ updateData.pid = data.pid;
|
|
|
updateData.pos_name = data.pos_name;
|
|
|
}
|
|
|
+ if (data.custom_define.indexOf('calc_img') === -1) {
|
|
|
+ updateData.custom_define = data.custom_define;
|
|
|
+ updateData.custom_define.push('calc_img');
|
|
|
+ updateData.custom_define = updateData.custom_define.join(',');
|
|
|
+ }
|
|
|
updateData.img = canvas.toDataURL('image/png');
|
|
|
updateData.imgInfo = itemInfo;
|
|
|
postData(window.location.pathname + '/detail/merge-img', updateData, function (result) {
|
|
@@ -2406,6 +2477,7 @@ $(document).ready(() => {
|
|
|
const imData = stageIm.buildImData();
|
|
|
SpreadJsObj.loadSheetData(this.sheet, SpreadJsObj.DataType.Data, imData);
|
|
|
this.reLoadDetailData();
|
|
|
+ this.loadLocateInfo();
|
|
|
}
|
|
|
loadStageLedgerUpdateData(data) {
|
|
|
const imData = stageIm.loadUpdateLedgerData(data);
|
|
@@ -2422,6 +2494,15 @@ $(document).ready(() => {
|
|
|
SpreadJsObj.loadSheetData(this.sheet, SpreadJsObj.DataType.Data, imData);
|
|
|
this.reLoadDetailData();
|
|
|
}
|
|
|
+ loadLocateInfo() {
|
|
|
+ const select = SpreadJsObj.getSelectObject(this.sheet);
|
|
|
+ if (select.source.length > 1) {
|
|
|
+ $('#im-locate2bills').next().show();
|
|
|
+ } else {
|
|
|
+ $('#im-locate2bills').next().hide();
|
|
|
+ }
|
|
|
+ $('#im-locate-info')[0].innerText = '1/' + select.source.length;
|
|
|
+ }
|
|
|
reLoadDetailData() {
|
|
|
const data = SpreadJsObj.getSelectObject(this.spread.getActiveSheet());
|
|
|
|
|
@@ -2615,7 +2696,7 @@ $(document).ready(() => {
|
|
|
searchEmpty: true,
|
|
|
resultSpreadSetting: {
|
|
|
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: 'name', width: 150, hAlign: 0, formatter: '@'},
|
|
|
{title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@'},
|