|
|
|
@ -37,7 +37,13 @@
|
|
|
|
|
<div class="avue-crud__header"> |
|
|
|
|
<!-- 头部左侧按钮模块 --> |
|
|
|
|
<div class="avue-crud__left"> |
|
|
|
|
<el-button type="primary" icon="Edit" v-if="ButtonPermissions.add">创建工单</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
icon="Edit" |
|
|
|
|
v-if="ButtonPermissions.add" |
|
|
|
|
@click="CreateworkOrder" |
|
|
|
|
>创建工单</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="primary" icon="Download" v-if="ButtonPermissions.export_Report" |
|
|
|
|
>Excel导出</el-button |
|
|
|
|
> |
|
|
|
@ -91,7 +97,7 @@
|
|
|
|
|
<el-tooltip content="表格设置" placement="bottom"> |
|
|
|
|
<el-button icon="Operation" @click="showdrawer(true)" circle></el-button> |
|
|
|
|
</el-tooltip> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-tooltip content="高级搜索" placement="bottom"> |
|
|
|
|
<el-button icon="Search" @click="searchHide" circle></el-button> |
|
|
|
|
</el-tooltip> |
|
|
|
@ -114,7 +120,7 @@
|
|
|
|
|
> |
|
|
|
|
<template #default="slotProps"> |
|
|
|
|
<template v-if="slotProps.scope.column.label === '异常工单号'"> |
|
|
|
|
<el-text class="el_textBtn" @click="InformationViewing(slotProps.scope)"> |
|
|
|
|
<el-text class="el_textBtn" @click="ViewDetailsRow(slotProps.scope.row)"> |
|
|
|
|
{{ |
|
|
|
|
slotProps.scope.column.label === '异常工单号' |
|
|
|
|
? slotProps.scope.row.workOrderNumber |
|
|
|
@ -124,7 +130,7 @@
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template v-if="slotProps.scope.column.label === '操作'"> |
|
|
|
|
<el-text>查看</el-text> |
|
|
|
|
<el-text @click="ViewDetails(slotProps.scope.row)">查看</el-text> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</tablecmt> |
|
|
|
@ -629,13 +635,15 @@ const timesc = (index, row) => {
|
|
|
|
|
if (!index) { |
|
|
|
|
delete details.query[row.prop]; |
|
|
|
|
} |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 表格表头下拉框选择 */ |
|
|
|
|
const selectsc = (index, row) => { |
|
|
|
|
processRowPropertyName(index, row, details.query); |
|
|
|
|
onLoad(); |
|
|
|
|
let _Obj = MatchCurrentMenu(); //匹配出当前菜单 |
|
|
|
|
_Obj.request = true; //更新请求状态 |
|
|
|
|
_Obj.query = details.query; |
|
|
|
|
processRowPropertyName(index, row, _Obj.query); |
|
|
|
|
PublicDataRequest(TabPermissions.value); //获取页面数据 |
|
|
|
|
}; |
|
|
|
|
/** 表格表头复选框选择 */ |
|
|
|
|
const selectionChange = list => { |
|
|
|
@ -690,6 +698,48 @@ const autoscaling = () => {
|
|
|
|
|
const _node = document.querySelector('.tableNode'); |
|
|
|
|
setNodeHeight(_node, '', true); |
|
|
|
|
}; |
|
|
|
|
/** |
|
|
|
|
* 该函数将 columnList - columnList10 等十一个表头对象的 |
|
|
|
|
* checkarr 属性赋值为对应的字典数组 |
|
|
|
|
* @param {Array} columnLists - 一个包含 columnList - columnList10 等十一个对象的数组 |
|
|
|
|
* @param {Object} propToDictionaryMap - 一个对象,键为 columnList 对象的 prop 属性,值为对应的字典数组 |
|
|
|
|
*/ |
|
|
|
|
const SelectionInitialization = () => { |
|
|
|
|
const columnLists = [ |
|
|
|
|
columnList, |
|
|
|
|
columnList1, |
|
|
|
|
columnList2, |
|
|
|
|
columnList3, |
|
|
|
|
columnList4, |
|
|
|
|
columnList5, |
|
|
|
|
columnList6, |
|
|
|
|
columnList7, |
|
|
|
|
columnList8, |
|
|
|
|
columnList9, |
|
|
|
|
columnList10, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
// 定义一个映射对象,用于替代 if-else 判断 |
|
|
|
|
const propToDictionaryMap = { |
|
|
|
|
workOrderTypeNameS: dictionaries.pc_work_order.value, |
|
|
|
|
discoveryNodeNameS: dictionaries.pc_discovery_node.value, |
|
|
|
|
workOrderStatusNameS: dictionaries.work_order_status.value, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const functionIF = item => { |
|
|
|
|
// 缓存过滤结果 |
|
|
|
|
const filteredData = item.filter(item => item.type === 3); |
|
|
|
|
|
|
|
|
|
filteredData.forEach(item => { |
|
|
|
|
const checkarr = propToDictionaryMap[item.prop]; |
|
|
|
|
if (checkarr) { |
|
|
|
|
item.checkarr = checkarr; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
columnLists.forEach(functionIF); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 描述: 初始化字典,包含角色信息、异常类型、发现环节、工单状态,。 |
|
|
|
@ -747,26 +797,27 @@ const Roleverification = () => {
|
|
|
|
|
}; |
|
|
|
|
onMounted(() => { |
|
|
|
|
autoscaling(); |
|
|
|
|
}) |
|
|
|
|
// 页面初始化请求 |
|
|
|
|
const onLoad = () => {}; |
|
|
|
|
}); |
|
|
|
|
/** |
|
|
|
|
*页面初始化函数,包含字典,等必要请求 |
|
|
|
|
*/ |
|
|
|
|
const PageOnlaod = async () => { |
|
|
|
|
PageLoading.value = true; |
|
|
|
|
try { |
|
|
|
|
await Dictionaryrequest(); //初始化字典 |
|
|
|
|
await Roleverification(); //获取角色信息 |
|
|
|
|
PublicDataRequest(TabPermissions.value); //获取页面数据 |
|
|
|
|
// 并行执行异步请求 |
|
|
|
|
await Promise.all([ |
|
|
|
|
Dictionaryrequest(), // 初始化字典 |
|
|
|
|
Roleverification(), // 获取角色信息 |
|
|
|
|
SelectionInitialization(), // 下拉框初始化赋值 |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
// 获取页面数据 |
|
|
|
|
PublicDataRequest(TabPermissions.value); |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log(error); |
|
|
|
|
} finally { |
|
|
|
|
PageLoading.value = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PageLoading.value = false; |
|
|
|
|
console.log(Useridentity, 'Useridentity'); |
|
|
|
|
console.log('外部执行完毕'); |
|
|
|
|
console.log(dictionaries); |
|
|
|
|
}; |
|
|
|
|
// 页面初始化 |
|
|
|
|
PageOnlaod(); |
|
|
|
@ -795,11 +846,13 @@ const PagingDataProcessing = () => {
|
|
|
|
|
* @return {void} 无返回值 |
|
|
|
|
*/ |
|
|
|
|
const tabChenge = async (value, Reset) => { |
|
|
|
|
PageLoading.value = true; // 开启loading |
|
|
|
|
let _Obj = await MatchCurrentMenu(); //匹配出上一个菜单 |
|
|
|
|
_Obj.query = await deepClone(details.query); //把上一个菜单的搜索条件缓存起来 |
|
|
|
|
TabPermissions.value = value; //记录最新的菜单 |
|
|
|
|
PublicDataRequest(value, Reset); //请求数据 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const PublicDataRequest = async (value, Reset) => { |
|
|
|
|
try { |
|
|
|
|
await MenuHeaderProcessing(value); // 处理头部菜单 |
|
|
|
@ -807,6 +860,7 @@ const PublicDataRequest = async (value, Reset) => {
|
|
|
|
|
// 判断是否需要请求数据{_state}返回true表示需要false表示不需要 |
|
|
|
|
let _state = PagingDataProcessing(); |
|
|
|
|
if (!_state) { |
|
|
|
|
PageLoading.value = false; // 关闭oading |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
PageLoading.value = true; // 开启loading |
|
|
|
@ -1095,20 +1149,56 @@ const Publicaccessdata = async Reset => {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 异常工单号点击查看 |
|
|
|
|
const InformationViewing = val => { |
|
|
|
|
console.log(val, '当前行数据'); |
|
|
|
|
const workOrderInfoPath = '/aftersales/aftersalesWorkOrderInfo'; |
|
|
|
|
/** |
|
|
|
|
* |
|
|
|
|
* @description 创建工单 |
|
|
|
|
*/ |
|
|
|
|
const CreateworkOrder = () => { |
|
|
|
|
$router.push('/aftersales/aftersalesWorkOrderAdd'); |
|
|
|
|
}; |
|
|
|
|
/** |
|
|
|
|
* @description: 全部常工单号,跳转到详情信息页面 |
|
|
|
|
* @param {Object} row - 当前行数据 |
|
|
|
|
* @return {void} |
|
|
|
|
*/ |
|
|
|
|
const ViewDetails0 = row => { |
|
|
|
|
console.log(row, '当前行数据'); |
|
|
|
|
const workOrderInfoPath = '/aftersales/aftersalesWorkOrderInfo'; //跳转路径 |
|
|
|
|
const queryParams = { |
|
|
|
|
id: val.row.workOrderId, |
|
|
|
|
name: `${val.row.workOrderNumber}-信息查看`, |
|
|
|
|
warehouseId: val.row.warehouseId, |
|
|
|
|
workOrderNumber: val.row.workOrderNumber, |
|
|
|
|
businessId: val.row.businessId, |
|
|
|
|
RouteIndexs: TabPermissions.value, |
|
|
|
|
workOrderStatus: val.row.workOrderStatus, |
|
|
|
|
id: row.id, //异常工单ID |
|
|
|
|
name: `${row.workOrderNumber}-详情信息`, |
|
|
|
|
workOrderNumber: row.workOrderNumber, //异常工单号 |
|
|
|
|
RouteIndexs: TabPermissions.value, //当前菜单编号 |
|
|
|
|
workOrderStatus: row.workOrderStatus, //工单状态 |
|
|
|
|
}; |
|
|
|
|
$router.push({ path: workOrderInfoPath, query: { ...queryParams, id: val.row.id } }); |
|
|
|
|
$router.push({ path: workOrderInfoPath, query: { ...queryParams } }); |
|
|
|
|
}; |
|
|
|
|
// 全部异常工单号点击查看 |
|
|
|
|
const ViewDetailsRow = row => { |
|
|
|
|
console.log(row, '异常工单号点击查看详情当前行数据'); |
|
|
|
|
switch (TabPermissions.value) { |
|
|
|
|
case 0: |
|
|
|
|
ViewDetails0(row); |
|
|
|
|
break; |
|
|
|
|
case 1: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @description: 查看按钮 |
|
|
|
|
* @param {Object} row 当前行数据 |
|
|
|
|
* @return {void} 无返回值 |
|
|
|
|
*/ |
|
|
|
|
const ViewDetails = row => { |
|
|
|
|
console.log(row, '点击查看详情当前行数据'); |
|
|
|
|
switch (TabPermissions.value) { |
|
|
|
|
case 0: |
|
|
|
|
ViewDetails0(row); //全部 |
|
|
|
|
break; |
|
|
|
|
case 1: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|