Commit 67085158 authored by huangyecong's avatar huangyecong

添加省市区接口

parent 89d8e598
...@@ -8,34 +8,34 @@ ...@@ -8,34 +8,34 @@
<ul class="area_box"> <ul class="area_box">
<li> <li>
<label>省:</label> <label>省:</label>
<a-select style="width: 120px"> <a-select style="width: 120px" @change="handleSelectProvince">
<a-select-option <a-select-option
v-for="item in provinceList" v-for="item in provinceList"
:key="item" :key="item.id"
:value="item" :value="item.provinceCode"
>{{ item }}</a-select-option >{{ item.provinceName }}</a-select-option
> >
</a-select> </a-select>
</li> </li>
<li> <li>
<label>市:</label> <label>市:</label>
<a-select style="width: 120px"> <a-select style="width: 120px" @change="handleSelectCity">
<a-select-option <a-select-option
v-for="item in provinceList" v-for="item in cityList"
:key="item" :key="item.id"
:value="item" :value="item.cityCode"
>{{ item }}</a-select-option >{{ item.cityName }}</a-select-option
> >
</a-select> </a-select>
</li> </li>
<li> <li>
<label>区:</label> <label>区:</label>
<a-select style="width: 120px"> <a-select style="width: 120px" @change="handleSelectDistrict">
<a-select-option <a-select-option
v-for="item in areaList" v-for="item in areaList"
:key="item" :key="item.id"
:value="item" :value="item.districtCode"
>{{ item }}</a-select-option >{{ item.districtName }}</a-select-option
> >
</a-select> </a-select>
</li> </li>
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
v-for="(item, index) in mechanismList" v-for="(item, index) in mechanismList"
:key="index" :key="index"
:class="index === selectIndex ? 'active' : ''" :class="index === selectIndex ? 'active' : ''"
@click="clickTab(index,(item.id))" @click="clickTab(index, item.id)"
>{{ item.supplierName }}-{{item.id}}</span >{{ item.supplierName }}-{{ item.id }}</span
> >
</div> </div>
</div> </div>
...@@ -94,7 +94,6 @@ ...@@ -94,7 +94,6 @@
<script> <script>
import api from '@/api/customer' import api from '@/api/customer'
import reserveDate from '../../../components/reserve-date' import reserveDate from '../../../components/reserve-date'
import { log } from 'util'
export default { export default {
name: 'selectInstitution', name: 'selectInstitution',
components: { components: {
...@@ -110,49 +109,91 @@ export default { ...@@ -110,49 +109,91 @@ export default {
return { return {
datePickShow: false, datePickShow: false,
selectIndex: 0, selectIndex: 0,
provinceList: ['上海市'], provinceList: [], //省
provinceList: ['上海市'], cityList: [], //市
areaList: ['静安区'], areaList: [], //区
provinceCode: '', //选择省
cityCode: '', //选择市
mechanismList: [], mechanismList: [],
hospitalList: [], hospitalList: [],
supplierIds:"",//体检中心ids,默认显示全部 supplierIds: '', //体检中心ids,默认显示全部
servicepackageId: '', //产品id
} }
}, },
created() { created() {
this.getProvinceList()//省 const { servicepackageId } = this.$route.query
this.servicepackageId = servicepackageId ? servicepackageId : ''
this.getProvinceList() //省
this.getSupplierList() //获取体检机构 this.getSupplierList() //获取体检机构
this.getShopByDistrictCode()//根据体检结构-显示可选择的体检中心,默认显示全部 this.getShopByDistrictCode() //根据体检结构-显示可选择的体检中心,默认显示全部
}, },
methods: { methods: {
// 省 // 获取
async getProvinceList() { async getProvinceList() {
const query = { const query = {
customerSex: 'M', chooseList: JSON.parse(window.localStorage.getItem('chooseList')),
customerMaritalStatus: '02', servicepackageId: this.servicepackageId,
chooseList: [{id: 1069}],
payList: [],
} }
await api.getProvinceList(query).then((res) => { await api.getProvinceList(query).then((res) => {
console.log('省=', res) if (res.returnCode === '0000') {
this.provinceList = res.content
} else {
this.$message.error(res.returnMsg)
}
}) })
// await this.getCityListByProvinceCode()
// await this.getDistrictListByCityCode()
}, },
// 市 // 获取
getCityListByProvinceCode() { getCityListByProvinceCode() {
api.getCityListByProvinceCode().then((res) => { const query = {
console.log('市=', res) provinceCode: this.provinceCode,
chooseList: JSON.parse(window.localStorage.getItem('chooseList')),
servicepackageId: this.servicepackageId,
}
api.getCityListByProvinceCode(query).then((res) => {
if (res.returnCode === '0000') {
this.cityList = res.content
} else {
this.$message.error(res.returnMsg)
}
}) })
}, },
// 区/城市 // 获取区/城市
getDistrictListByCityCode() { getDistrictListByCityCode() {
api.getDistrictListByCityCode().then((res) => { const query = {
console.log('区/城市=', res) cityCode: this.cityCode,
chooseList: JSON.parse(window.localStorage.getItem('chooseList')),
servicepackageId: this.servicepackageId,
}
api.getDistrictListByCityCode(query).then((res) => {
if (res.returnCode === '0000') {
this.areaList = res.content
} else {
this.$message.error(res.returnMsg)
}
}) })
}, },
// 选择省
handleSelectProvince(value) {
console.log(`选择省provinceCode= ${value}`)
this.provinceCode = value
this.getCityListByProvinceCode() // 根据省-获取市
},
// 选择市
handleSelectCity(value) {
console.log(`选择市CityCode= ${value}`)
this.cityCode = value
this.getDistrictListByCityCode() // 根据市-获取区
},
// 选择区
handleSelectDistrict(value){
console.log(`选择区DistrictCode= ${value}`)
},
// 获取体检机构 // 获取体检机构
getSupplierList() { getSupplierList() {
// this.id // this.id
...@@ -167,10 +208,12 @@ export default { ...@@ -167,10 +208,12 @@ export default {
...res.content, ...res.content,
] ]
// 提取所有的体检机构ids,并用逗号隔开,比如:1004,1007 // 提取所有的体检机构ids,并用逗号隔开,比如:1004,1007
this.supplierIds = data.map(function(e,i){ this.supplierIds = data
.map(function (e, i) {
return e.id return e.id
}).join(',') })
console.log('this.supplierIds===',this.supplierIds) .join(',')
console.log('this.supplierIds===', this.supplierIds)
} else { } else {
this.$message.error(res.returnMsg) this.$message.error(res.returnMsg)
} }
...@@ -178,9 +221,9 @@ export default { ...@@ -178,9 +221,9 @@ export default {
}, },
// 选择体检机构 // 选择体检机构
clickTab(index,id) { clickTab(index, id) {
this.selectIndex = index this.selectIndex = index
console.log("选择体检机构id",index,id); console.log('选择体检机构id', index, id)
this.supplierIds = id this.supplierIds = id
// 点击选择体检机构,显示该机构下的体检中心 // 点击选择体检机构,显示该机构下的体检中心
this.getShopByDistrictCode() this.getShopByDistrictCode()
...@@ -189,20 +232,19 @@ export default { ...@@ -189,20 +232,19 @@ export default {
// 根据体检机构-获取体检中心列表 // 根据体检机构-获取体检中心列表
getShopByDistrictCode() { getShopByDistrictCode() {
const params = { const params = {
customerSex: 'M',//性别 customerSex: 'M', //性别
customerMaritalStatus: '02',//婚姻状况 customerMaritalStatus: '02', //婚姻状况
chooseList: [{ id: 1069 }],//必选服务 chooseList: [{ id: 1069 }], //必选服务
payList: [], payList: [],
provinceCode: null,//省编号 provinceCode: null, //省编号
cityCode: '',//市编号 cityCode: '', //市编号
areaCode: '',//区号 areaCode: '', //区号
supplierIds: this.supplierIds,//体检机构d supplierIds: this.supplierIds, //体检机构d
location: ',',//经纬度 location: ',', //经纬度
servicepackageId: 1043,//客户id servicepackageId: 1043, //客户id
} }
api.getShopByDistrictCode(params).then((res) => { api.getShopByDistrictCode(params).then((res) => {
if(res.returnCode==='0000'){ if (res.returnCode === '0000') {
this.hospitalList = res.content this.hospitalList = res.content
} }
}) })
......
...@@ -57,7 +57,6 @@ import SelectInstitution from './components/selectInstitution.vue' ...@@ -57,7 +57,6 @@ import SelectInstitution from './components/selectInstitution.vue'
import Combos from './components/combo.vue' import Combos from './components/combo.vue'
import Detail from './components/detail.vue' import Detail from './components/detail.vue'
import api from '@/api/customer' import api from '@/api/customer'
import { log } from 'util'
export default { export default {
name: 'componentName', name: 'componentName',
components: { components: {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="item"> <div class="item">
<div class="left"> <div class="left">
<div class="title"> <div class="title">
<span class="point"></span> {{ item.servicepackageName }} <span class="point"></span> {{ item.servicepackageName }}-{{item.id}}
</div> </div>
<div class="detail" @click="$router.push(item.detailUrl)"> <div class="detail" @click="$router.push(item.detailUrl)">
<img :src="eyes" alt="" />点击查看体检套餐详情 <img :src="eyes" alt="" />点击查看体检套餐详情
...@@ -55,13 +55,14 @@ export default { ...@@ -55,13 +55,14 @@ export default {
// 立即预约 // 立即预约
handleSubmit() { 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({ this.$router.push({
name: 'Flow', name: 'Flow',
query: { query: {
id: this.id, id: this.id,//客户id
servicepackageId:this.item.id//产品id
}, },
}) })
}, },
......
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