|
@@ -141,17 +141,25 @@ $(document).ready(() => {
|
|
// 初始化 清单编号窗口 参数
|
|
// 初始化 清单编号窗口 参数
|
|
this.spreadSetting = {
|
|
this.spreadSetting = {
|
|
cols: [
|
|
cols: [
|
|
- {title: '已用', field: 'used', width: 45, formatter: '@', cellType: 'checkbox', readOnly: true, hAlign: 1,},
|
|
|
|
- {title: '变更令号', field: 'code', width: 100, formatter: '@', readOnly: true},
|
|
|
|
- {title: '名称', field: 'name', width: 120, formatter: '@', readOnly: true},
|
|
|
|
- {title: '总数量', field: 'amount', width: 60, formatter: '@', readOnly: true},
|
|
|
|
- {title: '可变更数量', field: 'vamount', width: 60, readOnly: true},
|
|
|
|
- {title: '本期计量', field: 'uamount', width: 60, formatter: '@'},
|
|
|
|
|
|
+ {title: '已用', field: '', width: 45, formatter: '@', cellType: 'image', readOnly: true, hAlign: 1, indent: 14},
|
|
|
|
+ {title: '变更令号', field: 'code', width: 100, formatter: '@', readOnly: true, hAlign: 0, },
|
|
|
|
+ {title: '名称', field: 'name', width: 120, formatter: '@', readOnly: true, hAlign: 0,},
|
|
|
|
+ {title: '总数量', field: 'b_amount', width: 60, formatter: '@', readOnly: true, hAlign: 2, },
|
|
|
|
+ {title: '可变更数量', field: 'vamount', width: 60, readOnly: true, hAlign: 2, },
|
|
|
|
+ {title: '本期计量', field: 'uamount', width: 60, formatter: '@', hAlign: 2, },
|
|
],
|
|
],
|
|
emptyRows: 0,
|
|
emptyRows: 0,
|
|
headRows: 1,
|
|
headRows: 1,
|
|
headRowHeight: [40],
|
|
headRowHeight: [40],
|
|
};
|
|
};
|
|
|
|
+ this.spreadSetting.cols[0].img = function (data) {
|
|
|
|
+ //return $('#icon-ok')[0];
|
|
|
|
+ if (data.uamount && !checkZero(data.uamount)) {
|
|
|
|
+ return $('#icon-ok')[0];
|
|
|
|
+ } else {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ };
|
|
this.curChangeId = '';
|
|
this.curChangeId = '';
|
|
this.spread = SpreadJsObj.createNewSpread($('#change-spread')[0]);
|
|
this.spread = SpreadJsObj.createNewSpread($('#change-spread')[0]);
|
|
this.firstView = true;
|
|
this.firstView = true;
|
|
@@ -168,6 +176,17 @@ $(document).ready(() => {
|
|
const change = SpreadJsObj.getSelectObject(info.sheet);
|
|
const change = SpreadJsObj.getSelectObject(info.sheet);
|
|
self._loadChangeDetail(change);
|
|
self._loadChangeDetail(change);
|
|
});
|
|
});
|
|
|
|
+ // 填写本期计量
|
|
|
|
+ this.spread.bind(spreadNS.Events.EditEnded, function (e, info) {
|
|
|
|
+ if (info.sheet.zh_setting) {
|
|
|
|
+ const col = info.sheet.zh_setting.cols[info.col];
|
|
|
|
+ const sortData = info.sheet.zh_dataType === 'tree' ? info.sheet.zh_tree.nodes : info.sheet.zh_data;
|
|
|
|
+ const node = sortData[info.row];
|
|
|
|
+ node[col.field] = col.type === 'Number' ? parseFloat(info.editingText) : info.editingText;
|
|
|
|
+ // 刷新已用提示
|
|
|
|
+ info.sheet.repaint(info.sheet.getCellRect(info.row, 0));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
// 过滤可变更数量为0
|
|
// 过滤可变更数量为0
|
|
$('#customCheckDisabled').click(function () {
|
|
$('#customCheckDisabled').click(function () {
|
|
self._filterEmptyChange(!this.checked);
|
|
self._filterEmptyChange(!this.checked);
|