From 29bf5936bf1da2eea81f3abe07dc738f5267c42c Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Mon, 02 Jan 2023 16:34:16 +0800
Subject: [PATCH] 修改顶部栏

---
 src/views/application/application.vue |   55 +++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 43 insertions(+), 12 deletions(-)

diff --git a/src/views/application/application.vue b/src/views/application/application.vue
index 6c36fb1..ad8a897 100644
--- a/src/views/application/application.vue
+++ b/src/views/application/application.vue
@@ -30,16 +30,15 @@
       </template>
       <template slot-scope="{type,size,row,index}" slot="menu">
         <el-button icon="el-icon-edit" :size="size" :type="type"  @click="$refs.crud.rowEdit(row,index)">编 辑</el-button>
-        <el-button icon="el-icon-tickets" :size="size" :type="type" @click="polishApplication">完善信息</el-button>
-<!--        <el-button icon="el-icon-delete" :size="size" :type="type">车辆变更</el-button>-->
-<!--        <el-button icon="el-icon-delete" :size="size" :type="type">延 期</el-button>-->
-<!--        <el-button icon="el-icon-delete" :size="size" :type="type">撤 销</el-button>-->
+        <el-button icon="el-icon-tickets" :size="size" :type="type" @click="polishApplication(row.id)">补正</el-button>
+        <el-button v-if="permit" icon="el-icon-tickets" :size="size" :type="type">受 理</el-button>
+        <el-button v-if="permit" icon="el-icon-tickets" :size="size" :type="type" @click="rejectApplication(row)">不予受理</el-button>
       </template>
       <!--按钮自定义-End-->
 
       <!--cell自定义-Begin-->
-      <template slot-scope="{row}" slot="id">
-        <a href="#javascript" style="color: #337ab7" @click="$refs.crud.rowView(row)">{{row.id}}</a>
+      <template slot-scope="{row}" slot="no">
+        <a href="#javascript" style="color: #337ab7" @click="$refs.crud.rowView(row)">{{row.no}}</a>
       </template>
       <template slot-scope="{row}" slot="enterpriseName">
         <a href="#javascript" style="color: #337ab7" @click="getEnterpriseDetail(row.userId)">{{row.enterpriseName}}</a>
@@ -47,7 +46,8 @@
       <!--cell自定义-End-->
     </avue-crud>
 
-
+    <!--不予受理的表单-->
+    <reject v-if="rejectVisible" ref="reject" @refreshLoad="refreshLoad"></reject>
   </basic-container>
 </template>
 
@@ -57,8 +57,10 @@
   import option from "@/const/application/application";
   import enterpriseOption from "@/const/enterprise/enterprise"
   import {mapGetters} from "vuex";
+  import Reject from "@/views/application/reject";
 
   export default {
+    components: {Reject},
     data() {
       return {
         form: {},
@@ -73,6 +75,7 @@
         selectionList: [],
         option: option,
         data: [],
+        rejectVisible:false
       };
     },
     computed: {
@@ -91,6 +94,19 @@
           ids.push(ele.id);
         });
         return ids.join(",");
+      },
+      permit(){
+        return this.userInfo.role_name == 'admin' || this.userInfo.role_name == 'administrator' ? true:false
+      }
+    },
+    watch:{
+      'form.passTime':{
+        handler(newVal){
+          if (newVal){
+            this.form.startPassTime = newVal[0]
+            this.form.endPassTime = newVal[1]
+          }
+        }
       }
     },
     methods: {
@@ -198,6 +214,9 @@
       },
       onLoad(page, params = {}) {
         this.loading = true;
+        if (this.userInfo.role_name != 'admin' && this.userInfo.role_name !="administrator"){
+          params.userId = this.userInfo.user_id
+        }
         getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
@@ -222,6 +241,7 @@
         let catId = car.id
         let goods = this.form.goodsEntity
         let goodsId = goods.id
+        this.form.passTime = [basic.startPassTime,basic.endPassTime]
         let form = this.form
         //保留原form中的字段
         let common = Object.assign({},form)
@@ -231,10 +251,8 @@
         form = Object.assign(form,scheme)
         form = Object.assign(form,car)
         form = Object.assign(form,goods)
-
         //覆盖回原form
         form = Object.assign(form,common)
-
         this.form.basicInfoEntity.id = basicId
         this.form.planEntity.id = planId
         this.form.schemeEntity.id = schemeId
@@ -242,9 +260,9 @@
         this.form.goodsEntity.id = goodsId
       },
       //完善信息
-      polishApplication(){
+      polishApplication(id){
         let that = this
-        getDetail(this.form.id).then(res => {
+        getDetail(id).then(res => {
           let data = res.data.data
           this.form = data
           this.init()
@@ -278,6 +296,13 @@
           })
         });
       },
+      //不予受理
+      rejectApplication(row){
+        this.rejectVisible = true
+        this.$nextTick(()=>{
+          this.$refs.reject.init(row)
+        })
+      },
       //获取企业信息
       getEnterpriseDetail(userId){
         getDetailByUserId(userId).then(res=>{
@@ -290,13 +315,19 @@
               width: '70%',
               data:enterpriseDetail,
               option: enterpriseOption,
-              callback:(res)=>{
+              callback:()=>{
                 enterpriseOption.detail = false
               }
             })
           }
         })
+      },
+
+      //刷新页面
+      refreshLoad(){
+        this.onLoad(this.page, this.query);
       }
+
     }
   };
 </script>

--
Gitblit v1.9.3