添砖-JAVA\Administrator
5 months ago
1 changed files with 301 additions and 239 deletions
@ -1,309 +1,371 @@ |
|||||
<template> |
<template> |
||||
<ContentWrap> |
<ContentWrap> |
||||
<!-- 搜索工作栏 --> |
<!-- 搜索工作栏 --> |
||||
<Search :schema="ApplicationRecordMain.allSchemas.searchSchema" @search="setSearchParams" |
<Search |
||||
@reset="setSearchParams" /> |
:schema="ApplicationRecordMain.allSchemas.searchSchema" |
||||
|
@search="setSearchParams" |
||||
|
@reset="setSearchParams" |
||||
|
/> |
||||
</ContentWrap> |
</ContentWrap> |
||||
|
|
||||
<!-- 列表头部 --> |
<!-- 列表头部 --> |
||||
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" |
<TableHead |
||||
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" |
:HeadButttondata="HeadButttondata" |
||||
:allSchemas="ApplicationRecordMain.allSchemas" /> |
@button-base-click="buttonBaseClick" |
||||
|
:routeName="routeName" |
||||
|
@updataTableColumns="updataTableColumns" |
||||
|
@searchFormClick="searchFormClick" |
||||
|
:allSchemas="ApplicationRecordMain.allSchemas" |
||||
|
/> |
||||
|
|
||||
<!-- 列表 --> |
<!-- 列表 --> |
||||
<ContentWrap> |
<ContentWrap> |
||||
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{ |
<Table |
||||
|
: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:sort="tableObject.sort"> |
v-model:pageSize="tableObject.pageSize" |
||||
<template #number="{row}"> |
v-model:currentPage="tableObject.currentPage" |
||||
|
v-model:sort="tableObject.sort" |
||||
|
> |
||||
|
<template #number="{ row }"> |
||||
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
||||
<span>{{ row.number }}</span> |
<span>{{ row.number }}</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 ref="formRef" @success="getList" :rules="ApplicationRecordMainRules" |
<BasicForm |
||||
:formAllSchemas="ApplicationRecordMain.allSchemas" :tableAllSchemas="ApplicationRecordDetail.allSchemas" |
ref="formRef" |
||||
:tableFormRules="ApplicationRecordDetailRules" :tableData="tableData" |
@success="getList" |
||||
|
:rules="ApplicationRecordMainRules" |
||||
|
:formAllSchemas="ApplicationRecordMain.allSchemas" |
||||
|
:tableAllSchemas="ApplicationRecordDetail.allSchemas" |
||||
|
:tableFormRules="ApplicationRecordDetailRules" |
||||
|
:tableData="tableData" |
||||
:apiUpdate="ApplicationRecordMainApi.updateApplicationRecordMain" |
:apiUpdate="ApplicationRecordMainApi.updateApplicationRecordMain" |
||||
:apiCreate="ApplicationRecordMainApi.createApplicationRecordMain" :isBusiness="true" |
:apiCreate="ApplicationRecordMainApi.createApplicationRecordMain" |
||||
@handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" |
:isBusiness="true" |
||||
@submitForm="submitForm" /> |
@handleAddTable="handleAddTable" |
||||
|
@handleDeleteTable="handleDeleteTable" |
||||
|
@searchTableSuccess="searchTableSuccess" |
||||
|
@submitForm="submitForm" |
||||
|
/> |
||||
|
|
||||
<!-- 详情 --> |
<!-- 详情 --> |
||||
<Detail ref="detailRef" :isBasic="false" :allSchemas="ApplicationRecordMain.allSchemas" |
<Detail |
||||
:detailAllSchemas="ApplicationRecordDetail.allSchemas" :detailAllSchemasRules="ApplicationRecordDetailRules" |
ref="detailRef" |
||||
|
:isBasic="false" |
||||
|
:allSchemas="ApplicationRecordMain.allSchemas" |
||||
|
:detailAllSchemas="ApplicationRecordDetail.allSchemas" |
||||
|
:detailAllSchemasRules="ApplicationRecordDetailRules" |
||||
:apiCreate="ApplicationRecordDetailApi.createApplicationRecordDetail" |
:apiCreate="ApplicationRecordDetailApi.createApplicationRecordDetail" |
||||
:apiUpdate="ApplicationRecordDetailApi.updateApplicationRecordDetail" |
:apiUpdate="ApplicationRecordDetailApi.updateApplicationRecordDetail" |
||||
:apiPage="ApplicationRecordDetailApi.getApplicationRecordDetailPage" |
:apiPage="ApplicationRecordDetailApi.getApplicationRecordDetailPage" |
||||
:apiDelete="ApplicationRecordDetailApi.deleteApplicationRecordDetail" |
:apiDelete="ApplicationRecordDetailApi.deleteApplicationRecordDetail" |
||||
@searchTableSuccessDetail="searchTableSuccessDetail" |
@searchTableSuccessDetail="searchTableSuccessDetail" |
||||
:isShowAddBtn="false" |
:isShowAddBtn="false" |
||||
:detailButtonIsShow="true" /> |
:detailButtonIsShow="true" |
||||
|
/> |
||||
<!-- 审批详情 --> |
<!-- 审批详情 --> |
||||
<approveDetail ref="detailRef1" :isBasic="false" :allSchemas="ApplicationRecordMain.allSchemas" |
<!-- <approveDetail |
||||
:detailAllSchemas="ApplicationRecordDetail.allSchemas" :detailAllSchemasRules="ApplicationRecordDetailRules" |
ref="detailRef1" |
||||
|
:isBasic="false" |
||||
|
:allSchemas="ApplicationRecordMain.allSchemas" |
||||
|
:detailAllSchemas="ApplicationRecordDetail.allSchemas" |
||||
|
:detailAllSchemasRules="ApplicationRecordDetailRules" |
||||
:apiAgree="ApplicationRecordMainApi.agreeApplicationRecordMain" |
:apiAgree="ApplicationRecordMainApi.agreeApplicationRecordMain" |
||||
:apiDisAgree="ApplicationRecordMainApi.disAgreeApplicationRecordMain" |
:apiDisAgree="ApplicationRecordMainApi.disAgreeApplicationRecordMain" |
||||
:apiPage="ApplicationRecordDetailApi.getApplicationRecordDetailPage" |
:apiPage="ApplicationRecordDetailApi.getApplicationRecordDetailPage" |
||||
@searchTableSuccessDetail="searchTableSuccessDetail" |
@searchTableSuccessDetail="searchTableSuccessDetail" |
||||
@agree="getList"/> |
@agree="getList" |
||||
|
/> --> |
||||
<!-- 导入 --> |
<!-- 导入 --> |
||||
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData" |
<ImportForm |
||||
@success="importSuccess" :isShowOut="true" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
ref="importFormRef" |
||||
|
url="/wms/purchase-main/import" |
||||
|
:importTemplateData="importTemplateData" |
||||
|
@success="importSuccess" |
||||
|
:isShowOut="true" |
||||
|
:updateIsDisable="true" |
||||
|
:coverIsDisable="true" |
||||
|
:mode="2" |
||||
|
/> |
||||
</template> |
</template> |
||||
|
|
||||
<script setup lang="ts"> |
<script setup lang="ts"> |
||||
import download from '@/utils/download' |
import download from '@/utils/download' |
||||
import { ApplicationRecordMain, ApplicationRecordMainRules, ApplicationRecordDetail, ApplicationRecordDetailRules } from './applicationRecordMain.data' |
import { |
||||
import * as ApplicationRecordMainApi from '@/api/eam/applicationRecordMain' |
ApplicationRecordMain, |
||||
import * as ApplicationRecordDetailApi from '@/api/eam/applicationRecordDetail' |
ApplicationRecordMainRules, |
||||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
ApplicationRecordDetail, |
||||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
ApplicationRecordDetailRules |
||||
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
} from './applicationRecordMain.data' |
||||
import approveDetail from '@/components/Detail/src/approveDetail.vue' |
import * as ApplicationRecordMainApi from '@/api/eam/applicationRecordMain' |
||||
|
import * as ApplicationRecordDetailApi from '@/api/eam/applicationRecordDetail' |
||||
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
||||
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
||||
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
||||
|
import approveDetail from '@/components/Detail/src/approveDetail.vue' |
||||
|
|
||||
// 采购订单 |
// 采购订单 |
||||
defineOptions({ name: 'ApplicationRecord' }) |
defineOptions({ name: 'ApplicationRecord' }) |
||||
|
|
||||
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(ApplicationRecordMain.allSchemas.tableColumns) |
const tableColumns = ref(ApplicationRecordMain.allSchemas.tableColumns) |
||||
|
|
||||
// 字段设置 更新主列表字段 |
// 字段设置 更新主列表字段 |
||||
const updataTableColumns = (val) => { |
const updataTableColumns = (val) => { |
||||
tableColumns.value = val |
tableColumns.value = val |
||||
} |
} |
||||
|
|
||||
// 查询页面返回 |
// 查询页面返回 |
||||
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
||||
nextTick(async () => { |
nextTick(async () => { |
||||
if (type == 'tableForm') { |
if (type == 'tableForm') { |
||||
// 明细查询页赋值 |
// 明细查询页赋值 |
||||
row[formField] = val[0][searchField] |
row[formField] = val[0][searchField] |
||||
row['itemNumber'] = val[0]['number'] |
row['itemNumber'] = val[0]['number'] |
||||
row['isRadeIn'] = val[0]['isRadeIn'] |
row['isRadeIn'] = val[0]['isRadeIn'] |
||||
row['available'] = val[0]['available'] |
row['available'] = val[0]['available'] |
||||
} else { |
} else { |
||||
const setV = {} |
|
||||
setV[formField] = val[0][searchField] |
|
||||
formRef.setValues(setV) |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
// 查询页面返回——详情 |
|
||||
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
||||
nextTick(async () => { |
|
||||
const setV = {} |
const setV = {} |
||||
// if(formField == 'itemCode'){ |
setV[formField] = val[0][searchField] |
||||
// await ItembasicApi.getItembasicPage({ |
|
||||
// code: setV['itemCode'] |
|
||||
// }).then(res => { |
|
||||
// setV['uom'] = res.list[0].uom |
|
||||
// setV[formField] = val[0][searchField] |
|
||||
// }) |
|
||||
// } |
|
||||
formRef.setValues(setV) |
formRef.setValues(setV) |
||||
}) |
} |
||||
} |
}) |
||||
|
} |
||||
|
// 查询页面返回——详情 |
||||
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
||||
|
nextTick(async () => { |
||||
|
const setV = {} |
||||
|
// if(formField == 'itemCode'){ |
||||
|
// await ItembasicApi.getItembasicPage({ |
||||
|
// code: setV['itemCode'] |
||||
|
// }).then(res => { |
||||
|
// setV['uom'] = res.list[0].uom |
||||
|
// setV[formField] = val[0][searchField] |
||||
|
// }) |
||||
|
// } |
||||
|
formRef.setValues(setV) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
// 子表新增的时候选择表格之后需要会显得字段 |
// 子表新增的时候选择表格之后需要会显得字段 |
||||
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] |
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] |
||||
const Echo = [] |
const Echo = [] |
||||
|
|
||||
const { tableObject, tableMethods } = useTable({ |
const { tableObject, tableMethods } = useTable({ |
||||
getListApi: ApplicationRecordMainApi.getApplicationRecordMainPage // 分页接口 |
getListApi: ApplicationRecordMainApi.getApplicationRecordMainPage // 分页接口 |
||||
}) |
}) |
||||
|
|
||||
// 获得表格的各种操作 |
// 获得表格的各种操作 |
||||
const { getList, setSearchParams } = tableMethods |
const { getList, setSearchParams } = tableMethods |
||||
|
|
||||
// 列表头部按钮 |
// 列表头部按钮 |
||||
const HeadButttondata = [ |
const HeadButttondata = [ |
||||
// defaultButtons.defaultAddBtn(null), // 新增 |
// defaultButtons.defaultAddBtn(null), // 新增 |
||||
// defaultButtons.defaultImportBtn(null), // 导入 |
// defaultButtons.defaultImportBtn(null), // 导入 |
||||
// defaultButtons.defaultExportBtn(null), // 导出 |
// defaultButtons.defaultExportBtn(null), // 导出 |
||||
defaultButtons.defaultFreshBtn(null), // 刷新 |
defaultButtons.defaultFreshBtn(null), // 刷新 |
||||
defaultButtons.defaultFilterBtn(null), // 筛选 |
defaultButtons.defaultFilterBtn(null), // 筛选 |
||||
defaultButtons.defaultSetBtn(null), // 设置 |
defaultButtons.defaultSetBtn(null) // 设置 |
||||
// { |
// { |
||||
// label: '自定义扩展按钮', |
// label: '自定义扩展按钮', |
||||
// name: 'zdy', |
// name: 'zdy', |
||||
// hide: false, |
// hide: false, |
||||
// type: 'primary', |
// type: 'primary', |
||||
// icon: 'Select', |
// icon: 'Select', |
||||
// color: '' |
// color: '' |
||||
// }, |
// }, |
||||
] |
] |
||||
|
|
||||
// 头部按钮事件 |
// 头部按钮事件 |
||||
const buttonBaseClick = (val, item) => { |
const buttonBaseClick = (val, item) => { |
||||
if (val == 'add') { // 新增 |
if (val == 'add') { |
||||
openForm('create') |
// 新增 |
||||
} else if (val == 'import') { // 导入 |
openForm('create') |
||||
handleImport() |
} else if (val == 'import') { |
||||
} else if (val == 'export') { // 导出 |
// 导入 |
||||
handleExport() |
handleImport() |
||||
} else if (val == 'refresh') { // 刷新 |
} else if (val == 'export') { |
||||
getList() |
// 导出 |
||||
} else if (val == 'filtrate') { // 筛选 |
handleExport() |
||||
} else { // 其他按钮 |
} else if (val == 'refresh') { |
||||
console.log('其他按钮', item) |
// 刷新 |
||||
} |
getList() |
||||
|
} else if (val == 'filtrate') { |
||||
|
// 筛选 |
||||
|
} else { |
||||
|
// 其他按钮 |
||||
|
console.log('其他按钮', item) |
||||
} |
} |
||||
|
} |
||||
|
|
||||
// 根据状态返回该按钮是否显示 |
// 根据状态返回该按钮是否显示 |
||||
const isShowMainButton = (row, val) => { |
const isShowMainButton = (row, val) => { |
||||
if (val.indexOf(row.status) > -1) { |
if (val.indexOf(row.status) > -1) { |
||||
return false |
return false |
||||
} else { |
} else { |
||||
return true |
return true |
||||
} |
|
||||
} |
} |
||||
|
} |
||||
|
|
||||
// 列表-操作按钮 |
// 列表-操作按钮 |
||||
const butttondata = (row) => { |
const butttondata = (row) => { |
||||
return [ |
return [ |
||||
defaultButtons.approveBtn({ hide: isShowMainButton(row, ['0']) ,hasPermi:'item:itemApplyMain:approve'}), // 审批 |
defaultButtons.approveBtn({ |
||||
// defaultButtons.mainListEditBtn(null), // 编辑 |
hide: isShowMainButton(row, ['0']), |
||||
// defaultButtons.mainListDeleteBtn(null), // 删除 |
hasPermi: 'item:itemApplyMain:approve' |
||||
] |
}) // 审批 |
||||
} |
// defaultButtons.mainListEditBtn(null), // 编辑 |
||||
|
// defaultButtons.mainListDeleteBtn(null), // 删除 |
||||
|
] |
||||
|
} |
||||
|
|
||||
// 列表-操作按钮事件 |
// 列表-操作按钮事件 |
||||
const buttonTableClick = async (val, row) => { |
const buttonTableClick = async (val, row) => { |
||||
if (val == 'edit') { // 编辑 |
if (val == 'edit') { |
||||
openForm('update', row) |
// 编辑 |
||||
} else if (val == 'approve') { // 审批 |
openForm('update', row) |
||||
handleApprove(row, '单据号', row.number) |
} else if (val == 'approve') { |
||||
} else if (val == 'delete') { // 删除 |
// 审批 |
||||
handleDelete(row.id) |
handleApprove(row, '单据号', row.number) |
||||
} |
} else if (val == 'delete') { |
||||
|
// 删除 |
||||
|
handleDelete(row.id) |
||||
} |
} |
||||
|
} |
||||
|
|
||||
/** 添加/修改操作 */ |
/** 添加/修改操作 */ |
||||
const formRef = ref() |
const formRef = ref() |
||||
const openForm = async (type : string, row ?: number) => { |
const openForm = async (type: string, row?: number) => { |
||||
tableData.value = [] // 重置明细数据 |
tableData.value = [] // 重置明细数据 |
||||
formRef.value.open(type, row) |
formRef.value.open(type, row) |
||||
} |
} |
||||
|
|
||||
/** 详情操作 */ |
/** 详情操作 */ |
||||
const detailRef = ref() |
const detailRef = ref() |
||||
const openDetail = (row : any, titleName : any, titleValue : any) => { |
const openDetail = (row: any, titleName: any, titleValue: any) => { |
||||
detailRef.value.openDetail(row, titleName, titleValue, 'basicApplicationRecordMain') |
detailRef.value.openDetail(row, titleName, titleValue, 'basicApplicationRecordMain') |
||||
} |
} |
||||
const detailRef1 = ref() |
const detailRef1 = ref() |
||||
const handleApprove = (row : any, titleName : any, titleValue : any) => { |
const handleApprove = (row: any, titleName: any, titleValue: any) => { |
||||
detailRef1.value.openDetail(row, titleName, titleValue, 'basicApplicationRecordMain') |
detailRef1.value.openDetail(row, titleName, titleValue, 'basicApplicationRecordMain') |
||||
|
// 刷新列表 |
||||
|
getList() |
||||
|
} |
||||
|
|
||||
|
/** 删除按钮操作 */ |
||||
|
const handleDelete = async (id: number) => { |
||||
|
try { |
||||
|
// 删除的二次确认 |
||||
|
await message.delConfirm() |
||||
|
// 发起删除 |
||||
|
await ApplicationRecordMainApi.deleteApplicationRecordMain(id) |
||||
|
message.success(t('common.delSuccess')) |
||||
// 刷新列表 |
// 刷新列表 |
||||
getList() |
await getList() |
||||
} |
} catch {} |
||||
|
} |
||||
|
|
||||
/** 删除按钮操作 */ |
/** 导出按钮操作 */ |
||||
const handleDelete = async (id : number) => { |
const exportLoading = ref(false) // 导出的加载中 |
||||
try { |
const handleExport = async () => { |
||||
// 删除的二次确认 |
try { |
||||
await message.delConfirm() |
// 导出的二次确认 |
||||
// 发起删除 |
await message.exportConfirm() |
||||
await ApplicationRecordMainApi.deleteApplicationRecordMain(id) |
// 发起导出 |
||||
message.success(t('common.delSuccess')) |
exportLoading.value = true |
||||
// 刷新列表 |
const data = await ApplicationRecordMainApi.exportApplicationRecordMain(tableObject.params) |
||||
await getList() |
download.excel(data, '备件申领记录主.xlsx') |
||||
} catch { } |
} catch { |
||||
|
} finally { |
||||
|
exportLoading.value = false |
||||
} |
} |
||||
|
} |
||||
|
|
||||
/** 导出按钮操作 */ |
/** |
||||
const exportLoading = ref(false) // 导出的加载中 |
* tableForm方法 |
||||
const handleExport = async () => { |
*/ |
||||
try { |
const tableFormKeys = {} |
||||
// 导出的二次确认 |
ApplicationRecordDetail.allSchemas.tableFormColumns.forEach((item) => { |
||||
await message.exportConfirm() |
tableFormKeys[item.field] = item.default ? item.default : '' |
||||
// 发起导出 |
}) |
||||
exportLoading.value = true |
const tableData = ref([]) |
||||
const data = await ApplicationRecordMainApi.exportApplicationRecordMain(tableObject.params) |
|
||||
download.excel(data, '备件申领记录主.xlsx') |
|
||||
} catch { |
|
||||
} finally { |
|
||||
exportLoading.value = false |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/** |
// 添加明细 |
||||
* tableForm方法 |
const handleAddTable = () => { |
||||
*/ |
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
||||
const tableFormKeys = {} |
} |
||||
ApplicationRecordDetail.allSchemas.tableFormColumns.forEach(item => { |
// 删除明细 |
||||
tableFormKeys[item.field] = item.default ? item.default : '' |
const handleDeleteTable = (item, index) => { |
||||
}) |
tableData.value.splice(index, 1) |
||||
const tableData = ref([]) |
} |
||||
|
|
||||
// 添加明细 |
// 主子数据 提交 |
||||
const handleAddTable = () => { |
const submitForm = async (formType, data) => { |
||||
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
data.subList = tableData.value // 拼接子表数据参数 |
||||
} |
try { |
||||
// 删除明细 |
if (formType === 'create') { |
||||
const handleDeleteTable = (item, index) => { |
await ApplicationRecordMainApi.createApplicationRecordMain(data) |
||||
tableData.value.splice(index, 1) |
message.success(t('common.createSuccess')) |
||||
} |
} else { |
||||
|
await ApplicationRecordMainApi.updateApplicationRecordMain(data) |
||||
// 主子数据 提交 |
message.success(t('common.updateSuccess')) |
||||
const submitForm = async (formType, data) => { |
|
||||
data.subList = tableData.value // 拼接子表数据参数 |
|
||||
try { |
|
||||
if (formType === 'create') { |
|
||||
await ApplicationRecordMainApi.createApplicationRecordMain(data) |
|
||||
message.success(t('common.createSuccess')) |
|
||||
} else { |
|
||||
await ApplicationRecordMainApi.updateApplicationRecordMain(data) |
|
||||
message.success(t('common.updateSuccess')) |
|
||||
} |
|
||||
formRef.value.dialogVisible = false |
|
||||
// 刷新当前列表 |
|
||||
getList() |
|
||||
} finally { |
|
||||
formRef.value.formLoading = false |
|
||||
} |
} |
||||
|
formRef.value.dialogVisible = false |
||||
|
// 刷新当前列表 |
||||
|
getList() |
||||
|
} finally { |
||||
|
formRef.value.formLoading = false |
||||
} |
} |
||||
|
} |
||||
|
|
||||
/** 导入 */ |
/** 导入 */ |
||||
const importFormRef = ref() |
const importFormRef = ref() |
||||
const handleImport = () => { |
const handleImport = () => { |
||||
importFormRef.value.open() |
importFormRef.value.open() |
||||
} |
} |
||||
|
|
||||
// 导入附件弹窗所需的参数 |
// 导入附件弹窗所需的参数 |
||||
const importTemplateData = reactive({ |
const importTemplateData = reactive({ |
||||
templateUrl: '', |
templateUrl: '', |
||||
templateTitle: '采购订单主导入模版.xlsx' |
templateTitle: '采购订单主导入模版.xlsx' |
||||
}) |
}) |
||||
|
|
||||
// 导入成功之后 |
// 导入成功之后 |
||||
const importSuccess = () => { |
const importSuccess = () => { |
||||
getList() |
getList() |
||||
} |
} |
||||
|
|
||||
// 筛选提交 |
// 筛选提交 |
||||
const searchFormClick = (searchData) => { |
const searchFormClick = (searchData) => { |
||||
tableObject.params = { |
tableObject.params = { |
||||
isSearch: true, |
isSearch: true, |
||||
filters: searchData.filters |
filters: searchData.filters |
||||
} |
|
||||
getList() // 刷新当前列表 |
|
||||
} |
} |
||||
|
getList() // 刷新当前列表 |
||||
|
} |
||||
|
|
||||
/** 初始化 **/ |
/** 初始化 **/ |
||||
onMounted(async () => { |
onMounted(async () => { |
||||
getList() |
getList() |
||||
importTemplateData.templateUrl = await ApplicationRecordMainApi.importTemplate() |
importTemplateData.templateUrl = await ApplicationRecordMainApi.importTemplate() |
||||
}) |
}) |
||||
</script> |
</script> |
||||
|
Loading…
Reference in new issue