From 3201bba04baf50d368fbc4ac11658701e97a0a97 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期三, 05 三月 2025 09:59:05 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/dmvisit

---
 admin/src/views/operation/serviceCar/apprRecord.vue |  174 ++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 120 insertions(+), 54 deletions(-)

diff --git a/admin/src/views/operation/serviceCar/apprRecord.vue b/admin/src/views/operation/serviceCar/apprRecord.vue
index 7eb4afa..571b12b 100644
--- a/admin/src/views/operation/serviceCar/apprRecord.vue
+++ b/admin/src/views/operation/serviceCar/apprRecord.vue
@@ -1,5 +1,5 @@
 <template>
-  <TableLayout :permissions="['business:empower:query']">
+  <TableLayout :permissions="['business:carusebook:query']">
     <!-- 鎼滅储琛ㄥ崟 -->
     <div ref="QueryFormRef" slot="search-form">
       <el-form ref="searchForm" :model="searchForm" label-width="100px" inline>
@@ -52,36 +52,70 @@
     </div>
     <!-- 琛ㄦ牸鍜屽垎椤� -->
     <template v-slot:table-wrap>
-      <ul class="toolbar" v-permissions="[
-        'business:carusebook:create',
-        'business:carusebook:exportExcel',
-      ]">
+      <ul
+        class="toolbar"
+        v-permissions="[
+          'business:carusebook:create',
+          'business:carusebook:exportExcel',
+        ]"
+      >
         <li>
-          <el-button type="primary" @click="handleEdit" icon="el-icon-plus"
-            v-permissions="['business:carusebook:create']">鏂板缓</el-button>
+          <el-button
+            type="primary"
+            @click="handleEdit"
+            icon="el-icon-plus"
+            v-permissions="['business:carusebook:create']"
+            >鏂板缓</el-button
+          >
         </li>
         <li>
-          <el-button type="primary" @click="handleEx" v-permissions="['business:carusebook:exportExcel']">瀵煎嚭</el-button>
+          <el-button
+            type="primary"
+            @click="handleEx"
+            v-permissions="['business:carusebook:exportExcel']"
+            >瀵煎嚭</el-button
+          >
         </li>
       </ul>
       <el-table :max-height="tableHeight" v-loading="isWorking.search" :data="tableData.list" stripe
         @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55"></el-table-column>
-        <el-table-column prop="carCode" label="杞︾墝鍙�" min-width="100px"></el-table-column>
-        <el-table-column prop="memberName" label="鎻愭姤浜�" min-width="80px"></el-table-column>
-        <el-table-column prop="memberNames" label="涔樿溅浜�" min-width="180px"></el-table-column>
-        <el-table-column prop="companyName" label="鎵�灞炵粍缁�" min-width="150px"></el-table-column>
+        <el-table-column
+            prop="carCode"
+            label="杞︾墝鍙�"
+            min-width="100px"
+        ></el-table-column>
+        <el-table-column
+          prop="memberName"
+          label="鎻愭姤浜�"
+          min-width="80px"
+        ></el-table-column>
+        <el-table-column
+            prop="memberNames"
+            label="涔樿溅浜�"
+            min-width="180px"
+        ></el-table-column>
+        <el-table-column
+          prop="companyName"
+          label="鎵�灞炵粍缁�"
+          min-width="150px"
+        ></el-table-column>
         <el-table-column label="鐢ㄨ溅鏃堕棿" min-width="170px">
           <template slot-scope="{ row }">
-            <span v-if="row.startTime">璧�:{{ row.startTime.slice(0, 16) }}</span><br />
-            <span v-if="row.endTime">姝�:{{ row.endTime.slice(0, 16) }}</span>
+            <span v-if="row.startTime">璧�:{{ row.startTime.slice(0,16) }}</span
+            ><br />
+            <span v-if="row.endTime">姝�:{{ row.endTime.slice(0,16) }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="planUseDate" label="鍑哄彂鏃堕棿" min-width="150px">
-          <template slot-scope="{ row }">
-            <span v-if="row.planUseDate">{{ row.planUseDate.slice(0, 16) }}</span>
-          </template>
-        </el-table-column>
+        <el-table-column
+          prop="planUseDate"
+          label="鍑哄彂鏃堕棿"
+          min-width="150px"
+        >
+        <template slot-scope="{ row }">
+          <span v-if="row.planUseDate">{{ row.planUseDate.slice(0,16) }}</span>
+        </template>
+      </el-table-column>
         <el-table-column label="鐩殑鍦�" min-width="200px">
           <template slot-scope="{ row }">
             <span class="status-green" v-if="row.type === 0">銆愬競鍐呫��</span>
@@ -99,28 +133,59 @@
           </template>
         </el-table-column>
 
-        <el-table-column prop="createDate" label="鐢宠鏃堕棿" min-width="150px"></el-table-column>
-        <el-table-column prop="editDate" label="鎿嶄綔鏃堕棿" min-width="150px"></el-table-column>
-        <el-table-column label="鎿嶄綔" min-width="160" align="center" fixed="right">
+        <el-table-column
+          prop="createDate"
+          label="鐢宠鏃堕棿"
+          min-width="150px"
+        ></el-table-column>
+        <el-table-column
+          prop="editDate"
+          label="鎿嶄綔鏃堕棿"
+          min-width="150px"
+        ></el-table-column>
+        <el-table-column
+          label="鎿嶄綔"
+          min-width="180"
+          align="center"
+          fixed="right"
+        >
           <template slot-scope="{ row }">
-            <el-button type="text" icon="el-icon-edit"
-              @click="$refs.OperaDetailsWindow.open('鍏姟杞︾敵璇疯鎯�', row)">鏌ョ湅璇︽儏</el-button>
+            <el-button
+              type="text"
+              icon="el-icon-edit"
+              @click="$refs.OperaDetailsWindow.open('鍏姟杞︾敵璇疯鎯�', row)"
+              >鏌ョ湅璇︽儏</el-button
+            >
             <!-- <el-button v-if="(row.status === 1 || row.status === 2) && new Date().getTime() < new Date(row.startTime).getTime()" type="text" icon="el-icon-delete" @click="rowRevokeClick(row)" >鎾ら攢</el-button> -->
-            <el-button style="color: red"
-              v-if="(row.status === 0 || row.status === 1 || row.status === 2) && new Date().getTime() < new Date(row.startTime).getTime()"
-              type="text" icon="el-icon-delete" @click="rowRevokeClick(row)">鎾ら攢</el-button>
-            <el-button style="color: red" type="text" icon="el-icon-delete" @click="deleteById(row)">鍒犻櫎</el-button>
+            <el-button style="color: red" v-if="row.hasRole ==1"  type="text"  icon="el-icon-delete"   @click="rowRevokeClick(row)" >鎾ら攢</el-button>
+            <!-- <el-button style="color: red"   v-if="(row.status === 0 && row.creator == userInfo.id)||((row.status === 0 || row.status === 1 ) || ( row.status === 2 && new Date().getTime() < new Date(row.startTime).getTime() ))"  type="text"  icon="el-icon-delete"   @click="rowRevokeClick(row)" >鎾ら攢</el-button>-->
+            <el-button  style="color: red" type="text"  icon="el-icon-delete"   v-permissions="['business:carusebook:delete']"  @click="deleteById(row)" >鍒犻櫎</el-button>
           </template>
         </el-table-column>
       </el-table>
-      <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination">
+      <pagination
+        @size-change="handleSizeChange"
+        @current-change="handlePageChange"
+        :pagination="tableData.pagination"
+      >
       </pagination>
     </template>
     <!--  -->
     <el-dialog title="鐢ㄨ溅鎾ら攢" :visible.sync="isShowBack" width="520px">
-      <el-form :model="backParam" :rules="rules" ref="backForm" label-width="100px" class="demo-ruleForm">
+      <el-form
+        :model="backParam"
+        :rules="rules"
+        ref="backForm"
+        label-width="100px"
+        class="demo-ruleForm"
+      >
         <el-form-item label="璇存槑" prop="info">
-          <el-input type="textarea" :rows="4" v-model="backParam.info" placeholder="璇疯緭鍏ユ挙閿�璇存槑"></el-input>
+          <el-input
+            type="textarea"
+            :rows="4"
+            v-model="backParam.info"
+            placeholder="璇疯緭鍏ユ挙閿�璇存槑"
+          ></el-input>
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
@@ -128,7 +193,10 @@
         <el-button type="primary" @click="backSubmit">纭畾</el-button>
       </span>
     </el-dialog>
-    <OperaCarUseBookWindow ref="OperaDetailsWindow" @success="handlePageChange" />
+    <OperaCarUseBookWindow
+      ref="OperaDetailsWindow"
+      @success="handlePageChange"
+    />
     <OperaCarUseBookParamWindow ref="OperaParamWindow" @success="search" />
   </TableLayout>
 </template>
@@ -146,8 +214,9 @@
   name: 'Empower',
   extends: BaseTable,
   components: { TableLayout, Pagination, OperaCarUseBookWindow, OperaCarUseBookParamWindow },
-  data() {
+  data () {
     return {
+      // userInfo: this.$store.state.userInfo,
       // 鎼滅储
       searchForm: {
         memberName: '',
@@ -169,7 +238,7 @@
       }
     }
   },
-  created() {
+  created () {
     this.config({
       module: '鐢ㄨ溅鐢宠绠$悊',
       api: '/business/carUseBook',
@@ -177,16 +246,11 @@
       'field.main': 'id'
     })
     // this.search()
-    this.changeRadio('0')
+    this.changeRadio(0)
     this.loadParams()
   },
-  mounted() {
-    this.$nextTick(() => {
-      this.tableHeight = document.body.scrollHeight - this.$refs.QueryFormRef.offsetHeight - 300
-    })
-  },
   methods: {
-    rowRevokeClick(row) {
+    rowRevokeClick (row) {
       this.isShowBack = true
       this.backParam = {}
       this.$set(this.backParam, 'id', row.id)
@@ -194,14 +258,14 @@
         this.$refs.backForm.clearValidate()
       })
     },
-    backSubmit() {
+    backSubmit () {
       revokeById({ ...this.backParam }).then(res => {
         this.$tip.success('鎾ら攢鎴愬姛')
         this.isShowBack = false
         this.search()
       })
     },
-    handleEx() {
+    handleEx () {
       this.$dialog.exportConfirm('纭瀵煎嚭鍚楋紵')
         .then(() => {
           this.exLoading = true
@@ -238,10 +302,10 @@
       }
       this.search()
     },
-    handleEdit() {
+    handleEdit () {
       this.$refs.OperaParamWindow.open()
     },
-    loadParams() {
+    loadParams () {
       allList({
       })
         .then(res => {
@@ -262,19 +326,21 @@
         .finally(() => {
         })
     },
-    seleTime(e) {
-      this.searchForm.queryStartTime = e[0]
-      this.searchForm.queryEndTime = e[1]
+    seleTime (e) {
+      this.searchForm.queryStartTime = null
+      this.searchForm.queryEndTime = null
+      if (e != null && e.length >= 2) {
+        this.searchForm.queryStartTime = e[0]
+        this.searchForm.queryEndTime = e[1]
+      }
       this.searchForm.radio = null
       this.search()
     },
-    reset() {
+    reset () {
       this.$refs.searchForm.resetFields()
-      this.searchForm = {}
-      this.time = []
-      // this.searchForm.radio = '0'
-      // this.changeRadio('0')
-      this.search()
+      this.searchForm.radio = 0
+      this.changeRadio(0)
+      // this.search()
     }
   }
 }

--
Gitblit v1.9.3