|
|
@@ -107,66 +107,6 @@ function initTreeColSettingEvents(setting) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 生成所有附件列表
|
|
|
-function getAllList(currPageNum = 1) {
|
|
|
- // 每页最多几个附件
|
|
|
- const pageCount = 20;
|
|
|
- // 附件总数
|
|
|
- const total = attData.length;
|
|
|
- // 总页数
|
|
|
- const pageNum = Math.ceil(total/pageCount);
|
|
|
- $('#totalPage').text(pageNum);
|
|
|
- $('#currentPage').text(total === 0 ? 0 : currPageNum);
|
|
|
- // 当前页附件内容
|
|
|
- const currPageAttData = attData.slice((currPageNum-1)*pageCount, currPageNum*pageCount);
|
|
|
- currPageFileData = currPageAttData;
|
|
|
- let html = '';
|
|
|
- // '/tender/' + tender.id + '/measure/stage/' + stage.order + '/download/file/' + att.id
|
|
|
- for(const att of currPageAttData) {
|
|
|
- const delHtml = deleteFilePermission && parseInt(cur_uid) === att.uid
|
|
|
- ? `<a class="ml-1 text-danger" href="javascript:void(0)" name="att-delete" file-id="${att.id}"><i class="fa fa-close" title="删除"></i></a>`
|
|
|
- : '';
|
|
|
- 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-10 att-file-name" file-id=${att.id}>${att.filename}${att.fileext}</a>
|
|
|
- <div class="att-file-btn col-2"><a href="/tender/${tender.id}/measure/stage/${stage.order}/download/file/${att.id}" class="pl-0"><i class="fa fa-download"></i></a>${delHtml}</div>
|
|
|
- </div>
|
|
|
- </td><td>${att.username}</td></tr>`
|
|
|
- }
|
|
|
- $('#alllist-table').html(html);
|
|
|
- $('#alllist-table').on('click', 'tr', function() {
|
|
|
- $('#alllist-table tr').removeClass('bg-light')
|
|
|
- $(this).addClass('bg-light')
|
|
|
- });
|
|
|
-}
|
|
|
-// 生成当前节点列表
|
|
|
-function getNodeList(node) {
|
|
|
- let html = '';
|
|
|
- for(const att of attData) {
|
|
|
- if (node === att.lid) {
|
|
|
- const delHtml = deleteFilePermission && parseInt(cur_uid) === att.uid
|
|
|
- ? `<a class="ml-1 text-danger" href="javascript:void(0)" name="att-delete" file-id="${att.id}"><i class="fa fa-close" title="删除"></i></a>`
|
|
|
- : '';
|
|
|
- // 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-10 att-file-name" file-id=${att.id}>${att.filename}${att.fileext}</a>
|
|
|
- <div class="att-file-btn col-2"><a href="/tender/${tender.id}/measure/stage/${stage.order}/download/file/${att.id}" class="pl-0"><i class="fa fa-download"></i></a>${delHtml}</div>
|
|
|
- </div>
|
|
|
- </td><td>${att.username}</td></tr>`
|
|
|
- }
|
|
|
- }
|
|
|
- $('#nodelist-table').html(html);
|
|
|
- $('#nodelist-table').on('click', 'tr', function() {
|
|
|
- $('#nodelist-table tr').removeClass('bg-light');
|
|
|
- $(this).addClass('bg-light');
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
function getGxbyText(data) {
|
|
|
const def = thirdParty.gxby.find(function (x) {
|
|
|
return x.value === data.gxby_status;
|
|
|
@@ -857,9 +797,6 @@ $(document).ready(() => {
|
|
|
};
|
|
|
SpreadJsObj.initSheet(slSpread.getActiveSheet(), ledgerSpreadSetting);
|
|
|
|
|
|
- //初始化所有附件列表
|
|
|
- getAllList();
|
|
|
-
|
|
|
// 初始化 计量单元 Spread
|
|
|
const spSpread = SpreadJsObj.createNewSpread($('#stage-pos')[0]);
|
|
|
const spSheet = spSpread.getActiveSheet();
|
|
|
@@ -1122,6 +1059,7 @@ $(document).ready(() => {
|
|
|
SpreadJsObj.resetTopAndSelect(posSheet);
|
|
|
stagePosSpreadObj.loadCurPosData();
|
|
|
if (posSearch) posSearch.search();
|
|
|
+ stageFile.getCurAttHtml(SpreadJsObj.getSelectObject(billsSheet));
|
|
|
},
|
|
|
selectionChanged: function (e, info) {
|
|
|
if (!info.oldSelections || !info.oldSelections[0] || info.newSelections[0].row !== info.oldSelections[0].row) {
|
|
|
@@ -2251,7 +2189,6 @@ $(document).ready(() => {
|
|
|
}
|
|
|
});
|
|
|
SpreadJsObj.loadSheetData(spSpread.getActiveSheet(), 'data', posData, posReadOnly);
|
|
|
- getNodeList(node.id);
|
|
|
} else {
|
|
|
spSpread.getActiveSheet().zh_setting.readOnly = true;
|
|
|
SpreadJsObj.loadSheetData(spSpread.getActiveSheet(), 'data', [], true);
|
|
|
@@ -2783,6 +2720,12 @@ $(document).ready(() => {
|
|
|
ledgerData = result.ledgerData;
|
|
|
posData = result.posData;
|
|
|
makeShouFang();
|
|
|
+
|
|
|
+ for (const r of attData) {
|
|
|
+ r.node = stageTree.datas.find(x => {return x.id === r.lid});
|
|
|
+ }
|
|
|
+ stageFile.loadDatas(attData);
|
|
|
+ stageFile.getCurAttHtml(SpreadJsObj.getSelectObject(slSheet));
|
|
|
}, null, true);
|
|
|
spSpread.bind(spreadNS.Events.EditEnded, stagePosSpreadObj.editEnded);
|
|
|
spSpread.bind(spreadNS.Events.ClipboardPasting, stagePosSpreadObj.clipboardPasting);
|
|
|
@@ -3971,7 +3914,7 @@ $(document).ready(() => {
|
|
|
const select = SpreadJsObj.getSelectObject(self.spread.getActiveSheet());
|
|
|
if (select && select.source) {
|
|
|
SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), select.source[curIndex-1].id, true);
|
|
|
- stagePosSpreadObj.loadCurPosData();
|
|
|
+ stageTreeSpreadObj.loadRelaData();
|
|
|
if (select.source[curIndex-1].pos_id) {
|
|
|
SpreadJsObj.locateDataBy(spSpread.getActiveSheet(), function(data){ return data.id === select.source[curIndex-1].pos_id});
|
|
|
}
|
|
|
@@ -3983,7 +3926,7 @@ $(document).ready(() => {
|
|
|
if (select && select.source) {
|
|
|
const targetIndex = Math.max(curIndex-1, 1);
|
|
|
SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), select.source[targetIndex-1].id, true);
|
|
|
- stagePosSpreadObj.loadCurPosData();
|
|
|
+ stageTreeSpreadObj.loadRelaData();
|
|
|
$('#im-locate-info')[0].innerText = targetIndex + '/' + select.source.length;
|
|
|
}
|
|
|
});
|
|
|
@@ -3993,7 +3936,7 @@ $(document).ready(() => {
|
|
|
if (select && select.source) {
|
|
|
const targetIndex = Math.min(curIndex+1, select.source.length);
|
|
|
SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), select.source[targetIndex-1].id, true);
|
|
|
- stagePosSpreadObj.loadCurPosData();
|
|
|
+ stageTreeSpreadObj.loadRelaData();
|
|
|
$('#im-locate-info')[0].innerText = targetIndex + '/' + select.source.length;
|
|
|
}
|
|
|
|
|
|
@@ -4581,7 +4524,7 @@ $(document).ready(() => {
|
|
|
|
|
|
SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), changeBills.pos[0].ledger_id, true);
|
|
|
SpreadJsObj.resetTopAndSelect(spSpread.getActiveSheet());
|
|
|
- stagePosSpreadObj.loadCurPosData();
|
|
|
+ stageTreeSpreadObj.loadRelaData();
|
|
|
}
|
|
|
} else if (changeBills.gcl_id) {
|
|
|
const node = stageTree.nodes.find(x => {return x.id === changeBills.gcl_id});
|
|
|
@@ -4589,7 +4532,7 @@ $(document).ready(() => {
|
|
|
|
|
|
SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), node.ledger_id, true);
|
|
|
SpreadJsObj.resetTopAndSelect(spSpread.getActiveSheet());
|
|
|
- stagePosSpreadObj.loadCurPosData();
|
|
|
+ stageTreeSpreadObj.loadRelaData();
|
|
|
const posData = spSpread.getActiveSheet().zh_data;
|
|
|
if (!posData || posData.length === 0) return;
|
|
|
|
|
|
@@ -4615,7 +4558,7 @@ $(document).ready(() => {
|
|
|
if (_.isMatch(cb, b)) {
|
|
|
SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), node.ledger_id);
|
|
|
SpreadJsObj.resetTopAndSelect(spSpread.getActiveSheet());
|
|
|
- stagePosSpreadObj.loadCurPosData();
|
|
|
+ stageTreeSpreadObj.loadRelaData();
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -4877,6 +4820,29 @@ $(document).ready(() => {
|
|
|
}
|
|
|
}
|
|
|
// 展开收起附件
|
|
|
+ const stageFile = $.ledger_att({
|
|
|
+ selector: '#fujian',
|
|
|
+ key: 'id',
|
|
|
+ masterKey: 'lid',
|
|
|
+ uploadUrl: window.location.pathname + '/upload/file',
|
|
|
+ deleteUrl: window.location.pathname + '/delete/file',
|
|
|
+ uploadBigUrl: window.location.pathname + '/file/upload/big',
|
|
|
+ checked: stageComplete,
|
|
|
+ zipName: `${tender.name}-附件.zip`,
|
|
|
+ readOnly: false,
|
|
|
+ bigValid: true,
|
|
|
+ // fileInfo: {
|
|
|
+ // user_name: 'user_name',
|
|
|
+ // user_id: 'uid',
|
|
|
+ // create_time: 'in_time',
|
|
|
+ // },
|
|
|
+ getCurHint: function(node) { return ''; },
|
|
|
+ locate: function (att) {
|
|
|
+ if (!att) return;
|
|
|
+ SpreadJsObj.locateDataBy(slSheet, function(x) { return x.id === att.node.id; });
|
|
|
+ stageFile.getCurAttHtml(att.node);
|
|
|
+ }
|
|
|
+ });
|
|
|
$('a', '.right-nav').bind('click', function () {
|
|
|
//const main = $('#main-view'), tool = $('#tools-view');
|
|
|
const tab = $(this), tabPanel = $(tab.attr('content'));
|
|
|
@@ -4965,10 +4931,6 @@ $(document).ready(() => {
|
|
|
});
|
|
|
searchLedger.spread.refresh();
|
|
|
}
|
|
|
- if (tab.attr('content') === '#fujian') {
|
|
|
- const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
- node && getNodeList(node.id);
|
|
|
- }
|
|
|
if (tab.attr('content') === '#zhongjian') {
|
|
|
if (!detail) {
|
|
|
detail = new Detail($('#detail-spread'));
|
|
|
@@ -5021,43 +4983,6 @@ $(document).ready(() => {
|
|
|
}
|
|
|
$('#showAttachment').hide();
|
|
|
});
|
|
|
- // 上传附件
|
|
|
- $('#upload-file-btn').click(function () {
|
|
|
- const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
- if (!node) return
|
|
|
- const files = $('#upload-file')[0].files;
|
|
|
- const formData = new FormData();
|
|
|
- formData.append('lid', node.id);
|
|
|
- for (const file of files) {
|
|
|
- if (file === undefined) {
|
|
|
- toastr.error('未选择上传文件!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- const filesize = file.size;
|
|
|
- if (filesize > 50 * 1024 * 1024) {
|
|
|
- toastr.error('存在上传文件大小过大!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- const fileext = '.' + file.name.toLowerCase().split('.').splice(-1)[0];
|
|
|
- if (whiteList.indexOf(fileext) === -1) {
|
|
|
- toastr.error('只能上传指定格式的附件!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- formData.append('size', filesize);
|
|
|
- formData.append('file[]', file);
|
|
|
- }
|
|
|
- postDataWithFile('/tender/' + tender.id + '/measure/stage/' + stage.order + '/upload/file', formData, function (data) {
|
|
|
- $('#upload').modal('hide');
|
|
|
- // 插入到attData中
|
|
|
- attData = data.concat(attData);
|
|
|
- // 重新生成List
|
|
|
- getAllList();
|
|
|
- getNodeList(node.id);
|
|
|
- }, function () {
|
|
|
- toastr.error('附件上传失败');
|
|
|
- });
|
|
|
- $('#upload-file').val('');
|
|
|
- });
|
|
|
|
|
|
// 获取附件信息
|
|
|
$('.list-table').on('click', '.att-file-name', function () {
|
|
|
@@ -5105,221 +5030,6 @@ $(document).ready(() => {
|
|
|
toastr.error('附件信息获取失败');
|
|
|
}
|
|
|
});
|
|
|
- // $('body').on('click', '.alllist-table a', handleFileList);
|
|
|
- $('body').on('click', '#btn-att a', function () {
|
|
|
- const content = $(this).attr('content');
|
|
|
- const fid = $('#showAttachment').attr('file-id');
|
|
|
- const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
- if (content === 'edit') {
|
|
|
- $('#btn-att a').eq(3).hide();
|
|
|
- $('#btn-att a').eq(2).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) {
|
|
|
- return item.id === parseInt(fid);
|
|
|
- });
|
|
|
- $('#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 !== 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') {
|
|
|
- $('#show-att').show();
|
|
|
- $('#edit-att').hide();
|
|
|
- $('#btn-att a').eq(3).show();
|
|
|
- $('#btn-att a').eq(2).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);
|
|
|
- formData.append('filename', $('#edit-att .form-group').eq(0).find('input').val());
|
|
|
- formData.append('fileext', $('#edit-att .form-group').eq(0).find('span').eq(1).text());
|
|
|
- formData.append('remark', $('#edit-att .form-group').eq(3).find('input').val());
|
|
|
- const file = $('#change-att-btn')[0];
|
|
|
- if (file.files[0] !== undefined) {
|
|
|
- const filesize = file.files[0].size;
|
|
|
- formData.append('size', filesize);
|
|
|
- formData.append('file', file.files[0]);
|
|
|
- }
|
|
|
- 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);
|
|
|
- });
|
|
|
- attData.splice(att_index, 1, data);
|
|
|
- // 重新生成List
|
|
|
- getAllList(parseInt($('#currentPage').text()));
|
|
|
- getNodeList(node.id);
|
|
|
- $('#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 !== 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);
|
|
|
- $('#btn-att a').eq(3).show();
|
|
|
- $('#btn-att a').eq(2).hide();
|
|
|
- $('#btn-att a').eq(4).hide();
|
|
|
- $('#btn-att a').eq(5).hide();
|
|
|
- }, function () {
|
|
|
- toastr.error('附件上传失败');
|
|
|
- });
|
|
|
- $('#change-att-btn').val('');
|
|
|
- } else if (content === 'del') {
|
|
|
- const att = attData.find(function (item) { return item.id === parseInt(fid); });
|
|
|
- deleteAfterHint(function () {
|
|
|
- const data = {id: fid};
|
|
|
- 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);
|
|
|
- });
|
|
|
- attData.splice(att_index, 1);
|
|
|
- // 重新生成List
|
|
|
-
|
|
|
- if ($('#alllist-table tr').length === 1) {
|
|
|
- getAllList(parseInt($('#currentPage').text()) - 1);
|
|
|
-
|
|
|
- } else {
|
|
|
- getAllList(parseInt($('#currentPage').text()));
|
|
|
- }
|
|
|
- getNodeList(node.id);
|
|
|
- $('#showAttachment').hide();
|
|
|
- $('#showAttachment').attr('file-id', '');
|
|
|
- });
|
|
|
- }, `确认删除附件「${att.filename}」?`);
|
|
|
-
|
|
|
- } else if (content === 'view') {
|
|
|
- const att = attData.find(item => item.id === parseInt(fid));
|
|
|
- window.open(att.viewpath || att.orginpath);
|
|
|
- } 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();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- // 替换附件
|
|
|
- $('#change-att-btn').on('change', function () {
|
|
|
- const file = $('#change-att-btn')[0].files[0];
|
|
|
- const name = file.name;
|
|
|
- const filename = name.substring(0, name.lastIndexOf("."));
|
|
|
- const fileext = name.substr(name.indexOf("."));
|
|
|
- const filesize = file.size;
|
|
|
- if (filesize > 50 * 1024 * 1024) {
|
|
|
- toastr.error('文件大小过大!');
|
|
|
- $('#change-att-btn').val('');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (whiteList.indexOf(fileext) === -1) {
|
|
|
- toastr.error('只能上传指定格式的附件!');
|
|
|
- $('#change-att-btn').val('');
|
|
|
- return false;
|
|
|
- }
|
|
|
- $('#edit-att .form-group').eq(0).find('input').val(filename);
|
|
|
- $('#edit-att .form-group').eq(0).find('span').eq(1).text(fileext);
|
|
|
- });
|
|
|
-
|
|
|
- // 切换页数
|
|
|
- $('.page-select').on('click', function () {
|
|
|
- const totalPageNum = parseInt($('#totalPage').text());
|
|
|
- const lastPageNum = parseInt($('#currentPage').text());
|
|
|
- const status = $(this).attr('content');
|
|
|
- if (status === 'pre' && lastPageNum > 1) {
|
|
|
- getAllList(lastPageNum-1);
|
|
|
- $('#showAttachment').hide();
|
|
|
- $('#syfujian .check-all-file').prop('checked', false)
|
|
|
- } else if (status === 'next' && lastPageNum < totalPageNum) {
|
|
|
- getAllList(lastPageNum+1);
|
|
|
- $('#showAttachment').hide();
|
|
|
- $('#syfujian .check-all-file').prop('checked', false)
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- // 批量下载
|
|
|
- $('#bach-download').click(function() {
|
|
|
- const fileIds = [];
|
|
|
- const type = $(this).attr('type');
|
|
|
- let node = ''
|
|
|
- if (type === 'curr') {
|
|
|
- node = '#nodelist-table .check-file:checked'
|
|
|
- } else {
|
|
|
- node = '#alllist-table .check-file:checked'
|
|
|
- }
|
|
|
- $(node).each(function() {
|
|
|
- const fileId = $(this).attr('file-id');
|
|
|
- fileId && fileIds.push(fileId);
|
|
|
- });
|
|
|
-
|
|
|
- if (fileIds.length) {
|
|
|
- if (fileIds.length > 20) {
|
|
|
- return toastr.warning(`最大允许20个文件(当前${fileIds.length}个)`)
|
|
|
- }
|
|
|
- toastr.success('正在进行压缩文件...', '', { timeOut: 0, extendedTimeOut: 0})
|
|
|
- $(this).attr('disabled', "true")
|
|
|
- const btn = $(this);
|
|
|
-
|
|
|
- const fileArr = [];
|
|
|
- for (const id of fileIds) {
|
|
|
- const fileInfo = _.find(currPageFileData, { id: parseInt(id) });
|
|
|
- fileArr.push({
|
|
|
- url: fileInfo.orginpath, //文件的oss存储路径 (必填)
|
|
|
- name: fileInfo.filename, // 文件名 (可选, 不需要填扩展名)
|
|
|
- foldPath: '' // (可选, 文件在压缩包中的存储路径)
|
|
|
- });
|
|
|
- }
|
|
|
- const packageName = `${tender.name}-计量台账-第${stage.order}期-附件.zip`;
|
|
|
- try {
|
|
|
- zipOss.downloadFromAliOss(fileArr, packageName, btn);
|
|
|
- } catch (e) {
|
|
|
- btn.removeAttr('disabled');
|
|
|
- toastr.clear();
|
|
|
- toastr.error('批量下载失败');
|
|
|
- }
|
|
|
- // postCompressFile(`/tender/${tender.id}/measure/stage/${stage.order}/download/compresse-file`, {fileIds}, function(result) {
|
|
|
- // toastr.clear()
|
|
|
- // toastr.success('压缩文件成功')
|
|
|
- // btn.removeAttr('disabled')
|
|
|
- // const href = window.URL.createObjectURL(result)
|
|
|
- // $('#zipDown').attr('href', href);
|
|
|
- // $('#zipDown').attr('download', `${tender.name}-计量台账-第${stage.order}期-附件.zip`);
|
|
|
- // $("#zipDown")[0].click();
|
|
|
- // }, () => {
|
|
|
- // btn.removeAttr('disabled')
|
|
|
- // toastr.clear()
|
|
|
- // toastr.error('批量下载失败')
|
|
|
- // });
|
|
|
- // const url = `/tender/${tender.id}/measure/stage/${stage.order}/download/compresse-file?fileIds=${JSON.stringify(fileIds)}`;
|
|
|
- // $('#zipDown').attr('href', url);
|
|
|
- // $("#zipDown")[0].click();
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- // 监听附件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) {
|
|
|
@@ -5665,7 +5375,7 @@ $(document).ready(() => {
|
|
|
if (sfInfo) {
|
|
|
const lData = _.find(ledgerData, { id: sfInfo.lid });
|
|
|
SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), lData.ledger_id, true);
|
|
|
- stagePosSpreadObj.loadCurPosData();
|
|
|
+ stageTreeSpreadObj.loadRelaData();
|
|
|
if (sfInfo.pid) {
|
|
|
const posData = _.find(spSpread.getActiveSheet().zh_data, { id: sfInfo.pid });
|
|
|
SpreadJsObj.locateData(spSpread.getActiveSheet(), posData);
|
|
|
@@ -5763,34 +5473,6 @@ $(document).ready(() => {
|
|
|
stageAssistRela.refreshAssistTable();
|
|
|
});
|
|
|
});
|
|
|
- $('body').on('click', 'a[name=att-delete]', function() {
|
|
|
- const fid = this.getAttribute('file-id');
|
|
|
- if (!fid) return;
|
|
|
-
|
|
|
- const att = attData.find(function (item) { return item.id === parseInt(fid); });
|
|
|
- deleteAfterHint(function() {
|
|
|
- const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
- const data = {id: fid};
|
|
|
- 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);
|
|
|
- });
|
|
|
- attData.splice(att_index, 1);
|
|
|
- // 重新生成List
|
|
|
-
|
|
|
- if ($('#alllist-table tr').length === 1) {
|
|
|
- getAllList(parseInt($('#currentPage').text()) - 1);
|
|
|
-
|
|
|
- } else {
|
|
|
- getAllList(parseInt($('#currentPage').text()));
|
|
|
- }
|
|
|
- getNodeList(node.id);
|
|
|
- $('#showAttachment').hide();
|
|
|
- $('#showAttachment').attr('file-id', '');
|
|
|
- });
|
|
|
- }, `确认删除附件「${att.filename}」?`);
|
|
|
- });
|
|
|
});
|
|
|
function makeOneShouFang(sf) {
|
|
|
const lData = _.find(ledgerData, { id: sf.lid });
|