Browse Source

格式化文件 否则打包失败

master_hella_20240701
陈薪名 5 months ago
parent
commit
2c8aa45b47
  1. 155
      src/views/eam/equipmentReportRepairRequest/index.vue

155
src/views/eam/equipmentReportRepairRequest/index.vue

@ -1,92 +1,71 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentReportRepairRequest.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search :schema="EquipmentReportRepairRequest.allSchemas.searchSchema" @search="setSearchParams"
@reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentReportRepairRequest.allSchemas"
/>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="EquipmentReportRepairRequest.allSchemas" />
<!-- 列表 -->
<ContentWrap>
<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 #number="{row}">
<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 #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)">
<span>{{ row.number }}</span>
</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>
<template #images="{ row }">
<ButtonBase v-if="row.images === 'TRUE' ":Butttondata="butttondataView(row)" @button-base-click="buttonTableClick($event, row)" />
<ButtonBase v-if="row.images === 'TRUE'" :Butttondata="butttondataView(row)"
@button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EquipmentReportRepairRequestRules"
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="EquipmentReportRepairRequestRules"
:formAllSchemas="EquipmentReportRepairRequest.allSchemas"
:apiUpdate="EquipmentReportRepairRequestApi.updateEquipmentReportRepairRequest"
:apiCreate="EquipmentReportRepairRequestApi.createEquipmentReportRepairRequest"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
@searchTableSuccess="searchTableSuccess" :isBusiness="false" @onChange="onChange" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentReportRepairRequest.allSchemas" />
<Dialog
ref="basicFormViewRef"
v-model="showView"
:key="viewKey"
:closeOnClickModal="true"
:title="viewTitle"
>
<Dialog ref="basicFormViewRef" v-model="showView" :key="viewKey" :closeOnClickModal="true" :title="viewTitle">
<el-image v-for="url in urls" :key="url" :src="url" lazy />
</Dialog>
<!-- 审核页面 -->
<AudiForm ref="audiFormRef" @success="getData" @close="getClosed"/>
<AudiForm ref="audiFormRef" @success="getData" @close="getClosed" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-report-repair-request/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm ref="importFormRef" url="/eam/equipment-report-repair-request/import"
:importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentReportRepairRequest,EquipmentReportRepairRequestRules } from './equipmentReportRepairRequest.data'
import { EquipmentReportRepairRequest, EquipmentReportRepairRequestRules } from './equipmentReportRepairRequest.data'
import * as EquipmentReportRepairRequestApi from '@/api/eam/equipmentReportRepairRequest'
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'
import AudiForm from '@/views/eam/equipmentReportRepairRequest/audiForm.vue'
import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data";
import { EquipmentAccounts } from "@/views/eam/equipmentAccounts/equipmentAccounts.data";
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data";
import { ToolAccounts } from "@/views/eam/toolAccounts/toolAccounts.data";
import * as ToolItemApi from "@/api/eam/toolAccounts";
import * as EquipmentReportRepairApi from "@/api/eam/equipmentReportRepairRequest";
@ -127,9 +106,9 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:equipmentReportRepairRequest:create'}), //
defaultButtons.defaultAddBtn({ hasPermi: 'eam:equipmentReportRepairRequest:create' }), //
//defaultButtons.defaultImportBtn({hasPermi:'eam:equipmentReportRepairRequest:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:equipmentReportRepairRequest:export'}), //
defaultButtons.defaultExportBtn({ hasPermi: 'eam:equipmentReportRepairRequest:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -167,7 +146,7 @@ const buttonBaseClick = (val, item) => {
}
const isShowStatusButton = (row,val) => {
const isShowStatusButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
@ -179,11 +158,11 @@ const isShowStatusButton = (row,val) => {
const butttondata = (row) => {
return [
//defaultButtons.mainListEditBtn({hide: isShowStatusButton(row, ['0']),hasPermi: 'eam:equipmentReportRepairRequest:update'}), //
defaultButtons.mainListAuditingBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), //
defaultButtons.mainListAuditedBtn({hide: isShowStatusButton(row, ['2']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), //
defaultButtons.mainListRevokeBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentReportRepairRequest:update'}),
defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentReportRepairRequest:update'}), //
defaultButtons.mainListAuditingBtn({ hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update' }), //
defaultButtons.mainListAuditedBtn({ hide: isShowStatusButton(row, ['2']), hasPermi: 'eam:equipmentReportRepairRequest:update' }), //
defaultButtons.mainListRevokeBtn({ hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update' }), //
defaultButtons.mainListFinishBtn({ hide: isShowStatusButton(row, ['3']), hasPermi: 'eam:equipmentReportRepairRequest:update' }),
defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:equipmentReportRepairRequest:update' }), //
]
}
@ -241,19 +220,19 @@ const openForm = async (type: string, row?: any) => {
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentReportRepairRequest.allSchemas.formSchema.some(function (item) {
const formsSuccess = async (formType, data) => {
var isHave = EquipmentReportRepairRequest.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.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;
const tags=ref([])
if (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null;
const tags = ref([])
if (data.images != null && data.images != "") {
data.images.forEach((item: any) => {
const newItem = {};
@ -288,7 +267,7 @@ const handleFinish = async (id: number) => {
try {
const params = ref({
id: '',
status:'',
status: '',
})
params.value.id = id
params.value.status = '5'
@ -296,7 +275,7 @@ const handleFinish = async (id: number) => {
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
} catch { }
}
//
@ -305,10 +284,10 @@ const handleAudited = async (row) => {
//
audiFormRef.value.open('update', row);
}).catch(async (action: Action) => {
if(action === 'cancel'){
if (action === 'cancel') {
const params = ref({
id: '',
status:'',
status: '',
})
params.value.id = row.id
params.value.status = '4'
@ -327,7 +306,7 @@ const handleAuditing = async (id: number) => {
try {
const params = ref({
id: '',
status:'',
status: '',
})
params.value.id = id
params.value.status = '2'
@ -335,7 +314,7 @@ const handleAuditing = async (id: number) => {
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
} catch { }
}
/** 撤回按钮操作 */
@ -344,7 +323,7 @@ const handleRevoke = async (id: number) => {
try {
const params = ref({
id: '',
status:'',
status: '',
})
params.value.id = id
params.value.status = '1'
@ -352,7 +331,7 @@ const handleRevoke = async (id: number) => {
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
} catch { }
}
/** 删除按钮操作 */
@ -365,7 +344,7 @@ const handleDelete = async (id: number) => {
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
} catch { }
}
/** 导出按钮操作 */
@ -400,41 +379,41 @@ const importSuccess = () => {
}
//audiForm
const getClosed=(val)=> {
const getClosed = (val) => {
nextTick?.(() => {
getList()
})
}
//audiForm
const getData=(val)=> {
const getData = (val) => {
nextTick?.(async () => {
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '3'
await EquipmentReportRepairRequestApi.updateEquipmentReportRepairOrder(params.value)
message.success(t('工单已流转'))
//
await getList()
} catch {}
try {
const params = ref({
id: '',
status: '',
})
params.value.id = val
params.value.status = '3'
await EquipmentReportRepairRequestApi.updateEquipmentReportRepairOrder(params.value)
message.success(t('工单已流转'))
//
await getList()
} catch { }
}
}
)
}
const onChange = (field, item) => {
//
if(field == 'type' && item == 'DEVICE'){
if (field == 'type' && item == 'DEVICE') {
EquipmentReportRepairRequest.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
basicFormRef.value.formRef.setValues({
equipmentCode:''
equipmentCode: ''
})
items.componentProps.searchAllSchemas = EquipmentAccounts.allSchemas
items.componentProps.searchPage = EquipmentItemApi.getEquipmentAccountsPage
@ -442,11 +421,11 @@ const onChange = (field, item) => {
})
}
//
if(field == 'type' && item == 'EQUIPMENT'){
if (field == 'type' && item == 'EQUIPMENT') {
EquipmentReportRepairRequest.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
basicFormRef.value.formRef.setValues({
equipmentCode:''
equipmentCode: ''
})
items.componentProps.searchAllSchemas = ToolAccounts.allSchemas
items.componentProps.searchPage = ToolItemApi.getToolAccountsPage
@ -454,7 +433,7 @@ const onChange = (field, item) => {
})
}
//
if(field == 'images'){
if (field == 'images') {
EquipmentReportRepairRequest.allSchemas.formSchema.forEach((items) => {
if (items.field == 'images') {
console.log(items.value);

Loading…
Cancel
Save