Browse Source

修复生产bug

master
ljlong_2630 1 month ago
parent
commit
169e9bb6d9
  1. 7
      src/api/eam/basic/item/index.ts
  2. 15
      src/api/eam/basic/location/index.ts
  3. 7
      src/api/eam/item/replaceItemDes/index.ts
  4. 12
      src/views/eam/basic/classType/classType.data.ts
  5. 11
      src/views/eam/item/applicationRecord/applicationRecordMain.data.ts
  6. 54
      src/views/eam/item/itemAccounts/itemAccounts.data.ts
  7. 7
      src/views/eam/item/itemApplyMain/itemApplyMain.data.ts
  8. 9
      src/views/eam/item/itemOutLocation/itemOutLocation.data.ts
  9. 28
      src/views/eam/item/replaceItemDes/index.vue

7
src/api/eam/basic/item/index.ts

@ -78,3 +78,10 @@ export const getItemList = async (params) => {
export const getItemNoPage = async (params) => { export const getItemNoPage = async (params) => {
return await request.get({ url: `/eam/item/noPage`, params }) return await request.get({ url: `/eam/item/noPage`, params })
} }
export const getItemNotInAccountSenior = async (params) => {
const data = {...params}
return await request.post({ url: `/eam/item/getItemNotInAccountSenior`, data })
}

15
src/api/eam/basic/location/index.ts

@ -59,3 +59,18 @@ export const selectPageByConditions = async (params) => {
return await request.get({ url: `/eam/location/selectPageByConditions`, params }) return await request.get({ url: `/eam/location/selectPageByConditions`, params })
} }
// 不在台账中的库位
export const getLocationNoInAccountPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: `/eam/location/getLocationNoInAccountSenior`, data })
} else {
return await request.get({ url: `/eam/location/getLocationNoInAccountPage`, params })
}
}

7
src/api/eam/item/replaceItemDes/index.ts

@ -19,7 +19,7 @@ export const getReplaceItemDesPage = async (params) => {
const data = {...params} const data = {...params}
return await request.post({ url: '/eam/attachment-file/senior', data }) return await request.post({ url: '/eam/attachment-file/senior', data })
} else { } else {
return await request.get({ url: `/eam/attachment-file/page`, params }) return await request.get({ url: `/eam/attachment-file/getGroupedAttachmentFiles`, params })
} }
} }
@ -31,12 +31,13 @@ export const getReplaceItemDes = async (id: number) => {
// 新增备件台账 // 新增备件台账
export const createReplaceItemDes = async (data: AttachmentFileVO) => { export const createReplaceItemDes = async (data: AttachmentFileVO) => {
data.funcCode = "Replace_Item_Des" data.funcCode = "Replace_Item_Des"
return await request.post({ url: `/eam/attachment-file/create`, data }) return await request.post({ url: `/eam/attachment-file/upload`, data })
} }
// 修改备件台账 // 修改备件台账
export const updateReplaceItemDes = async (data: AttachmentFileVO) => { export const updateReplaceItemDes = async (data: AttachmentFileVO) => {
return await request.put({ url: `/eam/attachment-file/update`, data }) data.funcCode = "Replace_Item_Des"
return await request.post({ url: `/eam/attachment-file/upload`, data })
} }
// 删除备件台账 // 删除备件台账

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

@ -4,6 +4,7 @@ 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' import { selectAllFactoryArea } from '@/api/system/dept'
import { useUserStore } from '@/store/modules/user'
// 表单校验 // 表单校验
export const ClassTypeRules = reactive({ export const ClassTypeRules = reactive({
workerRoleId: [required], workerRoleId: [required],
@ -11,9 +12,14 @@ export const ClassTypeRules = reactive({
type: [required], type: [required],
factoryAreaNumber: [required], factoryAreaNumber: [required],
}) })
const userStore = useUserStore()
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() const factoryList = await selectAllFactoryArea()
// 假设你想添加一个新的工厂区域
// const factoryList = [...factoryListResult, {
// ...userStore.userSelfInfo.dept
// }]
console.log('FactoryAreaNoPage',FactoryAreaNoPage); console.log('FactoryAreaNoPage',FactoryAreaNoPage);
console.log('roleList',roleList); console.log('roleList',roleList);
@ -53,7 +59,7 @@ console.log('roleList',roleList);
])) ]))
export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '维修工角色', label: '维修工角色编号',
field: 'workerRoleId', field: 'workerRoleId',
sort: 'custom', sort: 'custom',
form: { form: {
@ -79,7 +85,7 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
}, },
}, },
{ {
label: '工程师角色', label: '工程师角色编号',
field: 'engineerRoleId', field: 'engineerRoleId',
sort: 'custom', sort: 'custom',
form: { form: {
@ -121,7 +127,7 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
}, },
{ {
label: '所属厂区', label: '所属厂区编号',
field: 'factoryAreaNumber', field: 'factoryAreaNumber',
isSearch: true, isSearch: true,
sort: 'custom', sort: 'custom',

11
src/views/eam/item/applicationRecord/applicationRecordMain.data.ts

@ -32,7 +32,11 @@ export const ApplicationRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 180, width: 180,
}, },
isForm: false isForm: false,
detail: {
width: 180,
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
}, },
{ {
label: '申领人', label: '申领人',
@ -53,7 +57,10 @@ export const ApplicationRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 180, width: 180,
}, },
isForm: false isForm: false,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
}, },
{ {
label: '审批人', label: '审批人',

54
src/views/eam/item/itemAccounts/itemAccounts.data.ts

@ -1,6 +1,11 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { formatDate } from '@/utils/formatTime' import { Item, ItemRules } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
import { LocationArea, LocationAreaRules } from '../../basic/locationArea/locationArea.data'
import * as LocationAreaApi from '@/api/eam/basic/locationArea'
import { Location, LocationRules } from '../../basic/location/location.data'
import * as LocationApi from '@/api/eam/basic/location'
// 表单校验 // 表单校验
export const ItemAccountsRules = reactive({ export const ItemAccountsRules = reactive({
@ -19,23 +24,60 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([
width: 180, width: 180,
fixed: 'left' fixed: 'left'
}, },
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '备件', // 查询弹窗标题
searchAllSchemas: Item.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemNotInAccountSenior, // 查询弹窗所需分页方法
searchCondition: []
}
}
}, },
{ {
label: '库位编号', label: '库编号',
field: 'locationNumber', field: 'areaNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 110 width: 110
}, },
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '备件', // 查询弹窗标题
searchAllSchemas: LocationArea.allSchemas, // 查询弹窗所需类
searchPage: LocationAreaApi.getLocationAreaPage, // 查询弹窗所需分页方法
searchCondition: []
}
}
}, },
{ {
label: '库区编号', label: '库编号',
field: 'areaNumber', field: 'locationNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 110 width: 110
}, },
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '备件', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationNoInAccountPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'areaNumber',
value: 'areaNumber',
message: '请选择库区编号!',
isMainValue: true, // 拼接条件必须要 false 同时不能与 isMainValue: true 同用 // 前置添加必有,和isFormModel结合使用
}]
}
}
}, },
{ {
label: '备件名称', label: '备件名称',

7
src/views/eam/item/itemApplyMain/itemApplyMain.data.ts

@ -4,6 +4,7 @@ import { ItemAccounts } from '@/views/eam/item/itemAccounts/itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/item/itemAccounts' import * as ItemAccountsApi from '@/api/eam/item/itemAccounts'
import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance' import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
import { validateHanset, validateEmail } from '@/utils/validator' import { validateHanset, validateEmail } from '@/utils/validator'
import Detail from '@/views/bpm/oa/leave/detail.vue'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
/** /**
@ -84,7 +85,11 @@ export const ItemApplyMain = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
isForm: false isForm: false,
detail: {
width: 180,
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
}, },
{ {

9
src/views/eam/item/itemOutLocation/itemOutLocation.data.ts

@ -27,15 +27,6 @@ export const ItemOutLocation = useCrudSchemas(reactive<CrudSchema[]>([
width: 180, width: 180,
}, },
}, },
{
label: '出库编号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: 180,
},
},
{ {
label: '库位编号', label: '库位编号',
field: 'locationNumber', field: 'locationNumber',

28
src/views/eam/item/replaceItemDes/index.vue

@ -127,8 +127,7 @@
if (row&&row.filePathList && row.filePathList.length > 0) { if (row&&row.filePathList && row.filePathList.length > 0) {
row.filePathListView = row.filePathList.map((item) => { row.filePathListView = row.filePathList.map((item) => {
return { return {
name: item, ...item
url: item
} }
}) })
} }
@ -137,17 +136,26 @@
// form // form
const formsSuccess = async (formType, data) => { const formsSuccess = async (formType, data) => {
data.filePathList = data.filePathListView.map(item=>item.url) let paramData = {
console.log(formType) ...data
}
//
paramData.fileInfoList = paramData.filePathListView.map(item => item);
//
delete paramData.filePathList;
delete paramData.filePathListView;
console.log(formType);
if (formType === 'create') { if (formType === 'create') {
await ReplaceItemDesApi.createReplaceItemDes(data) await ReplaceItemDesApi.createReplaceItemDes(paramData);
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'));
} else { } else {
await ReplaceItemDesApi.updateReplaceItemDes(data) await ReplaceItemDesApi.updateReplaceItemDes(paramData);
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'));
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false;
getList() getList();
} }
/** 详情操作 */ /** 详情操作 */

Loading…
Cancel
Save