From e864e09fe9895d784f1700e73cabfea799f1bd1a Mon Sep 17 00:00:00 2001 From: 13176889840 <13176889840@163.com> Date: Thu, 17 Mar 2022 17:14:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6=E6=8F=90=E9=86=92=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../difficulty/difficultyForm.vue | 21 ++++++++++++++---- .../secretaryLog/humanisticCare/careForm.vue | 20 +++++++++++++---- .../secretaryLog/humanisticCare/careList.vue | 2 +- .../modules/secretaryLog/workLog/form.vue | 22 +++++++++++++++---- .../modules/secretaryLog/workLog/index.vue | 2 +- 5 files changed, 53 insertions(+), 14 deletions(-) diff --git a/src/views/modules/secretaryLog/difficulty/difficultyForm.vue b/src/views/modules/secretaryLog/difficulty/difficultyForm.vue index 02760a1d..240a320a 100644 --- a/src/views/modules/secretaryLog/difficulty/difficultyForm.vue +++ b/src/views/modules/secretaryLog/difficulty/difficultyForm.vue @@ -56,6 +56,8 @@ format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" type="datetime" + :picker-options="pickerOptions" + @change="handleTime" placeholder="选择时间"> @@ -114,6 +116,7 @@ import { mapGetters } from 'vuex' import { Loading } from 'element-ui' // 引入Loading服务 import { requestPost } from '@/js/dai/request' +import { dateFormats } from '@/utils/index' @@ -125,7 +128,11 @@ export default { formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 btnDisable: false, - + pickerOptions: { + disabledDate(time) { + return time.getTime() <= Date.now() - 8.64e7; + } + }, difficultyId: '', formData: { content: '',//内容 @@ -150,7 +157,12 @@ export default { }, 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) { this.startLoading() this.$refs.ref_form.resetFields(); @@ -203,8 +215,7 @@ export default { } else { await this.addDifficulty() - this.$store.dispatch('setTipsList') - this.$store.dispatch('setTipsTime') + } }) @@ -240,6 +251,8 @@ export default { this.resetData() this.$emit('dialogOk') this.btnDisable = false + this.$store.dispatch('setTipsList') + this.$store.dispatch('setTipsTime') } else { this.btnDisable = false this.$message.error(msg) diff --git a/src/views/modules/secretaryLog/humanisticCare/careForm.vue b/src/views/modules/secretaryLog/humanisticCare/careForm.vue index 2dc54f2a..4c9fba45 100644 --- a/src/views/modules/secretaryLog/humanisticCare/careForm.vue +++ b/src/views/modules/secretaryLog/humanisticCare/careForm.vue @@ -82,6 +82,8 @@ format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" type="datetime" + :picker-options="pickerOptions" + @change="handleTime" placeholder="选择时间"> @@ -145,6 +147,7 @@ import { mapGetters } from 'vuex' import { Loading } from 'element-ui' // 引入Loading服务 import { requestPost } from '@/js/dai/request' +import { dateFormats } from '@/utils/index' @@ -166,7 +169,11 @@ export default { ], btnDisable: false, - + pickerOptions: { + disabledDate(time) { + return time.getTime() <= Date.now() - 8.64e7; + } + }, careId: '', formData: { content: '',//关怀事项 @@ -194,7 +201,12 @@ export default { }, 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) { this.startLoading() this.$refs['ref_form'].resetFields(); @@ -248,8 +260,6 @@ export default { } else { await this.addCare() - this.$store.dispatch('setTipsList') - this.$store.dispatch('setTipsTime') } }) @@ -293,6 +303,8 @@ export default { this.resetData() this.$emit('dialogOk') this.btnDisable = false + this.$store.dispatch('setTipsList') + this.$store.dispatch('setTipsTime') } else { this.btnDisable = false this.$message.error(msg) diff --git a/src/views/modules/secretaryLog/humanisticCare/careList.vue b/src/views/modules/secretaryLog/humanisticCare/careList.vue index a712923c..bd0ec7ab 100644 --- a/src/views/modules/secretaryLog/humanisticCare/careList.vue +++ b/src/views/modules/secretaryLog/humanisticCare/careList.vue @@ -127,7 +127,7 @@ label="关怀人员" min-width="120"> - @@ -90,6 +92,7 @@ import { mapGetters } from 'vuex' import { Loading } from 'element-ui' // 引入Loading服务 import { requestPost } from '@/js/dai/request' +import { dateFormats } from '@/utils/index' @@ -102,7 +105,11 @@ export default { formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 btnDisable: false, - + pickerOptions: { + disabledDate(time) { + return time.getTime() <= Date.now() - 8.64e7; + } + }, id: '', formData: { content: '',//内容 @@ -140,7 +147,12 @@ export default { // 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 () { // const url = 'http://yapi.elinkservice.cn/mock/245/gov/project/memoDifficulty/detail' @@ -179,8 +191,7 @@ export default { } else { await this.addDifficulty() - this.$store.dispatch('setTipsList') - this.$store.dispatch('setTipsTime') + } @@ -215,8 +226,11 @@ export default { message: '操作成功' }) this.resetData() + this.$emit('dialogOk') this.btnDisable = false + this.$store.dispatch('setTipsList') + this.$store.dispatch('setTipsTime') } else { this.btnDisable = false this.$message.error(msg) diff --git a/src/views/modules/secretaryLog/workLog/index.vue b/src/views/modules/secretaryLog/workLog/index.vue index 57e2f85b..e448cb0c 100644 --- a/src/views/modules/secretaryLog/workLog/index.vue +++ b/src/views/modules/secretaryLog/workLog/index.vue @@ -204,7 +204,7 @@ export default { editForm }, async created () { - console.log('sHeightcreated-----', this.sHeight, this.tableHeight) + console.log('sHeightcreated-----', this.sHeight, Date.now()) }, async mounted () {