Browse Source

修复测试bug

master
ljlong_2630 7 months ago
parent
commit
c180306a39
  1. 5
      src/api/eam/basic/fixedAssets/index.ts
  2. 8
      src/api/eam/mold/moldInspectionMain/index.ts
  3. 16
      src/views/eam/basic/fixedAssets/fixedAssets.data.ts
  4. 3
      src/views/eam/basic/moldMaintenance/index.vue
  5. 2
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  6. 60
      src/views/eam/device/devicemaintenancejob/index.vue
  7. 4
      src/views/eam/mold/moldinspectionjob/index.vue

5
src/api/eam/basic/fixedAssets/index.ts

@ -1,7 +1,7 @@
import request from '@/config/axios'
import { getStrDictOptions } from '@/utils/dict'
import { useUserStore } from '@/store/modules/user'
import { checkPermi } from '@/utils/permission'
export interface FixedAssetsVO {
number: string
name: string
@ -31,13 +31,12 @@ export const getFixedAssetsPage = async (params) => {
);
const admin = userStore.roles.find(role => {
if (role == 'gdzc_admin') {
if(checkPermi(['gdzc_admin'])){
return true;
} else {
return false;
}
});
// 如果找到了匹配的角色,将它作为manageDept的值加入到params中
if (matchingRole) {
params.manageDept = matchingRole; // 这里只添加第一个匹配的角色

8
src/api/eam/mold/moldInspectionMain/index.ts

@ -58,6 +58,12 @@ export const importTemplate = () => {
}
// 检修完成
export const finishInspection = (id: number) => {
return request.get({ url: `/eam/mold-inspection-job-main/orderClickFinish?id=` + id })
}
// 查询检修工单主列表
export const getMoldInspectionMainNoPage = async (params) => {
return await request.get({ url: `/eam/mold-inspection-job-main/noPage`, params })
@ -66,5 +72,5 @@ export const getMoldInspectionMainNoPage = async (params) => {
//验证
export const verifyOrder = async (id: number,verifyContent: string) => {
return await request.get({ url: `/eam/mold-inspection-job-main/onVerify?id=`+id+`&verifyContent=` + verifyContent })
return await request.get({ url: `/eam/mold-inspection-job-main/orderClickVerify?id=`+id+`&verifyContent=` + verifyContent })
}

16
src/views/eam/basic/fixedAssets/fixedAssets.data.ts

@ -3,9 +3,23 @@ import { dateFormatter } from '@/utils/formatTime'
import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator'
import * as LocationApi from '@/api/eam/basic/location'
import * as SupplierApi from '@/api/eam/basic/supplier'
import { useUserStore } from '@/store/modules/user'
import { checkPermi } from '@/utils/permission'
const localtionList = await LocationApi.getLocationNoPage()
const supplierList = await SupplierApi.getSupplierNoPage()
const userStore = useUserStore() // 用户信息
const admin = userStore.roles.find(role => {
if(checkPermi(['gdzc_admin'])){
return true;
} else {
return false;
}
});
const isAdmin = ref(false);
if (admin) {
isAdmin.value = true;
}
// 表单校验
export const FixedAssetsRules = reactive({
@ -151,7 +165,7 @@ export const FixedAssets = useCrudSchemas(reactive<CrudSchema[]>([
label: '管理部门',
field: 'manageDept',
sort: 'custom',
isForm: false,
isForm: isAdmin.value,
dictType: DICT_TYPE.SPECIAL_DEPT_ROLE,
dictClass: 'string',
table: {

3
src/views/eam/basic/moldMaintenance/index.vue

@ -239,14 +239,12 @@ const formsSuccess = async (formType,data) => {
openDataNew.value = data
if(judgeSame()){
basicFormRef.value.dialogVisible = false
getList()
}else{
updateData.value = data
dialogVisible.value = true
}
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
@ -309,6 +307,7 @@ const onSubmit = async () => {
message.success(t('common.delSuccess'))
dialogVisible.value = false;
}
getList()
} catch (error) {
console.error(error);
// basicFormRef

2
src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts

@ -235,7 +235,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
labelField: 'label',
valueField: 'value'
},
disabled: true,
// disabled: true,
filterable: true,
placeholder: "请选择设备"
}

60
src/views/eam/device/devicemaintenancejob/index.vue

@ -361,38 +361,18 @@ const judgeIsTheClass = (row) => {
}
}
const judgeIsTheFactory = (row) => {
return userStore.userSelfInfo.deptId == row.factoryAreaNumber
}
const judgeIsTheClassEngineer = (row) => {
const rolesOk = userStore.roles.find(item => {
if (row.type == 'DEVICE') {
return item == 'device_class_Engineer_role'
}else if (row.type == 'TECH') {
return item == 'tech_class_Engineer_role'
}
})
if (rolesOk != undefined && rolesOk != null) {
return true
} else {
return false
}
}
const judgeIsTheClassEngineerAndApply = (row,type) => {
//
// if (row.status === 'COMPLETED' && type == 'CONFIRM') {
if (row.status === 'COMPLETED') {
if (row.status === 'COMPLETED' && type == 'CONFIRM') {
// COMPLETEDrequestNumberdeclarer
if(row.requestNumber != null && row.requestNumber !== '' && row.declarer === userStore.getUser.id){
return true
}else{
return false
}
}else if(row.status === 'APPLYPASS' && type == 'VERIFY'){
return true
}
// COMPLETEDAPPLYPASSCOMPLETEDfalse
return false;
}
@ -452,7 +432,7 @@ const butttondata = (row) => {
defaultButtons.acceptOrderBtn({
hasPermi:'eam:device-maintenance-job-main:orderClick',
hide: !(
row.status == 'PENDING' && judgeIsTheFactory(row)
row.status == 'PENDING'
)
}), //
defaultButtons.turnOrderBtn({
@ -466,7 +446,7 @@ const butttondata = (row) => {
defaultButtons.verifyOrderBtn({
hasPermi:'eam:device-maintenance-job-main:orderClickVerify',
hide: !(
judgeIsTheClassEngineerAndApply(row,'VERIFY') && judgeIsTheFactory(row)
judgeIsTheClassEngineerAndApply(row,'VERIFY')
)
}), //
defaultButtons.finishOrderBtn({
@ -491,11 +471,11 @@ const onChange = (field, cur, item) => {
// console.log(item)
// console.log(item.componentProps.options)
formRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id)
if (judgeIfDeviceRole()) {
formRef.value.formRef.formModel.type = 'DEVICE'
} else {
formRef.value.formRef.formModel.type = 'TECH'
}
// if (judgeIfDeviceRole()) {
// formRef.value.formRef.formModel.type = 'DEVICE'
// } else {
// formRef.value.formRef.formModel.type = 'TECH'
// }
}
}
@ -1186,16 +1166,16 @@ const getActorClass = () => {
}
const judgeIfDeviceRole = () => {
const rolesOk = userStore.roles.find(item => {
return item == 'device_class_worker_role' || item == 'device_class_Engineer_role'
})
if (rolesOk != undefined && rolesOk != null) {
return true
} else {
return false
}
}
// const judgeIfDeviceRole = () => {
// const rolesOk = userStore.roles.find(item => {
// return item == 'device_class_worker_role' || item == 'device_class_Engineer_role'
// })
// if (rolesOk != undefined && rolesOk != null) {
// return true
// } else {
// return false
// }
// }
const validateRow = (row) => {
let flag = true;

4
src/views/eam/mold/moldinspectionjob/index.vue

@ -404,7 +404,7 @@ function handleFinishOrder(row) {
let param = {
masterId : row.id
}
DeviceInspectionDetailApi.getDeviceInspectionDetailPage(param
MoldInspectionDetailApi.getMoldInspectionDetailPage(param
).then(response => {
if (response != null) {
if (response.list.length == 0) {
@ -417,7 +417,7 @@ function handleFinishOrder(row) {
// message.error(t(''))
// return
// } else {
DeviceInspectionMainApi.finishInspection(row.id).then(res => {
MoldInspectionMainApi.finishInspection(row.id).then(res => {
message.success(t('common.finishSuccess'))
getList()
})

Loading…
Cancel
Save