Sfoglia il codice sorgente

feat(bpm): 添加工单接收功能并优化质检项/样品信息展示

yusheng 4 mesi fa
parent
commit
78a5f0e038

+ 9 - 0
src/api/tickets/index.js

@@ -119,3 +119,12 @@ export async function acceptance(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+
+export async function startExecuting(params) {
+  const res = await request.post(`/eam/PdaWorkOrder/startExecuting`, params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 241 - 77
src/views/bpm/handleTask/components/inspectionProjectRequest/detailDialog.vue

@@ -1,6 +1,8 @@
 <template>
   <div>
-    <header-title title="质检项信息"></header-title>
+    <header-title
+      :title="form.recordingMethod == 1 ? '质检项信息' : '样品信息'"
+    ></header-title>
     <ele-pro-table
       :needPage="false"
       :columns="tableColumns"
@@ -9,16 +11,10 @@
       ref="table"
     ></ele-pro-table>
     <header-title title="派单信息"></header-title>
-    <el-form
-      ref="form"
-      :model="form"
-      :rules="rules"
-      class="el-form-box"
-      label-width="120px"
-    >
+    <el-form ref="form" :model="form" class="el-form-box" label-width="120px">
       <el-row>
         <el-col :span="8">
-          <el-form-item label="质检请托单号" prop="code">
+          <el-form-item label="质检请托单号" prop="code">
             <el-input
               v-model="form.code"
               placeholder=" "
@@ -81,83 +77,251 @@
     data() {
       return {
         form: {},
-        list: [],
-        tableColumns: [
-          {
-            width: 45,
-            type: 'index',
-            columnKey: 'index',
-            align: 'center',
-            fixed: 'left'
-          },
-          {
-            minWidth: 150,
-            prop: 'qualitySchemeTemplateCode',
-            align: 'center',
-            label: '质检方案编码',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 120,
-            prop: 'qualitySchemeTemplateName',
-            align: 'center',
-            label: '质检方案名称',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 100,
-            prop: 'categoryLevelClassName',
-            align: 'center',
-            label: '质检类型',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 130,
-            prop: 'inspectionCode',
-            align: 'center',
-            label: '质检项编码',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 120,
-            prop: 'inspectionName',
-            align: 'center',
-            label: '质检项名称',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 150,
-            prop: 'defaultValue',
-            align: 'center',
-            label: '工艺参数',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 150,
-            prop: 'status',
-            align: 'center',
-            formatter: (row) => {
-              return (
-                inspectionProjectStatus.find(
-                  (item) => item.value === row.status
-                )?.label || ''
-              );
-            },
-
-            label: '状态',
-            showOverflowTooltip: true
-          }
-        ]
+        list: []
       };
     },
+    computed: {
+      tableColumns() {
+        return this.form.recordingMethod == 1
+          ? [
+              {
+                width: 45,
+                type: 'index',
+                columnKey: 'index',
+                align: 'center',
+                fixed: 'left'
+              },
+
+              {
+                minWidth: 150,
+                prop: 'qualitySchemeTemplateCode',
+                align: 'center',
+                label: '质检方案编码',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 120,
+                prop: 'qualitySchemeTemplateName',
+                align: 'center',
+                label: '质检方案名称',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 100,
+                prop: 'categoryLevelClassName',
+                align: 'center',
+                label: '质检类型',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 130,
+                prop: 'inspectionCode',
+                align: 'center',
+                label: '质检项编码',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 120,
+                prop: 'inspectionName',
+                align: 'center',
+                label: '质检项名称',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 150,
+                prop: 'defaultValue',
+                align: 'center',
+                label: '工艺参数',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 150,
+                prop: 'status',
+                align: 'center',
+                formatter: (row) => {
+                  return (
+                    inspectionProjectStatus.find(
+                      (item) => item.value === row.status
+                    )?.label || ''
+                  );
+                },
+
+                label: '状态',
+                showOverflowTooltip: true
+              }
+            ]
+          : [
+              {
+                width: 45,
+                type: 'index',
+                columnKey: 'index',
+                align: 'center',
+                fixed: 'left'
+              },
 
+              {
+                label: '样品编码',
+                prop: 'sampleCode',
+                minWidth: '200',
+                align: 'center',
+                fixed: 'left'
+              },
+              {
+                label: '编码',
+                minWidth: '200',
+                prop: 'categoryCode',
+                align: 'center',
+                fixed: 'left'
+              },
+              {
+                label: '名称',
+                minWidth: '150',
+                prop: 'categoryName',
+                align: 'center'
+              },
+              {
+                label: '批次号',
+                minWidth: '150',
+                prop: 'batchNo',
+                align: 'center'
+              },
+              {
+                label: '发货条码',
+                minWidth: '150',
+                prop: 'barcodes',
+                align: 'center'
+              },
+              {
+                label: '包装编码',
+                minWidth: '150',
+                prop: 'packageNo',
+                align: 'center'
+              },
+              {
+                label: '包装数量',
+                minWidth: '150',
+                prop: 'packingQuantity',
+                align: 'center'
+              },
+              { label: '包装单位', prop: 'packingUnit', align: 'center' },
+              { label: '计量数量', prop: 'measureQuantity', align: 'center' },
+              { label: '计量单位', prop: 'measureUnit', align: 'center' },
+              {
+                label: '供应商名称',
+                prop: 'supplierName',
+                align: 'center',
+                width: '120'
+              },
+              {
+                label: '供应商代号',
+                prop: 'supplierCode',
+                align: 'center',
+                width: '120'
+              },
+              {
+                label: '物料代号',
+                prop: 'materielDesignation',
+                align: 'center',
+                slot: 'materielDesignation',
+                width: '120'
+              },
+              {
+                label: '客户代号',
+                prop: 'clientCode',
+                align: 'center',
+                slot: 'clientCode',
+                width: '120'
+              },
+              {
+                label: '刻码',
+                prop: 'engrave',
+                align: 'center',
+                slot: 'engrave',
+                width: '120'
+              },
+              {
+                label: '机型',
+                prop: 'modelKey',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '颜色',
+                prop: 'colorKey',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '型号',
+                prop: 'modelType',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '规格',
+                prop: 'specification',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '电压等级',
+                prop: 'voltage',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '重量',
+                prop: 'weight',
+                align: 'center',
+                slot: 'weight',
+                width: '120'
+              },
+              {
+                label: '重量单位',
+                prop: 'weightUnit',
+                align: 'center',
+                width: 100
+              },
+              {
+                label: '仓库',
+                prop: 'warehouseName',
+                align: 'center',
+                width: 100
+              },
+              { label: '货区', prop: 'areaName', align: 'center' },
+              { label: '货架', prop: 'goodsShelfName', align: 'center' },
+              { label: '货位', prop: 'goodsAllocationName', align: 'center' },
+              { label: '生产日期', prop: 'productionDate', align: 'center' },
+              { label: '采购日期', prop: 'purchaseDate', align: 'center' },
+              {
+                minWidth: 150,
+                prop: 'status',
+                align: 'center',
+                formatter: (row) => {
+                  return (
+                    inspectionProjectStatus.find(
+                      (item) => item.value === row.status
+                    )?.label || ''
+                  );
+                },
+
+                label: '状态',
+                fixed: 'right',
+                showOverflowTooltip: true
+              }
+            ];
+      }
+    },
     created() {
       this.init();
     },
     methods: {
       async init() {
         this.form = await getById(this.businessId);
-        this.list = this.form.templateList;
+        this.list =
+          this.form.recordingMethod == 1
+            ? this.form.templateList
+            : this.form.sampleList;
       }
     }
   };

+ 30 - 4
src/views/bpm/tickets/patrolInspection/index.vue

@@ -21,7 +21,20 @@
           <!-- 操作列 -->
           <template v-slot:action="{ row }">
             <el-link
-              v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
+              v-if="row.orderStatus == 0"
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="startExecuting(row)"
+            >
+              接收
+            </el-link>
+            <el-link
+              v-if="
+                row.orderStatus !== 3 &&
+                row.orderStatus !== 4 &&
+                row.orderStatus != 0
+              "
               type="primary"
               :underline="false"
               icon="el-icon-edit"
@@ -30,7 +43,11 @@
               报工
             </el-link>
             <el-link
-              v-if="row.orderStatus !== 3 && row.orderStatus !== 4&&row.isGroup != 1"
+              v-if="
+                row.orderStatus !== 3 &&
+                row.orderStatus !== 4 &&
+                row.isGroup != 1
+              "
               type="primary"
               :underline="false"
               icon="el-icon-edit"
@@ -55,7 +72,11 @@
   import RepairDetailsDialog from '../components/RepairDetailsDialog.vue';
   import redeployOther from '../components/redeployOther.vue';
   import signingUpWork from '../components/signingUpWork.vue';
-  import { ticketStatus, resultStatus } from '@/utils/dict/tickets';
+  import {
+    ticketStatus,
+    resultStatus,
+    startExecuting
+  } from '@/utils/dict/tickets';
   import { getWorkOrderPage, getRule } from '@/api/tickets';
   import pagenation from '@/components/Pagination';
 
@@ -240,7 +261,7 @@
               return { label: item.label, value: item.id };
             }),
             placeholder: ' '
-          },
+          }
 
           // {
           //   label: '开始结束时间:',
@@ -315,6 +336,11 @@
       getData() {
         this.search(this.searchForm);
       },
+      startExecuting(row) {
+        startExecuting({ id: row.id }).then((res) => {
+          this.getData();
+        });
+      },
       // 计算实际工时
       time_interval(dt1, dt2) {
         if (!dt1 || !dt2) {