Ver Fonte

fix:修改指派到具体人的工位任务

lupeng há 10 meses atrás
pai
commit
ec478714f5
1 ficheiros alterados com 46 adições e 6 exclusões
  1. 46 6
      src/views/plan/schedule/index.vue

+ 46 - 6
src/views/plan/schedule/index.vue

@@ -1,12 +1,31 @@
 <template>
   <div class="mainContentBox">
-    <avue-crud ref="crudRef" v-model:search="search" v-model="form" :data="data" :option="option" v-model:page="page"
-      @row-save="createRow" @row-update="updateRow" @row-del="deleteRow" @search-change="searchChange"
-      @search-reset="resetChange" @size-change="dataList" @current-change="dataList"
-      @selection-change="selectionChange">
+    <avue-crud
+      ref="crudRef"
+      v-model:search="search"
+      v-model="form"
+      :data="data"
+      :option="option"
+      v-model:page="page"
+      @row-save="createRow"
+      @row-update="updateRow"
+      @row-del="deleteRow"
+      @search-change="searchChange"
+      @search-reset="resetChange"
+      @size-change="dataList"
+      @current-change="dataList"
+      @selection-change="selectionChange"
+    >
       <template #menu="{ size, row, index }">
-        <el-button icon="el-icon-edit" text v-if="row.state === '-1' || row.state === '0'"
-          @click="handleEdit(row, index)" type="primary" :size="size">编辑</el-button>
+        <el-button
+          icon="el-icon-edit"
+          text
+          v-if="row.state === '-1' || row.state === '0' || row.state === '1'"
+          @click="handleEdit(row, index)"
+          type="primary"
+          :size="size"
+          >编辑</el-button
+        >
       </template>
       <template #menu-left>
         <div id="charts"></div>
@@ -19,6 +38,7 @@ import { ref } from "vue";
 import { useCrud } from "@/hooks/userCrud";
 import dictDataUtil from "@/common/configs/dictDataUtil";
 import { queryStationByLineId } from "@/api/station";
+import { getUserList } from "@/api/system/user";
 import { useDictionaryStore } from "@/store";
 import { getStatistics } from "@/api/order/index";
 import * as echarts from "echarts";
@@ -38,11 +58,20 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
 
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 const stationList = ref([]);
+const userList = ref([]);
 const charts = shallowRef(null);
 const handleEdit = (row, index) => {
   queryStationByLineId(row.productLineId).then((data) => {
     stationList.value = data.data;
   });
+  getUserList({}).then((data) => {
+    userList.value = data.data;
+  });
+  if (row.state === "1") {
+    option.value.column[2].editDisabled = true;
+    option.value.column[12].editDisabled = true;
+    option.value.column[13].editDisabled = true;
+  }
   crudRef.value && crudRef.value.rowEdit(row, index);
 };
 onMounted(() => {
@@ -115,6 +144,7 @@ option.value = Object.assign(option.value, {
       editDisabled: false,
       type: "select",
       dicData: stationList,
+      filterable: true,
       prop: "stationId",
       props: { label: "name", value: "id" },
       rules: [
@@ -126,6 +156,16 @@ option.value = Object.assign(option.value, {
       ],
     },
     {
+      label: "分配人员",
+      editDisabled: false,
+      type: "select",
+      dicData: userList,
+      filterable: true,
+      prop: "allocationUser",
+      dicMethod: "post",
+      props: { label: "userName", value: "userName" },
+    },
+    {
       label: "工单编码",
       prop: "workOrderCode",
       search: true,