| | |
| | | :model="form" |
| | | :rules="rules" |
| | | label-width="150px" |
| | | class="mt50" |
| | | class="add-base-form" |
| | | label-position="left" |
| | | > |
| | | <el-row> |
| | |
| | | required |
| | | prop="startTime" |
| | | > |
| | | <el-col :span="11" class="pick-time"> |
| | | <el-col :span="11" class> |
| | | <el-date-picker |
| | | size="small" |
| | | type="datetime" |
| | |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> --> |
| | | </el-row>--> |
| | | <el-row> |
| | | <el-col :span="6" :offset="15"> |
| | | <el-form-item style="margin-top:50px;text-align:right;" label-width="0px"> |
| | | <el-button type="info" size="small" @click="onCancle">取消</el-button> |
| | | <el-button type="info" size="small" @click="onCancle" style="color:#222">取消</el-button> |
| | | <el-button type="primary" size="small" @click="onSubmit('baseForm')" class="save">保存</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | baseObject: function (newVal, oldVal) { |
| | | this.foreverChecked = false |
| | | this.form = newVal |
| | | console.log(this.form,'baseObject') |
| | | console.log(this.form, 'baseObject') |
| | | if (!newVal.endTime || newVal.endTime === undefined || newVal.endTime === null) { |
| | | this.form.isForever = '1' |
| | | this.foreverChecked = true |
| | |
| | | tableName: this.form.tableName, |
| | | startTime: this.$moment(this.form.startTime).format('YYYY-MM-DD HH:mm:ss'), |
| | | tableType: this.form.tableType, |
| | | isForever: this.foreverChecked ? '1':'0', |
| | | isForever: this.foreverChecked ? '1' : '0', |
| | | id: this.form.id, |
| | | endTime: this.form.endTime ? this.$moment(this.form.endTime).format('YYYY-MM-DD HH:mm:ss') : '', |
| | | bwType: this.form.bwType, |
| | |
| | | tableName: this.form.tableName, |
| | | startTime: this.$moment(this.form.startTime).format('YYYY-MM-DD 00:00:00'), |
| | | tableType: this.form.tableType, |
| | | isForever: this.foreverChecked ? '1':'0', |
| | | isForever: this.foreverChecked ? '1' : '0', |
| | | id: this.form.id, |
| | | endTime: this.form.endTime ? this.$moment(this.form.endTime).format('YYYY-MM-DD 23:59:59') : '', |
| | | bwType: this.form.bwType, |
| | |
| | | }) |
| | | } |
| | | }, |
| | | onCancle(){ |
| | | onCancle() { |
| | | this.$emit('closeAdd') |
| | | }, |
| | | forever(value) { |
| | |
| | | }, |
| | | init() { |
| | | console.log('添加底库表单收到的数据', this.baseObject, this.type) |
| | | if(Object.keys(this.baseObject).length > 3){ |
| | | if (Object.keys(this.baseObject).length > 3) { |
| | | this.form = this.baseObject |
| | | if (!this.form.endTime) { |
| | | this.foreverChecked = true |
| | | } else { |
| | | this.foreverChecked = false |
| | | } |
| | | }else{ |
| | | } else { |
| | | this.$refs.baseForm.resetFields() |
| | | } |
| | | }, |
| | |
| | | } |
| | | </script> |
| | | <style lang="scss"> |
| | | .add-base-form { |
| | | margin-top: 50px; |
| | | } |
| | | .el-radio__inner { |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 100%; |
| | |
| | | -webkit-box-sizing: border-box; |
| | | box-sizing: border-box; |
| | | } |
| | | .el-radio__input.is-checked .el-radio__inner { |
| | | border-color: #3d68e1; |
| | | background: #3d68e1; |
| | | } |
| | | // .el-radio__input.is-checked .el-radio__inner { |
| | | // border-color: #3d68e1; |
| | | // background: #3d68e1; |
| | | // } |
| | | .save { |
| | | background: #3d68e1; |
| | | border-radius: 2px; |
| | |
| | | line-height: 40px; |
| | | outline: none; |
| | | padding: 0 0 0 15px; |
| | | -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1); |
| | | transition: border-color .2s cubic-bezier(.645,.045,.355,1); |
| | | -webkit-transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); |
| | | transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); |
| | | width: 100%; |
| | | } |
| | | .el-input--prefix .el-input__inner { |
| | | padding-left: 22px; |
| | | } |
| | | .el-input--suffix .el-input__inner { |
| | | padding-right: 0; |
| | | padding-right: 0; |
| | | } |
| | | .el-input__prefix { |
| | | position: absolute; |
| | |
| | | left: 0px; |
| | | top: 0; |
| | | text-align: center; |
| | | color: #C0C4CC; |
| | | color: #c0c4cc; |
| | | -webkit-transition: all 0.3s; |
| | | transition: all 0.3s; |
| | | } |
| | |
| | | right: -2px; |
| | | top: 0; |
| | | text-align: center; |
| | | color: #C0C4CC; |
| | | color: #c0c4cc; |
| | | -webkit-transition: all 0.3s; |
| | | transition: all 0.3s; |
| | | pointer-events: none; |
| | | } |
| | | .el-button--info { |
| | | color: #222222 !important; |
| | | } |
| | | } |
| | | </style> |