1

parent 553154e9
......@@ -42,18 +42,20 @@
<wd-col-picker
v-model="cityValue"
:columns="cityOpstion"
:disabled="![1].includes(pageStatus)"
value-key="value"
label-key="label"
auto-complete
custom-value-class="value-class"
style="width: 100%"
value-key="code"
label-key="name"
:column-change="columnChangeCity"
@confirm="handleConfirmCity"
use-default-slot
>
<p style="width: 100%; color: #77818f">
{{ cityText || "请选择岗位工作地点" }}
</p>
</wd-col-picker>
</formItem>
<formItem title="详细地址" icon="">
<p style="color: #77818f">{{ params.location || "请选择公司所在地" }}</p>
<formItem title="注册地址" icon="">
<p style="color: #77818f">{{ params.location || "请选择公司注册地址" }}</p>
</formItem>
<div class="textarea-wrap" v-if="[1].includes(pageStatus)">
<p class="label">公司介绍</p>
......@@ -78,7 +80,7 @@
import { reactive, ref } from "vue";
import formItem from "./formItem.vue";
import { getCompanyInfoApi, saveCompanyInfoApi, companyReviewInfo } from "@/api/user";
import { getTreeListApi, getDictDataApi } from "@/api/common";
import { getAreaListApi, getDictDataApi } from "@/api/common";
import { uploadFiles } from "@/utils/fileUpload";
import { getEnumText } from "@/utils/utils";
import evn from "@/utils/config";
......@@ -111,10 +113,10 @@ const jupmLicenseInfo = () => {
};
onLoad(async ({ status }) => {
pageStatus.value = status * 1;
// await getTreeListApi().then(res => {
// // cityOpstion.value.push(res.data);
// });
getAreaListApi({ type: "province", code: "" }).then(res => {
res.data.unshift({ name: "不限", code: null });
cityOpstion.value.push(res.data);
});
await getDictDataApi(["EnumIndustryCategory"]).then(res => {
columns.value = res.data.EnumIndustryCategory;
});
......@@ -146,17 +148,17 @@ function getCompanyInfoApiFn() {
creditCode,
cityCode,
districtCode,
provinceCode
provinceCode,
address
} = res.data;
params.companyName = name;
params.introduction = introduction;
params.logoPath = logoPath;
params.creditCode = creditCode;
await sleep();
if (provinceCode) {
cityValue.value = [provinceCode, cityCode, districtCode];
}
cityText.value = [provinceName, cityName, districtName].join("-");
cityText.value = address;
// 审核状态
auditStatus.value = await getEnumText("EnumReviewStatus", res.data.status);
});
......@@ -180,18 +182,17 @@ function companyReviewInfoFn() {
provinceCode,
cityCode,
districtCode,
companyName
companyName,
address
} = res.data;
cityText.value = location;
params.companyName = companyName;
params.introduction = introduction;
params.logoPath = logoPath;
cityText.value = address;
params.creditCode = creditCode;
await sleep();
if (provinceCode) {
cityValue.value = [provinceCode, cityCode, districtCode];
}
cityText.value = [provinceName, cityName, districtName].join("-");
// 审核状态
auditStatus.value = await getEnumText("EnumReviewStatus", res.data.status);
console.log("auditStatus", auditStatus);
......@@ -199,14 +200,7 @@ function companyReviewInfoFn() {
}
function handleConfirm() {}
/* 获取省市区 */
const cityOpstion = ref([
colPickerData.map(item => {
return {
value: item.value,
label: item.text
};
})
]);
const cityOpstion = ref([]);
const columns = ref([]);
const cityValue = ref([]);
......@@ -219,34 +213,37 @@ function sleep(second = 1) {
}, 1000 * second);
});
}
const columnChangeCity = async ({ selectedItem, resolve, finish }) => {
await sleep(0.3);
const areaData = findChildrenByCode(colPickerData, selectedItem.value);
if (areaData && areaData.length) {
resolve(
areaData.map(item => {
return {
value: item.value,
label: item.text
};
})
);
const keys = ["city", "district"];
const columnChangeCity = ({ selectedItem, resolve, index, finish }) => {
const type = keys[index];
if (type && selectedItem.code) {
getAreaListApi({ type, code: selectedItem.code }).then(res => {
res.data.unshift({ name: "不限", code: null });
resolve(res.data);
});
} else {
finish();
}
};
const handleConfirmCity = ({ selectedItems }) => {
cityText.value = selectedItems.map(v => v.name).join("-");
citySelectedItems = selectedItems;
const [province, city, district] = selectedItems;
params.provinceCode = province.value;
params.provinceName = province.label;
params.cityCode = city.value;
params.cityName = city.label;
params.districtCode = district.value;
params.districtName = district.label;
params.address = selectedItems.map(v => v.label).join("-");
// params.location = selectedItems.map(v => v.name).join("-");
const [province, city, district, street] = selectedItems;
cityText.value = selectedItems
.filter(v => v.code)
.map(v => v.name || "")
.join("-");
params.address = selectedItems
.filter(v => v.code)
.map(v => v.name || "")
.join("-");
if (!province.code) {
cityText.value = "不限";
params.address = "不限";
}
params.provinceCode = province.code;
params.cityCode = city?.code;
params.cityName = district?.name;
params.districtCode = district?.code;
params.street = street ? street.name : "";
};
/* 选择图片 */
const chooseImage = sourceType => {
......
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