From 5857dfa10b70a061b8e4711dd8f18b585ac6fc23 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 25 二月 2025 17:43:37 +0800
Subject: [PATCH] ll

---
 admin/src/views/task/index.vue |  145 +++++++++++++++++++++++-------------------------
 1 files changed, 69 insertions(+), 76 deletions(-)

diff --git a/admin/src/views/task/index.vue b/admin/src/views/task/index.vue
index 00740fb..4eb6bd9 100644
--- a/admin/src/views/task/index.vue
+++ b/admin/src/views/task/index.vue
@@ -1,18 +1,9 @@
 <template>
   <div class="main_app">
-    <QueryForm
-      v-model="filters"
-      :query-form-config="queryFormConfig"
-      @handleQuery="getList(1)"
-      @clear="clear"
-      @changeForm='changeForm'
-    >
+    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getHeadData(1)" @clear="clear"
+      @changeForm='changeForm'>
       <template #fastdate>
-        <el-radio-group
-          v-model="filters.fastdate"
-          size="small"
-          @input="changeRadio"
-        >
+        <el-radio-group v-model="filters.fastdate" size="small" @input="changeRadio">
           <el-radio-button label="0">褰撳ぉ</el-radio-button>
           <el-radio-button label="6">杩�7澶�</el-radio-button>
           <el-radio-button label="29">杩�30澶�</el-radio-button>
@@ -20,17 +11,11 @@
       </template>
     </QueryForm>
     <!--  -->
-    <el-tabs v-model="filters.queryType" @tab-click="(e) => getList(1)">
+    <el-tabs v-model="filters.queryType" @tab-click="(e) => getHeadData(1)">
       <el-tab-pane label="寰呭鐞�" name="0">
         <template #label>
-          <span
-            >寰呭鐞�
-            <el-badge
-              v-if="headData.noticeWaitNum"
-              :value="headData.noticeWaitNum"
-              class="item"
-              type="danger"
-            >
+          <span>寰呭鐞�
+            <el-badge v-if="headData.noticeWaitNum" :value="headData.noticeWaitNum" class="item" type="danger">
             </el-badge>
           </span>
         </template>
@@ -41,57 +26,40 @@
       </el-tab-pane>
       <el-tab-pane :value="headData.noticeCopyNum" label="鎶勯�佹垜鐨�" name="3">
         <template #label>
-          <span
-            >鎶勯�佹垜鐨�
-            <el-badge
-              v-if="headData.noticeCopyNum"
-              :value="headData.noticeCopyNum"
-              class="item"
-              type="danger"
-            >
+          <span>鎶勯�佹垜鐨�
+            <el-badge v-if="headData.noticeCopyNum" :value="headData.noticeCopyNum" class="item" type="danger">
             </el-badge>
           </span>
         </template>
       </el-tab-pane>
     </el-tabs>
-    <el-table
-      v-loading="loading"
-      :data="dataList"
-      stripe
-      row-key="id"
-      class="mb20"
-      default-expand-all
-    >
-      <el-table-column label="澶勭悊浜嬮」" min-width="200">
-        <template slot-scope="{ row }"> {{ row.title}}
+    <el-table v-loading="loading" :data="dataList" stripe row-key="id" class="mb20" default-expand-all>
+      <el-table-column label="澶勭悊浜嬮」" min-width="160">
+        <template slot-scope="{ row }"> {{ row.title }}
         </template>
       </el-table-column>
+      <el-table-column prop="info" label="褰撳墠闃舵" min-width="100"></el-table-column>
       <el-table-column prop="createDate" label="鎻愪氦鏃堕棿" min-width="100">
       </el-table-column>
       <el-table-column label="鎿嶄綔" width="230" fixed="right">
         <template slot-scope="{ row }">
-          <el-button
-            type="text"
-            @click="handleDetail(row)"
-            v-permissions="['business:company:update']"
-            >鏌ョ湅璇︽儏</el-button
-          >
+          <el-button type="text" @click="handleDetail(row)">鏌ョ湅璇︽儏</el-button>
         </template>
       </el-table-column>
     </el-table>
-    <pagination
-      @size-change="handleSizeChange"
-      @current-change="getList"
-      :pagination="pagination"
-    />
-    <TaskDetail v-if="isShowDetail" ref="DetailRef" />
-    <VisReportDetail v-if="isShowReport" ref="VisReportDetailRef" />
-    <DangetDetail v-if="isShowDanger" ref="DangetDetailRef" />
-    <DriverDetail v-if="isShowDriver" ref="DriverDetailRef" />
+    <pagination @size-change="handleSizeChange" @current-change="getHeadData" :pagination="pagination" />
+    <TaskDetail v-if="isShowDetail" ref="DetailRef" @close="isShowDetail = false"
+      @success="SubSuccess('isShowDetail')" />
+    <VisReportDetail v-if="isShowReport" ref="VisReportDetailRef" @close="isShowReport = false"
+      @success="SubSuccess('isShowReport')" />
+    <DangetDetail v-if="isShowDanger" ref="DangetDetailRef" @close="isShowDanger = false"
+      @success="SubSuccess('isShowDanger')" />
+    <DriverDetail v-if="isShowDriver" ref="DriverDetailRef" @close="isShowDriver = false"
+      @success="SubSuccess('isShowDriver')" />
     <!-- 鐢ㄨ溅鐢宠 -->
-    <OperaCarUseBookWindow ref="OperaDetailsWindow" @success="getList" />
+    <OperaCarUseBookWindow ref="OperaDetailsWindow" @success="getHeadData" />
     <!-- 闅愭偅 -->
-    <OperaHiddenDangerWindow ref="OperaHiddenDangerWindow" @success="getList" />
+    <OperaHiddenDangerWindow ref="OperaHiddenDangerWindow" @success="getHeadData" />
     <!-- 棰勭害璇︽儏 -->
     <OperaVisitsDesWindow ref="OperaVisitsDesWindow" />
   </div>
@@ -109,6 +77,7 @@
 import OperaVisitsDesWindow from '@/components/business/OperaVisitsDesWindow'
 import dayjs from 'dayjs'
 import {
+  getAppHeaderNav,
   taskCenterHeadPC,
   taskCenterPage,
   taskSignRead
@@ -125,7 +94,7 @@
     OperaHiddenDangerWindow,
     OperaVisitsDesWindow
   },
-  data () {
+  data() {
     return {
       isShowDetail: false,
       isShowReport: false,
@@ -133,7 +102,7 @@
       isShowDriver: false,
       filters: {
         queryType: '0',
-        fastdate: 0
+        // fastdate: 0
       },
       queryFormConfig: {
         formItems: [
@@ -165,12 +134,12 @@
       },
       pagination: {
         capacity: 10,
-        page: 1
+        page: 1,
+        total: 0,
       },
       loading: false,
       dataList: [],
       headData: {},
-      total: 0,
 
       cateList: [
         { name: '璁垮鐢宠', id: 0 },
@@ -181,18 +150,37 @@
       ]
     }
   },
-  created () {
+  created() {
     // this.getHeadData()
-    this.changeRadio('0')
-    this.getList()
+    // this.changeRadio('0')
+    this.getHeadData()
   },
   methods: {
-    changeRadio (day) {
+    changeRadio(day) {
       const arr = [dayjs().subtract(day, 'day').format('YYYY-MM-DD') + ' 00:00:00', dayjs().format('YYYY-MM-DD') + ' 23:59:59']
       this.$set(this.filters, 'selTime', arr)
-      this.getList()
+      this.getHeadData()
     },
-    handleDetail (row) {
+    SubSuccess(str) {
+      this[str] = false
+      this.getHeadData()
+    },
+    handleTest(row) {
+      getAppHeaderNav(5).then(res => {
+        if (res === undefined || res == null) {
+          return
+        }
+        const myWindow = window.open(res)
+        setTimeout(() => {
+          myWindow.postMessage('{"method":"goToApp","argument":' + row.param5 + '}', '*')
+        }, 3000)
+      })
+    },
+    handleDetail(row) {
+      if (row.type === 7) {
+        this.handleTest(row)
+        return
+      }
       if (this.filters.queryType == 3) {
         taskSignRead({
           noticesId: row.id,
@@ -241,15 +229,13 @@
         })
       }
     },
-    changeForm (str) {
+    changeForm(str) {
       if (str === 'selTime') {
         this.$set(this.filters, 'fastdate', null)
-        this.getList()
+        this.getHeadData()
       }
     },
-    getList (page) {
-      this.getHeadData()
-      console.log(this.filters)
+    getList(page) {
       const { filters, pagination } = this
       if (filters.selTime && filters.selTime.length > 0) {
         filters.startDate = filters.selTime[0]
@@ -264,13 +250,17 @@
         ...pagination
       }).then(res => {
         console.log('res', res)
+        this.loading = false
         this.dataList = res.records || []
+        this.pagination.total = res.total || 0
         this.dataList.forEach(i => {
           i.param1 = JSON.parse(i.param1)
+        }, () => {
+          this.loading = false
         })
       })
     },
-    getHeadData () {
+    getHeadData(page) {
       const { filters } = this
       if (filters.selTime && filters.selTime.length > 0) {
         filters.startDate = filters.selTime[0]
@@ -279,18 +269,21 @@
         filters.startDate = null
         filters.endDate = null
       }
+      this.loading = true
       taskCenterHeadPC({ ...filters, queryType: Number(filters.queryType), isDetail: '1' }).then(res => {
         this.headData = res
+        this.getList(1)
+      }, () => {
+        this.loading = false
       })
     },
-    clear () {
+    clear() {
       this.filters = {
         queryType: '0',
-        fastdate: 0
       }
-      this.getList(0)
+      this.getHeadData(0)
     },
-    handleSizeChange (capacity) {
+    handleSizeChange(capacity) {
       this.pagination.capacity = capacity
     }
   }

--
Gitblit v1.9.3