diff --git a/public/billOfQuantities.xlsx b/public/billOfQuantities.xlsx new file mode 100644 index 0000000..0437516 Binary files /dev/null and b/public/billOfQuantities.xlsx differ diff --git a/public/materialsEquipment.xlsx b/public/materialsEquipment.xlsx new file mode 100644 index 0000000..eaa0762 Binary files /dev/null and b/public/materialsEquipment.xlsx differ diff --git a/src/views/design/appointment/index.vue b/src/views/design/appointment/index.vue index 4376db7..54d4f92 100644 --- a/src/views/design/appointment/index.vue +++ b/src/views/design/appointment/index.vue @@ -47,9 +47,9 @@ 专业 设计人员(可多选) - 校审人员(可多选) - 审定人员(可多选) - 审核人员(可多选) + 校审人员 + 审定人员 + 审核人员 @@ -65,7 +65,7 @@ > - + -
+
-
+
-
+
- 一键展开 + {{ isExpandAll ? '一键收起' : '一键展开' }} - 一键收起 + 下载模板 @@ -51,15 +51,21 @@ + + 下载模板 + - 审核 + + + 审核 + + { + isExpandAll.value = true; console.log('tab', tab); state.tableData = []; state.options = []; @@ -305,13 +313,14 @@ function handleChangeVersion(versions) { handleQueryList(); } // 在 openTable 方法中通过索引获取对应的表格实例 -function openTable(flag, index) { +function openTable( index) { + isExpandAll.value = !isExpandAll.value; nextTick(() => { // 通过索引获取当前标签页的表格实例 const currentTable = tableRef.value[index]; console.log(currentTable, index); if (currentTable) { - handleArr(state.tableData, flag, currentTable); + handleArr(state.tableData, isExpandAll.value, currentTable); } }); } @@ -345,6 +354,34 @@ function lookApprovalFlow(row) { } }); } +// 下载模板 +const downloadTemplate = (type) => { + // 导出模版文件 + try { + let linkurl = ''; + let name = ''; + if (type==1) { + linkurl = '/billOfQuantities.xlsx'; + name = '工程量清单模板.xlsx'; + }else{ + linkurl = '/materialsEquipment.xlsx'; + name = '物资设备清单模板.xlsx'; + } + // 创建a标签 + const link = document.createElement('a'); + // 设置PDF文件路径 - 相对于public目录 + link.href = linkurl; + // 设置下载后的文件名 + link.download = name; + // 触发点击 + document.body.appendChild(link); + link.click(); + // 清理 + document.body.removeChild(link); + } catch (error) { + alert('下载失败,请重试'); + } +};