Browse Source

客户对账单接口对接

syhx
zhang_li 2 months ago
parent
commit
1282f7bb69
  1. 18
      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. 89
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue

18
src/components/ImportForm/src/ImportCustomerStatementForm.vue

@ -6,29 +6,33 @@
:model="queryParams" :model="queryParams"
class="demo-form-inline" class="demo-form-inline"
style="margin-bottom: 10px" style="margin-bottom: 10px"
label-width="100px" label-width="70px"
> >
<el-form-item label="客户代码" style="margin-right: 20px;"> <el-row>
<el-col :span="12">
<el-form-item label="客户代码">
<el-select <el-select
v-model="queryParams.customerCode" v-model="queryParams.customerCode"
placeholder="请选择客户代码" placeholder="请选择客户代码"
clearable clearable
style="width: 100px"
> >
<el-option v-for="(item) in customerList" :key="item.code" :label="item.name" :value="item.code" /> <el-option v-for="(item) in customerList" :key="item.code" :label="item.name" :value="item.code" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-form-item label="年月" style="margin-right: 20px;"> <el-col :span="12">
<el-form-item label="年月">
<el-date-picker <el-date-picker
v-model="queryParams.yearsMonthStr" v-model="queryParams.yearsMonthStr"
type="month" type="month"
placeholder="选择年月" placeholder="选择年月"
format="YYYY-MM" format="YYYY-MM"
value-format="YYYY-MM" value-format="YYYY-MM"
style="width: 100%"> style="width: 100%"
</el-date-picker> />
</el-form-item> </el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<el-upload <el-upload
ref="uploadRef" ref="uploadRef"

9
src/locales/en-US.ts

@ -1302,7 +1302,14 @@ export default {
: 'The range of invoices is', : 'The range of invoices is',
: 'Re compare', : 'Re compare',
: 'Confirm the comparison results', : '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.', ''), label: t(`ts.作废`).replace('ts.', ''),
name: 'cancel', name: 'cancel',
hide: false, hide: false,
type: 'primary', type: 'danger',
color: '', color: '',
link: true, // 文本展现按钮 link: true, // 文本展现按钮
hasPermi: '' hasPermi: ''

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

@ -25,7 +25,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,
@ -53,13 +53,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
detail: { detail: {
dateFormat: 'YYYY-MM' dateFormat: 'YYYY-MM'
}, },
table: { isTable:false,
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'YYYY-MM'
}
},
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -68,6 +62,15 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{
label: '年月',
field: 'yearsMonthStr',
sort: 'custom',
detail: {
dateFormat: 'YYYY-MM'
},
isForm:false,
},
{ {
label: '状态', label: '状态',
field: 'status', field: 'status',
@ -80,145 +83,12 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
component: 'Select', component: 'Select',
}, },
}, },
{ {
label: '重新比对时间', 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: '操作人',
field: 'creator', field: 'creator',
sort: 'custom', sort: 'custom',
}, },
{
label: '版本号',
field: 'versionNumber',
sort: 'custom',
},
// {
// label: '备注',
// field: 'remark',
// sort: 'custom',
// },
// {
// label: '是否可用默认TRUE',
// field: 'available',
// sort: 'custom',
// },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
@ -238,23 +108,13 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isForm: false, isForm: false,
}, },
// {
// label: '地点ID',
// field: 'siteId',
// sort: 'custom',
// },
// {
// label: '并发乐观锁',
// field: 'concurrencyStamp',
// sort: 'custom',
// },
{ {
label: '操作', label: '操作',
isDetail:false, isDetail:false,
field: 'action', field: 'action',
isForm: false, isForm: false,
table: { table: {
width: 300, width: 360,
fixed: 'right' fixed: 'right'
} }
} }
@ -282,9 +142,6 @@ export const CustomerStatementDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '开票种类', label: '开票种类',
field: 'invoiceType', field: 'invoiceType',
sort: 'custom', sort: 'custom',
form: {
component: 'SelectV2'
},
isForm: false, isForm: false,
}, },
{ {

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

@ -72,6 +72,7 @@
</Detail> </Detail>
<!-- 导入 --> <!-- 导入 -->
<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" />
<ImportCustomerStatementShareForm ref="importShareFormRef" url="/wms/customer-tool-apport-statement-detail/import" :importTemplateData="importShareTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -83,6 +84,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportCustomerStatementForm from '@/components/ImportForm/src/ImportCustomerStatementForm.vue' import ImportCustomerStatementForm from '@/components/ImportForm/src/ImportCustomerStatementForm.vue'
import Detail from '@/components/Detail/src/Detail.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' }) defineOptions({ name: 'CustomerStatementMain' })
@ -125,10 +128,8 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
//defaultButtons.defaultAddBtn({hasPermi:'wms:customerStatementMain:create'}), // //defaultButtons.defaultAddBtn({hasPermi:'wms:customerStatementMain:create'}), //
//defaultButtons.defaultImportBtn({hasPermi:'wms:customerStatementMain:import'}), // defaultButtons.defaultImportBtn({hasPermi:'wms:customer-statement-main:import'}), //
//defaultButtons.defaultExportBtn({hasPermi:'wms:customerStatementMain:export'}), // defaultButtons.defaultExportBtn({hasPermi:'wms:customer-statement-main:export'}), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -168,7 +169,7 @@ const butttondata = (row, $index) => {
// defaultButtons.mainListEditBtn({hasPermi:'wms:customerStatementMain:update'}), // // defaultButtons.mainListEditBtn({hasPermi:'wms:customerStatementMain:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerStatementMain:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerStatementMain:delete'}), //
{ {
label: t('重新比对'), label: t('ts.重新比对'),
name: 'rematch', name: 'rematch',
hide: isShowMainButton(row, ['2']), hide: isShowMainButton(row, ['2']),
type: 'primary', type: 'primary',
@ -178,7 +179,7 @@ const butttondata = (row, $index) => {
link: true // link: true //
}, },
{ {
label: t('确认对比结果'), label: t('ts.确认对比结果'),
name: 'confirmationContrast', name: 'confirmationContrast',
hide: isShowMainButton(row, ['2']), hide: isShowMainButton(row, ['2']),
type: 'primary', type: 'primary',
@ -187,18 +188,36 @@ const butttondata = (row, $index) => {
hasPermi: '', hasPermi: '',
link: true // 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('导入'), label: t('ts.导入模具分摊对账单'),
name: 'import', name: 'importShareReconciliation',
hide: isShowMainButton(row, ['3','4']), hide: isShowMainButton(row, ['3','4']),
type: 'warning', type: 'primary',
color: '', color: '',
hasPermi: '', hasPermi: '',
link: true // 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); tapRematch(row.id);
} else if (val == 'confirmationContrast') { // } else if (val == 'confirmationContrast') { //
tapConfirmationContrast(row.id) 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') { // 退 }else if (val == 'sendBack') { // 退
tapSendBack(row.id) tapSendBack(row.id)
}else if (val == 'cancel') { // }else if (val == 'cancel') { //
tapCancel(row.id) tapCancel(row.id)
}else if (val == 'import') { //
handleDelete(row.id)
} }
} }
@ -277,8 +300,9 @@ const handleExport = async () => {
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const excelTitle = ref(route.meta.title)
const data = await CustomerStatementMainApi.exportCustomerStatementMain(tableObject.params) const data = await CustomerStatementMainApi.exportCustomerStatementMain(tableObject.params)
download.excel(data, '客户对账单主信息表(WMS).xlsx') download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch { } catch {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
@ -287,13 +311,25 @@ const handleExport = async () => {
/** 导入 */ /** 导入 */
const importFormRef = ref() const importFormRef = ref()
//
const importShareFormRef = ref()
const handleImport = () => { const handleImport = () => {
importFormRef.value.open() importFormRef.value.open()
} }
const handleShareImport = (id:number) => {
importShareTemplateData.customerId = id
importShareFormRef.value.open()
}
// //
const importTemplateData = reactive({ const importTemplateData = reactive({
templateUrl: '', templateUrl: '',
templateTitle: '客户对账单导入模版.xlsx' templateTitle: `${route.meta.title}】导入模版.xlsx`
})
//
const importShareTemplateData = reactive({
templateUrl: '',
templateTitle: '模具分摊对账单导入模版.xlsx',
customerId: 0
}) })
// //
const importSuccess = () => { const importSuccess = () => {
@ -318,7 +354,7 @@ onMounted(async () => {
const tapRematch = async (id:number) => { const tapRematch = async (id:number) => {
try { try {
// //
await message.confirm('是否重新比对') await message.confirm( t('ts.是否重新比对'))
await CustomerStatementMainApi.recontrast(id); await CustomerStatementMainApi.recontrast(id);
// //
//exportLoading.value = true //exportLoading.value = true
@ -333,7 +369,7 @@ const tapRematch = async (id:number) => {
// //
const tapConfirmationContrast = async (id:number) => { const tapConfirmationContrast = async (id:number) => {
try { try {
await message.confirm('是否确认对比结果') await message.confirm( t('ts.是否确认对比结果'))
await CustomerStatementMainApi.confirmationContrast(id); await CustomerStatementMainApi.confirmationContrast(id);
// //
//exportLoading.value = true //exportLoading.value = true
@ -348,7 +384,7 @@ const tapConfirmationContrast = async (id:number) => {
//退 //退
const tapSendBack = async (id:number) => { const tapSendBack = async (id:number) => {
try { try {
await message.confirm('是否退回') await message.confirm(t('ts.是否退回'))
await CustomerStatementMainApi.sendBack(id); await CustomerStatementMainApi.sendBack(id);
// //
//exportLoading.value = true //exportLoading.value = true
@ -363,7 +399,7 @@ const tapSendBack = async (id:number) => {
// //
const tapCancel = async (id:number) => { const tapCancel = async (id:number) => {
try { try {
await message.confirm('是否作废') await message.confirm(t('ts.是否作废'))
await CustomerStatementMainApi.nodeAbrogate(id); await CustomerStatementMainApi.nodeAbrogate(id);
// //
//exportLoading.value = true //exportLoading.value = true
@ -374,7 +410,16 @@ const tapCancel = async (id:number) => {
await getList() await getList()
} }
} }
//
const handleConfirmShareMoney = async (id:number) => {
try {
await message.confirm(t('ts.是否确认分摊金额'))
await CustomerStatementMainApi.confirmationShare(id);
} finally {
//
await getList()
}
}
// //
const isShowMainButton = (row, val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) { if (val.indexOf(row.status) > -1) {
@ -426,7 +471,7 @@ const changeTabs = async (item) => {
hasPermi: '' hasPermi: ''
}, },
{ {
label:'重新对比', label: t('ts.重新对比'),
name: 'againContrast', name: 'againContrast',
hide: false, hide: false,
type: 'primary', type: 'primary',

Loading…
Cancel
Save