Browse Source

Merge branch 'feature/dev/vaccine_prarmeter' into dev

dev-用户反馈
zhaoqifeng 3 years ago
parent
commit
b5f885cd8e
  1. 201
      src/views/modules/sys/icvaccineprarmeter-add-or-update.vue
  2. 97
      src/views/modules/sys/icvaccineprarmeter.vue

201
src/views/modules/sys/icvaccineprarmeter-add-or-update.vue

@ -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"
center>
<!-- <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,17 @@
<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" 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" 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,37 +138,76 @@
<el-date-picker
v-model="dataForm.firstVacTime"
type="date"
clearable
placeholder="选择日期时间"
value-format="yyyy-MM-dd"
style="width: 200px; margin-right: 20px"
>
</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" 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"
>
</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" 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"
>
</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" 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"
@ -192,19 +234,28 @@
></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,
gridList: [],
villageList: [],
@ -219,6 +270,11 @@
{ value: '0', label: '否' },
{ value: '1', label: '是' },
],
vacSiteOption: [
{ value: '本街道内接种', label: '本街道内接种' },
{ value: '区内其他街道接种', label: '区内其他街道接种' },
{ value: '区外其他地区接种', label: '区外其他地区接种' },
],
reasonOption: [
{ value: '禁忌症', label: '禁忌症' },
{ value: '拒绝接种', label: '拒绝接种' },
@ -253,7 +309,8 @@
reason: '',
note: '',
checkState: '0',
checkReason: ''
checkReason: '',
btnDisable: false
}
}
},
@ -350,15 +407,21 @@
}
}
},
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;
@ -369,8 +432,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);
@ -398,6 +489,7 @@
this.$message.error(msg)
}
},
getVillageList() {
const { user } = this.$store.state
this.$http
@ -527,6 +619,16 @@
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 = {
id: '',
@ -565,8 +667,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";
@ -582,34 +712,13 @@
type: "success",
message: "操作成功",
});
this.resetData();
this.visible = false;
this.btnDisable = false;
this.$emit('dialogOk')
this.resetData()
this.btnDisable = false
} else {
this.btnDisable = false;
this.$message.error(msg);
}
// 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(() => {})
// })
}
}
}

97
src/views/modules/sys/icvaccineprarmeter.vue

@ -112,10 +112,10 @@
clearable
></el-input>
</el-form-item>
<el-form-item label="身份证号" prop="idCard">
<el-form-item label="证号" prop="idCard">
<el-input
v-model="dataForm.idCard"
placeholder="身份证号"
placeholder="证号"
clearable
></el-input>
</el-form-item>
@ -143,7 +143,7 @@
<el-card class="resi-card-table">
<div class="resi-row-btn">
<el-button class="diy-button--add" type="primary" size="small" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
<el-button class="diy-button--add" type="primary" size="small" @click="handleAdd">{{ $t('add') }}</el-button>
<el-button class="diy-button--export" size="small" @click="handleExportModule()">下载模板</el-button>
<el-upload
ref="upload"
@ -169,36 +169,41 @@
</el-upload>
<el-button class="diy-button--reset" size="small" @click="handleExport">导出</el-button>
</div>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle"
style="width: 100%;" class="resi-table">
<el-table v-loading="dataListLoading"
:data="dataList"
border
class="resi-table"
@selection-change="dataListSelectionChangeHandle"
style="width: 100%;"
:height="maxTableHeight">
<el-table-column label="序号" header-align="center" align="center" width="50px">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column prop="gridName" label="网格名称" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="villageName" label="所属小区名称" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="buildName" label="所属楼宇名称" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="unitName" label="单元" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="villageName" label="所属小区" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="buildName" label="所属楼宇" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="unitName" label="单元" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="homeName" label="房间名" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="householdTypeName" label="户口性质" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="name" label="姓名" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="mobile" label="联系电话" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="idCard" label="身份证号" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="idCard" label="证号" header-align="center" align="center" width="100" show-overflow-tooltip></el-table-column>
<el-table-column prop="isVaccinationName" label="是否接种" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="firstVacTime" label="第一次接种时间" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="firstVacSite" label="第一次接种地点" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="secondVacTime" label="第二次接种时间" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="secondVacSite" label="第二次接种地点" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="thirdVacTime" label="第三次接种时间" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="thirdVacSite" label="第三次接种地点" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="reason" label="原因" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="note" label="备注" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="firstVacTime" label="第一次接种时间" header-align="center" align="center" width="110" show-overflow-tooltip></el-table-column>
<el-table-column prop="firstVacSite" label="第一次接种地点" header-align="center" align="center" width="110" show-overflow-tooltip></el-table-column>
<el-table-column prop="secondVacTime" label="第二次接种时间" header-align="center" align="center" width="110" show-overflow-tooltip></el-table-column>
<el-table-column prop="secondVacSite" label="第二次接种地点" header-align="center" align="center" width="110" show-overflow-tooltip></el-table-column>
<el-table-column prop="thirdVacTime" label="第三次接种时间" header-align="center" align="center" width="110" show-overflow-tooltip></el-table-column>
<el-table-column prop="thirdVacSite" label="第三次接种地点" header-align="center" align="center" width="110" show-overflow-tooltip></el-table-column>
<el-table-column prop="reason" label="原因" header-align="center" align="center" width="110" show-overflow-tooltip></el-table-column>
<el-table-column prop="note" label="备注" header-align="center" align="center" width="110" show-overflow-tooltip></el-table-column>
<el-table-column prop="checkStateName" label="审核状态" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="checkReason" label="审核理由" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="handleEdit(scope.$index)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id)">{{ $t('delete') }}</el-button>
<el-button v-if="scope.row.checkState === '0'" type="text" class="div-table-button--detail" size="small"
@click="handleWatch(scope.row)">审核</el-button>
@ -215,9 +220,23 @@
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<icvaccineprarmeter-check v-if="checkVisible" ref="checkPage" @refreshDataList="getDataList"></icvaccineprarmeter-check>
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>-->
<!-- <icvaccineprarmeter-check v-if="checkVisible" ref="checkPage" @refreshDataList="getDataList"></icvaccineprarmeter-check>-->
</el-card>
<el-dialog :visible.sync="checkVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="850px"
top="5vh"
class="dialog-h"
@closed="addDiaClose">
<add-or-update ref="add_parameter"
@dialogCancle="addDiaClose"
@dialogOk="addFormOk">
</add-or-update>
</el-dialog>
</div>
</template>
@ -227,6 +246,7 @@ import AddOrUpdate from './icvaccineprarmeter-add-or-update'
import nextTick from "dai-js/tools/nextTick";
import { requestPost } from "@/js/dai/request";
import IcvaccineprarmeterCheck from './icvaccineprarmeter-check'
import {mapGetters} from "vuex";
export default {
mixins: [mixinViewModule],
data () {
@ -258,7 +278,8 @@ export default {
optionsH: [],
optionsD: [],
optionsG: [],
checkVisible: false
checkVisible: false,
formTitle:"新增"
}
},
components: {
@ -266,6 +287,12 @@ export default {
IcvaccineprarmeterCheck
},
computed:{
maxTableHeight() {
return this.$store.state.inIframe
? this.clientHeight - 360 + this.iframeHeigh
: this.clientHeight - 360;
},
...mapGetters(["clientHeight", "iframeHeight"]),
changeVDisabled() {
return !this.dataForm.villageId
},
@ -281,6 +308,21 @@ export default {
this.getValiheList()
},
methods:{
//
handleAdd() {
this.formTitle = "新增";
this.checkVisible = true;
this.$nextTick(() => {
this.$refs.add_parameter.init();
});
// await this.$refs.ref_form_add.init();
},
async handleEdit(rowIndex) {
this.formTitle = "修改";
this.checkVisible = true;
await nextTick();
this.$refs.add_parameter.init(this.dataList[rowIndex]);
},
async handleDelete(id) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
@ -304,7 +346,7 @@ export default {
type: "success",
message: "删除成功",
});
this.loadTable();
this.getDataList();
} else {
this.$message.error(msg);
}
@ -388,7 +430,13 @@ export default {
this.dataForm.homeId = ''
this.getHouseList()
},
addFormOk () {
this.checkVisible = false;
this.getDataList();
},
addDiaClose () {
this.checkVisible = false;
},
getGridList() {
const { user } = this.$store.state
this.$http
@ -610,11 +658,14 @@ export default {
}
);
},
}
}
</script>
<style lang="scss" scoped>
@import '@/assets/scss/buttonstyle.scss';
@import "@/assets/scss/modules/visual/communityManage.scss";
@import "@/assets/scss/modules/management/list-main.scss";
.resi-container .resi-card-table {
::v-deep .el-table th {

Loading…
Cancel
Save