Browse Source

SCP ——> 新增供应商询证函

hella_online_20240829
gaojs 4 months ago
parent
commit
fc5e83cd1a
  1. 70
      src/api/wms/supplierApbalanceDetail/index.ts
  2. 67
      src/api/wms/supplierApbalanceMain/index.ts
  3. 1
      src/utils/dict.ts
  4. 24
      src/utils/disposition/defaultButtons.ts
  5. 244
      src/views/wms/supplierManage/supplierApbalance/supplierApbalanceDetail/index.vue
  6. 299
      src/views/wms/supplierManage/supplierApbalance/supplierApbalanceDetail/supplierApbalanceDetail.data.ts
  7. 287
      src/views/wms/supplierManage/supplierApbalance/supplierApbalanceMain/index.vue
  8. 253
      src/views/wms/supplierManage/supplierApbalance/supplierApbalanceMain/supplierApbalanceMain.data.ts

70
src/api/wms/supplierApbalanceDetail/index.ts

@ -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' })
}

67
src/api/wms/supplierApbalanceMain/index.ts

@ -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' })
}

1
src/utils/dict.ts

@ -288,6 +288,7 @@ export enum DICT_TYPE {
CONTAIN_MANAGE_TYPE = 'contain_menage_type', //器具管理类型
INVOICE_BALANCE_STATEMENT_STATUS = 'invoice_balance_statement_status', //是否有价差
PL_MSTR_TYPE = 'pl_mstr_type', //产品类类型
TT_GLTYPE = 'tt_gltype', //账户类型
// ========== 业务 - mes ==========
MESDO_STATUS = 'mes_do_status', // 工单执行状态

24
src/utils/disposition/defaultButtons.ts

@ -1005,6 +1005,30 @@ export function mainListPackageBtn(option: any) {
hasPermi: ''
})
}
// 主列表-供应商对账打印
export function mainListPrintBtn(option: any) {
return __defaultBtnOption(option, {
label: t(`ts.打印`).replace('ts.', ''),
name: 'print',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-供应商对账回函录入
export function mainListReplyInputBtn(option: any) {
return __defaultBtnOption(option, {
label: t(`ts.回函录入`).replace('ts.', ''),
name: 'replyInput',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-打印
export function mainListPointBtn(option: any) {
return __defaultBtnOption(option, {

244
src/views/wms/supplierManage/supplierApbalance/supplierApbalanceDetail/index.vue

@ -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>

299
src/views/wms/supplierManage/supplierApbalance/supplierApbalanceDetail/supplierApbalanceDetail.data.ts

@ -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'
}
}
]))

287
src/views/wms/supplierManage/supplierApbalance/supplierApbalanceMain/index.vue

@ -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>

253
src/views/wms/supplierManage/supplierApbalance/supplierApbalanceMain/supplierApbalanceMain.data.ts

@ -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…
Cancel
Save