From 05b50dfb9565a874ea611c3149959cd9f7163623 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Mon, 02 Jan 2023 13:54:44 +0800
Subject: [PATCH] 新增通行证废止

---
 src/router/page/index.js                               |   10 +++++
 src/const/applicationCarChange/applicationCarChange.js |    2 
 src/page/passView/PassView.vue                         |   28 ++++++++++++++
 src/const/pass/pass.js                                 |   21 +++++++++-
 src/views/pass/pass.vue                                |   30 ++++++++++++++-
 src/const/applicationDelay/applicationDelay.js         |    2 
 6 files changed, 86 insertions(+), 7 deletions(-)

diff --git a/src/const/applicationCarChange/applicationCarChange.js b/src/const/applicationCarChange/applicationCarChange.js
index 65a2c9d..691e60d 100644
--- a/src/const/applicationCarChange/applicationCarChange.js
+++ b/src/const/applicationCarChange/applicationCarChange.js
@@ -30,7 +30,7 @@
       labelWidth:labelWidth,
       prop: "no",
       type: "select",
-      dicUrl: "/api/application/application/getAll?status=10&&userId="+userId,
+      dicUrl: "/api/application/application/getAll?status=10&&passStatus=1&&userId="+userId,
       props:{
         label:"no",
         value:"no"
diff --git a/src/const/applicationDelay/applicationDelay.js b/src/const/applicationDelay/applicationDelay.js
index 7195289..3b98e83 100644
--- a/src/const/applicationDelay/applicationDelay.js
+++ b/src/const/applicationDelay/applicationDelay.js
@@ -32,7 +32,7 @@
       prop: "no",
       span:24,
       type: "select",
-      dicUrl: "/api/application/application/getAll?status=10&&userId="+userId,
+      dicUrl: "/api/application/application/getAll?status=10&&passStatus=1&&userId="+userId,
       props:{
         label:"no",
         value:"no"
diff --git a/src/const/pass/pass.js b/src/const/pass/pass.js
index 406ff65..b95c0d3 100644
--- a/src/const/pass/pass.js
+++ b/src/const/pass/pass.js
@@ -1,5 +1,5 @@
 export default {
-  height:'auto',
+  height: 'auto',
   calcHeight: 30,
   tip: false,
   searchShow: true,
@@ -9,8 +9,10 @@
   viewBtn: false,
   delBtn: false,
   editBtn: false,
+  addBtn: false,
   selection: true,
   dialogClickModal: false,
+  menuWidth:300,
   column: [
     {
       label: "主键",
@@ -85,11 +87,24 @@
     {
       label: "状态",
       prop: "status",
-      type: "input",
+      type: "select",
+      dicData: [
+        {
+          label: '生效中',
+          value: 1
+        },
+        {
+          label: '已废止',
+          value: 2
+        }
+      ],
+      props:{
+        label:'label',
+        value:'value'
+      },
       addDisplay: false,
       editDisplay: false,
       viewDisplay: false,
-      hide: true,
     },
     {
       label: "是否已删除",
diff --git a/src/page/passView/PassView.vue b/src/page/passView/PassView.vue
new file mode 100644
index 0000000..5817a1f
--- /dev/null
+++ b/src/page/passView/PassView.vue
@@ -0,0 +1,28 @@
+<template>
+  <div>
+    {{no}}
+  </div>
+</template>
+
+<script>
+export default {
+  name: "PassView",
+  data(){
+    return{
+      no:"",
+    }
+  },
+  created() {
+    this.init()
+  },
+  methods:{
+    init(){
+      this.no = this.$route.params.no
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>
diff --git a/src/router/page/index.js b/src/router/page/index.js
index 1136402..4aa4a13 100644
--- a/src/router/page/index.js
+++ b/src/router/page/index.js
@@ -12,6 +12,16 @@
   }
 },
   {
+    path: '/passView/:no',
+    name:'通行证预览',
+    component:()=>import(/* webpackChunkName: "page" */ '@/page/passView/PassView'),
+    meta: {
+      keepAlive: true,
+      isTab: false,
+      isAuth: false
+    }
+  },
+  {
     path: '/lock',
     name: '锁屏页',
     component: () =>
diff --git a/src/views/pass/pass.vue b/src/views/pass/pass.vue
index 0815941..c3b1020 100644
--- a/src/views/pass/pass.vue
+++ b/src/views/pass/pass.vue
@@ -30,8 +30,8 @@
       <template slot-scope="{type,size,row,index}" slot="menu">
         <el-button icon="el-icon-view" :size="size" :type="type" @click="viewQr(row)">预 览</el-button>
         <el-button icon="el-icon-edit" :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-delete" :size="size" :type="type" @click="goToPassView(row)">跳 转</el-button>
+        <el-button icon="el-icon-delete" :disabled="row.status == 2" :size="size" :type="type" @click="abolishPass(row)">废 止</el-button>
       </template>
     </avue-crud>
 
@@ -229,6 +229,32 @@
         })
 
 
+      },
+      //跳转通行证预览页面
+      goToPassView(row){
+        this.$router.push({path:`/passView/${row.no}`})
+      },
+      //通行证废止
+      abolishPass(row){
+
+        this.$confirm('是否废止该通行证?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          row.status = 2
+          update(row).then(() => {
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.onLoad(this.page);
+          }, error => {
+            console.log(error);
+          });
+        }).catch(() => {
+
+        });
       }
     }
   };

--
Gitblit v1.9.3