ljlong_2630 9 months ago
parent
commit
9602f8d74b
  1. 5
      src/api/eam/basic/deviceMaintenance/index.ts
  2. 61
      src/api/eam/basic/inspection/index.ts
  3. 5
      src/api/eam/basic/moldMaintenance/index.ts
  4. 16
      src/api/eam/item/applicationRecordDetail/index.ts
  5. 5
      src/api/eam/item/itemAccounts/index.ts
  6. 16
      src/api/eam/item/itemApplyDetail/index.ts
  7. 49
      src/api/eam/item/itemLocationReplace/index.ts
  8. 4
      src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts
  9. 4
      src/views/eam/basic/inspection/index.vue
  10. 10
      src/views/eam/basic/inspection/inspection.data.ts
  11. 3
      src/views/eam/basic/item/index.vue
  12. 82
      src/views/eam/item/itemAccounts/index.vue
  13. 118
      src/views/eam/item/itemApplyMain/itemApplyMain.data.ts
  14. 244
      src/views/eam/item/itemLocationReplace/index.vue
  15. 62
      src/views/eam/item/itemLocationReplace/itemLocationReplace.data.ts
  16. 26
      src/views/eam/item/itemOrderMain/itemOrderMain.data.ts

5
src/api/eam/basic/deviceMaintenance/index.ts

@ -13,6 +13,7 @@ export interface DeviceMoldItemsVO {
// 查询项记录表(设备 模具 保养 维修 巡检点检)列表
export const getDeviceMoldItemsPage = async (params) => {
params.type="DEVICE"
params.status="MAINTAIN"
if (params.isSearch) {
delete params.isSearch
const data = {...params}
@ -35,11 +36,15 @@ export const getNumber = async (params) => {
// 新增项记录表(设备 模具 保养 维修 巡检点检)
export const createDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
data.type="DEVICE"
data.status="MAINTAIN"
return await request.post({ url: `/eam/device-mold-items/create`, data })
}
// 修改项记录表(设备 模具 保养 维修 巡检点检)
export const updateDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
data.type="DEVICE"
data.status="MAINTAIN"
return await request.put({ url: `/eam/device-mold-items/update`, data })
}

61
src/api/eam/basic/inspection/index.ts

@ -0,0 +1,61 @@
import request from '@/config/axios'
export interface DeviceMoldItemsVO {
name: string
deviceNumber: string
type: "DEVICE"
status: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询项记录表(设备 模具 保养 维修 巡检点检)列表
export const getDeviceMoldItemsPage = async (params) => {
params.type="DEVICE"
params.status="INSPECTION"
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-mold-items/senior', data })
} else {
return await request.get({ url: `/eam/device-mold-items/page`, params })
}
}
// 查询项记录表(设备 模具 保养 维修 巡检点检)详情
export const getDeviceMoldItems = async (id: number) => {
return await request.get({ url: `/eam/device-mold-items/get?id=` + id })
}
// 查询供应商发票申请主详情
export const getNumber = async (params) => {
return await request.get({ url: `/eam/device-mold-items/getNumber`, params})
}
// 新增项记录表(设备 模具 保养 维修 巡检点检)
export const createDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
data.type="DEVICE"
data.status="INSPECTION"
return await request.post({ url: `/eam/device-mold-items/create`, data })
}
// 修改项记录表(设备 模具 保养 维修 巡检点检)
export const updateDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
data.type="DEVICE"
data.status="INSPECTION"
return await request.put({ url: `/eam/device-mold-items/update`, data })
}
// 删除项记录表(设备 模具 保养 维修 巡检点检)
export const deleteDeviceMoldItems = async (id: number) => {
return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id })
}
// 导出项记录表(设备 模具 保养 维修 巡检点检) Excel
export const exportDeviceMoldItems = async (params) => {
return await request.download({ url: `/eam/device-mold-items/export-excel`, params })
}

5
src/api/eam/basic/moldMaintenance/index.ts

@ -13,6 +13,7 @@ export interface DeviceMoldItemsVO {
// 查询项记录表(设备 模具 保养 维修 巡检点检)列表
export const getDeviceMoldItemsPage = async (params) => {
params.type="MOLD"
params.status="MAINTAIN"
if (params.isSearch) {
delete params.isSearch
const data = {...params}
@ -35,11 +36,15 @@ export const getNumber = async (params) => {
// 新增项记录表(设备 模具 保养 维修 巡检点检)
export const createDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
data.type="MOLD"
data.status="MAINTAIN"
return await request.post({ url: `/eam/device-mold-items/create`, data })
}
// 修改项记录表(设备 模具 保养 维修 巡检点检)
export const updateDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
data.type="MOLD"
data.status="MAINTAIN"
return await request.put({ url: `/eam/device-mold-items/update`, data })
}

16
src/api/eam/item/applicationRecordDetail/index.ts

@ -20,38 +20,38 @@ export const getApplicationRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/item-apply-detail/senior', data })
return await request.post({ url: '/eam/item-apply-request-detail/senior', data })
} else {
return await request.get({ url: `/eam/item-apply-detail/page`, params })
return await request.get({ url: `/eam/item-apply-request-detail/page`, params })
}
}
// 查询备件申领记录主详情
export const getApplicationRecordDetail = async (id : number) => {
return await request.get({ url: `/eam/item-apply-detail/get?id=` + id })
return await request.get({ url: `/eam/item-apply-request-detail/get?id=` + id })
}
// 新增备件申领记录主
export const createApplicationRecordDetail = async (data : ItemApplyDetailVO) => {
return await request.post({ url: `/eam/item-apply-detail/create`, data })
return await request.post({ url: `/eam/item-apply-request-detail/create`, data })
}
// 修改备件申领记录主
export const updateApplicationRecordDetail = async (data : ItemApplyDetailVO) => {
return await request.put({ url: `/eam/item-apply-detail/update`, data })
return await request.put({ url: `/eam/item-apply-request-detail/update`, data })
}
// 删除备件申领记录主
export const deleteApplicationRecordDetail = async (id : number) => {
return await request.delete({ url: `/eam/item-apply-detail/delete?id=` + id })
return await request.delete({ url: `/eam/item-apply-request-detail/delete?id=` + id })
}
// 导出备件申领记录主 Excel
export const exportApplicationRecordDetail = async (params) => {
return await request.download({ url: `/eam/item-apply-detail/export-excel`, params })
return await request.download({ url: `/eam/item-apply-request-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-apply-detail/get-import-template' })
return request.download({ url: '/eam/item-apply-request-detail/get-import-template' })
}

5
src/api/eam/item/itemAccounts/index.ts

@ -50,3 +50,8 @@ export const exportItemAccounts = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/eam/item-accounts/get-import-template' })
}
// 更改备件库位
export const replaceLocation = async (data: Array<ItemAccountsVO>) => {
return await request.post({url: `/eam/item-accounts/replaceLocation `, data });
};

16
src/api/eam/item/itemApplyDetail/index.ts

@ -20,38 +20,38 @@ export const getItemApplyDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/item-apply-detail/senior', data })
return await request.post({ url: '/eam/item-apply-request-detail/senior', data })
} else {
return await request.get({ url: `/eam/item-apply-detail/page`, params })
return await request.get({ url: `/eam/item-apply-request-detail/page`, params })
}
}
// 查询备件申领记录主详情
export const getItemApplyDetail = async (id: number) => {
return await request.get({ url: `/eam/item-apply-detail/get?id=` + id })
return await request.get({ url: `/eam/item-apply-request-detail/get?id=` + id })
}
// 新增备件申领记录主
export const createItemApplyDetail = async (data: ItemApplyDetailVO) => {
return await request.post({ url: `/eam/item-apply-detail/create`, data })
return await request.post({ url: `/eam/item-apply-request-detail/create`, data })
}
// 修改备件申领记录主
export const updateItemApplyDetail = async (data: ItemApplyDetailVO) => {
return await request.put({ url: `/eam/item-apply-detail/update`, data })
return await request.put({ url: `/eam/item-apply-request-detail/update`, data })
}
// 删除备件申领记录主
export const deleteItemApplyDetail = async (id: number) => {
return await request.delete({ url: `/eam/item-apply-detail/delete?id=` + id })
return await request.delete({ url: `/eam/item-apply-request-detail/delete?id=` + id })
}
// 导出备件申领记录主 Excel
export const exportItemApplyDetail = async (params) => {
return await request.download({ url: `/eam/item-apply-detail/export-excel`, params })
return await request.download({ url: `/eam/item-apply-request-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-apply-detail/get-import-template' })
return request.download({ url: '/eam/item-apply-request-detail/get-import-template' })
}

49
src/api/eam/item/itemLocationReplace/index.ts

@ -0,0 +1,49 @@
import request from '@/config/axios'
export interface ItemLocationReplaceVO {
locationNumber: string
describe: string
oldItemNumber: string
itemNumber: string
}
// 查询备件库位变更记录列表
export const getItemLocationReplacePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/item-location-replace/senior', data })
} else {
return await request.get({ url: `/eam/item-location-replace/page`, params })
}
}
// 查询备件库位变更记录详情
export const getItemLocationReplace = async (id: number) => {
return await request.get({ url: `/eam/item-location-replace/get?id=` + id })
}
// 新增备件库位变更记录
export const createItemLocationReplace = async (data: ItemLocationReplaceVO) => {
return await request.post({ url: `/eam/item-location-replace/create`, data })
}
// 修改备件库位变更记录
export const updateItemLocationReplace = async (data: ItemLocationReplaceVO) => {
return await request.put({ url: `/eam/item-location-replace/update`, data })
}
// 删除备件库位变更记录
export const deleteItemLocationReplace = async (id: number) => {
return await request.delete({ url: `/eam/item-location-replace/delete?id=` + id })
}
// 导出备件库位变更记录 Excel
export const exportItemLocationReplace = async (params) => {
return await request.download({ url: `/eam/item-location-replace/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-location-replace/get-import-template' })
}

4
src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts

@ -113,7 +113,7 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '人数',
field: 'peopleNum',
field: 'peoples',
sort: 'custom',
isSearch: false,
table: {
@ -125,7 +125,7 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '保养所需时间(h)',
field: 'maintenanceTime',
field: 'estimatedMinutes',
sort: 'custom',
isSearch: false,
table: {

4
src/views/eam/basic/inspection/index.vue

@ -57,8 +57,8 @@
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceMoldItems,DeviceMoldItemsRules } from './deviceMoldItems.data'
import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
import { DeviceMoldItems,DeviceMoldItemsRules } from './inspection.data'
import * as DeviceMoldItemsApi from '@/api/eam/basic/inspection'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'

10
src/views/eam/basic/inspection/deviceMoldItems.data.ts → src/views/eam/basic/inspection/inspection.data.ts

@ -42,7 +42,6 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true,
},
{
label: '类型',
field: 'type',
@ -51,10 +50,13 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: false,
form: {
component: 'Select'
},
value: 'DEVICE',
componentProps: {
disabled: true,
}
}
},
{
{
label: '设备/模具编号',
field: 'deviceNumber',
sort: 'custom',

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

@ -146,9 +146,6 @@
null
)
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map(element => ({
itemNumber: itemNumber.value,

82
src/views/eam/item/itemAccounts/index.vue

@ -50,6 +50,8 @@
:isBusiness="false"
/>
<SearchTable ref="searchTableRef" @searchTableSuccess="submitItem" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ItemAccounts.allSchemas" />
@ -61,6 +63,8 @@
import download from '@/utils/download'
import { ItemAccounts,ItemAccountsRules } from './itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/item/itemAccounts'
import { Item } from '@/views/eam/basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
@ -70,9 +74,10 @@ defineOptions({ name: 'ItemAccounts' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
const locationNumber = ref()
const id = ref()
routeName.value = route.name
const tableColumns = ref(ItemAccounts.allSchemas.tableColumns)
@ -134,6 +139,7 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:itemAccounts:update'}), //
defaultButtons.selectItemBtn(null), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:itemAccounts:delete'}), //
]
@ -143,6 +149,80 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'selectItem') {
openItem(row.locationNumber,row.id)
}
}
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number: String,id: number) => {
console.log(id)
locationNumber.value = number
id = id
searchTableRef.value.open(
'选择备件',
Item.allSchemas,
getDeviceItemList,
null,
Item.allSchemas.searchSchema,
true,
null,
null,
null,
null
)
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map((element) => ({
id: id.value,
locationNumber: locationNumber.value,
itemNumber: element.number
}))
ItemAccountsApi.replaceLocation(deviceItemRelList).then((res) => {
console.log('res', res)
})
console.log('deviceItemRelList', deviceItemRelList)
}
const getItemWithOutBind = async () => {
try {
const res = await ItemApi.getItemPage({
...Item.allSchemas.searchSchema
})
if (res.list?.length > 0) {
// const response = await getDeviceItemPage(DeviceAccounts.allSchemas.searchSchema);
// const filteredList = res.list.filter(item => {
// return !response.list?.some(element => {
// return item.number === element.itemNumber
// });
// });
// console.log('filteredList',filteredList);
const filteredList = res.list
return filteredList //
}
return [] //
} catch (error) {
console.error(error)
throw error //
}
}
// getListApi getItemWithOutBind
const getDeviceItemList = async () => {
tableObject.loading = true
try {
const res = await getItemWithOutBind()
let result = {
list: res,
total: res.length
}
return result
} catch (error) {
console.error(error)
} finally {
tableObject.loading = false
}
}

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

@ -116,6 +116,124 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
]
},
},
{
label: '类型',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: false
}
},
{
label: '设备/模具编号',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择单号',
searchField: 'number',
searchTitle: '单号信息',
searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: "TRUE",
isMainValue: false
}, {
key: 'type',
value: "type",
isMainValue: true
}
]
},
},
{
label: '申领数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '库存数量',
field: 'currentQty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '是否以旧换新',
field: 'isRadeIn',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '备注',
field: 'remark',

244
src/views/eam/item/itemLocationReplace/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ItemLocationReplace.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ItemLocationReplace.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ItemLocationReplaceRules"
:formAllSchemas="ItemLocationReplace.allSchemas"
:apiUpdate="ItemLocationReplaceApi.updateItemLocationReplace"
:apiCreate="ItemLocationReplaceApi.createItemLocationReplace"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ItemLocationReplace.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/record/item-location-replace/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ItemLocationReplace,ItemLocationReplaceRules } from './itemLocationReplace.data'
import * as ItemLocationReplaceApi from '@/api/eam/item/itemLocationReplace'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'ItemLocationReplace' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ItemLocationReplace.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: ItemLocationReplaceApi.getItemLocationReplacePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:itemLocationReplace:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:itemLocationReplace:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:itemLocationReplace:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:itemLocationReplace:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:itemLocationReplace:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =ItemLocationReplace.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await ItemLocationReplaceApi.createItemLocationReplace(data)
message.success(t('common.createSuccess'))
} else {
await ItemLocationReplaceApi.updateItemLocationReplace(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicItemLocationReplace')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ItemLocationReplaceApi.deleteItemLocationReplace(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ItemLocationReplaceApi.exportItemLocationReplace(tableObject.params)
download.excel(data, '备件库位变更记录.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件库位变更记录导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ItemLocationReplaceApi.importTemplate()
})
</script>

62
src/views/eam/item/itemLocationReplace/itemLocationReplace.data.ts

@ -0,0 +1,62 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ItemLocationReplaceRules = reactive({
locationNumber: [required],
oldItemNumber: [required],
itemNumber: [required],
})
export const ItemLocationReplace = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '库位编号',
field: 'locationNumber',
sort: 'custom',
isSearch: true,
},
{
label: '变更前备件编号',
field: 'oldItemNumber',
sort: 'custom',
isSearch: true,
},
{
label: '变更后备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '描述',
field: 'describe',
sort: 'custom',
isSearch: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

26
src/views/eam/item/itemOrderMain/itemOrderMain.data.ts

@ -20,6 +20,19 @@ export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
fixed: 'left'
},
},
// {
// label: '日期',
// field: 'date',
// sort: 'custom',
// formatter: dateFormatter,
// form: {
// component: 'DatePicker',
// componentProps: {
// type: 'datetime',
// valueFormat: 'x'
// }
// },
// },
{
label: '日期',
field: 'date',
@ -28,10 +41,13 @@ export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
type: 'date',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD'
}
},
{
label: '电话',
@ -111,7 +127,7 @@ export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'dutyParagraph',
sort: 'custom',
},
{
{
label: '是否关闭',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
@ -149,9 +165,9 @@ export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
},
form: {
value: 'INCOMPLETE',
componentProps: {
disabled: true,
}
componentProps: {
disabled: true,
}
}
},
{

Loading…
Cancel
Save