|
@@ -14,52 +14,43 @@
|
|
|
style="background: linear-gradient( 180deg, #E8F4FF 0%, #FFFFFF 100%);border-radius: 16rpx;">
|
|
|
<view class="flex-row align-center justify-between">
|
|
|
<text class="font text-black2">姓名</text>
|
|
|
- <view class="flex-row justify-end" style="width: 440rpx;">
|
|
|
- <up-input placeholder="请输入申请人姓名" border="none" v-model.trim="formData.name" clearable
|
|
|
- :maxlength="20" input-align="end"></up-input>
|
|
|
- <!-- <text class="font text-black2">请选择申请人</text> -->
|
|
|
- </view>
|
|
|
+ <text class="font text-black2" @click="goChoosePeople">{{formData.name}}</text>
|
|
|
</view>
|
|
|
<view class="flex-row align-center justify-between mt-4">
|
|
|
<text class="font text-black2">护理需求</text>
|
|
|
<view style="width: 440rpx;">
|
|
|
<up-input placeholder="请输入护理需求" border="none" v-model.trim="formData.demand" clearable
|
|
|
- :maxlength="50"></up-input>
|
|
|
+ :maxlength="50" inputAlign="right"></up-input>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="flex-row align-center justify-between mt-4">
|
|
|
<text class="font text-black2">首选护理人员性别</text>
|
|
|
- <view style="width: 440rpx;">
|
|
|
- <u-input placeholder="请输入性别" border="none" type="number" v-model.trim="formData.sex"
|
|
|
- clearable :maxlength="11"></u-input>
|
|
|
- </view>
|
|
|
+ <text class="font text-black2" @click="chooseGender">{{formData.sex === '0'?'女':'男'}}</text>
|
|
|
</view>
|
|
|
<view class="flex-row align-center justify-between mt-4">
|
|
|
<text class="font text-black2">所在医院</text>
|
|
|
- <view style="width: 440rpx;">
|
|
|
- <u-input placeholder="请输入所在医院" border="none" type="number"
|
|
|
- v-model.trim="formData.hospital" clearable :maxlength="11"></u-input>
|
|
|
- </view>
|
|
|
+ <text class="font text-black2" @click="goChooseHospital">{{formData.hospital}}</text>
|
|
|
</view>
|
|
|
<view class="flex-row align-center justify-between mt-4">
|
|
|
<text class="font text-black2">详细地址</text>
|
|
|
<view style="width: 440rpx;">
|
|
|
- <u-input placeholder="请输入详细地址" border="none" type="number"
|
|
|
- v-model.trim="formData.address" clearable :maxlength="11"></u-input>
|
|
|
+ <u-input placeholder="请输入具体科室/楼层/房间/床号" border="none" v-model.trim="formData.address"
|
|
|
+ clearable :maxlength="50" inputAlign="right"></u-input>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="flex-row align-center justify-between mt-4">
|
|
|
<text class="font text-black2">预计天数</text>
|
|
|
<view style="width: 440rpx;">
|
|
|
<u-input placeholder="请输入预计天数" border="none" type="number"
|
|
|
- v-model.trim="formData.dayCount" clearable :maxlength="11"></u-input>
|
|
|
+ v-model.trim="formData.dayCount" clearable :maxlength="5"
|
|
|
+ inputAlign="right"></u-input>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="flex-row align-center justify-between mt-4">
|
|
|
<text class="font text-black2">备注</text>
|
|
|
<view style="width: 440rpx;">
|
|
|
- <u-input placeholder="请输入备注" border="none" type="number" v-model.trim="formData.remark"
|
|
|
- clearable :maxlength="50"></u-input>
|
|
|
+ <u-input placeholder="请输入备注" border="none" v-model.trim="formData.remark" clearable
|
|
|
+ :maxlength="100" inputAlign="right"></u-input>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -83,19 +74,60 @@
|
|
|
data() {
|
|
|
return {
|
|
|
formData: {
|
|
|
- personId: '6',
|
|
|
- name: '',
|
|
|
+ personId: '',
|
|
|
+ name: '请选择申请人',
|
|
|
demand: '',
|
|
|
- sex: '',
|
|
|
- hospital: '',
|
|
|
+ sex: '0',
|
|
|
+ hospital: '请选择所在医院',
|
|
|
address: '',
|
|
|
dayCount: '',
|
|
|
remark: ''
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ onLoad() {
|
|
|
+ uni.$on('personChoose', (e) => {
|
|
|
+ console.log(e);
|
|
|
+ this.formData.personId = e.id;
|
|
|
+ this.formData.name = e.name;
|
|
|
+ });
|
|
|
+
|
|
|
+ uni.$on('hospitalChoose', (e) => {
|
|
|
+ console.log(e);
|
|
|
+ this.formData.hospital = e.name;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onUnload() {
|
|
|
+ uni.$off('personChoose');
|
|
|
+ uni.$off('hospitalChoose');
|
|
|
+ },
|
|
|
methods: {
|
|
|
- handleSubmit() {
|
|
|
+ goChooseHospital() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/subpack/pages/choose-hospital/choose-hospital'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ goChoosePeople() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/subpack/pages/choose-people/choose-people'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ chooseGender() {
|
|
|
+ uni.showActionSheet({
|
|
|
+ title: '首选护理人员性别',
|
|
|
+ itemList: ['女', '男'],
|
|
|
+ success: (res) => {
|
|
|
+ // console.log('选择了第' + (res.tapIndex) + '个选项');
|
|
|
+ this.formData.sex = res.tapIndex + '';
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log('弹窗取消');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ apply() {
|
|
|
+ uni.showLoading();
|
|
|
applyUrl({
|
|
|
address: this.formData.address,
|
|
|
applyDate: dayjs().format('YYYY-MM-DD'),
|
|
@@ -108,15 +140,55 @@
|
|
|
remark: this.formData.remark
|
|
|
})
|
|
|
.then(res => {
|
|
|
- console.log('提交');
|
|
|
+ uni.hideLoading();
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: `提交成功`,
|
|
|
+ showCancel: false,
|
|
|
+ confirmText: '返回首页',
|
|
|
+ success: (e) => {
|
|
|
+ if (e.confirm) {
|
|
|
+ uni.navigateBack()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
.catch(err => {
|
|
|
+ uni.hideLoading();
|
|
|
console.log(err);
|
|
|
})
|
|
|
},
|
|
|
- goChoosePeople() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/subpack/pages/choose-people/choose-people'
|
|
|
+
|
|
|
+ handleSubmit() {
|
|
|
+ if (this.formData.name === '请选择申请人' || !this.formData.name) {
|
|
|
+ return uni.$u.toast('请选择申请人')
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.formData.demand) {
|
|
|
+ return uni.$u.toast('请输入护理需求')
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.formData.hospital === '请选择所在医院' || !this.formData.hospital) {
|
|
|
+ return uni.$u.toast('请选择所在医院')
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.formData.address) {
|
|
|
+ return uni.$u.toast('请输入详情地址')
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.formData.dayCount) {
|
|
|
+ return uni.$u.toast('请输入预计天数')
|
|
|
+ }
|
|
|
+
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: `确定提交此次申请吗?`,
|
|
|
+ showCancel: true,
|
|
|
+ success: (e) => {
|
|
|
+ if (e.confirm) {
|
|
|
+ this.apply();
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
}
|