From 7298d5354963a88643a543b51b90192dc9fc934c Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 11 九月 2025 18:43:14 +0800
Subject: [PATCH] 最新版本541200007

---
 admin/src/views/business/reportRecord.vue |  256 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 226 insertions(+), 30 deletions(-)

diff --git a/admin/src/views/business/reportRecord.vue b/admin/src/views/business/reportRecord.vue
index 348d2ef..2cba9f7 100644
--- a/admin/src/views/business/reportRecord.vue
+++ b/admin/src/views/business/reportRecord.vue
@@ -1,52 +1,153 @@
 <template>
-  <div class="main_app">
-    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" />
-    <el-table v-loading="loading" :data="list" stripe row-key="id" default-expand-all>
-      <el-table-column prop="" label="鍏ュ洯杞﹁締" min-width="100" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="" label="鍏徃鍚嶇О" min-width="120" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="" label="鑱旂郴浜轰俊鎭�" min-width="100" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="" label="鎵嬫満鍙�" min-width="120" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="" label="琚浜�" min-width="120" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="" label="鎷滆鏃堕棿" min-width="120" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="" label="鎷滆浜嬬敱" min-width="80" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="" fixed="right" 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>
+  <div class="main_app" >
+    <QueryForm
+      v-model="filters"
+      :query-form-config="queryFormConfig"
+      @handleQuery="getList(1)"
+      @clear="clear"
+    />
+    <div class="query_btns" style="margin: 16px 0 0" v-permissions="['business:visits:create', 'business:visits:exportExcel']">
+      <el-button type="primary" @click="handleEdit()" icon="el-icon-plus" v-permissions="['business:visits:create']">鏂板缓</el-button>
+      <el-button type="primary" :loading="exLoading" @click="exportExcel" v-permissions="['business:visits:exportExcel']">瀵煎嚭</el-button>
+    </div>
+    <el-table
+      :height="tableHeightNew"
+      v-loading="loading"
+      :data="dataList"
+      stripe
+      row-key="id"
+      default-expand-all
+    >
+      <el-table-column type="selection" width="55" align="center"></el-table-column>
+      <el-table-column
+        prop="carNos"
+        label="鍏ュ洯杞﹁締"
+        min-width="100px"
+      ></el-table-column>
+      <el-table-column
+        prop="companyName"
+        label="鍏徃鍚嶇О"
+        min-width="100px"
+      ></el-table-column>
+      <el-table-column
+        prop="name"
+        label="鑱旂郴浜轰俊鎭�"
+        min-width="100px"
+      ></el-table-column>
+      <el-table-column
+        prop="phone"
+        label="鎵嬫満鍙�"
+        min-width="100px"
+      ></el-table-column>
+      <el-table-column
+        prop="receptMemberName"
+        label="琚浜�"
+        min-width="100px"
+      ></el-table-column>
+      <el-table-column label="鎷滆鏃堕棿" min-width="160px">
+        <template slot-scope="{ row }">
+          <span>璧凤細{{ row.starttime }}</span
+          ><br />
+          <span>姝細{{ row.endtime }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="reason"
+        label="鎷滆浜嬬敱"
+        min-width="100"
+      ></el-table-column>
+      <el-table-column
+        prop="status"
+        fixed="right"
+        label="鐘舵��"
+        align="center"
+        min-width="100"
+      >
+        <template slot-scope="{ row }">
+          <span style="color: rgba(245, 154, 35, 0.996)" v-if="row.status === 0"
+            >寰呮彁浜ゅ鎵�</span
+          >
+          <span v-if="row.status === 1" style="color: rgba(245, 154, 35, 0.996)"
+            >澶勭悊涓�</span
+          >
+          <span v-if="row.status === 2" style="color: rgba(245, 154, 35, 0.996)"
+            >宸插悓鎰�</span
+          >
+          <span style="color: gray" v-if="row.status === 3">宸叉嫆缁�</span>
+          <span v-if="row.status === 4" style="color: gray">鍙栨秷</span>
+          <span v-if="row.status === 5" style="color: green">涓嬪彂鎴愬姛</span>
+          <span v-if="row.status === 6" style="color: gray">涓嬪彂澶辫触</span>
+          <span v-if="row.status === 7" style="color: green">宸茬櫥璁�</span>
+          <span v-if="row.status === 8" style="color: red">宸茬绂�</span>
+          <span v-if="row.status === 9" style="color: gray">宸插け鏁�</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="鎿嶄綔" align="center" width="240" fixed="right">
+        <template slot-scope="{ row }">
+          <el-button
+            type="text"
+            @click="handleDetail(row)"
+            v-permissions="['business:company:update']">鏌ョ湅璇︽儏</el-button>
+          <el-button  type="text"  icon="el-icon-delete" @click="deleteById(row)" style="color: red" v-permissions="['business:visits:delete']">鍒犻櫎</el-button>
+          <el-button type="text" @click="cancel(row.id)"   v-permissions="['business:visits:cancel']"  v-if="(row.status == 0 || row.status == 1 || row.status == 2|| row.status == 5)"  icon="el-icon-delete" style="color: red"  >鍙栨秷棰勭害</el-button>
         </template>
       </el-table-column>
     </el-table>
-    <pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
-    <ReportDetail v-if="isShowDetail" ref="DetailRef" />
+    <pagination
+      @size-change="handleSizeChange"
+      @current-change="getList"
+      :pagination="pagination"
+    />
+    <ReportDetail v-if="isShowReport" ref="VisReportDetailRef" />
+    <OperaVisitsReportWindow @close="isShowEdit = false" @success="getList"  v-if="isShowEdit" ref="operaVisitsWindowRef" />
   </div>
 </template>
 
 <script>
 import Pagination from '@/components/common/Pagination'
 import QueryForm from '@/components/common/QueryForm'
-import ReportDetail from './page-components/ReportDetail.vue'
+// import ReportDetail from './page-components/ReportDetail.vue'
+import ReportDetail from '@/views/task/visReportDetail.vue'
+import OperaVisitsReportWindow from '@/components/business/operaVisitsReportWindow.vue'
+import { fetchList, exportExcel, deleteById ,visitsCancel} from '@/api/business/visits'
+import BasePage from '@/components/base/BasePage'
+import {mapState } from "vuex";
 export default {
+  extends: BasePage,
   components: {
     ReportDetail,
     QueryForm,
-    Pagination
+    Pagination,
+    OperaVisitsReportWindow
   },
   data () {
     return {
-      isShowDetail: false,
+      isShowEdit: false,
+      exLoading: false,
+
+      isShowReport: false,
       activeTab: '0',
-      filters: {},
+      filters: {
+        type: 2
+      },
+      dataList: [],
       queryFormConfig: {
         formItems: [
           {
-            filed: 'idCard',
+            filed: 'carNos',
             type: 'input',
             label: '杞︾墝鍙�'
           },
           {
-            filed: 'name',
+            filed: 'companyName',
             type: 'input',
             label: '鍏徃鍚嶇О'
+          },
+          {
+            filed1: 'queryStarttime',
+            filed2: 'queryEndtime',
+            type: 'datetime',
+            label: '鎷滆鏃堕棿'
           }
         ],
         online: true
@@ -58,28 +159,123 @@
       },
       pagination: {
         capacity: 10,
-        page: 1
+        page: 1,
+        total: 0
       },
-      list: [{}],
       total: 0
     }
   },
+  computed: {
+    ...mapState(['userInfo'])
+  },
+  created () {
+    this.getList()
+  },
   methods: {
-    handleDetail () {
-      this.isShowDetail = true
-      this.$nextTick(() => {
-        this.$refs.DetailRef.isShowModal = true
+    cancel (id) {
+      this.$confirm('纭畾鍙栨秷棰勭害鍚�, 鏄惁缁х画?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        visitsCancel(id)
+          .then(res => {
+            this.pagination.page = 1
+            this.getList()
+          })
+      }).catch(() => {
       })
     },
-    getList (page) {},
-    clear () { },
+    exportExcel () {
+      this.$dialog.exportConfirm('纭瀵煎嚭鍚楋紵')
+        .then(() => {
+          this.exLoading = true
+          exportExcel({
+            page: this.pagination.page,
+            capacity: 1000000,
+            model: this.filters
+          })
+            .then(response => {
+              this.download(response)
+            })
+            .catch(e => {
+              this.$tip.apiFailed(e)
+            })
+            .finally(() => {
+              this.exLoading = false
+            })
+        })
+    },
+    handleEdit () {
+      this.isShowEdit = true
+      this.$nextTick(() => {
+        this.$refs.operaVisitsWindowRef.isShowModal = true
+      })
+    },
+    deleteById (row) {
+      this.$confirm('纭畾鍒犻櫎璇ヨ褰曞悧, 鏄惁缁х画?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        deleteById(row.id)
+          .then(res => {
+            this.$message.success('鎿嶄綔鎴愬姛')
+            this.page = 1
+            this.getList()
+          })
+      }).catch(() => {
+      })
+    },
+    handleDetail (row) {
+      this.isShowReport = true
+      this.$nextTick(() => {
+        this.$nextTick(() => {
+          this.$refs.VisReportDetailRef.id = row.id
+          this.$refs.VisReportDetailRef.type = 1
+          this.$refs.VisReportDetailRef.getDetail()
+          this.$refs.VisReportDetailRef.isShowModal = true
+        })
+      })
+    },
+    getList (page) {
+      const { pagination, filters } = this
+      pagination.page = page || pagination.page
+      fetchList({
+        model: { ...filters },
+        ...pagination
+      }).then(res => {
+        this.dataList = res.records || []
+        this.pagination.total = res.total
+      })
+    },
+    clear () {
+      this.filters = {
+        type: 2
+      }
+      this.getList(0)
+    },
     handleSizeChange (capacity) {
       this.pagination.capacity = capacity
+      this.getList(1)
     }
   }
 }
 </script>
 
 <style lang="scss" scoped>
+.table-pagination {
 
+  margin-left: 0px;
+  padding: 16px 0px ;
+  text-align: left;
+  display: block;
+  z-index: 100;
+  width: -webkit-fill-available;
+  /* width: 80%; */
+  position: fixed;
+  bottom: 0px;
+  background-color: white;
+  margin-right: 50px;
+}
 </style>

--
Gitblit v1.9.3