Commit 01df31be authored by lrw's avatar lrw

首次上报

parent ba765a3e
...@@ -2,30 +2,32 @@ ...@@ -2,30 +2,32 @@
<view class="questionnaire"> <view class="questionnaire">
<form @submit="formSubmit"> <form @submit="formSubmit">
<template v-for="(item,index) in list"> <template v-for="(item,index) in list">
<view v-if="item.type == 'radio'" class="margin-top padding sict-label" :key="item.value"> <template v-if="item.type == 'radio'">
<view v-show="!item.hidden"> <view class="margin-top padding sict-label" :key="item.value" v-show="!item.hidden">
<span style="color:red;display: inline-block; vertical-align:inherit;margin-right:4upx" v-if="item.required">*</span> <view v-show="!item.hidden">
{{index+1}}{{item.label}} <span style="color:red;display: inline-block; vertical-align:inherit;margin-right:4upx" v-if="item.required">*</span>
</view> {{index+1}}{{item.label}}
<view class="text-right sict-value" v-show="!item.hidden"> </view>
<radio-group> <view class="text-right sict-value" v-show="!item.hidden">
<view> <radio-group @change="showChange($event,item)">
<view class="label" v-for="(opt, optIndex) in item.opts" :key="opt.label" @click="radioChange(opt.value,item.value)"> <view>
<radio :class="form[item.value]== opt.value ?'checked':''" :checked="form[item.value]== opt.value?true:false" <view class="label" v-for="(opt, optIndex) in item.opts" :key="opt.label">
:value="opt.value"></radio> <radio :class="form[item.value]== opt.value ?'checked':''" :checked="form[item.value]== opt.value?true:false"
<view style="display: inline-block;" class="right">{{opt.label}}</view> :value="opt.value"></radio>
<view style="display: inline-block;" class="right">{{opt.label}}</view>
</view>
</view> </view>
</view> </radio-group>
</radio-group> </view>
</view> </view>
</view> </template>
<template v-else-if="item.type == 'picker'"> <template v-else-if="item.type == 'picker'">
<view class="cu-form-group margin-top padding-rl" v-show="!item.hidden" :key="item.value"> <view class="cu-form-group margin-top padding-rl" v-show="!item.hidden" :key="item.value">
<view :class="item.titleClass"><span style="color:red;display: inline-block; vertical-align:inherit;margin-right:4upx" <view :class="item.titleClass"><span style="color:red;display: inline-block; vertical-align:inherit;margin-right:4upx"
v-if="item.required">*</span>{{index+1}}{{item.label}}</view> v-if="item.required">*</span>{{index+1}}{{item.label}}</view>
<picker @change="updatePickerVal($event,item.value)" range-key="label" :value="form[item.value]" :range="item.opts"> <picker @change="updatePickerVal($event,item)" range-key="label" mode="selector" :value="form[item.value]" :range="item.opts">
<view class="picker"> <view class="picker">
{{form[item.value]>-1?item.opts[form[item.value]].label:'请选择'}} {{form[item.value]?form[item.value]:'请选择'}}
</view> </view>
</picker> </picker>
</view> </view>
...@@ -37,9 +39,9 @@ ...@@ -37,9 +39,9 @@
<uni-collapse-item :title="index+1 +'、' + item.label" :open="true" :required="item.required"> <uni-collapse-item :title="index+1 +'、' + item.label" :open="true" :required="item.required">
<view class="padding-lr"> <view class="padding-lr">
<view class="uni-list"> <view class="uni-list">
<checkbox-group> <checkbox-group @change="showChange($event,item)">
<label class="uni-list-cell uni-list-cell-pd" v-for="(itemCheck,indexCheck) in item.opts" :key="itemCheck.value" <label class="uni-list-cell uni-list-cell-pd" v-for="(itemCheck,indexCheck) in item.opts" :key="itemCheck.value"
@click="checkboxChange(indexCheck,item.opts,itemCheck,item.value)"> @click="checkboxChange(indexCheck,itemCheck,item)">
<view class="list-item"> <view class="list-item">
<view class="fl"> <view class="fl">
<checkbox :value="itemCheck.value" :checked="itemCheck.checked" /> <checkbox :value="itemCheck.value" :checked="itemCheck.checked" />
...@@ -59,15 +61,15 @@ ...@@ -59,15 +61,15 @@
<view class="cu-form-group margin-top padding-rl" v-show="!item.hidden" :key="item.value"> <view class="cu-form-group margin-top padding-rl" v-show="!item.hidden" :key="item.value">
<view :class="item.titleClass"><span style="color:red;display: inline-block; vertical-align:inherit;margin-right:4upx" <view :class="item.titleClass"><span style="color:red;display: inline-block; vertical-align:inherit;margin-right:4upx"
v-if="item.required">*</span>{{index+1}}{{item.label}}</view> v-if="item.required">*</span>{{index+1}}{{item.label}}</view>
<picker mode="date" :value="date" start="2015-09-01" end="2020-09-01" @change="updatePickerVal($event,item.value)"> <picker mode="date" :value="date" start="2015-09-01" end="2020-09-01" @change="updatePickerVal($event,item)">
<view class="picker"> <view class="picker">
{{form[item.value]>-1?item.opts[form[item.value]].label:'请选择'}} {{form[item.value]?form[item.value]:'请选择'}}
</view> </view>
</picker> </picker>
</view> </view>
</template> </template>
<template v-else-if="item.type == 'input'"> <template v-else-if="item.type == 'input'">
<view class="cu-form-group margin-top padding-rl" :key="item.value"> <view class="cu-form-group margin-top padding-rl" :key="item.value" v-show="!item.hidden">
<view :class="item.titleClass"> <view :class="item.titleClass">
<span style="color:red;display: inline-block; vertical-align:inherit;margin-right:4upx" v-if="item.required">*</span> <span style="color:red;display: inline-block; vertical-align:inherit;margin-right:4upx" v-if="item.required">*</span>
{{index+1}}{{item.label}}</view> {{index+1}}{{item.label}}</view>
...@@ -84,7 +86,7 @@ ...@@ -84,7 +86,7 @@
<checkbox v-if="childItem.type == 'radio'" :class="form[childItem.value]?'checked':''" :checked="form[childItem.value]?true:false" <checkbox v-if="childItem.type == 'radio'" :class="form[childItem.value]?'checked':''" :checked="form[childItem.value]?true:false"
:value="childItem.value"></checkbox> :value="childItem.value"></checkbox>
<picker v-else-if="childItem.type == 'picker'" range-key="label" @change="updatePickerVal($event,childItem.value)" <picker v-else-if="childItem.type == 'picker'" range-key="label" @change="updatePickerVal($event,childItem)"
:value="form[childItem.value]" :range="childItem.opts"> :value="form[childItem.value]" :range="childItem.opts">
<view class="picker"> <view class="picker">
{{form[childItem.value]>-1?childItem.opts[form[childItem.value]].label:'请选择'}} {{form[childItem.value]>-1?childItem.opts[form[childItem.value]].label:'请选择'}}
...@@ -98,11 +100,11 @@ ...@@ -98,11 +100,11 @@
<view class="cu-form-group margin-top-sm"> <view class="cu-form-group margin-top-sm">
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<view class="padding-top padding-bottom"> <view class="padding-top padding-bottom" >
<checkbox-group @change="checkboxChange($event,'agree')"> <checkbox-group @click="openModal">
<label> <label>
<checkbox value="A" :checked="form.agree == 'a'" class="fl" style="margin-top:4upx" /> <checkbox value="A" :checked="form.agree == '1'" class="fl" style="margin-top:4upx" />
<view style="padding-left:60upx;padding-top:6upx" @click="modalName = 'Modal'"> <view style="padding-left:60upx;padding-top:6upx">
我已阅读理解了全部情况,我同意参加 我已阅读理解了全部情况,我同意参加
</view> </view>
</label> </label>
...@@ -112,7 +114,7 @@ ...@@ -112,7 +114,7 @@
</checkbox-group> </checkbox-group>
</view> </view>
<view class="cu-modal" :class="modalName=='Modal'?'show':''"> <view class="cu-modal" :class="modalName?'show':''">
<view class="cu-dialog"> <view class="cu-dialog">
<view class="cu-bar bg-white justify-end text-bold"> <view class="cu-bar bg-white justify-end text-bold">
<view class="content">知情同意书</view> <view class="content">知情同意书</view>
...@@ -160,7 +162,7 @@ ...@@ -160,7 +162,7 @@
}, },
data() { data() {
return { return {
modalName: '', modalName: false,
id: '', id: '',
radio: [], radio: [],
shanghaiList: [{ shanghaiList: [{
...@@ -452,7 +454,7 @@ ...@@ -452,7 +454,7 @@
list: [{ list: [{
label: '单位名称', label: '单位名称',
required: true, required: true,
value: 'orgId', value: 'orgName',
titleClass: 'title', titleClass: 'title',
type: 'picker', type: 'picker',
opts: [] opts: []
...@@ -489,7 +491,7 @@ ...@@ -489,7 +491,7 @@
placeholder: '请输入联系方式', placeholder: '请输入联系方式',
type: 'input', type: 'input',
}, },
{ {
label: '国籍', label: '国籍',
required: true, required: true,
value: 'nationality', value: 'nationality',
...@@ -1332,12 +1334,16 @@ ...@@ -1332,12 +1334,16 @@
titleClass: 'title', titleClass: 'title',
type: 'radio', type: 'radio',
opts: [{ opts: [{
value: 'a', value: '0',
label: '' label: ''
}, { },
value: 'b', {
label: '' value: '1',
}], label: ''
},
],
show: [11],
showValue: ['1']
}, },
{ {
label: '计划复工日期', label: '计划复工日期',
...@@ -1345,21 +1351,26 @@ ...@@ -1345,21 +1351,26 @@
required: true, required: true,
value: 'planReturnDate', value: 'planReturnDate',
titleClass: 'title', titleClass: 'title',
type: 'date' type: 'date',
num: 11
}, },
{ {
label: '是否离沪', label: '是否离沪',
required: true, required: true,
value: 'left', value: 'left',
titleClass: 'title', titleClass: 'title',
type: 'picker', type: 'radio',
opts: [{ opts: [{
value: 'a', value: '0',
label: '' label: ''
}, { },
value: 'b', {
label: '' value: '1',
}] label: ''
}
],
show: [13, 14, 15, 16, 17, 18, 19, 20, 21],
showValue: ['1']
}, },
{ {
label: '离沪原因', label: '离沪原因',
...@@ -1379,7 +1390,9 @@ ...@@ -1379,7 +1390,9 @@
}, { }, {
value: 'b', value: 'b',
label: '其他' label: '其他'
}] }],
num: 13,
hidden: true,
}, },
{ {
label: '离沪出发日期', label: '离沪出发日期',
...@@ -1387,26 +1400,32 @@ ...@@ -1387,26 +1400,32 @@
value: 'leftDate', value: 'leftDate',
titleClass: 'title', titleClass: 'title',
type: 'date', type: 'date',
num: 14,
hidden: true,
}, },
{ {
label: '离沪方式', label: '离沪方式',
required: true, required: true,
value: 'leftVehicle', value: 'leftVehicle',
titleClass: 'title', titleClass: 'title',
type: 'date', type: 'radio',
opts: [{ opts: [{
value: 'a', value: '火车',
label: '火车 ' label: '火车 '
}, { }, {
value: '飞机', value: '飞机',
label: '' label: '飞机'
}, { }, {
value: '客车', value: '客车',
label: '' label: '客车'
}, { }, {
value: '自驾', value: '自驾',
label: '' label: '自驾'
}] }],
num: 15,
show: ['16'],
showValue: ['火车', '飞机'],
hidden: true,
}, },
{ {
label: '离沪车次/航班', label: '离沪车次/航班',
...@@ -1415,6 +1434,8 @@ ...@@ -1415,6 +1434,8 @@
titleClass: 'title', titleClass: 'title',
placeholder: '请输入地址', placeholder: '请输入地址',
type: 'input', type: 'input',
num: 16,
hidden: true,
}, },
{ {
label: '离沪到达日期', label: '离沪到达日期',
...@@ -1422,13 +1443,8 @@ ...@@ -1422,13 +1443,8 @@
value: 'leftReachDate', value: 'leftReachDate',
titleClass: 'title', titleClass: 'title',
type: 'date', type: 'date',
opts: [{ num: 17,
value: 'a', hidden: true,
label: ''
}, {
value: 'b',
label: ''
}]
}, },
{ {
label: '离沪目的地', label: '离沪目的地',
...@@ -1437,6 +1453,8 @@ ...@@ -1437,6 +1453,8 @@
titleClass: 'title', titleClass: 'title',
placeholder: '请输入地址', placeholder: '请输入地址',
type: 'input', type: 'input',
num: 18,
hidden: true,
}, },
{ {
label: '离沪具体地址', label: '离沪具体地址',
...@@ -1445,6 +1463,8 @@ ...@@ -1445,6 +1463,8 @@
titleClass: 'title', titleClass: 'title',
placeholder: '请输入地址', placeholder: '请输入地址',
type: 'input', type: 'input',
num: 19,
hidden: true,
}, },
{ {
label: '离沪同行者姓名(没有填无)', label: '离沪同行者姓名(没有填无)',
...@@ -1453,6 +1473,8 @@ ...@@ -1453,6 +1473,8 @@
titleClass: 'title', titleClass: 'title',
placeholder: '请输入', placeholder: '请输入',
type: 'input', type: 'input',
num: 20,
hidden: true,
}, },
{ {
label: '离沪同行者联系方式(没有填无)', label: '离沪同行者联系方式(没有填无)',
...@@ -1461,19 +1483,23 @@ ...@@ -1461,19 +1483,23 @@
titleClass: 'title', titleClass: 'title',
placeholder: '请输入', placeholder: '请输入',
type: 'input', type: 'input',
num: 21,
hidden: true,
}, },
{ {
label: '是否返沪', label: '是否返沪',
required: true, required: true,
value: 'backed', value: 'backed',
titleClass: 'title', titleClass: 'title',
type: 'picker', type: 'radio',
show: [23, 24, 25, 26, 27, 28, 29],
showValue: ['1'],
opts: [{ opts: [{
value: 'a', value: '0',
label: ''
}, {
value: 'b',
label: '' label: ''
}, {
value: '1',
label: ''
}] }]
}, },
{ {
...@@ -1483,6 +1509,8 @@ ...@@ -1483,6 +1509,8 @@
titleClass: 'title', titleClass: 'title',
placeholder: '请输入', placeholder: '请输入',
type: 'input', type: 'input',
num: 23,
hidden: true,
}, },
{ {
label: '返沪出发日期', label: '返沪出发日期',
...@@ -1490,26 +1518,32 @@ ...@@ -1490,26 +1518,32 @@
value: 'backDate', value: 'backDate',
titleClass: 'title', titleClass: 'title',
type: 'date', type: 'date',
num: 24,
hidden: true,
}, },
{ {
label: '返沪方式', label: '返沪方式',
required: true, required: true,
value: 'backVehicle', value: 'backVehicle',
titleClass: 'title', titleClass: 'title',
type: 'picker', type: 'radio',
opts: [{ opts: [{
value: 'a', value: '火车',
label: '火车 ' label: '火车 '
}, { }, {
value: '飞机', value: '飞机',
label: '' label: '飞机'
}, { }, {
value: '客车', value: '客车',
label: '' label: '客车'
}, { }, {
value: '自驾', value: '自驾',
label: '' label: '自驾'
}] }],
show: ['26'],
showValue: ['火车', '飞机'],
num: 25,
hidden: true,
}, },
{ {
label: '返沪车次/航班', label: '返沪车次/航班',
...@@ -1518,6 +1552,8 @@ ...@@ -1518,6 +1552,8 @@
titleClass: 'title', titleClass: 'title',
placeholder: '请输入地址', placeholder: '请输入地址',
type: 'input', type: 'input',
num: 26,
hidden: true,
}, },
{ {
label: '返沪到达日期', label: '返沪到达日期',
...@@ -1525,6 +1561,8 @@ ...@@ -1525,6 +1561,8 @@
value: 'backReachedDate', value: 'backReachedDate',
titleClass: 'title', titleClass: 'title',
type: 'date', type: 'date',
num: 27,
hidden: true,
}, },
{ {
label: '返沪同行者姓名(没有填无)', label: '返沪同行者姓名(没有填无)',
...@@ -1533,6 +1571,8 @@ ...@@ -1533,6 +1571,8 @@
titleClass: 'title', titleClass: 'title',
placeholder: '请输入', placeholder: '请输入',
type: 'input', type: 'input',
num: 28,
hidden: true,
}, },
{ {
label: '返沪同行者联系方式(没有填无)', label: '返沪同行者联系方式(没有填无)',
...@@ -1541,113 +1581,262 @@ ...@@ -1541,113 +1581,262 @@
titleClass: 'title', titleClass: 'title',
placeholder: '请输入', placeholder: '请输入',
type: 'input', type: 'input',
num: 29,
hidden: true,
}, },
{ {
label: '当前状况', label: '当前状况',
required: true, required: true,
value: 'currentStatus', value: 'currentStatus',
titleClass: 'title', titleClass: 'title',
type: 'picker', type: 'pickerMore',
opts: [{ opts: [{
value: 'a', value: '已经确诊',
label: '已经确诊' label: '已经确诊'
}, { }, {
value: 'b', value: '疑似诊断',
label: '疑似诊断' label: '疑似诊断'
}, { }, {
value: 'b', value: '亲密接触者',
label: '亲密接触者' label: '亲密接触者'
}, { }, {
value: 'b', value: '居家观察/正在接受集中医学观察',
label: '正在接受集中医学观察' label: '居家观察/正在接受集中医学观察'
}, {
value: 'b',
label: '居家观察'
}, { }, {
value: 'b', value: '已解除集中医学观察',
label: '已解除集中医学观察' label: '已解除集中医学观察'
}, { }, {
value: 'b', value: '无上述情况',
label: '无上述情况' label: '无上述情况'
}] }],
showList: [{
value: '亲密接触者',
show: '32,48'
},
{
value: '居家观察/正在接受集中医学观察',
show: '49,50',
},
]
}, },
{ {
label: '症状', label: '停留湖北',
required: true, required: true,
value: 'symptom', value: 'hubeiStopped',
titleClass: 'title', titleClass: 'title',
type: 'pickerMore', type: 'radio',
num: 32,
hidden: true,
opts: [{ opts: [{
value: '发热', value: '0',
label: '发热' label: ''
}, {
value: '咳嗽',
label: '咳嗽'
}, {
value: '流涕',
label: '流涕'
}, {
value: '咽痛',
label: '咽痛'
}, {
value: '咳痰',
label: '咳痰'
}, {
value: '胸痛',
label: '胸痛'
}, {
value: '肌肉酸痛/关节痛',
label: '肌肉酸痛/关节痛'
}, {
value: '气促',
label: '气促'
}, {
value: '腹泻',
label: '腹泻'
}, { }, {
value: '以上均无', value: '1',
label: '以上均无' label: ''
}] }],
show: [33, 34],
showValue: ['1']
}, },
{ {
label: '湖北接触史', label: '到达湖北日期',
required: true, required: true,
value: 'relativesGastricCount', value: 'hubeiStopStartDate',
titleClass: 'title',
type: 'date',
num: 33,
hidden: true
},
{
label: '离开湖北日期',
required: true,
value: 'hubeiStopEndDate',
titleClass: 'title',
type: 'date',
num: 34,
hidden: true
},
{
label: '途径湖北',
required: true,
value: 'hubeiPassed',
titleClass: 'title', titleClass: 'title',
type: 'radio', type: 'radio',
opts: [{ opts: [{
value: '已经确诊', value: '0',
label: '已经确诊' label: ''
}, { }, {
value: '疑似诊断', value: '1',
label: '疑似诊断' label: ''
}],
show: [36, 37],
num: 35,
hidden: true,
showValue: ['1']
},
{
label: '途径湖北到达日期',
required: true,
value: 'hubeiPassStartDate',
titleClass: 'title',
type: 'date',
num: 36,
hidden: true
},
{
label: '途径湖北离开日期',
required: true,
value: 'hubeiPassEndDate',
titleClass: 'title',
type: 'date',
num: 37,
hidden: true
},
{
label: '接触湖北人员',
required: true,
value: 'hubeiContacted',
titleClass: 'title',
type: 'radio',
opts: [{
value: '0',
label: ''
}, { }, {
value: '亲密接触者', value: '1',
label: '亲密接触者' label: ''
}],
show: [39],
num: 38,
hidden: true,
showValue: ['1']
},
{
label: '接触湖北人员接触时间',
required: true,
value: 'hubeiContactDate',
titleClass: 'title',
type: 'date',
num: 39,
hidden: true
},
{
label: '家属停留或途径湖北',
required: true,
value: 'hubeiFamilyStopped',
titleClass: 'title',
type: 'radio',
opts: [{
value: '0',
label: ''
}, { }, {
value: '正在接受集中医学观察', value: '1',
label: '正在接受集中医学观察' label: ''
}],
show: [41, 42],
num: 40,
hidden: true,
showValue: ['1']
},
{
label: '家属停留或途径湖北到达日期',
required: true,
value: 'hubeiFamilyStopStartDate',
titleClass: 'title',
type: 'date',
num: 41,
hidden: true
},
{
label: '家属停留或途径湖北离开日期',
required: true,
value: 'hubeiFamilyStoppEndDate',
titleClass: 'title',
type: 'date',
num: 42,
hidden: true
},
{
label: '家属接触湖北人员',
required: true,
value: 'hubeiFamilyContacted',
titleClass: 'title',
type: 'radio',
opts: [{
value: '0',
label: ''
}, { }, {
value: '居家观察', value: '1',
label: '居家观察' label: ''
}],
show: [44],
num: 43,
hidden: true,
showValue: ['1']
},
{
label: '家属接触湖北人员接触时间',
required: true,
value: 'hubeiFamilyContactDate',
titleClass: 'title',
type: 'date',
num: 44,
hidden: true
},
{
label: '接触过已确诊或疑似患者',
required: true,
value: 'patientContact',
titleClass: 'title',
type: 'radio',
opts: [{
value: '0',
label: ''
}, { }, {
value: '已解除集中医学观察', value: '1',
label: '已解除集中医学观察' label: ''
}] }],
show: [46],
num: 45,
hidden: true,
showValue: ['1']
}, },
{ {
label: '患者接触史', label: '接触患者时间',
required: true, required: true,
value: 'relativesGastricCount', value: 'patientContactDate',
titleClass: 'title',
type: 'date',
num: 46,
hidden: true
},
{
label: '家属接触过已确诊或疑似患者',
required: true,
value: 'familyPatientContact',
titleClass: 'title', titleClass: 'title',
type: 'radio', type: 'radio',
opts: [{ opts: [{
value: '接触过已确诊或疑似患者', value: '0',
label: '接触过已确诊或疑似患者' label: ''
}, { }, {
value: '家属接触过已确诊或疑似患者', value: '1',
label: '家属接触过已确诊或疑似患者' label: ''
}] }],
show: [48],
num: 47,
hidden: true,
showValue: ['1']
},
{
label: '家属接触患者时间',
required: true,
value: 'familyPatientContactDate',
titleClass: 'title',
type: 'date',
num: 48,
hidden: true
}, },
{ {
label: '隔离地址', label: '隔离地址',
...@@ -1656,6 +1845,8 @@ ...@@ -1656,6 +1845,8 @@
titleClass: 'title', titleClass: 'title',
placeholder: '请输入', placeholder: '请输入',
type: 'input', type: 'input',
num: 49,
hidden: true
}, },
{ {
label: '隔离开始日期', label: '隔离开始日期',
...@@ -1663,18 +1854,59 @@ ...@@ -1663,18 +1854,59 @@
value: 'quarantineDate', value: 'quarantineDate',
titleClass: 'title', titleClass: 'title',
type: 'date', type: 'date',
num: 50,
hidden: true
},
{
label: '症状',
required: true,
value: 'symptom',
titleClass: 'title',
type: 'pickerMore',
opts: [{
value: '发热',
label: '发热'
}, {
value: '咳嗽',
label: '咳嗽'
}, {
value: '流涕',
label: '流涕'
}, {
value: '咽痛',
label: '咽痛'
}, {
value: '咳痰',
label: '咳痰'
}, {
value: '胸痛',
label: '胸痛'
}, {
value: '肌肉酸痛/关节痛',
label: '肌肉酸痛/关节痛'
}, {
value: '气促',
label: '气促'
}, {
value: '腹泻',
label: '腹泻'
}, {
value: '以上均无',
label: '以上均无'
}]
}, },
], ],
form: { form: {
agree: '', agree: 0,
orgId: -1, orgId: '',
orgName: '',
department: '', department: '',
position: '', position: '',
name: '', name: '',
phone: '', phone: '',
nationality: -1, nationality: '',
idCard: '', idCard: '',
returnToWork: -1, returnToWork: '',
householdAddress: '', householdAddress: '',
residenceAddress: '', residenceAddress: '',
planReturnDate: '' planReturnDate: ''
...@@ -1688,6 +1920,15 @@ ...@@ -1688,6 +1920,15 @@
methods: { methods: {
openModal() {
if(!this.form.agree) {
this.form.agree = '1'
this.modalName = true
}else {
this.form.agree = 0
}
},
getOrg() { getOrg() {
const data = { const data = {
params: { params: {
...@@ -1716,27 +1957,86 @@ ...@@ -1716,27 +1957,86 @@
}, },
// 更新复选框绑定的表单内容 // 更新复选框绑定的表单内容
checkboxChange(index, checkList, obj, prop) { checkboxChange(index, obj, item) {
for (var i = 0, lenI = checkList.length; i < lenI; ++i) { const checkList = item.opts
const prop = item.value
for (let i = 0, lenI = checkList.length; i < lenI; ++i) {
if (index == i) { if (index == i) {
this.$set(checkList[i], 'checked', !checkList[i].checked) this.$set(checkList[i], 'checked', !checkList[i].checked)
} }
} }
// 处理以上均无情况 // 处理以上均无情况
if (obj.label == '以上均无') { const nullList = ['无上述情况', '以上均无']
if (nullList.includes(obj.label)) {
for (var i = 0, lenI = checkList.length; i < lenI; ++i) { for (var i = 0, lenI = checkList.length; i < lenI; ++i) {
this.$set(checkList[i], 'checked', false) this.$set(checkList[i], 'checked', false)
} }
this.$set(checkList[checkList.length - 1], 'checked', true) this.$set(checkList[checkList.length - 1], 'checked', true)
this.form[prop] = obj.label
} else { } else {
this.$set(checkList[checkList.length - 1], 'checked', false) this.$set(checkList[checkList.length - 1], 'checked', false)
const values = []
for (var i = 0, lenI = checkList.length; i < lenI; ++i) {
if(checkList[i].checked) {
values.push(checkList[i].label)
}
}
this.form[prop] = values.join(',')
} }
}, },
radioChange(val, prop) { radioChange(val, prop) {
this.$set(this.form, prop, val) this.$set(this.form, prop, val)
this.isShowChild() this.isShowChild()
}, },
// 隐藏/显示
showChange(evt, item) {
const prop = item.value
const type = item.type
if (type === 'radio') {
const val = evt.target.value
this.$set(this.form, prop, val)
for (let i = 0; i < this.list.length; i++) {
const current = this.list[i]
if (current.value == prop && current.show) {
current.show.forEach(child => {
this.list.forEach(row => {
if (child == row.num) {
this.$set(row, 'hidden', !current.showValue.includes(val))
}
})
})
}
}
}
// 复选框展示和隐藏
if (type === 'pickerMore') {
console.log(evt)
const nullList = ['无上述情况','以上均无']
const checkList = item.opts
let val = evt.detail.value;
const showList = item.showList
if (showList && showList.length > 0) {
showList.forEach(item => {
const start = +item.show.split(',')[0]
const end = +item.show.split(',')[1]
for (let i = start, lenI = end; i <= end; i++) {
this.list.forEach(row => {
if (i == row.num) {
this.$set(row, 'hidden', !val.includes(item.value))
}
})
}
})
}
}
},
isShowChild() { isShowChild() {
console.log(this.form['returnToWork']) console.log(this.form['returnToWork'])
this.list[10].hidden = this.form['returnToWork'] == 'a' this.list[10].hidden = this.form['returnToWork'] == 'a'
...@@ -1750,47 +2050,65 @@ ...@@ -1750,47 +2050,65 @@
this.form[props] = event.target.value this.form[props] = event.target.value
}, },
// 更新下拉框绑定的表单内容 // 更新下拉框绑定的表单内容
updatePickerVal(event, props) { updatePickerVal(event, item) {
this.$set(this.form, props, event.detail.value) console.log(event)
const opts = item.opts
const prop = item.value
const val = event.detail.value
if (!opts) {
this.$set(this.form, prop, val)
return
}
for (let i = 0; i < opts.length; i++) {
if (i == val) {
if (prop == 'orgName') {
this.$set(this.form, 'orgId', opts[i].value)
this.$set(this.form, prop, opts[i].label)
} else {
this.$set(this.form, prop, opts[i].label)
}
}
}
}, },
// 提交信息 // 提交信息
formSubmit() { formSubmit() {
console.log(this.form) console.log(this.form)
// let flag = true let flag = true
// let msg = '' let msg = ''
// for (let i = 0; i < this.list.length; i++) { for (let i = 0; i < this.list.length; i++) {
// if(this.list[i].required){ if (this.list[i].required) {
// if(!this.form[this.list[i].value]){ const val = this.form[this.list[i].value]
// flag = false if ((!val || val == -1) && !this.list[i].hidden) {
// uni.showToast({ flag = false
// icon: 'none', uni.showToast({
// title: "第"+(i+1)+"项有必填数据未填写" icon: 'none',
// }) title: `第${i+1}${this.list[i].label }未填写`
// break })
// } break
// if(!flag){ }
// break if (!flag) {
// } break
// } }
// } }
}
// if(!flag){ if (!flag) {
// return false return false
// }else{ } else {
// this.$http.post(`/ewell-gastric-cancer-data/wechat/report`,obj).then(res => { this.$http.post(`/sict-ncov/record`, this.form).then(res => {
// const d = res.data const d = res.data
// if(d.code == 1){ if (d.code == 1) {
// }else{ } else {
// uni.showToast({ uni.showToast({
// icon: 'none', icon: 'none',
// title: d.message title: d.message
// }) })
// } }
// }).catch(err => { }).catch(err => {
// console.log(err) console.log(err)
// }) })
// } }
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment