|
|
@ -1,8 +1,10 @@ |
|
|
|
<template> |
|
|
|
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" |
|
|
|
:close-on-click-modal="false" |
|
|
|
:close-on-press-escape="false" |
|
|
|
left> |
|
|
|
<!-- <el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')"--> |
|
|
|
<!-- :close-on-click-modal="false"--> |
|
|
|
<!-- :close-on-press-escape="false"--> |
|
|
|
<!-- center>--> |
|
|
|
<div> |
|
|
|
<div class="dialog-h-content scroll-h"> |
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" class="form"> |
|
|
|
<el-form-item label="所属网格" label-width="150px" prop="gridId"> |
|
|
|
<el-select class="item_width_2" |
|
|
@ -96,7 +98,7 @@ |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="户口性质" label-width="150px"> |
|
|
|
<el-form-item label="户口性质" label-width="150px" prop="householdType"> |
|
|
|
<el-select class="item_width_2" |
|
|
|
v-model.trim="dataForm.householdType" |
|
|
|
placeholder="请选择" |
|
|
@ -113,16 +115,16 @@ |
|
|
|
<el-input class="item_width_2" style="width: 200px; margin-right: 20px" clearable v-model="dataForm.name" placeholder="姓名"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="联系电话" label-width="150px" prop="mobile"> |
|
|
|
<el-input v-model="dataForm.mobile" class="item_width_2" style="width: 200px; margin-right: 20px" placeholder="联系电话"></el-input> |
|
|
|
<el-input v-model="dataForm.mobile" class="item_width_2" clearable style="width: 200px; margin-right: 20px" placeholder="联系电话"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="身份证号" label-width="150px" prop="idCard"> |
|
|
|
<el-input v-model="dataForm.idCard" class="item_width_2" style="width: 200px; margin-right: 20px" placeholder="身份证号"></el-input> |
|
|
|
<el-form-item label="证件号" label-width="150px" prop="idCard"> |
|
|
|
<el-input v-model="dataForm.idCard" class="item_width_2" clearable style="width: 200px; margin-right: 20px" placeholder="证件号"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="是否接种" label-width="150px"> |
|
|
|
<el-form-item label="是否接种" label-width="150px" prop="isVaccination"> |
|
|
|
<el-select class="item_width_2" |
|
|
|
v-model.trim="dataForm.isVaccination" |
|
|
|
placeholder="请选择" |
|
|
|
clearable |
|
|
|
@change="isVacChange" |
|
|
|
> |
|
|
|
<el-option v-for="item in isVaccinationOption" |
|
|
|
:key="item.value" |
|
|
@ -135,6 +137,7 @@ |
|
|
|
<el-date-picker |
|
|
|
v-model="dataForm.firstVacTime" |
|
|
|
type="date" |
|
|
|
clearable |
|
|
|
placeholder="选择日期时间" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
style="width: 200px; margin-right: 20px" |
|
|
@ -142,12 +145,24 @@ |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="dataForm.isVaccination === '1'" label="第一次接种地点" label-width="150px" > |
|
|
|
<el-input v-model="dataForm.firstVacSite" class="item_width_2" style="width: 200px; margin-right: 20px" placeholder="第一次接种地点"></el-input> |
|
|
|
<el-select class="item_width_2" |
|
|
|
v-model.trim="dataForm.firstVacSite" |
|
|
|
placeholder="请选择" |
|
|
|
clearable |
|
|
|
style="width: 200px; margin-right: 20px" |
|
|
|
> |
|
|
|
<el-option v-for="item in vacSiteOption" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="dataForm.isVaccination === '1'" label="第二次接种时间" label-width="150px"> |
|
|
|
<el-date-picker |
|
|
|
v-model="dataForm.secondVacTime" |
|
|
|
type="date" |
|
|
|
clearable |
|
|
|
placeholder="选择日期时间" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
style="width: 200px; margin-right: 20px" |
|
|
@ -155,12 +170,24 @@ |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="dataForm.isVaccination === '1'" label="第二次接种地点" label-width="150px"> |
|
|
|
<el-input v-model="dataForm.secondVacSite" class="item_width_1" style="width: 200px; margin-right: 20px" placeholder="第二次接种地点"></el-input> |
|
|
|
<el-select class="item_width_2" |
|
|
|
v-model.trim="dataForm.secondVacSite" |
|
|
|
placeholder="请选择" |
|
|
|
clearable |
|
|
|
style="width: 200px; margin-right: 20px" |
|
|
|
> |
|
|
|
<el-option v-for="item in vacSiteOption" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="dataForm.isVaccination === '1'" label="第三次接种时间" label-width="150px"> |
|
|
|
<el-date-picker |
|
|
|
v-model="dataForm.thirdVacTime" |
|
|
|
type="date" |
|
|
|
clearable |
|
|
|
placeholder="选择日期时间" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
style="width: 200px; margin-right: 20px" |
|
|
@ -168,7 +195,18 @@ |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="dataForm.isVaccination === '1'" label="第三次接种地点" label-width="150px"> |
|
|
|
<el-input v-model="dataForm.thirdVacSite" class="item_width_2" style="width: 200px; margin-right: 20px" placeholder="第三次接种地点"></el-input> |
|
|
|
<el-select class="item_width_2" |
|
|
|
v-model.trim="dataForm.thirdVacSite" |
|
|
|
placeholder="请选择" |
|
|
|
clearable |
|
|
|
style="width: 200px; margin-right: 20px" |
|
|
|
> |
|
|
|
<el-option v-for="item in vacSiteOption" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="dataForm.isVaccination === '0'" label="原因" label-width="150px"> |
|
|
|
<el-select class="item_width_2" |
|
|
@ -195,20 +233,30 @@ |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<template slot="footer"> |
|
|
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|
|
|
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
<div class="div_btn resi-btns"> |
|
|
|
<!-- <template slot="footer">--> |
|
|
|
<el-button @click=handleCancle>{{ $t('cancel') }}</el-button> |
|
|
|
<el-button type="primary" @click="dataFormSubmitHandle()" :disabled="btnDisable">{{ $t('confirm') }}</el-button> |
|
|
|
<!-- </template>--> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- </el-dialog>--> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import debounce from 'lodash/debounce' |
|
|
|
import { requestPost } from '@/js/dai/request' |
|
|
|
import nextTick from "dai-js/tools/nextTick"; |
|
|
|
import { Loading } from "element-ui"; |
|
|
|
import formVltHelper from "dai-js/tools/formVltHelper"; |
|
|
|
let loading; // 加载动画 |
|
|
|
export default { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
formType: "add", |
|
|
|
visible: false, |
|
|
|
btnDisable: false, |
|
|
|
gridList: [], |
|
|
|
villageList: [], |
|
|
|
buildList: [], |
|
|
@ -222,6 +270,11 @@ |
|
|
|
{ value: '0', label: '否' }, |
|
|
|
{ value: '1', label: '是' }, |
|
|
|
], |
|
|
|
vacSiteOption: [ |
|
|
|
{ value: '本街道内接种', label: '本街道内接种' }, |
|
|
|
{ value: '区内其他街道接种', label: '区内其他街道接种' }, |
|
|
|
{ value: '区外其他地区接种', label: '区外其他地区接种' }, |
|
|
|
], |
|
|
|
reasonOption: [ |
|
|
|
{ value: '禁忌症', label: '禁忌症' }, |
|
|
|
{ value: '拒绝接种', label: '拒绝接种' }, |
|
|
@ -256,7 +309,7 @@ |
|
|
|
reason: '', |
|
|
|
note: '', |
|
|
|
checkState: '0', |
|
|
|
checkReason: '' |
|
|
|
checkReason: '', |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -353,21 +406,27 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
async created () { |
|
|
|
async mounted () { |
|
|
|
const { user } = this.$store.state |
|
|
|
this.agencyId = user.agencyId |
|
|
|
//获取网格下拉框数据 |
|
|
|
await this.loadGrid() |
|
|
|
this.getVillageList() |
|
|
|
this.getBuildList() |
|
|
|
this.getUniList() |
|
|
|
this.getHouseList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
init () { |
|
|
|
debugger |
|
|
|
async init (row) { |
|
|
|
if (row) { |
|
|
|
this.dataForm.id = row.id |
|
|
|
} |
|
|
|
const { user } = this.$store.state |
|
|
|
this.agencyId = user.agencyId |
|
|
|
this.visible = true; |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['dataForm'].resetFields() |
|
|
|
if (this.dataForm.id) { |
|
|
|
if (this.dataForm.id !== '') { |
|
|
|
this.getInfo() |
|
|
|
}else { |
|
|
|
this.dataForm = { |
|
|
@ -404,8 +463,36 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
async initForm(type, row) { |
|
|
|
// this.$refs.ref_form.resetFields(); |
|
|
|
this.formType = type; |
|
|
|
console.log(row); |
|
|
|
if (row) { |
|
|
|
// this.fmData = { ...this.fmData, ...row }; |
|
|
|
await this.getInfo(row.id); |
|
|
|
this.getValiheList(); |
|
|
|
this.getBuildList(); |
|
|
|
this.getUniList(); |
|
|
|
this.getHouseList(); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 开启加载动画 |
|
|
|
startLoading() { |
|
|
|
loading = Loading.service({ |
|
|
|
lock: true, // 是否锁定 |
|
|
|
text: "正在加载……", // 加载中需要显示的文字 |
|
|
|
background: "rgba(0,0,0,.7)", // 背景颜色 |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 结束加载动画 |
|
|
|
endLoading() { |
|
|
|
// clearTimeout(timer); |
|
|
|
if (loading) { |
|
|
|
loading.close(); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 获取信息 |
|
|
|
getInfo () { |
|
|
|
async getInfo () { |
|
|
|
this.$http.get(`/epmetuser/icVaccinePrarmeter/${this.dataForm.id}`).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
;return this.$message.error(res.msg); |
|
|
@ -433,6 +520,7 @@ |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
getVillageList() { |
|
|
|
const { user } = this.$store.state |
|
|
|
this.$http |
|
|
@ -562,8 +650,18 @@ |
|
|
|
homeClick(data) { |
|
|
|
this.dataForm.homeName = data.label; |
|
|
|
}, |
|
|
|
isVacChange(val) { |
|
|
|
if (val === '0') { |
|
|
|
this.dataForm.firstVacTime = ''; |
|
|
|
this.dataForm.firstVacSite = ''; |
|
|
|
this.dataForm.secondVacTime = ''; |
|
|
|
this.dataForm.secondVacSite = ''; |
|
|
|
this.dataForm.thirdVacTime = ''; |
|
|
|
this.dataForm.thirdVacSite = ''; |
|
|
|
} |
|
|
|
}, |
|
|
|
resetData () { |
|
|
|
this.formData = { |
|
|
|
this.dataForm = { |
|
|
|
id: '', |
|
|
|
customerId: '', |
|
|
|
gridId: '', |
|
|
@ -600,8 +698,36 @@ |
|
|
|
// this.formData = {} |
|
|
|
// this.resetData() |
|
|
|
}, |
|
|
|
handleCancle () { |
|
|
|
this.resetData() |
|
|
|
this.$emit('dialogCancle') |
|
|
|
|
|
|
|
}, |
|
|
|
// 表单提交 |
|
|
|
async dataFormSubmitHandle() { |
|
|
|
this.btnDisable = true; |
|
|
|
setTimeout(() => { |
|
|
|
this.btnDisable = false; |
|
|
|
}, 10000); |
|
|
|
//验证手机号码 |
|
|
|
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; |
|
|
|
if (regPhone.test(this.dataForm.mobile) === false) { |
|
|
|
this.btnDisable = false |
|
|
|
this.$message({ |
|
|
|
type: 'warning', |
|
|
|
message: '请输入正确的手机号码' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
await this.$refs['dataForm'].validate((valid) => { |
|
|
|
if (!valid) { |
|
|
|
return false |
|
|
|
} |
|
|
|
this.submit(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
async submit() { |
|
|
|
let url = ""; |
|
|
|
if (!this.dataForm.id ) { |
|
|
|
url = "/epmetuser/icVaccinePrarmeter/save"; |
|
|
@ -617,36 +743,13 @@ |
|
|
|
type: "success", |
|
|
|
message: "操作成功", |
|
|
|
}); |
|
|
|
this.resetData(); |
|
|
|
this.visible = false; |
|
|
|
this.btnDisable = false; |
|
|
|
this.$emit('refreshDataList') |
|
|
|
this.$emit('dialogOk') |
|
|
|
this.resetData() |
|
|
|
this.btnDisable = false |
|
|
|
} else { |
|
|
|
this.btnDisable = false; |
|
|
|
this.$message.error(msg); |
|
|
|
this.$emit('refreshDataList') |
|
|
|
} |
|
|
|
|
|
|
|
// this.$refs['dataForm'].validate((valid) => { |
|
|
|
// if (!valid); { |
|
|
|
// return false |
|
|
|
// } |
|
|
|
// |
|
|
|
// this.$http[!this.dataForm.id ? 'post' : 'put'](url, this.dataForm).then(({ data: res }) => { |
|
|
|
// if (res.code !== 0) { |
|
|
|
// return this.$message.error(res.msg); |
|
|
|
// } |
|
|
|
// this.$message({ |
|
|
|
// message: this.$t('prompt.success'), |
|
|
|
// type: 'success', |
|
|
|
// duration: 500, |
|
|
|
// onClose: () => { |
|
|
|
// this.visible = false; |
|
|
|
// this.$emit('refreshDataList') |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }).catch(() => {}) |
|
|
|
// }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|