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) deviceMoldTypeList.some(deviceMold => deviceMold.value === role)
); );
const admin = userStore.roles.find(role => { const admin = checkPermi(['gdzc_admin']);
if(checkPermi(['gdzc_admin'])){
return true;
} else {
return false;
}
});
// 如果找到了匹配的角色,将它作为manageDept的值加入到params中 // 如果找到了匹配的角色,将它作为manageDept的值加入到params中
if (matchingRole) { if (matchingRole) {
params.manageDept = 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 deptApi from '@/api/system/dept'
import * as roleApi from '@/api/system/role' import * as roleApi from '@/api/system/role'
import { Role } from '@/views/system/role/role.data' import { Role } from '@/views/system/role/role.data'
import { selectAllFactoryArea } from '@/api/system/dept'
// 表单校验 // 表单校验
export const ClassTypeRules = reactive({ export const ClassTypeRules = reactive({
workerRoleId: [required], workerRoleId: [required],
@ -12,6 +13,7 @@ export const ClassTypeRules = reactive({
}) })
const FactoryAreaNoPage = await deptApi.getDeptPage({'deptGroup':'factory'}) const FactoryAreaNoPage = await deptApi.getDeptPage({'deptGroup':'factory'})
const roleList = await roleApi.getSimpleRoleList({}) const roleList = await roleApi.getSimpleRoleList({})
const factoryList = await selectAllFactoryArea()
console.log('FactoryAreaNoPage',FactoryAreaNoPage); console.log('FactoryAreaNoPage',FactoryAreaNoPage);
console.log('roleList',roleList); console.log('roleList',roleList);
@ -51,7 +53,7 @@ console.log('roleList',roleList);
])) ]))
export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '维修工角色id', label: '维修工角色',
field: 'workerRoleId', field: 'workerRoleId',
sort: 'custom', sort: 'custom',
form: { form: {
@ -77,7 +79,7 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
}, },
}, },
{ {
label: '工程师角色id', label: '工程师角色',
field: 'engineerRoleId', field: 'engineerRoleId',
sort: 'custom', sort: 'custom',
form: { form: {
@ -123,6 +125,18 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
field: 'factoryAreaNumber', field: 'factoryAreaNumber',
isSearch: true, isSearch: true,
sort: 'custom', sort: 'custom',
search: {
show: true,
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
},
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { 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 localtionList = await LocationApi.getLocationNoPage()
const supplierList = await SupplierApi.getSupplierNoPage() const supplierList = await SupplierApi.getSupplierNoPage()
const userStore = useUserStore() // 用户信息 const userStore = useUserStore() // 用户信息
const admin = userStore.roles.find(role => { const admin = checkPermi(['gdzc_admin']);
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({
@ -165,7 +155,7 @@ export const FixedAssets = useCrudSchemas(reactive<CrudSchema[]>([
label: '管理部门', label: '管理部门',
field: 'manageDept', field: 'manageDept',
sort: 'custom', sort: 'custom',
isForm: isAdmin.value, isForm: admin,
dictType: DICT_TYPE.SPECIAL_DEPT_ROLE, dictType: DICT_TYPE.SPECIAL_DEPT_ROLE,
dictClass: 'string', dictClass: 'string',
table: { 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['factoryAreaNumber'] = newRow.value.factoryAreaNumber
setV['maintenance'] = newRow.value.maintenance setV['maintenance'] = newRow.value.maintenance
formRefSec.setValues(setV) formRefSec.setValues(setV)
DeviceMaintenanceMainSecRules.maintenance = [{ required: true }] DeviceMaintenanceMainSecRules.maintenance = [{ required: true,message:'请选择维修人' }]
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).componentProps.disabled = true }).componentProps.disabled = true

Loading…
Cancel
Save