Explorar el Código

通用工艺和产品工艺列表和新增窗口增加产品负责人。

jiaxiaoqiang hace 6 meses
padre
commit
8b15761b83

+ 8 - 1
src/api/craft/route/index.ts

@@ -35,4 +35,11 @@ export function updateProcess(data: object) {
   });
 }
 
-
+// 编辑工艺 针对产品负责人的修改
+export function editRouteWith(data: object) {
+  return request({
+    url: `/api/v1/op/route/update`,
+    method: "post",
+    data: data,
+  });
+}

+ 77 - 2
src/views/base/craftManagement/route/index.vue

@@ -20,6 +20,21 @@
         <el-tag v-else type="info">未绑定</el-tag>
       </template>
 
+      <template #productManager-form="{ row }">
+        <el-select
+          v-model="form.productManager"
+          placeholder="产品负责人"
+          filterable
+        >
+          <el-option
+            v-for="item in userList"
+            :key="item.userName"
+            :label="item.userName"
+            :value="item.userName"
+          />
+        </el-select>
+      </template>
+
       <!-- :disabled="row.usable == '1' ? false : true" -->
       <!--<template #menu-right="{}">
         <el-dropdown split-button
@@ -49,6 +64,14 @@
         >
         <el-button
           link
+          type="primary"
+          icon="el-icon-edit"
+          v-else
+          @click="showProductManager(row, index)"
+          >编辑</el-button
+        >
+        <el-button
+          link
           type="danger"
           icon="el-icon-edit"
           v-if="row.usable === 0"
@@ -108,6 +131,26 @@
         </div>
       </template>
     </el-dialog>
+    <el-dialog
+      v-model="productManagerVisible"
+      title="编辑产品负责人"
+      width="500"
+      align-center
+    >
+      <el-form :model="form" label-width="auto" style="max-width: 800px">
+        <el-form-item label="工艺路线编号" prop="productManager">
+          <el-input v-model="form.productManager" />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="productManagerVisible = false">取消</el-button>
+          <el-button type="primary" @click="sureToEditProductManager">
+            确定
+          </el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 <script setup>
@@ -115,8 +158,8 @@ import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
 import dictDataUtil from "@/common/configs/dictDataUtil";
 import { useDictionaryStore } from "@/store";
-import { copyRoute } from "@/api/craft/route/index";
-
+import { copyRoute, editRouteWith } from "@/api/craft/route/index";
+import { getUserList } from "@/api/system/user/index";
 // 数据字典相关
 const { dicts } = useDictionaryStore();
 
@@ -140,9 +183,28 @@ let centerDialogVisible = ref(false);
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 const tmpForm = ref({});
 
+// 产品负责人相关
+const userList = ref([]);
+const currentPMRow = ref({});
+const productManagerVisible = ref(false);
+const showProductManager = (row, index) => {
+  productManagerVisible.value = true;
+  currentPMRow.value = row;
+  form.value = row;
+};
+const sureToEditProductManager = () => {
+  editRouteWith(currentPMRow.value).then(() => {
+    dataList();
+    productManagerVisible.value = false;
+  });
+};
+
 onMounted(() => {
   // console.log("crudRef", crudRef)
   dataList();
+  getUserList({}).then((data) => {
+    userList.value = data.data;
+  });
 });
 
 /**
@@ -378,6 +440,19 @@ option.value = Object.assign(option.value, {
       disabled: true,
     },
     {
+      label: "产品负责人",
+      prop: "productManager",
+      width: 120,
+      slot: true,
+      rules: [
+        {
+          required: true,
+          message: "工艺路线类型不能为空",
+          trigger: "change",
+        },
+      ],
+    },
+    {
       label: "产品型号",
       prop: "prodtModel",
       overHidden: true,

+ 34 - 0
src/views/base/craftManagement/routeCommon/index.vue

@@ -22,6 +22,21 @@
       </template>-->
 
       <!-- :disabled="row.usable == '1' ? false : true" -->
+      <template #productManager-form="{ row }">
+        <el-select
+          v-model="form.productManager"
+          placeholder="产品负责人"
+          filterable
+        >
+          <el-option
+            v-for="item in userList"
+            :key="item.userName"
+            :label="item.userName"
+            :value="item.userName"
+          />
+        </el-select>
+      </template>
+
       <template #menu-right="{}">
         <el-dropdown split-button
           >导入
@@ -96,6 +111,7 @@ import ButtonPermKeys from "@/common/configs/buttonPermission";
 import dictDataUtil from "@/common/configs/dictDataUtil";
 import { useDictionaryStore } from "@/store";
 import { copyRoute } from "@/api/craft/route/index";
+import { getUserList } from "@/api/system/user/index";
 
 // 数据字典相关
 const { dicts } = useDictionaryStore();
@@ -128,6 +144,9 @@ onMounted(() => {
   // console.log("crudRef", crudRef)
   search.value.routeType = "common";
   dataList();
+  getUserList({}).then((data) => {
+    userList.value = data.data;
+  });
 });
 
 /**
@@ -149,6 +168,8 @@ const importExcelData = () => {
 // 选择产品相关
 const ctableRef = ref(null);
 
+const userList = ref([]);
+
 const onSelectedFinish = (selectedValue) => {
   // search.value.prodtName = selectedValue.materialName;
   form.value.prodtName = selectedValue.materialName;
@@ -310,6 +331,19 @@ option.value = Object.assign(option.value, {
       value: 0,
     },
     {
+      label: "产品负责人",
+      prop: "productManager",
+      width: 120,
+      slot: true,
+      rules: [
+        {
+          required: true,
+          message: "工艺路线类型不能为空",
+          trigger: "change",
+        },
+      ],
+    },
+    {
       label: "创建人",
       prop: "creator",
       addDisplay: false,