Browse Source

bug修复

master
ljlong_2630 7 months ago
parent
commit
935e5ea21e
  1. 8
      src/api/eam/basic/fixedAssets/index.ts
  2. 18
      src/views/eam/basic/classType/classType.data.ts
  3. 14
      src/views/eam/basic/fixedAssets/fixedAssets.data.ts
  4. 2
      src/views/eam/device/devicemaintenancejob/index.vue

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

@ -30,13 +30,7 @@ export const getFixedAssetsPage = async (params) => {
deviceMoldTypeList.some(deviceMold => deviceMold.value === role)
);
const admin = userStore.roles.find(role => {
if(checkPermi(['gdzc_admin'])){
return true;
} else {
return false;
}
});
const admin = checkPermi(['gdzc_admin']);
// 如果找到了匹配的角色,将它作为manageDept的值加入到params中
if (matchingRole) {
params.manageDept = matchingRole; // 这里只添加第一个匹配的角色

18
src/views/eam/basic/classType/classType.data.ts

@ -3,6 +3,7 @@ import { dateFormatter } from '@/utils/formatTime'
import * as deptApi from '@/api/system/dept'
import * as roleApi from '@/api/system/role'
import { Role } from '@/views/system/role/role.data'
import { selectAllFactoryArea } from '@/api/system/dept'
// 表单校验
export const ClassTypeRules = reactive({
workerRoleId: [required],
@ -12,6 +13,7 @@ export const ClassTypeRules = reactive({
})
const FactoryAreaNoPage = await deptApi.getDeptPage({'deptGroup':'factory'})
const roleList = await roleApi.getSimpleRoleList({})
const factoryList = await selectAllFactoryArea()
console.log('FactoryAreaNoPage',FactoryAreaNoPage);
console.log('roleList',roleList);
@ -51,7 +53,7 @@ console.log('roleList',roleList);
]))
export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '维修工角色id',
label: '维修工角色',
field: 'workerRoleId',
sort: 'custom',
form: {
@ -77,7 +79,7 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: '工程师角色id',
label: '工程师角色',
field: 'engineerRoleId',
sort: 'custom',
form: {
@ -123,6 +125,18 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
field: 'factoryAreaNumber',
isSearch: true,
sort: 'custom',
search: {
show: true,
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {

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

@ -9,17 +9,7 @@ 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;
}
const admin = checkPermi(['gdzc_admin']);
// 表单校验
export const FixedAssetsRules = reactive({
@ -165,7 +155,7 @@ export const FixedAssets = useCrudSchemas(reactive<CrudSchema[]>([
label: '管理部门',
field: 'manageDept',
sort: 'custom',
isForm: isAdmin.value,
isForm: admin,
dictType: DICT_TYPE.SPECIAL_DEPT_ROLE,
dictClass: 'string',
table: {

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

@ -600,7 +600,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
setV['factoryAreaNumber'] = newRow.value.factoryAreaNumber
setV['maintenance'] = newRow.value.maintenance
formRefSec.setValues(setV)
DeviceMaintenanceMainSecRules.maintenance = [{ required: true }]
DeviceMaintenanceMainSecRules.maintenance = [{ required: true,message:'请选择维修人' }]
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.disabled = true

Loading…
Cancel
Save