|
@@ -315,7 +315,7 @@ $(document).ready(function() {
|
|
|
$('#htpay-table tbody').find('.pay-del').hide();
|
|
|
}
|
|
|
} else {
|
|
|
- $('#add_contract_pay_btn').show();
|
|
|
+ if (node.uid === user_id || permission_add_pay) $('#add_contract_pay_btn').show();
|
|
|
if (need && contractPays && contractPays.length > 0) {
|
|
|
for (const [i, cp] of contractPays.entries()) {
|
|
|
if (cp.uid === user_id) {
|
|
@@ -410,7 +410,7 @@ $(document).ready(function() {
|
|
|
contractTreeSpreadObj.setContractPays(result.pays, node);
|
|
|
contractTreeSpreadObj.setContractFiles(result.files, node.id);
|
|
|
});
|
|
|
- if (node.uid === user_id) {
|
|
|
+ if ((node.uid === user_id || permission_edit_contract)) {
|
|
|
if (node.settle_code) {
|
|
|
$('a[href*="#cons-unlock"]').show();
|
|
|
$('a[href*="#cons-close"]').hide();
|
|
@@ -427,7 +427,11 @@ $(document).ready(function() {
|
|
|
$('a[href*="#cons-close"]').hide();
|
|
|
$('a[href*="#cons-upfile"]').hide();
|
|
|
if (node && node.c_code && $('.bc-bar .nav li .active').attr('href') === '#htfile' && permission_att) $('a[href*="#cons-upfile"]').show();
|
|
|
- $('#add_contract_pay_btn').hide();
|
|
|
+ if (node && node.c_code && $('.bc-bar .nav li .active').attr('href') === '#htpay' && (node.uid === user_id || permission_add_pay)) {
|
|
|
+ $('#add_contract_pay_btn').show();
|
|
|
+ } else {
|
|
|
+ $('#add_contract_pay_btn').hide();
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
$('#htdetail-table').hide();
|
|
@@ -1157,15 +1161,17 @@ $(document).ready(function() {
|
|
|
$('.bc-bar ul li a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
|
|
const node = SpreadJsObj.getSelectObject(contractSheet);
|
|
|
$('a[href*="#cons-upfile"]').hide();
|
|
|
+ $('#add_contract_pay_btn').hide();
|
|
|
if (node && node.c_code) {
|
|
|
if ($('.bc-bar .nav li .active').attr('href') === '#htfile' && permission_att) $('a[href*="#cons-upfile"]').show();
|
|
|
- if (node.uid === user_id) contractTreeSpreadObj.changeContractTab(node, true);
|
|
|
+ if ($('.bc-bar .nav li .active').attr('href') === '#htpay' && !node.settle_code && permission_add_pay) $('#add_contract_pay_btn').show();
|
|
|
+ if ((node.uid === user_id || permission_edit_contract)) contractTreeSpreadObj.changeContractTab(node, true);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$('#edit_contract_btn').on('click', function () {
|
|
|
const node = SpreadJsObj.getSelectObject(contractSheet);
|
|
|
- if (node && node.c_code && node.uid === user_id) {
|
|
|
+ if (node && node.c_code && (node.uid === user_id || permission_edit_contract)) {
|
|
|
$('#edit_contract_btn').hide();
|
|
|
$('#save_contract_btn').show();
|
|
|
$('#cancel_contract_btn').show();
|
|
@@ -1186,7 +1192,7 @@ $(document).ready(function() {
|
|
|
|
|
|
$('#save_contract_btn').on('click', function () {
|
|
|
const node = SpreadJsObj.getSelectObject(contractSheet);
|
|
|
- if (node && node.c_code && node.uid === user_id) {
|
|
|
+ if (node && node.c_code && (node.uid === user_id || permission_edit_contract)) {
|
|
|
const data = {
|
|
|
id: node.id,
|
|
|
};
|
|
@@ -1237,7 +1243,7 @@ $(document).ready(function() {
|
|
|
|
|
|
$('#cancel_contract_btn').on('click', function () {
|
|
|
const node = SpreadJsObj.getSelectObject(contractSheet);
|
|
|
- if (node && node.c_code && node.uid === user_id) {
|
|
|
+ if (node && node.c_code && (node.uid === user_id || permission_edit_contract)) {
|
|
|
$('#edit_contract_btn').show();
|
|
|
$('#save_contract_btn').hide();
|
|
|
$('#cancel_contract_btn').hide();
|
|
@@ -1531,6 +1537,12 @@ $(document).ready(function() {
|
|
|
if (ca && ca.permission_add) {
|
|
|
txt.push('添加合同');
|
|
|
}
|
|
|
+ if (ca && ca.permission_edit_contract) {
|
|
|
+ txt.push('编辑合同');
|
|
|
+ }
|
|
|
+ if (ca && ca.permission_add_pay) {
|
|
|
+ txt.push('添加支付');
|
|
|
+ }
|
|
|
if (ca && ca.permission_show_unit) {
|
|
|
txt.push('查看本单位合同');
|
|
|
}
|
|
@@ -1810,8 +1822,8 @@ $(document).ready(function() {
|
|
|
toastr.error('请选择一个合同节点');
|
|
|
return;
|
|
|
}
|
|
|
- if (node.uid !== user_id) {
|
|
|
- toastr.error('只能添加自己的合同' + contractConst.typeName[contract_type]);
|
|
|
+ if (!(node.uid === user_id || permission_add_pay)) {
|
|
|
+ toastr.error('没有权限添加合同' + contractConst.typeName[contract_type]);
|
|
|
return;
|
|
|
}
|
|
|
if (node.settle_code) {
|
|
@@ -2119,8 +2131,8 @@ $(document).ready(function() {
|
|
|
},
|
|
|
spreadSetting: {
|
|
|
cols: [
|
|
|
- {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true, cellType: 'tree'},
|
|
|
- {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
|
|
|
+ {title: '项目节编号', field: 'code', hAlign: 0, width: 180, formatter: '@', readOnly: true, cellType: 'tree'},
|
|
|
+ {title: '名称', field: 'name', hAlign: 0, width: 200, formatter: '@', readOnly: true},
|
|
|
],
|
|
|
treeCol: 0,
|
|
|
emptyRows: 0,
|