• vue dateinfo绑定


                <el-row>
                    <el-col :span="8">
                        <el-form-item label="抽奖时间:" required>
                            <el-form-item prop="DrawTimeInfo">
                                <el-date-picker type="daterange" v-model="DrawTimeInfo" value-format="yyyy-MM-dd"
                                                align="right"
                                                unlink-panels
                                                range-separator=""
                                                start-placeholder="开始日期"
                                                end-placeholder="结束日期" style="100%">
                                </el-date-picker>
                            </el-form-item>
                        </el-form-item>
                    </el-col>
                </el-row>
    
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="领取截止时间:" required>
                            <el-form-item prop="ReceiveUpTime">
                                <el-date-picker v-model="model.ReceiveUpTime" type="date" placeholder="选择日期" :picker-options="checkTime(model.EndTime,model.ReceiveUpTime)" value-format="yyyy-MM-dd" style="100%"></el-date-picker>
                            </el-form-item>
                        </el-form-item>
                    </el-col>
                </el-row>
    
    
    
    
    
    
      data: {
                   DrawTimeInfo: [],//时间     
                },
    
    
    methods: {
                   checkTime: function (Starttime, Validtime) {
                       if (this.DrawTimeInfo !== null && this.DrawTimeInfo.length > 0) {
                           if (this.DrawTimeInfo[0].constructor == String) {
                               this.model.StartTime = this.DrawTimeInfo[0];
                               this.model.EndTime = this.DrawTimeInfo[1];
                           } else {
                               this.model.StartTime = this.DrawTimeInfo[0].format("yyyy-MM-dd");
                               this.model.EndTime = this.DrawTimeInfo[1].format("yyyy-MM-dd");
                           }
                       }
                       if (Starttime == null) {
                           Starttime = this.model.EndTime;
                       }
                       if (Starttime && Validtime) {
                           if (Starttime > Validtime) {
                               this.$message.warning("领取截止时间不能小于结束日期");
                           }
                       }
                   },
    
                    //编辑 获取实例
                    GetModel: function () {
                        var self = this;
                        sa.ajax('/Activity/GetModel/@ViewBag.id', {}, function (res) {
                            if (res != null) {
                                self.model = res;
                                self.DrawTimeInfo = [res.StartTime, res.EndTime];
                               
                            }// 数据
                        }.bind(this), { type: "get" });
                   },
                     //确定
                   ok: function () {
                       let self = this;
                        this.model.StartTime = null;
                        this.model.EndTime = null;
                        if (this.DrawTimeInfo !== null && this.DrawTimeInfo.length > 0) {
                            this.model.StartTime = this.DrawTimeInfo[0];
                            this.model.EndTime = this.DrawTimeInfo[1];
                        }
                        this.$refs['model'].validate((flgs,object) => {
                            if (!flgs) {
                                 return false;
                            }
                            sa.ajax('/Activity/Edit', { model: self.model  }, function (res) {
                                if (res.Status) {
                                    sa.alert(res.Message, res.Status, function () {
                                        parent.app.f5();
                                        sa.closeCurrIframe();
                                    });
                                } else {
                                    sa.error(res.Message, res.Status, function () {
                                    });
                                }
                            }.bind(this));
                        });
                    },
    
            }

    此随笔或为自己所写、或为转载于网络。仅用于个人收集及备忘。

  • 相关阅读:
    安装Hadoop
    爬虫综合大作业
    爬取全部校园新闻
    理解爬虫原理
    中文词频统计与词云生成
    复合数据类型,英文词频统计
    字符串操作、文件操作,英文词频统计预处理
    了解大数据的特点、来源与数据呈现方式
    大数据应用期末总评
    分布式文件系统HDFS 练习
  • 原文地址:https://www.cnblogs.com/shy1766IT/p/15601717.html
Copyright © 2020-2023  润新知