|
|
@ -5,16 +5,28 @@ |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" |
|
|
|
:allSchemas="PurchasePlanMain.allSchemas" /> |
|
|
|
<TableHead |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
@button-base-click="buttonBaseClick" |
|
|
|
:routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="PurchasePlanMain.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> |
|
|
@ -27,25 +39,40 @@ |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm ref="formRef" @success="getList" :rules="PurchasePlanMainRules" |
|
|
|
:formAllSchemas="PurchasePlanMain.allSchemas" :tableAllSchemas="PurchasePlanDetail.allSchemas" |
|
|
|
:tableFormRules="PurchasePlanDetailRules" :tableData="tableData" |
|
|
|
:apiUpdate="PurchasePlanMainApi.updatePurchasePlanMain" :apiCreate="PurchasePlanMainApi.createPurchasePlanMain" |
|
|
|
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" |
|
|
|
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" /> |
|
|
|
<BasicForm |
|
|
|
ref="formRef" |
|
|
|
@success="getList" |
|
|
|
:rules="PurchasePlanMainRules" |
|
|
|
:formAllSchemas="PurchasePlanMain.allSchemas" |
|
|
|
:tableAllSchemas="PurchasePlanDetail.allSchemas" |
|
|
|
:tableFormRules="PurchasePlanDetailRules" |
|
|
|
:tableData="tableData" |
|
|
|
:apiUpdate="PurchasePlanMainApi.updatePurchasePlanMain" |
|
|
|
:apiCreate="PurchasePlanMainApi.createPurchasePlanMain" |
|
|
|
:isBusiness="true" |
|
|
|
@handleAddTable="handleAddTable" |
|
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@submitForm="submitForm" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
|
<Detail ref="detailRef" :isBasic="false" :allSchemas="PurchasePlanMain.allSchemas" |
|
|
|
:detailAllSchemas="PurchasePlanDetail.allSchemas" :detailAllSchemasRules="PurchasePlanDetailRules" |
|
|
|
<Detail |
|
|
|
ref="detailRef" |
|
|
|
:isBasic="false" |
|
|
|
:allSchemas="PurchasePlanMain.allSchemas" |
|
|
|
:detailAllSchemas="PurchasePlanDetail.allSchemas" |
|
|
|
:detailAllSchemasRules="PurchasePlanDetailRules" |
|
|
|
:apiCreate="PurchasePlanDetailApi.createPurchasePlanDetail" |
|
|
|
:apiUpdate="PurchasePlanDetailApi.updatePurchasePlanDetail" |
|
|
|
:apiPage="PurchasePlanDetailApi.getPurchasePlanDetailPage" |
|
|
|
:apiDelete="PurchasePlanDetailApi.deletePurchasePlanDetail" :Echo="Echo" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" /> |
|
|
|
:apiDelete="PurchasePlanDetailApi.deletePurchasePlanDetail" |
|
|
|
:Echo="Echo" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/purchase-plan-main/import" :importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" /> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/purchase-plan-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
@ -156,35 +183,40 @@ |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListPurchasePlanWitBtn({ hide: isShowMainButton(row, ['3']) }), // 下架 |
|
|
|
defaultButtons.mainListPurchasePlanRejBtn({ hide: isShowMainButton(row, ['3']) }), // 不接受 |
|
|
|
defaultButtons.mainListPurchasePlanAccBtn({ hide: isShowMainButton(row, ['3']) }), // 接受 |
|
|
|
defaultButtons.mainListPurchasePlanPubBtn({ hide: isShowMainButton(row, ['1']) }), // 发布 |
|
|
|
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1']) }), // 关闭 |
|
|
|
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['2']) }), // 打开 |
|
|
|
defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:purchase-plan-main:update' }), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:purchase-plan-main:delete' }), // 删除 |
|
|
|
defaultButtons.mainListPurchasePlanModBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_REJECTED'])}), // 修改 |
|
|
|
defaultButtons.mainListPurchasePlanWitBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), // 下架 |
|
|
|
defaultButtons.mainListPurchasePlanRejBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), // 不接受 |
|
|
|
defaultButtons.mainListPurchasePlanAccBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), // 接受 |
|
|
|
defaultButtons.mainListPurchasePlanPubBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY'])}), // 发布 |
|
|
|
defaultButtons.mainListPurchasePlanCloBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY'])}), // 关闭 |
|
|
|
defaultButtons.mainListPurchasePlanOpeBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_CLOSED'])}), // 打开 |
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY']),hasPermi:'wms:purchase-plan-main:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY']),hasPermi:'wms:purchase-plan-main:delete'}), // 删除 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
if (val == 'mainPurPlanOpe') { // 打开 |
|
|
|
console.log('列表-操作按钮事件-打开') |
|
|
|
} else if (val == 'mainPurPlanClo') { // 关闭 |
|
|
|
handleClose(row.id) |
|
|
|
} else if (val == 'mainPurPlanOpe') { // 打开 |
|
|
|
handleOpen(row.id) |
|
|
|
console.log('列表-操作按钮事件-关闭') |
|
|
|
} else if (val == 'mainPurPlanPub') { // 发布 |
|
|
|
handlePublish(row.id) |
|
|
|
} else if (val == 'mainPurPlanWit') { // 下架 |
|
|
|
handleWit(row.id) |
|
|
|
console.log('列表-操作按钮事件-发布') |
|
|
|
} else if (val == 'mainPurPlanAcc') { // 接受 |
|
|
|
handleAcc(row.id) |
|
|
|
} else if (val == 'mainPurPlanRej') { // 驳回 |
|
|
|
handleWit(row.id) |
|
|
|
console.log('列表-操作按钮事件-接受') |
|
|
|
} else if (val == 'mainPurPlanRej') { // 不接受 |
|
|
|
console.log('列表-操作按钮事件-不接受') |
|
|
|
} else if (val == 'mainPurPlanWit') { // 下架 |
|
|
|
console.log('列表-操作按钮事件-下架') |
|
|
|
} else if (val == 'mainPurPlanMod') { // 修改 |
|
|
|
console.log('列表-操作按钮事件-修改') |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -214,85 +246,6 @@ |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
/** 关闭按钮操作 */ |
|
|
|
const handleClose = async (id : number) => { |
|
|
|
try { |
|
|
|
// 关闭的二次确认 |
|
|
|
await message.confirm('是否关闭所选中数据?') |
|
|
|
// 发起关闭 |
|
|
|
await PurchasePlanMainApi.closePurchasePlanMain(id) |
|
|
|
message.success(t('关闭成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 打开按钮操作 */ |
|
|
|
const handleOpen = async (id : number) => { |
|
|
|
try { |
|
|
|
// 打开的二次确认 |
|
|
|
await message.confirm('是否打开所选中数据?') |
|
|
|
// 发起打开 |
|
|
|
await PurchasePlanMainApi.openPurchasePlanMain(id) |
|
|
|
message.success(t('打开成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 发布按钮操作 */ |
|
|
|
const handlePublish = async (id : number) => { |
|
|
|
try { |
|
|
|
// 发布的二次确认 |
|
|
|
await message.confirm('是否发布所选中数据?') |
|
|
|
// 发起发布 |
|
|
|
await PurchasePlanMainApi.publishPurchasePlanMain(id) |
|
|
|
message.success(t('发布成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 下架按钮操作 */ |
|
|
|
const handleWit = async (id : number) => { |
|
|
|
try { |
|
|
|
// 下架的二次确认 |
|
|
|
await message.confirm('是否下架所选中数据?') |
|
|
|
// 发起下架 |
|
|
|
await PurchasePlanMainApi.witPurchasePlanMain(id) |
|
|
|
message.success(t('下架成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 接受按钮操作 */ |
|
|
|
const handleAcc = async (id : number) => { |
|
|
|
try { |
|
|
|
// 接受的二次确认 |
|
|
|
await message.confirm('是否接受所选中数据?') |
|
|
|
// 发起接受 |
|
|
|
await PurchasePlanMainApi.accPurchasePlanMain(id) |
|
|
|
message.success(t('接受成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 驳回按钮操作 */ |
|
|
|
const handleRej = async (id : number) => { |
|
|
|
try { |
|
|
|
// 驳回的二次确认 |
|
|
|
await message.confirm('是否驳回所选中数据?') |
|
|
|
// 发起驳回 |
|
|
|
await PurchasePlanMainApi.rejPurchasePlanMain(id) |
|
|
|
message.success(t('驳回成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
|
const handleExport = async () => { |
|
|
@ -355,7 +308,7 @@ |
|
|
|
// 导入附件弹窗所需的参数 |
|
|
|
const importTemplateData = reactive({ |
|
|
|
templateUrl: '', |
|
|
|
templateTitle: '要货计划主导入模版.xlsx' |
|
|
|
templateTitle: '要货计划主导入模版.xls' |
|
|
|
}) |
|
|
|
|
|
|
|
// 导入成功之后 |
|
|
|