lijingjia 4 months ago
commit 3258ce6520

@ -761,3 +761,19 @@ export function GetTaskPlatEnumDict() {
method: 'post',
})
}
export function TaskAllocationSave(parameter) {
return request<DataResult>({
url: '/taskApi/TaskAllocation/Save',
data:parameter,
method: 'post',
})
}
export function TaskAllocationGetList(parameter) {
return request<DataResult>({
url: '/taskApi/TaskAllocation/GetList',
params:parameter,
method: 'get',
})
}

@ -372,6 +372,12 @@ function refshTotalStat() {
levelTop.value = res.data.levelTop
levelNextAll.value = res.data.levelNext
levelTreeAll.value = res.data.levelTree
levelTree.value = selectTreeLevel(levelTreeAll.value, activeNextKey.value, activeTopKey.value)
levelTree.value.map((item, index) => {
if(item.key === taskType.value){
item.active = true
}
})
reload()
})
.catch(err => {

@ -1,32 +1,183 @@
<template>
<div class="main">
<a-card title="操作" style="width: 300px">
<template #extra> <i @click="handleEdit('Operator')" class="icon-bianji1 iconfont"></i> </template>
<p>card content</p>
<p>card content</p>
<p>card content</p>
</a-card>
<div style="margin-bottom: 20px;">
船公司:
<a-select v-model:value="carrierId" style="width: 180px;margin-left: 20px;">
<a-select-option v-for="item in carrierList" :key="item.id" :value="item.id">{{
item.shortName
}}</a-select-option>
</a-select>
<a-button @click="searchInfo"></a-button>
</div>
<a-modal v-model:open="open" title="分配任务" @ok="handleSave">
<div class="list" >
<a-card title="操作" class="card" >
<template #extra> <i @click="handleEdit('Operator')" class="icon-bianji1 iconfont"></i> </template>
<div class="taskType" v-for="(item, index) in roleTaskData.operatorTaskTypeList" :key="index">{{
item.taskTypeName }}
</div>
</a-card>
<a-card title="单证" class="card">
<template #extra> <i @click="handleEdit('VouchingClerk')" class="icon-bianji1 iconfont"></i> </template>
<div class="taskType" v-for="(item, index) in roleTaskData.vouchingClerkTaskTypeList" :key="index">{{
item.taskTypeName }}
</div>
</a-card>
<a-card title="销售" class="card">
<template #extra> <i @click="handleEdit('Sale')" class="icon-bianji1 iconfont"></i> </template>
<div class="taskType" v-for="(item, index) in roleTaskData.saleTaskTypeList" :key="index">{{
item.taskTypeName }}
</div>
</a-card>
<a-card title="报关员" class="card">
<template #extra> <i @click="handleEdit('Custom')" class="icon-bianji1 iconfont"></i> </template>
<div class="taskType" v-for="(item, index) in roleTaskData.customTaskTypeList" :key="index">{{
item.taskTypeName }}
</div>
</a-card>
<a-card title="财务" class="card">
<template #extra> <i @click="handleEdit('FinancialStaff')" class="icon-bianji1 iconfont"></i> </template>
<div class="taskType" v-for="(item, index) in roleTaskData.financialStaffTaskTypeList" :key="index">{{
item.taskTypeName }}
</div>
</a-card>
<a-card title="客服" class="card">
<template #extra> <i @click="handleEdit('CustomerService')" class="icon-bianji1 iconfont"></i> </template>
<div class="taskType" v-for="(item, index) in roleTaskData.customerServiceTaskTypeList" :key="index">{{
item.taskTypeName }}
</div>
</a-card>
<a-card title="司机" class="card">
<template #extra> <i @click="handleEdit('Driver')" class="icon-bianji1 iconfont"></i> </template>
<div class="taskType" v-for="(item, index) in roleTaskData.driverTaskTypeList" :key="index">{{
item.taskTypeName }}
</div>
</a-card>
<a-card title="派车调度人员" class="card">
<template #extra> <i @click="handleEdit('Dispatcher')" class="icon-bianji1 iconfont"></i> </template>
<div class="taskType" v-for="(item, index) in roleTaskData.dispatcherTaskTypeList" :key="index">{{
item.taskTypeName }}
</div>
</a-card>
</div>
<a-modal @cancel="open = false" :visible="open" title="分配任务" @ok="handleSave">
<a-spin :spinning="taskSaveLoad">
<div style="display: flex;margin: 20px 0px;">
<div style="margin-right: 20px;">
<div>船公司</div>
<a-select v-model:value="carrierId" style="width: 180px">
<a-select-option v-for="item in carrierList" :key="item.id" :value="item.id">{{
item.shortName
}}</a-select-option>
</a-select>
</div>
<div>
<div>任务类型</div>
<a-select mode="multiple" v-model:value="taskTypeCode" style="width: 180px">
<a-select-option v-for="item in taskType" :key="item.code" :value="item.code">{{
item.name
}}</a-select-option>
</a-select>
</div>
</div>
</a-spin>
</a-modal>
</div>
</template>
<script lang="ts" setup>
<script lang="ts" setup name="任务分配">
import { ref, onMounted } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import pdf from '../components/pdf.vue'
import taskData from '../components/taskData.vue'
import taskButton from '../components/taskButton.vue'
import { GetInfoByTaskId, DownloadFileByBC } from '../api'
import { GetCarrierlist } from '/@/views/operation/seaexport/api/BookingLedger'
import { GetTaskPlatEnumDict, TaskAllocationSave, TaskAllocationGetList } from '../api'
import { useMessage } from '../../../hooks/web/useMessage'
const { createMessage } = useMessage()
const open = ref(false)
const roleType = ref('')
const taskSaveLoad = ref(false)
function handleEdit(type) {
open.value = true
roleType.value = type
taskTypeCode.value = []
}
const roleTaskData = ref({
vouchingClerkTaskTypeList: [],
saleTaskTypeList: [],
operatorTaskTypeList: [],
financialStaffTaskTypeList: [],
driverTaskTypeList: [],
dispatcherTaskTypeList: [],
customerServiceTaskTypeList: [],
customTaskTypeList: []
})
function handleSave() {
if (!carrierId.value) {
createMessage.warning('请选择船公司')
}
const data = {
carrierId: carrierId.value,
allocationTargetCode: roleType.value,
taskTypeList: []
} as any
carrierList.value.forEach(item => {
if (item.id === carrierId.value) {
data.carrier = item.shortName
data.carrierCode = item.codeName
}
})
const arr = [] as any
taskType.value.forEach(item => {
taskTypeCode.value.forEach(ite => {
if (item.code === ite) {
arr.push({
taskTypeCode: item.code,
taskTypeName: item.name
})
}
})
})
data.taskTypeList = arr
taskSaveLoad.value = true
TaskAllocationSave(data).then(res => {
if (res.succeeded) {
createMessage.success(res.message)
} else {
createMessage.error(res.message)
}
taskSaveLoad.value = false
open.value = false
searchInfo()
})
}
function handleSave(){
const carrierId = ref('')
const taskTypeCode = ref([])
const taskType = ref([]) as any
const carrierList = ref([]) as any
onMounted(() => {
GetCarrierlist().then((res) => {
carrierList.value = res.data
})
GetTaskPlatEnumDict().then(res => {
res.data.forEach(item => {
if (item.type === 'TASK_TYPE') {
taskType.value = item.data
}
})
})
})
function searchInfo() {
TaskAllocationGetList({ carrierId: carrierId.value }).then(res => {
if (res.succeeded) {
roleTaskData.value = res.data
} else {
createMessage.error(res.message)
}
})
}
</script>
@ -38,5 +189,18 @@ function handleSave(){
cursor: pointer;
color: rgba(22, 119, 255, 1);
}
.taskType {
margin-bottom: 5px
}
.list{
display: flex;
flex-wrap: wrap;
.card{
width: 300px;
margin-right: 20px;
margin-bottom: 20px;
}
}
}
</style>
Loading…
Cancel
Save