Browse Source

保养工单检修工单

master
zhang_li 8 months ago
parent
commit
bfa5fbe9ef
  1. 27
      src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts
  2. 5
      src/views/eam/device/deviceSpotInspectionRecordMain/index.vue
  3. 3
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  4. 396
      src/views/eam/device/problemSolving/index.vue
  5. 6
      src/views/eam/item/itemApplyMain/itemApplyMain.data.ts
  6. 15
      src/views/eam/item/replaceItemDes/index.vue
  7. 5
      src/views/eam/item/replaceItemDes/replaceItemDes.data.ts
  8. 2
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts

27
src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts

@ -8,6 +8,7 @@ import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item' import * as ItemApi from '@/api/eam/basic/item'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { fa } from 'element-plus/es/locale'
// 邮箱账号的列表 // 邮箱账号的列表
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({})
@ -16,6 +17,13 @@ const userListAll = await UserApi.getSimpleUserList()
const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({}) const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'DEVICE') const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'DEVICE')
const deviceDeviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) const deviceDeviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
const isConformList = [{
label:'是',
value:'TRUE'
},{
label:'否',
value:'FALSE'
}]
// 表单校验 // 表单校验
export const DeviceSpotInspectionRecordMainRules = reactive({ export const DeviceSpotInspectionRecordMainRules = reactive({
deviceNumber: [required], deviceNumber: [required],
@ -81,6 +89,7 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname return userListAll.find((account) => account.id == cellValue)?.nickname
}, },
isDetail:false,
form: { form: {
component: 'Select', component: 'Select',
api: () => userList, api: () => userList,
@ -93,6 +102,18 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
}, },
} }
}, },
{
label: '维修人',
field: 'maintenanceName',
sort: 'custom',
table: {
width: '150',
},
isForm:false,
isDetail:true,
isSearch:false,
isTable:false
},
{ {
label: '状态', label: '状态',
field: 'status', field: 'status',
@ -140,6 +161,9 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
placeholder: "请选择设备" placeholder: "请选择设备"
} }
}, },
detail:{
dictType:DICT_TYPE.APP_DEVICE_MOLD_TYPE
}
}, },
{ {
label: '描述', label: '描述',
@ -190,6 +214,9 @@ export const DeviceSpotInspectionRecordDetail = useCrudSchemas(reactive<CrudSche
table: { table: {
width: 'auto', width: 'auto',
}, },
formatter: (_: Recordable, __: TableColumn, cellValue: String) => {
return isConformList.find((account) => account.value == cellValue)?.label
},
}, },
{ {

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

@ -106,6 +106,7 @@ import * as DeviceSpotInspectionRecordMainApi from '@/api/eam/device/deviceSpotI
import * as DeviceSpotInspectionRecordDetailApi from '@/api/eam/device/deviceSpotInspectionRecordDetail' import * as DeviceSpotInspectionRecordDetailApi from '@/api/eam/device/deviceSpotInspectionRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import * as UserApi from '@/api/system/user'
defineOptions({ name: 'DeviceSpotInspectionRecordMain' }) defineOptions({ name: 'DeviceSpotInspectionRecordMain' })
const message = useMessage() // const message = useMessage() //
@ -288,7 +289,9 @@ const openForm = (type: string, row?: any) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail =async (row: any, titleName: any, titleValue: any) => {
const userListAll = await UserApi.getSimpleUserList()
row.maintenanceName = userListAll.find((account) => account.id == row.maintenance)?.nickname
detailRef.value.openDetail(row, titleName, titleValue,'DeviceSpotInspectionRecordMain') detailRef.value.openDetail(row, titleName, titleValue,'DeviceSpotInspectionRecordMain')
} }

3
src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts

@ -186,10 +186,11 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
detail:{ detail:{
dateFormat:'YYYY-MM-DD HH:mm:ss' dateFormat:'YYYY-MM-DD HH:mm:ss'
} }
}, },
{ {
label: '完成时间', label: '完成时间',
field: 'finishedTime', field: 'completionTime',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
table: { table: {

396
src/views/eam/device/problemSolving/index.vue

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

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

@ -327,6 +327,12 @@ export const ItemApplyDetailRules = reactive({
itemNumber: [ itemNumber: [
{ required: true, message: '请选择备件编号', trigger: 'change' } { required: true, message: '请选择备件编号', trigger: 'change' }
], ],
type: [
{ required: true, message: '请选择类型', trigger: 'change' }
],
deviceNumber: [
{ required: true, message: '请选择设备模具编号', trigger: 'change' }
],
qty: [ qty: [
{ required: true, message: '请输入申领数量', trigger: 'change' } { required: true, message: '请输入申领数量', trigger: 'change' }
], ],

15
src/views/eam/item/replaceItemDes/index.vue

@ -129,21 +129,8 @@
// form // form
const formsSuccess = async (formType, data) => { const formsSuccess = async (formType, data) => {
var isHave = ReplaceItemDes.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 (data.expireTime == 0) data.expireTime = null;
data.filePathList = []; data.filePathList = data.filePathList.map(item=>item.url)
for (let i = 0; i < data.filePathList.length; i++) {
data.filePathList.push(data.filePathList[i].url);
}
if (formType === 'create') { if (formType === 'create') {
await ReplaceItemDesApi.createReplaceItemDes(data) await ReplaceItemDesApi.createReplaceItemDes(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))

5
src/views/eam/item/replaceItemDes/replaceItemDes.data.ts

@ -6,9 +6,8 @@ import * as ItemApi from '@/api/eam/basic/item'
// 表单校验 // 表单校验
export const ReplaceItemDesRules = reactive({ export const ReplaceItemDesRules = reactive({
itemNumber: [required], number: [required],
areaNumber: [required], filePathList: [required],
concurrencyStamp: [required],
}) })
export const ReplaceItemDes = useCrudSchemas(reactive<CrudSchema[]>([ export const ReplaceItemDes = useCrudSchemas(reactive<CrudSchema[]>([

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

@ -180,7 +180,7 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '完成时间', label: '完成时间',
field: 'finishedTime', field: 'completionTime',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
table: { table: {

Loading…
Cancel
Save