Merge pull request 'master' (#71) from master into test

Reviewed-on: http://git.feashow.cn/feashow/SmartOpsWeb/pulls/71
This commit is contained in:
2024-09-15 19:22:46 +00:00
6 changed files with 109 additions and 40 deletions

View File

@@ -34,8 +34,8 @@
<el-button v-if="searchConfig.length>=4" link type="primary" @click="showMore = !showMore">
{{ showMore ? '收起' : '展开' }}
</el-button>
<el-button type="primary" @click="getValues" :icon="Search">查询</el-button>
<el-button @click="handleReset" :icon="Refresh">重置</el-button>
<el-button type="primary" @click="getValues" >查询</el-button>
<el-button @click="handleReset" >重置</el-button>
</el-form-item>
</el-col>
</el-row>

View File

@@ -1,19 +1,22 @@
<template>
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>
<fvFormDialog ref="formDialogRef" :isVisited="showAddOrEditAddressBookDialog" :title="dialogTitle" :dialogType="dialogType"
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"
@selectionChange="selectionChange"></fvTable>
<fvFormDialog ref="formDialogRef" :title="dialogTitle" :dialogType="dialogType"
:form-schema="formSchema" :form-rules="formRules" @dialogCancel="handleCancel"
@dialogSubmit="handleSubmit"></fvFormDialog>
</template>
<script setup lang="jsx">
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import {addContact,editContact,getContactDetail,deleteContact} from "@/api/address-book";
import {addContact, editContact, getContactDetail, deleteContact} from "@/api/address-book";
import {ElMessage, ElMessageBox} from "element-plus";
const router = useRouter()
const tableIns = ref()
const formDialogRef = ref()
const delBtnDisabled = ref(true)
const contactIds = ref("");
const dialogTitle = ref("");
const dialogType = ref("");
const formRules = reactive({
@@ -131,6 +134,10 @@ const searchConfig = reactive([
])
const tableConfig = reactive({
columns: [
{
type: 'selection',
prop: 'selection'
},
{
prop: 'index',
type: 'index',
@@ -178,12 +185,12 @@ const tableConfig = reactive({
fixed: 'right',
width: 150,
showOverflowTooltip: false,
currentRender: ({ row, index }) => {
currentRender: ({row, index}) => {
let btn = []
btn.push({ label: '编辑', func: () => handleEdit(row), type: 'primary' })
btn.push({ label: '删除', func: () => handleDelete(row), type: 'danger' })
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
btn.push({label: '删除', func: () => handleSingleDelete(row), type: 'danger'})
return (
<div style={{ width: '100%' }}>
<div style={{width: '100%'}}>
{
btn.map(item => (
<el-button
@@ -204,7 +211,8 @@ const tableConfig = reactive({
api: '/contact/list',
params: {},
btns: [
{name: '新增', key: 'add', type: 'primary', icon: 'Plus'},
{name: '新增', key: 'add', type: 'primary'},
{name: '删除', key: 'delete', type: 'danger'},
]
})
const search = (val) => {
@@ -223,6 +231,9 @@ const headBtnClick = (key) => {
case 'add':
handleAdd()
break;
case 'delete':
handleMoreDelete()
break;
}
}
@@ -242,7 +253,7 @@ const handleEdit = (row) => {
dialogTitle.value = "编辑通讯录";
dialogType.value = "edit";
}
const getDetail=(row)=>{
const getDetail = (row) => {
getContactDetail(row.contactsId).then(res => {
if (res.code === 1000) {
ElMessage.success(res.msg)
@@ -255,20 +266,49 @@ const getDetail=(row)=>{
}
})
}
const handleDelete = (row) => {
const selectionChange = (selection) => {
if (selection.length !== 0) {
delBtnDisabled.value = false
contactIds.value = selection.map(item => item.contactsId).join()
} else {
contactIds.value=''
delBtnDisabled.value = true
}
}
const deleteContactMethod = (contactsId) => {
deleteContact(contactsId).then(res => {
if (res.code === 1000) {
ElMessage.success(res.msg)
tableIns.value.refresh()
} else {
ElMessage.error(res.msg)
}
})
}
const handleMoreDelete = () => {
console.info("🚀 ~method:contactIds -----", contactIds.value)
if(contactIds.value){
ElMessageBox.confirm(`确认删除选择的通讯录吗?`, '系统提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteContactMethod(contactIds.value)
})
}else{
ElMessage.warning("请选择要删除的通讯录")
}
}
const handleSingleDelete = (row) => {
ElMessageBox.confirm(`确认删除姓名为${row.name}的通讯录吗?`, '系统提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteContact(row.contactsId).then(res => {
if (res.code === 1000) {
ElMessage.success(res.msg)
tableIns.value.refresh()
} else {
ElMessage.error(res.msg)
}
})
deleteContactMethod(row.contactsId)
})
}

View File

@@ -9,7 +9,7 @@
import { reactive, shallowRef } from 'vue';
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import WorkDialog from '../components/WorkDialog.vue';
import { orderdDetele, orderdClose, orderAdd } from "@/api/order/order.js"
import { orderdDetele, orderdClose} from "@/api/order/order.js"
const rowData = ref()
const workDialogRef = ref()
@@ -263,7 +263,7 @@ const handleDetail = (row) => {
}
const handleClose = async (row) => {
// console.log(row.orderNumber);
console.log(row);
ElMessageBox.confirm(
'确定要关单吗?',
@@ -276,12 +276,14 @@ const handleClose = async (row) => {
)
.then(async () => {
await orderdClose(row.orderNumber)
tableIns.value.refresh()
ElMessage({
type: 'success',
message: '关闭成功',
})
})
.catch(() => {
// tableIns.value.refresh()
ElMessage({
type: 'info',
message: '关闭失败',
@@ -302,12 +304,14 @@ const handleDelete = async (row) => {
)
.then(async () => {
await orderdDetele(row.orderNumber)
tableIns.value.refresh()
ElMessage({
type: 'success',
message: '删除成功',
})
})
.catch(() => {
// tableIns.value.refresh()
ElMessage({
type: 'info',
message: '删除失败',

View File

@@ -52,7 +52,7 @@ watch(() => props.rowData, (newRowData) => {
if (newRowData) {
// console.log(getData(newRowData));
getData(newRowData).then((data) => {
opsCallList.value=[]
opsCallList.value = []
orderData.value = data.data
//电话拨打记录
const dataDetails = data.data.opsCallList
@@ -73,13 +73,15 @@ watch(() => props.rowData, (newRowData) => {
})
});
theData.pop()
// theData[0].data.sort((a, b) => b.answer_time- a.answer_time)
// console.log(theData);
theData.forEach(item => {
item.data.sort((a, b) => b.answer_time- a.answer_time)
opsCallList.value.push(item)
})
//工单时间线
orderContent.value=[]
console.log(orderData.value);
orderContent.value = []
// console.log(orderData.value);
content.map((item, index) => {
if (index === 0) {
item.timestamp = orderData.value.operationTime || '--'
@@ -93,10 +95,10 @@ watch(() => props.rowData, (newRowData) => {
})
content.forEach(item => {
orderContent.value.push(item)
orderContent.value.push(item)
})
console.log(orderContent.value);
// console.log(orderContent.value);
})
}
@@ -207,20 +209,19 @@ defineExpose({
<el-scrollbar height="20vh">
<el-timeline style="max-width: 99%" class="timeline">
<el-timeline-item v-for="(activity, index) in opsCallList" :key="index"
:icon="activity.icon" :type="activity.type" :color="activity.color"
:size="activity.size">
icon="MoreFilled" type="primary" size="large">
<div class="custom-card">
<div>{{ activity.createTime }}</div>
<div style="font-weight: bold">{{ activity.createTime }}</div>
<div v-for="(info, index) in activity.data" :key="index">
<div>
<div class="timeline-row">
<span :style="{ color: '#a8abb2' }">{{ info.callIdNumber
}}</span>
<PointTag dictType="call_status" :value="info.callState" />
<span :style="{
<PointTag dictType="call_status" :value="info.callState" class="tag"/>
<!-- <span :style="{
color: info.callState === '通话中' ? '#6cc23a' : '#409eff'
}">{{ info.callState }}</span>
}">{{ info.callState }}</span> -->
<span class="span-3th" :style="{ color: '#a8abb2' }">{{
info.answer_time }}</span>
info.answer_time ||'00 : 00'}}</span>
</div>
</div>
</div>
@@ -318,6 +319,26 @@ defineExpose({
}
.main-content .timeline-row{
// border: 1px solid #000;
display: flex;
// justify-content: space-between;
// border: 1px solid #000;
}
.main-content .tag{
align-items: center;
// background-color: red;
margin-left: 30px;
}
.main-content .span-3th{
// flex-grow: 1;
// margin-right:;
flex: 1;
text-align: right;
margin-right: 100px;
}
.custom-card {
width: 100%;
font-size: 16px;
@@ -329,8 +350,4 @@ defineExpose({
margin: 2px;
}
.custom-card .span-3th {
float: right;
}
</style>

View File

@@ -278,12 +278,14 @@ const handleClose = async (row) => {
)
.then(async () => {
await orderdClose(row.orderNumber)
tableIns.value.refresh()
ElMessage({
type: 'success',
message: '关闭成功',
})
})
.catch(() => {
// tableIns.value.refresh()
ElMessage({
type: 'info',
message: '关闭失败',
@@ -304,12 +306,14 @@ const handleDelete = async (row) => {
)
.then(async () => {
await orderdDetele(row.orderNumber)
tableIns.value.refresh()
ElMessage({
type: 'success',
message: '删除成功',
})
})
.catch(() => {
// tableIns.value.refresh()
ElMessage({
type: 'info',
message: '删除失败',

View File

@@ -278,12 +278,14 @@ const handleClose = async (row) => {
)
.then(async () => {
await orderdClose(row.orderNumber)
tableIns.value.refresh()
ElMessage({
type: 'success',
message: '关闭成功',
})
})
.catch(() => {
// tableIns.value.refresh()
ElMessage({
type: 'info',
message: '关闭失败',
@@ -304,12 +306,14 @@ const handleDelete = async (row) => {
)
.then(async () => {
await orderdDetele(row.orderNumber)
tableIns.value.refresh()
ElMessage({
type: 'success',
message: '删除成功',
})
})
.catch(() => {
// tableIns.value.refresh()
ElMessage({
type: 'info',
message: '删除失败',