|
@@ -11,7 +11,8 @@ $(document).ready(function() {
|
|
|
{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: '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'},
|
|
{title: '备注', colSpan: '1', rowSpan: '2', field: 'remark', hAlign: 0, width: 120, formatter: '@', cellType: 'ellipsisAutoTip', scrollHeightClass: '.sjs-height-1'},
|
|
|
],
|
|
],
|
|
|
emptyRows: 0,
|
|
emptyRows: 0,
|
|
@@ -83,7 +84,7 @@ $(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'];
|
|
|
|
|
|
|
+ const gdColField = ['type', 'party_a', 'party_b'];
|
|
|
const colMap = {
|
|
const colMap = {
|
|
|
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},
|
|
|
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},
|
|
@@ -151,7 +152,7 @@ $(document).ready(function() {
|
|
|
};
|
|
};
|
|
|
const contractTree = createNewPathTree('revise', treeSetting);
|
|
const contractTree = createNewPathTree('revise', treeSetting);
|
|
|
|
|
|
|
|
- const contractDetail = ['c_code', 'name', 'total_price', 'pay_price', 'debit_price','yf_price', 'sf_price', 'party_a', 'party_a_user', 'party_b', 'party_b_user', 'sign_date', 'address', 'entity', 'bank', 'bank_account', 'remark', 'settle_code', 'create_time'];
|
|
|
|
|
|
|
+ const contractDetail = ['c_code', 'name', 'total_price', 'pay_price', 'debit_price','yf_price', 'sf_price', 'party_a', 'party_a_user', 'party_b', 'party_b_user', 'sign_date', 'address', 'entity', 'bank', 'bank_account', 'remark', 'settle_code', 'tax', 'create_time'];
|
|
|
|
|
|
|
|
// 清单 相关方法&绑定spreadjs事件
|
|
// 清单 相关方法&绑定spreadjs事件
|
|
|
const contractTreeSpreadObj = {
|
|
const contractTreeSpreadObj = {
|
|
@@ -1642,6 +1643,9 @@ $(document).ready(function() {
|
|
|
} else if (c === 'remark') {
|
|
} else if (c === 'remark') {
|
|
|
$('#htdetail_' + c).html('<textarea class="form-control form-control-sm" rows="3">' + node[c] + '</textarea>');
|
|
$('#htdetail_' + c).html('<textarea class="form-control form-control-sm" rows="3">' + node[c] + '</textarea>');
|
|
|
continue;
|
|
continue;
|
|
|
|
|
+ } else if (c === 'tax') {
|
|
|
|
|
+ $('#htdetail_' + c).html('<input type="number" min="0" max="100" step="1" class="form-control form-control-sm" value="' + (node[c] ? node[c] : '') + '">');
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
$('#htdetail_' + c).html('<input type="text" class="form-control form-control-sm" value="' + node[c] + '">');
|
|
$('#htdetail_' + c).html('<input type="text" class="form-control form-control-sm" value="' + node[c] + '">');
|
|
|
}
|
|
}
|
|
@@ -1678,15 +1682,24 @@ $(document).ready(function() {
|
|
|
toastr.warning('合同金额只能输入数字');
|
|
toastr.warning('合同金额只能输入数字');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (data.tax !== '') {
|
|
|
|
|
+ const reg = /^(\d{1,2}|100)$/;
|
|
|
|
|
+ if (!reg.test(data.tax)) {
|
|
|
|
|
+ toastr.warning('税率只能输入0-100之间的整数');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ data.tax = null;
|
|
|
|
|
+ }
|
|
|
if (parseFloat(data.total_price) < node.yf_price) {
|
|
if (parseFloat(data.total_price) < node.yf_price) {
|
|
|
const name = contract_type === contractConst.type.expenses ? '付' : '回';
|
|
const name = contract_type === contractConst.type.expenses ? '付' : '回';
|
|
|
toastr.warning('合同金额不能小于累计应' + name);
|
|
toastr.warning('合同金额不能小于累计应' + name);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (data.party_b === '') {
|
|
|
|
|
- toastr.warning('签订单位(乙方)不能为空');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (data.party_b === '') {
|
|
|
|
|
+ // toastr.warning('签订单位(乙方)不能为空');
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
// 更新至服务器
|
|
// 更新至服务器
|
|
|
postData(window.location.pathname + '/update', {postType: 'update-contract', postData: data}, function (result) {
|
|
postData(window.location.pathname + '/update', {postType: 'update-contract', postData: data}, function (result) {
|
|
|
toastr.success('已编辑成功');
|
|
toastr.success('已编辑成功');
|
|
@@ -2190,13 +2203,16 @@ $(document).ready(function() {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
if (permission_add) {
|
|
if (permission_add) {
|
|
|
|
|
+ const signDate = $('#cons-add input[name="sign_date"]').datepicker().data('datepicker');
|
|
|
$('#cons-add').on('show.bs.modal', function () {
|
|
$('#cons-add').on('show.bs.modal', function () {
|
|
|
$('#cons-add input[name="code"]').val('');
|
|
$('#cons-add input[name="code"]').val('');
|
|
|
$('#cons-add input[name="name"]').val('');
|
|
$('#cons-add input[name="name"]').val('');
|
|
|
$('#cons-add input[name="total_price"]').val('');
|
|
$('#cons-add input[name="total_price"]').val('');
|
|
|
|
|
+ $('#cons-add input[name="party_a"]').val('');
|
|
|
$('#cons-add input[name="party_b"]').val('');
|
|
$('#cons-add input[name="party_b"]').val('');
|
|
|
|
|
+ $('#cons-add input[name="sign_date"]').val('');
|
|
|
|
|
+ signDate.selectDate('');
|
|
|
$('#cons-add textarea[name="remark"]').val('');
|
|
$('#cons-add textarea[name="remark"]').val('');
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -2211,7 +2227,9 @@ $(document).ready(function() {
|
|
|
code: $('#cons-add input[name="code"]').val(),
|
|
code: $('#cons-add input[name="code"]').val(),
|
|
|
name: $('#cons-add input[name="name"]').val(),
|
|
name: $('#cons-add input[name="name"]').val(),
|
|
|
total_price: $('#cons-add input[name="total_price"]').val(),
|
|
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(),
|
|
party_b: $('#cons-add input[name="party_b"]').val(),
|
|
|
|
|
+ sign_date: $('#cons-add input[name="sign_date"]').val(),
|
|
|
remark: $('#cons-add textarea[name="remark"]').val(),
|
|
remark: $('#cons-add textarea[name="remark"]').val(),
|
|
|
type: $('#cons-add select[name="type"]').val(),
|
|
type: $('#cons-add select[name="type"]').val(),
|
|
|
}
|
|
}
|
|
@@ -2232,10 +2250,10 @@ $(document).ready(function() {
|
|
|
toastr.error('合同金额只能输入数字');
|
|
toastr.error('合同金额只能输入数字');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (!data.party_b) {
|
|
|
|
|
- toastr.error('请输入签订单位(乙方)');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (!data.party_b) {
|
|
|
|
|
+ // toastr.error('请输入签订单位(乙方)');
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
console.log(node, data);
|
|
console.log(node, data);
|
|
|
postData(window.location.pathname + '/update', {postType: 'add-contract', postData: { select: node, contract: data }}, function (result) {
|
|
postData(window.location.pathname + '/update', {postType: 'add-contract', postData: { select: node, contract: data }}, function (result) {
|
|
|
const refreshNode = contractTree.loadPostData(result);
|
|
const refreshNode = contractTree.loadPostData(result);
|