更新任务分配

szh-new
sunzehua 4 months ago
parent 18eae2dabd
commit 6eded6d7f9

@ -785,3 +785,10 @@ export function GetCompareResult(parameter) {
method: 'get',
})
}
export function GetContainsCarrierList() {
return request<DataResult>({
url: '/taskApi/TaskAllocation/GetContainsCarrierList',
method: 'get',
})
}

@ -306,6 +306,7 @@ function getInfo(type) {
GetInfoByTaskId(ApiData).then(res => {
if (res.data.succ) {
form.value = res.data.ext
console.log(form.value)
} else {
createMessage.error(res.data.msg)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@ -3,48 +3,31 @@
<div class="main">
<div class="main-content">
<a-row style="padding: 15px;" :gutter="16">
<a-col :span="pdfUrl ? 11 : 24">
<taskData :pdfUrl="pdfUrl" ref="taskDataRef" title='Booking Confirmation'></taskData>
</a-col>
<a-col :span="13" v-show="pdfUrl">
<pdf v-show="pdfUrl" @handleSuccess="handleSuccess" style="margin-bottom: 20px;" :id="taskPKId"
ref="pdfData"></pdf>
</a-col>
</a-row>
<a-col :span="pdfUrl ? 11 : 24">
<taskData :pdfUrl="pdfUrl" ref="taskDataRef" title='Booking Confirmation'></taskData>
</a-col>
<a-col :span="13" v-show="pdfUrl">
<pdf v-show="pdfUrl" @handleSuccess="handleSuccess" style="margin-bottom: 20px;" :id="taskPKId"
ref="pdfData"></pdf>
</a-col>
</a-row>
</div>
<taskButton :buttonList="['取消', '完成', '转移', '生成', '邮件']" @loadingStart="loadingStart"
@loadingStop="loadingStop" :id="taskPKId" ref="taskButtonRef">
</taskButton>
</div> <a-row style="padding: 15px;" :gutter="16">
<a-col :span="pdfUrl ? 11 : 24">
<taskData ref="taskDataRef" title='Booking Cancellation' ></taskData>
</a-col>
<a-col :span="13" v-show="pdfUrl">
<pdf v-show="pdfUrl" @handleSuccess="handleSuccess" style="margin-bottom: 20px;" :id="taskPKId" ref="pdfData"></pdf>
<a-row style="margin-top: 20px;" type="flex" justify="end" :gutter="16">
<taskButton :buttonList="['取消', '完成', '转移', '生成', '邮件']" @loadingStart="loadingStart" @loadingStop="loadingStop" :id="taskPKId" ref="taskButtonRef">
</taskButton>
</a-row>
</a-col>
<a-col :span="24" v-show="!pdfUrl">
<a-row style="margin-top: 20px;" type="flex" justify="end" :gutter="16">
<taskButton :buttonList="['取消', '完成', '转移', '生成', '邮件']" @loadingStart="loadingStart" @loadingStop="loadingStop" :id="taskPKId" ref="taskButtonRef">
</taskButton>
</a-row>
</a-col>
</a-row>
</div>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import { useRouter,useRoute } from 'vue-router'
import { useRouter, useRoute } from 'vue-router'
import pdf from '../components/pdf.vue'
import taskData from '../components/taskData.vue'
import { useMessage } from '../../../hooks/web/useMessage'
const { createMessage } = useMessage()
import taskButton from '../components/taskButton.vue'
import { GetInfoByTaskId,DownloadFileByBC } from '../api'
import { GetInfoByTaskId, DownloadFileByBC } from '../api'
const route = useRoute()
const router = useRouter();
@ -63,10 +46,10 @@ onMounted(() => {
pdfData.value.init()
})
function loadingStart(){
function loadingStart() {
spinning.value = true
}
function loadingStop(){
function loadingStop() {
spinning.value = false
}

@ -1,81 +1,127 @@
<template>
<div class="main">
<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
<div class="title">
<div> 船公司</div>
<a-select size="small" v-model:value="carrierId" style="width: 180px;margin-right: 20px">
<a-select-option v-for="item in carrierList" :key="item.carrierId" :value="item.carrierId">{{
item.carrier
}}</a-select-option>
</a-select>
<a-button @click="searchInfo"></a-button>
<a-button size="small" type="primary" @click="searchInfo"></a-button>
</div>
<a-spin :spinning="loading">
<div class="list">
<div title="操作" class="card">
<div class="left">
<div class="card-title"> 操作<i @click="handleEdit('Operator')"
class="icon-piliangbianji iconfont"></i>
</div>
<div class="taskTypeList">
<div class="taskType" v-for="(item, index) in roleTaskData.operatorTaskTypeList"
:key="index">{{
item.taskTypeName }}
</div>
</div>
<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>
<div class="right">
<img src="../img/操作.png" alt="">
</div>
</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 title="单证" class="card">
<div class="left">
<div class="card-title"> 单证<i @click="handleEdit('VouchingClerk')"
class="icon-piliangbianji iconfont"></i>
</div>
<div class="taskTypeList">
<div class="taskType" v-for="(item, index) in roleTaskData.vouchingClerkTaskTypeList"
:key="index">
{{
item.taskTypeName }}
</div>
</div>
</div>
<div class="right">
<img src="../img/单证.png" alt="">
</div>
</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 title="销售" class="card">
<div class="left">
<div class="card-title"> 销售<i @click="handleEdit('Sale')"
class="icon-piliangbianji iconfont"></i>
</div>
<div class="taskTypeList">
<div class="taskType" v-for="(item, index) in roleTaskData.saleTaskTypeList" :key="index">{{
item.taskTypeName }}
</div>
</div>
</div>
<div class="right">
<img src="../img/销售.png" alt="">
</div>
</div>
</a-card>
<a-card title="报关员" class="card">
<template #extra> <i @click="handleEdit('Custom')" class="icon-bianji1 iconfont"></i> </template>
<!-- <div title="报关员" class="card">
<div class="card-title"> <i @click="handleEdit('Custom')" class="icon-piliangbianji iconfont"></i> </div>
<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>
<div title="财务" class="card">
<div class="card-title"> <i @click="handleEdit('FinancialStaff')" class="icon-piliangbianji iconfont"></i> </div>
<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> -->
<div title="客服" class="card">
<div class="left">
<div class="card-title"> 客服<i @click="handleEdit('CustomerService')"
class="icon-piliangbianji iconfont"></i>
</div>
<div class="taskTypeList">
<div class="taskType" v-for="(item, index) in roleTaskData.customerServiceTaskTypeList"
:key="index">{{
item.taskTypeName }}
</div>
</div>
</div>
<div class="right">
<img src="../img/客服.png" alt="">
</div>
</div>
</a-card>
<a-card title="司机" class="card">
<template #extra> <i @click="handleEdit('Driver')" class="icon-bianji1 iconfont"></i> </template>
<!-- <div title="司机" class="card">
<div class="card-title"> <i @click="handleEdit('Driver')" class="icon-piliangbianji iconfont"></i> </div>
<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>
<div title="派车调度人员" class="card">
<div class="card-title"> <i @click="handleEdit('Dispatcher')" class="icon-piliangbianji iconfont"></i> </div>
<div class="taskType" v-for="(item, index) in roleTaskData.dispatcherTaskTypeList" :key="index">{{
item.taskTypeName }}
</div>
</a-card>
</div>
</div> -->
</div>
</a-spin>
<a-modal @cancel="open = false" :visible="open" title="分配任务" @ok="handleSave">
<a-modal width="800px" @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">{{
<a-select @change="handleChangeCarrier" v-model:value="carrierIdAll" style="width: 180px">
<a-select-option v-for="item in carrierListAll" :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 mode="multiple" v-model:value="taskTypeCode" style="width: 500px">
<a-select-option v-for="item in taskType" :key="item.code" :value="item.code">{{
item.name
}}</a-select-option>
@ -93,16 +139,45 @@ import pdf from '../components/pdf.vue'
import taskData from '../components/taskData.vue'
import taskButton from '../components/taskButton.vue'
import { GetCarrierlist } from '/@/views/operation/seaexport/api/BookingLedger'
import { GetTaskPlatEnumDict, TaskAllocationSave, TaskAllocationGetList } from '../api'
import { GetTaskPlatEnumDict, TaskAllocationSave, TaskAllocationGetList, GetContainsCarrierList } from '../api'
import { useMessage } from '../../../hooks/web/useMessage'
const { createMessage } = useMessage()
const open = ref(false)
const carrierIdAll = ref('')
const roleType = ref('')
const taskSaveLoad = ref(false)
const loading = ref(false)
function handleEdit(type) {
open.value = true
roleType.value = type
taskTypeCode.value = []
if (type == 'Sale') {
const arr = [] as any
roleTaskData.value.saleTaskTypeList.forEach(item => {
arr.push(item.taskTypeCode)
})
taskTypeCode.value = arr
}
if (type == 'CustomerService') {
const arr = [] as any
roleTaskData.value.customerServiceTaskTypeList.forEach(item => {
arr.push(item.taskTypeCode)
})
taskTypeCode.value = arr
}
if (type == 'VouchingClerk') {
const arr = [] as any
roleTaskData.value.vouchingClerkTaskTypeList.forEach(item => {
arr.push(item.taskTypeCode)
})
taskTypeCode.value = arr
}
if (type == 'Operator') {
const arr = [] as any
roleTaskData.value.operatorTaskTypeList.forEach(item => {
arr.push(item.taskTypeCode)
})
taskTypeCode.value = arr
}
}
const roleTaskData = ref({
vouchingClerkTaskTypeList: [],
@ -113,18 +188,15 @@ const roleTaskData = ref({
dispatcherTaskTypeList: [],
customerServiceTaskTypeList: [],
customTaskTypeList: []
})
}) as any
function handleSave() {
if (!carrierId.value) {
createMessage.warning('请选择船公司')
}
const data = {
carrierId: carrierId.value,
carrierId: carrierIdAll.value,
allocationTargetCode: roleType.value,
taskTypeList: []
} as any
carrierList.value.forEach(item => {
if (item.id === carrierId.value) {
carrierListAll.value.forEach(item => {
if (item.id === carrierIdAll.value) {
data.carrier = item.shortName
data.carrierCode = item.codeName
}
@ -142,6 +214,7 @@ function handleSave() {
})
data.taskTypeList = arr
taskSaveLoad.value = true
loading.value = true
TaskAllocationSave(data).then(res => {
if (res.succeeded) {
createMessage.success(res.message)
@ -150,16 +223,34 @@ function handleSave() {
}
taskSaveLoad.value = false
open.value = false
searchInfo()
GetContainsCarrierList().then((res) => {
carrierList.value = res.data
carrierList.value.unshift({
carrier: '默认',
carrierCode: '',
carrierId: ''
})
carrierId.value = carrierIdAll.value
searchInfo()
})
})
}
const carrierId = ref('')
const taskTypeCode = ref([])
const taskType = ref([]) as any
const carrierList = ref([]) as any
const carrierListAll = ref([]) as any
onMounted(() => {
GetCarrierlist().then((res) => {
loading.value = true
GetContainsCarrierList().then((res) => {
carrierList.value = res.data
carrierList.value.unshift({
carrier: '默认',
carrierCode: '',
carrierId: ''
})
carrierId.value = ''
searchInfo()
})
GetTaskPlatEnumDict().then(res => {
res.data.forEach(item => {
@ -168,36 +259,92 @@ onMounted(() => {
}
})
})
GetCarrierlist().then((res) => {
carrierListAll.value = res.data
carrierListAll.value.unshift({
shortName: '默认',
code: '',
id: ''
})
})
})
function handleChangeCarrier() {
taskTypeCode.value = []
}
function searchInfo() {
loading.value = true
TaskAllocationGetList({ carrierId: carrierId.value }).then(res => {
if (res.succeeded) {
roleTaskData.value = res.data
} else {
createMessage.error(res.message)
}
loading.value = false
})
}
</script>
<style lang="less" scoped>
.main {
padding: 20px;
// padding: 20px;
.title {
background: rgba(245, 249, 252, 1);
padding: 15px 25px;
div {
font-size: 12px;
font-weight: 700;
}
}
.iconfont {
cursor: pointer;
color: rgba(22, 119, 255, 1);
margin-left: 20px;
}
.card {
border-radius: 2px;
background: rgba(245, 249, 252, 1);
padding: 8px 10px 8px 20px;
display: flex;
align-items: flex-start;
width: 32%;
flex-shrink: 0;
min-height: 150px;
justify-content: space-between;
.card-title {
font-weight: 700;
font-size: 12px;
margin-bottom: 10px
}
}
.taskType {
margin-bottom: 5px
margin-bottom: 5px;
color: rgba(122, 135, 152, 1);
margin-right: 8px;
}
.taskTypeList {
display: flex;
flex-wrap: wrap;
}
.list{
.right {
width: 100px;
flex-shrink: 0;
}
.list {
display: flex;
flex-wrap: wrap;
.card{
width: 300px;
margin-top: 20px;
padding: 0 20px;
.card {
margin-right: 20px;
margin-bottom: 20px;
}

Loading…
Cancel
Save