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