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

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

@ -81,9 +81,6 @@
</el-form-item> </el-form-item>
</div>
<div>
<el-form-item label="姓名" <el-form-item label="姓名"
prop="name"> prop="name">
<el-input v-model="searchForm.name" <el-input v-model="searchForm.name"
@ -113,9 +110,17 @@
placeholder="请输入身份证"> placeholder="请输入身份证">
</el-input> </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>
<el-form-item label="疫苗接种针次" <el-form-item label="疫苗接种针次"
style="margin-left:20px"
prop="vaccineCount"> prop="vaccineCount">
<el-input v-model="searchForm.vaccineCount" <el-input v-model="searchForm.vaccineCount"
size="small" size="small"
@ -480,6 +485,7 @@
<script> <script>
import natForm from './natInfo/natForm' import natForm from './natInfo/natForm'
import inputRange from '@/views/components/rangeInput.vue'
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
@ -508,7 +514,10 @@ export default {
mobile: '', mobile: '',
idCard: '', idCard: '',
vaccineCount: '', vaccineCount: '',
natCount: '' natCount: '',
age: {},
startBirthDay: '',
endBirthDay: '',
}, },
formDetail: { formDetail: {
name: '', name: '',
@ -537,7 +546,7 @@ export default {
} }
}, },
components: { components: {
natForm natForm, inputRange
}, },
async created () { async created () {
@ -556,6 +565,32 @@ export default {
}, },
methods: { 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 () { handleCnalceForm () {
this.$refs.detail_form.resetFields() this.$refs.detail_form.resetFields()
this.vaccineList = [] this.vaccineList = []
@ -828,6 +863,9 @@ export default {
this.searchForm.buildingId = '' this.searchForm.buildingId = ''
this.searchForm.unitId = '' this.searchForm.unitId = ''
this.searchForm.houseId = '' this.searchForm.houseId = ''
this.searchForm.age = {}
this.searchForm.startBirthDay = ''
this.searchForm.endBirthDay = ''
this.pageSize = 20 this.pageSize = 20
this.pageNo = 1 this.pageNo = 1
this.loadTable() this.loadTable()

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

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

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

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

Loading…
Cancel
Save