You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.2 KiB
JavaScript
67 lines
1.2 KiB
JavaScript
const app=getApp();
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
index: '1',
|
|
picker: ['病案原件寄回', '电子版扫描件'],
|
|
date: '2018-12-25',
|
|
address: ''
|
|
},
|
|
onLoad:function(){
|
|
this.setData({
|
|
address: app.globalData.address
|
|
})
|
|
},
|
|
PickerChange(e) {
|
|
console.log(this.data.index);
|
|
this.setData({
|
|
index: e.detail.value
|
|
})
|
|
},
|
|
submitForm(e){
|
|
// 验证参数
|
|
let formData=e.detail.value;
|
|
if(!formData.mrNumber){
|
|
wx.showToast({
|
|
title: '病案号必填',
|
|
icon: 'error',
|
|
})
|
|
return;
|
|
}
|
|
if(!formData.patientName){
|
|
wx.showToast({
|
|
title: '患者姓名必填',
|
|
icon: 'error',
|
|
})
|
|
return;
|
|
}
|
|
if(!formData.times){
|
|
wx.showToast({
|
|
title: '就诊次数必填',
|
|
icon: 'error',
|
|
})
|
|
return;
|
|
}
|
|
if(formData.type==='0'&&!formData.address){
|
|
wx.showToast({
|
|
title: '寄送地址必填',
|
|
icon: 'error',
|
|
})
|
|
return;
|
|
}
|
|
// 请求接口
|
|
app.utils.util.request({
|
|
url: '/order',
|
|
data: formData,
|
|
success: function(res){
|
|
// 跳转页面
|
|
wx.reLaunch({
|
|
url:"../order/order"
|
|
})
|
|
}
|
|
})
|
|
},
|
|
}) |