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. 9
      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. 38
      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) => {
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 })
}
// 不在台账中的库位
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 })
}
}

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

@ -19,7 +19,7 @@ export const getReplaceItemDesPage = async (params) => {
const data = {...params}
return await request.post({ url: '/eam/attachment-file/senior', data })
} else {
return await request.get({ url: `/eam/attachment-file/page`, params })
return await request.get({ url: `/eam/attachment-file/getGroupedAttachmentFiles`, params })
}
}
@ -30,13 +30,14 @@ export const getReplaceItemDes = async (id: number) => {
// 新增备件台账
export const createReplaceItemDes = async (data: AttachmentFileVO) => {
data.funcCode="Replace_Item_Des"
return await request.post({ url: `/eam/attachment-file/create`, data })
data.funcCode = "Replace_Item_Des"
return await request.post({ url: `/eam/attachment-file/upload`, data })
}
// 修改备件台账
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 { Role } from '@/views/system/role/role.data'
import { selectAllFactoryArea } from '@/api/system/dept'
import { useUserStore } from '@/store/modules/user'
// 表单校验
export const ClassTypeRules = reactive({
workerRoleId: [required],
@ -11,9 +12,14 @@ export const ClassTypeRules = reactive({
type: [required],
factoryAreaNumber: [required],
})
const userStore = useUserStore()
const FactoryAreaNoPage = await deptApi.getDeptPage({'deptGroup':'factory'})
const roleList = await roleApi.getSimpleRoleList({})
const factoryList = await selectAllFactoryArea()
// 假设你想添加一个新的工厂区域
// const factoryList = [...factoryListResult, {
// ...userStore.userSelfInfo.dept
// }]
console.log('FactoryAreaNoPage',FactoryAreaNoPage);
console.log('roleList',roleList);
@ -53,7 +59,7 @@ console.log('roleList',roleList);
]))
export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '维修工角色',
label: '维修工角色编号',
field: 'workerRoleId',
sort: 'custom',
form: {
@ -79,7 +85,7 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: '工程师角色',
label: '工程师角色编号',
field: 'engineerRoleId',
sort: 'custom',
form: {
@ -121,7 +127,7 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
},
{
label: '所属厂区',
label: '所属厂区编号',
field: 'factoryAreaNumber',
isSearch: true,
sort: 'custom',

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

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

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

@ -1,6 +1,11 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
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({
@ -19,23 +24,60 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([
width: 180,
fixed: 'left'
},
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '备件', // 查询弹窗标题
searchAllSchemas: Item.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemNotInAccountSenior, // 查询弹窗所需分页方法
searchCondition: []
}
}
},
{
label: '库位编号',
field: 'locationNumber',
label: '库编号',
field: 'areaNumber',
sort: 'custom',
table: {
width: 110
},
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '备件', // 查询弹窗标题
searchAllSchemas: LocationArea.allSchemas, // 查询弹窗所需类
searchPage: LocationAreaApi.getLocationAreaPage, // 查询弹窗所需分页方法
searchCondition: []
}
}
},
{
label: '库区编号',
field: 'areaNumber',
label: '库编号',
field: 'locationNumber',
sort: 'custom',
table: {
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: '备件名称',

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 DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
import { validateHanset, validateEmail } from '@/utils/validator'
import Detail from '@/views/bpm/oa/leave/detail.vue'
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')]
}
},
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,
},
},
{
label: '出库编号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: 180,
},
},
{
label: '库位编号',
field: 'locationNumber',

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

@ -123,12 +123,11 @@
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
const openForm = (type: string, row?: any) => {
if (row&&row.filePathList && row.filePathList.length > 0) {
row.filePathListView = row.filePathList.map((item) => {
return {
name: item,
url: item
...item
}
})
}
@ -136,19 +135,28 @@
}
// form
const formsSuccess = async (formType, data) => {
data.filePathList = data.filePathListView.map(item=>item.url)
console.log(formType)
if (formType === 'create') {
await ReplaceItemDesApi.createReplaceItemDes(data)
message.success(t('common.createSuccess'))
} else {
await ReplaceItemDesApi.updateReplaceItemDes(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
const formsSuccess = async (formType, data) => {
let paramData = {
...data
}
//
paramData.fileInfoList = paramData.filePathListView.map(item => item);
//
delete paramData.filePathList;
delete paramData.filePathListView;
console.log(formType);
if (formType === 'create') {
await ReplaceItemDesApi.createReplaceItemDes(paramData);
message.success(t('common.createSuccess'));
} else {
await ReplaceItemDesApi.updateReplaceItemDes(paramData);
message.success(t('common.updateSuccess'));
}
basicFormRef.value.dialogVisible = false;
getList();
}
/** 详情操作 */
const detailRef = ref()

Loading…
Cancel
Save