Browse Source

Merge remote-tracking branch 'origin/feature/dev/vaccine_prarmeter' into feature/dev/vaccine_prarmeter

# Conflicts:
#	src/views/modules/sys/icvaccineprarmeter-add-or-update.vue
#	src/views/modules/sys/icvaccineprarmeter.vue
feature
wanggongfeng 3 years ago
parent
commit
e278e37cab
  1. 205
      src/views/modules/sys/icvaccineprarmeter-add-or-update.vue
  2. 60
      src/views/modules/sys/icvaccineprarmeter.vue

205
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"
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(() => {})
// })
}
}
}

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

@ -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"
@ -174,7 +174,8 @@
border
class="resi-table"
@selection-change="dataListSelectionChangeHandle"
style="width: 100%; height: 524px;overflow: auto;">
style="width: 100%;"
:height="maxTableHeight">
<el-table-column label="序号" header-align="center" align="center" width="50px">
<template slot-scope="scope">
{{scope.$index+1}}
@ -202,7 +203,7 @@
<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 v-if="scope.row.checkState === '0'" type="text" size="small" class="div-table-button--edit" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="scope.row.checkState === '0'" type="text" size="small" class="div-table-button--edit" @click="handleEdit(scope.$index)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" class="div-table-button--delete--noline" @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>
@ -219,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>
@ -231,6 +246,7 @@ import AddOrUpdate from './icvaccineprarmeter-add-or-update'
import nextTick from "dai-js/tools/nextTick";
import { requestPost , requestGet} from "@/js/dai/request";
import IcvaccineprarmeterCheck from './icvaccineprarmeter-check'
import {mapGetters} from "vuex";
export default {
mixins: [mixinViewModule],
data () {
@ -262,7 +278,8 @@ export default {
optionsH: [],
optionsD: [],
optionsG: [],
checkVisible: false
checkVisible: false,
formTitle:"新增"
}
},
components: {
@ -270,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
},
@ -285,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: "确定",
@ -392,7 +430,14 @@ export default {
this.dataForm.homeId = ''
this.getHouseList()
},
addFormOk () {
this.checkVisible = false;
this.getDataList();
},
addDiaClose () {
this.checkVisible = false;
this.$refs.add_parameter.resetData()
},
getGridList() {
const { user } = this.$store.state
this.$http
@ -615,6 +660,7 @@ export default {
}
);
},
}
}
</script>

Loading…
Cancel
Save