|
@ -4,63 +4,45 @@ |
|
|
<Search :schema="DeviceMaintenanceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
<Search :schema="DeviceMaintenanceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
<!-- 列表头部 --> |
|
|
<TableHead |
|
|
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" |
|
|
:HeadButttondata="HeadButttondata" |
|
|
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" |
|
|
@button-base-click="buttonBaseClick" |
|
|
:allSchemas="DeviceMaintenanceMain.allSchemas" /> |
|
|
:routeName="routeName" |
|
|
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
|
|
:allSchemas="DeviceMaintenanceMain.allSchemas" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
<!-- 列表 --> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<Table |
|
|
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{ |
|
|
:columns="tableColumns" |
|
|
total: tableObject.total |
|
|
:data="tableObject.tableList" |
|
|
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" |
|
|
:loading="tableObject.loading" |
|
|
v-model:sort="tableObject.sort"> |
|
|
:pagination="{ |
|
|
<template #code="{ row }"> |
|
|
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)"> |
|
|
<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(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" /> |
|
|
</template> |
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<BasicForm |
|
|
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="DeviceMaintenanceMainRules" |
|
|
ref="basicFormRef" |
|
|
:formAllSchemas="DeviceMaintenanceMain.allSchemas" :apiUpdate="DeviceMaintenanceMainApi.updateDeviceMaintenanceMain" |
|
|
@success="formsSuccess" |
|
|
:apiCreate="DeviceMaintenanceMainApi.createDeviceMaintenanceMain" @searchTableSuccess="searchTableSuccess" |
|
|
:rules="DeviceMaintenanceMainRules" |
|
|
:isBusiness="false" @onChange="onChange" /> |
|
|
:formAllSchemas="DeviceMaintenanceMain.allSchemas" |
|
|
|
|
|
:apiUpdate="DeviceMaintenanceMainApi.updateDeviceMaintenanceMain" |
|
|
|
|
|
:apiCreate="DeviceMaintenanceMainApi.createDeviceMaintenanceMain" |
|
|
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
|
|
:isBusiness="false" |
|
|
|
|
|
@onChange="onChange" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMaintenanceMain.allSchemas" /> |
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMaintenanceMain.allSchemas" /> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/eam/device-maintenance-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
<ImportForm ref="importFormRef" url="/eam/device-maintenance-main/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 { DeviceMaintenanceMain,DeviceMaintenanceMainRules } from './deviceMaintenanceMain.data' |
|
|
import { DeviceMaintenanceMain, DeviceMaintenanceMainRules } from './deviceMaintenanceMain.data' |
|
|
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain' |
|
|
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain' |
|
|
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' |
|
@ -146,19 +128,19 @@ const butttondata = (row) => { |
|
|
defaultButtons.mainListEditBtn(null), // 编辑 |
|
|
defaultButtons.mainListEditBtn(null), // 编辑 |
|
|
// defaultButtons.mainListDeleteBtn(null), // 删除 |
|
|
// defaultButtons.mainListDeleteBtn(null), // 删除 |
|
|
// defaultButtons.backoutBtn(null), // 撤销吗,,,, |
|
|
// defaultButtons.backoutBtn(null), // 撤销吗,,,, |
|
|
defaultButtons.acceptOrderBtn({ hide: !(row.status == 'PENDING' && userStore?.userSelfInfo?.posts?.some((item) => item.code == 'worker'))}), // 接单 |
|
|
defaultButtons.mainListDetailBtn(null), // 查看详情 |
|
|
|
|
|
defaultButtons.acceptOrderBtn({ hide: !(row.status == 'PENDING' && userStore?.userSelfInfo?.posts?.some((item) => item.code == 'worker')) }), // 接单 |
|
|
defaultButtons.turnOrderBtn({ hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) }), // 转办 |
|
|
defaultButtons.turnOrderBtn({ hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) }), // 转办 |
|
|
defaultButtons.finishOrderBtn({ hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)}), // 完成 |
|
|
|
|
|
defaultButtons.verifyOrderBtn({ hide: !(row.status == 'COMPLETED' && userStore?.userSelfInfo?.posts?.some((item) => item.code == 'engineer')) }), // 验证 |
|
|
|
|
|
defaultButtons.repairBtn({ hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) }), // 维修 |
|
|
defaultButtons.repairBtn({ hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) }), // 维修 |
|
|
defaultButtons.mainListDetailBtn(null), // 查看详情 |
|
|
defaultButtons.verifyOrderBtn({ hide: !(row.status == 'COMPLETED' && userStore?.userSelfInfo?.posts?.some((item) => item.code == 'engineer')) }), // 验证 |
|
|
|
|
|
defaultButtons.finishOrderBtn({ hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) }), // 完成 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
const onChange = (field, cur, item) => { |
|
|
const onChange = (field, cur, item) => { |
|
|
// 当有效天数 和 生效时间 发生变化 |
|
|
// 当有效天数 和 生效时间 发生变化 |
|
|
console.log(field) |
|
|
console.log(field) |
|
|
console.log(cur) |
|
|
console.log(cur) |
|
|
if(field == 'deviceNumber'){ |
|
|
if (field == 'deviceNumber') { |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[1].componentProps.disabled = true; |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[1].componentProps.disabled = true; |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[2].componentProps.disabled = true; |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[2].componentProps.disabled = true; |
|
|
basicFormRef.value.formRef.formModel.factoryAreaNumber = Number(item.componentProps.options.find(item => item.number == cur).factoryAreaNumber) |
|
|
basicFormRef.value.formRef.formModel.factoryAreaNumber = Number(item.componentProps.options.find(item => item.number == cur).factoryAreaNumber) |
|
@ -172,14 +154,13 @@ const buttonTableClick = async (val, row) => { |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = true; |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = true; |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { // 删除 |
|
|
handleDelete(row.id) |
|
|
handleDelete(row.id) |
|
|
} else if (val == 'acceptOrder') { |
|
|
} else if (val == 'acceptOrder') { |
|
|
acceptOrder(row) |
|
|
acceptOrder(row) |
|
|
} else if (val == 'turnOrder') { |
|
|
} else if (val == 'turnOrder') { |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[3].componentProps.disabled = false; |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[3].componentProps.disabled = false; |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[2].componentProps.disabled = false; |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[2].componentProps.disabled = false; |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[1].componentProps.disabled = true; |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[1].componentProps.disabled = true; |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = true; |
|
|
DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = true; |
|
|
debugger |
|
|
|
|
|
openForm('turnOrder', row) |
|
|
openForm('turnOrder', row) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -191,20 +172,20 @@ const openForm = (type: string, row?: any) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// form表单提交 |
|
|
// form表单提交 |
|
|
const formsSuccess = async (formType,data) => { |
|
|
const formsSuccess = async (formType, data) => { |
|
|
var isHave =DeviceMaintenanceMain.allSchemas.formSchema.some(function (item) { |
|
|
var isHave = DeviceMaintenanceMain.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.activeTime == 0) data.activeTime = null; |
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
if (data.expireTime == 0) data.expireTime = null; |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
|
|
|
|
|
|
data.status = 'PECEIVED' |
|
|
data.status = 'PECEIVED' |
|
|
await DeviceMaintenanceMainApi.createDeviceMaintenanceMain(data) |
|
|
await DeviceMaintenanceMainApi.createDeviceMaintenanceMain(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
@ -235,7 +216,7 @@ const handleDelete = async (id: number) => { |
|
|
message.success(t('common.delSuccess')) |
|
|
message.success(t('common.delSuccess')) |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch {} |
|
|
} catch { } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
/** 导出按钮操作 */ |
|
@ -284,24 +265,24 @@ function acceptOrder(row) { |
|
|
} |
|
|
} |
|
|
// 转办 |
|
|
// 转办 |
|
|
function turnOrder() { |
|
|
function turnOrder() { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
// 完成 |
|
|
// 完成 |
|
|
function finishOrder() { |
|
|
function finishOrder() { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
// 验证 |
|
|
// 验证 |
|
|
function verifyOrder() { |
|
|
function verifyOrder() { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
// 维修 |
|
|
// 维修 |
|
|
function repair() { |
|
|
function repair() { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 详情 |
|
|
// 详情 |
|
|
function mainListDetail() { |
|
|
function mainListDetail() { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|