Commit 199d91ea authored by 李明环(东信)'s avatar 李明环(东信)
parents a8ff795e 4a87c057
...@@ -9,10 +9,10 @@ export const xinhuaMpLogin = params => instance.post("/user/appUser/xinhua/mpLog ...@@ -9,10 +9,10 @@ export const xinhuaMpLogin = params => instance.post("/user/appUser/xinhua/mpLog
// B端-获取登录用户 // B端-获取登录用户
export const getLoginUserApi = params => instance.post("/b/user/getLoginUser", params); export const getLoginUserApi = params => instance.post("/b/user/getLoginUser", params);
// 保存用户信息 // 保存用户信息
export const saveBasicInfoApi = params => instance.post("/company/user/saveBasicInfo", params); export const saveBasicInfoApi = params => instance.post("/b/user/save", params);
// 注册企业信息 // 注册企业信息
export const registerCompanyApi = params => instance.post("/company/register", params); export const registerCompanyApi = params => instance.post("/b/company/register", params);
// 重新注册企业信息 // 重新注册企业信息
export const resubmitCompanyApi = params => instance.post("/company/register/resubmit", params); export const resubmitCompanyApi = params => instance.post("/company/register/resubmit", params);
...@@ -25,7 +25,7 @@ export const getApplicationListApi = params => instance.post("/job/getApplicatio ...@@ -25,7 +25,7 @@ export const getApplicationListApi = params => instance.post("/job/getApplicatio
export const getInterviewListApi = params => instance.post("/job/getInterviewList", params); export const getInterviewListApi = params => instance.post("/job/getInterviewList", params);
// 获取公司信息及审核信息 // 获取公司信息及审核信息
export const getCompanyInfoApi = params => instance.post("/company/get", params); export const getCompanyInfoApi = params => instance.post("/b/company/info", params);
// 保存企业信息 // 保存企业信息
export const saveCompanyInfoApi = params => instance.post("/company/save", params); export const saveCompanyInfoApi = params => instance.post("/company/save", params);
//企业申诉 //企业申诉
...@@ -42,6 +42,10 @@ export const appealInfo = params => instance.post("/company/appeal/info", params ...@@ -42,6 +42,10 @@ export const appealInfo = params => instance.post("/company/appeal/info", params
//营业执照ocr //营业执照ocr
export const ocrLicense = params => instance.postForm("/ocr/license", params); export const ocrLicense = params => instance.postForm("/ocr/license", params);
//检查企业是否存在
export const companyCheck = params => instance.post("/b/company/check", params);
//获取用户审核或申诉信息
export const companyReviewInfo = params => instance.post("/b/company/review/info", params);
//根据id获取反馈信息 //根据id获取反馈信息
export const feedbackById = params => instance.post(`/feedback/${params}`); export const feedbackById = params => instance.post(`/feedback/${params}`);
...@@ -23,20 +23,27 @@ const login = async () => { ...@@ -23,20 +23,27 @@ const login = async () => {
setToken(loginRes.data); setToken(loginRes.data);
const userInfoRes = await getLoginUserApi(); const userInfoRes = await getLoginUserApi();
// 已经判断是否注册过企业 // 已经判断是否注册过企业
if (userInfoRes.data) { if (userInfoRes.data) {
uni.switchTab({ const { status } = userInfoRes.data;
url: "/pages/user/index" console.log("status", typeof status);
});
switch (status) {
case 0:
uni.navigateTo({
url: `/pages/user/businessLicense/fillIn`
});
break;
default:
uni.switchTab({
url: "/pages/user/index"
});
break;
}
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: "/pages/user/businessLicense/fillIn" url: `/pages/user/businessLicense/fillIn`
}); });
} }
} else {
uni.showToast({
title: loginRes.message
});
} }
}; };
</script> </script>
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<div class="item"> <div class="item">
<p class="label">姓名<text class="red">*</text></p> <p class="label">姓名<text class="red">*</text></p>
<input type="text" v-model="params.realName" placeholder="请输入姓名" /> <input type="text" v-model="params.name" placeholder="请输入姓名" />
</div> </div>
<div class="item"> <div class="item">
<p class="label">职位<text class="red">*</text></p> <p class="label">职位<text class="red">*</text></p>
...@@ -97,52 +97,77 @@ ...@@ -97,52 +97,77 @@
import { ref } from "vue"; import { ref } from "vue";
import evn from "@/utils/config"; import evn from "@/utils/config";
import { uploadFiles } from "@/utils/fileUpload"; import { uploadFiles } from "@/utils/fileUpload";
import { ocrLicense, getLoginUserApi } from "@/api/user.js"; import { validateForm } from "@/utils/utils";
import { ocrLicense, getLoginUserApi, saveBasicInfoApi } from "@/api/user.js";
import { useDefineStore } from "./store"; import { useDefineStore } from "./store";
const pinias = useDefineStore(); const pinias = useDefineStore();
const params = reactive({ const params = reactive({
avatarPath: "", avatarPath: "",
realName: "", name: "",
phone: "", phone: "",
position: "" position: ""
}); });
onLoad(() => { onLoad(() => {
console.log(uni); console.log(uni);
}); });
const step = ref(0); const step = ref(1);
const name = ref(""); const name = ref("");
const showPopout = ref(true); const showPopout = ref(false);
onShow(() => { onShow(() => {
step.value = 0; step.value = 1;
// getLoginUserApiFn(); getLoginUserApiFn();
}); });
function ocrLicenseFn(uri) { function ocrLicenseFn(uri) {
return ocrLicense({ uri }).then(res => { return ocrLicense({ uri }).then(res => {
if (res.code == 200) { if (res.code == 200) {
pinias.setFormDataKey("name", res.data.name); pinias.setFormDataKey("name", res.data.name);
pinias.setFormDataKey("creditCode", res.data.regNum); pinias.setFormDataKey("creditCode", res.data.regNum);
pinias.setFormDataKey("location", res.data.address);
}
});
}
function getLoginUserApiFn() {
getLoginUserApi().then(user => {
if (user.code == 200 && user.data) {
const { avatarPath, name, phone, position } = user.data;
params.avatarPath = avatarPath;
params.name = name;
params.phone = phone;
params.position = position;
if (name) {
step.value = 3;
}
} }
}); });
} }
// function getLoginUserApiFn() { /**
// getLoginUserApi().then(user => { * 保存用户信息
// if (user.code == 200) { */
// const { avatarPath, realName, phone, position } = user.data; function saveBasicInfoApiFn() {
// params.avatarPath = avatarPath; xma.showLoading({
// params.realName = realName; title: "提交中...",
// params.phone = phone; mask: true
// params.position = position; });
// } if (validateForm(params, ["avatarPath", "name", "phone", "position"])) {
// console.log("user", user); return saveBasicInfoApi(params).then(res => {
// }); xma.hideLoading();
// } if (res.code == 200) {
step.value = 3;
return false;
} else {
return true;
}
});
} else {
return true;
}
}
const nextStep = () => { const nextStep = () => {
let flag = false; let flag = false;
switch (step.value) { switch (step.value) {
case 1: case 1:
if (!pinias.formData.name) flag = true; flag = saveBasicInfoApiFn();
break; break;
case 2: case 2:
if (!pinias.formData.creditCode) flag = true; if (!pinias.formData.creditCode) flag = true;
...@@ -162,7 +187,6 @@ const nextStep = () => { ...@@ -162,7 +187,6 @@ const nextStep = () => {
}); });
return; return;
} }
step.value++;
}; };
/* 选择图片 */ /* 选择图片 */
const chooseImage = sourceType => { const chooseImage = sourceType => {
...@@ -171,9 +195,13 @@ const chooseImage = sourceType => { ...@@ -171,9 +195,13 @@ const chooseImage = sourceType => {
count: 1, count: 1,
success: async ({ tempFiles }) => { success: async ({ tempFiles }) => {
const res = await uploadFiles(tempFiles); const res = await uploadFiles(tempFiles);
pinias.setFormDataKey("licensePath", res[0].key); if (step.value == 1) {
ocrLicenseFn(res[0].key); params.avatarPath = res[0].key;
showPopout.value = false; } else {
pinias.setFormDataKey("licensePath", res[0].key);
ocrLicenseFn(res[0].key);
showPopout.value = false;
}
} }
}); });
}; };
......
...@@ -6,6 +6,7 @@ export const useDefineStore = defineStore("useDefineStore", ()=>{ ...@@ -6,6 +6,7 @@ export const useDefineStore = defineStore("useDefineStore", ()=>{
name: "", name: "",
creditCode: "", creditCode: "",
licensePath: "", licensePath: "",
location:"",
licenseValidityPeriod: "" licenseValidityPeriod: ""
}) })
function setFormDataKey(key, data) { function setFormDataKey(key, data) {
......
...@@ -2,22 +2,46 @@ ...@@ -2,22 +2,46 @@
<div class="page"> <div class="page">
<NavBar backgroundBox="#FFFFFF" :showIcon="true" :showTitle="true" title="企业信息"></NavBar> <NavBar backgroundBox="#FFFFFF" :showIcon="true" :showTitle="true" title="企业信息"></NavBar>
<view class="image-wrap"> <view class="image-wrap">
<image v-if="formData.licensePath" :src="evn.APP_IMAGE_BASE_API + formData.licensePath" mode="" /> <image v-if="pinias.formData.licensePath" :src="evn.APP_IMAGE_BASE_API + pinias.formData.licensePath" mode="" />
<view>注:接受拍摄复印件,黑白复印需要加盖公章,大小不超过10M</view> <view>注:接受拍摄复印件,黑白复印需要加盖公章,大小不超过10M</view>
</view> </view>
<view class="content-wrap"> <view class="content-wrap">
<view class="item"> <view class="item">
<view class="label"> 企业全称 </view> <view class="label"> 企业全称 </view>
<view class="content"> <view class="content">
{{ formData.name }} {{ pinias.formData.name }}
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="label"> 信用代码 </view> <view class="label"> 信用代码 </view>
<view class="content"> <view class="content">
{{ formData.creditCode }} {{ pinias.formData.creditCode }}
</view> </view>
</view> </view>
<view class="item">
<view class="label"> 公司地址 </view>
<view class="content">
{{ pinias.formData.location }}
</view>
</view>
<view class="item">
<view class="label"> 是否人资机构 </view>
<view class="content">
<wd-radio-group v-model="pinias.formData.licenseValidityPeriod" shape="dot" inline>
<wd-radio value="true"></wd-radio>
<wd-radio value=""></wd-radio>
</wd-radio-group>
</view>
</view>
<view class="image-upload">
<image
v-if="pinias.formData.licenseValidityPeriod"
@click="chooseImage('album')"
src="@/static/image/businessLicense/businessLicenseUpload2.png"
mode=""
/>
<image v-else :src="evn.APP_IMAGE_BASE_API + pinias.formData.licenseValidityPeriod" mode="" />
</view>
<!-- <view class="item"> <!-- <view class="item">
<view class="label"> 有效期 </view> <view class="label"> 有效期 </view>
<view class="content"> <view class="content">
...@@ -30,7 +54,7 @@ ...@@ -30,7 +54,7 @@
<view class="item"> <view class="item">
<view class="label"> 日期 </view> <view class="label"> 日期 </view>
<wd-calendar <wd-calendar
v-model="formData.licenseValidityPeriod" v-model="pinias.formData.licenseValidityPeriod"
:disabled="radio == 1" :disabled="radio == 1"
:min-date="new Date().getTime()" :min-date="new Date().getTime()"
:max-date="new Date('2059/01/01').getTime()" :max-date="new Date('2059/01/01').getTime()"
...@@ -38,17 +62,22 @@ ...@@ -38,17 +62,22 @@
> >
<view :class="`content ${radio == 1 ? 'disabled' : ''}`"> <view :class="`content ${radio == 1 ? 'disabled' : ''}`">
{{ {{
(formData.licenseValidityPeriod && dayjs(formData.licenseValidityPeriod).format("YYYY-MM-DD")) || (pinias.formData.licenseValidityPeriod && dayjs(pinias.formData.licenseValidityPeriod).format("YYYY-MM-DD")) ||
"请选择" "请选择"
}} }}
</view> </view>
</wd-calendar> </wd-calendar>
</view> --> </view> -->
</view> </view>
<wd-tabbar
<view class="btn-wrap"> @tap="submit"
<button class="bottom-btn" @tap="submit">提交</button> custom-style="display: flex;justify-content: center !important;z-index:1;"
</view> fixed
placeholder
safeAreaInsetBottom
>
<view class="foot-btn">提交审核</view>
</wd-tabbar>
<!-- 申请错误 --> <!-- 申请错误 -->
<!-- <van-popup show="{{ showSubmitError }}" custom-style="border-radius:12rpx"> <!-- <van-popup show="{{ showSubmitError }}" custom-style="border-radius:12rpx">
...@@ -90,11 +119,11 @@ ...@@ -90,11 +119,11 @@
import evn from "@/utils/config"; import evn from "@/utils/config";
import { useDefineStore } from "./store"; import { useDefineStore } from "./store";
import { ref } from "vue"; import { ref } from "vue";
import dayjs from "dayjs"; import { registerCompanyApi, companyCheck } from "@/api/user";
import { registerCompanyApi } from "@/api/user";
const { formData, setFormDataKey } = useDefineStore(); const pinias = useDefineStore();
const show = ref(false); const show = ref(false);
// console.log(formData); // console.log(pinias.formData);
const id = ref(""); const id = ref("");
const name = ref(""); const name = ref("");
const radio = ref(1); const radio = ref(1);
...@@ -103,35 +132,43 @@ const navigateTo = url => { ...@@ -103,35 +132,43 @@ const navigateTo = url => {
url url
}); });
}; };
/* 选择图片 */
const chooseImage = sourceType => {
uni.chooseImage({
sourceType: [sourceType],
count: 1,
success: async ({ tempFiles }) => {
const res = await uploadFiles(tempFiles);
pinias.setFormDataKey("licenseValidityPeriod", res[0].key);
}
});
};
const submit = () => { const submit = () => {
const params = { ...formData }; const params = { ...pinias.formData };
if (radio.value == 1) { const { name, creditCode } = pinias.formData;
params.licenseValidityPeriod = "2099-12-31"; companyCheck({ name, creditCode }).then(company => {
} if (company.code == 200) {
registerCompanyApi(params).then(res => { if (!company.data) {
if (res.code == 200) { xma.showLoading({
// 被占用 title: "提交中...",
if (res.data) { mask: true
name.value = res.data.name;
id.value = res.data.id;
show.value = true;
} else {
// 正常
uni.showToast({
title: "提交成功",
icon: "none"
}); });
uni.switchTab({ registerCompanyApi(params).then(res => {
url: "/pages/user/index" xma.hideLoading();
if (res.code == 200) {
uni.switchTab({
url: "/pages/user/index"
});
}
}); });
} else {
show.value = true;
id.value = company.data.id;
name.value = company.data.name;
} }
} else {
uni.showToast({
title: res.message,
icon: "error"
});
} }
}); });
return;
}; };
</script> </script>
...@@ -139,7 +176,6 @@ const submit = () => { ...@@ -139,7 +176,6 @@ const submit = () => {
.page { .page {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%;
} }
.image-wrap { .image-wrap {
padding: 32rpx; padding: 32rpx;
...@@ -163,6 +199,7 @@ const submit = () => { ...@@ -163,6 +199,7 @@ const submit = () => {
display: flex; display: flex;
padding: 32rpx 0; padding: 32rpx 0;
border-bottom: 2rpx solid #f3f4f8; border-bottom: 2rpx solid #f3f4f8;
align-items: center;
.label { .label {
flex: 0 0 184rpx; flex: 0 0 184rpx;
font-size: 24rpx; font-size: 24rpx;
...@@ -175,6 +212,7 @@ const submit = () => { ...@@ -175,6 +212,7 @@ const submit = () => {
color: #1b2026; color: #1b2026;
.van-radio-group { .van-radio-group {
display: flex; display: flex;
align-items: center;
gap: 30rpx; gap: 30rpx;
} }
} }
...@@ -182,6 +220,27 @@ const submit = () => { ...@@ -182,6 +220,27 @@ const submit = () => {
color: #cccccc; color: #cccccc;
} }
} }
.image-upload {
.t2 {
margin-top: 16rpx;
}
image {
width: 686rpx;
height: 386rpx;
margin-top: 84rpx;
}
}
}
.foot-btn {
position: fixed;
display: flex;
align-items: center;
justify-content: center;
width: 622rpx;
height: 80rpx;
color: #ffffff;
background: #1f86ff;
border-radius: 12rpx;
} }
.btn-wrap { .btn-wrap {
padding: 16rpx 0; padding: 16rpx 0;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</div> </div>
<div class="item"> <div class="item">
<p class="label">姓名</p> <p class="label">姓名</p>
<input type="text" v-model="params.realName" placeholder="请输入姓名" /> <input type="text" v-model="params.name" placeholder="请输入姓名" />
</div> </div>
<div class="item"> <div class="item">
<p class="label">职位</p> <p class="label">职位</p>
...@@ -41,7 +41,7 @@ import { uploadFiles } from "@/utils/fileUpload"; ...@@ -41,7 +41,7 @@ import { uploadFiles } from "@/utils/fileUpload";
import { saveBasicInfoApi, getLoginUserApi } from "@/api/user"; import { saveBasicInfoApi, getLoginUserApi } from "@/api/user";
const params = reactive({ const params = reactive({
avatarPath: "", avatarPath: "",
realName: "", name: "",
phone: "", phone: "",
position: "" position: ""
}); });
...@@ -49,9 +49,9 @@ const params = reactive({ ...@@ -49,9 +49,9 @@ const params = reactive({
getLoginUserApi().then(res => { getLoginUserApi().then(res => {
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
const { avatarPath, realName, phone, position } = res.data; const { avatarPath, name, phone, position } = res.data;
params.avatarPath = avatarPath; params.avatarPath = avatarPath;
params.realName = realName; params.name = name;
params.phone = phone; params.phone = phone;
params.position = position; params.position = position;
} }
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<script setup> <script setup>
import navBar from "@/components/navBar/index.vue"; import navBar from "@/components/navBar/index.vue";
import { getLoginUserApi, getCompanyInfoApi, appealInfo } from "@/api/user"; import { getLoginUserApi, getCompanyInfoApi, appealInfo, companyReviewInfo } from "@/api/user";
import { getEnumText } from "@/utils/utils"; import { getEnumText } from "@/utils/utils";
import { ref, reactive } from "vue"; import { ref, reactive } from "vue";
import evn from "@/utils/config.js"; import evn from "@/utils/config.js";
...@@ -129,6 +129,17 @@ const appealInfoFn = () => { ...@@ -129,6 +129,17 @@ const appealInfoFn = () => {
} }
}); });
}; };
const companyReviewInfoFn = () => {
companyReviewInfo().then(res => {
if (res.data.status == 2) {
navList[0].url = "/pages/user/myCompany/index?status=3";
navList[0].subText = "审核不通过";
} else if (res.data.status == 0) {
navList[0].subText = res.data.companyName;
navList[0].url = "/pages/user/myCompany/index";
}
});
};
/* 获取用户信息 */ /* 获取用户信息 */
const getUserInfo = async () => { const getUserInfo = async () => {
const userRes = await getLoginUserApi(); const userRes = await getLoginUserApi();
...@@ -139,31 +150,57 @@ const getUserInfo = async () => { ...@@ -139,31 +150,57 @@ const getUserInfo = async () => {
id.value = userRes.data.companyId; id.value = userRes.data.companyId;
} }
const { status } = userRes.data; const { status } = userRes.data;
if (status !== 1) { switch (status) {
uni.hideTabBar(); case 1:
if (status == 2) { navList[0].subText = userRes.data.companyName;
// 代表添加了申述信息,需要查看申述状态,调用申诉信息接口 avList[0].url = "/pages/user/myCompany/index?status=1";
appealInfoFn(); break;
} else if (status == 3) { case 2:
navList[0].subText = "审核中";
navList[0].url = "/pages/user/myCompany/index?status=2";
companyReviewInfoFn();
break;
case 3:
navList[0].subText = "申诉中";
navList[0].url = "/pages/user/businessLicense/appeal";
companyReviewInfoFn();
break;
case 4:
navList[0].subText = "企业信息失效";
show.value = true; show.value = true;
// 代表账号所关联的企业被申述解除关联 break;
} case 5:
} // 账号长时间未登录 弹窗申诉
if (status == 1 || status == 4) { show.value = true;
show.value = false; break;
const companyRes = await getCompanyInfoApi(); default:
if (companyRes.code == 200) { break;
let type = companyRes.data.companyAudit.status;
if (type != 1) {
navList[0].subText = await getEnumText("EnumAuditStatus", type);
navList[0].url = "/pages/user/myCompany/index";
navList[0].auditStatus = type;
uni.hideTabBar();
} else {
uni.showTabBar();
}
}
} }
// if (status !== 1) {
// uni.hideTabBar();
// if (status == 2) {
// // 代表添加了申述信息,需要查看申述状态,调用申诉信息接口
// appealInfoFn();
// } else if (status == 3) {
// show.value = true;
// // 代表账号所关联的企业被申述解除关联
// }
// }
// if (status == 1 || status == 4) {
// show.value = false;
// const companyRes = await getCompanyInfoApi();
// if (companyRes.code == 200) {
// let type = companyRes.data.companyAudit.status;
// if (type != 1) {
// navList[0].subText = await getEnumText("EnumAuditStatus", type);
// navList[0].url = "/pages/user/myCompany/index";
// navList[0].auditStatus = type;
// uni.hideTabBar();
// } else {
// uni.showTabBar();
// }
// }
// }
}; };
onShow(() => { onShow(() => {
getUserInfo(); getUserInfo();
......
...@@ -34,6 +34,7 @@ const { title, border, arrow } = defineProps({ ...@@ -34,6 +34,7 @@ const { title, border, arrow } = defineProps({
.form-title { .form-title {
width: 200rpx; width: 200rpx;
font-size: 24rpx; font-size: 24rpx;
text-wrap: nowrap;
font-weight: normal; font-weight: normal;
color: #77818f; color: #77818f;
} }
......
...@@ -5,43 +5,48 @@ ...@@ -5,43 +5,48 @@
<div class="top"> <div class="top">
<img v-if="params.logoPath" :src="evn.APP_IMAGE_BASE_API + params.logoPath" @click="chooseImage" /> <img v-if="params.logoPath" :src="evn.APP_IMAGE_BASE_API + params.logoPath" @click="chooseImage" />
<img v-else src="@/static/image/temp/defaultCompany.png" alt="" @click="chooseImage" /> <img v-else src="@/static/image/temp/defaultCompany.png" alt="" @click="chooseImage" />
<div class="name">{{ companyInfo.name }}</div> <div class="name">{{ companyInfo.companyName }}</div>
<formItem style="margin-top: 80rpx" title="营业执照" arrow :border="false" @click="jupmLicenseInfo"> <formItem style="margin-top: 80rpx" title="营业执照" arrow :border="false" @click="jupmLicenseInfo">
<p :class="`status${companyInfo.companyAudit?.status}`">{{ auditStatus }}</p> <p :class="`status${companyInfo.companyAudit?.status}`">{{ auditStatus }}</p>
</formItem> </formItem>
</div> </div>
<div class="form-wrap"> <div class="form-wrap">
<formItem title="企业简称"> <!-- <formItem title="企业名称">
<input type="text" v-model="params.nameAbbreviation" placeholder="请输入企业简称" /> <input type="text" v-model="params.companyName" placeholder="请输入企业名称" />
</formItem> -->
<formItem title="行业分类" v-if="[1].includes(pageStatus)">
<p style="color: #77818f">{{ companyInfo.industryCategory }}</p>
</formItem>
<formItem title="信用代码">
<p style="color: #77818f">{{ companyInfo.creditCode }}</p>
</formItem> </formItem>
<formItem title="公司所在地" arrow> <formItem title="公司地址" arrow>
<wd-col-picker <wd-col-picker
v-model="cityValue" v-model="cityValue"
:columns="cityOpstion" :columns="cityOpstion"
:disabled="![1, 3].includes(pageStatus)"
value-key="code" value-key="code"
label-key="name" label-key="name"
:column-change="columnChangeCity" :column-change="columnChangeCity"
@confirm="handleConfirmCity" @confirm="handleConfirmCity"
use-default-slot use-default-slot
> >
<p :class="{ placeholder: !cityText }" class="text-single">{{ cityText || "请选择公司所在地" }}</p> <p :class="{ placeholder: !params.location }" class="text-single">
{{ params.location || "请选择公司所在地" }}
</p>
</wd-col-picker> </wd-col-picker>
</formItem> </formItem>
<formItem title="行业分类"> <div class="textarea-wrap" v-if="[1].includes(pageStatus)">
<p style="color: #77818f">{{ companyInfo.industryCategory }}</p>
</formItem>
<formItem title="详细地址">
<input type="text" placeholder="请输入详细地址" v-model="params.address" />
</formItem>
<div class="textarea-wrap">
<p class="label">公司介绍</p> <p class="label">公司介绍</p>
<textarea maxlength="500" placeholder="请输入公司介绍" v-model="params.companyIntro" /> <textarea maxlength="500" placeholder="请输入公司介绍" v-model="params.companyIntro" />
</div> </div>
</div> </div>
</div> </div>
<wd-tabbar <wd-tabbar
v-if="[1, 3].includes(pageStatus)"
@click="submit" @click="submit"
custom-style="display: flex;justify-content: center !important;" custom-style="display: flex;justify-content: center !important;z-index:1;"
fixed fixed
placeholder placeholder
safeAreaInsetBottom safeAreaInsetBottom
...@@ -54,50 +59,72 @@ ...@@ -54,50 +59,72 @@
<script setup> <script setup>
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import formItem from "./formItem.vue"; import formItem from "./formItem.vue";
import { getCompanyInfoApi, saveCompanyInfoApi } from "@/api/user"; import { getCompanyInfoApi, saveCompanyInfoApi, companyReviewInfo } from "@/api/user";
import { getTreeListApi } from "@/api/common"; import { getTreeListApi } 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";
import { useCompanyInfoStore } from "./companyInfo";
const params = reactive({ const params = reactive({
id: 0, id: 0,
logoPath: "", logoPath: "",
nameAbbreviation: "", companyName: "",
provinceCode: "", provinceCode: "",
provinceName: "", provinceName: "",
cityCode: "", cityCode: "",
cityName: "", cityName: "",
districtCode: "", districtCode: "",
districtName: "", districtName: "",
address: "", creditCode: "",
location: "",
companyIntro: "" companyIntro: ""
}); });
const pageStatus = ref(1);
/* 调整到审核信息 */ /* 调整到审核信息 */
const jupmLicenseInfo = () => { const jupmLicenseInfo = () => {
uni.navigateTo({ if (pageStatus.value == 1 || pageStatus.value == 2 || pageStatus.value == 3) {
url: "/pages/user/myCompany/licenseInfo" uni.navigateTo({
}); url: `/pages/user/myCompany/licenseInfo?status=${pageStatus.value}`
});
}
}; };
onLoad(({ status }) => {
pageStatus.value = status * 1;
if (status == 1) {
getCompanyInfoApiFn();
} else {
companyReviewInfoFn();
}
});
/* 审核状态文字 */ /* 审核状态文字 */
const auditStatus = ref(""); const auditStatus = ref("");
/* 获取公司信息 */ /* 获取公司信息 */
const companyInfo = ref({}); const companyInfo = ref({});
getCompanyInfoApi().then(async res => { function getCompanyInfoApiFn() {
const { setCompanyInfoValue } = useCompanyInfoStore(); getCompanyInfoApi().then(async res => {
companyInfo.value = res.data;
Object.keys(params).forEach(key => {
params[key] = res.data[key];
});
const { provinceName, cityName, districtName } = res.data;
companyInfo.value = res.data; cityText.value = [provinceName, cityName, districtName].join("-");
Object.keys(params).forEach(key => { // 审核状态
params[key] = res.data[key]; auditStatus.value = await getEnumText("EnumAuditStatus", res.data.companyAudit.status);
}); });
const { provinceName, cityName, districtName } = res.data; }
function companyReviewInfoFn() {
cityText.value = [provinceName, cityName, districtName].join("-"); companyReviewInfo().then(async res => {
// 审核状态 companyInfo.value = res.data;
auditStatus.value = await getEnumText("EnumAuditStatus", res.data.companyAudit.status); Object.keys(params).forEach(key => {
setCompanyInfoValue(res.data); params[key] = res.data[key];
}); });
cityText.value = res.data.location;
// 审核状态
auditStatus.value = await getEnumText("EnumAuditStatus", res.data.status);
});
}
/* 获取省市区 */ /* 获取省市区 */
const cityOpstion = ref([]); const cityOpstion = ref([]);
const cityValue = ref([]); const cityValue = ref([]);
...@@ -118,13 +145,14 @@ const handleConfirmCity = ({ selectedItems }) => { ...@@ -118,13 +145,14 @@ const handleConfirmCity = ({ selectedItems }) => {
cityText.value = selectedItems.map(v => v.name).join("-"); cityText.value = selectedItems.map(v => v.name).join("-");
citySelectedItems = selectedItems; citySelectedItems = selectedItems;
const [province, city, district] = selectedItems; const [province, city, district] = selectedItems;
params.provinceCode = province.code; // params.provinceCode = province.code;
params.provinceName = province.name; // params.provinceName = province.name;
params.cityCode = city.code; // params.cityCode = city.code;
params.cityName = city.name; // params.cityName = city.name;
params.districtCode = district.code; // params.districtCode = district.code;
params.districtName = district.name; // params.districtName = district.name;
console.log(cityValue);
params.location = selectedItems.map(v => v.name).join("-");
}; };
/* 选择图片 */ /* 选择图片 */
const chooseImage = sourceType => { const chooseImage = sourceType => {
...@@ -233,6 +261,10 @@ const validateForm = (formData, requiredFields) => { ...@@ -233,6 +261,10 @@ const validateForm = (formData, requiredFields) => {
.placeholder { .placeholder {
color: #77818f; color: #77818f;
} }
.text-single {
max-width: 80%;
margin-left: 50rpx;
}
.textarea-wrap { .textarea-wrap {
padding: 16px 0; padding: 16px 0;
.label { .label {
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</template></wd-input </template></wd-input
> >
</view> </view>
<view class="item"> <!-- <view class="item">
<view class="label"> 有效期 </view> <view class="label"> 有效期 </view>
<view class="content"> <view class="content">
<wd-radio-group @change="change" v-model="radio" shape="dot" inline :disabled="status != 2"> <wd-radio-group @change="change" v-model="radio" shape="dot" inline :disabled="status != 2">
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
{{ (myLicenseValidityPeriod && $formatTimestamp(myLicenseValidityPeriod, "YYYY-MM-DD")) || "请选择" }} {{ (myLicenseValidityPeriod && $formatTimestamp(myLicenseValidityPeriod, "YYYY-MM-DD")) || "请选择" }}
</view> </view>
</wd-calendar> </wd-calendar>
</view> </view> -->
</view> </view>
<view class="btn-wrap" v-if="status == 2"> <view class="btn-wrap" v-if="status == 2">
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<script setup> <script setup>
import evn from "@/utils/config"; import evn from "@/utils/config";
import { uploadFiles } from "@/utils/fileUpload"; import { uploadFiles } from "@/utils/fileUpload";
import { getCompanyInfoApi, resubmitCompanyApi } from "@/api/user"; import { getCompanyInfoApi, resubmitCompanyApi, companyReviewInfo } from "@/api/user";
import { ref } from "vue"; import { ref } from "vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
const radio = ref(1); const radio = ref(1);
...@@ -92,9 +92,8 @@ let myLicenseValidityPeriod = ref(new Date().getTime()); ...@@ -92,9 +92,8 @@ let myLicenseValidityPeriod = ref(new Date().getTime());
let companyInfo = reactive({}); let companyInfo = reactive({});
let minDate = ref(new Date().getTime()); let minDate = ref(new Date().getTime());
let maxDate = ref(new Date().getTime() + 1000 * 60 * 60 * 24 * 365); let maxDate = ref(new Date().getTime() + 1000 * 60 * 60 * 24 * 365);
onReady(() => {
getCompanyInfoApiFn(); const pageStatus = ref(1);
});
function change(e) { function change(e) {
console.log(e); console.log(e);
if (e.value == 2) { if (e.value == 2) {
...@@ -103,13 +102,22 @@ function change(e) { ...@@ -103,13 +102,22 @@ function change(e) {
myLicenseValidityPeriod.value = 4102329600000; myLicenseValidityPeriod.value = 4102329600000;
} }
} }
onLoad(({ status }) => {
pageStatus.value = status;
if (status == 1) {
getCompanyInfoApiFn();
} else {
companyReviewInfoFn();
}
});
function getCompanyInfoApiFn() { function getCompanyInfoApiFn() {
getCompanyInfoApi().then(res => { getCompanyInfoApi().then(res => {
companyInfo = res.data; companyInfo = res.data;
status.value = res.data.companyAudit.status; status.value = res.data.status;
myLicensePath.value = res.data.companyAudit.licensePath; myLicensePath.value = res.data.licensePath;
companyName.value = res.data.companyAudit.companyName; companyName.value = res.data.companyName;
myCode.value = res.data.companyAudit.creditCode; myCode.value = res.data.creditCode;
myLicenseValidityPeriod.value = res.data.licenseValidityPeriod; myLicenseValidityPeriod.value = res.data.licenseValidityPeriod;
// if (res.data.licenseValidityPeriod == 4102329600000) { // if (res.data.licenseValidityPeriod == 4102329600000) {
...@@ -119,6 +127,17 @@ function getCompanyInfoApiFn() { ...@@ -119,6 +127,17 @@ function getCompanyInfoApiFn() {
// } // }
}); });
} }
function companyReviewInfoFn() {
companyReviewInfo().then(async res => {
companyInfo.value = res.data;
status.value = res.data.status;
myLicensePath.value = res.data.licensePath;
companyName.value = res.data.companyName;
myCode.value = res.data.creditCode;
myLicenseValidityPeriod.value = res.data.licenseValidityPeriod;
});
}
/* 选择图片 */ /* 选择图片 */
const chooseImage = () => { const chooseImage = () => {
if (status.value == 2) { if (status.value == 2) {
......
...@@ -71,7 +71,7 @@ export const formatTimestamp = (timestamp, formatString = "YYYY-MM-DD hh:mm:ss") ...@@ -71,7 +71,7 @@ export const formatTimestamp = (timestamp, formatString = "YYYY-MM-DD hh:mm:ss")
export const validateForm=(formData,requiredFields) =>{ export const validateForm=(formData,requiredFields) =>{
const phoneRegex = /^1[3-9]\d{9}$/; // 正则表达式匹配中国大陆手机号码 const phoneRegex = /^1[3-9]\d{9}$/; // 正则表达式匹配中国大陆手机号码
for (const field of requiredFields) { for (const field of requiredFields) {
if(field === "contactPhone") { if(field === "contactPhone"||field === "phone") {
if (!formData[field] || !phoneRegex.test(formData[field])) { if (!formData[field] || !phoneRegex.test(formData[field])) {
uni.showToast({ uni.showToast({
title: `请填写正确电话号码!`, title: `请填写正确电话号码!`,
...@@ -101,6 +101,12 @@ export const validateForm=(formData,requiredFields) =>{ ...@@ -101,6 +101,12 @@ export const validateForm=(formData,requiredFields) =>{
?'联系人' ?'联系人'
:field==='jobType' :field==='jobType'
?'职位类型' ?'职位类型'
:field==='position'
?'职位'
:field==='name'
?'姓名'
:field==='avatarPath'
?'头像'
:"" :""
}!`, }!`,
icon: "none", icon: "none",
......
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