1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<template>
<div>
<mt-header title="填写随访">
<router-link to="/" slot="left">
<mt-button icon="back"></mt-button>
</router-link>
</mt-header>
<div class="remarks">
注:药具领取前需填写之前的使用情况
</div>
<form>
<div class="subject">
<mt-radio
title="使用是否满意"
align="left"
v-model="formData.isAgree"
:options="options1" @change="changeAgree">
</mt-radio>
<div v-if="formData.isAgree==='1'" style="margin-top: 8px">
<input type="text" style="height: 33px" v-model.trim="formData.disagreeReason" @blur="blurDisagreeReason" placeholder="请填写原因"/>
<label class="checkMsg" v-if="formData.checkDisagreeReason">请填写不满意原因</label>
</div>
<mt-radio
title="有无不良反应"
align="left"
v-model="formData.isBadReaction"
:options="options2"
@change="changeBad"
>
</mt-radio>
<div v-if="formData.isBadReaction==='1'" class="badReaction">
<div style="font-weight: bold; color: #888">请选择不良反应(多选):</div>
<div v-for="item in options3" :key="item.value" style="margin-top: 7px">
<input type="checkbox" v-model="formData.badReaction" @change="changeBadReaction" :id="item.value" :value="item.value" class="hidden"/>
<span></span>
<span class="txt">{{item.label}}</span>
</div>
<label class="checkMsg" v-if="formData.checkBadReaction">请选择不良反应</label>
<div v-if="formData.badReaction.includes(9)">
<input type="text" v-model="formData.otherBadReaction" @blur="blurOtherBadReaction" placeholder="请填写其他不良反应"/>
<label class="checkMsg" v-if="formData.checkOtherBadReaction">请填写其他不良反应</label>
</div>
</div>
</div>
</form>
<div class="sub-badReaction">
<mt-button type="primary" @click="subReturnVisit">提 交</mt-button>
</div>
</div>
</template>
<script>
import {addVisitRecord} from "../utils/api";
import { Toast } from 'mint-ui';
import { Indicator } from 'mint-ui';
export default {
name: "returnVisit",
data() {
return {
options1: [{label: '满意', value: '0'}, {label: '不满意', value: '1'}],
options2: [{label: '没有', value: '0'}, {label: '有', value: '1'}],
options3: [
{label: '恶心呕吐', value: 1},
{label: '阴道点滴出血', value: 2},
{label: '月经过少或闭经', value: 3},
{label: '面部色素沉着', value: 4},
{label: '体重增加', value: 5},
{label: '其他', value: 9}],
formData: {
isAgree:'0',
disagreeReason: '',
isBadReaction:'0',
badReaction: [],
otherBadReaction: '',
checkDisagreeReason:false,
checkOtherBadReaction:false,
checkBadReaction:false
}
}
},
methods:{
changeAgree() {
if(this.formData.isAgree == 0) {
this.formData.disagreeReason = ''
}
},
blurDisagreeReason(){
this.formData.checkDisagreeReason=this.formData.disagreeReason===''||this.formData.disagreeReason===undefined;
},
blurOtherBadReaction(){
this.formData.checkOtherBadReaction=this.formData.otherBadReaction===''||this.formData.otherBadReaction===undefined;
},
changeBad() {
if (this.formData.isBadReaction == 0) {
this.formData.badReaction = []
this.formData.otherBadReaction = ''
}
},
changeBadReaction(){
this.formData.checkBadReaction=this.formData.badReaction.length<1|| this.formData.badReaction===undefined;
},
subReturnVisit(){
let flag=true;
if(this.formData.isAgree==='1'){
this.blurDisagreeReason();
if(this.formData.checkDisagreeReason){
flag=false;
}
}
if(this.formData.isBadReaction==='1'){
this.changeBadReaction();
if(this.formData.checkBadReaction){
flag=false;
}
if(this.formData.badReaction.includes(9)){
this.blurOtherBadReaction();
if(this.formData.checkOtherBadReaction){
flag=false;
}
}
}
/*验证完毕*/
if(flag){
Indicator.open()
let badInfo = this.formData.badReaction.join()
let info = JSON.parse(window.sessionStorage.getItem('mobileTokenIno'))
const {phone = '', userId =''} = info
let par = {
residentId: userId,
telephone: phone,
satisfied: this.formData.isAgree,
satisfiedReason: this.formData.disagreeReason,
bad: this.formData.isBadReaction,
badReason: badInfo,
inputType: 0,
badOther: this.formData.otherBadReaction
}
addVisitRecord(par).then(({data}) => {
Indicator.close()
if (data.code == 'SUCCESS') {
Toast({
message: '填写成功!',
duration: 2000
});
window.history.go(-1)
} else {
Toast({
message: '系统异常,请联系客服!',
duration: 2000
});
}
})
}else {
return false;
}
}
}
}
</script>
<style lang="less">
.checkMsg{
color: red;
}
.remarks {
background-color: #F5F6F8;
padding: 5px 0px 5px 20px;
}
.subject {
padding: 5px 0px 5px 20px;
height: calc(100vh - 144px);
overflow: auto;
}
.subject .mint-cell:not(:last-child) {
float: left;
}
.subject input[type=text] {
border: none;
outline: none;
width: 100%;
padding-left: 5px;
border-bottom: 1px solid #F0F0F0;
color: #6E6166;
outline: none;
}
.badReaction {
width: 100%;
/*
border-top: 1px solid #F0F0F0;
*/
padding-top: 10px;
padding-left: 5px;
}
.hidden {
opacity: 0;
position: absolute;
z-index: 11;
}
input[type=checkbox] + span {
display: inline-block;
height: 16px;
width: 16px;
border-radius: 3px;
background-color: white;
border: 1px solid #cccccc;
}
input[type=checkbox]:checked + span {
background-color: #00CA9D;
}
.txt {
position: relative;
top: -3px;
left: 3px;
}
.sub-badReaction {
position: fixed;
z-index: 2;
left: calc(50% - 155px);
bottom: 20px;
}
.sub-badReaction .mint-button {
width: 311px;
height: 44px;
background: linear-gradient(242deg, #dff9b9 -27%, #1bd09f 85%);
border-radius: 22px;
box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.1);
}
</style>