|
|
@ -72,6 +72,7 @@ |
|
|
|
</Detail> |
|
|
|
<!-- 导入 --> |
|
|
|
<ImportCustomerStatementForm ref="importFormRef" url="/wms/customer-statement-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
|
<ImportCustomerStatementShareForm ref="importShareFormRef" url="/wms/customer-tool-apport-statement-detail/import" :importTemplateData="importShareTemplateData" @success="importSuccess" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
@ -83,6 +84,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import ImportCustomerStatementForm from '@/components/ImportForm/src/ImportCustomerStatementForm.vue' |
|
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
import ImportCustomerStatementShareForm from '@/components/ImportForm/src/ImportCustomerStatementShareForm.vue' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
|
|
|
|
defineOptions({ name: 'CustomerStatementMain' }) |
|
|
|
|
|
|
@ -125,10 +128,8 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
//defaultButtons.defaultAddBtn({hasPermi:'wms:customerStatementMain:create'}), // 新增 |
|
|
|
//defaultButtons.defaultImportBtn({hasPermi:'wms:customerStatementMain:import'}), // 导入 |
|
|
|
//defaultButtons.defaultExportBtn({hasPermi:'wms:customerStatementMain:export'}), // 导出 |
|
|
|
defaultButtons.defaultImportBtn(null), // 导入 |
|
|
|
defaultButtons.defaultExportBtn(null), // 导出 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:customer-statement-main:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:customer-statement-main:export'}), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
@ -168,7 +169,7 @@ const butttondata = (row, $index) => { |
|
|
|
// defaultButtons.mainListEditBtn({hasPermi:'wms:customerStatementMain:update'}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerStatementMain:delete'}), // 删除 |
|
|
|
{ |
|
|
|
label: t('重新比对'), |
|
|
|
label: t('ts.重新比对'), |
|
|
|
name: 'rematch', |
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
type: 'primary', |
|
|
@ -178,7 +179,7 @@ const butttondata = (row, $index) => { |
|
|
|
link: true // 文本展现按钮 |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: t('确认对比结果'), |
|
|
|
label: t('ts.确认对比结果'), |
|
|
|
name: 'confirmationContrast', |
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
type: 'primary', |
|
|
@ -187,18 +188,36 @@ const butttondata = (row, $index) => { |
|
|
|
hasPermi: '', |
|
|
|
link: true // 文本展现按钮 |
|
|
|
}, |
|
|
|
defaultButtons.mainSendBackBtn({ hide: isShowMainButton(row, ['3','4','5']) }), // 退回 |
|
|
|
//defaultButtons.mainListCancelBtn({ hide: isShowMainButton(row, ['2','3','4','5']), hasPermi: 'wms:purchase-plan-main:update' }), // 作废 |
|
|
|
defaultButtons.mainListCancelBtn({ hide: isShowMainButton(row, ['2','3','4','5'])}), // 作废 |
|
|
|
{ |
|
|
|
label: t('导入'), |
|
|
|
name: 'import', |
|
|
|
label: t('ts.导入模具分摊对账单'), |
|
|
|
name: 'importShareReconciliation', |
|
|
|
hide: isShowMainButton(row, ['3','4']), |
|
|
|
type: 'warning', |
|
|
|
type: 'primary', |
|
|
|
color: '', |
|
|
|
hasPermi: '', |
|
|
|
link: true // 文本展现按钮 |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: t('ts.确认分摊金额'), |
|
|
|
name: 'confirmShareMoney', |
|
|
|
hide: isShowMainButton(row, ['4']), |
|
|
|
type: 'primary', |
|
|
|
color: '', |
|
|
|
hasPermi: '', |
|
|
|
link: true // 文本展现按钮 |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: t('ts.创建开票申请'), |
|
|
|
name: 'createTicketApply', |
|
|
|
hide: isShowMainButton(row, ['5']), |
|
|
|
type: 'primary', |
|
|
|
color: '', |
|
|
|
hasPermi: '', |
|
|
|
link: true // 文本展现按钮 |
|
|
|
}, |
|
|
|
defaultButtons.mainSendBackBtn({ hide: isShowMainButton(row, ['3','4','5']) }), // 退回 |
|
|
|
defaultButtons.mainListCancelBtn({ hide: isShowMainButton(row, ['2','3','4','5'])}), // 作废 |
|
|
|
|
|
|
|
|
|
|
|
] |
|
|
|
} |
|
|
@ -209,12 +228,16 @@ const buttonTableClick = async (val, row) => { |
|
|
|
tapRematch(row.id); |
|
|
|
} else if (val == 'confirmationContrast') { // 确认对比结果 |
|
|
|
tapConfirmationContrast(row.id) |
|
|
|
} else if (val == 'importShareReconciliation') { // 导入模具分摊对账单、 |
|
|
|
handleShareImport(row.id) |
|
|
|
} else if (val == 'confirmShareMoney') { // 确认分摊金额 |
|
|
|
handleConfirmShareMoney(row.id) |
|
|
|
} else if (val == 'createTicketApply') { // 创建开票申请 |
|
|
|
// handleConfirmShareMoney(row.id) |
|
|
|
}else if (val == 'sendBack') { // 退回 |
|
|
|
tapSendBack(row.id) |
|
|
|
}else if (val == 'cancel') { // 作废 |
|
|
|
tapCancel(row.id) |
|
|
|
}else if (val == 'import') { // 导入 |
|
|
|
handleDelete(row.id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -277,8 +300,9 @@ const handleExport = async () => { |
|
|
|
await message.exportConfirm() |
|
|
|
// 发起导出 |
|
|
|
exportLoading.value = true |
|
|
|
const excelTitle = ref(route.meta.title) |
|
|
|
const data = await CustomerStatementMainApi.exportCustomerStatementMain(tableObject.params) |
|
|
|
download.excel(data, '客户对账单主信息表(WMS).xlsx') |
|
|
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
exportLoading.value = false |
|
|
@ -287,13 +311,25 @@ const handleExport = async () => { |
|
|
|
|
|
|
|
/** 导入 */ |
|
|
|
const importFormRef = ref() |
|
|
|
//导入客户模具分摊对账单 |
|
|
|
const importShareFormRef = ref() |
|
|
|
const handleImport = () => { |
|
|
|
importFormRef.value.open() |
|
|
|
} |
|
|
|
const handleShareImport = (id:number) => { |
|
|
|
importShareTemplateData.customerId = id |
|
|
|
importShareFormRef.value.open() |
|
|
|
} |
|
|
|
// 导入附件弹窗所需的参数 |
|
|
|
const importTemplateData = reactive({ |
|
|
|
templateUrl: '', |
|
|
|
templateTitle: '客户对账单导入模版.xlsx' |
|
|
|
templateTitle: `【${route.meta.title}】导入模版.xlsx` |
|
|
|
}) |
|
|
|
//导入客户模具对账单参数 |
|
|
|
const importShareTemplateData = reactive({ |
|
|
|
templateUrl: '', |
|
|
|
templateTitle: '模具分摊对账单导入模版.xlsx', |
|
|
|
customerId: 0 |
|
|
|
}) |
|
|
|
// 导入成功之后 |
|
|
|
const importSuccess = () => { |
|
|
@ -318,7 +354,7 @@ onMounted(async () => { |
|
|
|
const tapRematch = async (id:number) => { |
|
|
|
try { |
|
|
|
// 确认 |
|
|
|
await message.confirm('是否重新比对') |
|
|
|
await message.confirm( t('ts.是否重新比对')) |
|
|
|
await CustomerStatementMainApi.recontrast(id); |
|
|
|
// 发起导出 |
|
|
|
//exportLoading.value = true |
|
|
@ -333,7 +369,7 @@ const tapRematch = async (id:number) => { |
|
|
|
//点击确认对比方法 |
|
|
|
const tapConfirmationContrast = async (id:number) => { |
|
|
|
try { |
|
|
|
await message.confirm('是否确认对比结果') |
|
|
|
await message.confirm( t('ts.是否确认对比结果')) |
|
|
|
await CustomerStatementMainApi.confirmationContrast(id); |
|
|
|
// 发起导出 |
|
|
|
//exportLoading.value = true |
|
|
@ -348,7 +384,7 @@ const tapConfirmationContrast = async (id:number) => { |
|
|
|
//点击退回方法 |
|
|
|
const tapSendBack = async (id:number) => { |
|
|
|
try { |
|
|
|
await message.confirm('是否退回') |
|
|
|
await message.confirm(t('ts.是否退回')) |
|
|
|
await CustomerStatementMainApi.sendBack(id); |
|
|
|
// 发起导出 |
|
|
|
//exportLoading.value = true |
|
|
@ -363,7 +399,7 @@ const tapSendBack = async (id:number) => { |
|
|
|
//点击作废方法 |
|
|
|
const tapCancel = async (id:number) => { |
|
|
|
try { |
|
|
|
await message.confirm('是否作废') |
|
|
|
await message.confirm(t('ts.是否作废')) |
|
|
|
await CustomerStatementMainApi.nodeAbrogate(id); |
|
|
|
// 发起导出 |
|
|
|
//exportLoading.value = true |
|
|
@ -374,7 +410,16 @@ const tapCancel = async (id:number) => { |
|
|
|
await getList() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 确认分摊金额 |
|
|
|
const handleConfirmShareMoney = async (id:number) => { |
|
|
|
try { |
|
|
|
await message.confirm(t('ts.是否确认分摊金额')) |
|
|
|
await CustomerStatementMainApi.confirmationShare(id); |
|
|
|
} finally { |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} |
|
|
|
} |
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isShowMainButton = (row, val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
@ -426,7 +471,7 @@ const changeTabs = async (item) => { |
|
|
|
hasPermi: '' |
|
|
|
}, |
|
|
|
{ |
|
|
|
label:'重新对比', |
|
|
|
label: t('ts.重新对比'), |
|
|
|
name: 'againContrast', |
|
|
|
hide: false, |
|
|
|
type: 'primary', |
|
|
|