|
|
@ -1,24 +1,33 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="MoldInspectionMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<Search |
|
|
|
:schema="MoldInspectionMain.allSchemas.searchSchema" |
|
|
|
@search="setSearchParams" |
|
|
|
@reset="setSearchParams" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" |
|
|
|
:allSchemas="MoldInspectionMain.allSchemas" /> |
|
|
|
<TableHead |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
@button-base-click="buttonBaseClick" |
|
|
|
:routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="MoldInspectionMain.allSchemas" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<Table |
|
|
|
:columns="tableColumns" |
|
|
|
:data="tableObject.tableList" |
|
|
|
:loading="tableObject.loading" |
|
|
|
<Table |
|
|
|
:columns="tableColumns" |
|
|
|
:data="tableObject.tableList" |
|
|
|
:loading="tableObject.loading" |
|
|
|
:pagination="{ |
|
|
|
total: tableObject.total |
|
|
|
}" |
|
|
|
v-model:pageSize="tableObject.pageSize" |
|
|
|
}" |
|
|
|
v-model:pageSize="tableObject.pageSize" |
|
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
|
v-model:sort="tableObject.sort" |
|
|
|
> |
|
|
@ -28,22 +37,25 @@ |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" /> |
|
|
|
<ButtonBase |
|
|
|
:Butttondata="butttondata(row)" |
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm |
|
|
|
ref="basicFormRef" |
|
|
|
@success="formsSuccess" |
|
|
|
<BasicForm |
|
|
|
ref="basicFormRef" |
|
|
|
@success="formsSuccess" |
|
|
|
:rules="MoldInspectionMainRules" |
|
|
|
:formAllSchemas="MoldInspectionMain.allSchemas" |
|
|
|
:formAllSchemas="MoldInspectionMain.allSchemas" |
|
|
|
:apiUpdate="MoldInspectionMainApi.updateMoldInspectionMain" |
|
|
|
:apiCreate="MoldInspectionMainApi.createMoldInspectionMain" |
|
|
|
:apiCreate="MoldInspectionMainApi.createMoldInspectionMain" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
:isBusiness="true" |
|
|
|
@onChange="onChange" |
|
|
|
:isBusiness="true" |
|
|
|
@onChange="onChange" |
|
|
|
:isShowReduceButton="isShowReduceButton" |
|
|
|
:tableAllSchemas="MoldInspectionDetailFilter.allSchemas" |
|
|
|
:tableFormRules="MoldInspectionAddDetailRules" |
|
|
@ -56,38 +68,43 @@ |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
|
<!-- <Detail ref="detailRef" :isBasic="true" :allSchemas="MoldInspectionDetail.allSchemas" /> --> |
|
|
|
<Detail ref="detailRef" |
|
|
|
:isBasic="false" |
|
|
|
<Detail |
|
|
|
ref="detailRef" |
|
|
|
:isBasic="false" |
|
|
|
:allSchemas="MoldInspectionMain.allSchemas" |
|
|
|
:detailAllSchemas="MoldInspectionDetailFilter.allSchemas" |
|
|
|
:detailAllSchemasRules="MoldInspectionDetailRules" |
|
|
|
:apiCreate="MoldInspectionDetailApi.createMoldInspectionDetail" |
|
|
|
:apiUpdate="MoldInspectionDetailApi.updateMoldInspectionDetail" |
|
|
|
:apiPage="MoldInspectionDetailApi.getMoldInspectionDetailPage" |
|
|
|
:apiDelete="MoldInspectionDetailApi.deleteMoldInspectionDetail" |
|
|
|
:apiDelete="MoldInspectionDetailApi.deleteMoldInspectionDetail" |
|
|
|
:Echo="Echo" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
@detailOpenForm="detailOpenForm" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
@detailOpenForm="detailOpenForm" |
|
|
|
:detailValidate="detailValidate" |
|
|
|
@detailSubmitForm="detailSubmitForm" |
|
|
|
:isSearchTableItem="true" |
|
|
|
@detailSubmitForm="detailSubmitForm" |
|
|
|
:isSearchTableItem="true" |
|
|
|
:openFormCallBack="openFormCallBack" |
|
|
|
@detailOnChange="detailOnChange" |
|
|
|
:buttonControllFunction="buttonControllFunction" |
|
|
|
:isShowAddBtn="isShowAddBtn" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/eam/mold-inspection-main/import" :importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" /> |
|
|
|
|
|
|
|
<ImportForm |
|
|
|
ref="importFormRef" |
|
|
|
url="/eam/mold-inspection-main/import" |
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" |
|
|
|
/> |
|
|
|
|
|
|
|
<Dialog |
|
|
|
<Dialog |
|
|
|
ref="verifyDialog" |
|
|
|
title="验证意见" |
|
|
|
title="验证意见" |
|
|
|
v-model="verifyDialogVisible" |
|
|
|
:width="600" |
|
|
|
:maxHeight="700" |
|
|
|
:style="{height:'450px'}" |
|
|
|
:style="{ height: '450px' }" |
|
|
|
:before-close="handleBeforeVerifyClose" |
|
|
|
> |
|
|
|
<el-form :model="verifyFormValue" class="demo-form-inline"> |
|
|
@ -102,39 +119,35 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<template #footer> |
|
|
|
<div style="text-align: center;"> |
|
|
|
<div style="text-align: center"> |
|
|
|
<el-button type="primary" @click="verifyCancel">取消</el-button> |
|
|
|
<el-button type="primary" @click="verifySubmit">提交</el-button> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</Dialog> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { MoldInspectionDetail, MoldInspectionDetailRules, MoldInspectionMain, MoldInspectionMainRules, MoldInspectionAddDetailRules, MoldInspectionAddDetail } from './moldInspectionMain.data' |
|
|
|
import { |
|
|
|
MoldInspectionAddDetailRules, |
|
|
|
MoldInspectionDetail, |
|
|
|
MoldInspectionDetailRules, |
|
|
|
MoldInspectionMain, |
|
|
|
MoldInspectionMainRules |
|
|
|
} from './moldInspectionMain.data' |
|
|
|
import * as MoldInspectionMainApi from '@/api/eam/mold/moldInspectionMain' |
|
|
|
import * as MoldInspectionDetailApi from '@/api/eam/mold/moldInspectionDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
|
import { selectAllFactoryArea } from '@/api/system/dept' |
|
|
|
import * as UserApi from '@/api/system/user' |
|
|
|
import * as DeviceInspectionDetailApi from '@/api/eam/device/deviceInspectionDetail' |
|
|
|
import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain' |
|
|
|
import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts' |
|
|
|
import { MoldAccountsVO } from '@/api/eam/mold/moldAccounts' |
|
|
|
import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain' |
|
|
|
import * as RepairRelationApi from '@/api/eam/basic/repairRelation' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
import { |
|
|
|
MoldMaintenanceMain, |
|
|
|
MoldMaintenanceMainRules, |
|
|
|
MoldMaintenanceDetail, |
|
|
|
MoldMaintenanceDetailRules, |
|
|
|
MoldMaintenanceMainSec, |
|
|
|
MoldMaintenanceMainSecRules, |
|
|
|
} from '../moldmaintenancejob/moldMaintenanceMain.data' |
|
|
|
import {MoldAccountsVO} from "@/api/eam/mold/moldAccounts"; |
|
|
|
import { MoldMaintenanceMain } from '../moldmaintenancejob/moldMaintenanceMain.data' |
|
|
|
import { cloneDeep } from 'lodash-es' |
|
|
|
|
|
|
|
// import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
@ -153,9 +166,10 @@ const tableColumns = ref(MoldInspectionMain.allSchemas.tableColumns) |
|
|
|
const Echo = [] |
|
|
|
const tableData = ref([]) |
|
|
|
const formRef = ref() |
|
|
|
const isShowAddBtn = ref(false) |
|
|
|
const verifyDialogVisible = ref(false) |
|
|
|
const verifyFormValue = ref({ |
|
|
|
verifyContent: '', |
|
|
|
verifyContent: '' |
|
|
|
}) |
|
|
|
const openRowValue = ref() |
|
|
|
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|
|
@ -173,22 +187,26 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
|
}) |
|
|
|
str = str.substring(0, str.length - 1) |
|
|
|
row['itemNumbers1'] = str |
|
|
|
row['itemNumbers'] = val |
|
|
|
row['itemNumbers'] = val |
|
|
|
} |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
if(formField == 'maintenanceNumber'){ |
|
|
|
const maintenanceRecord = val[0]; |
|
|
|
if (formField == 'maintenanceNumber') { |
|
|
|
const maintenanceRecord = val[0] |
|
|
|
basicFormRef.value.formRef.formModel.deviceNumber = maintenanceRecord.deviceNumber |
|
|
|
basicFormRef.value.formRef.formModel.factoryAreaNumber = String(maintenanceRecord.factoryAreaNumber) |
|
|
|
basicFormRef.value.formRef.formModel.factoryAreaNumber = String( |
|
|
|
maintenanceRecord.factoryAreaNumber |
|
|
|
) |
|
|
|
basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id) |
|
|
|
if(maintenanceRecord.sourceType == '1'){ |
|
|
|
if (maintenanceRecord.sourceType == '1') { |
|
|
|
basicFormRef.value.formRef.formModel.sourceType = '1' |
|
|
|
RepairRelationApi.getRepairRelationNoPage({repairNumber:maintenanceRecord.number}).then(res => { |
|
|
|
RepairRelationApi.getRepairRelationNoPage({ |
|
|
|
repairNumber: maintenanceRecord.number |
|
|
|
}).then((res) => { |
|
|
|
if (res != null) { |
|
|
|
res.forEach(item=>{ |
|
|
|
res.forEach((item) => { |
|
|
|
tableFormKeys['name'] = item.spotInspectionName |
|
|
|
tableFormKeys['hiddenTheReduceButton'] = true |
|
|
|
tableFormKeys['disabled_name'] = true |
|
|
@ -199,7 +217,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
basicFormRef.value.formRef.formModel.sourceType = '0' |
|
|
|
} |
|
|
|
} |
|
|
@ -219,9 +237,8 @@ const { tableObject, tableMethods } = useTable({ |
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
|
|
|
|
const judgeHasAddFunc = () => { |
|
|
|
const rolesOk = userStore.roles.find(item => { |
|
|
|
const rolesOk = userStore.roles.find((item) => { |
|
|
|
return item == 'mold_class_worker_role' || item == 'mold_class_Engineer_role' |
|
|
|
}) |
|
|
|
if (rolesOk != undefined && rolesOk != null) { |
|
|
@ -231,15 +248,14 @@ const judgeHasAddFunc = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({ hasPermi:'eam:mold-inspection-job-main:create'}), // 新增 |
|
|
|
defaultButtons.defaultAddBtn({ hasPermi: 'eam:mold-inspection-job-main:create' }), // 新增 |
|
|
|
// defaultButtons.defaultImportBtn({ hasPermi:'eam:mold-inspection-job-main:import'}), |
|
|
|
// defaultButtons.defaultExportBtn({ hasPermi:'eam:mold-inspection-job-main:export'}), |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
|
|
|
|
|
// { |
|
|
|
// label: '自定义扩展按钮', |
|
|
@ -253,18 +269,25 @@ const HeadButttondata = [ |
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'add') { // 新增 |
|
|
|
MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'status').value = 'PROCCED'; |
|
|
|
MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'type').value = 'MOLD'; |
|
|
|
if (val == 'add') { |
|
|
|
// 新增 |
|
|
|
MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'status').value = |
|
|
|
'PROCCED' |
|
|
|
MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'type').value = 'MOLD' |
|
|
|
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) |
|
|
|
} |
|
|
|
} |
|
|
@ -272,28 +295,40 @@ const buttonBaseClick = (val, item) => { |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainInspectionOrderBtn({ hasPermi:'eam:mold-inspection-job-main:inspection', hide: !(row.status == 'PECEIVED' && (userStore.getUser.id == row.maintenance)) }), //检修 |
|
|
|
defaultButtons.finishOrderBtn({ hasPermi:'eam:mold-inspection-job-main:orderClickFinish', hide: !(row.status == 'PECEIVED' && (userStore.getUser.id == row.maintenance)) }), //完成 |
|
|
|
defaultButtons.mainInspectionOrderBtn({ |
|
|
|
hasPermi: 'eam:mold-inspection-job-main:inspection', |
|
|
|
hide: !(row.status == 'PECEIVED' && userStore.getUser.id == row.maintenance) |
|
|
|
}), //检修 |
|
|
|
defaultButtons.finishOrderBtn({ |
|
|
|
hasPermi: 'eam:mold-inspection-job-main:orderClickFinish', |
|
|
|
hide: !(row.status == 'PECEIVED' && userStore.getUser.id == row.maintenance) |
|
|
|
}), //完成 |
|
|
|
defaultButtons.verifyOrderBtn({ |
|
|
|
hasPermi:'eam:mold-inspection-job-main:orderClickVerify', |
|
|
|
hasPermi: 'eam:mold-inspection-job-main:orderClickVerify', |
|
|
|
hide: !(row.status == 'COMPLETED') |
|
|
|
}), // 验证 |
|
|
|
defaultButtons.orderPrintBtn({ |
|
|
|
hasPermi:'eam:mold-inspection-job-main:print', |
|
|
|
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || !((row.status == 'COMPLETED' || row.status == 'PECEIVED')) |
|
|
|
hasPermi: 'eam:mold-inspection-job-main:print', |
|
|
|
hide: |
|
|
|
!(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || |
|
|
|
!(row.status == 'COMPLETED' || row.status == 'PECEIVED') |
|
|
|
}) // 打印 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'mainInspectionOrder') { // 检修 |
|
|
|
} else if (val == 'mainInspectionOrder') { |
|
|
|
// 检修 |
|
|
|
openDetail(row, '代码', row.number) |
|
|
|
} else if (val == 'finishOrder') { // 完成 |
|
|
|
} else if (val == 'finishOrder') { |
|
|
|
// 完成 |
|
|
|
handleFinishOrder(row) |
|
|
|
} else if (val == 'verifyOrder') { // 验证 |
|
|
|
} else if (val == 'verifyOrder') { |
|
|
|
// 验证 |
|
|
|
verifyOrder(row) |
|
|
|
} else if (val == 'orderPrint') { |
|
|
|
orderPrint(row) |
|
|
@ -304,51 +339,62 @@ const buttonTableClick = async (val, row) => { |
|
|
|
const basicFormRef = ref() |
|
|
|
const openForm = async (type: string, row?: any) => { |
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
await MoldAccountsApi.getMoldAccountsNoPage({sourceType: '0'} as MoldAccountsVO).then(res => { |
|
|
|
MoldMaintenanceMain.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = res |
|
|
|
await MoldAccountsApi.getMoldAccountsNoPage({ sourceType: '0' } as MoldAccountsVO).then((res) => { |
|
|
|
MoldMaintenanceMain.allSchemas.formSchema.find((item) => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = res |
|
|
|
}) |
|
|
|
const res = await MoldInspectionMainApi.getMoldInspectionMainNoPage() |
|
|
|
const moldList = await MoldAccountsApi.getMoldAccountsNoPage({sourceType: '0'} as MoldAccountsVO) |
|
|
|
const moldList = await MoldAccountsApi.getMoldAccountsNoPage({ |
|
|
|
sourceType: '0' |
|
|
|
} as MoldAccountsVO) |
|
|
|
const repairList = await MoldMaintenanceMainApi.getMoldMainTempList('MOLD') |
|
|
|
const newMoldList = moldList.filter(item => { |
|
|
|
const newMoldList = moldList.filter((item) => { |
|
|
|
let flag = true |
|
|
|
res.forEach(element => { |
|
|
|
if (item.number == element.deviceNumber && element.status != 'COMPLETED' && element.status != 'VERIFIED' && element.status != 'REJECTED') { |
|
|
|
flag = false |
|
|
|
} |
|
|
|
}) |
|
|
|
return flag |
|
|
|
res.forEach((element) => { |
|
|
|
if ( |
|
|
|
item.number == element.deviceNumber && |
|
|
|
element.status != 'COMPLETED' && |
|
|
|
element.status != 'VERIFIED' && |
|
|
|
element.status != 'REJECTED' |
|
|
|
) { |
|
|
|
flag = false |
|
|
|
} |
|
|
|
}) |
|
|
|
return flag |
|
|
|
}) |
|
|
|
const newRepairList = repairList.filter(item => { |
|
|
|
const newRepairList = repairList.filter((item) => { |
|
|
|
let flag = false |
|
|
|
newMoldList.forEach(element => { |
|
|
|
newMoldList.forEach((element) => { |
|
|
|
if (item.deviceNumber == element.number) { |
|
|
|
flag = true |
|
|
|
} |
|
|
|
}) |
|
|
|
return flag |
|
|
|
}) |
|
|
|
MoldInspectionMain.allSchemas.formSchema.find(item => item.field == 'deviceNumber').componentProps.options = newMoldList |
|
|
|
MoldInspectionMain.allSchemas.formSchema.find(item => item.field == 'maintenanceNumber').componentProps.options = newRepairList |
|
|
|
|
|
|
|
MoldInspectionMain.allSchemas.formSchema.find( |
|
|
|
(item) => item.field == 'deviceNumber' |
|
|
|
).componentProps.options = newMoldList |
|
|
|
MoldInspectionMain.allSchemas.formSchema.find( |
|
|
|
(item) => item.field == 'maintenanceNumber' |
|
|
|
).componentProps.options = newRepairList |
|
|
|
|
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
} |
|
|
|
|
|
|
|
// form表单提交 |
|
|
|
const formsSuccess = async (formType, data) => { |
|
|
|
var isHave = MoldInspectionMain.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; |
|
|
|
if (data.activeTime == 0) data.activeTime = null |
|
|
|
if (data.expireTime == 0) data.expireTime = null |
|
|
|
if (formType === 'create') { |
|
|
|
await MoldInspectionMainApi.createMoldInspectionMain(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
@ -363,10 +409,14 @@ const formsSuccess = async (formType, data) => { |
|
|
|
/** 详情操作 */ |
|
|
|
const detailRef = ref() |
|
|
|
const openDetail = async (row: any, titleName: any, titleValue: any) => { |
|
|
|
if(row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'APPLYPASS'){ |
|
|
|
MoldInspectionDetailFilter.value.allSchemas.tableColumns = MoldInspectionDetail.allSchemas.tableColumns.filter(item => item.field !== 'action'); |
|
|
|
}else{ |
|
|
|
MoldInspectionDetailFilter.value.allSchemas.tableColumns = MoldInspectionDetail.allSchemas.tableColumns; |
|
|
|
if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'APPLYPASS') { |
|
|
|
MoldInspectionDetailFilter.value.allSchemas.tableColumns = |
|
|
|
MoldInspectionDetail.allSchemas.tableColumns.filter((item) => item.field !== 'action') |
|
|
|
isShowAddBtn.value = false |
|
|
|
} else { |
|
|
|
isShowAddBtn.value = true |
|
|
|
MoldInspectionDetailFilter.value.allSchemas.tableColumns = |
|
|
|
MoldInspectionDetail.allSchemas.tableColumns |
|
|
|
} |
|
|
|
const factoryList = await selectAllFactoryArea() |
|
|
|
const userListAll = await UserApi.getSimpleUserList() |
|
|
@ -386,7 +436,7 @@ const handleDelete = async (id: number) => { |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
@ -422,13 +472,13 @@ const importSuccess = () => { |
|
|
|
|
|
|
|
// 筛选提交 |
|
|
|
const searchFormClick = (searchData) => { |
|
|
|
searchData.filters = searchData.filters.filter(item=>item.column != 'type') |
|
|
|
searchData.filters = searchData.filters.filter((item) => item.column != 'type') |
|
|
|
const fixedField = [ |
|
|
|
{ |
|
|
|
action:"==", |
|
|
|
column:"type", |
|
|
|
value:"MOLD", |
|
|
|
}, |
|
|
|
action: '==', |
|
|
|
column: 'type', |
|
|
|
value: 'MOLD' |
|
|
|
} |
|
|
|
] |
|
|
|
searchData.filters.push(...fixedField) |
|
|
|
tableObject.params = { |
|
|
@ -438,16 +488,13 @@ const searchFormClick = (searchData) => { |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
|
|
|
|
function handleMaintenanceOrder(row) { |
|
|
|
|
|
|
|
} |
|
|
|
function handleMaintenanceOrder(row) {} |
|
|
|
|
|
|
|
function handleFinishOrder(row) { |
|
|
|
let param = { |
|
|
|
masterId : row.id |
|
|
|
masterId: row.id |
|
|
|
} |
|
|
|
MoldInspectionDetailApi.getMoldInspectionDetailPage(param |
|
|
|
).then(response => { |
|
|
|
MoldInspectionDetailApi.getMoldInspectionDetailPage(param).then((response) => { |
|
|
|
if (response != null) { |
|
|
|
if (response.list.length == 0) { |
|
|
|
message.error(t('请先填写并完成检修明细内容!')) |
|
|
@ -459,12 +506,12 @@ function handleFinishOrder(row) { |
|
|
|
// message.error(t('请先完成各检修明细内容!')) |
|
|
|
// return |
|
|
|
// } else { |
|
|
|
MoldInspectionMainApi.finishInspection(row.id).then(res => { |
|
|
|
message.success(t('common.finishSuccess')) |
|
|
|
getList() |
|
|
|
}) |
|
|
|
MoldInspectionMainApi.finishInspection(row.id).then((res) => { |
|
|
|
message.success(t('common.finishSuccess')) |
|
|
|
getList() |
|
|
|
}) |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
message.error(t('common.finishFail')) |
|
|
|
} |
|
|
@ -474,20 +521,26 @@ function handleFinishOrder(row) { |
|
|
|
const onChange = (field, cur, item) => { |
|
|
|
// 当有效天数 和 生效时间 发生变化 |
|
|
|
if (field == 'deviceNumber') { |
|
|
|
basicFormRef.value.formRef.formModel.factoryAreaNumber = String(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber) |
|
|
|
basicFormRef.value.formRef.formModel.factoryAreaNumber = String( |
|
|
|
item.componentProps.options.find((element) => element.number == cur).factoryAreaNumber |
|
|
|
) |
|
|
|
basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id) |
|
|
|
basicFormRef.value.formRef.formModel.maintenanceNumber = '' |
|
|
|
} else if (field == 'maintenanceNumber') { |
|
|
|
tableData.value = [] |
|
|
|
basicFormRef.value.formRef.formModel.deviceNumber = item.componentProps.options.find(element => element.number == cur).deviceNumber |
|
|
|
basicFormRef.value.formRef.formModel.factoryAreaNumber = String(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber) |
|
|
|
basicFormRef.value.formRef.formModel.deviceNumber = item.componentProps.options.find( |
|
|
|
(element) => element.number == cur |
|
|
|
).deviceNumber |
|
|
|
basicFormRef.value.formRef.formModel.factoryAreaNumber = String( |
|
|
|
item.componentProps.options.find((element) => element.number == cur).factoryAreaNumber |
|
|
|
) |
|
|
|
basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id) |
|
|
|
const itemObj = item.componentProps.options.find(element => element.number == cur) |
|
|
|
if(itemObj.sourceType == '1'){ |
|
|
|
const itemObj = item.componentProps.options.find((element) => element.number == cur) |
|
|
|
if (itemObj.sourceType == '1') { |
|
|
|
basicFormRef.value.formRef.formModel.sourceType = '1' |
|
|
|
RepairRelationApi.getRepairRelationNoPage({repairNumber:cur}).then(res => { |
|
|
|
RepairRelationApi.getRepairRelationNoPage({ repairNumber: cur }).then((res) => { |
|
|
|
if (res != null) { |
|
|
|
res.forEach(item=>{ |
|
|
|
res.forEach((item) => { |
|
|
|
tableFormKeys['name'] = item.spotInspectionName |
|
|
|
tableFormKeys['hiddenTheReduceButton'] = true |
|
|
|
tableFormKeys['disabled_name'] = true |
|
|
@ -496,7 +549,7 @@ const onChange = (field, cur, item) => { |
|
|
|
tableFormKeys['hiddenTheReduceButton'] = undefined |
|
|
|
tableFormKeys['disabled_name'] = undefined |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
basicFormRef.value.formRef.formModel.sourceType = '0' |
|
|
|
} |
|
|
|
}) |
|
|
@ -504,9 +557,6 @@ const onChange = (field, cur, item) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询页面返回——详情 |
|
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(() => { |
|
|
@ -526,16 +576,14 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
|
} |
|
|
|
|
|
|
|
const detailOpenForm = (type, row) => { |
|
|
|
console.log("type", type); |
|
|
|
console.log("row", row); |
|
|
|
MoldInspectionDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
|
|
|
|
|
}) |
|
|
|
console.log('type', type) |
|
|
|
console.log('row', row) |
|
|
|
MoldInspectionDetail.allSchemas.tableFormColumns.map((item) => {}) |
|
|
|
} |
|
|
|
|
|
|
|
// 子表新增/编辑校验 |
|
|
|
const detailValidate = (data) => { |
|
|
|
let tag = true; |
|
|
|
let tag = true |
|
|
|
return tag |
|
|
|
} |
|
|
|
// 子表提交 |
|
|
@ -555,12 +603,12 @@ const detailSubmitForm = async (formType, data, formRef, tableList) => { |
|
|
|
estimatedMinutes: data.estimatedMinutes, |
|
|
|
actualMinutes: data.actualMinutes, |
|
|
|
chargePeoples: data.chargePeoples.join(','), |
|
|
|
completionTime: data.completionTime?data.completionTime:'', |
|
|
|
completionTime: data.completionTime ? data.completionTime : '', |
|
|
|
engineer: data.engineer, |
|
|
|
uncompleted: data.uncompleted, |
|
|
|
itemNumbers: data.itemNumbers, |
|
|
|
itemNumbers: data.itemNumbers |
|
|
|
} |
|
|
|
console.log('data1',data1) |
|
|
|
console.log('data1', data1) |
|
|
|
if (formType === 'create') { |
|
|
|
console.log('create', data1) |
|
|
|
await MoldInspectionDetailApi.createMoldInspectionDetail(data1) |
|
|
@ -573,17 +621,16 @@ const detailSubmitForm = async (formType, data, formRef, tableList) => { |
|
|
|
formRef.dialogVisible = false |
|
|
|
console.log('before', data1) |
|
|
|
// 刷新当前列表 |
|
|
|
await detailRef.value.getList() |
|
|
|
await detailRef.value.getList() |
|
|
|
console.log('after', data1) |
|
|
|
detailRef.value.tableObject.tableList.forEach(item => { |
|
|
|
detailRef.value.tableObject.tableList.forEach((item) => { |
|
|
|
if (item.itemNumbers?.length > 0) { |
|
|
|
let str = '' |
|
|
|
item.itemNumbers.forEach(element => { |
|
|
|
item.itemNumbers.forEach((element) => { |
|
|
|
str += element.name + ':' + element.qty + ',' |
|
|
|
}) |
|
|
|
item.itemNumbers1 = str.substring(0, str.length - 1) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
} finally { |
|
|
|
formRef.formLoading = false |
|
|
@ -593,8 +640,8 @@ const detailSubmitForm = async (formType, data, formRef, tableList) => { |
|
|
|
/** |
|
|
|
* tableForm方法 |
|
|
|
*/ |
|
|
|
const tableFormKeys = {} |
|
|
|
MoldInspectionDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
|
const tableFormKeys = {} |
|
|
|
MoldInspectionDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
|
}) |
|
|
|
|
|
|
@ -608,12 +655,11 @@ const handleDeleteTable = (item, index) => { |
|
|
|
tableData.value.splice(index, 1) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
data.subList = tableData.value.map((item) => { |
|
|
|
item.chargePeoples = item.chargePeoples.join(','); |
|
|
|
return item; |
|
|
|
item.chargePeoples = item.chargePeoples.join(',') |
|
|
|
return item |
|
|
|
}) // 拼接子表数据参数 |
|
|
|
console.log(data.subList) |
|
|
|
try { |
|
|
@ -632,9 +678,7 @@ const submitForm = async (formType, data) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function detailOnChange(field, cur, item,formRef) { |
|
|
|
function detailOnChange(field, cur, item, formRef) { |
|
|
|
// if (field == 'status') { |
|
|
|
// if (cur == '1') { |
|
|
|
// MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false |
|
|
@ -677,19 +721,34 @@ const openFormCallBack = (type, row, masterParmas, callback) => { |
|
|
|
|
|
|
|
function buttonControllFunction(row, val) { |
|
|
|
if (val == 'delete') { |
|
|
|
if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { |
|
|
|
if ( |
|
|
|
row.status == 'COMPLETED' || |
|
|
|
row.status == 'VERIFIED' || |
|
|
|
row.status == 'REJECTED' || |
|
|
|
!isReceiver(row.maintenance) |
|
|
|
) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} else if (val == 'edit') { |
|
|
|
if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { |
|
|
|
} else if (val == 'edit') { |
|
|
|
if ( |
|
|
|
row.status == 'COMPLETED' || |
|
|
|
row.status == 'VERIFIED' || |
|
|
|
row.status == 'REJECTED' || |
|
|
|
!isReceiver(row.maintenance) |
|
|
|
) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} else if(val == 'add') { |
|
|
|
if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { |
|
|
|
} else if (val == 'add') { |
|
|
|
if ( |
|
|
|
row.status == 'COMPLETED' || |
|
|
|
row.status == 'VERIFIED' || |
|
|
|
row.status == 'REJECTED' || |
|
|
|
!isReceiver(row.maintenance) |
|
|
|
) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
@ -717,7 +776,7 @@ function verifyOrder(row) { |
|
|
|
// 验证 |
|
|
|
function verifySubmit() { |
|
|
|
const row = openRowValue.value |
|
|
|
MoldInspectionMainApi.verifyOrder(row.id,verifyFormValue.value.verifyContent).then(res => { |
|
|
|
MoldInspectionMainApi.verifyOrder(row.id, verifyFormValue.value.verifyContent).then((res) => { |
|
|
|
verifyDialogVisible.value = false |
|
|
|
getList() |
|
|
|
message.success('操作成功') |
|
|
@ -730,25 +789,32 @@ function verifyCancel(row) { |
|
|
|
} |
|
|
|
|
|
|
|
const orderPrint = (row) => { |
|
|
|
window.open(src.value + "&id=" + row.id) |
|
|
|
window.open(src.value + '&id=' + row.id) |
|
|
|
} |
|
|
|
|
|
|
|
const formSelectChange = (field, cur, item) =>{ |
|
|
|
|
|
|
|
const formSelectChange = (field, cur, item) => { |
|
|
|
if (field == 'status') { |
|
|
|
item.tableFormRules = cloneDeep(MoldInspectionMainRules) |
|
|
|
if (cur == '1') { |
|
|
|
item['disabled_' + 'uncompleted'] = false |
|
|
|
item['disabled_' + 'completionTime'] = true |
|
|
|
item['completionTime']='' |
|
|
|
item.tableFormRules.uncompleted = [{ required: true, message: '该项为必填项' , trigger: ['blur','change']}] |
|
|
|
item.tableFormRules.completionTime = [{ required: false, message: '该项为必填项' , trigger: ['blur','change']}] |
|
|
|
item['completionTime'] = '' |
|
|
|
item.tableFormRules.uncompleted = [ |
|
|
|
{ required: true, message: '该项为必填项', trigger: ['blur', 'change'] } |
|
|
|
] |
|
|
|
item.tableFormRules.completionTime = [ |
|
|
|
{ required: false, message: '该项为必填项', trigger: ['blur', 'change'] } |
|
|
|
] |
|
|
|
} else { |
|
|
|
item['disabled_' + 'uncompleted'] = true |
|
|
|
item['disabled_' + 'uncompleted'] = true |
|
|
|
item['disabled_' + 'completionTime'] = false |
|
|
|
item['uncompleted']='' |
|
|
|
item.tableFormRules.uncompleted = [{ required: false, message: '该项为必填项' , trigger: ['blur','change']}] |
|
|
|
item.tableFormRules.completionTime = [{ required: true, message: '该项为必填项' , trigger: ['blur','change']}] |
|
|
|
item['uncompleted'] = '' |
|
|
|
item.tableFormRules.uncompleted = [ |
|
|
|
{ required: false, message: '该项为必填项', trigger: ['blur', 'change'] } |
|
|
|
] |
|
|
|
item.tableFormRules.completionTime = [ |
|
|
|
{ required: true, message: '该项为必填项', trigger: ['blur', 'change'] } |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -758,5 +824,4 @@ onMounted(async () => { |
|
|
|
getList() |
|
|
|
importTemplateData.templateUrl = await MoldInspectionMainApi.importTemplate() |
|
|
|
}) |
|
|
|
|
|
|
|
</script> |
|
|
|