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 }) 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) => { export const getDeviceRepairPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = { ...params }
return await request.post({ url: '/eam/device-repair-request/senior', data }) return await request.post({ url: '/eam/device-repair-request/senior', data })
} else { } else {
params.type = 'DEVICE'
return await request.get({ url: `/eam/device-repair-request/page`, params }) 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 siteId: string
available: string available: string
concurrencyStamp: number concurrencyStamp: number
status: string
} }
// 查询设备台账列表 // 查询设备台账列表
@ -59,8 +60,13 @@ export const importTemplate = () => {
} }
// 查询设备台账列表 // 查询模具台账列表
export const getMoldAccountsNoPage = async (params) => { export const getMoldAccountsNoPage = async (params) => {
return await request.get({ url: `/eam/mold-accounts/selectData`, 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) => { export const getMoldRepairPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = { ...params }
return await request.post({ url: '/eam/device-repair-request/senior', data }) return await request.post({ url: '/eam/device-repair-request/senior', data })
} else { } else {
params.type = 'MOLD'
return await request.get({ url: `/eam/device-repair-request/page`, params }) return await request.get({ url: `/eam/device-repair-request/page`, params })
} }
} }
@ -54,3 +55,8 @@ export const exportMoldRepair = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/eam/device-repair-request/get-import-template' }) 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 factoryList = await selectAllFactoryArea()
const deviceList = ref([]); const deviceList = ref([]);
const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
// 表单校验 // 表单校验
export const DeviceRepairRules = reactive({ export const DeviceRepairRules = reactive({
@ -72,11 +73,11 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
valueField: 'id' valueField: 'id'
}, },
onChange: (val) => { onChange: (val) => {
DeviceAccountsApi.getDeviceAccountsPage({ DeviceAccountsApi.getDeviceAccountsNoPage({
isSearch: false, isSearch: false,
factoryAreaNumber: val factoryAreaNumber: val
}).then((res) => { }).then((res) => {
deviceList.value = res?.list deviceList.value = res
}).catch((e) => { }).catch((e) => {
console.log(e) console.log(e)
}) })
@ -92,6 +93,12 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
width: '150', width: '150',
}, },
isSearch: true, isSearch: true,
api: () => DeviceAccountsApi.getDeviceAccountsNoPage({
isSearch: false
}),
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListNoPage.find((account) => account.number == cellValue)?.name
},
form: { form: {
component: 'Select', component: 'Select',
componentProps: { componentProps: {

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

@ -30,9 +30,17 @@
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="DeviceRepairRules" <BasicForm
:formAllSchemas="DeviceRepair.allSchemas" :apiUpdate="DeviceRepairApi.updateDeviceRepair" ref="basicFormRef"
:apiCreate="DeviceRepairApi.createDeviceRepair" @searchTableSuccess="searchTableSuccess" :isBusiness="false" /> @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" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceRepair.allSchemas" />
@ -57,6 +65,7 @@ import download from '@/utils/download'
import { DeviceRepair, DeviceRepairRules } from './deviceRepair.data' import { DeviceRepair, DeviceRepairRules } from './deviceRepair.data'
import * as DeviceRepairApi from '@/api/eam/device/deviceRepair' import * as DeviceRepairApi from '@/api/eam/device/deviceRepair'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as DeviceAccountApi from '@/api/eam/device/deviceAccounts'
// 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'
// import Detail from '@/components/Detail/src/Detail.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 () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await DeviceRepairApi.importTemplate() importTemplateData.templateUrl = await DeviceRepairApi.importTemplate()
}) })
</script> </script>

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

@ -26,9 +26,17 @@
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="MoldRepairRules" <BasicForm
:formAllSchemas="MoldRepair.allSchemas" :apiUpdate="MoldRepairApi.updateMoldRepair" ref="basicFormRef"
:apiCreate="MoldRepairApi.createMoldRepair" @searchTableSuccess="searchTableSuccess" :isBusiness="false" /> @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" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="MoldRepair.allSchemas" />
@ -43,11 +51,7 @@ import download from '@/utils/download'
import { MoldRepair, MoldRepairRules } from './moldRepair.data' import { MoldRepair, MoldRepairRules } from './moldRepair.data'
import * as MoldRepairApi from '@/api/eam/mold/moldRepair' import * as MoldRepairApi from '@/api/eam/mold/moldRepair'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { selectAllFactoryArea } from '@/api/system/dept' import * as MoldAccountApi from '@/api/eam/mold/moldAccount'
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'
defineOptions({ name: 'MoldRepair' }) defineOptions({ name: 'MoldRepair' })
@ -56,7 +60,6 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
const factoryAreaList = ref([])
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(MoldRepair.allSchemas.tableColumns) const tableColumns = ref(MoldRepair.allSchemas.tableColumns)
@ -252,4 +255,8 @@ onMounted(async () => {
importTemplateData.templateUrl = await MoldRepairApi.importTemplate() importTemplateData.templateUrl = await MoldRepairApi.importTemplate()
}) })
const onChange = (field, cur, item) => {
}
</script> </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 { dateFormatter } from '@/utils/formatTime'
import { selectAllFactoryArea } from '@/api/system/dept' import { selectAllFactoryArea } from '@/api/system/dept'
import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts' import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts'
// 邮箱账号的列表 // 邮箱账号的列表
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const moldList = ref([]); const moldList = ref([]);
const moldListNoPage = await MoldAccountsApi.getMoldAccountsAllNoPage({
status: '0'
} as MoldAccountsApi.MoldAccountsVO)
// 表单校验 // 表单校验
export const MoldRepairRules = reactive({ export const MoldRepairRules = reactive({
number: [required], number: [required],
moldNumber: [required], deviceNumber: [required],
factoryAreaNumber: [required], factoryAreaNumber: [required],
declarer: [required], declarer: [required],
faultType: [required], faultType: [required],
@ -72,11 +77,11 @@ export const MoldRepair = useCrudSchemas(reactive<CrudSchema[]>([
valueField: 'id' valueField: 'id'
}, },
onChange: (val) => { onChange: (val) => {
MoldAccountsApi.getMoldAccountsPage({ MoldAccountsApi.getMoldAccountsNoPage({
isSearch: false, isSearch: false,
factoryAreaNumber: val factoryAreaNumber: val
}).then((res) => { }).then((res) => {
moldList.value = res?.list moldList.value = res
}).catch((e) => { }).catch((e) => {
console.log(e) console.log(e)
}) })
@ -86,12 +91,16 @@ export const MoldRepair = useCrudSchemas(reactive<CrudSchema[]>([
}, },
{ {
label: '模具', label: '模具',
field: 'moldNumber', field: 'deviceNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: '150', width: '150',
}, },
isSearch: true, isSearch: true,
api: () => moldListNoPage,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return moldListNoPage.find((account) => account.number == cellValue)?.name
},
form: { form: {
component: 'Select', component: 'Select',
componentProps: { componentProps: {

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

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

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

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

Loading…
Cancel
Save