Просмотр исходного кода

feat(工单管理): 添加工单类型区分并优化路由跳转

liujt 2 месяцев назад
Родитель
Сommit
534de79c92

+ 21 - 3
src/views/bpm/doneTickets/index.vue

@@ -17,7 +17,7 @@
         </div>
       </div>
       <div class="content-wrapper" style="margin-left: 10px">
-        <component :is="activeComp"></component>
+        <component :is="activeComp" way="done"></component>
       </div>
     </el-card>
   </div>
@@ -28,12 +28,18 @@
   import maintenance from './maintenance';
   import delivery from './delivery';
   import repair from './repair';
+  import inspectionWork from '@/views/bpm/tickets/inspectionWork/index.vue';
+  import productions from '@/views/bpm/tickets/productions/index.vue';
+  import work from '@/views/bpm/tickets/work/index.vue';
   export default {
     components: {
       patrolInspection,
       maintenance,
       delivery,
-      repair
+      repair,
+      inspectionWork,
+      productions,
+      work
     },
     data() {
       return {
@@ -41,7 +47,10 @@
         tabOptions: [
           { key: 'patrolInspection', name: '巡点检工单' },
           { key: 'maintenance', name: '保养工单' },
-          { key: 'repair', name: '维修工单' }
+          { key: 'repair', name: '维修工单' },
+          { key: 'productions', name: '生产工单' },
+          { key: 'inspectionWork', name: '质检工单' },
+          { key: 'work', name: '盘点工单' }
           // { key: 'delivery', name: '量具送检工单' }
           // { key: 'repair', name: '计划性维修工单' },
           // { key: 'malfunction', name: '盘点工单' }
@@ -59,6 +68,15 @@
         case '量具送检工单':
           this.activeComp = 'delivery';
           break;
+        case '质检工单':
+          this.activeComp = 'inspectionWork';
+          break;
+        case '盘点工单':
+          this.activeComp = 'work';
+          break;
+        case '生产工单':
+          this.activeComp = 'productions';
+          break;
         default:
           break;
       }

+ 1 - 1
src/views/bpm/tickets/index.vue

@@ -20,7 +20,7 @@
         </div>
       </div>
       <div class="content-wrapper" style="margin-left: 10px">
-        <component :is="activeComp" @recount="setCount"></component>
+        <component :is="activeComp" way="todo" @recount="setCount"></component>
       </div>
     </el-card>
   </div>

+ 31 - 9
src/views/bpm/tickets/inspectionWork/index.vue

@@ -85,10 +85,11 @@
       <template v-slot:action="{ row }">
 
         <el-link
+          v-if="row.status == 0"
           type="primary"
           :underline="false"
           @click="handelRouterTo(row)"
-          >详情</el-link
+          >报工</el-link
         >
       </template>
       <template v-slot:templateList="{ row }">
@@ -182,7 +183,7 @@
           {
             prop: 'code',
             label: '质检工单编码',
-            // slot: 'code',
+            slot: 'code',
             align: 'center',
             width: 180,
             showOverflowTooltip: true,
@@ -523,9 +524,29 @@
       }
     },
     methods: {
-      handelRouterTo(row) {
-        window.history.pushState(null, '', '/page-qms/inspectionWork?isWt=true&businessId=' + row.id);
-        // this.$router.push(path);
+      async handelRouterTo(row) {
+        // window.history.pushState(null, '', '/page-qms/inspectionWork?isWt=true&businessId=' + row.id);
+        // // this.$router.push(path);
+
+        // if (type == 'edit') {
+          const code = await verificationQualityInspector(row.id);
+          if (code == '-1') {
+            return;
+          }
+        // }
+        const id = row.id;
+        const qualityType = row.qualityType;
+        const qualityTimeStart = row.qualityTimeStart || '';
+        window.history.pushState(null, '', '/page-qms/inspectionWork/edit?type=edit&id=' + id + '&qualityType=' + qualityType + '&qualityTimeStart=' + qualityTimeStart);
+        // this.$router.push({
+        //   path: '/inspectionWork/edit',
+        //   query: {
+        //     type,
+        //     id,
+        //     qualityType,
+        //     qualityTimeStart
+        //   }
+        // });
       },
       getReportTemplateList() {
         getQmsReportTemplatePageList({
@@ -715,10 +736,11 @@
       },
       openDetails(row) {
         let id = row.id;
-        this.$router.push({
-          path: '/inspectionWork/details',
-          query: { id, path: '/inspectionWork', name: '工单' }
-        });
+        window.history.pushState(null, '', '/inspectionWork/details?id=' + id + '&path=' + '/inspectionWork' + '&name=工单');
+        // this.$router.push({
+        //   path: '/inspectionWork/details',
+        //   query: { id, path: '/inspectionWork', name: '工单' }
+        // });
       },
       openWorkDetails(row) {
         if (row.qualityPlanCode) {

+ 10 - 4
src/views/bpm/tickets/productions/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="ele-body">
+  <div>
     <el-card shadow="never" v-loading="loading">
       <seek-page :seekList="seekList" @search="search"></seek-page>
       <!-- <el-tabs v-model="tabValue" type="card" @tab-click="handleTabClick"> -->
@@ -172,11 +172,12 @@
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
             <el-link
+            v-if="way == 'todo'"
             type="primary"
             :underline="false"
             @click="handelRouterTo(row)"
           >
-            详情
+            报工
           </el-link>
           <!-- <template v-if="activeName == 'second'">
             <el-link
@@ -281,7 +282,12 @@
     components: {
    
     },
-
+    props: {
+      way: {
+        type: String,
+        default: 'todo'
+      }
+    },
     data() {
       return {
         activeName: 'first',
@@ -836,7 +842,7 @@
 
     methods: {
       handelRouterTo(row) {
-        window.history.pushState(null, '', '/page-mes/produceOrder?isWt=true&item=' + JSON.stringify(row));
+        window.history.pushState(null, '', '/page-mes/produceOrder?isWt=true&way=' + this.way + '&item=' + JSON.stringify(row));
         // this.$router.push(path);
       },
       //派单

+ 15 - 9
src/views/bpm/tickets/work/index.vue

@@ -145,9 +145,14 @@
         userInfo: {}
       };
     },
+    computed: {
+      userInfo() {
+        return this.$store.getters.user.info;
+      }
+    },
     created() {
-      let info = JSON.parse(localStorage.getItem('info'));
-      this.userInfo = info;
+      // let info = JSON.parse(localStorage.getItem('info'));
+      // this.userInfo = info;
     },
     methods: {
       control(row) {
@@ -184,13 +189,14 @@
       },
       // 详情
       goDetail(row) {
-        this.$router.push({
-          path: '/warehouseManagement/stocktaking/work/details',
-          query: {
-            id: row.id,
-            planId: row.planId
-          }
-        });
+        window.history.pushState(null, '', '/page-wms/warehouseManagement/stocktaking/work/details?id=' + row.id + '&planId=' + row.planId);
+        // this.$router.push({
+        //   path: '/page-wms/warehouseManagement/stocktaking/work/details',
+        //   query: {
+        //     id: row.id,
+        //     planId: row.planId
+        //   }
+        // });
       }
     }
   };