kongdeqiang
2023-01-16 0d846fafce55573aacba349935c1f10c6dfc638d
修改前端页面
2个文件已修改
38 ■■■■ 已修改文件
src/components/page/orderRecord/index.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/whiteList/index.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/orderRecord/index.vue
@@ -53,7 +53,7 @@
            }
        },
        mounted() {
            this.loadData();
            this.defaultDate();
            this.$byutil.postData(this, this.$systemconfig.basePath+'/park/findAll', this.formData, res => {
                this.table1 = res.data;
            })
@@ -74,6 +74,22 @@
            onSearch() {
                this.loadData();
            },
          //设置默认日期
          defaultDate(){
            //获取新的时间
            let date = new Date()
            //获取当前时间的年份转为字符串
            let year = date.getFullYear().toString()
            //获取月份,由于月份从0开始,此处要加1,判断是否小于10,如果是在字符串前面拼接'0'
            let month = date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1).toString():(date.getMonth()+1).toString()
            //获取天,判断是否小于10,如果是在字符串前面拼接'0'
            let da = date.getDate() < 10 ? '0'+date.getDate().toString():date.getDate().toString()
            //字符串拼接,开始时间,结束时间
            let end = year + '-' + month + '-' + da  //当天'2019-04-12'
            let beg = year + '-' + month + '-' + da    //当月第一天'2019-04-01'
            this.searchForm.date = [beg,end] //将值设置给插件绑定的数据
            this.loadData();
          },
        }
    }
</script>
src/components/page/whiteList/index.vue
@@ -50,8 +50,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>
@@ -80,8 +80,10 @@
                    type: 0,
                    endTime: '',
                    startTime: '',
                    parkId:null
                    parkIds: '',
                    name: ''
                },
                ids:[],
                urlPath:this.$systemconfig.basePath + '/whiteList/',
                table1:[],
            }
@@ -103,6 +105,7 @@
            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;
@@ -115,7 +118,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();
@@ -130,14 +133,19 @@
                    type: 0,
                    endTime: '',
                    startTime: '',
                    parkId:null
                    parkIds: null
                }
            },
            onEdit(row) {
                this.flag=true;
                this.ids = []
                this.formData  = row;
                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) {