jiangyy 3 years ago
parent
commit
0bb4a130d1
  1. 85
      src/views/components/rangeInput.vue
  2. 48
      src/views/modules/base/epidemic/antiInfo.vue
  3. 8
      src/views/modules/base/epidemic/vaccin.vue
  4. 54
      src/views/modules/base/epidemic/vaccinAdd.vue

85
src/views/components/rangeInput.vue

@ -1,33 +1,31 @@
<template>
<el-form :model="inputForm" :rules="rules" class="demo-form-inline">
<div class="flex-div">
<el-form-item prop="start">
<el-input
v-model="inputForm.start"
class="wd50"
size="small"
:type="inputType"
clearable
placeholder="请输入"
@change="handleChange"
/>
</el-form-item>
<div>-</div>
<el-form-item prop="end">
<el-input
v-model="inputForm.end"
class="wd50"
size="small"
:type="inputType"
clearable
placeholder="请输入"
@change="handleChange"
@blur="handleBlur"
/>
</el-form-item>
</div>
</el-form>
<el-form :model="inputForm"
:rules="rules"
class="demo-form-inline">
<div class="flex-div">
<el-form-item prop="start">
<el-input v-model="inputForm.start"
class="wd50"
size="small"
:type="inputType"
clearable
placeholder="请输入"
@change="handleChange" />
</el-form-item>
<div class="div_middle">-</div>
<el-form-item prop="end">
<el-input v-model="inputForm.end"
class="wd50"
size="small"
:type="inputType"
clearable
placeholder="请输入"
@change="handleChange"
@blur="handleBlur" />
</el-form-item>
</div>
</el-form>
</template>
<script>
@ -40,19 +38,19 @@ export default {
props: {
value: {
type: Object,
default: () => {
default: () => {
return {
start: '',
end: ''
}
}
}
},
type: {
type: String,
default: ''
}
},
data() {
data () {
let checkAge = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入内容'))
@ -64,33 +62,33 @@ export default {
}
}
return {
inputForm: {...this.value},
inputForm: { ...this.value },
rules: {
end: [
{ validator: checkAge, trigger: 'blur' }
],
{ validator: checkAge, trigger: 'blur' }
],
}
}
},
computed: {
inputType() {
inputType () {
if (this.type == 'num') return 'number'
}
},
watch: {
'value.start'(val) {
'value.start' (val) {
this.inputForm.start = val
},
'value.end'(val) {
'value.end' (val) {
this.inputForm.end = val
},
},
methods: {
handleChange(val) {
handleChange (val) {
// if ()
this.$emit('change', { ...this.inputForm})
this.$emit('change', { ...this.inputForm })
},
handleBlur() {
handleBlur () {
}
}
@ -117,10 +115,13 @@ export default {
input::-webkit-inner-spin-button {
-webkit-appearance: none;
}
input[type='number']{
input[type="number"] {
-moz-appearance: textfield;
}
}
}
.div_middle {
padding: 0 10px;
}
</style>

48
src/views/modules/base/epidemic/antiInfo.vue

@ -81,9 +81,6 @@
</el-form-item>
</div>
<div>
<el-form-item label="姓名"
prop="name">
<el-input v-model="searchForm.name"
@ -113,9 +110,17 @@
placeholder="请输入身份证">
</el-input>
</el-form-item>
<el-form-item label="年龄"
prop="age">
<inputRange v-model="searchForm.age"
type="range"
@change="handleAgeChange" />
</el-form-item>
<el-form-item label="疫苗接种针次"
style="margin-left:20px"
prop="vaccineCount">
<el-input v-model="searchForm.vaccineCount"
size="small"
@ -480,6 +485,7 @@
<script>
import natForm from './natInfo/natForm'
import inputRange from '@/views/components/rangeInput.vue'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
@ -508,7 +514,10 @@ export default {
mobile: '',
idCard: '',
vaccineCount: '',
natCount: ''
natCount: '',
age: {},
startBirthDay: '',
endBirthDay: '',
},
formDetail: {
name: '',
@ -537,7 +546,7 @@ export default {
}
},
components: {
natForm
natForm, inputRange
},
async created () {
@ -556,6 +565,32 @@ export default {
},
methods: {
handleAgeChange (val) {
console.log('val----age---', val)
if (val.end) {
const s = this.computedBirth(val.end)
const e = this.computedBirth(val.start)
this.searchForm.startBirthDay = s
this.searchForm.endBirthDay = e
}
},
computedBirth (age) {
let now = new Date();
let nowYear = now.getFullYear();
let nowMonth = now.getMonth() + 1;
let nowDay = now.getDate(); // daymonthmonthyearyear
let subYear = nowYear - age
if (nowMonth < 10) {
nowMonth = '0' + nowMonth
}
if (nowDay < 10) {
nowDay = '0' + nowDay
}
console.log(subYear + '-' + nowMonth + '-' + nowDay);
return subYear + '-' + nowMonth + '-' + nowDay
},
handleCnalceForm () {
this.$refs.detail_form.resetFields()
this.vaccineList = []
@ -828,6 +863,9 @@ export default {
this.searchForm.buildingId = ''
this.searchForm.unitId = ''
this.searchForm.houseId = ''
this.searchForm.age = {}
this.searchForm.startBirthDay = ''
this.searchForm.endBirthDay = ''
this.pageSize = 20
this.pageNo = 1
this.loadTable()

8
src/views/modules/base/epidemic/vaccin.vue

@ -420,7 +420,7 @@ export default {
this.formTitle = "修改";
this.addFormShow = true;
this.$nextTick(() => {
this.$refs.ref_form_add.initForm("edit", row.icNatId);
this.$refs.ref_form_add.initForm("edit", row.vaccineId);
});
},
@ -460,11 +460,11 @@ export default {
},
async deleteNat (row) {
const url = "/epmetuser/icNat/del";
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/del"
const url = "/epmetuser/icVaccine/del";
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icVaccine/del"
let params = {
icNatId: row.icNatId,
icVaccineId: row.vaccineId,
};
const { data, code, msg } = await requestPost(url, params);

54
src/views/modules/base/epidemic/vaccinAdd.vue

@ -98,10 +98,10 @@
<el-form-item label="接种"
style="display: block"
prop="natTime"
prop="inoculateTime"
label-width="150px">
<el-date-picker class="item_width_2"
v-model="formData.natTime"
v-model="formData.inoculateTime"
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm"
type="datetime"
@ -112,23 +112,23 @@
</el-form-item>
<el-form-item label="接种地点"
prop="natAddress"
prop="inoculateAddress"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入检测地点"
clearable
v-model="formData.natAddress">
v-model="formData.inoculateAddress">
</el-input>
</el-form-item>
<el-form-item label="疫苗厂家"
prop="natAddress"
prop="manufacturer"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入检测地点"
clearable
v-model="formData.natAddress">
v-model="formData.manufacturer">
</el-input>
</el-form-item>
@ -218,18 +218,19 @@ export default {
btnDisable: false,
icNatId: '',
icVaccineId: '',
formData: {
icNatId: '',
icVaccineId: '',
agencyId: '',//Id
userId: '',//idicResiUserId
userType: 'icresi',//resi;icresi;import;synchro
name: '',
idCard: '',
mobile: '',
natTime: '',
natAddress: '',
natResult: '',
inoculateTime: '',
inoculateAddress: '',
manufacturer: '',
isSelChannel: false,
channel: [],
content: '',
@ -252,7 +253,7 @@ export default {
this.formData.content = ''
},
async initForm (type, icNatId) {
async initForm (type, icVaccineId) {
this.startLoading()
this.formData.agencyId = this.agencyId
@ -261,9 +262,9 @@ export default {
this.enterType = '1'
this.formType = type
if (icNatId) {
this.icNatId = icNatId
this.formData.icNatId = icNatId
if (icVaccineId) {
this.icVaccineId = icVaccineId
this.formData.icVaccineId = icVaccineId
this.isFromResi = false
await this.loadFormData()
}
@ -337,7 +338,7 @@ export default {
// const url = 'http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/detail'
const url = '/epmetuser/icNat/detail'
let params = {
icNatId: this.icNatId,
icVaccineId: this.icVaccineId,
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
@ -355,7 +356,7 @@ export default {
// }
console.log(this.formData.isSelChannel)
this.formData.icNatId = this.icNatId
this.formData.icVaccineId = this.icVaccineId
if (this.formData.userId) {
this.isFromResi = true
} else {
@ -432,7 +433,7 @@ export default {
if (this.formType === 'add') {
url = '/epmetuser/icNat/add'
// url = "http://yapi.elinkservice.cn/mock/102/epmetuser/icNat/add"
this.formData.icNatId = ''
this.formData.icVaccineId = ''
} else {
url = '/epmetuser/icNat/edit'
@ -466,21 +467,22 @@ export default {
resetData () {
this.icNatId = ''
this.icVaccineId = ''
this.fileList = []
this.hideUploadEdit = false
this.formData = {
icNatId: '',
icVaccineId: '',
agencyId: '',//Id
userId: '',//idicResiUserId
userType: 'icresi',//resi;icresi;import;synchro
name: '',
idCard: '',
mobile: '',
natTime: '',
natAddress: '',
natResult: '',
inoculateTime: '',
inoculateAddress: '',
manufacturer: '',
isSelChannel: false,
channel: [],
content: '',
@ -517,13 +519,13 @@ export default {
mobile: [
{ required: true, message: '手机号不能为空', trigger: 'blur' },
],
natTime: [
inoculateTime: [
{ required: true, message: '接种时间不能为空', trigger: 'blur' },
],
natTime: [
inoculateTime: [
{ required: true, message: '接种地点不能为空', trigger: 'blur' },
],
natTime: [
inoculateTime: [
{ required: true, message: '疫苗厂家不能为空', trigger: 'blur' },
],

Loading…
Cancel
Save