Browse Source

BUG修改

master
yejiaxing 10 months ago
parent
commit
681a0086b1
  1. 56
      src/api/eam/basic/deviceMaintenance/index.ts
  2. 4
      src/api/eam/basic/moldMaintenance/index.ts
  3. 3
      src/utils/dict.ts
  4. 42
      src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts
  5. 221
      src/views/eam/basic/deviceMaintenance/index.vue
  6. 2
      src/views/eam/basic/inspection/deviceMoldItems.data.ts
  7. 2
      src/views/eam/basic/inspection/index.vue
  8. 2
      src/views/eam/basic/item/index.vue
  9. 30
      src/views/eam/basic/item/item.data.ts
  10. 34
      src/views/eam/basic/moldMaintenance/index.vue
  11. 147
      src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts
  12. 168
      src/views/eam/item/itemAccounts/itemAccounts.data.ts
  13. 1
      src/views/eam/item/transaction/transaction.data.ts

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

@ -0,0 +1,56 @@
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"
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) => {
return await request.post({ url: `/eam/device-mold-items/create`, data })
}
// 修改项记录表(设备 模具 保养 维修 巡检点检)
export const updateDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
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 })
}

4
src/api/eam/basic/deviceMoldItems/index.ts → src/api/eam/basic/moldMaintenance/index.ts

@ -3,7 +3,7 @@ import request from '@/config/axios'
export interface DeviceMoldItemsVO { export interface DeviceMoldItemsVO {
name: string name: string
deviceNumber: string deviceNumber: string
type: string type: "MOLD"
status: string status: string
siteId: string siteId: string
available: string available: string
@ -12,6 +12,7 @@ export interface DeviceMoldItemsVO {
// 查询项记录表(设备 模具 保养 维修 巡检点检)列表 // 查询项记录表(设备 模具 保养 维修 巡检点检)列表
export const getDeviceMoldItemsPage = async (params) => { export const getDeviceMoldItemsPage = async (params) => {
params.type="MOLD"
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
@ -21,6 +22,7 @@ export const getDeviceMoldItemsPage = async (params) => {
} }
} }
// 查询项记录表(设备 模具 保养 维修 巡检点检)详情 // 查询项记录表(设备 模具 保养 维修 巡检点检)详情
export const getDeviceMoldItems = async (id: number) => { export const getDeviceMoldItems = async (id: number) => {
return await request.get({ url: `/eam/device-mold-items/get?id=` + id }) return await request.get({ url: `/eam/device-mold-items/get?id=` + id })

3
src/utils/dict.ts

@ -280,5 +280,6 @@ export enum DICT_TYPE {
WEI_XIU_ORDER_STATUS = 'wei_xiu_order_status',//维修单状态 WEI_XIU_ORDER_STATUS = 'wei_xiu_order_status',//维修单状态
BASIC_STATUS = 'basic_status',//设备模具状态 BASIC_STATUS = 'basic_status',//设备模具状态
CLASS_TYPE = 'class_type', // 班组类型 CLASS_TYPE = 'class_type', // 班组类型
INVENTORY_ACTION = 'inventory_action' //库存动作 INVENTORY_ACTION = 'inventory_action', //库存动作
MAINTENANCE_TYPE = 'maintenance_type', //保养类型
} }

42
src/views/eam/basic/maintenance/deviceMoldItems.data.ts → src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts

@ -1,9 +1,9 @@
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 * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMoldItems' import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
// 表单校验 // 表单校验
export const DeviceMoldItemsRules = reactive({ export const DeviceMaintenanceRules = reactive({
name: [required], name: [required],
deviceNumber: [required], deviceNumber: [required],
type: [required], type: [required],
@ -35,7 +35,7 @@ export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
])) ]))
export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '保养项名称', label: '保养项名称',
field: 'name', field: 'name',
@ -48,16 +48,19 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.DEVICE_MOLD_TYPE, dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string', dictClass: 'string',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'Select' value: 'DEVICE',
}, componentProps: {
disabled: true,
}
}
}, },
{ {
label: '设备/模具编号', label: '设备编号',
field: 'deviceNumber', field: 'deviceNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
@ -74,8 +77,8 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
isMainValue: false isMainValue: false
}, { }, {
key: 'type', key: 'type',
value: 'type', value: "DEVICE",
isMainValue: true isMainValue: false
} }
] ]
} }
@ -87,7 +90,7 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.DEVICEMOLDITEMS_STATUS, dictType: DICT_TYPE.DEVICEMOLDITEMS_STATUS,
dictClass: 'string', dictClass: 'string',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'Select', component: 'Select',
value: 'MAINTAIN', value: 'MAINTAIN',
@ -96,12 +99,27 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{
label: '保养类型',
field: 'maintenanceType',
dictType: DICT_TYPE.MAINTENANCE_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
form: {
component: 'Select',
value: 'CYCLE',
componentProps: {
disabled: true
}
},
},
{ {
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: false,
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {

221
src/views/eam/basic/deviceMaintenance/index.vue

@ -0,0 +1,221 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceMaintenance.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeviceMaintenance.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="DeviceMaintenanceRules"
:formAllSchemas="DeviceMaintenance.allSchemas"
:apiUpdate="DeviceMaintenanceApi.updateDeviceMoldItems"
:apiCreate="DeviceMaintenanceApi.createDeviceMoldItems"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMaintenance.allSchemas" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceMaintenance,DeviceMaintenanceRules } from './deviceMaintenance.data'
import * as DeviceMaintenanceApi from '@/api/eam/basic/deviceMaintenance'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'DeviceMaintenance' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeviceMaintenance.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: DeviceMaintenanceApi.getDeviceMoldItemsPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultExportBtn(null), //
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 == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
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 =DeviceMaintenance.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 DeviceMaintenanceApi.createDeviceMoldItems(data)
message.success(t('common.createSuccess'))
} else {
await DeviceMaintenanceApi.updateDeviceMoldItems(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, 'basicDeviceMoldItems')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceMaintenanceApi.deleteDeviceMoldItems(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 DeviceMaintenanceApi.exportDeviceMoldItems(tableObject.params)
download.excel(data, '项记录表(设备 模具 保养 维修 巡检点检).xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

2
src/views/eam/basic/inspection/deviceMoldItems.data.ts

@ -1,6 +1,6 @@
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 * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMoldItems' import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
// 表单校验 // 表单校验
export const DeviceMoldItemsRules = reactive({ export const DeviceMoldItemsRules = reactive({

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

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

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

@ -98,7 +98,7 @@
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn(null), // // defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultExportBtn(null), // defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //

30
src/views/eam/basic/item/item.data.ts

@ -25,6 +25,9 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
field: 'name', field: 'name',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width:110,
},
}, },
{ {
label: '规格', label: '规格',
@ -36,11 +39,11 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
field: 'isConstant', field: 'isConstant',
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: false,
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width:110,
}, },
tableForm: { tableForm: {
type: 'Select', type: 'Select',
@ -67,11 +70,8 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.UOM, dictType: DICT_TYPE.UOM,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: false,
isTable: true, isTable: true,
table: {
width: 150
},
tableForm: { tableForm: {
type: 'Select' type: 'Select'
} }
@ -85,6 +85,9 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
label: '重点采购', label: '重点采购',
field: 'reprocurement', field: 'reprocurement',
sort: 'custom', sort: 'custom',
table: {
width:110,
},
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
@ -94,6 +97,9 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
label: '安全库存', label: '安全库存',
field: 'safetyStock', field: 'safetyStock',
sort: 'custom', sort: 'custom',
table: {
width:110,
},
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
@ -103,11 +109,17 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
label: '成本中心', label: '成本中心',
field: 'cost', field: 'cost',
sort: 'custom', sort: 'custom',
table: {
width:110,
},
}, },
{ {
label: '采购员', label: '采购员',
field: 'purchaser', field: 'purchaser',
sort: 'custom', sort: 'custom',
table: {
width:100,
},
}, },
{ {
label: '财务', label: '财务',
@ -119,11 +131,11 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
field: 'isRadeIn', field: 'isRadeIn',
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: false,
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 140
}, },
tableForm: { tableForm: {
type: 'Select', type: 'Select',
@ -144,7 +156,7 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
field: 'available', field: 'available',
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: false,
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {

34
src/views/eam/basic/maintenance/index.vue → src/views/eam/basic/moldMaintenance/index.vue

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="DeviceMoldItems.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="MoldMaintenance.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -11,7 +11,7 @@
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="DeviceMoldItems.allSchemas" :allSchemas="MoldMaintenance.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
@ -42,35 +42,35 @@
<BasicForm <BasicForm
ref="basicFormRef" ref="basicFormRef"
@success="formsSuccess" @success="formsSuccess"
:rules="DeviceMoldItemsRules" :rules="MoldMaintenanceRules"
:formAllSchemas="DeviceMoldItems.allSchemas" :formAllSchemas="MoldMaintenance.allSchemas"
:apiUpdate="DeviceMoldItemsApi.updateDeviceMoldItems" :apiUpdate="MoldMaintenanceApi.updateDeviceMoldItems"
:apiCreate="DeviceMoldItemsApi.createDeviceMoldItems" :apiCreate="MoldMaintenanceApi.createDeviceMoldItems"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMoldItems.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="MoldMaintenance.allSchemas" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { DeviceMoldItems,DeviceMoldItemsRules } from './deviceMoldItems.data' import { MoldMaintenance,MoldMaintenanceRules } from './moldMaintenance.data'
import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMoldItems' import * as MoldMaintenanceApi from '@/api/eam/basic/moldMaintenance'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Maintenance' }) defineOptions({ name: 'MoldMaintenance' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(DeviceMoldItems.allSchemas.tableColumns) const tableColumns = ref(MoldMaintenance.allSchemas.tableColumns)
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -87,7 +87,7 @@ const updataTableColumns = (val) => {
} }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: DeviceMoldItemsApi.getDeviceMoldItemsPage // getListApi: MoldMaintenanceApi.getDeviceMoldItemsPage //
}) })
// //
@ -147,7 +147,7 @@ const openForm = (type: string, row?: any) => {
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType,data) => {
var isHave =DeviceMoldItems.allSchemas.formSchema.some(function (item) { var isHave =MoldMaintenance.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime';
}); });
if(isHave){ if(isHave){
@ -159,10 +159,10 @@ const formsSuccess = async (formType,data) => {
if(data.activeTime==0)data.activeTime = null; if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null; if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') { if (formType === 'create') {
await DeviceMoldItemsApi.createDeviceMoldItems(data) await MoldMaintenanceApi.createDeviceMoldItems(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await DeviceMoldItemsApi.updateDeviceMoldItems(data) await MoldMaintenanceApi.updateDeviceMoldItems(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
@ -181,7 +181,7 @@ const handleDelete = async (id: number) => {
// //
await message.delConfirm() await message.delConfirm()
// //
await DeviceMoldItemsApi.deleteDeviceMoldItems(id) await MoldMaintenanceApi.deleteDeviceMoldItems(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
@ -196,7 +196,7 @@ const handleExport = async () => {
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await DeviceMoldItemsApi.exportDeviceMoldItems(tableObject.params) const data = await MoldMaintenanceApi.exportDeviceMoldItems(tableObject.params)
download.excel(data, '项记录表(设备 模具 保养 维修 巡检点检).xlsx') download.excel(data, '项记录表(设备 模具 保养 维修 巡检点检).xlsx')
} catch { } catch {
} finally { } finally {

147
src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts

@ -0,0 +1,147 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
// 表单校验
export const MoldMaintenanceRules = reactive({
name: [required],
deviceNumber: [required],
type: [required],
status: [required],
concurrencyStamp: [required],
})
export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
field: 'number',
sort: 'custom',
isForm: false,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '名称',
field: 'name',
sort: 'custom',
},
{
label: '规格型号',
field: 'specification',
sort: 'custom',
},
]))
export const MoldMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '保养项名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '类型',
field: 'type',
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
form: {
value: 'MOLD',
componentProps: {
disabled: true,
}
}
},
{
label: '模具编号',
field: 'deviceNumber',
sort: 'custom',
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择模具编号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '模具信息', // 查询弹窗标题
searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: "TRUE",
isMainValue: false
}, {
key: 'type',
value: "MOLD",
isMainValue: false
}
]
}
}
},
{
label: '项类型',
field: 'status',
dictType: DICT_TYPE.DEVICEMOLDITEMS_STATUS,
dictClass: 'string',
sort: 'custom',
isSearch: false,
form: {
component: 'Select',
value: 'MAINTAIN',
componentProps: {
disabled: true
}
},
},
{
label: '保养类型',
field: 'maintenanceType',
dictType: DICT_TYPE.MAINTENANCE_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
form: {
component: 'Select'
},
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

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

@ -14,21 +14,185 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([
field: 'itemNumber', field: 'itemNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 180,
fixed: 'left'
},
}, },
{ {
label: '库存数量', label: '备件名称',
field: 'qty', field: 'itemDO.name',
sort: 'custom',
table: {
width: 110
},
isSearch: true,
},
{
label: '库位编号',
field: 'locationNumber',
sort: 'custom', sort: 'custom',
table: {
width: 110
},
}, },
{ {
label: '库区编号', label: '库区编号',
field: 'areaNumber', field: 'areaNumber',
sort: 'custom', sort: 'custom',
table: {
width: 110
},
},
{
label: '库存数量',
field: 'qty',
sort: 'custom',
table: {
width: 110
},
}, },
{ {
label: '是否账内库', label: '是否账内库',
field: 'isInAccount', field: 'isInAccount',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: true,
sort: 'custom',
table: {
width: 130
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '规格',
field: 'itemDO.specifications',
sort: 'custom',
},
{
label: '是否存储',
field: 'itemDO.isConstant',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 110
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '科目',
field: 'itemDO.subject',
sort: 'custom',
},
{
label: '单位',
field: 'itemDO.uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{
label: '单价',
field: 'itemDO.singlePrice',
sort: 'custom',
},
{
label: '重点采购',
field: 'itemDO.reprocurement',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '安全库存',
field: 'itemDO.safetyStock',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '成本中心',
field: 'itemDO.cost',
sort: 'custom',
},
{
label: '采购员',
field: 'itemDO.purchaser',
sort: 'custom',
},
{
label: '财务',
field: 'itemDO.financer',
sort: 'custom',
},
{
label: '是否以旧换新',
field: 'itemDO.isRadeIn',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom', sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
}, },
{ {
label: '是否可用', label: '是否可用',

1
src/views/eam/item/transaction/transaction.data.ts

@ -10,7 +10,6 @@ export const Rules = reactive({
}) })
export const Transaction = useCrudSchemas(reactive<CrudSchema[]>([ export const Transaction = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '事务编号', label: '事务编号',
field: 'number', field: 'number',

Loading…
Cancel
Save