Browse Source

报修对设备模具状态维护功能代码

master
ljlong_2630 9 months ago
parent
commit
44769f6127
  1. 6
      src/api/eam/device/deviceAccounts/index.ts
  2. 3
      src/api/eam/device/deviceRepair/index.ts
  3. 8
      src/api/eam/mold/moldAccounts/index.ts
  4. 8
      src/api/eam/mold/moldRepair/index.ts
  5. 11
      src/views/eam/device/deviceRepair/deviceRepair.data.ts
  6. 27
      src/views/eam/device/deviceRepair/index.vue
  7. 25
      src/views/eam/mold/moldRepair/index.vue
  8. 17
      src/views/eam/mold/moldRepair/moldRepair.data.ts
  9. 4
      src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts
  10. 2
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts

6
src/api/eam/device/deviceAccounts/index.ts

@ -64,3 +64,9 @@ export const getDeviceAccountsNoPage = async (params) => {
return await request.get({ url: `/eam/device-accounts/selectData`, params })
}
// 查询设备台账全部列表
export const getDeviceAccountsAllNoPage = async (data: DeviceAccountsVO) => {
return await request.post({ url: `/eam/device-accounts/noPage`,data })
}

3
src/api/eam/device/deviceRepair/index.ts

@ -19,9 +19,10 @@ export interface DeviceRepairVO {
export const getDeviceRepairPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
const data = { ...params }
return await request.post({ url: '/eam/device-repair-request/senior', data })
} else {
params.type = 'DEVICE'
return await request.get({ url: `/eam/device-repair-request/page`, params })
}
}

8
src/api/eam/mold/moldAccounts/index.ts

@ -15,6 +15,7 @@ export interface MoldAccountsVO {
siteId: string
available: string
concurrencyStamp: number
status: string
}
// 查询设备台账列表
@ -59,8 +60,13 @@ export const importTemplate = () => {
}
// 查询设备台账列表
// 查询模具台账列表
export const getMoldAccountsNoPage = async (params) => {
return await request.get({ url: `/eam/mold-accounts/selectData`, params })
}
// 查询模具台账全部列表
export const getMoldAccountsAllNoPage = async (data: MoldAccountsVO) => {
return await request.post({ url: `/eam/mold-accounts/noPage`,data })
}

8
src/api/eam/mold/moldRepair/index.ts

@ -18,9 +18,10 @@ export interface MoldRepairVO {
export const getMoldRepairPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
const data = { ...params }
return await request.post({ url: '/eam/device-repair-request/senior', data })
} else {
params.type = 'MOLD'
return await request.get({ url: `/eam/device-repair-request/page`, params })
}
}
@ -54,3 +55,8 @@ export const exportMoldRepair = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/eam/device-repair-request/get-import-template' })
}
// 撤销申请
export const rejected = (id: Number) => {
return request.delete({ url: '/eam/device-repair-request/rejected?id=' + id })
}

11
src/views/eam/device/deviceRepair/deviceRepair.data.ts

@ -5,6 +5,7 @@ import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
// 邮箱账号的列表
const factoryList = await selectAllFactoryArea()
const deviceList = ref([]);
const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
// 表单校验
export const DeviceRepairRules = reactive({
@ -72,11 +73,11 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
valueField: 'id'
},
onChange: (val) => {
DeviceAccountsApi.getDeviceAccountsPage({
DeviceAccountsApi.getDeviceAccountsNoPage({
isSearch: false,
factoryAreaNumber: val
}).then((res) => {
deviceList.value = res?.list
deviceList.value = res
}).catch((e) => {
console.log(e)
})
@ -92,6 +93,12 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
width: '150',
},
isSearch: true,
api: () => DeviceAccountsApi.getDeviceAccountsNoPage({
isSearch: false
}),
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListNoPage.find((account) => account.number == cellValue)?.name
},
form: {
component: 'Select',
componentProps: {

27
src/views/eam/device/deviceRepair/index.vue

@ -30,9 +30,17 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="DeviceRepairRules"
:formAllSchemas="DeviceRepair.allSchemas" :apiUpdate="DeviceRepairApi.updateDeviceRepair"
:apiCreate="DeviceRepairApi.createDeviceRepair" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="DeviceRepairRules"
:formAllSchemas="DeviceRepair.allSchemas"
:apiUpdate="DeviceRepairApi.updateDeviceRepair"
:apiCreate="DeviceRepairApi.createDeviceRepair"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceRepair.allSchemas" />
@ -57,6 +65,7 @@ import download from '@/utils/download'
import { DeviceRepair, DeviceRepairRules } from './deviceRepair.data'
import * as DeviceRepairApi from '@/api/eam/device/deviceRepair'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as DeviceAccountApi from '@/api/eam/device/deviceAccounts'
// import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import Detail from '@/components/Detail/src/Detail.vue'
@ -283,12 +292,24 @@ function handleBackout(row) {
}
const onChange = (field, cur, item) => {
if (field == 'factoryAreaNumber') {
//
DeviceRepair.allSchemas.formSchema
}
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await DeviceRepairApi.importTemplate()
})
</script>

25
src/views/eam/mold/moldRepair/index.vue

@ -26,9 +26,17 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="MoldRepairRules"
:formAllSchemas="MoldRepair.allSchemas" :apiUpdate="MoldRepairApi.updateMoldRepair"
:apiCreate="MoldRepairApi.createMoldRepair" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="MoldRepairRules"
:formAllSchemas="MoldRepair.allSchemas"
:apiUpdate="MoldRepairApi.updateMoldRepair"
:apiCreate="MoldRepairApi.createMoldRepair"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="MoldRepair.allSchemas" />
@ -43,11 +51,7 @@ import download from '@/utils/download'
import { MoldRepair, MoldRepairRules } from './moldRepair.data'
import * as MoldRepairApi from '@/api/eam/mold/moldRepair'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { selectAllFactoryArea } from '@/api/system/dept'
import { getRowIdentity } from 'element-plus/es/components/table/src/util'
// import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import Detail from '@/components/Detail/src/Detail.vue'
import * as MoldAccountApi from '@/api/eam/mold/moldAccount'
defineOptions({ name: 'MoldRepair' })
@ -56,7 +60,6 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
const factoryAreaList = ref([])
routeName.value = route.name
const tableColumns = ref(MoldRepair.allSchemas.tableColumns)
@ -252,4 +255,8 @@ onMounted(async () => {
importTemplateData.templateUrl = await MoldRepairApi.importTemplate()
})
const onChange = (field, cur, item) => {
}
</script>

17
src/views/eam/mold/moldRepair/moldRepair.data.ts

@ -2,14 +2,19 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { selectAllFactoryArea } from '@/api/system/dept'
import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts'
// 邮箱账号的列表
const factoryList = await selectAllFactoryArea()
const moldList = ref([]);
const moldListNoPage = await MoldAccountsApi.getMoldAccountsAllNoPage({
status: '0'
} as MoldAccountsApi.MoldAccountsVO)
// 表单校验
export const MoldRepairRules = reactive({
number: [required],
moldNumber: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
declarer: [required],
faultType: [required],
@ -72,11 +77,11 @@ export const MoldRepair = useCrudSchemas(reactive<CrudSchema[]>([
valueField: 'id'
},
onChange: (val) => {
MoldAccountsApi.getMoldAccountsPage({
MoldAccountsApi.getMoldAccountsNoPage({
isSearch: false,
factoryAreaNumber: val
}).then((res) => {
moldList.value = res?.list
moldList.value = res
}).catch((e) => {
console.log(e)
})
@ -86,12 +91,16 @@ export const MoldRepair = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '模具',
field: 'moldNumber',
field: 'deviceNumber',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
api: () => moldListNoPage,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return moldListNoPage.find((account) => account.number == cellValue)?.name
},
form: {
component: 'Select',
componentProps: {

4
src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts

@ -71,8 +71,8 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
{
label: '设备',
field: 'moldNumber',
label: '模具',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
table: {

2
src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts

@ -54,7 +54,7 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '设备/模具',
field: 'moldNumber',
field: 'deviceNumber',
sort: 'custom',
isSearch: false,
table: {

Loading…
Cancel
Save