提交 4e424ad8 编写于 作者: 张敬贤's avatar 张敬贤

add

上级 98410dea
...@@ -81,8 +81,6 @@ export default { ...@@ -81,8 +81,6 @@ export default {
console.log('locationAreaCode', this.provinceList, provinceIndex); console.log('locationAreaCode', this.provinceList, provinceIndex);
const data = [this.provinceList[provinceIndex], this.cityList[cityIndex], this.countyList[countyIndex]]; const data = [this.provinceList[provinceIndex], this.cityList[cityIndex], this.countyList[countyIndex]];
this.$emit('confirm', data); this.$emit('confirm', data);
}else{
this.initData();
} }
}, },
...@@ -103,10 +101,12 @@ export default { ...@@ -103,10 +101,12 @@ export default {
// 初始化 省市县信息 // 初始化 省市县信息
async initData() { async initData() {
this.provinceList = await this.getProvinceList(); this.provinceList = await this.getProvinceList();
console.log('this.provinceList1', this.provinceList);
this.cityList = await this.getCityList(this.provinceList[0].id); this.cityList = await this.getCityList(this.provinceList[0].id);
this.countyList = await this.getCountyList(this.cityList[0].id); this.countyList = await this.getCountyList(this.cityList[0].id);
this.columns = [{ values: this.provinceList }, { values: this.cityList }, { values: this.countyList }]; this.columns = [{ values: this.provinceList }, { values: this.cityList }, { values: this.countyList }];
const data = [this.provinceList[0], this.cityList[0], this.countyList[0]]; const data = [this.provinceList[0], this.cityList[0], this.countyList[0]];
console.log('initData', data);
this.$emit('confirm', data); this.$emit('confirm', data);
}, },
// 获取省列表 // 获取省列表
...@@ -129,8 +129,12 @@ export default { ...@@ -129,8 +129,12 @@ export default {
}, },
// 获取省列表下市区 // 获取省列表下市区
getCityList(provinceId) { getCityList(provinceId) {
console.log('this.provinceList', provinceId);
if (!provinceId) {
return;
}
return new Promise((resolve, rejects) => { return new Promise((resolve, rejects) => {
getCityList({ provinceId, projectEquityNo:this.projectEquityNo }).then(res => { getCityList({ provinceId:provinceId, projectEquityNo:this.projectEquityNo }).then(res => {
this.hideLoading(); this.hideLoading();
const data = res.data.cityList.map(ele => { const data = res.data.cityList.map(ele => {
return { return {
...@@ -146,6 +150,9 @@ export default { ...@@ -146,6 +150,9 @@ export default {
}, },
// 获取市区县区 // 获取市区县区
getCountyList(cityId) { getCountyList(cityId) {
if (!cityId) {
return;
}
return new Promise((resolve, rejects) => { return new Promise((resolve, rejects) => {
this.hideLoading(); this.hideLoading();
getCountyList({ cityId, projectEquityNo:this.projectEquityNo}).then(res => { getCountyList({ cityId, projectEquityNo:this.projectEquityNo}).then(res => {
......
...@@ -115,11 +115,11 @@ export default { ...@@ -115,11 +115,11 @@ export default {
console.log('externalData', nv); console.log('externalData', nv);
this.getHospitalList(false); this.getHospitalList(false);
}, },
deep:true deep: true,
immediate:truer
} }
}, },
mounted() { mounted() {
this.getHospitalList(false); this.getHospitalList(false);
}, },
methods: { methods: {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div <div
v-show="currentItem.amTimeBegin !='' && currentItem.amTimeEnd !=''" v-show="currentItem.amTimeBegin !='' && currentItem.amTimeEnd !=''"
class="text" class="text"
:class="selectTimeBucket === 'am' ?'selected':''" :class="selectTimeBucket === currentItem.amTimeBegin ?'selected':''"
@click="selectTimeB('am')" @click="selectTimeB('am')"
> >
{{ currentItem.amTimeContent }} {{ currentItem.amTimeContent }}
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<div <div
v-if="currentItem.pmTimeBegin !='' && currentItem.pmTimeEnd!=''" v-if="currentItem.pmTimeBegin !='' && currentItem.pmTimeEnd!=''"
class="text" class="text"
:class="selectTimeBucket === 'pm' ?'selected':''" :class="selectTimeBucket === currentItem.pmTimeBegin ?'selected':''"
@click="selectTimeB('pm')" @click="selectTimeB('pm')"
> >
{{ currentItem.pmTimeContent }} {{ currentItem.pmTimeContent }}
...@@ -150,6 +150,7 @@ export default { ...@@ -150,6 +150,7 @@ export default {
console.log(item); console.log(item);
this.selectTimes = selectTimes; this.selectTimes = selectTimes;
this.currentItem = item; this.currentItem = item;
this.selectTimeBucket = '';
this.selectItem(); this.selectItem();
}, },
selectTimeB(item) { selectTimeB(item) {
......
...@@ -420,6 +420,7 @@ export default { ...@@ -420,6 +420,7 @@ export default {
confirm(values) { confirm(values) {
console.log('confirm', values); console.log('confirm', values);
if (values) { if (values) {
console.log('confirm1', values);
this.showAreaLabel = values.map(ele => ele.name).join(''); this.showAreaLabel = values.map(ele => ele.name).join('');
this.externalData.provinceId = values[0].id; this.externalData.provinceId = values[0].id;
this.externalData.countyId = values[2].id; this.externalData.countyId = values[2].id;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册