From 1b2917db364f20dadbd04860f08af4f3d1af659c Mon Sep 17 00:00:00 2001
From: kongdeqiang <123456>
Date: 星期一, 28 十月 2024 09:26:56 +0800
Subject: [PATCH] feat: 白名单新增创建人

---
 src/components/page/whiteList/index.vue |   65 +++++++++++++++++++++++++-------
 1 files changed, 50 insertions(+), 15 deletions(-)

diff --git a/src/components/page/whiteList/index.vue b/src/components/page/whiteList/index.vue
index 3299801..5aa7a81 100644
--- a/src/components/page/whiteList/index.vue
+++ b/src/components/page/whiteList/index.vue
@@ -3,8 +3,21 @@
         <div style="padding: 10px 10px 0px 10px;">
             <el-form :inline="true" :model="searchForm">
                 <el-form-item label="杞︾墝鍙�">
-                <el-input v-model="searchForm.carNo"></el-input>
+                <el-input v-model="searchForm.carNo" clearable></el-input>
                 </el-form-item>
+              <el-form-item label="绫诲瀷">
+              <el-select  v-model="searchForm.type" placeholder="璇烽�夋嫨" clearable>
+                <el-option label="姘镐箙" :value="0"></el-option>
+                <el-option label="鏈堢エ" :value="1"></el-option>
+              </el-select>
+              </el-form-item>
+              <el-form-item label="閫夋嫨缁撴潫鏃堕棿">
+                <div class="date-box">
+                  <el-date-picker type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd"
+                                  v-model="searchForm.date" placeholder="" clearable>
+                  </el-date-picker>
+                </div>
+              </el-form-item>
                 <el-form-item>
                     <el-button type="primary" size="small" @click="onSearch" icon="el-icon-search">鏌ヨ</el-button>
                     <el-button type="primary" size="small" @click="onAdd" icon="el-icon-plus">澧炲姞</el-button>
@@ -12,7 +25,7 @@
             </el-form>
         </div>
 
-        <el-table :data="pageData.rows" v-loading="pageData.isLoading" border style="width:100%;border:1px solid #bcbec2;">
+        <el-table :height="tableHeight" :data="pageData.rows" v-loading="pageData.isLoading" border style="width:100%;border:1px solid #bcbec2;">
             <el-table-column type="index" width="50" label="搴忓彿" align="center"> </el-table-column>
             <el-table-column prop="carNo" label="杞︾墝鍙�" align="center" width="150"></el-table-column>
             <el-table-column prop="type" label="绫诲瀷" align="center" width="100">
@@ -24,6 +37,7 @@
             <el-table-column prop="startTime" label="鏈堢エ寮�濮嬫棩鏈�" align="center"></el-table-column>
             <el-table-column prop="endTime" label="鏈堢エ缁撴潫鏃ユ湡" align="center"></el-table-column>
             <el-table-column prop="name" label="鍋滆溅鍦�" align="center"></el-table-column>
+            <el-table-column prop="createBy" label="鎿嶄綔浜�" align="center"></el-table-column>
             <el-table-column label="鎿嶄綔" fixed="right" width="150" align="center">
                 <template slot-scope="scope">
                     <el-button size="mini" @click="onEdit(scope.row)">缂栬緫</el-button>
@@ -50,8 +64,8 @@
                 <el-form-item label="鏈堢エ缁撴潫鏃ユ湡" prop="endTime" v-if="flag2">
                     <el-date-picker placeholder="閫夋嫨鏃堕棿" v-model="formData.endTime"></el-date-picker>
                 </el-form-item>
-                <el-form-item label="鍋滆溅鍦�" prop="parkId" v-if="flag2">
-                    <el-select v-model="formData.parkId">
+                <el-form-item label="鍋滆溅鍦�" prop="parkIds" v-if="flag2">
+                    <el-select v-model="ids" multiple clearable>
                         <el-option v-for="item in table1" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
@@ -72,7 +86,10 @@
                 flag:false,
                 flag2:false,
                 searchForm: {
-                    name: ''
+                    name: '',
+                    carNo:'',
+                    type:null,
+                    date: null
                 },
                 pageData: this.$byutil.defaultPageData(),
                 formData: {
@@ -80,17 +97,27 @@
                     type: 0,
                     endTime: '',
                     startTime: '',
-                    parkId:null
+                    parkIds: null,
+                    name: '',
+                    createBy:'',
+                    updateBy:''
                 },
-                urlPath:this.$systemconfig.basePath + '/whiteList/',
+                ids:[],
+                urlPath:this.$systemconfig.basePath + '/ffzf/whiteList/',
                 table1:[],
+                userName:'',
+              tableHeight:500,
             }
         },
         mounted() {
+          let username = localStorage.getItem('name')
+          this.formData.createBy = username
+          this.userName = username
             this.loadData();
-            this.$byutil.postData(this, this.$systemconfig.basePath+'/park/findAll', this.formData, res => {
-                this.table1 = res.obj;
+            this.$byutil.postData(this, this.$systemconfig.basePath+'/ffzf/park/findAll', this.formData, res => {
+                this.table1 = res.data;
             })
+          this.tableHeight = window.innerHeight - 260
         },
         methods: {
             selectChange(value){
@@ -103,10 +130,11 @@
             onSave(){
                 this.$refs['formData'].validate((valid) => {
                     if (valid) {
+                      this.formData.parkIds = this.ids.join(",")
                         this.$byutil.postData(this, this.urlPath+'save', this.formData, res => {
                             this.$refs['formData'].resetFields();
                             this.flag=false;
-                            this.$message({message: res.message, type: 'success'});
+                            this.$message({message:'淇濆瓨鎴愬姛', type: 'success'});
                             this.loadData();
                         })
                     } else {
@@ -115,7 +143,7 @@
                 });
             },
             loadData() {
-                this.$byutil.loadPageData(this, this.urlPath+'findPage', this.searchForm);
+                this.$byutil.loadPageData(this, this.urlPath+'findPageNew', this.searchForm);
             },
             onSearch() {
                 this.pageData = this.$byutil.defaultPageData();
@@ -123,25 +151,32 @@
             },
             onAdd() {
                 this.flag=true;
+                this.flag2=false;
                 this.$refs['formData'].resetFields();
                 this.formData = {
                     carNo: '',
                     type: 0,
                     endTime: '',
                     startTime: '',
-                    parkId:null
+                    parkIds: null
                 }
             },
             onEdit(row) {
                 this.flag=true;
+                this.ids = []
                 this.formData  = row;
+                this.formData.updateBy = this.userName
                 if(row.type==1){
-                    this.flag2=true;
+                  this.ids = this.formData.parkIds.split(",")
+                  this.ids = this.ids.map(function(data){
+                    return +data;
+                  });
+                  this.flag2=true;
                 }
             },
             onDelete(row) {
                 this.$byutil.deleteData(this,this.urlPath+"delete",{id:row.id}, res => {
-                    this.$message({message: res.message, type: 'success'});
+                    this.$message({message: '鍒犻櫎鎴愬姛', type: 'success'});
                     this.loadData();
                 })
             },
@@ -159,4 +194,4 @@
 
 <style scoped>
 
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.1