|
@@ -103,7 +103,7 @@ function initTreeColSettingEvents(setting) {
|
|
// 生成所有附件列表
|
|
// 生成所有附件列表
|
|
function getAllList(currPageNum = 1) {
|
|
function getAllList(currPageNum = 1) {
|
|
// 每页最多几个附件
|
|
// 每页最多几个附件
|
|
- const pageCount = 11;
|
|
|
|
|
|
+ const pageCount = 15;
|
|
// 附件总数
|
|
// 附件总数
|
|
const total = attData.length;
|
|
const total = attData.length;
|
|
// 总页数
|
|
// 总页数
|
|
@@ -113,8 +113,16 @@ function getAllList(currPageNum = 1) {
|
|
// 当前页附件内容
|
|
// 当前页附件内容
|
|
const currPageAttData = attData.slice((currPageNum-1)*pageCount, currPageNum*pageCount);
|
|
const currPageAttData = attData.slice((currPageNum-1)*pageCount, currPageNum*pageCount);
|
|
let html = '';
|
|
let html = '';
|
|
|
|
+ // '/tender/' + tender.id + '/measure/stage/' + stage.order + '/download/file/' + att.id
|
|
for(const att of currPageAttData) {
|
|
for(const att of currPageAttData) {
|
|
- html += '<tr ><td><a href="javascript:void(0)" file-id="'+ att.id +'">'+ att.filename + att.fileext +'</a></td><td>'+ att.username +'</td></tr>';
|
|
|
|
|
|
+ html += `<tr>
|
|
|
|
+ <td width="25"><input type="checkbox" class="check-file" file-id=${att.id}></td>
|
|
|
|
+ <td>
|
|
|
|
+ <div class="d-flex">
|
|
|
|
+ <a href="javascript:void(0)" class="pl-0 col-11 att-file-name" file-id=${att.id}>${att.filename}${att.fileext}</a>
|
|
|
|
+ <a href="/tender/${tender.id}/measure/stage/${stage.order}/download/file/${att.id}" class="col-1 pl-0 att-file-btn"><i class="fa fa-download"></i></a>
|
|
|
|
+ </div>
|
|
|
|
+ </td><td>${att.username}</td></tr>`
|
|
}
|
|
}
|
|
$('#alllist-table').html(html);
|
|
$('#alllist-table').html(html);
|
|
$('#alllist-table').on('click', 'tr', function() {
|
|
$('#alllist-table').on('click', 'tr', function() {
|
|
@@ -127,7 +135,15 @@ function getNodeList(node) {
|
|
let html = '';
|
|
let html = '';
|
|
for(const att of attData) {
|
|
for(const att of attData) {
|
|
if (node === att.lid) {
|
|
if (node === att.lid) {
|
|
- html += '<tr><td><a href="javascript:void(0)" file-id="'+ att.id +'">'+ att.filename + att.fileext +'</a></td><td>'+ att.username +'</td></tr>';
|
|
|
|
|
|
+ // html += '<tr><td><a href="javascript:void(0)" file-id="'+ att.id +'">'+ att.filename + att.fileext +'</a></td><td>'+ att.username +'</td></tr>';
|
|
|
|
+ html += `<tr>
|
|
|
|
+ <td width="25"><input type="checkbox" class="check-file" file-id=${att.id}></td>
|
|
|
|
+ <td>
|
|
|
|
+ <div class="d-flex">
|
|
|
|
+ <a href="javascript:void(0)" class="pl-0 col-11 att-file-name" file-id=${att.id}>${att.filename}${att.fileext}</a>
|
|
|
|
+ <a href="/tender/${tender.id}/measure/stage/${stage.order}/download/file/${att.id}" class="col-1 pl-0 att-file-btn"><i class="fa fa-download"></i></a>
|
|
|
|
+ </div>
|
|
|
|
+ </td><td>${att.username}</td></tr>`
|
|
}
|
|
}
|
|
}
|
|
}
|
|
$('#nodelist-table').html(html);
|
|
$('#nodelist-table').html(html);
|
|
@@ -2484,6 +2500,29 @@ $(document).ready(() => {
|
|
}
|
|
}
|
|
_initModifyDetail() {
|
|
_initModifyDetail() {
|
|
const self = this;
|
|
const self = this;
|
|
|
|
+ // 重置
|
|
|
|
+ $('#reset-detail-ok').click(function () {
|
|
|
|
+ const data = SpreadJsObj.getSelectObject(self.spread.getActiveSheet());
|
|
|
|
+ if (!data.uuid) return;
|
|
|
|
+ const updateData = {
|
|
|
|
+ lid: data.lid, pid: data.pid,
|
|
|
|
+ uuid: data.uuid,
|
|
|
|
+ custom_define: [],
|
|
|
|
+ };
|
|
|
|
+ for (const f of data.custom_define) {
|
|
|
|
+ if (stageIm.resetFields.indexOf(f) >= 0) {
|
|
|
|
+ updateData[f] = null;
|
|
|
|
+ } else {
|
|
|
|
+ updateData.custom_define.push(f);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ updateData.custom_define = updateData.custom_define.join(',');
|
|
|
|
+ $('#reset-detail-modal').modal('hide');
|
|
|
|
+ postData(window.location.pathname + '/detail/save', updateData, function (result) {
|
|
|
|
+ stageIm.loadUpdateDetailData(result);
|
|
|
|
+ self.reLoadDetailData();
|
|
|
|
+ });
|
|
|
|
+ });
|
|
// 编辑
|
|
// 编辑
|
|
$('#edit-detail').click(function () {
|
|
$('#edit-detail').click(function () {
|
|
$(this).hide();
|
|
$(this).hide();
|
|
@@ -2688,11 +2727,7 @@ $(document).ready(() => {
|
|
if (data.uuid) {
|
|
if (data.uuid) {
|
|
updateData.uuid = data.uuid;
|
|
updateData.uuid = data.uuid;
|
|
}
|
|
}
|
|
- if (data.custom_define.indexOf('calc_img') === -1) {
|
|
|
|
- updateData.custom_define = data.custom_define;
|
|
|
|
- updateData.custom_define.push('calc_img');
|
|
|
|
- updateData.custom_define = updateData.custom_define.join(',');
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
updateData.img = canvas.toDataURL('image/png');
|
|
updateData.img = canvas.toDataURL('image/png');
|
|
updateData.imgInfo = itemInfo;
|
|
updateData.imgInfo = itemInfo;
|
|
updateData.calc_img_remark = img_remark;
|
|
updateData.calc_img_remark = img_remark;
|
|
@@ -2776,7 +2811,14 @@ $(document).ready(() => {
|
|
}
|
|
}
|
|
reLoadDetailData() {
|
|
reLoadDetailData() {
|
|
const data = SpreadJsObj.getSelectObject(this.spread.getActiveSheet());
|
|
const data = SpreadJsObj.getSelectObject(this.spread.getActiveSheet());
|
|
|
|
+ $('#reset-detail').hide();
|
|
if (data) {
|
|
if (data) {
|
|
|
|
+ for (const f of data.custom_define) {
|
|
|
|
+ if (stageIm.resetFields.indexOf(f) >= 0) {
|
|
|
|
+ $('#reset-detail').show();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
$('#edit-detail').show();
|
|
$('#edit-detail').show();
|
|
$('#modify-img').show();
|
|
$('#modify-img').show();
|
|
} else {
|
|
} else {
|
|
@@ -3145,7 +3187,7 @@ $(document).ready(() => {
|
|
});
|
|
});
|
|
|
|
|
|
// 获取附件信息
|
|
// 获取附件信息
|
|
- $('body').on('click', '.list-table a', function () {
|
|
|
|
|
|
+ $('.list-table').on('click', '.att-file-name', function () {
|
|
const fid = $(this).attr('file-id');
|
|
const fid = $(this).attr('file-id');
|
|
if ($('#showAttachment').attr('file-id') === fid && !$('#showAttachment').is(":hidden")) {
|
|
if ($('#showAttachment').attr('file-id') === fid && !$('#showAttachment').is(":hidden")) {
|
|
return;
|
|
return;
|
|
@@ -3161,11 +3203,11 @@ $(document).ready(() => {
|
|
$('#show-att tr').eq(0).children('td').text(att.filename + att.fileext);
|
|
$('#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 : '');
|
|
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(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(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);
|
|
|
|
|
|
+ $('#show-att tr').eq(2).children('td').eq(0).text(att.username);
|
|
|
|
+ $('#show-att tr').eq(2).children('td').eq(1).text(att.in_time);
|
|
|
|
+ $('#show-att tr').eq(3).children('td').text(att.remark);
|
|
// 附件uid等于当前用户id, 附件上传本人
|
|
// 附件uid等于当前用户id, 附件上传本人
|
|
if (parseInt(cur_uid) === att.uid) {
|
|
if (parseInt(cur_uid) === att.uid) {
|
|
$('#btn-att').show();
|
|
$('#btn-att').show();
|
|
@@ -3251,7 +3293,7 @@ $(document).ready(() => {
|
|
$('#show-att tr').eq(0).children('td').text(data.filename + data.fileext);
|
|
$('#show-att tr').eq(0).children('td').text(data.filename + data.fileext);
|
|
const name = data.code !== null && data.code !== '' ? data.code : (data.b_code !== null ? data.b_code : '');
|
|
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(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(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(0).text(data.username);
|
|
$('#show-att tr').eq(3).children('td').eq(1).text(data.in_time);
|
|
$('#show-att tr').eq(3).children('td').eq(1).text(data.in_time);
|
|
$('#show-att tr').eq(4).children('td').text(data.remark);
|
|
$('#show-att tr').eq(4).children('td').text(data.remark);
|
|
@@ -3335,6 +3377,57 @@ $(document).ready(() => {
|
|
$('#showAttachment').hide();
|
|
$('#showAttachment').hide();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ // 批量下载
|
|
|
|
+ $('#bach-download').click(function() {
|
|
|
|
+ const fileIds = []
|
|
|
|
+ $('.tab-pane.active .list-table .check-file:checked').each(function() {
|
|
|
|
+ const fileId = $(this).attr('file-id')
|
|
|
|
+ fileId && fileIds.push(fileId)
|
|
|
|
+ })
|
|
|
|
+ console.log('fileIds', fileIds)
|
|
|
|
+
|
|
|
|
+ if (fileIds.length) {
|
|
|
|
+ const url = `/tender/${tender.id}/measure/stage/${stage.order}/download/compresse-file?fileIds=${JSON.stringify(fileIds)}`
|
|
|
|
+ $('#zipDown').attr('href', url)
|
|
|
|
+ $("#zipDown")[0].click()
|
|
|
|
+ // 执行请求
|
|
|
|
+ // postData('/tender/' + tender.id + '/measure/stage/' + stage.order + '/download/compresse-file', { fileIds }, function(data) {
|
|
|
|
+ // console.log(data)
|
|
|
|
+ // })
|
|
|
|
+ // $.ajax({
|
|
|
|
+ // type:"get",
|
|
|
|
+ // // url: '/tender/' + tender.id + '/measure/stage/' + stage.order + '/download/compresse-file',
|
|
|
|
+ // url: `/tender/${tender.id}/measure/stage/${stage.order}/download/compresse-file?fileids=${JSON.stringify(fileids)}`,
|
|
|
|
+ // dataType: 'json',
|
|
|
|
+ // cache: false,
|
|
|
|
+ // // 告诉jQuery不要去设置Content-Type请求头
|
|
|
|
+ // contentType: false,
|
|
|
|
+ // // 告诉jQuery不要去处理发送的数据
|
|
|
|
+ // processData: false,
|
|
|
|
+ // timeout: 60000,
|
|
|
|
+ // })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // 监听附件check是否选中
|
|
|
|
+ $('.list-table').on('click', '.check-file', function() {
|
|
|
|
+ const checkedList = $(this).parents('.list-table').children().find('input:checked')
|
|
|
|
+ const childs = $(this).parents('.list-table').children().length
|
|
|
|
+ const checkBox = $(this).parents('.list-table').parent().find('.check-all-file')
|
|
|
|
+ if (checkedList.length === childs) {
|
|
|
|
+ checkBox.prop("checked", true)
|
|
|
|
+ } else {
|
|
|
|
+ checkBox.prop("checked", false)
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ $('.check-all-file').click(function() {
|
|
|
|
+ const isCheck = $(this).is(':checked')
|
|
|
|
+ $(this).parents('table').find('.list-table').each(function() {
|
|
|
|
+ $(this).find('input:checkbox').prop("checked", isCheck)
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+
|
|
// 显示层次
|
|
// 显示层次
|
|
(function (select, sheet) {
|
|
(function (select, sheet) {
|
|
$(select).click(function () {
|
|
$(select).click(function () {
|