|
@@ -7,6 +7,7 @@ $(document).ready(function() {
|
|
|
{title: '编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 100, formatter: '@', readOnly: 'readOnly.code', cellType: 'tree'},
|
|
|
{title: '合同编号', colSpan: '1', rowSpan: '2', field: 'c_code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
|
|
|
{title: '项目名称/合同名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 240, formatter: '@', readOnly: 'readOnly.code'},
|
|
|
+ {title: '创建人', colSpan: '1', rowSpan: '2', field: 'username', hAlign: 1, width: 80, formatter: '@', readOnly: true},
|
|
|
{title: '合同金额', colSpan: '1', rowSpan: '2', field: 'total_price', hAlign: 2, width: 120, formatter: '@', readOnly: true},
|
|
|
],
|
|
|
emptyRows: 0,
|
|
@@ -41,7 +42,12 @@ $(document).ready(function() {
|
|
|
const contractCol = {
|
|
|
getValue: {
|
|
|
status: function (data) {
|
|
|
- return data.c_code ? (data.settle_code ? '已结算' : data.yf_price !== data.total_price ? '履行中' : '已完成') : '';
|
|
|
+ return data.c_code ? (data.settle_code ? '● 已结算' : data.yf_price < data.total_price ? '● 履行中' : '● 已完成') : '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ foreColor: {
|
|
|
+ status: function (data) {
|
|
|
+ return data.c_code ? (data.settle_code ? '#6c757d' : data.yf_price < data.total_price ? '#da9500' : '#28a745') : '';
|
|
|
}
|
|
|
},
|
|
|
readOnly: {
|
|
@@ -60,7 +66,7 @@ $(document).ready(function() {
|
|
|
contractSpreadSetting.cols.push({title: '累计应回', colSpan: '1', rowSpan: '2', field: 'yf_price', hAlign: 2, width: 120, formatter: '@', readOnly: true});
|
|
|
contractSpreadSetting.cols.push({title: '回款进度', colSpan: '1', rowSpan: '2', formatter: '@', readOnly: true, field: 'stackedBar', hAlign: 0, width: 200, cellType: 'stackedBar', stackedBarCover: true, bc_type: 'grid', getTip: getStackedBarTip});
|
|
|
}
|
|
|
- contractSpreadSetting.cols.push({title: '合同状态', colSpan: '1', rowSpan: '2', field: 'status', hAlign: 1, width: 100, formatter: '@', readOnly: true, getValue:'getValue.status'});
|
|
|
+ contractSpreadSetting.cols.push({title: '合同状态', colSpan: '1', rowSpan: '2', field: 'status', hAlign: 1, width: 100, formatter: '@', readOnly: true, getValue:'getValue.status', foreColor:'foreColor.status'});
|
|
|
contractSpreadSetting.cols.push({title: '备注', colSpan: '1', rowSpan: '2', field: 'remark', hAlign: 0, width: 120, formatter: '@', readOnly: !permission_edit, cellType: 'ellipsisAutoTip', scrollHeightClass: '.sjs-height-1'});
|
|
|
|
|
|
const contractSpread = SpreadJsObj.createNewSpread($('#contract-spread')[0]);
|
|
@@ -121,6 +127,27 @@ $(document).ready(function() {
|
|
|
}
|
|
|
return [tree, node, count];
|
|
|
},
|
|
|
+ // setAllForeColor: function (sheet) {
|
|
|
+ // for(var i = 0; i < sheet.zh_tree.nodes.length; i++){
|
|
|
+ // if (!sheet.zh_tree.nodes[i].c_code) continue;
|
|
|
+ // const value = contractCol.getValue.status(sheet.zh_tree.nodes[i]);
|
|
|
+ // console.log(i, value);
|
|
|
+ // this.setForeColor(sheet, i, value);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // setForeColor: function (sheet, row, value = null, col = 7, color = '') {
|
|
|
+ // value = value !== null ? value : sheet.getValue(row, col);
|
|
|
+ // if (!value) return;
|
|
|
+ // if (value === '已结算') {
|
|
|
+ // color = '#6c757d';
|
|
|
+ // } else if (value === '已完成') {
|
|
|
+ // color = '#28a745';
|
|
|
+ // } else if (value === '履行中') {
|
|
|
+ // color = '#da9500';
|
|
|
+ // }
|
|
|
+ // console.log(sheet.getCell(row, col).text(), color);
|
|
|
+ // sheet.getCell(row, col).foreColor(color);
|
|
|
+ // },
|
|
|
/**
|
|
|
* 刷新顶部按钮是否可用
|
|
|
* @param sheet
|
|
@@ -1376,6 +1403,7 @@ $(document).ready(function() {
|
|
|
SpreadJsObj.loadTopAndSelect(contractSheet, ckBillsSpread);
|
|
|
checkShowLast(result.contractTree.length);
|
|
|
contractTreeSpreadObj.refreshOperationValid(contractSheet);
|
|
|
+ // contractTreeSpreadObj.setAllForeColor(contractSheet);
|
|
|
console.log(contractTree);
|
|
|
});
|
|
|
|
|
@@ -1731,6 +1759,10 @@ $(document).ready(function() {
|
|
|
const refreshNode = contractTree.loadPostData(result.node);
|
|
|
contractTreeSpreadObj.refreshTree(contractSheet, refreshNode);
|
|
|
contractTreeSpreadObj.setContractPays(result.pays, node);
|
|
|
+ // const selection = contractSheet.getSelections();
|
|
|
+ // const sel = selection ? selection[0] : contractSheet.getSelections()[0];
|
|
|
+ // const row = sel ? sel.row : -1;
|
|
|
+ // contractTreeSpreadObj.setForeColor(contractSheet, row);
|
|
|
$('#cons-addpay').modal('hide');
|
|
|
})
|
|
|
});
|
|
@@ -1792,6 +1824,10 @@ $(document).ready(function() {
|
|
|
const refreshNode = contractTree.loadPostData(result.node);
|
|
|
contractTreeSpreadObj.refreshTree(contractSheet, refreshNode);
|
|
|
contractTreeSpreadObj.setContractPays(result.pays, node);
|
|
|
+ // const selection = contractSheet.getSelections();
|
|
|
+ // const sel = selection ? selection[0] : contractSheet.getSelections()[0];
|
|
|
+ // const row = sel ? sel.row : -1;
|
|
|
+ // contractTreeSpreadObj.setForeColor(contractSheet, row);
|
|
|
$('#cons-addpay').modal('hide');
|
|
|
})
|
|
|
});
|
|
@@ -1861,6 +1897,10 @@ $(document).ready(function() {
|
|
|
contractTreeSpreadObj.refreshTree(contractSheet, refreshNode);
|
|
|
const newNode = SpreadJsObj.getSelectObject(contractSheet);
|
|
|
contractTreeSpreadObj.changeContractTab(newNode, true);
|
|
|
+ // const selection = contractSheet.getSelections();
|
|
|
+ // const sel = selection ? selection[0] : contractSheet.getSelections()[0];
|
|
|
+ // const row = sel ? sel.row : -1;
|
|
|
+ // contractTreeSpreadObj.setForeColor(contractSheet, row);
|
|
|
$('#cons-close').modal('hide');
|
|
|
$('a[href*="#cons-unlock"]').show();
|
|
|
$('a[href*="#cons-close"]').hide();
|
|
@@ -1883,6 +1923,10 @@ $(document).ready(function() {
|
|
|
contractTreeSpreadObj.refreshTree(contractSheet, refreshNode);
|
|
|
const newNode = SpreadJsObj.getSelectObject(contractSheet);
|
|
|
contractTreeSpreadObj.changeContractTab(newNode, true);
|
|
|
+ // const selection = contractSheet.getSelections();
|
|
|
+ // const sel = selection ? selection[0] : contractSheet.getSelections()[0];
|
|
|
+ // const row = sel ? sel.row : -1;
|
|
|
+ // contractTreeSpreadObj.setForeColor(contractSheet, row);
|
|
|
$('#cons-unlock').modal('hide');
|
|
|
$('a[href*="#cons-unlock"]').hide();
|
|
|
$('a[href*="#cons-close"]').show();
|