|
|
@@ -11,6 +11,7 @@ $(document).ready(function() {
|
|
|
{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: '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: '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'},
|
|
|
@@ -351,6 +352,11 @@ $(document).ready(function() {
|
|
|
$('#htdetail_' + c).text(node[c] || '');
|
|
|
}
|
|
|
$('#htdetail_df_price').text(ZhCalc.sub(node.yf_price, node.sf_price) || '');
|
|
|
+ const attrInfo = node.attribute_json ? JSON.parse(node.attribute_json) : null;
|
|
|
+ for (const attr of attributeSet) {
|
|
|
+ $('#htdetail_' + attr.field).text(attrInfo && attrInfo[attr.field] ? attrInfo[attr.field] : '');
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
} else if ($('.bc-bar .nav li .active').attr('href') === '#htpay') {
|
|
|
$('#edit_contract_btn').hide();
|
|
|
@@ -553,6 +559,7 @@ $(document).ready(function() {
|
|
|
|
|
|
if (node && node.c_code) {
|
|
|
$('#htdetail-table').show();
|
|
|
+ $('#htdetail-attr').show();
|
|
|
$('#htpay-table').show();
|
|
|
$('#htfile-table').show();
|
|
|
for (const c of contractDetail) {
|
|
|
@@ -565,6 +572,10 @@ $(document).ready(function() {
|
|
|
}
|
|
|
$('#htdetail_' + c).text(node[c] || '');
|
|
|
}
|
|
|
+ const attrInfo = node.attribute_json ? JSON.parse(node.attribute_json) : null;
|
|
|
+ for (const attr of attributeSet) {
|
|
|
+ $('#htdetail_' + attr.field).text(attrInfo && attrInfo[attr.field] ? attrInfo[attr.field] : '');
|
|
|
+ }
|
|
|
$('#htdetail_df_price').text(ZhCalc.sub(node.yf_price, node.sf_price) || '');
|
|
|
if (needPost) {
|
|
|
postData(window.location.pathname + '/update', {postType: 'get-contract', postData: node.id}, function (result) {
|
|
|
@@ -577,6 +588,7 @@ $(document).ready(function() {
|
|
|
}
|
|
|
} else {
|
|
|
$('#htdetail-table').hide();
|
|
|
+ $('#htdetail-attr').hide();
|
|
|
$('#htpay-table').hide();
|
|
|
$('#htfile-table').hide();
|
|
|
$('#edit_contract_btn').hide();
|
|
|
@@ -1147,6 +1159,7 @@ $(document).ready(function() {
|
|
|
}];
|
|
|
if (oldParentNode.children.length === 1) {
|
|
|
oldParentNode.is_leaf = 1;
|
|
|
+ oldParentNode.total_price = null;
|
|
|
data.push({
|
|
|
id: oldParentNode.id,
|
|
|
is_leaf: 1,
|
|
|
@@ -1176,8 +1189,8 @@ $(document).ready(function() {
|
|
|
toastr.success('合同已移动成功');
|
|
|
const refreshNode = contractTree.loadPostData(result);
|
|
|
contractTreeSpreadObj.refreshTree(contractSheet, refreshNode);
|
|
|
- const newNode = SpreadJsObj.getSelectObject(contractSheet);
|
|
|
- contractTreeSpreadObj.changeContractTab(newNode, true);
|
|
|
+ contractTreeSpreadObj.setContract(contractSheet);
|
|
|
+ contractTreeSpreadObj.refreshOperationValid(contractSheet);
|
|
|
$('#cons-move').modal('hide');
|
|
|
});
|
|
|
});
|
|
|
@@ -1267,6 +1280,7 @@ $(document).ready(function() {
|
|
|
}
|
|
|
if (node.children.length === data.length) {
|
|
|
node.is_leaf = 1;
|
|
|
+ node.total_price = null;
|
|
|
data.push({
|
|
|
id: node.id,
|
|
|
is_leaf: 1,
|
|
|
@@ -1297,8 +1311,10 @@ $(document).ready(function() {
|
|
|
toastr.success('合同已移动成功');
|
|
|
const refreshNode = contractTree.loadPostData(result);
|
|
|
contractTreeSpreadObj.refreshTree(contractSheet, refreshNode);
|
|
|
- const newNode = SpreadJsObj.getSelectObject(contractSheet);
|
|
|
- contractTreeSpreadObj.changeContractTab(newNode, true);
|
|
|
+ contractTreeSpreadObj.setContract(contractSheet);
|
|
|
+ contractTreeSpreadObj.refreshOperationValid(contractSheet);
|
|
|
+ // const newNode = SpreadJsObj.getSelectObject(contractSheet);
|
|
|
+ // contractTreeSpreadObj.changeContractTab(newNode, true);
|
|
|
$('#cons-move2').modal('hide');
|
|
|
});
|
|
|
});
|
|
|
@@ -1650,6 +1666,14 @@ $(document).ready(function() {
|
|
|
$('#htdetail_' + c).html('<input type="text" class="form-control form-control-sm" value="' + node[c] + '">');
|
|
|
}
|
|
|
}
|
|
|
+ const attrInfo = node.attribute_json ? JSON.parse(node.attribute_json) : null;
|
|
|
+ for (const attr of attributeSet) {
|
|
|
+ if (attr.type === 'long_text') {
|
|
|
+ $('#htdetail_' + attr.field).html('<textarea class="form-control form-control-sm" rows="3">' + (attrInfo && attrInfo[attr.field] ? attrInfo[attr.field] : '') + '</textarea>');
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ $('#htdetail_' + attr.field).html('<input type="' + attr.type + '" class="form-control form-control-sm" value="' + (attrInfo && attrInfo[attr.field] ? attrInfo[attr.field] : '') + '">');
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -1671,6 +1695,15 @@ $(document).ready(function() {
|
|
|
data[c] = $('#htdetail_' + c + ' input').val();
|
|
|
}
|
|
|
}
|
|
|
+ const attrInfo = node.attribute_json ? JSON.parse(node.attribute_json) : {};
|
|
|
+ for (const attr of attributeSet) {
|
|
|
+ if (attr.type === 'long_text') {
|
|
|
+ attrInfo[attr.field] = $('#htdetail_' + attr.field + ' textarea').val();
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ attrInfo[attr.field] = $('#htdetail_' + attr.field + ' input').val();
|
|
|
+ }
|
|
|
+ data.attribute_json = JSON.stringify(attrInfo);
|
|
|
if (data.c_code === '' || data.name === '') {
|
|
|
toastr.warning('合同编号和合同名称不能为空');
|
|
|
return;
|
|
|
@@ -1726,6 +1759,14 @@ $(document).ready(function() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ const attrInfo = node.attribute_json ? JSON.parse(node.attribute_json) : {};
|
|
|
+ for (const attr of attributeSet) {
|
|
|
+ if (attr.type === 'long_text') {
|
|
|
+ $('#htdetail_' + attr.field).text(attrInfo && attrInfo[attr.field] ? attrInfo[attr.field] : '');
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ $('#htdetail_' + attr.field).text(attrInfo && attrInfo[attr.field] ? attrInfo[attr.field] : '');
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -2229,7 +2270,7 @@ $(document).ready(function() {
|
|
|
total_price: $('#cons-add input[name="total_price"]').val(),
|
|
|
party_a: $('#cons-add input[name="party_a"]').val(),
|
|
|
party_b: $('#cons-add input[name="party_b"]').val(),
|
|
|
- sign_date: $('#cons-add input[name="sign_date"]').val(),
|
|
|
+ sign_date: $('#cons-add input[name="sign_date"]').val() || null,
|
|
|
remark: $('#cons-add textarea[name="remark"]').val(),
|
|
|
type: $('#cons-add select[name="type"]').val(),
|
|
|
}
|