提交10.31
This commit is contained in:
158
packageRc/pages/demand/components/ImageUpload.vue
Normal file
158
packageRc/pages/demand/components/ImageUpload.vue
Normal file
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<view class="upload-container">
|
||||
<u-upload :disabled="disabled" :width="width" :height="height" :fileList="internalFileList" :name="name" :multiple="multiple"
|
||||
:maxCount="maxCount" @afterRead="handleAfterRead" @delete="handleRemove">
|
||||
</u-upload>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import {
|
||||
// uploadImg
|
||||
// } from '@/api/company'
|
||||
import config from '@/config'
|
||||
// import {
|
||||
// getToken
|
||||
// } from '@/utils/auth'
|
||||
export default {
|
||||
props: {
|
||||
maxSize: {
|
||||
type: Number,
|
||||
default: 5, // 最大文件大小(MB)
|
||||
},
|
||||
allowedFormats: {
|
||||
type: Array,
|
||||
default: () => [], // 允许的文件格式
|
||||
},
|
||||
maxImageSize: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
width: 2048,
|
||||
height: 2048
|
||||
}), // 图片最大宽度和高度
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100rpx', // 默认宽度
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '100rpx', // 默认高度
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
default: 'file', // 默认name字段
|
||||
},
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: false, // 是否允许多选,默认不允许
|
||||
},
|
||||
maxCount: {
|
||||
type: Number,
|
||||
default: 1, // 默认最大上传数量为1
|
||||
},
|
||||
fileList: {
|
||||
type: Array,
|
||||
default: () => [], // 默认的文件列表为空
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
internalFileList: Array.isArray(this.fileList) ? [...this.fileList] : [], // 内部的文件列表,确保与父组件的同步
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 监听 fileList 的变化,确保内外部数据同步
|
||||
fileList(newVal) {
|
||||
this.internalFileList = Array.isArray(newVal) ? [...newVal] : [];
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 新增图片
|
||||
async handleAfterRead(event) {
|
||||
let lists = [].concat(event.file);
|
||||
let fileListLen = this.internalFileList.length;
|
||||
lists.map((item) => {
|
||||
this.internalFileList.push({
|
||||
...item,
|
||||
status: "uploading",
|
||||
message: "上传中",
|
||||
});
|
||||
});
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
if (this.allowedFormats.length > 0) {
|
||||
let fileType = lists[i].name.split('.').pop().toLowerCase();
|
||||
if (!this.allowedFormats.includes(fileType)) {
|
||||
// this.$emit('error', '不支持的文件格式');
|
||||
uni.showToast({
|
||||
title: '不支持的文件格式',
|
||||
icon: 'none',
|
||||
});
|
||||
this.internalFileList.splice(fileListLen, 1);
|
||||
this.$emit('update', this.internalFileList); // 通知父组件文件列表更新
|
||||
return;
|
||||
}
|
||||
}
|
||||
const result = await this.uploadFilePromise(lists[i].url);
|
||||
let item = this.internalFileList[fileListLen];
|
||||
this.internalFileList.splice(
|
||||
fileListLen,
|
||||
1,
|
||||
Object.assign(item, {
|
||||
status: "success",
|
||||
message: "",
|
||||
data: result,
|
||||
})
|
||||
);
|
||||
fileListLen++;
|
||||
this.$emit('update', this.internalFileList); // 通知父组件文件列表更新
|
||||
}
|
||||
},
|
||||
uploadFilePromise(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: config.baseUrl + '/system/oss/upload',
|
||||
filePath: url,
|
||||
name: "file",
|
||||
header: {
|
||||
Authorization: "Bearer " + getToken(),
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
let res = JSON.parse(uploadFileRes.data);
|
||||
resolve(res.data);
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log(err);
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
handleRemove({file, index}) {
|
||||
this.internalFileList.splice(index, 1); // 从文件列表中移除指定文件
|
||||
this.$emit('update', this.internalFileList); // 通知父组件文件列表更新
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.upload-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.upload-slot {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px dashed #ccc;
|
||||
border-radius: 4px;
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -66,6 +66,7 @@
|
||||
pageNum: 1
|
||||
}).then(res => {
|
||||
this.personList = res.rows
|
||||
console.log("人眼",res.row)
|
||||
clearTimeout(this.searcher)
|
||||
})
|
||||
}, 200)
|
||||
|
||||
@@ -4,60 +4,83 @@
|
||||
* @LastEditTime: 2025-05-06 16:56:20
|
||||
-->
|
||||
<template>
|
||||
<view class="input-outer-part">
|
||||
<view class="container" style="background-color: #f7f7f7;">
|
||||
<scroll-view scroll-y="true" :style="{height: edit?'calc(90vh - 150px)':'calc(100vh - 144px)'}">
|
||||
<view class="inner">
|
||||
<view class="part-title" style="display: flex;justify-content: space-between;">创业需求信息
|
||||
<view v-if="!edit&&formData.id&&formData.currentStatus!=3" class="btn"
|
||||
style="font-weight: normal;display: flex;" @click="edit=true">编辑<u-icon name="edit-pen"
|
||||
color="#A6A6A6"></u-icon></view>
|
||||
style="font-weight: normal;display: flex;" @click="edit=true">编辑<view class="icon-right">✏️</view></view>
|
||||
</view>
|
||||
<view class="inner-part">
|
||||
<u--form labelPosition="left" :model="formData" :rules="rules" ref="uForm" class="self-form"
|
||||
labelWidth="100">
|
||||
<u-form-item label="姓名" prop="personName" required
|
||||
v-if="$store.getters.roles.includes('shequn'|| $store.getters.roles.includes('gly'))"
|
||||
>
|
||||
<view style="width: 100%;" @click="openPersonChooser"
|
||||
<view class="self-form">
|
||||
<view class="form-item">
|
||||
<view class="form-label">姓名 <text class="required">*</text></view>
|
||||
<view v-if="name" style="width: 100%;"
|
||||
class="disabledLine">
|
||||
{{ formData.personName || '请选择' }}
|
||||
</view>
|
||||
<view v-else style="width: 100%;" @click="openPersonChooser"
|
||||
:class="{disabledLine: !edit||!canChoosePerson, noValue: !formData.personName}">
|
||||
{{ formData.personName || '请选择' }}
|
||||
</view>
|
||||
<u-icon slot="right" name="edit-pen" color="#A6A6A6"></u-icon>
|
||||
</u-form-item>
|
||||
<!--
|
||||
<u-form-item label="服务需求标题" prop="serviceRequirementTitle" required>
|
||||
<u--textarea :disabled="!edit" v-model="formData.serviceRequirementTitle"
|
||||
placeholder="请输入"></u--textarea>
|
||||
<u-icon slot="right" name="edit-pen" color="#A6A6A6"></u-icon>
|
||||
</u-form-item> -->
|
||||
<u-form-item label="有无场地需求" prop="ywcdxq" required>
|
||||
<u-radio-group :disabled="!edit" v-model="formData.ywcdxq" placement="row">
|
||||
<u-radio :customStyle="{marginRight: '16px'}" label="是" name="是"></u-radio>
|
||||
<u-radio :customStyle="{marginRight: '16px'}" label="否" name="否"></u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item label="场地面积" prop="cdmj">
|
||||
<u--input :disabled="!edit" v-model="formData.cdmj" border="none"
|
||||
placeholder="请输入"></u--input>
|
||||
<u-icon slot="right" name="edit-pen" color="#A6A6A6"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="办公人数" prop="bgrs">
|
||||
<u--input :disabled="!edit" v-model="formData.bgrs" border="none"
|
||||
placeholder="请输入"></u--input>
|
||||
<u-icon slot="right" name="edit-pen" color="#A6A6A6"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="办公位置" prop="bgdd">
|
||||
<u--input :disabled="!edit" v-model="formData.bgdd" border="none"
|
||||
placeholder="请输入"></u--input>
|
||||
<u-icon slot="right" name="edit-pen" color="#A6A6A6"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="有无创业培训需求" prop="ywcypxxq" required>
|
||||
<u-radio-group :disabled="!edit" v-model="formData.ywcypxxq"
|
||||
placement="row">
|
||||
<u-radio :customStyle="{marginRight: '16px'}" label="是" name="是"></u-radio>
|
||||
<u-radio :customStyle="{marginRight: '16px'}" label="否" name="否"></u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<view class="icon-right">✏️</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-label">有无场地需求 <text class="required">*</text></view>
|
||||
<view class="radio-group">
|
||||
<view
|
||||
:class="['radio-item', { 'radio-disabled': !edit }]"
|
||||
@click="formData.ywcdxq = '是'"
|
||||
v-if="edit">
|
||||
<view :class="['radio', { 'radio-checked': formData.ywcdxq === '是' }]"></view>
|
||||
<text>是</text>
|
||||
</view>
|
||||
<view
|
||||
:class="['radio-item', { 'radio-disabled': !edit }]"
|
||||
@click="formData.ywcdxq = '否'"
|
||||
v-if="edit">
|
||||
<view :class="['radio', { 'radio-checked': formData.ywcdxq === '否' }]"></view>
|
||||
<text>否</text>
|
||||
</view>
|
||||
<view v-else>{{ formData.ywcdxq }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-label">场地面积</view>
|
||||
|
||||
<input type="number" :disabled="!edit" v-model="formData.requiredOfficeSpace" placeholder="请输入" :class="['form-input', { 'form-input-disabled': !edit }]"/>
|
||||
<view class="icon-right">✏️</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-label">办公人数</view>
|
||||
<input type="number" :disabled="!edit" v-model="formData.bgrs" placeholder="请输入" :class="['form-input', { 'form-input-disabled': !edit }]"/>
|
||||
<view class="icon-right">✏️</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-label">办公位置</view>
|
||||
<input type="text" :disabled="!edit" v-model="formData.bgdd" placeholder="请输入" :class="['form-input', { 'form-input-disabled': !edit }]"/>
|
||||
<view class="icon-right">✏️</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-label">有无创业培训需求 <text class="required">*</text></view>
|
||||
<view class="radio-group">
|
||||
<view
|
||||
:class="['radio-item', { 'radio-disabled': !edit }]"
|
||||
@click="formData.ywcypxxq = '是'"
|
||||
v-if="edit">
|
||||
<view :class="['radio', { 'radio-checked': formData.ywcypxxq === '是' }]"></view>
|
||||
<text>是</text>
|
||||
</view>
|
||||
<view
|
||||
:class="['radio-item', { 'radio-disabled': !edit }]"
|
||||
@click="formData.ywcypxxq = '否'"
|
||||
v-if="edit">
|
||||
<view :class="['radio', { 'radio-checked': formData.ywcypxxq === '否' }]"></view>
|
||||
<text>否</text>
|
||||
</view>
|
||||
<view v-else>{{ formData.ywcypxxq }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <u-form-item label="是否意向接受创业培训" prop="isInterestedEntrepreneurshipGuidance" required>-->
|
||||
<!-- <u-radio-group :disabled="!edit" v-model="formData.isInterestedEntrepreneurshipGuidance"-->
|
||||
<!-- placement="row">-->
|
||||
@@ -65,23 +88,31 @@
|
||||
<!-- <u-radio :customStyle="{marginRight: '16px'}" label="否" name="否"></u-radio>-->
|
||||
<!-- </u-radio-group>-->
|
||||
<!-- </u-form-item>-->
|
||||
<u-form-item label="有无资金需求" prop="ywzjxq" required>
|
||||
<u-radio-group :disabled="!edit" v-model="formData.ywzjxq" placement="row">
|
||||
<u-radio :customStyle="{marginRight: '16px'}" label="是" name="是"></u-radio>
|
||||
<u-radio :customStyle="{marginRight: '16px'}" label="否" name="否"></u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item label="需求说明" prop="jobDescription" required>
|
||||
<u-textarea :disabled="!edit" v-model="formData.jobDescription" placeholder="请输入"></u-textarea>
|
||||
</u-form-item>
|
||||
<!-- <u-form-item label="希望解决日期" prop="hopeSolveDate" required>
|
||||
<view style="width: 100%;" @click="showPicker('hopeSolveDate')"
|
||||
:class="{disabledLine: !edit, noValue: !formData.hopeSolveDate}">
|
||||
{{ formData.hopeSolveDate||'请选择' }}
|
||||
<view class="form-item">
|
||||
<view class="form-label">有无资金需求 <text class="required">*</text></view>
|
||||
<view class="radio-group">
|
||||
<view
|
||||
:class="['radio-item', { 'radio-disabled': !edit }]"
|
||||
@click="formData.ywzjxq = '是'"
|
||||
v-if="edit">
|
||||
<view :class="['radio', { 'radio-checked': formData.ywzjxq === '是' }]"></view>
|
||||
<text>是</text>
|
||||
</view>
|
||||
<view
|
||||
:class="['radio-item', { 'radio-disabled': !edit }]"
|
||||
@click="formData.ywzjxq = '否'"
|
||||
v-if="edit">
|
||||
<view :class="['radio', { 'radio-checked': formData.ywzjxq === '否' }]"></view>
|
||||
<text>否</text>
|
||||
</view>
|
||||
<view v-else>{{ formData.ywzjxq }}</view>
|
||||
</view>
|
||||
<u-icon slot="right" name="arrow-down" color="#A6A6A6"></u-icon>
|
||||
</u-form-item> -->
|
||||
</u--form>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-label">需求说明 <text class="required">*</text></view>
|
||||
<textarea :disabled="!edit" v-model="formData.jobDescription" placeholder="请输入" :class="['form-textarea', { 'form-textarea-disabled': !edit }]"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="inner" style="margin-top: 32rpx;">-->
|
||||
@@ -112,29 +143,27 @@
|
||||
fileUrl: formData.fileUrl
|
||||
}" />
|
||||
</scroll-view>
|
||||
<u-datetime-picker :show="show.hopeSolveDate" v-model="dates.hopeSolveDate" mode="date"
|
||||
@confirm="confirmDate('hopeSolveDate', $event)" @cancel="cancelPicker('hopeSolveDate')"></u-datetime-picker>
|
||||
<choose-person ref="personChooser" @confirm="personNameConfirm" />
|
||||
<view class="button-area" v-if="edit">
|
||||
<view class="btn" @click="cancelPage">取消</view>
|
||||
<view class="btn reset" @click="getPersonInfo()">重置</view>
|
||||
<view class="btn reset" @click="formData.id ? getDetail(formData.id) : setDefaultValues()">重置</view>
|
||||
<view class="btn save" @click="saveInfo">保存</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import {
|
||||
// getPersonBase
|
||||
// } from "@/api/person";
|
||||
// import {
|
||||
// addPersonDemand,
|
||||
// updatePersonDemand,
|
||||
// getPersonDemand
|
||||
// } from "@/api/needs/personDemand";
|
||||
// import ImageUpload from '@/components/ImageUpload'
|
||||
// import ChoosePerson from '@/pages/needs/components/choosePerson';
|
||||
// import dayjs from "dayjs";
|
||||
import {
|
||||
getPersonBase
|
||||
} from "@/packageRc/api/personinfo/index";
|
||||
import {
|
||||
addPersonDemand,
|
||||
updatePersonDemand,
|
||||
getPersonDemand
|
||||
} from "@/packageRc/api/needs/personDemand";
|
||||
import ImageUpload from './ImageUpload'
|
||||
import ChoosePerson from './choosePerson';
|
||||
import PlacePicker from "@/components/placePicker";
|
||||
import dayjs from "dayjs";
|
||||
export default {
|
||||
components: {
|
||||
// ChoosePerson,
|
||||
@@ -152,55 +181,27 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fileList: [],
|
||||
edit: true,
|
||||
personBase: {},
|
||||
dates: {},
|
||||
formData: {
|
||||
jobDescription:"",
|
||||
demandType:"2",
|
||||
personName: '',
|
||||
personId:"",
|
||||
userId:"",
|
||||
serviceRequirementTitle: '',
|
||||
isAcceptAssistance: '',
|
||||
isAcceptApprovalResult: '',
|
||||
|
||||
},
|
||||
rules: {
|
||||
|
||||
ywcdxq: [{
|
||||
required: true,
|
||||
message: '请选择有无场地需求',
|
||||
trigger: ['blur', 'change'],
|
||||
}, ],
|
||||
ywcypxxq: [{
|
||||
required: true,
|
||||
message: '请选择有无创业培训需求',
|
||||
trigger: ['blur', 'change'],
|
||||
}, ],
|
||||
isInterestedEntrepreneurshipGuidance: [{
|
||||
required: true,
|
||||
message: '请选择是否意向接受创业培训',
|
||||
trigger: ['blur', 'change'],
|
||||
}, ],
|
||||
ywzjxq: [{
|
||||
required: true,
|
||||
message: '请选择有无资金需求',
|
||||
trigger: ['blur', 'change'],
|
||||
}, ],
|
||||
|
||||
},
|
||||
dict: {},
|
||||
show: {},
|
||||
currentCityArr: [],
|
||||
originalDept: [],
|
||||
currentCity: '请选择',
|
||||
bysj: '',
|
||||
loading: false,
|
||||
jobTypeList: [],
|
||||
route: {},
|
||||
canChoosePerson: false,
|
||||
formData: {
|
||||
id: '',
|
||||
personId: '',
|
||||
userId: '',
|
||||
personName: '',
|
||||
ywcdxq: '',
|
||||
requiredOfficeSpace: '',
|
||||
bgrs: '',
|
||||
bgdd: '',
|
||||
ywcypxxq: '',
|
||||
ywzjxq: '',
|
||||
jobDescription: '',
|
||||
actualSolveDate: '',
|
||||
solveDesc: '',
|
||||
actualSolvePeople: '',
|
||||
fileUrl: '',
|
||||
currentStatus: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
@@ -223,13 +224,13 @@
|
||||
uni.navigateBack()
|
||||
}
|
||||
},
|
||||
// setName(){
|
||||
// this.formData.personName = this.name
|
||||
// this.formData.personId = this.needid
|
||||
// this.formData.userId = this.needid
|
||||
|
||||
// this.$forceUpdate();
|
||||
// },
|
||||
setName(){
|
||||
this.formData.personName = this.name
|
||||
this.formData.personId = this.needId
|
||||
this.formData.userId = this.needId
|
||||
console.log("this",this)
|
||||
|
||||
},
|
||||
openPersonChooser() {
|
||||
if (this.edit && this.canChoosePerson) {
|
||||
this.$refs.personChooser.open();
|
||||
@@ -261,7 +262,8 @@
|
||||
this.getPersonInfo()
|
||||
if(this.name){
|
||||
this.formData.personName = this.name
|
||||
this.formData.userId = this.needid
|
||||
this.formData.personId = this.needId
|
||||
this.formData.userId = this.needId
|
||||
}
|
||||
this.edit = true
|
||||
},
|
||||
@@ -332,18 +334,32 @@
|
||||
this.formData.serviceRequirementTitle = `${this.formData.personName}_于${dayNew}_提出创业需求`
|
||||
},
|
||||
async saveInfo() {
|
||||
this.setName()
|
||||
try {
|
||||
if (!this.formData.jobDescription || this.formData.jobDescription.trim() === '') {
|
||||
this.$u.toast('请填写需求说明!');
|
||||
// 验证必填项
|
||||
if (!this.formData.personName || this.formData.personName.trim() === '') {
|
||||
uni.showToast({ title: '请选择姓名!', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
// 验证表单
|
||||
const isValid = await this.$refs.uForm.validate();
|
||||
if (!isValid) {
|
||||
throw new Error('请检查必填项填写');
|
||||
if (!this.formData.ywcdxq) {
|
||||
uni.showToast({ title: '请选择有无场地需求!', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!this.formData.ywcypxxq) {
|
||||
uni.showToast({ title: '请选择有无创业培训需求!', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!this.formData.ywzjxq) {
|
||||
uni.showToast({ title: '请选择有无资金需求!', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!this.formData.jobDescription || this.formData.jobDescription.trim() === '') {
|
||||
uni.showToast({ title: '请填写需求说明!', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
|
||||
// 显示全局加载
|
||||
this.$showLoading();
|
||||
uni.showLoading({ title: '保存中...' });
|
||||
// 根据 formData 是否有 id 来决定是更新还是新增
|
||||
let response;
|
||||
this.formData.demandType = 2;
|
||||
@@ -358,24 +374,23 @@
|
||||
|
||||
// 检查响应码是否为200
|
||||
if (response.code === 200) {
|
||||
this.$u.toast(successMessage);
|
||||
uni.showToast({ title: successMessage, icon: 'success' });
|
||||
// 如果是编辑模式,关闭编辑状态;否则返回上一页
|
||||
if (this.formData.id) {
|
||||
this.edit = false;
|
||||
} else {
|
||||
await this.$delay(1000); // 延迟1秒后返回上一页
|
||||
uni.navigateBack();
|
||||
// 延迟1秒后返回上一页
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
if(error.length){
|
||||
this.$u.toast('请填写完整信息!');
|
||||
}else{
|
||||
this.$u.toast('系统错误,请联系管理员!');
|
||||
}
|
||||
console.error('保存失败:', error);
|
||||
uni.showToast({ title: '系统错误,请联系管理员!', icon: 'none' });
|
||||
} finally {
|
||||
// 确保加载页总是会被隐藏
|
||||
this.$hideLoading();
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -385,6 +400,21 @@
|
||||
this.$set(this.formData, 'ywcypxxq', '是')
|
||||
this.$set(this.formData, 'isInterestedEntrepreneurshipGuidance', '是')
|
||||
this.$set(this.formData, 'ywzjxq', '是')
|
||||
},
|
||||
// 获取详情数据
|
||||
async getDetail(id) {
|
||||
try {
|
||||
this.loading = true;
|
||||
const response = await getPersonDemand(id);
|
||||
if (response.code === 200) {
|
||||
this.formData = { ...response.data };
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取详情失败:', error);
|
||||
uni.showToast({ title: '获取详情失败', icon: 'none' });
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
// saveInfo() {
|
||||
// this.$refs.uForm.validate().then(res => {
|
||||
@@ -431,10 +461,7 @@
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
.input-outer-part {
|
||||
padding: 0 32rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.inner {
|
||||
background: #eef1f5;
|
||||
border-radius: 16rpx;
|
||||
@@ -452,6 +479,115 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 表单项目样式 */
|
||||
.form-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 24rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 8rpx;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
width: 200rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
flex-shrink: 0;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.required {
|
||||
color: #f56c6c;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
|
||||
.form-input {
|
||||
flex: 1;
|
||||
border: none;
|
||||
outline: none;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
background: none;
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.form-input-disabled {
|
||||
color: #909399;
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
.form-textarea {
|
||||
flex: 1;
|
||||
border: none;
|
||||
outline: none;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
background: none;
|
||||
min-height: 120rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.form-textarea-disabled {
|
||||
color: #909399;
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
.icon-right {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #A6A6A6;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
/* 单选框样式 */
|
||||
.radio-group {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.radio-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 32rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.radio-item.radio-disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.radio {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
border-radius: 50%;
|
||||
border: 2rpx solid #dcdfe6;
|
||||
margin-right: 12rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.radio.radio-checked {
|
||||
border-color: #409eff;
|
||||
background-color: #409eff;
|
||||
}
|
||||
|
||||
.radio.radio-checked::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
/* 调整按钮区域样式 */
|
||||
.button-area {
|
||||
margin-top: 24rpx;
|
||||
|
||||
@@ -4,19 +4,17 @@
|
||||
* @LastEditTime: 2025-05-06 16:55:10
|
||||
-->
|
||||
<template>
|
||||
|
||||
<view class="input-outer-part">
|
||||
<view class="container" style="background-color: #f7f7f7;">
|
||||
<scroll-view scroll-y="true" :style="{height: edit?'calc(90vh - 150px)':'calc(100vh - 144px)'}">
|
||||
<view class="inner">
|
||||
<view class="part-title" style="display: flex;justify-content: space-between;">求职需求信息
|
||||
<view v-if="!edit&&formData.id&&formData.currentStatus!=3" class="btn"
|
||||
style="font-weight: normal;display: flex;" @click="edit=true">编辑<u-icon name="edit-pen"
|
||||
color="#A6A6A6"></u-icon></view>
|
||||
style="font-weight: normal;display: flex;" @click="edit=true">编辑<view class="icon-right">✏️</view></view>
|
||||
</view>
|
||||
<view class="inner-part">
|
||||
<u--form labelPosition="left" :model="formData" :rules="rules" ref="uForm" class="self-form" labelWidth="100">
|
||||
<u-form-item label="姓名" prop="personName" required
|
||||
>
|
||||
<view class="self-form">
|
||||
<view class="form-item">
|
||||
<view class="form-label">姓名 <text class="required">*</text></view>
|
||||
<view v-if="name" style="width: 100%;"
|
||||
class="disabledLine">
|
||||
{{ formData.personName || '请选择' }}
|
||||
@@ -25,9 +23,13 @@
|
||||
:class="{disabledLine: !edit||!canChoosePerson, noValue: !formData.personName}">
|
||||
{{ formData.personName || '请选择' }}
|
||||
</view>
|
||||
<u-icon slot="right" name="edit-pen" color="#A6A6A6"></u-icon>
|
||||
</u-form-item>
|
||||
|
||||
<view class="icon-right">✏️</view>
|
||||
</view>
|
||||
<!-- <u-form-item label="姓名" prop="personName" required>
|
||||
<u--input :disabled="!edit" v-model="formData.name" border="none"
|
||||
placeholder="请输入"></u--input>
|
||||
<view class="icon-right" style="width: 40rpx; height: 40rpx;">✏️</view>
|
||||
</u-form-item> -->
|
||||
<!-- <u-form-item label="求职工种" prop="jobWorkType" required>
|
||||
<view style="width: 100%;" @click="showPicker('jobWorkType')"
|
||||
:class="{disabledLine: !edit, noValue: !formData.jobWorkTypeName}">
|
||||
@@ -36,7 +38,8 @@
|
||||
<u-icon slot="right" name="arrow-down" color="#A6A6A6"></u-icon>
|
||||
</u-form-item> -->
|
||||
<!-- 新增工种选择 -->
|
||||
<u-form-item label="求职工种" prop="jobWorkType">
|
||||
<view class="form-item">
|
||||
<view class="form-label">求职工种</view>
|
||||
<picker
|
||||
mode="multiSelector"
|
||||
:range="workTypeColumns"
|
||||
@@ -47,14 +50,14 @@
|
||||
v-if="workTypeColumns[0] && workTypeColumns[0].length"
|
||||
>
|
||||
<view class="picker-view">
|
||||
<text>{{ formData.jobWorkTypeName || '请选择工种' }}</text>
|
||||
<u-icon name="arrow-down" color="#999999"></u-icon>
|
||||
</view>
|
||||
<view class="picker-view-text">{{ formData.jobWorkTypeName || '请选择工种' }}</view>
|
||||
<view class="icon-right">▼</view>
|
||||
</view>
|
||||
</picker>
|
||||
<view v-else class="picker-view">
|
||||
<text>工种数据加载中...</text>
|
||||
</view>
|
||||
</u-form-item>
|
||||
<view class="picker-view-text">工种数据加载中...</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <u-form-item label="工种选择" prop="selectedWorkType">
|
||||
<uni-data-picker
|
||||
v-model="selectedWorkType"
|
||||
@@ -70,46 +73,67 @@
|
||||
:self-field="false"
|
||||
/>
|
||||
</u-form-item> -->
|
||||
|
||||
<u-form-item label="最低薪酬" prop="minRecruitmentSalary" required>
|
||||
<u--input :disabled="!edit" v-model="formData.minRecruitmentSalary" border="none"
|
||||
placeholder="请输入"></u--input>
|
||||
<u-icon slot="right" name="edit-pen" color="#A6A6A6"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="最高薪酬" prop="highRecruitmentSalary" required>
|
||||
<u--input :disabled="!edit" v-model="formData.highRecruitmentSalary" border="none"
|
||||
placeholder="请输入"></u--input>
|
||||
<u-icon slot="right" name="edit-pen" color="#A6A6A6"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="单位性质" prop="unitNature" required>
|
||||
<!-- <u-form-item label="希望解决日期" prop="hopeSolveDate" required>
|
||||
<view style="width: 100%;" @click="showPicker('hopeSolveDate')"
|
||||
:class="{disabledLine: !edit, noValue: !formData.hopeSolveDate}">
|
||||
{{ formData.hopeSolveDate||'请选择' }}
|
||||
</view>
|
||||
<u-icon slot="right" name="arrow-down" color="#A6A6A6"></u-icon>
|
||||
</u-form-item> -->
|
||||
<!-- <u-form-item label="从业年数" prop="emplymentYear" required>
|
||||
<view style="width: 100%;" @click="showPicker('emplymentYear')"
|
||||
:class="{disabledLine: !edit, noValue: getDictLabel(formData.emplymentYear, dict.emplymentYear)=='请选择'}">
|
||||
{{ getDictLabel(formData.emplymentYear, dict.emplymentYear) }}
|
||||
</view>
|
||||
<u-icon slot="right" name="arrow-down" color="#A6A6A6"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="工资类型" prop="salaryType" required>
|
||||
<view style="width: 100%;" @click="showPicker('salaryType')"
|
||||
:class="{disabledLine: !edit, noValue: getDictLabel(formData.salaryType, dict.salaryType)=='请选择'}">
|
||||
{{ getDictLabel(formData.salaryType, dict.salaryType) }}
|
||||
</view>
|
||||
<u-icon slot="right" name="arrow-down" color="#A6A6A6"></u-icon>
|
||||
</u-form-item> -->
|
||||
<view class="form-item">
|
||||
<view class="form-label">最低薪酬 <text class="required">*</text></view>
|
||||
<input type="number" :disabled="!edit" v-model="formData.minRecruitmentSalary" placeholder="请输入" :class="['form-input', { 'form-input-disabled': !edit }]"/>
|
||||
<view class="icon-right" style="width: 40rpx; height: 40rpx;">✏️</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-label">最高薪酬 <text class="required">*</text></view>
|
||||
<input type="number" :disabled="!edit" v-model="formData.highRecruitmentSalary" placeholder="请输入" :class="['form-input', { 'form-input-disabled': !edit }]"/>
|
||||
<view class="icon-right" style="width: 40rpx; height: 40rpx;">✏️</view>
|
||||
</view>
|
||||
<!-- <u-form-item label="单位性质" prop="unitNature" required>
|
||||
<view style="width: 100%;" @click="showPicker('unitNature')"
|
||||
:class="{disabledLine: !edit, noValue: getDictLabel(formData.unitNature, this.dictTypeMap.unitNature)=='请选择'}">
|
||||
{{ getDictLabel(formData.unitNature, this.dictTypeMap.unitNature) }}
|
||||
:class="{disabledLine: !edit, noValue: getDictLabel(formData.unitNature, dict.unitNature)=='请选择'}">
|
||||
{{ getDictLabel(formData.unitNature, dict.unitNature) }}
|
||||
</view>
|
||||
<u-icon slot="right" name="arrow-down" color="#A6A6A6"></u-icon>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="希望工作地点" prop="addressDesc">
|
||||
<view class="df_flex df_flex_1">
|
||||
<u--input placeholder="请输入" border="none" v-model="formData.addressDesc"
|
||||
class="ellipsis_1" @focus="$refs.placePicker.openDialog()"></u--input>
|
||||
<!-- <u-icon name="edit-pen" color="#999" size="42rpx"></u-icon> -->
|
||||
</u-form-item> -->
|
||||
<!-- <u-form-item label="用工形式" prop="employmentType" required>
|
||||
<view style="width: 100%;" @click="showPicker('employmentType')"
|
||||
:class="{disabledLine: !edit, noValue: getDictLabel(formData.employmentType, dict.employmentType)=='请选择'}">
|
||||
{{ getDictLabel(formData.employmentType, dict.employmentType) }}
|
||||
</view>
|
||||
</u-form-item>
|
||||
<u--form labelPosition="left" class="self-form" labelWidth="110" >
|
||||
<u-form-item label="求职说明" prop="jobDescription" required >
|
||||
<u-textarea :disabled="!edit" v-model="formData.jobDescription"
|
||||
placeholder="请输入" ></u-textarea>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<u-form-item label="就业意愿" prop="employmentWillingness">
|
||||
<u-icon slot="right" name="arrow-down" color="#A6A6A6"></u-icon>
|
||||
</u-form-item> -->
|
||||
<view class="form-item">
|
||||
<view class="form-label">希望工作地点</view>
|
||||
<input type="text" placeholder="请输入" v-model="formData.addressDesc" class="form-input ellipsis_1" @focus="$refs.placePicker.openDialog()"/>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-label">求职说明 <text class="required">*</text></view>
|
||||
<textarea :disabled="!edit" v-model="formData.jobDescription" placeholder="请输入" :class="['form-textarea', { 'form-textarea-disabled': !edit }]"></textarea>
|
||||
</view>
|
||||
<!-- <u-form-item label="就业意愿" prop="employmentWillingness">
|
||||
<view style="width: 100%;" @click="showPicker('employmentWillingness')"
|
||||
:class="{disabledLine: !edit, noValue: getDictLabel(formData.employmentWillingness, this.dictTypeMap.employmentWillingness)=='请选择'}">
|
||||
{{ getDictLabel(formData.employmentWillingness, this.dictTypeMap.employmentWillingness) }}
|
||||
:class="{disabledLine: !edit, noValue: getDictLabel(formData.employmentWillingness, dict.employmentWillingness)=='请选择'}">
|
||||
{{ getDictLabel(formData.employmentWillingness, dict.employmentWillingness) }}
|
||||
</view>
|
||||
<u-icon slot="right" name="arrow-down" color="#A6A6A6"></u-icon>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
</u-form-item> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -131,82 +155,38 @@
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</scroll-view>
|
||||
<u-datetime-picker :show="show.hopeSolveDate" v-model="dates.hopeSolveDate" mode="date"
|
||||
@confirm="confirmDate('hopeSolveDate', $event)" @cancel="cancelPicker('hopeSolveDate')"></u-datetime-picker>
|
||||
<u-picker :show="show.jobWorkType" :columns="[jobTypeList]" keyName="workTypeName"
|
||||
@confirm="jobTypeConfirm('jobWorkType', $event)" @cancel="cancelPicker('jobWorkType')"></u-picker>
|
||||
<u-picker :show="show.emplymentYear" :columns="[dict.type[this.dictTypeMap.emplymentYear]]" keyName="label"
|
||||
@confirm="pickerConfirm('emplymentYear', $event)" @cancel="cancelPicker('emplymentYear')"></u-picker>
|
||||
<u-picker :show="show.salaryType" :columns="[dict.type[this.dictTypeMap.salaryType]]" keyName="label"
|
||||
@confirm="pickerConfirm('salaryType', $event)" @cancel="cancelPicker('salaryType')"></u-picker>
|
||||
<u-picker :show="show.highRecruitmentSalary" :columns="[dict.type[this.dictTypeMap.highRecruitmentSalary]]" keyName="label"
|
||||
@confirm="pickerConfirm('highRecruitmentSalary', $event)"
|
||||
@cancel="cancelPicker('highRecruitmentSalary')"></u-picker>
|
||||
<u-picker :show="show.minRecruitmentSalary" :columns="[dict.type[this.dictTypeMap.minRecruitmentSalary]]" keyName="label"
|
||||
@confirm="pickerConfirm('minRecruitmentSalary', $event)"
|
||||
@cancel="cancelPicker('minRecruitmentSalary')"></u-picker>
|
||||
<u-picker :show="show.unitNature" :columns="[dict.type[this.dictTypeMap.unitNature]]" keyName="label"
|
||||
@confirm="pickerConfirm('unitNature', $event)" @cancel="cancelPicker('unitNature')"></u-picker>
|
||||
<u-picker :show="show.employmentType" :columns="[dict.type[this.dictTypeMap.employmentType || 'qcjy_ygxs']]" keyName="label"
|
||||
@confirm="pickerConfirm('employmentType', $event)" @cancel="cancelPicker('employmentType')"></u-picker>
|
||||
|
||||
<u-picker :show="show.employmentWillingness" :columns="[dict.type[this.dictTypeMap.employmentWillingness]]" keyName="label"
|
||||
@confirm="pickerConfirm('employmentWillingness', $event)"
|
||||
@cancel="cancelPicker('employmentWillingness')"></u-picker>
|
||||
|
||||
<!-- 帮扶方式字典示例 -->
|
||||
<view v-if="dict.type.qyjy_zdfwlx && dict.type.qyjy_zdfwlx.length" style="padding: 20rpx;">
|
||||
<text>帮扶方式字典数据示例:</text>
|
||||
<view v-for="item in dict.type.qyjy_zdfwlx" :key="item.value" style="padding: 10rpx 0;">
|
||||
{{ item.label }} ({{ item.value }})
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
<!-- 使用原生picker组件代替uView的选择器 -->
|
||||
<!-- 工种选择器弹窗 -->
|
||||
<u-picker
|
||||
:show="show.workTypePicker"
|
||||
:columns="[workTypeList]"
|
||||
keyName="label"
|
||||
@confirm="onWorkTypePickerConfirm"
|
||||
@cancel="cancelWorkTypePicker"
|
||||
:loading="workTypeList.length === 0"
|
||||
:defaultIndex="[0]"
|
||||
:immediateChange="true"
|
||||
:closeOnClickOverlay="true"
|
||||
></u-picker>
|
||||
|
||||
|
||||
<choose-person ref="personChooser" @confirm="personNameConfirm" />
|
||||
<view class="button-area" v-if="edit">
|
||||
<view class="btn" @click="cancelPage">取消</view>
|
||||
<view class="btn reset" @click="getDetail(formData.id)">重置</view>
|
||||
<view class="btn save" @click="saveInfo">保存</view>
|
||||
</view>
|
||||
|
||||
<PlacePicker ref="placePicker" @selected="handleSelected" />
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { computed } from 'vue'
|
||||
import {
|
||||
getPersonBase
|
||||
} from "../../../api/needs/person";
|
||||
import {
|
||||
addPersonDemand,
|
||||
updatePersonDemand,
|
||||
getPersonDemand
|
||||
} from "../../../api/needs/personDemand";
|
||||
import {
|
||||
listJobType
|
||||
} from "../../../api/jobType/index";
|
||||
import ImageUpload from '@/components/ImageUpload'
|
||||
import ChoosePerson from './choosePerson';
|
||||
import PlacePicker from "@/components/placePicker";
|
||||
|
||||
//import uPopup from 'uview-ui/components/u-popup/u-popup.vue'
|
||||
getPersonBase
|
||||
} from "@/packageRc/api/personinfo/index";
|
||||
import {
|
||||
addPersonDemand,
|
||||
updatePersonDemand,
|
||||
getPersonDemand
|
||||
} from "@/packageRc/api/needs/personDemand";
|
||||
import {
|
||||
listJobType
|
||||
} from "@/packageRc/api/jobType/index";
|
||||
import ImageUpload from './ImageUpload'
|
||||
import ChoosePerson from './choosePerson';
|
||||
import PlacePicker from "@/components/placePicker";
|
||||
|
||||
//import uPopup from 'uview-ui/components/u-popup/u-popup.vue'
|
||||
export default {
|
||||
components: {
|
||||
ChoosePerson,
|
||||
@@ -224,39 +204,6 @@
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
setup() {
|
||||
// 导入字典store
|
||||
const useDictStore = require('@/stores/useDictStore').default
|
||||
const dictStore = useDictStore()
|
||||
|
||||
// 直接使用store中的dict对象,支持dict.type.xxx语法
|
||||
const dict = computed(() => dictStore.dict)
|
||||
|
||||
// 字典类型映射
|
||||
const dictTypeMap = {
|
||||
emplymentYear: 'qcjy_gznx',
|
||||
salaryType: 'qcjy_gzlx',
|
||||
highRecruitmentSalary: 'qcjy_zgzpgz',
|
||||
minRecruitmentSalary: 'qcjy_zgzpgz',
|
||||
unitNature: 'qcjy_dwxz',
|
||||
employmentWillingness: 'qcjt_jyyy',
|
||||
// 添加帮扶方式字典
|
||||
qyjy_zdfwlx: 'qyjy_zdfwlx'
|
||||
}
|
||||
|
||||
// 预加载字典数据
|
||||
const loadDicts = async () => {
|
||||
const dictTypes = Object.values(dictTypeMap)
|
||||
const uniqueTypes = [...new Set(dictTypes)]
|
||||
await Promise.all(uniqueTypes.map(type => dictStore.loadDict(type)))
|
||||
}
|
||||
|
||||
return {
|
||||
dict,
|
||||
loadDicts,
|
||||
dictTypeMap
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
edit: true,
|
||||
@@ -264,9 +211,11 @@
|
||||
dates: {},
|
||||
currentCommunityId: '',
|
||||
showPickerPicker: false,
|
||||
canChoosePerson: true,
|
||||
canChoosePerson: true,
|
||||
formData: {
|
||||
demandType:"1",
|
||||
personName: '',
|
||||
personName: '',
|
||||
personId:"",
|
||||
userId:"",
|
||||
jobWorkType: '',
|
||||
@@ -306,10 +255,28 @@
|
||||
trigger: ['blur', 'change'],
|
||||
}, ],
|
||||
jobDescription: [{
|
||||
required: true,
|
||||
message: '请填写求职说明',
|
||||
trigger: ['blur', 'change'],
|
||||
}, ]
|
||||
required: true,
|
||||
message: '请填写求职说明',
|
||||
trigger: ['blur', 'change'],
|
||||
}, ]
|
||||
// employmentType: [{
|
||||
// required: true,
|
||||
// message: '请选择用工形式',
|
||||
// trigger: ['blur', 'change'],
|
||||
// }, ],
|
||||
// addressDesc: [{
|
||||
// required: true,
|
||||
// message: '请选择希望工作地点',
|
||||
// trigger: ['blur', 'change'],
|
||||
// }, ],
|
||||
},
|
||||
dict: {
|
||||
emplymentYear: [],
|
||||
salaryType: [],
|
||||
highRecruitmentSalary: [],
|
||||
minRecruitmentSalary: [],
|
||||
unitNature: [],
|
||||
employmentWillingness: []
|
||||
},
|
||||
show: {
|
||||
hopeSolveDate: false,
|
||||
@@ -334,26 +301,70 @@
|
||||
workTypeIndexes: [0, 0, 0],
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.uForm.setRules(this.rules)
|
||||
},
|
||||
// 移除uView表单验证相关代码
|
||||
created() {
|
||||
this.setName()
|
||||
this.loading = true;
|
||||
// 使用新的字典加载方法
|
||||
this.loadDicts()
|
||||
.then(() => {
|
||||
console.log('字典数据加载完成:', this.dict);
|
||||
let arr = [{
|
||||
key: 'qcjy_gznx',
|
||||
prop: 'emplymentYear'
|
||||
},
|
||||
{
|
||||
key: 'qcjy_gzlx',
|
||||
prop: 'salaryType'
|
||||
},
|
||||
{
|
||||
key: 'qcjy_zgzpgz',
|
||||
prop: 'highRecruitmentSalary'
|
||||
},
|
||||
{
|
||||
key: 'qcjy_zgzpgz',
|
||||
prop: 'minRecruitmentSalary'
|
||||
},
|
||||
{
|
||||
key: 'qcjy_dwxz',
|
||||
prop: 'unitNature'
|
||||
},
|
||||
// {
|
||||
// key: 'qcjy_ygxs',
|
||||
// prop: 'employmentType'
|
||||
// },
|
||||
{
|
||||
key: 'qcjt_jyyy',
|
||||
prop: 'employmentWillingness'
|
||||
},
|
||||
]
|
||||
|
||||
// 使用 Promise.all 确保所有字典数据加载完成
|
||||
Promise.all(arr.map(ele => this.getDicts(ele.key)))
|
||||
.then(responses => {
|
||||
responses.forEach((res, index) => {
|
||||
this.dict[arr[index].prop] = res.data || [];
|
||||
});
|
||||
this.loading = false;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('加载字典数据失败:', error);
|
||||
// 设置默认空数组
|
||||
arr.forEach(ele => {
|
||||
this.dict[ele.prop] = [];
|
||||
});
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
this.workTypeRemoteMethod('');
|
||||
},
|
||||
methods: {
|
||||
// 不再需要这个方法,使用store中的loadDict方法
|
||||
// 获取字典数据
|
||||
getDicts(dictType) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// 这里应该调用实际的API,暂时返回空数组
|
||||
// 如果需要真实的API调用,请替换下面的代码
|
||||
setTimeout(() => {
|
||||
resolve({ data: [] });
|
||||
}, 100);
|
||||
});
|
||||
},
|
||||
|
||||
cancelPage() {
|
||||
if (this.formData.id) {
|
||||
@@ -446,7 +457,7 @@
|
||||
cancelPicker(type) {
|
||||
this.show[type] = false
|
||||
},
|
||||
getCityOptions(data) {
|
||||
getCityOptis(data) {
|
||||
if (data && data[0] && data[0].children) {
|
||||
return [data].concat(this.getCityOptions(data[0].children))
|
||||
} else {
|
||||
@@ -454,29 +465,21 @@
|
||||
}
|
||||
},
|
||||
|
||||
// 新的getDictLabel方法,支持使用dict.type语法
|
||||
getDictLabel(value, dictType) {
|
||||
// 兼容旧的使用方式
|
||||
if (Array.isArray(dictType)) {
|
||||
let arr = dictType.filter(ele => ele.dictValue == value)
|
||||
getDictLabel(value, list) {
|
||||
if (list && Array.isArray(list)) {
|
||||
let arr = list.filter(ele => ele.dictValue == value)
|
||||
if (arr.length) {
|
||||
return arr[0].dictLabel || '请选择'
|
||||
} else {
|
||||
return '请选择'
|
||||
}
|
||||
}
|
||||
|
||||
// 新的使用方式,通过dict.type和dict.label访问
|
||||
if (this.dict.label && this.dict.label[dictType]) {
|
||||
return this.dict.label[dictType][value] || '请选择'
|
||||
}
|
||||
return '请选择'
|
||||
},
|
||||
|
||||
pickerConfirm(type, event) {
|
||||
this.show[type] = false
|
||||
// 使用新的字典格式
|
||||
this.formData[type] = event.value[0].value || event.value[0].dictValue
|
||||
this.formData[type] = event.value[0].dictValue
|
||||
},
|
||||
jobTypeConfirm(type, event) {
|
||||
this.show[type] = false
|
||||
@@ -499,29 +502,49 @@
|
||||
},
|
||||
getPersonInfo() {
|
||||
this.loading = true;
|
||||
// 移除对未定义的$store的引用
|
||||
// 设置默认值,允许选择人员
|
||||
this.canChoosePerson = true;
|
||||
// 这里可以添加实际获取用户信息的逻辑
|
||||
// 例如从localStorage获取或调用其他API
|
||||
this.loading = false;
|
||||
this.$store.dispatch("GetInfo").then((res) => {
|
||||
if (res.data.roles.indexOf('qunzhong') == -1) {
|
||||
this.canChoosePerson = true;
|
||||
} else {
|
||||
this.canChoosePerson = false;
|
||||
getPersonBase(res.data.user.userId).then(resp => {
|
||||
this.formData.personId = resp.data.id
|
||||
this.formData.userId = resp.data.userId
|
||||
this.formData.personName = resp.data.name
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
async saveInfo() {
|
||||
this.setName()
|
||||
try {
|
||||
console.log("this.formData.personName",this.formData.personName)
|
||||
// 先检查求职说明是否为空,如果为空直接提示
|
||||
if (!this.formData.jobDescription || this.formData.jobDescription.trim() === '') {
|
||||
this.$u.toast('请填写求职说明!');
|
||||
uni.showToast({ title: '请填写求职说明!', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证表单
|
||||
// 简单的表单验证
|
||||
console.log(this.formData)
|
||||
const isValid = await this.$refs.uForm.validate();
|
||||
if (!isValid) {
|
||||
throw new Error('表单验证失败');
|
||||
if (!this.formData.personName) {
|
||||
uni.showToast({ title: '请填写姓名!', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!this.formData.jobWorkType) {
|
||||
uni.showToast({ title: '请选择求职工种!', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!this.formData.minRecruitmentSalary) {
|
||||
uni.showToast({ title: '请填写最低薪酬!', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!this.formData.highRecruitmentSalary) {
|
||||
uni.showToast({ title: '请填写最高薪酬!', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
// 显示全局加载
|
||||
this.$showLoading();
|
||||
uni.showLoading({ title: '加载中...' });
|
||||
this.formData.demandType = 1;
|
||||
// this.formData.userId = this.formData.personId
|
||||
// 根据 formData 是否有 id 来决定是更新还是新增
|
||||
@@ -536,26 +559,27 @@
|
||||
}
|
||||
// 检查响应码是否为200
|
||||
if (response.code === 200) {
|
||||
this.$u.toast(successMessage);
|
||||
uni.showToast({ title: successMessage });
|
||||
// 如果是编辑模式,关闭编辑状态;否则返回上一页
|
||||
if (this.formData.id) {
|
||||
this.edit = false;
|
||||
} else {
|
||||
await this.$delay(1000); // 延迟1秒后返回上一页
|
||||
uni.navigateBack();
|
||||
// 延迟1秒后返回
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
if(error.length){
|
||||
this.$u.toast('请填写完整信息!');
|
||||
}else{
|
||||
this.$u.toast('系统错误,请联系管理员!');
|
||||
if(error && error.length){
|
||||
uni.showToast({ title: '请填写完整信息!', icon: 'none' });
|
||||
} else {
|
||||
uni.showToast({ title: '系统错误,请联系管理员!', icon: 'none' });
|
||||
}
|
||||
// this.$u.toast('请检查必填项填写');
|
||||
|
||||
} finally {
|
||||
}
|
||||
finally {
|
||||
// 确保加载页总是会被隐藏
|
||||
this.$hideLoading();
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
popupclosed() {
|
||||
@@ -721,124 +745,154 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page {
|
||||
::v-deep .u-navbar__content {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
background-color: #EEF1F5 !important;
|
||||
height: 100vh;
|
||||
background-image: url('https://rc.jinan.gov.cn/qcwjyH5/static/images/top.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
.input-outer-part {
|
||||
padding: 0 32rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
<style scoped>
|
||||
.inner {
|
||||
background: #eef1f5;
|
||||
border-radius: 16rpx;
|
||||
|
||||
padding: 32rpx;
|
||||
margin-bottom: 24rpx;
|
||||
padding: 40rpx;
|
||||
}
|
||||
|
||||
.inner-part {
|
||||
width: 100%;
|
||||
.form-item {
|
||||
display: flex;
|
||||
margin-bottom: 40rpx;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
border-radius: 12rpx;
|
||||
padding: 20rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
/* 为表单元素添加一些间距 */
|
||||
.self-form {
|
||||
width: 100%;
|
||||
.form-label {
|
||||
width: 140rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
line-height: 1.5;
|
||||
font-weight: 500;
|
||||
margin-right: 30rpx;
|
||||
text-align: right;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 调整按钮区域样式 */
|
||||
.button-area {
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
.button-area {
|
||||
padding: 24rpx 32rpx 68rpx;
|
||||
width: calc(100% + 64rpx);
|
||||
margin-left: -32rpx;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
margin-top: 40rpx;
|
||||
border-radius: 16px 16px 0px 0px;
|
||||
|
||||
.btn {
|
||||
line-height: 72rpx;
|
||||
width: 176rpx;
|
||||
margin-right: 16rpx;
|
||||
font-size: 28rpx;
|
||||
border: 1px solid #B8C5D4;
|
||||
color: #282828;
|
||||
text-align: center;
|
||||
.form-input {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
padding: 0 25rpx;
|
||||
border: 1px solid #e8e8e8;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.reset {
|
||||
background: #DCE2E9;
|
||||
}
|
||||
|
||||
.save {
|
||||
background: linear-gradient(103deg, #1D64CF 0%, #1590D4 99%);
|
||||
color: #fff;
|
||||
border: 0;
|
||||
flex-grow: 1;
|
||||
}
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.noValue {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
.form-input:focus {
|
||||
border-color: #1989fa;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 0 3rpx rgba(25, 137, 250, 0.1);
|
||||
}
|
||||
|
||||
.form-input-disabled {
|
||||
color: #999;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.form-textarea {
|
||||
flex: 1;
|
||||
min-height: 200rpx;
|
||||
padding: 25rpx;
|
||||
border: 1px solid #e8e8e8;
|
||||
border-radius: 8rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
background-color: #fafafa;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.form-textarea:focus {
|
||||
border-color: #1989fa;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 0 3rpx rgba(25, 137, 250, 0.1);
|
||||
}
|
||||
|
||||
.form-textarea-disabled {
|
||||
color: #999;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.required {
|
||||
color: #FF4D4F;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
|
||||
.picker-view {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 80rpx;
|
||||
border: 1px solid #e8e8e8;
|
||||
border-radius: 8rpx;
|
||||
padding: 0 25rpx;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.picker-view-text {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.disabledLine {
|
||||
background: rgb(245, 247, 250);
|
||||
cursor: not-allowed;
|
||||
background-color: #f5f5f5;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.picker-view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: 28rpx 36rpx;
|
||||
background: #ffffff;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
border-radius: 12rpx;
|
||||
min-height: 88rpx;
|
||||
box-sizing: border-box;
|
||||
transition: all 0.3s ease;
|
||||
.noValue {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.picker-view:active {
|
||||
background: #f8f9fa;
|
||||
border-color: #007aff;
|
||||
.ellipsis_1 {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.picker-view text {
|
||||
color: #333333;
|
||||
font-size: 28rpx;
|
||||
flex: 1;
|
||||
/* 按钮区域样式 */
|
||||
.button-area {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 40rpx;
|
||||
gap: 30rpx;
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #eee;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.picker-view .u-icon {
|
||||
margin-left: 16rpx;
|
||||
color: #999999;
|
||||
}
|
||||
::v-deep .u-textarea{
|
||||
background-color: red !important;
|
||||
border-radius: 12rpx;
|
||||
border: 2rpx solid red;
|
||||
.btn {
|
||||
flex: 1;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
text-align: center;
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.btn.save {
|
||||
color: #fff;
|
||||
background-color: #1989fa;
|
||||
}
|
||||
|
||||
.btn.reset {
|
||||
color: #666;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
/* 图标样式优化 */
|
||||
.icon-right {
|
||||
margin-left: 20rpx;
|
||||
font-size: 36rpx;
|
||||
color: #1989fa;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
>
|
||||
<view class="picker-view">
|
||||
<text>{{ formData.qwpxgzName || '请选择工种' }}</text>
|
||||
<u-icon name="arrow-down" color="#999999"></u-icon>
|
||||
<view class="icon-right">▼</view>
|
||||
</view>
|
||||
</picker>
|
||||
<view v-else class="picker-view">
|
||||
@@ -68,7 +68,7 @@
|
||||
<view class="bordered" style="width: 100%" @click="showTime = true"
|
||||
:class="{ noValue: !formData.qwpxsj }">
|
||||
{{ formData.qwpxsj || "请选择" }}</view>
|
||||
<u-icon slot="right" name="arrow-down" color="#A6A6A6"></u-icon>
|
||||
<view class="icon-right">▼</view>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<u--form labelPosition="left" class="self-form" labelWidth="110">
|
||||
@@ -116,19 +116,19 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import {
|
||||
// getPersonBase
|
||||
// } from "@/api/person";
|
||||
// import {
|
||||
// addPersonDemand,
|
||||
// updatePersonDemand,
|
||||
// getPersonDemand
|
||||
// } from "@/api/needs/personDemand";
|
||||
// import {
|
||||
// listJobType
|
||||
// } from "@/api/jobType/index";
|
||||
// import ImageUpload from '@/components/ImageUpload'
|
||||
// import ChoosePerson from '@/pages/needs/components/choosePerson';
|
||||
import {
|
||||
getPersonBase
|
||||
} from "@/packageRc/api/personinfo/index";
|
||||
import {
|
||||
addPersonDemand,
|
||||
updatePersonDemand,
|
||||
getPersonDemand
|
||||
} from "@/packageRc/api/needs/personDemand";
|
||||
import {
|
||||
listJobType
|
||||
} from "@/packageRc/api/jobType/index";
|
||||
import ImageUpload from './ImageUpload'
|
||||
import ChoosePerson from './choosePerson';
|
||||
// import dayjs from "dayjs";
|
||||
|
||||
export default {
|
||||
@@ -258,14 +258,14 @@
|
||||
this.formData.fileUrl = this.$arrayToString(this.formData.fileUrl)
|
||||
},
|
||||
addOne() {
|
||||
this.formData = {}
|
||||
this.getPersonInfo()
|
||||
if(this.name){
|
||||
this.formData.personName = this.name
|
||||
this.formData.userId = this.needid
|
||||
}
|
||||
this.edit = true
|
||||
},
|
||||
this.formData = {}
|
||||
this.getPersonInfo()
|
||||
if(this.name){
|
||||
this.formData.personName = this.name
|
||||
this.formData.userId = this.needId
|
||||
}
|
||||
this.edit = true
|
||||
},
|
||||
workTypeRemoteMethod(key) {
|
||||
listJobType({
|
||||
workTypeName: key,
|
||||
@@ -355,8 +355,9 @@
|
||||
this.formData.demandTitle = `${this.formData.personName}_于${dayNew}_提出培训需求`
|
||||
},
|
||||
async saveInfo() {
|
||||
try {
|
||||
// 手动检查培训意愿工种是否已选择
|
||||
try {
|
||||
this.setName();
|
||||
// 手动检查培训意愿工种是否已选择
|
||||
if (!this.formData.qwpxgz || this.formData.qwpxgz.trim() === '') {
|
||||
this.$u.toast('请选择培训意愿工种!');
|
||||
return;
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
-->
|
||||
<template>
|
||||
<view class="page">
|
||||
<view class="page-header df_flex">
|
||||
<view class="page-header df_flex" style="display:flex;align-items:center;justify-content:space-between;padding:20rpx 0rpx;">
|
||||
<u-icon class="back-icon" name="arrow-left" color="#fff" size="16" @click="goBack()"></u-icon>
|
||||
<view class="title df_flex_1" style="padding-left: 32rpx;" >{{isAdd ? '需求新增' : '需求维护'}}</view>
|
||||
<u-icon style="margin-right: 32rpx;" name="list" size="44rpx" color="fff"></u-icon>
|
||||
<u-icon style="margin-right: 32rpx;" @tap="$store.commit('SET_SHOWEXITPOPUP', true)" name="list" size="44rpx" color="#fff"></u-icon>
|
||||
</view>
|
||||
<view class="tab-list" v-if="showTab != 1">
|
||||
<view class="tab" :class="{active: activeType == 1}" @click="canChangeType ? changeType(1) : ''">求职<br>需求
|
||||
@@ -19,12 +19,12 @@
|
||||
</view>
|
||||
<view class="tab" :class="{active: activeType == 5}" @click="canChangeType ? changeType(5) : ''">其他<br>需求
|
||||
</view>
|
||||
</view>
|
||||
<jobService v-if="activeType == 1" :id="id" :name="name" ref="type1" />
|
||||
<assistService v-if="activeType == 2" :id="id" :name="name" ref="type2" />
|
||||
<entrepreneurshipService :id="id" :name="name" v-if="activeType == 3" ref="type3" />
|
||||
<trainService v-if="activeType == 4" :id="id" :name="name" ref="type4" />
|
||||
<otherService v-if="activeType == 5" :id="id" :name="name" ref="type5" />
|
||||
</view>
|
||||
<jobService v-if="activeType == 1" :needId="id" :name="name" ref="type1" />
|
||||
<assistService v-if="activeType == 2" :needId="id" :name="name" ref="type2" />
|
||||
<entrepreneurshipService :needId="id" :name="name" v-if="activeType == 3" ref="type3" />
|
||||
<trainService v-if="activeType == 4" :needId="id" :name="name" ref="type4" />
|
||||
<otherService v-if="activeType == 5" :needId="id" :name="name" ref="type5" />
|
||||
<!-- 社区端 - 显示隐藏退出组件 -->
|
||||
<exitPopup />
|
||||
</view>
|
||||
@@ -56,6 +56,7 @@
|
||||
onLoad(options) {
|
||||
this.showTab = options.showTab
|
||||
this.id = options.id
|
||||
console.log("this.id",this.id)
|
||||
this.name = options.name
|
||||
if (options.id && options.type) {
|
||||
this.isAdd = false
|
||||
@@ -93,7 +94,7 @@
|
||||
.page {
|
||||
background-color: #EEF1F5 !important;
|
||||
height: 100vh;
|
||||
background-image: url('../../static/images/top.png');
|
||||
background-image: url('https://rc.jinan.gov.cn/qcwjyH5/static/images/top.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% auto;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user