Browse Source

客户对账单接口对接

syhx
zhang_li 2 months ago
parent
commit
1282f7bb69
  1. 58
      src/components/ImportForm/src/ImportCustomerStatementForm.vue
  2. 9
      src/locales/en-US.ts
  3. 10
      src/locales/zh-CN.ts
  4. 2
      src/utils/disposition/defaultButtons.ts
  5. 171
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data.ts
  6. 105
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue

58
src/components/ImportForm/src/ImportCustomerStatementForm.vue

@ -2,34 +2,38 @@
<template>
<Dialog v-model="dialogVisible" :title="t('ts.导入')" width="600" :close-on-click-modal="false">
<el-form
:inline="true"
:model="queryParams"
class="demo-form-inline"
style="margin-bottom: 10px"
label-width="100px"
>
<el-form-item label="客户代码" style="margin-right: 20px;">
<el-select
v-model="queryParams.customerCode"
placeholder="请选择客户代码"
clearable
style="width: 100px"
:inline="true"
:model="queryParams"
class="demo-form-inline"
style="margin-bottom: 10px"
label-width="70px"
>
<el-option v-for="(item) in customerList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
<el-form-item label="年月" style="margin-right: 20px;">
<el-date-picker
v-model="queryParams.yearsMonthStr"
type="month"
placeholder="选择年月"
format="YYYY-MM"
value-format="YYYY-MM"
style="width: 100%">
</el-date-picker>
</el-form-item>
</el-form>
<el-row>
<el-col :span="12">
<el-form-item label="客户代码">
<el-select
v-model="queryParams.customerCode"
placeholder="请选择客户代码"
clearable
>
<el-option v-for="(item) in customerList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="年月">
<el-date-picker
v-model="queryParams.yearsMonthStr"
type="month"
placeholder="选择年月"
format="YYYY-MM"
value-format="YYYY-MM"
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-upload
ref="uploadRef"
v-model:file-list="fileList"

9
src/locales/en-US.ts

@ -1302,7 +1302,14 @@ export default {
: 'The range of invoices is',
: 'Re compare',
: 'Confirm the comparison results',
: 'Confirm the shared amount'
: 'Confirm the shared amount',
: 'Import mold allocation statement',
: 'Do you want to re compare?',
: 'Are you sure about the comparison results?',
退: 'Do you want to return it?',
: 'Do you want to invalidate it?',
: 'Do you want to confirm the allocation amount?',
: 'Create an invoice request?',
},

10
src/locales/zh-CN.ts

@ -1301,8 +1301,16 @@ export default {
: '发票回转成功',
:'最后更新人',
: '可开票数量范围是',
: '重新比对',
: '确认对比结果',
: '确认分摊金额'
: '确认分摊金额',
: '导入模具分摊对账单',
: '是否重新比对?',
: "是否确认对比结果?",
退: '是否退回?',
: '是否作废?',
: '是否确认分摊金额?',
: '创建开票申请',
},
}

2
src/utils/disposition/defaultButtons.ts

@ -470,7 +470,7 @@ export function mainListCancelBtn(option: any) {
label: t(`ts.作废`).replace('ts.', ''),
name: 'cancel',
hide: false,
type: 'primary',
type: 'danger',
color: '',
link: true, // 文本展现按钮
hasPermi: ''

171
src/views/wms/deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data.ts

@ -25,7 +25,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
},
{
label: '客户编号',
label: '客户代码',
field: 'customerCode',
sort: 'custom',
isSearch: true,
@ -53,13 +53,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
detail: {
dateFormat: 'YYYY-MM'
},
table: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'YYYY-MM'
}
},
isTable:false,
form: {
component: 'DatePicker',
componentProps: {
@ -68,6 +62,15 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '年月',
field: 'yearsMonthStr',
sort: 'custom',
detail: {
dateFormat: 'YYYY-MM'
},
isForm:false,
},
{
label: '状态',
field: 'status',
@ -80,145 +83,12 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
component: 'Select',
},
},
{
label: '重新比对时间',
field: 'comparisonTime',
sort: 'custom',
isTable:false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '发布时间',
field: 'publishTime',
sort: 'custom',
isTable:false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '已分摊时间',
field: 'shareTime',
sort: 'custom',
isTable:false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '待开票时间',
field: 'beInvoicedTime',
sort: 'custom',
isTable:false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '开票中时间',
field: 'invoicedTime',
sort: 'custom',
isTable:false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '已开票时间',
field: 'issuedInvoicedTime',
sort: 'custom',
isTable:false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '已作废时间',
field: 'abrogateTime',
sort: 'custom',
isTable:false,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '操作人',
label: '创建者',
field: 'creator',
sort: 'custom',
},
{
label: '版本号',
field: 'versionNumber',
sort: 'custom',
},
// {
// label: '备注',
// field: 'remark',
// sort: 'custom',
// },
// {
// label: '是否可用默认TRUE',
// field: 'available',
// sort: 'custom',
// },
{
label: '创建时间',
field: 'createTime',
@ -238,23 +108,13 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
},
isForm: false,
},
// {
// label: '地点ID',
// field: 'siteId',
// sort: 'custom',
// },
// {
// label: '并发乐观锁',
// field: 'concurrencyStamp',
// sort: 'custom',
// },
{
label: '操作',
isDetail:false,
field: 'action',
isForm: false,
table: {
width: 300,
width: 360,
fixed: 'right'
}
}
@ -282,9 +142,6 @@ export const CustomerStatementDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '开票种类',
field: 'invoiceType',
sort: 'custom',
form: {
component: 'SelectV2'
},
isForm: false,
},
{

105
src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue

@ -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,14 +410,23 @@ const tapCancel = async (id:number) => {
await getList()
}
}
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
//
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) {
return false
} else {
return true
}
}
const tabCurrent = ref({})
const changeTabs = async (item) => {
@ -426,7 +471,7 @@ const changeTabs = async (item) => {
hasPermi: ''
},
{
label:'重新对比',
label: t('ts.重新对比'),
name: 'againContrast',
hide: false,
type: 'primary',
@ -453,7 +498,7 @@ const changeTabs = async (item) => {
apiPage.value = CustomerStatementDetailApi.getCustomerStatementDetailPage
DetailAllSchemas.value = CustomerStatementShareReconciliation.allSchemas
otherHeadButttonData.value = [
{
{
label: t(`ts.导出`).replace('ts.', ''),
name: 'exportConfirmShareMoney',
hide: false,

Loading…
Cancel
Save