merge: 合并main分支到CareerMap
This commit is contained in:
@@ -1,177 +1,147 @@
|
||||
<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">
|
||||
<label class="form-label">被帮扶对象</label>
|
||||
<input
|
||||
v-model="serviceForm.serviceObjectName"
|
||||
style="border: none; width: 100%; padding: 10px 0;"
|
||||
placeholder="请输入"
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-item required">
|
||||
<label class="form-label">帮扶方式</label>
|
||||
<div class="form-select-wrapper" style="position: relative;">
|
||||
<!-- 显示区域 -->
|
||||
<div
|
||||
class="form-value"
|
||||
:class="{ 'noValue': !serviceForm.demandType }"
|
||||
@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;"
|
||||
<view class="inner-part">
|
||||
<view class="form-item required">
|
||||
<label class="form-label">被帮扶对象</label>
|
||||
<input
|
||||
v-model="serviceForm.serviceObjectName"
|
||||
style="border: none; width: 100%;"
|
||||
placeholder="请输入"
|
||||
disabled
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="form-item required">
|
||||
<label class="form-label">帮扶方式</label>
|
||||
<view class="form-select-wrapper" style="position: relative;">
|
||||
|
||||
<!-- 显示区域 -->
|
||||
<view
|
||||
class="form-value"
|
||||
style="width: 100%;"
|
||||
@click="showDemandTypePicker = !showDemandTypePicker"
|
||||
:class="!serviceForm.demandType ? 'noValue' : ''"
|
||||
>
|
||||
{{ getDemandTypeLabel(serviceForm.demandType) || "请选择" }}
|
||||
</view>
|
||||
|
||||
<!-- 选项列表 -->
|
||||
<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;"
|
||||
>
|
||||
<view
|
||||
v-for="option in demandTypeOptions"
|
||||
:key="option.value"
|
||||
@click="selectDemandType(option.value)"
|
||||
style="padding: 10px; border-bottom: 1px solid #f0f0f0; cursor: pointer;"
|
||||
>
|
||||
{{ getDemandTypeLabel(serviceForm.demandType) || "请选择" }}
|
||||
<span class="arrow-down">▼</span>
|
||||
</div>
|
||||
|
||||
<!-- 选项列表 -->
|
||||
<div
|
||||
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
|
||||
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>
|
||||
|
||||
<div class="form-item required" v-if="serviceForm.demandType == '4' || serviceForm.demandType == '5'">
|
||||
<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">
|
||||
<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>
|
||||
{{ option.label }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-item required" v-if="serviceForm.demandType">
|
||||
<label class="form-label">帮扶时间 <text class="required">*</text></label>
|
||||
<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="arrow-down">▼</view>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-item required" v-if="serviceForm.demandType">
|
||||
<label class="form-label">经办人</label>
|
||||
<view class="form-select-wrapper">
|
||||
<uni-data-select
|
||||
style="width: 100%"
|
||||
v-model="serviceForm.agentUserId"
|
||||
placeholder="请选择经办人"
|
||||
:localdata="jingbrList1"
|
||||
@change="handleAgentChange"
|
||||
>
|
||||
</uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-item required" v-if="serviceForm.demandType == '5'">
|
||||
<label class="form-label">电话沟通结果</label>
|
||||
<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>
|
||||
|
||||
<view class="form-item required" v-if="serviceForm.demandType">
|
||||
<label class="form-label">帮扶内容</label>
|
||||
<view class="date-picker-wrapper" :class="{ noValue: !serviceForm.serviceContent }">
|
||||
<picker
|
||||
@change="onServiceContentChange"
|
||||
:range="serviceContentOptions.map(item => item.label)"
|
||||
:value="getServiceContentIndex(serviceForm.serviceContent)"
|
||||
mode="selector"
|
||||
>
|
||||
<view class="date-value">
|
||||
<view style="flex-grow: 1;">{{ getServiceContentLabel(serviceForm.serviceContent) || "请选择" }}</view>
|
||||
<text class="arrow-down">▼</text>
|
||||
</view>
|
||||
</picker>
|
||||
</div>
|
||||
|
||||
<div class="form-item required" v-if="serviceForm.demandType == '4' || serviceForm.demandType == '5'">
|
||||
<label class="form-label">经办人</label>
|
||||
<div class="form-select-wrapper">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="serviceForm.agentUserId"
|
||||
placeholder="请选择经办人"
|
||||
@change="handleAgentChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in jingbrList1"
|
||||
:key="item.userId"
|
||||
:label="item.nickName"
|
||||
:value="item.userId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div 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>
|
||||
|
||||
<div class="form-item required" v-if="serviceForm.demandType == '4' || serviceForm.demandType == '5'">
|
||||
<label class="form-label">帮扶内容</label>
|
||||
<div class="date-picker-wrapper" :class="{ noValue: !serviceForm.serviceContent }">
|
||||
<picker
|
||||
@change="onServiceContentChange"
|
||||
:range="serviceContentOptions.map(item => item.label)"
|
||||
:value="getServiceContentIndex(serviceForm.serviceContent)"
|
||||
mode="selector"
|
||||
>
|
||||
<view class="date-value">
|
||||
{{ getServiceContentLabel(serviceForm.serviceContent) || "请选择" }}
|
||||
<span class="arrow-down">▼</span>
|
||||
</view>
|
||||
</picker>
|
||||
</div>
|
||||
</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>
|
||||
<textarea
|
||||
v-model="serviceForm.blqksm"
|
||||
style="width: 100%; border: none; padding: 10px 0; min-height: 100px; resize: none;"
|
||||
placeholder="请输入"
|
||||
></textarea>
|
||||
</div>
|
||||
</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">
|
||||
<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;">
|
||||
上传附件 (最多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>
|
||||
<!-- 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>
|
||||
</div>
|
||||
</view>
|
||||
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="inner-part" v-if="serviceForm.demandType">
|
||||
<view class="form-item">
|
||||
<label class="form-label">附件</label>
|
||||
<view style="width: 100%; padding: 10px 0;">
|
||||
<button @click="chooseFiles" style="padding: 0px 24rpx; border: 1px solid #e4e4e4;border-radius: 4px;">
|
||||
上传附件 (最多6个)
|
||||
</button>
|
||||
<!-- 简单的文件列表显示 -->
|
||||
<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>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
@@ -182,40 +152,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 { getDicts } from '@/apiRc/system/dict.js';
|
||||
import {getJbrInfo} from "@/packageRc/apiRc/personinfo/index"
|
||||
import {addInvestigate} from "@/packageRc/apiRc/needs/person"
|
||||
import { getDicts } from '@/packageRc/apiRc/system/dict.js';
|
||||
import config from '@/utilsRc/config.js'
|
||||
import { getToken } from "@/utilsRc/auth";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -233,6 +206,14 @@ export default {
|
||||
fileUrl: [] // 附件
|
||||
},
|
||||
|
||||
personStatusMap: {
|
||||
'1': '就业政策咨询',
|
||||
'2': '职业指导',
|
||||
'3': '技能培训',
|
||||
'4': '岗位推荐',
|
||||
'5': '创业指导',
|
||||
'6': '其他'
|
||||
},
|
||||
serviceContentMap: {
|
||||
'1': '就业政策咨询',
|
||||
'2': '职业指导',
|
||||
@@ -291,6 +272,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,27 +302,93 @@ 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'],
|
||||
success: (res) => {
|
||||
// 添加新选择的图片到列表
|
||||
res.tempFilePaths.forEach((path, index) => {
|
||||
this.fileList.push({
|
||||
url: path,
|
||||
file: res.tempFiles[index]
|
||||
});
|
||||
});
|
||||
extension: ['.png', '.jpg', '.jpeg', '.doc', '.docx', '.pdf', '.xls', '.xlsx' ],
|
||||
success: (res) => {
|
||||
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 ' + getToken(),
|
||||
},
|
||||
success: (res) => {
|
||||
var data = JSON.parse(res.data);
|
||||
console.log(data, 'sdfjiosdjfoi')
|
||||
if(data.code==200) {
|
||||
this.fileList.push({
|
||||
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);
|
||||
@@ -351,9 +407,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 +437,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 +476,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 +485,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 +512,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 +525,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 +539,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 +654,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));
|
||||
|
||||
uni.showToast({ title: '保存成功', icon: 'success' });
|
||||
uni.navigateBack();
|
||||
// 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 +685,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 +714,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,13 +747,13 @@ export default {
|
||||
.form-select-wrapper::after {
|
||||
content: '▼';
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
pointer-events: none;
|
||||
color: #999;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
right: 20rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
pointer-events: none;
|
||||
color: #999;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.form-item.required .form-label::after {
|
||||
content: '*';
|
||||
@@ -683,19 +766,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 +810,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 +879,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 +912,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 +932,7 @@ export default {
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.picker-options > div {
|
||||
.picker-options > view {
|
||||
padding: 16px 20px;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
@@ -885,22 +942,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 +971,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 {
|
||||
|
||||
Reference in New Issue
Block a user