计划出图
This commit is contained in:
@ -43,7 +43,7 @@
|
||||
class="upload-demo"
|
||||
:http-request="importExcel"
|
||||
style="margin-right: 12px"
|
||||
v-if="Object.keys(state.versionsData).length === 0 || state.versionsData.status == 'cancel' || state.versionsData.status == 'draft'"
|
||||
v-if="Object.keys(state.versionsData).length === 0 || state.versionsData.status == 'cancel'"
|
||||
:show-file-list="false"
|
||||
>
|
||||
<template #trigger>
|
||||
@ -52,9 +52,9 @@
|
||||
</el-upload>
|
||||
<el-button v-if="state.versionsData.status == 'draft'" type="primary" con="edit" @click="clickApprovalSheet()">审核</el-button>
|
||||
<el-button
|
||||
v-if="state.versionsData.status == 'warning' || state.versionsData.status == 'finish'"
|
||||
v-if="state.versionsData.status == 'waiting' || state.versionsData.status == 'finish'"
|
||||
icon="view"
|
||||
@click="lookApprovalSheet()"
|
||||
@click="lookApprovalFlow()"
|
||||
type="warning"
|
||||
>查看流程</el-button
|
||||
>
|
||||
@ -65,6 +65,9 @@
|
||||
v-if="index < 3"
|
||||
:ref="(el) => (tableRef[index] = el)"
|
||||
:data="state.tableData"
|
||||
v-loading="state.loading.list"
|
||||
stripe
|
||||
:row-class-name="state.tableData.length === 0 ? 'table-null' : ''"
|
||||
style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)"
|
||||
row-key="id"
|
||||
border
|
||||
@ -132,7 +135,7 @@ const state = reactive({
|
||||
// 物质设备清单
|
||||
// tableData_sdsqd: [],
|
||||
// 展开收起
|
||||
isOpen: false,
|
||||
isOpen: true,
|
||||
// 版本号
|
||||
versionsData: {}
|
||||
});
|
||||
@ -172,6 +175,10 @@ async function getVersionNums(isSheet = true) {
|
||||
state.options = rows || [];
|
||||
if (state.options.length > 0) {
|
||||
state.queryForm.versions = state.options[0].versions;
|
||||
if (state.work_order_type == 3) {
|
||||
state.versionsData = state.options[0] || [];
|
||||
console.log('state.versionsData', state.versionsData);
|
||||
}
|
||||
// 等待表名加载完成
|
||||
console.log(isSheet, state.sheets.length);
|
||||
if (isSheet) {
|
||||
@ -181,8 +188,7 @@ async function getVersionNums(isSheet = true) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
state.error = `获取版本号失败: 错误码 ${code}`;
|
||||
console.error(state.error);
|
||||
await handleQueryList(isSheet);
|
||||
}
|
||||
} catch (err) {
|
||||
state.error = `获取版本号时发生错误: ${err.message}`;
|
||||
@ -238,9 +244,6 @@ async function handleQueryList(isSheet = true) {
|
||||
const result = await obtainTheList(state.queryForm);
|
||||
|
||||
if (result?.code === 200) {
|
||||
if (state.work_order_type == 3) {
|
||||
state.versionsData = result.data || [];
|
||||
}
|
||||
state.tableData = result.data || [];
|
||||
} else {
|
||||
state.error = `获取列表数据失败: 错误码 ${result?.code}`;
|
||||
@ -256,13 +259,9 @@ async function handleQueryList(isSheet = true) {
|
||||
// 上传excel
|
||||
function importExcel(options) {
|
||||
console.log(options);
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '正在导入,请稍候...',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
let formData = new FormData();
|
||||
formData.append('file', options.file);
|
||||
state.loading.list = true;
|
||||
importExcelFile({ workOrderType: state.work_order_type, projectId: currentProject.value?.id }, formData)
|
||||
.then((res) => {
|
||||
const { code } = res;
|
||||
@ -271,11 +270,15 @@ function importExcel(options) {
|
||||
// 更新列表
|
||||
getVersionNums(false);
|
||||
} else {
|
||||
getVersionNums();
|
||||
proxy.$modal.msgError(res.msg || '导入失败');
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
loading.close();
|
||||
state.loading.list = false;
|
||||
})
|
||||
.finally(() => {
|
||||
// loading.close();
|
||||
});
|
||||
}
|
||||
// 切换表名
|
||||
|
Reference in New Issue
Block a user