diff --git a/src/api/HidePage/index.js b/src/api/HidePage/index.js new file mode 100644 index 00000000..c5d7704f --- /dev/null +++ b/src/api/HidePage/index.js @@ -0,0 +1,9 @@ +import request from '@/axios'; +// 数据修复 +export const $_syncUnloadData = data => { + return request({ + url: '/api/logpm-trunkline/carsLoad/syncUnloadData', + method: 'POST', + data, + }); +}; diff --git a/src/router/views/index.js b/src/router/views/index.js index c9ec91a4..43945738 100644 --- a/src/router/views/index.js +++ b/src/router/views/index.js @@ -1859,4 +1859,21 @@ export default [ }, ], }, + // 数据修复(进入页面自动执行) + { + path: '/HidePage/DataRecovery', + component: Layout, + redirect: '/HidePage/DataRecovery', + children: [ + { + meta: { + i18n: 'dict', + keepAlive: false, + }, + path: '/HidePage/DataRecovery', + name: '数据修复', + component: () => import('@/views/HidePage/DataRecovery.vue'), + }, + ], + }, ]; diff --git a/src/views/HidePage/DataRecovery.vue b/src/views/HidePage/DataRecovery.vue new file mode 100644 index 00000000..a68feea2 --- /dev/null +++ b/src/views/HidePage/DataRecovery.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/src/views/aftersales/aftersalesWorkOrderTemp.vue b/src/views/aftersales/aftersalesWorkOrderTemp.vue index fe8ef9af..383ae280 100644 --- a/src/views/aftersales/aftersalesWorkOrderTemp.vue +++ b/src/views/aftersales/aftersalesWorkOrderTemp.vue @@ -90,7 +90,7 @@ - + @@ -131,6 +131,30 @@ @@ -155,6 +179,59 @@ + + + +
+ + + + + + + + + + + + + + + + 取消 + 确定 + +
+
+
@@ -186,7 +263,9 @@ import { } from '@/utils/util'; import { ElMessageBox, ElMessage } from 'element-plus'; import { getDictionaryBiz } from '@/api/system/dict'; +import { getToken } from '@/utils/auth'; import dayjs from 'dayjs'; +import { getDetailWarehouse, getDeptWarehouse } from '@/api/basicdata/basicdataWarehouse'; //处理方 import { $_getList, $_submit, @@ -263,6 +342,19 @@ const tabValue = ref(0); //菜单激活 const UserPermissions = ref(''); //当前人身份 const workOrderStatus = ref(30); //工单状态 const PageLoading = ref(false); //页面loading +const warehouseData = ref([]); //仓库信息 +const UserInfo = ref({}); //登陆人信息 +const appeal = ref({ + dialogappeal: false, //工单申诉弹窗 + AppealeditorState: false, //申诉是否为编辑状态(默认否) + loadingappeal: false, //申诉弹窗loading + Appealselection: [], //申诉弹窗选中数据 + AppealAttachment: [], //申诉照片 + Reasonforappeal: '', //申诉原因 + selectList: [], //申诉列表 + selectionList: [], //要申诉的数据 +}); +const appealruleFormRef = ref(); const columnListName = ref('columnList'); const columnLists = [ 'columnList', @@ -325,7 +417,78 @@ const TabList = ref([ createTabItem(10, '申诉列表'), createTabItem(7, '超时未处理'), ]); - +/** + * @description 申诉按钮的逻辑 + * @returns {boolean} 是否显示申诉按钮 + */ +const WorkOrderAppealButton = () => { + // 如果是仓库客服角色 + if (UserPermissions.value == Useridentity.Warehouse_customer_service) { + // 并且当前标签是申诉列表 + if (TabPermissions.value == 6) { + // 则显示申诉按钮 + return true; + } + } + // 否则不显示申诉按钮 + return false; +}; +/** + * @description 取消申诉按钮的逻辑 + * @returns {boolean} 是否显示申诉按钮 + */ +const CancelAppealButton = () => { + // 如果是仓库客服角色 + if (UserPermissions.value == Useridentity.Warehouse_customer_service) { + // 并且当前标签是申诉列表 + if (TabPermissions.value == 10) { + // 则显示申诉按钮 + return true; + } + } + return false; +}; +/** + * @description 编辑申诉按钮的逻辑 + * @returns {boolean} 是否显示申诉编辑按钮 + */ +const AppealEditorButton = () => { + // 如果是仓库客服角色 + if (UserPermissions.value == Useridentity.Warehouse_customer_service) { + // 并且当前标签是申诉列表 + if (TabPermissions.value == 10) { + // 则显示申诉按钮 + return true; + } + } + return false; +}; +/** + * @description 编辑申诉按钮的逻辑 + * @returns {boolean} 是否显示申诉删除按钮 + */ +const Deleteappealbutton = () => { + // 如果是仓库客服角色 + if (UserPermissions.value == Useridentity.Warehouse_customer_service) { + // 并且当前标签是申诉列表 + if (TabPermissions.value == 10) { + // 则显示申诉按钮 + return true; + } + } + // 否则不显示申诉按钮 + return false; +}; +/** + * @description 操作栏按钮权限 + * @returns {boolean} 是否显示相关按钮 + */ +const PermissionButton = computed(row => ({ + Work_order_appeal: WorkOrderAppealButton(), + Cancel_appeal_button: CancelAppealButton(), + Appeal_editor_button: AppealEditorButton(), + Delete_appeal_button: Deleteappealbutton(), +})); const ButtonPermissions = computed(() => { // 根据 TabPermissions 的状态,决定每个按钮的显示隐藏逻辑 switch (TabPermissions.value) { @@ -609,7 +772,35 @@ const { recorddata, defaultTime2, } = toRefs(details); +watch( + () => $route.path, + (newPath, oldPath) => { + if ($useStore.state.isRefresh.refreshObj.aftersalesWorkOrder) { + TabPermissions.value = $useStore.state.Customer.Customerobj; + tabValue.value = $useStore.state.Customer.Customerobj; //菜单编号 + if ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].includes(TabPermissions.value)) { + let _Obj = MatchCurrentMenu(); //匹配出当前菜单 + _Obj.request = true; //更新请求状态 + PublicDataRequest(TabPermissions.value); //请求数据 + $useStore.commit('Customer_Menu', 0); //设置回初始值 + } + $useStore.commit('EDIT_REFRESHITEM', { title: 'aftersalesWorkOrder', status: false }); //重新缓存页面 + } + } +); +const appealrules = reactive({ + Reasonforappeal: [{ required: true, message: '请选择责任方', trigger: 'blur' }], + Appealselection: [{ required: true, message: '请填写申诉原因', trigger: 'blur' }], +}); +// 图片上传接口 +const doubledCount = computed(() => { + return '/api/blade-resource/oss/endpoint/put-file'; +}); +// 图片上传必须携带TOKEN +const headers = computed(() => { + return { 'Blade-Auth': 'Bearer ' + getToken() }; +}); /** 展开列表控件 */ const showdrawer = _flag => { details.drawerShow = _flag; @@ -617,7 +808,6 @@ const showdrawer = _flag => { /** 表格表头输入框搜索 */ const inputsc = (index, row) => { console.log(details.query, 'details.query'); - let _Obj = MatchCurrentMenu(); //匹配出当前菜单 _Obj.request = true; //更新请求状态 _Obj.query = details.query; @@ -665,12 +855,11 @@ const searchChangeS = () => { // 重置表格搜索 const ResetTableSearch = async () => { let _Obj = MatchCurrentMenu(); + console.log(TabPermissions.value, '123123123'); _Obj.request = true; + console.log(_Obj, 'Obj'); await handleClearTableQuery(details.columnListPublic); - let _query = await getQuery(); //查询条件 - console.log(_query, '查询条件'); - _Obj = {}; - _query = {}; + _Obj.query = {}; PublicDataRequest(TabPermissions.value, true); }; //清空 @@ -770,12 +959,15 @@ const Roleverification = () => { console.error('解析用户角色信息出错:', error); return; } + UserInfo.value = JSON.parse(userInfo); //存储一份登陆人信息 // 匹配用户角色 const matchingItem = dictionaries.after_sales_visits.value.find(item => roleNames.includes(item.label) ); // 更新用户权限 if (matchingItem) { + console.log(matchingItem, '匹配出来的角色'); + UserPermissions.value = matchingItem.label; } // 更新TabList的状态 @@ -798,18 +990,34 @@ const Roleverification = () => { onMounted(() => { autoscaling(); }); +/** + * 获取所有仓库信息 + */ +const GetWarehouse = () => { + getDeptWarehouse({}).then(res => { + res.data.data.forEach(item => { + warehouseData.value.push({ + value: item.id, + label: item.name, + disabled: item.name == localStorage.getItem('WarehouseName'), + }); + }); + }); +}; + /** *页面初始化函数,包含字典,等必要请求 */ const PageOnlaod = async () => { PageLoading.value = true; try { - // 并行执行异步请求 - await Promise.all([ - Dictionaryrequest(), // 初始化字典 - Roleverification(), // 获取角色信息 - SelectionInitialization(), // 下拉框初始化赋值 - ]); + await Dictionaryrequest(), // 初始化字典 + // 并行执行异步请求 + await Promise.all([ + Roleverification(), // 获取角色信息 + SelectionInitialization(), // 下拉框初始化赋值 + GetWarehouse(), //获取仓库 + ]); // 获取页面数据 PublicDataRequest(TabPermissions.value); @@ -896,6 +1104,9 @@ const PublicDataRequest = async (value, Reset) => { * @return {void} 无返回值 */ const Processingworkorderstatus = value => { + console.log(UserPermissions.value, 'UserPermissions.value'); + console.log(Useridentity.Warehouse_customer_service, 'Useridentity.Warehouse_customer_service'); + switch (value) { case 0: // 全部 workOrderStatus.value = @@ -915,7 +1126,7 @@ const Processingworkorderstatus = value => { workOrderStatus.value = 70; break; case 6: // 完结 - workOrderStatus.value = 90; + workOrderStatus.value = 80; break; case 9: // 待审核 workOrderStatus.value = @@ -931,8 +1142,8 @@ const updatePageDetails = (pageSize, currentPage) => { details.page.pageSize = pageSize; details.page.currentPage = currentPage; }; -const MatchCurrentMenu = () => { - return TabList.value.find(res => res.name == TabPermissions.value); +const MatchCurrentMenu = (ID =TabPermissions.value) => { + return TabList.value.find(res => res.name == ID); }; // 每页多少条 const sizeChange = value => { @@ -1157,13 +1368,213 @@ const CreateworkOrder = () => { $router.push('/aftersales/aftersalesWorkOrderAdd'); }; /** - * @description: 全部常工单号,跳转到详情信息页面 + * + * @description 工单申诉 + */ +const WorkOrderAppeal = async (row, state) => { + appeal.value.selectList = []; + appeal.value.AppealAttachment = []; //清空图片 + appeal.value.Appealselection = []; //清空责任人 + appeal.value.Reasonforappeal = ''; //清空申诉内容 + appeal.value.selectList.push(row); //存储当前申诉的对象 + console.log(appeal.value.selectList, 'appeal.value.selectList'); + + appeal.value.dialogappeal = true; //展开申诉编辑 + if (state == 'edit') { + // 当前是编辑申诉 + appeal.value.AppealeditorState = true; //开启申诉编辑状态 + console.log(row, 'row'); + + let data = { + id: row.id, + }; + await $_AppealDetails(data).then(res => { + console.log(res, '申诉编辑回显'); + appeal.value.Reasonforappeal = res.data.data.reason; //申诉原因 + setTimeout(() => { + if (res.data.data.peopleEntityList) { + appeal.value.Appealselection = res.data.data.peopleEntityList.map( + item => item.actualPersonId + ); + } + if (res.data.data.imagePath) { + appeal.value.AppealAttachment.push({ + url: res.data.data.imagePath, + }); + } + }, 0); + }); + return; + } + if (!state) { + appeal.value.AppealeditorState = false; //开启申诉编辑状态 + } +}; +// 工单申诉确认按钮 +const Appealbutton = async state => { + try { + await appealruleFormRef.value.validate(); + } catch (fields) { + return; + } + + const confirmResult = await ElMessageBox.confirm('是否确认发起工单申诉?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + }).catch(() => false); + + if (!confirmResult) { + return; + } + + if (appeal.value.AppealAttachment.length > 1) { + ElMessage({ + message: '只能上传一张图片', + type: 'warning', + }); + return; + } + + appeal.value.loadingappeal = true; + + let data = { + peopleEntityList: [], + imagePath: '', + workOrderId: '', + appealPeopleName: '', + }; + + data.reason = appeal.value.Reasonforappeal; + data.appealPeopleName = warehouseData.value + .filter(item => appeal.value.Appealselection.includes(item.value)) + .map(item => item.label) + .join(','); + + appeal.value.Appealselection.forEach(item => { + const selectedWarehouse = warehouseData.value.find(res => res.value === item); + data.peopleEntityList.push({ + workOrderId: appeal.value.selectList[0].id, + reason: appeal.value.Reasonforappeal, + claimant: UserInfo.value.content.user_name, + actualPersonId: selectedWarehouse.value, + actualPersonName: selectedWarehouse.label, + }); + }); + + data.workOrderId = appeal.value.AppealeditorState + ? appeal.value.selectList[0].workOrderId + : appeal.value.selectList[0].id; + + if (appeal.value.AppealeditorState) { + data.id = appeal.value.selectList[0].id; + } + + if (appeal.value.AppealAttachment.length > 0) { + const attachment = appeal.value.AppealAttachment[0]; + data.imagePath = attachment.response ? attachment.response.data.link : attachment.url; + } + + console.log(data, '处理好的值'); + + try { + const { data: response } = await $_appealSubmit(data); + const { code, msg } = response; + + if (code === 200) { + ElMessage({ + message: msg, + type: 'success', + }); + } + + appeal.value.dialogappeal = false; + const currentMenu = MatchCurrentMenu(); + currentMenu.request = true; + PublicDataRequest(TabPermissions.value); + } finally { + appeal.value.loadingappeal = false; + } +}; + +// 删除申诉记录 +const Deleteappealrecords = async row => { + ElMessageBox.confirm('是否删除当前记录?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + }) + .then(async () => { + try { + appeal.value.loadingappeal = true; + let data = { + ids: row.id, + }; + let _res = await $_getDetails(data); + if (_res.data.code == 200) { + ElMessage({ + message: '删除成功', + type: 'success', + }); + let _Obj = MatchCurrentMenu(); + _Obj.request = true; + PublicDataRequest(TabPermissions.value); //获取新数据 + } + } catch { + } finally { + appeal.value.loadingappeal = false; + } + }) + .catch(() => {}); +}; + +/** + * + * @description 工单取消申诉 + */ +const CancelWorkOrderAppeal = row => { + ElMessageBox.confirm('是否取消申诉?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + }) + .then(() => { + let data = { + id: row.id, //取消申诉ID + typesOf: '3', //申诉状态 + workOrderId: row.workOrderId, //异常工单ID + }; + PageLoading.value = true; + $_Cancelappeal(data) + .then(res => { + console.log(res, '取消申诉返回值'); + if (res.data.code == 200) { + let _Obj = MatchCurrentMenu(); + _Obj.request = true; + PublicDataRequest(TabPermissions.value); //获取新数据 + ElMessage({ + message: '取消申诉成功', + type: 'success', + }); + } + }) + .catch(error => { + console.log(error); + }) + .finally(() => { + PageLoading.value = false; + }); + }) + .catch(() => {}); +}; +/** + * @description: [全部]常工单号,跳转到详情信息页面 * @param {Object} row - 当前行数据 * @return {void} */ const ViewDetails0 = row => { console.log(row, '当前行数据'); - const workOrderInfoPath = '/aftersales/aftersalesWorkOrderInfo'; //跳转路径 + const workOrderInfoPath_Info = '/aftersales/aftersalesWorkOrderInfo'; //跳转路径 const queryParams = { id: row.id, //异常工单ID name: `${row.workOrderNumber}-详情信息`, @@ -1171,7 +1582,147 @@ const ViewDetails0 = row => { RouteIndexs: TabPermissions.value, //当前菜单编号 workOrderStatus: row.workOrderStatus, //工单状态 }; - $router.push({ path: workOrderInfoPath, query: { ...queryParams } }); + $router.push({ path: workOrderInfoPath_Info, query: { ...queryParams } }); +}; + +/** + * @description: [待回复]常工单号,跳转到详情信息页面 + * @param {Object} row - 当前行数据 + * @return {void} + */ +const ViewDetails8 = row => { + console.log(row, '当前行数据'); + const workOrderInfoPath_end = '/aftersales/aftersalesWorkOrderend'; //跳转路径 + const queryParams = { + id: row.id, //异常工单ID + name: `${row.workOrderNumber}-回复信息`, + workOrderNumber: row.workOrderNumber, //异常工单号 + RouteIndexs: TabPermissions.value, //当前菜单编号 + workOrderStatus: row.workOrderStatus, //工单状态 + }; + $router.push({ path: workOrderInfoPath_end, query: { ...queryParams } }); +}; +/** + * @description: [待回复]常工单号,跳转到详情信息页面 + * @param {Object} row - 当前行数据 + * @return {void} + */ +const ViewDetails3 = row => { + console.log(row, '【待回复】当前行数据'); + const workOrderInfoPath_end = '/aftersales/aftersalesWorkOrderend'; //跳转路径 + const queryParams = { + id: row.id, //异常工单ID + name: `${row.workOrderNumber}-处理结果`, + workOrderNumber: row.workOrderNumber, //异常工单号 + RouteIndexs: TabPermissions.value, //当前菜单编号 + workOrderStatus: row.workOrderStatus, //工单状态 + }; + $router.push({ path: workOrderInfoPath_end, query: { ...queryParams } }); +}; +/** + * @description: [处理中]常工单号,跳转到详情信息页面 + * @param {Object} row - 当前行数据 + * @return {void} + */ +const ViewDetails1 = row => { + console.log(row, '【处理中】当前行数据'); + const workOrderInfoPath_end = '/aftersales/aftersalesWorkOrderend'; //跳转路径 + const queryParams = { + id: row.id, //异常工单ID + name: `${row.workOrderNumber}-处理结果`, + workOrderNumber: row.workOrderNumber, //异常工单号 + RouteIndexs: TabPermissions.value, //当前菜单编号 + workOrderStatus: row.workOrderStatus, //工单状态 + }; + $router.push({ path: workOrderInfoPath_end, query: { ...queryParams } }); +}; +/** + * @description: [理赔金额未出]常工单号,跳转到详情信息页面 + * @param {Object} row - 当前行数据 + * @return {void} + */ +const ViewDetails4 = row => { + console.log(row, '【理赔金额未出】当前行数据'); + const workOrderInfoPath_end = '/aftersales/aftersalesWorkOrderend'; //跳转路径 + const queryParams = { + id: row.lawoId, //理赔金额未出的异常ID + subId: row.laprId, //修改处理结果提交需要的ID + name: `${row.workOrderNumber}-处理结果`, + workOrderNumber: row.workOrderNumber, //异常工单号 + RouteIndexs: TabPermissions.value, //当前菜单编号 + workOrderStatus: row.workOrderStatus, //工单状态 + businessId: row.businessId, //客服仲裁完结需要的ID(后期看情况可以删除) + }; + $router.push({ path: workOrderInfoPath_end, query: { ...queryParams } }); +}; + +/** + * @description: [处理完毕]常工单号,跳转到详情信息页面 + * @param {Object} row - 当前行数据 + * @return {void} + */ +const ViewDetails2 = row => { + console.log(row, '【处理完毕】当前行数据'); + const workOrderInfoPath_end = '/aftersales/aftersalesWorkOrderend'; //跳转路径 + const queryParams = { + id: row.id, //异常工单ID + name: `${row.workOrderNumber}-处理完毕`, + workOrderNumber: row.workOrderNumber, //异常工单号 + RouteIndexs: TabPermissions.value, //当前菜单编号 + workOrderStatus: row.workOrderStatus, //工单状态 + }; + $router.push({ path: workOrderInfoPath_end, query: { ...queryParams } }); +}; +/** + * @description: [客服介入]常工单号,跳转到详情信息页面 + * @param {Object} row - 当前行数据 + * @return {void} + */ +const ViewDetails5 = row => { + console.log(row, '【客服介入】当前行数据'); + const workOrderInfoPath_end = '/aftersales/aftersalesWorkOrderend'; //跳转路径 + const queryParams = { + id: row.id, //异常工单ID + name: `${row.workOrderNumber}-客服介入`, + workOrderNumber: row.workOrderNumber, //异常工单号 + RouteIndexs: TabPermissions.value, //当前菜单编号 + workOrderStatus: row.workOrderStatus, //工单状态 + }; + $router.push({ path: workOrderInfoPath_end, query: { ...queryParams } }); +}; +/** + * @description: [待审核]常工单号,跳转到详情信息页面 + * @param {Object} row - 当前行数据 + * @return {void} + */ +const ViewDetails9 = row => { + console.log(row, '【待审核】当前行数据'); + const workOrderInfoPath_end = '/aftersales/aftersalesWorkOrderend'; //跳转路径 + const queryParams = { + id: row.id, //异常工单ID + name: `${row.workOrderNumber}-待审核`, + workOrderNumber: row.workOrderNumber, //异常工单号 + RouteIndexs: TabPermissions.value, //当前菜单编号 + workOrderStatus: row.workOrderStatus, //工单状态 + }; + $router.push({ path: workOrderInfoPath_end, query: { ...queryParams } }); +}; +/** + * @description: [完结]常工单号,跳转到详情信息页面 + * @param {Object} row - 当前行数据 + * @return {void} + */ +const ViewDetails6 = row => { + console.log(row, '【完结】当前行数据'); + const workOrderInfoPath_end = '/aftersales/aftersalesWorkOrderend'; //跳转路径 + const queryParams = { + id: row.id, //异常工单ID + name: `${row.workOrderNumber}-完结`, + workOrderNumber: row.workOrderNumber, //异常工单号 + RouteIndexs: TabPermissions.value, //当前菜单编号 + workOrderStatus: row.workOrderStatus, //工单状态 + }; + $router.push({ path: workOrderInfoPath_end, query: { ...queryParams } }); }; // 全部异常工单号点击查看 const ViewDetailsRow = row => { @@ -1181,6 +1732,31 @@ const ViewDetailsRow = row => { ViewDetails0(row); break; case 1: + ViewDetails1(row); + break; + case 2: + ViewDetails2(row); + break; + case 3: + ViewDetails3(row); + break; + case 4: + ViewDetails4(row); + break; + case 5: + ViewDetails5(row); + break; + case 6: + ViewDetails6(row); + break; + case 8: + ViewDetails8(row); + break; + case 9: + ViewDetails9(row); + break; + + default: break; } }; @@ -1197,6 +1773,30 @@ const ViewDetails = row => { ViewDetails0(row); //全部 break; case 1: + ViewDetails1(row); + break; + case 2: + ViewDetails2(row); + break; + case 3: + ViewDetails3(row); + break; + case 4: + ViewDetails4(row); + break; + case 5: + ViewDetails5(row); + break; + case 6: + ViewDetails6(row); + break; + case 8: + ViewDetails8(row); + break; + case 9: + ViewDetails9(row); + break; + default: break; } }; @@ -1245,4 +1845,23 @@ const ViewDetails = row => { border-radius: 2px; } } +:deep(.el_appeal) { + .el-form-item { + flex-direction: column; + align-items: flex-start; + .el-form-item__label { + position: relative; + } + // .el-form-item__label::after { + // position: absolute; + // top: 0; + // left: -8px; + // content: '*'; + // width: 10px; + // } + .el-form-item__content { + width: 100% !important; + } + } +} diff --git a/vite.config.js b/vite.config.js index 9e69d510..591c0a8a 100644 --- a/vite.config.js +++ b/vite.config.js @@ -39,7 +39,7 @@ export default ({ mode, command }) => { // target: 'http://192.168.10.200:13000', // target: 'http://192.168.3.16:13000', // target: 'http://192.168.3.73:13000', // - // target: 'http://h5uapi.huitongys.com', + target: 'http://h5uapi.huitongys.com', // target: 'http://test.api.huo5u.com', changeOrigin: true, rewrite: path => path.replace(/^\/api/, ''),