|
@@ -403,20 +403,20 @@ $(document).ready(function() {
|
|
|
if (node.settle_code) {
|
|
if (node.settle_code) {
|
|
|
$('#add_contract_supplement_btn').hide();
|
|
$('#add_contract_supplement_btn').hide();
|
|
|
if (need) {
|
|
if (need) {
|
|
|
- $('#htsupplement-table tbody').find('.pay-edit').hide();
|
|
|
|
|
- $('#htsupplement-table tbody').find('.pay-del').hide();
|
|
|
|
|
|
|
+ $('#htsupplement-table tbody').find('.supplement-edit').hide();
|
|
|
|
|
+ $('#htsupplement-table tbody').find('.supplement-del').hide();
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
if ((node.uid === user_id || permission_edit_contract) && (!shenpi_status || (shenpi_status && node.status === auditConst.status.checked))) $('#add_contract_supplement_btn').show();
|
|
if ((node.uid === user_id || permission_edit_contract) && (!shenpi_status || (shenpi_status && node.status === auditConst.status.checked))) $('#add_contract_supplement_btn').show();
|
|
|
if (need && contractSupplements && contractSupplements.length > 0) {
|
|
if (need && contractSupplements && contractSupplements.length > 0) {
|
|
|
for (const [i, cp] of contractSupplements.entries()) {
|
|
for (const [i, cp] of contractSupplements.entries()) {
|
|
|
if (cp.uid === user_id && (!shenpi_status || (shenpi_status && (cp.status === auditConst.status.uncheck || cp.status === auditConst.status.checkNo)))) {
|
|
if (cp.uid === user_id && (!shenpi_status || (shenpi_status && (cp.status === auditConst.status.uncheck || cp.status === auditConst.status.checkNo)))) {
|
|
|
- $('#htsupplement-table tbody tr').eq(i).find('.pay-edit').show();
|
|
|
|
|
- $('#htsupplement-table tbody tr').eq(i).find('.pay-del').show();
|
|
|
|
|
|
|
+ $('#htsupplement-table tbody tr').eq(i).find('.supplement-edit').show();
|
|
|
|
|
+ $('#htsupplement-table tbody tr').eq(i).find('.supplement-del').show();
|
|
|
} else if (shenpi_status && cp.status === auditConst.status.checked && is_admin) {
|
|
} else if (shenpi_status && cp.status === auditConst.status.checked && is_admin) {
|
|
|
- $('#htsupplement-table tbody tr').eq(i).find('.pay-del').show();
|
|
|
|
|
|
|
+ $('#htsupplement-table tbody tr').eq(i).find('.supplement-del').show();
|
|
|
} else if (shenpi_status && (cp.status === auditConst.status.checking || cp.status === auditConst.status.checkNoPre) && cp.curAuditorIds && cp.curAuditorIds.length > 0 && cp.curAuditorIds.indexOf(user_id) !== -1) {
|
|
} else if (shenpi_status && (cp.status === auditConst.status.checking || cp.status === auditConst.status.checkNoPre) && cp.curAuditorIds && cp.curAuditorIds.length > 0 && cp.curAuditorIds.indexOf(user_id) !== -1) {
|
|
|
- $('#htsupplement-table tbody tr').eq(i).find('.pay-edit').show();
|
|
|
|
|
|
|
+ $('#htsupplement-table tbody tr').eq(i).find('.supplement-edit').show();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -431,19 +431,25 @@ $(document).ready(function() {
|
|
|
this.setContractFiles(supplement.files, supplement.cid, supplement.id, '#cons-supplement-file table tbody');
|
|
this.setContractFiles(supplement.files, supplement.cid, supplement.id, '#cons-supplement-file table tbody');
|
|
|
},
|
|
},
|
|
|
checkCloseStatus: function (node) {
|
|
checkCloseStatus: function (node) {
|
|
|
|
|
+ let have_uncheck = false;
|
|
|
if (pay_shenpi_status) {
|
|
if (pay_shenpi_status) {
|
|
|
- let have_uncheck = false;
|
|
|
|
|
for (const pay of contractPays) {
|
|
for (const pay of contractPays) {
|
|
|
if (pay.status !== auditConst.status.checked) {
|
|
if (pay.status !== auditConst.status.checked) {
|
|
|
have_uncheck = true;
|
|
have_uncheck = true;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (have_uncheck) {
|
|
|
|
|
- $('a[href*="#cons-close"]').hide();
|
|
|
|
|
- } else if ((node.uid === user_id || permission_edit_contract) && !node.settle_code) {
|
|
|
|
|
- $('a[href*="#cons-close"]').show();
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!have_uncheck && shenpi_status) {
|
|
|
|
|
+ for (const supplement of contractSupplements) {
|
|
|
|
|
+ if (supplement.status !== auditConst.status.checked) {
|
|
|
|
|
+ have_uncheck = true;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ if (have_uncheck) {
|
|
|
|
|
+ $('a[href*="#cons-close"]').hide();
|
|
|
} else if ((node.uid === user_id || permission_edit_contract) && !node.settle_code) {
|
|
} else if ((node.uid === user_id || permission_edit_contract) && !node.settle_code) {
|
|
|
$('a[href*="#cons-close"]').show();
|
|
$('a[href*="#cons-close"]').show();
|
|
|
}
|
|
}
|
|
@@ -489,7 +495,7 @@ $(document).ready(function() {
|
|
|
}
|
|
}
|
|
|
$('#shenpi_btn').html(shenpi_html);
|
|
$('#shenpi_btn').html(shenpi_html);
|
|
|
if (node.uid === user_id || permission_edit_contract) {
|
|
if (node.uid === user_id || permission_edit_contract) {
|
|
|
- contractTreeSpreadObj.changeContractTab(node);
|
|
|
|
|
|
|
+ contractTreeSpreadObj.changeContractTab(node, true);
|
|
|
} else {
|
|
} else {
|
|
|
$('#edit_contract_btn').hide();
|
|
$('#edit_contract_btn').hide();
|
|
|
$('#save_contract_btn').hide();
|
|
$('#save_contract_btn').hide();
|
|
@@ -515,7 +521,7 @@ $(document).ready(function() {
|
|
|
$('a[href*="#cons-unlock"]').hide();
|
|
$('a[href*="#cons-unlock"]').hide();
|
|
|
contractTreeSpreadObj.checkCloseStatus(node);
|
|
contractTreeSpreadObj.checkCloseStatus(node);
|
|
|
}
|
|
}
|
|
|
- contractTreeSpreadObj.changeContractTab(node);
|
|
|
|
|
|
|
+ contractTreeSpreadObj.changeContractTab(node, true);
|
|
|
} else {
|
|
} else {
|
|
|
$('#edit_contract_btn').hide();
|
|
$('#edit_contract_btn').hide();
|
|
|
$('#save_contract_btn').hide();
|
|
$('#save_contract_btn').hide();
|
|
@@ -621,7 +627,8 @@ $(document).ready(function() {
|
|
|
newSupplements.forEach((supplement, idx) => {
|
|
newSupplements.forEach((supplement, idx) => {
|
|
|
const shenpi_html = setSupplementShenpiHtml(supplement, false, node);
|
|
const shenpi_html = setSupplementShenpiHtml(supplement, false, node);
|
|
|
const operationHtml = `<a href="javascript:void(0);" class="text-primary supplement-edit" data-id="${supplement.id}" ${!supplement.showEdit ? `style="display:none"` : ''}>编辑</a> <a href="javascript:void(0);" class="text-danger supplement-del" data-id="${supplement.id}" ${!supplement.showDel ? `style="display:none"` : ''}>删除</a>`;
|
|
const operationHtml = `<a href="javascript:void(0);" class="text-primary supplement-edit" data-id="${supplement.id}" ${!supplement.showEdit ? `style="display:none"` : ''}>编辑</a> <a href="javascript:void(0);" class="text-danger supplement-del" data-id="${supplement.id}" ${!supplement.showDel ? `style="display:none"` : ''}>删除</a>`;
|
|
|
- supplementsHtml += `<tr class="text-center" data-cpid="${supplement.id}">
|
|
|
|
|
|
|
+ supplementsHtml += `<tr class="text-center" data-csid="${supplement.id}">
|
|
|
|
|
+ <td>${idx + 1}</td>
|
|
|
<td>${supplement.code}</td>
|
|
<td>${supplement.code}</td>
|
|
|
<td>${supplement.name}</td>
|
|
<td>${supplement.name}</td>
|
|
|
<td>${supplement.price}</td>
|
|
<td>${supplement.price}</td>
|
|
@@ -2245,8 +2252,8 @@ $(document).ready(function() {
|
|
|
$('#cons-addsupplement input[name="price"]').val(csInfo ? csInfo.price : '');
|
|
$('#cons-addsupplement input[name="price"]').val(csInfo ? csInfo.price : '');
|
|
|
$('#cons-addsupplement input[name="party_a"]').val(csInfo ? csInfo.party_a : '');
|
|
$('#cons-addsupplement input[name="party_a"]').val(csInfo ? csInfo.party_a : '');
|
|
|
$('#cons-addsupplement input[name="party_b"]').val(csInfo ? csInfo.party_b : '');
|
|
$('#cons-addsupplement input[name="party_b"]').val(csInfo ? csInfo.party_b : '');
|
|
|
- $('#cons-addsupplement input[name="sign_time"]').val(csInfo ? moment(csInfo.sign_time).format('YYYY-MM-DD') : '');
|
|
|
|
|
- signTime.selectDate(csInfo ? new Date(csInfo.sign_time) : '');
|
|
|
|
|
|
|
+ $('#cons-addsupplement input[name="sign_time"]').val(csInfo && csInfo.sign_time ? moment(csInfo.sign_time).format('YYYY-MM-DD') : '');
|
|
|
|
|
+ signTime.selectDate(csInfo && csInfo.sign_time ? new Date(csInfo.sign_time) : '');
|
|
|
$('#cons-addsupplement textarea[name="content"]').val(csInfo ? csInfo.content : '');
|
|
$('#cons-addsupplement textarea[name="content"]').val(csInfo ? csInfo.content : '');
|
|
|
if (only_sf_edit) {
|
|
if (only_sf_edit) {
|
|
|
// 用readOnly
|
|
// 用readOnly
|
|
@@ -2286,7 +2293,7 @@ $(document).ready(function() {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
const csid = $('#cons-supplement-file input[name="csid"]').val();
|
|
const csid = $('#cons-supplement-file input[name="csid"]').val();
|
|
|
- const csInfo = _.find(contractsupplements, { id: parseInt(csid) });
|
|
|
|
|
|
|
+ const csInfo = _.find(contractSupplements, { id: parseInt(csid) });
|
|
|
if (!csInfo) {
|
|
if (!csInfo) {
|
|
|
toastr.warning('请选择补充合同再上传文件');
|
|
toastr.warning('请选择补充合同再上传文件');
|
|
|
$('#cons-supplement-file input[type="file"]').val('');
|
|
$('#cons-supplement-file input[type="file"]').val('');
|