需求大厅调整区域条件筛选;实名中子师傅可以不填公司信息;

This commit is contained in:
杨丹琪 2023-10-21 03:07:18 +08:00
parent 7e0d673551
commit 8c9082e503
2 changed files with 113 additions and 26 deletions

View File

@ -27,7 +27,7 @@
:value="areaMultiIndex" :range-key="'areaName'" :range="areaList"> :value="areaMultiIndex" :range-key="'areaName'" :range="areaList">
<view class="flex justify-start"> <view class="flex justify-start">
<view class="text-cut search-nav-item-text"> <view class="text-cut search-nav-item-text">
{{chosenArea && chosenArea.length ? chosenArea[2].areaName : item.title}} {{chosenArea && chosenArea.length ? chosenArea[chosenArea.length - 1].areaName : item.title}}
</view> </view>
<text class="text-lg"><text class="cuIcon-triangledownfill"></text></text> <text class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
</view> </view>
@ -276,7 +276,10 @@
chosenCategory: [], chosenCategory: [],
bankCard: null, bankCard: null,
certifyInfo: null, certifyInfo: null,
hasNotice: false hasNotice: false,
workerCityIds: [],
workerDistrictIds: [],
workerStreetIds: []
} }
}, },
onShow() { onShow() {
@ -285,6 +288,7 @@
methods: { methods: {
async loadData() { async loadData() {
this.curUserInfo = this.$request.getCurUserInfo(); this.curUserInfo = this.$request.getCurUserInfo();
await this.getWorkerAreaIds();
// this.checkBankAndCertify(); // this.checkBankAndCertify();
// this.tasks = await this.$api.data('tasks'); // this.tasks = await this.$api.data('tasks');
this.reloadMasterOrderPage(); this.reloadMasterOrderPage();
@ -315,6 +319,28 @@
} }
return res; 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 = {}) { async loadMasterOrderPage(params = {}) {
params.pageSize = this.$globalData.initPageSize; params.pageSize = this.$globalData.initPageSize;
params.pageNum = this.pageNum; params.pageNum = this.pageNum;
@ -329,6 +355,13 @@
params.params[condition.code] = condition.value === 1 ? 'desc' : 'asc'; 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(); this.$refs.loadStatusBar.showLoading();
try { try {
@ -400,22 +433,40 @@
this.categoryList.push(thirdTypeList); this.categoryList.push(thirdTypeList);
}, },
async loadRegionList() { async loadRegionList() {
let regionList = await this.$request.areaListByStep(); let regionList = await this.$request.areaListByStep({
areaIds: this.workerCityIds,
parentCode: ''
});
regionList = regionList.data; regionList = regionList.data;
let subRegionList = []; let subRegionList = [];
let subSubRegionList = []; let subSubRegionList = [];
if (regionList && regionList.length > 0) { if (regionList && regionList.length > 0) {
subRegionList = await this.$request.areaListByStep({ subRegionList = await this.$request.areaListByStep({
parentCode: regionList[0].areaCode parentCode: regionList[0].areaCode,
areaIds: this.workerDistrictIds
}); });
subRegionList = subRegionList.data; subRegionList = subRegionList.data;
} }
if (subRegionList && subRegionList.length > 0) { if (subRegionList && subRegionList.length > 0) {
subSubRegionList = await this.$request.areaListByStep({ subSubRegionList = await this.$request.areaListByStep({
parentCode: subRegionList[0].areaCode parentCode: subRegionList[0].areaCode,
areaIds: this.workerStreetIds
}); });
subSubRegionList = subSubRegionList.data; 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(regionList);
this.areaList.push(subRegionList); this.areaList.push(subRegionList);
this.areaList.push(subSubRegionList); this.areaList.push(subSubRegionList);
@ -437,23 +488,40 @@
this.areaMultiIndex = e.detail.value; this.areaMultiIndex = e.detail.value;
let chosenArea = []; let chosenArea = [];
for (let i = 0; i < this.areaList.length; i++) { for (let i = 0; i < this.areaList.length; i++) {
if (this.areaMultiIndex[i] === 0) {
//
break;
}
chosenArea.push(this.areaList[i][this.areaMultiIndex[i]]); chosenArea.push(this.areaList[i][this.areaMultiIndex[i]]);
} }
this.chosenArea = chosenArea; 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(); this.searchTasks();
}, },
async regionColChange(e) { async regionColChange(e) {
let colObj = e.detail; let colObj = e.detail;
if (colObj.column == 0) { 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; subAreaList = subAreaList.data;
let subSubAreaList = []; let subSubAreaList = [];
if (subAreaList.length) { 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; 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.pop(); this.areaList.pop();
this.areaList.push(subAreaList); this.areaList.push(subAreaList);
@ -461,8 +529,15 @@
this.areaMultiIndex = [colObj.value, 0, 0]; this.areaMultiIndex = [colObj.value, 0, 0];
} else if (colObj.column == 1) { } 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; subAreaList = subAreaList.data;
//
if (subAreaList.length > 0) {
subAreaList.unshift({
areaName: '全部',
areaId: -1
});
}
this.areaList.pop(); this.areaList.pop();
this.areaList.push(subAreaList); this.areaList.push(subAreaList);
this.areaMultiIndex = [this.areaMultiIndex[0], colObj.value, 0]; this.areaMultiIndex = [this.areaMultiIndex[0], colObj.value, 0];

View File

@ -391,7 +391,8 @@
}, },
data() { data() {
return { return {
curUserInfo: null, curUserInfo: null,
hasJoinedTeam: false,
curCertifyInfo: null, curCertifyInfo: null,
servSpecialSkills: null, servSpecialSkills: null,
curStep: 0, curStep: 0,
@ -436,7 +437,8 @@
onShow() {}, onShow() {},
methods: { methods: {
async loadData() { async loadData() {
this.curUserInfo = this.$request.getCurUserInfo(); this.curUserInfo = this.$request.getCurUserInfo();
this.checkedHasJoinedTeam();
let res = await this.$request.getWorkerCertify(); let res = await this.$request.getWorkerCertify();
this.curCertifyInfo = res.data; this.curCertifyInfo = res.data;
if (this.curCertifyInfo && this.curCertifyInfo.workerCertificationId) { if (this.curCertifyInfo && this.curCertifyInfo.workerCertificationId) {
@ -454,6 +456,13 @@
this.loadAreaList(); this.loadAreaList();
this.loadSpecialSkillType(); 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() { async showForm() {
this.loadAreaList(); this.loadAreaList();
@ -733,7 +742,24 @@
/* 特殊技能 end */ /* 特殊技能 end */
validData() { validData() {
let teamParams = this.realNameInfo; 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) { if (teamParams.companySize == null || teamParams.companySize == undefined) {
errMsg = "请选择经营主体规模"; errMsg = "请选择经营主体规模";
} else if (!teamParams.brandName) { } else if (!teamParams.brandName) {
@ -746,20 +772,6 @@
errMsg = "请填写名字" errMsg = "请填写名字"
} else if (!teamParams.idCardNum) { } else if (!teamParams.idCardNum) {
errMsg = "请填写身份证号"; 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) { if (errMsg) {
uni.showToast({ uni.showToast({