From 620462349e5270433d15e442a2cd19ddf51d59ce Mon Sep 17 00:00:00 2001 From: donqi Date: Sun, 5 Mar 2023 22:15:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E9=A9=BB=EF=BC=8C=E5=AE=9E=E5=90=8D?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/request.js | 28 +++++++++- pages/my/certification.vue | 85 ++++++++++++++++++++++------ pages/my/master-occupancy.vue | 101 ++++++++++++++++++++++++++++++++-- 3 files changed, 189 insertions(+), 25 deletions(-) diff --git a/common/js/request.js b/common/js/request.js index 30074af..82c20d6 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -13,9 +13,9 @@ export default { }) let userInfo = _this.getCurUserInfo(); // request 触发前拼接 url - args.url = 'https://www.opsoul.com:8881' + args.url; + // args.url = 'https://www.opsoul.com:8881' + args.url; // args.url = 'http://127.0.0.1:80' + args.url; - // args.url = 'http://192.168.2.36:80' + args.url; + args.url = 'http://192.168.2.43:80' + args.url; if (!args.data) { args.data = {} @@ -189,6 +189,14 @@ export default { }) return res[1].data; }, + async noticeMsg(params = {}) { + let res = await uni.request({ + url: '/wx/noticeMsg', + method: 'POST', + data: params + }) + return res[1].data; + }, async sendVertifyCode(params = {}) { let res = await uni.request({ url: '/tool/sms/send', @@ -583,6 +591,22 @@ export default { }) return res[1].data; }, + async getWorkerAreaEdit(params = {}) { + let res = await uni.request({ + url: '/worker/area/worker/edit', + method: 'GET', + data: params + }) + return res[1].data; + }, + async getWorkerGoodsCategoryEdit(params = {}) { + let res = await uni.request({ + url: '/worker/goods/category/worker/edit', + method: 'GET', + data: params + }) + return res[1].data; + }, async qrPay(params = {}) { let res = await uni.request({ url: '/pay/ali/qr', diff --git a/pages/my/certification.vue b/pages/my/certification.vue index 0d6211c..69d68ec 100644 --- a/pages/my/certification.vue +++ b/pages/my/certification.vue @@ -184,20 +184,20 @@ :candidates="specialSkill[index].specialSubTypeList" :showField="'goodsCategoryName'" placeholder="请选择" v-model="specialSkill[index].specialSubTypeObj" - @input="chooseSpecialSkill($event, 1, index)"> + @input="chooseSpecialSkill($event, 1, index)" @tap="reloadTargetCategory(1, index)"> + @input="chooseSpecialSkill($event, 3, index)" @tap="reloadTargetCategory(2, index)"> - + 技能证书: - + 保险证明: - + 保险日期: - + 保险证明: { + servSpecialSkills.push({ + ...item, + specialSkillName: item.threeDeptGoodsCategory.goodsCategoryName + }) + }) + this.servSpecialSkills = servSpecialSkills; this.curCertifyInfo.otherServArr = this.curCertifyInfo.otherServ.split(","); } else { this.loadAreaList(); this.loadSpecialSkillType(); } }, - async showForm() { + async showForm() { + this.loadAreaList(); + this.loadSpecialSkillType(); if (this.curCertifyInfo) { let idCardImgList = []; if (this.curCertifyInfo.idCardUrl1) { @@ -476,6 +485,23 @@ companyArea.push(areaList[0]); companyArea.push(subAreaList[0]); companyArea.push(subSubAreaList[0]); + // 特殊技能 + let specialSkill = []; + this.curCertifyInfo.specialSkills.forEach(item => { + specialSkill.push({ + specialTypeObj: item.firstDeptGoodsCategory, + specialTypeList: item.specialTypeList, + specialSubTypeObj: item.twoDeptGoodsCategory, + specialSubTypeList: [], + specialSkillList: [], + specialSkillObj: item.threeDeptGoodsCategory, + skillCert: [item.credential], + insurCert: [item.insurance], + insurStartDate: item.insuranceStart, + insurEndDate: item.insuranceEnd + }) + }); + this.specialSkill = specialSkill; this.realNameInfo = { ...this.curCertifyInfo, @@ -487,8 +513,6 @@ this.curCertifyInfo = null; } - this.loadAreaList(); - this.loadSpecialSkillType(); }, preStep() { this.curStep = this.curStep === 0 ? 0 : --this.curStep; @@ -591,12 +615,39 @@ goodsCategoryId: res[0].goodsCategoryId }); this.specialTypeList = typeList.data; + }, + async reloadTargetCategory(colIndex, specialSkillIndex) { + switch(colIndex) { + case 1: { + if (this.specialSkill[specialSkillIndex].specialTypeObj + && (!this.specialSkill[specialSkillIndex].specialSubTypeList + || this.specialSkill[specialSkillIndex].specialSubTypeList.length === 0)) { + let res = await this.$request.listByStep({ + goodsCategoryId: this.specialSkill[specialSkillIndex].specialTypeObj.goodsCategoryId, + type: 1 + }); + this.specialSkill[specialSkillIndex].specialSubTypeList = res.data; + } + } break; + case 2: { + if (this.specialSkill[specialSkillIndex].specialSubTypeObj + && (!this.specialSkill[specialSkillIndex].specialSkillList + || this.specialSkill[specialSkillIndex].specialSkillList.length === 0)) { + let res = await this.$request.listByStep({ + goodsCategoryId: this.specialSkill[specialSkillIndex].specialSubTypeObj.goodsCategoryId, + type: 1 + }); + this.specialSkill[specialSkillIndex].specialSkillList = res.data; + } + } break; + default: break; + } }, async chooseSpecialSkill(e, type, index) { let funName = "listByStep"; - if (type === 1) { - funName = "qrySpecialSkillList"; - } + // if (type === 1) { + // funName = "qrySpecialSkillList"; + // } let res = await this.$request[funName]({ goodsCategoryId: e.goodsCategoryId, type: 1 @@ -728,10 +779,10 @@ let specialSkills = []; // 特殊技能参数 this.specialSkill.forEach((item) => { - if (item.specialSkillObj && item.specialSkillObj.specialSkillId) { + if (item.specialSkillObj && item.specialSkillObj.goodsCategoryId) { specialSkills.push({ workerId: workerId, - specialSkillId: item.specialSkillObj.specialSkillId, + specialSkillId: item.specialSkillObj.goodsCategoryId, credential: item.skillCert[0], insurance: item.insurCert[0], insuranceStart: item.insurStartDate, diff --git a/pages/my/master-occupancy.vue b/pages/my/master-occupancy.vue index 526979b..4a861ec 100644 --- a/pages/my/master-occupancy.vue +++ b/pages/my/master-occupancy.vue @@ -33,10 +33,10 @@ @input="chooseRegion($event, 0, index)"> + @input="chooseRegion($event, 1, index)" @tap="reloadTargetArea(1, index)"> + @input="chooseRegion($event, 2, index)" @tap="reloadTargetArea(2, index)"> @@ -82,7 +82,7 @@ @input="chooseType($event, 0, index)"> + @input="chooseType($event, 1, index)" @tap="reloadTargetCategory(1, index)"> @@ -257,11 +257,59 @@ } }, methods: { - loadData() { + async loadData() { this.curUserInfo = this.$request.getCurUserInfo(); - this.loadProvinceList(); - this.loadTypeList(); + await this.loadProvinceList(); + await this.loadTypeList(); + await this.loadExistData(); // this.loadSpecialSkill(); + }, + async loadExistData() { + this.loadServAreas(); + this.loadServSkills(); + }, + async loadServAreas() { + let res = await this.$request.getWorkerAreaEdit({ + workerId: this.curUserInfo.workerId + }); + let servArea = []; + for(let i = 0; i < res.data.length; i++) { + let item = res.data[i]; + let streetListRes = await this.$request.areaListByStep({ + parentCode: item.districtArea.areaCode + }); + servArea.push({ + cityList: [], + districtList: [], + streetList: streetListRes.data, + provinceObj: item.provinceArea, + cityObj: item.cityArea, + districtObj: item.districtArea, + streetIds: item.streetIds + }) + } + this.servArea = servArea; + }, + async loadServSkills() { + let res = await this.$request.getWorkerGoodsCategoryEdit({ + workerId: this.curUserInfo.workerId + }); + let servSkill = []; + for(let i = 0; i < res.data.length; i++) { + let item = res.data[i]; + let subSubTypeRes = await this.$request.listByStep({ + goodsCategoryId: item.twoGoodsCategory.goodsCategoryId, + type: 1 + }); + servSkill.push({ + subTypeList: [], + subSubTypeList: subSubTypeRes.data, + typeObj: item.oneGoodsCategory, + subTypeObj: item.twoGoodsCategory, + subSubTypeIds: item.categoryIds + }) + } + this.servSkill = servSkill; }, /* 服务区域 start */ async loadProvinceList() { @@ -317,6 +365,31 @@ }, delServArea(index) { this.servArea.splice(index, 1); + }, + async reloadTargetArea(colIndex, areaIndex) { + switch(colIndex) { + case 1: { + if (this.servArea[areaIndex].provinceObj + && (!this.servArea[areaIndex].cityList + || this.servArea[areaIndex].cityList.length === 0)) { + let res = await this.$request.areaListByStep({ + parentCode: this.servArea[areaIndex].provinceObj.areaCode, + }); + this.servArea[areaIndex].cityList = res.data; + } + } break; + case 2: { + if (this.servArea[areaIndex].cityObj + && (!this.servArea[areaIndex].districtList + || this.servArea[areaIndex].districtList.length === 0)) { + let res = await this.$request.areaListByStep({ + parentCode: this.servArea[areaIndex].cityObj.areaCode, + }); + this.servArea[areaIndex].districtList = res.data; + } + } break; + default: break; + } }, /* 服务区域 end */ /* 服务技能 start */ @@ -371,6 +444,22 @@ }, delServSkill(index) { this.servSkill.splice(index, 1); + }, + async reloadTargetCategory(colIndex, servSkillIndex) { + switch(colIndex) { + case 1: { + if (this.servSkill[servSkillIndex].typeObj + && (!this.servSkill[servSkillIndex].subTypeList + || this.servSkill[servSkillIndex].subTypeList.length === 0)) { + let res = await this.$request.listByStep({ + goodsCategoryId: this.servSkill[servSkillIndex].typeObj.goodsCategoryId, + type: 1 + }); + this.servSkill[servSkillIndex].subTypeList = res.data; + } + } break; + default: break; + } }, /* 服务技能 end */ /* 特殊技能 start */