Jelajahi Sumber

feat(inspectionWork): 检验作业详情与列表新增所属工厂、执行班组、产线字段及筛选条件

lucw 4 hari lalu
induk
melakukan
7590439703

+ 116 - 3
src/views/inspectionWork/components/inspectionWorkList.vue

@@ -330,7 +330,7 @@
   import { queryTodo } from '@/api/bpm/task';
   import dictMixins from '@/mixins/dictMixins';
   import { getFile } from '@/api/system/file';
-  import { parameterGetByCode } from '@/api/main/index';
+  import { parameterGetByCode, getteampage } from '@/api/main/index';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { getCategoryByCode } from '@/api/main/index';
   import { getQmsReportTemplatePageList } from '@/api/inspectionWork';
@@ -342,7 +342,11 @@
     purchaseorderreceivePage,
     saleentrustedreceive
   } from '@/api/inspectionPlan/index.js';
-  import { produceOrder } from '@/api/aps/index.js';
+  import {
+    produceOrder,
+    getFactoryList,
+    getFactoryarea
+  } from '@/api/aps/index.js';
   export default {
     name: 'InspectionWorkList',
     mixins: [dictMixins, tabMixins],
@@ -488,6 +492,36 @@
             width: 120,
             showOverflowTooltip: true
           },
+          {
+            prop: 'executeJobName',
+            label: '执行班组',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return row.executeJobName || '';
+            }
+          },
+          {
+            prop: 'productLineName',
+            label: '产线',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return row.productLineName || '';
+            }
+          },
+          {
+            prop: 'factoryName',
+            label: '所属工厂',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return row.factoryName || '';
+            }
+          },
           {
             prop: 'createUserName',
             label: '送检人',
@@ -661,7 +695,10 @@
         transferId: '',
         isReportApproval: 0,
         selection: [],
-        reportTemplateList: []
+        reportTemplateList: [],
+        factoryList: [],
+        teamList: [],
+        productLineList: []
       };
     },
     created() {
@@ -670,6 +707,9 @@
       this.requestDict('取样类型');
       this.getCode();
       this.getReportTemplateList();
+      this.getFactoryOptions();
+      this.getTeamOptions();
+      this.getProductLineOptions();
     },
     mounted() {
       const isWt = this.$route.query?.isWt;
@@ -700,6 +740,27 @@
             type: 'input',
             placeholder: ''
           },
+          {
+            label: '所属工厂:',
+            value: 'factoriesId',
+            type: 'select',
+            placeholder: '',
+            planList: this.factoryList
+          },
+          {
+            label: '执行班组:',
+            value: 'executeJobId',
+            type: 'select',
+            placeholder: '',
+            planList: this.teamList
+          },
+          {
+            label: '产线:',
+            value: 'productLineId',
+            type: 'select',
+            placeholder: '',
+            planList: this.productLineList
+          },
           {
             label: '质检报告:',
             value: 'reportStatus',
@@ -776,6 +837,58 @@
       }
     },
     methods: {
+      // 所属工厂下拉
+      getFactoryOptions() {
+        getFactoryList()
+          .then((res) => {
+            this.factoryList = (res || []).map((item) => {
+              return {
+                label: item.name,
+                value: item.id
+              };
+            });
+          })
+          .catch((err) => {
+            console.error('获取工厂列表失败:', err);
+          });
+      },
+      // 执行班组下拉
+      getTeamOptions() {
+        getteampage({
+          pageNum: 1,
+          size: -1
+        })
+          .then((res) => {
+            this.teamList = (res?.list || []).map((item) => {
+              return {
+                label: item.name,
+                value: item.id
+              };
+            });
+          })
+          .catch((err) => {
+            console.error('获取班组列表失败:', err);
+          });
+      },
+      // 产线(场站)下拉
+      getProductLineOptions() {
+        getFactoryarea({
+          pageNum: 1,
+          size: 999,
+          type: 4
+        })
+          .then((res) => {
+            this.productLineList = (res?.list || []).map((item) => {
+              return {
+                label: item.name,
+                value: item.id
+              };
+            });
+          })
+          .catch((err) => {
+            console.error('获取产线列表失败:', err);
+          });
+      },
       getReportTemplateList() {
         getQmsReportTemplatePageList({
           pageNum: 1,

+ 8 - 6
src/views/inspectionWork/details.vue

@@ -61,6 +61,11 @@
                 </el-form-item>
               </el-col>
 
+              <el-col :span="6">
+                <el-form-item label="所属工厂">
+                  <el-input :value="form.factoryName" disabled />
+                </el-form-item>
+              </el-col>
               <el-col :span="6">
                 <el-form-item
                   label="执行部门"
@@ -70,10 +75,7 @@
                   <el-input :value="form.executeDeptName" disabled />
                 </el-form-item>
               </el-col>
-              <el-col
-                :span="6"
-                v-if="form.qualityType == 2 || form.assignType == 1"
-              >
+              <el-col :span="6">
                 <el-form-item
                   label="执行班组"
                   prop="executeJobName"
@@ -94,8 +96,8 @@
                   <el-input :value="form.executeUserName" disabled />
                 </el-form-item>
               </el-col>
-              <el-col :span="6" v-if="form.assignType == 1">
-                <el-form-item label="场站" prop="productLineId">
+              <el-col :span="6">
+                <el-form-item label="产线" prop="productLineId">
                   <el-input v-model="form.productLineName" disabled></el-input>
                 </el-form-item>
               </el-col>