Commit 37f61644 authored by huangyecong's avatar huangyecong

添加已预约接口

parent c18c17eb
......@@ -40,4 +40,12 @@ api.getSupplierList = function (data) {
api.getShopByDistrictCode = function (data) {
return req.post('/api/mn/mobile/getShopByDistrictCode', data)
}
// 门店排期
api.getScheduleByCode = function (data) {
return req.post('/api/mn/mobile/getScheduleByCode', data)
}
// 预约
api.addAppointment = function (data) {
return req.post('/api/mn/mobile/addAppointment', data)
}
export default api
......@@ -99,8 +99,11 @@ export default {
chooseList.push({
id:this.chooseId
})
// 本地存储数据-选择的体检套餐
window.localStorage.setItem('chooseList',JSON.stringify(chooseList))
console.log("选择体检套餐chooseId===",this.chooseId)
// 显示"下一步"
this.$parent.next = true
},
},
};
......
......@@ -52,7 +52,7 @@
:key="index"
:class="index === selectIndex ? 'active' : ''"
@click="clickTab(index, item.id)"
>{{ item.supplierName }}</span
>{{ item.supplierName }}-{{ item.id }}</span
>
</div>
</div>
......@@ -71,7 +71,7 @@
:class="item.isDisabled ? 'btn disabled' : 'btn'"
@click="openDatePicker(item)"
>
选择体检日期
选择体检日期-{{ item.supplierId }}-{{ item.id }}
</button>
</li>
</ul>
......@@ -121,13 +121,17 @@ export default {
isShowHospitalList: true, //是否显示体检中心列表
supplierIds: '', //体检中心ids,默认显示全部
servicepackageId: '', //产品id
serviceDate: '', //预约的时间
hospitalId: '', //医院id
supplierId: '', //选择体检中id
}
},
created() {
const { servicepackageId } = this.$route.query
this.servicepackageId = servicepackageId ? servicepackageId : ''
this.getProvinceList() //省
this.getProvinceList() //获取
this.getSupplierList() //获取体检机构
// 获取门店排期
},
methods: {
......@@ -146,6 +150,7 @@ export default {
}
})
},
// 获取市
getCityListByProvinceCode() {
const query = {
......@@ -161,6 +166,7 @@ export default {
}
})
},
// 获取区/城市
getDistrictListByCityCode() {
const query = {
......@@ -200,31 +206,33 @@ export default {
// 获取体检机构
async getSupplierList() {
// 测试id1043
api.getSupplierList({ servicepackageId: this.servicepackageId}).then((res) => {
if (res.returnCode == '0000') {
const data = res.content
// 提取所有的体检机构ids,并用逗号隔开,比如:1004,1007
this.supplierIds = data
.map(function (e, i) {
return e.id
})
.join(',')
api
.getSupplierList({ servicepackageId: this.servicepackageId })
.then((res) => {
if (res.returnCode == '0000') {
const data = res.content
// 提取所有的体检机构ids,并用逗号隔开,比如:1004,1007
this.supplierIds = data
.map(function (e, i) {
return e.id
})
.join(',')
this.mechanismList = [
{
status: '0',
supplierName: '全部',
id:this.supplierIds
},
...res.content,
]
console.log('this.supplierIds===', this.supplierIds)
this.getShopByDistrictCode()//根据体检结构-显示可选择的体检中心,默认显示全部
} else {
this.$message.error(res.returnMsg)
}
})
{
status: '0',
supplierName: '全部',
id: this.supplierIds,
},
...res.content,
]
console.log('this.supplierIds===', this.supplierIds)
this.getShopByDistrictCode() //根据体检结构-显示可选择的体检中心,默认显示全部
} else {
this.$message.error(res.returnMsg)
}
})
},
// 选择体检机构
......@@ -248,34 +256,101 @@ export default {
areaCode: '', //区号
supplierIds: this.supplierIds, //体检机构d
location: ',', //经纬度
servicepackageId: this.servicepackageId, //客户id
servicepackageId: this.servicepackageId, //产品id
}
api.getShopByDistrictCode(params).then((res) => {
if (res.returnCode === '0000') {
this.isShowHospitalList = true
this.hospitalList = res.content
console.log('根据体检机构-获取体检中心列表=',this.hospitalList)
}else{
this.isShowHospitalList = true
this.hospitalList = res.content
console.log('根据体检机构-获取体检中心列表=', this.hospitalList)
} else {
this.isShowHospitalList = false
// this.$message.error(res.returnMsg)
}
})
},
// 获取门店排期
getScheduleByCode() {
const query = {
code: '', //门店编码
beginDate: '', //开始时间
endDate: '', //结束时间
supplierId: '', //机构id
}
api.getScheduleByCode(query).then((res) => {
console.log(res)
})
},
// 打开日期弹框
openDatePicker(item) {
if (item.isDisabled) {
return
}
this.supplierId = item.supplierId
this.hospitalId = item.id
this.datePickShow = true
},
// 确认选择-"立即预约"
getConfirm(val) {
this.datePickShow = false
console.log('确认选择', val, this.serviceDate)
const _this = this
const query = {
dataSource: 'M', //数据来源P电脑PC ,M 手机
customerId: this.id, //客户id
servicepackageId: this.servicepackageId, //套餐id
checkUnitCode: JSON.stringify(this.hospitalId), //预约门店code
serviceDate: this.serviceDate, //预约使用服务时间
chooseList: JSON.parse(window.localStorage.getItem('chooseList')), //选择服务列表
payList: [],
supplierId: this.supplierId, //供应商id
hospitalId: this.hospitalId, //医院id
// checkUnitCode: '2152',
// chooseList: [{ id: 1069 }],
// customerId: 56418,
// dataSource: 'M',
// hospitalId: 2152,
// payList: [],
// serviceDate: '20211127',
// servicepackageId: 1043,
// supplierId: 1007,
}
console.log('立即预约=', query)
// 弹窗-"你预约的日期为:xxxxxx"
this.$confirm({
title: '预约时间确认',
content: `你预约的日期为:${this.serviceDate}`,
onOk() {
// return new Promise((resolve, reject) => {
// setTimeout(Math.random() > 0.5 ? resolve : reject, 1000)
// }).catch(() => console.log('Oops errors!'))
api.addAppointment(query).then((res) => {
if (res.returnCode === '0000') {
console.log('立即预约=', res)
_this.$message.error('预约成功')
// 提示预约成功,之后跳转到预约详情页面
} else {
_this.$message.error(res.returnMsg)
}
})
},
onCancel() {},
})
},
getCancle(val) {
this.datePickShow = false
},
dateChange(date, type) {
console.log(date)
if (date.length != 0) {
this.serviceDate = date[0].date
}
},
},
}
......@@ -377,7 +452,7 @@ export default {
}
}
}
.hospital_none{
.hospital_none {
text-align: center;
padding: 20px;
}
......
......@@ -6,12 +6,12 @@
<div class="info">
<div class="item">
<span class="label">姓名:</span>
<a-input :default-value="customerInfo.name" disabled></a-input>
<a-input :value="customerInfo.name" disabled></a-input>
</div>
<div class="item">
<span class="label">性别:</span>
<a-input
:default-value="customerInfo.sex == 'M' ? '女' : '男'"
:value="customerInfo.sex == 'M' ? '女' : '男'"
disabled
/>
</div>
......@@ -24,15 +24,15 @@
</div>
<div class="item">
<span class="label">身份证:</span>
<a-input :default-value="customerInfo.idNo" disabled />
<a-input :value="customerInfo.idNo" disabled />
</div>
<div class="item">
<span class="label">手机号码:</span>
<a-input :default-value="customerInfo.phone" />
<a-input :value="customerInfo.phone" />
</div>
<div class="item">
<span class="label">出生日期:</span>
<a-input :default-value="customerInfo.birthDate" disabled />
<a-input :value="customerInfo.birthDate" disabled />
</div>
</div>
<div class="reset">
......@@ -41,13 +41,13 @@
</div>
<div class="right">
<!-- <Combos :id="id"/> -->
<SelectInstitution :id="id" />
<!-- <Detail /> -->
<!-- <Combos :id="id" v-if="step1"/>
<SelectInstitution :id="id" v-if="step2"/> -->
<Detail />
</div>
</div>
<div class="btn">
<a-button type="primary" @click="nextStep" v-if="!next">下一步</a-button>
<a-button type="primary" @click="nextStep" v-if="next">下一步</a-button>
</div>
</div>
</template>
......@@ -67,7 +67,7 @@ export default {
props: {},
data() {
return {
next: true,
next: false,
id: '', //客户id
customerInfo: {
name: '',
......@@ -77,6 +77,9 @@ export default {
birthDate: '',
maritalStatus:''
}, //客户信息
step1:true,
step2:false,
step3:false
}
},
created() {
......@@ -87,6 +90,10 @@ export default {
methods: {
nextStep() {
this.next = true
if(this.next){
this.step1 = false
this.step2 = true
}
},
// 获取客户信息
......
......@@ -2,7 +2,7 @@
<div class="item">
<div class="left">
<div class="title">
<span class="point"></span> {{ item.servicepackageName }}-{{item.id}}
<span class="point"></span> {{ item.servicepackageName }}-{{ item.id }}
</div>
<div class="detail" @click="$router.push(item.detailUrl)">
<img :src="eyes" alt="" />点击查看体检套餐详情
......@@ -21,9 +21,7 @@
@click="handleSubmit"
>立即预约</a-button
>
<div class="date">
有效期至:{{ item.validityEnd }}
</div>
<div class="date">有效期至:{{ item.validityEnd }}</div>
</div>
</div>
</template>
......@@ -54,15 +52,15 @@ export default {
methods: {
// 立即预约
handleSubmit() {
console.log('立即预约~',this.item.chooseList)
console.log('立即预约~', this.item.chooseList)
// 本地存储数据-该产品下可选择的体检套餐
window.localStorage.setItem('reservedInfo',JSON.stringify(this.item))
window.localStorage.setItem('reservedInfo', JSON.stringify(this.item))
this.$router.push({
name: 'Flow',
query: {
id: this.id,//客户id
servicepackageId:this.item.id//产品id
id: this.id, //客户id
servicepackageId: this.item.id, //产品id
},
})
},
......
......@@ -2,15 +2,18 @@
<div class="index">
<div class="appointment">
<div class="type"><span class="point"></span> 待预约的服务</div>
<div class="item-container">
<div v-if="packageList.length == 0">暂无可预约体检</div>
<div class="item-container" v-else>
<Item v-for="(item, index) in packageList" :item="item" :key="index" listType='1' :id="id"/>
</div>
</div>
<div class="appointmented">
<div class="type"><span class="point"></span>已预约的服务</div>
<div class="item-container">
<Item v-for="(item, index) in itemb" :item="item" :key="index" listType='2' :id="id"/>
<div v-if="appointmentList.length == 0">暂无已预约体检</div>
<div class="item-container" v-else>
<Item v-for="(item, index) in appointmentList" :item="item" :key="index" listType='2' :id="id"/>
</div>
</div>
<!-- 新卡-初始对话框 -->
<a-modal
......@@ -86,7 +89,8 @@ export default {
date: '2021-11-18',
},
],
packageList:[]//待预约列表
packageList:[],//待预约列表
appointmentList:[]//已预约列表
}
},
created() {
......@@ -123,15 +127,21 @@ export default {
if (res.returnCode == '0000') {
console.log('获取待预约==', res.content)
this.packageList = res.content
} else {
this.$message.error(res.returnMsg)
}
}
// else {
// this.$message.error(res.returnMsg)
// }
})
},
// 获取已预约列表
getAppointmentList() {
api.getAppointmentList({ id: parseInt(this.id) }).then((res) => {
console.log('获取已预约列表', res)
if (res.returnCode == '0000') {
console.log('获取已预约列表==', res.content)
this.appointmentList = res.content
} else {
this.$message.error(res.returnMsg)
}
})
},
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment