Browse Source

限制提醒时间

shibei_master
13176889840 3 years ago
parent
commit
e864e09fe9
  1. 21
      src/views/modules/secretaryLog/difficulty/difficultyForm.vue
  2. 20
      src/views/modules/secretaryLog/humanisticCare/careForm.vue
  3. 2
      src/views/modules/secretaryLog/humanisticCare/careList.vue
  4. 22
      src/views/modules/secretaryLog/workLog/form.vue
  5. 2
      src/views/modules/secretaryLog/workLog/index.vue

21
src/views/modules/secretaryLog/difficulty/difficultyForm.vue

@ -56,6 +56,8 @@
format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm"
type="datetime" type="datetime"
:picker-options="pickerOptions"
@change="handleTime"
placeholder="选择时间"> placeholder="选择时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -114,6 +116,7 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request' import { requestPost } from '@/js/dai/request'
import { dateFormats } from '@/utils/index'
@ -125,7 +128,11 @@ export default {
formType: 'add', // addeditdetail formType: 'add', // addeditdetail
btnDisable: false, btnDisable: false,
pickerOptions: {
disabledDate(time) {
return time.getTime() <= Date.now() - 8.64e7;
}
},
difficultyId: '', difficultyId: '',
formData: { formData: {
content: '',// content: '',//
@ -150,7 +157,12 @@ export default {
}, },
methods: { methods: {
handleTime() {
var startAt = new Date(this.formData.remindTime) * 1000 /1000;
if(startAt < Date.now()) {
this.formData.remindTime = dateFormats('YYYY-mm-dd HH:MM', new Date());
}
},
async initForm (type, difficultyId) { async initForm (type, difficultyId) {
this.startLoading() this.startLoading()
this.$refs.ref_form.resetFields(); this.$refs.ref_form.resetFields();
@ -203,8 +215,7 @@ export default {
} else { } else {
await this.addDifficulty() await this.addDifficulty()
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
} }
}) })
@ -240,6 +251,8 @@ export default {
this.resetData() this.resetData()
this.$emit('dialogOk') this.$emit('dialogOk')
this.btnDisable = false this.btnDisable = false
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
} else { } else {
this.btnDisable = false this.btnDisable = false
this.$message.error(msg) this.$message.error(msg)

20
src/views/modules/secretaryLog/humanisticCare/careForm.vue

@ -82,6 +82,8 @@
format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm"
type="datetime" type="datetime"
:picker-options="pickerOptions"
@change="handleTime"
placeholder="选择时间"> placeholder="选择时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -145,6 +147,7 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request' import { requestPost } from '@/js/dai/request'
import { dateFormats } from '@/utils/index'
@ -166,7 +169,11 @@ export default {
], ],
btnDisable: false, btnDisable: false,
pickerOptions: {
disabledDate(time) {
return time.getTime() <= Date.now() - 8.64e7;
}
},
careId: '', careId: '',
formData: { formData: {
content: '',//怀 content: '',//怀
@ -194,7 +201,12 @@ export default {
}, },
methods: { methods: {
handleTime() {
var startAt = new Date(this.formData.remindTime) * 1000 /1000;
if(startAt < Date.now()) {
this.formData.remindTime = dateFormats('YYYY-mm-dd HH:MM', new Date());
}
},
async initForm (type, careId) { async initForm (type, careId) {
this.startLoading() this.startLoading()
this.$refs['ref_form'].resetFields(); this.$refs['ref_form'].resetFields();
@ -248,8 +260,6 @@ export default {
} else { } else {
await this.addCare() await this.addCare()
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
} }
}) })
@ -293,6 +303,8 @@ export default {
this.resetData() this.resetData()
this.$emit('dialogOk') this.$emit('dialogOk')
this.btnDisable = false this.btnDisable = false
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
} else { } else {
this.btnDisable = false this.btnDisable = false
this.$message.error(msg) this.$message.error(msg)

2
src/views/modules/secretaryLog/humanisticCare/careList.vue

@ -127,7 +127,7 @@
label="关怀人员" label="关怀人员"
min-width="120"> min-width="120">
</el-table-column> </el-table-column>
<el-table-column prop="phnoe" <el-table-column prop="phone"
header-align="center" header-align="center"
align="center" align="center"
label="电话" label="电话"

22
src/views/modules/secretaryLog/workLog/form.vue

@ -45,6 +45,8 @@
value-format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm"
type="datetime" type="datetime"
:disabled="disabled" :disabled="disabled"
:picker-options="pickerOptions"
@change="handleTime"
placeholder="选择时间"> placeholder="选择时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -90,6 +92,7 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request' import { requestPost } from '@/js/dai/request'
import { dateFormats } from '@/utils/index'
@ -102,7 +105,11 @@ export default {
formType: 'add', // addeditdetail formType: 'add', // addeditdetail
btnDisable: false, btnDisable: false,
pickerOptions: {
disabledDate(time) {
return time.getTime() <= Date.now() - 8.64e7;
}
},
id: '', id: '',
formData: { formData: {
content: '',// content: '',//
@ -140,7 +147,12 @@ export default {
// this.endLoading() // this.endLoading()
}, },
handleTime() {
var startAt = new Date(this.formData.remindTime) * 1000 /1000;
if(startAt < Date.now()) {
this.formData.remindTime = dateFormats('YYYY-mm-dd HH:MM', new Date());
}
},
async loadFormData () { async loadFormData () {
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/detail' // const url = 'http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/detail'
@ -179,8 +191,7 @@ export default {
} else { } else {
await this.addDifficulty() await this.addDifficulty()
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
} }
@ -215,8 +226,11 @@ export default {
message: '操作成功' message: '操作成功'
}) })
this.resetData() this.resetData()
this.$emit('dialogOk') this.$emit('dialogOk')
this.btnDisable = false this.btnDisable = false
this.$store.dispatch('setTipsList')
this.$store.dispatch('setTipsTime')
} else { } else {
this.btnDisable = false this.btnDisable = false
this.$message.error(msg) this.$message.error(msg)

2
src/views/modules/secretaryLog/workLog/index.vue

@ -204,7 +204,7 @@ export default {
editForm editForm
}, },
async created () { async created () {
console.log('sHeightcreated-----', this.sHeight, this.tableHeight) console.log('sHeightcreated-----', this.sHeight, Date.now())
}, },
async mounted () { async mounted () {

Loading…
Cancel
Save