|
|
@ -1,67 +1,51 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="CustomerStatementMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<Search :schema="CustomerStatementMain.allSchemas.searchSchema" @search="setSearchParams" |
|
|
|
@reset="setSearchParams" /> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
@button-base-click="buttonBaseClick" |
|
|
|
:routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="CustomerStatementMain.allSchemas" |
|
|
|
/> |
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" |
|
|
|
:allSchemas="CustomerStatementMain.allSchemas" /> |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<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" |
|
|
|
> |
|
|
|
<template #code="{row}"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|
|
|
<span>{{ row.code }}</span> |
|
|
|
<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"> |
|
|
|
<template #number="{ row }"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|
|
|
<span>{{ row.number }}</span> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
<template #action="{ row,$index }"> |
|
|
|
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm |
|
|
|
ref="basicFormRef" |
|
|
|
@success="formsSuccess" |
|
|
|
:rules="CustomerStatementMainRules" |
|
|
|
:formAllSchemas="CustomerStatementMain.allSchemas" |
|
|
|
:apiUpdate="CustomerStatementMainApi.updateCustomerStatementMain" |
|
|
|
:apiCreate="CustomerStatementMainApi.createCustomerStatementMain" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
:isBusiness="false" |
|
|
|
/> |
|
|
|
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="CustomerStatementMainRules" |
|
|
|
:formAllSchemas="CustomerStatementMain.allSchemas" :apiUpdate="CustomerStatementMainApi.updateCustomerStatementMain" |
|
|
|
:apiCreate="CustomerStatementMainApi.createCustomerStatementMain" @searchTableSuccess="searchTableSuccess" |
|
|
|
:isBusiness="false" /> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerStatementMain.allSchemas" /> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<!-- <ImportForm ref="importFormRef" url="/wms/customer-statement-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> --> |
|
|
|
<ImportCustomerStatementForm ref="importFormRef" url="/wms/customer-statement-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
|
<ImportCustomerStatementForm ref="importFormRef" url="/wms/customer-statement-main/import" |
|
|
|
:importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { CustomerStatementMain,CustomerStatementMainRules } from './customerStatementMain.data' |
|
|
|
import { CustomerStatementDetail,CustomerStatementDetailRules } from './customerStatementDetail.data' |
|
|
|
import { CustomerStatementMain, CustomerStatementMainRules } from './customerStatementMain.data' |
|
|
|
import { CustomerStatementDetail, CustomerStatementDetailRules } from './customerStatementDetail.data' |
|
|
|
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain' |
|
|
|
import * as CustomerStatementDetailApi from '@/api/wms/customerStatementDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
@ -137,16 +121,61 @@ const buttonBaseClick = (val, item) => { |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:customerStatementMain:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerStatementMain:delete'}), // 删除 |
|
|
|
] |
|
|
|
const butttondata = (row, $index) => { |
|
|
|
const findIndex = row['masterId'] ? tableObject.tableList.findIndex(item => item['masterId'] == row['masterId']) : -1 |
|
|
|
if (findIndex > -1 && findIndex < $index) { |
|
|
|
return [] |
|
|
|
} |
|
|
|
return [ |
|
|
|
// defaultButtons.mainListEditBtn({hasPermi:'wms:customerStatementMain:update'}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerStatementMain:delete'}), // 删除 |
|
|
|
{ |
|
|
|
label: t('重新比对'), |
|
|
|
name: 'rematch', |
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
type: 'primary', |
|
|
|
icon: '', |
|
|
|
color: '', |
|
|
|
hasPermi: '', |
|
|
|
link: true // 文本展现按钮 |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: t('确认对比结果'), |
|
|
|
name: 'confirmationContrast', |
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
type: 'primary', |
|
|
|
icon: '', |
|
|
|
color: '', |
|
|
|
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', |
|
|
|
hide: isShowMainButton(row, ['3','4']), |
|
|
|
type: 'warning', |
|
|
|
color: '', |
|
|
|
hasPermi: '', |
|
|
|
link: true // 文本展现按钮 |
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
if (val == 'rematch') { //重新比对 |
|
|
|
tapRematch(row.id); |
|
|
|
} else if (val == 'confirmationContrast') { // 确认对比结果 |
|
|
|
tapConfirmationContrast(row.id) |
|
|
|
}else if (val == 'sendBack') { // 退回 |
|
|
|
tapSendBack(row.id) |
|
|
|
}else if (val == 'cancel') { // 作废 |
|
|
|
tapCancel(row.id) |
|
|
|
}else if (val == 'import') { // 导入 |
|
|
|
handleDelete(row.id) |
|
|
|
} |
|
|
|
} |
|
|
@ -158,18 +187,18 @@ const openForm = (type: string, row?: any) => { |
|
|
|
} |
|
|
|
|
|
|
|
// form表单提交 |
|
|
|
const formsSuccess = async (formType,data) => { |
|
|
|
var isHave =CustomerStatementMain.allSchemas.formSchema.some(function (item) { |
|
|
|
const formsSuccess = async (formType, data) => { |
|
|
|
var isHave = CustomerStatementMain.allSchemas.formSchema.some(function (item) { |
|
|
|
return item.field === 'activeTime' || item.field === 'expireTime'; |
|
|
|
}); |
|
|
|
if(isHave){ |
|
|
|
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ |
|
|
|
if (isHave) { |
|
|
|
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { |
|
|
|
message.error('失效时间要大于生效时间') |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
if (data.activeTime == 0) data.activeTime = null; |
|
|
|
if (data.expireTime == 0) data.expireTime = null; |
|
|
|
if (formType === 'create') { |
|
|
|
await CustomerStatementMainApi.createCustomerStatementMain(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
@ -197,7 +226,7 @@ const handleDelete = async (id: number) => { |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
@ -245,5 +274,73 @@ onMounted(async () => { |
|
|
|
getList() |
|
|
|
importTemplateData.templateUrl = await CustomerStatementMainApi.importTemplate() |
|
|
|
}) |
|
|
|
//点击重新比对方法 |
|
|
|
const tapRematch = async (id:number) => { |
|
|
|
try { |
|
|
|
// 确认 |
|
|
|
await message.confirm('是否重新比对') |
|
|
|
await CustomerStatementMainApi.recontrast(id); |
|
|
|
// 发起导出 |
|
|
|
//exportLoading.value = true |
|
|
|
} catch { |
|
|
|
|
|
|
|
} finally { |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//点击确认对比方法 |
|
|
|
const tapConfirmationContrast = async (id:number) => { |
|
|
|
try { |
|
|
|
await message.confirm('是否确认对比结果') |
|
|
|
await CustomerStatementMainApi.confirmationContrast(id); |
|
|
|
// 发起导出 |
|
|
|
//exportLoading.value = true |
|
|
|
} catch { |
|
|
|
|
|
|
|
} finally { |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//点击退回方法 |
|
|
|
const tapSendBack = async (id:number) => { |
|
|
|
try { |
|
|
|
await message.confirm('是否退回') |
|
|
|
await CustomerStatementMainApi.sendBack(id); |
|
|
|
// 发起导出 |
|
|
|
//exportLoading.value = true |
|
|
|
} catch { |
|
|
|
|
|
|
|
} finally { |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//点击作废方法 |
|
|
|
const tapCancel = async (id:number) => { |
|
|
|
try { |
|
|
|
await message.confirm('是否作废') |
|
|
|
await CustomerStatementMainApi.nodeAbrogate(id); |
|
|
|
// 发起导出 |
|
|
|
//exportLoading.value = true |
|
|
|
} catch { |
|
|
|
|
|
|
|
} finally { |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isShowMainButton = (row, val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|