فهرست منبع

feat: 新增质量检查检测记录页面

yusheng 1 ماه پیش
والد
کامیت
7275b59e48

+ 1 - 0
src/views/home/index.vue

@@ -5,6 +5,7 @@
     v-model="isFullscreen"
     fullscreenClass="box-container"
     :exit-on-click-wrapper="false"
+    :style="{height:isFullscreen?'100vh':'calc(100vh - 97px)'}"
   >
     <div class="box-content">
       <div class="scroll-wrapper">

+ 86 - 0
src/views/qualityTestRecords/index.vue

@@ -0,0 +1,86 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <div class="switch">
+        <div class="switch_left">
+          <ul>
+            <li
+              v-for="item in tabOptions"
+              :key="item.key"
+              :class="{ active: activeComp == item.key }"
+              @click="handleClick(item)"
+            >
+              {{ item.name }}
+            </li>
+          </ul>
+        </div>
+        <!-- <div class="right" style="padding: 10px">
+          <el-button @click="$router.go(-1)">返回</el-button>
+        </div> -->
+      </div>
+      <div class="main">
+        <div v-if="activeComp == 'plan'">
+          <plan ref="tableRef" :pageName="'qualityTestRecords'"></plan>
+        </div>
+        <div v-if="activeComp == 'workOrder'">
+          <workOrder ref="tableRef" :pageName="'qualityTestRecords'"></workOrder>
+        </div>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import plan from '@/views/recordComponents/plan.vue';
+  import workOrder from '@/views/recordComponents//workOrder.vue';
+
+  export default {
+    components: {
+      plan,
+      workOrder
+    },
+    data() {
+      return {
+        activeComp: 'plan',
+        tabOptions: [
+          { key: 'plan', name: '计划' },
+          { key: 'workOrder', name: '工单' }
+        ],
+        // 加载状态
+        loading: false
+      };
+    },
+    mounted() {
+      console.log(this.$route.query);
+      switch (this.$route.query.title) {
+        case '计划':
+          this.activeComp = 'plan';
+          break;
+        case '工单':
+          this.activeComp = 'workOrder';
+          break;
+        default:
+          break;
+      }
+    },
+    methods: {
+      handleClick(val) {
+        this.activeComp = val.key;
+        this.$refs.tableRef && this.$refs.tableRef.reload();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  ::v-deep .el-card__body {
+    padding-top: 0;
+    padding-left: 0;
+  }
+  .main {
+    padding-left: 17px;
+    .plan {
+      padding-top: 15px;
+    }
+  }
+</style>

+ 6 - 1
src/views/recordComponents/plan.vue

@@ -117,6 +117,7 @@
           productionRecords: 2,
           steamInjectionInspectionRecord: 3,
           solidWasteRecord: 4,
+          qualityTestRecords: 5,
           boilerOperationRecord: 6
         },
 
@@ -388,7 +389,11 @@
               ? '生产记录'
               : this.pageName == 'steamInjectionInspectionRecord'
               ? '注汽检查记录'
-              :this.pageName == 'solidWasteRecord'? '固废记录':'锅炉运行记录'
+              : this.pageName == 'solidWasteRecord'
+              ? '固废记录'
+              : this.pageName == 'qualityTestRecords'
+              ? '质量检查检测记录'
+              : '锅炉运行记录'
           )
         );
       },

+ 85 - 16
src/views/recordComponents/programRulesDialog.vue

@@ -139,7 +139,6 @@
               multiple
               filterable
               @change="executeIdListChange"
-      
             >
               <el-option
                 v-for="item in executorList"
@@ -535,23 +534,58 @@
         <template v-slot:toolName="{ row, $index }">
           <el-link :underline="false" style="cursor: pointer">
             <div class="ele-cell">
-              <div @click="handleAdd(row, $index)">
+              <div @click="handleAdd(row, '', 'toolName')">
+                {{
+                  row.tools && row.tools.length > 0
+                    ? row.tools.map((i) => i.toolName).join(',')
+                    : '请选择'
+                }}
+              </div>
+              <i
+                v-if="row.tools.length == 0"
+                class="el-icon-arrow-down"
+                @click="handleAdd(row, '', 'toolName')"
+              ></i>
+              <i
+                v-else
+                class="el-icon-close"
+                @click="clearTool(row, '', 'toolName')"
+              ></i>
+            </div>
+          </el-link>
+        </template>
+        <template v-slot:substanceName="{ row, $index }">
+          <el-link :underline="false" style="cursor: pointer">
+            <div class="ele-cell">
+              <div @click="handleAdd(row, $index, 'substanceName')">
                 {{ row.substanceName || '请选择' }}
               </div>
               <i
                 v-if="!row.substanceName"
                 class="el-icon-arrow-down"
-                @click="handleAdd(row, $index)"
+                @click="handleAdd(row, $index, 'substanceName')"
               ></i>
               <i
                 v-else
                 class="el-icon-close"
-                @click="clearTool(row, $index)"
+                @click="clearTool(row, $index, 'substanceName')"
               ></i>
             </div>
           </el-link>
         </template>
         <template v-slot:toolCodes="{ row }">
+          <el-input
+            :value="
+              row.tools && row.tools.length > 0
+                ? row.tools.map((i) => i.toolCode).join(',')
+                : ''
+            "
+            placeholder="自动带出"
+            disabled
+            size="mini"
+          ></el-input>
+        </template>
+        <template v-slot:substanceCode="{ row }">
           <el-input
             :value="row.substanceCode"
             placeholder="自动带出"
@@ -892,15 +926,29 @@
             minWidth: 110
           },
           {
-            prop: 'toolName',
+            prop: 'substanceName',
             label: '设备名称',
             align: 'center',
+            slot: 'substanceName',
+            minWidth: 110
+          },
+          {
+            prop: 'substanceCode',
+            label: '设备编码',
+            align: 'center',
+            slot: 'substanceCode',
+            minWidth: 110
+          },
+          {
+            prop: 'toolName',
+            label: '工具名称',
+            align: 'center',
             slot: 'toolName',
             minWidth: 110
           },
           {
             prop: 'toolCodes',
-            label: '设备编码',
+            label: '工具编码',
             align: 'center',
             slot: 'toolCodes',
             minWidth: 110
@@ -1192,6 +1240,7 @@
           this.addForm.deviceId = info.id;
           this.addForm.deviceCode = info.code;
           this.addForm.deviceName = info.name;
+          this.addForm.detailList=[]
         }
       },
       // 添加
@@ -1242,15 +1291,31 @@
         }
       },
 
-      handleAdd(row, index) {
+      // handleAdd(row, index) {
+      //   this.currentRow = row;
+      //   this.currentIndex = index;
+      //   this.$refs.bindSubstanceRef.open(
+      //     this.addForm.deviceId,
+      //     this.addForm.deviceName,
+      //     this.addForm.deviceCode
+      //   );
+      // },
+
+
+      handleAdd(row, index,type) {
         this.currentRow = row;
         this.currentIndex = index;
-        this.$refs.bindSubstanceRef.open(
-          this.addForm.deviceId,
-          this.addForm.deviceName,
-          this.addForm.deviceCode
-        );
+        if (type=='substanceName') {
+          this.$refs.bindSubstanceRef.open(
+            this.formData.deviceId,
+            this.formData.deviceName,
+            this.formData.deviceCode
+          );
+        } else {
+          this.$refs.toolModalRef.open(row.toolCodes);
+        }
       },
+
       bindSubstanceListOpen() {
         this.currentIndex = 9999;
         this.$refs.bindSubstanceRef.open(
@@ -1276,7 +1341,7 @@
               minValue: item.minValue,
               paramType: 7,
               paramValue: item.paramValue,
-              iotId:item.iotId,
+              iotId: item.iotId,
               remark: '',
               symbol: null,
               tools: [],
@@ -1308,9 +1373,13 @@
       },
       // 清空工具
       clearTool(row, index) {
-        substanceKey.forEach((key) => {
-          this.$set(this.addForm.detailList[index], key, '');
-        });
+       if (type=='substanceName') {
+          substanceKey.forEach((key) => {
+            this.$set(this.formData.details[index], key, '');
+          });
+        } else {
+          row.tools = [];
+        }
       },
       // 选择物品 产品、物料等
       selectChooseModalProduct(row) {

+ 10 - 0
src/views/recordComponents/workOrder.vue

@@ -86,6 +86,7 @@
           productionRecords: 2,
           steamInjectionInspectionRecord: 3,
           solidWasteRecord: 4,
+          qualityTestRecords: 5,
           boilerOperationRecord: 6
         },
         columns: [
@@ -204,6 +205,15 @@
             minWidth: 110,
             isNone: this.pageName != 'solidWasteRecord'
           },
+          {
+            prop: 'contactName',
+            label: '联合站检查人',
+            align: 'center',
+            showOverflowTooltip: true,
+            isNone: this.pageName != 'qualityTestRecords',
+            minWidth: 110
+          },
+
           {
             prop: 'status',
             label: '状态',

+ 80 - 20
src/views/recordComponents/workOrderReport.vue

@@ -242,6 +242,25 @@
           <div> {{ row.paramValue }}</div>
         </template>
 
+        <template v-slot:checkUsersIds="{ row }">
+          <div>
+            <el-select
+              v-model="row.checkUsersIds"
+              placeholder="请选择检查人"
+              filterable
+              multiple
+              @change="checkUsersIdsChange(row)"
+            >
+              <el-option
+                v-for="item in addForm.executeUsers"
+                :label="item.userName"
+                :value="item.userId"
+                :key="item.userId"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </template>
         <template v-slot:checkStatus="{ row }">
           <div>
             <el-radio-group v-model="row.checkStatus">
@@ -250,6 +269,20 @@
             </el-radio-group>
           </div>
         </template>
+        <template v-slot:errorMsg="{ row }">
+          <div>
+            <el-input
+              type="text"
+              :rows="1"
+              placeholder="请输入"
+              v-model="row.errorMsg"
+            >
+              <template v-if="row.unitName" slot="append">
+                <div>{{ row.unitName }}</div>
+              </template>
+            </el-input>
+          </div></template
+        >
         <template v-slot:num="{ row }">
           <div>
             <el-input type="number" placeholder="请输入" v-model="row.num">
@@ -514,29 +547,41 @@
             label: '数量',
             prop: 'num',
             minWidth: 120,
-            slot: 'num'
+            slot: 'num',
+            isNone: this.pageName == 'qualityTestRecords'
+          },
+          {
+            label: '检查人',
+            prop: 'checkUsersIds',
+            minWidth: 120,
+            slot: 'checkUsersIds',
+            isNone: this.pageName != 'qualityTestRecords'
+          },
+          {
+            label: '描述',
+            prop: 'errorMsg',
+            minWidth: 120,
+            slot: 'errorMsg',
+            isNone: this.pageName != 'qualityTestRecords'
+          },
+          {
+            label: '检查情况',
+            prop: 'checkStatus',
+            minWidth: 120,
+            slot: 'checkStatus',
+            isNone: this.pageName == 'productionRecords'
+          },
+
+          {
+            label: '检查结果',
+            prop: 'checkResult',
+            minWidth: 120,
+            isNone: this.pageName == 'productionRecords',
+            slot: 'checkResult'
           }
         ];
 
-        if (this.pageName != 'productionRecords') {
-          list = [
-            ...list,
-            {
-              label: '检查情况',
-              prop: 'checkStatus',
-              minWidth: 120,
-              slot: 'checkStatus'
-            },
-
-            {
-              label: '检查结果',
-              prop: 'checkResult',
-              minWidth: 120,
-              slot: 'checkResult'
-            }
-          ];
-        }
-        return list;
+        return list.filter((item) => !item.isNone);
       }
     },
     created() {
@@ -786,6 +831,21 @@
             });
           }
         });
+        this.addForm.detailList.forEach((detail) => {
+          detail.checkUsersIds = this.addForm.executeUsersIds;
+          detail.checkUsers = this.addForm.executeUsers;
+        });
+      },
+      checkUsersIdsChange(row) {
+        // 同步 checkUsers
+        row.checkUsers = row.checkUsersIds.map((i) => {
+          const user = this.addForm.executeUsers.find(
+            (item) => item.userId === i
+          );
+          return user;
+        });
+
+        console.log('row', row);
       },
       checkChange() {
         this.addForm.executeUsersIds = [];