Browse Source

工艺菜单添加

master
ljlong_2630 7 months ago
parent
commit
3e1b3ddaeb
  1. 6
      src/api/eam/device/deviceMaintenanceDetail/index.ts
  2. 3
      src/api/eam/device/deviceMaintenanceMain/index.ts
  3. 1
      src/api/eam/device/deviceRepair/index.ts
  4. 51
      src/api/eam/device/techMaintenanceDetail/index.ts
  5. 95
      src/api/eam/device/techMaintenanceMain/index.ts
  6. 69
      src/api/eam/device/techRepair/index.ts
  7. 12
      src/views/eam/device/deviceRepair/deviceRepair.data.ts
  8. 5
      src/views/eam/device/deviceRepair/index.vue
  9. 16
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  10. 334
      src/views/eam/device/techRepair/index.vue
  11. 245
      src/views/eam/device/techRepair/techRepair.data.ts
  12. 1195
      src/views/eam/device/techmaintenancejob/index.vue
  13. 937
      src/views/eam/device/techmaintenancejob/techMaintenanceMain.data.ts

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

@ -12,7 +12,7 @@ export const getDeviceMaintenanceDetailPage = async (params) => {
  if (params.isSearch) {
    delete params.isSearch
    const data = {...params}
    return await request.post({ url: '/wms/purchasereceipt-request-detail/senior', data })
    return await request.post({ url: '/eam/device-maintenance-job-detail/senior', data })
  } else {
    return await request.get({ url: `/eam/device-maintenance-job-detail/page`, params })
  }
@ -42,10 +42,10 @@ export const deleteDeviceMaintenanceDetail = async (id: number) => {
// 导出维修工单子 Excel
export const exportPurchasereceiptRequestDetail = async (params) => {
  return await request.download({ url: `/wms/purchasereceipt-request-detail/export-excel`, params })
  return await request.download({ url: `/eam/device-maintenance-job-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
  return request.download({ url: '/wms/purchasereceipt-request-detail/get-import-template' })
  return request.download({ url: '/eam/device-maintenance-job-detail/get-import-template' })
}

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

@ -16,8 +16,9 @@ export interface DeviceMaintenanceMainVO {
concurrencyStamp: number
}
// 查询维修工单主列表
// 查询设备维修工单主列表
export const getDeviceMaintenanceMainPage = async (params) => {
params.type = 'DEVICE'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

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

@ -17,6 +17,7 @@ export interface DeviceRepairVO {
// 查询报修申请列表
export const getDeviceRepairPage = async (params) => {
params.type = 'DEVICE'
if (params.isSearch) {
delete params.isSearch
const data = { ...params }

51
src/api/eam/device/techMaintenanceDetail/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface DeviceMaintenanceDetailVO {
  describes: string
  describes1: string
  workOut: string
  maintenances: string
}
// 查询维修工单子列表
export const getDeviceMaintenanceDetailPage = async (params) => {
  if (params.isSearch) {
    delete params.isSearch
    const data = {...params}
    return await request.post({ url: '/eam/tech-maintenance-job-detail/senior', data })
  } else {
    return await request.get({ url: `/eam/tech-maintenance-job-detail/page`, params })
  }
}
// 查询维修工单子详情
export const getPurchasereceiptRequestDetail = async (id) => {
  return await request.get({ url: `/eam/tech-maintenance-job-detail/selectListByNumber?id=` + id })
}
// 新增维修工单子
export const createDeviceMaintenanceDetail = async (data: DeviceMaintenanceDetailVO) => {
  return await request.post({ url: `/eam/tech-maintenance-job-detail/create`, data })
}
// 修改维修工单子
export const updateDeviceMaintenanceDetail = async (data: DeviceMaintenanceDetailVO) => {
  return await request.put({ url: `/eam/tech-maintenance-job-detail/update`, data })
}
// 删除维修工单子
export const deleteDeviceMaintenanceDetail = async (id: number) => {
  return await request.delete({ url: `/eam/tech-maintenance-job-detail/delete?id=` + id })
}
// 导出维修工单子 Excel
export const exportPurchasereceiptRequestDetail = async (params) => {
  return await request.download({ url: `/eam/tech-maintenance-job-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
  return request.download({ url: '/eam/tech-maintenance-job-detail/get-import-template' })
}

95
src/api/eam/device/techMaintenanceMain/index.ts

@ -0,0 +1,95 @@
import request from '@/config/axios'
export interface DeviceMaintenanceMainVO {
id: number
number: string
requestNumber: string
describe: string
deviceNumber: string
factoryAreaNumber: string
maintenance: number
maintenancePhone: string
status: string
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询工艺维修工单主列表
export const getTechMaintenanceMainPage = async (params) => {
params.type = 'TECH'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/tech-maintenance-job-main/senior', data })
} else {
return await request.get({ url: `/eam/tech-maintenance-job-main/page`, params })
}
}
// 查询维修工单主详情
export const getDeviceMaintenanceMain = async (id: number) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/get?id=` + id })
}
// 新增维修工单主
export const createDeviceMaintenanceMain = async (data: DeviceMaintenanceMainVO) => {
return await request.post({ url: `/eam/tech-maintenance-job-main/createPC`, data })
}
// 修改维修工单主
export const updateDeviceMaintenanceMain = async (data: DeviceMaintenanceMainVO) => {
return await request.put({ url: `/eam/tech-maintenance-job-main/update`, data })
}
// 删除维修工单主
export const deleteDeviceMaintenanceMain = async (id: number) => {
return await request.delete({ url: `/eam/tech-maintenance-job-main/delete?id=` + id })
}
// 导出维修工单主 Excel
export const exportDeviceMaintenanceMain = async (params) => {
return await request.download({ url: `/eam/tech-maintenance-job-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/tech-maintenance-job-main/get-import-template' })
}
// 修改维修工单主
export const orderStepChange = async (data: DeviceMaintenanceMainVO) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/orderClick?number=`+data.number+`&status=`+data.status+`&id=`+data.id+`&requestNumber=`+data.requestNumber })
}
// 修改维修工单主
export const orderTurnTo = async (data: DeviceMaintenanceMainVO) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/turnTo?deviceNumber=`+data.deviceNumber +`&id=`+data.id + `&receiverType=`+ data.type +`&receiverUserId=` + data.maintenance })
}
// 查询维修工单主列表不分页
export const getDeviceMainTempList = async (type: String) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/getList?type=` + type })
}
// 完成维修工单
export const finishOrder = async (params) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/orderClickFinish`, params})
}
// 校验维修工单
export const verifyOrder = async (params) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/orderClickVerify`, params})
}
// 确认维修工单
export const confirmOrder = async (params) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/orderClickConfirm`, params})
}

69
src/api/eam/device/techRepair/index.ts

@ -0,0 +1,69 @@
import request from '@/config/axios'
export interface DeviceRepairVO {
id: number
number: string
describe: string
deviceNumber: string
factoryAreaNumber: string
declarer: number
declarerPhone: string
faultType: string
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询报修申请列表
export const getDeviceRepairPage = async (params) => {
params.type = 'TECH'
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/tech-repair-request/senior', data })
} else {
return await request.get({ url: `/eam/tech-repair-request/page`, params })
}
}
// 查询报修申请详情
export const getDeviceRepair = async (id: number) => {
return await request.get({ url: `/eam/tech-repair-request/get?id=` + id })
}
// 新增报修申请
export const createDeviceRepair = async (data: DeviceRepairVO) => {
return await request.post({ url: `/eam/tech-repair-request/create`, data })
}
// 修改报修申请
export const updateDeviceRepair = async (data: DeviceRepairVO) => {
return await request.put({ url: `/eam/tech-repair-request/update`, data })
}
// 删除报修申请
export const deleteDeviceRepair = async (id: number) => {
return await request.delete({ url: `/eam/tech-repair-request/delete?id=` + id })
}
// 导出报修申请 Excel
export const exportDeviceRepair = async (params) => {
return await request.download({ url: `/eam/tech-repair-request/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/tech-repair-request/get-import-template' })
}
// 撤销申请
export const cancel = (id: Number) => {
return request.delete({ url: '/eam/tech-repair-request/cancel?id=' + id })
}
// 根据单号查询申请工单信息
export const getOrderByNumber = (number: Number) => {
return request.get({ url: '/eam/tech-repair-request/getOrderByNumber?number=' + number })
}

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

@ -96,17 +96,6 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
},
isSearch: true,
search: {
component: 'Select',
componentProps: {
options: deviceTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
filterable: true,
},
},
form: {
component: 'Select',
componentProps: {
@ -115,6 +104,7 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
labelField: 'label',
valueField: 'value'
},
// disabled: true,
filterable: true,
placeholder: "请选择设备"
}

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

@ -180,6 +180,11 @@ const buttonTableClick = async (val, row) => {
const basicFormRef = ref()
const basicFormViewRef = ref()
const openForm = (type: string, row?: any) => {
// if(type == 'create'){
// DeviceRepair.allSchemas.formSchema.find(item => {
// return item.field == 'type'
// }).value = 'DEVICE'
// }
if (type == 'view') {
showView.value = true
urls.value = row.filePathList

16
src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts

@ -216,17 +216,6 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
},
// dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE,
isSearch: true,
search: {
component: 'Select',
componentProps: {
options: deviceTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
filterable: true,
},
},
form: {
component: 'Select',
componentProps: {
@ -235,10 +224,11 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
labelField: 'label',
valueField: 'value'
},
// disabled: true,
disabled: true,
filterable: true,
placeholder: "请选择设备"
}
},
value: 'DEVICE'
},
},
{

334
src/views/eam/device/techRepair/index.vue

@ -0,0 +1,334 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceRepair.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="DeviceRepair.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 #upload="{ row }">
<ButtonBase v-if="row.filePathList != null && row.filePathList.length != 0" :Butttondata="butttondataView(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<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" />
<Dialog
ref="basicFormViewRef"
v-model="showView"
:key="viewKey"
:closeOnClickModal="true"
:title="viewTitle"
>
<el-image v-for="url in urls" :key="url" :src="url" lazy />
</Dialog>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/tech-repair-request/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceRepair, DeviceRepairRules } from './techRepair.data'
import * as DeviceRepairApi from '@/api/eam/device/techRepair'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as DeviceAccountApi from '@/api/eam/device/deviceAccounts'
import { DeviceAccounts } from '../deviceAccounts/deviceAccounts.data'
import { useUserStore } from '@/store/modules/user'
// 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: 'TechRepair' })
const userStore = useUserStore()
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
const showView = ref(false)
const viewTitle = ref('图片预览')
const urls = ref([])
const viewKey = ref(0)
routeName.value = route.name
const tableColumns = ref(DeviceRepair.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: DeviceRepairApi.getDeviceRepairPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:tech-repair-request:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'eam:tech-repair-request:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'eam:tech-repair-request: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 = (row) => {
return [
// defaultButtons.mainListEditBtn({hasPermi:'eam:deviceRepair:update'}), //
// defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:deviceRepair:delete' }), //
defaultButtons.backoutBtn({hasPermi:'eam:tech-repair-request:cancel', hide: !(row.result == 'PENDING' && row.declarer == userStore.getUser.id )}), //
]
}
// -
const butttondataView = (row) => {
return [
defaultButtons.viewBtn(null),
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'backout') { //
handleBackout(row)
} else if (val == 'view') { //
openForm('view', row)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const basicFormViewRef = ref()
const openForm = (type: string, row?: any) => {
// if(type == 'create'){
// DeviceRepair.allSchemas.formSchema.find(item => {
// return item.field == 'type'
// }).value = 'TECH'
// }
if (type == 'view') {
showView.value = true
urls.value = row.filePathList
viewKey.value += 1
} else {
basicFormRef.value.open(type, row)
}
}
// form
const formsSuccess = async (formType, data) => {
var isHave = DeviceRepair.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;
data.result = 'PENDING';
if (data.upload != null && data.upload != "") {
data.filePathList = data?.upload?.map((item: any) => {
return item.url
})
}
if (formType === 'create') {
await DeviceRepairApi.createDeviceRepair(data)
message.success(t('common.createSuccess'))
} else {
await DeviceRepairApi.updateDeviceRepair(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, 'basicDeviceRepair')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceRepairApi.deleteDeviceRepair(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 DeviceRepairApi.exportDeviceRepair(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() //
}
// function getAllFactoryAreaList() {
// selectAllFactoryArea().then(res => {
// factoryAreaList.value = res.data
// })
// }
function handleBackout(row) {
if (row.result != 'PENDING') {
message.error('该报修单正在处理中,不能撤销!')
}
DeviceRepairApi.cancel(row.id).then(res => {
console.log("撤销成功!")
getList() //
})
}
const onChange = (field, cur, item,formRef) => {
if (field == 'factoryAreaNumber') {
nextTick(() => {
const setV = {}
setV['deviceNumber'] = ''
formRef.setValues(setV)
})
}
// if (field == 'factoryAreaNumber') {
// //
// debugger
// delete DeviceRepair.allSchemas.formSchema.find(item => {
// return item.field == 'deviceNumber'
// }).value
// }
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await DeviceRepairApi.importTemplate()
})
</script>

245
src/views/eam/device/techRepair/techRepair.data.ts

@ -0,0 +1,245 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { selectAllFactoryArea } from '@/api/system/dept'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator'
import * as UserApi from '@/api/system/user'
const userListAll = await UserApi.getSimpleUserList()
// 邮箱账号的列表
const factoryList = await selectAllFactoryArea()
const deviceList = ref([]);
const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD')
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
// 表单校验
export const DeviceRepairRules = reactive({
number: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
declarer: [required],
faultType: [required],
type: [required],
available: [required],
declarerPhone: [
required,
{ validator:validateHanset, message: '输入手机号格式不正确', trigger: 'blur'}
]
// result: [required],
})
export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '报修工单编号',
field: 'number',
sort: 'custom',
table: {
width: '150',
fixed: 'left',
},
isSearch: false,
isForm: false
},
{
label: '厂区',
field: 'factoryAreaNumber',
sort: 'custom',
table: {
width: '150',
},
api: () => factoryList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
onChange: (val) => {
DeviceAccountsApi.getDeviceAccountsNoPage({
isSearch: false,
factoryAreaNumber: val
}).then((res) => {
deviceList.value = res
}).catch((e) => {
console.log(e)
})
}
},
}
},
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
},
isSearch: true,
form: {
component: 'Select',
componentProps: {
options: deviceTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
// disabled: true,
filterable: true,
placeholder: "请选择设备"
}
},
},
{
label: '设备',
field: 'deviceNumber',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
api: () => DeviceAccountsApi.getDeviceAccountsNoPage({
isSearch: false
}),
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListNoPage.find((account) => account.number == cellValue)?.name
},
search: {
component: 'Select',
componentProps: {
options: deviceListNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
},
},
form: {
component: 'Select',
componentProps: {
options: deviceList,
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
},
}
},
{
label: '报修人电话',
field: 'declarerPhone',
sort: 'custom',
table: {
width: '150',
},
},
{
label: '报修人',
field: 'declarer',
sort: 'custom',
table: {
width: '150',
},
isForm: false,
isDetail: false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
search: {
component: 'Select',
componentProps: {
options: userListAll,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
},
},
},
// {
// label: '故障类型',
// field: 'faultType',
// sort: 'custom',
// table: {
// width: '150',
// },
// dictType: DICT_TYPE.FAULT_TYPE,
// dictClass: 'string',
// form: {
// component: 'Select'
// },
// },
{
label: '描述',
field: 'describes',
sort: 'custom',
table: {
width: '150',
},
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{
label: '维修状态',
field: 'result',
sort: 'custom',
table: {
width: '150',
},
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
isSearch: true,
isForm: false,
form: {
component: 'Select',
},
},
{
label: '图片',
field: 'upload',
isForm: true,
form: {
component: 'UploadImgs',
componentProps: {
limit:3,
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

1195
src/views/eam/device/techmaintenancejob/index.vue

File diff suppressed because it is too large

937
src/views/eam/device/techmaintenancejob/techMaintenanceMain.data.ts

@ -0,0 +1,937 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { selectAllFactoryArea } from '@/api/system/dept'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import { useUserStore } from '@/store/modules/user'
import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
import * as UserApi from '@/api/system/user'
import { getStrDictOptions } from '@/utils/dict'
import { selecUserByType } from '@/api/system/dept'
const userStore = useUserStore()
const factoryList = await selectAllFactoryArea()
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({})
const userListAll = await UserApi.getSimpleUserList()
const deviceListAll = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null })
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD')
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
// 表单校验
export const DeviceMaintenanceMainRules = reactive({
number: [required],
requestNumber: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
maintenance: [required],
type: [required],
classes: [required],
faultType: [required],
describes: [
required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
})
export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '维修工单编号',
field: 'number',
sort: 'custom',
table: {
width: '150',
fixed: 'left',
},
isSearch: false,
isForm: false,
},
{
label: '报修工单编号',
field: 'requestNumber',
sort: 'custom',
table: {
width: '150',
},
isForm: false,
isSearch: false,
isTable: true,
},
{
label: '设备',
field: 'deviceNumber',
sort: 'custom',
table: {
width: '150',
},
isDetail: false,
api: () => deviceList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListAll.find((account) => account.number == cellValue)?.name
},
search: {
show: false,
component: 'Input',
api: () => deviceList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => deviceList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
},
}
},
{
label: '设备',
field: 'deviceNumberDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '厂区',
field: 'factoryAreaNumber',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => factoryList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => factoryList,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: "请先选择设备"
},
}
},
{
label: '厂区',
field: 'factoryAreaNumberDetail',
sort: 'custom',etail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
table: {
width: 150
}
},
{
label: '维修人',
field: 'maintenance',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
form: {
component: 'Select',
api: () => userListAll,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
placeholder: "请先选择设备"
},
},
isSearch: true,
search: {
component: 'Select',
api: () => userListAll,
componentProps: {
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
}
}
},
{
label: '维修人',
field: 'maintenanceDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
table: {
width: 150
}
},
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
isDetail: false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
},
// dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE,
isSearch: false,
form: {
component: 'Select',
componentProps: {
options: deviceTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
disabled: true,
filterable: true,
placeholder: "请选择设备"
},
},
},
{
label: '类型',
field: 'typeDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '班次',
field: 'classes',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
dictType: DICT_TYPE.MAINTENANCE_SHIFT,
dictClass: 'string',
form: {
component: 'Select'
},
},
{
label: '故障类型',
field: 'faultType',
sort: 'custom',
table: {
width: '150',
},
isDetail: false,
isSearch: false,
dictType: DICT_TYPE.FAULT_TYPE,
dictClass: 'string',
form: {
component: 'Select'
},
},
{
label: '描述',
field: 'describes',
sort: 'custom',
table: {
width: '150',
},
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{
label: '是否完成',
field: 'status',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isTable: true,
isForm: false,
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
disabled: false,
}
},
tableForm: {
type: 'Select',
componentProps: {
disabled: false,
}
},
},
{
label: '完成方式',
field: 'result',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isTable: true,
isForm: false,
dictType: DICT_TYPE.ORDER_COMPLETE_RESULT,
dictClass: 'string',
},
{
label: '报修人',
field: 'declarer',
sort: 'custom',
isDetail: false,
isForm: false,
isSearch: true,
table: {
width: '150',
},
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
search: {
component: 'Select',
api: () => userListAll,
componentProps: {
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
}
}
},
{
label: '报修人',
field: 'declarerDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
table: {
width: 150
}
},
{
label: '报修人意见',
field: 'applyContent',
sort: 'custom',
isForm: false,
table: {
width: 150
}
},
{
label: '验证人',
field: 'verifyer',
sort: 'custom',
isDetail: false,
isForm: false,
table: {
width: '150',
},
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
isSearch: true,
search: {
component: 'Select',
api: () => userListAll,
componentProps: {
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
}
}
},
{
label: '验证人',
field: 'verifyerDetail',
sort: 'custom',
table: {
width: 150
},
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '验证人意见',
field: 'verifyContent',
sort: 'custom',
isForm: false,
table: {
width: 150
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 300,
fixed: 'right'
},
isDetail: false
}
]))
export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '维修编号',
field: 'number',
sort: 'custom',
isSearch: false,
form: {
component: 'Input',
componentProps: {
disabled: true
}
},
},
{
label: '故障描述',
field: 'describes',
sort: 'custom',
table: {
},
isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{
label: '故障真因',
field: 'describes1',
sort: 'custom',
table: {
},
isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{
label: '解决措施',
field: 'workOut',
sort: 'custom',
table: {
},
isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{
label: '维修人',
field: 'maintenances',
sort: 'custom',
isDetail: false,
// formatter: (_: Recordable, __: TableColumn, cellValue) => {
// let cellValueList = []
// if (Array.isArray(cellValue)) {
// cellValueList = cellValue
// } else {
// cellValueList = cellValue ? cellValue.split(',') : [];
// }
// // const cellValueList = cellValue ? cellValue.split(',') : [];
// return userListAll
// .filter(item => cellValueList.includes(item.id.toString()))
// .map(item => item.nickname)
// .join(',');
// },
isTable:true,
tableForm: {
type: 'Select',
initOptions: userListAll,
multiple: true,
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
},
form: {
component: 'Select',
// api: () => dutyUserList,
componentProps: {
multiple: true,
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
}
},
{
label: '维修人',
field: 'maintenancesName',
sort: 'custom',
isForm:false,
isDetail:true,
isTable:false,
isTableForm:false
},
{
label: '备件',
field: 'itemNumbers1',
sort: 'custom',
table: {
},
tableForm: {
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件',
searchField: 'itemNumbers1',
searchTitle: '备件',
multiple: true,
searchAllSchemas: ItemSearchTable.allSchemas,
searchPage: ItemApi.getItemList,
searchCondition: [{
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
}]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件', // 输入框占位文本
searchField: 'itemNumbers1', // 查询弹窗赋值字段
searchTitle: '备件', // 查询弹窗标题
multiple: true,
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
}]
}
},
isSearch: false,
},
{
label: '备件1',
field: 'itemNumbers',
sort: 'custom',
table: {
},
isForm: false,
isDetail: false,
isTable: false,
isSearch: false,
isTableForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 300,
fixed: 'right'
},
isDetail: false,
isTableForm: false,
}
]))
// 表单校验
export const DeviceMaintenanceDetailRules = reactive({
describes: [
required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
describes1: [
required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
workOut: [
required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
maintenances: [required],
})
// 表单校验
export const DeviceMaintenanceMainSecRules = reactive({
number: [required],
requestNumber: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
maintenance: [required],
turnType: [required],
type: [required],
classes: [required],
faultType: [required],
describes: [
required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
})
export const DeviceMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '维修工单编号',
field: 'number',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isForm: false,
},
{
label: '报修工单编号',
field: 'requestNumber',
sort: 'custom',
table: {
width: '150',
},
isForm: false,
isSearch: false,
isTable: true,
},
{
label: '转办类型',
field: 'turnType',
sort: 'custom',
isDetail: false,
isTable: false,
isSearch: false,
isForm: true,
dictType: DICT_TYPE.TURN_TYPE,
dictClass: 'string',
form: {
component: 'Select',
}
},
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
},
isSearch: true,
search: {
component: 'Select',
componentProps: {
options: deviceMoldTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
filterable: true,
},
},
form: {
component: 'Select',
componentProps: {
options: deviceMoldTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
filterable: true,
placeholder: "请选择设备"
}
},
},
{
label: '厂区',
field: 'factoryAreaNumber',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => factoryList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => factoryList,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: "请先选择设备"
},
}
},
{
label: '厂区',
field: 'factoryAreaNumber1',
sort: 'custom',
isDetail: true,
isSearch: false,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '设备模具',
field: 'deviceNumber',
sort: 'custom',
table: {
width: '150',
},
api: () => deviceList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListAll.find((account) => account.number == cellValue)?.name
},
search: {
show: false,
component: 'Input',
api: () => deviceList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => deviceList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
},
}
},
{
label: '维修人',
field: 'maintenance',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => dutyUserList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return dutyUserList.find((account) => account.id == cellValue)?.name
},
form: {
component: 'Select',
api: () => dutyUserList,
componentProps: {
disabled: false,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: "请先选择设备"
},
}
},
{
label: '维修人',
field: 'maintenance1',
sort: 'custom',
isDetail: true,
isSearch: false,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '班次',
field: 'classes',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
dictType: DICT_TYPE.MAINTENANCE_SHIFT,
dictClass: 'string',
form: {
component: 'Select'
},
},
{
label: '故障类型',
field: 'faultType',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
dictType: DICT_TYPE.FAULT_TYPE,
dictClass: 'string',
form: {
component: 'Select'
},
},
{
label: '描述',
field: 'describes',
sort: 'custom',
table: {
width: '150',
},
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isTable: true,
isForm: false,
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
disabled: false,
}
},
tableForm: {
type: 'Select',
componentProps: {
disabled: false,
}
},
},
// {
// label: '完成方式',
// field: 'result',
// sort: 'custom',
// table: {
// width: '150',
// },
// isSearch: false,
// isTable: true,
// isForm: false,
// dictType: DICT_TYPE.ORDER_COMPLETE_RESULT,
// dictClass: 'string',
// },
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 300,
fixed: 'right'
},
isDetail: false
}
]))
Loading…
Cancel
Save