From 72f13e697d40c8fffc7aa0197fec4509bbe41569 Mon Sep 17 00:00:00 2001
From: ZhangXianQiang <1135831638@qq.com>
Date: 星期一, 06 五月 2024 11:36:10 +0800
Subject: [PATCH] Merge branch 'master' into dev-threejs

---
 src/views/system/check/result/detail/index.vue |   99 +++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 83 insertions(+), 16 deletions(-)

diff --git a/src/views/system/result/detail/index1.vue b/src/views/system/check/result/detail/index.vue
similarity index 72%
rename from src/views/system/result/detail/index1.vue
rename to src/views/system/check/result/detail/index.vue
index 72c3c32..d9326e2 100644
--- a/src/views/system/result/detail/index1.vue
+++ b/src/views/system/check/result/detail/index.vue
@@ -50,18 +50,33 @@
         <el-table-column label="鍒嗘暟" prop="score" align="center">
         </el-table-column>
         <el-table-column label="鐘舵��" prop="publish" align="center">
-        </el-table-column>
-        <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
           <template slot-scope="scope">
-            <el-button size="small" type="text" v-show="scope.row.publish != 1">纭鍙戝竷</el-button>
-            <el-button size="small" type="text" v-show="scope.row.publish == 1">鍙栨秷鍙戝竷</el-button>
-            <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row.id)">璇︾粏</el-button>
+            <dict-tag :options="dict.type.platform_is_publish" :value="scope.row.publish" />
+          </template>
+        </el-table-column>
+        <el-table-column label="鎿嶄綔" align="center">
+          <template slot-scope="scope">
+            <div style="display: flex;justify-content: center;">
+            <el-button size="small" type="text" @click="handlePublish(scope.row)" v-if="scope.row.publish === 'UNPUBLISHED'" >纭鍙戝竷</el-button>
+            <el-button size="small" type="text" @click="handlePublish(scope.row)" v-if="scope.row.publish === 'PUBLISHED'">鍙栨秷鍙戝竷</el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-view"
+              @click="handleDetail(scope.row.id)"
+            >璇︾粏</el-button>
+            </div>
           </template>
         </el-table-column>
       </el-table>
 
-      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
-        @pagination="getList" />
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParamsList.pageNum"
+      :limit.sync="queryParamsList.pageSize"
+      @pagination="getList"
+    />
 
     </div>
 
@@ -76,11 +91,15 @@
 let observer = null;
 export default {
   name: 'index',
-  dicts: ['platform_examine_use', 'platform_examine_category'],
+  dicts: ['platform_examine_category','platform_is_publish'],
   data() {
     return {
       activeIndex: '0',
       areaList: [],
+      province: {
+        id: [],
+        publish: null,
+      },
       date: '',
       dateRange: '',
       // 鎬绘潯鏁�
@@ -91,9 +110,15 @@
         deptId: null,
         examineTag: 0
       },
+      queryParamsList: {
+        pageNum: 1,
+        pageSize: 10,
+        deptId: null,
+        examineTag:0
+      },
       tableData: [],
-      loading: false,
       tableLoading: false,
+      loading: false,
       searchForm: {
         time: null,
       }
@@ -104,12 +129,16 @@
     console.log(this.$route.query.index)
     if (this.$route.query.index) {
       this.queryParams.deptId = this.$route.query.index
+      this.queryParamsList.deptId = this.$route.query.index
     }
     const date = new Date();
     const year = date.getFullYear();
     const month = (date.getMonth() + 1) >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1);
     this.date = year + '-' + month;
     this.queryParams.date = this.date;
+    this.queryParams.examineTag =this.$route.query.examineTag;
+    this.queryParamsList.examineTag =this.$route.query.examineTag;
+    this.activeIndex = this.$route.query.examineTag;
     this.areaSelect();
     this.getList(this.$route.query.index);
   },
@@ -117,6 +146,37 @@
 
   },
   methods: {
+    //鍙戝竷
+    handlePublish(row) {
+      const getExamineCategoryText = category => {
+        switch (category) {
+          case 1: return '瑙嗛鑰冩牳';
+          case 2: return '杞﹁締鑰冩牳';
+          case 3: return '浜鸿劯鑰冩牳';
+          default: return '鏈煡';
+        }
+      };
+
+      const year = row.createTime.substr(0, 4);
+      const month = (parseInt(row.createTime.substr(5, 2), 10)).toString();
+      const day = (parseInt(row.createTime.substr(8, 2), 10)).toString();
+      const formattedCreateTime = year + '骞�' + month + '鏈�' + day + '鏃�';
+
+      let text = row.publish === 'UNPUBLISHED' ? '鍙戝竷' : '鍙栨秷鍙戝竷';
+      this.province.id = [row.id]
+      this.province.publish = text === "鍙戝竷" ? "PUBLISHED" : "UNPUBLISHED";
+      this.$modal.confirm('纭瑕�' + text + "" + getExamineCategoryText(row.examineCategory) + "" + formattedCreateTime + '鐨勮�冩牳鎴愮哗鍚楋紵')
+        .then(() => {
+          return publishScore(this.province);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess(text + "鎴愬姛");
+        })
+        .catch(() => {
+          // 閿欒澶勭悊閫昏緫
+        });
+    },
     // 鍖哄煙涓嬫媺鏁版嵁
     areaSelect() {
       areaSelect().then(res => {
@@ -131,8 +191,9 @@
     handleSelect(key) {
       this.activeIndex = key;
       this.queryParams.examineTag = key;
+      this.queryParamsList.examineTag = key;
       this.getChart(this.queryParams.deptId);
-      this.getList(this.queryParams.deptId);
+      this.getList(this.queryParamsList.deptId);
     },
     /** 鏌ヨ鑰冩牳妯℃澘鍒楄〃 */
     getChart(deptId) {
@@ -146,7 +207,7 @@
     /** 鏌ヨ鑰冩牳妯℃澘鍒楄〃 */
     getList() {
       this.tableLoading = true;
-      detailScore(this.queryParams).then(response => {
+      detailScore(this.queryParamsList).then(response => {
         this.tableData = response.rows;
         this.total = response.total;
         this.tableLoading = false;
@@ -160,9 +221,11 @@
     },
     handleDetail(id) {
       this.$router.push({
-        path: '/examine/detail/detail',
+        path: '/check/detail/detail',
         query: {
           id: id,
+          examineTag: this.activeIndex,
+          deptId: this.queryParamsList.deptId
         }
       })
     },
@@ -196,7 +259,7 @@
         series: [
           {
             name: '杞﹁締鑰冩牳',
-            data: this.filterData(dataList, 0),
+            data: this.filterData(dataList, 2),
             type: 'line',
             itemStyle: {
               color: 'rgba(62, 144, 247, 1)'
@@ -204,7 +267,7 @@
           },
           {
             name: '浜鸿劯鑰冩牳',
-            data: this.filterData(dataList, 1),
+            data: this.filterData(dataList, 3),
             type: 'line',
             itemStyle: {
               color: 'rgba(85, 192, 191, 1)'
@@ -212,7 +275,7 @@
           },
           {
             name: '瑙嗛鑰冩牳',
-            data: this.filterData(dataList, 2),
+            data: this.filterData(dataList, 1),
             type: 'line',
             itemStyle: {
               color: 'rgba(255, 165, 0, 1)'
@@ -252,6 +315,10 @@
     },
 
     getAllDay() {
+      // const date = new Date();
+      // const year = date.getFullYear();
+      // const month = (date.getMonth() + 1) >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1);
+      // this.date = year + '-' + month;
       const currentDate = this.date.split('-');
       const currentYear = currentDate[0];
       const currentMonth = currentDate[1];
@@ -282,8 +349,8 @@
 
     dateChange() {
       this.queryParams.date = this.date;
+      console.log(this.queryParams);
       this.getChart(this.queryParams.deptId);
-      this.getList(this.queryParams.deptId);
     }
 
   },

--
Gitblit v1.8.0