帮扶任务分配、帮扶任务下发
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<AppLayout :title="title" :show-bg-image="false" >
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')" v-if="showVue=='main'">
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')" >
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>帮扶任务分配</text>
|
||||
@@ -31,19 +31,16 @@
|
||||
<!-- 按钮组 -->
|
||||
<view class="button-group">
|
||||
<button class="btn submit-btn" @click="handleSubmit">确定</button>
|
||||
<button class="btn reset-btn" @click="handleCancel">取消</button>
|
||||
<!-- <button class="btn reset-btn" @click="handleCancel">取消</button> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
<target-personel-choice :allocationId="formData.allocationId" @update:show-vue="handleShowVueChange"></target-personel-choice>
|
||||
</view>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, ref, reactive } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app';
|
||||
const { $api, navTo, navBack } = inject('globalFunction');
|
||||
import config from "@/config.js"
|
||||
import targetPersonelChoice from './components/targetPersonnelChoice.vue'
|
||||
@@ -52,6 +49,7 @@ const title = ref('');
|
||||
const taskTypeOptions=ref([])
|
||||
const priorityOptions=ref([])
|
||||
const executeDeptOptions=ref([])
|
||||
const jumpUrl=ref('')
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
taskId: '',
|
||||
@@ -103,9 +101,8 @@ const getBackgroundStyle = (imageName) => ({
|
||||
backgroundPosition: 'center', // 居中
|
||||
backgroundRepeat: 'no-repeat'
|
||||
});
|
||||
const showVue=ref('main')
|
||||
function choicePerson(){
|
||||
showVue.value='choice'
|
||||
navTo('/packageB/priority/targetPersonnelChoice?allocationId='+formData.allocationId);
|
||||
}
|
||||
function listNotParam(){
|
||||
let header={
|
||||
@@ -160,16 +157,6 @@ function normalizePersonData(dataList) {
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function handleShowVueChange(newValue){
|
||||
showVue.value=newValue.showVue
|
||||
if(newValue.selectedPersonIds&&newValue.selectedPersonIds.length>0){
|
||||
formData.goalPersonList=normalizePersonData(newValue.selectedPersonIds)
|
||||
formData.goalPersonCount=newValue.selectedPersonIds.length
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
const handleSubmit = () => {
|
||||
formRef.value?.validate()
|
||||
.then(() => {
|
||||
@@ -209,31 +196,45 @@ const handleCancel = () => {
|
||||
formData.allocationNote=''
|
||||
formData.deadline=null
|
||||
formData.goalPersonList=[]
|
||||
navTo('/packageB/priority/taskAssignment');
|
||||
navTo(jumpUrl.value);
|
||||
}
|
||||
function getDetail(id){
|
||||
function getDetail(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
let params={
|
||||
id:id
|
||||
id:formData.allocationId
|
||||
}
|
||||
$api.myRequest('/dispatch/assist/task/getTask',params,'get',9100,header).then((resData) => {
|
||||
formData.id=resData.data.taskAllocation.id
|
||||
formData.taskName=resData.data.taskName
|
||||
formData.createBy=resData.data.createBy
|
||||
formData.deadline=resData.data.taskAllocation.deadline
|
||||
formData.allocationNote=resData.data.taskAllocation.allocationNote
|
||||
formData.executeDeptAncestors=resData.data.taskAllocation.executeDeptAncestors
|
||||
formData.allocationId=resData.data.taskAllocation.id
|
||||
formData.taskId=resData.data.taskAllocation.taskId
|
||||
});
|
||||
}
|
||||
onLoad((options) => {
|
||||
if(options.url=='taskIssue'){
|
||||
jumpUrl.value='/packageB/priority/taskIssue'
|
||||
}else if (options.url=='taskAssignment'){
|
||||
jumpUrl.value='/packageB/priority/taskAssignment'
|
||||
}
|
||||
let dataInfo=JSON.parse(options.item)
|
||||
formData.id=dataInfo.allocationId
|
||||
formData.taskName=dataInfo.taskName
|
||||
formData.createBy=dataInfo.createBy
|
||||
formData.deadline=dataInfo.taskAllocation.deadline
|
||||
formData.allocationNote=dataInfo.taskAllocation.allocationNote
|
||||
formData.allocationId=dataInfo.allocationId
|
||||
formData.taskId=dataInfo.taskAllocation.taskId
|
||||
listNotParam()
|
||||
getDetail(options.id)
|
||||
getDetail()
|
||||
});
|
||||
onShow(()=>{
|
||||
uni.$on('choicePerson', handleBackData);
|
||||
})
|
||||
// 定义监听回调
|
||||
const handleBackData = (data) => {
|
||||
formData.goalPersonList=normalizePersonData(data)
|
||||
formData.goalPersonCount=data.length
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<image src="/packageB/static/images/train/ctb-k.png" mode=""></image>
|
||||
<view>
|
||||
<text>帮扶记录管理 </text>
|
||||
<view class="btn" style="margin-left: 13%;">
|
||||
<view class="btn" >
|
||||
<text>立即查看</text>
|
||||
<image src="/packageB/static/images/train/arrow.png" mode=""></image>
|
||||
</view>
|
||||
|
||||
@@ -1,197 +1,213 @@
|
||||
<template>
|
||||
<AppLayout :title="title" :show-bg-image="false" @onScrollBottom="getDataList('add')">
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>筛选条件</text>
|
||||
<view class="title-line"></view>
|
||||
</view>
|
||||
<view class="title-right button-sp-area">
|
||||
<button class="mini-btn search-box-btn" type="primary" size="mini" @click="handleSearch">查询</button>
|
||||
<button class="mini-btn reset-box-btn" type="default" size="mini" @click="handleReset">重置</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="search-container">
|
||||
<!-- 人员姓名 -->
|
||||
<view class="search-item">
|
||||
<text class="label">人员姓名:</text>
|
||||
<uni-easyinput v-model="formData.name" placeholder="请输入人员姓名"></uni-easyinput>
|
||||
</view>
|
||||
|
||||
<!-- 身份证号 -->
|
||||
<view class="search-item">
|
||||
<text class="label">身份证号:</text>
|
||||
<uni-easyinput v-model="formData.idCard" placeholder="请输入身份证号"></uni-easyinput>
|
||||
</view>
|
||||
|
||||
<!-- 帮扶类型(下拉选择) -->
|
||||
<view class="search-item">
|
||||
<text class="label">帮扶类型:</text>
|
||||
<uni-data-select v-model="formData.taskType" :localdata="taskTypeOptions" placeholder="请选择帮扶类型" @change="onTaskTypeChange"></uni-data-select>
|
||||
</view>
|
||||
|
||||
<!-- 帮扶人员 -->
|
||||
<view class="search-item">
|
||||
<text class="label">帮扶人员:</text>
|
||||
<uni-easyinput v-model="formData.createByName" placeholder="请输入帮扶人员姓名"></uni-easyinput>
|
||||
</view>
|
||||
|
||||
<!-- 所属区域(下拉选择) -->
|
||||
<view class="search-item">
|
||||
<text class="label">所属区域:</text>
|
||||
<uni-data-picker ref="picker" class="picker" placeholder="请选择所属区域" popup-title="请选择所属区域" :localdata="regions" v-model="formData.deptTags"
|
||||
@change="onchange" >
|
||||
</uni-data-picker>
|
||||
</view>
|
||||
|
||||
<!-- 开始时间 -->
|
||||
<view class="search-item" v-if="false">
|
||||
<text class="label">开始时间:</text>
|
||||
<uni-datetime-picker type="date" placeholder="请选择开始时间" v-model="formData.startTime" @maskClick="onStartTimeChange" />
|
||||
</view>
|
||||
|
||||
<!-- 结束时间 -->
|
||||
<view class="search-item" v-if="false">
|
||||
<text class="label">结束时间:</text>
|
||||
<uni-datetime-picker type="date" placeholder="请选择结束时间" v-model="formData.endTime" @maskClick="onEndTimeChange" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>帮扶记录列表</text>
|
||||
<view class="title-line" style="left: 70rpx;"></view>
|
||||
</view>
|
||||
<view class="title-total">
|
||||
共<text class="total-num">{{totalNum}}</text>条记录
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-box" v-if="dataList.length>0">
|
||||
<view class="con-box" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="form-title">
|
||||
<view class="form-name">
|
||||
{{item.name}}
|
||||
<AppLayout :title="title" :show-bg-image="false" >
|
||||
<view class="page-container" >
|
||||
<scroll-view :scroll-y="true" class="nearby-scroll" @scrolltolower="scrollBottom" lower-threshold="50">
|
||||
<view class="info-box">
|
||||
<view class="info-item info-line">
|
||||
<view class="">
|
||||
<uni-icons type="contact" color="#175CE9" size="34"></uni-icons>
|
||||
</view>
|
||||
<view class="form-type">
|
||||
{{getTaskTypeLabelByValue(item.task_type)}}
|
||||
<view class="info-label">
|
||||
帮扶任务总数
|
||||
</view>
|
||||
<view class="info-value">
|
||||
{{ stats.taskCount }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.phone">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/tele.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
联系电话:
|
||||
</view>
|
||||
<view class="info-item info-line">
|
||||
<view class="">
|
||||
<uni-icons type="info" color="#175CE9" size="34"></uni-icons>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.phone}}
|
||||
<view class="info-label">
|
||||
待分配任务
|
||||
</view>
|
||||
<view class="info-value">
|
||||
{{ stats.pendingCount }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.id_card">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/num.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
身份证号:
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="">
|
||||
<uni-icons type="checkbox" color="#175CE9" size="34"></uni-icons>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.id_card}}
|
||||
<view class="info-label">
|
||||
已分配任务
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.dept_name">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/base.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
所属区域:
|
||||
</view>
|
||||
<view class="info-value">
|
||||
{{ stats.allocatedCount }}
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.dept_name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.create_by_name">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/person.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
帮扶人员:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.create_by_name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.create_by_dept_name">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/help.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
帮扶单位:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.create_by_dept_name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.follow_date">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/date.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
帮扶日期:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.follow_date}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.next_contact_date">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/next.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
下次联系:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.next_contact_date}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-btns">
|
||||
<button class="mini-btn form-box-btn detail-btn" size="mini" v-if="false">详情</button>
|
||||
<button class="mini-btn form-box-btn follow-btn" size="mini" @click="goFollow(item)">跟进</button>
|
||||
<button class="mini-btn form-box-btn recommend-btn" size="mini" @click="goRecommend(item)">智能推荐</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-else pdTop="200"></empty>
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>筛选条件</text>
|
||||
<view class="title-line"></view>
|
||||
</view>
|
||||
<view class="title-right button-sp-area">
|
||||
<button class="mini-btn search-box-btn" type="primary" size="mini" @click="handleSearch">查询</button>
|
||||
<button class="mini-btn reset-box-btn" type="default" size="mini" @click="handleReset">重置</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-container">
|
||||
<!-- 人员姓名 -->
|
||||
<view class="search-item">
|
||||
<text class="label">任务名称:</text>
|
||||
<uni-easyinput v-model="formData.taskName" placeholder="请输入任务名称"></uni-easyinput>
|
||||
</view>
|
||||
<!-- 任务类型 -->
|
||||
<view class="search-item">
|
||||
<text class="label">任务类型:</text>
|
||||
<uni-data-select :key="1" v-model="formData.taskType" :localdata="taskTypeOptions" placeholder="请选择任务类型" @change="onTaskTypeChange"></uni-data-select>
|
||||
</view>
|
||||
<!-- 优先级 -->
|
||||
<view class="search-item">
|
||||
<text class="label">优先级:</text>
|
||||
<uni-data-select :key="2" v-model="formData.priority" :localdata="priorityOptions" placeholder="请选择优先级" @change="onPriorityChange"></uni-data-select>
|
||||
</view>
|
||||
<!-- 创建时间 -->
|
||||
<view class="search-item">
|
||||
<text class="label">创建时间:</text>
|
||||
<uni-datetime-picker v-model="filterTimeRange" type="datetimerange" rangeSeparator="至" @change="filterTimeRangeChange" />
|
||||
</view>
|
||||
<!-- 分配状态 -->
|
||||
<view class="search-item">
|
||||
<text class="label">分配状态:</text>
|
||||
<uni-data-select :key="3" v-model="formData.allocationStatus" :localdata="allocationStatusOptions" placeholder="请选择分配状态" @change="onAllocationStatusChange"></uni-data-select>
|
||||
</view>
|
||||
<!-- 执行区域 -->
|
||||
<view class="search-item" v-if="false">
|
||||
<text class="label">执行区域:</text>
|
||||
<uni-data-select :key="4" v-model="formData.executeDeptId" :localdata="executeDeptOptions" placeholder="请选择区域" @change="onExecuteDeptChange"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>帮扶任务列表</text>
|
||||
<view class="title-line" style="left: 70rpx;"></view>
|
||||
</view>
|
||||
<view class="title-total">
|
||||
共<text class="total-num">{{totalNum}}</text>条记录
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-box" v-if="dataList.length>0">
|
||||
<view class="con-box" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="form-title">
|
||||
<view class="form-name">
|
||||
{{item.taskName}}
|
||||
</view>
|
||||
<view class="form-type">
|
||||
优先级:{{item.priority}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/person.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
目标人数:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.taskAllocation.goalPersonCount}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/num.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
任务类型:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.taskType}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/date.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
分配状态:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.taskAllocation.allocationStatus}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/base.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
执行区域:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.taskAllocation.executeDeptName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/next.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
创建时间:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.createTime}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/next.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
截止时间:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.taskAllocation.deadline}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-btns">
|
||||
<button class="mini-btn form-box-btn detail-btn" size="mini" @click="goDetail(item)">详情</button>
|
||||
<button class="mini-btn form-box-btn follow-btn" size="mini" @click="goTarget(item)">目标人员</button>
|
||||
<button class="mini-btn form-box-btn recommend-btn" v-if="item.taskAllocation.allocationStatus == '待分配'" size="mini" @click="goRecommend(item)">分配</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-else pdTop="200"></empty>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, ref, reactive,onMounted } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { inject, ref, reactive } from 'vue';
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app';
|
||||
const { $api, navTo, navBack } = inject('globalFunction');
|
||||
import config from "@/config.js"
|
||||
|
||||
// state
|
||||
const title = ref('');
|
||||
const initialForm = {
|
||||
name: '',
|
||||
idCard: '',
|
||||
taskType: '',
|
||||
createByName: '',
|
||||
// helpArea: [],
|
||||
// startTime: '',
|
||||
// endTime: '',
|
||||
// deptId:'',
|
||||
deptTags:''
|
||||
}
|
||||
const formData = reactive({ ...initialForm });
|
||||
const taskTypeOptions=ref([])
|
||||
const dataList=ref([])
|
||||
const pageSize=ref(10)
|
||||
const pageNum=ref(1)
|
||||
const stats=ref({})
|
||||
const formData = reactive({
|
||||
taskName: '',
|
||||
taskType: '',
|
||||
priority: '',
|
||||
createTimeStart: null,
|
||||
createTimeEnd: null,
|
||||
allocationStatus: '',
|
||||
executeDeptId: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
})
|
||||
const taskName=ref('')
|
||||
const filterTimeRange=ref([])
|
||||
const totalNum=ref(0)
|
||||
const dataList=ref([])
|
||||
const taskTypeOptions=ref([])
|
||||
const priorityOptions=ref([])
|
||||
const allocationStatusOptions=ref([])
|
||||
const executeDeptOptions=ref([])
|
||||
const baseUrl = config.imgBaseUrl
|
||||
const getBackgroundStyle = (imageName) => ({
|
||||
backgroundImage: `url(${baseUrl}/dispatch/${imageName})`,
|
||||
@@ -199,51 +215,35 @@ const getBackgroundStyle = (imageName) => ({
|
||||
backgroundPosition: 'center', // 居中
|
||||
backgroundRepeat: 'no-repeat'
|
||||
});
|
||||
const trainVideoImgUrl=config.trainVideoImgUrl
|
||||
const picker = ref(null)
|
||||
|
||||
|
||||
// 所属区域选项(可根据实际替换为动态数据)
|
||||
const regions = ref([])
|
||||
|
||||
// 事件处理
|
||||
const onTaskTypeChange = (e) => {
|
||||
formData.taskType=e
|
||||
function listNotParam(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
let params={}
|
||||
$api.myRequest('/dispatch/dept/listNotParam',params,'get',9100,header).then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.deptId,
|
||||
text: item.deptName,
|
||||
ancestors:item.ancestors
|
||||
}
|
||||
executeDeptOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
const onStartTimeChange = (e) => {
|
||||
formData.startTime = e.detail.value
|
||||
function statisticTask(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
let params={}
|
||||
$api.myRequest('/dispatch/assist/task/allocation/statisticTask',params,'get',9100,header).then((resData) => {
|
||||
stats.value=resData.data
|
||||
});
|
||||
}
|
||||
|
||||
const onEndTimeChange = (e) => {
|
||||
formData.endTime = e.detail.value
|
||||
}
|
||||
|
||||
const handleSearch = () => {
|
||||
// 在这里调用接口进行搜索
|
||||
getDataList('refresh')
|
||||
}
|
||||
const handleReset = () =>{
|
||||
Object.assign(formData, initialForm);
|
||||
getDataList('refresh')
|
||||
}
|
||||
onMounted(async () => {
|
||||
// await loadLevelData('201');
|
||||
});
|
||||
onLoad(() => {
|
||||
// let token=uni.getStorageSync('fourLevelLinkage-token')
|
||||
// if(token){
|
||||
// $api.myRequest("/system/user/login/user/info", {}, "GET", 9100, {
|
||||
// Authorization: `Bearer ${uni.getStorageSync("fourLevelLinkage-token")}`
|
||||
// }).then(async (resData) => {
|
||||
|
||||
// await loadLevelData(resData.sysUser.dept.deptId);
|
||||
// getDictionary()
|
||||
// getDataList('refresh');
|
||||
// });
|
||||
// }else{
|
||||
// navTo('/packageB/login2');
|
||||
// }
|
||||
});
|
||||
function getDictionary(){
|
||||
$api.myRequest('/system/public/dict/data/type/assist_task_type').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
@@ -256,151 +256,163 @@ function getDictionary(){
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
function getTaskTypeLabelByValue(value) {
|
||||
if (!Array.isArray(taskTypeOptions.value)) {
|
||||
return ''
|
||||
}
|
||||
const item = taskTypeOptions.value.find(item => item.value === String(value))
|
||||
return item ? item.text : '暂无帮扶类型'
|
||||
}
|
||||
// 加载某一级的数据(parentId 为空表示根)
|
||||
async function loadLevelData(parentId,node) {
|
||||
let header = {
|
||||
'Authorization': uni.getStorageSync('fourLevelLinkage-token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
};
|
||||
let params = { parentId };
|
||||
|
||||
try {
|
||||
const resData = await $api.myRequest('/dispatch/dept/list', params, 'get', 9100, header);
|
||||
if(resData.data.length==0){
|
||||
picker.value.hide()
|
||||
return
|
||||
}
|
||||
const formatted = (resData.data || []).map(item => ({
|
||||
text: item.deptName,
|
||||
value: item.tags,
|
||||
deptId: item.deptId,
|
||||
children: []
|
||||
}));
|
||||
if(node){
|
||||
injectChildren(parentId, formatted);
|
||||
}else{
|
||||
regions.value=formatted
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("加载部门数据失败:", error);
|
||||
uni.showToast({ title: '加载失败', icon: 'none' });
|
||||
}
|
||||
}
|
||||
// 将子级数据注入到对应的父节点
|
||||
function injectChildren(parentValue, childrenData) {
|
||||
const findAndInject = (nodes) => {
|
||||
for (let node of nodes) {
|
||||
if (node.deptId === parentValue) {
|
||||
// 如果 children 已存在且非空,避免重复加载
|
||||
if (!node.children || node.children.length === 0) {
|
||||
node.children = childrenData;
|
||||
$api.myRequest('/system/public/dict/data/type/assist_task_priority').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.dictValue,
|
||||
text: item.dictLabel
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (node.children && node.children.length > 0) {
|
||||
if (findAndInject(node.children)) return true;
|
||||
}
|
||||
priorityOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
findAndInject(regions.value);
|
||||
// 强制更新
|
||||
}
|
||||
// 当用户选择时触发(注意:change 在每级选择后都会触发)
|
||||
function onchange(e) {
|
||||
const selectedValues = e.detail.value;
|
||||
// formData.deptId=selectedValues.map(item => item.value).join(',');
|
||||
if (selectedValues.length === 0) return;
|
||||
// 获取最后一级选中的 value
|
||||
const lastSelectedValue = selectedValues[selectedValues.length - 1];
|
||||
// 查找该节点是否有 children,如果没有则尝试加载
|
||||
const node = findNodeByValue(regions.value, lastSelectedValue);
|
||||
if (node && (!node.children || node.children.length === 0)) {
|
||||
// 检查接口是否还有下一级(可通过接口返回判断,或先尝试加载)
|
||||
// 这里我们直接尝试加载下一级
|
||||
loadLevelData(node.deptId , node);
|
||||
picker.value.show()
|
||||
}
|
||||
}
|
||||
// 工具函数:根据 value 查找节点
|
||||
function findNodeByValue(nodes, value) {
|
||||
for (let node of nodes) {
|
||||
if (node.value === value.value) {
|
||||
return node;
|
||||
});
|
||||
$api.myRequest('/system/public/dict/data/type/assist_task_allocation_status').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.dictValue,
|
||||
text: item.dictLabel
|
||||
}
|
||||
allocationStatusOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
if (node.children && node.children.length > 0) {
|
||||
const found = findNodeByValue(node.children, value);
|
||||
if (found) return found;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function getDeptOptions(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('fourLevelLinkage-token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
let params={
|
||||
parentId:''
|
||||
}
|
||||
$api.myRequest('/dispatch/dept/list', params,'get',9100,header).then((resData) => {
|
||||
});
|
||||
}
|
||||
function getDataList(type = 'add') {
|
||||
let maxPage=Math.ceil(totalNum.value/pageSize.value)
|
||||
let params=({...formData})
|
||||
function getabelByValue(value,arr) {
|
||||
if (!Array.isArray(arr.value)) {
|
||||
return ''
|
||||
}
|
||||
const item = arr.value.find(item => item.value === String(value))
|
||||
return item ? item.text : '暂无'
|
||||
}
|
||||
function onTaskTypeChange(e){
|
||||
formData.taskType=e
|
||||
}
|
||||
function onPriorityChange(e){
|
||||
formData.priority=e
|
||||
}
|
||||
function onAllocationStatusChange(e){
|
||||
formData.allocationStatus=e
|
||||
}
|
||||
function filterTimeRangeChange(e){
|
||||
formData.createTimeStart=e[0]
|
||||
formData.createTimeEnd=e[1]
|
||||
}
|
||||
function onExecuteDeptChange(e){
|
||||
formData.executeDeptId=e
|
||||
}
|
||||
function handleSearch(){
|
||||
dataList.value=[]
|
||||
getDataList()
|
||||
}
|
||||
function getDataList(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('fourLevelLinkage-token'),
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
if (type === 'refresh') {
|
||||
pageNum.value = 1;
|
||||
params.pageSize=pageSize.value
|
||||
params.pageNum=pageNum.value
|
||||
$api.myRequest('/dispatch/assist/records/pageRecords', params,'get',9100,header).then((resData) => {
|
||||
if(resData&&resData.code == 200){
|
||||
dataList.value=resData.rows
|
||||
totalNum.value=resData.total
|
||||
}
|
||||
});
|
||||
}
|
||||
if (type === 'add' && pageNum.value < maxPage) {
|
||||
pageNum.value += 1;
|
||||
params.pageSize=pageSize.value
|
||||
params.pageNum=pageNum.value
|
||||
$api.myRequest('/dispatch/assist/records/pageRecords', params,'get',9100,header).then((resData) => {
|
||||
dataList.value=dataList.value.concat(resData.rows)
|
||||
});
|
||||
$api.myRequest('/dispatch/assist/task/pageAllocateDeptTaskList',formData,'get',9100,header).then((resData) => {
|
||||
resData.rows.forEach(item=>{
|
||||
item.priority=getabelByValue(item.priority,priorityOptions)
|
||||
item.taskType=getabelByValue(item.taskType,taskTypeOptions)
|
||||
item.taskAllocation.allocationStatus=getabelByValue(item.taskAllocation.allocationStatus,allocationStatusOptions)
|
||||
})
|
||||
totalNum.value=resData.total
|
||||
dataList.value=dataList.value.concat(resData.rows)
|
||||
|
||||
});
|
||||
}
|
||||
const handleReset = () => {
|
||||
dataList.value=[]
|
||||
formData.taskName=''
|
||||
formData.taskType=''
|
||||
formData.priority=''
|
||||
formData.createTimeStart=null
|
||||
formData.createTimeEnd=null
|
||||
formData.allocationStatus=''
|
||||
formData.executeDeptId=''
|
||||
formData.pageNum=1
|
||||
formData.pageSize=10
|
||||
filterTimeRange.value=[]
|
||||
getDataList()
|
||||
}
|
||||
const creatTask = () => {
|
||||
navTo('/packageB/priority/taskCreated');
|
||||
}
|
||||
function goRecommend(item){
|
||||
navTo('/packageB/priority/allocate?item='+JSON.stringify(item)+'&url=taskIssue');
|
||||
}
|
||||
function goDetail(item){
|
||||
navTo('/packageB/priority/taskDetail?item='+JSON.stringify(item));
|
||||
}
|
||||
function goTarget(item){
|
||||
navTo('/packageB/priority/targetPersonnel?id='+item.taskAllocation.id+'&taskName='+item.taskName);
|
||||
}
|
||||
function scrollBottom(){
|
||||
if(formData.pageNum<totalNum.value/formData.pageSize){
|
||||
formData.pageNum++
|
||||
getDataList()
|
||||
}
|
||||
}
|
||||
function goFollow(item) {
|
||||
navTo(`/packageB/priority/helpFollow?task_id=${item.task_id}&person_id=${item.person_id}&&name=${item.name}&&taskType=${getTaskTypeLabelByValue(item.task_type)}`);
|
||||
}
|
||||
//智能推荐
|
||||
const goRecommend = (item) => {
|
||||
navTo('/packageB/priority/recommend');
|
||||
onShow(()=>{
|
||||
formData.pageNum=1
|
||||
dataList.value=[]
|
||||
getDataList()
|
||||
console.log("111")
|
||||
})
|
||||
onLoad((options) => {
|
||||
listNotParam()
|
||||
statisticTask()
|
||||
runAsyncTasks(options)
|
||||
});
|
||||
const runAsyncTasks = async (options) => {
|
||||
|
||||
await getDictionary()
|
||||
await getDataList()
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
||||
image
|
||||
height: 100%
|
||||
width: 100%
|
||||
|
||||
.page-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - var(--window-top)); /* 如果 AppLayout 有 header,需减去 */
|
||||
/* 或者简单用:height: 100vh; */
|
||||
}
|
||||
.nearby-scroll
|
||||
// 使用flex布局让scroll-view自适应高度,占据剩余空间
|
||||
flex: 1
|
||||
// overflow: hidden;
|
||||
.info-box
|
||||
margin: 30rpx 30rpx
|
||||
background: linear-gradient(0deg, #D9ECFF 0%, #F0F7FF 100%)
|
||||
border-radius: 20rpx
|
||||
padding: 40rpx 0
|
||||
display: flex
|
||||
align-items: center
|
||||
.info-line
|
||||
border-right: 2rpx solid #B7D6FF
|
||||
.info-item
|
||||
display: flex
|
||||
flex-direction: column
|
||||
align-items: center
|
||||
justify-content: center
|
||||
width: 50%
|
||||
.info-label
|
||||
font-size: 26rpx
|
||||
color: #6E7E9B
|
||||
margin-bottom: 20rpx
|
||||
.info-value
|
||||
font-weight: bold
|
||||
font-size: 28rpx
|
||||
color: #3D61AC
|
||||
.main-list
|
||||
background-color: #ffffff
|
||||
padding: 20rpx 30rpx 28rpx 30rpx
|
||||
padding: 20rpx 20rpx 28rpx 20rpx
|
||||
margin: 30rpx 30rpx
|
||||
box-shadow: 0px 3px 20px 0px rgba(0,105,234,0.1)
|
||||
border-radius: 12px
|
||||
@@ -417,19 +429,29 @@ image
|
||||
.title-line
|
||||
position: absolute
|
||||
bottom: -10rpx
|
||||
left: 36rpx
|
||||
left: 70rpx
|
||||
width: 70rpx
|
||||
height: 8rpx
|
||||
background: linear-gradient(90deg, #FFAD58 0%, #FF7A5B 100%)
|
||||
border-radius: 4rpx
|
||||
.search-box-btn
|
||||
border-radius: 32rpx !important
|
||||
background: #3088FF !important
|
||||
margin-right: 16rpx
|
||||
.reset-box-btn
|
||||
border-radius: 32rpx !important
|
||||
background: #02B44D
|
||||
color: #fff
|
||||
.title-total
|
||||
font-size: 24rpx
|
||||
color: #999999
|
||||
.total-num
|
||||
color: #3088FF
|
||||
margin-left: 4rpx
|
||||
margin-right: 4rpx
|
||||
font-weight: bold
|
||||
font-size: 26rpx
|
||||
|
||||
.list-box
|
||||
margin-top: 40rpx
|
||||
|
||||
:deep(.uni-forms-item__label)
|
||||
width: 194rpx !important
|
||||
font-size: 28rpx;
|
||||
color: #404040;
|
||||
|
||||
.search-container
|
||||
padding: 20rpx 0rpx 0rpx 0rpx
|
||||
.title-total
|
||||
@@ -457,8 +479,14 @@ image
|
||||
background: #FFFFFF
|
||||
flex: 1
|
||||
min-width: 0
|
||||
.list-box
|
||||
margin-top: 40rpx
|
||||
.search-box-btn
|
||||
border-radius: 32rpx !important
|
||||
background: #3088FF !important
|
||||
margin-right: 16rpx
|
||||
.reset-box-btn
|
||||
border-radius: 32rpx !important
|
||||
background: #02B44D
|
||||
color: #fff
|
||||
.con-box
|
||||
background: #fff
|
||||
padding: 20rpx
|
||||
|
||||
457
packageB/priority/targetPersonnel.vue
Normal file
457
packageB/priority/targetPersonnel.vue
Normal file
@@ -0,0 +1,457 @@
|
||||
<template>
|
||||
<AppLayout :title="title" :show-bg-image="false" >
|
||||
<view class="page-container" >
|
||||
<scroll-view :scroll-y="true" class="nearby-scroll" @scrolltolower="scrollBottom" lower-threshold="50">
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="task-box">
|
||||
<text class="task-label">任务:</text>
|
||||
<text class="task-name">{{taskName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>目标人员列表</text>
|
||||
<view class="title-line" style="left: 70rpx;"></view>
|
||||
</view>
|
||||
<view class="title-total">
|
||||
目标人数<text class="total-num">{{totalNum}}</text>人
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-box" v-if="dataList.length>0">
|
||||
<view class="con-box" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="form-title">
|
||||
<view class="form-name">
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.idCard">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/person.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
身份证号:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.idCard}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.phone">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/tele.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
联系电话:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.phone}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.address">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/base.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
住址:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.address}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.skills">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/num.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
技能特长:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.skills}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.tags.length>0">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/date.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
人员标签:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<view class="" v-for="(val,num) in item.tags" :key="num">
|
||||
{{val}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.datasource">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/next.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
数据来源:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.datasource=== '1' ? '自动识别' : '手动添加'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.assistStatus">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/help.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
帮扶状态:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.assistStatus}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.employmentStatus">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/num.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
就业状态:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.employmentStatus}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.unemploymentDate">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/date.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
失业时间:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.unemploymentDate}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.unemploymentRegisterDate">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/date.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
失业登记时间:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.unemploymentRegisterDate}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.graduateDate">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/next.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
毕业时间:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.graduateDate}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-else pdTop="200"></empty>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, ref, reactive, onMounted } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
const { $api, navTo, navBack } = inject('globalFunction');
|
||||
import config from "@/config.js"
|
||||
|
||||
const title = ref('');
|
||||
const id=ref('')
|
||||
const taskName=ref('')
|
||||
const pageNum = ref(1)
|
||||
const pageSize = ref(2)
|
||||
const currentItem=ref({})
|
||||
const totalNum=ref(0)
|
||||
const dataList=ref([])
|
||||
const personDatabaseStatusOptions=ref([])
|
||||
const employmentStatusOptions=ref([])
|
||||
const baseUrl = config.imgBaseUrl
|
||||
const getBackgroundStyle = (imageName) => ({
|
||||
backgroundImage: `url(${baseUrl}/dispatch/${imageName})`,
|
||||
backgroundSize: 'cover', // 覆盖整个容器
|
||||
backgroundPosition: 'center', // 居中
|
||||
backgroundRepeat: 'no-repeat'
|
||||
});
|
||||
const emit = defineEmits(['update:showView'])
|
||||
function getDictionary(){
|
||||
$api.myRequest('/system/public/dict/data/type/person_database_status').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.dictValue,
|
||||
text: item.dictLabel
|
||||
}
|
||||
personDatabaseStatusOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
});
|
||||
$api.myRequest('/system/public/dict/data/type/assist_employment_status').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.dictValue,
|
||||
text: item.dictLabel
|
||||
}
|
||||
employmentStatusOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
function getabelByValue(value,arr) {
|
||||
if (!Array.isArray(arr.value)) {
|
||||
return ''
|
||||
}
|
||||
const item = arr.value.find(item => item.value === String(value))
|
||||
return item ? item.text : '暂无'
|
||||
}
|
||||
function getDataList(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
let params={
|
||||
allocationId: id.value,
|
||||
pageNum: pageNum.value,
|
||||
pageSize: pageSize.value
|
||||
}
|
||||
$api.myRequest('/dispatch/assist/person/database/pageGoalPersonList',params,'get',9100,header).then((resData) => {
|
||||
resData.rows.forEach(item=>{
|
||||
item.tags=item.tagName.split(',')
|
||||
item.assistStatus=getabelByValue(item.assistStatus,personDatabaseStatusOptions)
|
||||
item.employmentStatus=getabelByValue(item.employmentStatus,employmentStatusOptions)
|
||||
})
|
||||
totalNum.value=resData.total
|
||||
dataList.value=dataList.value.concat(resData.rows)
|
||||
|
||||
});
|
||||
}
|
||||
function scrollBottom(){
|
||||
if(pageNum.value<totalNum.value/pageSize.value){
|
||||
pageNum.value++
|
||||
getDataList()
|
||||
}
|
||||
}
|
||||
onLoad((options) => {
|
||||
console.log("options",options)
|
||||
id.value=options.id
|
||||
taskName.value=options.taskName
|
||||
runAsyncTasks()
|
||||
});
|
||||
const runAsyncTasks = async () => {
|
||||
await getDictionary()
|
||||
await getDataList()
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
image
|
||||
height: 100%
|
||||
width: 100%
|
||||
.page-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - var(--window-top)); /* 如果 AppLayout 有 header,需减去 */
|
||||
/* 或者简单用:height: 100vh; */
|
||||
padding-bottom: 140rpx
|
||||
}
|
||||
.nearby-scroll
|
||||
// 使用flex布局让scroll-view自适应高度,占据剩余空间
|
||||
flex: 1
|
||||
// overflow: hidden;
|
||||
.task-box
|
||||
display: flex
|
||||
align-items: center
|
||||
.task-label
|
||||
font-size: 30rpx
|
||||
color: #6E7E9B
|
||||
.task-name
|
||||
font-weight: bold
|
||||
font-size: 30rpx
|
||||
color: #3D61AC
|
||||
.main-list
|
||||
background-color: #ffffff
|
||||
padding: 20rpx 20rpx 28rpx 20rpx
|
||||
margin: 30rpx 30rpx
|
||||
box-shadow: 0px 3px 20px 0px rgba(0,105,234,0.1)
|
||||
border-radius: 12px
|
||||
.list-top
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: space-between
|
||||
.list-title
|
||||
font-weight: bold
|
||||
font-size: 36rpx
|
||||
color: #404040
|
||||
position: relative
|
||||
|
||||
.title-line
|
||||
position: absolute
|
||||
bottom: -10rpx
|
||||
left: 70rpx
|
||||
width: 70rpx
|
||||
height: 8rpx
|
||||
background: linear-gradient(90deg, #FFAD58 0%, #FF7A5B 100%)
|
||||
border-radius: 4rpx
|
||||
.title-total
|
||||
font-size: 24rpx
|
||||
color: #999999
|
||||
.total-num
|
||||
color: #3088FF
|
||||
margin-left: 4rpx
|
||||
margin-right: 4rpx
|
||||
font-weight: bold
|
||||
font-size: 26rpx
|
||||
|
||||
.list-box
|
||||
margin-top: 40rpx
|
||||
|
||||
:deep(.uni-forms-item__label)
|
||||
width: 194rpx !important
|
||||
font-size: 28rpx;
|
||||
color: #404040;
|
||||
|
||||
.search-container
|
||||
padding: 20rpx 0rpx 0rpx 0rpx
|
||||
.title-total
|
||||
font-size: 24rpx
|
||||
color: #999999
|
||||
.total-num
|
||||
color: #3088FF
|
||||
margin-left: 4rpx
|
||||
margin-right: 4rpx
|
||||
font-weight: bold
|
||||
font-size: 26rpx
|
||||
.search-item
|
||||
display: flex
|
||||
align-items: center
|
||||
margin-bottom: 30rpx
|
||||
|
||||
.label
|
||||
width: 160rpx
|
||||
font-size: 28rpx
|
||||
color: #404040
|
||||
flex-shrink: 0
|
||||
|
||||
.input,
|
||||
.picker
|
||||
background: #FFFFFF
|
||||
flex: 1
|
||||
min-width: 0
|
||||
.search-box-btn
|
||||
border-radius: 32rpx !important
|
||||
background: #3088FF !important
|
||||
margin-right: 16rpx
|
||||
.reset-box-btn
|
||||
border-radius: 32rpx !important
|
||||
background: #02B44D
|
||||
color: #fff
|
||||
.con-box
|
||||
background: #fff
|
||||
padding: 20rpx
|
||||
box-shadow: 0px 0px 6rpx 0px rgba(0,71,200,0.16)
|
||||
border-radius: 24rpx
|
||||
border: 1rpx solid #EDF5FF
|
||||
margin-top: 30rpx
|
||||
.form-title
|
||||
display: flex
|
||||
align-items: center
|
||||
|
||||
.form-name
|
||||
font-weight: bold
|
||||
font-size: 30rpx
|
||||
color: #595959
|
||||
margin-right:16rpx
|
||||
.form-type
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #FF7D26;
|
||||
font-size: 24rpx
|
||||
color: #F1690E
|
||||
padding: 4rpx 10rpx
|
||||
.form-item
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: space-between
|
||||
margin-top: 30rpx
|
||||
.item-left
|
||||
display: flex
|
||||
align-items: center
|
||||
.item-img
|
||||
width: 26rpx
|
||||
height: 26rpx
|
||||
margin-right: 10rpx
|
||||
.item-label
|
||||
font-size: 26rpx
|
||||
color: #B3B3B3
|
||||
width: 190rpx
|
||||
.item-right
|
||||
font-size: 26rpx
|
||||
color: #737373
|
||||
// overflow: hidden
|
||||
// text-overflow: ellipsis
|
||||
// white-space: nowrap
|
||||
word-wrap: break-word
|
||||
overflow-wrap: break-word
|
||||
white-space: normal
|
||||
.form-btns
|
||||
margin-top:30rpx
|
||||
.form-box-btn
|
||||
border-radius: 50rpx !important
|
||||
margin-right: 24rpx
|
||||
padding: 0rpx 40rpx
|
||||
.detail-btn
|
||||
background: #EDF5FF
|
||||
border: 1px solid #3088FF
|
||||
font-size: 28rpx
|
||||
color: #3088FF
|
||||
.follow-btn
|
||||
background: #EEF9F3
|
||||
border: 1px solid #00933E
|
||||
font-size: 28rpx
|
||||
color: #00933E
|
||||
.recommend-btn
|
||||
background: linear-gradient(92deg, #0DCCFF 0%, #4760FF 100%)
|
||||
font-size: 28rpx
|
||||
color: #FFFFFF
|
||||
.button-group
|
||||
position: fixed
|
||||
bottom: 0
|
||||
left: 0
|
||||
width: 100%
|
||||
height: 120rpx
|
||||
background: #fff
|
||||
.btns
|
||||
height: 120rpx
|
||||
width: 100%
|
||||
line-height: 120px
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: space-between
|
||||
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1)
|
||||
|
||||
.btn {
|
||||
width: 45%;
|
||||
height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.reset-btn {
|
||||
background-color: #D8E9FF;
|
||||
color: #1176FF;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background-color: #368BFF;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
563
packageB/priority/targetPersonnelChoice.vue
Normal file
563
packageB/priority/targetPersonnelChoice.vue
Normal file
@@ -0,0 +1,563 @@
|
||||
<template>
|
||||
<AppLayout :title="title" :show-bg-image="false" >
|
||||
<view class="page-container" >
|
||||
<scroll-view :scroll-y="true" class="nearby-scroll" @scrolltolower="scrollBottom" lower-threshold="50">
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>筛选条件</text>
|
||||
<view class="title-line"></view>
|
||||
</view>
|
||||
<view class="title-right button-sp-area">
|
||||
<button class="mini-btn search-box-btn" type="primary" size="mini" @click="handleSearch">查询</button>
|
||||
<button class="mini-btn reset-box-btn" type="default" size="mini" @click="handleReset">重置</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-container">
|
||||
<view class="search-item">
|
||||
<text class="label">姓名:</text>
|
||||
<uni-easyinput v-model="formData.name" placeholder="请输入任务名称"></uni-easyinput>
|
||||
</view>
|
||||
<view class="search-item">
|
||||
<text class="label">身份证号:</text>
|
||||
<uni-easyinput v-model="formData.idCard" placeholder="请输入身份证号"></uni-easyinput>
|
||||
</view>
|
||||
<view class="search-item">
|
||||
<text class="label">人员标签:</text>
|
||||
<uni-data-select v-model="formData.tagId" :localdata="personTagOptions" placeholder="请选择人员标签" @change="personTagChange"></uni-data-select>
|
||||
</view>
|
||||
<view class="search-item">
|
||||
<text class="label">所属区域:</text>
|
||||
<uni-data-select v-model="formData.deptTags" :localdata="taskTypeOptions" placeholder="请选择所属区域" @change="onTaskTypeChange"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>目标人员列表</text>
|
||||
<view class="title-line" style="left: 70rpx;"></view>
|
||||
</view>
|
||||
<view class="title-total">
|
||||
目标人数<text class="total-num">{{totalNum}}</text>人
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-box" v-if="dataList.length>0">
|
||||
<view class="con-box" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="form-title">
|
||||
<checkbox :value="item.id" :checked="item.checked" @click="selectItem(item)"/>
|
||||
<view class="form-name">
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.idCard">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/person.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
身份证号:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.idCard}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.phone">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/tele.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
联系电话:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.phone}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.address">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/base.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
住址:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.address}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.skills">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/num.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
技能特长:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.skills}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.tags.length>0">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/date.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
人员标签:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<view class="" v-for="(val,num) in item.tags" :key="num">
|
||||
{{val}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.datasource">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/next.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
数据来源:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.datasource=== '1' ? '自动识别' : '手动添加'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.assistStatus">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/help.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
帮扶状态:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.assistStatus}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.employmentStatus">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/num.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
就业状态:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.employmentStatus}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.unemploymentDate">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/date.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
失业时间:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.unemploymentDate}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.unemploymentRegisterDate">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/date.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
失业登记时间:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.unemploymentRegisterDate}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.graduateDate">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/next.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
毕业时间:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.graduateDate}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-else pdTop="200"></empty>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
<view class="button-group">
|
||||
<view class="btns">
|
||||
<button class="btn submit-btn" @click="handlesubmit">确认选择</button>
|
||||
<button class="btn reset-btn" @click="handleCancel">关闭</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, ref, reactive, onMounted } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
const { $api, navTo, navBack } = inject('globalFunction');
|
||||
import config from "@/config.js"
|
||||
|
||||
const title = ref('');
|
||||
const formData = reactive({
|
||||
allocationId:'',
|
||||
name: '',
|
||||
idCard: '',
|
||||
tagId: '',
|
||||
deptTags: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
})
|
||||
const totalNum=ref(0)
|
||||
const dataList=ref([])
|
||||
const personDatabaseStatusOptions=ref([])
|
||||
const employmentStatusOptions=ref([])
|
||||
const personTagOptions=ref([])
|
||||
const selectedPersonIds=ref([])
|
||||
const baseUrl = config.imgBaseUrl
|
||||
const getBackgroundStyle = (imageName) => ({
|
||||
backgroundImage: `url(${baseUrl}/dispatch/${imageName})`,
|
||||
backgroundSize: 'cover', // 覆盖整个容器
|
||||
backgroundPosition: 'center', // 居中
|
||||
backgroundRepeat: 'no-repeat'
|
||||
});
|
||||
const emit = defineEmits(['update:showVue'])
|
||||
function getDictionary(){
|
||||
$api.myRequest('/system/public/dict/data/type/person_database_status').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.dictValue,
|
||||
text: item.dictLabel
|
||||
}
|
||||
personDatabaseStatusOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
});
|
||||
$api.myRequest('/system/public/dict/data/type/assist_employment_status').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.dictValue,
|
||||
text: item.dictLabel
|
||||
}
|
||||
employmentStatusOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
});
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
let params={}
|
||||
$api.myRequest('/dispatch/assist/person/tag/list',params,'get',9100,header).then((resData) => {
|
||||
console.log("res",resData)
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.id,
|
||||
text: item.name
|
||||
}
|
||||
personTagOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
function getabelByValue(value,arr) {
|
||||
if (!Array.isArray(arr.value)) {
|
||||
return ''
|
||||
}
|
||||
const item = arr.value.find(item => item.value === String(value))
|
||||
return item ? item.text : '暂无'
|
||||
}
|
||||
const handleCancel = () => {
|
||||
uni.navigateBack();
|
||||
// emit('update:showVue', {
|
||||
// showVue: 'main',
|
||||
// selectedPersonIds: []
|
||||
// });
|
||||
// emit('update:showVue', 'main')
|
||||
}
|
||||
function handleSearch(){
|
||||
dataList.value=[]
|
||||
getDataList()
|
||||
}
|
||||
function handleReset(){
|
||||
formData.allocationId=''
|
||||
formData.name=''
|
||||
formData.idCard=''
|
||||
formData.tagId=''
|
||||
formData.deptTags=''
|
||||
formData.pageNum=1
|
||||
formData.pageSize=10
|
||||
dataList.value=[]
|
||||
getDataList()
|
||||
}
|
||||
function getDataList(){
|
||||
let url=''
|
||||
if(formData.allocationId){
|
||||
url='/dispatch/assist/person/database/pageAllocatePersonList'
|
||||
}else{
|
||||
url='/dispatch/assist/person/database/pageList'
|
||||
}
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
$api.myRequest(url,formData,'get',9100,header).then((resData) => {
|
||||
resData.rows.forEach(item=>{
|
||||
item.tags=item.tagName.split(',')
|
||||
item.assistStatus=getabelByValue(item.assistStatus,personDatabaseStatusOptions)
|
||||
item.employmentStatus=getabelByValue(item.employmentStatus,employmentStatusOptions)
|
||||
item.checked = false; // 添加这一行
|
||||
})
|
||||
totalNum.value=resData.total
|
||||
dataList.value=dataList.value.concat(resData.rows)
|
||||
|
||||
});
|
||||
}
|
||||
function selectItem(item) {
|
||||
const id = item.id; // 假设每条数据有唯一 id 字段
|
||||
item.checked = !item.checked;
|
||||
|
||||
if (item.checked) {
|
||||
// 如果选中,加入数组(去重)
|
||||
if (!selectedPersonIds.value.includes(id)) {
|
||||
selectedPersonIds.value.push(id);
|
||||
}
|
||||
} else {
|
||||
// 如果取消选中,从数组中移除
|
||||
selectedPersonIds.value = selectedPersonIds.value.filter(v => v !== id);
|
||||
}
|
||||
}
|
||||
// 获取选中的数据
|
||||
function handlesubmit() {
|
||||
uni.$emit('choicePerson', selectedPersonIds.value);
|
||||
uni.navigateBack();
|
||||
// emit('update:showVue', {
|
||||
// showVue: 'main',
|
||||
// selectedPersonIds: selectedPersonIds.value
|
||||
// });
|
||||
}
|
||||
function personTagChange(e){
|
||||
formData.tagId=e
|
||||
}
|
||||
function scrollBottom(){
|
||||
if(formData.pageNum<totalNum.value/formData.pageSize){
|
||||
formData.pageNum++
|
||||
getDataList()
|
||||
}
|
||||
}
|
||||
onLoad((options) => {
|
||||
if(options.allocationId){
|
||||
formData.allocationId=options.allocationId
|
||||
}
|
||||
runAsyncTasks()
|
||||
});
|
||||
const runAsyncTasks = async () => {
|
||||
await getDictionary()
|
||||
await getDataList()
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
image
|
||||
height: 100%
|
||||
width: 100%
|
||||
.page-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - var(--window-top)); /* 如果 AppLayout 有 header,需减去 */
|
||||
padding-bottom: 140rpx
|
||||
/* 或者简单用:height: 100vh; */
|
||||
}
|
||||
.nearby-scroll
|
||||
// 使用flex布局让scroll-view自适应高度,占据剩余空间
|
||||
flex: 1
|
||||
// overflow: hidden;
|
||||
.task-box
|
||||
display: flex
|
||||
align-items: center
|
||||
.task-label
|
||||
font-size: 30rpx
|
||||
color: #6E7E9B
|
||||
.task-name
|
||||
font-weight: bold
|
||||
font-size: 30rpx
|
||||
color: #3D61AC
|
||||
.main-list
|
||||
background-color: #ffffff
|
||||
padding: 20rpx 20rpx 28rpx 20rpx
|
||||
margin: 30rpx 30rpx
|
||||
box-shadow: 0px 3px 20px 0px rgba(0,105,234,0.1)
|
||||
border-radius: 12px
|
||||
.list-top
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: space-between
|
||||
.list-title
|
||||
font-weight: bold
|
||||
font-size: 36rpx
|
||||
color: #404040
|
||||
position: relative
|
||||
|
||||
.title-line
|
||||
position: absolute
|
||||
bottom: -10rpx
|
||||
left: 70rpx
|
||||
width: 70rpx
|
||||
height: 8rpx
|
||||
background: linear-gradient(90deg, #FFAD58 0%, #FF7A5B 100%)
|
||||
border-radius: 4rpx
|
||||
.title-total
|
||||
font-size: 24rpx
|
||||
color: #999999
|
||||
.total-num
|
||||
color: #3088FF
|
||||
margin-left: 4rpx
|
||||
margin-right: 4rpx
|
||||
font-weight: bold
|
||||
font-size: 26rpx
|
||||
|
||||
.list-box
|
||||
margin-top: 40rpx
|
||||
|
||||
:deep(.uni-forms-item__label)
|
||||
width: 194rpx !important
|
||||
font-size: 28rpx;
|
||||
color: #404040;
|
||||
|
||||
.search-container
|
||||
padding: 20rpx 0rpx 0rpx 0rpx
|
||||
.title-total
|
||||
font-size: 24rpx
|
||||
color: #999999
|
||||
.total-num
|
||||
color: #3088FF
|
||||
margin-left: 4rpx
|
||||
margin-right: 4rpx
|
||||
font-weight: bold
|
||||
font-size: 26rpx
|
||||
.search-item
|
||||
display: flex
|
||||
align-items: center
|
||||
margin-bottom: 30rpx
|
||||
|
||||
.label
|
||||
width: 160rpx
|
||||
font-size: 28rpx
|
||||
color: #404040
|
||||
flex-shrink: 0
|
||||
|
||||
.input,
|
||||
.picker
|
||||
background: #FFFFFF
|
||||
flex: 1
|
||||
min-width: 0
|
||||
.search-box-btn
|
||||
border-radius: 32rpx !important
|
||||
background: #3088FF !important
|
||||
margin-right: 16rpx
|
||||
.reset-box-btn
|
||||
border-radius: 32rpx !important
|
||||
background: #02B44D
|
||||
color: #fff
|
||||
.con-box
|
||||
background: #fff
|
||||
padding: 20rpx
|
||||
box-shadow: 0px 0px 6rpx 0px rgba(0,71,200,0.16)
|
||||
border-radius: 24rpx
|
||||
border: 1rpx solid #EDF5FF
|
||||
margin-top: 30rpx
|
||||
.form-title
|
||||
display: flex
|
||||
align-items: center
|
||||
|
||||
.form-name
|
||||
font-weight: bold
|
||||
font-size: 30rpx
|
||||
color: #595959
|
||||
margin-right:16rpx
|
||||
.form-type
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #FF7D26;
|
||||
font-size: 24rpx
|
||||
color: #F1690E
|
||||
padding: 4rpx 10rpx
|
||||
.form-item
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: space-between
|
||||
margin-top: 30rpx
|
||||
.item-left
|
||||
display: flex
|
||||
align-items: center
|
||||
.item-img
|
||||
width: 26rpx
|
||||
height: 26rpx
|
||||
margin-right: 10rpx
|
||||
.item-label
|
||||
font-size: 26rpx
|
||||
color: #B3B3B3
|
||||
width: 190rpx
|
||||
.item-right
|
||||
font-size: 26rpx
|
||||
color: #737373
|
||||
// overflow: hidden
|
||||
// text-overflow: ellipsis
|
||||
// white-space: nowrap
|
||||
word-wrap: break-word
|
||||
overflow-wrap: break-word
|
||||
white-space: normal
|
||||
.form-btns
|
||||
margin-top:30rpx
|
||||
.form-box-btn
|
||||
border-radius: 50rpx !important
|
||||
margin-right: 24rpx
|
||||
padding: 0rpx 40rpx
|
||||
.detail-btn
|
||||
background: #EDF5FF
|
||||
border: 1px solid #3088FF
|
||||
font-size: 28rpx
|
||||
color: #3088FF
|
||||
.follow-btn
|
||||
background: #EEF9F3
|
||||
border: 1px solid #00933E
|
||||
font-size: 28rpx
|
||||
color: #00933E
|
||||
.recommend-btn
|
||||
background: linear-gradient(92deg, #0DCCFF 0%, #4760FF 100%)
|
||||
font-size: 28rpx
|
||||
color: #FFFFFF
|
||||
.button-group
|
||||
position: fixed
|
||||
bottom: 0
|
||||
left: 0
|
||||
width: 100%
|
||||
height: 120rpx
|
||||
background: #fff
|
||||
.btns
|
||||
height: 120rpx
|
||||
width: 100%
|
||||
line-height: 120px
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: space-between
|
||||
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1)
|
||||
.btn {
|
||||
width: 45%;
|
||||
height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.reset-btn {
|
||||
background-color: #D8E9FF;
|
||||
color: #1176FF;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background-color: #368BFF;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<AppLayout :title="title" :show-bg-image="false" >
|
||||
<view class="page-container" v-if="showView=='main'">
|
||||
<view class="page-container">
|
||||
<scroll-view :scroll-y="true" class="nearby-scroll" @scrolltolower="scrollBottom" lower-threshold="50">
|
||||
<view class="info-box">
|
||||
<view class="info-item info-line">
|
||||
@@ -184,15 +184,7 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- <view class="" v-else-if="showView=='add'" >
|
||||
<task-created :taskTypeOptions="taskTypeOptions" :priorityOptions="priorityOptions" :executeDeptOptions="executeDeptOptions" @update:show-view="handleShowViewChange"></task-created>
|
||||
</view> -->
|
||||
<view class="" v-else-if="showView=='detail'" >
|
||||
<task-detail :currentItem="currentItem" :taskTypeOptions="taskTypeOptions" :priorityOptions="priorityOptions" :executeDeptOptions="executeDeptOptions" :allocationStatusOptions="allocationStatusOptions" @update:show-view="handleShowViewChange"></task-detail>
|
||||
</view>
|
||||
<view class="" v-else-if="showView=='targetPersonnel'" >
|
||||
<target-personnel :currentItem="currentItem" :taskName="taskName" @update:show-view="handleShowViewChange"></target-personnel>
|
||||
</view>
|
||||
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
@@ -201,11 +193,7 @@ import { inject, ref, reactive } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
const { $api, navTo, navBack } = inject('globalFunction');
|
||||
import config from "@/config.js"
|
||||
// import taskCreated from './components/taskCreated.vue';
|
||||
import taskDetail from './components/taskDetail.vue';
|
||||
import targetPersonnel from './components/targetPersonnel.vue';
|
||||
|
||||
const showView=ref('main')
|
||||
const title = ref('');
|
||||
const stats=ref({})
|
||||
const formData = reactive({
|
||||
@@ -356,11 +344,6 @@ const handleReset = () => {
|
||||
filterTimeRange.value=[]
|
||||
getDataList()
|
||||
}
|
||||
function handleShowViewChange(newValue) {
|
||||
showView.value = newValue
|
||||
dataList.value=[]
|
||||
getDataList()
|
||||
}
|
||||
const creatTask = () => {
|
||||
navTo('/packageB/priority/taskCreated');
|
||||
}
|
||||
@@ -368,13 +351,10 @@ function goRecommend(item){
|
||||
navTo('/packageB/priority/allocate?id='+item.id);
|
||||
}
|
||||
function goDetail(item){
|
||||
currentItem.value=item.id
|
||||
showView.value='detail'
|
||||
navTo('/packageB/priority/taskDetail?item='+JSON.stringify(item)+'&url=taskAssignment');
|
||||
}
|
||||
function goTarget(item){
|
||||
currentItem.value=item.taskAllocation.id
|
||||
taskName.value=item.taskName
|
||||
showView.value='targetPersonnel'
|
||||
navTo('/packageB/priority/targetPersonnel?id='+item.taskAllocation.id+'&taskName='+item.taskName);
|
||||
}
|
||||
function scrollBottom(){
|
||||
if(formData.pageNum<totalNum.value/formData.pageSize){
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<AppLayout :title="title" :show-bg-image="false" >
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')" v-if="showVue=='main'">
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>创建任务</text>
|
||||
@@ -41,18 +41,14 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
<target-personel-choice @update:show-vue="handleShowVueChange"></target-personel-choice>
|
||||
</view>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, ref, reactive } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app';
|
||||
const { $api, navTo, navBack } = inject('globalFunction');
|
||||
import config from "@/config.js"
|
||||
import targetPersonelChoice from './components/targetPersonnelChoice.vue'
|
||||
|
||||
const title = ref('');
|
||||
const taskTypeOptions=ref([])
|
||||
@@ -121,9 +117,8 @@ const getBackgroundStyle = (imageName) => ({
|
||||
backgroundPosition: 'center', // 居中
|
||||
backgroundRepeat: 'no-repeat'
|
||||
});
|
||||
const showVue=ref('main')
|
||||
function choicePerson(){
|
||||
showVue.value='choice'
|
||||
navTo('/packageB/priority/targetPersonnelChoice');
|
||||
}
|
||||
function getDictionary(){
|
||||
$api.myRequest('/system/public/dict/data/type/assist_task_type').then((resData) => {
|
||||
@@ -209,15 +204,6 @@ function normalizePersonData(dataList) {
|
||||
};
|
||||
});
|
||||
}
|
||||
function handleShowVueChange(newValue){
|
||||
showVue.value=newValue.showVue
|
||||
if(newValue.selectedPersonIds&&newValue.selectedPersonIds.length>0){
|
||||
formData.taskAllocation.goalPersonList = normalizePersonData(newValue.selectedPersonIds)
|
||||
formData.taskAllocation.goalPersonCount=newValue.selectedPersonIds.length
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
const handleSubmit = () => {
|
||||
formRef.value?.validate()
|
||||
.then(() => {
|
||||
@@ -259,12 +245,22 @@ const handleCancel = () => {
|
||||
formData.taskAllocation.allocationNote=''
|
||||
formData.taskAllocation.deadline=null
|
||||
formData.taskAllocation.goalPersonList=[]
|
||||
navTo('/packageB/priority/taskAssignment');
|
||||
uni.redirectTo({
|
||||
url:'/packageB/priority/taskAssignment'
|
||||
})
|
||||
}
|
||||
onLoad((options) => {
|
||||
listNotParam()
|
||||
getDictionary()
|
||||
});
|
||||
onShow(()=>{
|
||||
uni.$on('choicePerson', handleBackData);
|
||||
})
|
||||
// 定义监听回调
|
||||
const handleBackData = (data) => {
|
||||
formData.taskAllocation.goalPersonList=normalizePersonData(data)
|
||||
formData.taskAllocation.goalPersonCount=data.length
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
470
packageB/priority/taskDetail.vue
Normal file
470
packageB/priority/taskDetail.vue
Normal file
@@ -0,0 +1,470 @@
|
||||
<template>
|
||||
<AppLayout :title="title" :show-bg-image="false" >
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>帮扶任务详情</text>
|
||||
<view class="title-line"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-container">
|
||||
<view class="form-item">
|
||||
<view class="item-label">
|
||||
任务名称:
|
||||
</view>
|
||||
<view class="item-value">
|
||||
{{formData.taskName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="item-label">
|
||||
任务类型:
|
||||
</view>
|
||||
<view class="item-value">
|
||||
{{formData.taskType}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="item-label">
|
||||
优先级:
|
||||
</view>
|
||||
<view class="item-value">
|
||||
{{formData.priority}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="item-label">
|
||||
目标人数:
|
||||
</view>
|
||||
<view class="item-value">
|
||||
{{formData.taskAllocation.goalPersonCount}}人
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="item-label">
|
||||
分配区域:
|
||||
</view>
|
||||
<view class="item-value" v-if="isAssignment" >
|
||||
{{formData.taskAllocation.allocationByDeptName}}
|
||||
</view>
|
||||
<view class="item-value" v-else >
|
||||
{{formData.taskAllocation.executeDeptName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="item-label">
|
||||
创建时间:
|
||||
</view>
|
||||
<view class="item-value">
|
||||
{{formData.createTime}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="item-label">
|
||||
截止时间:
|
||||
</view>
|
||||
<view class="item-value">
|
||||
{{formData.taskAllocation.deadline}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="item-label">
|
||||
分配状态:
|
||||
</view>
|
||||
<view class="item-value">
|
||||
{{formData.taskAllocation.allocationStatus}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="item-label">
|
||||
分配说明:
|
||||
</view>
|
||||
<view class="item-value">
|
||||
{{formData.taskAllocation.allocationNote?formData.taskAllocation.allocationNote:'暂无'}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')" v-if="isAssignment">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>分配列表</text>
|
||||
<view class="title-line" style="left: 70rpx;"></view>
|
||||
</view>
|
||||
<view class="title-total">
|
||||
共<text class="total-num">{{allocationList.length}}</text>条记录
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-box" v-if="allocationList.length>0">
|
||||
<view class="con-box" v-for="(item,index) in allocationList" :key="index">
|
||||
<view class="form-item mb-30" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/person.png'" mode=""></image>
|
||||
<view class="item-label1">
|
||||
目标人数:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.goalPersonCount}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item mb-30" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/person.png'" mode=""></image>
|
||||
<view class="item-label1">
|
||||
分配人:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.allocationByName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item mb-30" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/base.png'" mode=""></image>
|
||||
<view class="item-label1">
|
||||
分配区域:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.allocationByDeptName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item mb-30" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/next.png'" mode=""></image>
|
||||
<view class="item-label1">
|
||||
分配时间:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.allocationTime}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item mb-30" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/base.png'" mode=""></image>
|
||||
<view class="item-label1">
|
||||
执行区域:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.createByDeptName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item mb-30" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/date.png'" mode=""></image>
|
||||
<view class="item-label1">
|
||||
执行状态:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.allocationStatus}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item mb-30" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/next.png'" mode=""></image>
|
||||
<view class="item-label1">
|
||||
截止时间:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.deadline}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-else pdTop="200"></empty>
|
||||
</view>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, ref, reactive,onMounted } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
const { $api, navTo, navBack } = inject('globalFunction');
|
||||
import config from "@/config.js"
|
||||
|
||||
const title = ref('');
|
||||
const formData = reactive({
|
||||
taskName: '',
|
||||
taskType: '',
|
||||
priority: '',
|
||||
createTime:'',
|
||||
allocationStatus:'',
|
||||
taskAllocation: {
|
||||
goalPersonCount: null,
|
||||
executeDeptId: '',
|
||||
executeDeptName: '',
|
||||
executeDeptAncestors: '',
|
||||
allocationStatus: '1',
|
||||
allocationNote: '',
|
||||
deadline: null,
|
||||
goalPersonList: []
|
||||
}
|
||||
})
|
||||
const isAssignment=ref(true)
|
||||
const taskTypeOptions=ref([])
|
||||
const priorityOptions=ref([])
|
||||
const allocationStatusOptions=ref([])
|
||||
const executeDeptOptions=ref([])
|
||||
// 表单引用
|
||||
const formRef = ref(null)
|
||||
const allocationList=ref([])
|
||||
const baseUrl = config.imgBaseUrl
|
||||
const getBackgroundStyle = (imageName) => ({
|
||||
backgroundImage: `url(${baseUrl}/dispatch/${imageName})`,
|
||||
backgroundSize: 'cover', // 覆盖整个容器
|
||||
backgroundPosition: 'center', // 居中
|
||||
backgroundRepeat: 'no-repeat'
|
||||
});
|
||||
|
||||
// 事件处理
|
||||
function onDateChange(){}
|
||||
function taskTypeChange(){}
|
||||
function priorityChange(){}
|
||||
function executeDeptChange(){}
|
||||
|
||||
function listNotParam(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
let params={}
|
||||
$api.myRequest('/dispatch/dept/listNotParam',params,'get',9100,header).then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.deptId,
|
||||
text: item.deptName,
|
||||
ancestors:item.ancestors
|
||||
}
|
||||
executeDeptOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
function getDictionary(){
|
||||
$api.myRequest('/system/public/dict/data/type/assist_task_type').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.dictValue,
|
||||
text: item.dictLabel
|
||||
}
|
||||
taskTypeOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
});
|
||||
$api.myRequest('/system/public/dict/data/type/assist_task_priority').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.dictValue,
|
||||
text: item.dictLabel
|
||||
}
|
||||
priorityOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
});
|
||||
$api.myRequest('/system/public/dict/data/type/assist_task_allocation_status').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.dictValue,
|
||||
text: item.dictLabel
|
||||
}
|
||||
allocationStatusOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
function getDetail(id){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
let params={
|
||||
id:id
|
||||
}
|
||||
$api.myRequest('/dispatch/assist/task/getTask',params,'get',9100,header).then((resData) => {
|
||||
resData.data.taskType=getabelByValue(resData.data.taskType,taskTypeOptions.value)
|
||||
resData.data.priority=getabelByValue(resData.data.priority,priorityOptions.value)
|
||||
let allocationStatus=resData.data.taskAllocation.allocationStatus
|
||||
resData.data.allocationStatus=getabelByValue(allocationStatus,allocationStatusOptions.value)
|
||||
Object.assign(formData, resData.data)
|
||||
getAllocationList()
|
||||
});
|
||||
}
|
||||
function getAllocationList(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
let params={
|
||||
parentId:formData.taskAllocation.id
|
||||
}
|
||||
$api.myRequest('/dispatch/assist/task/allocation/getAllocationList',params,'get',9100,header).then((resData) => {
|
||||
console.log("resData",resData)
|
||||
resData.data.forEach(item=>{
|
||||
item.allocationStatus=getabelByValue(item.allocationStatus,allocationStatusOptions.value)
|
||||
})
|
||||
allocationList.value=resData.data
|
||||
});
|
||||
}
|
||||
function getabelByValue(value,arr) {
|
||||
if (!Array.isArray(arr)) {
|
||||
return ''
|
||||
}
|
||||
const item = arr.find(item => item.value === String(value))
|
||||
return item ? item.text : '暂无'
|
||||
}
|
||||
onLoad((options) => {
|
||||
if(options.url&&options.url=='taskAssignment'){
|
||||
isAssignment.value=false
|
||||
}
|
||||
listNotParam()
|
||||
runAsyncTasks(options)
|
||||
});
|
||||
const runAsyncTasks = async (options) => {
|
||||
await getDictionary()
|
||||
let dataInfo=JSON.parse(options.item)
|
||||
console.log("dataInfo",dataInfo)
|
||||
Object.assign(formData, dataInfo)
|
||||
if(isAssignment.value){
|
||||
getAllocationList()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
image
|
||||
height: 100%
|
||||
width: 100%
|
||||
.main-list
|
||||
background-color: #ffffff
|
||||
padding: 20rpx 20rpx 28rpx 20rpx
|
||||
margin: 30rpx 30rpx
|
||||
box-shadow: 0px 3px 20px 0px rgba(0,105,234,0.1)
|
||||
border-radius: 12px
|
||||
.list-top
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: space-between
|
||||
.list-title
|
||||
font-weight: bold
|
||||
font-size: 36rpx
|
||||
color: #404040
|
||||
position: relative
|
||||
|
||||
.title-line
|
||||
position: absolute
|
||||
bottom: -10rpx
|
||||
left: 70rpx
|
||||
width: 70rpx
|
||||
height: 8rpx
|
||||
background: linear-gradient(90deg, #FFAD58 0%, #FF7A5B 100%)
|
||||
border-radius: 4rpx
|
||||
.title-total
|
||||
font-size: 24rpx
|
||||
color: #999999
|
||||
.total-num
|
||||
color: #3088FF
|
||||
margin-left: 4rpx
|
||||
margin-right: 4rpx
|
||||
font-weight: bold
|
||||
font-size: 26rpx
|
||||
.input,
|
||||
.picker
|
||||
flex: 1
|
||||
|
||||
.picker-value
|
||||
color: #666
|
||||
|
||||
.form-container
|
||||
margin-top: 30rpx
|
||||
.con-box
|
||||
background: #fff
|
||||
padding: 20rpx
|
||||
box-shadow: 0px 0px 6rpx 0px rgba(0,71,200,0.16)
|
||||
border-radius: 24rpx
|
||||
border: 1rpx solid #EDF5FF
|
||||
margin-top: 30rpx
|
||||
.form-item
|
||||
display: flex
|
||||
align-items: center
|
||||
margin-bottom: 20rpx
|
||||
.mb-30
|
||||
margin-bottom: 30rpx
|
||||
.item-left
|
||||
display: flex
|
||||
align-items: center
|
||||
.item-img
|
||||
width: 26rpx
|
||||
height: 26rpx
|
||||
margin-right: 10rpx
|
||||
.item-label1
|
||||
font-size: 26rpx
|
||||
color: #B3B3B3
|
||||
width: 130rpx
|
||||
.item-label
|
||||
width:200rpx
|
||||
text-align: left
|
||||
font-size: 30rpx
|
||||
color: #606266
|
||||
height: 72rpx
|
||||
padding: 0 24rpx 0 0
|
||||
vertical-align: middle
|
||||
flex-shrink: 0
|
||||
box-sizing: border-box
|
||||
.item-value
|
||||
color: #333
|
||||
font-size: 30rpx
|
||||
height: 72rpx
|
||||
padding: 0 24rpx 0 0
|
||||
vertical-align: middle
|
||||
flex-shrink: 0
|
||||
box-sizing: border-box
|
||||
:deep(.uni-forms-item__label)
|
||||
width: 194rpx !important
|
||||
font-size: 28rpx;
|
||||
color: #404040;
|
||||
|
||||
.button-group {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 40rpx 20rpx 20rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 45%;
|
||||
height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.reset-btn {
|
||||
background-color: #D8E9FF;
|
||||
color: #1176FF;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background-color: #368BFF;
|
||||
color: white;
|
||||
}
|
||||
.choice-btn{
|
||||
width: 100%;
|
||||
height: 70rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 8rpx;
|
||||
background-color: #368BFF;
|
||||
color: white;
|
||||
margin-left: 0;
|
||||
}
|
||||
:deep(.uni-easyinput__content)
|
||||
background: rgba(0,0,0,0) !important
|
||||
</style>
|
||||
@@ -1,197 +1,213 @@
|
||||
<template>
|
||||
<AppLayout :title="title" :show-bg-image="false" @onScrollBottom="getDataList('add')">
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>筛选条件</text>
|
||||
<view class="title-line"></view>
|
||||
</view>
|
||||
<view class="title-right button-sp-area">
|
||||
<button class="mini-btn search-box-btn" type="primary" size="mini" @click="handleSearch">查询</button>
|
||||
<button class="mini-btn reset-box-btn" type="default" size="mini" @click="handleReset">重置</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="search-container">
|
||||
<!-- 人员姓名 -->
|
||||
<view class="search-item">
|
||||
<text class="label">人员姓名:</text>
|
||||
<uni-easyinput v-model="formData.name" placeholder="请输入人员姓名"></uni-easyinput>
|
||||
</view>
|
||||
|
||||
<!-- 身份证号 -->
|
||||
<view class="search-item">
|
||||
<text class="label">身份证号:</text>
|
||||
<uni-easyinput v-model="formData.idCard" placeholder="请输入身份证号"></uni-easyinput>
|
||||
</view>
|
||||
|
||||
<!-- 帮扶类型(下拉选择) -->
|
||||
<view class="search-item">
|
||||
<text class="label">帮扶类型:</text>
|
||||
<uni-data-select v-model="formData.taskType" :localdata="taskTypeOptions" placeholder="请选择帮扶类型" @change="onTaskTypeChange"></uni-data-select>
|
||||
</view>
|
||||
|
||||
<!-- 帮扶人员 -->
|
||||
<view class="search-item">
|
||||
<text class="label">帮扶人员:</text>
|
||||
<uni-easyinput v-model="formData.createByName" placeholder="请输入帮扶人员姓名"></uni-easyinput>
|
||||
</view>
|
||||
|
||||
<!-- 所属区域(下拉选择) -->
|
||||
<view class="search-item">
|
||||
<text class="label">所属区域:</text>
|
||||
<uni-data-picker ref="picker" class="picker" placeholder="请选择所属区域" popup-title="请选择所属区域" :localdata="regions" v-model="formData.deptTags"
|
||||
@change="onchange" >
|
||||
</uni-data-picker>
|
||||
</view>
|
||||
|
||||
<!-- 开始时间 -->
|
||||
<view class="search-item" v-if="false">
|
||||
<text class="label">开始时间:</text>
|
||||
<uni-datetime-picker type="date" placeholder="请选择开始时间" v-model="formData.startTime" @maskClick="onStartTimeChange" />
|
||||
</view>
|
||||
|
||||
<!-- 结束时间 -->
|
||||
<view class="search-item" v-if="false">
|
||||
<text class="label">结束时间:</text>
|
||||
<uni-datetime-picker type="date" placeholder="请选择结束时间" v-model="formData.endTime" @maskClick="onEndTimeChange" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>帮扶记录列表</text>
|
||||
<view class="title-line" style="left: 70rpx;"></view>
|
||||
</view>
|
||||
<view class="title-total">
|
||||
共<text class="total-num">{{totalNum}}</text>条记录
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-box" v-if="dataList.length>0">
|
||||
<view class="con-box" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="form-title">
|
||||
<view class="form-name">
|
||||
{{item.name}}
|
||||
<AppLayout :title="title" :show-bg-image="false" >
|
||||
<view class="page-container" >
|
||||
<scroll-view :scroll-y="true" class="nearby-scroll" @scrolltolower="scrollBottom" lower-threshold="50">
|
||||
<view class="info-box">
|
||||
<view class="info-item info-line">
|
||||
<view class="">
|
||||
<uni-icons type="contact" color="#175CE9" size="34"></uni-icons>
|
||||
</view>
|
||||
<view class="form-type">
|
||||
{{getTaskTypeLabelByValue(item.task_type)}}
|
||||
<view class="info-label">
|
||||
帮扶任务总数
|
||||
</view>
|
||||
<view class="info-value">
|
||||
{{ stats.taskCount }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.phone">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/tele.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
联系电话:
|
||||
</view>
|
||||
<view class="info-item info-line">
|
||||
<view class="">
|
||||
<uni-icons type="info" color="#175CE9" size="34"></uni-icons>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.phone}}
|
||||
<view class="info-label">
|
||||
待分配任务
|
||||
</view>
|
||||
<view class="info-value">
|
||||
{{ stats.pendingCount }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.id_card">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/num.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
身份证号:
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="">
|
||||
<uni-icons type="checkbox" color="#175CE9" size="34"></uni-icons>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.id_card}}
|
||||
<view class="info-label">
|
||||
已分配任务
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.dept_name">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/base.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
所属区域:
|
||||
</view>
|
||||
<view class="info-value">
|
||||
{{ stats.allocatedCount }}
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.dept_name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.create_by_name">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/person.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
帮扶人员:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.create_by_name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.create_by_dept_name">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/help.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
帮扶单位:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.create_by_dept_name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.follow_date">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/date.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
帮扶日期:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.follow_date}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="item.next_contact_date">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/next.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
下次联系:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.next_contact_date}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-btns">
|
||||
<button class="mini-btn form-box-btn detail-btn" size="mini" v-if="false">详情</button>
|
||||
<button class="mini-btn form-box-btn follow-btn" size="mini" @click="goFollow(item)">跟进</button>
|
||||
<button class="mini-btn form-box-btn recommend-btn" size="mini" @click="goRecommend(item)">智能推荐</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-else pdTop="200"></empty>
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>筛选条件</text>
|
||||
<view class="title-line"></view>
|
||||
</view>
|
||||
<view class="title-right button-sp-area">
|
||||
<button class="mini-btn search-box-btn" type="primary" size="mini" @click="handleSearch">查询</button>
|
||||
<button class="mini-btn reset-box-btn" type="default" size="mini" @click="handleReset">重置</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-container">
|
||||
<!-- 人员姓名 -->
|
||||
<view class="search-item">
|
||||
<text class="label">任务名称:</text>
|
||||
<uni-easyinput v-model="formData.taskName" placeholder="请输入任务名称"></uni-easyinput>
|
||||
</view>
|
||||
<!-- 任务类型 -->
|
||||
<view class="search-item">
|
||||
<text class="label">任务类型:</text>
|
||||
<uni-data-select :key="1" v-model="formData.taskType" :localdata="taskTypeOptions" placeholder="请选择任务类型" @change="onTaskTypeChange"></uni-data-select>
|
||||
</view>
|
||||
<!-- 优先级 -->
|
||||
<view class="search-item">
|
||||
<text class="label">优先级:</text>
|
||||
<uni-data-select :key="2" v-model="formData.priority" :localdata="priorityOptions" placeholder="请选择优先级" @change="onPriorityChange"></uni-data-select>
|
||||
</view>
|
||||
<!-- 创建时间 -->
|
||||
<view class="search-item">
|
||||
<text class="label">创建时间:</text>
|
||||
<uni-datetime-picker v-model="filterTimeRange" type="datetimerange" rangeSeparator="至" @change="filterTimeRangeChange" />
|
||||
</view>
|
||||
<!-- 分配状态 -->
|
||||
<view class="search-item">
|
||||
<text class="label">分配状态:</text>
|
||||
<uni-data-select :key="3" v-model="formData.allocationStatus" :localdata="allocationStatusOptions" placeholder="请选择分配状态" @change="onAllocationStatusChange"></uni-data-select>
|
||||
</view>
|
||||
<!-- 执行区域 -->
|
||||
<view class="search-item" v-if="false">
|
||||
<text class="label">执行区域:</text>
|
||||
<uni-data-select :key="4" v-model="formData.executeDeptId" :localdata="executeDeptOptions" placeholder="请选择区域" @change="onExecuteDeptChange"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>帮扶任务列表</text>
|
||||
<view class="title-line" style="left: 70rpx;"></view>
|
||||
</view>
|
||||
<view class="title-total">
|
||||
共<text class="total-num">{{totalNum}}</text>条记录
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-box" v-if="dataList.length>0">
|
||||
<view class="con-box" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="form-title">
|
||||
<view class="form-name">
|
||||
{{item.taskName}}
|
||||
</view>
|
||||
<view class="form-type">
|
||||
优先级:{{item.priority}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/person.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
目标人数:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.taskAllocation.goalPersonCount}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/num.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
任务类型:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.taskType}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/date.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
分配状态:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.taskAllocation.allocationStatus}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/base.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
执行区域:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.taskAllocation.executeDeptName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/next.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
创建时间:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.createTime}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<view class="item-left">
|
||||
<image class="item-img" :src="baseUrl+'/dispatch/next.png'" mode=""></image>
|
||||
<view class="item-label">
|
||||
截止时间:
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
{{item.taskAllocation.deadline}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-btns">
|
||||
<button class="mini-btn form-box-btn detail-btn" size="mini" @click="goDetail(item)">详情</button>
|
||||
<button class="mini-btn form-box-btn follow-btn" size="mini" @click="goTarget(item)">目标人员</button>
|
||||
<button class="mini-btn form-box-btn recommend-btn" v-if="item.taskAllocation.allocationStatus == '待分配'" size="mini" @click="goRecommend(item)">分配</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-else pdTop="200"></empty>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, ref, reactive,onMounted } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { inject, ref, reactive } from 'vue';
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app';
|
||||
const { $api, navTo, navBack } = inject('globalFunction');
|
||||
import config from "@/config.js"
|
||||
|
||||
// state
|
||||
const title = ref('');
|
||||
const initialForm = {
|
||||
name: '',
|
||||
idCard: '',
|
||||
taskType: '',
|
||||
createByName: '',
|
||||
// helpArea: [],
|
||||
// startTime: '',
|
||||
// endTime: '',
|
||||
// deptId:'',
|
||||
deptTags:''
|
||||
}
|
||||
const formData = reactive({ ...initialForm });
|
||||
const taskTypeOptions=ref([])
|
||||
const dataList=ref([])
|
||||
const pageSize=ref(10)
|
||||
const pageNum=ref(1)
|
||||
const stats=ref({})
|
||||
const formData = reactive({
|
||||
taskName: '',
|
||||
taskType: '',
|
||||
priority: '',
|
||||
createTimeStart: null,
|
||||
createTimeEnd: null,
|
||||
allocationStatus: '',
|
||||
executeDeptId: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
})
|
||||
const taskName=ref('')
|
||||
const filterTimeRange=ref([])
|
||||
const totalNum=ref(0)
|
||||
const dataList=ref([])
|
||||
const taskTypeOptions=ref([])
|
||||
const priorityOptions=ref([])
|
||||
const allocationStatusOptions=ref([])
|
||||
const executeDeptOptions=ref([])
|
||||
const baseUrl = config.imgBaseUrl
|
||||
const getBackgroundStyle = (imageName) => ({
|
||||
backgroundImage: `url(${baseUrl}/dispatch/${imageName})`,
|
||||
@@ -199,51 +215,35 @@ const getBackgroundStyle = (imageName) => ({
|
||||
backgroundPosition: 'center', // 居中
|
||||
backgroundRepeat: 'no-repeat'
|
||||
});
|
||||
const trainVideoImgUrl=config.trainVideoImgUrl
|
||||
const picker = ref(null)
|
||||
|
||||
|
||||
// 所属区域选项(可根据实际替换为动态数据)
|
||||
const regions = ref([])
|
||||
|
||||
// 事件处理
|
||||
const onTaskTypeChange = (e) => {
|
||||
formData.taskType=e
|
||||
function listNotParam(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
let params={}
|
||||
$api.myRequest('/dispatch/dept/listNotParam',params,'get',9100,header).then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.deptId,
|
||||
text: item.deptName,
|
||||
ancestors:item.ancestors
|
||||
}
|
||||
executeDeptOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
const onStartTimeChange = (e) => {
|
||||
formData.startTime = e.detail.value
|
||||
function statisticTask(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
let params={}
|
||||
$api.myRequest('/dispatch/assist/task/allocation/statisticTask',params,'get',9100,header).then((resData) => {
|
||||
stats.value=resData.data
|
||||
});
|
||||
}
|
||||
|
||||
const onEndTimeChange = (e) => {
|
||||
formData.endTime = e.detail.value
|
||||
}
|
||||
|
||||
const handleSearch = () => {
|
||||
// 在这里调用接口进行搜索
|
||||
getDataList('refresh')
|
||||
}
|
||||
const handleReset = () =>{
|
||||
Object.assign(formData, initialForm);
|
||||
getDataList('refresh')
|
||||
}
|
||||
onMounted(async () => {
|
||||
// await loadLevelData('201');
|
||||
});
|
||||
onLoad(() => {
|
||||
// let token=uni.getStorageSync('fourLevelLinkage-token')
|
||||
// if(token){
|
||||
// $api.myRequest("/system/user/login/user/info", {}, "GET", 9100, {
|
||||
// Authorization: `Bearer ${uni.getStorageSync("fourLevelLinkage-token")}`
|
||||
// }).then(async (resData) => {
|
||||
|
||||
// await loadLevelData(resData.sysUser.dept.deptId);
|
||||
// getDictionary()
|
||||
// getDataList('refresh');
|
||||
// });
|
||||
// }else{
|
||||
// navTo('/packageB/login2');
|
||||
// }
|
||||
});
|
||||
function getDictionary(){
|
||||
$api.myRequest('/system/public/dict/data/type/assist_task_type').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
@@ -256,151 +256,163 @@ function getDictionary(){
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
function getTaskTypeLabelByValue(value) {
|
||||
if (!Array.isArray(taskTypeOptions.value)) {
|
||||
return ''
|
||||
}
|
||||
const item = taskTypeOptions.value.find(item => item.value === String(value))
|
||||
return item ? item.text : '暂无帮扶类型'
|
||||
}
|
||||
// 加载某一级的数据(parentId 为空表示根)
|
||||
async function loadLevelData(parentId,node) {
|
||||
let header = {
|
||||
'Authorization': uni.getStorageSync('fourLevelLinkage-token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
};
|
||||
let params = { parentId };
|
||||
|
||||
try {
|
||||
const resData = await $api.myRequest('/dispatch/dept/list', params, 'get', 9100, header);
|
||||
if(resData.data.length==0){
|
||||
picker.value.hide()
|
||||
return
|
||||
}
|
||||
const formatted = (resData.data || []).map(item => ({
|
||||
text: item.deptName,
|
||||
value: item.tags,
|
||||
deptId: item.deptId,
|
||||
children: []
|
||||
}));
|
||||
if(node){
|
||||
injectChildren(parentId, formatted);
|
||||
}else{
|
||||
regions.value=formatted
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("加载部门数据失败:", error);
|
||||
uni.showToast({ title: '加载失败', icon: 'none' });
|
||||
}
|
||||
}
|
||||
// 将子级数据注入到对应的父节点
|
||||
function injectChildren(parentValue, childrenData) {
|
||||
const findAndInject = (nodes) => {
|
||||
for (let node of nodes) {
|
||||
if (node.deptId === parentValue) {
|
||||
// 如果 children 已存在且非空,避免重复加载
|
||||
if (!node.children || node.children.length === 0) {
|
||||
node.children = childrenData;
|
||||
$api.myRequest('/system/public/dict/data/type/assist_task_priority').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.dictValue,
|
||||
text: item.dictLabel
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (node.children && node.children.length > 0) {
|
||||
if (findAndInject(node.children)) return true;
|
||||
}
|
||||
priorityOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
findAndInject(regions.value);
|
||||
// 强制更新
|
||||
}
|
||||
// 当用户选择时触发(注意:change 在每级选择后都会触发)
|
||||
function onchange(e) {
|
||||
const selectedValues = e.detail.value;
|
||||
// formData.deptId=selectedValues.map(item => item.value).join(',');
|
||||
if (selectedValues.length === 0) return;
|
||||
// 获取最后一级选中的 value
|
||||
const lastSelectedValue = selectedValues[selectedValues.length - 1];
|
||||
// 查找该节点是否有 children,如果没有则尝试加载
|
||||
const node = findNodeByValue(regions.value, lastSelectedValue);
|
||||
if (node && (!node.children || node.children.length === 0)) {
|
||||
// 检查接口是否还有下一级(可通过接口返回判断,或先尝试加载)
|
||||
// 这里我们直接尝试加载下一级
|
||||
loadLevelData(node.deptId , node);
|
||||
picker.value.show()
|
||||
}
|
||||
}
|
||||
// 工具函数:根据 value 查找节点
|
||||
function findNodeByValue(nodes, value) {
|
||||
for (let node of nodes) {
|
||||
if (node.value === value.value) {
|
||||
return node;
|
||||
});
|
||||
$api.myRequest('/system/public/dict/data/type/assist_task_allocation_status').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.dictValue,
|
||||
text: item.dictLabel
|
||||
}
|
||||
allocationStatusOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
if (node.children && node.children.length > 0) {
|
||||
const found = findNodeByValue(node.children, value);
|
||||
if (found) return found;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function getDeptOptions(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('fourLevelLinkage-token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
let params={
|
||||
parentId:''
|
||||
}
|
||||
$api.myRequest('/dispatch/dept/list', params,'get',9100,header).then((resData) => {
|
||||
});
|
||||
}
|
||||
function getDataList(type = 'add') {
|
||||
let maxPage=Math.ceil(totalNum.value/pageSize.value)
|
||||
let params=({...formData})
|
||||
function getabelByValue(value,arr) {
|
||||
if (!Array.isArray(arr.value)) {
|
||||
return ''
|
||||
}
|
||||
const item = arr.value.find(item => item.value === String(value))
|
||||
return item ? item.text : '暂无'
|
||||
}
|
||||
function onTaskTypeChange(e){
|
||||
formData.taskType=e
|
||||
}
|
||||
function onPriorityChange(e){
|
||||
formData.priority=e
|
||||
}
|
||||
function onAllocationStatusChange(e){
|
||||
formData.allocationStatus=e
|
||||
}
|
||||
function filterTimeRangeChange(e){
|
||||
formData.createTimeStart=e[0]
|
||||
formData.createTimeEnd=e[1]
|
||||
}
|
||||
function onExecuteDeptChange(e){
|
||||
formData.executeDeptId=e
|
||||
}
|
||||
function handleSearch(){
|
||||
dataList.value=[]
|
||||
getDataList()
|
||||
}
|
||||
function getDataList(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('fourLevelLinkage-token'),
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
if (type === 'refresh') {
|
||||
pageNum.value = 1;
|
||||
params.pageSize=pageSize.value
|
||||
params.pageNum=pageNum.value
|
||||
$api.myRequest('/dispatch/assist/records/pageRecords', params,'get',9100,header).then((resData) => {
|
||||
if(resData&&resData.code == 200){
|
||||
dataList.value=resData.rows
|
||||
totalNum.value=resData.total
|
||||
}
|
||||
});
|
||||
}
|
||||
if (type === 'add' && pageNum.value < maxPage) {
|
||||
pageNum.value += 1;
|
||||
params.pageSize=pageSize.value
|
||||
params.pageNum=pageNum.value
|
||||
$api.myRequest('/dispatch/assist/records/pageRecords', params,'get',9100,header).then((resData) => {
|
||||
dataList.value=dataList.value.concat(resData.rows)
|
||||
});
|
||||
$api.myRequest('/dispatch/assist/task/pageAllocateDeptTaskList',formData,'get',9100,header).then((resData) => {
|
||||
resData.rows.forEach(item=>{
|
||||
item.priority=getabelByValue(item.priority,priorityOptions)
|
||||
item.taskType=getabelByValue(item.taskType,taskTypeOptions)
|
||||
item.taskAllocation.allocationStatus=getabelByValue(item.taskAllocation.allocationStatus,allocationStatusOptions)
|
||||
})
|
||||
totalNum.value=resData.total
|
||||
dataList.value=dataList.value.concat(resData.rows)
|
||||
|
||||
});
|
||||
}
|
||||
const handleReset = () => {
|
||||
dataList.value=[]
|
||||
formData.taskName=''
|
||||
formData.taskType=''
|
||||
formData.priority=''
|
||||
formData.createTimeStart=null
|
||||
formData.createTimeEnd=null
|
||||
formData.allocationStatus=''
|
||||
formData.executeDeptId=''
|
||||
formData.pageNum=1
|
||||
formData.pageSize=10
|
||||
filterTimeRange.value=[]
|
||||
getDataList()
|
||||
}
|
||||
const creatTask = () => {
|
||||
navTo('/packageB/priority/taskCreated');
|
||||
}
|
||||
function goRecommend(item){
|
||||
navTo('/packageB/priority/allocate?item='+JSON.stringify(item)+'&url=taskIssue');
|
||||
}
|
||||
function goDetail(item){
|
||||
navTo('/packageB/priority/taskDetail?item='+JSON.stringify(item));
|
||||
}
|
||||
function goTarget(item){
|
||||
navTo('/packageB/priority/targetPersonnel?id='+item.taskAllocation.id+'&taskName='+item.taskName);
|
||||
}
|
||||
function scrollBottom(){
|
||||
if(formData.pageNum<totalNum.value/formData.pageSize){
|
||||
formData.pageNum++
|
||||
getDataList()
|
||||
}
|
||||
}
|
||||
function goFollow(item) {
|
||||
navTo(`/packageB/priority/helpFollow?task_id=${item.task_id}&person_id=${item.person_id}&&name=${item.name}&&taskType=${getTaskTypeLabelByValue(item.task_type)}`);
|
||||
}
|
||||
//智能推荐
|
||||
const goRecommend = (item) => {
|
||||
navTo('/packageB/priority/recommend');
|
||||
onShow(()=>{
|
||||
formData.pageNum=1
|
||||
dataList.value=[]
|
||||
getDataList()
|
||||
console.log("111")
|
||||
})
|
||||
onLoad((options) => {
|
||||
listNotParam()
|
||||
statisticTask()
|
||||
runAsyncTasks(options)
|
||||
});
|
||||
const runAsyncTasks = async (options) => {
|
||||
|
||||
await getDictionary()
|
||||
await getDataList()
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
||||
image
|
||||
height: 100%
|
||||
width: 100%
|
||||
|
||||
.page-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - var(--window-top)); /* 如果 AppLayout 有 header,需减去 */
|
||||
/* 或者简单用:height: 100vh; */
|
||||
}
|
||||
.nearby-scroll
|
||||
// 使用flex布局让scroll-view自适应高度,占据剩余空间
|
||||
flex: 1
|
||||
// overflow: hidden;
|
||||
.info-box
|
||||
margin: 30rpx 30rpx
|
||||
background: linear-gradient(0deg, #D9ECFF 0%, #F0F7FF 100%)
|
||||
border-radius: 20rpx
|
||||
padding: 40rpx 0
|
||||
display: flex
|
||||
align-items: center
|
||||
.info-line
|
||||
border-right: 2rpx solid #B7D6FF
|
||||
.info-item
|
||||
display: flex
|
||||
flex-direction: column
|
||||
align-items: center
|
||||
justify-content: center
|
||||
width: 50%
|
||||
.info-label
|
||||
font-size: 26rpx
|
||||
color: #6E7E9B
|
||||
margin-bottom: 20rpx
|
||||
.info-value
|
||||
font-weight: bold
|
||||
font-size: 28rpx
|
||||
color: #3D61AC
|
||||
.main-list
|
||||
background-color: #ffffff
|
||||
padding: 20rpx 30rpx 28rpx 30rpx
|
||||
padding: 20rpx 20rpx 28rpx 20rpx
|
||||
margin: 30rpx 30rpx
|
||||
box-shadow: 0px 3px 20px 0px rgba(0,105,234,0.1)
|
||||
border-radius: 12px
|
||||
@@ -417,19 +429,29 @@ image
|
||||
.title-line
|
||||
position: absolute
|
||||
bottom: -10rpx
|
||||
left: 36rpx
|
||||
left: 70rpx
|
||||
width: 70rpx
|
||||
height: 8rpx
|
||||
background: linear-gradient(90deg, #FFAD58 0%, #FF7A5B 100%)
|
||||
border-radius: 4rpx
|
||||
.search-box-btn
|
||||
border-radius: 32rpx !important
|
||||
background: #3088FF !important
|
||||
margin-right: 16rpx
|
||||
.reset-box-btn
|
||||
border-radius: 32rpx !important
|
||||
background: #02B44D
|
||||
color: #fff
|
||||
.title-total
|
||||
font-size: 24rpx
|
||||
color: #999999
|
||||
.total-num
|
||||
color: #3088FF
|
||||
margin-left: 4rpx
|
||||
margin-right: 4rpx
|
||||
font-weight: bold
|
||||
font-size: 26rpx
|
||||
|
||||
.list-box
|
||||
margin-top: 40rpx
|
||||
|
||||
:deep(.uni-forms-item__label)
|
||||
width: 194rpx !important
|
||||
font-size: 28rpx;
|
||||
color: #404040;
|
||||
|
||||
.search-container
|
||||
padding: 20rpx 0rpx 0rpx 0rpx
|
||||
.title-total
|
||||
@@ -457,8 +479,14 @@ image
|
||||
background: #FFFFFF
|
||||
flex: 1
|
||||
min-width: 0
|
||||
.list-box
|
||||
margin-top: 40rpx
|
||||
.search-box-btn
|
||||
border-radius: 32rpx !important
|
||||
background: #3088FF !important
|
||||
margin-right: 16rpx
|
||||
.reset-box-btn
|
||||
border-radius: 32rpx !important
|
||||
background: #02B44D
|
||||
color: #fff
|
||||
.con-box
|
||||
background: #fff
|
||||
padding: 20rpx
|
||||
|
||||
Reference in New Issue
Block a user