Merge pull request 'fix:修复了工单,工单详情,工作台的部分显示问题' (#109) from wxy into master

Reviewed-on: http://git.feashow.cn/feashow/SmartOpsWeb/pulls/109
This commit is contained in:
springlog
2024-09-26 17:32:56 +00:00
7 changed files with 155 additions and 123 deletions

View File

@@ -43,7 +43,7 @@ watch(() => props.rowData, async (newVal) => {
item.textVoList = convertArrayToMap(item.textVoList); item.textVoList = convertArrayToMap(item.textVoList);
}) })
recordLeftObj.value = res.data recordLeftObj.value = res.data
console.info("🚀 ~method:res.data -----", res.data) // console.info("🚀 ~method:res.data -----", res.data)
if (res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
leftHeadData.value.username = res.data[0].callIdNumber || '--'; leftHeadData.value.username = res.data[0].callIdNumber || '--';
leftHeadData.value.phone = res.data[0].callPhone || '--'; leftHeadData.value.phone = res.data[0].callPhone || '--';

View File

@@ -5,17 +5,21 @@ const open = (row) => {
}; };
// console.log(dialogVisible.value); // console.log(dialogVisible.value);
defineProps({ defineProps({
title:String title:String,
rowUrl:String
}) })
defineExpose({ defineExpose({
open, open,
}); });
// console.log(props.rowUrl);
</script> </script>
<template> <template>
<el-dialog v-model="dialogVisible" :title="title" width="500" > <el-dialog v-model="dialogVisible" :title="title" width="500" >
<audio src="" controls style="width: 100%;"></audio> <audio :src=rowUrl controls style="width: 100%;"></audio>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">

View File

@@ -4,10 +4,11 @@
<div class="real-time-call"> <div class="real-time-call">
<LiveCall /> <LiveCall />
</div> </div>
<div class="call-history"><h3 >历史通话记录</h3> <div class="call-history">
<h3>历史通话记录</h3>
<fvTable ref="tableIns" :tableConfig="tableConfig"></fvTable> <fvTable ref="tableIns" :tableConfig="tableConfig"></fvTable>
<voice ref="voiceRef" title="语音详情"/> <voice ref="voiceRef" title="语音详情" :rowUrl="rowUrl" />
<infoLiveCall ref="infoLiveCallRef" :rowData="rowData"/> <infoLiveCall ref="infoLiveCallRef" :rowData="rowData" />
</div> </div>
</div> </div>
</template> </template>
@@ -17,15 +18,16 @@ 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 rowData = ref() const rowData = ref()
const infoLiveCallRef=ref() const rowUrl = ref()
const voiceRef=ref() const infoLiveCallRef = ref()
const voiceRef = ref()
const tableIns = ref() const tableIns = ref()
const auths = reactive({ const auths = reactive({
report: ['mosr:collect:reported'], report: ['mosr:collect:reported'],
}) })
const tableConfig = reactive({ const tableConfig = reactive({
columns: [ columns: [
{ {
prop: 'index', prop: 'index',
type: 'index', type: 'index',
label: '序号', label: '序号',
@@ -119,14 +121,23 @@ const tableConfig = reactive({
], ],
api: '/order/list', api: '/order/list',
params: { params: {
orderState:'2' orderState: '2'
} }
}) })
const handleVoice = (row) => { const handleVoice = (row) => {
voiceRef.value.open(true) if (row.recordUrl !== null) {
voiceRef.value.open(true)
rowUrl.value = row.recordUrl
}else{
ElMessage({
message: '暂无语音',
type: 'warning',
})
}
} }
const handleInfo = (row) => { const handleInfo = (row) => {
// console.log(row); console.log(row);
infoLiveCallRef.value.open(true) infoLiveCallRef.value.open(true)
rowData.value = row.orderNumber rowData.value = row.orderNumber

View File

@@ -276,25 +276,27 @@ const handleClose = async (row) => {
} }
) )
.then(async () => { .then(async () => {
await orderdClose(row.orderNumber) const info = await orderdClose(row.orderNumber)
tableIns.value.refresh() // console.log(info);
ElMessage({ if (info.code === 1000) {
type: 'success', tableIns.value.refresh()
message: '关闭成功', ElMessage({
}) message: '关闭成功',
}) type: 'success',
.catch(() => { })
// tableIns.value.refresh() } else {
ElMessage({ ElMessage({
type: 'info', message: info.msg,
message: '关闭失败', type: 'warning',
}) })
}
}) })
} else { } else {
ElMessageBox.alert('此工单已被关闭!', '温馨提示', { ElMessageBox.alert('此工单已被关闭!', '温馨提示', {
// if you want to disable its autofocus // if you want to disable its autofocus
// autofocus: false, // autofocus: false,
type:'warning', type: 'warning',
confirmButtonText: '确定', confirmButtonText: '确定',
}) })
} }
@@ -313,19 +315,20 @@ const handleDelete = async (row) => {
} }
) )
.then(async () => { .then(async () => {
await orderdDetele(row.orderNumber) const info = await orderdDetele(row.orderNumber)
tableIns.value.refresh() console.log(info);
ElMessage({ if (info.code === 1000) {
type: 'success', tableIns.value.refresh()
message: '删除成功', ElMessage({
}) message: '删除成功',
}) type: 'success',
.catch(() => { })
// tableIns.value.refresh() } else {
ElMessage({ ElMessage({
type: 'info', message: info.msg,
message: '删除失败', type: 'warning',
}) })
}
}) })
} }
</script> </script>

View File

@@ -18,6 +18,7 @@ let opsCallList = ref([]);
let orderData = ref([]); let orderData = ref([]);
let orderContent = ref([]); let orderContent = ref([]);
const voiceRef = ref() const voiceRef = ref()
const rowUrl = ref()
const open = (row) => { const open = (row) => {
dialogVisible.value = true; dialogVisible.value = true;
}; };
@@ -108,7 +109,7 @@ watch(() => props.rowData, (newRowData) => {
//电话拨打记录 //电话拨打记录
const dataDetails = data.data.opsCallList const dataDetails = data.data.opsCallList
console.log(dataDetails); // console.log(dataDetails);
const theData = [{ createTime: '', data: [] }] const theData = [{ createTime: '', data: [] }]
dataDetails.forEach(for1data => { dataDetails.forEach(for1data => {
@@ -128,7 +129,7 @@ watch(() => props.rowData, (newRowData) => {
}); });
// theData.pop() // theData.pop()
// theData[0].data.sort((a, b) => b.answer_time- a.answer_time) // theData[0].data.sort((a, b) => b.answer_time- a.answer_time)
console.log(theData); // console.log(theData);
theData.forEach(item => { theData.forEach(item => {
item.data.forEach(info => { item.data.forEach(info => {
if (info.answeredTime !== null) { if (info.answeredTime !== null) {
@@ -145,7 +146,7 @@ watch(() => props.rowData, (newRowData) => {
//工单时间线 //工单时间线
orderContent.value = [] orderContent.value = []
console.log(orderData.value); // console.log(orderData.value);
// orderData.value.orderState='2' // orderData.value.orderState='2'
if (orderData.value.orderState === '0') { if (orderData.value.orderState === '0') {
inputOrderContent(contentState0) inputOrderContent(contentState0)
@@ -185,9 +186,26 @@ const inputOrderContent = (contentState) => {
} }
const openRecord = () => { const openRecord = () => {
voiceRef.value.open(true) if ( props.rowData.recordUrl !== null) {
voiceRef.value.open(true)
rowUrl.value = props.rowData.recordUrl
} else {
ElMessage({
message: '暂无语音',
type: 'warning',
})
}
} }
const downloadRecord = () => {
if(props.rowData.recordUrl === null){
ElMessage({
message: '暂无语音',
type: 'warning',
})
}
}
defineExpose({ defineExpose({
open, open,
}); });
@@ -201,7 +219,7 @@ defineExpose({
<div class="common-layout"> <div class="common-layout">
<el-container> <el-container>
<el-header class="header"><span>工单号</span> <el-header class="header"><span>工单号</span>
<span>{{ rowData.orderNumber }}</span> <span>{{ rowData.orderNumber || '--' }}</span>
</el-header> </el-header>
<el-container class="main-container"> <el-container class="main-container">
<el-aside width="200px" :style="{ position: 'static' }"> <el-aside width="200px" :style="{ position: 'static' }">
@@ -219,11 +237,11 @@ defineExpose({
<div class="top"> <div class="top">
<div class="info"> <div class="info">
<!-- <span>创始人{{ rowData.createBy }}</span> --> <!-- <span>创始人{{ rowData.createBy }}</span> -->
<span>处理人{{ rowData.operationUser }}</span> <span>处理人{{ rowData.operationUser || '--' }}</span>
</div> </div>
<div class="info"> <div class="info">
<span>工单名称{{ rowData.orderName }}</span> <span>工单名称{{ rowData.orderName || '--' }}</span>
<span>关单人{{ rowData.knotter }}</span> <span>关单人{{ rowData.knotter || '--' }}</span>
</div> </div>
</div> </div>
<div class="body"> <div class="body">
@@ -231,7 +249,7 @@ defineExpose({
<div>工单内容</div> <div>工单内容</div>
<div class="textBox"> <div class="textBox">
<el-scrollbar> <el-scrollbar>
<div class="text">{{ rowData.orderContent }}</div> <div class="text">{{ rowData.orderContent || '暂无工单内容' }}</div>
</el-scrollbar> </el-scrollbar>
</div> </div>
</div> </div>
@@ -239,7 +257,7 @@ defineExpose({
<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>
@@ -251,9 +269,10 @@ defineExpose({
<el-button @click="openRecord" type="primary" :icon="VideoPlay" <el-button @click="openRecord" type="primary" :icon="VideoPlay"
style="margin-right: 10px ;">播放录音 style="margin-right: 10px ;">播放录音
</el-button> </el-button>
<voice ref="voiceRef" title="录音详情" /> <voice ref="voiceRef" title="录音详情" :rowUrl="rowUrl" />
<a :href="opsCallList.recordUrl" download="record.mp3"> <a :href=rowData.recordUrl download>
<el-button type="primary" :icon="Download">下载录音</el-button> <el-button type="primary" :icon="Download"
@click="downloadRecord">下载录音</el-button>
</a> </a>
<!-- <el-scrollbar> --> <!-- <el-scrollbar> -->
<!-- <div class="text">{{ rowData.recordUrl }}</div> --> <!-- <div class="text">{{ rowData.recordUrl }}</div> -->
@@ -267,6 +286,7 @@ defineExpose({
<div class="timebox"> <div class="timebox">
<div> <div>
<el-scrollbar height="20vh"> <el-scrollbar height="20vh">
<p v-if="opsCallList.length === 0">暂无电话拨打记录</p>
<el-timeline style="max-width: 99%" class="timeline"> <el-timeline style="max-width: 99%" class="timeline">
<el-timeline-item v-for="(activity, index) in opsCallList" :key="index" <el-timeline-item v-for="(activity, index) in opsCallList" :key="index"
icon="MoreFilled" type="primary" size="large"> icon="MoreFilled" type="primary" size="large">

View File

@@ -233,14 +233,14 @@ const tableConfig = reactive({
} }
], ],
api: '/order/list', api: '/order/list',
params: {orderState:"2"}, params: { orderState: "2" },
btns: [ btns: [
// {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report}, // {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report},
] ]
}) })
const search = (val) => { const search = (val) => {
let obj = {...val} let obj = { ...val, orderState: '2' }
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]
@@ -276,25 +276,26 @@ const handleClose = async (row) => {
} }
) )
.then(async () => { .then(async () => {
await orderdClose(row.orderNumber) const info = await orderdClose(row.orderNumber)
tableIns.value.refresh() // console.log(info);
ElMessage({ if (info.code === 1000) {
type: 'success', tableIns.value.refresh()
message: '关闭成功', ElMessage({
}) message: '关闭成功',
}) type: 'success',
.catch(() => { })
// tableIns.value.refresh() } else {
ElMessage({ ElMessage({
type: 'info', message: info.msg,
message: '关闭失败', type: 'warning',
}) })
}
}) })
} else { } else {
ElMessageBox.alert('此工单已被关闭!', '温馨提示', { ElMessageBox.alert('此工单已被关闭!', '温馨提示', {
// if you want to disable its autofocus // if you want to disable its autofocus
// autofocus: false, // autofocus: false,
type:'warning', type: 'warning',
confirmButtonText: '确定', confirmButtonText: '确定',
}) })
} }
@@ -313,19 +314,20 @@ const handleDelete = async (row) => {
} }
) )
.then(async () => { .then(async () => {
await orderdDetele(row.orderNumber) const info = await orderdDetele(row.orderNumber)
tableIns.value.refresh() console.log(info);
ElMessage({ if (info.code === 1000) {
type: 'success', tableIns.value.refresh()
message: '删除成功', ElMessage({
}) message: '删除成功',
}) type: 'success',
.catch(() => { })
// tableIns.value.refresh() } else {
ElMessage({ ElMessage({
type: 'info', message: info.msg,
message: '删除失败', type: 'warning',
}) })
}
}) })
} }
</script> </script>

View File

@@ -52,16 +52,6 @@ const searchConfig = reactive([
checkStrictly: true checkStrictly: true
}, },
component: 'el-input', component: 'el-input',
}, {
label: '工单状态',
prop: 'orderState',
props: {
placeholder: '请选择工单状态查询',
cacheKey: 'work_order_status',
clearable: true,
filterable: true,
},
component: shallowRef(fvSelect),
}, { }, {
label: '处理人', label: '处理人',
prop: 'operationUser', prop: 'operationUser',
@@ -233,14 +223,14 @@ const tableConfig = reactive({
} }
], ],
api: '/order/list', api: '/order/list',
params: {orderState:"0"}, params: { orderState: "0" },
btns: [ btns: [
// {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report}, // {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report},
] ]
}) })
const search = (val) => { const search = (val) => {
let obj = {...val} let obj = { ...val, orderState: '0' }
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]
@@ -276,25 +266,26 @@ const handleClose = async (row) => {
} }
) )
.then(async () => { .then(async () => {
await orderdClose(row.orderNumber) const info = await orderdClose(row.orderNumber)
tableIns.value.refresh() // console.log(info);
ElMessage({ if (info.code === 1000) {
type: 'success', tableIns.value.refresh()
message: '关闭成功', ElMessage({
}) message: '关闭成功',
}) type: 'success',
.catch(() => { })
// tableIns.value.refresh() } else {
ElMessage({ ElMessage({
type: 'info', message: info.msg,
message: '关闭失败', type: 'warning',
}) })
}
}) })
} else { } else {
ElMessageBox.alert('此工单已被关闭!', '温馨提示', { ElMessageBox.alert('此工单已被关闭!', '温馨提示', {
// if you want to disable its autofocus // if you want to disable its autofocus
// autofocus: false, // autofocus: false,
type:'warning', type: 'warning',
confirmButtonText: '确定', confirmButtonText: '确定',
}) })
} }
@@ -313,19 +304,20 @@ const handleDelete = async (row) => {
} }
) )
.then(async () => { .then(async () => {
await orderdDetele(row.orderNumber) const info = await orderdDetele(row.orderNumber)
tableIns.value.refresh() console.log(info);
ElMessage({ if (info.code === 1000) {
type: 'success', tableIns.value.refresh()
message: '删除成功', ElMessage({
}) message: '删除成功',
}) type: 'success',
.catch(() => { })
// tableIns.value.refresh() } else {
ElMessage({ ElMessage({
type: 'info', message: info.msg,
message: '删除失败', type: 'warning',
}) })
}
}) })
} }
</script> </script>