|
@@ -3021,22 +3021,23 @@ $(document).ready(() => {
|
|
|
$('#show-att tr').eq(0).children('td').text(att.filename + att.fileext);
|
|
|
const name = att.code !== null && att.code !== '' ? att.code : (att.b_code !== null ? att.b_code : '');
|
|
|
$('#show-att tr').eq(1).children('td').text($.trim(name + ' ' + att.lname));
|
|
|
- $('#show-att tr').eq(2).find('a').attr('href', '/tender/' + tender.id + '/measure/stage/' + stage.order + '/download/file/' + att.id);
|
|
|
+ // $('#show-att tr').eq(2).find('a').attr('href', '/tender/' + tender.id + '/measure/stage/' + stage.order + '/download/file/' + att.id);
|
|
|
+ $('#show-att tr').eq(2).find('a').attr('href', att.filepath);
|
|
|
$('#show-att tr').eq(3).children('td').eq(0).text(att.username);
|
|
|
$('#show-att tr').eq(3).children('td').eq(1).text(att.in_time);
|
|
|
$('#show-att tr').eq(4).children('td').text(att.remark);
|
|
|
if (parseInt(userID) === att.uid) {
|
|
|
$('#btn-att').show();
|
|
|
- $('#btn-att a').eq(1).show();
|
|
|
- $('#btn-att a').eq(0).hide();
|
|
|
+ $('#btn-att a').eq(3).show();
|
|
|
$('#btn-att a').eq(2).hide();
|
|
|
- $('#btn-att a').eq(3).hide();
|
|
|
+ $('#btn-att a').eq(4).hide();
|
|
|
+ $('#btn-att a').eq(5).hide();
|
|
|
} else {
|
|
|
$('#btn-att').hide();
|
|
|
- $('#btn-att a').eq(1).hide();
|
|
|
- $('#btn-att a').eq(0).hide();
|
|
|
- $('#btn-att a').eq(2).hide();
|
|
|
$('#btn-att a').eq(3).hide();
|
|
|
+ $('#btn-att a').eq(2).hide();
|
|
|
+ $('#btn-att a').eq(4).hide();
|
|
|
+ $('#btn-att a').eq(5).hide();
|
|
|
}
|
|
|
$('#showAttachment').attr('file-id', fid);
|
|
|
$('#showAttachment').show();
|
|
@@ -3051,10 +3052,10 @@ $(document).ready(() => {
|
|
|
const fid = $('#showAttachment').attr('file-id');
|
|
|
const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
if (content === 'edit') {
|
|
|
- $('#btn-att a').eq(1).hide();
|
|
|
- $('#btn-att a').eq(0).show();
|
|
|
+ $('#btn-att a').eq(3).hide();
|
|
|
$('#btn-att a').eq(2).show();
|
|
|
- $('#btn-att a').eq(3).show();
|
|
|
+ $('#btn-att a').eq(4).show();
|
|
|
+ $('#btn-att a').eq(5).show();
|
|
|
$('#show-att').hide();
|
|
|
$('#edit-att').show();
|
|
|
const att = attData.find(function (item) {
|
|
@@ -3069,10 +3070,10 @@ $(document).ready(() => {
|
|
|
} else if (content === 'cancel') {
|
|
|
$('#show-att').show();
|
|
|
$('#edit-att').hide();
|
|
|
- $('#btn-att a').eq(1).show();
|
|
|
- $('#btn-att a').eq(0).hide();
|
|
|
+ $('#btn-att a').eq(3).show();
|
|
|
$('#btn-att a').eq(2).hide();
|
|
|
- $('#btn-att a').eq(3).hide();
|
|
|
+ $('#btn-att a').eq(4).hide();
|
|
|
+ $('#btn-att a').eq(5).hide();
|
|
|
} else if (content === 'save') {
|
|
|
const formData = new FormData();
|
|
|
formData.append('id', fid);
|
|
@@ -3103,10 +3104,10 @@ $(document).ready(() => {
|
|
|
$('#show-att tr').eq(3).children('td').eq(0).text(data.username);
|
|
|
$('#show-att tr').eq(3).children('td').eq(1).text(data.in_time);
|
|
|
$('#show-att tr').eq(4).children('td').text(data.remark);
|
|
|
- $('#btn-att a').eq(1).show();
|
|
|
- $('#btn-att a').eq(0).hide();
|
|
|
+ $('#btn-att a').eq(3).show();
|
|
|
$('#btn-att a').eq(2).hide();
|
|
|
- $('#btn-att a').eq(3).hide();
|
|
|
+ $('#btn-att a').eq(4).hide();
|
|
|
+ $('#btn-att a').eq(5).hide();
|
|
|
}, function () {
|
|
|
toastr.error('附件上传失败');
|
|
|
});
|
|
@@ -3125,6 +3126,19 @@ $(document).ready(() => {
|
|
|
$('#showAttachment').hide();
|
|
|
$('#showAttachment').attr('file-id', '');
|
|
|
});
|
|
|
+ } else if (content === 'view') {
|
|
|
+ const data = {id: fid};
|
|
|
+ postData('/tender/' + tender.id + '/measure/stage/' + stage.order + '/check/file', data, function (result) {
|
|
|
+ const { filepath } = result
|
|
|
+ $('#show-att tr').eq(2).find('a').attr('href', filepath)
|
|
|
+ $('#show-att tr').eq(2).find('a').children('span').eq(0).trigger('click')
|
|
|
+ });
|
|
|
+ } else if (content === 'location') {
|
|
|
+ const att = attData.find(item => item.id === parseInt(fid));
|
|
|
+ if (Object.keys(att).length) {
|
|
|
+ SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), att.ledger_id, true);
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|