添加和修改功能

This commit is contained in:
2025-11-06 12:16:28 +08:00
parent d3fef15fa3
commit b31fcd34c7
16 changed files with 1192 additions and 288 deletions

View File

@@ -3,7 +3,7 @@
<view class="input-outer-part"
style="padding: 24rpx 32rpx 0;max-height: unset;">
<view class="search-line">
<u-input placeholder="请输入群众姓名进行搜索" v-model="queryParams.searchValue" border="none" />
<input style="width: 100%;" placeholder="请输入群众姓名进行搜索" v-model="queryParams.searchValue" border="none" />
<img src="https://rc.jinan.gov.cn/qcwjyH5/static/images/person/search.png" class="search-icon" @click="search()" />
</view>
<view class="inner"
@@ -13,7 +13,7 @@
<view v-if="total" style="position: relative;padding-bottom: 16px;color: #000;">
<text> {{ total }} </text>
</view>
<scroll-view :scroll-y="true" style="height: calc(100vh - 422rpx);position: relative;z-index: 1;"
<scroll-view :scroll-y="true" style="height: calc(100vh - 342rpx);position: relative;z-index: 1;"
@scrolltolower="getBottomList">
<uni-swipe-action>
<uni-swipe-action-item @click="clickDelete(item)" v-for="(item, index) in tableData" :key="index"
@@ -32,24 +32,24 @@
:class="item.currentStatus == 1 ? 'not' : item.currentStatus == 2 ? 'ing' : item.currentStatus == 3 ? 'finish' : '' ">
{{ getDictLabel(item.currentStatus, currentStatusList) }}
</text></view>
<view class="info" v-if="queryParams.needsType == 1">
<view class="info" v-if="queryParams.demandType == 1">
<text>需求工种</text>{{ item.jobWorkTypeName }}
</view>
<view class="info" v-if="queryParams.needsType == 3">
<view class="info" v-if="queryParams.demandType == 3">
<text>需求名称</text>{{ item.serviceRequirementTitle }}
</view>
<view class="info"
v-if="queryParams.needsType == 2||queryParams.needsType == 4||queryParams.needsType == 5">
v-if="queryParams.demandType == 2||queryParams.demandType == 4||queryParams.demandType == 5">
<text>需求名称</text>{{ item.demandTitle }}
</view>
</view>
<!--
item.currentStatus = 1 待处理2 处理中 3 已完成
queryParams.needsType 1 求职需求 2 援助需求 3 创业需求 4 培训需求 5其他需求 展示办结按钮
queryParams.demandType 1 求职需求 2 援助需求 3 创业需求 4 培训需求 5其他需求 展示办结按钮
item.currentStatus = 1待处理 item.currentStatus = 2 处理中
求职需求列表(queryParams.needsType = 1) 展示 推荐办理
培训需求列表(queryParams.needsType = 4) 展示 培训办理
求职需求列表(queryParams.demandType = 1) 展示 推荐办理
培训需求列表(queryParams.demandType = 4) 展示 培训办理
援助创业其他列表 展示办理
item.currentStatus = 3 已完成
统一展示 服务追溯
@@ -64,7 +64,7 @@
<!-- 需求处于待处理处理中 -->
<view v-else class="df_flex_1">
<!-- 求职需求 -->
<view v-if="queryParams.needsType == 1" class="df_flex">
<view v-if="queryParams.demandType == 1" class="df_flex">
<view type="primary" :plain="true" color="#BF5818" text="推荐"
:customStyle="{border: 'none'}"
@click="requirementTraining(item, 1)">推荐</view>
@@ -73,7 +73,7 @@
:customStyle="{border: 'none'}" @click="requirementHandling(item)">办理</view>
</view>
<!-- 培训需求 -->
<view v-else-if="queryParams.needsType == 4" class="df_flex">
<view v-else-if="queryParams.demandType == 4" class="df_flex">
<view type="primary" :plain="true" color="#BF5818" text="培训"
:customStyle="{border: 'none'}"
@click="requirementTraining(item, 4)">培训</view>
@@ -103,30 +103,35 @@
</view>  
</scroll-view>
</view>
<uni-popup ref="openDeal" style="position: relative;z-index: 100;" background-color="#fff" type="bottom">
<u--form class="self-form" labelPosition="top" :model="formData" :rules="rules" ref="uForm"
labelWidth="300">
<u-form-item label="实际解决时间" prop="actualSolveDate" required>
<view class="bordered" style="width: 100%;" @click="showTime=true"
:class="{noValue: !formData.actualSolveDate}">{{ formData.actualSolveDate||'请选择' }}</view>
<u-icon slot="right" name="arrow-down" color="#A6A6A6"></u-icon>
</u-form-item>
<DealDone ref="dealDone" @finished="search();"/>
<!-- <uni-popup ref="openDeal" background-color="#fff" type="bottom">
<view style="padding: 32rpx;padding-bottom: 0">
<uni-forms class="self-form" labelPosition="top" :model="formData" :rules="rules" ref="uForm"
labelWidth="300">
<uni-forms-item label="实际解决时间" prop="actualSolveDate" required>
<picker style="width: 100%;" mode="date" :value="formData.actualSolveDate" start="1900-01-01" end="2100-12-31" @change="onDateChange">
<view class="date-picker-wrapper" :class="{ noValue: !formData.actualSolveDate }">
<view v-if="formData.actualSolveDate" class="date-value">{{ formData.actualSolveDate }}</view>
<view v-else>请选择</view>
</view>
</picker>
</uni-forms-item>
<u-form-item label="附件" prop="fileUrl" >
<ImageUpload :fileList="fileList" @update="changeFile" :maxCount="6" />
</u-form-item>
<uni-forms-item label="附件" prop="fileUrl" >
<ImageUpload :fileList="fileList" @update="changeFile" :maxCount="6" />
</uni-forms-item>
<u-form-item label="解决说明" prop="solveDesc" required>
<u-textarea v-model="formData.solveDesc" placeholder="请输入"></u-textarea>
<u-icon slot="right" name="edit-pen" color="#A6A6A6"></u-icon>
</u-form-item>
</u--form>
<view class="button-area">
<uni-forms-item label="解决说明" prop="solveDesc" required>
<textarea style="border: 1px solid #e4e4e4;width: 100%;border-radius: 8rpx;padding: 24rpx;box-sizing: border-box;" v-model="formData.solveDesc" placeholder="请输入"></textarea>
</uni-forms-item>
</uni-forms>
</view>
<view class="button-area" style="box-shadow: unset;border-top: 1px solid #e4e4e4;padding-bottom: 0;">
<view class="btn" @click="closeopenDeal">取消</view>
<view class="btn reset" @click="formData.actualSolveDate = '';formData.solveDesc = ''">重置</view>
<view class="btn save" @click="finishJobRecommend">办结</view>
</view>
</uni-popup>
</uni-popup> -->
<view class="addNeeds" @click="goAddNeeds()">
<img src="https://rc.jinan.gov.cn/qcwjyH5/static/images/person/addNeeds.png" />
</view>
@@ -135,7 +140,7 @@
@cancel="showTime=false"></u-datetime-picker> -->
<u-datetime-picker
<!-- <u-datetime-picker
style="position: relative;z-index: 100;"
:show="showTime"
v-model="hopeSolveDate"
@@ -144,7 +149,7 @@
@confirm="confirmDate"
@cancel="showTime=false"
@close="showTime=false"
></u-datetime-picker>
></u-datetime-picker> -->
<!-- 社区端 - 显示隐藏退出组件 -->
@@ -180,10 +185,12 @@
delOtherService,
finishOtherService
} from '@/apiRc/needs/otherService'
import DealDone from './dealDone.vue'
export default {
components: {
PopupList,
ImageUpload
ImageUpload,
DealDone,
},
data() {
return {
@@ -194,7 +201,7 @@
queryParams: {
pageNum: 1,
pageSize: 10,
needsType: 1
demandType: 1
},
total: 0,
showMorePage: true,
@@ -227,19 +234,23 @@
onLoad({
dictValue
}) {
this.queryParams.needsType = dictValue || 1
this.queryParams.demandType = dictValue || 1
this.getCheckData()
},
onShow() {
this.search();
},
methods: {
// 日期选择变化处理
onDateChange(e) {
this.formData.actualSolveDate = e.detail.value;
},
closeopenDeal() {
this.$refs.openDeal.close()
},
// 新增需求
goAddNeeds() {
this.$tab.navigateTo(`/pages/needs/needDetail?activeType=${this.queryParams.needsType}&showTab=1`)
uni.navigateTo(`/packageRc/pages/needs/needDetail?activeType=${this.queryParams.demandType}&showTab=1`)
},
confirmDate(e) {
@@ -255,36 +266,36 @@
// 需求推荐/培训
requirementTraining(item, index) {
if (index == 1) {
uni.navigateTo(
`/pages/services/serviceDetail?personName=${item.personName}&personId=${item.personId}&jobDemandInfoId=${item.id}&jobWorkType=${item.jobWorkType}&type=3&showTab=1`
)
uni.navigateTo({
url: `/packageRc/pages/service/serviceDetail?personName=${item.personName}&personId=${item.personId}&jobDemandInfoId=${item.id}&jobWorkType=${item.jobWorkType}&type=3&showTab=1`
})
} else {
uni.navigateTo(
`/pages/services/serviceDetail?personName=${item.personName}&personId=${item.personId}&skillTrainingId=${item.id}&personStatus=${item.personStatus}&type=4&showTab=1`
)
uni.navigateTo({
url: `/packageRc/pages/service/serviceDetail?personName=${item.personName}&personId=${item.personId}&skillTrainingId=${item.id}&personStatus=${item.personStatus}&type=4&showTab=1`
})
}
},
clickDelete(item) {
this.loading = true;
if (this.queryParams.needsType == 1) {
if (this.queryParams.demandType == 1) {
delJobService(item.id).then((res) => {
this.deleteFinish(res)
});
} else if (this.queryParams.needsType == 2) {
} else if (this.queryParams.demandType == 2) {
delAssistService(item.id).then((res) => {
this.deleteFinish(res)
});
} else if (this.queryParams.needsType == 3) {
} else if (this.queryParams.demandType == 3) {
delEntrepreneurshipService(item.id).then((res) => {
this.deleteFinish(res)
});
} else if (this.queryParams.needsType == 4) {
} else if (this.queryParams.demandType == 4) {
delTrainService(item.id).then((res) => {
this.deleteFinish(res)
});
} else if (this.queryParams.needsType == 5) {
} else if (this.queryParams.demandType == 5) {
delOtherService(item.id).then((res) => {
this.deleteFinish(res)
});
@@ -298,7 +309,7 @@
},
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.demandType}&showTab=1`
})
},
getDictLabel(value, list) {
@@ -321,12 +332,12 @@
console.log(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: "demandType",
data: [{dictLabel: '求职需求', dictValue: '1'},{dictLabel: '创业需求', dictValue: '3'},{dictLabel: '培训需求', dictValue: '4'},{dictLabel: '其他需求', dictValue: '5'}],
activeIndex: 0,
},
{
name: "需求状态",
type: "currentStatus",
@@ -375,9 +386,9 @@
5: 'other' // 其他需求
};
// 获取当前的需求类型字符串
const demandType = demandTypeMap[this.queryParams.needsType] || 'other';
const demandType = demandTypeMap[this.queryParams.demandType] || 'other';
uni.navigateTo({url: `/packageRc/pages/service/serviceTraceability?id=${item.id}&demandType=${demandType}`});
// 使用映射后的字符串构建URL并导航
this.$tab.navigateTo(`/pages/services/serviceTraceability?id=${item.id}&demandType=${demandType}`);
},
// 触底加载
getBottomList() {
@@ -403,27 +414,27 @@
// 获取列表
async getList() {
this.loading = true;
if (this.queryParams.needsType == 1) {
// if (this.queryParams.demandType == 1) {
listJobService(this.queryParams).then((res) => {
this.gettedData(res)
});
} else if (this.queryParams.needsType == 2) {
listAssistService(this.queryParams).then((res) => {
this.gettedData(res)
});
} else if (this.queryParams.needsType == 3) {
listEntrepreneurshipService(this.queryParams).then((res) => {
this.gettedData(res)
});
} else if (this.queryParams.needsType == 4) {
listTrainService(this.queryParams).then((res) => {
this.gettedData(res)
});
} else if (this.queryParams.needsType == 5) {
listOtherService(this.queryParams).then((res) => {
this.gettedData(res)
});
}
// } else if (this.queryParams.demandType == 2) {
// listAssistService(this.queryParams).then((res) => {
// this.gettedData(res)
// });
// } else if (this.queryParams.demandType == 3) {
// listEntrepreneurshipService(this.queryParams).then((res) => {
// this.gettedData(res)
// });
// } else if (this.queryParams.demandType == 4) {
// listTrainService(this.queryParams).then((res) => {
// this.gettedData(res)
// });
// } else if (this.queryParams.demandType == 5) {
// listOtherService(this.queryParams).then((res) => {
// this.gettedData(res)
// });
// }
},
gettedData(res) {
if (res.code == 200) {
@@ -444,11 +455,19 @@
// 需求办结
requirementHandling(item) {
this.$refs.openDeal.open()
this.formData = {
// this.$refs.openDeal.open()
// this.formData = {
// id: item.id,
// currentStatus: '3'
// }
console.log(item, 'asdfjoiasiodfjoi')
this.$refs.dealDone.init({
id: item.id,
currentStatus: '3'
}
currentStatus: "3",
userId: item.userId,
// personStatus: item.personStatus || (this.dict.personStatusList[0] && this.dict.personStatusList[0].dictValue),
});
},
// 需求推荐
@@ -460,6 +479,7 @@
// 办结按钮
async finishJobRecommend() {
uni.showLoading();
try {
// 检查必填项
if (!this.formData.actualSolveDate) {
@@ -468,9 +488,7 @@
if (!this.formData.solveDesc) {
throw new Error('解决说明不能为空');
}
// 显示全局加载
this.$showLoading();
// 根据 queryParams.needsType 获取对应的 URL
// 根据 queryParams.demandType 获取对应的 URL
const obj = {
1: '/demand/personJobDemandInfo/JdJobDemandDone',
2: '/demand/personAssistDemandInfo/assistDone',
@@ -479,7 +497,7 @@
5: '/demand/personOtherDemandInfo/otherDemandDone',
};
const url = obj[this.queryParams.needsType];
const url = '/manage/personDemand/demandDone';//obj[this.queryParams.demandType];
if (!url) {
throw new Error('无效的需求类型');
}
@@ -491,18 +509,17 @@
// 检查响应码是否为200
if (code === 200) {
// 显示成功的提示信息
this.$u.toast(msg);
uni.showToast({title: msg, icon: 'none'});
// this.openDeal = false;
this.$refs.openDeal.close()
this.$refs.openDeal.close()
this.search();
}
} catch (error) {
// 处理错误并显示提示信息
this.$u.toast('请检查必填项填写');
console.error('完成需求时发生错误:', error);
uni.showToast({title: '请检查必填项填写', icon: 'none'});
} finally {
// 确保加载页总是会被隐藏
this.$hideLoading();
uni.hideLoading();
}
},
// async finishJobRecommend() {
@@ -514,21 +531,22 @@
// 4: '/demand/personTrainDemandInfo/JdTrainDemandDone',
// 5: '/demand/personOtherDemandInfo/otherDemandDone',
// }
// if (!this.formData.actualSolveDate) return this.$u.toast('解决时间不能为空');
// if (!this.formData.solveDesc) return this.$u.toast('解决说明不能为空');
// if (!this.formData.actualSolveDate) return uni.showToast({title: '解决时间不能为空', icon: 'none'});
// if (!this.formData.solveDesc) return uni.showToast({title: '解决说明不能为空', icon: 'none'});
// const {
// code,
// data,
// msg
// } = await requirementCompletion(obj[this.queryParams.needsType], this.formData)
// } = await requirementCompletion(obj[this.queryParams.demandType], this.formData)
// if (code == 200) {
// this.$u.toast(msg)
// uni.showToast({title: ms, icon: 'none'}g)
// this.openDeal = false
// this.search()
// }
// },
changeFile(e) {
console.log(e, 34234234234234)
// 清空当前的 fileUrl 数组
this.formData.fileUrl = [];
// 如果 e 有长度(即用户选择了文件)
@@ -539,7 +557,7 @@
this.formData.fileUrl.push(url);
}
}
this.formData.fileUrl = this.$arrayToString(this.formData.fileUrl)
this.formData.fileUrl = this.formData.fileUrl.join(',');
},
}
}
@@ -569,11 +587,15 @@
.search-icon {
width: 40rpx;
height: 40rpx;
}
}
.job-item {
position: relative;
margin-bottom: 24rpx;
background: #fff;
border-radius: 16rpx;
.item_btn{
height: 100rpx;
border-top: 1px solid #e3e8ee;
@@ -616,8 +638,6 @@
}
.top-container {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
// margin-bottom: 24rpx;
@@ -774,10 +794,54 @@
width: 100%;
}
}
.d_flex{
.df_flex{
display: flex;
view{
flex-grow: 1;
text-align: center;
color: #4c6efb;
}
}
}
.df_flex_1{
flex: 1;
}
.df__direction_column {
flex-direction: column;
}
.df_align_center{
align-items: center;
}
.df_justify_center{
justify-content: center;
}
.df_content_between{
justify-content: space-between;
}
.df_shrink_0{
flex-shrink: 0;
}
/* 日期选择器样式 */
.date-picker-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
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-value {
color: #333;
width: 100%
}
</style>