帮扶任务分配
This commit is contained in:
@@ -1,42 +1,43 @@
|
||||
<template>
|
||||
<AppLayout :title="title" :show-bg-image="false" >
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')" v-if="showVue=='main'">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>帮扶任务分配</text>
|
||||
<view class="title-line"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-container">
|
||||
<uni-forms ref="formRef" v-model="formData" :rules="rules" validate-trigger="submit" >
|
||||
<uni-forms-item label="任务名称:" name="taskName" required >
|
||||
<uni-easyinput v-model="formData.taskName" placeholder="请输入任务名称"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="目标人员:" name="priority" required >
|
||||
<uni-data-select v-model="formData.priority" placeholder="请选择目标人员" :localdata="followWays" @change="onMethodChange"></uni-data-select>
|
||||
<uni-forms-item label="目标人员:" required >
|
||||
<button class="choice-btn" @click="choicePerson">从帮扶人员库选择目标人员</button>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="目标人数:" name="content" required>
|
||||
<uni-easyinput v-model="formData.taskAllocation.goalPersonCount" placeholder="请输入目标人数"></uni-easyinput>
|
||||
<uni-forms-item label="目标人数:" name="goalPersonCount" required>
|
||||
<uni-easyinput v-model="formData.goalPersonCount" disabled></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="执行区域:" name="executeDeptId" required >
|
||||
<uni-data-select v-model="formData.taskAllocation.executeDeptId" placeholder="请选择执行区域" :localdata="followWays" @change="onMethodChange"></uni-data-select>
|
||||
<uni-data-select v-model="formData.executeDeptId" placeholder="请选择执行区域" :localdata="executeDeptOptions" @change="executeDeptChange"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="分配说明:" name="allocationNote" required>
|
||||
<uni-easyinput type="textarea" v-model="formData.taskAllocation.allocationNote" placeholder="请输入分配说明"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="截止时间:" name="deadline" >
|
||||
<uni-datetime-picker class="picker-value" type="date" placeholder="请选择截止时间" v-model="formData.taskAllocation.deadline" @change="onDateChange" />
|
||||
<uni-forms-item label="截止时间:" name="deadline" required>
|
||||
<uni-datetime-picker class="picker-value" type="date" placeholder="请选择截止时间" v-model="formData.deadline" @change="onDateChange" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="分配说明:" name="allocationNote" >
|
||||
<uni-easyinput type="textarea" v-model="formData.allocationNote" placeholder="请输入分配说明"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
|
||||
<!-- 按钮组 -->
|
||||
<view class="button-group">
|
||||
<button class="btn submit-btn" @click="handleSubmit">确定</button>
|
||||
<button class="btn reset-btn" @click="handleReset">取消</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>
|
||||
|
||||
@@ -45,60 +46,55 @@ import { inject, ref, reactive } from 'vue';
|
||||
import { onLoad } 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([])
|
||||
const priorityOptions=ref([])
|
||||
const executeDeptOptions=ref([])
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
taskId: '',
|
||||
taskName: '',
|
||||
taskType: '',
|
||||
priority: '',
|
||||
taskAllocation: {
|
||||
goalPersonCount: null,
|
||||
executeDeptId: '',
|
||||
executeDeptName: '',
|
||||
executeDeptAncestors: '',
|
||||
allocationStatus: '1',
|
||||
allocationNote: '',
|
||||
deadline: null,
|
||||
goalPersonList: []
|
||||
}
|
||||
createBy: '',
|
||||
goalPersonCount: null,
|
||||
executeDeptId: '',
|
||||
executeDeptName: '',
|
||||
executeDeptAncestors: '',
|
||||
allocationStatus: '1',
|
||||
allocationNote: '',
|
||||
deadline: null,
|
||||
goalPersonList: [],
|
||||
allocationId:''
|
||||
})
|
||||
const personInfo=ref({
|
||||
goalPersonId:'',
|
||||
name:'',
|
||||
taskType:'',
|
||||
task_id:''
|
||||
})
|
||||
const followWays = ref([])
|
||||
const followList = ref([])
|
||||
const followListNum=ref(0)
|
||||
// 表单引用
|
||||
const formRef = ref(null)
|
||||
// 校验规则
|
||||
const rules = {
|
||||
followDate: {
|
||||
taskName: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请选择跟进日期'
|
||||
errorMessage: '请填写任务名称'
|
||||
}]
|
||||
},
|
||||
followWay: {
|
||||
goalPersonCount: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请选择跟进方式'
|
||||
errorMessage: '请选择目标人员'
|
||||
}]
|
||||
},
|
||||
content: {
|
||||
executeDeptId: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请填写跟进内容'
|
||||
errorMessage: '请选择执行区域'
|
||||
}]
|
||||
},
|
||||
result: {
|
||||
deadline:{
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请填写跟进结果'
|
||||
errorMessage: '请选择截止时间'
|
||||
}]
|
||||
}
|
||||
},
|
||||
}
|
||||
const baseUrl = config.imgBaseUrl
|
||||
const getBackgroundStyle = (imageName) => ({
|
||||
@@ -107,77 +103,84 @@ const getBackgroundStyle = (imageName) => ({
|
||||
backgroundPosition: 'center', // 居中
|
||||
backgroundRepeat: 'no-repeat'
|
||||
});
|
||||
|
||||
const onFollowDateChange = (e)=>{
|
||||
formData.followDate=e
|
||||
const showVue=ref('main')
|
||||
function choicePerson(){
|
||||
showVue.value='choice'
|
||||
}
|
||||
const onMethodChange = (e) => {
|
||||
formData.followWay=e
|
||||
}
|
||||
// 事件处理
|
||||
const onDateChange = ( e) => {
|
||||
formData.nextContactDate=e
|
||||
}
|
||||
function getFollowList(){
|
||||
function listNotParam(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('fourLevelLinkage-token'),
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
let params={
|
||||
personId:personInfo.value.person_id,
|
||||
taskId:personInfo.value.task_id
|
||||
}
|
||||
$api.myRequest('/dispatch/assist/records/getFollowList', params,'get',9100,header).then((resData) => {
|
||||
console.log("resData",resData)
|
||||
if(resData && resData.code == 200){
|
||||
if(resData.data && resData.data.length>0){
|
||||
followListNum.value=resData.data.length
|
||||
resData.data.forEach(item=>{
|
||||
const obj={
|
||||
title:item.followDate,
|
||||
desc:`跟进方式:${getFollowWaysLabelByValue(item.followWay)}\n跟进人:${item.createByName}\n跟进内容:${item.content}`
|
||||
}
|
||||
followList.value.push(obj)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getDictionary(){
|
||||
$api.myRequest('/system/public/dict/data/type/assist_follow_way').then((resData) => {
|
||||
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.dictValue,
|
||||
text: item.dictLabel
|
||||
value: item.deptId,
|
||||
text: item.deptName,
|
||||
ancestors:item.ancestors
|
||||
}
|
||||
followWays.value.push(obj)
|
||||
executeDeptOptions.value.push(obj)
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
function getFollowWaysLabelByValue(value) {
|
||||
if (!Array.isArray(followWays.value)) {
|
||||
// 事件处理
|
||||
function onDateChange(e){
|
||||
formData.deadline=e
|
||||
}
|
||||
function executeDeptChange(e){
|
||||
formData.executeDeptId=e
|
||||
formData.executeDeptName=getLabelByValue(e,executeDeptOptions.value)
|
||||
formData.executeDeptAncestors=getAncestorsByValue(e,executeDeptOptions.value)
|
||||
}
|
||||
function getLabelByValue(value,arr) {
|
||||
if (!Array.isArray(arr)) {
|
||||
return ''
|
||||
}
|
||||
const item = followWays.value.find(item => item.value === String(value))
|
||||
return item ? item.text : '暂无跟进方式'
|
||||
}
|
||||
|
||||
const item = arr.find(item => item.value === value)
|
||||
return item ? item.text : '暂无'
|
||||
}
|
||||
function getAncestorsByValue(value,arr){
|
||||
if (!Array.isArray(arr)) {
|
||||
return ''
|
||||
}
|
||||
|
||||
const item = arr.find(item => item.value === value)
|
||||
return item ? item.ancestors : ''
|
||||
}
|
||||
function normalizePersonData(dataList) {
|
||||
if (!Array.isArray(dataList)) return [];
|
||||
return dataList.map(obj => {
|
||||
const fullValue = obj;
|
||||
return {
|
||||
personId: String(fullValue) // 确保转为字符串,防止意外类型
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
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(() => {
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('fourLevelLinkage-token')
|
||||
'Authorization':uni.getStorageSync('Padmin-Token')
|
||||
}
|
||||
formData.goalPersonId=personInfo.value.goalPersonId
|
||||
$api.myRequest('/dispatch/assist/records/addRecords', formData,'post',9100,header).then((resData) => {
|
||||
console.log("resData",resData)
|
||||
$api.myRequest('/dispatch/assist/task/allocation/allocate', formData,'post',9100,header).then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
handleReset()
|
||||
handleCancel()
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
title: '分配成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
@@ -196,21 +199,40 @@ const handleSubmit = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const handleReset = () => {
|
||||
formData.followDate = '';
|
||||
formData.followWay = '';
|
||||
formData.content = '';
|
||||
formData.result = '';
|
||||
formData.nextPlan = '';
|
||||
formData.nextContactDate = '';
|
||||
const handleCancel = () => {
|
||||
formData.taskName=''
|
||||
formData.goalPersonCount=null
|
||||
formData.executeDeptId=''
|
||||
formData.executeDeptName=''
|
||||
formData.executeDeptAncestors=''
|
||||
formData.allocationStatus='1'
|
||||
formData.allocationNote=''
|
||||
formData.deadline=null
|
||||
formData.goalPersonList=[]
|
||||
navTo('/packageB/priority/taskAssignment');
|
||||
}
|
||||
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) => {
|
||||
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) => {
|
||||
// personInfo.value.person_id=options.person_id
|
||||
// personInfo.value.name=options.name
|
||||
// personInfo.value.taskType=options.taskType
|
||||
// personInfo.value.task_id=options.task_id
|
||||
// getDictionary()
|
||||
// getFollowList()
|
||||
listNotParam()
|
||||
getDetail(options.id)
|
||||
});
|
||||
|
||||
|
||||
@@ -220,33 +242,6 @@ onLoad((options) => {
|
||||
image
|
||||
height: 100%
|
||||
width: 100%
|
||||
.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-img
|
||||
width: 40rpx
|
||||
height: 40rpx
|
||||
margin-bottom: 20rpx
|
||||
.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 20rpx 28rpx 20rpx
|
||||
@@ -271,20 +266,6 @@ image
|
||||
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
|
||||
|
||||
.label
|
||||
width: 160rpx
|
||||
font-size: 28rpx
|
||||
color: #404040
|
||||
|
||||
.input,
|
||||
.picker
|
||||
@@ -292,10 +273,8 @@ image
|
||||
|
||||
.picker-value
|
||||
color: #666
|
||||
.list-box
|
||||
margin-top: 40rpx
|
||||
|
||||
.form-container
|
||||
|
||||
.form-container
|
||||
margin-top: 30rpx
|
||||
:deep(.uni-forms-item__label)
|
||||
width: 194rpx !important
|
||||
@@ -324,35 +303,15 @@ image
|
||||
background-color: #368BFF;
|
||||
color: white;
|
||||
}
|
||||
:deep(.uni-steps__column-circle )
|
||||
width: 24rpx !important
|
||||
height: 24rpx !important
|
||||
background: radial-gradient(circle,
|
||||
#00C0FA 0%,
|
||||
#015EEA 50%,
|
||||
#FFFFFF 51%,
|
||||
#FFFFFF 100%) !important
|
||||
border-radius: 50%
|
||||
border: 2rpx solid #015EEA
|
||||
:deep(.uni-steps__column-title)
|
||||
font-size: 28rpx !important
|
||||
color: #006CFF !important
|
||||
margin-bottom: 24rpx
|
||||
:deep(.uni-steps__column-desc)
|
||||
font-size: 28rpx
|
||||
color: #898989 !important
|
||||
line-height: 1.5
|
||||
:deep(.uni-steps__column-text )
|
||||
padding: 16rpx 0 !important
|
||||
border: none
|
||||
:deep(.uni-steps__column-line)
|
||||
background-color: #368BFF !important
|
||||
:deep(.uni-steps__column-line--before)
|
||||
background-color:rgba(0,0,0,0) !important
|
||||
:deep(.uni-date-x)
|
||||
background: rgba(0,0,0,0) !important
|
||||
:deep(.uni-stat-box)
|
||||
background: rgba(0,0,0,0) !important
|
||||
.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>
|
||||
|
||||
@@ -233,6 +233,7 @@ const handleCancel = () => {
|
||||
emit('update:showView', 'main')
|
||||
}
|
||||
function getDataList(){
|
||||
console.log("props.currentItem",props.currentItem)
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
|
||||
@@ -197,8 +197,16 @@ import { onLoad } from '@dcloudio/uni-app';
|
||||
const { $api, navTo, navBack } = inject('globalFunction');
|
||||
import config from "@/config.js"
|
||||
|
||||
const props = defineProps({
|
||||
allocationId:{
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
})
|
||||
const title = ref('');
|
||||
const formData = reactive({
|
||||
allocationId:'',
|
||||
name: '',
|
||||
idCard: '',
|
||||
tagId: '',
|
||||
@@ -219,7 +227,7 @@ const getBackgroundStyle = (imageName) => ({
|
||||
backgroundPosition: 'center', // 居中
|
||||
backgroundRepeat: 'no-repeat'
|
||||
});
|
||||
const emit = defineEmits(['update:showView'])
|
||||
const emit = defineEmits(['update:showVue'])
|
||||
function getDictionary(){
|
||||
$api.myRequest('/system/public/dict/data/type/person_database_status').then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
@@ -269,13 +277,18 @@ function getabelByValue(value,arr) {
|
||||
return item ? item.text : '暂无'
|
||||
}
|
||||
const handleCancel = () => {
|
||||
emit('update:showView', 'main')
|
||||
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=''
|
||||
@@ -286,11 +299,20 @@ function handleReset(){
|
||||
getDataList()
|
||||
}
|
||||
function getDataList(){
|
||||
let url=''
|
||||
if(props.allocationId){
|
||||
formData.allocationId=props.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('/dispatch/assist/person/database/pageList',formData,'get',9100,header).then((resData) => {
|
||||
$api.myRequest(url,formData,'get',9100,header).then((resData) => {
|
||||
resData.rows.forEach(item=>{
|
||||
item.tags=item.tagName.split(',')
|
||||
item.assistStatus=getabelByValue(item.assistStatus,personDatabaseStatusOptions)
|
||||
@@ -318,8 +340,8 @@ function selectItem(item) {
|
||||
}
|
||||
// 获取选中的数据
|
||||
function handlesubmit() {
|
||||
emit('update:showView', {
|
||||
showView: 'main',
|
||||
emit('update:showVue', {
|
||||
showVue: 'main',
|
||||
selectedPersonIds: selectedPersonIds.value
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<AppLayout :title="title" :show-bg-image="false" >
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')">
|
||||
<view class="main-list" :style="getBackgroundStyle('k.png')" v-if="showVue=='main'">
|
||||
<view class="list-top">
|
||||
<view class="list-title">
|
||||
<text>创建任务</text>
|
||||
@@ -19,16 +19,16 @@
|
||||
<uni-data-select v-model="formData.priority" placeholder="请选择优先级" :localdata="priorityOptions" @change="priorityChange"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="目标人员:" required >
|
||||
<button class="choice-btn">从帮扶人员库选择目标人员</button>
|
||||
<button class="choice-btn" @click="choicePerson">从帮扶人员库选择目标人员</button>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="目标人数:" name="goalPersonCount" required>
|
||||
<uni-easyinput v-model="formData.taskAllocation.goalPersonCount" ></uni-easyinput>
|
||||
<uni-forms-item label="目标人数:" name="taskAllocation.goalPersonCount" required>
|
||||
<uni-easyinput v-model="formData.taskAllocation.goalPersonCount" disabled></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="执行区域:" name="executeDeptId" required >
|
||||
<uni-forms-item label="执行区域:" name="taskAllocation.executeDeptId" required >
|
||||
<uni-data-select v-model="formData.taskAllocation.executeDeptId" placeholder="请选择执行区域" :localdata="executeDeptOptions" @change="executeDeptChange"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="截止时间:" name="deadline" required>
|
||||
<uni-datetime-picker class="picker-value" type="date" placeholder="请选择截止时间" v-model="formData.taskAllocation.deadline" @change="onDateChange" />
|
||||
<uni-forms-item label="截止时间:" name="taskAllocation.deadline" required>
|
||||
<uni-datetime-picker class="picker-value" type="date" placeholder="请选择截止时间" v-model="formData.taskAllocation.deadline" @change="onDateChange" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="分配说明:" name="allocationNote" >
|
||||
<uni-easyinput type="textarea" v-model="formData.taskAllocation.allocationNote" placeholder="请输入分配说明"></uni-easyinput>
|
||||
@@ -41,6 +41,9 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
<target-personel-choice @update:show-vue="handleShowVueChange"></target-personel-choice>
|
||||
</view>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
@@ -49,6 +52,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 targetPersonelChoice from './targetPersonnelChoice.vue'
|
||||
|
||||
const props = defineProps({
|
||||
taskTypeOptions: {
|
||||
@@ -105,19 +109,19 @@ const rules = {
|
||||
errorMessage: '请选择优先级'
|
||||
}]
|
||||
},
|
||||
goalPersonCount: {
|
||||
'taskAllocation.goalPersonCount': {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请选择目标人员'
|
||||
}]
|
||||
},
|
||||
executeDeptId: {
|
||||
'taskAllocation.executeDeptId': {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请选择执行区域'
|
||||
}]
|
||||
},
|
||||
deadline:{
|
||||
'taskAllocation.deadline':{
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请选择截止时间'
|
||||
@@ -131,25 +135,71 @@ const getBackgroundStyle = (imageName) => ({
|
||||
backgroundPosition: 'center', // 居中
|
||||
backgroundRepeat: 'no-repeat'
|
||||
});
|
||||
const showVue=ref('main')
|
||||
const emit = defineEmits(['update:showView'])
|
||||
|
||||
function choicePerson(){
|
||||
showVue.value='choice'
|
||||
}
|
||||
// 事件处理
|
||||
function onDateChange(){}
|
||||
function taskTypeChange(){}
|
||||
function priorityChange(){}
|
||||
function executeDeptChange(){}
|
||||
function onDateChange(e){
|
||||
formData.taskAllocation.deadline=e
|
||||
}
|
||||
function taskTypeChange(e){
|
||||
formData.taskType=e
|
||||
}
|
||||
function priorityChange(e){
|
||||
formData.priority=e
|
||||
}
|
||||
function executeDeptChange(e){
|
||||
formData.taskAllocation.executeDeptId=e
|
||||
formData.taskAllocation.executeDeptName=getLabelByValue(e,props.executeDeptOptions)
|
||||
formData.taskAllocation.executeDeptAncestors=getAncestorsByValue(e,props.executeDeptOptions)
|
||||
}
|
||||
function getLabelByValue(value,arr) {
|
||||
if (!Array.isArray(arr)) {
|
||||
return ''
|
||||
}
|
||||
|
||||
const item = arr.find(item => item.value === value)
|
||||
return item ? item.text : '暂无'
|
||||
}
|
||||
function getAncestorsByValue(value,arr){
|
||||
if (!Array.isArray(arr)) {
|
||||
return ''
|
||||
}
|
||||
|
||||
const item = arr.find(item => item.value === value)
|
||||
return item ? item.ancestors : ''
|
||||
}
|
||||
function normalizePersonData(dataList) {
|
||||
if (!Array.isArray(dataList)) return [];
|
||||
return dataList.map(obj => {
|
||||
const fullValue = obj;
|
||||
return {
|
||||
personId: String(fullValue) // 确保转为字符串,防止意外类型
|
||||
};
|
||||
});
|
||||
}
|
||||
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(() => {
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('fourLevelLinkage-token')
|
||||
'Authorization':uni.getStorageSync('Padmin-Token')
|
||||
}
|
||||
$api.myRequest('/dispatch/assist/records/addRecords', formData,'post',9100,header).then((resData) => {
|
||||
console.log("resData",resData)
|
||||
$api.myRequest('/dispatch/assist/task/add', formData,'post',9100,header).then((resData) => {
|
||||
if(resData && resData.code == 200){
|
||||
handleReset()
|
||||
handleCancel()
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
title: '创建成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
<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" size="mini" @click="goRecommend(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>
|
||||
@@ -184,9 +184,9 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="" v-else-if="showView=='add'" >
|
||||
<!-- <view class="" v-else-if="showView=='add'" >
|
||||
<task-created :taskTypeOptions="taskTypeOptions" :priorityOptions="priorityOptions" :executeDeptOptions="executeDeptOptions" @update:show-view="handleShowViewChange"></task-created>
|
||||
</view>
|
||||
</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>
|
||||
@@ -201,7 +201,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 taskCreated from './components/taskCreated.vue';
|
||||
import taskDetail from './components/taskDetail.vue';
|
||||
import targetPersonnel from './components/targetPersonnel.vue';
|
||||
|
||||
@@ -246,7 +246,8 @@ function listNotParam(){
|
||||
resData.data.forEach(item=>{
|
||||
const obj = {
|
||||
value: item.deptId,
|
||||
text: item.deptName
|
||||
text: item.deptName,
|
||||
ancestors:item.ancestors
|
||||
}
|
||||
executeDeptOptions.value.push(obj)
|
||||
})
|
||||
@@ -357,13 +358,14 @@ const handleReset = () => {
|
||||
}
|
||||
function handleShowViewChange(newValue) {
|
||||
showView.value = newValue
|
||||
dataList.value=[]
|
||||
getDataList()
|
||||
}
|
||||
const creatTask = () => {
|
||||
showView.value='add'
|
||||
// navTo('/packageB/priority/taskCreated');
|
||||
navTo('/packageB/priority/taskCreated');
|
||||
}
|
||||
const goRecommend = () =>{
|
||||
navTo('/packageB/priority/allocate');
|
||||
function goRecommend(item){
|
||||
navTo('/packageB/priority/allocate?id='+item.id);
|
||||
}
|
||||
function goDetail(item){
|
||||
currentItem.value=item.id
|
||||
|
||||
@@ -445,6 +445,12 @@
|
||||
"navigationBarTitleText": "帮扶任务分配"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "priority/taskCreated",
|
||||
"style": {
|
||||
"navigationBarTitleText": "创建任务"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "priority/taskIssue",
|
||||
"style": {
|
||||
|
||||
Reference in New Issue
Block a user