ljlong_2630
9 months ago
13 changed files with 463 additions and 410 deletions
@ -1,316 +1,359 @@ |
|||||
<template> |
<template> |
||||
<ContentWrap> |
<ContentWrap> |
||||
<!-- 搜索工作栏 --> |
<!-- 搜索工作栏 --> |
||||
<Search :schema="ItemApplyMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
<Search :schema="ItemApplyMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
||||
</ContentWrap> |
</ContentWrap> |
||||
|
|
||||
<!-- 列表头部 --> |
<!-- 列表头部 --> |
||||
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" |
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" |
||||
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" |
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" |
||||
:allSchemas="ItemApplyMain.allSchemas" /> |
:allSchemas="ItemApplyMain.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:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" |
||||
v-model:sort="tableObject.sort"> |
v-model:sort="tableObject.sort"> |
||||
<template #number="{row}"> |
<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="ItemApplyMainRules" :formAllSchemas="ItemApplyMain.allSchemas" |
<BasicForm ref="formRef" @success="getList" :rules="ItemApplyMainRules" :formAllSchemas="ItemApplyMain.allSchemas" |
||||
:tableAllSchemas="ItemApplyDetail.allSchemas" :tableFormRules="ItemApplyDetailRules" :tableData="tableData" |
:tableAllSchemas="ItemApplyDetail.allSchemas" :tableFormRules="ItemApplyDetailRules" :tableData="tableData" |
||||
:apiUpdate="ItemApplyMainApi.updateItemApplyMain" :apiCreate="ItemApplyMainApi.createItemApplyMain" |
:apiUpdate="ItemApplyMainApi.updateItemApplyMain" :apiCreate="ItemApplyMainApi.createItemApplyMain" |
||||
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" |
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" |
||||
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" /> |
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" /> |
||||
|
|
||||
<!-- 详情 --> |
<!-- 详情 --> |
||||
<Detail ref="detailRef" :isBasic="false" :allSchemas="ItemApplyMain.allSchemas" |
<Detail ref="detailRef" :isBasic="false" :allSchemas="ItemApplyMain.allSchemas" |
||||
:detailAllSchemas="ItemApplyDetail.allSchemas" :detailAllSchemasRules="ItemApplyDetailRules" |
:detailAllSchemas="ItemApplyDetail.allSchemas" :detailAllSchemasRules="ItemApplyDetailRules" |
||||
:apiCreate="ItemApplyDetailApi.createItemApplyDetail" :apiUpdate="ItemApplyDetailApi.updateItemApplyDetail" |
:apiCreate="ItemApplyDetailApi.createItemApplyDetail" :apiUpdate="ItemApplyDetailApi.updateItemApplyDetail" |
||||
:apiPage="ItemApplyDetailApi.getItemApplyDetailPage" :apiDelete="ItemApplyDetailApi.deleteItemApplyDetail" |
:apiPage="ItemApplyDetailApi.getItemApplyDetailPage" :apiDelete="ItemApplyDetailApi.deleteItemApplyDetail" |
||||
@searchTableSuccessDetail="searchTableSuccessDetail" /> |
@searchTableSuccessDetail="searchTableSuccessDetail" @detailSubmitForm='detailSubmitForm' |
||||
|
:isShowAddBtn="isShowAddBtn" |
||||
<!-- 导入 --> |
:detailButtonIsShow="detailButtonIsShow" |
||||
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData" |
/> |
||||
@success="importSuccess" :isShowOut="true" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|
||||
</template> |
<!-- 导入 --> |
||||
|
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData" |
||||
<script setup lang="ts"> |
@success="importSuccess" :isShowOut="true" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
||||
import download from '@/utils/download' |
</template> |
||||
import { ItemApplyMain, ItemApplyMainRules, ItemApplyDetail, ItemApplyDetailRules } from './itemApplyMain.data' |
|
||||
import * as ItemApplyMainApi from '@/api/eam/item/itemApplyMain' |
<script setup lang="ts"> |
||||
import * as ItemApplyDetailApi from '@/api/eam/item/itemApplyDetail' |
import download from '@/utils/download' |
||||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
import { ItemApplyMain, ItemApplyMainRules, ItemApplyDetail, ItemApplyDetailRules } from './itemApplyMain.data' |
||||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
import * as ItemApplyMainApi from '@/api/eam/item/itemApplyMain' |
||||
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
import * as ItemApplyDetailApi from '@/api/eam/item/itemApplyDetail' |
||||
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
||||
// 采购订单 |
import TableHead from '@/components/TableHead/src/TableHead.vue' |
||||
defineOptions({ name: 'ItemApplyMain' }) |
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
||||
|
|
||||
const message = useMessage() // 消息弹窗 |
// 采购订单 |
||||
const { t } = useI18n() // 国际化 |
defineOptions({ name: 'ItemApplyMain' }) |
||||
const route = useRoute() // 路由信息 |
|
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
const { t } = useI18n() // 国际化 |
||||
|
const route = useRoute() // 路由信息 |
||||
const routeName = ref() |
const routeName = ref() |
||||
routeName.value = route.name |
const isShowAddBtn = ref(true) |
||||
const tableColumns = ref(ItemApplyMain.allSchemas.tableColumns) |
const detailButtonIsShow = ref(false) |
||||
|
routeName.value = route.name |
||||
// 字段设置 更新主列表字段 |
const tableColumns = ref(ItemApplyMain.allSchemas.tableColumns) |
||||
const updataTableColumns = (val) => { |
|
||||
tableColumns.value = val |
// 字段设置 更新主列表字段 |
||||
} |
const updataTableColumns = (val) => { |
||||
|
tableColumns.value = val |
||||
// 查询页面返回 |
} |
||||
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
||||
nextTick(async () => { |
// 查询页面返回 |
||||
if (type == 'tableForm') { |
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
||||
console.log(formField); |
nextTick(async () => { |
||||
// 明细查询页赋值 |
if (type == 'tableForm') { |
||||
if (formField == 'itemNumber') { |
console.log(formField); |
||||
row[formField] = val[0][searchField] |
// 明细查询页赋值 |
||||
row['itemNumber'] = val[0]['itemNumber'] |
if (formField == 'itemNumber') { |
||||
row['isRadeIn'] = val[0]['isInAccount'] |
let subList = tableData.value |
||||
row['currentQty'] = val[0]['qty'] |
let flag = false; |
||||
row['available'] = val[0]['available'] |
if (subList.length > 0) { |
||||
} |
subList.forEach((item) => { |
||||
if (formField == 'deviceNumber') { |
if (item.itemNumber == val[0]['itemNumber']) { |
||||
row['deviceNumber'] = val[0]['number'] |
flag = true; |
||||
} |
} |
||||
} else { |
}) |
||||
const setV = {} |
} |
||||
setV[formField] = val[0][searchField] |
if (flag) { |
||||
formRef.setValues(setV) |
message.warning("物料编号已经存在"); |
||||
} |
return; |
||||
}) |
} |
||||
} |
row[formField] = val[0][searchField] |
||||
// 查询页面返回——详情 |
row['itemNumber'] = val[0]['itemNumber'] |
||||
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
row['isRadeIn'] = val[0]['isInAccount'] |
||||
nextTick(async () => { |
row['currentQty'] = val[0]['qty'] |
||||
const setV = {} |
row['available'] = val[0]['available'] |
||||
// if(formField == 'itemCode'){ |
} |
||||
// await ItembasicApi.getItembasicPage({ |
if (formField == 'deviceNumber') { |
||||
// code: setV['itemCode'] |
row['deviceNumber'] = val[0]['number'] |
||||
// }).then(res => { |
} |
||||
// setV['uom'] = res.list[0].uom |
} else { |
||||
// setV[formField] = val[0][searchField] |
const setV = {} |
||||
// }) |
setV[formField] = val[0][searchField] |
||||
// } |
formRef.setValues(setV) |
||||
formRef.setValues(setV) |
} |
||||
}) |
}) |
||||
} |
} |
||||
|
// 查询页面返回——详情 |
||||
// 子表新增的时候选择表格之后需要会显得字段 |
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
||||
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] |
nextTick(async () => { |
||||
const Echo = [] |
const setV = {} |
||||
|
setV[formField] = val[0][searchField] |
||||
const { tableObject, tableMethods } = useTable({ |
if (formField == 'itemNumber') { |
||||
getListApi: ItemApplyMainApi.getItemApplyMainPage // 分页接口 |
setV['itemNumber'] = val[0]['itemNumber'] |
||||
}) |
setV['isRadeIn'] = val[0]['isInAccount'] |
||||
|
setV['currentQty'] = val[0]['qty'] |
||||
// 获得表格的各种操作 |
setV['available'] = val[0]['available'] |
||||
const { getList, setSearchParams } = tableMethods |
} else if (formField == 'deviceNumber') { |
||||
|
setV['deviceNumber'] = val[0]['number'] |
||||
// 列表头部按钮 |
} |
||||
const HeadButttondata = [ |
formRef.setValues(setV) |
||||
defaultButtons.defaultAddBtn(null), // 新增 |
}) |
||||
defaultButtons.defaultImportBtn(null), // 导入 |
} |
||||
defaultButtons.defaultExportBtn(null), // 导出 |
|
||||
defaultButtons.defaultFreshBtn(null), // 刷新 |
// 子表新增的时候选择表格之后需要会显得字段 |
||||
defaultButtons.defaultFilterBtn(null), // 筛选 |
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] |
||||
defaultButtons.defaultSetBtn(null), // 设置 |
const Echo = [] |
||||
// { |
|
||||
// label: '自定义扩展按钮', |
const { tableObject, tableMethods } = useTable({ |
||||
// name: 'zdy', |
getListApi: ItemApplyMainApi.getItemApplyMainPage // 分页接口 |
||||
// hide: false, |
}) |
||||
// type: 'primary', |
|
||||
// icon: 'Select', |
// 获得表格的各种操作 |
||||
// color: '' |
const { getList, setSearchParams } = tableMethods |
||||
// }, |
|
||||
] |
// 列表头部按钮 |
||||
|
const HeadButttondata = [ |
||||
// 头部按钮事件 |
defaultButtons.defaultAddBtn(null), // 新增 |
||||
const buttonBaseClick = (val, item) => { |
// defaultButtons.defaultImportBtn(null), // 导入 |
||||
if (val == 'add') { // 新增 |
// defaultButtons.defaultExportBtn(null), // 导出 |
||||
openForm('create') |
defaultButtons.defaultFreshBtn(null), // 刷新 |
||||
} else if (val == 'import') { // 导入 |
defaultButtons.defaultFilterBtn(null), // 筛选 |
||||
handleImport() |
defaultButtons.defaultSetBtn(null), // 设置 |
||||
} else if (val == 'export') { // 导出 |
// { |
||||
handleExport() |
// label: '自定义扩展按钮', |
||||
} else if (val == 'refresh') { // 刷新 |
// name: 'zdy', |
||||
getList() |
// hide: false, |
||||
} else if (val == 'filtrate') { // 筛选 |
// type: 'primary', |
||||
} else { // 其他按钮 |
// icon: 'Select', |
||||
console.log('其他按钮', item) |
// color: '' |
||||
} |
// }, |
||||
} |
] |
||||
|
|
||||
// 根据状态返回该按钮是否显示 |
// 头部按钮事件 |
||||
const isShowMainButton = (row, val) => { |
const buttonBaseClick = (val, item) => { |
||||
if (val.indexOf(row.status) > -1) { |
if (val == 'add') { // 新增 |
||||
return false |
openForm('create') |
||||
} else { |
} else if (val == 'import') { // 导入 |
||||
return true |
handleImport() |
||||
} |
} else if (val == 'export') { // 导出 |
||||
} |
handleExport() |
||||
|
} else if (val == 'refresh') { // 刷新 |
||||
// 列表-操作按钮 |
getList() |
||||
const butttondata = (row) => { |
} else if (val == 'filtrate') { // 筛选 |
||||
return [ |
} else { // 其他按钮 |
||||
defaultButtons.backoutBtn({ hide: isShowMainButton(row, ['0']) }), // 撤回 |
console.log('其他按钮', item) |
||||
// defaultButtons.mainListEditBtn(null), // 编辑 |
} |
||||
// defaultButtons.mainListDeleteBtn(null), // 删除 |
} |
||||
] |
|
||||
} |
// 根据状态返回该按钮是否显示 |
||||
|
const isShowMainButton = (row, val) => { |
||||
// 列表-操作按钮事件 |
if (val.indexOf(row.status) > -1) { |
||||
const buttonTableClick = async (val, row) => { |
return false |
||||
if (val == 'edit') { // 编辑 |
} else { |
||||
openForm('update', row) |
return true |
||||
} |
} |
||||
else if (val == 'backout') { // 提交审批 |
} |
||||
backout(row.id) |
|
||||
} |
// 列表-操作按钮 |
||||
else if (val == 'delete') { // 删除 |
const butttondata = (row) => { |
||||
handleDelete(row.id) |
return [ |
||||
} |
defaultButtons.backoutBtn({ hide: isShowMainButton(row, ['0']) }), // 撤回 |
||||
} |
// defaultButtons.mainListEditBtn(null), // 编辑 |
||||
|
// defaultButtons.mainListDeleteBtn(null), // 删除 |
||||
/** 撤销按钮操作 */ |
] |
||||
const backout = async (id : number) => { |
} |
||||
try { |
|
||||
// 撤销的二次确认 |
// 列表-操作按钮事件 |
||||
await message.confirm('是否撤销所选中数据?') |
const buttonTableClick = async (val, row) => { |
||||
// 发起撤销 |
if (val == 'edit') { // 编辑 |
||||
await ItemApplyMainApi.backoutItemApplyMain(id) |
openForm('update', row) |
||||
message.success(t('撤销成功!')) |
} |
||||
// 刷新列表 |
else if (val == 'backout') { // 提交审批 |
||||
await getList() |
backout(row.id) |
||||
} catch { } |
} |
||||
} |
else if (val == 'delete') { // 删除 |
||||
|
handleDelete(row.id) |
||||
/** 添加/修改操作 */ |
} |
||||
const formRef = ref() |
} |
||||
const openForm = async (type : string, row ?: number) => { |
|
||||
tableData.value = [] // 重置明细数据 |
/** 撤销按钮操作 */ |
||||
formRef.value.open(type, row) |
const backout = async (id : number) => { |
||||
} |
try { |
||||
|
// 撤销的二次确认 |
||||
/** 详情操作 */ |
await message.confirm('是否撤销所选中数据?') |
||||
const detailRef = ref() |
// 发起撤销 |
||||
|
await ItemApplyMainApi.backoutItemApplyMain(id) |
||||
|
message.success(t('撤销成功!')) |
||||
|
// 刷新列表 |
||||
|
await getList() |
||||
|
} catch { } |
||||
|
} |
||||
|
|
||||
|
/** 添加/修改操作 */ |
||||
|
const formRef = ref() |
||||
|
const openForm = async (type : string, row ?: number) => { |
||||
|
tableData.value = [] // 重置明细数据 |
||||
|
formRef.value.open(type, row) |
||||
|
} |
||||
|
|
||||
|
/** 详情操作 */ |
||||
|
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, 'basicItemApplyMain') |
if(row.status!='0'){ |
||||
} |
isShowAddBtn.value=false |
||||
|
detailButtonIsShow.value=true |
||||
/** 删除按钮操作 */ |
}else{ |
||||
const handleDelete = async (id : number) => { |
isShowAddBtn.value=true |
||||
try { |
detailButtonIsShow.value=false |
||||
// 删除的二次确认 |
} |
||||
await message.delConfirm() |
detailRef.value.openDetail(row, titleName, titleValue, 'basicItemApplyMain') |
||||
// 发起删除 |
} |
||||
await ItemApplyMainApi.deleteItemApplyMain(id) |
|
||||
message.success(t('common.delSuccess')) |
/** 删除按钮操作 */ |
||||
// 刷新列表 |
const handleDelete = async (id : number) => { |
||||
await getList() |
try { |
||||
} catch { } |
// 删除的二次确认 |
||||
} |
await message.delConfirm() |
||||
|
// 发起删除 |
||||
/** 导出按钮操作 */ |
await ItemApplyMainApi.deleteItemApplyMain(id) |
||||
const exportLoading = ref(false) // 导出的加载中 |
message.success(t('common.delSuccess')) |
||||
const handleExport = async () => { |
// 刷新列表 |
||||
try { |
await getList() |
||||
// 导出的二次确认 |
} catch { } |
||||
await message.exportConfirm() |
} |
||||
// 发起导出 |
|
||||
exportLoading.value = true |
/** 导出按钮操作 */ |
||||
const data = await ItemApplyMainApi.exportItemApplyMain(tableObject.params) |
const exportLoading = ref(false) // 导出的加载中 |
||||
download.excel(data, '备件申领记录主.xlsx') |
const handleExport = async () => { |
||||
} catch { |
try { |
||||
} finally { |
// 导出的二次确认 |
||||
exportLoading.value = false |
await message.exportConfirm() |
||||
} |
// 发起导出 |
||||
} |
exportLoading.value = true |
||||
|
const data = await ItemApplyMainApi.exportItemApplyMain(tableObject.params) |
||||
/** |
download.excel(data, '备件申领记录主.xlsx') |
||||
* tableForm方法 |
} catch { |
||||
*/ |
} finally { |
||||
const tableFormKeys = {} |
exportLoading.value = false |
||||
ItemApplyDetail.allSchemas.tableFormColumns.forEach(item => { |
} |
||||
tableFormKeys[item.field] = item.default ? item.default : '' |
} |
||||
}) |
|
||||
const tableData = ref([]) |
/** |
||||
|
* tableForm方法 |
||||
// 添加明细 |
*/ |
||||
const handleAddTable = () => { |
const tableFormKeys = {} |
||||
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
ItemApplyDetail.allSchemas.tableFormColumns.forEach(item => { |
||||
} |
tableFormKeys[item.field] = item.default ? item.default : '' |
||||
// 删除明细 |
}) |
||||
const handleDeleteTable = (item, index) => { |
const tableData = ref([]) |
||||
tableData.value.splice(index, 1) |
|
||||
} |
// 添加明细 |
||||
|
const handleAddTable = () => { |
||||
// 主子数据 提交 |
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
||||
const submitForm = async (formType, data) => { |
} |
||||
data.subList = tableData.value // 拼接子表数据参数 |
// 删除明细 |
||||
try { |
const handleDeleteTable = (item, index) => { |
||||
for (let item of tableData.value) { |
tableData.value.splice(index, 1) |
||||
if (item.qty > item.currentQty) { |
} |
||||
message.error('要货计划数量不得大于订单数量-已计划数量') |
|
||||
return false; |
// 主子数据 提交 |
||||
} |
const submitForm = async (formType, data) => { |
||||
} |
data.subList = tableData.value // 拼接子表数据参数 |
||||
if (formType === 'create') { |
try { |
||||
await ItemApplyMainApi.createItemApplyMain(data) |
for (let item of tableData.value) { |
||||
message.success(t('common.createSuccess')) |
if (item.qty > item.currentQty) { |
||||
} else { |
message.error('要货计划数量不得大于订单数量-已计划数量') |
||||
await ItemApplyMainApi.updateItemApplyMain(data) |
return false; |
||||
message.success(t('common.updateSuccess')) |
} |
||||
} |
} |
||||
formRef.value.dialogVisible = false |
if (formType === 'create') { |
||||
// 刷新当前列表 |
await ItemApplyMainApi.createItemApplyMain(data) |
||||
getList() |
message.success(t('common.createSuccess')) |
||||
} finally { |
} else { |
||||
formRef.value.formLoading = false |
await ItemApplyMainApi.updateItemApplyMain(data) |
||||
} |
message.success(t('common.updateSuccess')) |
||||
} |
} |
||||
|
formRef.value.dialogVisible = false |
||||
/** 导入 */ |
// 刷新当前列表 |
||||
const importFormRef = ref() |
getList() |
||||
const handleImport = () => { |
} finally { |
||||
importFormRef.value.open() |
formRef.value.formLoading = false |
||||
} |
} |
||||
|
} |
||||
// 导入附件弹窗所需的参数 |
|
||||
const importTemplateData = reactive({ |
/** 导入 */ |
||||
templateUrl: '', |
const importFormRef = ref() |
||||
templateTitle: '采购订单主导入模版.xlsx' |
const handleImport = () => { |
||||
}) |
importFormRef.value.open() |
||||
|
} |
||||
// 导入成功之后 |
|
||||
const importSuccess = () => { |
// 导入附件弹窗所需的参数 |
||||
getList() |
const importTemplateData = reactive({ |
||||
} |
templateUrl: '', |
||||
|
templateTitle: '采购订单主导入模版.xlsx' |
||||
// 筛选提交 |
}) |
||||
const searchFormClick = (searchData) => { |
|
||||
tableObject.params = { |
// 导入成功之后 |
||||
isSearch: true, |
const importSuccess = () => { |
||||
filters: searchData.filters |
getList() |
||||
} |
} |
||||
getList() // 刷新当前列表 |
|
||||
} |
// 筛选提交 |
||||
|
const searchFormClick = (searchData) => { |
||||
/** 初始化 **/ |
tableObject.params = { |
||||
onMounted(async () => { |
isSearch: true, |
||||
getList() |
filters: searchData.filters |
||||
importTemplateData.templateUrl = await ItemApplyMainApi.importTemplate() |
} |
||||
}) |
getList() // 刷新当前列表 |
||||
|
} |
||||
|
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { |
||||
|
try {
if (formType === 'create') { |
||||
|
await ItemApplyDetailApi.createItemApplyDetail(data) |
||||
|
message.success(t('common.createSuccess')) |
||||
|
formRef.dialogVisible = false |
||||
|
formRef.getList |
||||
|
} else { |
||||
|
await ItemApplyDetailApi.updateItemApplyDetail(data) |
||||
|
message.success(t('common.updateSuccess')) |
||||
|
formRef.dialogVisible = false |
||||
|
formRef.getList |
||||
|
}
}catch { |
||||
|
} finally { |
||||
|
formRef.formLoading = false |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** 初始化 **/ |
||||
|
onMounted(async () => { |
||||
|
getList() |
||||
|
importTemplateData.templateUrl = await ItemApplyMainApi.importTemplate() |
||||
|
}) |
||||
</script> |
</script> |
||||
|
Loading…
Reference in new issue