添加页面

This commit is contained in:
2025-11-05 17:07:17 +08:00
parent 328721e6e9
commit 886b27218c
29 changed files with 1691 additions and 829 deletions

View File

@@ -1,7 +1,7 @@
/*
* @Date: 2025-10-31 11:06:15
* @LastEditors: lip
* @LastEditTime: 2025-11-03 12:48:30
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-05 15:33:21
*/
// 人员接口
// import { post, get } from '@/utilsRc/request'
@@ -27,7 +27,7 @@ export function getPersonList(params) {
export function addInvestigate(data) {
return request({
// url: '//process/processInterview',
url: '//timelime/timelime',
url: '/timelime/timelime',
method: 'post',
data: data
})

View File

@@ -2,7 +2,7 @@
* @Descripttion:
* @Author: lip
* @Date: 2025-11-03 12:35:56
* @LastEditors: lip
* @LastEditors: shirlwang
*/
// import { post, get } from '../../utils/request.js'
import request from '@/utilsRc/request'
@@ -28,14 +28,14 @@ export function personAlertList(params) {
export function getJbrInfo() {
return request({
method: 'get',
url: `system/center/user/selectHxjbr`,
url: `/system/center/user/selectHxjbr`,
method: 'get'
})
}
export function getPersonBase() {
return request({
method: 'get',
url: `system/center/user/selectHxjbr`,
url: `/system/center/user/selectHxjbr`,
method: 'get'
})
}

26
apiRc/timeLine/index.js Normal file
View File

@@ -0,0 +1,26 @@
import request from '@/utilsRc/request'
// 查询时间轴列表
export function timelineList(params) {
return request({
url: '/timelime/timelime/timeline',
method: 'get',
params
})
}
// 查询时间轴详情列表
export function timeList(params) {
return request({
url: '/timelime/timelime/list',
method: 'get',
params
})
}
//获取时间轴详细信息
export function timeDetails(id) {
return request({
url: '/timelime/timelime/' + id,
method: 'get'
})
}

View File

@@ -1,7 +1,7 @@
/*
* @Date: 2025-10-31 11:06:15
* @LastEditors: lip
* @LastEditTime: 2025-11-03 12:48:30
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-05 15:33:17
*/
// 人员接口
// import { post, get } from '@/utilsRc/request'
@@ -27,7 +27,7 @@ export function getPersonList(params) {
export function addInvestigate(data) {
return request({
// url: '//process/processInterview',
url: '//timelime/timelime',
url: '/timelime/timelime',
method: 'post',
data: data
})

View File

@@ -2,7 +2,7 @@
* @Descripttion:
* @Author: lip
* @Date: 2025-11-03 12:35:56
* @LastEditors: lip
* @LastEditors: shirlwang
*/
// import { post, get } from '../../utils/request.js'
import request from '@/utilsRc/request'
@@ -28,14 +28,14 @@ export function personAlertList(params) {
export function getJbrInfo() {
return request({
method: 'get',
url: `system/center/user/selectHxjbr`,
url: `/system/center/user/selectHxjbr`,
method: 'get'
})
}
export function getPersonBase() {
return request({
method: 'get',
url: `system/center/user/selectHxjbr`,
url: `/system/center/user/selectHxjbr`,
method: 'get'
})
}

View File

@@ -1,100 +1,93 @@
<template>
<view class="page">
<u-navbar
title="帮扶登记"
:autoBack="true"
bgColor="transparent"
leftIconColor="#fff"
:titleStyle="{ color: '#fff' }"
></u-navbar>
<view class="page" style="background-image: url('../../../packageRc/static/pageBg.png');">
<view class="input-outer-part">
<scroll-view scroll-y="true" style="height: calc(100vh - 100px)">
<view class="inner">
<div class="self-form">
<view class="inner-part">
<div class="form-item required">
<view class="form-item required">
<label class="form-label">被帮扶对象</label>
<input
v-model="serviceForm.serviceObjectName"
style="border: none; width: 100%; padding: 10px 0;"
style="border: none; width: 100%;"
placeholder="请输入"
disabled
/>
</div>
</view>
<div class="form-item required">
<view class="form-item required">
<label class="form-label">帮扶方式</label>
<div class="form-select-wrapper" style="position: relative;">
<view class="form-select-wrapper" style="position: relative;">
<!-- 显示区域 -->
<div
<view
class="form-value"
:class="{ 'noValue': !serviceForm.demandType }"
style="width: 100%;"
@click="showDemandTypePicker = !showDemandTypePicker"
style="width: 100%; height: 40px; padding: 0 10px; border: 1px solid #e6e6e6; border-radius: 8rpx; background-color: #fff; display: flex; align-items: center; justify-content: space-between; cursor: pointer;"
:class="!serviceForm.demandType ? 'noValue' : ''"
>
{{ getDemandTypeLabel(serviceForm.demandType) || "请选择" }}
<span class="arrow-down"></span>
</div>
</view>
<!-- 选项列表 -->
<div
<view
v-if="showDemandTypePicker"
class="options-list"
style="position: absolute; top: 45px; left: 0; right: 0; background-color: #fff; border: 1px solid #e6e6e6; border-radius: 8rpx; z-index: 1000; max-height: 200px; overflow-y: auto;"
>
<div
<view
v-for="option in demandTypeOptions"
:key="option.value"
@click="selectDemandType(option.value)"
style="padding: 10px; border-bottom: 1px solid #f0f0f0; cursor: pointer;"
>
{{ option.label }}
</div>
</div>
</div>
</div>
</view>
</view>
</view>
</view>
<div class="form-item required" v-if="serviceForm.demandType == '4' || serviceForm.demandType == '5'">
<view class="form-item required" v-if="serviceForm.demandType">
<label class="form-label">帮扶时间 <text class="required">*</text></label>
<picker mode="date" :value="serviceForm.practicalSolutionTime" start="1900-01-01" end="2100-12-31" @change="onDateChange">
<picker style="width: 100%;" mode="date" :value="serviceForm.practicalSolutionTime" start="1900-01-01" end="2100-12-31" @change="onDateChange">
<view class="date-picker-wrapper" :class="{ noValue: !serviceForm.practicalSolutionTime }">
<view v-if="serviceForm.practicalSolutionTime" class="date-value">{{ serviceForm.practicalSolutionTime }}</view>
<view v-else>请选择</view>
<view class="icon-right"></view>
<view class="arrow-down"></view>
</view>
</picker>
</div>
</view>
<div class="form-item required" v-if="serviceForm.demandType == '4' || serviceForm.demandType == '5'">
<view class="form-item required" v-if="serviceForm.demandType">
<label class="form-label">经办人</label>
<div class="form-select-wrapper">
<el-select
<view class="form-select-wrapper">
<uni-data-select
style="width: 100%"
v-model="serviceForm.agentUserId"
placeholder="请选择经办人"
:localdata="jingbrList1"
@change="handleAgentChange"
>
<el-option
</uni-data-select>
<!-- <el-option
v-for="item in jingbrList1"
:key="item.userId"
:label="item.nickName"
:value="item.userId"
></el-option>
</el-select>
</div>
</div>
></el-option> -->
</view>
</view>
<div class="form-item required" v-if="serviceForm.demandType == '5'">
<view class="form-item required" v-if="serviceForm.demandType == '5'">
<label class="form-label">电话沟通结果</label>
<div class="form-value" @click="showPicker('dhgtjg')" :class="{ noValue: !serviceForm.dhgtjg }">
{{ getDhgtjgLabel(serviceForm.dhgtjg) || "请选择" }}
<span class="arrow-down"></span>
</div>
</div>
<view class="form-value" @click="showPicker('dhgtjg')" :class="{ noValue: !serviceForm.dhgtjg }">
<view style="flex-grow: 1;">{{ getDhgtjgLabel(serviceForm.dhgtjg) || "请选择" }}</view>
<text class="arrow-down"></text>
</view>
</view>
<div class="form-item required" v-if="serviceForm.demandType == '4' || serviceForm.demandType == '5'">
<view class="form-item required" v-if="serviceForm.demandType">
<label class="form-label">帮扶内容</label>
<div class="date-picker-wrapper" :class="{ noValue: !serviceForm.serviceContent }">
<view class="date-picker-wrapper" :class="{ noValue: !serviceForm.serviceContent }">
<picker
@change="onServiceContentChange"
:range="serviceContentOptions.map(item => item.label)"
@@ -102,76 +95,59 @@
mode="selector"
>
<view class="date-value">
{{ getServiceContentLabel(serviceForm.serviceContent) || "请选择" }}
<span class="arrow-down"></span>
<view style="flex-grow: 1;">{{ getServiceContentLabel(serviceForm.serviceContent) || "请选择" }}</view>
<text class="arrow-down"></text>
</view>
</picker>
</div>
</div>
</view>
</view>
<!-- v-if="serviceForm.demandType" -->
<view class="form-item required" v-if="serviceForm.demandType">
<label class="form-label">人员状态</label>
<view class="date-picker-wrapper" :class="{ noValue: !serviceForm.personStatus }">
<picker
@change="onpersonStatusChange"
:range="personStatusOptions.map(item => item.label)"
:value="getpersonStatusIndex(serviceForm.personStatus)"
mode="selector"
>
<view class="date-value">
<view style="flex-grow: 1;">{{ getpersonStatusLabel(serviceForm.personStatus) || "请选择" }}</view>
<text class="arrow-down"></text>
</view>
</picker>
</view>
</view>
</view>
<view class="inner-part">
<div class="form-item required" v-if="serviceForm.demandType == '4' || serviceForm.demandType == '5'">
<view class="inner-part" v-if="serviceForm.demandType">
<view class="form-item required" v-if="serviceForm.demandType">
<label class="form-label">帮扶情况说明</label>
<textarea
v-model="serviceForm.blqksm"
style="width: 100%; border: none; padding: 10px 0; min-height: 100px; resize: none;"
placeholder="请输入"
></textarea>
</div>
</view>
</view>
<view class="inner-part">
<div class="form-item required" v-if="serviceForm.demandType == '4' || serviceForm.demandType == '5'">
<label class="form-label">帮扶情况说明</label>
<div class="file-upload-container">
<button class="upload-btn" @click="chooseImages" :disabled="fileList.length >= 6">
+ 添加图片 ({{ fileList.length }}/6)
</button>
<div class="file-list" v-if="fileList.length > 0">
<div v-for="(file, index) in fileList" :key="index" class="file-item">
<image :src="file.url" mode="aspectFill" class="uploaded-image"></image>
<span class="delete-btn" @click="removeImage(index)">删除</span>
</div>
</div>
</div>
</div>
</view>
<view class="inner-part" v-if="serviceForm.demandType == '4' || serviceForm.demandType == '5'">
<div class="form-item">
<view class="inner-part" v-if="serviceForm.demandType">
<view class="form-item">
<label class="form-label">附件</label>
<div style="width: 100%; padding: 10px 0;">
<button @click="triggerFileUpload" style="padding: 8px 16px; background: #f0f0f0; border: none; border-radius: 4px;">
<view style="width: 100%; padding: 10px 0;">
<button @click="chooseFiles" style="padding: 0px 24rpx; border: 1px solid #e4e4e4;border-radius: 4px;">
上传附件 (最多6个)
</button>
<!-- 简单的文件列表显示 -->
<div v-if="serviceForm.fileUrl.length > 0" class="file-list">
<div v-for="(file, index) in serviceForm.fileUrl" :key="index" class="file-item">
{{ file.name }}
<span @click="removeFile(index)" style="margin-left: 10px; cursor: pointer; color: #ff4444;">删除</span>
</div>
</div>
</div>
</div>
<view class="file-list">
<view v-for="(file, index) in fileList" :key="index" class="file-item">
{{ file.file.name }}
<text @click="removeFile(index)" style="margin-left: 10px; cursor: pointer; color: #ff4444;">删除</text>
</view>
</view>
</view>
</view>
</view>
</div>
</view>
</scroll-view>
@@ -182,40 +158,43 @@
</view>
<!-- 通用选择器 -->
<div v-if="currentPicker" class="datetime-picker-overlay">
<div class="datetime-picker">
<div class="picker-header">
<span @click="cancelPicker" style="padding: 10px;">取消</span>
<span style="font-weight: bold;">{{ getPickerTitle(currentPicker) }}</span>
<span @click="confirmPicker" style="padding: 10px; color: #007AFF;">确定</span>
</div>
<div class="picker-content">
<div v-if="currentPicker === 'practicalSolutionTime'">
<view v-if="currentPicker" class="datetime-picker-overlay">
<view class="datetime-picker">
<view class="picker-header">
<text @click="cancelPicker" style="padding: 10px;">取消</text>
<text style="font-weight: bold;">{{ getPickerTitle(currentPicker) }}</text>
<text @click="confirmPicker" style="padding: 10px; color: #007AFF;">确定</text>
</view>
<view class="picker-content">
<view v-if="currentPicker === 'practicalSolutionTime'">
<input
type="datetime-local"
v-model="manualDateTime"
style="width: 100%; padding: 15px; box-sizing: border-box;"
/>
</div>
<div v-else class="picker-options">
<div
</view>
<view v-else class="picker-options">
<view
v-for="option in getPickerOptions(currentPicker)"
:key="option.value"
@click="selectPickerOption(option.value)"
:class="{ 'selected': selectedOption === option.value }"
>
{{ option.label }}
</div>
</div>
</div>
</div>
</div>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {getJbrInfo} from "../../api/personinfo/index"
import config from '@/utilsRc/config.js'
import {getJbrInfo} from "@/apiRc/personinfo/index"
import {addInvestigate} from "@/apiRc/needs/person"
import { getDicts } from '@/apiRc/system/dict.js';
import { getToken } from "@/utilsRc/auth";
export default {
data() {
return {
@@ -233,6 +212,14 @@ export default {
fileUrl: [] // 附件
},
personStatusMap: {
'1': '就业政策咨询',
'2': '职业指导',
'3': '技能培训',
'4': '岗位推荐',
'5': '创业指导',
'6': '其他'
},
serviceContentMap: {
'1': '就业政策咨询',
'2': '职业指导',
@@ -291,6 +278,15 @@ export default {
}));
}
});
getDicts('qyjy_dhgtjg').then(res => {
if (res.data && Array.isArray(res.data)) {
// 将字典数据转换为picker组件需要的格式
this.dhgtjgOptions = res.data.map(item => ({
value: item.dictValue,
label: item.dictLabel
}));
}
});
// 使用getDicts API获取人员状态字典数据
getDicts('qcjy_ryzt').then(res => {
@@ -312,32 +308,118 @@ export default {
},
methods: {
// 选择图片
chooseImages() {
chooseFiles() {
const remainingCount = 6 - this.fileList.length;
if (remainingCount <= 0) {
uni.showToast({ title: '最多只能上传6张图片', icon: 'none' });
return;
}
uni.chooseImage({
console.log(wx, 'wx')
wx.chooseMessageFile({
count: remainingCount,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
extension: ['.png', '.jpg', '.jpeg', '.doc', '.docx', '.pdf', '.xls', '.xlsx' ],
success: (res) => {
// 添加新选择的图片到列表
res.tempFilePaths.forEach((path, index) => {
console.log('选择文件成功:', res);
let arr = [];
let path = "";
const twoMBInBytes = 2 * 1024 * 1024; // 2MB转换为字节数
res.tempFiles.forEach((file) => {
if (file.size > twoMBInBytes) {
uni.showToast({
title: "图片大小不能超过2MB",
icon: "none",
});
return;
}
if (res.tempFiles && res.tempFiles.length > 0) {
path = file.path;
if (['png', 'jpg', 'jpeg', 'doc', 'docx', 'pdf', 'xls', 'xlsx' ].indexOf(path.split(".")[1])!=-1) {
uni.showLoading();
const tempFilePath = file;
uni.uploadFile({
url: config.baseUrl+'/system/oss/upload', //图片上传地址
filePath: tempFilePath.path,
name: 'file',
formData: {},
header: {
// 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJzeXNfdXNlcjoxIiwicm5TdHIiOiJQSlUyVlJCc1E1aXRMMWgxdjNkcVh2eER1c2VVc0hvRiIsInVzZXJJZCI6MX0.z4Z2XqgXyU0GQU-i7Bsa5T-zCKApTxj1YQ73rk7bAVo'
'Authorization': 'Bearer ' + getToken(),
},
success: (res) => {
var data = JSON.parse(res.data);
console.log(data, 'sdfjiosdjfoi')
if(data.code==200) {
this.fileList.push({
url: path,
file: res.tempFiles[index]
url: data.data.url,
file: file
})
this.serviceForm.fileUrl = this.fileList.map(item => item.url).join(',')
this.$forceUpdate()
uni.hideLoading();
} else {
uni.hideLoading();
uni.showToast({
title: res.msg || '上传失败',
icon: 'none',
duration: 2000
});
}
},
fail: (error) => {
uni.showToast({
title: '上传失败',
icon: 'none'
});
console.error(error);
}
})
} else {
uni.showToast({
icon: "none",
duration: 1500,
title: `只能选择${['.png', '.jpg', '.jpeg', '.doc', '.docx', '.pdf', '.xls', '.xlsx' ].join('、')}格式文件`,
});
}
}
})
// // 添加新选择的图片到列表
// res.tempFiles.forEach((item, index) => {
// this.fileList.push({
// url: item.path,
// file: res.tempFiles[index]
// });
// });
// 更新 serviceForm.fileUrl
this.updateFileUrls();
// this.updateFileUrls();
},
fail: (err) => {
console.error('选择图片失败:', err);
}
});
// uni.chooseImage({
// count: remainingCount,
// sizeType: ['original', 'compressed'],
// sourceType: ['album', 'camera'],
// success: (res) => {
// // 添加新选择的图片到列表
// res.tempFilePaths.forEach((path, index) => {
// this.fileList.push({
// url: path,
// file: res.tempFiles[index]
// });
// });
// // 更新 serviceForm.fileUrl
// this.updateFileUrls();
// },
// fail: (err) => {
// console.error('选择图片失败:', err);
// }
// });
},
// 移除图片
@@ -351,9 +433,16 @@ export default {
updateFileUrls() {
this.serviceForm.fileUrl = this.fileList.map(file => file.url);
},
async getJbrInfo11(){
const res=await getJbrInfo()
this.jingbrList1=res
getJbrInfo11(){
getJbrInfo().then(res => {
console.log(res, 'joisdfjiosdfjio')
this.jingbrList1=res.map(ele => {
return {
value: ele.userId,
text: ele.nickName
}
})
})
},
// 显示选择器
showPicker(type) {
@@ -374,7 +463,7 @@ export default {
this.serviceForm[this.currentPicker] = this.selectedOption;
// 特殊处理经办人,同时保存名称
if (this.currentPicker === 'agentUserId') {
const agent = this.jingbrList1.find(item => item.userId === this.selectedOption);
const agent = this.jingbrList1.find(item => item.value === this.selectedOption);
this.serviceForm.agentUserName = agent ? agent.nickName : '';
}
}
@@ -413,7 +502,7 @@ export default {
},
// 获取经办人名称
getAgentUserName(userId) {
const agent = this.jingbrList1.find(item => item.userId === userId);
const agent = this.jingbrList1.find(item => item.value === userId);
return agent ? agent.nickName : '';
},
// 处理经办人选择变化
@@ -422,7 +511,7 @@ export default {
this.serviceForm.agentUserName = '';
return;
}
const user = this.jingbrList1.find(item => item.userId === value);
const user = this.jingbrList1.find(item => item.value === value);
if (user) {
this.serviceForm.agentUserName = user.nickName;
} else {
@@ -449,6 +538,11 @@ export default {
getServiceContentLabel(value) {
return this.serviceContentMap[value] || '';
},
// 获取帮扶内容标签
getpersonStatusLabel(value) {
let arr = this.personStatusOptions.filter(item => item.value == value)
return arr.length ? arr[0].label : ''
},
// 处理帮扶内容选择变化
onServiceContentChange(e) {
@@ -457,6 +551,13 @@ export default {
this.serviceForm.serviceContent = this.serviceContentOptions[index].value;
}
},
// 处理人员状态选择变化
onpersonStatusChange(e) {
const index = e.detail.value;
if (this.personStatusOptions && this.personStatusOptions[index]) {
this.serviceForm.personStatus = this.personStatusOptions[index].value;
}
},
// 获取帮扶内容当前索引
getServiceContentIndex(value) {
@@ -464,6 +565,11 @@ export default {
const index = this.serviceContentOptions.findIndex(item => item.value === value);
return index !== -1 ? index : 0;
},
getpersonStatusIndex(value) {
if (!value) return 0;
const index = this.personStatusOptions.findIndex(item => item.value === value);
return index !== -1 ? index : 0;
},
// 格式化日期时间为YYYY-MM-DDTHH:MM格式datetime-local输入框需要
formatDateTime(date) {
const year = date.getFullYear();
@@ -574,17 +680,23 @@ export default {
const submitData = {
...this.serviceForm,
// 格式化文件数据
fileUrl: JSON.stringify(this.serviceForm.fileUrl)
// fileUrl: JSON.stringify(this.serviceForm.fileUrl)
fileUrl: this.fileList.map(item => item.url).join(',')
};
// 打印提交数据
console.log('提交数据:', submitData);
// 模拟API调用延迟
await new Promise(resolve => setTimeout(resolve, 1000));
// await new Promise(resolve => setTimeout(resolve, 1000));
addInvestigate(submitData).then(res => {
if(res.code == 200){
uni.showToast({ title: '保存成功', icon: 'success' });
setTimeout(() => {
uni.navigateBack();
}, 1000);
}
})
} catch (error) {
console.error(error);
uni.showToast({ title: '保存失败', icon: 'none' });
@@ -599,25 +711,22 @@ export default {
<style lang="scss" scoped>
.page {
height: 100vh;
background-color: #eef1f5 !important;
background-color: #f4f4f4 !important;
background-image: url("~@/packageRc/static/images/top.png");
background-repeat: no-repeat;
background-size: 100% auto;
}
.input-outer-part {
background: #eef1f5;
padding: 32rpx;
padding-top: 100rpx; /* 增加顶部内边距,防止内容被遮挡 */
position: relative;
top: -80rpx;
border-radius: 32rpx 32rpx 0 0;
}
.inner {
.inner-part {
background: #fff;
padding: 0 32rpx;
padding: 24rpx 32rpx;
border-radius: 16rpx;
margin-bottom: 20rpx;
}
@@ -631,21 +740,21 @@ export default {
.form-item {
display: flex;
align-items: flex-start;
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid #f0f0f0;
box-sizing: border-box;
}
/* 选择器容器样式 */
.form-select-wrapper {
flex: 1;
padding: 5px 0;
position: relative;
}
.form-select {
width: 100%;
padding: 20rpx;
padding: 0 20rpx;
line-height: 64rpx;
box-sizing: border-box;
border: 1px solid #e6e6e6;
border-radius: 8rpx;
font-size: 28rpx;
@@ -664,7 +773,7 @@ export default {
.form-select-wrapper::after {
content: '▼';
position: absolute;
right: 30rpx;
right: 20rpx;
top: 50%;
transform: translateY(-50%);
pointer-events: none;
@@ -683,19 +792,33 @@ export default {
flex-shrink: 0;
font-size: 14px;
color: #333;
padding: 10px 0;
height: 64rpx;
display: flex;
align-items: center;
}
.form-value {
flex: 1;
padding: 10px 0;
height: 64rpx;
font-size: 14px;
color: #666;
box-sizing: border-box;
border: 1px solid #e6e6e6;
display: flex;
justify-content: space-between;
padding: 0 24rpx;
// justify-content: space-between;
align-items: center;
}
input{
flex: 1;
line-height: 64rpx;
height: 64rpx;
font-size: 14px;
color: #666;
}
.form-value.noValue {
color: #999;
}
@@ -713,11 +836,19 @@ export default {
.form-input-wrapper {
flex: 1;
position: relative;
padding: 0;
box-sizing: border-box;
}
picker{
width: 100%;
.date-value{
width: 100%;
display: flex;
}
}
.form-input-wrapper input {
width: 100%;
padding: 10px 0;
border: none;
outline: none;
font-size: 14px;
@@ -774,54 +905,6 @@ export default {
width: 100%;
padding: 10px 0;
}
.upload-btn {
padding: 10px 20px;
background-color: #f0f0f0;
border: 1px dashed #ddd;
border-radius: 4px;
color: #666;
margin-bottom: 10px;
width: 100%;
}
.upload-btn:disabled {
opacity: 0.6;
}
.file-list {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.file-item {
position: relative;
width: 100px;
height: 100px;
}
.uploaded-image {
width: 100%;
height: 100%;
border-radius: 4px;
}
.delete-btn {
position: absolute;
top: -8px;
right: -8px;
background-color: #ff4444;
color: white;
width: 20px;
height: 20px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
}
/* 选择器样式 */
.datetime-picker-overlay {
position: fixed;
@@ -855,12 +938,12 @@ export default {
background-color: #fafafa;
}
.picker-header > span:first-child {
.picker-header > text:first-child {
color: #666;
font-size: 16px;
}
.picker-header > span:last-child {
.picker-header > text:last-child {
color: #1d64cf;
font-size: 16px;
font-weight: 500;
@@ -875,7 +958,7 @@ export default {
padding: 5px 0;
}
.picker-options > div {
.picker-options > view {
padding: 16px 20px;
font-size: 16px;
color: #333;
@@ -885,22 +968,22 @@ export default {
align-items: center;
}
.picker-options > div:not(:last-child) {
.picker-options > view:not(:last-child) {
border-bottom: 1px solid #f8f8f8;
}
.picker-options > div:active {
.picker-options > view:active {
background-color: #f5f5f5;
}
.picker-options > div.selected {
.picker-options > view.selected {
background-color: #f0f7ff;
color: #1d64cf;
font-weight: 500;
}
/* 添加选中状态的对勾图标 */
.picker-options > div.selected::after {
.picker-options > view.selected::after {
content: '✓';
position: absolute;
right: 20px;
@@ -914,18 +997,22 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
width: 100%;
box-sizing: border-box;
padding: 0 24rpx;
height: 64rpx;
border: 1px solid #ddd;
border-radius: 4px;
background-color: #fff;
}
.date-picker-wrapper.noValue {
background-color: #f9f9f9;
}
// .date-picker-wrapper.noValue {
// background-color: #f9f9f9;
// }
.date-value {
color: #333;
width: 100%
}
.icon-right {

View File

@@ -0,0 +1,523 @@
<template>
<view class="job-list" style="background-image: url('/packageRc/static/pageBg.png');">
<!-- <view class="top_box_bg">
<image src="/packageRc/static/pageBg.png" width="750rpx" height="496rpx" />
</view> -->
<view class="job-list__content" style="height: calc(-32rpx + 100vh)">
<view style="display: flex; justify-content: space-between;">
<input style="border: 1px solid #e4e4e4;height: 64rpx;padding: 0 16rpx;flex-grow: 1;border-radius: 30rpx;"
placeholder="输入经办人姓名进行搜索"
border="surround"
v-model="queryParams.agentUserName"
shape="circle"
:customStyle="customInputStyle"
/>
<!-- <view slot="suffix">
<u-icon
@tap="handleSearch"
name="search"
color="#2979ff"
size="28"
></u-icon>
</view> -->
<button
class="custom-style"
@click="openshow"
>{{ filterTotal > 0 ? '筛选+' + filterTotal : '筛选' }}</button>
</view>
<view
v-if="total"
style="position: relative; padding-top: 16px; color: #000"
>
<text> {{ total }} </text>
</view>
<scroll-view
class="job-list__scroll"
scroll-y="true"
@scrolltolower="loadMoreJobs"
>
<view
class="jobSearchListview"
v-for="(item, index) in tableList"
:key="item.id"
@click="goNeedsDetail(item)"
>
<view class="custom_timeline_marker">
<view class="custom_timeline_line" :class="{ last: index === item.length - 1 }"></view>
<view class="custom_timeline_point active"></view>
</view>
<view class="job-list__item inner">
<view class="job-list__item-detail" style="margin: 0">{{ item.practicalSolutionTime }}</view>
<div style="display: flex;justify-content: space-between;">
<view class="job-list__item-detail" style="color: #333">{{ selectDictLabel(serviceTypeList, item.demandType) }}</view>
<view class="job-list__item-detail">
<text>经办人:</text>
<text>{{ item.agentUserName || "-" }}</text>
</view>
</div>
</view>
</view>
</scroll-view>
</view>
<uni-popup ref="show" @close="close" @open="open" backgroundColor="#fff" type="bottom">
<view class="dialog_div">
<view class="dialog_div_top">
<view @click="close">取消</view>
<view @click="handleSearch">确定</view>
</view>
<view>
<view class="df_flex">
<view class="text">服务类别</view>
<view class="df_flex_items">
<view
class="item"
@click="handleServiceStatus('demandType', item)"
:class="
item.dictValue == queryParams.demandType ? 'item-active' : ''
"
v-for="item in serviceTypeList"
:key="item.dictValue"
>{{ item.dictLabel }}</view
>
</view>
</view>
</view>
<view class="dialog_div_btn">
<u-button class="reset-style" text="重 置" @click="reset"></u-button>
<u-button
class="sure-style"
text="确 定"
@click="handleSearch"
></u-button>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import { timeList } from "@/apiRc/timeLine";
export default {
name: "serviceRecord",
data() {
return {
total: 0,
tableList: [],
serviceTypeList: [
{
dictLabel: "全部",
dictValue: "",
},
],
loading: false,
status: "more", // 加载更多状态
customInputStyle: {
background: "#fff",
height: "40rpx",
},
filterTotal: 0,
show: false,
userId:"",
queryParams: {
page: 1,
size: 10,
demandType: "",
serviceObjectName: "",
userId:""
},
};
},
onLoad(options) {
this.queryParams.userId = options.userId;
this.userId = options.userId;
this.$getDict("qcjy_fwlx").then((res) => {
this.serviceTypeList = this.serviceTypeList.concat(res.data);
});
},
mounted() {
this.getList();
},
methods: {
openshow() {
this.$refs.show.open();
},
selectDictLabel(datas, value) {
if (value === undefined) {
return ''
}
var actions = []
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + value)) {
actions.push(datas[key].dictLabel)
return true
}
})
if (actions.length === 0) {
actions.push(value)
}
return actions.join('')
},
open() {
// console.log('open');
},
reset() {
this.queryParams = {
page: 1,
size: 10,
demandType: "",
serviceObjectName: "",
userId:this.userId
};
this.filterTotal = 0;
},
close() {
this.$refs.show.close();
// console.log('close');
},
goNeedsDetail(item) {
let needsType = "";
// 走访调查和电话沟通,统一页面,不查需求
if (item.demandType == 4||item.demandType == 5) {
uni.navigateTo({
url: `/pages/community/investigationDetails?id=${item.id}`,
});
} else {
if (item.demandType == 1) {
needsType = 1;
}
if (item.demandType == 2) {
needsType = 3;
}
if (item.demandType == 3) {
needsType = 4;
}
if (item.demandType == 9) {
needsType = 5;
}
uni.navigateTo({
url: `/packageRc/pages/needs/needDetail?id=${item.businessId}&type=${needsType}&showTab=1`,
});
}
},
handleServiceStatus(label, item) {
this.filterTotal = 0;
this.queryParams[label] = item.dictValue;
for (const key in this.queryParams) {
if (key == "demandType" || key == "personType" || key == "gender") {
this.filterTotal += this.queryParams[key] ? 1 : 0;
}
}
},
// 加载更多
loadMoreJobs() {
if (this.tableList.length >= this.total || this.status === "noMore")
return;
this.queryParams.pageNum += 1;
this.getList();
},
// 获取列表
async getList(reset = false) {
if (this.loading) return;
this.loading = true;
// 重置数据
if (reset) {
this.tableList = [];
this.queryParams.pageNum = 1;
}
const { code, rows, total } = await timeList(this.queryParams);
if (code === 200) {
this.tableList = [...this.tableList, ...rows];
this.tableList.forEach((element) => {
this.$set(element, "isEye", false);
});
this.total = total;
this.status = this.tableList.length >= this.total ? "noMore" : "more";
}
this.loading = false;
},
// 搜索功能处理
handleSearch() {
console.log(this.queryParams,"查询参数")
this.show = false;
this.$refs.show.close();
this.getList(true);
},
getTimeList() {
timeList(this.queryParams).then((res) => {
if (res.code == 200) {
this.tableList = res.rows;
this.total = res.total;
}
});
},
},
};
</script>
<style lang="scss" scoped>
.job-list__content {
overflow: auto;
box-sizing: border-box;
}
.job-list {
padding:32rpx;
background-color: #f4f4f4;
box-sizing: border-box;
width: 100%;
margin: 0 auto;
background-repeat: no-repeat;
&__navbar {
height: 80rpx;
}
&__content {
box-sizing: border-box;
position: relative;
padding: 32rpx;
z-index: 10;
width: 100%;
background-color: #fff;
border-radius: 32rpx 32rpx 0 0;
border: 1px solid #fff;
}
&__scroll {
margin-top: 10rpx;
height: calc(100vh - 320rpx);
}
&__item {
position: relative;
padding: 32rpx;
background-color: #d0dcee;
border-radius: 16rpx;
font-size: 28rpx;
.tips {
position: absolute;
right: 0;
top: 0;
min-width: 40rpx;
padding: 0 24rpx;
height: 40rpx;
line-height: 40rpx;
color: #1ace62;
border-radius: 0px 16rpx 0px 16rpx;
background-color: #d9f9ed;
border: 1px solid #58e6a2;
}
}
&__item-detail {
margin-top: 20rpx;
color: #8e8e8e;
view,
text:last-child {
margin-left: 10rpx;
color: #333;
}
}
.tab_list {
margin-top: 30rpx;
height: 86rpx;
color: #ce6b1a;
border-top: 1px solid #eff2f6;
}
.items {
margin-top: 30rpx;
border-top: 1px solid #d0dcee;
}
.post_job_btn {
position: fixed;
bottom: 120rpx;
right: 16rpx;
width: 150rpx;
height: 150rpx;
border-radius: 50%;
z-index: 20;
background: url("https://rc.jinan.gov.cn/qcwjyH5/static/images/addPersonnel.png") no-repeat;
background-size: 100% 100%;
}
.dialog_form {
padding: 30rpx;
width: 80vw;
.tadio {
height: 100rpx;
}
.btn {
margin-top: 100rpx;
}
}
}
.jobSearchListview {
margin-top: 20rpx;
width: 100%;
// padding: 30rpx;
box-sizing: border-box;
position: relative;
display: flex;
justify-content: space-between;
.inner{
flex-grow: 1;flex-shrink: 1;
border-radius: 8px;
// background: #ffffff;
}
.custom_timeline_marker {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
margin-right: 40rpx;
// width: 16rpx;
/* 虚线样式 */
.custom_timeline_line {
position: absolute;
width: 4rpx;
top: 0;
bottom: 0;
height: 160rpx;
background: repeating-linear-gradient(to bottom,
#76A0DF 0px,
#76A0DF 8rpx,
transparent 8rpx,
transparent 16rpx);
&.last {
display: none;
}
}
.custom_timeline_point {
z-index: 1;
/* 确保点覆盖在线条之上 */
width: 16rpx;
height: 16rpx;
background-color: #fff;
border-radius: 50%;
border: 10rpx solid #e0e0e0;
&.active {
border: 10rpx solid #007aff;
}
}
}
.jobSearchListview_currentStatus {
position: absolute;
right: 40rpx;
top: 40rpx;
}
.jobSearchListview_name {
font-size: 38rpx;
font-weight: bold;
color: #282828;
}
.salaryExpectation {
margin-top: 20rpx;
display: flex;
align-items: center;
.salary {
font-size: 38rpx;
font-weight: bold;
color: #fa6553;
}
}
}
.job-list__item-btn {
height: 60rpx;
margin-top: 40rpx;
border-top: 1px solid #eee;
display: flex;
justify-content: space-between;
color: #1a62ce;
font-size: 26rpx;
.btn {
width: 50%;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
margin-top: 10rpx;
}
}
.custom-style {
background-color: #4d89e3;
width: 150rpx;
color: #fff;
margin-left: 30rpx;
line-height: 64rpx;
font-size: 24rpx;
border: 1px solid #1a62ce;
border-radius: 50px;
}
.dialog_div {
.dialog_div_top {
height: 100rpx;
border-bottom: 1px solid #e6e6e6;
padding: 30rpx;
box-sizing: border-box;
display: flex;
justify-content: space-between;
color: #077dfe;
}
.df_flex_items {
display: flex;
flex-wrap: wrap;
flex: 1;
}
.df_flex {
display: flex;
margin-top: 30rpx;
margin-left: 30rpx;
.text {
width: 140rpx;
display: flex;
justify-content: flex-end;
}
.item-active {
background: linear-gradient(90deg, #1a62ce 0%, #1d8ace 100%) !important;
color: #fff;
}
.item {
background: #f2f4f7;
margin: 0 20rpx;
margin-bottom: 10rpx;
padding: 10rpx 20rpx;
border-radius: 8px;
}
}
.dialog_div_btn {
display: flex;
margin: 40rpx;
.reset-style {
width: 200rpx;
background: #ffffff;
margin-right: 40rpx;
color: #3d3d3d;
}
.sure-style {
background: linear-gradient(270deg, #4370e5 0%, #53a0ea 100%);
color: #ffffff;
}
}
}
.describe {
//最多显示两行
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
</style>

View File

@@ -1,7 +1,7 @@
<!--
* @Date: 2025-10-16 15:15:47
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-03 17:41:33
* @LastEditTime: 2025-11-04 16:34:54
-->
<template>
<view>
@@ -50,7 +50,7 @@
<view class="title-item active"><view>待办需求预警列表</view></view>
<view> {{jobList1count}}条信息</view>
</view>
<view v-for="(item, index) in jobList1" :key="index" class="job-list">
<view v-for="(item, index) in jobList1" :key="index" class="job-list" @click="toNeedDetail(item)">
<view class="title">{{ item.personName }} {{ item.deptName }}</view>
<view class="info">
{{getDictLabel(item.demandType, qcjy_xqlx)}}_{{ item.jobDescription }}
@@ -137,6 +137,14 @@ function goPersonalList() {
url: '/packageRc/pages/personalList/personalList'
});
}
function toNeedDetail(item) {
let demandType = item.demandType == 1 ? 1 : item.demandType == 2 ? 3 :item.demandType == 3 ? 4 :item.demandType == 9 ? 5 : '';
console.log('toNeedDetail', demandType)
uni.navigateTo({
url: `/packageRc/pages/needs/needDetail?showTab=1&type=${demandType}&id=${item.id}&name=${item.personName}`
// url: `/packageRc/pages/demand/demandail?showTab=1&type=${demandType}&id=${item.id}&name=${item.personName}`
});
};
function back() {
uni.navigateBack({
delta: 1

View File

@@ -8,8 +8,8 @@
alt=""
/>
<view class="serviceFrequency" @tap="
$tab.navigateTo(
`/pages/community/serviceRecord?userId=${form.userId}`
uni.navigateTo(
{url:`/packageRc/pages/daiban/bangfuList?userId=${form.userId}`}
)
">
<view>服务次数 {{ serviceTotal }}</view>
@@ -20,14 +20,7 @@
>
</view>
<view class="content">
<view
class="personnelInformation"
@tap="
$tab.navigateTo(
`/pages/community/personEdit?id=${form.id}&type=edit`
)
"
>
<view class="personnelInformation">
<view class="left">
<view class="left_name">{{ form?.name || '' }}</view>
<view style="margin-top: 10rpx">
@@ -420,6 +413,93 @@
></u-datetime-picker> -->
<!-- 社区端 - 显示隐藏退出组件 -->
<exitPopup />
<uni-popup background-color="#fff" type="bottom"
ref="openDeal"
style="position: relative; z-index: 100"
closeOnClickOverlay
@close="openDeal = false"
>
<view style="padding: 32rpx;">
<uni-forms style="width: 100%;"
class="self-form"
labelPosition="top"
:model="formData"
:rules="rules"
ref="uForm"
labelWidth="300"
>
<uni-forms-item label="实际解决时间" prop="actualSolveDate" required>
<view
class="picker-view"
:class="{ selected: formData.actualSolveDate }"
@click="showTime = true"
>
<uni-datetime-picker
type="date"
:value="formData.actualSolveDate"
start="2021-3-20"
end="2030-6-20"
@change="change"
/>
<!-- <text :class="formData.actualSolveDate ? 'picker-text' : 'picker-placeholder'">
{{ formData.actualSolveDate || "请选择实际解决时间" }}
</text> -->
</view>
</uni-forms-item>
<uni-forms-item label="经办人" prop="agentUserName" required>
<view class="input-view">
<input
v-model="formData.agentUserName"
border="none"
placeholder="请输入经办人姓名"
:customStyle="{
padding: '28rpx 36rpx',
fontSize: '28rpx',
color: '#333333'
}"
/>
</view>
</uni-forms-item>
<uni-forms-item label="附件" prop="fileUrl">
<ImageUpload
:fileList="fileList"
@update="changeFile"
:maxCount="6"
/>
</uni-forms-item>
<uni-forms-item label="解决说明" prop="solveDesc" required>
<view class="textarea-view">
<textarea
v-model="formData.solveDesc"
placeholder="请输入解决说明"
:customStyle="{
padding: '28rpx 36rpx',
fontSize: '28rpx',
color: '#333333',
minHeight: '120rpx'
}"
></textarea>
</view>
</uni-forms-item>
</uni-forms>
</view>
<view class="button-area">
<view class="btn" @click="closeopenDeal">取消</view>
<view
class="btn reset"
@click="
formData.actualSolveDate = '';
formData.solveDesc = '';
"
>重置</view
>
<view class="btn save" @click="finishJobRecommend(needsType)"
>办结</view
>
</view>
</uni-popup>
</view>
</template>
@@ -428,15 +508,15 @@
import { getPersonInfo } from "../../api/company/index.js";
// import { listJobService, serviceTraceability } from "@/api/needs/jobService";
import { listPersonDemand, delPersonDemand } from "../../api/needs/personDemand";
// import { requirementCompletion } from "@/api/company";
import { requirementCompletion } from "@/apiRc/company/index";
// import { listEntrepreneurshipService } from "@/api/needs/entrepreneurshipService";
// import { listTrainService, delTrainService } from "@/api/needs/trainService";
import { listJobType } from "../../api/jobType/index";
// import ImageUpload from "@/packageRc/components/ImageUpload";
import ImageUpload from "@/packageRc/components/ImageUpload";
export default {
name: "serviceDetails",
components: {
//ImageUpload,
ImageUpload,
},
data() {
@@ -554,6 +634,9 @@ export default {
},
methods: {
closeopenDeal() {
this.$refs.openDeal.close();
},
// 返回上一页
goBack() {
uni.navigateBack();
@@ -613,20 +696,11 @@ export default {
try {
const url = `/packageRc/pages/daiban/addbangfu?id=${this.form?.userId || ''}&name=${this.form.name}`;
// const url = `/packageRc/pages/service/serviceDetail?id=${this.form?.userId || ''}&name=${this.form.name}`;
console.log("导航URL:", url);
uni.navigateTo({
url: url,
success: () => {
console.log("导航成功");
},
fail: (err) => {
console.error("导航失败:", err);
uni.showToast({
title: '导航失败: ' + JSON.stringify(err),
icon: 'none'
});
}
});
} catch (error) {
console.error("执行出错:", error);
@@ -637,6 +711,9 @@ export default {
}
},
goNeedsDetail(item, needsType) {
// uni.navigateTo({
// url: `/packageRc/pages/demand/demandail?id=${item.id}&type=${needsType}&showTab=1`,
// });
uni.navigateTo({
url: `/packageRc/pages/needs/needDetail?id=${item.id}&type=${needsType}&showTab=1`,
});
@@ -665,14 +742,17 @@ export default {
}
}
},
confirmDate(e) {
this.showTime = false;
// 获取选中的日期
const date = e.value;
// 使用 uView 的 uTime 方法格式化日期,包含时分秒
const formattedDateTime = uni.$u.timeFormat(date, "yyyy-mm-dd hh:MM:ss");
// 设置表单数据
this.formData.actualSolveDate = formattedDateTime;
// confirmDate(e) {
// this.showTime = false;
// // 获取选中的日期
// const date = e.value;
// // 使用 uView 的 uTime 方法格式化日期,包含时分秒
// const formattedDateTime = uni.$u.timeFormat(date, "yyyy-mm-dd hh:MM:ss");
// // 设置表单数据
// this.formData.actualSolveDate = formattedDateTime;
// },
change(e) {
this.formData.actualSolveDate = e
},
removeRowData(data) {
//确实要删除的提示
@@ -702,7 +782,8 @@ export default {
},
goAddNeeds() {
uni.navigateTo({
url: `/packageRc/pages/demand/demandail?activeType=${1}&id=${this.form.userId}&name=${this.form.name}`,
url: `/packageRc/pages/needs/needDetail?userId=${this.form.userId}&type=1&name=${this.form.name}`,
// url: `/packageRc/pages/demand/demandail?activeType=${1}&id=${this.form.userId}&name=${this.form.name}`,
success: function() {
console.log('导航成功')
@@ -741,12 +822,12 @@ export default {
},
// 办结按钮
async finishJobRecommend(needsType) {
uni.showLoading();
try {
// 先进行表单校验
await this.$refs.uForm.validate();
// 校验通过后再走后续逻辑
this.$showLoading();
const url = "/manage/personDemand/demandDone";
if (!url) {
throw new Error("无效的需求类型");
@@ -754,8 +835,8 @@ export default {
const { code, msg } = await requirementCompletion(url, this.formData);
if (code === 200) {
this.$u.toast('办结成功');
this.openDeal = false;
uni.showToast({title: '办结成功', icon: 'none'});
this.$refs.openDeal.close();
this.getListPersonDemand();
this.serviceTraceability();
}
@@ -770,9 +851,9 @@ export default {
} else {
msg = '请检查必填项填写';
}
this.$u.toast(msg);
uni.showToast({title: msg, icon: 'none'});
} finally {
this.$hideLoading();
uni.hideLoading();
}
},
// 需求推荐/培训
@@ -802,7 +883,8 @@ export default {
},
// 需求办结
requirementHandling(item, needsType) {
this.openDeal = true;
// this.openDeal = true;
this.$refs.openDeal.open();
this.needsType = needsType;
this.formData = {
id: item.id,

View File

@@ -1,11 +1,11 @@
<!--
* @Date: 2024-10-08 14:29:36
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-03 15:43:51
* @LastEditTime: 2025-11-04 15:55:41
-->
<template>
<view class="container">
<scroll-view scroll-y="true" :style="{height: edit?'calc(90vh - 150px)':'calc(100vh - 144px)'}">
<scroll-view scroll-y="true" :style="{height: edit?'calc(100vh - 380rpx)':'calc(100vh - 194rpx)'}">
<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"

View File

@@ -1,11 +1,11 @@
<!--
* @Date: 2024-10-08 14:29:36
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-04 13:53:56
* @LastEditTime: 2025-11-04 16:30:05
-->
<template>
<view class="container">
<scroll-view scroll-y="true" >
<scroll-view scroll-y="true" :style="{height: edit?'calc(100vh - 380rpx)':'calc(100vh - 194rpx)'}">
<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"
@@ -160,6 +160,8 @@
<!-- 工种选择器弹窗 -->
<choose-person ref="personChooser" @confirm="personNameConfirm" />
<PlacePicker ref="placePicker" @selected="handleSelected" />
</scroll-view>
<view class="button-area" v-if="edit">
<view class="btn" @click="cancelPage">取消</view>
@@ -171,26 +173,24 @@
<script>
import {
getPersonBase
} from "@/packageRc/api/personinfo/index";
} from "@/apiRc/person";
import {
addPersonDemand,
updatePersonDemand,
getPersonDemand
} from "@/packageRc/api/needs/personDemand";
} from "@/apiRc/needs/personDemand";
import {
listJobType
} from "@/packageRc/api/jobType/index";
import ImageUpload from './ImageUpload'
import ChoosePerson from './choosePerson';
} from "@/apiRc/jobType/index";
import ImageUpload from '/packageRc/components/ImageUpload'
import ChoosePerson from '/packageRc/pages/needs/components/choosePerson';
import PlacePicker from "/packageRc/components/placePicker";
//import uPopup from 'uview-ui/components/u-popup/u-popup.vue'
export default {
components: {
ChoosePerson,
ImageUpload,
PlacePicker,
// uPopup
},
props: {
needId: {
@@ -209,8 +209,6 @@
dates: {},
currentCommunityId: '',
showPickerPicker: false,
canChoosePerson: true,
canChoosePerson: true,
formData: {
demandType:"1",
personName: '',
@@ -228,7 +226,6 @@
jobDescription: '',
// fileUrl: []
},
bfnrzd:[],
rules: {
personName: [{
required: true,
@@ -300,14 +297,10 @@
workTypeIndexes: [0, 0, 0],
}
},
// 移除uView表单验证相关代码
onReady() {
this.$refs.uForm.setRules(this.rules)
},
created() {
this.workTypeRemoteMethod('');
console.log('qcjy_fwnr' );
this.$getDict('qcjy_fwnr').then(res => {
this.bfnrzd = res.data;
});
this.setName()
this.loading = true;
let arr = [{
key: 'qcjy_gznx',
@@ -356,14 +349,18 @@
this.loading = false;
});
this.workTypeRemoteMethod('');
},
methods: {
// 获取字典数据
getDicts(dictType) {
return this.$getDict(dictType)
// .then(res => {
// this.dict[dictType] = res.data;
// });
return new Promise((resolve, reject) => {
// 这里应该调用实际的API暂时返回空数组
// 如果需要真实的API调用请替换下面的代码
setTimeout(() => {
resolve({ data: [] });
}, 100);
});
},
cancelPage() {
@@ -380,15 +377,12 @@
}
},
setName(){
// 只有在name有值时才设置人员信息避免覆盖已有数据
if(this.name) {
this.formData.personName = this.name
this.formData.personId = this.needId
this.formData.userId = this.needId
}
},
personNameConfirm(event) {
// this.formData.personName = event.name
this.formData.personName = event.name
this.formData.personId = event.id
this.formData.userId = event.userId
@@ -460,7 +454,7 @@
cancelPicker(type) {
this.show[type] = false
},
getCityOptis(data) {
getCityOptions(data) {
if (data && data[0] && data[0].children) {
return [data].concat(this.getCityOptions(data[0].children))
} else {
@@ -493,7 +487,7 @@
if (this.edit) {
if(type === 'workTypeTree') {
if (!this.workTypeTreeColumns[0] || !this.workTypeTreeColumns[0].length) {
uni.showToast({title: '工种数据未加载,请稍后重试'});
uni.showToast({title: '工种数据未加载,请稍后重试', icon: 'none'});
return;
}
// 弹窗打开时初始化临时columns和index
@@ -519,35 +513,21 @@
})
},
async saveInfo() {
this.setName()
uni.showLoading();
try {
console.log("this.formData.personName",this.formData.personName)
// 先检查求职说明是否为空,如果为空直接提示
if (!this.formData.jobDescription || this.formData.jobDescription.trim() === '') {
uni.showToast({title: '请填写求职说明!', icon: 'none'});
return;
}
// 简单的表单验证
// 验证表单
console.log(this.formData)
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;
const isValid = await this.$refs.uForm.validate();
if (!isValid) {
throw new Error('表单验证失败');
}
// 显示全局加载
uni.showLoading({ title: '加载中...' });
this.formData.demandType = 1;
// this.formData.userId = this.formData.personId
// 根据 formData 是否有 id 来决定是更新还是新增
@@ -562,25 +542,25 @@
}
// 检查响应码是否为200
if (response.code === 200) {
uni.showToast({ title: successMessage });
uni.showToast({title: successMessage, icon: 'none'});
// 如果是编辑模式,关闭编辑状态;否则返回上一页
if (this.formData.id) {
this.edit = false;
} else {
// 延迟1秒后返回
setTimeout(() => {
uni.navigateBack();
}, 1000);
}, 2000);
}
}
} catch (error) {
if(error && error.length){
if(error.length){
uni.showToast({title: '请填写完整信息!', icon: 'none'});
}else{
uni.showToast({title: '系统错误,请联系管理员!', icon: 'none'});
}
}
finally {
// uni.showToast({title: '请检查必填项填写', icon: 'none'});
} finally {
// 确保加载页总是会被隐藏
uni.hideLoading();
}

View File

@@ -1,11 +1,11 @@
<!--
* @Date: 2024-10-08 14:29:36
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-03 16:07:40
* @LastEditTime: 2025-11-04 16:14:41
-->
<template>
<view class="container">
<scroll-view scroll-y="true" >
<scroll-view scroll-y="true" :style="{height: edit?'calc(100vh - 380rpx)':'calc(100vh - 194rpx)'}">
<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"
@@ -32,12 +32,8 @@
</view>
</view>
</view>
<!-- 办理完成后 需求说明 -->
</scroll-view>
<choose-person ref="personChooser" @confirm="personNameConfirm" />
<view class="button-area" v-if="edit">
<view class="btn" @click="cancelPage">取消</view>
@@ -48,13 +44,25 @@
</template>
<script>
import { getPersonBase } from "@/packageRc/api/personinfo/index";
import { addPersonDemand, updatePersonDemand, getPersonDemand } from "@/packageRc/api/needs/personDemand";
//import reqComp from './req-comp';
import {
getPersonBase
} from "@/apiRc/person";
import {
addPersonDemand,
updatePersonDemand,
getPersonDemand
} from "@/apiRc/needs/personDemand";
import ImageUpload from '/packageRc/components/ImageUpload'
import ChoosePerson from '/packageRc/pages/needs/components/choosePerson';
import {
listJobType
} from "@/apiRc/jobType/index";
import dayjs from "dayjs";
export default {
components: {
// reqComp
ChoosePerson,
ImageUpload
},
props: {
needId: {
@@ -68,60 +76,65 @@ import { addPersonDemand, updatePersonDemand, getPersonDemand } from "@/packageR
},
data() {
return {
fileList: [],
edit: true,
canChoosePerson: false,
personBase: {},
dates: {},
formData: {
id: '',
personName: '',
personId: '',
demandType:"9",
userId: '',
demandTitle: '',
jobDescription: '',
actualSolveDate: '',
actualSolvePeople: '',
solveDesc: '',
fileUrl: '',
currentStatus: ''
}
isAcceptAssistance: '',
isAcceptApprovalResult: '',
qtxqsm: ''
},
rules: {
personName: [{
required: true,
message: '请填写姓名',
trigger: ['blur', 'change'],
}, ],
qtxqsm: [{
required: true,
message: '请填写需求说明',
trigger: ['blur', 'change'],
}, ],
},
dict: {},
show: {},
currentCityArr: [],
originalDept: [],
currentCity: '请选择',
bysj: '',
loading: false,
jobTypeList: [],
route: {},
canChoosePerson: false,
}
},
onReady() {
// 组件已准备就绪
this.$refs.uForm.setRules(this.rules)
},
created() {
this.loading = true;
// 直接使用传入的参数设置姓名信息
if(this.name && this.needId) {
this.formData.personName = this.name;
this.formData.personId = this.needId;
this.formData.userId = this.needId;
}
// 如果需要获取详情
if (this.needId) {
this.getDetail(this.needId);
}
},
methods: {
cancelPage() {
if (!this.formData.id) {
this.$u.navigateBack();
} else {
if (this.formData.id) {
this.edit = false;
this.getDetail(this.formData.id);
this.getDetail(this.formData.id)
} else {
uni.navigateBack()
}
},
// workTypeRemoteMethod(key) {
// listJobType({
// workTypeName: key,
// pageNum: 1,
// pageSize: 50
// }).then(
// (res) => {
// this.jobTypeList = res.rows;
// }
// );
// },
workTypeRemoteMethod(key) {
listJobType({
workTypeName: key,
pageNum: 1,
pageSize: 50
}).then(
(res) => {
this.jobTypeList = res.rows;
}
);
},
openPersonChooser() {
if (this.edit && this.canChoosePerson) {
this.$refs.personChooser.open();
@@ -131,110 +144,178 @@ import { addPersonDemand, updatePersonDemand, getPersonDemand } from "@/packageR
this.formData.personName = event.name
this.formData.personId = event.id
this.formData.userId = event.userId
this.formNameChange();
this.$forceUpdate();
},
changeFile(e) {
// 清空当前的 fileUrl 数组
this.formData.fileUrl = [];
// 如果 e 有长度(即用户选择了文件)
if (e.length) {
// 遍历每个文件对象并获取其 url
for (let data of e) {
const url = data.data ? data.data.url : data.url;
this.formData.fileUrl.push(url);
}
}
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
},
getDetail(id) {
this.$request({
url: '/mini/demand/getPersonDemandById',
method: 'GET',
data: {
id: id
}
}).then(res => {
if (res.code == 200) {
getPersonDemand(id).then(res => {
this.formData = res.data;
}
}).catch(err => {
console.log(err);
});
this.edit = false
})
},
confirmDate(type, e) {
this.show[type] = false;
let date = new Date(e.value)
this.formData[type] =
`${date.getFullYear()}-${(date.getMonth()+1)>9?(date.getMonth()+1):('0'+(date.getMonth()+1))}-${date.getDate()>9?date.getDate():('0'+date.getDate())}`
this.$forceUpdate();
},
goBack() {
uni.navigateBack();
},
setName() {
// 确保personName存在
if (!this.formData.personName) {
this.formData.personName = '未知用户';
}
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
month = month < 10 ? '0' + month : month;
let day = date.getDate();
day = day < 10 ? '0' + day : day;
this.formData.demandTitle = `${this.formData.personName}_于${year}-${month}-${day}_提出其他需求`;
cancelPicker(type) {
this.show[type] = false
this.$forceUpdate();
},
saveInfo() {
console.log("执行")
getDictLabel(value, list) {
if (list) {
let arr = list.filter(ele => ele.dictValue == value)
if (arr.length) {
return arr[0].dictLabel
} else {
return '请选择'
}
}
},
pickerConfirm(type, event) {
this.show[type] = false
this.formData[type] = event.value[0].dictValue
this.$forceUpdate();
},
showPicker(type) {
if (this.edit) {
this.show[type] = true
this.$forceUpdate()
}
},
getPersonInfo() {
this.loading = true;
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
this.formNameChange();
this.$forceUpdate();
})
}
})
},
formNameChange() {
let date = new Date()
let day =
`${date.getFullYear()}-${(date.getMonth()+1) + 1 > 9 ? (date.getMonth()+1) + 1: '0'+((date.getMonth()+1) + 1)}-${date.getDate() > 9 ? date.getDate(): '0'+date.getDate()}`
const dayNew = dayjs(date).format("YYYY-MM-DD");
this.formData.demandTitle = `${this.formData.personName}_于${dayNew}_提出其他需求`
},
async saveInfo() {
uni.showLoading();
try {
// 验证必填项
if (!this.formData.personName) {
uni.showToast({
title: '请选择姓名',
icon: 'none'
});
return;
// 验证表单
const isValid = await this.$refs.uForm.validate();
if (!isValid) {
throw new Error('请检查必填项填写');
}
if (!this.formData.jobDescription) {
uni.showToast({
title: '请输入需求说明',
icon: 'none'
});
return;
// 显示全局加载
// 根据 formData 是否有 id 来决定是更新还是新增
let response;
let successMessage;
this.formData.demandType = 9;
// this.formData.userId = this.formData.personId
if (this.formData.id) {
response = await updatePersonDemand(this.formData);
successMessage = '修改成功';
} else {
response = await addPersonDemand(this.formData);
successMessage = '保存成功';
}
uni.showLoading({
title: '保存中...'
});
this.setName();
let params = {
...this.formData,
type: '3'
};
const requestFn = this.formData.id ? updatePersonDemand : addPersonDemand;
requestFn(params).then(res => {
if (res.code == 200) {
uni.showToast({
title: '保存成功',
icon: 'success'
});
// 检查响应码是否为200
if (response.code === 200) {
this.$u.toast(successMessage);
// 如果是编辑模式,关闭编辑状态;否则返回上一页
if (this.formData.id) {
this.edit = false;
if (!this.formData.id) {
this.formData.id = res.data;
} else {
await this.$delay(1000); // 延迟1秒后返回上一页
uni.navigateBack();
}
} else {
uni.showToast({
title: res.message,
icon: 'none'
});
throw new Error('服务器响应错误');
}
}).catch(err => {
if (err.message) {
uni.showToast({
title: err.message,
icon: 'none'
});
}
});
} catch (error) {
console.error('保存失败:', error);
if(error.length){
this.$u.toast('请填写完整信息!');
}else{
this.$u.toast('系统错误,请联系管理员!');
}
} finally {
// 确保加载页总是会被隐藏
uni.hideLoading();
}
}
// saveInfo() {
// this.$refs.uForm.validate().then(res => {
// if (this.formData.id) {
// updatePersonDemand(this.formData).then(res => {
// if (res.code == 200) {
// uni.showToast({
// title: '修改成功'
// })
// this.edit = false;
// }
// })
// } else {
// addPersonDemand(this.formData).then(res => {
// if (res.code == 200) {
// uni.showToast({
// title: '保存成功'
// })
// uni.navigateBack();
// }
// })
// }
// }).catch(() => {
// uni.showToast({
// title: '请检查必填项填写',
// icon: 'none'
// })
// })
// }
}
}
</script>
<style lang="scss">
.container {
height: 100vh;
overflow: hidden;
background-color: #f7f7f7;
}
@import "/packageRc/static/scss/index.scss";
.inner {
background: #fff;
@@ -244,12 +325,14 @@ import { addPersonDemand, updatePersonDemand, getPersonDemand } from "@/packageR
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
}
.inner-part {
width: 100%;
}
.self-form {
width: 100%;
}
@@ -302,14 +385,15 @@ import { addPersonDemand, updatePersonDemand, getPersonDemand } from "@/packageR
margin-left: 16rpx;
}
.button-area {
padding: 24rpx 32rpx 68rpx;
width: 100%;
background: #fff;
display: flex;
box-sizing: border-box;
margin-top: 40rpx;
border-radius: 16px 16px 0px 0px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
.btn {
line-height: 72rpx;
@@ -333,16 +417,6 @@ import { addPersonDemand, updatePersonDemand, getPersonDemand } from "@/packageR
flex-grow: 1;
}
}
.container {
background-color: #f7f7f7;
}
.inner {
background-color: #f7f7f7;
padding: 24rpx 32rpx;
}
.self-form {
width: 100%;
}

View File

@@ -1,11 +1,11 @@
<!--
* @Date: 2024-10-08 14:29:36
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-03 16:07:22
* @LastEditTime: 2025-11-04 15:56:09
-->
<template>
<view class="container">
<scroll-view scroll-y="true" :style="{height: edit?'calc(90vh - 150px)':'calc(100vh - 144px)'}">
<scroll-view scroll-y="true" :style="{height: edit?'calc(100vh - 380rpx)':'calc(100vh - 194rpx)'}">
<view class="inner">
<view class="part-title" style="display: flex;justify-content: space-between;">培训需求信息

View File

@@ -1,15 +1,15 @@
<!--
* @Date: 2024-10-08 14:29:36
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-03 16:29:26
* @LastEditTime: 2025-11-04 16:16:45
-->
<template>
<view class="page" style="background-image: url('../../../packageRc/static/pageBg.png');">
<view class="page-header df_flex" style="display:flex;align-items:center;justify-content:space-between;padding:20rpx 0rpx;">
<!-- <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;" @tap="$store.commit('SET_SHOWEXITPOPUP', true)" name="list" size="44rpx" color="#fff"></u-icon>
</view>
</view> -->
<view class="tab-list" v-if="showTab != 1">
<view class="tab" :class="{active: activeType == 1}" @click="canChangeType ? changeType(1) : ''">求职<br>需求
</view>
@@ -51,6 +51,10 @@
}
},
onLoad(options) {
uni.setNavigationBarTitle({
title: '需求信息'
})
console.log("options",options)
this.showTab = options.showTab
this.id = options.id
console.log("this.id",this.id)
@@ -70,6 +74,9 @@
},
methods: {
changeType(type) {
uni.setNavigationBarTitle({
title: '新增需求'
})
this.activeType = type
this.$nextTick(() => {
this.$refs['type' + type].addOne()
@@ -84,47 +91,17 @@
<style lang="scss">
@import "/packageRc/static/scss/index.scss";
.page {
background-color: #F4F4F4 !important;
height: 100vh;
background-repeat: no-repeat;
padding-top: 32rpx;
background-size: 100% auto;
}
.button-area {
padding: 24rpx 32rpx 68rpx;
width: 100%;
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;
border-radius: 8rpx;
}
.reset {
background: #DCE2E9;
}
.save {
background: linear-gradient(103deg, #1D64CF 0%, #1590D4 99%);
color: #fff;
border: 0;
flex-grow: 1;
}
}
.noValue {
color: rgb(192, 196, 204);
}

View File

@@ -1,7 +1,7 @@
<!--
* @Date: 2025-10-16 15:15:47
* @LastEditors: lip
* @LastEditTime: 2025-11-04 11:50:05
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-05 16:52:15
-->
<template>
<!-- @scroll="handleScroll" @scrolltolower="scrollBottom" -->
@@ -107,7 +107,7 @@ function tiao(){
console.log('尝试导航到待办详情页面');
// 尝试直接使用uni.navigateTo使用正确的格式
uni.navigateTo({
url: '/packageRc/pages/demand/index',
url: `/packageRc/pages/needs/personNeeds`,
success: function() {
console.log('导航成功');
},

View File

@@ -1,11 +1,11 @@
<!--
* @Date: 2024-10-08 14:29:36
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-04 14:29:24
* @LastEditTime: 2025-11-04 17:33:17
-->
<template>
<view class="input-outer-part">
<scroll-view scroll-y="true" :style="{height: edit?'calc(100vh - 200rpx)':'calc(100vh - 194rpx)'}">
<scroll-view scroll-y="true" :style="{height: edit?'calc(100vh - 380rpx)':'calc(100vh - 194rpx)'}">
<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"
@@ -31,10 +31,27 @@
<u-icon slot="right" name="edit-pen" color="#A6A6A6"></u-icon>
</uni-forms-item> -->
<uni-forms-item label="有无场地需求" name="ywcdxq" required>
<radio-group :disabled="!edit" :value="formData.ywcdxq" placement="row">
<!-- <radio-group :disabled="!edit" :value="formData.ywcdxq" placement="row">
<radio :customStyle="{marginRight: '16px'}" label="是" value="是"></radio>
<radio :customStyle="{marginRight: '16px'}" label="否" value="否"></radio>
</radio-group>
</radio-group> -->
<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>
</uni-forms-item>
<uni-forms-item label="场地面积" name="cdmj">
<input :disabled="!edit" v-model="formData.cdmj" border="none"
@@ -225,8 +242,8 @@
},
// setName(){
// this.formData.personName = this.name
// this.formData.personId = this.needid
// this.formData.userId = this.needid
// this.formData.personId = this.needId
// this.formData.userId = this.needId
// this.$forceUpdate();
// },
@@ -255,13 +272,13 @@
}
this.formData.fileUrl = this.$arrayToString(this.formData.fileUrl)
},
addOne() {
addOne(userId) {
this.formData = {}
this.setDefaultValues()
this.getPersonInfo()
if(this.name){
this.formData.personName = this.name
this.formData.userId = this.needid
this.formData.userId = userId
}
this.edit = true
},
@@ -349,24 +366,34 @@
this.formData.demandType = 2;
let successMessage;
if (this.formData.id) {
response = await updatePersonDemand(this.formData);
successMessage = '修改成功';
} else {
response = await addPersonDemand(this.formData);
successMessage = '保存成功';
}
// 检查响应码是否为200
if (response.code === 200) {
uni.showToast({title: successMessage, icon: 'none'});
updatePersonDemand(this.formData).then(response => {
uni.showToast({title: '修改成功', icon: 'none'});
if (response.code == 200) {
// 如果是编辑模式,关闭编辑状态;否则返回上一页
if (this.formData.id) {
this.edit = false;
} else {
await this.$delay(1000); // 延迟1秒后返回上一页
setTimeout(() => {
uni.navigateBack();
}, 2000);
}
}
})
} else {
addPersonDemand(this.formData).then(response => {
uni.showToast({title: '保存成功', icon: 'none'});
if (response.code == 200) {
// 如果是编辑模式,关闭编辑状态;否则返回上一页
if (this.formData.id) {
this.edit = false;
} else {
setTimeout(() => {
uni.navigateBack();
}, 2000);
}
}
})
}
} catch (error) {
if(error.length){
uni.showToast({title: '请填写完整信息!', icon: 'none'});
@@ -423,6 +450,49 @@
.noValue {
color: rgb(192, 196, 204);
}
/* 单选框样式 */
.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;
}
.disabledLine {
background: rgb(245, 247, 250);

View File

@@ -1,12 +1,12 @@
<!--
* @Date: 2024-10-08 14:29:36
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-04 14:00:51
* @LastEditTime: 2025-11-04 17:32:32
-->
<template>
<view class="input-outer-part">
<scroll-view scroll-y="true" :style="{height: edit?'calc(100vh - 200rpx)':'calc(100vh - 194rpx)'}">
<scroll-view scroll-y="true" :style="{height: edit?'calc(100vh - 380rpx)':'calc(100vh - 194rpx)'}">
<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"
@@ -335,12 +335,12 @@
}
this.formData.fileUrl = this.$arrayToString(this.formData.fileUrl)
},
addOne() {
addOne(userId) {
this.formData = {}
this.getPersonInfo()
if(this.name){
this.formData.personName = this.name
this.formData.userId = this.needId
this.formData.userId = userId
}
this.edit = true
},
@@ -422,7 +422,7 @@
if (this.edit) {
if(type === 'workTypeTree') {
if (!this.workTypeTreeColumns[0] || !this.workTypeTreeColumns[0].length) {
uni.showToast({title: '工种数据未加载,请稍后重试'});
uni.showToast({title: '工种数据未加载,请稍后重试', icon: 'none'});
return;
}
// 弹窗打开时初始化临时columns和index
@@ -452,7 +452,7 @@
try {
// 先检查求职说明是否为空,如果为空直接提示
if (!this.formData.jobDescription || this.formData.jobDescription.trim() === '') {
uni.showToast({title: '请填写求职说明!'});
uni.showToast({title: '请填写求职说明!', icon: 'none'});
return;
}
@@ -466,18 +466,11 @@
this.formData.demandType = 1;
// this.formData.userId = this.formData.personId
// 根据 formData 是否有 id 来决定是更新还是新增
let response;
let successMessage;
if (this.formData.id) {
response = await updatePersonDemand(this.formData);
successMessage = '修改成功';
} else {
response = await addPersonDemand(this.formData);
successMessage = '保存成功';
}
// 检查响应码是否为200
if (response.code === 200) {
uni.showToast({title: successMessage});
updatePersonDemand(this.formData).then(response => {
uni.showToast({title: '修改成功', icon: 'none'});
if (response.code == 200) {
// 如果是编辑模式,关闭编辑状态;否则返回上一页
if (this.formData.id) {
this.edit = false;
@@ -487,13 +480,29 @@
}, 2000);
}
}
})
} else {
addPersonDemand(this.formData).then(response => {
uni.showToast({title: '保存成功', icon: 'none'});
if (response.code == 200) {
// 如果是编辑模式,关闭编辑状态;否则返回上一页
if (this.formData.id) {
this.edit = false;
} else {
setTimeout(() => {
uni.navigateBack();
}, 2000);
}
}
})
}
} catch (error) {
if(error.length){
uni.showToast({title: '请填写完整信息!'});
uni.showToast({title: '请填写完整信息!', icon: 'none'});
}else{
uni.showToast({title: '系统错误,请联系管理员!'});
uni.showToast({title: '系统错误,请联系管理员!', icon: 'none'});
}
// uni.showToast({title: '请检查必填项填写'});
// uni.showToast({title: '请检查必填项填写', icon: 'none'});
} finally {
// 确保加载页总是会被隐藏

View File

@@ -1,12 +1,12 @@
<!--
* @Date: 2024-10-08 14:29:36
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-04 14:16:26
* @LastEditTime: 2025-11-05 08:57:34
-->
<template>
<view class="input-outer-part">
<scroll-view scroll-y="true" :style="{height: edit?'calc(100vh - 200rpx)':'calc(100vh - 194rpx)'}">
<scroll-view scroll-y="true" :style="{height: edit?'calc(100vh - 380rpx)':'calc(100vh - 194rpx)'}">
<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"
@@ -16,18 +16,18 @@
<view class="inner-part">
<uni-forms labelPosition="left" :model="formData" :rules="rules" ref="uForm" class="self-form"
labelWidth="100">
<u-form-item label="姓名" prop="personName" required
<uni-forms-item label="姓名" prop="personName" required
v-if="$store.getters.roles.includes('shequn')|| $store.getters.roles.includes('gly')">
<view 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>
</uni-forms-item>
<u-form-item label="需求说明" prop="jobDescription" required>
<u-textarea :disabled="!edit" v-model="formData.jobDescription" placeholder="请输入"></u-textarea>
</u-form-item>
<uni-forms-item label="需求说明" prop="jobDescription" required>
<textarea :disabled="!edit" v-model="formData.jobDescription" placeholder="请输入"></textarea>
</uni-forms-item>
</uni-forms>
</view>
</view>
@@ -167,12 +167,12 @@
}
this.formData.fileUrl = this.$arrayToString(this.formData.fileUrl)
},
addOne() {
addOne(userId) {
this.formData = {}
this.getPersonInfo()
if(this.name){
this.formData.personName = this.name
this.formData.userId = this.needid
this.formData.userId = userId
}
this.edit = true
@@ -181,7 +181,6 @@
getPersonDemand(id).then(res => {
this.formData = res.data;
this.edit = false
this.fileList = this.$processFileUrl(this.formData.fileUrl)
})
},
confirmDate(type, e) {
@@ -259,24 +258,35 @@
this.formData.demandType = 9;
// this.formData.userId = this.formData.personId
if (this.formData.id) {
response = await updatePersonDemand(this.formData);
successMessage = '修改成功';
} else {
response = await addPersonDemand(this.formData);
successMessage = '保存成功';
}
// 检查响应码是否为200
if (response.code === 200) {
this.$u.toast(successMessage);
updatePersonDemand(this.formData).then(response => {
uni.showToast({title: '修改成功', icon: 'none'});
if (response.code == 200) {
// 如果是编辑模式,关闭编辑状态;否则返回上一页
if (this.formData.id) {
this.edit = false;
} else {
await this.$delay(1000); // 延迟1秒后返回上一页
setTimeout(() => {
uni.navigateBack();
}, 2000);
}
}
uni.hideLoading();
})
} else {
throw new Error('服务器响应错误');
addPersonDemand(this.formData).then(response => {
uni.showToast({title: '保存成功', icon: 'none'});
if (response.code == 200) {
// 如果是编辑模式,关闭编辑状态;否则返回上一页
if (this.formData.id) {
this.edit = false;
} else {
setTimeout(() => {
uni.navigateBack();
}, 2000);
}
}
uni.hideLoading();
})
}
} catch (error) {
if(error.length){

View File

@@ -1,12 +1,12 @@
<!--
* @Date: 2024-10-08 14:29:36
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-04 14:29:43
* @LastEditTime: 2025-11-04 17:45:50
-->
<template>
<view class="input-outer-part">
<scroll-view scroll-y="true" :style="{height: edit?'calc(100vh - 200rpx)':'calc(100vh - 194rpx)'}">
<scroll-view scroll-y="true" :style="{height: edit?'calc(100vh - 380rpx)':'calc(100vh - 194rpx)'}">
<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"
@@ -46,15 +46,23 @@
</view>
</uni-forms-item>
<uni-forms-item label="期望培训时间" prop="qwpxsj" required>
<view class="bordered" style="width: 100%" @click="showTime = true"
<uni-datetime-picker
type="date"
:value="formData.qwpxsj"
start="2021-3-20"
end="2030-6-20"
@change="change"
/>
<!-- <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>
<u-icon slot="right" name="arrow-down" color="#A6A6A6"></u-icon> -->
</uni-forms-item>
</uni-forms>
<uni-forms labelPosition="left" class="self-form" labelWidth="110">
<uni-forms-item label="需求说明" prop="jobDescription">
<u-textarea :disabled="!edit" v-model="formData.jobDescription" placeholder="请输入"></u-textarea>
<textarea :disabled="!edit" v-model="formData.jobDescription" placeholder="请输入"></textarea>
</uni-forms-item>
</uni-forms>
</view>
@@ -196,6 +204,9 @@
this.workTypeRemoteMethod('');
},
methods: {
change(e) {
this.formData.qwpxsj = e;
},
cancelPage() {
if (this.formData.id) {
this.edit = false;
@@ -238,12 +249,12 @@
}
this.formData.fileUrl = this.$arrayToString(this.formData.fileUrl)
},
addOne() {
addOne(userId) {
this.formData = {}
this.getPersonInfo()
if(this.name){
this.formData.personName = this.name
this.formData.userId = this.needid
this.formData.userId = userId
}
this.edit = true
},
@@ -337,58 +348,57 @@
},
async saveInfo() {
uni.showLoading();
try {
// 手动检查培训意愿工种是否已选择
if (!this.formData.qwpxgz || this.formData.qwpxgz.trim() === '') {
this.$u.toast('请选择培训意愿工种!');
return;
}
// 手动检查期望培训时间是否已选择
if (!this.formData.qwpxsj || this.formData.qwpxsj.trim() === '') {
this.$u.toast('请选择期望培训时间!');
return;
}
// // 手动检查培训意愿工种是否已选择
// if (!this.formData.qwpxgz || this.formData.qwpxgz.trim() === '') {
// uni.showToast({title: '请选择培训意愿工种!', icon: 'none'});
// return;
// }
// // 手动检查期望培训时间是否已选择
// if (!this.formData.qwpxsj || this.formData.qwpxsj.trim() === '') {
// uni.showToast({title: '请选择期望培训时间!', icon: 'none'});
// return;
// }
// 验证表单
const isValid = await this.$refs.uForm.validate();
if (!isValid) {
throw new Error('请检查必填项填写');
return
}
let response;
let successMessage;
if (isValid) {
this.formData.demandType = 3;
if (this.formData.id) {
response = await updatePersonDemand(this.formData);
successMessage = '修改成功';
} else {
response = await addPersonDemand(this.formData);
successMessage = '保存成功';
}
// 检查响应码是否为200
if (response.code === 200) {
this.$u.toast(successMessage);
updatePersonDemand(this.formData).then(response => {
uni.showToast({title: '修改成功', icon: 'none'});
if (response.code == 200) {
// 如果是编辑模式,关闭编辑状态;否则返回上一页
if (this.formData.id) {
this.edit = false;
} else {
await this.$delay(1000); // 延迟1秒后返回上一页
setTimeout(() => {
uni.navigateBack();
}, 2000);
}
}
} catch (error) {
if(error.length){
this.$u.toast('请填写完整信息!');
uni.hideLoading();
})
} else {
this.$u.toast('系统错误,请联系管理员!');
addPersonDemand(this.formData).then(response => {
uni.showToast({title: '保存成功', icon: 'none'});
if (response.code == 200) {
// 如果是编辑模式,关闭编辑状态;否则返回上一页
if (this.formData.id) {
this.edit = false;
} else {
setTimeout(() => {
uni.navigateBack();
}, 2000);
}
} finally {
// 确保加载页总是会被隐藏
}
uni.hideLoading();
})
}
}else{
uni.showToast({title: '请填写完整信息!', icon: 'none'});
uni.hideLoading();
}
// 确保加载页总是会被隐藏
},
// getWorkTypeTree() {
// listJobType({

View File

@@ -1,19 +1,19 @@
<!--
* @Date: 2024-10-08 14:29:36
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-04 14:04:39
* @LastEditTime: 2025-11-04 17:16:49
-->
<template>
<view class="page" style="background-image: url('../../../packageRc/static/pageBg.png');">
<!-- 需求新增 -->
<view class="tab-list" v-if="showTab != 1">
<view class="tab" :class="{active: activeType == 1}" @click="canChangeType ? changeType(1) : ''">求职<br>需求
<view class="tab" :class="{active: activeType == 1}" @click="canChangeType ? changeType(1, options) : ''">求职<br>需求
</view>
<view class="tab" :class="{active: activeType == 3}" @click="canChangeType ? changeType(3) : ''">创业<br>需求
<view class="tab" :class="{active: activeType == 3}" @click="canChangeType ? changeType(3, options) : ''">创业<br>需求
</view>
<view class="tab" :class="{active: activeType == 4}" @click="canChangeType ? changeType(4) : ''">培训<br>需求
<view class="tab" :class="{active: activeType == 4}" @click="canChangeType ? changeType(4, options) : ''">培训<br>需求
</view>
<view class="tab" :class="{active: activeType == 5}" @click="canChangeType ? changeType(5) : ''">其他<br>需求
<view class="tab" :class="{active: activeType == 5}" @click="canChangeType ? changeType(5, options) : ''">其他<br>需求
</view>
</view>
<jobService v-if="activeType == 1" :needId="id" :name="name" ref="type1" />
@@ -44,12 +44,14 @@
canChangeType: true,
id: '',
name:"",
options: {}
}
},
onLoad(options) {
this.showTab = options.showTab
this.id = options.id
this.name = options.name
this.options=options
if (options.id && options.type) {
this.isAdd = false
this.activeType = options.type
@@ -59,15 +61,15 @@
})
} else {
// 添加需求的时候根据传入的类型 判断对应的表单
this.changeType(options.activeType || 1)
this.changeType(options.activeType || 1, options)
}
},
methods: {
changeType(type) {
changeType(type, options) {
this.activeType = type
this.$nextTick(() => {
this.$refs['type' + type].addOne()
this.$refs['type' + type].addOne(options.userId)
})
},
goBack() {

View File

@@ -259,11 +259,11 @@
// 需求推荐/培训
requirementTraining(item, index) {
if (index == 1) {
this.$tab.navigateTo(
uni.navigateTo(
`/pages/services/serviceDetail?personName=${item.personName}&personId=${item.personId}&jobDemandInfoId=${item.id}&jobWorkType=${item.jobWorkType}&type=3&showTab=1`
)
} else {
this.$tab.navigateTo(
uni.navigateTo(
`/pages/services/serviceDetail?personName=${item.personName}&personId=${item.personId}&skillTrainingId=${item.id}&personStatus=${item.personStatus}&type=4&showTab=1`
)
}

View File

@@ -1,13 +1,8 @@
<template>
<view>
<view class="page">
<view class="page-header">
<u-icon class="back-icon" name="arrow-left" color="#fff" size="16" @click="goBack()"></u-icon>
<view class="title">需求列表</view>
<view style="width: 16rpx;"></view> <!-- 占位保证左右对称 -->
</view>
<view class="page" style="background-image: url('../../../packageRc/static/pageBg.png');">
<view class="input-outer-part"
style="padding-top: 12rpx;margin-top: 16rpx;padding-bottom: 0;max-height: unset;">
style="padding-top: 32rpx;padding-bottom: 0;max-height: unset;">
<!-- <view class="inner"
style="width: calc(100% + 64rpx);margin-left: -32rpx;height: 122rpx;position: relative;z-index: 2;">
<PopupList :checkData="checkData" @searchCheck="search" ref="PopupList"
@@ -15,9 +10,9 @@
</view> -->
<scroll-view :scroll-y="true" style="height: calc(100vh - 242rpx);position: relative;z-index: 1;"
@scrolltolower="getBottomList">
<u-swipe-action>
<u-swipe-action-item @click="clickDelete(item)" v-for="(item, index) in tableData" :key="index"
style="margin-bottom: 24rpx;border-radius: 16rpx;" :options="options1">
<uni-swipe-action>
<uni-swipe-action-item @click="clickDelete(item)" v-for="(item, index) in tableData" :key="index"
style="margin-bottom: 24rpx;border-radius: 16rpx;" :right-options="options1">
<view @click="goNeedsDetail(item)" class="job-item">
<view class="title-line" v-if="queryParams.needsType==1">
<view class="type-tag qz">求职需求</view>
@@ -50,8 +45,8 @@
<view style="font-size:12px;">左划删除需求</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
</uni-swipe-action-item>
</uni-swipe-action>
<img v-if="!total&&!loading" src="https://rc.jinan.gov.cn/qcwjyH5/static/images/person/empty.png"
style="width: 100%;display: block;margin: 0 auto;" />
<view v-if="loading"><u-loading-icon></u-loading-icon>
@@ -83,15 +78,15 @@
import {
listAssistService,
delAssistService
} from '@/api/apiRc/assistService'
} from '@/apiRc/needs/assistService'
import {
listEntrepreneurshipService,
delEntrepreneurshipService
} from '@/api/apiRc/entrepreneurshipService'
} from '@/apiRc/needs/entrepreneurshipService'
import {
listTrainService,
delTrainService
} from '@/api/apiRc/trainService'
} from '@/apiRc/needs/trainService'
import { listJobType } from "@/apiRc/jobType/index";
@@ -104,6 +99,7 @@ import { listJobType } from "@/apiRc/jobType/index";
PopupList,
},
onShow() {
console.log('search',34224234)
this.search();
},
data() {
@@ -116,8 +112,8 @@ import { listJobType } from "@/apiRc/jobType/index";
queryParams: {
pageNum: 1,
pageSize: 10,
needsType: 1,
userId: '',
needsType: 1,
},
jobTypeList:[],
total: 0,
@@ -134,27 +130,30 @@ import { listJobType } from "@/apiRc/jobType/index";
onLoad({
dictValue,userId
}) {
this.queryParams.needsType = dictValue
dictValue ? this.queryParams.needsType = dictValue : ''
this.queryParams.userId = userId
this.getCheckData()
this.getDicts('qcjy_xqlc').then(res => {
this.$getDict('qcjy_xqlc').then(res => {
this.currentStatusList = res.data;
})
this.workTypeRemoteMethod()
this.getDicts('qcjy_zgzpgz').then(res => {
this.$getDict('qcjy_zgzpgz').then(res => {
this.salaryList = res.data;
})
console.log(this.$store.state.user, 234234234)
getPersonBase(this.$store.state.user.userId).then(resp => {
this.person = resp.data
this.queryParams.personId = resp.data.id
this.person = resp.data || {}
// this.queryParams.personId = resp.data.id
})
},
methods: {
getJobWorkTypeName(data){
if (data) {
let arr = this.jobTypeList.filter((ele) => ele.id == data);
if(arr.length){
return arr[0].workTypeName;
}else{
return '--'
}
}
},
workTypeRemoteMethod(key) {
@@ -164,11 +163,13 @@ import { listJobType } from "@/apiRc/jobType/index";
pageSize: 50,
}).then((res) => {
this.jobTypeList = res.rows;
});
},
goAddNeeds() {
this.$tab.navigateTo(`/pages/needs/needDetail?activeType=${this.queryParams.needsType}&showTab=1`)
uni.navigateTo({
url: `/packageRc/pages/needs/needDetail?userId=${this.$store.state.user.userId}&type=1&name=${this.$store.state.user.nick}`,
// url: `/packageRc/pages/needs/needDetail?activeType=${this.queryParams.needsType}&showTab=1`
})
},
goBack() {
uni.navigateBack()
@@ -206,7 +207,7 @@ import { listJobType } from "@/apiRc/jobType/index";
},
goNeedsDetail(item) {
uni.navigateTo({
url: `/pages/needs/needDetail?id=${item.id}&type=${this.queryParams.needsType}&showTab=1`
url: `/packageRc/pages/needs/needDetail?id=${item.id}&type=${this.queryParams.needsType}`
})
},
getDictLabel(value, list) {
@@ -219,30 +220,6 @@ import { listJobType } from "@/apiRc/jobType/index";
}
}
},
async getCheckData() {
let workExperienceYears
await this.getDicts('qcjy_gznx').then(res => {
workExperienceYears = res.data
})
this.checkData = [
// {
// name: "需求类型",
// type: "needsType",
// data: [{dictLabel: '求职需求', dictValue: '1'},{dictLabel: '援助需求', dictValue: '2'},{dictLabel: '创业需求', dictValue: '3'},{dictLabel: '培训需求', dictValue: '4'},{dictLabel: '其他需求', dictValue: '5'}],
// activeIndex: 0,
// },
// {
// name: "工作经验",
// type: "workExperienceYears",
// data: [{
// dictLabel: '全部',
// dictValue: ''
// }].concat(workExperienceYears),
// activeIndex: 0,
// },
];
},
popupSearch(queryParams) {
queryParams.forEach((item, index) => {
if (item.data[item.activeIndex].dictLabel == "全部") {
@@ -285,6 +262,7 @@ import { listJobType } from "@/apiRc/jobType/index";
},
// 获取列表
async getList() {
console.log('getlist',this.queryParams.needsType, 234234234)
this.loading = true;
if (this.queryParams.needsType == 1) {
this.queryParams.demandType = 1
@@ -313,6 +291,7 @@ import { listJobType } from "@/apiRc/jobType/index";
}
},
gettedData(res) {
console.log('this.gettedData')
if (res.code == 200) {
if (res.rows.length < 10) {
this.showMorePage = false;
@@ -334,9 +313,9 @@ import { listJobType } from "@/apiRc/jobType/index";
<style lang="scss" scoped>
.page {
background-color: #eef1f5 !important;
background-color: #f4f4f4 !important;
height: 100vh;
background-image: url('https://rc.jinan.gov.cn/qcwjyH5/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;
}
@@ -361,9 +340,9 @@ import { listJobType } from "@/apiRc/jobType/index";
}
.job-item {
border-radius: 24rpx; /* 增大圆角,使界面更圆润 */
padding: 32rpx;
margin: 30rpx 30rpx 24rpx 30rpx; /* 添加左右30rpx边距 */
border-radius: 16rpx; /* 增大圆角,使界面更圆润 */
padding: 24rpx 32rpx;
margin: 0 30rpx 24rpx 30rpx; /* 添加左右30rpx边距 */
background-color: #FFFFFF; /* 设置白色背景,避免与底层背景重合 */
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); /* 添加轻微阴影增强层次感 */
@@ -407,6 +386,8 @@ import { listJobType } from "@/apiRc/jobType/index";
color: #3D3D3D;
width: calc(100% - 137rpx);
overflow: hidden;
padding-left: 24rpx;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 40rpx;

View File

@@ -1,7 +1,7 @@
<!--
* @Date: 2024-10-08 14:29:36
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-04 09:06:28
* @LastEditTime: 2025-11-04 16:18:33
-->
<template>

View File

@@ -1,7 +1,7 @@
<!--
* @Date: 2024-10-08 14:29:36
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-04 13:56:42
* @LastEditTime: 2025-11-04 16:18:56
-->
<template>
<view>

View File

@@ -1,7 +1,7 @@
<!--
* @Date: 2024-10-08 14:29:36
* @LastEditors: shirlwang
* @LastEditTime: 2025-11-04 13:56:02
* @LastEditTime: 2025-11-04 17:11:33
-->
<template>
<view class="page" style="background-image: url('../../../packageRc/static/pageBg.png');position:relative;">

View File

@@ -470,6 +470,16 @@
"style": {
"navigationBarTitleText": "需求"
}
} , {
"path": "pages/daiban/bangfuList",
"style": {
"navigationBarTitleText": "服务记录"
}
} , {
"path": "pages/needs/personNeeds",
"style": {
"navigationBarTitleText": "需求上报"
}
}
]
}],

View File

@@ -1001,16 +1001,32 @@ function dataToImg(data) {
}
// import { loginRc } from '@/apiRc/login/login.js';
// import storeRc from '@/utilsRc/store/index.js';
import storeRc from '@/utilsRc/store/index.js';
import { getToken } from '@/utilsRc/auth.js';
// 跳转到高校毕业页面
function goRc(){
if (checkLogin()) {
// let userInfo = uni.getStorageSync('userInfo')
// console.log(uni.getStorageSync('userInfo'), "uni.getStorageSync('userInfo')");
// storeRc.dispatch('LoginByUserInfo', userInfo).then(res => {
// console.log(res, "'res");
let token = getToken();
if( token != null ){
if(storeRc.state.user.type == 'person'){
navTo('/packageRc/pages/index/index');
// });
}else{
navTo('/packageRc/pages/daiban/daiban');
}
console.log(storeRc.state.user.roles, storeRc.state.user.type, 'state')
}else{
let userInfo = uni.getStorageSync('userInfo')
storeRc.dispatch('LoginByUserInfo', userInfo).then(res => {
// console.log(res, "'res");
storeRc.dispatch('GetInfo').then(res => {
if(res.data.user.userType == 'person'){
navTo('/packageRc/pages/index/index');
}else{
navTo('/packageRc/pages/daiban/daiban');
}
});
});
}
}
}

View File

@@ -20,7 +20,7 @@ const request = config => {
if (getToken() && !isToken) {
config.header['Authorization'] = 'Bearer ' + getToken()
}
config.header['Authorization'] = 'Bearer ' + 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJzeXNfdXNlcjoxIiwicm5TdHIiOiI5aW9ycXdMYVp5aXFienBJOXdvVGlYc3R3V0xydkFqWSIsInVzZXJJZCI6MX0.lfsx6tcpSUYYenWmz8T7gsgc8_t1sFNif_e2nOBRRL4'
config.header['Authorization'] = 'Bearer ' + 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJzeXNfdXNlcjoxIiwicm5TdHIiOiJQSlUyVlJCc1E1aXRMMWgxdjNkcVh2eER1c2VVc0hvRiIsInVzZXJJZCI6MX0.z4Z2XqgXyU0GQU-i7Bsa5T-zCKApTxj1YQ73rk7bAVo'
// get请求映射params参数
if (config.params) {
let url = config.url + '?' + tansParams(config.params)
@@ -45,10 +45,9 @@ const request = config => {
return
}
const code = res.code || 200
console.log(code, 'const code = res.code || 200')
const msg = errorCode[code] || res.msg || errorCode['default']
const isShowModel = getApp().globalData.isShowModel
if (code === 200) {
if (code == 200) {
resolve(res)
}else if (code === 401) {
if(isShowModel === false) {
@@ -89,7 +88,6 @@ const request = config => {
resolve(res.data)
})
.catch(error => {
console.log(error, 'error')
let message = error.errMsg
if (message === 'Network Error') {
message = '网络出小差,请稍后再试'

View File

@@ -99,7 +99,6 @@ const user = {
// info.password = '04' + sm2.doEncrypt(info.password, state.publicKey, 0)
// info.username = '04' + sm2.doEncrypt(info.username, state.publicKey, 0)
login(userInfo).then(res => {
console.log('登录接口返回:', res);
setToken(res.data.token)
commit('SET_TOKEN', res.data.token)
resolve(res)