gaojs
4 months ago
8 changed files with 1245 additions and 0 deletions
@ -0,0 +1,70 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface SupplierApbalanceDetailVO { |
|||
id: number |
|||
ttSupplier: string |
|||
ttSupplierName: string |
|||
ttGlcode: string |
|||
ttYear: string |
|||
ttVoucher: string |
|||
ttReference: string |
|||
ttInvoiceno: string |
|||
ttTcAmt: number |
|||
ttBcAmt: number |
|||
ttTcbal: number |
|||
ttBcbal: number |
|||
ttCurr: string |
|||
ttDueDate: Date |
|||
ttInvDate: Date |
|||
ttEffDate: Date |
|||
ttCreditTerm: string |
|||
ttGltype: string |
|||
masterId: number |
|||
remark: string |
|||
siteId: string |
|||
available: string |
|||
deletionTime: Date |
|||
deleterId: byte[] |
|||
concurrencyStamp: number |
|||
} |
|||
|
|||
// 查询供应商余额明细子列表
|
|||
export const getSupplierApbalanceDetailPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/supplier-apbalance-detail/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/supplier-apbalance-detail/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询供应商余额明细子详情
|
|||
export const getSupplierApbalanceDetail = async (id: number) => { |
|||
return await request.get({ url: `/wms/supplier-apbalance-detail/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增供应商余额明细子
|
|||
export const createSupplierApbalanceDetail = async (data: SupplierApbalanceDetailVO) => { |
|||
return await request.post({ url: `/wms/supplier-apbalance-detail/create`, data }) |
|||
} |
|||
|
|||
// 修改供应商余额明细子
|
|||
export const updateSupplierApbalanceDetail = async (data: SupplierApbalanceDetailVO) => { |
|||
return await request.put({ url: `/wms/supplier-apbalance-detail/update`, data }) |
|||
} |
|||
|
|||
// 删除供应商余额明细子
|
|||
export const deleteSupplierApbalanceDetail = async (id: number) => { |
|||
return await request.delete({ url: `/wms/supplier-apbalance-detail/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出供应商余额明细子 Excel
|
|||
export const exportSupplierApbalanceDetail = async (params) => { |
|||
return await request.download({ url: `/wms/supplier-apbalance-detail/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/wms/supplier-apbalance-detail/get-import-template' }) |
|||
} |
@ -0,0 +1,67 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface SupplierApbalanceMainVO { |
|||
id: number |
|||
ttCompany: string |
|||
ttSupplier: string |
|||
ttGltype: string |
|||
ttCustorsupp: string |
|||
ttSupplierType: string |
|||
ttName1: string |
|||
ttName2: string |
|||
ttName3: string |
|||
ttSupplierName: string |
|||
ttGenerateTime: Date |
|||
ttAccountAp: number |
|||
ttAccountOthap: number |
|||
ttAccountPrepay: number |
|||
ttCreditTerm: string |
|||
departmentCode: string |
|||
remark: string |
|||
siteId: string |
|||
available: string |
|||
deletionTime: Date |
|||
deleterId: byte[] |
|||
concurrencyStamp: number |
|||
} |
|||
|
|||
// 查询供应商余额明细主列表
|
|||
export const getSupplierApbalanceMainPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/supplier-apbalance-main/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/supplier-apbalance-main/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询供应商余额明细主详情
|
|||
export const getSupplierApbalanceMain = async (id: number) => { |
|||
return await request.get({ url: `/wms/supplier-apbalance-main/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增供应商余额明细主
|
|||
export const createSupplierApbalanceMain = async (data: SupplierApbalanceMainVO) => { |
|||
return await request.post({ url: `/wms/supplier-apbalance-main/create`, data }) |
|||
} |
|||
|
|||
// 修改供应商余额明细主
|
|||
export const updateSupplierApbalanceMain = async (data: SupplierApbalanceMainVO) => { |
|||
return await request.put({ url: `/wms/supplier-apbalance-main/update`, data }) |
|||
} |
|||
|
|||
// 删除供应商余额明细主
|
|||
export const deleteSupplierApbalanceMain = async (id: number) => { |
|||
return await request.delete({ url: `/wms/supplier-apbalance-main/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出供应商余额明细主 Excel
|
|||
export const exportSupplierApbalanceMain = async (params) => { |
|||
return await request.download({ url: `/wms/supplier-apbalance-main/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/wms/supplier-apbalance-main/get-import-template' }) |
|||
} |
@ -0,0 +1,244 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="SupplierApbalanceDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="SupplierApbalanceDetail.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> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="formsSuccess" |
|||
:rules="SupplierApbalanceDetailRules" |
|||
:formAllSchemas="SupplierApbalanceDetail.allSchemas" |
|||
:apiUpdate="SupplierApbalanceDetailApi.updateSupplierApbalanceDetail" |
|||
:apiCreate="SupplierApbalanceDetailApi.createSupplierApbalanceDetail" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="SupplierApbalanceDetail.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/wms/supplier-apbalance-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { SupplierApbalanceDetail,SupplierApbalanceDetailRules } from './supplierApbalanceDetail.data' |
|||
import * as SupplierApbalanceDetailApi from '@/api/wms/supplierApbalanceDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|||
import Detail from '@/components/Detail/src/Detail.vue' |
|||
|
|||
defineOptions({ name: 'SupplierApbalanceDetail' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(SupplierApbalanceDetail.allSchemas.tableColumns) |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: SupplierApbalanceDetailApi.getSupplierApbalanceDetailPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'wms:supplierApbalanceDetail:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'wms:supplierApbalanceDetail:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'wms:supplierApbalanceDetail:export'}), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn({hasPermi:'wms:supplierApbalanceDetail:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierApbalanceDetail:delete'}), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// form表单提交 |
|||
const formsSuccess = async (formType,data) => { |
|||
var isHave =SupplierApbalanceDetail.allSchemas.formSchema.some(function (item) { |
|||
return item.field === 'activeTime' || item.field === '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 (formType === 'create') { |
|||
await SupplierApbalanceDetailApi.createSupplierApbalanceDetail(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await SupplierApbalanceDetailApi.updateSupplierApbalanceDetail(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
basicFormRef.value.dialogVisible = false |
|||
getList() |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicSupplierApbalanceDetail') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await SupplierApbalanceDetailApi.deleteSupplierApbalanceDetail(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await SupplierApbalanceDetailApi.exportSupplierApbalanceDetail(tableObject.params) |
|||
download.excel(data, '供应商余额明细子.xlsx') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '供应商余额明细子导入模版.xlsx' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await SupplierApbalanceDetailApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,299 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const SupplierApbalanceDetailRules = reactive({ |
|||
ttSupplier: [required], |
|||
ttGltype: [required], |
|||
concurrencyStamp: [required], |
|||
}) |
|||
|
|||
export const SupplierApbalanceDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '供应商代码', |
|||
field: 'ttSupplier', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '供应商名称', |
|||
field: 'ttSupplierName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '科目代码', |
|||
field: 'ttGlcode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '年度', |
|||
field: 'ttYear', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '凭证号', |
|||
field: 'ttVoucher', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '发票号', |
|||
field: 'ttReference', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '完整凭证号', |
|||
field: 'ttInvoiceno', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '发票TC原始金额', |
|||
field: 'ttTcAmt', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '发票BC原始金额', |
|||
field: 'ttBcAmt', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '发票TC余额', |
|||
field: 'ttTcbal', |
|||
sort: 'custom', |
|||
}, |
|||
{ |
|||
label: '发票BC余额', |
|||
field: 'ttBcbal', |
|||
sort: 'custom', |
|||
}, |
|||
{ |
|||
label: '货币', |
|||
field: 'ttCurr', |
|||
sort: 'custom', |
|||
}, |
|||
{ |
|||
label: '到期日期', |
|||
field: 'ttDueDate', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '发票日期', |
|||
field: 'ttInvDate', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '凭证日期', |
|||
field: 'ttEffDate', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '付款周期', |
|||
field: 'ttCreditTerm', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '账户类型', |
|||
field: 'ttGltype', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.TT_GLTYPE, |
|||
dictClass: 'string', |
|||
}, |
|||
{ |
|||
label: '父ID', |
|||
field: 'masterId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '地点ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '是否可用默认TRUE', |
|||
field: 'available', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '删除时间', |
|||
field: 'deletionTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除人id', |
|||
field: 'deleterId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '并发乐观锁', |
|||
field: 'concurrencyStamp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,287 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="SupplierApbalanceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="SupplierApbalanceMain.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 #id="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.id)"> |
|||
<span>{{ row.id }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="formsSuccess" |
|||
:rules="SupplierApbalanceMainRules" |
|||
:formAllSchemas="SupplierApbalanceMain.allSchemas" |
|||
:apiUpdate="SupplierApbalanceMainApi.updateSupplierApbalanceMain" |
|||
:apiCreate="SupplierApbalanceMainApi.createSupplierApbalanceMain" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="SupplierApbalanceMain.allSchemas" /> |
|||
<Detail ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="SupplierApbalanceMain.allSchemas" |
|||
:detailAllSchemasRules="SupplierApbalanceDetailRules" |
|||
:detailAllSchemas="SupplierApbalanceDetail.allSchemas" |
|||
:apiPage="SupplierApbalanceDetailApi.getSupplierApbalanceDetailPage" |
|||
:detailButtonIsShowAdd=false |
|||
:detailButtonIsShowEdit=false |
|||
:detailButtonIsShowDelete=false |
|||
/> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/wms/supplier-apbalance-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { SupplierApbalanceMain,SupplierApbalanceMainRules } from './supplierApbalanceMain.data' |
|||
import { SupplierApbalanceDetail,SupplierApbalanceDetailRules } from '../supplierApbalanceDetail/supplierApbalanceDetail.data' |
|||
import * as SupplierApbalanceMainApi from '@/api/wms/supplierApbalanceMain' |
|||
import * as SupplierApbalanceDetailApi from '@/api/wms/supplierApbalanceDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|||
import Detail from '@/components/Detail/src/Detail.vue' |
|||
import * as BasicSpotCheckOptionApi from "@/api/eam/basicSpotCheckOption"; |
|||
import {getJmreportBaseUrl} from "@/utils/systemParam"; |
|||
import {getAccessToken} from "@/utils/auth"; |
|||
|
|||
defineOptions({ name: 'SupplierApbalanceMain' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(SupplierApbalanceMain.allSchemas.tableColumns) |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: SupplierApbalanceMainApi.getSupplierApbalanceMainPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
//defaultButtons.defaultAddBtn({hasPermi:'wms:supplier-apbalance-main:create'}), // 新增 |
|||
//defaultButtons.defaultImportBtn({hasPermi:'wms:supplier-apbalance-main:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'wms:supplier-apbalance-main:export'}), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListPrintBtn({hasPermi:'wms:supplier-apbalance-main:update'}), // 打印 |
|||
defaultButtons.mainListReplyInputBtn({hasPermi:'wms:supplier-apbalance-main:update'}), // 回函录入 |
|||
] |
|||
|
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} else if (val == 'print') { // 删除 |
|||
handlePrint(row) |
|||
} else if (val == 'replyInput') { // 删除 |
|||
handleReplyInput(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// form表单提交 |
|||
const formsSuccess = async (formType,data) => { |
|||
var isHave =SupplierApbalanceMain.allSchemas.formSchema.some(function (item) { |
|||
return item.field === 'activeTime' || item.field === '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 (formType === 'create') { |
|||
await SupplierApbalanceMainApi.createSupplierApbalanceMain(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await SupplierApbalanceMainApi.updateSupplierApbalanceMain(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
basicFormRef.value.dialogVisible = false |
|||
getList() |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicSupplierApbalanceMain') |
|||
} |
|||
|
|||
//打印 |
|||
const BASE_URL = getJmreportBaseUrl() |
|||
const src = ref(BASE_URL + '/jmreport/view/973017727126409216?token=' + getAccessToken()) |
|||
const handlePrint = async (row) => { |
|||
window.open(src.value+'&id='+row.id) |
|||
} |
|||
|
|||
//回函录入 |
|||
const handleReplyInput = async (id: number) => { |
|||
try { |
|||
const params = ref({ |
|||
id: '', |
|||
available:'', |
|||
}) |
|||
params.value.id = id |
|||
params.value.available = 'TRUE' |
|||
await BasicSpotCheckOptionApi.updateEnableCode(params.value) |
|||
message.success(t('common.updateSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await SupplierApbalanceMainApi.deleteSupplierApbalanceMain(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await SupplierApbalanceMainApi.exportSupplierApbalanceMain(tableObject.params) |
|||
download.excel(data, '供应商余额明细主.xlsx') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '供应商余额明细主导入模版.xlsx' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await SupplierApbalanceMainApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,253 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const SupplierApbalanceMainRules = reactive({ |
|||
ttCompany: [required], |
|||
ttSupplier: [required], |
|||
ttGltype: [required], |
|||
ttCustorsupp: [required], |
|||
ttSupplierType: [required], |
|||
ttGenerateTime: [required], |
|||
concurrencyStamp: [required], |
|||
}) |
|||
|
|||
export const SupplierApbalanceMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '公司代码', |
|||
field: 'ttCompany', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '供应商代码', |
|||
field: 'ttSupplier', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '账户类型', |
|||
field: 'ttGltype', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
dictType: DICT_TYPE.TT_GLTYPE, |
|||
dictClass: 'string', |
|||
}, |
|||
{ |
|||
label: '类型固定值', |
|||
field: 'ttCustorsupp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '供应商类型', |
|||
field: 'ttSupplierType', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
form: { |
|||
component: 'SelectV2' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '名称1', |
|||
field: 'ttName1', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '名称2', |
|||
field: 'ttName2', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '名称3', |
|||
field: 'ttName3', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '供应商名称', |
|||
field: 'ttSupplierName', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '生成时间', |
|||
field: 'ttGenerateTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '应付挂账金额', |
|||
field: 'ttAccountAp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '其他应付金额', |
|||
field: 'ttAccountOthap', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '预付金额', |
|||
field: 'ttAccountPrepay', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '付款周期', |
|||
field: 'ttCreditTerm', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '部门id', |
|||
field: 'departmentCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '地点ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '是否可用默认TRUE', |
|||
field: 'available', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '删除时间', |
|||
field: 'deletionTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除人id', |
|||
field: 'deleterId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '并发乐观锁', |
|||
field: 'concurrencyStamp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
Loading…
Reference in new issue