工程量清单的展开和折叠

This commit is contained in:
2025-08-15 18:26:36 +08:00
parent 8cc384cdcb
commit 094a7ba0f0
2 changed files with 12 additions and 14 deletions

View File

@ -5,7 +5,7 @@ VITE_APP_TITLE = 新能源项目管理平台
VITE_APP_ENV = 'development'
# 开发环境
VITE_APP_BASE_API = 'http://192.168.110.180:8899'
VITE_APP_BASE_API = 'http://192.168.110.159:8898'
# 无人机接口地址

View File

@ -70,8 +70,9 @@
:row-class-name="state.tableData.length === 0 ? 'table-null' : ''"
style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)"
row-key="id"
lazy
border
:default-expand-all="state.isOpen"
:default-expand-all="true"
>
<el-table-column prop="num" label="编号" />
<el-table-column prop="name" label="工程或费用名称" />
@ -132,10 +133,6 @@ const state = reactive({
error: null,
// 前三个
tableData: [],
// 物质设备清单
// tableData_sdsqd: [],
// 展开收起
isOpen: true,
// 版本号
versionsData: {}
});
@ -155,7 +152,6 @@ const handleTabChange = (tab) => {
};
onMounted(async () => {
await getVersionNums();
openTable(true, state.work_order_type);
});
// 获取版本号
async function getVersionNums(isSheet = true) {
@ -268,18 +264,19 @@ function importExcel(options) {
if (code == 200) {
proxy.$modal.msgSuccess(res.msg || '导入成功');
// 更新列表
getVersionNums(false);
if (state.work_order_type == 3) {
getVersionNums(false);
}else{
getVersionNums();
}
} else {
getVersionNums();
proxy.$modal.msgError(res.msg || '导入失败');
}
})
.finally(() => {
}).catch(()=>{
proxy.$modal.msgError(res.msg || '导入失败');
}).finally(() => {
state.loading.list = false;
})
.finally(() => {
// loading.close();
});
}
// 切换表名
function handleChange(sheet) {
@ -299,6 +296,7 @@ function openTable(flag, index) {
nextTick(() => {
// 通过索引获取当前标签页的表格实例
const currentTable = tableRef.value[index];
console.log(currentTable, index);
if (currentTable) {
handleArr(state.tableData, flag, currentTable);
}