Browse Source

BUG修改

master_hella_20240701
parent
commit
f99b42437b
  1. 10
      src/views/qms/inspection/inspectionRecord/index.vue
  2. 88
      src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts
  3. 387
      src/views/qms/inspection/inspectionRequest/index.vue

10
src/views/qms/inspection/inspectionRecord/index.vue

@ -30,9 +30,9 @@
<BasicForm ref="formRef" @success="getList" :rules="InspectionRecordMainRules" <BasicForm ref="formRef" @success="getList" :rules="InspectionRecordMainRules"
:formAllSchemas="InspectionRecordMain.allSchemas" :tableAllSchemas="InspectionRecordDetail.allSchemas" :formAllSchemas="InspectionRecordMain.allSchemas" :tableAllSchemas="InspectionRecordDetail.allSchemas"
:tableFormRules="InspectionRecordDetailRules" :tableData="tableData" :tableFormRules="InspectionRecordDetailRules" :tableData="tableData"
:apiUpdate="InspectionRecordMainApi.updateInspectionRecordMain" :apiCreate="InspectionRecordMainApi.createInspectionRecordMain" :apiUpdate="InspectionRecordMainApi.updateInspectionRecordMain"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" :apiCreate="InspectionRecordMainApi.createInspectionRecordMain" :isBusiness="true" @handleAddTable="handleAddTable"
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" /> @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas" <Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas"
@ -40,8 +40,8 @@
:apiCreate="InspectionRecordDetailApi.createInspectionRecordDetail" :apiCreate="InspectionRecordDetailApi.createInspectionRecordDetail"
:apiUpdate="InspectionRecordDetailApi.updateInspectionRecordDetail" :apiUpdate="InspectionRecordDetailApi.updateInspectionRecordDetail"
:apiPage="InspectionRecordDetailApi.getInspectionRecordDetailPage" :apiPage="InspectionRecordDetailApi.getInspectionRecordDetailPage"
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail" @searchTableSuccessDetail="searchTableSuccessDetail" :apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail"
:isShowAddBtn="false" :detailButtonIsShow="true" /> @searchTableSuccessDetail="searchTableSuccessDetail" :isShowAddBtn="false" :detailButtonIsShow="true" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData" <ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"

88
src/views/qms/inspection/inspectionRecord/inspectionJobMain.data.ts → src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts

@ -9,15 +9,7 @@ const { t } = useI18n() // 国际化
*/ */
export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: 'id', label: '记录编号',
field: 'id',
sort: 'custom',
isTable: false,
isSearch: true,
isForm: false,
},
{
label: '编码',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
@ -32,82 +24,82 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '任务编码', label: '任务编码',
field: 'taskCode', field: 'taskCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '供应商编码', label: '供应商编码',
field: 'supplierCode', field: 'supplierCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '物料编码', label: '物料编码',
field: 'materialCode', field: 'materialCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '批次', label: '批次',
field: 'batch', field: 'batch',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '检验方案编码', label: '检验方案编码',
field: 'inspectionSchemeCode', field: 'inspectionSchemeCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '检验方案Json', label: '检验方案Json',
field: 'inspectionSchemeJson', field: 'inspectionSchemeJson',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '检验批次', label: '检验批次',
field: 'inspectionBatch', field: 'inspectionBatch',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '检验批数量', label: '检验批数量',
field: 'inspectionBatchAmount', field: 'inspectionBatchAmount',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '采样总数量', label: '采样总数量',
field: 'sampleTatalAmount', field: 'sampleTatalAmount',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '检验类型', label: '检验类型',
field: 'inspectionType', field: 'inspectionType',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'SelectV2' component: 'Select'
}, },
}, },
{ {
label: '检验批来源', label: '检验批来源',
field: 'inspectionBatchSource', field: 'inspectionBatchSource',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '订单号', label: '订单号',
field: 'orderCode', field: 'orderCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '订单行', label: '订单行',
field: 'orderRow', field: 'orderRow',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
@ -117,13 +109,13 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '凭证号', label: '凭证号',
field: 'certificateCode', field: 'certificateCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '凭证行', label: '凭证行',
field: 'certificateRow', field: 'certificateRow',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
@ -133,7 +125,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '检验阶段', label: '检验阶段',
field: 'inspectionStage', field: 'inspectionStage',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
@ -143,20 +135,20 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '检验严格性', label: '检验严格性',
field: 'inspectionStringency', field: 'inspectionStringency',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '使用决策', label: '使用决策',
field: 'useDecision', field: 'useDecision',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '计划开始时间', label: '计划开始时间',
field: 'planStartTime', field: 'planStartTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -178,7 +170,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'planEndTime', field: 'planEndTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -200,7 +192,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'realStartTime', field: 'realStartTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -222,7 +214,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'realEndTime', field: 'realEndTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -243,26 +235,26 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '检验水平', label: '检验水平',
field: 'inspectionLevel', field: 'inspectionLevel',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: 'AQL值', label: 'AQL值',
field: 'aqlValue', field: 'aqlValue',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -319,32 +311,32 @@ export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'id', field: 'id',
sort: 'custom', sort: 'custom',
isTable: false, isTable: false,
isSearch: true, isSearch: false,
isForm: false, isForm: false,
}, },
{ {
label: '记录编码', label: '记录编码',
field: 'recordCode', field: 'recordCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '工序编码', label: '工序编码',
field: 'processCode', field: 'processCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '工序描述', label: '工序描述',
field: 'processDescribe', field: 'processDescribe',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '顺序号', label: '顺序号',
field: 'sequenceCode', field: 'sequenceCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
@ -354,7 +346,7 @@ export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '是否破坏性检验', label: '是否破坏性检验',
field: 'isDestroyInspection', field: 'isDestroyInspection',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'Radio' component: 'Radio'
}, },
@ -364,7 +356,7 @@ export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionStartTime', field: 'inspectionStartTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -386,7 +378,7 @@ export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionEndTime', field: 'inspectionEndTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -407,26 +399,26 @@ export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '检验人', label: '检验人',
field: 'inspectionOperator', field: 'inspectionOperator',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '检验特性编码', label: '检验特性编码',
field: 'inspectionFeaturesCode', field: 'inspectionFeaturesCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {

387
src/views/qms/inspection/inspectionRequest/index.vue

@ -4,29 +4,17 @@
<Search :schema="InspectionMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="InspectionMain.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="InspectionMain.allSchemas" />
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="InspectionMain.allSchemas"
/>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table <Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total total: tableObject.total
}" }" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:pageSize="tableObject.pageSize" v-model:sort="tableObject.sort">
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}"> <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>
@ -39,206 +27,199 @@
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm ref="basicFormRef" @success="formsSuccess" :rules="InspectionMainRules"
ref="basicFormRef" :formAllSchemas="InspectionMain.allSchemas" :apiUpdate="InspectionMainApi.updateInspectionMain"
@success="formsSuccess" :apiCreate="InspectionMainApi.createInspectionMain" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
:rules="InspectionMainRules"
:formAllSchemas="InspectionMain.allSchemas"
:apiUpdate="InspectionMainApi.updateInspectionMain"
:apiCreate="InspectionMainApi.createInspectionMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionMain.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionMain.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/request/inspection-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/request/inspection-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 { InspectionMain,InspectionMainRules } from './inspectionMain.data' import { InspectionMain, InspectionMainRules } from './inspectionMain.data'
import * as InspectionMainApi from '@/api/qms/inspectionRequest' import * as InspectionMainApi from '@/api/qms/inspectionRequest'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'InspectionMain' }) defineOptions({ name: 'InspectionMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(InspectionMain.allSchemas.tableColumns) const tableColumns = ref(InspectionMain.allSchemas.tableColumns)
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
formRef.setValues(setV) formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: InspectionMainApi.getInspectionMainPage //
}) })
}
//
// const { getList, setSearchParams } = tableMethods
const updataTableColumns = (val) => {
tableColumns.value = val //
} const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
const { tableObject, tableMethods } = useTable({ defaultButtons.defaultImportBtn({ hasPermi: 'wms:inspectionMain:import' }), //
getListApi: InspectionMainApi.getInspectionMainPage // defaultButtons.defaultExportBtn({ hasPermi: 'wms:inspectionMain:export' }), //
}) defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
// defaultButtons.defaultSetBtn(null), //
const { getList, setSearchParams } = tableMethods // {
// label: '',
// // name: 'zdy',
const HeadButttondata = [ // hide: false,
defaultButtons.defaultAddBtn({hasPermi:'wms:inspectionMain:create'}), // // type: 'primary',
defaultButtons.defaultImportBtn({hasPermi:'wms:inspectionMain:import'}), // // icon: 'Select',
defaultButtons.defaultExportBtn({hasPermi:'wms:inspectionMain:export'}), // // color: ''
defaultButtons.defaultFreshBtn(null), // // },
defaultButtons.defaultFilterBtn(null), // ]
defaultButtons.defaultSetBtn(null), //
// { //
// label: '', const buttonBaseClick = (val, item) => {
// name: 'zdy', if (val == 'add') { //
// hide: false, openForm('create')
// type: 'primary', } else if (val == 'import') { //
// icon: 'Select', handleImport()
// color: '' } else if (val == 'export') { //
// }, handleExport()
] } else if (val == 'refresh') { //
getList()
// } else if (val == 'filtrate') { //
const buttonBaseClick = (val, item) => { } else { //
if (val == 'add') { // console.log('其他按钮', item)
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 = [
const butttondata = [ defaultButtons.mainListEditBtn({ hasPermi: 'wms:inspectionMain:update' }), //
defaultButtons.mainListEditBtn({hasPermi:'wms:inspectionMain:update'}), // defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:inspectionMain:delete' }), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:inspectionMain:delete'}), // ]
]
// -
// - const buttonTableClick = async (val, row) => {
const buttonTableClick = async (val, row) => { if (val == 'edit') { //
if (val == 'edit') { // openForm('update', row)
openForm('update', row) } else if (val == 'delete') { //
} else if (val == 'delete') { // handleDelete(row.id)
handleDelete(row.id) }
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
basicFormRef.value.open(type, row)
} }
}
// form
/** 添加/修改操作 */ const formsSuccess = async (formType, data) => {
const basicFormRef = ref() var isHave = InspectionMain.allSchemas.formSchema.some(function (item) {
const openForm = (type: string, row?: any) => { return item.field === 'activeTime' || item.field === 'expireTime';
basicFormRef.value.open(type, row) });
} if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
// form message.error('失效时间要大于生效时间')
const formsSuccess = async (formType,data) => { return;
var isHave =InspectionMain.allSchemas.formSchema.some(function (item) { }
return item.field === 'activeTime' || item.field === 'expireTime'; }
}); if (data.activeTime == 0) data.activeTime = null;
if(isHave){ if (data.expireTime == 0) data.expireTime = null;
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (formType === 'create') {
message.error('失效时间要大于生效时间') await InspectionMainApi.createInspectionMain(data)
return; message.success(t('common.createSuccess'))
} else {
await InspectionMainApi.updateInspectionMain(data)
message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false
getList()
} }
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null; /** 详情操作 */
if (formType === 'create') { const detailRef = ref()
await InspectionMainApi.createInspectionMain(data) const openDetail = (row : any, titleName : any, titleValue : any) => {
message.success(t('common.createSuccess')) detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionMain')
} else {
await InspectionMainApi.updateInspectionMain(data)
message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false
getList() /** 删除按钮操作 */
} const handleDelete = async (id : number) => {
try {
/** 详情操作 */ //
const detailRef = ref() await message.delConfirm()
const openDetail = (row: any, titleName: any, titleValue: any) => { //
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionMain') await InspectionMainApi.deleteInspectionMain(id)
} message.success(t('common.delSuccess'))
//
/** 删除按钮操作 */ await getList()
const handleDelete = async (id: number) => { } catch { }
try {
//
await message.delConfirm()
//
await InspectionMainApi.deleteInspectionMain(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 InspectionMainApi.exportInspectionMain(tableObject.params)
download.excel(data, '检验申请.xlsx')
} catch {
} finally {
exportLoading.value = false
} }
}
/** 导出按钮操作 */
/** 导入 */ const exportLoading = ref(false) //
const importFormRef = ref() const handleExport = async () => {
const handleImport = () => { try {
importFormRef.value.open() //
} await message.exportConfirm()
// //
const importTemplateData = reactive({ exportLoading.value = true
templateUrl: '', const data = await InspectionMainApi.exportInspectionMain(tableObject.params)
templateTitle: '检验申请导入模版.xlsx' download.excel(data, '检验申请.xlsx')
}) } catch {
// } finally {
const importSuccess = () => { exportLoading.value = false
getList() }
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
} }
getList() //
}
/** 初始化 **/ /** 导入 */
onMounted(async () => { const importFormRef = ref()
getList() const handleImport = () => {
importTemplateData.templateUrl = await InspectionMainApi.importTemplate() 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 InspectionMainApi.importTemplate()
})
</script> </script>

Loading…
Cancel
Save