From c977c9fb967a080ca56ac46b1f17ce2c57f2122e Mon Sep 17 00:00:00 2001
From: Fixiaobai <fixiaobai@163.com>
Date: 星期四, 10 八月 2023 17:53:53 +0800
Subject: [PATCH] 	new file:   src/api/urlEnum/satisfactionSurveys.js 	modified:   src/views/CNAS/satisfactionSurveys/index.vue

---
 src/views/rawMaterials/reportForInspection/index.vue |  432 +++++++++++++++++++++++++++++++-----------------------
 1 files changed, 248 insertions(+), 184 deletions(-)

diff --git a/src/views/rawMaterials/reportForInspection/index.vue b/src/views/rawMaterials/reportForInspection/index.vue
index e8c9abe..e1663e3 100644
--- a/src/views/rawMaterials/reportForInspection/index.vue
+++ b/src/views/rawMaterials/reportForInspection/index.vue
@@ -1,207 +1,234 @@
 <template>
-  <div class="content-main">
-    <div class="top-bar">
-      <el-form ref="form" inline="true" :model="searchData">
-        <el-form-item>
-          <el-input
-            v-model="searchData.keyword"
-            class="input-form"
-            placeholder="璇疯緭鍏ョ敵璇峰崟鍙�/妫�楠屽璞�/瀵硅薄浣嶇疆/瀵硅薄鍚嶇О"
+  <div>
+    <template v-if="!showDetail">
+      <div class="content-main">
+        <div class="top-bar">
+          <el-form ref="form" :inline="true" :model="searchData">
+            <el-form-item>
+              <el-input
+                v-model="searchData.keyword"
+                class="input-form"
+                placeholder="璇疯緭鍏ョ敵璇峰崟鍙�/妫�楠屽璞�/瀵硅薄浣嶇疆/瀵硅薄鍚嶇О"
+              >
+                <i slot="prefix" class="el-input__icon el-icon-search" />
+              </el-input>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary">鏌ヨ</el-button>
+              <el-button type="primary" plain>閲嶇疆</el-button>
+            </el-form-item>
+            <el-dropdown>
+              <span class="retrieval">
+                楂樼骇妫�绱�<i class="el-icon-arrow-down el-icon--right" />
+              </span>
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item>榛勯噾绯�</el-dropdown-item>
+                <el-dropdown-item>鐙瓙澶�</el-dropdown-item>
+                <el-dropdown-item>铻鸿洺绮�</el-dropdown-item>
+                <el-dropdown-item disabled>鍙岀毊濂�</el-dropdown-item>
+                <el-dropdown-item divided>铓典粩鐓�</el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </el-form>
+          <el-form class="rightBtn">
+            <el-form-item class="getDataBtn">
+              <el-button type="primary" icon="el-icon-download" plain>鑾峰彇ERP鏁版嵁</el-button>
+            </el-form-item>
+            <el-form-item class="createBtn">
+              <el-button type="primary" icon="el-icon-plus" @click="checkTypeVisible = true">鏂板妫�楠屽崟</el-button>
+            </el-form-item>
+          </el-form>
+        </div>
+        <div class="library-table">
+          <div class="table-header">
+            <div class="search-bar">
+              <el-radio-group v-model="radioValue">
+                <el-radio-button label="鍏ㄩ儴" />
+                <el-radio-button label="寰呮彁浜�" />
+                <el-radio-button label="宸叉彁浜�" />
+                <el-radio-button label="宸蹭綔搴�" />
+              </el-radio-group>
+            </div>
+          </div>
+          <div class="table-box">
+            <el-table
+              ref="inspectionTable"
+              :max-height="800"
+              :cell-style="{textAlign: 'center'}"
+              :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}"
+              :data="inspectionTable"
+              style="width: 100%"
+            >
+              <el-table-column
+                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="createTime"
+                label="鍒涘缓鏃堕棿"
+                min-width="200"
+              />
+              <el-table-column
+                prop="userName"
+                label="鐢宠浜�"
+                min-width="200"
+              />
+              <el-table-column
+                prop="inspectUserId"
+                label="妫�楠屼汉"
+                min-width="200"
+              />
+              <el-table-column
+                prop="inspectionStatus"
+                label="妫�楠岀姸鎬�"
+                min-width="200"
+              />
+              <el-table-column
+                prop="qualifiedState"
+                label="鍚堟牸鐘舵��"
+                min-width="200"
+              />
+              <el-table-column
+                prop="inspectStartTime"
+                label="妫�楠屽紑濮嬫椂闂�"
+                min-width="200"
+              />
+              <el-table-column
+                prop="inspectEndTime"
+                label="妫�楠岀粨鏉熸椂闂�"
+                min-width="200"
+              />
+              <el-table-column
+                label="鎿嶄綔"
+                min-width="200"
+                fixed="right"
+              >
+                <template slot-scope="scope">
+                  <el-button type="text" size="small" @click="handleClick(scope.row)">鏌ョ湅</el-button>
+                  <el-button type="text" size="small">浣滃簾</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+            <!-- 鍒嗛〉鍣� -->
+            <div>
+              <el-pagination
+                :current-page="currentPage"
+                :page-sizes="[100, 200, 300, 400]"
+                :page-size="pageSize"
+                layout="total, sizes, prev, pager, next, jumper"
+                :total="total"
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+              />
+            </div>
+          </div>
+        </div>
+        <div class="checkType">
+          <el-dialog
+            title="鏂板妫�楠屽崟"
+            :visible.sync="checkTypeVisible"
+            width="40%"
           >
-            <i slot="prefix" class="el-input__icon el-icon-search" />
-          </el-input>
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary">鏌ヨ</el-button>
-          <el-button type="primary" plain>閲嶇疆</el-button>
-        </el-form-item>
-        <el-dropdown>
-          <span class="retrieval">
-            楂樼骇妫�绱�<i class="el-icon-arrow-down el-icon--right" />
-          </span>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item>榛勯噾绯�</el-dropdown-item>
-            <el-dropdown-item>鐙瓙澶�</el-dropdown-item>
-            <el-dropdown-item>铻鸿洺绮�</el-dropdown-item>
-            <el-dropdown-item disabled>鍙岀毊濂�</el-dropdown-item>
-            <el-dropdown-item divided>铓典粩鐓�</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-      </el-form>
-      <el-form class="rightBtn">
-        <el-form-item class="getDataBtn">
-          <el-button type="primary" icon="el-icon-download" plain>鑾峰彇ERP鏁版嵁</el-button>
-        </el-form-item>
-        <el-form-item class="createBtn">
-          <el-button type="primary" icon="el-icon-plus">鏂板妫�楠屽崟</el-button>
-        </el-form-item>
-      </el-form>
-    </div>
-    <div class="library-table">
-      <div class="table-header">
-        <div class="search-bar">
-          <el-radio-group v-model="radioValue">
-            <el-radio-button label="鍏ㄩ儴" />
-            <el-radio-button label="寰呮彁浜�" />
-            <el-radio-button label="宸叉彁浜�" />
-            <el-radio-button label="宸蹭綔搴�" />
-          </el-radio-group>
+            <div class="check-box">
+              <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>
+              </el-radio-group>
+            </div>
+            <span slot="footer" class="dialog-footer">
+              <el-button @click="checkTypeVisible = false">鍙� 娑�</el-button>
+              <el-button type="primary" @click="goToForInspectionDetail">纭� 瀹�</el-button>
+            </span>
+          </el-dialog>
         </div>
       </div>
-      <div class="table-box">
-        <el-table
-          ref="inspectionTable"
-          :max-height="800"
-          :cell-style="{textAlign: 'center'}"
-          :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}"
-          :data="inspectionTable"
-          style="width: 100%"
-        >
-          <el-table-column
-            prop="applicationOrdernumber"
-            label="鐢宠鍗曞彿"
-            min-width="200"
-          />
-          <el-table-column
-            prop="typeofInspection"
-            label="妫�楠岀被鍨�"
-            min-width="200"
-          />
-          <el-table-column
-            prop="objectofInspection"
-            label="妫�楠屽璞�"
-            min-width="200"
-          />
-          <el-table-column
-            prop="palceofObject"
-            label="瀵硅薄浣嶇疆"
-            min-width="200"
-          />
-          <el-table-column
-            prop="name"
-            label="瀵硅薄鍚嶇О"
-            min-width="200"
-          />
-          <el-table-column
-            prop="date"
-            label="鐧昏鏃ユ湡"
-            min-width="200"
-          />
-          <el-table-column
-            prop="registrant"
-            label="鐧昏浜�"
-            min-width="200"
-          />
-          <el-table-column
-            prop="applicationTime"
-            label="鐢宠鏃堕棿"
-            min-width="200"
-          />
-          <el-table-column
-            label="鎿嶄綔"
-            min-width="200"
-            :fixed="true"
-          >
-            <template slot-scope="scope">
-              <el-button type="text" size="small" @click="handleClick(scope.row)">鏌ョ湅</el-button>
-              <el-button type="text" size="small">浣滃簾</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-        <!-- 鍒嗛〉鍣� -->
-      <div>
-          <el-pagination
-            :current-page="currentPage"
-            :page-sizes="[100, 200, 300, 400]"
-            :page-size="pageSize"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="this.inspectionTable.length"
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-          />
-      </div>
-      </div>
-    </div>
+    </template>
+    <template v-else>
+      <router-view />
+    </template>
   </div>
 </template>
 
 <script>
+import { getInspectionList, addInspection } from '@/api/rawMaterials/reportForInspection'
 export default {
   data() {
     return {
+      showDetail: false,
       searchData: {
         keyword: ''
       },
       inspectionTable: [{
-        applicationOrdernumber: 'QC22-09155',
-        typeofInspection: '閲囪喘鍏ュ簱',
-        objectofInspection: 'MI202207032-1',
-        palceofObject: '---',
-        name: '杩欐槸涓�鏉℃祴璇曟暟鎹�',
-        date: '2022-09-23',
-        registrant: '绠$悊鍛�',
-        applicationTime: '111'
-      },
-      {
-        applicationOrdernumber: 'QC22-09155',
-        typeofInspection: '閲囪喘鍏ュ簱',
-        objectofInspection: 'MI202207032-1',
-        palceofObject: '---',
-        name: '杩欐槸涓�鏉℃祴璇曟暟鎹�',
-        date: '2022-09-23',
-        registrant: '绠$悊鍛�',
-        applicationTime: '111'
-      },
-      {
-        applicationOrdernumber: 'QC22-09155',
-        typeofInspection: '閲囪喘鍏ュ簱',
-        objectofInspection: 'MI202207032-1',
-        palceofObject: '---',
-        name: '杩欐槸涓�鏉℃祴璇曟暟鎹�',
-        date: '2022-09-23',
-        registrant: '绠$悊鍛�',
-        applicationTime: '111'
-      },
-      {
-        applicationOrdernumber: 'QC22-09155',
-        typeofInspection: '閲囪喘鍏ュ簱',
-        objectofInspection: 'MI202207032-1',
-        palceofObject: '---',
-        name: '杩欐槸涓�鏉℃祴璇曟暟鎹�',
-        date: '2022-09-23',
-        registrant: '绠$悊鍛�',
-        applicationTime: '111'
-      },
-      {
-        applicationOrdernumber: 'QC22-09155',
-        typeofInspection: '閲囪喘鍏ュ簱',
-        objectofInspection: 'MI202207032-1',
-        palceofObject: '---',
-        name: '杩欐槸涓�鏉℃祴璇曟暟鎹�',
-        date: '2022-09-23',
-        registrant: '绠$悊鍛�',
-        applicationTime: '111'
-      },
-      {
-        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, // 姣忛〉鐨勬暟鎹潯鏁�
-      radioValue: '鍏ㄩ儴'
+      pageSize: 10, // 姣忛〉鐨勬暟鎹潯鏁�
+      radioValue: '鍏ㄩ儴',
+      checkTypeVisible: false,
+      addInspectionType: 0
     }
   },
+  watch: {
+    $route: {
+      handler(val, oldval) {
+        console.log(val)// 鏂拌矾鐢变俊鎭�
+        console.log(oldval)// 鑰佽矾鐢变俊鎭�
+      },
+      // 娣卞害瑙傚療鐩戝惉
+      deep: true
+    }
+  },
+  created() {
+    this.getInspectionTableData()
+  },
+  updated() {
+    if (this.$route.name === 'ForInspectionDetail') this.showDetail = true
+  },
   methods: {
+    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) {
@@ -219,11 +246,43 @@
 </script>
 
 <style lang="scss" scoped>
-  .content-main{
+.checkType{
+  .check-box{
+    .el-radio-group{
+      display: flex;
+      justify-content: space-around;
+      .el-radio{
+        // display: flex;
+        // align-items: center;
+        &.is-checked{
+          background: #ecf5ff;
+          border-color: #b3d8ff;
+         ::v-deep  .el-radio__label{
+            color: #333 !important;
+
+          }
+        }
+        height: auto;
+        font-size: 22px !important;
+        padding: 20px 40px !important;
+        ::v-deep  .el-radio__label{
+          font-size: 22px !important;
+          padding-left: 0px !important;
+        }
+        ::v-deep  .el-radio__input{
+        display: none !important;
+      }
+    }
+ }
+  }
+}
+ .content-main{
     width: 100%;
     height: 100%;
     display: flex;
     flex-direction: column;
+    min-height: calc(100vh - 88px);
+    padding: 15px;
   }
   .top-bar{
     margin: -25px;
@@ -276,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