Browse Source

修复按钮权限判断问题

pre-production
马远东 1 year ago
parent
commit
728630acc5
  1. 365
      src/views/aftersales/aftersalesWorkOrder.vue
  2. 4
      src/views/aftersales/aftersalesWorkOrderAdd.vue
  3. 2129
      src/views/aftersales/aftersalesWorkOrderInfoTemp.vue
  4. 2
      src/views/aftersales/aftersalesWorkOrderend.vue

365
src/views/aftersales/aftersalesWorkOrder.vue

@ -188,7 +188,7 @@
<!-- 处理结果确定和处理完毕 -->
<el-button
v-if="
TabPermissions == '1' && slotProps.scope.row.workOrderStatus!='30'
TabPermissions == '2' && slotProps.scope.row.workOrderStatus!='30'
"
@click="DetermineStorage(slotProps.scope)"
>确定</el-button
@ -807,7 +807,7 @@ const details = reactive({
search: false,
/** 表格搜索条件 */
query: {
workOrderStatus: null,
workOrderStatus:UserPermissions.value == '仓库客服' ? '1000':'',
},
/** 时间快捷选择设置 */
shortcuts: [
@ -1115,55 +1115,8 @@ const TransportLossNode = ref([
{ label: '安装环节', value: 6 },
]);
//
const IndexTable = val => {
ClaimStatus.value = false;
AppealStatus.value = false; //
TimeoutStatus.value = false; //
// ProcessingPartyState.value = false; //
details.loadingObj.list = true; //
columnList[2].checkarr = []; //
columnList[3].checkarr = [];
columnList[10].checkarr=[]
updateDictionary(columnList[2].checkarr, 'pc_work_order'); //
updateDictionary(columnList[3].checkarr, 'pc_discovery_node'); //
updateDictionary(columnList[10].checkarr, 'work_order_status'); //
getDictionaryBiz('after_sales_visits').then(res => {
console.log(res, '角色字典');
const matchingItem = res.data.data.find(
item => item.dictValue == JSON.parse(localStorage.getItem('TWMS-userInfo')).content.role_name
);
if (matchingItem) {
console.log(TabList.value, '导航');
UserPermissions.value = matchingItem.dictValue;
console.log(matchingItem.dictValue, '角色');
if (matchingItem.dictValue != '仓库客服') {
TabList.value[2].state = false;
} else {
TabList.value[2].state = true;
}
} else {
TabList.value[2].state = true;
UserPermissions.value = '仓库客服';
}
console.log(UserPermissions.value, '当前角色权限');
let data = {
workOrderStatus:TabPermissions.value == '0' && UserPermissions.value == '仓库客服' ? '1000' : null, //
...val, //
current: page.value.currentPage, //
size: page.value.pageSize, //
};
$_getList(data).then(res => {
Tableheaderswitching(columnList);
console.log(res, '初始化返回值');
details.loadingObj.list = false; //
console.log(columnList[17].checkarr,'工单状态12312421');
if (res.data.data) {
page.value.total = res.data.data.total; //
if (res.data.data.records.length) {
res.data.data.records.forEach(item => {
const Statusprocessing=(val)=>{
val.forEach(item => {
console.log(item, 'item');
// null
// for (const property in item) {
@ -1225,6 +1178,55 @@ const IndexTable = val => {
item.workOrderStatusNameS = columnList[10].checkarr[10].label; //
}
});
}
//
const IndexTable = val => {
console.log(val,'接收的搜索参数');
console.log(data.workOrderStatus,'当前搜状态');
ClaimStatus.value = false;
AppealStatus.value = false; //
TimeoutStatus.value = false; //
// ProcessingPartyState.value = false; //
details.loadingObj.list = true; //
columnList[2].checkarr = []; //
columnList[3].checkarr = [];
columnList[10].checkarr=[]
updateDictionary(columnList[2].checkarr, 'pc_work_order'); //
updateDictionary(columnList[3].checkarr, 'pc_discovery_node'); //
updateDictionary(columnList[10].checkarr, 'work_order_status'); //
getDictionaryBiz('after_sales_visits').then(res => {
console.log(res, '角色字典');
const matchingItem = res.data.data.find(
item => item.dictValue == JSON.parse(localStorage.getItem('TWMS-userInfo')).content.role_name
);
if (matchingItem) {
console.log(TabList.value, '导航');
UserPermissions.value = matchingItem.dictValue;
console.log(matchingItem.dictValue, '角色');
if (matchingItem.dictValue != '仓库客服') {
TabList.value[2].state = false;
} else {
TabList.value[2].state = true;
}
} else {
TabList.value[2].state = true;
UserPermissions.value = '仓库客服';
}
console.log(UserPermissions.value, '当前角色权限');
let data = {
// workOrderStatus:TabPermissions.value == '0' && UserPermissions.value == '' ? '1000' : val.workOrderStatus, //
...val, //
current: page.value.currentPage, //
size: page.value.pageSize, //
};
$_getList(data).then(res => {
Tableheaderswitching(columnList);
console.log(res, '初始化返回值');
details.loadingObj.list = false; //
if (res.data.data) {
page.value.total = res.data.data.total; //
if (res.data.data.records.length) {
Statusprocessing(res.data.data.records)
details.data = res.data.data.records;
} else {
details.data = res.data.data.records;
@ -1244,7 +1246,6 @@ const Tableheaderswitching = val => {
//
const OnLoad = () => {
//
userInfo.value = JSON.parse(localStorage.getItem('TWMS-userInfo')); //
Mydata.value = JSON.parse(localStorage.getItem('my_data')); //
currentUser.value = Mydata.value.id;
@ -1261,7 +1262,8 @@ const OnLoad = () => {
console.log(data, '要提交的数据');
updateDictionary(columnList[2].checkarr, 'pc_work_order'); //
updateDictionary(columnList[3].checkarr, 'pc_discovery_node'); //
IndexTable();
// details.query.workOrderStatus=UserPermissions.value == '' ? '1000':details.query.workOrderStatus;//
IndexTable(details.query);
getDeptWarehouse({}).then(res => {
res.data.data.forEach(item => {
warehouseData.value.push({
@ -1288,22 +1290,6 @@ function updateDictionary(targetArray, dictionaryType) {
//
const AddInfo = () => {
$router.push('/aftersales/aftersalesWorkOrderAdd');
// Indexform.value = {}; //
// IndexException.value = [];
// DiscoveringNodes.value = [];
// // Indexdialog.value = true; //
// FromDisabled.value = false; //
// updateDictionary(IndexException.value, 'pc_work_order'); //
// updateDictionary(DiscoveringNodes.value, 'pc_discovery_node'); //
// getDeptWarehouse({}).then(res => {
// console.log(res, '');
// res.data.data.forEach(item => {
// warehouseData.value.push({
// value: item.id,
// label: item.name,
// });
// });
// });
};
//
const beforeAvatarUpload = rawFile => {
@ -1353,7 +1339,6 @@ const ConfirmForm = () => {
typesOf: 1,
});
});
// processorEntityList.push(ResponsibleParty);
console.log(processorEntityList, 'processorEntityList');
let DataSubmit = { ...Indexform.value }; //
@ -1362,7 +1347,6 @@ const ConfirmForm = () => {
delete DataSubmit.processor; //
console.log(DataSubmit, '处理好的表单信息');
console.log(warehouseData.value, 'warehouseData.value');
Indexdialog.value = false; //
$_submit(DataSubmit).then(res => {
if (res.data.code == 200) {
@ -1683,7 +1667,6 @@ const DetermineClaims=(val)=>{
workOrderStatus:30
}
details.loadingObj.list = true; //
console.log(data,'处理好的值');
$_settlementUpdate(data).then(res=>{
console.log(res);
@ -1811,66 +1794,64 @@ const Appealbutton = state => {
}
};
//
const abnormalChange = val => {
console.log(val);
StateType.value = false;
if (val == 1 || val == 2 || val == 3) {
SelectType.value = val;
} else {
StateType.value = true;
}
};
//
const DiscoveringNodesChange = val => {
groundlineSet.value = false; //线
if (val == 1 || val == 2 || val == 3 || val == 4 || val == 5) {
groundlineType.value = val; //线
} else {
groundlineSet.value = true; //
}
};
//
const handleRemove = (uploadFile, uploadFiles) => {
console.log(uploadFile, uploadFiles);
};
const handlePictureCardPreview = uploadFile => {
dialogImageUrl.value = uploadFile.url;
dialogVisible.value = true;
};
/** 表格表头输入框搜索 */
const inputsc = (index, row) => {
processRowProperty(index, row, details);
details.query[row.prop] = index;
console.log(details.query,'搜索参数');
if (TimeoutStatus.value) {
//
TimeoutHandling(details.query);
return;
if(TabPermissions.value == '4'){
//
settlementclaim(details.query);
return
}
if (AppealStatus.value) {
//
if(AppealStatusT.value && TabPermissions.value == '6'){
//
appealFn(details.query);
return;
return
}
if (ClaimStatus.value) {
//
settlementclaim(details.query);
return;
if(TabPermissions.value == '8'){
//
ProcessingPartyFun(details.query);
return
}
if (!ProcessingPartyState.value) {
IndexTable(details.query); //
console.log('首页');
} else {
ProcessingPartyFun(details.query); //
console.log('处理方');
if(TabPermissions.value == '7'){
TimeoutHandling(details.query);//
}
IndexTable(details.query); //
// =======
// if (TimeoutStatus.value) {
// //
// TimeoutHandling(details.query);
// return;
// }
// if (AppealStatus.value) {
// //
// appealFn(details.query);
// return;
// }
// if (ClaimStatus.value) {
// //
// settlementclaim(details.query);
// return;
// }
// if (!ProcessingPartyState.value) {
// IndexTable(details.query); //
// console.log('');
// } else {
// ProcessingPartyFun(details.query); //
// console.log('');
// }
};
//
const searchChange = () => {
@ -1890,6 +1871,7 @@ const searchChange = () => {
};
//
const empty = () => {
console.log(details.columnList);
details.columnList.forEach(item => {
item.values = '';
});
@ -1930,11 +1912,15 @@ const btnsc = val => {
/** 表格表头下拉框选择 */
const selectsc = (index, row) => {
processRowProperty(index, row, details);
console.log(details,'下拉的参数');
details.query.workOrderStatus = TabPermissions.value
if (TimeoutStatus.value) {
//
TimeoutHandling(details.query);
return;
}
if (AppealStatus.value) {
//
appealFn(details.query);
@ -1966,7 +1952,6 @@ const Antidictionary = (val, data) => {
});
};
function onLoad() {}
/** 表格表头复选框选择 */
const selectionChange = list => {
@ -2274,79 +2259,67 @@ const TimeoutHandling = val => {
};
//
const tabChenge = val => {
const tabChenge = (val,input) => {
TabPermissions.value = val; //
AppealStatusT.value = false; //
console.log(val, '触发了标签栏');
let data = {};
let data = {
...input,//
};
empty();
if (val == 0) {
ProcessingPartyState.value = false; //
ArbitrationStatus.value = true; //
if (UserPermissions.value == '仓库客服') {
if (UserPermissions.value == '仓库客服') {//
data.workOrderStatus = 1000;
details.query.workOrderStatus = 1000;
Tableheaderswitching(columnList);
IndexTable(data);
empty();
} else {
details.query.workOrderStatus = null;
Tableheaderswitching(columnList);
IndexTable();
empty();
console.log('全部');
}
} else if (val == 1) {
//
if (UserPermissions.value == '仓库客服') {
data.workOrderStatus = 20;
details.query.workOrderStatus = 20;
Tableheaderswitching(columnList);
empty();
IndexTable(data);
} else {
data.workOrderStatus = 40;
details.query.workOrderStatus = 40;
Tableheaderswitching(columnList);
empty();
IndexTable(data);
details.query.workOrderStatus = 40;
}
ProcessingPartyState.value = false; //
ArbitrationStatus.value = true; //
Tableheaderswitching(columnList);
IndexTable(data);
} else if (val == 2) {
console.log('处理完毕');
//
data.workOrderStatus = 30;
details.query.workOrderStatus = 30;
Tableheaderswitching(columnList);
empty();
IndexTable(data);
//
ProcessingPartyState.value = false; //
ArbitrationStatus.value = false; //
Tableheaderswitching(columnList);
IndexTable(data);
} else if (val == 3) {
//
console.log(UserPermissions.value, '当前身份');
console.log('待处理');
ProcessingPartyState.value = true; //
if (UserPermissions.value != '仓库客服') {
data.workOrderStatus = 500;
details.query.workOrderStatus = 500;
ArbitrationStatus.value = true; //
} else {
data.workOrderStatus = 10;
details.query.workOrderStatus = 10;
ArbitrationStatus.value = true; //
}
ArbitrationStatus.value = true; //
Tableheaderswitching(columnList);
empty();
IndexTable(data);
} else if (val == 4) {
//
ProcessingPartyState.value = false; //
//
details.query.workOrderStatus = null;
ArbitrationStatus.value = false; //
Tableheaderswitching(Claimsfield); //
empty();
settlementclaim();
} else if (val == 5) {
//
@ -2355,7 +2328,6 @@ const tabChenge = val => {
details.query.workOrderStatus = 70;
ArbitrationStatus.value = false; //
Tableheaderswitching(columnList); //
empty();
IndexTable(data);
} else if (val == 6) {
//
@ -2364,10 +2336,7 @@ const tabChenge = val => {
details.query.workOrderStatus = 80;
ArbitrationStatus.value = false; //
Tableheaderswitching(columnList); //
empty();
IndexTable(data);
console.log('执行了计算高度');
var bodyContent = document.querySelectorAll('.maboxhi');
const _height = getWinHight();
//
@ -2378,22 +2347,21 @@ const tabChenge = val => {
//
ProcessingPartyState.value = false; //
data.workOrderStatus = null;
details.query.workOrderStatus = '';
details.query.workOrderStatus = null;
ArbitrationStatus.value = false; //
Tableheaderswitching(timeoutList); //
empty();
TimeoutHandling(); //
} else if (val == 8) {
//
console.log('待回复');
if (UserPermissions.value == '仓库客服') {
data.workOrderStatus = '';
details.query.workOrderStatus = '';
//
data.workOrderStatus = null;
details.query.workOrderStatus = null;
Tableheaderswitching(columnList);
empty();
ProcessingPartyFun(data);
}
}
console.log('执行完毕');
};
/**
* 设置列表 -- 固定函数
@ -2417,12 +2385,13 @@ const showdrawer = _flag => {
details.drawerShow = _flag;
};
//
//
const ProcessingPartyFun = val => {
console.log('触发了待回复');
ClaimStatus.value = false; //
TimeoutStatus.value = false; //
AppealStatus.value = false; //
details.query.workOrderStatus = null;
// details.query.workOrderStatus = null;
details.loadingObj.list = true; //
let data = {
...val,
@ -2430,7 +2399,6 @@ const ProcessingPartyFun = val => {
console.log(val, 'val接收的参数');
columnList[2].checkarr = []; //
columnList[3].checkarr = [];
data.current = page.value.currentPage; //
data.size = page.value.pageSize; //
updateDictionary(columnList[2].checkarr, 'pc_work_order'); //
@ -2439,50 +2407,53 @@ const ProcessingPartyFun = val => {
details.loadingObj.list = false; //
page.value.total = res.data.data.total; //
if (res.data.data.records.length) {
res.data.data.records.forEach(item => {
// null
for (const property in item) {
if (item[property] == null) {
item[property] = '/';
}
}
//
if (item.workOrderType == 1) {
item.workOrderTypeNameS = columnList[2].checkarr[0].label; //
} else if (item.workOrderType == 2) {
item.workOrderTypeNameS = columnList[2].checkarr[1].label; //
} else if (item.workOrderType == 3) {
item.workOrderTypeNameS = columnList[2].checkarr[2].label; //
} else if (item.workOrderType == 4) {
item.workOrderTypeNameS = columnList[2].checkarr[3].label; //
} else if (item.workOrderType == 5) {
item.workOrderTypeNameS = columnList[2].checkarr[4].label; //
}
//
if (item.discoveryNode == 1) {
item.discoveryNodeNameS = columnList[3].checkarr[0].label; //
} else if (item.discoveryNode == 2) {
item.discoveryNodeNameS = columnList[3].checkarr[1].label; //
} else if (item.discoveryNode == 3) {
item.discoveryNodeNameS = columnList[3].checkarr[2].label; //线
} else if (item.discoveryNode == 4) {
item.discoveryNodeNameS = columnList[3].checkarr[3].label; //
} else if (item.discoveryNode == 5) {
item.discoveryNodeNameS = columnList[3].checkarr[4].label; //
} else if (item.discoveryNode == 6) {
item.discoveryNodeNameS = columnList[3].checkarr[5].label; //
} else if (item.discoveryNode == 7) {
item.discoveryNodeNameS = columnList[3].checkarr[6].label; //
} else if (item.discoveryNode == 8) {
item.discoveryNodeNameS = columnList[3].checkarr[7].label; //
}
});
Statusprocessing(res.data.data.records)
// res.data.data.records.forEach(item => {
// // null
// // for (const property in item) {
// // if (item[property] == null) {
// // item[property] = '/';
// // }
// // }
// //
// if (item.workOrderType == 1) {
// item.workOrderTypeNameS = columnList[2].checkarr[0].label; //
// } else if (item.workOrderType == 2) {
// item.workOrderTypeNameS = columnList[2].checkarr[1].label; //
// } else if (item.workOrderType == 3) {
// item.workOrderTypeNameS = columnList[2].checkarr[2].label; //
// } else if (item.workOrderType == 4) {
// item.workOrderTypeNameS = columnList[2].checkarr[3].label; //
// } else if (item.workOrderType == 5) {
// item.workOrderTypeNameS = columnList[2].checkarr[4].label; //
// }
// //
// if (item.discoveryNode == 1) {
// item.discoveryNodeNameS = columnList[3].checkarr[0].label; //
// } else if (item.discoveryNode == 2) {
// item.discoveryNodeNameS = columnList[3].checkarr[1].label; //
// } else if (item.discoveryNode == 3) {
// item.discoveryNodeNameS = columnList[3].checkarr[2].label; //线
// } else if (item.discoveryNode == 4) {
// item.discoveryNodeNameS = columnList[3].checkarr[3].label; //
// } else if (item.discoveryNode == 5) {
// item.discoveryNodeNameS = columnList[3].checkarr[4].label; //
// } else if (item.discoveryNode == 6) {
// item.discoveryNodeNameS = columnList[3].checkarr[5].label; //
// } else if (item.discoveryNode == 7) {
// item.discoveryNodeNameS = columnList[3].checkarr[6].label; //
// } else if (item.discoveryNode == 8) {
// item.discoveryNodeNameS = columnList[3].checkarr[7].label; //
// }
// });
details.data = res.data.data.records;
console.log(details.data, '存储的数据');
} else {
details.data = res.data.data.records; //
}
loading.value = false; //
}).catch(res=>{
loading.value = false; //
});
};

4
src/views/aftersales/aftersalesWorkOrderAdd.vue

@ -2070,4 +2070,8 @@ const isShowFormItem2 = computed(() => {
:deep(.el_inputTop) {
margin-bottom: 0 !important;
}
:deep(.el-form-item.is-required:not(.is-no-asterisk).asterisk-left > .el-form-item__label:before){
color: #ff0000;
}
</style>

2129
src/views/aftersales/aftersalesWorkOrderInfoTemp.vue

File diff suppressed because it is too large Load Diff

2
src/views/aftersales/aftersalesWorkOrderend.vue

@ -1897,7 +1897,7 @@ const submit = () => {
// ...info,
},
processingMoneyEntityList: [], //
// processingMoneyEntityList: [], //
};
data.id = $route.query.id;
data.aftersalesProcessingResultsDTO['workOrderId'] = $route.query.id; //ID

Loading…
Cancel
Save