|
|
@ -5,28 +5,15 @@ |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
@button-base-click="buttonBaseClick" |
|
|
|
:routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="PurchaseMain.allSchemas" |
|
|
|
/> |
|
|
|
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="PurchaseMain.allSchemas" /> |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<Table |
|
|
|
:columns="tableColumns" |
|
|
|
:data="tableObject.tableList" |
|
|
|
:loading="tableObject.loading" |
|
|
|
:pagination="{ |
|
|
|
<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" |
|
|
|
> |
|
|
|
}" 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> |
|
|
@ -39,40 +26,22 @@ |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm |
|
|
|
ref="formRef" |
|
|
|
@success="getList" |
|
|
|
:rules="PurchaseMainRules" |
|
|
|
:formAllSchemas="PurchaseMain.allSchemas" |
|
|
|
:tableAllSchemas="PurchaseDetail.allSchemas" |
|
|
|
:tableFormRules="PurchaseDetailRules" |
|
|
|
:tableData="tableData" |
|
|
|
:apiUpdate="PurchaseMainApi.updatePurchaseMain" |
|
|
|
:apiCreate="PurchaseMainApi.createPurchaseMain" |
|
|
|
:isBusiness="true" |
|
|
|
@handleAddTable="handleAddTable" |
|
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@submitForm="submitForm" |
|
|
|
/> |
|
|
|
<BasicForm ref="formRef" @success="getList" :rules="PurchaseMainRules" :formAllSchemas="PurchaseMain.allSchemas" |
|
|
|
:tableAllSchemas="PurchaseDetail.allSchemas" :tableFormRules="PurchaseDetailRules" :tableData="tableData" |
|
|
|
:apiUpdate="PurchaseMainApi.updatePurchaseMain" :apiCreate="PurchaseMainApi.createPurchaseMain" :isBusiness="true" |
|
|
|
@handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" |
|
|
|
@submitForm="submitForm" /> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
|
<Detail |
|
|
|
ref="detailRef" |
|
|
|
:isBasic="false" |
|
|
|
:allSchemas="PurchaseMain.allSchemas" |
|
|
|
:detailAllSchemas="PurchaseDetail.allSchemas" |
|
|
|
:detailAllSchemasRules="PurchaseDetailRules" |
|
|
|
:apiCreate="PurchaseDetailApi.createPurchaseDetail" |
|
|
|
:apiUpdate="PurchaseDetailApi.updatePurchaseDetail" |
|
|
|
:apiPage="PurchaseDetailApi.getPurchaseDetailPage" |
|
|
|
:apiDelete="PurchaseDetailApi.deletePurchaseDetail" |
|
|
|
:Echo="Echo" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
/> |
|
|
|
<Detail ref="detailRef" :isBasic="false" :allSchemas="PurchaseMain.allSchemas" |
|
|
|
:detailAllSchemas="PurchaseDetail.allSchemas" :detailAllSchemasRules="PurchaseDetailRules" |
|
|
|
:apiCreate="PurchaseDetailApi.createPurchaseDetail" :apiUpdate="PurchaseDetailApi.updatePurchaseDetail" |
|
|
|
:apiPage="PurchaseDetailApi.getPurchaseDetailPage" :apiDelete="PurchaseDetailApi.deletePurchaseDetail" :Echo="Echo" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" /> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData" @success="importSuccess" :isShowOut="true" /> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" :isShowOut="true" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
@ -87,7 +56,6 @@ defineOptions({ name: 'PurchaseMain' }) |
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
@ -178,32 +146,28 @@ const isShowMainButton = (row,val) => { |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListOrderCloBtn({ hide: isShowMainButton(row, ['1']) }), // 关闭 |
|
|
|
defaultButtons.mainListOrderPubBtn({hide:isShowMainButton(row,['1'])}), // 发布 |
|
|
|
defaultButtons.mainListOrderOpeBtn({ hide: isShowMainButton(row, ['3']) }), // 打开 |
|
|
|
defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row, ['1']) }), // 发布 |
|
|
|
defaultButtons.mainListOrderWitBtn({ hide: isShowMainButton(row, ['2']) }), // 下架 |
|
|
|
defaultButtons.mainListEditBtn({ hasPermi: 'wms:purchase-main:update', hide: isShowMainButton(row, ['1']) }), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:purchase-main:delete',hide:isShowMainButton(row,['1'])}), // 删除 |
|
|
|
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:purchase-main:delete', hide: isShowMainButton(row, ['1']) }), // 删除 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainClose') { // 关闭 |
|
|
|
console.log('列表-操作按钮事件-关闭') |
|
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
|
console.log('列表-操作按钮事件-重新添加') |
|
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
|
console.log('列表-操作按钮事件-提交审批') |
|
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
|
console.log('列表-操作按钮事件-驳回') |
|
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
|
console.log('列表-操作按钮事件-审批通过') |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} else if (val == 'mainOrderClo') { // 关闭 |
|
|
|
handleClose(row.id) |
|
|
|
} else if (val == 'mainOrderOpe') { // 打开 |
|
|
|
handleOpen(row.id) |
|
|
|
} else if (val == 'mainOrderPub') { // 发布 |
|
|
|
handlePublish(row.id) |
|
|
|
} else if (val == 'mainOrderWit') { // 下架 |
|
|
|
handleWit(row.id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -233,6 +197,58 @@ const handleDelete = async (id: number) => { |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 关闭按钮操作 */ |
|
|
|
const handleClose = async (id : number) => { |
|
|
|
try { |
|
|
|
// 关闭的二次确认 |
|
|
|
await message.confirm('是否关闭所选中数据?') |
|
|
|
// 发起关闭 |
|
|
|
await PurchaseMainApi.closePurchaseMain(id) |
|
|
|
message.success(t('关闭成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 打开按钮操作 */ |
|
|
|
const handleOpen = async (id : number) => { |
|
|
|
try { |
|
|
|
// 打开的二次确认 |
|
|
|
await message.confirm('是否打开所选中数据?') |
|
|
|
// 发起打开 |
|
|
|
await PurchaseMainApi.openPurchaseMain(id) |
|
|
|
message.success(t('打开成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 发布按钮操作 */ |
|
|
|
const handlePublish = async (id : number) => { |
|
|
|
try { |
|
|
|
// 发布的二次确认 |
|
|
|
await message.confirm('是否发布所选中数据?') |
|
|
|
// 发起发布 |
|
|
|
await PurchaseMainApi.publishPurchaseMain(id) |
|
|
|
message.success(t('发布成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 下架按钮操作 */ |
|
|
|
const handleWit = async (id : number) => { |
|
|
|
try { |
|
|
|
// 下架的二次确认 |
|
|
|
await message.confirm('是否下架所选中数据?') |
|
|
|
// 发起下架 |
|
|
|
await PurchaseMainApi.witPurchaseMain(id) |
|
|
|
message.success(t('下架成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
|
const handleExport = async () => { |
|
|
@ -295,7 +311,7 @@ const handleImport = () => { |
|
|
|
// 导入附件弹窗所需的参数 |
|
|
|
const importTemplateData = reactive({ |
|
|
|
templateUrl: '', |
|
|
|
templateTitle: '采购订单主导入模版.xls' |
|
|
|
templateTitle: '采购订单主导入模版.xlsx' |
|
|
|
}) |
|
|
|
|
|
|
|
// 导入成功之后 |
|
|
|