Jelajahi Sumber

feat:新增wex分机组配置;

zhangchong 1 tahun lalu
induk
melakukan
c70676a491

+ 56 - 0
src/api/device/group.ts

@@ -0,0 +1,56 @@
+/*
+ * @Author: zc
+ * @Description: 分机组设置(wex)
+ * @version:
+ * @Date: 2022-08-26 14:43:22
+ * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2022-11-10 11:51:09
+ */
+import request from '/@/utils/request';
+/**
+ * @description: 获取分机组列表
+ * @param {object} params
+ * @return {*}
+ */
+export const getGroupList = (params?: object) => {
+    return request({
+        url: '/api/v1/Pbx/telgroup-list',
+        method: 'get',
+        params: params,
+    });
+};
+/**
+ * @description: 查询分机列表
+ * @param {object} params
+ * @return {*}
+ */
+export const getTelsListWex = (params?: object) => {
+    return request({
+        url: '/api/v1/Pbx/query-tel-list',
+        method: 'get',
+        params: params,
+    });
+};
+/**
+ * @description: 配置wex分机组
+ * @return {*}
+ * @param data
+ */
+export const editWexGroup = (data: object) => {
+    return request({
+        url: '/api/v1/Pbx/add-update-telgroup',
+        method: 'post',
+        data
+    });
+};
+/**
+ * @description: 配置wex分机组
+ * @return {*}
+ * @param telNo
+ */
+export const getGroup = (telNo: string) => {
+    return request({
+        url: `/api/v1/Pbx/telgroup/${telNo}`,
+        method: 'get'
+    });
+};

+ 1 - 1
src/components/IconSelector/index.vue

@@ -195,7 +195,7 @@ const onClearFontIcon = () => {
 // 获取 input 的宽度
 const getInputWidth = () => {
   nextTick(() => {
-    state.fontIconWidth = inputWidthRef.value.$el.offsetWidth;
+    state.fontIconWidth = inputWidthRef?.value.$el.offsetWidth;
   });
 };
 // 监听页面宽度改变

+ 18 - 10
src/layout/navBars/breadcrumb/telControl.vue

@@ -449,6 +449,7 @@ import { VoiceInterfaceObject } from '/@/utils/PhoneScript';
 import { WebsocketInterface } from '/@/utils/websocket';
 import signalR from '/@/utils/signalR';
 import { Local } from '/@/utils/storage';
+import {getGroup} from '/@/api/device/group';
 const storesUserInfo = useUserInfo();
 const { userInfos } = storeToRefs(storesUserInfo);
 
@@ -514,6 +515,7 @@ const state = reactive<any>({
 		metingId: '', // 三方会议ID
 		phoneNo: '', // 三方会议号码
 	},
+  groupName:'', //坐席组名称
 });
 const useTelStatusStore = useTelStatus();
 const { telStatusInfo } = storeToRefs(useTelStatusStore);
@@ -578,7 +580,7 @@ const initWebsocket = () => {
 		GongHao: userInfos.value.staffNo,
 		FenJi: telNo,
 		DepartmentID: 'Default',
-		AgentGroupName: '座席3组',
+		AgentGroupName: state.groupName,
 	});
 	// 初始化参数
 	const wsParams = {
@@ -666,6 +668,7 @@ const currentStatusText = computed(() => {
 });
 // 查询所有分机
 const getTelsLists = async (object?: object) => {
+  state.loading = true;
 	try {
 		const res: any = await getTelList(object);
 		state.telsList = res?.data ?? [];
@@ -674,9 +677,11 @@ const getTelsLists = async (object?: object) => {
 			label: item.device,
 			...item,
 		}));
+    state.loading = false;
 		return Promise.resolve(state.telsList);
 	} catch (err) {
 		console.log(err);
+    state.loading = false;
 	}
 };
 // 鼠标移入移出改变图标
@@ -765,11 +770,12 @@ const clickOnDuty = (formEl: FormInstance | undefined) => {
 		if (!valid) return;
 		state.loading = true;
 		// {telNo:state.dutyForm.telNo}
-		setTimeout(() => {
-			state.loading = false;
-			state.dutyDialogVisible = false;
-			initWebsocket(); //开启消息监听
-		}, 300);
+    getGroup(state.dutyForm.telNo).then((res:any)=>{// 获取坐席分组
+      state.groupName = res.result.groupName ?? '';
+      state.loading = false;
+      state.dutyDialogVisible = false;
+      initWebsocket(); //开启消息监听
+    })
 	});
 };
 // 签出
@@ -1003,8 +1009,9 @@ const onTransfer = () => {
 	//  重置表单
 	transferFormRef.value?.resetFields();
 	// 获取所有分机列表
-	getTelsLists();
-	state.transferDialogVisible = true;
+	getTelsLists().then(()=>{
+    state.transferDialogVisible = true;
+  })
 };
 // 确认转接
 const clickOnTransfer = (formEl: FormInstance | undefined) => {
@@ -1071,8 +1078,9 @@ const onOutbound = () => {
 	//  重置表单
 	outboundFormRef.value?.resetFields();
 	// 获取所有分机列表
-	getTelsLists();
-	state.outboundDialogVisible = true;
+	getTelsLists().then(()=>{
+    state.outboundDialogVisible = true;
+  })
 };
 // 外呼保存
 const clickOnOutbound = (formEl: FormInstance | undefined) => {

+ 3 - 3
src/utils/PhoneScript.ts

@@ -144,7 +144,7 @@ export const VoiceInterfaceObject: any = {
 			// ElMessage.success(returnVal.Message)
 		} else {
 			console.info(returnVal.Message);
-			ElMessage.error('设置组权限失败');
+			ElMessage.error(returnVal.Message);
 		}
 	},
 
@@ -163,7 +163,7 @@ export const VoiceInterfaceObject: any = {
 			// ElMessage.success(returnVal.Message)
 		} else {
 			console.info(returnVal.Message);
-			ElMessage.error('设置录音权限失败!');
+			ElMessage.error(returnVal.Message);
 		}
 	},
 	// 设置呼叫权限
@@ -181,7 +181,7 @@ export const VoiceInterfaceObject: any = {
 			console.info(returnVal.Message);
 			// ElMessage.success(returnVal.Message)
 		} else {
-			ElMessage.error('设置呼叫权限失败!');
+			ElMessage.error(returnVal.Message);
 			console.info(returnVal.Message);
 		}
 	},

+ 1 - 1
src/views/business/delay/index.vue

@@ -294,7 +294,7 @@ const getBaseData = async () => {
 };
 /** 获取列表 */
 const queryList = throttle(() => {
-	if (!auth('business:backlog:query')) ElMessage.error('抱歉,您没有权限查看工单延期申请!');
+	if (!auth('business:delay:query')) ElMessage.error('抱歉,您没有权限查看工单延期申请!');
 	else {
 	}
 }, 500);

+ 1 - 1
src/views/business/followUp/backlog/index.vue

@@ -151,7 +151,7 @@
 				<el-table-column prop="no" label="是否接通" show-overflow-tooltip></el-table-column>
 				<el-table-column label="操作" width="150" fixed="right" align="center">
 					<template #default="{ row }">
-						<el-button link type="primary" @click="onOrderDetail(row)" title="查看工单详情" v-auth="'business:waitFollowUp:detail'"> 工单详情 </el-button>
+						<el-button link type="primary" @click="onOrderDetail(row)" title="查看工单详情" v-auth="'business:followUp:backlog:detail'"> 工单详情 </el-button>
 						<el-button link type="primary" @click="onManpower(row)" title="工单回访" v-auth="'business:followUp:backlog:manpower'"> 回访 </el-button>
 					</template>
 				</el-table-column>

+ 1 - 1
src/views/business/followUp/component/Follow-up-detail.vue

@@ -228,7 +228,7 @@
       <template #footer>
 			<span class="dialog-footer">
 				<el-button @click="onCancel" class="default-button">取 消</el-button>
-				<el-button type="primary" @click="onSubmit(ruleFormRef)" :loading="state.loading" v-auth="'business:waitFollowUp:manpower'">保存</el-button>
+				<el-button type="primary" @click="onSubmit(ruleFormRef)" :loading="state.loading">保存</el-button>
 			</span>
       </template>
     </el-dialog>

+ 1 - 1
src/views/business/order/accept/orderEdit.vue

@@ -802,7 +802,7 @@ const save = throttle((formEl: FormInstance | undefined) => {
 				mittBus.emit('onCurrentContextmenuClick', Object.assign({}, { contextMenuClickId: 1, ...route }));
 				mittBus.emit('clearCache', 'order');
 				router.replace({
-					path: '/business/order',
+					path: '/business/order/index',
 				});
 			});
 		};

+ 5 - 0
src/views/business/order/components/Order-detail.vue

@@ -338,6 +338,7 @@ import { commonEnum } from '/@/utils/constants';
 import { verifyNumberCnUppercase } from '/@/utils/toolsValidate';
 import { orderDetail } from '/@/api/business/order';
 import { formatDate } from '/@/utils/formatTime';
+import {ElMessage} from "element-plus";
 
 // 引入组件
 const OrderExpandDetail = defineAsyncComponent(() => import('/@/views/business/order/components/Order-expand-detail.vue')); // 扩展信息
@@ -407,6 +408,10 @@ const ruleFormRef = ref<RefType>(); // 表单ref
 const router = useRouter(); // 路由
 // 打开弹窗
 const openDialog = (val: any) => {
+  if(!val || !val.id){
+    ElMessage.error('工单id不能为空')
+    return;
+  }
 	state.orderId = val.id;
 	getDetail(val.id);
 };

+ 1 - 1
src/views/business/release/component/Order-release.vue

@@ -1,5 +1,5 @@
 <template>
-	<el-dialog v-model="state.dialogVisible" draggable title="工单发布" ref="dialogRef" width="60%" append-to-body destroy-on-close>
+	<el-dialog v-model="state.dialogVisible" draggable title="工单发布" ref="dialogRef" width="50%" append-to-body destroy-on-close>
 		<div class="collapse-container pb1">
 			<el-form label-width="100px" ref="ruleFormRef" :model="state.ruleForm">
 				<el-row :gutter="20" class="w100">

+ 156 - 0
src/views/device/group/index.vue

@@ -0,0 +1,156 @@
+
+<template>
+  <div class="device-group-container layout-pd">
+    <el-card shadow="never">
+      <!-- 通用搜索 -->
+      <el-form :model="state.queryParams" ref="searchFormRef" :inline="true" @submit.native.prevent class="mt15">
+        <el-form-item label="分机号" prop="TelNo">
+          <el-input v-model="state.queryParams.TelNo" placeholder="请输入分机号" clearable @keyup.enter="handleQuery" />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="handleQuery" :loading="state.loading" v-waves> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
+          <el-button @click="resetQuery(searchFormRef)" v-waves class="default-button" :loading="state.loading">
+            <SvgIcon name="ele-Refresh" class="mr5" />重置
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </el-card>
+    <el-card shadow="never">
+      <!-- 表格 -->
+      <el-table :data="state.tableData" v-loading="state.loading">
+        <el-table-column prop="telNo" label="分机号" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="groupName" label="所属分机组" show-overflow-tooltip></el-table-column>
+        <el-table-column label="操作" width="100" fixed="right" align="center">
+          <template #default="{ row }">
+            <el-button link type="primary" @click="onEditGroup(row)" v-auth="'device:group:edit'" title="配置分机组"> 配置 </el-button>
+          </template>
+        </el-table-column>
+        <template #empty>
+          <Empty />
+        </template>
+      </el-table>
+      <!-- 分页 -->
+      <pagination
+          :total="state.total"
+          v-model:page="state.queryParams.pageIndex"
+          v-model:limit="state.queryParams.pageSize"
+          @pagination="queryList"
+      />
+    </el-card>
+
+    <!-- 配置分机组 -->
+    <el-dialog v-model="state.dialogVisible" draggable :title="dialogTitle" width="500px">
+      <el-form :model="state.ruleForm" label-width="100px" ref="ruleFormRef">
+        <el-form-item label="分机组" prop="obj" :rules="[{ required: true, message: '请选择分机组', trigger: 'change' }]">
+          <el-select v-model="state.ruleForm.obj" placeholder="请选择分机组" class="w100" value-key="groupId">
+            <el-option v-for="item in state.groupList" :key="item.groupId" :label="item.groupName" :value="item" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+				<span class="dialog-footer">
+					<el-button @click="state.dialogVisible = false" class="default-button">取 消</el-button>
+					<el-button type="primary" @click="save(ruleFormRef)" :loading="state.loading">保 存</el-button>
+				</span>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+<script setup lang="ts" name="deviceGroup">
+import {onMounted, reactive,ref} from "vue";
+import {auth} from "/@/utils/authFunction";
+import {ElMessage, FormInstance} from "element-plus";
+import {getGroupList,getTelsListWex,editWexGroup} from "/@/api/device/group";
+import {throttle} from "/@/utils/tools";
+
+
+// 定义变量内容
+const state = reactive<any>({
+  loading: false, // 加载状态
+  queryParams: {
+    // 查询参数
+    pageIndex: 1, // 当前页码
+    pageSize: 10, // 每页条数
+    TelNo:'', // 分机号
+  },
+  total:0, // 总条数
+  tableData: [],  // 表格数据
+  dialogVisible: false, // 弹窗显示隐藏
+  ruleForm:{ // 表单数据
+    obj:{}
+  },
+  groupList:[], // 分机组列表
+  currentRow:{}, // 当前行数据
+});
+const dialogTitle = ref('配置分机组');
+const ruleFormRef = ref<RefType>();  // 表单ref
+const searchFormRef = ref<RefType>();  // 表单ref
+/** 搜索按钮操作 节流操作 */
+const handleQuery = throttle(() => {
+  state.queryParams.PageIndex = 1;
+  queryList();
+}, 500);
+/** 重置按钮操作 */
+const resetQuery = throttle((formEl: FormInstance | undefined) => {
+  if (!formEl) return;
+  formEl.resetFields();
+  handleQuery();
+}, 500);
+/** 获取分机组设置 */
+const queryList = () => {
+  if (!auth('device:group:query')) ElMessage.error('抱歉,您没有权限查看分机组设置!');
+  else {
+    state.loading = true;
+    getTelsListWex(state.queryParams)
+        .then((response: any) => {
+          state.tableData = response.result?.items ?? [];
+          state.total = response.result.total ?? 0;
+          state.loading = false;
+        })
+        .catch(() => {
+          state.loading = false;
+        });
+  }
+};
+// 修改分机组
+const onEditGroup = async (row:any)=>{
+  try {
+    state.currentRow = row;
+    const response = await getGroupList();
+    state.groupList = response.result ?? [];
+    state.dialogVisible = true;
+  }catch (e) {
+    console.log(e);
+  }
+}
+// 保存分机组
+const save = (formEl: FormInstance | undefined) => {
+  if (!formEl) return;
+  formEl.validate((valid: boolean) => {
+    if (!valid) return;
+    const params = {
+      groupId:state.ruleForm.obj.groupId,
+      telNo:state.currentRow.telNo,
+      id:state.currentRow.id,
+      groupName:state.ruleForm.obj.groupName,
+      zuoGroupName:state.currentRow.groupName,
+    }
+    editWexGroup(params)
+        .then(() => {
+          ElMessage.success('保存成功!');
+          state.dialogVisible = false;
+          queryList();
+        })
+        .catch(() => {
+          state.loading = false;
+        });
+  })
+};
+onMounted(() => {
+  queryList();
+})
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 5 - 5
src/views/home/index.vue

@@ -448,19 +448,19 @@ const customEntry = () => {
 const linkList = ()=>{
   switch (activeName.value) {
     case '0': // 工单待办
-      router.push('/business/backlog')
+      router.push('/business/order/backlog')
       break;
     case '1': // 延期待办
-      router.push('/business/delay')
+      router.push('/business/delay/backlog')
       break;
     case '2': //甄别待办
-      router.push('/business/screen')
+      router.push('/business/discern/backlog')
       break;
     case '3': // 退回待办
-      router.push('/business/order/index')
+      router.push('/business/return/backlog')
       break;
     case '4': // 发布待办
-      router.push('/business/release')
+      router.push('/business/followUp/backlog')
       break;
     case '5': // 回访待办
       router.push('/business/followUp')

+ 8 - 4
src/views/system/parameter/component/Parameter-add.vue

@@ -39,7 +39,7 @@
 			<template #footer>
 				<span class="dialog-footer">
 					<el-button @click="onCancel" class="default-button">取 消</el-button>
-					<el-button type="primary" @click="onSubmit(ruleFormRef)" :loading="loading">确 定</el-button>
+					<el-button type="primary" @click="onSubmit(ruleFormRef)" :loading="loading" v-auth="'system:parameter:add'">确 定</el-button>
 				</span>
 			</template>
 		</el-dialog>
@@ -97,12 +97,16 @@ const onSubmit = throttle(async (formEl: FormInstance | undefined) => {
 					message: '保存成功',
 					type: 'success',
 				});
-				loading.value = false;
-				closeDialog();
 				emit('updateList');
 			})
-			.catch(() => {
+			.catch((error) => {
 				// 新增失败
+				ElMessage({
+					message: `保存失败: ${error.message}`,
+					type: 'error',
+				});
+			})
+			.finally(() => {
 				loading.value = false;
 				closeDialog();
 			});

+ 1 - 1
src/views/system/parameter/component/Parameter-edit.vue

@@ -45,7 +45,7 @@
 			<template #footer v-if="!state.isDisabled">
 				<span class="dialog-footer">
 					<el-button @click="onCancel" class="default-button">取 消</el-button>
-					<el-button type="primary" @click="onSubmit(ruleFormRef)" :loading="loading">确 定</el-button>
+					<el-button type="primary" @click="onSubmit(ruleFormRef)" :loading="loading" v-auth="'system:parameter:edit'">确 定</el-button>
 				</span>
 			</template>
 		</el-dialog>

+ 2 - 2
src/views/system/parameter/index.vue

@@ -14,7 +14,7 @@
 				</el-form-item>
 			</el-form>
 			<div class="mb20">
-				<el-button type="primary" @click="addParameter" v-waves v-auth="'system:timeLimit:add'">
+				<el-button type="primary" @click="addParameter" v-waves v-auth="'system:parameter:add'">
 					<SvgIcon name="ele-Plus" class="mr5" />新增
 				</el-button>
 			</div>
@@ -38,7 +38,7 @@
 				<el-table-column prop="sort" label="排序" show-overflow-tooltip width="60"></el-table-column>
 				<el-table-column label="操作" width="200" fixed="right" align="center">
 					<template #default="{ row }">
-						<el-button link type="primary" @click="updateParameter(row)" v-auth="'system:timeLimit:edit'" title="修改参数"> 修改 </el-button>
+						<el-button link type="primary" @click="updateParameter(row)" v-auth="'system:parameter:edit'" title="修改参数"> 修改 </el-button>
 						<el-button link type="info" @click="viewParameter(row)" v-auth="'system:timeLimit:detail'" title="查看详情"> 查看 </el-button>
 						<!--              <el-button link type="danger" @click="parameterDelete(row)" v-auth="'system:timeLimit:detail'" title="删除参数"> 删除 </el-button>-->
 					</template>