|
@@ -1251,7 +1251,6 @@ $(document).ready(() => {
|
|
|
$('#showPage').show();
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
// 上传附件
|
|
|
$('#upload-file-btn').click(function () {
|
|
|
const file = $('#upload-file')[0];
|
|
@@ -1274,7 +1273,7 @@ $(document).ready(() => {
|
|
|
formData.append('lid', node.id);
|
|
|
formData.append('size', filesize);
|
|
|
formData.append('file', file.files[0]);
|
|
|
- postDataWithFile('/tender/' + tender.id + '/measure/stage/' + tender.ledger_times + '/upload/file', formData, function (data) {
|
|
|
+ postDataWithFile('/tender/' + tender.id + '/measure/stage/' + stage.order + '/upload/file', formData, function (data) {
|
|
|
$('#upload').modal('hide');
|
|
|
// 插入到attData中
|
|
|
attData.unshift(data);
|
|
@@ -1300,9 +1299,9 @@ $(document).ready(() => {
|
|
|
$('#show-att').show();
|
|
|
if (att !== undefined) {
|
|
|
$('#show-att tr').eq(0).children('td').text(att.filename + att.fileext);
|
|
|
- const name = att.code !== null && att.code !== '' ? att.code : att.b_code;
|
|
|
- $('#show-att tr').eq(1).children('td').text(name + ' ' + att.lname);
|
|
|
- $('#show-att tr').eq(2).find('a').attr('href', '/tender/' + tender.id + '/measure/stage/' + tender.ledger_times + '/download/file/' + att.id);
|
|
|
+ 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(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);
|
|
@@ -1344,8 +1343,8 @@ $(document).ready(() => {
|
|
|
});
|
|
|
$('#edit-att .form-group').eq(0).find('input').val(att.filename);
|
|
|
$('#edit-att .form-group').eq(0).find('span').eq(1).text(att.fileext);
|
|
|
- const name = att.code !== null && att.code !== '' ? att.code : att.b_code;
|
|
|
- $('#edit-att .form-group').eq(1).find('input').val(name + ' ' + att.lname);
|
|
|
+ const name = att.code !== null && att.code !== '' ? att.code : (att.b_code !== null ? att.b_code : '');
|
|
|
+ $('#edit-att .form-group').eq(1).find('input').val($.trim(name + ' ' + att.lname));
|
|
|
$('#edit-att .form-group').eq(2).find('input').val(att.in_time);
|
|
|
$('#edit-att .form-group').eq(3).find('input').val(att.remark);
|
|
|
} else if (content === 'cancel') {
|
|
@@ -1367,7 +1366,7 @@ $(document).ready(() => {
|
|
|
formData.append('size', filesize);
|
|
|
formData.append('file', file.files[0]);
|
|
|
}
|
|
|
- postDataWithFile('/tender/' + tender.id + '/measure/stage/' + tender.ledger_times + '/save/file', formData, function (data) {
|
|
|
+ postDataWithFile('/tender/' + tender.id + '/measure/stage/' + stage.order + '/save/file', formData, function (data) {
|
|
|
// 替换到attData中
|
|
|
const att_index = attData.findIndex(function (item) {
|
|
|
return item.id === parseInt(fid);
|
|
@@ -1379,9 +1378,9 @@ $(document).ready(() => {
|
|
|
$('#show-att').show();
|
|
|
$('#edit-att').hide();
|
|
|
$('#show-att tr').eq(0).children('td').text(data.filename + data.fileext);
|
|
|
- const name = data.code !== null && data.code !== '' ? data.code : data.b_code;
|
|
|
- $('#show-att tr').eq(1).children('td').text(name + ' ' + data.lname);
|
|
|
- $('#show-att tr').eq(2).find('a').attr('href', '/tender/' + tender.id + '/measure/stage/' + tender.ledger_times + '/download/file/' + data.id);
|
|
|
+ const name = data.code !== null && data.code !== '' ? data.code : (data.b_code !== null ? data.b_code : '');
|
|
|
+ $('#show-att tr').eq(1).children('td').text($.trim(name + ' ' + data.lname));
|
|
|
+ $('#show-att tr').eq(2).find('a').attr('href', '/tender/' + tender.id + '/measure/stage/' + stage.order + '/download/file/' + data.id);
|
|
|
$('#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);
|
|
@@ -1395,7 +1394,7 @@ $(document).ready(() => {
|
|
|
$('#change-att-btn').val('');
|
|
|
} else if (content === 'del') {
|
|
|
const data = {id: fid};
|
|
|
- postData('/tender/' + tender.id + '/measure/stage/' + tender.ledger_times + '/delete/file', data, function (result) {
|
|
|
+ postData('/tender/' + tender.id + '/measure/stage/' + stage.order + '/delete/file', data, function (result) {
|
|
|
// 删除到attData中
|
|
|
const att_index = attData.findIndex(function (item) {
|
|
|
return item.id === parseInt(fid);
|