From 06d627bc28e77e1a314d8e35914512d63dbab1bd Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 20 三月 2026 17:14:48 +0800
Subject: [PATCH] fix: 点击取消时将表单子元素全部销毁
---
src/views/productionManagement/productionProcess/index.vue | 96 ++++++++++++++++++++++++++++++++++++++---------
1 files changed, 77 insertions(+), 19 deletions(-)
diff --git a/src/views/productionManagement/productionProcess/index.vue b/src/views/productionManagement/productionProcess/index.vue
index af6bbfa..b99c8d6 100644
--- a/src/views/productionManagement/productionProcess/index.vue
+++ b/src/views/productionManagement/productionProcess/index.vue
@@ -51,9 +51,9 @@
{{ process.status ? '鍚敤' : '鍋滅敤' }}
</el-tag>
<el-tag size="small"
- :type="process.isQuality ? 'warning' : 'info'"
+ :type="process.isQuality == 1 ? 'warning' : 'info'"
style="margin-left: 8px">
- {{ process.isQuality ? '璐ㄦ' : '闈炶川妫�' }}
+ {{ process.isQuality == 1 ? '璐ㄦ' : '闈炶川妫�' }}
</el-tag>
</div>
<span class="param-count">宸ヨ祫瀹氶: 楼{{ process.salaryQuota || 0 }}</span>
@@ -70,7 +70,7 @@
<el-button type="primary"
size="small"
:disabled="!selectedProcess"
- @click="handleSelectParam">
+ @click="openParamDialog">
<el-icon>
<Plus />
</el-icon>閫夋嫨鍙傛暟
@@ -119,8 +119,8 @@
<el-form-item label="鏄惁璐ㄦ"
prop="isQuality">
<el-switch v-model="processForm.isQuality"
- :active-value="true"
- inactive-value="false" />
+ :active-value="1"
+ :inactive-value="0" />
</el-form-item>
<el-form-item label="宸ュ簭鎻忚堪"
prop="remark">
@@ -249,8 +249,8 @@
</el-form-item>
<el-form-item label="鏄惁蹇呭~">
<el-switch v-model="selectedParam.isRequired"
- :active-value="1"
- :inactive-value="0" />
+ :active-value="true"
+ :inactive-value="false" />
</el-form-item>
</el-form>
<el-empty v-else
@@ -313,8 +313,8 @@
<el-form-item label="鏄惁蹇呭~"
prop="isRequired">
<el-switch v-model="editParamForm.isRequired"
- :active-value="1"
- :inactive-value="0" />
+ :active-value="true"
+ :inactive-value="false" />
</el-form-item>
</el-form>
<template #footer>
@@ -368,7 +368,7 @@
no: "",
name: "",
salaryQuota: null,
- isQuality: false,
+ isQuality: 0,
remark: "",
status: true,
});
@@ -418,7 +418,7 @@
minValue: null,
maxValue: null,
sort: 1,
- isRequired: 0,
+ isRequired: false,
tenantId: 1,
});
const editParamRules = {
@@ -562,8 +562,8 @@
label: "鏄惁蹇呭~",
prop: "isRequired",
dataType: "tag",
- formatType: row => (row.isRequired === 1 ? "success" : "info"),
- formatData: row => (row.isRequired === 1 ? "鏄�" : "鍚�"),
+ formatType: row => (row.isRequired === true ? "success" : "info"),
+ formatData: row => (row.isRequired === true ? "鏄�" : "鍚�"),
},
{
label: "鎿嶄綔",
@@ -626,7 +626,7 @@
processForm.no = "";
processForm.name = "";
processForm.salaryQuota = null;
- processForm.isQuality = false;
+ processForm.isQuality = 0;
processForm.remark = "";
processForm.status = true;
processDialogVisible.value = true;
@@ -638,7 +638,7 @@
processForm.no = process.no;
processForm.name = process.name;
processForm.salaryQuota = process.salaryQuota;
- processForm.isQuality = process.isQuality || false;
+ processForm.isQuality = process.isQuality || 0;
processForm.remark = process.remark || "";
processForm.status = process.status;
processDialogVisible.value = true;
@@ -680,6 +680,29 @@
});
}
});
+ };
+ const openParamDialog = () => {
+ paramSearchKeyword.value = "";
+ if (!selectedProcess.value) {
+ ElMessage.warning("璇峰厛閫夋嫨涓�涓伐搴�");
+ return;
+ }
+ // 鑾峰彇鍙�夊弬鏁板垪琛�
+ getBaseParamList({
+ paramName: paramSearchKeyword.value,
+ current: paramPage.current,
+ size: paramPage.size,
+ }).then(res => {
+ if (res.code === 200) {
+ filteredParamList.value = res.data?.records || [];
+ paramPage.total = res.data?.total || 0;
+ } else {
+ ElMessage.error(res.msg || "鏌ヨ澶辫触");
+ }
+ });
+ console.log(filteredParamList.value, "鍙�夊弬鏁板垪琛�");
+ selectedParam.value = null;
+ paramDialogVisible.value = true;
};
// 鍙傛暟鎿嶄綔
@@ -774,7 +797,7 @@
editParamForm.minValue = row.minValue;
editParamForm.maxValue = row.maxValue;
editParamForm.sort = row.sort || 1;
- editParamForm.isRequired = row.isRequired || 0;
+ editParamForm.isRequired = row.isRequired || false;
editParamForm.tenantId = 1;
editParamDialogVisible.value = true;
};
@@ -807,7 +830,7 @@
standardValue: selectedParam.value.standardValue,
minValue: selectedParam.value.minValue,
maxValue: selectedParam.value.maxValue,
- isRequired: selectedParam.value.isRequired || 0,
+ isRequired: selectedParam.value.isRequired || false,
tenantId: 1,
})
.then(() => {
@@ -967,17 +990,52 @@
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
+ min-width: 0;
}
.param-table-wrapper {
flex: 1;
padding: 0 20px 20px;
overflow: auto;
+ min-width: 100%;
}
/* 琛ㄦ牸妯悜婊氬姩 */
- :deep(.el-table) {
- // min-width: 800px;
+ .param-table-wrapper :deep(.el-table) {
+ min-width: 100%;
+ }
+
+ .param-table-wrapper :deep(.el-table__body-wrapper) {
+ overflow-x: auto;
+ }
+
+ .pagination-container {
+ margin-top: 10px;
+ overflow-x: auto;
+ padding-bottom: 8px;
+ }
+
+ .pagination-container .el-pagination {
+ white-space: nowrap;
+ }
+
+ /* 鍝嶅簲寮忚皟鏁� */
+ @media screen and (max-width: 768px) {
+ .pagination-container {
+ font-size: 12px;
+ }
+
+ .pagination-container .el-pagination__sizes {
+ margin-right: 8px;
+ }
+
+ .pagination-container .el-pagination__jump {
+ margin-left: 8px;
+ }
+
+ .pagination-container .el-pagination__page-size {
+ font-size: 12px;
+ }
}
.empty-tip {
--
Gitblit v1.9.3