+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 导出数据
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/design/billofQuantities/index.vue b/src/views/design/billofQuantities/index.vue
index 4010b73..e428c0d 100644
--- a/src/views/design/billofQuantities/index.vue
+++ b/src/views/design/billofQuantities/index.vue
@@ -163,9 +163,6 @@ const handleTabChange = (tab) => {
getVersionNums(false);
}
};
-onMounted(async () => {
- await getVersionNums();
-});
// 获取版本号
async function getVersionNums(isSheet = true) {
@@ -173,6 +170,7 @@ async function getVersionNums(isSheet = true) {
state.loading.versions = true;
state.error = null;
+ console.log('🚀 ~ handleSheetName ~ currentProject.value?.id:', currentProject.value?.id);
const res = await obtainAllVersionNumbers({
projectId: currentProject.value?.id,
workOrderType: state.work_order_type,
@@ -378,6 +376,32 @@ const downloadTemplate = (type) => {
alert('下载失败,请重试');
}
};
+const resetState = () => {
+ state.tableData = [];
+ state.options = [];
+ state.sheets = [];
+ state.queryForm.versions = '';
+ state.queryForm.sheet = '';
+ state.versionsData = {};
+ state.error = null;
+ isExpandAll.value = true;
+};
+onMounted(async () => {
+ await getVersionNums();
+});
+//监听项目id刷新数据
+const listeningProject = watch(
+ () => currentProject.value?.id,
+ (nid, oid) => {
+ resetState();
+ state.queryForm.projectId = nid;
+ getVersionNums();
+ }
+);
+
+onUnmounted(() => {
+ listeningProject();
+});