合并
This commit is contained in:
@ -16,10 +16,10 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="openTable(true, index)">一键展开</el-button>
|
||||
<el-button type="primary" @click="openTable(index)">{{ isExpandAll ? '一键收起' : '一键展开' }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="openTable(false, index)">一键收起</el-button>
|
||||
<el-button type="success" @click="downloadTemplate(1)">下载模板</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-upload ref="uploadRef" class="upload-demo" :http-request="importExcel" :show-file-list="false">
|
||||
@ -51,15 +51,21 @@
|
||||
<el-option v-for="item in state.options" :key="item.versions" :label="item.versions" :value="item.versions" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="success" @click="downloadTemplate(2)">下载模板</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-upload ref="uploadRef" class="upload-demo" :http-request="importExcel" :show-file-list="false" style="margin-right: 10px">
|
||||
<template #trigger>
|
||||
<el-button type="primary">导入excel</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button v-if="state.versionsData.status == 'draft'" type="primary" con="edit" @click="clickApprovalSheet()">审核</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="state.versionsData.status == 'draft'">
|
||||
<el-button type="primary" con="edit" @click="clickApprovalSheet()">审核</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="state.versionsData.status == 'waiting' || state.versionsData.status == 'finish'">
|
||||
<el-button
|
||||
v-if="state.versionsData.status == 'waiting' || state.versionsData.status == 'finish'"
|
||||
icon="view"
|
||||
@click="lookApprovalFlow()"
|
||||
type="warning"
|
||||
@ -117,6 +123,7 @@ const { proxy } = getCurrentInstance();
|
||||
const { work_order_type } = toRefs(proxy?.useDict('work_order_type'));
|
||||
const tableRef = ref({});
|
||||
console.log(work_order_type);
|
||||
const isExpandAll = ref(true);
|
||||
|
||||
// tableData
|
||||
// 版本号
|
||||
@ -146,6 +153,7 @@ const state = reactive({
|
||||
});
|
||||
// tab切换
|
||||
const handleTabChange = (tab) => {
|
||||
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('下载失败,请重试');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.billof-quantities {
|
||||
|
Reference in New Issue
Block a user