From f95b9cfb401821ebd2079f7cf44266a8969307f4 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Thu, 7 Jul 2022 15:40:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=96=AB=E6=83=85=E9=98=B2=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/base/epidemic/natInfo/natList.vue | 2 +- src/views/modules/base/epidemic/vaccin.vue | 22 +++-- src/views/modules/base/epidemic/vaccinAdd.vue | 87 +++++++++--------- .../base/epidemic/veroFocus/veroFocusAdd.vue | 88 +++++++++++++++++-- .../communityService/fuwujilu/fuwuList.vue | 1 + 5 files changed, 138 insertions(+), 62 deletions(-) diff --git a/src/views/modules/base/epidemic/natInfo/natList.vue b/src/views/modules/base/epidemic/natInfo/natList.vue index f269abef..ee9480f1 100644 --- a/src/views/modules/base/epidemic/natInfo/natList.vue +++ b/src/views/modules/base/epidemic/natInfo/natList.vue @@ -4,7 +4,7 @@ + :label-width="'110px'">
+ :label-width="'110px'">
+ @closed="addDiaClose">
@@ -399,6 +399,10 @@ export default { this.$refs.ref_form.resetData(); this.formShow = false; }, + addDiaClose () { + + this.addFormShow = false; + }, async handleDetail (row) { this.formTitle = "详情"; @@ -416,16 +420,18 @@ export default { }); }, - handleEdit (row) { + async handleEdit (row) { this.formTitle = "修改"; + const row1 = { ...row } + let row2 = await this.getInfo(row1); this.addFormShow = true; this.$nextTick(() => { - this.$refs.ref_form_add.initForm("edit", row.vaccineId); + this.$refs.ref_form_add.initForm("edit", row2); }); }, addFormOk () { - this.formShow = false; + this.addFormShow = false; this.loadTable(); }, @@ -441,6 +447,7 @@ export default { if (code === 0) { row.mobile = data.mobile; row.idCard = data.idCard; + row.isResiUser = data.isResiUser } return row; }, @@ -461,10 +468,9 @@ export default { async deleteNat (row) { const url = "/epmetuser/icVaccine/del"; - // const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icVaccine/del" let params = { - icVaccineId: row.vaccineId, + vaccineId: row.vaccineId, }; const { data, code, msg } = await requestPost(url, params); diff --git a/src/views/modules/base/epidemic/vaccinAdd.vue b/src/views/modules/base/epidemic/vaccinAdd.vue index 7f6723b6..2224c5c8 100644 --- a/src/views/modules/base/epidemic/vaccinAdd.vue +++ b/src/views/modules/base/epidemic/vaccinAdd.vue @@ -179,15 +179,6 @@ @click="handleComfirm">确 定
- - - - @@ -203,8 +194,7 @@ export default { data () { return { formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 - hideUploadEdit: false, // 隐藏'上传按钮' - limitNum: 1, + enterType: '1',//录入方式1 手动输入 2 选择居民 isFromResi: false,//是否从已有居民信息中选择 @@ -218,12 +208,13 @@ export default { btnDisable: false, - icVaccineId: '', + vaccineId: '', formData: { - icVaccineId: '', + vaccineId: '', agencyId: '',//当前网格所属组织Id userId: '',//居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 userType: 'icresi',//居民端小程序的人:resi;数字社区的居民:icresi;导入的:import;同步的:synchro + isResiUser: "0",//是否客户下居民(0:否 1:是) name: '', idCard: '', mobile: '', @@ -253,7 +244,7 @@ export default { this.formData.content = '' }, - async initForm (type, icVaccineId) { + async initForm (type, row) { this.startLoading() this.formData.agencyId = this.agencyId @@ -262,11 +253,16 @@ export default { this.enterType = '1' this.formType = type - if (icVaccineId) { - this.icVaccineId = icVaccineId - this.formData.icVaccineId = icVaccineId - this.isFromResi = false - await this.loadFormData() + if (row) { + + if (row.userId) { + this.isFromResi = true + } + row.content = '' + row.isSelChannel = false + row.channel = [] + this.formData = { ...row } + } this.endLoading() @@ -283,8 +279,10 @@ export default { this.$refs['ref_form'].resetFields(); if (value === '2') { + this.formData.isResiUser = "1" this.isFromResi = true } else { + this.formData.isResiUser = "0" this.isFromResi = false } @@ -335,10 +333,9 @@ export default { async loadFormData () { - // const url = 'http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/detail' const url = '/epmetuser/icNat/detail' let params = { - icVaccineId: this.icVaccineId, + vaccineId: this.vaccineId, } const { data, code, msg } = await requestPost(url, params) if (code === 0) { @@ -356,7 +353,7 @@ export default { // } console.log(this.formData.isSelChannel) - this.formData.icVaccineId = this.icVaccineId + this.formData.vaccineId = this.vaccineId if (this.formData.userId) { this.isFromResi = true } else { @@ -375,20 +372,14 @@ export default { app.util.validateRule(messageObj) } else { - this.addNat() + this.addVaccin() } }) }, - async addNat () { - // if (this.imgLoading) { - // this.$message({ - // type: 'warning', - // message: '正在上传图片,请稍候重试' - // }) - // return false; - // } + async addVaccin () { + const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //手机号码 if (regPhone.test(this.formData.mobile) === false) { this.btnDisable = false @@ -424,6 +415,8 @@ export default { this.formData.content = '' } + + this.btnDisable = true setTimeout(() => { this.btnDisable = false @@ -431,13 +424,13 @@ export default { let url = '' if (this.formType === 'add') { - url = '/epmetuser/icNat/add' - // url = "http://yapi.elinkservice.cn/mock/102/epmetuser/icNat/add" - this.formData.icVaccineId = '' + url = '/epmetuser/icVaccine/add' + + this.formData.vaccineId = '' } else { - url = '/epmetuser/icNat/edit' - // url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/edit" + url = '/epmetuser/icVaccine/edit' + } @@ -448,8 +441,9 @@ export default { type: 'success', message: '操作成功' }) - this.resetData() + this.$emit('dialogOk') + this.resetData() this.btnDisable = false } else { @@ -467,15 +461,14 @@ export default { resetData () { - this.icVaccineId = '' - this.fileList = [] - this.hideUploadEdit = false + this.vaccineId = '' this.formData = { - icVaccineId: '', + vaccineId: '', agencyId: '',//当前网格所属组织Id userId: '',//居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 userType: 'icresi',//居民端小程序的人:resi;数字社区的居民:icresi;导入的:import;同步的:synchro + isResiUser: "0",//是否客户下居民(0:否 1:是) name: '', idCard: '', mobile: '', @@ -511,22 +504,22 @@ export default { dataRule () { return { name: [ - { required: true, message: '姓名不能为空', trigger: 'blur' } + { required: true, message: '姓名不能为空', trigger: 'change' } ], idCard: [ - { required: true, message: '身份证号不能为空', trigger: 'blur' } + { required: true, message: '身份证号不能为空', trigger: 'change' } ], mobile: [ - { required: true, message: '手机号不能为空', trigger: 'blur' }, + { required: true, message: '手机号不能为空', trigger: 'change' }, ], inoculateTime: [ - { required: true, message: '接种时间不能为空', trigger: 'blur' }, + { required: true, message: '接种时间不能为空', trigger: 'change' }, ], inoculateTime: [ - { required: true, message: '接种地点不能为空', trigger: 'blur' }, + { required: true, message: '接种地点不能为空', trigger: 'change' }, ], inoculateTime: [ - { required: true, message: '疫苗厂家不能为空', trigger: 'blur' }, + { required: true, message: '疫苗厂家不能为空', trigger: 'change' }, ], diff --git a/src/views/modules/base/epidemic/veroFocus/veroFocusAdd.vue b/src/views/modules/base/epidemic/veroFocus/veroFocusAdd.vue index 578e0b10..64d94a37 100644 --- a/src/views/modules/base/epidemic/veroFocus/veroFocusAdd.vue +++ b/src/views/modules/base/epidemic/veroFocus/veroFocusAdd.vue @@ -128,6 +128,7 @@ + + + + + + + + + + + width="150"> + label="接种次数" + width="80"> + + @@ -323,6 +357,21 @@ import { mapGetters } from 'vuex' let loading // 加载动画 export default { data () { + let endDisabledDate = (time) => {//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 + let nowData = Date.now() + + if (this.startDate) { + let startDate = new Date(this.startDate) + return time.getTime() > nowData || time.getTime() < startDate || time.getTime() === startDate + } else { + return time.getTime() > nowData + } + + } + let startDisabledDate = (time) => {//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 + let nowData = Date.now() + return time.getTime() > nowData + } return { activeName: "first", @@ -331,10 +380,21 @@ export default { btnDisable: false, + startDate: '', + endDate: '', formDataSearch: { gridId: '', vaccineCount: undefined, - attentionType: 1 + attentionType: 1, + startDate: '', + endDate: '' + }, + + endPickerOptions: { + disabledDate: endDisabledDate + }, + startPickerOptions: { + disabledDate: startDisabledDate }, formData1: { @@ -374,6 +434,7 @@ export default { this.agencyId = user.agencyId //获取网格下拉框数据 await this.loadGrid() + this.loadTable() }, methods: { @@ -384,7 +445,7 @@ export default { this.formData2.content = '' }, async initForm () { - this.tableData = [] + this.loadTable() this.$refs['ref_form1'].resetFields(); this.$refs['ref_form2'].resetFields(); @@ -400,6 +461,15 @@ export default { async loadTable () { this.tableLoading = true + if (this.startDate) { + let array = this.startDate.split('-') + this.formDataSearch.startDate = array[0] + array[1] + array[2] + } + if (this.endDate) { + let array = this.endDate.split('-') + this.formDataSearch.endDate = array[0] + array[1] + array[2] + } + const url = "/epmetuser/epidemicPrevention/user-list" // const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/epidemicPrevention/page" let params = { @@ -673,7 +743,9 @@ export default { this.formDataSearch = { gridId: '', vaccineCount: undefined, - attentionType: 1 + attentionType: 1, + startDate: '', + endDate: '' } }, @@ -782,6 +854,10 @@ export default { diff --git a/src/views/modules/communityService/fuwujilu/fuwuList.vue b/src/views/modules/communityService/fuwujilu/fuwuList.vue index 2309bd62..c670f259 100644 --- a/src/views/modules/communityService/fuwujilu/fuwuList.vue +++ b/src/views/modules/communityService/fuwujilu/fuwuList.vue @@ -280,6 +280,7 @@ export default { data () { let endDisabledDate = (time) => {//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 let nowData = Date.now() + if (this.formData.serviceTimeStart) { let serviceTimeStart = new Date(this.formData.serviceTimeStart) return time.getTime() > nowData || time.getTime() < serviceTimeStart || time.getTime() === serviceTimeStart