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 { 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: {

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

@ -1,231 +1,269 @@
<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">
<template #code="{row}">
}"
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 #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</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">
import download from '@/utils/download'
import { ProblemSolving, ProblemSolvingRules } from './problemSolving.data'
import * as ProblemSolvingApi from '@/api/eam/device/problemSolving'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
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: '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)
})
}
import download from '@/utils/download'
import { ProblemSolving, ProblemSolvingRules } from './problemSolving.data'
import * as ProblemSolvingApi from '@/api/eam/device/problemSolving'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
defineOptions({ name: 'ProblemSolving' })
const message = useMessage() //
const { t } = useI18n() //
const { tableObject, tableMethods } = useTable({
getListApi: ProblemSolvingApi.getProblemSolvingPage //
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)
})
}
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(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 updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: ProblemSolvingApi.getProblemSolvingPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(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 = [
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
// -
const butttondata = [
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null) //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
// console.log(99,row)
row.filePathListView = row.filePathList.map(item=>{
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
// console.log(99,row)
console.log(row)
if (row&&row.filePathList && row.filePathList.length > 0) {
row.filePathListView = row.filePathList.map((item) => {
return {
name:item,
url:item
name: item,
url: item
}
})
basicFormRef.value.open(type, row)
}
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';
});
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.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'))
// form
const formsSuccess = async (formType, data) => {
var isHave = ProblemSolving.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
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicProblemSolving')
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)
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await ProblemSolvingApi.deleteProblemSolving(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
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()
}
/** 导出按钮操作 */
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 detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicProblemSolving')
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件台账导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ProblemSolvingApi.deleteProblemSolving(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 ProblemSolvingApi.exportProblemSolving(tableObject.params)
download.excel(data, '备件台账.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
/** 导入 */
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() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ProblemSolvingApi.importTemplate()
})
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ProblemSolvingApi.importTemplate()
})
</script>

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