需求大厅调整区域条件筛选;实名中子师傅可以不填公司信息;
This commit is contained in:
parent
7e0d673551
commit
8c9082e503
|
|
@ -27,7 +27,7 @@
|
|||
:value="areaMultiIndex" :range-key="'areaName'" :range="areaList">
|
||||
<view class="flex justify-start">
|
||||
<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>
|
||||
<text class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
||||
</view>
|
||||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -392,6 +392,7 @@
|
|||
data() {
|
||||
return {
|
||||
curUserInfo: null,
|
||||
hasJoinedTeam: false,
|
||||
curCertifyInfo: null,
|
||||
servSpecialSkills: null,
|
||||
curStep: 0,
|
||||
|
|
@ -437,6 +438,7 @@
|
|||
methods: {
|
||||
async loadData() {
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
this.checkedHasJoinedTeam();
|
||||
let res = await this.$request.getWorkerCertify();
|
||||
this.curCertifyInfo = res.data;
|
||||
if (this.curCertifyInfo && this.curCertifyInfo.workerCertificationId) {
|
||||
|
|
@ -455,6 +457,13 @@
|
|||
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();
|
||||
this.loadSpecialSkillType();
|
||||
|
|
@ -734,19 +743,8 @@
|
|||
validData() {
|
||||
let teamParams = this.realNameInfo;
|
||||
let errMsg = null;
|
||||
if (teamParams.companySize == null || teamParams.companySize == undefined) {
|
||||
errMsg = "请选择经营主体规模";
|
||||
} else if (!teamParams.brandName) {
|
||||
errMsg = "请填写品牌名称"
|
||||
} else if (!teamParams.idCardImgList || !teamParams.idCardImgList.length) {
|
||||
errMsg = "请上传身份证照片"
|
||||
} else if (!teamParams.surname) {
|
||||
errMsg = "请填写姓氏"
|
||||
} else if (!teamParams.name) {
|
||||
errMsg = "请填写名字"
|
||||
} else if (!teamParams.idCardNum) {
|
||||
errMsg = "请填写身份证号";
|
||||
} else if (!teamParams.licenseImgList || !teamParams.licenseImgList.length) {
|
||||
if (!this.hasJoinedTeam) {
|
||||
if (!teamParams.licenseImgList || !teamParams.licenseImgList.length) {
|
||||
errMsg = "请上传公司营业执照";
|
||||
} else if (!teamParams.companyName) {
|
||||
errMsg = "请填写公司名称";
|
||||
|
|
@ -761,6 +759,20 @@
|
|||
} else if (!teamParams.legalPersionPhoneNum) {
|
||||
errMsg = "请填写法人联系电话";
|
||||
}
|
||||
}
|
||||
if (teamParams.companySize == null || teamParams.companySize == undefined) {
|
||||
errMsg = "请选择经营主体规模";
|
||||
} else if (!teamParams.brandName) {
|
||||
errMsg = "请填写品牌名称"
|
||||
} else if (!teamParams.idCardImgList || !teamParams.idCardImgList.length) {
|
||||
errMsg = "请上传身份证照片"
|
||||
} else if (!teamParams.surname) {
|
||||
errMsg = "请填写姓氏"
|
||||
} else if (!teamParams.name) {
|
||||
errMsg = "请填写名字"
|
||||
} else if (!teamParams.idCardNum) {
|
||||
errMsg = "请填写身份证号";
|
||||
}
|
||||
if (errMsg) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
|
|
|
|||
Loading…
Reference in New Issue