|
@@ -8,13 +8,13 @@ $(document).ready(function() {
|
|
|
// 移除所有active类
|
|
// 移除所有active类
|
|
|
$('.bc-bar .nav li a').removeClass('active');
|
|
$('.bc-bar .nav li a').removeClass('active');
|
|
|
$('.tab-content .tab-pane').removeClass('active');
|
|
$('.tab-content .tab-pane').removeClass('active');
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 激活htpay选项卡
|
|
// 激活htpay选项卡
|
|
|
$('.bc-bar .nav li a[href="#htpay"]').addClass('active');
|
|
$('.bc-bar .nav li a[href="#htpay"]').addClass('active');
|
|
|
$('#htpay').addClass('active');
|
|
$('#htpay').addClass('active');
|
|
|
}, 100);
|
|
}, 100);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
let stdXmj;
|
|
let stdXmj;
|
|
|
const ckBillsSpread = '/contract/' + window.location.pathname.split('/')[2] + '/' + contractConst.typeMap[contract_type] + '/detail/contract-billsSelect';
|
|
const ckBillsSpread = '/contract/' + window.location.pathname.split('/')[2] + '/' + contractConst.typeMap[contract_type] + '/detail/contract-billsSelect';
|
|
|
autoFlashHeight();
|
|
autoFlashHeight();
|
|
@@ -25,10 +25,7 @@ $(document).ready(function() {
|
|
|
{title: '项目名称/合同名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 360, formatter: '@', readOnly: 'readOnly.code', wordWrap: true},
|
|
{title: '项目名称/合同名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 360, formatter: '@', readOnly: 'readOnly.code', wordWrap: true},
|
|
|
{title: '创建人', colSpan: '1', rowSpan: '2', field: 'username', hAlign: 1, width: 80, formatter: '@', readOnly: true},
|
|
{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},
|
|
{title: '合同金额', colSpan: '1', rowSpan: '2', field: 'total_price', hAlign: 2, width: 120, formatter: '@', readOnly: true},
|
|
|
- {title: '合同类型', colSpan: '1', rowSpan: '2', field: 'type', hAlign: 0, width: 120, readOnly: 'readOnly.type', cellType: 'customizeCombo', comboItems: types, cellTypeKey: 1},
|
|
|
|
|
{title: '合同状态', colSpan: '1', rowSpan: '2', field: 'status', hAlign: 1, width: 100, formatter: '@', readOnly: true, getValue:'getValue.status', foreColor:'foreColor.status'},
|
|
{title: '合同状态', colSpan: '1', rowSpan: '2', field: 'status', hAlign: 1, width: 100, formatter: '@', readOnly: true, getValue:'getValue.status', foreColor:'foreColor.status'},
|
|
|
- {title: '甲方', colSpan: '1', rowSpan: '2', field: 'party_a', hAlign: 1, width: 80, formatter: '@', readOnly: true},
|
|
|
|
|
- {title: '乙方', colSpan: '1', rowSpan: '2', field: 'party_b', hAlign: 1, width: 80, formatter: '@', readOnly: true},
|
|
|
|
|
{title: '备注', colSpan: '1', rowSpan: '2', field: 'remark', hAlign: 0, width: 120, formatter: '@', cellType: 'ellipsisAutoTip', scrollHeightClass: '.sjs-height-1'},
|
|
{title: '备注', colSpan: '1', rowSpan: '2', field: 'remark', hAlign: 0, width: 120, formatter: '@', cellType: 'ellipsisAutoTip', scrollHeightClass: '.sjs-height-1'},
|
|
|
],
|
|
],
|
|
|
emptyRows: 0,
|
|
emptyRows: 0,
|
|
@@ -103,7 +100,6 @@ $(document).ready(function() {
|
|
|
return data.c_code && data.status ? auditConst.auditClassColor[data.status] : '';
|
|
return data.c_code && data.status ? auditConst.auditClassColor[data.status] : '';
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
- const gdColField = ['type', 'party_a', 'party_b'];
|
|
|
|
|
const settlePriceEnabled = !!_.find(colSet, { field: 'settle_price', show: 1 });
|
|
const settlePriceEnabled = !!_.find(colSet, { field: 'settle_price', show: 1 });
|
|
|
const getContractPayLimit = function (node) {
|
|
const getContractPayLimit = function (node) {
|
|
|
const useSettlePrice = settlePriceEnabled && parseFloat(node.settle_price) !== 0;
|
|
const useSettlePrice = settlePriceEnabled && parseFloat(node.settle_price) !== 0;
|
|
@@ -113,6 +109,9 @@ $(document).ready(function() {
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
const colMap = {
|
|
const colMap = {
|
|
|
|
|
+ type: {title: '合同类型', colSpan: '1', rowSpan: '2', field: 'type', hAlign: 0, width: 120, readOnly: 'readOnly.type', cellType: 'customizeCombo', comboItems: types, cellTypeKey: 1},
|
|
|
|
|
+ party_a: {title: '甲方', colSpan: '1', rowSpan: '2', field: 'party_a', hAlign: 1, width: 100, formatter: '@', readOnly: true},
|
|
|
|
|
+ party_b: {title: '乙方', colSpan: '1', rowSpan: '2', field: 'party_b', hAlign: 1, width: 100, formatter: '@', readOnly: true},
|
|
|
yf_price: {title: '累计应付', colSpan: '1', rowSpan: '2', field: 'yf_price', hAlign: 2, width: 120, formatter: '@', readOnly: true},
|
|
yf_price: {title: '累计应付', colSpan: '1', rowSpan: '2', field: 'yf_price', hAlign: 2, width: 120, formatter: '@', readOnly: true},
|
|
|
settle_price: {title: '结算金额', colSpan: '1', rowSpan: '2', field: 'settle_price', hAlign: 2, width: 120, type: 'Number', readOnly: 'readOnly.settlePrice'},
|
|
settle_price: {title: '结算金额', colSpan: '1', rowSpan: '2', field: 'settle_price', hAlign: 2, width: 120, type: 'Number', readOnly: 'readOnly.settlePrice'},
|
|
|
stackedBar: {title: '应付进度', colSpan: '1', rowSpan: '2', formatter: '@', readOnly: true, field: 'stackedBar', hAlign: 0, width: 200, cellType: 'stackedBar', stackedBarCover: true, bc_type: 'grid', getTip: getStackedBarTip, hintNum: true},
|
|
stackedBar: {title: '应付进度', colSpan: '1', rowSpan: '2', formatter: '@', readOnly: true, field: 'stackedBar', hAlign: 0, width: 200, cellType: 'stackedBar', stackedBarCover: true, bc_type: 'grid', getTip: getStackedBarTip, hintNum: true},
|
|
@@ -123,26 +122,50 @@ $(document).ready(function() {
|
|
|
calc: {title: '计算1', colSpan: '1', rowSpan: '2', field: 'calc', hAlign: 2, width: 120, type: 'Number', readOnly: 'readOnly.calc'},
|
|
calc: {title: '计算1', colSpan: '1', rowSpan: '2', field: 'calc', hAlign: 2, width: 120, type: 'Number', readOnly: 'readOnly.calc'},
|
|
|
calc2: {title: '计算2', colSpan: '1', rowSpan: '2', field: 'calc2', hAlign: 2, width: 120, type: 'Number', readOnly: 'readOnly.calc'},
|
|
calc2: {title: '计算2', colSpan: '1', rowSpan: '2', field: 'calc2', hAlign: 2, width: 120, type: 'Number', readOnly: 'readOnly.calc'},
|
|
|
}
|
|
}
|
|
|
|
|
+ const optionalContractColumns = contractColumnOptions.detail.concat(contractColumnOptions.attribute);
|
|
|
|
|
+ optionalContractColumns.forEach(function (item) {
|
|
|
|
|
+ if (colMap[item.field]) return;
|
|
|
|
|
+ const col = {
|
|
|
|
|
+ title: item.name,
|
|
|
|
|
+ colSpan: '1',
|
|
|
|
|
+ rowSpan: '2',
|
|
|
|
|
+ field: item.field,
|
|
|
|
|
+ hAlign: item.type === 'number' ? 2 : 0,
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ formatter: '@',
|
|
|
|
|
+ readOnly: true,
|
|
|
|
|
+ };
|
|
|
|
|
+ if (item.type === 'number') col.type = 'Number';
|
|
|
|
|
+ if (item.source === 'attribute') {
|
|
|
|
|
+ contractCol.getValue[item.field] = function (data) {
|
|
|
|
|
+ if (!data || !data.attribute_json) return '';
|
|
|
|
|
+ try {
|
|
|
|
|
+ const attributes = JSON.parse(data.attribute_json);
|
|
|
|
|
+ return attributes[item.field] === undefined || attributes[item.field] === null ? '' : attributes[item.field];
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ return '';
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ col.getValue = 'getValue.' + item.field;
|
|
|
|
|
+ } else if (item.field === 'df_price') {
|
|
|
|
|
+ contractCol.getValue.df_price = function (data) {
|
|
|
|
|
+ return data ? ZhCalc.sub(data.yf_price, data.sf_price) : '';
|
|
|
|
|
+ };
|
|
|
|
|
+ col.getValue = 'getValue.df_price';
|
|
|
|
|
+ } else if (item.type === 'date') {
|
|
|
|
|
+ contractCol.getValue[item.field] = function (data) {
|
|
|
|
|
+ return data && data[item.field] ? moment(data[item.field]).format('YYYY-MM-DD') : '';
|
|
|
|
|
+ };
|
|
|
|
|
+ col.getValue = 'getValue.' + item.field;
|
|
|
|
|
+ }
|
|
|
|
|
+ colMap[item.field] = col;
|
|
|
|
|
+ });
|
|
|
// 根据 colSet 组装最终显示的列配置
|
|
// 根据 colSet 组装最终显示的列配置
|
|
|
colSet.forEach(col => {
|
|
colSet.forEach(col => {
|
|
|
const colInfo = colMap && colMap[col.field];
|
|
const colInfo = colMap && colMap[col.field];
|
|
|
- if (col.field === 'settle_price') {
|
|
|
|
|
- if (colInfo && col.show) {
|
|
|
|
|
- const totalPriceIndex = contractSpreadSetting.cols.findIndex(c => c.field === 'total_price');
|
|
|
|
|
- contractSpreadSetting.cols.splice(totalPriceIndex + 1, 0, Object.assign({}, colInfo, { title: col.name }));
|
|
|
|
|
- }
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
if (colInfo && col.show) {
|
|
if (colInfo && col.show) {
|
|
|
contractSpreadSetting.cols.push(Object.assign({}, colInfo, { title: (col && col.alias) || col.name }));
|
|
contractSpreadSetting.cols.push(Object.assign({}, colInfo, { title: (col && col.alias) || col.name }));
|
|
|
}
|
|
}
|
|
|
- if (col.gd) {
|
|
|
|
|
- const gdColInfo = gdColField.includes(col.field);
|
|
|
|
|
- if (gdColInfo && !col.show) {
|
|
|
|
|
- const index = contractSpreadSetting.cols.findIndex(c => c.field === col.field);
|
|
|
|
|
- if (index !== -1) contractSpreadSetting.cols.splice(index, 1);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
@@ -673,6 +696,8 @@ $(document).ready(function() {
|
|
|
<td>${pay.yf_price}</td>
|
|
<td>${pay.yf_price}</td>
|
|
|
<td>${pay.sf_price}</td>
|
|
<td>${pay.sf_price}</td>
|
|
|
<td>${pay.pay_type}</td>
|
|
<td>${pay.pay_type}</td>
|
|
|
|
|
+ <td>${pay.kp_price ? pay.kp_price : ''}</td>
|
|
|
|
|
+ <td>${pay.kp_time ? moment(pay.kp_time).format('YYYY-MM-DD') : ''}</td>
|
|
|
<td>${pay.username}</td>
|
|
<td>${pay.username}</td>
|
|
|
<td>${moment(pay.create_time).format('YYYY-MM-DD HH:mm:ss')}</td>
|
|
<td>${moment(pay.create_time).format('YYYY-MM-DD HH:mm:ss')}</td>
|
|
|
<td>${pay.remark}</td>
|
|
<td>${pay.remark}</td>
|
|
@@ -3315,6 +3340,8 @@ $(document).ready(function() {
|
|
|
yf_price: $('#cons-addpay input[name="yf_price"]').val() || 0,
|
|
yf_price: $('#cons-addpay input[name="yf_price"]').val() || 0,
|
|
|
sf_price: $('#cons-addpay input[name="sf_price"]').val() || 0,
|
|
sf_price: $('#cons-addpay input[name="sf_price"]').val() || 0,
|
|
|
pay_type: $('#cons-addpay select[name="pay_type"]').val(),
|
|
pay_type: $('#cons-addpay select[name="pay_type"]').val(),
|
|
|
|
|
+ kp_price: $('#cons-addpay input[name="kp_price"]').val(),
|
|
|
|
|
+ kp_time: $('#cons-addpay input[name="kp_time"]').val(),
|
|
|
remark: $('#cons-addpay textarea[name="remark"]').val(),
|
|
remark: $('#cons-addpay textarea[name="remark"]').val(),
|
|
|
}
|
|
}
|
|
|
const name = contract_type === contractConst.type.expenses ? '付' : '回';
|
|
const name = contract_type === contractConst.type.expenses ? '付' : '回';
|
|
@@ -3370,6 +3397,8 @@ $(document).ready(function() {
|
|
|
yf_price: $('#cons-addpay input[name="yf_price"]').val() || 0,
|
|
yf_price: $('#cons-addpay input[name="yf_price"]').val() || 0,
|
|
|
sf_price: $('#cons-addpay input[name="sf_price"]').val() || 0,
|
|
sf_price: $('#cons-addpay input[name="sf_price"]').val() || 0,
|
|
|
pay_type: $('#cons-addpay select[name="pay_type"]').val(),
|
|
pay_type: $('#cons-addpay select[name="pay_type"]').val(),
|
|
|
|
|
+ kp_price: $('#cons-addpay input[name="kp_price"]').val(),
|
|
|
|
|
+ kp_time: $('#cons-addpay input[name="kp_time"]').val(),
|
|
|
remark: $('#cons-addpay textarea[name="remark"]').val(),
|
|
remark: $('#cons-addpay textarea[name="remark"]').val(),
|
|
|
}
|
|
}
|
|
|
const name = contract_type === contractConst.type.expenses ? '付' : '回';
|
|
const name = contract_type === contractConst.type.expenses ? '付' : '回';
|