帮扶任务分配、帮扶任务下发

This commit is contained in:
2026-03-05 16:33:24 +08:00
parent 97d8c987d1
commit 6c10231636
10 changed files with 2315 additions and 774 deletions

View File

@@ -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>