站点区域

master
lion 9 months ago
parent b89665d0a3
commit 26ebdc4d35

@ -140,6 +140,17 @@
:error-type="['toast']" :error-type="['toast']"
> >
<view class="form-card form-card-1"> <view class="form-card form-card-1">
<!-- 站点 根据前面选择的站点来 -->
<u-form-item label="站点区域" prop="hospital" required>
<u-input
:type="!!orderId || canSelectSite ? 'input' : 'select'"
placeholder="请选择站点区域"
:disabled="!!orderId || canSelectSite"
:value="site_name"
:select-open="isShowSite"
@click="orderId || canSelectSite ? false : (isShowSite = true)"
/>
</u-form-item>
<u-form-item label="就诊医院" prop="hospital" required v-if="form.type == 1"> <u-form-item label="就诊医院" prop="hospital" required v-if="form.type == 1">
<u-input <u-input
:type="!!orderId ? 'input' : 'select'" :type="!!orderId ? 'input' : 'select'"
@ -503,6 +514,15 @@
label-name="name" label-name="name"
:list="list_hospital" :list="list_hospital"
></u-select> ></u-select>
<!-- 如果前面没有选站点 就需要选择产品下的站点 -->
<u-select
v-model="isShowSite"
value-name="id"
@confirm="confirmSite"
label-name="name"
:list="list_psite"
></u-select>
<!-- 服务时间 --> <!-- 服务时间 -->
<u-picker <u-picker
v-model="isShowTime" v-model="isShowTime"
@ -705,7 +725,12 @@ export default {
list_archive: [], list_archive: [],
orderId: "", orderId: "",
nurse: {}, nurse: {},
isShowSite:false,
list_psite: [],
site_name:'',
canSelectSite:false, //
form: { form: {
site_id:'',
type: 1, type: 1,
is_show: false, is_show: false,
accompany_product_id: "", accompany_product_id: "",
@ -739,6 +764,11 @@ export default {
trigger: ["blur", "change"], trigger: ["blur", "change"],
}, },
], ],
site_id:[{
required: true,
message: "请选择所在站点",
trigger: ["blur", "change"],
}],
hospital: [ hospital: [
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
@ -798,16 +828,22 @@ export default {
this.form.can_multi_num = option.can_multi_num ? Number(option.can_multi_num) : 0 this.form.can_multi_num = option.can_multi_num ? Number(option.can_multi_num) : 0
this.form.accompany_product_id = option.id ? Number(option.id) : ""; this.form.accompany_product_id = option.id ? Number(option.id) : "";
this.form.type = Number(option.type); this.form.type = Number(option.type);
this.form.site_id = option.site_id?Number(option.site_id):''
this.site_name = option.site_id?option.site_name:''
this.canSelectSite = option.site_id?true:false
// this.site_name = this.vuex_site?this.vuex_site.name:''
console.log("this.vuex_site",this.form.site_id,this.site_name)
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: option.type == 1 ? '预约陪诊' : '预约居家照护' title: option.type == 1 ? '预约陪诊' : '预约居家照护'
}) })
this.getList(option.type); if (!this.orderId && option.order_id) {
this.orderId = option.order_id;
this.getDetail();
}
this.getList(option.type,option.site_id);
this.getHospital(option.site_id); this.getHospital(option.site_id);
this.getUserArchive(); this.getUserArchive();
if (!this.orderId && option.order_id) {
this.orderId = option.order_id;
this.getDetail();
}
}, },
methods: { methods: {
@ -834,13 +870,18 @@ export default {
} }
}, },
// //
async getList(type) { async getList(type,site_id) {
const res = await this.$u.api.accompanyProduct({ const res = await this.$u.api.accompanyProduct({
type: type, type: type,
page: 1, page: 1,
page_size: 999, page_size: 999,
site_id:site_id?site_id:''
}); });
this.list_service = res.data; this.list_service = res.data;
if(!this.orderId){
this.list_psite = res.data.filter(item=>item.id==this.form.accompany_product_id)[0].site
}
}, },
async getDetail(id) { async getDetail(id) {
console.log(id, this.orderId); console.log(id, this.orderId);
@ -867,6 +908,7 @@ export default {
url: i.url url: i.url
})) }))
this.paidPrice = res.price this.paidPrice = res.price
this.site_name = res.site?res.site.name:''
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: res.accompany_product?res.accompany_product.name:'订单详情' title: res.accompany_product?res.accompany_product.name:'订单详情'
}) })
@ -890,6 +932,12 @@ export default {
changeService(item) { changeService(item) {
this.info = item; this.info = item;
this.form.accompany_product_id = item.id; this.form.accompany_product_id = item.id;
if(this.canSelectSite){
this.list_psite = item.site
this.form.site_id = ''
this.site_name = ''
}
console.log("this.list_psite",this.list_psite)
this.getHospital(item.site_id); this.getHospital(item.site_id);
this.isShowService = false; this.isShowService = false;
this.form.hospital = ""; this.form.hospital = "";
@ -897,6 +945,10 @@ export default {
confirmHospital(e) { confirmHospital(e) {
this.form.hospital = e[0].value; this.form.hospital = e[0].value;
}, },
confirmSite(e) {
this.form.site_id = e[0].value;
this.site_name = e[0].label;
},
confirmTime(e) { confirmTime(e) {
this.form.time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:00`; this.form.time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:00`;
}, },

@ -41,6 +41,14 @@
<u-form :model="form" :rules="rules" ref="uForm" :label-width="178" :error-type="['toast']"> <u-form :model="form" :rules="rules" ref="uForm" :label-width="178" :error-type="['toast']">
<view class="form-card form-card-1"> <view class="form-card form-card-1">
<u-form-item label="站点区域" prop="hospital" required>
<u-input
type="input"
placeholder="请选择站点区域"
:disabled="true"
:value="site_name"
/>
</u-form-item>
<u-form-item label="就诊医院" prop="hospital" required v-if="form.type == 1"> <u-form-item label="就诊医院" prop="hospital" required v-if="form.type == 1">
<u-input :type="'select'" placeholder="请选择就诊医院" :value="hospital.name" <u-input :type="'select'" placeholder="请选择就诊医院" :value="hospital.name"
:select-open="isShowHospital" @click="isShowHospital = true" /> :select-open="isShowHospital" @click="isShowHospital = true" />
@ -323,6 +331,7 @@
isShowService: false, isShowService: false,
// form // form
site_name:'',
fileList: [], fileList: [],
isShowHospital: false, isShowHospital: false,
isShowTime: false, isShowTime: false,
@ -449,6 +458,7 @@
url: i.url url: i.url
})) }))
this.paidPrice = res.price this.paidPrice = res.price
this.site_name = res.site.name?res.site.name:''
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: res.accompany_product ? res.accompany_product.name : '订单详情' title: res.accompany_product ? res.accompany_product.name : '订单详情'
}) })

@ -99,6 +99,8 @@
data() { data() {
return { return {
id: '', id: '',
choose_site:'',
site_name:'',
currentTab: 0, currentTab: 0,
info: {}, info: {},
orderBtnStyle: { orderBtnStyle: {
@ -116,6 +118,8 @@
title: option.title ?? "服务项目" title: option.title ?? "服务项目"
}); });
this.id = option.id ? option.id : '' this.id = option.id ? option.id : ''
this.choose_site = option.choose_site?option.choose_site:''
this.site_name = option.site_name?option.site_name:''
this.getDetail(this.id) this.getDetail(this.id)
}, },
mounted() { mounted() {
@ -157,7 +161,7 @@
return return
} }
this.$u.route({ this.$u.route({
url: '/package_sub/pages/AddOrder/AddOrder?id='+info.id+'&site_id='+info.site_id+'&type='+info.type+'&can_multi_num='+info.can_multi_num url: '/package_sub/pages/AddOrder/AddOrder?id='+info.id+'&site_name='+this.site_name+'&site_id='+this.choose_site+'&type='+info.type+'&can_multi_num='+info.can_multi_num
}) })
}, },
} }

@ -164,7 +164,7 @@
}, },
toDetail(item) { toDetail(item) {
this.$u.route({ this.$u.route({
url: '/package_sub/pages/ServiceDetail/ServiceDetail?id=' + item.id url: '/package_sub/pages/ServiceDetail/ServiceDetail?id=' + item.id+'&site_name='+this.site_name+'&choose_site='+this.select.site_id
}) })
} }
}, },

Loading…
Cancel
Save