Blame view

pages/funeralreport/funeralreport.vue 14.3 KB
1f3f2378   起风了   我的第一次
1
2
3
4
5
  <template>
  	<view class="page">
  		<pyh-nv ref="nv" :config="nvConfig"></pyh-nv>
  		<view class="listBox" :style="{'padding-top':(pageTop+'px')}">
  		<view class="content">
1f3f2378   起风了   我的第一次
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
  			<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>
a9c5bb83   起风了   修改
39
  				<u-picker :show="xbshow" @confirm="xbconfirm" @cancel="xbclose" :columns="xbcolumns"></u-picker>
1f3f2378   起风了   我的第一次
40
41
42
43
  			</view>
  			</view>
  			
  			<view class="message-list">
fe62b839   起风了   1
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
  				<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>
1f3f2378   起风了   我的第一次
59
  			</view>
fe62b839   起风了   1
60
61
62
63
64
65
66
67
68
69
70
71
72
73
  			<!--  -->
  			<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 width100">
  							<!-- <view @click="areashow = true">{{area}}</view> -->
  							<view>
  								<input v-model="area" class="input-text" type="text" placeholder="请输入详细地址" placeholder-class="inputtext" />
  							</view>
  							<view class="info-box-small">接运地点</view>
  						</view>
1f3f2378   起风了   我的第一次
74
  					</view>
fe62b839   起风了   1
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
  					<u-picker :show="areashow"  :columns="areacolumns" @confirm="areaconfirm" @close="areaclose"></u-picker>
  					<view class="info-box-list">
  						<view class="info-box-width width100">
  							<view @click="timeshow = true">
  								<label>{{accessTime}}</label>
  							</view>
  							<view class="info-box-small">接运时间</view>
  						</view>
  					</view>
  					<view class="info-box-list">
  						<view class="info-box-width width100">
  							<view>
  								<input v-model="remarks" class="input-text" type="text" placeholder="请输入" placeholder-class="inputtext" />
  							</view>
  							<view class="info-box-small">备注</view>
  						</view>
1f3f2378   起风了   我的第一次
91
92
93
  					</view>
  				</view>
  			</view>
fe62b839   起风了   1
94
95
96
97
98
99
100
101
  			<u-datetime-picker
  			    :show="timeshow1"
  			    mode="datetime"
  				v-model="accessTimeby"
  				@confirm="xztime"
  				@cancel="qxtime"
  			></u-datetime-picker>
  			<!--  -->
1f3f2378   起风了   我的第一次
102
103
  			<u-calendar :show="jytimeshow" @confirm="jytimeconfirm" @close="jytimeclose"></u-calendar>
  			<view class="message-list">
fe62b839   起风了   1
104
105
106
107
108
109
110
111
112
113
114
115
116
  				<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 @click="swyyshow = true"><input disabled 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>
1f3f2378   起风了   我的第一次
117
  					</view>
a9c5bb83   起风了   修改
118
  					<u-picker :show="swyyshow" @confirm="swyyconfirm" @cancel="swyyclose" :columns="swyycolumns"></u-picker>
1f3f2378   起风了   我的第一次
119
  				</view>
1f3f2378   起风了   我的第一次
120
121
122
  			</view>
  			<u-calendar minDate="2023-11-01" maxDate="3050-12-01" :show="timeshow" @confirm="timeconfirm" @close="timeclose"></u-calendar>
  			<view class="message-list">
fe62b839   起风了   1
123
124
125
126
  				<view class="titleall-box">
  					<view class="titleall-left"><view class="titleall-left-line"></view>家属信息<text>(选填)</text></view>
  				</view>
  				<view class="info-box">
1f3f2378   起风了   我的第一次
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
  				<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>
a9c5bb83   起风了   修改
145
  					<u-picker :show="qsgxshow" @confirm="qsgxconfirm" @cancel="qsgxclose" :columns="qsgxcolumns"></u-picker>
1f3f2378   起风了   我的第一次
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
  					<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">
30c714a7   起风了   zh
162
  			    <view class="cart-add" @click="lxdh">
1f3f2378   起风了   我的第一次
163
164
165
  					<view><image src="../../static/btn2.png"></image></view>
  					<view class="cart-add-text"><image src="../../static/phone.png"></image><text>联系电话</text></view>
  			    </view>
fe62b839   起风了   1
166
  			    <view class="buy-at" @click="funeralresult">
1f3f2378   起风了   我的第一次
167
  					<image src="../../static/btn1.png"></image>
fe62b839   起风了   1
168
  			      <text>提交</text>
1f3f2378   起风了   我的第一次
169
170
171
  			    </view>
  			  </view>
  			</view>
1f3f2378   起风了   我的第一次
172
173
  		</view>
  		</view>
fe62b839   起风了   1
174
  		<u-toast ref="uToast"></u-toast>
1f3f2378   起风了   我的第一次
175
176
177
178
179
180
181
182
183
184
185
  	</view>
  </template>
  
  <script>
  	import BASE_URL from "@/common/config.js"
  	export default {
  		data() {
  			return {
  				BASE_URL,
  				fileList: [],
  				nvConfig:{
fe62b839   起风了   1
186
  					title:"报丧登记",
1f3f2378   起风了   我的第一次
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
  					bgColor:"#ffffff",
  					color:"#000000",
  					fixedAssist:{
  						hide:true,
  					},
  				},
  				sex:"请选择",
  				from:{
  					deceasedName:"",
  					deceasedAge:"",
  					deceasedSex:"请选择",
  					idCardNumber:"",
  					ethnicity:"",
  					
  					contactName:"",
  					contactPhone:"",
  					
  					deathCase:null,
  					deathdate:"请选择",
  					
  					
  					relativeName:"",
  					relativePhone:"",
  					deceasedRelationship:"请选择",
  					relativeIdCardNumber:"",
  					relativeAddress:"",
  					
fe62b839   起风了   1
214
215
216
217
218
219
220
  					provelmage:"",
  					
  					accessLocation:"",
  					accessTime:"",
  					obituaryType:"",
  					remarks:"",
  					userId:"",
1f3f2378   起风了   我的第一次
221
222
223
224
225
226
227
228
229
230
231
  				},
  				xbshow:false,
  				xbcolumns: [
  				    ['男', '女']
  				],
  				qsgxshow:false,
  				qsgxcolumns: [
  				    ['爱人', '兄弟','父亲','母亲','其他']
  				],
  				timeshow:false,
  				jytimeshow:false,
a9c5bb83   起风了   修改
232
  				// 不详、车祸、触电、溺水、枪击、烧死、事故、摔、死胎、死刑、他杀、滝死、意外、中毒、坠楼、自杀
0d8fdbbf   起风了   gps修改
233
  				swyycolumns:[
a9c5bb83   起风了   修改
234
  					['病','不详','车祸','触电','溺水','枪击','烧死','事故','摔','死胎','死刑','他杀','滝死','意外','中毒','坠楼','自杀']
0d8fdbbf   起风了   gps修改
235
236
  				],
  				swyyshow:false,
fe62b839   起风了   1
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
  				
  				
  				// 
  				timeshow1:false,
  				accessLocation:"",
  				area:"",
  				xxarea:"",
  				areashow:false,
  				areacolumns:[
  					['地区1', '地区2']
  				],
  				
  				accessTime:"请选择",
  				accessTimeby:2,
  				timeshow:false,
  				remarks:"",
  				info:{}
  				// 
1f3f2378   起风了   我的第一次
255
256
257
258
259
260
261
  			};
  		},
  		onPageScroll(e) {this.$refs.nv.pageScroll(e)},
  		computed:{
  			pageTop(){return parseInt(88*uni.getSystemInfoSync().windowWidth/750) + uni.getSystemInfoSync().statusBarHeight}
  		},
  		onLoad(params) {
fe62b839   起风了   1
262
263
264
  			const timestamp = Date.now();
  			this.accessTime = this.timestampToTime(timestamp);
  			
1f3f2378   起风了   我的第一次
265
266
  		},
  		methods:{
30c714a7   起风了   zh
267
268
269
270
271
272
273
274
275
276
277
278
279
  			lxdh(){
  				uni.showModal({
  					title: '联系电话',
  					content: '028-36241643',
  					success: function(res) {
  						if (res.confirm) {
  							console.log('点击了确认')
  						} else {
  							console.log('点击了取消')
  						}
  					}
  				})
  			},
fe62b839   起风了   1
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
  			// 
  			xztime(value){
  				this.timeshow1 = false
  				var that = this;
  				let selectTime =this.timestampToTime(value.value);
  				that.accessTime = selectTime;
  			},
  			qxtime(){
  				this.timeshow1 = false
  			},
  			timeclose(){
  				this.timeshow1 = false
  			},
  			timestampToTime(timestamp) {
  			    timestamp = timestamp ? timestamp : null;
  			    let date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  			    let Y = date.getFullYear() + '-';
  			    let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  			    let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
  			    let h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
  			    let m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
  			    let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
  			    return Y + M + D + h + m + s;
  			},
  			funeralresult(){
  				this.from.accessLocation = this.area
  				this.from.accessTime = this.accessTime
  				// this.info.obituaryType = "网上报丧"
  				if(uni.getStorageSync('dh') == 2){
  					this.from.obituaryType = "电话报丧"
  				}else{
  					this.from.obituaryType = "网上报丧"
  				}
  				this.from.remarks = this.remarks
  				this.from.userId = uni.getStorageSync("USERS_KEY").userId
  				// console.log(this.from);
  				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 == '请选择' || this.area != '请输入详细地址' || this.accessTime != "请选择" || this.remarks != ''){
  					uni.showToast({
  						icon:"error",
  						title:"请填写完整必填信息"
  					})
  				}else{
  					// console.log(1123);
  					this.API.tjwsyy(this.info).then(res=>{
  						console.log("网上报丧",res);
  					})
  					uni.navigateTo({
  						url: '/pages/funeralresult/funeralresult',
  					})
  				}
  			},
  			// 地区选择确认回调
  			areaconfirm(e){
  				this.areashow = false
  				this.area = e.value[0];
  			},
  			areaclose(){
  				this.areashow = false
  			},
  			timeclose(){
  				this.timeshow = false
  			},
  			// 
1f3f2378   起风了   我的第一次
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
  			// 上传图片
  			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(){
0d8fdbbf   起风了   gps修改
370
  				// this.from.deceasedSex = this.sex
1f3f2378   起风了   我的第一次
371
  				var info = JSON.stringify(this.from)
0d8fdbbf   起风了   gps修改
372
  				console.log("提交的数据",this.from,this.sex);
1f3f2378   起风了   我的第一次
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
  				// 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]
0d8fdbbf   起风了   gps修改
394
  				this.from.deceasedSex = e.value[0]
1f3f2378   起风了   我的第一次
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
  				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
  			},
0d8fdbbf   起风了   gps修改
418
419
420
421
422
423
424
425
426
427
428
  			// 死亡原因确认
  			swyyconfirm(e){
  				console.log("e",e);
  				this.from.deathCase = e.value[0]
  				this.swyyshow = false
  			},
  			// 死亡原因取消
  			swyyclose(){
  				this.swyyshow = false
  			}
  			
1f3f2378   起风了   我的第一次
429
430
431
432
433
434
435
  		}
  	}
  </script>
  
  <style scoped lang="scss">
  	@import 'funeralreport.scss';
  </style>