|
|
@ -2,17 +2,18 @@ |
|
|
|
<div> |
|
|
|
<el-drawer |
|
|
|
v-model="isShowDrawer" |
|
|
|
title="详情" |
|
|
|
:title="t(`ts.详情`).replace('ts.','')" |
|
|
|
direction="rtl" |
|
|
|
size="80%" |
|
|
|
v-loading="detailLoading" |
|
|
|
> |
|
|
|
<template #header> |
|
|
|
<div class="font-size-18px"> |
|
|
|
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span> |
|
|
|
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ t(`ts.${titleNameRef}`).replace('ts.','') }}</span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<ContentWrap v-if="!isBasic"> |
|
|
|
<Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" /> |
|
|
|
<ContentWrap v-if="!isBasic" v-show="tabsList[current].label=='主数据'"> |
|
|
|
<Descriptions |
|
|
|
:data="detailData" |
|
|
|
labelClassName="label-class-name" |
|
|
@ -24,11 +25,9 @@ |
|
|
|
width="200px" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" /> |
|
|
|
<div class="flex"> |
|
|
|
<!-- 详情 --> |
|
|
|
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!='附件'&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'"> <!-- 列表头部 --> |
|
|
|
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!=annexAlias.label&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'&&tabsList[current].label!='主数据'&&!annexTableData.some(item=>item.label==tabsList[current].label)"> <!-- 列表头部 --> |
|
|
|
<TableHead |
|
|
|
v-if="!isBasic" |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
@ -54,6 +53,7 @@ |
|
|
|
:pagination="{ total: tableObjectRef.total }" |
|
|
|
v-model:pageSize="tableObjectRef.pageSize" |
|
|
|
v-model:currentPage="tableObjectRef.currentPage" |
|
|
|
v-model:sort="tableObjectRef.sort" |
|
|
|
> |
|
|
|
<!-- <template #action="{ row }"> |
|
|
|
<ButtonBase |
|
|
@ -70,9 +70,10 @@ |
|
|
|
:pagination="{ total: tableObjectRef.total }" |
|
|
|
v-model:pageSize="tableObjectRef.pageSize" |
|
|
|
v-model:currentPage="tableObjectRef.currentPage" |
|
|
|
v-model:sort="tableObjectRef.sort" |
|
|
|
> |
|
|
|
<template #photos="{ row }"> |
|
|
|
<div v-for="(item,index) in row.photos.split(',')" :key="index" style="color:#409eff ; cursor: pointer;" @click="openImage(item)">{{ item }}</div> </template> |
|
|
|
<template #photos="{ row }"> |
|
|
|
<div v-for="(item,index) in row.photos.split(',')" :key="index" style="color:#409eff ; cursor: pointer;" @click="openImage(item)">{{ item }}</div> </template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase |
|
|
|
:Butttondata="buttondata" |
|
|
@ -96,24 +97,69 @@ |
|
|
|
</template> |
|
|
|
</DetailTable> |
|
|
|
</ContentWrap> |
|
|
|
<!-- other附件组件:如质检明细 --> |
|
|
|
<div v-for="(annexItem ,index) in annexTableData" :key="index" v-show="annexItem.label==tabsList[current].label" class="w-[100%]" :style="{height:annexItem.hasSubDetail?'100%':remarkHeight+'px'}"> |
|
|
|
<ContentWrap class="w-[100%]"> |
|
|
|
<ElScrollbar ref="scrollbar" :style="{height:annexItem.hasSubDetail?'100%':(remarkHeight-40)+'px'}"> |
|
|
|
<Annex v-show="tabsList[current].label==annexItem.label" |
|
|
|
:annexData="annexItem" |
|
|
|
:fileType="annexItem.fileType" |
|
|
|
:showPreview="annexItem.showPreview" |
|
|
|
:showDownload = "annexItem.showDownload" |
|
|
|
:hiddenDelete = "annexItem.hiddenDelete" |
|
|
|
@handleAnnexSuccess="updateAnnexTableHandle" |
|
|
|
@deleteAnnexSuccess="updateAnnexTableHandle" |
|
|
|
:upData="{...remarksData.data,tableName:annexItem.tableName}" |
|
|
|
/> |
|
|
|
</ElScrollbar> |
|
|
|
</ContentWrap> |
|
|
|
<ContentWrap class="w-[100%]" v-if="annexItem.subDetailTableData"> |
|
|
|
<Table |
|
|
|
v-if="!isBasic && fromeWhere != 'countPlan'" |
|
|
|
:align="annexItem.align?annexItem.align:'center'" |
|
|
|
:columns="annexItem.subDetailTableData.tableColumns" |
|
|
|
:data="annexItem.subDetailTableData.tableList" |
|
|
|
:loading="annexItem.subDetailTableData.loading" |
|
|
|
:pagination="{ total: annexItem.subDetailTableData.tableList.length }" |
|
|
|
v-model:pageSize="tableObjectRef.pageSize" |
|
|
|
v-model:currentPage="tableObjectRef.currentPage" |
|
|
|
v-model:sort="tableObjectRef.sort" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
</div> |
|
|
|
<!-- 附件/备注/变更记录 --> |
|
|
|
<ContentWrap class="w-[100%]" v-show="tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}"> |
|
|
|
<ContentWrap class="w-[100%]" v-show="tabsList[current].label==annexAlias.label" :style="{height:remarkHeight+'px'}"> |
|
|
|
<!-- 附件组件 --> |
|
|
|
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}"> |
|
|
|
<Annex v-show="tabsList[current].label=='附件'" |
|
|
|
<Annex |
|
|
|
:annexData="annexData" |
|
|
|
:showDownload = "annexAlias.showDownload" |
|
|
|
:hiddenDelete = "annexAlias.hiddenDelete" |
|
|
|
@handleAnnexSuccess="handleAnnexSuccess" |
|
|
|
@deleteAnnexSuccess="deleteAnnexSuccess" |
|
|
|
:upData="remarksData.data" |
|
|
|
:key="count" |
|
|
|
/> |
|
|
|
</ElScrollbar> |
|
|
|
</ContentWrap> |
|
|
|
<ContentWrap class="w-[100%]" v-show="tabsList[current].label=='备注'" :style="{height:remarkHeight+'px'}"> |
|
|
|
<!-- 附件组件 --> |
|
|
|
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}"> |
|
|
|
<!-- 备注组件 --> |
|
|
|
<Remarks v-show="tabsList[current].label=='备注'" |
|
|
|
<Remarks |
|
|
|
:remarksData="remarksData" |
|
|
|
class="mt-20px" |
|
|
|
@remarksSubmitScuess="remarksSubmitScuess" |
|
|
|
:key="count" |
|
|
|
/> |
|
|
|
</ElScrollbar> |
|
|
|
</ContentWrap> |
|
|
|
<ContentWrap class="w-[100%]" v-show="tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}"> |
|
|
|
<!-- 附件组件 --> |
|
|
|
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}"> |
|
|
|
<!-- 变更记录组件 --> |
|
|
|
<ChangeRecord v-show="tabsList[current].label=='变更记录'" :changeRecordData="changeRecordData" class="mt-20px" /> |
|
|
|
<ChangeRecord :changeRecordData="changeRecordData" class="mt-20px" :key="count"/> |
|
|
|
</ElScrollbar> |
|
|
|
</ContentWrap> |
|
|
|
</div> |
|
|
@ -121,7 +167,7 @@ |
|
|
|
<!-- 表格弹窗 --> |
|
|
|
<SearchTable ref="searchTableRef" @search-table-success="searchTableSuccess1" /> |
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicFormQmsNumber |
|
|
|
<BasicForm |
|
|
|
ref="formRef" |
|
|
|
@success="submitForm" |
|
|
|
:rules="detailAllSchemasRules" |
|
|
@ -140,7 +186,6 @@ |
|
|
|
@onChange="detailBasicFormOnChange" |
|
|
|
@onBlur="onBlur" |
|
|
|
@formFormDateChange="formFormDateChange" |
|
|
|
:myFuncTypeSign="myFuncTypeSign" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</template> |
|
|
@ -154,12 +199,15 @@ import Tabs from '@/components/Tabs/src/Tabs.vue' |
|
|
|
import * as RemarkApi from '@/api/wms/remark' |
|
|
|
import * as FileApi from '@/api/wms/file' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import BasicFormQmsNumber from '@/components/BasicForm/src/BasicFormQmsNumber.vue' |
|
|
|
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import DetailTable from '@/components/DetailTable/src/DetailTable.vue' |
|
|
|
import { SearchTable } from '@/components/SearchTable' |
|
|
|
import { |
|
|
|
EquipmentMaintenanceDetail, EquipmentMaintenanceDetailRules, |
|
|
|
} from "@/views/eam/equipmentMaintenanceMain/equipmentMaintenanceMain.data"; |
|
|
|
|
|
|
|
defineOptions({ name: 'DetailQmsNumber' }) |
|
|
|
defineOptions({ name: 'Detail' }) |
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
@ -177,6 +225,24 @@ const props = defineProps({ |
|
|
|
required: true, |
|
|
|
default: null |
|
|
|
}, |
|
|
|
//展示附件组件的tab标签 |
|
|
|
annexTable: { |
|
|
|
type: Array, |
|
|
|
required: false, |
|
|
|
default: ()=>[] |
|
|
|
}, |
|
|
|
//展示附件组件的tab标签 |
|
|
|
annexAlias: { |
|
|
|
type: Object, |
|
|
|
required: false, |
|
|
|
default: ()=>({ |
|
|
|
label: '附件', |
|
|
|
showDownload:false, |
|
|
|
showPreview:false, |
|
|
|
hiddenDelete:false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 是否是基础数据 展现详情顶部表单 |
|
|
|
isBasic: { |
|
|
|
type: Boolean, |
|
|
@ -311,16 +377,15 @@ const props = defineProps({ |
|
|
|
required: false, |
|
|
|
default: false |
|
|
|
}, |
|
|
|
//个性化功能标志 |
|
|
|
myFuncTypeSign:{ |
|
|
|
type: String, |
|
|
|
//扩展其他按钮 |
|
|
|
otherHeadButttonData:{ |
|
|
|
type:Array, |
|
|
|
required: false, |
|
|
|
default: null |
|
|
|
}, |
|
|
|
default: () => [] |
|
|
|
} |
|
|
|
}) |
|
|
|
const isShowDrawer = ref(false) |
|
|
|
const detailLoading = ref(false) |
|
|
|
const myFuncTypeSign = props.myFuncTypeSign |
|
|
|
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : ''))) |
|
|
|
|
|
|
|
if (props.isBasic == true) { |
|
|
@ -342,17 +407,32 @@ if (props.isBasic == true) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const otherList = [] |
|
|
|
|
|
|
|
const otherList = [...props.annexTable,{ |
|
|
|
label:props.annexAlias.label, |
|
|
|
prop:'Annex' |
|
|
|
},{ |
|
|
|
label:'备注', |
|
|
|
prop:'Remarks' |
|
|
|
},{ |
|
|
|
label:'变更记录', |
|
|
|
prop:'ChangeRecord' |
|
|
|
}] |
|
|
|
tabsList.value = [...tabsList?.value,...otherList] |
|
|
|
|
|
|
|
if (!tabsList.value || tabsList.value && tabsList.value.length == otherList.length) { |
|
|
|
tabsList.value.unshift({ |
|
|
|
label: '明细', |
|
|
|
prop: 'Detail' |
|
|
|
label: '明细', |
|
|
|
prop: 'Detail' |
|
|
|
}) |
|
|
|
} |
|
|
|
if(!props.isBasic){ |
|
|
|
tabsList.value.unshift({ |
|
|
|
label: '主数据', |
|
|
|
prop: 'Descriptions' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Tabs |
|
|
|
const tabRef = ref() |
|
|
|
//滚动条 |
|
|
@ -372,6 +452,8 @@ const remarkHeight = computed(() => { |
|
|
|
const annexData = reactive({ |
|
|
|
annexList: [] |
|
|
|
}) |
|
|
|
// // 其他附件默认数据数组 |
|
|
|
const annexTableData = ref<Array<any>>([]) |
|
|
|
|
|
|
|
// 备注数据 |
|
|
|
const remarksData = reactive({ |
|
|
@ -393,6 +475,48 @@ const getFileList = async () => { |
|
|
|
detailLoading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
// 获取其他附件列表篇 |
|
|
|
const getAnnexFileList = async (row) => { |
|
|
|
props.annexTable?.forEach(async (item) => { |
|
|
|
let requstData = {...remarksData.data,tableName: item?.tableName} |
|
|
|
if(item?.queryParams){ |
|
|
|
item?.queryParams?.forEach(queryItem => { |
|
|
|
requstData[queryItem.queryField] = row[queryItem.rowField] |
|
|
|
}); |
|
|
|
} |
|
|
|
const annexList = await FileApi.getFileList(requstData) |
|
|
|
const annexData = annexTableData.value.find(annex=>annex.label === item.label) |
|
|
|
if(annexData){ |
|
|
|
annexData.annexList = annexList |
|
|
|
}else{ |
|
|
|
annexTableData.value.push({ |
|
|
|
align:item.align, |
|
|
|
label: item.label, |
|
|
|
tableName: item?.tableName || '', |
|
|
|
annexList, |
|
|
|
hasSubDetail:item.hasSubDetail||false, |
|
|
|
subDetailTableData:item.subDetailTableData, |
|
|
|
fileType:item.fileType||['apk','doc', 'xls', 'ppt', 'txt', 'pdf','png', 'jpg', 'jpeg'], |
|
|
|
showPreview:item.showPreview||false, // 是否展示预览按钮 |
|
|
|
showDownload:item.showDownload||false, // 是否展示下载按钮 |
|
|
|
hiddenDelete:item.hiddenDelete || false, // 是否展示删除按钮 |
|
|
|
}) |
|
|
|
if(item?.subDetailTableData){ |
|
|
|
const { tableObject:subTableObject, tableMethods:subTableMethods } = useTable({ |
|
|
|
getListApi: item.subDetailTableData.getSubList // 分页接口 |
|
|
|
}) |
|
|
|
const {getList:getSubList} = subTableMethods |
|
|
|
subTableObject.params= {} |
|
|
|
item.subDetailTableData.queryParams.forEach(queryItem => { |
|
|
|
subTableObject.params[queryItem.queryField] = row[queryItem.rowField] |
|
|
|
}); |
|
|
|
await getSubList() |
|
|
|
item.subDetailTableData.tableList = subTableObject.tableList |
|
|
|
console.log('subTableObject',annexTableData.value) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
/** 添加附件 */ |
|
|
|
const handleAnnexSuccess = () => { |
|
|
|
getFileList() |
|
|
@ -403,6 +527,11 @@ const deleteAnnexSuccess = async () => { |
|
|
|
getFileList() |
|
|
|
getChangeRecordList() |
|
|
|
} |
|
|
|
/** 追加的附件 */ |
|
|
|
const updateAnnexTableHandle = () => { |
|
|
|
getAnnexFileList(detailData.value) |
|
|
|
getChangeRecordList() |
|
|
|
} |
|
|
|
|
|
|
|
// Tabs当前选择 |
|
|
|
const current = ref(0) |
|
|
@ -420,7 +549,7 @@ const change = (item, index) => { |
|
|
|
const masterParmas = ref({ |
|
|
|
masterId: '', //主表id |
|
|
|
number: '', //主表单据号 |
|
|
|
status: '', //主表状态 用于控制子表新增编辑按钮显示情况 |
|
|
|
status: '' //主表状态 用于控制子表新增编辑按钮显示情况 |
|
|
|
}) |
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
@ -455,17 +584,23 @@ const searchTableFormType = ref('') // 表单的类型:create - 新增;updat |
|
|
|
const formRef = ref() |
|
|
|
const titleNameRef = ref() |
|
|
|
const titleValueRef = ref() |
|
|
|
const count =ref(0) |
|
|
|
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => { |
|
|
|
titleNameRef.value = titleName |
|
|
|
titleValueRef.value = titleValue |
|
|
|
remarksData.data = { |
|
|
|
tableId: row.masterId||row.id, |
|
|
|
tableName: tableName |
|
|
|
} |
|
|
|
count.value++ |
|
|
|
// 加载明细列表 |
|
|
|
if (!props.isBasic) { |
|
|
|
// 设置主表id |
|
|
|
masterParmas.value.masterId = row.id |
|
|
|
masterParmas.value.masterId = row.masterId||row.id |
|
|
|
masterParmas.value.number = row.number |
|
|
|
masterParmas.value.status = row.status |
|
|
|
tableObjectRef.value.params = { |
|
|
|
masterId: row.id |
|
|
|
masterId: row.masterId||row.id |
|
|
|
} |
|
|
|
await getList() |
|
|
|
} |
|
|
@ -474,9 +609,10 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
|
detailLoading.value = true |
|
|
|
try { |
|
|
|
detailData.value = row |
|
|
|
// getRemarkList() |
|
|
|
// getFileList() |
|
|
|
// getChangeRecordList() |
|
|
|
getRemarkList() |
|
|
|
getFileList() |
|
|
|
getAnnexFileList(row) |
|
|
|
getChangeRecordList() |
|
|
|
// 判断详情按钮是否显示 |
|
|
|
let detailButtonFilter: any = [] |
|
|
|
let detailButtonAdd: any = [] |
|
|
@ -502,7 +638,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
|
defaultButtons.defaultFilterBtn(null) // 筛选 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
HeadButttondata.value = [...HeadButttondata.value,...props.otherHeadButttonData] |
|
|
|
let detailButtonEdit: any = [] |
|
|
|
let detailButtonDelete: any = [] |
|
|
|
if (props.detailButtonIsShowEdit) { |
|
|
@ -564,11 +700,6 @@ detailAllSchemasRef.value = props.detailAllSchemas |
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isShowMainButton = (row, val) => { |
|
|
|
// if (val.indexOf(row.status) > -1) { |
|
|
|
// return false |
|
|
|
// } else { |
|
|
|
// return true |
|
|
|
// } |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
@ -588,13 +719,13 @@ const buttonBaseClick = (val, item) => { |
|
|
|
}) |
|
|
|
const item = props.detailAllSchemas.formSchema[0] |
|
|
|
opensearchTable( |
|
|
|
item.field, item?.componentProps?.searchField, |
|
|
|
item?.componentProps?.searchTitle, |
|
|
|
item?.componentProps?.searchAllSchemas, |
|
|
|
item?.componentProps?.searchPage, |
|
|
|
item?.componentProps?.searchCondition, |
|
|
|
item?.componentProps?.multiple, |
|
|
|
undefined,undefined |
|
|
|
item.field, item?.componentProps?.searchField, |
|
|
|
item?.componentProps?.searchTitle, |
|
|
|
item?.componentProps?.searchAllSchemas, |
|
|
|
item?.componentProps?.searchPage, |
|
|
|
item?.componentProps?.searchCondition, |
|
|
|
item?.componentProps?.multiple, |
|
|
|
undefined,undefined |
|
|
|
) |
|
|
|
}else{ |
|
|
|
openForm('create') |
|
|
@ -613,6 +744,7 @@ const buttonBaseClick = (val, item) => { |
|
|
|
} else { |
|
|
|
// 其他按钮 |
|
|
|
console.log('其他按钮', item) |
|
|
|
emit('buttonBaseClick',val, item) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -643,8 +775,6 @@ const opensearchTable = ( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(searchCondition) |
|
|
|
console.log(_searchCondition) |
|
|
|
searchTableRef.value.open( |
|
|
|
searchTitle, |
|
|
|
searchAllSchemas, |
|
|
@ -674,13 +804,13 @@ const buttonTableClick = async (val, row) => { |
|
|
|
} |
|
|
|
const item = props.detailAllSchemas.formSchema[0] |
|
|
|
opensearchTable( |
|
|
|
item.field, item?.componentProps?.searchField, |
|
|
|
item?.componentProps?.searchTitle, |
|
|
|
item?.componentProps?.searchAllSchemas, |
|
|
|
item?.componentProps?.searchPage, |
|
|
|
item?.componentProps?.searchCondition, |
|
|
|
item?.componentProps?.multiple, |
|
|
|
undefined,undefined |
|
|
|
item.field, item?.componentProps?.searchField, |
|
|
|
item?.componentProps?.searchTitle, |
|
|
|
item?.componentProps?.searchAllSchemas, |
|
|
|
item?.componentProps?.searchPage, |
|
|
|
item?.componentProps?.searchCondition, |
|
|
|
item?.componentProps?.multiple, |
|
|
|
undefined,undefined |
|
|
|
) |
|
|
|
}else{ |
|
|
|
openForm('update', row) |
|
|
@ -694,8 +824,69 @@ const buttonTableClick = async (val, row) => { |
|
|
|
} |
|
|
|
/** 添加/修改操作 */ |
|
|
|
const openForm = async (type: string, row?: number) => { |
|
|
|
|
|
|
|
|
|
|
|
formRef.value.open(type, row, masterParmas.value) |
|
|
|
emit('detailOpenForm', type, row, masterParmas.value) |
|
|
|
emit('detailOpenForm', type, row) |
|
|
|
if(type == "create"){ |
|
|
|
EquipmentMaintenanceDetail.allSchemas.formSchema.forEach((item) => { |
|
|
|
if(item.field == 'peoples'){ |
|
|
|
item.componentProps.disabled = true |
|
|
|
EquipmentMaintenanceDetailRules.peoples[0].required = false |
|
|
|
} |
|
|
|
if(item.field == 'estimatedMinutes'){ |
|
|
|
EquipmentMaintenanceDetailRules.estimatedMinutes[0].required = true |
|
|
|
} |
|
|
|
if(item.field == 'actualMinutes'){ |
|
|
|
item.componentProps.disabled = true |
|
|
|
EquipmentMaintenanceDetailRules.actualMinutes[0].required = false |
|
|
|
} |
|
|
|
if(item.field == 'completionTime'){ |
|
|
|
item.componentProps.disabled = true |
|
|
|
EquipmentMaintenanceDetailRules.completionTime[0].required = false |
|
|
|
} |
|
|
|
if(item.field == 'result'){ |
|
|
|
item.componentProps.disabled = true |
|
|
|
EquipmentMaintenanceDetailRules.result[0].required = false |
|
|
|
} |
|
|
|
if(item.field == 'uncompletedCause'){ |
|
|
|
item.componentProps.disabled = true |
|
|
|
EquipmentMaintenanceDetailRules.uncompletedCause[0].required = false |
|
|
|
} |
|
|
|
if(item.field == 'name'){ |
|
|
|
EquipmentMaintenanceDetailRules.name[0].required = true |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
EquipmentMaintenanceDetail.allSchemas.formSchema.forEach((item) => { |
|
|
|
if(item.field == 'peoples'){ |
|
|
|
item.componentProps.disabled = false |
|
|
|
EquipmentMaintenanceDetailRules.peoples[0].required = true |
|
|
|
} |
|
|
|
if(item.field == 'estimatedMinutes'){ |
|
|
|
EquipmentMaintenanceDetailRules.estimatedMinutes[0].required = false |
|
|
|
} |
|
|
|
if(item.field == 'actualMinutes'){ |
|
|
|
item.componentProps.disabled = false |
|
|
|
EquipmentMaintenanceDetailRules.actualMinutes[0].required = true |
|
|
|
} |
|
|
|
if(item.field == 'completionTime'){ |
|
|
|
item.componentProps.disabled = false |
|
|
|
EquipmentMaintenanceDetailRules.completionTime[0].required = true |
|
|
|
} |
|
|
|
if(item.field == 'result'){ |
|
|
|
item.componentProps.disabled = false |
|
|
|
EquipmentMaintenanceDetailRules.result[0].required = true |
|
|
|
} |
|
|
|
if(item.field == 'uncompletedCause'){ |
|
|
|
item.componentProps.disabled = false |
|
|
|
EquipmentMaintenanceDetailRules.uncompletedCause[0].required = false |
|
|
|
} |
|
|
|
if(item.field == 'name'){ |
|
|
|
EquipmentMaintenanceDetailRules.name[0].required = true |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
// form 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
@ -710,6 +901,7 @@ const submitForm = async (formType, data) => { |
|
|
|
await props.apiUpdate(data) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} |
|
|
|
emit('handleMainFefresh') |
|
|
|
formRef.value.dialogVisible = false |
|
|
|
// 刷新当前列表 |
|
|
|
await getList() |
|
|
@ -740,7 +932,8 @@ const emit = defineEmits([ |
|
|
|
'openImage', |
|
|
|
'onBlur', |
|
|
|
'detailBasicFormOnChange', |
|
|
|
'formFormDateChange' |
|
|
|
'formFormDateChange', |
|
|
|
'buttonBaseClick' |
|
|
|
]) |
|
|
|
/** 删除按钮操作 */ |
|
|
|
const handleDelete = async (id: number) => { |
|
|
@ -752,6 +945,7 @@ const handleDelete = async (id: number) => { |
|
|
|
await props.apiDelete(id) |
|
|
|
tableObject.loading = false |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
emit('handleMainFefresh') |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
updateKey.value += 1 |
|
|
@ -796,7 +990,7 @@ const openImage=(item)=>{ |
|
|
|
* @param field 当前操作字段 |
|
|
|
* @param cur 改变后值 |
|
|
|
*/ |
|
|
|
const detailBasicFormOnChange = (field, cur) => { |
|
|
|
const detailBasicFormOnChange = (field, cur) => { |
|
|
|
emit('detailBasicFormOnChange', field, cur) |
|
|
|
} |
|
|
|
|
|
|
@ -805,7 +999,7 @@ const openImage=(item)=>{ |
|
|
|
* @param field 当前操作字段 |
|
|
|
* @param e |
|
|
|
*/ |
|
|
|
const onBlur = (field, e) => { |
|
|
|
const onBlur = (field, e) => { |
|
|
|
emit('onBlur', field, e) |
|
|
|
} |
|
|
|
|