|
@@ -611,7 +611,7 @@ $(document).ready(() => {
|
|
|
if (data.ccid && data.ccid === 1) {
|
|
|
return '#dc3545';
|
|
|
}
|
|
|
- if (data.id && data.lid != 0) {
|
|
|
+ if (data.id && data.lid != 0 && !data.children) {
|
|
|
return '#ffc107';
|
|
|
}
|
|
|
if(data.lid != 0) return;
|
|
@@ -690,16 +690,16 @@ $(document).ready(() => {
|
|
|
},
|
|
|
readOnly: {
|
|
|
isValuation: function (data) {
|
|
|
- return !(!readOnly && data.id && _.findIndex(changeUsedData, { cbid: data.id }) !== -1);
|
|
|
+ return !(!readOnly && ((data.id && _.findIndex(changeUsedData, { cbid: data.id }) !== -1) || (data.children && data.children.length === 1 && _.findIndex(changeUsedData, { cbid: data.children[0].id }) !== -1)));
|
|
|
},
|
|
|
isEdit: function (data) {
|
|
|
return !(!readOnly && data.lid == 0 && data.id && !checkIsSettle(data));
|
|
|
},
|
|
|
isSettle: function (data) {
|
|
|
- return !((!readOnly || shenpiPower) && data.id && !checkIsSettle(data));
|
|
|
+ return !((!readOnly || shenpiPower) && ((data.id && !checkIsSettle(data)) || (data.children && data.children.length === 1 && !checkIsSettle(data.children[0]))));
|
|
|
},
|
|
|
isSettle2: function (data) {
|
|
|
- return !(!readOnly && data.id && !checkIsSettle(data));
|
|
|
+ return !(!readOnly && ((data.id && !checkIsSettle(data)) || (data.children && data.children.length === 1 && !checkIsSettle(data.children[0]))));
|
|
|
}
|
|
|
},
|
|
|
};
|
|
@@ -729,7 +729,7 @@ $(document).ready(() => {
|
|
|
if (!sel) return;
|
|
|
const col = changeSpreadSheet.zh_setting.cols[sel.col];
|
|
|
const data = SpreadJsObj.getSelectObject(changeSpreadSheet);
|
|
|
- if (col && col.field === 'camount' && data && !data.gcl_id) {
|
|
|
+ if (col && col.field === 'camount' && data && (!data.gcl_id || (data.children && data.children.length === 1))) {
|
|
|
if (readOnly) {
|
|
|
$('#camount-expr').val(data.camount_expr ? data.camount_expr : data.camount);
|
|
|
} else {
|
|
@@ -868,10 +868,10 @@ $(document).ready(() => {
|
|
|
for (const cl of changeList) {
|
|
|
const newCl = _.cloneDeep(cl);
|
|
|
if (cl.gcl_id && _.findIndex(newChangeList, { gcl_id: cl.gcl_id }) === -1) {
|
|
|
- delete newCl.id;
|
|
|
- newCl.bwmx = '';
|
|
|
- newCl.detail = '';
|
|
|
- newCl.delimit = null;
|
|
|
+ // delete newCl.id;
|
|
|
+ // newCl.bwmx = '';
|
|
|
+ // newCl.detail = '';
|
|
|
+ // newCl.delimit = null;
|
|
|
newCl.children = [];
|
|
|
newCl.children.push(cl);
|
|
|
if (_.findIndex(changeLedgerList, { id: newCl.gcl_id }) !== -1 || _.findIndex(changePosList, { id: newCl.mx_id }) !== -1) {
|
|
@@ -886,6 +886,10 @@ $(document).ready(() => {
|
|
|
if (_.findIndex(changeLedgerList, { id: newCl.gcl_id }) !== -1 || _.findIndex(changePosList, { id: newCl.mx_id }) !== -1) {
|
|
|
newCl2.ccid = 1;
|
|
|
}
|
|
|
+ delete newCl2.id;
|
|
|
+ newCl2.bwmx = '';
|
|
|
+ newCl2.detail = '';
|
|
|
+ newCl2.delimit = null;
|
|
|
newCl2.children.push(newCl);
|
|
|
}
|
|
|
}
|
|
@@ -1461,11 +1465,19 @@ $(document).ready(() => {
|
|
|
|
|
|
// 更新至服务器
|
|
|
postData(window.location.pathname + '/save', { type:'update', updateData: cInfo }, function (result) {
|
|
|
+ if (select.children && select.children.length === 1) {
|
|
|
+ const child = select.children[0];
|
|
|
+ child[col.field] = validText;
|
|
|
+ }
|
|
|
changeSpreadObj.calcOneSum(select);
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
changeSpreadObj.refreshXmjData();
|
|
|
changeSpreadObj.countSum();
|
|
|
changeSpreadObj.refreshActn();
|
|
|
+ if (info.row === info.sheet.zh_data.length - 1) {
|
|
|
+ const [newChangeList, updateOrderList] = changeSpreadObj.makeNewChangeList();
|
|
|
+ changeSpreadObj.reloadSheet(newChangeList);
|
|
|
+ }
|
|
|
}, function () {
|
|
|
select[col.field] = orgValue;
|
|
|
cInfo[col.field] = orgValue;
|
|
@@ -1644,6 +1656,11 @@ $(document).ready(() => {
|
|
|
// 更新至服务器
|
|
|
postData(window.location.pathname + '/save', { type:'update', updateData: cInfo }, function (result) {
|
|
|
changeSpreadObj.reloadRow(info.sheet, info.row);
|
|
|
+ if (select.children && select.children.length === 1) {
|
|
|
+ const child = select.children[0];
|
|
|
+ child[col.field] = select.is_valuation;
|
|
|
+ changeSpreadObj.refreshXmjData();
|
|
|
+ }
|
|
|
}, function () {
|
|
|
select.is_valuation = info.sheet.getValue(info.row, info.col) ? 1 : 0;
|
|
|
cInfo.is_valuation = select.is_valuation;
|
|
@@ -2071,6 +2088,9 @@ $(document).ready(() => {
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
const billIndex = _.indexOf(changeSpreadSheet.zh_data, node);
|
|
|
node.children = info.sheet.zh_data;
|
|
|
+ if (node.children && node.children.length === 1) {
|
|
|
+ node[col.field] = validText;
|
|
|
+ }
|
|
|
changeSpreadObj.calcOneSum(node);
|
|
|
changeSpreadObj.reloadRow(changeSpreadSheet, billIndex);
|
|
|
changeSpreadObj.countSum();
|
|
@@ -2233,6 +2253,11 @@ $(document).ready(() => {
|
|
|
const node = SpreadJsObj.getSelectObject(changeSpreadSheet);
|
|
|
const billIndex = _.indexOf(changeSpreadSheet.zh_data, node);
|
|
|
node.children = info.sheet.zh_data;
|
|
|
+ if (node.children && node.children.length === 1) {
|
|
|
+ for (const col in data[0]) {
|
|
|
+ node[col] = data[0][col];
|
|
|
+ }
|
|
|
+ }
|
|
|
changeSpreadObj.calcOneSum(node);
|
|
|
changeSpreadObj.reloadRow(changeSpreadSheet, billIndex);
|
|
|
changeSpreadObj.countSum();
|