From 4e44261ac4f6dcac2f15b3d30636d4b4823f6918 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 27 五月 2026 13:24:38 +0800
Subject: [PATCH] 君哥 1.恢复之前工艺路线模块,删除字段计件/计时字段,工资定额修改成计划工时,新增计划执行人员。工艺绑定,工艺路线恢复。仅需删除bom。 2.对于新增订单需流转协同办公进行审批,审批完成流转生产管控-生产订单 3.新增审批管理,规范管理所有节点审批人。 4.修改菜单栏样式bug
---
src/views/productionManagement/productionProcess/New.vue | 137 ++++++++++-----------------------------------
1 files changed, 32 insertions(+), 105 deletions(-)
diff --git a/src/views/productionManagement/productionProcess/New.vue b/src/views/productionManagement/productionProcess/New.vue
index 250e229..8b57f23 100644
--- a/src/views/productionManagement/productionProcess/New.vue
+++ b/src/views/productionManagement/productionProcess/New.vue
@@ -10,53 +10,21 @@
<el-row :gutter="16">
<el-col :span="12">
<el-form-item
- label="浜у搧鍚嶇О锛�"
- prop="productId"
+ label="閮ㄤ欢鍚嶇О"
+ prop="name"
:rules="[
{
required: true,
- message: '璇烽�夋嫨浜у搧鍚嶇О',
- },
- ]">
- <el-tree-select
- v-model="formState.productId"
- placeholder="璇烽�夋嫨浜у搧鍚嶇О"
- clearable
- filterable
- check-strictly
- :data="productCategoryOptions"
- :render-after-expand="false"
- style="width: 100%"
- @change="handleProductChange"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- label="浜у搧瑙勬牸锛�"
- prop="productModelId"
- :rules="[
- {
- required: true,
- message: '璇烽�夋嫨浜у搧瑙勬牸',
- },
- ]">
- <el-select v-model="formState.productModelId"
- placeholder="璇烽�夋嫨浜у搧瑙勬牸"
- clearable
- filterable
- :disabled="!formState.productId"
- style="width: 100%">
- <el-option v-for="item in modelOptions"
- :key="item.id"
- :label="item.model"
- :value="item.id" />
- </el-select>
+ message: '璇疯緭鍏ラ儴浠跺悕绉�',
+ }
+ ]"
+ >
+ <el-input v-model="formState.name" placeholder="璇疯緭鍏ラ儴浠跺悕绉�" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="閮ㄤ欢缂栧彿" prop="no">
- <el-input v-model="formState.no" />
+ <el-input v-model="formState.no" placeholder="璇疯緭鍏ラ儴浠剁紪鍙�" />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -113,6 +81,25 @@
</el-form-item>
</el-col>
<el-col :span="12">
+ <el-form-item label="璁″垝鎵ц浜哄憳" prop="executorId">
+ <el-select
+ v-model="formState.executorId"
+ placeholder="璇烽�夋嫨璁″垝鎵ц浜哄憳"
+ clearable
+ filterable
+ style="width: 100%"
+ @change="handleExecutorChange"
+ >
+ <el-option
+ v-for="item in plannerOptions"
+ :key="item.userId"
+ :label="item.nickName"
+ :value="item.userId"
+ />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
<el-form-item label="鏄惁璐ㄦ" prop="isQuality">
<el-switch v-model="formState.isQuality" :active-value="true" inactive-value="false"/>
</el-form-item>
@@ -137,7 +124,6 @@
<script setup>
import { ref, computed, getCurrentInstance, onMounted } from "vue";
import {add} from "@/api/productionManagement/productionProcess.js";
-import { modelListPage, productTreeList } from "@/api/basicData/product";
import { userListNoPageByTenantId } from "@/api/system/user.js";
const props = defineProps({
@@ -152,17 +138,15 @@
// 鍝嶅簲寮忔暟鎹紙鏇夸唬閫夐」寮忕殑 data锛�
const formState = ref({
name: '',
- productId: undefined,
- productModelId: undefined,
type: undefined,
remark: '',
salaryQuota: '',
plannerId: undefined,
plannerName: '',
+ executorId: undefined,
+ executorName: '',
isQuality: false,
});
-const productCategoryOptions = ref([]);
-const modelOptions = ref([]);
const plannerOptions = ref([]);
const isShow = computed({
@@ -189,60 +173,6 @@
callback();
};
-const convertProductTree = list => {
- return (list || []).map(item => {
- const children = convertProductTree(item.children || item.childList || []);
- return {
- ...item,
- value: item.id,
- label: item.name || item.label,
- children,
- disabled: children.length > 0,
- };
- });
-};
-
-const findNodeById = (nodes, targetId) => {
- for (const node of nodes || []) {
- if (String(node.value) === String(targetId)) {
- return node;
- }
- if (node.children && node.children.length > 0) {
- const found = findNodeById(node.children, targetId);
- if (found) return found;
- }
- }
- return null;
-};
-
-const getProductCategoryOptions = async () => {
- try {
- const res = await productTreeList();
- const list = Array.isArray(res) ? res : res?.data || [];
- productCategoryOptions.value = convertProductTree(list);
- } catch (e) {
- productCategoryOptions.value = [];
- }
-};
-
-const getModelOptions = async productId => {
- if (!productId) {
- modelOptions.value = [];
- return;
- }
- try {
- const res = await modelListPage({
- id: productId,
- current: 1,
- size: 999,
- });
- const records = res?.records || res?.data?.records || [];
- modelOptions.value = records;
- } catch (e) {
- modelOptions.value = [];
- }
-};
-
const getPlannerOptions = async () => {
try {
const res = await userListNoPageByTenantId();
@@ -257,11 +187,9 @@
formState.value.plannerName = selectedUser?.nickName || '';
};
-const handleProductChange = async value => {
- const selectedNode = findNodeById(productCategoryOptions.value, value);
- formState.value.name = selectedNode?.label || '';
- formState.value.productModelId = undefined;
- await getModelOptions(value);
+const handleExecutorChange = value => {
+ const selectedUser = plannerOptions.value.find(item => String(item.userId) === String(value));
+ formState.value.executorName = selectedUser?.nickName || '';
};
const closeModal = () => {
@@ -283,7 +211,6 @@
};
onMounted(() => {
- getProductCategoryOptions();
getPlannerOptions();
});
--
Gitblit v1.9.3