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 request from '@/config/axios'
import { getStrDictOptions } from '@/utils/dict' import { getStrDictOptions } from '@/utils/dict'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { checkPermi } from '@/utils/permission'
export interface FixedAssetsVO { export interface FixedAssetsVO {
number: string number: string
name: string name: string
@ -31,13 +31,12 @@ export const getFixedAssetsPage = async (params) => {
); );
const admin = userStore.roles.find(role => { const admin = userStore.roles.find(role => {
if (role == 'gdzc_admin') { if(checkPermi(['gdzc_admin'])){
return true; return true;
} else { } else {
return false; return false;
} }
}); });
// 如果找到了匹配的角色,将它作为manageDept的值加入到params中 // 如果找到了匹配的角色,将它作为manageDept的值加入到params中
if (matchingRole) { if (matchingRole) {
params.manageDept = 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) => { export const getMoldInspectionMainNoPage = async (params) => {
return await request.get({ url: `/eam/mold-inspection-job-main/noPage`, 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) => { 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 { validateHanset,validateNumDot, validateEmail } from '@/utils/validator'
import * as LocationApi from '@/api/eam/basic/location' import * as LocationApi from '@/api/eam/basic/location'
import * as SupplierApi from '@/api/eam/basic/supplier' 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 localtionList = await LocationApi.getLocationNoPage()
const supplierList = await SupplierApi.getSupplierNoPage() 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({ export const FixedAssetsRules = reactive({
@ -151,7 +165,7 @@ export const FixedAssets = useCrudSchemas(reactive<CrudSchema[]>([
label: '管理部门', label: '管理部门',
field: 'manageDept', field: 'manageDept',
sort: 'custom', sort: 'custom',
isForm: false, isForm: isAdmin.value,
dictType: DICT_TYPE.SPECIAL_DEPT_ROLE, dictType: DICT_TYPE.SPECIAL_DEPT_ROLE,
dictClass: 'string', dictClass: 'string',
table: { table: {

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

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

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

@ -235,7 +235,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
labelField: 'label', labelField: 'label',
valueField: 'value' valueField: 'value'
}, },
disabled: true, // disabled: true,
filterable: true, filterable: true,
placeholder: "请选择设备" 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) => { const judgeIsTheClassEngineerAndApply = (row,type) => {
// //
// if (row.status === 'COMPLETED' && type == 'CONFIRM') { if (row.status === 'COMPLETED' && type == 'CONFIRM') {
if (row.status === 'COMPLETED') {
// COMPLETEDrequestNumberdeclarer // COMPLETEDrequestNumberdeclarer
if(row.requestNumber != null && row.requestNumber !== '' && row.declarer === userStore.getUser.id){ if(row.requestNumber != null && row.requestNumber !== '' && row.declarer === userStore.getUser.id){
return true return true
}else{ }else{
return false return false
} }
}else if(row.status === 'APPLYPASS' && type == 'VERIFY'){
return true
} }
// COMPLETEDAPPLYPASSCOMPLETEDfalse // COMPLETEDAPPLYPASSCOMPLETEDfalse
return false; return false;
} }
@ -452,7 +432,7 @@ const butttondata = (row) => {
defaultButtons.acceptOrderBtn({ defaultButtons.acceptOrderBtn({
hasPermi:'eam:device-maintenance-job-main:orderClick', hasPermi:'eam:device-maintenance-job-main:orderClick',
hide: !( hide: !(
row.status == 'PENDING' && judgeIsTheFactory(row) row.status == 'PENDING'
) )
}), // }), //
defaultButtons.turnOrderBtn({ defaultButtons.turnOrderBtn({
@ -466,7 +446,7 @@ const butttondata = (row) => {
defaultButtons.verifyOrderBtn({ defaultButtons.verifyOrderBtn({
hasPermi:'eam:device-maintenance-job-main:orderClickVerify', hasPermi:'eam:device-maintenance-job-main:orderClickVerify',
hide: !( hide: !(
judgeIsTheClassEngineerAndApply(row,'VERIFY') && judgeIsTheFactory(row) judgeIsTheClassEngineerAndApply(row,'VERIFY')
) )
}), // }), //
defaultButtons.finishOrderBtn({ defaultButtons.finishOrderBtn({
@ -491,11 +471,11 @@ const onChange = (field, cur, item) => {
// console.log(item) // console.log(item)
// console.log(item.componentProps.options) // console.log(item.componentProps.options)
formRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id) formRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id)
if (judgeIfDeviceRole()) { // if (judgeIfDeviceRole()) {
formRef.value.formRef.formModel.type = 'DEVICE' // formRef.value.formRef.formModel.type = 'DEVICE'
} else { // } else {
formRef.value.formRef.formModel.type = 'TECH' // formRef.value.formRef.formModel.type = 'TECH'
} // }
} }
} }
@ -1186,16 +1166,16 @@ const getActorClass = () => {
} }
const judgeIfDeviceRole = () => { // const judgeIfDeviceRole = () => {
const rolesOk = userStore.roles.find(item => { // const rolesOk = userStore.roles.find(item => {
return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' // return item == 'device_class_worker_role' || item == 'device_class_Engineer_role'
}) // })
if (rolesOk != undefined && rolesOk != null) { // if (rolesOk != undefined && rolesOk != null) {
return true // return true
} else { // } else {
return false // return false
} // }
} // }
const validateRow = (row) => { const validateRow = (row) => {
let flag = true; let flag = true;

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

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

Loading…
Cancel
Save