|
@@ -187,7 +187,396 @@ $(document).ready(() => {
|
|
} else {
|
|
} else {
|
|
$(this).val(change[val_name]);
|
|
$(this).val(change[val_name]);
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const changeSpread = SpreadJsObj.createNewSpread($('#apply-spread')[0]);
|
|
|
|
+ const changeSpreadSheet = changeSpread.getActiveSheet();
|
|
|
|
+ const style1 = new GC.Spread.Sheets.Style();
|
|
|
|
+ style1.locked = true;
|
|
|
|
+
|
|
|
|
+ const changeSpreadSetting = {
|
|
|
|
+ cols: [
|
|
|
|
+ {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 110, formatter: '@', readOnly: 'readOnly.isEdit'},
|
|
|
|
+ {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 130, formatter: '@', readOnly: 'readOnly.isEdit'},
|
|
|
|
+ {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', readOnly: 'readOnly.isEdit', cellType: 'unit', comboItems: changeUnits, comboEdit: true},
|
|
|
|
+ {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number', readOnly: 'readOnly.isEdit', getValue: 'getValue.unit_price'},
|
|
|
|
+ {title: '原设计|数量', colSpan: '2|1', rowSpan: '1|1', field: 'oamount', hAlign: 2, width: 60, type: 'Number', readOnly: 'readOnly.isEdit', getValue: 'getValue.oamount'},
|
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'oa_tp', hAlign: 2, width: 80, type: 'Number', readOnly: true, getValue: 'getValue.oa_tp'},
|
|
|
|
+ {title: '申请变更增(+)减(-)|数量', colSpan: '2|1', rowSpan: '1|1', field: 'camount', hAlign: 2, width: 60, type: 'Number', readOnly: 'readOnly.isEdit', getValue: 'getValue.camount'},
|
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'ca_tp', hAlign: 2, width: 80, type: 'Number', readOnly: true, getValue: 'getValue.ca_tp'},
|
|
|
|
+ ],
|
|
|
|
+ emptyRows: !readOnly ? 3 : 0,
|
|
|
|
+ headRows: 2,
|
|
|
|
+ headRowHeight: [25, 25],
|
|
|
|
+ defaultRowHeight: 21,
|
|
|
|
+ headerFont: '12px 微软雅黑',
|
|
|
|
+ font: '12px 微软雅黑',
|
|
|
|
+ readOnly: readOnly,
|
|
|
|
+ localCache: {
|
|
|
|
+ key: 'changes-apply-list-spread',
|
|
|
|
+ colWidth: true,
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ console.log(changeList);
|
|
|
|
+
|
|
|
|
+ const changeCol = {
|
|
|
|
+ getValue: {
|
|
|
|
+ unit_price: function(data) {
|
|
|
|
+ return ZhCalc.round(data.unit_price, unitPriceUnit);
|
|
|
|
+ },
|
|
|
|
+ oa_tp: function (data) {
|
|
|
|
+ return ZhCalc.round(ZhCalc.mul(data.unit_price, data.oamount), totalPriceUnit);
|
|
|
|
+ },
|
|
|
|
+ ca_tp: function (data) {
|
|
|
|
+ return ZhCalc.round(ZhCalc.mul(data.unit_price, data.camount), totalPriceUnit);
|
|
|
|
+ },
|
|
|
|
+ oamount: function (data) {
|
|
|
|
+ return ZhCalc.round(data.oamount, findDecimal(data.unit));
|
|
|
|
+ },
|
|
|
|
+ camount: function (data) {
|
|
|
|
+ return ZhCalc.round(data.camount, findDecimal(data.unit));
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ readOnly: {
|
|
|
|
+ isEdit: function (data) {
|
|
|
|
+ return readOnly;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ const changeSpreadObj = {
|
|
|
|
+ makeSjsFooter: function() {
|
|
|
|
+ // 增加汇总行并设为锁定禁止编辑状态
|
|
|
|
+ changeSpreadSheet.addRows(changeSpreadSheet.getRowCount(), 1);
|
|
|
|
+ changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 0, '合计');
|
|
|
|
+ changeSpreadSheet.setStyle(changeSpreadSheet.getRowCount() - 1, -1, style1);
|
|
|
|
+ changeSpreadObj.countSum();
|
|
|
|
+ },
|
|
|
|
+ countSum: function() {
|
|
|
|
+ const rowCount = changeSpreadSheet.getRowCount();
|
|
|
|
+ let oSum = 0,
|
|
|
|
+ cSum = 0;
|
|
|
|
+ for (let i = 0; i < rowCount - 1; i++) {
|
|
|
|
+ oSum = ZhCalc.add(oSum, changeSpreadSheet.getValue(i, 5));
|
|
|
|
+ cSum = ZhCalc.add(cSum, changeSpreadSheet.getValue(i, 7));
|
|
|
|
+ }
|
|
|
|
+ changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 5, oSum !== 0 ? oSum : null);
|
|
|
|
+ changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 7, cSum !== 0 ? cSum : null);
|
|
|
|
+ },
|
|
|
|
+ deletePress: function (sheet) {
|
|
|
|
+ return;
|
|
|
|
+ },
|
|
|
|
+ valueChanged: function (e, info) {
|
|
|
|
+ // 防止ctrl+z撤销数据
|
|
|
|
+ SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ if (!readOnly) {
|
|
|
|
+ changeSpreadObj.del = function (sheet) {
|
|
|
|
+ const selection = sheet.getSelections();
|
|
|
|
+ const row = selection[0].row, count = selection[0].rowCount;
|
|
|
|
+ const sortData = sheet.zh_data;
|
|
|
|
+ const ids = [];
|
|
|
|
+ for (let iRow = 0; iRow < count; iRow++) {
|
|
|
|
+ if (sortData[iRow + row]) {
|
|
|
|
+ ids.push(sortData[iRow + row].id);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (ids.length > 0) {
|
|
|
|
+ postData(preUrl + '/list/save', {type: 'del', ids}, function (result) {
|
|
|
|
+ changeList = result;
|
|
|
|
+ SpreadJsObj.loadSheetData(changeSpreadSheet, SpreadJsObj.DataType.Data, changeList);
|
|
|
|
+ changeSpreadObj.makeSjsFooter();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ changeSpreadObj.editEnded = function (e, info) {
|
|
|
|
+ if (info.sheet.zh_setting) {
|
|
|
|
+ const type = SpreadJsObj.getSelectObject(info.sheet) ? 'update' : 'add';
|
|
|
|
+ const select = type === 'update' ? SpreadJsObj.getSelectObject(info.sheet) : {unit: ''};
|
|
|
|
+ const col = info.sheet.zh_setting.cols[info.col];
|
|
|
|
+ // 未改变值则不提交
|
|
|
|
+ let validText = is_numeric(info.editingText) ? parseFloat(info.editingText) : (info.editingText ? trimInvalidChar(info.editingText) : '');
|
|
|
|
+ const orgValue = type === 'update' ? select[col.field] : '';
|
|
|
|
+ if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
|
|
|
|
+ SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (col.field === 'oa_tp' || col.field === 'ca_tp') {
|
|
|
|
+ SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // 判断部分值是否输入的是数字判断和数据计算
|
|
|
|
+ if (col.type === 'Number') {
|
|
|
|
+ if (isNaN(validText)) {
|
|
|
|
+ toastr.error('不能输入其它非数字类型字符');
|
|
|
|
+ SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (col.field === 'unit_price') {
|
|
|
|
+ validText = ZhCalc.round(validText, unitPriceUnit);
|
|
|
|
+ } else {
|
|
|
|
+ validText = ZhCalc.round(validText, findDecimal(select.unit)) || 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (col.field === 'unit') {
|
|
|
|
+ select.camount = ZhCalc.round(select.camount, findDecimal(validText)) || 0;
|
|
|
|
+ select.oamount = ZhCalc.round(select.oamount, findDecimal(validText)) || 0;
|
|
|
|
+ }
|
|
|
|
+ select[col.field] = validText;
|
|
|
|
+
|
|
|
|
+ console.log(select, type);
|
|
|
|
+ delete select.waitingLoading;
|
|
|
|
+
|
|
|
|
+ // 更新至服务器
|
|
|
|
+ postData(preUrl + '/list/save', { type, updateData: select }, function (result) {
|
|
|
|
+ if(type === 'update') {
|
|
|
|
+ changeList.splice(info.row, 1, select);
|
|
|
|
+ SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
|
+ changeSpreadObj.countSum();
|
|
|
|
+ } else {
|
|
|
|
+ changeList.push(result);
|
|
|
|
+ changeSpreadSheet.addRows(changeList.length - 1, 1);
|
|
|
|
+ SpreadJsObj.reLoadRowData(changeSpreadSheet, changeList.length - 1);
|
|
|
|
+ changeSpreadSheet.setStyle(changeSpreadSheet.getRowCount() - 1, -1, style1);
|
|
|
|
+ changeSpreadSheet.setSelection(changeList.length - 1, 0, 1, 1);
|
|
|
|
+ }
|
|
|
|
+ }, function () {
|
|
|
|
+ select[col.field] = orgValue;
|
|
|
|
+ if(col.field === 'camount') {
|
|
|
|
+ select.spamount = orgValue;
|
|
|
|
+ }
|
|
|
|
+ SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ changeSpreadObj.clipboardPasted = function(e, info, cellRange) {
|
|
|
|
+ if (info.sheet.getColumnCount() > info.sheet.zh_setting.cols.length) {
|
|
|
|
+ info.sheet.setColumnCount(info.sheet.zh_setting.cols.length);
|
|
|
|
+ }
|
|
|
|
+ const hint = {
|
|
|
|
+ cellError: {type: 'error', msg: '粘贴内容超出了表格范围'},
|
|
|
|
+ numberExpr: {type: 'error', msg: '不能粘贴其它非数字类型字符'},
|
|
|
|
+ };
|
|
|
|
+ if (info.sheet.zh_setting) {
|
|
|
|
+ const sortData = info.sheet.zh_data || [];
|
|
|
|
+ const range = info.cellRange;
|
|
|
|
+ const data = [];
|
|
|
|
+ for (let iRow = 0; iRow < range.rowCount; iRow++) {
|
|
|
|
+ let bPaste = true;
|
|
|
|
+ const curRow = range.row + iRow;
|
|
|
|
+ // const materialData = JSON.parse(JSON.stringify(sortData[curRow]));
|
|
|
|
+ const cLData = curRow >= sortData.length ? {unit: ''} : {id: sortData[curRow].id};
|
|
|
|
+ const hintRow = range.rowCount > 1 ? curRow : '';
|
|
|
|
+ let sameCol = 0;
|
|
|
|
+ for (let iCol = 0; iCol < range.colCount; iCol++) {
|
|
|
|
+ const curCol = range.col + iCol;
|
|
|
|
+ const colSetting = info.sheet.zh_setting.cols[curCol];
|
|
|
|
+ if (!colSetting) continue;
|
|
|
|
+ // cLData[colSetting.field] = trimInvalidChar(info.sheet.getText(curRow, curCol));
|
|
|
|
+
|
|
|
|
+ let validText = info.sheet.getText(curRow, curCol);
|
|
|
|
+ validText = is_numeric(validText) ? parseFloat(validText) : (validText ? trimInvalidChar(validText) : '');
|
|
|
|
+ const orgValue = curRow >= sortData.length ? '' : sortData[curRow][colSetting.field];
|
|
|
|
+ if (orgValue == validText || ((!orgValue || orgValue === '') && (validText === ''))) {
|
|
|
|
+ sameCol++;
|
|
|
|
+ if (range.colCount === sameCol) {
|
|
|
|
+ bPaste = false;
|
|
|
|
+ }
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (colSetting.type === 'Number') {
|
|
|
|
+ if (isNaN(validText)) {
|
|
|
|
+ // toastMessageUniq(getPasteHint(hint.numberExpr, hintRow));
|
|
|
|
+ toastMessageUniq(hint.numberExpr);
|
|
|
|
+ bPaste = false;
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if (colSetting.field === 'unit_price') {
|
|
|
|
+ validText = ZhCalc.round(validText, unitPriceUnit);
|
|
|
|
+ } else {
|
|
|
|
+ validText = ZhCalc.round(validText, findDecimal(cLData.unit)) || 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ let unitdecimal = validText;
|
|
|
|
+ if (colSetting.field === 'unit') {
|
|
|
|
+ //粘贴内容要为下拉列表里所有的单位,不然为空
|
|
|
|
+ if (changeUnits.indexOf(validText) === -1) {
|
|
|
|
+ unitdecimal = '';
|
|
|
|
+ // validText = null;
|
|
|
|
+ }
|
|
|
|
+ cLData.camount = curRow >= sortData.length ? 0 : ZhCalc.round(sortData[curRow].camount, findDecimal(unitdecimal)) || 0;
|
|
|
|
+ cLData.oamount = curRow >= sortData.length ? 0 : ZhCalc.round(sortData[curRow].oamount, findDecimal(unitdecimal)) || 0;
|
|
|
|
+ }
|
|
|
|
+ cLData[colSetting.field] = validText;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (bPaste) {
|
|
|
|
+ delete cLData.oa_tp;
|
|
|
|
+ delete cLData.ca_tp;
|
|
|
|
+ data.push(cLData);
|
|
|
|
+ // rowData.push(curRow);
|
|
|
|
+ } else {
|
|
|
|
+ SpreadJsObj.reLoadRowData(info.sheet, curRow);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (data.length === 0) {
|
|
|
|
+ SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ console.log(data);
|
|
|
|
+ // 更新至服务器
|
|
|
|
+ postData(preUrl + '/list/save', { type:'paste', updateData: data }, function (result) {
|
|
|
|
+ changeList = result;
|
|
|
|
+ SpreadJsObj.loadSheetData(changeSpreadSheet, SpreadJsObj.DataType.Data, changeList);
|
|
|
|
+ changeSpreadObj.makeSjsFooter();
|
|
|
|
+ }, function () {
|
|
|
|
+ SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
|
|
|
|
+ return;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ changeSpreadObj.updateOamount = function () {
|
|
|
|
+ const select = SpreadJsObj.getSelectObject(changeSpreadSheet);
|
|
|
|
+ console.log(changeSpreadSheet);
|
|
|
|
+ const index = changeList.indexOf(select);
|
|
|
|
+ if (index > -1) {
|
|
|
|
+ const dataSource = listRule.source === 1 ? gclGatherData : dealBillList;
|
|
|
|
+ const source = _.find(dataSource, function (item) {
|
|
|
|
+ if (item.b_code === select.code && item.name === select.name) {
|
|
|
|
+ if (listRule.rule.length > 0) {
|
|
|
|
+ for(const r of listRule.rule) {
|
|
|
|
+ if (item[r] !== select[r]) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ });
|
|
|
|
+ if (source && source.quantity !== select.oamount) {
|
|
|
|
+ select.oamount = source.quantity;
|
|
|
|
+ delete select.waitingLoading;
|
|
|
|
+ console.log(select);
|
|
|
|
+ // 更新至服务器
|
|
|
|
+ postData(preUrl + '/list/save', { type:'update', updateData: select }, function (result) {
|
|
|
|
+ changeList.splice(index, 1, select);
|
|
|
|
+ SpreadJsObj.reLoadRowData(changeSpreadSheet, index);
|
|
|
|
+ changeSpreadObj.countSum();
|
|
|
|
+ }, function () {
|
|
|
|
+ SpreadJsObj.reLoadRowData(changeSpreadSheet, index);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ // changeSpread.bind(spreadNS.Events.CellChanged, changeSpreadObj.cellChanged);
|
|
|
|
+ changeSpread.bind(spreadNS.Events.EditEnded, changeSpreadObj.editEnded);
|
|
|
|
+ changeSpread.bind(spreadNS.Events.ClipboardPasted, changeSpreadObj.clipboardPasted);
|
|
|
|
+ changeSpread.bind(spreadNS.Events.ValueChanged, changeSpreadObj.valueChanged);
|
|
|
|
+ SpreadJsObj.addDeleteBind(changeSpread, changeSpreadObj.deletePress);
|
|
|
|
+
|
|
|
|
+ // 右键菜单
|
|
|
|
+ $.contextMenu({
|
|
|
|
+ selector: '#apply-spread',
|
|
|
|
+ build: function ($trigger, e) {
|
|
|
|
+ const target = SpreadJsObj.safeRightClickSelection($trigger, e, changeSpread);
|
|
|
|
+ return target.hitTestType === GC.Spread.Sheets.SheetArea.viewport || target.hitTestType === GC.Spread.Sheets.SheetArea.rowHeader;
|
|
|
|
+ },
|
|
|
|
+ items: {
|
|
|
|
+ 'updateOamount': {
|
|
|
|
+ name: '原设计数量读取',
|
|
|
|
+ icon: '',
|
|
|
|
+ callback: function (key, opt) {
|
|
|
|
+ changeSpreadObj.updateOamount(changeSpreadSheet);
|
|
|
|
+ },
|
|
|
|
+ disabled: function (key, opt) {
|
|
|
|
+ const select = SpreadJsObj.getSelectObject(changeSpreadSheet);
|
|
|
|
+ const sel = changeSpreadSheet.getSelections()[0];
|
|
|
|
+ // console.log(select, sel);
|
|
|
|
+ if (!readOnly && select && sel.row !== changeSpreadSheet.getRowCount() - 1) {
|
|
|
|
+ return false;
|
|
|
|
+ } else {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ sprDel: '------------',
|
|
|
|
+ 'delete': {
|
|
|
|
+ name: '删除',
|
|
|
|
+ icon: 'fa-remove',
|
|
|
|
+ callback: function (key, opt) {
|
|
|
|
+ changeSpreadObj.del(changeSpreadSheet);
|
|
|
|
+ },
|
|
|
|
+ disabled: function (key, opt) {
|
|
|
|
+ // const select = SpreadJsObj.getSelectObject(changeSpreadSheet);
|
|
|
|
+ if (changeSpreadSheet.zh_data) {
|
|
|
|
+ const selection = changeSpreadSheet.getSelections();
|
|
|
|
+ return changeSpreadSheet.zh_data.length < selection[0].row + selection[0].rowCount;
|
|
|
|
+ } else {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ // const sel = changeSpreadSheet.getSelections()[0];
|
|
|
|
+ // // console.log(select, sel);
|
|
|
|
+ // if (!readOnly && select && sel.row !== changeSpreadSheet.getRowCount() - 1) {
|
|
|
|
+ // return false;
|
|
|
|
+ // } else {
|
|
|
|
+ // return true;
|
|
|
|
+ // }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $('#shuliangguize').on('show.bs.modal', function () {
|
|
|
|
+ $('#shuliangguize input[name="data_source"][value="'+ listRule.source +'"]').prop('checked', true);
|
|
|
|
+ $('#shuliangguize input[name="data_rule"]').prop('checked', false);
|
|
|
|
+ for(const r of listRule.rule) {
|
|
|
|
+ $('#shuliangguize input[name="data_rule"][value="' + r +'"]').prop('checked', true);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // 设置原设计数量读取
|
|
|
|
+ $('#setListRule').click(function () {
|
|
|
|
+ const rule = [];
|
|
|
|
+ $('#shuliangguize input[name="data_rule"]:checked').each(function () {
|
|
|
|
+ rule.push($(this).val());
|
|
|
|
+ });
|
|
|
|
+ const newListRule = {
|
|
|
|
+ source: parseInt($('#shuliangguize input[name="data_source"]:checked').val()),
|
|
|
|
+ rule,
|
|
|
|
+ };
|
|
|
|
+ postData(preUrl + '/list/save', { type: 'list_rule', postData: JSON.stringify(newListRule) }, function (result) {
|
|
|
|
+ listRule = newListRule;
|
|
|
|
+ $('#shuliangguize').modal('hide');
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ let changeListData;
|
|
|
|
+ let gclGatherData;
|
|
|
|
+ let dealBillList;
|
|
|
|
+ const billUrl = window.location.pathname.split('/').slice(0, 4).join('/');
|
|
|
|
+ postData(billUrl + '/defaultBills', {}, function (result) {
|
|
|
|
+ gclGatherModel.loadLedgerData(result.bills);
|
|
|
|
+ gclGatherModel.loadPosData(result.pos);
|
|
|
|
+
|
|
|
|
+ gclGatherData = gclGatherModel.gatherGclData();
|
|
|
|
+ gclGatherData = _.filter(gclGatherData, function (item) {
|
|
|
|
+ return item.leafXmjs && item.leafXmjs.length !== 0;
|
|
|
|
+ });
|
|
|
|
+ // 数组去重
|
|
|
|
+ dealBillList = result.dealBills;
|
|
|
|
+ changeListData = gclGatherData;
|
|
|
|
+ console.log(changeListData, dealBillList);
|
|
|
|
+
|
|
|
|
+ SpreadJsObj.initSpreadSettingEvents(changeSpreadSetting, changeCol);
|
|
|
|
+ SpreadJsObj.initSheet(changeSpreadSheet, changeSpreadSetting);
|
|
|
|
+ SpreadJsObj.loadSheetData(changeSpreadSheet, SpreadJsObj.DataType.Data, changeList);
|
|
|
|
+ changeSpreadObj.makeSjsFooter();
|
|
|
|
+ });
|
|
});
|
|
});
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -211,3 +600,23 @@ function validateFiles(files) {
|
|
return true
|
|
return true
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+function findDecimal(unit) {
|
|
|
|
+ let value = precision.other.value;
|
|
|
|
+ const changeUnits = precision;
|
|
|
|
+ for (const d in changeUnits) {
|
|
|
|
+ if (changeUnits[d].unit !== undefined && changeUnits[d].unit === unit) {
|
|
|
|
+ value = changeUnits[d].value;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return value;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const is_numeric = (value) => {
|
|
|
|
+ if (typeof(value) === 'object') {
|
|
|
|
+ return false;
|
|
|
|
+ } else {
|
|
|
|
+ return !Number.isNaN(Number(value)) && value.toString().trim() !== '';
|
|
|
|
+ }
|
|
|
|
+};
|