From 1ef08126ca554a8cd4b9ba47d19dc3b790e2c018 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期二, 19 五月 2026 17:21:19 +0800
Subject: [PATCH] Merge branch 'dev-new_pro_OA' of http://114.132.189.42:9002/r/product-inventory-management into dev-new_pro_OA
---
src/views/productionManagement/productionProcess/index.vue | 69 +++++++++++++++++++++++++---------
1 files changed, 50 insertions(+), 19 deletions(-)
diff --git a/src/views/productionManagement/productionProcess/index.vue b/src/views/productionManagement/productionProcess/index.vue
index 9668853..747b8de 100644
--- a/src/views/productionManagement/productionProcess/index.vue
+++ b/src/views/productionManagement/productionProcess/index.vue
@@ -162,9 +162,9 @@
</el-form>
<template #footer>
<span class="dialog-footer">
- <el-button @click="processDialogVisible = false">鍙栨秷</el-button>
<el-button type="primary"
@click="handleProcessSubmit">纭畾</el-button>
+ <el-button @click="processDialogVisible = false">鍙栨秷</el-button>
</span>
</template>
</el-dialog>
@@ -243,6 +243,7 @@
</el-form-item>
<el-form-item label="鏍囧噯鍊�">
<el-input v-model="selectedParam.standardValue"
+ @input="val => onStandardValueInput(val, selectedParam)"
placeholder="璇疯緭鍏ラ粯璁ゅ��" />
</el-form-item>
</el-form>
@@ -252,10 +253,10 @@
</div>
<template #footer>
<span class="dialog-footer">
- <el-button @click="paramDialogVisible = false">鍙栨秷</el-button>
<el-button type="primary"
:disabled="!selectedParam"
@click="handleParamSubmit">纭畾</el-button>
+ <el-button @click="paramDialogVisible = false">鍙栨秷</el-button>
</span>
</template>
</el-dialog>
@@ -273,14 +274,15 @@
<el-form-item label="鏍囧噯鍊�"
prop="standardValue">
<el-input v-model="editParamForm.standardValue"
+ @input="val => onStandardValueInput(val, editParamForm)"
placeholder="璇疯緭鍏ユ爣鍑嗗��" />
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
- <el-button @click="editParamDialogVisible = false">鍙栨秷</el-button>
<el-button type="primary"
@click="handleEditParamSubmit">纭畾</el-button>
+ <el-button @click="editParamDialogVisible = false">鍙栨秷</el-button>
</span>
</template>
</el-dialog>
@@ -288,7 +290,7 @@
</template>
<script setup>
- import { ref, reactive, onMounted } from "vue";
+ import { ref, reactive, computed, onMounted } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { Plus, Edit, Delete, Search } from "@element-plus/icons-vue";
import PIMTable from "@/components/PIMTable/PIMTable.vue";
@@ -313,8 +315,19 @@
const processLoading = ref(false);
const deviceOptions = ref([]);
- // 鍙傛暟鍒楄〃鏁版嵁
- const paramList = ref([]);
+ // 宸ュ簭宸查�夊弬鏁拌〃鏍煎垎椤碉紙鎺ュ彛涓�娆¤繑鍥炲叏閲忥級
+ const paramPage2 = ref({
+ current: 1,
+ size: 10,
+ total: 0,
+ });
+ const paramListRaw = ref([]);
+ const paramList = computed(() => {
+ const all = paramListRaw.value;
+ const { current, size } = paramPage2.value;
+ const start = (current - 1) * size;
+ return all.slice(start, start + size);
+ });
const paramLoading = ref(false);
// 鏁版嵁瀛楀吀
@@ -381,7 +394,18 @@
technologyParamId: null,
paramName: "",
standardValue: null,
+ paramType: null,
});
+
+ const onStandardValueInput = (val, target) => {
+ const data = target.value || target;
+ const type = data.paramType;
+ if (type === 1) {
+ // 鏁板�兼牸寮忥細涓嶈兘杈撳叆涓枃鎴栬嫳鏂囧瓧绗�
+ data.standardValue = val.replace(/[a-zA-Z\u4e00-\u9fa5]/g, "");
+ }
+ };
+
const editParamRules = {
standardValue: [
{
@@ -392,6 +416,12 @@
if (value === null || value === undefined || value === "") {
callback(new Error("璇疯緭鍏ユ爣鍑嗗��"));
} else {
+ const type = editParamForm.paramType;
+ if (type === 1 && value) {
+ if (/[a-zA-Z\u4e00-\u9fa5]/.test(value)) {
+ return callback(new Error("鏁板�兼牸寮忎笉鑳藉寘鍚腑鑻辨枃瀛楃"));
+ }
+ }
callback();
}
},
@@ -485,21 +515,21 @@
}
};
- const paramPage2 = ref({
- current: 1,
- size: 10,
- total: 0,
- });
-
// 鑾峰彇鍙傛暟鍒楄〃
const getParamList = processId => {
paramLoading.value = true;
- console.log(paramPage2.value, "paramPage2.value");
getProcessParamList({ technologyOperationId: processId })
.then(res => {
- console.log(res, "res");
- paramList.value = res.data || [];
- paramPage2.value.total = 0;
+ const list = res.data || [];
+ paramListRaw.value = Array.isArray(list) ? list : [];
+ paramPage2.value.total = paramListRaw.value.length;
+ const maxPage = Math.max(
+ 1,
+ Math.ceil(paramPage2.value.total / paramPage2.value.size) || 1
+ );
+ if (paramPage2.value.current > maxPage) {
+ paramPage2.value.current = maxPage;
+ }
})
.catch(() => {
ElMessage.error("鑾峰彇鍙傛暟鍒楄〃澶辫触");
@@ -512,6 +542,7 @@
// 閫夋嫨宸ュ簭
const selectProcess = process => {
selectedProcess.value = process;
+ paramPage2.value.current = 1;
getParamList(process.id);
};
@@ -556,7 +587,8 @@
getProcessList();
if (selectedProcess.value?.id === process.id) {
selectedProcess.value = null;
- paramList.value = [];
+ paramListRaw.value = [];
+ paramPage2.value.total = 0;
}
})
.catch(() => {
@@ -704,6 +736,7 @@
editParamForm.technologyParamId = row.technologyParamId;
editParamForm.paramName = row.paramName;
editParamForm.standardValue = row.standardValue;
+ editParamForm.paramType = row.paramType;
editParamDialogVisible.value = true;
};
@@ -744,10 +777,8 @@
};
const handleParamPagination = obj => {
- console.log(obj, "obj");
paramPage2.value.current = obj.page;
paramPage2.value.size = obj.limit;
- getParamList(selectedProcess.value.id);
};
// 鑾峰彇鏁版嵁瀛楀吀
--
Gitblit v1.9.3