|
@@ -101,6 +101,7 @@ $(document).ready(() => {
|
|
|
{title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number', readOnly: 'readOnly.isEdit2', getValue: 'getValue.unit_price'},
|
|
|
{title: '变更部位', colSpan: '1', rowSpan: '2', field: 'bwmx', hAlign: 0, width: 120, formatter: '@', readOnly: 'readOnly.isEdit2'},
|
|
|
{title: '变更详情', colSpan: '1', rowSpan: '2', field: 'detail', hAlign: 0, width: 120, formatter: '@', readOnly: false},
|
|
|
+ {title: '计量上限(%)', colSpan: '1', rowSpan: '2', field: 'delimit', hAlign: 2, width: 60, formatter: '@', readOnly: false, visible: openChangeState},
|
|
|
{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: false, getValue: 'getValue.camount'},
|
|
@@ -197,13 +198,13 @@ $(document).ready(() => {
|
|
|
cSum = 0,
|
|
|
cdSum = 0;
|
|
|
for(var i = 0; i < rowCount - 1; i++){
|
|
|
- oSum = ZhCalc.add(oSum, changeSpreadSheet.getValue(i, 8));
|
|
|
- cSum = ZhCalc.add(cSum, changeSpreadSheet.getValue(i, 10));
|
|
|
- cdSum = ZhCalc.add(cdSum, changeSpreadSheet.getValue(i, 12));
|
|
|
+ oSum = ZhCalc.add(oSum, changeSpreadSheet.getValue(i, startLimit));
|
|
|
+ cSum = ZhCalc.add(cSum, changeSpreadSheet.getValue(i, startLimit + 2));
|
|
|
+ cdSum = ZhCalc.add(cdSum, changeSpreadSheet.getValue(i, startLimit + 4));
|
|
|
}
|
|
|
- changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 8, oSum !== 0 ? oSum : null);
|
|
|
- changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 10, cSum !== 0 ? cSum : null);
|
|
|
- changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 12, cdSum !== 0 ? cdSum : null);
|
|
|
+ changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, startLimit, oSum !== 0 ? oSum : null);
|
|
|
+ changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, startLimit + 2, cSum !== 0 ? cSum : null);
|
|
|
+ changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, startLimit + 4, cdSum !== 0 ? cdSum : null);
|
|
|
},
|
|
|
add: function () {
|
|
|
let select = null;
|
|
@@ -586,7 +587,7 @@ $(document).ready(() => {
|
|
|
for (let iCol = 0; iCol < range.colCount; iCol++) {
|
|
|
const curCol = range.col + iCol;
|
|
|
let colSetting = info.sheet.zh_setting.cols[curCol];
|
|
|
- if ((needColAdd && curCol > 5) || (needCopyIgnore && curCol === 5)) { // 要判断是否已隐藏了变更详情,是则变更详情后面的curCol要+1
|
|
|
+ if ((needColAdd && curCol > 6) || (needCopyIgnore && curCol === 6)) { // 要判断是否已隐藏了变更详情,是则变更详情后面的curCol要+1
|
|
|
const newCurCol = curCol + 1;
|
|
|
needColAdd = true;
|
|
|
colSetting = info.sheet.zh_setting.cols[newCurCol];
|
|
@@ -968,7 +969,7 @@ $(document).ready(() => {
|
|
|
changeSpread.bind(spreadNS.Events.ValueChanged, changeSpreadObj.valueChanged);
|
|
|
changeSpread.bind(spreadNS.Events.ButtonClicked, changeSpreadObj.buttonClicked);
|
|
|
SpreadJsObj.addDeleteBind(changeSpread, changeSpreadObj.deletePress);
|
|
|
- changeSpreadSheet.getCell(-1, 13).foreColor('#dc3545');
|
|
|
+ changeSpreadSheet.getCell(-1, startLimit + 5).foreColor('#dc3545');
|
|
|
const delCommand = {
|
|
|
canUndo: false,
|
|
|
execute: function (context, options, isUndo) {
|
|
@@ -1822,7 +1823,7 @@ $(document).ready(() => {
|
|
|
// 更新至服务器
|
|
|
postData(window.location.pathname + '/save', { type:'info', updateData: changeInfo }, function (result) {
|
|
|
$('.reduction-code').attr('data-code', $('input[name="code"]').val());
|
|
|
- toastr.success(result);
|
|
|
+ toastr.success(result ? result.msg : '');
|
|
|
$('#show-save-btn').hide();
|
|
|
$('#sp-btn').show();
|
|
|
$('.title-main').removeClass('bg-warning');
|
|
@@ -1831,6 +1832,18 @@ $(document).ready(() => {
|
|
|
changeInfo.expr = changeInfo.expr.replace(/[\r\n]/g, '<br>');
|
|
|
changeInfo.memo = changeInfo.memo.replace(/[\r\n]/g, '<br>');
|
|
|
back_changeInfo = Object.assign({}, changeInfo);
|
|
|
+ if (result.changeList) {
|
|
|
+ deLimit = result.deLimit;
|
|
|
+ changeList = result.changeList;
|
|
|
+ SpreadJsObj.initSpreadSettingEvents(changeSpreadSetting, changeCol);
|
|
|
+ SpreadJsObj.initSheet(changeSpreadSheet, changeSpreadSetting);
|
|
|
+ SpreadJsObj.loadSheetData(changeSpreadSheet, SpreadJsObj.DataType.Data, changeList);
|
|
|
+ // SpreadJsObj.reLoadSheetData(changeSpreadSheet);
|
|
|
+ changeSpreadObj.makeSjsFooter();
|
|
|
+ const select = SpreadJsObj.getSelectObject(changeSpreadSheet);
|
|
|
+ changeSpreadObj.resetXmjSpread(select);
|
|
|
+ changeSpreadObj.refreshActn();
|
|
|
+ }
|
|
|
});
|
|
|
return false;
|
|
|
});
|
|
@@ -2235,6 +2248,7 @@ function remakeChangeSpread(cOrder = changeOrder) {
|
|
|
gcl_id,
|
|
|
mx_id,
|
|
|
is_valuation: 1,
|
|
|
+ delimit: deLimit,
|
|
|
};
|
|
|
const radionInfo = changeList.find(function (info) {
|
|
|
//return info.code === code && (info.lid == lid || parseInt(info.lid) === parseInt(lindex)) && gcl_id == info.gcl_id && (info.bwmx === bwmx || (info.bwmx === xmj_jldy && info.mx_id && info.mx_id === mx_id)) && parseInt(info.oamount) === parseInt(oamount);
|
|
@@ -2245,6 +2259,7 @@ function remakeChangeSpread(cOrder = changeOrder) {
|
|
|
trlist.camount_expr = radionInfo.camount_expr;
|
|
|
trlist.detail = radionInfo.detail;
|
|
|
trlist.is_valuation = radionInfo.is_valuation;
|
|
|
+ trlist.delimit = radionInfo.delimit;
|
|
|
}
|
|
|
newTableList.push(trlist);
|
|
|
}
|
|
@@ -2315,6 +2330,7 @@ function changeFormRemake() {
|
|
|
$('#change_form select[name="quality"]').val(changeInfo.quality);
|
|
|
$('#change_form select[name="company"]').val(changeInfo.company);
|
|
|
$('#change_form input[name="charge"][value="'+ changeInfo.charge +'"]').prop('checked', true);
|
|
|
+ $('#change_form input[name="state"][value="'+ changeInfo.state +'"]').prop('checked', true);
|
|
|
$('#change_form input[name="type[]"]').prop('checked', false);
|
|
|
const typecheck = changeInfo.type.split(',');
|
|
|
for (const type of typecheck) {
|