From 8c9082e50363c5c69053ffb8e8543608aeaf96c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E4=B8=B9=E7=90=AA?= Date: Sat, 21 Oct 2023 03:07:18 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=A4=A7=E5=8E=85=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=8C=BA=E5=9F=9F=E6=9D=A1=E4=BB=B6=E7=AD=9B=E9=80=89?= =?UTF-8?q?=EF=BC=9B=E5=AE=9E=E5=90=8D=E4=B8=AD=E5=AD=90=E5=B8=88=E5=82=85?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=B8=8D=E5=A1=AB=E5=85=AC=E5=8F=B8=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/demand-center/accept-demand-center.vue | 93 ++++++++++++++++++-- pages/my/certification.vue | 46 ++++++---- 2 files changed, 113 insertions(+), 26 deletions(-) diff --git a/pages/demand-center/accept-demand-center.vue b/pages/demand-center/accept-demand-center.vue index 938c262..c54ca96 100644 --- a/pages/demand-center/accept-demand-center.vue +++ b/pages/demand-center/accept-demand-center.vue @@ -27,7 +27,7 @@ :value="areaMultiIndex" :range-key="'areaName'" :range="areaList"> - {{chosenArea && chosenArea.length ? chosenArea[2].areaName : item.title}} + {{chosenArea && chosenArea.length ? chosenArea[chosenArea.length - 1].areaName : item.title}} @@ -276,7 +276,10 @@ chosenCategory: [], bankCard: null, certifyInfo: null, - hasNotice: false + hasNotice: false, + workerCityIds: [], + workerDistrictIds: [], + workerStreetIds: [] } }, onShow() { @@ -285,6 +288,7 @@ methods: { async loadData() { this.curUserInfo = this.$request.getCurUserInfo(); + await this.getWorkerAreaIds(); // this.checkBankAndCertify(); // this.tasks = await this.$api.data('tasks'); this.reloadMasterOrderPage(); @@ -315,6 +319,28 @@ } return res; }, + async getWorkerAreaIds() { + let res = await this.$request.getWorkerArea({ + workerId: this.curUserInfo.workerId + }); + let cityIds = []; + let districtIds = []; + let streetIds = []; + for(let i = 0; i < res.data.length; i++) { + if (cityIds.indexOf(res.data[i].cityId) === -1) { + cityIds.push(res.data[i].cityId) + } + if (districtIds.indexOf(res.data[i].districtId) === -1) { + districtIds.push(res.data[i].districtId) + } + if (streetIds.indexOf(res.data[i].streetId) === -1) { + streetIds.push(res.data[i].streetId) + } + } + this.workerCityIds = cityIds; + this.workerDistrictIds = districtIds; + this.workerStreetIds = streetIds; + }, async loadMasterOrderPage(params = {}) { params.pageSize = this.$globalData.initPageSize; params.pageNum = this.pageNum; @@ -329,6 +355,13 @@ params.params[condition.code] = condition.value === 1 ? 'desc' : 'asc'; } }) + params.streetIds = this.workerStreetIds; + if (this.chosenArea.length === 1) { + params.cityIds = [this.chosenArea[0].areaId] + } + if (this.chosenArea.length === 2) { + params.districtIds = [this.chosenArea[1].areaId] + } this.$refs.loadStatusBar.showLoading(); try { @@ -400,22 +433,40 @@ this.categoryList.push(thirdTypeList); }, async loadRegionList() { - let regionList = await this.$request.areaListByStep(); + let regionList = await this.$request.areaListByStep({ + areaIds: this.workerCityIds, + parentCode: '' + }); regionList = regionList.data; let subRegionList = []; let subSubRegionList = []; if (regionList && regionList.length > 0) { subRegionList = await this.$request.areaListByStep({ - parentCode: regionList[0].areaCode + parentCode: regionList[0].areaCode, + areaIds: this.workerDistrictIds }); subRegionList = subRegionList.data; } if (subRegionList && subRegionList.length > 0) { subSubRegionList = await this.$request.areaListByStep({ - parentCode: subRegionList[0].areaCode + parentCode: subRegionList[0].areaCode, + areaIds: this.workerStreetIds }); subSubRegionList = subSubRegionList.data; } + // 加上“全部”节点 + regionList.unshift({ + areaName: '全部', + areaId: -1 + }); + subRegionList.unshift({ + areaName: '全部', + areaId: -1 + }); + subSubRegionList.unshift({ + areaName: '全部', + areaId: -1 + }); this.areaList.push(regionList); this.areaList.push(subRegionList); this.areaList.push(subSubRegionList); @@ -437,23 +488,40 @@ this.areaMultiIndex = e.detail.value; let chosenArea = []; for (let i = 0; i < this.areaList.length; i++) { + if (this.areaMultiIndex[i] === 0) { + // 选中了全部节点 + break; + } chosenArea.push(this.areaList[i][this.areaMultiIndex[i]]); } this.chosenArea = chosenArea; - this.taskConditions[this.tabCur].value = chosenArea[chosenArea.length - 1].areaId; + // this.taskConditions[this.tabCur].value = chosenArea[chosenArea.length - 1].areaId; this.searchTasks(); }, async regionColChange(e) { let colObj = e.detail; if (colObj.column == 0) { // 通过一级查二级 - let subAreaList = await this.$request.areaListByStep({parentCode: this.areaList[0][colObj.value].areaCode}); + let subAreaList = await this.$request.areaListByStep({parentCode: this.areaList[0][colObj.value].areaCode, areaIds: this.workerDistrictIds}); subAreaList = subAreaList.data; let subSubAreaList = []; if (subAreaList.length) { - subSubAreaList = await this.$request.areaListByStep({parentCode: subAreaList[0].areaCode}); + subSubAreaList = await this.$request.areaListByStep({parentCode: subAreaList[0].areaCode, areaIds: this.workerStreetIds}); subSubAreaList = subSubAreaList.data; } + // 加上“全部”节点 + if (subAreaList.length > 0) { + subAreaList.unshift({ + areaName: '全部', + areaId: -1 + }); + } + if (subSubAreaList.length > 0) { + subSubAreaList.unshift({ + areaName: '全部', + areaId: -1 + }); + } this.areaList.pop(); this.areaList.pop(); this.areaList.push(subAreaList); @@ -461,8 +529,15 @@ this.areaMultiIndex = [colObj.value, 0, 0]; } else if (colObj.column == 1) { // 通过二级查三级 - let subAreaList = await this.$request.areaListByStep({parentCode: this.areaList[1][colObj.value].areaCode}); + let subAreaList = await this.$request.areaListByStep({parentCode: this.areaList[1][colObj.value].areaCode, areaIds: this.workerStreetIds}); subAreaList = subAreaList.data; + // 加上“全部”节点 + if (subAreaList.length > 0) { + subAreaList.unshift({ + areaName: '全部', + areaId: -1 + }); + } this.areaList.pop(); this.areaList.push(subAreaList); this.areaMultiIndex = [this.areaMultiIndex[0], colObj.value, 0]; diff --git a/pages/my/certification.vue b/pages/my/certification.vue index 69d68ec..7a5f22b 100644 --- a/pages/my/certification.vue +++ b/pages/my/certification.vue @@ -391,7 +391,8 @@ }, data() { return { - curUserInfo: null, + curUserInfo: null, + hasJoinedTeam: false, curCertifyInfo: null, servSpecialSkills: null, curStep: 0, @@ -436,7 +437,8 @@ onShow() {}, methods: { async loadData() { - this.curUserInfo = this.$request.getCurUserInfo(); + this.curUserInfo = this.$request.getCurUserInfo(); + this.checkedHasJoinedTeam(); let res = await this.$request.getWorkerCertify(); this.curCertifyInfo = res.data; if (this.curCertifyInfo && this.curCertifyInfo.workerCertificationId) { @@ -454,6 +456,13 @@ this.loadAreaList(); this.loadSpecialSkillType(); } + }, + async checkedHasJoinedTeam() { + let params = { + hasRegistered: true + } + let res = await this.$request.getTeamPage(params); + this.hasJoinedTeam = res.rows.length > 0 ? true : false; }, async showForm() { this.loadAreaList(); @@ -733,7 +742,24 @@ /* 特殊技能 end */ validData() { let teamParams = this.realNameInfo; - let errMsg = null; + let errMsg = null; + if (!this.hasJoinedTeam) { + if (!teamParams.licenseImgList || !teamParams.licenseImgList.length) { + errMsg = "请上传公司营业执照"; + } else if (!teamParams.companyName) { + errMsg = "请填写公司名称"; + } else if (!teamParams.businessLicenseNum) { + errMsg = "请填写公司营业执照号码"; + } else if (!teamParams.companyArea || !teamParams.companyArea.length) { + errMsg = "请选择公司地址所在省市区"; + } else if (!teamParams.companyAddress) { + errMsg = "请输入营业执照地址/经营地址/服务网点"; + } else if (!teamParams.legalPersionName) { + errMsg = "请填写法人姓名"; + } else if (!teamParams.legalPersionPhoneNum) { + errMsg = "请填写法人联系电话"; + } + } if (teamParams.companySize == null || teamParams.companySize == undefined) { errMsg = "请选择经营主体规模"; } else if (!teamParams.brandName) { @@ -746,20 +772,6 @@ errMsg = "请填写名字" } else if (!teamParams.idCardNum) { errMsg = "请填写身份证号"; - } else if (!teamParams.licenseImgList || !teamParams.licenseImgList.length) { - errMsg = "请上传公司营业执照"; - } else if (!teamParams.companyName) { - errMsg = "请填写公司名称"; - } else if (!teamParams.businessLicenseNum) { - errMsg = "请填写公司营业执照号码"; - } else if (!teamParams.companyArea || !teamParams.companyArea.length) { - errMsg = "请选择公司地址所在省市区"; - } else if (!teamParams.companyAddress) { - errMsg = "请输入营业执照地址/经营地址/服务网点"; - } else if (!teamParams.legalPersionName) { - errMsg = "请填写法人姓名"; - } else if (!teamParams.legalPersionPhoneNum) { - errMsg = "请填写法人联系电话"; } if (errMsg) { uni.showToast({