refactor(task-management): 重构工单管理功能

- 更新了工作台页面的工单列表和详情展示
- 重构了工单关闭和删除的逻辑
-优化了工单详情弹窗的展示内容
- 调整了 API 接口的参数传递方式
This commit is contained in:
dj
2024-11-23 12:19:04 +08:00
parent 2856ce09dd
commit 226ff55ddf
8 changed files with 127 additions and 118 deletions

2
auto-imports.d.ts vendored
View File

@@ -5,6 +5,8 @@
export {} export {}
declare global { declare global {
const EffectScope: typeof import('vue')['EffectScope'] const EffectScope: typeof import('vue')['EffectScope']
const ElMessage: typeof import('element-plus/es')['ElMessage']
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
const computed: typeof import('vue')['computed'] const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp'] const createApp: typeof import('vue')['createApp']
const customRef: typeof import('vue')['customRef'] const customRef: typeof import('vue')['customRef']

33
components.d.ts vendored
View File

@@ -11,56 +11,41 @@ declare module '@vue/runtime-core' {
export interface GlobalComponents { export interface GlobalComponents {
ElAside: typeof import('element-plus/es')['ElAside'] ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup'] ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol'] ElCol: typeof import('element-plus/es')['ElCol']
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElContainer: typeof import('element-plus/es')['ElContainer'] ElContainer: typeof import('element-plus/es')['ElContainer']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog'] ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider'] ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm'] ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon'] ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput'] ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElMain: typeof import('element-plus/es')['ElMain'] ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption'] ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination'] ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElPopover: typeof import('element-plus/es')['ElPopover'] ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRate: typeof import('element-plus/es')['ElRate']
ElRow: typeof import('element-plus/es')['ElRow'] ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect'] ElSelect: typeof import('element-plus/es')['ElSelect']
ElStep: typeof import('element-plus/es')['ElStep'] ElSpace: typeof import('element-plus/es')['ElSpace']
ElSteps: typeof import('element-plus/es')['ElSteps']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable'] ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTag: typeof import('element-plus/es')['ElTag'] ElTag: typeof import('element-plus/es')['ElTag']
ElText: typeof import('element-plus/es')['ElText'] ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload']
FvCheckbox: typeof import('./src/fvcomponents/fvCheckbox/index.vue')['default'] FvCheckbox: typeof import('./src/fvcomponents/fvCheckbox/index.vue')['default']
FvForm: typeof import('./src/fvcomponents/fvForm/index.vue')['default'] FvForm: typeof import('./src/fvcomponents/fvForm/index.vue')['default']
FvFormDialog: typeof import('./src/fvcomponents/fvFormDialog/index.vue')['default']
FvPagination: typeof import('./src/fvcomponents/fvPagination/index.vue')['default'] FvPagination: typeof import('./src/fvcomponents/fvPagination/index.vue')['default']
FvRadio: typeof import('./src/fvcomponents/fvRadio/index.vue')['default'] FvRadio: typeof import('./src/fvcomponents/fvRadio/index.vue')['default']
FvSearchForm: typeof import('./src/fvcomponents/fvSearchForm/index.vue')['default'] FvSearchForm: typeof import('./src/fvcomponents/fvSearchForm/index.vue')['default']
@@ -74,18 +59,20 @@ declare module '@vue/runtime-core' {
IconSelect: typeof import('./src/components/iconSelect/index.vue')['default'] IconSelect: typeof import('./src/components/iconSelect/index.vue')['default']
IconSupport: typeof import('./src/components/icons/IconSupport.vue')['default'] IconSupport: typeof import('./src/components/icons/IconSupport.vue')['default']
IconTooling: typeof import('./src/components/icons/IconTooling.vue')['default'] IconTooling: typeof import('./src/components/icons/IconTooling.vue')['default']
JavaCodeEdit: typeof import('./src/components/codeEdit/JavaCodeEdit.vue')['default'] InfoLiveCall: typeof import('./src/components/infoLiveCall/index.vue')['default']
JsCodeEdit: typeof import('./src/components/codeEdit/JsCodeEdit.vue')['default'] LiveCall: typeof import('./src/components/liveCall/index.vue')['default']
LiveCallItem: typeof import('./src/components/liveCall/LiveCallItem.vue')['default']
LiveCallItemHome: typeof import('./src/components/liveCall/LiveCallItemHome.vue')['default']
Pagination: typeof import('./src/components/pagination/index.vue')['default'] Pagination: typeof import('./src/components/pagination/index.vue')['default']
ParentView: typeof import('./src/components/ParentView.vue')['default'] ParentView: typeof import('./src/components/ParentView.vue')['default']
PointTag: typeof import('./src/components/PointTag.vue')['default'] PointTag: typeof import('./src/components/PointTag.vue')['default']
PopoverDelete: typeof import('./src/components/PopoverDelete.vue')['default'] PopoverDelete: typeof import('./src/components/PopoverDelete.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']
SqlCodeEdit: typeof import('./src/components/codeEdit/SqlCodeEdit.vue')['default']
SvgIcon: typeof import('./src/components/svgIcon/index.vue')['default'] SvgIcon: typeof import('./src/components/svgIcon/index.vue')['default']
Tag: typeof import('./src/components/Tag.vue')['default'] Tag: typeof import('./src/components/Tag.vue')['default']
TheWelcome: typeof import('./src/components/TheWelcome.vue')['default'] TheWelcome: typeof import('./src/components/TheWelcome.vue')['default']
Voice: typeof import('./src/components/voice/index.vue')['default']
WelcomeItem: typeof import('./src/components/WelcomeItem.vue')['default'] WelcomeItem: typeof import('./src/components/WelcomeItem.vue')['default']
} }
export interface ComponentCustomProperties { export interface ComponentCustomProperties {

View File

@@ -11,8 +11,9 @@ export const orderGetList=(params)=>{
export const orderGetDetails =(params)=>{ export const orderGetDetails =(params)=>{
return request({ return request({
url:`/order/info/${params}`, url:'/order/info',
method:'get' method:'get',
params
}) })
} }
@@ -33,8 +34,9 @@ export const orderdDetele =(params)=>{
export const orderdClose =(params)=>{ export const orderdClose =(params)=>{
return request({ return request({
url:`/order/${params}`, url:`/order`,
method:'post' method:'post',
params
}) })
} }

View File

@@ -3,8 +3,9 @@ import request from '@/utils/request.js'
//获取历史通话文本记录 //获取历史通话文本记录
export const getHistoryCallContent=(params)=>{ export const getHistoryCallContent=(params)=>{
return request({ return request({
url:`/text/history/list/${params}`, url:`/text/history/list`,
method:'get' method:'get',
params
}) })
} }
//获取工作台当前线路记录 //获取工作台当前线路记录

View File

@@ -8,8 +8,8 @@ const recordLeftRef = ref(null);
const emit = defineEmits(['update:value']) const emit = defineEmits(['update:value'])
const props = defineProps({ const props = defineProps({
value: { value: {
type:String, type:Object,
default:'' default:{}
} }
}) })
@@ -54,7 +54,12 @@ watch(() => props.value, async (newVal) => {
}) })
const getHistoryDetail=(newVal)=>{ const getHistoryDetail=(newVal)=>{
detailLoading.value=true detailLoading.value=true
getHistoryCallContent(newVal).then(res => { let param={
orderNumber:newVal.orderNumber,
alarmObject :newVal.alarmObject,
alarmUnit :newVal.alarmUnit,
}
getHistoryCallContent(param).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
detailLoading.value=false detailLoading.value=false
res.data?.forEach(item => { res.data?.forEach(item => {
@@ -69,6 +74,7 @@ const getHistoryDetail=(newVal)=>{
leftHeadData.value.orderName = res.data[0].orderName || '--'; leftHeadData.value.orderName = res.data[0].orderName || '--';
} }
} else { } else {
detailLoading.value=false
ElMessage.error(res.msg); ElMessage.error(res.msg);
} }
}) })

View File

@@ -8,7 +8,7 @@
<h3>历史通话记录</h3> <h3>历史通话记录</h3>
<fvTable ref="tableIns" :tableConfig="tableConfig" :isLoading="isLoading"></fvTable> <fvTable ref="tableIns" :tableConfig="tableConfig" :isLoading="isLoading"></fvTable>
<voice ref="voiceRef" title="语音详情" :rowUrl="rowUrl" /> <voice ref="voiceRef" title="语音详情" :rowUrl="rowUrl" />
<infoLiveCall ref="infoLiveCallRef" v-model:value="orderNumber" /> <infoLiveCall ref="infoLiveCallRef" v-model:value="historyData" />
</div> </div>
</div> </div>
</template> </template>
@@ -17,6 +17,7 @@
import LiveCall from '@/components/liveCall/index.vue' import LiveCall from '@/components/liveCall/index.vue'
import Voice from '@/components/voice/index.vue' import Voice from '@/components/voice/index.vue'
import InfoLiveCall from '@/components/infoLiveCall/index.vue' import InfoLiveCall from '@/components/infoLiveCall/index.vue'
const historyData = ref({})
const orderNumber = ref('') const orderNumber = ref('')
const rowUrl = ref() const rowUrl = ref()
const infoLiveCallRef = ref() const infoLiveCallRef = ref()
@@ -147,12 +148,13 @@ const handleVoice = (row) => {
} }
const handleInfo = (row) => { const handleInfo = (row) => {
historyData.value=row
orderNumber.value = row.orderNumber orderNumber.value = row.orderNumber
infoLiveCallRef.value.open() infoLiveCallRef.value.open()
} }
window.setInterval(() => { // window.setInterval(() => {
setTimeout(tableIns.value.refresh(), 0) // setTimeout(tableIns.value.refresh(), 0)
}, 2000) // }, 2000)
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -1,14 +1,14 @@
<template> <template>
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm> <fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable> <fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
<WorkDialog ref="workDialogRef" :rowData="rowData" /> <WorkDialog ref="workDialogRef" :rowData="rowData"/>
</template> </template>
<script setup lang="jsx"> <script setup lang="jsx">
import { reactive, shallowRef } from 'vue'; import {reactive, shallowRef} from 'vue';
import fvSelect from '@/fvcomponents/fvSelect/index.vue' import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import WorkDialog from '../components/WorkDialog.vue'; import WorkDialog from '../components/WorkDialog.vue';
import { orderdDetele, orderdClose } from "@/api/order/order.js" import {orderdDetele, orderdClose} from "@/api/order/order.js"
const rowData = ref() const rowData = ref()
const workDialogRef = ref() const workDialogRef = ref()
@@ -150,9 +150,9 @@ const tableConfig = reactive({
label: '工单状态', label: '工单状态',
align: 'center', align: 'center',
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({ row, index }) => { currentRender: ({row, index}) => {
if (row.orderState !== null) { if (row.orderState !== null) {
return (<Tag dictType={'work_order_status'} value={row.orderState} />) return (<Tag dictType={'work_order_status'} value={row.orderState}/>)
} else { } else {
return '--' return '--'
} }
@@ -164,9 +164,9 @@ const tableConfig = reactive({
align: 'center', align: 'center',
width: 150, width: 150,
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({ row, index }) => { currentRender: ({row, index}) => {
if (row.callState !== null) { if (row.callState !== null) {
return (<Tag dictType={'call_status'} value={row.callState} />) return (<Tag dictType={'call_status'} value={row.callState}/>)
} else { } else {
return '--' return '--'
} }
@@ -176,7 +176,7 @@ const tableConfig = reactive({
prop: 'operationUser', prop: 'operationUser',
label: '处理人', label: '处理人',
align: 'center', align: 'center',
currentRender: ({ row, index }) => { currentRender: ({row, index}) => {
if (row.operationUser) { if (row.operationUser) {
return row.operationUser return row.operationUser
} else { } else {
@@ -220,28 +220,28 @@ const tableConfig = reactive({
fixed: 'right', fixed: 'right',
width: 150, width: 150,
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({ row, index }) => { currentRender: ({row, index}) => {
// console.log(row); // console.log(row);
let btn = [] let btn = []
btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' }) btn.push({label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary'})
btn.push({ label: '关单', prem: auths.close, func: () => handleClose(row), type: 'primary' }) btn.push({label: '关单', prem: auths.close, func: () => handleClose(row), type: 'primary'})
btn.push({ label: '删除', prem: auths.delete, func: () => handleDelete(row), type: 'danger'}) btn.push({label: '删除', prem: auths.delete, func: () => handleDelete(row), type: 'danger'})
return ( return (
<div style={{ width: '100%' }}> <div style={{width: '100%'}}>
{ {
btn.map(item => ( btn.map(item => (
<el-button <el-button
type={item.type} type={item.type}
v-perm={item.prem} v-perm={item.prem}
onClick={() => item.func()} onClick={() => item.func()}
link link
> >
{item.label} {item.label}
</el-button> </el-button>
)) ))
} }
</div> </div>
) )
} }
} }
@@ -253,7 +253,7 @@ const tableConfig = reactive({
] ]
}) })
const search = (val) => { const search = (val) => {
let obj = { ...val } let obj = {...val}
if (obj.dateValue) { if (obj.dateValue) {
obj.startTime = obj.dateValue[0] obj.startTime = obj.dateValue[0]
obj.endTime = obj.dateValue[1] obj.endTime = obj.dateValue[1]
@@ -282,30 +282,35 @@ const handleDetail = (row) => {
const handleClose = async (row) => { const handleClose = async (row) => {
if (row.orderState !== '2') { if (row.orderState !== '2') {
ElMessageBox.confirm( ElMessageBox.confirm(
'确定要关单吗?', '确定要关单吗?',
'温馨提示', '温馨提示',
{ {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}
)
.then(async () => {
const info = await orderdClose(row.orderNumber)
// console.log(info);
if (info.code === 1000) {
tableIns.value.refresh()
ElMessage({
message: '关闭成功',
type: 'success',
})
} else {
ElMessage({
message: info.msg,
type: 'warning',
})
} }
}) )
.then(async () => {
const info = await orderdClose(
{
orderNumber: row.orderNumber,
alarmObject: row.alarmObject,
alarmUnit: row.alarmUnit
})
// console.log(info);
if (info.code === 1000) {
tableIns.value.refresh()
ElMessage({
message: '关闭成功',
type: 'success',
})
} else {
ElMessage({
message: info.msg,
type: 'warning',
})
}
})
} else { } else {
ElMessageBox.alert('此工单已被关闭!', '温馨提示', { ElMessageBox.alert('此工单已被关闭!', '温馨提示', {
@@ -321,30 +326,30 @@ const handleClose = async (row) => {
const handleDelete = async (row) => { const handleDelete = async (row) => {
ElMessageBox.confirm( ElMessageBox.confirm(
'确定要删除吗?', '确定要删除吗?',
'温馨提示', '温馨提示',
{ {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}
)
.then(async () => {
const info = await orderdDetele(row.orderNumber)
console.log(info);
if (info.code === 1000) {
tableIns.value.refresh()
ElMessage({
message: '删除成功',
type: 'success',
})
} else {
ElMessage({
message: info.msg,
type: 'warning',
})
} }
}) )
.then(async () => {
const info = await orderdDetele(row.orderNumber)
console.log(info);
if (info.code === 1000) {
tableIns.value.refresh()
ElMessage({
message: '删除成功',
type: 'success',
})
} else {
ElMessage({
message: info.msg,
type: 'warning',
})
}
})
} }
</script> </script>

View File

@@ -25,7 +25,11 @@ const open = (row) => {
const getData = async () => { const getData = async () => {
// console.log(123); // console.log(123);
const data = await orderGetDetails(props.rowData.orderNumber) const data = await orderGetDetails({
orderNumber:props.rowData.orderNumber,
alarmObject :props.rowData.alarmObject,
alarmUnit :props.rowData.alarmUnit
})
// console.log("111", data); // console.log("111", data);
return data return data
@@ -253,15 +257,15 @@ defineExpose({
</el-scrollbar> </el-scrollbar>
</div> </div>
</div> </div>
<div> <!-- <div>-->
<div>通话记录</div> <!-- <div>通话记录</div>-->
<div class="textBox"> <!-- <div class="textBox">-->
<el-scrollbar> <!-- <el-scrollbar>-->
<div class="text">{{ rowData.processedContent || '暂无通话记录' }}</div> <!-- <div class="text">{{ rowData.processedContent || '暂无通话记录' }}</div>-->
</el-scrollbar> <!-- </el-scrollbar>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
<div> <div>
<div>录音信息</div> <div>录音信息</div>
<div class="textBox—record"> <div class="textBox—record">