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. 98
      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 { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as UserApi from '@/api/system/user'
import { fa } from 'element-plus/es/locale'
// 邮箱账号的列表
const factoryList = await selectAllFactoryArea()
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({})
@ -16,6 +17,13 @@ const userListAll = await UserApi.getSimpleUserList()
const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'DEVICE')
const deviceDeviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
const isConformList = [{
label:'是',
value:'TRUE'
},{
label:'否',
value:'FALSE'
}]
// 表单校验
export const DeviceSpotInspectionRecordMainRules = reactive({
deviceNumber: [required],
@ -81,6 +89,7 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
isDetail:false,
form: {
component: 'Select',
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: '状态',
field: 'status',
@ -140,6 +161,9 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
placeholder: "请选择设备"
}
},
detail:{
dictType:DICT_TYPE.APP_DEVICE_MOLD_TYPE
}
},
{
label: '描述',
@ -190,6 +214,9 @@ export const DeviceSpotInspectionRecordDetail = useCrudSchemas(reactive<CrudSche
table: {
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 defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user'
import * as UserApi from '@/api/system/user'
defineOptions({ name: 'DeviceSpotInspectionRecordMain' })
const message = useMessage() //
@ -288,7 +289,9 @@ const openForm = (type: string, row?: any) => {
/** 详情操作 */
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')
}

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

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

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

@ -1,20 +1,36 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ProblemSolving.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="ProblemSolving.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="ProblemSolving.allSchemas" />
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ProblemSolving.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
<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">
}"
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>
@ -27,16 +43,27 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="ProblemSolvingRules"
:formAllSchemas="ProblemSolving.allSchemas" :apiUpdate="ProblemSolvingApi.updateProblemSolving"
:apiCreate="ProblemSolvingApi.createProblemSolving" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<BasicForm
ref="basicFormRef"
@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" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/item-accounts/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/eam/item-accounts/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
@ -81,7 +108,7 @@
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultAddBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -94,16 +121,22 @@
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
@ -111,14 +144,16 @@
// -
const butttondata = [
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
defaultButtons.mainListDeleteBtn(null) //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
@ -127,31 +162,34 @@
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
// 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 {
name: item,
url: item
}
})
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType, data) => {
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 (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间')
return;
return
}
}
if (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null;
data.filePathList=[];
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);
data.filePathList.push(data.filePathListView[i].url)
}
if (formType === 'create') {
await ProblemSolvingApi.createProblemSolving(data)

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

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

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

@ -129,21 +129,8 @@
// form
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;
data.filePathList = [];
for (let i = 0; i < data.filePathList.length; i++) {
data.filePathList.push(data.filePathList[i].url);
}
data.filePathList = data.filePathList.map(item=>item.url)
if (formType === 'create') {
await ReplaceItemDesApi.createReplaceItemDes(data)
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({
itemNumber: [required],
areaNumber: [required],
concurrencyStamp: [required],
number: [required],
filePathList: [required],
})
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: '完成时间',
field: 'finishedTime',
field: 'completionTime',
sort: 'custom',
isSearch: false,
table: {

Loading…
Cancel
Save