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

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wt into dengfei

695593266@qq.com 2 месяцев назад
Родитель
Сommit
c69c122654

+ 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>

+ 36 - 10
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 }">
@@ -151,6 +152,10 @@
       myWork: {
         type: Boolean,
         default: false
+      },
+      way: {
+        type: String,
+        default: 'todo'
       }
     },
     data() {
@@ -182,7 +187,7 @@
           {
             prop: 'code',
             label: '质检工单编码',
-            // slot: 'code',
+            slot: 'code',
             align: 'center',
             width: 180,
             showOverflowTooltip: true,
@@ -523,9 +528,29 @@
       }
     },
     methods: {
-      handelRouterTo(row) {
-        window.history.pushState(null, '', '/page-qms/inspectionWork?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({
@@ -660,7 +685,7 @@
 
         // if (this.myWork) {
           where.currentLoginUserId = this.$store.state.user.info.userId;
-          where.status = 0;
+          where.status = this.way == 'todo' ? 0 : 1;
         // }
 
         return getList({
@@ -715,10 +740,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) {

+ 20 - 13
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"> -->
@@ -58,7 +58,7 @@
         </template>
 
         <template v-slot:code="{ row }">
-          <el-link type="primary" :underline="false" @click="goDetail(row)">
+          <el-link type="primary" :underline="false" @click="handelRouterTo('done', row)">
             {{ row.code }}
           </el-link>
         </template>
@@ -172,11 +172,12 @@
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
             <el-link
+            v-if="way == 'todo'"
             type="primary"
             :underline="false"
-            @click="handelRouterTo(row)"
+            @click="handelRouterTo('todo', 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',
@@ -485,7 +491,7 @@
 
           {
             prop: 'code',
-            // slot: 'code',
+            slot: 'code',
             label: '生产工单号',
             align: 'center',
             minWidth: 110,
@@ -835,8 +841,8 @@
     },
 
     methods: {
-      handelRouterTo(row) {
-        window.history.pushState(null, '', '/page-mes/produceOrder?businessId=' + row.id);
+      handelRouterTo(way, row) {
+        window.history.pushState(null, '', '/page-mes/produceOrder?isWt=true&way=' + way + '&item=' + JSON.stringify(row));
         // this.$router.push(path);
       },
       //派单
@@ -983,7 +989,8 @@
           queryTermination: this.tabValue == '10' ? 1 : 0,
           pageNum: page,
           size: limit,
-          ...this.sort
+          ...this.sort,
+          statusList: this.way == 'todo' ? [4, 5, 7] : [6, 10]
         };
 
         // 只有 tabValue == 1 才可能需要 workCenterIds 字段,可根据业务决定是否添加
@@ -993,7 +1000,7 @@
 
         const URL = this.tabValue == 1 ? getMyPage : getPage;
 
-        let res = await URL({ ...params, statusList });
+        let res = await URL({ ...params });
 
         this.loadTaskNames(res.list);
 
@@ -1225,9 +1232,9 @@
       /* 刷新表格 */
       reload(where = {}) {
         this.$nextTick(() => {
-          where.statusList = (
-            where.status || this.statusOpt[this.activeName][0].value
-          ).split(',');
+          // where.statusList = (
+          //   where.status || this.statusOpt[this.activeName][0].value
+          // ).split(',');
           this.$refs.table.reload({ page: 1, where });
         });
       },

+ 22 - 10
src/views/bpm/tickets/work/index.vue

@@ -41,6 +41,12 @@
       WorkSearch,
       DisposeDialog
     },
+    props: {
+      way: {
+        type: String,
+        default: 'todo'
+      }
+    },
     data() {
       return {
         visibleDialog: false,
@@ -145,9 +151,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) {
@@ -163,7 +174,7 @@
       },
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        where.status = 0
+        where.status = this.way == 'todo' ? 0 : 2;
         where.executorId = this.userInfo.userId;
         return getPlanOrderList({ pageNum: page, size: limit, ...where });
       },
@@ -184,13 +195,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
+        //   }
+        // });
       }
     }
   };