Browse Source

YT-170:客户对账单重新比对、确认对比结果、作废接口方法以及按钮回显逻辑

syhx
宋国强 4 months ago
parent
commit
e52a5182c4
  1. 20
      src/api/wms/customerStatementMain/index.ts
  2. 12
      src/utils/disposition/defaultButtons.ts
  3. 26
      src/views/wms/deliversettlementManage/customerStatement/customerStatement/customerStatementMain.data.ts
  4. 203
      src/views/wms/deliversettlementManage/customerStatement/customerStatement/index.vue

20
src/api/wms/customerStatementMain/index.ts

@ -65,4 +65,24 @@ export const importTemplate = () => {
// 导入客户对账单前校验是否有相同客户代码和年月的数据存在 // 导入客户对账单前校验是否有相同客户代码和年月的数据存在
export const verifyDataExist = async (yearsMonthStr: String,customerCode:String) => { export const verifyDataExist = async (yearsMonthStr: String,customerCode:String) => {
return await request.get({ url: `/wms/customer-statement-main/verifyDataExist?yearsMonthStr=` + yearsMonthStr+'&customerCode='+customerCode }) return await request.get({ url: `/wms/customer-statement-main/verifyDataExist?yearsMonthStr=` + yearsMonthStr+'&customerCode='+customerCode })
}
// 客户对账单重新比对
export const recontrast = async (id: number) => {
return await request.get({ url: `/wms/customer-statement-main/recontrast?id=` + id})
}
// 客户对账单确认比对结果
export const confirmationContrast = async (id: number) => {
return await request.get({ url: `/wms/customer-statement-main/confirmationContrast?id=` + id})
}
// 客户对账单废除数据
export const nodeAbrogate = async (id: number) => {
return await request.get({ url: `/wms/customer-statement-main/nodeAbrogate?id=` + id})
}
// 客户对账单退回操作
export const sendBack = async (id: number) => {
return await request.get({ url: `/wms/customer-statement-main/sendBack?id=` + id})
} }

12
src/utils/disposition/defaultButtons.ts

@ -1404,6 +1404,18 @@ export function outBtn(option: any) {
hasPermi: '' hasPermi: ''
}) })
} }
// 主列表-退回
export function mainSendBackBtn(option: any) {
return __defaultBtnOption(option, {
label: t(`ts.退回`).replace('ts.', ''),
name: 'sendBack',
hide: false,
type: 'warning',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 默认按钮规则 // 默认按钮规则
function __defaultBtnOption(option: any, specific: any) { function __defaultBtnOption(option: any, specific: any) {
return { return {

26
src/views/wms/deliversettlementManage/customerStatement/customerStatement/customerStatementMain.data.ts

@ -23,7 +23,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
}, },
{ {
label: '客户代码', label: '客户编号',
field: 'customerCode', field: 'customerCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
@ -43,7 +43,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM',
type: 'daterange', type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
@ -72,6 +72,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '重新比对更新时间', label: '重新比对更新时间',
field: 'comparisonTime', field: 'comparisonTime',
sort: 'custom', sort: 'custom',
isTable:false,
formatter: dateFormatter, formatter: dateFormatter,
form: { form: {
component: 'DatePicker', component: 'DatePicker',
@ -85,6 +86,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '发布时间', label: '发布时间',
field: 'publishTime', field: 'publishTime',
sort: 'custom', sort: 'custom',
isTable:false,
formatter: dateFormatter, formatter: dateFormatter,
form: { form: {
component: 'DatePicker', component: 'DatePicker',
@ -98,6 +100,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '已分摊时间', label: '已分摊时间',
field: 'shareTime', field: 'shareTime',
sort: 'custom', sort: 'custom',
isTable:false,
formatter: dateFormatter, formatter: dateFormatter,
form: { form: {
component: 'DatePicker', component: 'DatePicker',
@ -111,6 +114,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '待开票时间', label: '待开票时间',
field: 'beInvoicedTime', field: 'beInvoicedTime',
sort: 'custom', sort: 'custom',
isTable:false,
formatter: dateFormatter, formatter: dateFormatter,
form: { form: {
component: 'DatePicker', component: 'DatePicker',
@ -124,6 +128,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '开票中时间', label: '开票中时间',
field: 'invoicedTime', field: 'invoicedTime',
sort: 'custom', sort: 'custom',
isTable:false,
formatter: dateFormatter, formatter: dateFormatter,
form: { form: {
component: 'DatePicker', component: 'DatePicker',
@ -137,6 +142,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '已开票时间', label: '已开票时间',
field: 'issuedInvoicedTime', field: 'issuedInvoicedTime',
sort: 'custom', sort: 'custom',
isTable:false,
formatter: dateFormatter, formatter: dateFormatter,
form: { form: {
component: 'DatePicker', component: 'DatePicker',
@ -150,6 +156,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '已作废时间', label: '已作废时间',
field: 'abrogateTime', field: 'abrogateTime',
sort: 'custom', sort: 'custom',
isTable:false,
formatter: dateFormatter, formatter: dateFormatter,
form: { form: {
component: 'DatePicker', component: 'DatePicker',
@ -160,16 +167,21 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
}, },
{ {
label: '版本号', label: '操作人',
field: 'versionNumber', field: 'creator',
sort: 'custom', sort: 'custom',
}, },
{ {
label: '备注', label: '版本号',
field: 'remark', field: 'versionNumber',
sort: 'custom', sort: 'custom',
}, },
// { // {
// label: '备注',
// field: 'remark',
// sort: 'custom',
// },
// {
// label: '是否可用默认TRUE', // label: '是否可用默认TRUE',
// field: 'available', // field: 'available',
// sort: 'custom', // sort: 'custom',
@ -205,7 +217,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action', field: 'action',
isForm: false, isForm: false,
table: { table: {
width: 150, width: 300,
fixed: 'right' fixed: 'right'
} }
} }

203
src/views/wms/deliversettlementManage/customerStatement/customerStatement/index.vue

@ -1,67 +1,51 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="CustomerStatementMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="CustomerStatementMain.allSchemas.searchSchema" @search="setSearchParams"
@reset="setSearchParams" />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
:HeadButttondata="HeadButttondata" @updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
@button-base-click="buttonBaseClick" :allSchemas="CustomerStatementMain.allSchemas" />
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CustomerStatementMain.allSchemas"
/>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table <Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
:columns="tableColumns" total: tableObject.total
:data="tableObject.tableList" }" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
:loading="tableObject.loading" v-model:sort="tableObject.sort">
:pagination="{ <template #number="{ row }">
total: tableObject.total <el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
}" <span>{{ row.number }}</span>
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>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm ref="basicFormRef" @success="formsSuccess" :rules="CustomerStatementMainRules"
ref="basicFormRef" :formAllSchemas="CustomerStatementMain.allSchemas" :apiUpdate="CustomerStatementMainApi.updateCustomerStatementMain"
@success="formsSuccess" :apiCreate="CustomerStatementMainApi.createCustomerStatementMain" @searchTableSuccess="searchTableSuccess"
:rules="CustomerStatementMainRules" :isBusiness="false" />
:formAllSchemas="CustomerStatementMain.allSchemas"
:apiUpdate="CustomerStatementMainApi.updateCustomerStatementMain"
:apiCreate="CustomerStatementMainApi.createCustomerStatementMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerStatementMain.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerStatementMain.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<!-- <ImportForm ref="importFormRef" url="/wms/customer-statement-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> --> <!-- <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> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { CustomerStatementMain,CustomerStatementMainRules } from './customerStatementMain.data' import { CustomerStatementMain, CustomerStatementMainRules } from './customerStatementMain.data'
import { CustomerStatementDetail,CustomerStatementDetailRules } from './customerStatementDetail.data' import { CustomerStatementDetail, CustomerStatementDetailRules } from './customerStatementDetail.data'
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain' import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain'
import * as CustomerStatementDetailApi from '@/api/wms/customerStatementDetail' import * as CustomerStatementDetailApi from '@/api/wms/customerStatementDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -137,16 +121,61 @@ const buttonBaseClick = (val, item) => {
} }
// - // -
const butttondata = [ const butttondata = (row, $index) => {
defaultButtons.mainListEditBtn({hasPermi:'wms:customerStatementMain:update'}), // const findIndex = row['masterId'] ? tableObject.tableList.findIndex(item => item['masterId'] == row['masterId']) : -1
defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerStatementMain:delete'}), // 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) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'rematch') { //
openForm('update', row) tapRematch(row.id);
} else if (val == 'delete') { // } 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) handleDelete(row.id)
} }
} }
@ -158,18 +187,18 @@ const openForm = (type: string, row?: any) => {
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType, data) => {
var isHave =CustomerStatementMain.allSchemas.formSchema.some(function (item) { var isHave = CustomerStatementMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime';
}); });
if(isHave){ if (isHave) {
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return;
} }
} }
if(data.activeTime==0)data.activeTime = null; if (data.activeTime == 0) data.activeTime = null;
if(data.expireTime==0)data.expireTime = null; if (data.expireTime == 0) data.expireTime = null;
if (formType === 'create') { if (formType === 'create') {
await CustomerStatementMainApi.createCustomerStatementMain(data) await CustomerStatementMainApi.createCustomerStatementMain(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
@ -197,7 +226,7 @@ const handleDelete = async (id: number) => {
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
} catch {} } catch { }
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
@ -245,5 +274,73 @@ onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await CustomerStatementMainApi.importTemplate() 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> </script>

Loading…
Cancel
Save