mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-19 06:46:45 +08:00
[FIX]bug_GFRS-468客户管理重要事件列表-已提醒状态事件去掉编辑按钮
[FIX]bug_GFRS-467客户管理重要事件提醒-编辑客户事件时,提醒时间应当不可以选择当前时间之前的时间
This commit is contained in:
@@ -1,209 +1,215 @@
|
||||
<template>
|
||||
<div class="addMilesone">
|
||||
<van-cell-group>
|
||||
<van-field v-model="noticeDate" class="fs14" label="提醒日期" v-validate="'required'" name="提醒日期" placeholder="请选择" @click="show = true" :readonly="true"/>
|
||||
<van-field
|
||||
v-model="noticeDate"
|
||||
class="fs14"
|
||||
label="提醒日期"
|
||||
v-validate="'required'"
|
||||
name="提醒日期"
|
||||
placeholder="请选择"
|
||||
@click="show = true"
|
||||
:readonly="true"
|
||||
/>
|
||||
</van-cell-group>
|
||||
<van-cell-group>
|
||||
<van-field v-model="noticeTime" class="fs14" label="提醒时间" v-validate="'required'" name="提醒时间" placeholder="请选择" @click="timeShow = true" :readonly="true"/>
|
||||
<van-field
|
||||
v-model="noticeTime"
|
||||
class="fs14"
|
||||
label="提醒时间"
|
||||
v-validate="'required'"
|
||||
name="提醒时间"
|
||||
placeholder="请选择"
|
||||
@click="timeShow = true"
|
||||
:readonly="true"
|
||||
/>
|
||||
</van-cell-group>
|
||||
<van-cell-group>
|
||||
<van-field v-model="eventContent" label="事件内容" v-validate="'required'" name="事件内容" placeholder="请输入" class="text fs14" type="textarea"/>
|
||||
<van-field v-model="eventContent" label="事件内容" v-validate="'required'" name="事件内容" placeholder="请输入" class="text fs14" type="textarea" />
|
||||
</van-cell-group>
|
||||
<van-button type="danger" @click="save" class="bottom-btn fs16">保存</van-button>
|
||||
<van-popup v-model="show" position="bottom">
|
||||
<van-datetime-picker
|
||||
v-model="currentDate"
|
||||
type="date"
|
||||
@confirm="ok"
|
||||
@cancel="cancel"
|
||||
:min-date="minDate"
|
||||
:formatter="formatter"
|
||||
/>
|
||||
<van-datetime-picker v-model="currentDate" type="date" @confirm="ok" @cancel="cancel" :min-date="minDate" :formatter="formatter" />
|
||||
</van-popup>
|
||||
<van-popup v-model="timeShow" position="bottom">
|
||||
<van-datetime-picker
|
||||
v-model="currentTime"
|
||||
type="time"
|
||||
@confirm="okTime"
|
||||
@cancel="cancelTime"
|
||||
:filter="filter"
|
||||
|
||||
/>
|
||||
<van-datetime-picker v-model="currentTime" type="time" @confirm="okTime" @cancel="cancelTime" :filter="filter" />
|
||||
</van-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import { Field,CellGroup,DatetimePicker,Popup } from 'vant';
|
||||
import Vue from 'vue'
|
||||
import { Field, CellGroup, DatetimePicker, Popup } from 'vant'
|
||||
import { saveOrUpdate } from '@/api/ebiz/milestone/milestone.js'
|
||||
Vue.use(Field).use(CellGroup).use(DatetimePicker).use(Popup);
|
||||
export default {
|
||||
name: 'addMilestone',
|
||||
data(){
|
||||
return{
|
||||
noticeDate: '',
|
||||
noticeTime: '',
|
||||
eventContent: '',
|
||||
show: false,
|
||||
timeShow:false,
|
||||
currentDate: new Date(),
|
||||
minDate:new Date(),
|
||||
currentTime: '12:00',
|
||||
date: '',
|
||||
minMinute: 0,
|
||||
minHour: 0
|
||||
Vue.use(Field)
|
||||
.use(CellGroup)
|
||||
.use(DatetimePicker)
|
||||
.use(Popup)
|
||||
export default {
|
||||
name: 'addMilestone',
|
||||
data() {
|
||||
return {
|
||||
noticeDate: '',
|
||||
noticeTime: '',
|
||||
eventContent: '',
|
||||
show: false,
|
||||
timeShow: false,
|
||||
currentDate: new Date(),
|
||||
minDate: new Date(),
|
||||
currentTime: '12:00',
|
||||
date: '',
|
||||
minMinute: 0,
|
||||
minHour: 0
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
save() {
|
||||
this.$validator.validate().then(valid => {
|
||||
if (true === valid) {
|
||||
this.save1()
|
||||
} else {
|
||||
this.$toast(this.$validator.errors.all()[0])
|
||||
}
|
||||
})
|
||||
},
|
||||
save1() {
|
||||
let $this = this
|
||||
let data = {
|
||||
token: localStorage.getItem('token'),
|
||||
eventDTO: {
|
||||
customerNumber: localStorage.getItem('customerNumber'), // 客户号
|
||||
eventContent: $this.eventContent, // 事件内容
|
||||
noticeDate: $this.noticeDate, //提示日期 yyyy-MM-dd
|
||||
noticeTime: $this.noticeTime + ':00', // 提示时间 HH:mm:ss
|
||||
noticeStatus: '00' // 提示状态 00 未提醒(固定)
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
|
||||
},
|
||||
methods:{
|
||||
save(){
|
||||
this.$validator.validate().then(valid => {
|
||||
if(true === valid){
|
||||
this.save1()
|
||||
}else{
|
||||
this.$toast(this.$validator.errors.all()[0])
|
||||
console.log(123, data)
|
||||
saveOrUpdate(data)
|
||||
.then(res => {
|
||||
if (res.result == 0) {
|
||||
$this.$toast('保存成功')
|
||||
setTimeout(() => {
|
||||
this.$jump({
|
||||
flag: 'goBack',
|
||||
extra: {
|
||||
refresh: '1',
|
||||
index: '-1'
|
||||
},
|
||||
routerInfo: {
|
||||
type: 2,
|
||||
index: -1,
|
||||
path: '/milestone/list'
|
||||
}
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
})
|
||||
},
|
||||
save1(){
|
||||
let $this = this
|
||||
let data = {
|
||||
token: localStorage.getItem('token'),
|
||||
eventDTO:{
|
||||
customerNumber: localStorage.getItem('customerNumber'),// 客户号
|
||||
eventContent: $this.eventContent,// 事件内容
|
||||
noticeDate: $this.noticeDate,//提示日期 yyyy-MM-dd
|
||||
noticeTime: $this.noticeTime+':00',// 提示时间 HH:mm:ss
|
||||
noticeStatus: "00"// 提示状态 00 未提醒(固定)
|
||||
.catch(err => {
|
||||
$this.$toast('保存失败')
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.show = false
|
||||
},
|
||||
ok(value) {
|
||||
this.show = false
|
||||
var date = new Date(value)
|
||||
var year = date.getFullYear()
|
||||
var month = date.getMonth() + 1
|
||||
var day = date.getDate()
|
||||
if (month < 10) {
|
||||
month = '0' + month
|
||||
}
|
||||
if (day < 10) {
|
||||
day = '0' + day
|
||||
}
|
||||
this.noticeDate = year + '-' + month + '-' + day
|
||||
this.date = date.getTime()
|
||||
if (date.getTime() == this.minDate.getTime()) {
|
||||
this.getTime()
|
||||
if (this.noticeTime.split(':')[0] < this.minHour) {
|
||||
this.noticeTime = ''
|
||||
} else if ((this.noticeTime.split(':')[0] = this.minHour)) {
|
||||
if (this.noticeTime.split(':')[1] < this.minMinute) {
|
||||
this.noticeTime = ''
|
||||
}
|
||||
}
|
||||
console.log(123,data)
|
||||
saveOrUpdate(data)
|
||||
.then(res => {
|
||||
if (res.result == 0) {
|
||||
$this.$toast('保存成功')
|
||||
setTimeout(()=>{
|
||||
this.$jump({
|
||||
flag: 'goBack',
|
||||
extra: {
|
||||
refresh: '1',
|
||||
index: '-1',
|
||||
},
|
||||
routerInfo: {
|
||||
type: 2,
|
||||
index: -1,
|
||||
path: '/milestone/list'
|
||||
}
|
||||
})
|
||||
},100)
|
||||
}
|
||||
})
|
||||
.catch(err => {$this.$toast('保存失败')})
|
||||
},
|
||||
cancel(){
|
||||
this.show = false;
|
||||
},
|
||||
ok(value){
|
||||
this.show = false;
|
||||
var date = new Date(value)
|
||||
var year = date.getFullYear()
|
||||
var month = date.getMonth() + 1
|
||||
var day = date.getDate()
|
||||
if (month < 10) {
|
||||
month = '0' + month
|
||||
}
|
||||
if (day < 10) {
|
||||
day = '0' + day
|
||||
}
|
||||
this.noticeDate = year + '-' + month + '-' + day
|
||||
this.date = date.getTime()
|
||||
if(date.getTime()==this.minDate.getTime()){
|
||||
this.getTime()
|
||||
if(this.noticeTime.split(':')[0]<this.minHour){
|
||||
this.noticeTime=''
|
||||
}else if(this.noticeTime.split(':')[0]=this.minHour){
|
||||
if(this.noticeTime.split(':')[1]<this.minMinute){
|
||||
this.noticeTime=''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
okTime(value){
|
||||
console.log(value.split(':')[0])
|
||||
|
||||
if(this.date==this.minDate.getTime()){
|
||||
if(value.split(':')[0]<this.minHour){
|
||||
}
|
||||
},
|
||||
okTime(value) {
|
||||
console.log(value.split(':')[0])
|
||||
|
||||
if (this.date == this.minDate.getTime()) {
|
||||
if (value.split(':')[0] < this.minHour) {
|
||||
this.$toast('不能小于当前时间')
|
||||
} else if ((value.split(':')[0] = this.minHour)) {
|
||||
if (value.split(':')[1] < this.minMinute) {
|
||||
this.$toast('不能小于当前时间')
|
||||
}else if(value.split(':')[0]=this.minHour){
|
||||
if(value.split(':')[1]<this.minMinute){
|
||||
this.$toast('不能小于当前时间')
|
||||
}else{
|
||||
this.timeShow = false;
|
||||
this.noticeTime = value
|
||||
}
|
||||
}else{
|
||||
this.timeShow = false;
|
||||
} else {
|
||||
this.timeShow = false
|
||||
this.noticeTime = value
|
||||
}
|
||||
}else{
|
||||
this.timeShow = false;
|
||||
} else {
|
||||
this.timeShow = false
|
||||
this.noticeTime = value
|
||||
}
|
||||
|
||||
},
|
||||
cancelTime(){
|
||||
this.timeShow = false;
|
||||
},
|
||||
formatter(type, value) {
|
||||
if (type === 'year') {
|
||||
return `${value}年`;
|
||||
} else if (type === 'month') {
|
||||
return `${value}月`
|
||||
}else if (type === 'day') {
|
||||
return `${value}日`
|
||||
}
|
||||
return value;
|
||||
},
|
||||
filter(type, options) {
|
||||
if (type === 'minute') {
|
||||
return options.filter(option => option % 15 === 0)
|
||||
}
|
||||
return options;
|
||||
},
|
||||
getTime(){
|
||||
let date=new Date();
|
||||
let hour=date.getHours();
|
||||
let minute=date.getMinutes();
|
||||
if (minute<15) {
|
||||
minute='15';
|
||||
}else if(minute>=15&&minute<30){
|
||||
minute='30'
|
||||
}else if(minute>=30&&minute<45){
|
||||
minute='45'
|
||||
}else if(minute>=45&&minute<60){
|
||||
minute='00'
|
||||
hour=hour+1
|
||||
}
|
||||
if (hour<10) {
|
||||
hour='0'+hour;
|
||||
}
|
||||
this.currentTime = hour+':'+minute
|
||||
this.minHour = hour
|
||||
this.minMinute = minute
|
||||
} else {
|
||||
this.timeShow = false
|
||||
this.noticeTime = value
|
||||
}
|
||||
},
|
||||
cancelTime() {
|
||||
this.timeShow = false
|
||||
},
|
||||
formatter(type, value) {
|
||||
if (type === 'year') {
|
||||
return `${value}年`
|
||||
} else if (type === 'month') {
|
||||
return `${value}月`
|
||||
} else if (type === 'day') {
|
||||
return `${value}日`
|
||||
}
|
||||
return value
|
||||
},
|
||||
filter(type, options) {
|
||||
if (type === 'minute') {
|
||||
return options.filter(option => option % 15 === 0)
|
||||
}
|
||||
return options
|
||||
},
|
||||
getTime() {
|
||||
let date = new Date()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
if (minute < 15) {
|
||||
minute = '15'
|
||||
} else if (minute >= 15 && minute < 30) {
|
||||
minute = '30'
|
||||
} else if (minute >= 30 && minute < 45) {
|
||||
minute = '45'
|
||||
} else if (minute >= 45 && minute < 60) {
|
||||
minute = '00'
|
||||
hour = hour + 1
|
||||
}
|
||||
if (hour < 10) {
|
||||
hour = '0' + hour
|
||||
}
|
||||
this.currentTime = hour + ':' + minute
|
||||
this.minHour = hour
|
||||
this.minMinute = minute
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.addMilesone{
|
||||
.addMilesone {
|
||||
height: 100%;
|
||||
background-color: #fff
|
||||
background-color: #fff;
|
||||
}
|
||||
.text{
|
||||
min-height: 22vw
|
||||
.text {
|
||||
min-height: 22vw;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,233 +1,244 @@
|
||||
<template>
|
||||
<div class="editMilesone">
|
||||
<van-cell-group>
|
||||
<van-field v-model="noticeDate" class="fs14" label="提醒日期" v-validate="'required'" name="提醒日期" placeholder="请选择" @click="show = true" :readonly="true"/>
|
||||
<van-field
|
||||
v-model="noticeDate"
|
||||
class="fs14"
|
||||
label="提醒日期"
|
||||
v-validate="'required'"
|
||||
name="提醒日期"
|
||||
placeholder="请选择"
|
||||
@click="show = true"
|
||||
:readonly="true"
|
||||
/>
|
||||
</van-cell-group>
|
||||
<van-cell-group>
|
||||
<van-field v-model="noticeTime" class="fs14" label="提醒时间" v-validate="'required'" name="提醒时间" placeholder="请选择" @click="timeShow = true" :readonly="true"/>
|
||||
<van-field
|
||||
v-model="noticeTime"
|
||||
class="fs14"
|
||||
label="提醒时间"
|
||||
v-validate="'required'"
|
||||
name="提醒时间"
|
||||
placeholder="请选择"
|
||||
@click="timeShow = true"
|
||||
:readonly="true"
|
||||
/>
|
||||
</van-cell-group>
|
||||
<van-cell-group>
|
||||
<van-field v-model="eventContent" label="事件内容" v-validate="'required'" name="事件内容" placeholder="请输入" class="text fs14" type="textarea"/>
|
||||
<van-field v-model="eventContent" label="事件内容" v-validate="'required'" name="事件内容" placeholder="请输入" class="text fs14" type="textarea" />
|
||||
</van-cell-group>
|
||||
<van-button type="danger" @click="save" class="bottom-btn fs16">保存</van-button>
|
||||
<van-popup v-model="show" position="bottom">
|
||||
<van-datetime-picker
|
||||
v-model="currentDate"
|
||||
type="date"
|
||||
@confirm="ok"
|
||||
@cancel="cancel"
|
||||
:min-date="minDate"
|
||||
:formatter="formatter"
|
||||
/>
|
||||
<van-datetime-picker v-model="currentDate" type="date" @confirm="ok" @cancel="cancel" :min-date="minDate" :formatter="formatter" />
|
||||
</van-popup>
|
||||
<van-popup v-model="timeShow" position="bottom">
|
||||
<van-datetime-picker
|
||||
v-model="currentTime"
|
||||
type="time"
|
||||
@confirm="okTime"
|
||||
@cancel="cancelTime"
|
||||
:filter="filter"
|
||||
/>
|
||||
<van-datetime-picker v-model="currentTime" type="time" @confirm="okTime" @cancel="cancelTime" :filter="filter" />
|
||||
</van-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import { Field,CellGroup,DatetimePicker,Popup } from 'vant';
|
||||
import Vue from 'vue'
|
||||
import { Field, CellGroup, DatetimePicker, Popup } from 'vant'
|
||||
import { saveOrUpdate } from '@/api/ebiz/milestone/milestone.js'
|
||||
|
||||
Vue.use(Field).use(CellGroup).use(DatetimePicker).use(Popup);
|
||||
export default {
|
||||
name: 'editMilestone',
|
||||
data(){
|
||||
return{
|
||||
noticeDate: '',
|
||||
noticeTime: '',
|
||||
eventContent: '',
|
||||
show: false,
|
||||
timeShow:false,
|
||||
currentDate: new Date(),
|
||||
minDate:new Date(),
|
||||
currentTime: '12:00',
|
||||
item: '',
|
||||
date: '',
|
||||
minMinute: 0,
|
||||
minHour: 0,
|
||||
today:'',
|
||||
y:'',
|
||||
m:'',
|
||||
d:''
|
||||
Vue.use(Field)
|
||||
.use(CellGroup)
|
||||
.use(DatetimePicker)
|
||||
.use(Popup)
|
||||
export default {
|
||||
name: 'editMilestone',
|
||||
data() {
|
||||
return {
|
||||
noticeDate: '',
|
||||
noticeTime: '',
|
||||
eventContent: '',
|
||||
show: false,
|
||||
timeShow: false,
|
||||
currentDate: new Date(),
|
||||
minDate: new Date(),
|
||||
currentTime: '12:00',
|
||||
item: '',
|
||||
date: '',
|
||||
minMinute: 0,
|
||||
minHour: 0,
|
||||
today: '',
|
||||
y: '',
|
||||
m: '',
|
||||
d: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.item = JSON.parse(decodeURIComponent(this.$route.query.item))
|
||||
let item = JSON.parse(localStorage.getItem('milestone'))
|
||||
this.item = item
|
||||
this.noticeDate = item.noticeDate
|
||||
this.noticeTime = item.noticeTime
|
||||
this.eventContent = item.eventContent
|
||||
},
|
||||
methods: {
|
||||
save() {
|
||||
this.$validator.validate().then(valid => {
|
||||
if (true === valid) {
|
||||
this.save1()
|
||||
} else {
|
||||
this.$toast(this.$validator.errors.all()[0])
|
||||
}
|
||||
})
|
||||
},
|
||||
save1() {
|
||||
let $this = this
|
||||
let data = {
|
||||
token: localStorage.getItem('token'),
|
||||
eventDTO: {
|
||||
id: $this.item.id, //事件id 新增传null 修改必传
|
||||
customerNumber: localStorage.getItem('customerNumber'), // 客户号
|
||||
eventContent: $this.eventContent, // 事件内容
|
||||
noticeDate: $this.noticeDate, //提示日期 yyyy-MM-dd
|
||||
noticeTime: $this.noticeTime + ':00', // 提示时间 HH:mm:ss
|
||||
noticeStatus: '00' // 提示状态 00 未提醒(固定)
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
// this.item = JSON.parse(decodeURIComponent(this.$route.query.item))
|
||||
let item = JSON.parse(localStorage.getItem('milestone'))
|
||||
this.item = item
|
||||
this.noticeDate = item.noticeDate
|
||||
this.noticeTime = item.noticeTime
|
||||
this.eventContent = item.eventContent
|
||||
},
|
||||
methods:{
|
||||
save(){
|
||||
this.$validator.validate().then(valid => {
|
||||
if(true === valid){
|
||||
this.save1()
|
||||
}else{
|
||||
this.$toast(this.$validator.errors.all()[0])
|
||||
console.log(123, data)
|
||||
|
||||
saveOrUpdate(data)
|
||||
.then(res => {
|
||||
if (res.result == 0) {
|
||||
$this.$toast('保存成功')
|
||||
setTimeout(() => {
|
||||
this.$jump({
|
||||
flag: 'goBack',
|
||||
extra: {
|
||||
refresh: '1',
|
||||
index: '-1'
|
||||
},
|
||||
routerInfo: {
|
||||
type: 2,
|
||||
index: -1,
|
||||
path: '/milestone/list'
|
||||
}
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
})
|
||||
},
|
||||
save1(){
|
||||
let $this = this
|
||||
let data = {
|
||||
token: localStorage.getItem('token'),
|
||||
eventDTO:{
|
||||
id: $this.item.id, //事件id 新增传null 修改必传
|
||||
customerNumber: localStorage.getItem('customerNumber'),// 客户号
|
||||
eventContent: $this.eventContent,// 事件内容
|
||||
noticeDate: $this.noticeDate,//提示日期 yyyy-MM-dd
|
||||
noticeTime: $this.noticeTime+':00',// 提示时间 HH:mm:ss
|
||||
noticeStatus: "00"// 提示状态 00 未提醒(固定)
|
||||
}
|
||||
}
|
||||
console.log(123,data)
|
||||
|
||||
saveOrUpdate(data)
|
||||
.then(res => {
|
||||
if (res.result == 0) {
|
||||
$this.$toast('保存成功')
|
||||
setTimeout(()=>{
|
||||
this.$jump({
|
||||
flag: 'goBack',
|
||||
extra: {
|
||||
refresh: '1',
|
||||
index: '-1',
|
||||
},
|
||||
routerInfo: {
|
||||
type: 2,
|
||||
index: -1,
|
||||
path: '/milestone/list'
|
||||
}
|
||||
})
|
||||
},100)
|
||||
}
|
||||
})
|
||||
.catch(err => {$this.$toast('保存失败')})
|
||||
},
|
||||
cancel(){
|
||||
this.show = false;
|
||||
},
|
||||
ok(value){
|
||||
this.show = false;
|
||||
var date = new Date(value)
|
||||
var year = date.getFullYear()
|
||||
var month = date.getMonth() + 1
|
||||
var day = date.getDate()
|
||||
if (month < 10) {
|
||||
month = '0' + month
|
||||
}
|
||||
if (day < 10) {
|
||||
day = '0' + day
|
||||
}
|
||||
this.noticeDate = year + '-' + month + '-' + day
|
||||
this.date = date.getTime()
|
||||
if(date.getTime()==this.minDate.getTime()){
|
||||
this.getTime()
|
||||
if(this.noticeTime.split(':')[0]<this.minHour){
|
||||
this.noticeTime=''
|
||||
}else if(this.noticeTime.split(':')[0]=this.minHour){
|
||||
if(this.noticeTime.split(':')[1]<this.minMinute){
|
||||
this.noticeTime=''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
okTime(value){
|
||||
console.log(value.split(':')[0])
|
||||
.catch(err => {
|
||||
$this.$toast('保存失败')
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.show = false
|
||||
},
|
||||
ok(value) {
|
||||
this.show = false
|
||||
var date = new Date(value)
|
||||
var year = date.getFullYear()
|
||||
var month = date.getMonth() + 1
|
||||
var day = date.getDate()
|
||||
if (month < 10) {
|
||||
month = '0' + month
|
||||
}
|
||||
if (day < 10) {
|
||||
day = '0' + day
|
||||
}
|
||||
this.noticeDate = year + '-' + month + '-' + day
|
||||
this.date = date.getTime()
|
||||
if (date.getTime() == this.minDate.getTime()) {
|
||||
this.getTime()
|
||||
let flag=this.noticeDate.split('-')[0]<this.y||(this.noticeDate.split('-')[0]==this.y&&this.noticeDate.split('-')[1]<this.m)||(this.noticeDate.split('-')[0]==this.y&&this.noticeDate.split('-')[1]==this.m&&this.noticeDate.split('-')[2]<this.d)
|
||||
if(flag){
|
||||
this.noticeDate=''
|
||||
this.timeShow = false;
|
||||
this.noticeTime = value
|
||||
}else{
|
||||
if(this.noticeDate==this.today){
|
||||
if(value.split(':')[0]<this.minHour){
|
||||
if (this.noticeTime.split(':')[0] < this.minHour) {
|
||||
this.noticeTime = ''
|
||||
} else if ((this.noticeTime.split(':')[0] = this.minHour)) {
|
||||
if (this.noticeTime.split(':')[1] < this.minMinute) {
|
||||
this.noticeTime = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
okTime(value) {
|
||||
console.log(value.split(':')[0])
|
||||
this.getTime()
|
||||
let flag =
|
||||
this.noticeDate.split('-')[0] < this.y ||
|
||||
(this.noticeDate.split('-')[0] == this.y && this.noticeDate.split('-')[1] < this.m) ||
|
||||
(this.noticeDate.split('-')[0] == this.y && this.noticeDate.split('-')[1] == this.m && this.noticeDate.split('-')[2] < this.d)
|
||||
if (flag) {
|
||||
this.noticeDate = ''
|
||||
this.timeShow = false
|
||||
this.noticeTime = value
|
||||
} else {
|
||||
if (this.noticeDate == this.today) {
|
||||
if (value.split(':')[0] < this.minHour) {
|
||||
this.$toast('不能小于当前时间')
|
||||
} else if ((value.split(':')[0] = this.minHour)) {
|
||||
if (value.split(':')[1] < this.minMinute) {
|
||||
this.$toast('不能小于当前时间')
|
||||
}else if(value.split(':')[0]=this.minHour){
|
||||
if(value.split(':')[1]<this.minMinute){
|
||||
this.$toast('不能小于当前时间')
|
||||
}else{
|
||||
this.timeShow = false;
|
||||
this.noticeTime = value
|
||||
}
|
||||
}else{
|
||||
this.timeShow = false;
|
||||
} else {
|
||||
this.timeShow = false
|
||||
this.noticeTime = value
|
||||
}
|
||||
}else{
|
||||
this.timeShow = false;
|
||||
} else {
|
||||
this.timeShow = false
|
||||
this.noticeTime = value
|
||||
}
|
||||
} else {
|
||||
this.timeShow = false
|
||||
this.noticeTime = value
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
cancelTime(){
|
||||
this.timeShow = false;
|
||||
},
|
||||
formatter(type, value) {
|
||||
if (type === 'year') {
|
||||
return `${value}年`;
|
||||
} else if (type === 'month') {
|
||||
return `${value}月`
|
||||
}else if (type === 'day') {
|
||||
return `${value}日`
|
||||
}
|
||||
return value;
|
||||
},
|
||||
filter(type, options) {
|
||||
if (type === 'minute') {
|
||||
return options.filter(option => option % 15 === 0)
|
||||
}
|
||||
return options;
|
||||
},
|
||||
getTime(){
|
||||
let date=new Date();
|
||||
let hour=date.getHours();
|
||||
let minute=date.getMinutes();
|
||||
this.y = date.getFullYear(); // 年
|
||||
this.m = date.getMonth() + 1; // 月份从0开始的
|
||||
this.d = date.getDate(); //日
|
||||
if (minute<15) {
|
||||
minute='15';
|
||||
}else if(minute>=15&&minute<30){
|
||||
minute='30'
|
||||
}else if(minute>=30&&minute<45){
|
||||
minute='45'
|
||||
}else if(minute>=45&&minute<60){
|
||||
minute='00'
|
||||
hour=hour+1
|
||||
}
|
||||
if (hour<10) {
|
||||
hour='0'+hour;
|
||||
}
|
||||
this.today= this.y+'-'+ this.m +'-'+this.d
|
||||
this.currentTime = hour+':'+minute
|
||||
this.minHour = hour
|
||||
this.minMinute = minute
|
||||
}
|
||||
}
|
||||
},
|
||||
cancelTime() {
|
||||
this.timeShow = false
|
||||
},
|
||||
formatter(type, value) {
|
||||
if (type === 'year') {
|
||||
return `${value}年`
|
||||
} else if (type === 'month') {
|
||||
return `${value}月`
|
||||
} else if (type === 'day') {
|
||||
return `${value}日`
|
||||
}
|
||||
return value
|
||||
},
|
||||
filter(type, options) {
|
||||
if (type === 'minute') {
|
||||
return options.filter(option => option % 15 === 0)
|
||||
}
|
||||
return options
|
||||
},
|
||||
getTime() {
|
||||
let date = new Date()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
this.y = date.getFullYear() // 年
|
||||
this.m = date.getMonth() + 1 > 9 ? date.getMonth() + 1 : '0' + Number(date.getMonth() + 1) // 月份从0开始的
|
||||
this.d = date.getDate() > 9 ? date.getDate() : '0' + Number(date.getDate()) //日
|
||||
if (minute < 15) {
|
||||
minute = '15'
|
||||
} else if (minute >= 15 && minute < 30) {
|
||||
minute = '30'
|
||||
} else if (minute >= 30 && minute < 45) {
|
||||
minute = '45'
|
||||
} else if (minute >= 45 && minute < 60) {
|
||||
minute = '00'
|
||||
hour = hour + 1
|
||||
}
|
||||
if (hour < 10) {
|
||||
hour = '0' + hour
|
||||
}
|
||||
this.today = this.y + '-' + this.m + '-' + this.d
|
||||
this.currentTime = hour + ':' + minute
|
||||
this.minHour = hour
|
||||
this.minMinute = minute
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.editMilesone{
|
||||
.editMilesone {
|
||||
height: 100%;
|
||||
background-color: #fff
|
||||
background-color: #fff;
|
||||
}
|
||||
.text{
|
||||
min-height: 22vw
|
||||
.text {
|
||||
min-height: 22vw;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</van-col>
|
||||
</van-row>
|
||||
<van-row class="text-right pv5 card-title">
|
||||
<van-button type="danger" @click="edit(item)" size="small" class="mr5" round>编辑</van-button>
|
||||
<van-button type="danger" @click="edit(item)" size="small" class="mr5" round v-if="item.noticeStatus != '01'">编辑</van-button>
|
||||
<van-button type="danger" plain @click="del(item)" size="small" class="mr5" round>删除</van-button>
|
||||
</van-row>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user