Commit c0642abf authored by 李明环(东信)'s avatar 李明环(东信)

需求修改

parent c9d3e2ce
......@@ -77,6 +77,21 @@
</div>
</div>
</div>
<!-- 专业 -->
<div class="filter-item certificate">
<p class="title">学历要求</p>
<div class="filter-select">
<div
class="select-item"
:class="{ active: v.active }"
@click="onClickCertificate(v)"
v-for="(v, i) in certificateList"
:key="i"
>
{{ v.name }}
</div>
</div>
</div>
</div>
<div class="bottom-wrap">
<button class="cancel" @click="onCancel">取消</button>
......@@ -123,12 +138,15 @@ const onClickWorkYear = v => {
workYearList.value.forEach(v => (v.active = false));
v.active = true;
};
// 专业
const dictJobTypeList = ref([]);
const onClickMajor = v => {
dictJobTypeList.value.forEach(v => (v.active = false));
// 证书
const certificateList = ref([]);
const onClickCertificate = v => {
certificateList.value.forEach(v => (v.active = false));
v.active = true;
};
// 类型
// 证书
// positionalTitle professionalCertificates specialCertificates
// 初始化数据
const initData = async () => {
/* 初始化菜单 */
......@@ -136,8 +154,8 @@ const initData = async () => {
{ active: true, name: "学历", className: "education" },
{ active: false, name: "年龄", className: "age" },
{ active: false, name: "性别", className: "gender" },
{ active: false, name: "工作年限", className: "workYear" }
// { active: false, name: "专业", className: "major" }
{ active: false, name: "工作年限", className: "workYear" },
{ active: false, name: "证书", className: "certificate" }
];
/* 初始化数据 */
educationList.value = await getEumData("EnumEducationRequirement");
......@@ -174,11 +192,16 @@ const initData = async () => {
max: null
}
];
const dictJobType = await dictJobTypeApi({});
dictJobTypeList.value = dictJobType.data;
certificateList.value = [
{ active: false, name: "专业技术职称", key: "positionalTitle" },
{ active: false, name: "职业等级证书", key: "professionalCertificates" },
{ active: false, name: "特种作业证书", key: "specialCertificates" }
];
/* const dictJobType = await dictJobTypeApi({});
dictJobTypeList.value = dictJobType.data; */
};
initData();
/*
/*
接受两个方法
1. 确认 接收数据
2. 取消
......@@ -193,9 +216,12 @@ const onConfirm = () => {
const [minAge, maxAge] = age.value;
const { min: minWorkAge, max: maxWorkAge } = workYearList.value.find(v => v.active) || { min: 0, max: 100 };
const education = educationList.value.find(v => v.active)?.code;
const jobType = dictJobTypeList.value.find(v => v.active)?.id;
// const jobType = dictJobTypeList.value.find(v => v.active)?.id;
const sex = genderList.value.find(v => v.active)?.code;
emit("confirm", { minAge, maxAge, minWorkAge, maxWorkAge, education, jobType, sex });
const certificateKey = certificateList.value.find(v => v.active)?.key;
const temp = { minAge, maxAge, minWorkAge, maxWorkAge, education, jobType: "", sex };
certificateKey && (temp[certificateKey] = certificateKey);
emit("confirm", temp);
};
</script>
......
......@@ -303,7 +303,7 @@ getColumnsCity();
const handleConfirmCity = ({ value, selectedItems }) => {
const textIndex = _.compact(value).length - 1;
if (textIndex === -1) {
cityText.value = "全";
cityText.value = "全";
} else {
cityText.value = selectedItems[textIndex].name;
}
......
......@@ -122,7 +122,7 @@ const next = () => {
xma.hideKeyboard();
console.log(pinias.formData);
if (validateForm(pinias.formData, ["jobTypeId", "jobTypeName", "name", "positionDesc"])) {
if (validateForm(pinias.formData, ["jobTypeId", "jobTypeName", "name", "positionDesc"], "post")) {
uni.redirectTo({
url: "/pages/recommend/releasePostion/step2"
});
......
......@@ -51,7 +51,7 @@ const pinias = useReleasePostionStore();
const showTab = ref(true);
import { validateForm } from "@/utils/utils";
// 地区接口地址
const keys = ["district", "street"];
const keys = ["city", "district", "street"];
/* 获取省市区 */
const cityOpstion = ref([]);
const cityValue = ref([]);
......@@ -59,7 +59,7 @@ const cityValue = ref([]);
const cityText = ref("");
let citySelectedItems = [];
getAreaListApi({ type: "city", code: "52" }).then(res => {
getAreaListApi({ type: "province", code: "" }).then(res => {
cityOpstion.value.push(res.data);
});
const columnChangeCity = ({ selectedItem, resolve, index, finish }) => {
......@@ -99,9 +99,10 @@ const columnChangeCity = ({ selectedItem, resolve, finish }) => {
const handleConfirmCity = ({ selectedItems }) => {
cityText.value = selectedItems.map(v => v.name || "").join("-");
citySelectedItems = selectedItems;
const [city, district, street] = selectedItems;
const [province, city, district, street] = selectedItems;
pinias.formData.address = selectedItems.map(v => v.name || "").join("");
pinias.formData.provinceCode = 520000;
// pinias.formData.provinceCode = 520000;
pinias.formData.provinceCode = province.code;
pinias.formData.cityCode = city.code;
pinias.formData.cityName = district.name;
pinias.formData.districtCode = district.code;
......
......@@ -269,8 +269,8 @@ const columnChangeMajor = ({ selectedItem, resolve, finish }) => {
};
const handleConfirmMajor = ({ value }) => {
console.log(value);
majorText.value = value[0];
pinias.formData.majorRequirement = value[0];
majorText.value = value[1];
pinias.formData.majorRequirement = value[1];
};
const majorText = ref("");
getMajorTreeApi().then(res => {
......@@ -335,7 +335,7 @@ const next = () => {
if (certificateInputValue.value && certificateSelectValue.value)
pinias.formData.professionalCertificates = certificateInputValue.value + "-" + certificateSelectValue.value;
console.log(pinias.formData);
if (validateForm(pinias.formData, ["identityRequirement", "educationRequirement", "majorRequirement"])) {
if (validateForm(pinias.formData, ["identityRequirement", "educationRequirement", "majorRequirement"], "post")) {
uni.redirectTo({
url: "/pages/recommend/releasePostion/step5"
});
......
......@@ -89,7 +89,7 @@ const submit = () => {
uni.hideLoading();
});
} else {
if (validateForm(pinias.formData, ["contactPhone", "contactPerson"])) {
if (validateForm(pinias.formData, ["contactPhone", "contactPerson"], "post")) {
// 提交
createJobApi(pinias.formData)
.then(res => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment