From 8293aa5351afca2e18331bd5ec7731a5bd3af082 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 23 三月 2026 11:48:38 +0800
Subject: [PATCH] 工艺路线默认卡片视图
---
src/views/productionManagement/productionProcess/index.vue | 164 +++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 123 insertions(+), 41 deletions(-)
diff --git a/src/views/productionManagement/productionProcess/index.vue b/src/views/productionManagement/productionProcess/index.vue
index bef5379..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">
@@ -167,7 +167,7 @@
</el-input>
</div>
<el-table :data="filteredParamList"
- height="360"
+ height="300"
border
highlight-current-row
@current-change="handleParamSelect">
@@ -183,6 +183,18 @@
</template>
</el-table-column>
</el-table>
+ <!-- 鍒嗛〉鎺т欢 -->
+ <div class="pagination-container"
+ style="margin-top: 10px;">
+ <el-pagination v-model:current-page="paramPage.current"
+ v-model:page-size="paramPage.size"
+ :page-sizes="[10, 20, 50, 100]"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="paramPage.total"
+ @size-change="handleParamSizeChange"
+ @current-change="handleParamCurrentChange"
+ size="small" />
+ </div>
</div>
<!-- 鍙充晶鍙傛暟璇︽儏 -->
<div class="param-detail-area">
@@ -237,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
@@ -301,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>
@@ -343,11 +355,6 @@
// 鍙傛暟鍒楄〃鏁版嵁
const paramList = ref([]);
const paramLoading = ref(false);
- const paramPage = reactive({
- current: 1,
- size: 10,
- total: 0,
- });
// 鏁版嵁瀛楀吀
const dictTypes = ref([]);
@@ -361,7 +368,7 @@
no: "",
name: "",
salaryQuota: null,
- isQuality: false,
+ isQuality: 0,
remark: "",
status: true,
});
@@ -370,13 +377,11 @@
name: [{ required: true, message: "璇疯緭鍏ュ伐搴忓悕绉�", trigger: "blur" }],
salaryQuota: [
{
- required: true,
+ required: false,
message: "璇疯緭鍏ュ伐璧勫畾棰�",
trigger: "blur",
validator: (rule, value, callback) => {
- if (value === null || value === undefined || value === "") {
- callback(new Error("璇疯緭鍏ュ伐璧勫畾棰�"));
- } else if (isNaN(value) || value < 0) {
+ if (isNaN(value) || value < 0) {
callback(new Error("宸ヨ祫瀹氶蹇呴』鏄潪璐熸暟瀛�"));
} else {
callback();
@@ -393,6 +398,13 @@
const selectedParam = ref(null);
const paramSearchKeyword = ref("");
+ // 鍙�夊弬鏁板垎椤�
+ const paramPage = reactive({
+ current: 1,
+ size: 10,
+ total: 0,
+ });
+
// 缂栬緫鍙傛暟瀵硅瘽妗�
const editParamDialogVisible = ref(false);
const editParamFormRef = ref(null);
@@ -406,7 +418,7 @@
minValue: null,
maxValue: null,
sort: 1,
- isRequired: 0,
+ isRequired: false,
tenantId: 1,
});
const editParamRules = {
@@ -550,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: "鎿嶄綔",
@@ -614,7 +626,7 @@
processForm.no = "";
processForm.name = "";
processForm.salaryQuota = null;
- processForm.isQuality = false;
+ processForm.isQuality = 0;
processForm.remark = "";
processForm.status = true;
processDialogVisible.value = true;
@@ -626,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;
@@ -669,6 +681,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;
+ };
// 鍙傛暟鎿嶄綔
const handleSelectParam = () => {
@@ -677,10 +712,14 @@
return;
}
// 鑾峰彇鍙�夊弬鏁板垪琛�
- getBaseParamList({ paramName: paramSearchKeyword.value }).then(res => {
+ getBaseParamList({
+ paramName: paramSearchKeyword.value,
+ current: paramPage.current,
+ size: paramPage.size,
+ }).then(res => {
if (res.code === 200) {
- filteredParamList.value = res.data || [];
- page.total = res.data?.length || 0;
+ filteredParamList.value = res.data?.records || [];
+ paramPage.total = res.data?.total || 0;
} else {
ElMessage.error(res.msg || "鏌ヨ澶辫触");
}
@@ -695,14 +734,22 @@
};
const handleParamSearch = () => {
- const keyword = paramSearchKeyword.value.trim().toLowerCase();
- if (!keyword) {
- filteredParamList.value = availableParamList.value;
- } else {
- filteredParamList.value = availableParamList.value.filter(item =>
- item.paramName.toLowerCase().includes(keyword)
- );
- }
+ // 閲嶇疆鍒嗛〉
+ paramPage.current = 1;
+ // 閲嶆柊鍔犺浇鏁版嵁
+ handleSelectParam();
+ };
+
+ // 澶勭悊鍒嗛〉澶у皬鍙樺寲
+ const handleParamSizeChange = size => {
+ paramPage.size = size;
+ handleSelectParam();
+ };
+
+ // 澶勭悊褰撳墠椤电爜鍙樺寲
+ const handleParamCurrentChange = current => {
+ paramPage.current = current;
+ handleSelectParam();
};
const getParamTypeText = type => {
const typeMap = {
@@ -750,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;
};
@@ -783,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(() => {
@@ -943,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 {
@@ -975,7 +1057,7 @@
th {
background: transparent;
font-weight: 600;
- color: #ffffff;
+ // color: #ffffff;
border-bottom: none;
padding: 16px 0;
}
--
Gitblit v1.9.3