funeralreport.vue
8.99 KB
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<template>
<view class="page">
<pyh-nv ref="nv" :config="nvConfig"></pyh-nv>
<view class="listBox" :style="{'padding-top':(pageTop+'px')}">
<view class="content">
<view class="message-list">
<view class="titleall-box">
<view class="titleall-left"><view class="titleall-left-line"></view>逝者信息<text style="color: red;">(必填)</text></view>
</view>
<view class="info-box">
<view class="info-box-list">
<view class="info-box-width">
<view><input class="input-text" v-model="from.deceasedName" type="text" placeholder="请输入" placeholder-class="inputtext" /></view>
<view class="info-box-small">逝者姓名</view>
</view>
<view class="info-box-width">
<view><input class="input-text" v-model="from.deceasedAge" type="text" placeholder="请输入" placeholder-class="inputtext" /></view>
<view class="info-box-small">逝者年龄</view>
</view>
</view>
<view class="info-box-list">
<view class="info-box-width">
<view @click="xbshow = true">
{{sex}}
</view>
<view class="info-box-small">逝者性别</view>
</view>
<view class="info-box-width">
<view><input class="input-text" v-model="from.idCardNumber" type="text" placeholder="请输入" placeholder-class="inputtext" /></view>
<view class="info-box-small">逝者身份证号</view>
</view>
</view>
<view class="info-box-list">
<view class="info-box-width">
<view><input class="input-text" v-model="from.ethnicity" type="text" placeholder="请输入" placeholder-class="inputtext" /></view>
<view class="info-box-small">逝者民族</view>
</view>
</view>
<u-picker :show="xbshow" @confirm="xbconfirm" @close="xbclose" :columns="xbcolumns"></u-picker>
</view>
</view>
<view class="message-list">
<view class="titleall-box">
<view class="titleall-left"><view class="titleall-left-line"></view>预约人信息<text style="color: red;">(必填)</text></view>
</view>
<view class="info-box">
<view class="info-box-list">
<view class="info-box-width">
<view><input class="input-text" v-model="from.contactName" type="text" placeholder="请输入" placeholder-class="inputtext" /></view>
<view class="info-box-small">预约人姓名</view>
</view>
<view class="info-box-width">
<view><input v-model="from.contactPhone" class="input-text" type="text" placeholder="请输入" placeholder-class="inputtext" /></view>
<view class="info-box-small">预约人电话</view>
</view>
</view>
</view>
</view>
<u-calendar :show="jytimeshow" @confirm="jytimeconfirm" @close="jytimeclose"></u-calendar>
<view class="message-list">
<view class="titleall-box">
<view class="titleall-left"><view class="titleall-left-line"></view>死亡相关<text style="color: red;">(必填)</text></view>
</view>
<view class="info-box">
<view class="info-box-list">
<view class="info-box-width">
<view><input v-model="from.deathCase" class="input-text" type="text" placeholder="请输入" placeholder-class="inputtext" /></view>
<view class="info-box-small">死亡原因</view>
</view>
<view class="info-box-width" @click="timeshow = true">
<view>{{from.deathdate}}</view>
<view class="info-box-small">死亡日期</view>
</view>
</view>
</view>
</view>
<u-calendar minDate="2023-11-01" maxDate="3050-12-01" :show="timeshow" @confirm="timeconfirm" @close="timeclose"></u-calendar>
<view class="message-list">
<view class="titleall-box">
<view class="titleall-left"><view class="titleall-left-line"></view>家属信息<text>(选填)</text></view>
</view>
<view class="info-box">
<view class="info-box-list">
<view class="info-box-width">
<view><input v-model="from.relativeName" class="input-text" type="text" placeholder="请输入" placeholder-class="inputtext" /></view>
<view class="info-box-small">家属姓名</view>
</view>
<view class="info-box-width">
<view><input v-model="from.relativePhone" class="input-text" type="text" placeholder="请输入" placeholder-class="inputtext" /></view>
<view class="info-box-small">家属电话</view>
</view>
</view>
<view class="info-box-list">
<view class="info-box-width">
<view class="" @click="qsgxshow = true">
{{from.deceasedRelationship}}
</view>
<!-- <view><input class="input-text" type="text" placeholder="请选择" placeholder-class="inputtext" /></view> -->
<view class="info-box-small">与逝者关系</view>
</view>
<u-picker :show="qsgxshow" @confirm="qsgxconfirm" @close="xbclose" :columns="qsgxcolumns"></u-picker>
<view class="info-box-width">
<view><input class="input-text" v-model="from.relativeIdCardNumber" type="text" placeholder="请输入" placeholder-class="inputtext" /></view>
<view class="info-box-small">家属证件号码</view>
</view>
</view>
<view class="info-box-list">
<view class="info-box-width">
<view><input class="input-text" v-model="from.relativeAddress" type="text" placeholder="请输入" placeholder-class="inputtext" /></view>
<view class="info-box-small">家属地址</view>
</view>
</view>
</view>
</view>
<view class="page-footer">
<view class="footer-buy">
<view class="cart-add">
<view><image src="../../static/btn2.png"></image></view>
<view class="cart-add-text"><image src="../../static/phone.png"></image><text>联系电话</text></view>
</view>
<view class="buy-at" @click="funeralreportmove">
<image src="../../static/btn1.png"></image>
<text>下一步</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import BASE_URL from "@/common/config.js"
export default {
data() {
return {
BASE_URL,
fileList: [],
nvConfig:{
title:"填写基本信息",
bgColor:"#ffffff",
color:"#000000",
fixedAssist:{
hide:true,
},
},
sex:"请选择",
from:{
deceasedName:"",
deceasedAge:"",
deceasedSex:"请选择",
idCardNumber:"",
ethnicity:"",
contactName:"",
contactPhone:"",
deathCase:null,
deathdate:"请选择",
relativeName:"",
relativePhone:"",
deceasedRelationship:"请选择",
relativeIdCardNumber:"",
relativeAddress:"",
provelmage:""
},
xbshow:false,
xbcolumns: [
['男', '女']
],
qsgxshow:false,
qsgxcolumns: [
['爱人', '兄弟','父亲','母亲','其他']
],
timeshow:false,
jytimeshow:false,
};
},
onPageScroll(e) {this.$refs.nv.pageScroll(e)},
computed:{
pageTop(){return parseInt(88*uni.getSystemInfoSync().windowWidth/750) + uni.getSystemInfoSync().statusBarHeight}
},
onLoad(params) {
},
methods:{
// 上传图片
async afterRead(event) {
console.log(event);
var res = await this.uploadImg(event.file.url)
console.log("上传图片",res,this.BASE_URL)
res = JSON.parse(res.data)
this.from.provelmage = this.BASE_URL + res.fileName
this.fileList.push({
name:res.fileName,
fileId:res.newFileName,
url: this.BASE_URL + res.fileName
})
},
uploadImg(url) {
return new Promise((r, e) => {
uni.uploadFile({
url: this.BASE_URL + "/common/upload",
filePath: url,
name: "file",
success: (d) => r(d)
})
})
},
deletePic(event) {
this.fileList.splice(event.index, 1)
},
funeralreportmove(){
var info = JSON.stringify(this.from)
console.log("提交的数据",this.from);
// return
// deceasedName deceasedAge idCardNumber ethnicity contactName contactPhone deathCase deathdate sex
if(this.from.deceasedName == '' || this.from.deceasedAge == '' || this.from.idCardNumber == '' || this.from.ethnicity == '' || this.from.contactName == '' || this.from.contactPhone == '' || this.from.deathCase == '' || this.from.deathdate == '请选择' || this.sex == '请选择'){
uni.showToast({
title: '请输入完整必填',
//将值设置为 success 或者直接不用写icon这个参数
icon: 'error',
//显示持续时间为 2秒
duration: 2000
})
}else{
uni.navigateTo({
url: '/pages/funeralreportmove/funeralreportmove?info=' + info,
})
}
},
// 性别确认选择
xbconfirm(e){
this.xbshow = false
this.sex = e.value[0]
console.log("性别选择",e);
},
// 性别取消选择
xbclose(){
this.xbshow = false
},
// 亲属关系确认选择
qsgxconfirm(e){
this.qsgxshow = false
this.from.deceasedRelationship = e.value[0]
},
qsgxclose(){
this.qsgxshow = false
},
// 死亡日期确认
timeconfirm(e){
console.log("死亡时间",e);
this.from.deathdate = e[0]
this.timeshow = false
},
timeclose(){
this.timeshow = false
},
}
}
</script>
<style scoped lang="scss">
@import 'funeralreport.scss';
</style>