|
@@ -29,11 +29,14 @@ function loadUpdateDealPays(newPay, fields) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-function makeAttTable(id, attachment) {
|
|
|
|
|
|
+function makeAttTable(payNode) {
|
|
|
|
+ const id = payNode.id, attachment = payNode.attachment;
|
|
let html = '';
|
|
let html = '';
|
|
if (attachment !== null) {
|
|
if (attachment !== null) {
|
|
for (const [index, att] of attachment.entries()) {
|
|
for (const [index, att] of attachment.entries()) {
|
|
- const delhtml = uploadPermission && parseInt(att.uid) === parseInt(userID) ? '<a class="delete-att text-danger" href="javascript:void(0);" data-payid="'+ id +'" data-attindex="'+ index +'" title="删除"><i class="fa fa-remove "></i></a>' : '';
|
|
|
|
|
|
+ const delhtml = !readOnly && uploadPermission && (parseInt(att.uid) === parseInt(userID) || payNode.uid === parseInt(userID) || (payNode.uid === -1 && parseInt(userID) === stage.user_id))
|
|
|
|
+ ? '<a class="delete-att text-danger" href="javascript:void(0);" data-payid="'+ id +'" data-attindex="'+ index +'" title="删除"><i class="fa fa-remove "></i></a>'
|
|
|
|
+ : '';
|
|
html += '<tr><td style="width: 200px">' + att.filename + att.fileext + '</td><td>' + att.username + '</td><td>' + att.in_time + '</td>' +
|
|
html += '<tr><td style="width: 200px">' + att.filename + att.fileext + '</td><td>' + att.username + '</td><td>' + att.in_time + '</td>' +
|
|
'<td><a href="/tender/'+ tender.id + '/measure/stage/' + tender.ledger_times +'/pay/download/file/'+ id +'/'+ index +'" title="下载"><i class="fa fa-download "></i></a> ' +
|
|
'<td><a href="/tender/'+ tender.id + '/measure/stage/' + tender.ledger_times +'/pay/download/file/'+ id +'/'+ index +'" title="下载"><i class="fa fa-download "></i></a> ' +
|
|
delhtml +
|
|
delhtml +
|
|
@@ -88,7 +91,7 @@ $(document).ready(() => {
|
|
pos: SpreadJsObj.getObjPos($('#pay-spread')[0]),
|
|
pos: SpreadJsObj.getObjPos($('#pay-spread')[0]),
|
|
};
|
|
};
|
|
paySpreadSetting.imageClick = function (data) {
|
|
paySpreadSetting.imageClick = function (data) {
|
|
- makeAttTable(data.id, data.attachment);
|
|
|
|
|
|
+ makeAttTable(data);
|
|
$('#file').modal('show');
|
|
$('#file').modal('show');
|
|
};
|
|
};
|
|
paySpreadSetting.getColor = function (sheet, data, col, defaultColor) {
|
|
paySpreadSetting.getColor = function (sheet, data, col, defaultColor) {
|
|
@@ -829,7 +832,7 @@ $(document).ready(() => {
|
|
} else {
|
|
} else {
|
|
select.attachment = data.concat(select.attachment);
|
|
select.attachment = data.concat(select.attachment);
|
|
}
|
|
}
|
|
- makeAttTable(select.id, select.attachment);
|
|
|
|
|
|
+ makeAttTable(select);
|
|
const index = dealPay.indexOf(select);
|
|
const index = dealPay.indexOf(select);
|
|
dealPay.splice(index, 1, select);
|
|
dealPay.splice(index, 1, select);
|
|
SpreadJsObj.reLoadSheetData(paySpread.getActiveSheet());
|
|
SpreadJsObj.reLoadSheetData(paySpread.getActiveSheet());
|
|
@@ -850,7 +853,7 @@ $(document).ready(() => {
|
|
const select = SpreadJsObj.getSelectObject(paySpread.getActiveSheet());
|
|
const select = SpreadJsObj.getSelectObject(paySpread.getActiveSheet());
|
|
postData('/tender/' + tender.id + '/measure/stage/' + tender.ledger_times + '/pay/delete/file', data, function (result) {
|
|
postData('/tender/' + tender.id + '/measure/stage/' + tender.ledger_times + '/pay/delete/file', data, function (result) {
|
|
select.attachment.splice(index, 1);
|
|
select.attachment.splice(index, 1);
|
|
- makeAttTable(id, select.attachment);
|
|
|
|
|
|
+ makeAttTable(select);
|
|
const pay_index = dealPay.indexOf(select);
|
|
const pay_index = dealPay.indexOf(select);
|
|
dealPay.splice(pay_index, 1, select);
|
|
dealPay.splice(pay_index, 1, select);
|
|
SpreadJsObj.reLoadSheetData(paySpread.getActiveSheet());
|
|
SpreadJsObj.reLoadSheetData(paySpread.getActiveSheet());
|