From 85f689b65f4fb915ffe6bb2e5e65d7a88dc22865 Mon Sep 17 00:00:00 2001
From: yuyu <1981343953@qq.com>
Date: 星期四, 10 八月 2023 16:59:25 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.110.209:9001/r/lims-before

---
 src/views/rawMaterials/reportForInspection/index.vue |  128 ++++++++++++++++++++++++------------------
 1 files changed, 74 insertions(+), 54 deletions(-)

diff --git a/src/views/rawMaterials/reportForInspection/index.vue b/src/views/rawMaterials/reportForInspection/index.vue
index 62ec587..e1663e3 100644
--- a/src/views/rawMaterials/reportForInspection/index.vue
+++ b/src/views/rawMaterials/reportForInspection/index.vue
@@ -60,43 +60,49 @@
               style="width: 100%"
             >
               <el-table-column
-                prop="applicationOrdernumber"
-                label="鐢宠鍗曞彿"
-                min-width="200"
-              />
-              <el-table-column
-                prop="typeofInspection"
+                prop="type"
                 label="妫�楠岀被鍨�"
                 min-width="200"
-              />
+              >
+                <template slot-scope="scope">
+                  <span v-if="scope.row.type===0">鍘熸潗鏂欐楠�</span>
+                  <span v-else-if="scope.row.type===1">鍗婃垚鍝佹楠�</span>
+                  <span v-else-if="scope.row.type===2">鎴愬搧妫�楠�</span>
+                </template>
+              </el-table-column>
               <el-table-column
-                prop="objectofInspection"
-                label="妫�楠屽璞�"
+                prop="createTime"
+                label="鍒涘缓鏃堕棿"
                 min-width="200"
               />
               <el-table-column
-                prop="palceofObject"
-                label="瀵硅薄浣嶇疆"
+                prop="userName"
+                label="鐢宠浜�"
                 min-width="200"
               />
               <el-table-column
-                prop="name"
-                label="瀵硅薄鍚嶇О"
+                prop="inspectUserId"
+                label="妫�楠屼汉"
                 min-width="200"
               />
               <el-table-column
-                prop="date"
-                label="鐧昏鏃ユ湡"
+                prop="inspectionStatus"
+                label="妫�楠岀姸鎬�"
                 min-width="200"
               />
               <el-table-column
-                prop="registrant"
-                label="鐧昏浜�"
+                prop="qualifiedState"
+                label="鍚堟牸鐘舵��"
                 min-width="200"
               />
               <el-table-column
-                prop="applicationTime"
-                label="鐢宠鏃堕棿"
+                prop="inspectStartTime"
+                label="妫�楠屽紑濮嬫椂闂�"
+                min-width="200"
+              />
+              <el-table-column
+                prop="inspectEndTime"
+                label="妫�楠岀粨鏉熸椂闂�"
                 min-width="200"
               />
               <el-table-column
@@ -117,7 +123,7 @@
                 :page-sizes="[100, 200, 300, 400]"
                 :page-size="pageSize"
                 layout="total, sizes, prev, pager, next, jumper"
-                :total="this.inspectionTable.length"
+                :total="total"
                 @size-change="handleSizeChange"
                 @current-change="handleCurrentChange"
               />
@@ -131,7 +137,7 @@
             width="40%"
           >
             <div class="check-box">
-              <el-radio-group v-model="type">
+              <el-radio-group v-model="addInspectionType">
                 <el-radio :label="0" border>鍘熸潗鏂欐楠�</el-radio>
                 <el-radio :label="1" border>鍗婃垚鍝佹楠�</el-radio>
                 <el-radio :label="2" border>鎴愬搧妫�楠�</el-radio>
@@ -152,6 +158,7 @@
 </template>
 
 <script>
+import { getInspectionList, addInspection } from '@/api/rawMaterials/reportForInspection'
 export default {
   data() {
     return {
@@ -160,21 +167,25 @@
         keyword: ''
       },
       inspectionTable: [{
-        applicationOrdernumber: 'QC22-09155',
-        typeofInspection: '閲囪喘鍏ュ簱',
-        objectofInspection: 'MI202207032-1',
-        palceofObject: '---',
-        name: '杩欐槸涓�鏉℃祴璇曟暟鎹�',
-        date: '2022-09-23',
-        registrant: '绠$悊鍛�',
-        applicationTime: '111'
+        'id': '1681215775833042945',
+        'type': 0,
+        'inspectionStatus': 0,
+        'qualifiedState': null,
+        'state': 1,
+        'createTime': '2023-07-18 16:14:11',
+        'updateTime': null,
+        'version': null,
+        'userName': '娴嬭瘯浜哄憳',
+        'inspectUserId': null,
+        'inspectStartTime': null,
+        'inspectEndTime': null
       }],
       currentPage: 1,
       total: 20, // 鎬绘潯鏁�
-      pageSize: 100, // 姣忛〉鐨勬暟鎹潯鏁�
+      pageSize: 10, // 姣忛〉鐨勬暟鎹潯鏁�
       radioValue: '鍏ㄩ儴',
       checkTypeVisible: false,
-      type: 0
+      addInspectionType: 0
     }
   },
   watch: {
@@ -187,35 +198,37 @@
       deep: true
     }
   },
-  // beforeRouteEnter(to, from, next) {
-  //   console.log(to, from)
-  //   next()
-  //   // 鍦ㄦ覆鏌撹缁勪欢鐨勫搴旇矾鐢辫 confirm 鍓嶈皟鐢�
-  //   // 涓嶏紒鑳斤紒鑾峰彇缁勪欢瀹炰緥 `this`
-  //   // 鍥犱负褰撻挬瀛愭墽琛屽墠锛岀粍浠跺疄渚嬭繕娌¤鍒涘缓
-  // },
-  // beforeRouteUpdate(to, from, next) {
-  //   console.log(to, from)
-  //   if (to.name === 'ForInspectionDetail') this.showDetail = true
-  //   this.$nextTick(() => {
-  //     console.log(1)
-  //     this.showDetail = true
-  //   })
-  //   next()
-  //   // 鍦ㄥ綋鍓嶈矾鐢辨敼鍙橈紝浣嗘槸璇ョ粍浠惰澶嶇敤鏃惰皟鐢�
-  //   // 涓句緥鏉ヨ锛屽浜庝竴涓甫鏈夊姩鎬佸弬鏁扮殑璺緞 /foo/:id锛屽湪 /foo/1 鍜� /foo/2 涔嬮棿璺宠浆鐨勬椂鍊欙紝
-  //   // 鐢变簬浼氭覆鏌撳悓鏍风殑 Foo 缁勪欢锛屽洜姝ょ粍浠跺疄渚嬩細琚鐢ㄣ�傝�岃繖涓挬瀛愬氨浼氬湪杩欎釜鎯呭喌涓嬭璋冪敤銆�
-  //   // 鍙互璁块棶缁勪欢瀹炰緥 `this`
-  // },
+  created() {
+    this.getInspectionTableData()
+  },
   updated() {
     if (this.$route.name === 'ForInspectionDetail') this.showDetail = true
   },
   methods: {
-    goToForInspectionDetail() {
-      this.$router.push('/rawMaterials/reportForInspection/forInspectionDetail')
+    async getInspectionTableData() {
+      const res = await getInspectionList({ pageSize: this.currentPage, countSize: this.pageSize })
+      // this.inspectionTable = data
+      console.log(res)
+      this.inspectionTable = res.data
     },
+    async goToForInspectionDetail() {
+      try {
+        //
+        const form = new FormData()
+        form.append('type', this.addInspectionType)
+        let { data: inspectionDetail } = await addInspection(form)
+        // console.log(res)
+        inspectionDetail = JSON.stringify(inspectionDetail)
+        this.$message.success('娣诲姞鎴愬姛')
+        this.$router.push({ path: '/rawMaterials/reportForInspection/forInspectionDetail', query: { inspectionDetail }})
+      } catch (error) {
+        this.$message.error('娣诲姞澶辫触')
+      }
+    },
+    // 鏌ョ湅瀵瑰簲鐢宠鍗曡鎯�
     handleClick(row) {
-      console.log(row)
+      const inspectionDetail = JSON.stringify(row)
+      this.$router.push({ path: '/rawMaterials/reportForInspection/forInspectionDetail', query: { inspectionDetail }})
     },
     // 姣忛〉鏉℃暟鏀瑰彉鏃惰Е鍙� 閫夋嫨涓�椤垫樉绀哄灏戣
     handleSizeChange(val) {
@@ -268,6 +281,8 @@
     height: 100%;
     display: flex;
     flex-direction: column;
+    min-height: calc(100vh - 88px);
+    padding: 15px;
   }
   .top-bar{
     margin: -25px;
@@ -320,6 +335,11 @@
           flex-direction: column;
           .el-table {
             flex: 1;
+            display: flex;
+            flex-direction: column;
+            ::v-deep .el-table__body-wrapper{
+              flex: 1;
+            }
           }
           >div:nth-child(2){
             display: flex;

--
Gitblit v1.9.3