|
@ -25,13 +25,13 @@ |
|
|
</uv-form-item> |
|
|
</uv-form-item> |
|
|
</view> |
|
|
</view> |
|
|
<view class="form-item"> |
|
|
<view class="form-item"> |
|
|
<uv-form-item prop="idNo" :customStyle="formItemStyle"> |
|
|
|
|
|
|
|
|
<uv-form-item prop="cerNo" :customStyle="formItemStyle"> |
|
|
<view class="form-item-label"> |
|
|
<view class="form-item-label"> |
|
|
<image class="icon" src="@/pages_order/static/icon-require.png" mode="widthFix"></image> |
|
|
<image class="icon" src="@/pages_order/static/icon-require.png" mode="widthFix"></image> |
|
|
身份证号 |
|
|
身份证号 |
|
|
</view> |
|
|
</view> |
|
|
<view class="form-item-content"> |
|
|
<view class="form-item-content"> |
|
|
<formInput v-model="form.idNo"></formInput> |
|
|
|
|
|
|
|
|
<formInput v-model="form.cerNo"></formInput> |
|
|
</view> |
|
|
</view> |
|
|
</uv-form-item> |
|
|
</uv-form-item> |
|
|
</view> |
|
|
</view> |
|
@ -42,7 +42,7 @@ |
|
|
类型 |
|
|
类型 |
|
|
</view> |
|
|
</view> |
|
|
<view class="form-item-content"> |
|
|
<view class="form-item-content"> |
|
|
<uv-radio-group v-model="form.type" |
|
|
|
|
|
|
|
|
<uv-radio-group v-model="form.periodId" |
|
|
iconColor="#00A9FF" |
|
|
iconColor="#00A9FF" |
|
|
iconSize="36rpx" |
|
|
iconSize="36rpx" |
|
|
size="36rpx" |
|
|
size="36rpx" |
|
@ -50,7 +50,7 @@ |
|
|
labelSize="26rpx" |
|
|
labelSize="26rpx" |
|
|
> |
|
|
> |
|
|
<uv-radio |
|
|
<uv-radio |
|
|
v-for="(item, index) in typeOptions" |
|
|
|
|
|
|
|
|
v-for="(item, index) in periodOptions" |
|
|
:key="index" |
|
|
:key="index" |
|
|
:label="item.label" |
|
|
:label="item.label" |
|
|
:name="item.value" |
|
|
:name="item.value" |
|
@ -61,13 +61,13 @@ |
|
|
</uv-form-item> |
|
|
</uv-form-item> |
|
|
</view> |
|
|
</view> |
|
|
<view class="form-item"> |
|
|
<view class="form-item"> |
|
|
<uv-form-item prop="gender" :customStyle="formItemStyle"> |
|
|
|
|
|
|
|
|
<uv-form-item prop="sex" :customStyle="formItemStyle"> |
|
|
<view class="form-item-label"> |
|
|
<view class="form-item-label"> |
|
|
<image class="icon" src="@/pages_order/static/icon-require.png" mode="widthFix"></image> |
|
|
<image class="icon" src="@/pages_order/static/icon-require.png" mode="widthFix"></image> |
|
|
性别 |
|
|
性别 |
|
|
</view> |
|
|
</view> |
|
|
<view class="form-item-content"> |
|
|
<view class="form-item-content"> |
|
|
<uv-radio-group v-model="form.gender" |
|
|
|
|
|
|
|
|
<uv-radio-group v-model="form.sex" |
|
|
iconColor="#00A9FF" |
|
|
iconColor="#00A9FF" |
|
|
iconSize="36rpx" |
|
|
iconSize="36rpx" |
|
|
size="36rpx" |
|
|
size="36rpx" |
|
@ -75,7 +75,7 @@ |
|
|
labelSize="26rpx" |
|
|
labelSize="26rpx" |
|
|
> |
|
|
> |
|
|
<uv-radio |
|
|
<uv-radio |
|
|
v-for="(item, index) in genderOptions" |
|
|
|
|
|
|
|
|
v-for="(item, index) in sexOptions" |
|
|
:key="index" |
|
|
:key="index" |
|
|
:label="item.label" |
|
|
:label="item.label" |
|
|
:name="item.value" |
|
|
:name="item.value" |
|
@ -97,10 +97,10 @@ |
|
|
</uv-form-item> |
|
|
</uv-form-item> |
|
|
</view> |
|
|
</view> |
|
|
<view class="form-item"> |
|
|
<view class="form-item"> |
|
|
<uv-form-item prop="wx" :customStyle="formItemStyle"> |
|
|
|
|
|
|
|
|
<uv-form-item prop="wechat" :customStyle="formItemStyle"> |
|
|
<view class="form-item-label">微信号</view> |
|
|
<view class="form-item-label">微信号</view> |
|
|
<view class="form-item-content"> |
|
|
<view class="form-item-content"> |
|
|
<formInput v-model="form.wx"></formInput> |
|
|
|
|
|
|
|
|
<formInput v-model="form.wechat"></formInput> |
|
|
</view> |
|
|
</view> |
|
|
</uv-form-item> |
|
|
</uv-form-item> |
|
|
</view> |
|
|
</view> |
|
@ -137,24 +137,24 @@ |
|
|
</uv-form-item> |
|
|
</uv-form-item> |
|
|
</view> |
|
|
</view> |
|
|
<view class="form-item"> |
|
|
<view class="form-item"> |
|
|
<uv-form-item prop="emergencyContact" :customStyle="formItemStyle"> |
|
|
|
|
|
|
|
|
<uv-form-item prop="emergencyPhone" :customStyle="formItemStyle"> |
|
|
<view class="form-item-label"> |
|
|
<view class="form-item-label"> |
|
|
<image class="icon" src="@/pages_order/static/icon-require.png" mode="widthFix"></image> |
|
|
<image class="icon" src="@/pages_order/static/icon-require.png" mode="widthFix"></image> |
|
|
紧急联系人 |
|
|
紧急联系人 |
|
|
</view> |
|
|
</view> |
|
|
<view class="form-item-content"> |
|
|
<view class="form-item-content"> |
|
|
<formInput v-model="form.emergencyContact"></formInput> |
|
|
|
|
|
|
|
|
<formInput v-model="form.emergencyPhone"></formInput> |
|
|
</view> |
|
|
</view> |
|
|
</uv-form-item> |
|
|
</uv-form-item> |
|
|
</view> |
|
|
</view> |
|
|
<view class="form-item"> |
|
|
<view class="form-item"> |
|
|
<uv-form-item prop="guardiancontact" :customStyle="formItemStyle"> |
|
|
|
|
|
|
|
|
<uv-form-item prop="chaperonPhone" :customStyle="formItemStyle"> |
|
|
<view class="form-item-label"> |
|
|
<view class="form-item-label"> |
|
|
<image class="icon" src="@/pages_order/static/icon-require.png" mode="widthFix"></image> |
|
|
<image class="icon" src="@/pages_order/static/icon-require.png" mode="widthFix"></image> |
|
|
监护人联系方式 |
|
|
监护人联系方式 |
|
|
</view> |
|
|
</view> |
|
|
<view class="form-item-content"> |
|
|
<view class="form-item-content"> |
|
|
<formInput v-model="form.guardiancontact"></formInput> |
|
|
|
|
|
|
|
|
<formInput v-model="form.chaperonPhone"></formInput> |
|
|
</view> |
|
|
</view> |
|
|
</uv-form-item> |
|
|
</uv-form-item> |
|
|
</view> |
|
|
</view> |
|
@ -211,17 +211,17 @@ |
|
|
title: null, |
|
|
title: null, |
|
|
form: { |
|
|
form: { |
|
|
name: null, |
|
|
name: null, |
|
|
idNo: null, |
|
|
|
|
|
type: 0, |
|
|
|
|
|
gender: 0, |
|
|
|
|
|
|
|
|
cerNo: null, |
|
|
|
|
|
periodId: 0, |
|
|
|
|
|
sex: 0, |
|
|
phone: null, |
|
|
phone: null, |
|
|
wx: null, |
|
|
|
|
|
|
|
|
wechat: null, |
|
|
school: null, |
|
|
school: null, |
|
|
grade: null, |
|
|
grade: null, |
|
|
age: null, |
|
|
age: null, |
|
|
remark: null, |
|
|
remark: null, |
|
|
emergencyContact: null, |
|
|
|
|
|
guardiancontact: null, |
|
|
|
|
|
|
|
|
emergencyPhone: null, |
|
|
|
|
|
chaperonPhone: null, |
|
|
}, |
|
|
}, |
|
|
rules: { |
|
|
rules: { |
|
|
'name': { |
|
|
'name': { |
|
@ -229,17 +229,17 @@ |
|
|
required: true, |
|
|
required: true, |
|
|
message: '请输入姓名', |
|
|
message: '请输入姓名', |
|
|
}, |
|
|
}, |
|
|
'idNo': { |
|
|
|
|
|
|
|
|
'cerNo': { |
|
|
type: 'string', |
|
|
type: 'string', |
|
|
required: true, |
|
|
required: true, |
|
|
message: '请输入身份证号', |
|
|
message: '请输入身份证号', |
|
|
}, |
|
|
}, |
|
|
'type': { |
|
|
|
|
|
|
|
|
'periodId': { |
|
|
type: 'string', |
|
|
type: 'string', |
|
|
required: true, |
|
|
required: true, |
|
|
message: '请选择类型', |
|
|
message: '请选择类型', |
|
|
}, |
|
|
}, |
|
|
'gender': { |
|
|
|
|
|
|
|
|
'sex': { |
|
|
type: 'string', |
|
|
type: 'string', |
|
|
required: true, |
|
|
required: true, |
|
|
message: '请选择性别', |
|
|
message: '请选择性别', |
|
@ -249,20 +249,20 @@ |
|
|
required: true, |
|
|
required: true, |
|
|
message: '请输入手机号', |
|
|
message: '请输入手机号', |
|
|
}, |
|
|
}, |
|
|
'emergencyContact': { |
|
|
|
|
|
|
|
|
'emergencyPhone': { |
|
|
type: 'string', |
|
|
type: 'string', |
|
|
required: true, |
|
|
required: true, |
|
|
message: '请输入紧急联系人联系方式', |
|
|
message: '请输入紧急联系人联系方式', |
|
|
}, |
|
|
}, |
|
|
'guardiancontact': { |
|
|
|
|
|
|
|
|
'chaperonPhone': { |
|
|
type: 'string', |
|
|
type: 'string', |
|
|
required: true, |
|
|
required: true, |
|
|
message: '请输入监护人联系方式', |
|
|
message: '请输入监护人联系方式', |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
formItemStyle: { padding: 0 }, |
|
|
formItemStyle: { padding: 0 }, |
|
|
// todo: check |
|
|
|
|
|
typeOptions: [ |
|
|
|
|
|
|
|
|
// todo: fetch |
|
|
|
|
|
periodOptions: [ |
|
|
{ |
|
|
{ |
|
|
id: '001', |
|
|
id: '001', |
|
|
label: '成人', |
|
|
label: '成人', |
|
@ -279,7 +279,8 @@ |
|
|
value: '2', |
|
|
value: '2', |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
genderOptions: [ |
|
|
|
|
|
|
|
|
// todo: check |
|
|
|
|
|
sexOptions: [ |
|
|
{ |
|
|
{ |
|
|
id: '001', |
|
|
id: '001', |
|
|
label: '男', |
|
|
label: '男', |
|
@ -295,10 +296,40 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
async fetchTravelerDetail(id) { |
|
|
|
|
|
|
|
|
async fetchTravelerDetail(personId) { |
|
|
try { |
|
|
try { |
|
|
|
|
|
|
|
|
// todo: fetch |
|
|
|
|
|
|
|
|
const result = await this.$fetch('queryTouristById', { personId }) |
|
|
|
|
|
|
|
|
|
|
|
const { |
|
|
|
|
|
name, |
|
|
|
|
|
cerNo, |
|
|
|
|
|
periodId, |
|
|
|
|
|
sex, |
|
|
|
|
|
phone, |
|
|
|
|
|
wechat, |
|
|
|
|
|
school, |
|
|
|
|
|
grade, |
|
|
|
|
|
age, |
|
|
|
|
|
remark, |
|
|
|
|
|
emergencyPhone, |
|
|
|
|
|
chaperonPhone, |
|
|
|
|
|
} = result |
|
|
|
|
|
|
|
|
|
|
|
this.form = { |
|
|
|
|
|
name, |
|
|
|
|
|
cerNo, |
|
|
|
|
|
periodId, |
|
|
|
|
|
sex, |
|
|
|
|
|
phone, |
|
|
|
|
|
wechat, |
|
|
|
|
|
school, |
|
|
|
|
|
grade, |
|
|
|
|
|
age, |
|
|
|
|
|
remark, |
|
|
|
|
|
emergencyPhone, |
|
|
|
|
|
chaperonPhone, |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} catch (err) { |
|
|
} catch (err) { |
|
|
|
|
|
|
|
@ -315,17 +346,18 @@ |
|
|
this.title = '添加出行人' |
|
|
this.title = '添加出行人' |
|
|
this.form = { |
|
|
this.form = { |
|
|
name: null, |
|
|
name: null, |
|
|
idNo: null, |
|
|
|
|
|
type: 0, |
|
|
|
|
|
gender: 0, |
|
|
|
|
|
|
|
|
cerNo: null, |
|
|
|
|
|
// todo: fetch default |
|
|
|
|
|
periodId: 0, |
|
|
|
|
|
sex: 0, |
|
|
phone: null, |
|
|
phone: null, |
|
|
wx: null, |
|
|
|
|
|
|
|
|
wechat: null, |
|
|
school: null, |
|
|
school: null, |
|
|
grade: null, |
|
|
grade: null, |
|
|
age: null, |
|
|
age: null, |
|
|
remark: null, |
|
|
remark: null, |
|
|
emergencyContact: null, |
|
|
|
|
|
guardiancontact: null, |
|
|
|
|
|
|
|
|
emergencyPhone: null, |
|
|
|
|
|
chaperonPhone: null, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -353,16 +385,39 @@ |
|
|
await this.$refs.form.validate() |
|
|
await this.$refs.form.validate() |
|
|
|
|
|
|
|
|
const { |
|
|
const { |
|
|
|
|
|
name, |
|
|
|
|
|
cerNo, |
|
|
|
|
|
periodId, |
|
|
|
|
|
sex, |
|
|
|
|
|
phone, |
|
|
|
|
|
wechat, |
|
|
|
|
|
school, |
|
|
|
|
|
grade, |
|
|
|
|
|
age, |
|
|
|
|
|
remark, |
|
|
|
|
|
emergencyPhone, |
|
|
|
|
|
chaperonPhone, |
|
|
} = this.form |
|
|
} = this.form |
|
|
|
|
|
|
|
|
const params = { |
|
|
const params = { |
|
|
|
|
|
name, |
|
|
|
|
|
cerNo, |
|
|
|
|
|
periodId, |
|
|
|
|
|
sex, |
|
|
|
|
|
phone, |
|
|
|
|
|
wechat, |
|
|
|
|
|
school, |
|
|
|
|
|
grade, |
|
|
|
|
|
age, |
|
|
|
|
|
remark, |
|
|
|
|
|
emergencyPhone, |
|
|
|
|
|
chaperonPhone, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.id) { |
|
|
if (this.id) { |
|
|
params.id = this.id |
|
|
params.id = this.id |
|
|
|
|
|
|
|
|
// todo: fetch |
|
|
|
|
|
// await this.$fetch('updateAddress', params) |
|
|
|
|
|
|
|
|
await this.$fetch('updateTourist', params) |
|
|
|
|
|
|
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
icon: 'success', |
|
|
icon: 'success', |
|
@ -371,8 +426,7 @@ |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
// todo: fetch |
|
|
|
|
|
// await this.$fetch('addAddress', params) |
|
|
|
|
|
|
|
|
await this.$fetch('addTourist', params) |
|
|
|
|
|
|
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
icon: 'success', |
|
|
icon: 'success', |
|
|