songguoqiang 1 month ago
parent
commit
5196ae2ae5
  1. 59
      src/api/wms/customerSaleInvoiceDetail/index.ts
  2. 59
      src/api/wms/customerSaleInvoiceMain/index.ts
  3. 27
      src/api/wms/purchaseBarterRecordDetail/index.ts
  4. 124
      src/views/wms/deliversettlementManage/customerSaleInvoiceMain/customerSaleInvoiceMain.data.ts
  5. 245
      src/views/wms/deliversettlementManage/customerSaleInvoiceMain/index.vue
  6. 16
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data.ts
  7. 3
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue
  8. 84
      src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/customerToolApportStatementForecastMain.data.ts
  9. 107
      src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/index.vue
  10. 158
      src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/index.vue
  11. 95
      src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/purchaseBarterRecordMain.data.ts

59
src/api/wms/customerSaleInvoiceDetail/index.ts

@ -0,0 +1,59 @@
import request from '@/config/axios'
export interface CustomerSaleInvoiceDetailVO {
id: number
number: string
masterId: number
itemCode: string
articleNumber: string
qty: number
price: number
allocationPrice: number
sumPrice: number
afterTaxAmount: number
beforeTaxAmount: number
taxAmount: number
remark: string
available: string
}
// 查询客户销售开票子信息表(WMS)列表
export const getCustomerSaleInvoiceDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/customer-sale-invoice-detail/senior', data })
} else {
return await request.get({ url: `/wms/customer-sale-invoice-detail/page`, params })
}
}
// 查询客户销售开票子信息表(WMS)详情
export const getCustomerSaleInvoiceDetail = async (id: number) => {
return await request.get({ url: `/wms/customer-sale-invoice-detail/get?id=` + id })
}
// 新增客户销售开票子信息表(WMS)
export const createCustomerSaleInvoiceDetail = async (data: CustomerSaleInvoiceDetailVO) => {
return await request.post({ url: `/wms/customer-sale-invoice-detail/create`, data })
}
// 修改客户销售开票子信息表(WMS)
export const updateCustomerSaleInvoiceDetail = async (data: CustomerSaleInvoiceDetailVO) => {
return await request.put({ url: `/wms/customer-sale-invoice-detail/update`, data })
}
// 删除客户销售开票子信息表(WMS)
export const deleteCustomerSaleInvoiceDetail = async (id: number) => {
return await request.delete({ url: `/wms/customer-sale-invoice-detail/delete?id=` + id })
}
// 导出客户销售开票子信息表(WMS) Excel
export const exportCustomerSaleInvoiceDetail = async (params) => {
return await request.download({ url: `/wms/customer-sale-invoice-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/customer-sale-invoice-detail/get-import-template' })
}

59
src/api/wms/customerSaleInvoiceMain/index.ts

@ -0,0 +1,59 @@
import request from '@/config/axios'
export interface CustomerSaleInvoiceMainVO {
id: number
number: string
customerStatementNumber: string
beforeTaxAmount: number
taxRate: number
taxAmount: number
adTaxAmount: number
goldenTaxInvoiceNumber: string
invoiceTime: Date
status: string
publishTime: Date
abrogateTime: Date
remark: string
available: string
}
// 查询客户销售开票主信息表(WMS)列表
export const getCustomerSaleInvoiceMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/customer-sale-invoice-main/senior', data })
} else {
return await request.get({ url: `/wms/customer-sale-invoice-main/page`, params })
}
}
// 查询客户销售开票主信息表(WMS)详情
export const getCustomerSaleInvoiceMain = async (id: number) => {
return await request.get({ url: `/wms/customer-sale-invoice-main/get?id=` + id })
}
// 新增客户销售开票主信息表(WMS)
export const createCustomerSaleInvoiceMain = async (data: CustomerSaleInvoiceMainVO) => {
return await request.post({ url: `/wms/customer-sale-invoice-main/create`, data })
}
// 修改客户销售开票主信息表(WMS)
export const updateCustomerSaleInvoiceMain = async (data: CustomerSaleInvoiceMainVO) => {
return await request.put({ url: `/wms/customer-sale-invoice-main/update`, data })
}
// 删除客户销售开票主信息表(WMS)
export const deleteCustomerSaleInvoiceMain = async (id: number) => {
return await request.delete({ url: `/wms/customer-sale-invoice-main/delete?id=` + id })
}
// 导出客户销售开票主信息表(WMS) Excel
export const exportCustomerSaleInvoiceMain = async (params) => {
return await request.download({ url: `/wms/customer-sale-invoice-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/customer-sale-invoice-main/get-import-template' })
}

27
src/api/wms/purchaseBarterRecordDetail/index.ts

@ -0,0 +1,27 @@
import request from '@/config/axios'
export interface PurchaseBarterRecordDetailVO {
masterId: number
itemCode: string
itemName: string
uom: string
batch: string
packUnit: string
qty: number
reason: string
}
// 查询采购换货申请明细列表
export const getPurchaseBarterRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchase-barter-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/purchase-barter-record-detail/page`, params })
}
}
export async function exportPurchaseBarterRecord(params: any) {
}

124
src/views/wms/deliversettlementManage/customerSaleInvoiceMain/customerSaleInvoiceMain.data.ts

@ -0,0 +1,124 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const CustomerSaleInvoiceMainRules = reactive({
beforeTaxAmount: [required],
taxRate: [required],
taxAmount: [required],
adTaxAmount: [required],
})
export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
} ,{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
// 0:新增1:已发布2已作废
},
{
label: '客户对账单单据号',
field: 'customerStatementNumber',
sort: 'custom',
isSearch: true,
},
{
label: '客户代码',
field: 'customer',
sort: 'custom',
isSearch: true,
},
{
label: '客户名称',
field: 'customerName',
sort: 'custom',
},
{
label: '未税金额',
field: 'beforeTaxAmount',
sort: 'custom',
},
{
label: '税率',
field: 'taxRate',
sort: 'custom',
},
{
label: '税额',
field: 'taxAmount',
sort: 'custom',
},
{
label: '价税合计金额',
field: 'adTaxAmount',
sort: 'custom',
},
{
label: '金税票号',
field: 'goldenTaxInvoiceNumber',
sort: 'custom',
},
{
label: '开票日期',
field: 'invoiceTime',
sort: 'custom',
formatter: dateFormatter,
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: 'remark',
sort: 'custom',
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
isTable:false
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
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: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

245
src/views/wms/deliversettlementManage/customerSaleInvoiceMain/index.vue

@ -0,0 +1,245 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CustomerSaleInvoiceMain.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="CustomerSaleInvoiceMainRules"
:formAllSchemas="CustomerSaleInvoiceMain.allSchemas"
:apiUpdate="CustomerSaleInvoiceMainApi.updateCustomerSaleInvoiceMain"
:apiCreate="CustomerSaleInvoiceMainApi.createCustomerSaleInvoiceMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerSaleInvoiceMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/customer-sale-invoice-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CustomerSaleInvoiceMain,CustomerSaleInvoiceMainRules } from './customerSaleInvoiceMain.data'
import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain'
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: 'CustomerSaleInvoiceMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(CustomerSaleInvoiceMain.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: CustomerSaleInvoiceMainApi.getCustomerSaleInvoiceMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:customerSaleInvoiceMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:customerSaleInvoiceMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:customerSaleInvoiceMain: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:customerSaleInvoiceMain:update'}), //
defaultButtons.mainListOrderPubBtn({hasPermi:'wms:customerSaleInvoiceMain:publish'}), //
defaultButtons.mainListOrderPubBtn({hasPermi:'wms:mainListCancelBtn:cancle'}), //
]
// -
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 =CustomerSaleInvoiceMain.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 CustomerSaleInvoiceMainApi.createCustomerSaleInvoiceMain(data)
message.success(t('common.createSuccess'))
} else {
await CustomerSaleInvoiceMainApi.updateCustomerSaleInvoiceMain(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, 'basicCustomerSaleInvoiceMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await CustomerSaleInvoiceMainApi.deleteCustomerSaleInvoiceMain(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 CustomerSaleInvoiceMainApi.exportCustomerSaleInvoiceMain(tableObject.params)
download.excel(data, '客户销售开票主信息表(WMS).xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '客户销售开票主信息表(WMS)导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await CustomerSaleInvoiceMainApi.importTemplate()
})
</script>

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

@ -1,5 +1,6 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { validateTwoNum } from '@/utils/validator'
// 表单校验
export const CustomerStatementMainRules = reactive({
@ -261,17 +262,10 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
// 表单校验
export const CustomerStatementDetailRules = reactive({
releaseNumber: [required],
ingress: [required],
ingress2: [required],
itemCode: [required],
articleNumber: [required],
articleName: [required],
checkTime: [required],
uom: [required],
qty: [required],
price: [required],
amount: [required],
amount: [
required,
{ validator: validateTwoNum, message: '小数点后最多2位', trigger: 'blur' }
],
})
export const CustomerStatementDetail = useCrudSchemas(reactive<CrudSchema[]>([

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

@ -33,14 +33,13 @@
:apiCreate="CustomerStatementMainApi.createCustomerStatementMain" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" />
<!-- 详情 -->
<!-- <Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerStatementMain.allSchemas" /> -->
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="CustomerStatementMain.allSchemas"
:detailAllSchemas="DetailAllSchemas"
:detailAllSchemasRules="CustomerStatementDetailRules"
:apiPage="apiPage"
:tabsExtend="tabsExtend"
:tabs="[{

84
src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/customerToolApportStatementForecastMain.data.ts

@ -92,3 +92,87 @@ export const CustomerToolApportStatementForecastMain = useCrudSchemas(reactive<C
}
}
]))
// 表单校验
export const CustomerToolApportStatementForecastDetailRules = reactive({
customerCode: [required],
customerName: [required],
yearsMonth: [required],
})
export const CustomerToolApportStatementForecastDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '帐票号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '品号',
field: 'articleNumber',
sort: 'custom',
isSearch: true,
},
{
label: '车型',
field: 'vehicleType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '模具预测分摊金额',
field: 'forecastAllocationAmount',
sort: 'custom',
},
{
label: '操作',
field: 'action',
isForm: false,
isTable: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 预测与对账单差异
export const ForecastWithBillDifference = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '车型',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '模具分摊预测金额',
field: 'articleNumber',
sort: 'custom',
isSearch: true,
},
{
label: '模具分摊对账金额',
field: 'vehicleType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '差异',
field: 'forecastAllocationAmount',
sort: 'custom',
},
{
label: '操作',
field: 'action',
isForm: false,
isTable: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

107
src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/index.vue

@ -27,9 +27,9 @@
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>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
@ -51,20 +51,47 @@
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerToolApportStatementForecastMain.allSchemas" />
<!-- <Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerToolApportStatementForecastMain.allSchemas" /> -->
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="CustomerStatementMain.allSchemas"
:detailAllSchemas="DetailAllSchemas"
:apiPage="apiPage"
:tabsExtend="tabsExtend"
:tabs="[{
label: '明细',
prop: 'Detail'
},{
label: '预测与对账单差异',
prop: 'ForecastWithBilltDifference'
}]"
:otherHeadButttonData="otherHeadButttonData"
:detailButtonIsShowAdd="false"
:detailButtonIsShowEdit="false"
:detailButtonIsShowDelete="false"
@changeTabs="changeTabs"
:tableObjectExtend="tableObjectExtend"
@buttonBaseClick="detailButtonBaseClick"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/customer-tool-apport-statement-forecast-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CustomerToolApportStatementForecastMain,CustomerToolApportStatementForecastMainRules } from './customerToolApportStatementForecastMain.data'
import { CustomerToolApportStatementForecastMain,CustomerToolApportStatementForecastMainRules,CustomerToolApportStatementForecastDetail,CustomerToolApportStatementForecastDetailRules,ForecastWithBillDifference } from './customerToolApportStatementForecastMain.data'
import * as CustomerToolApportStatementForecastMainApi from '@/api/wms/customerToolApportStatementForecastMain'
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 { CustomerStatementMain, CustomerStatementMainRules,CustomerStatementDetail,CustomerStatementDetailRules,CustomerStatementReconciliation,CustomerStatementShareReconciliation} from '../customerStatement/customerStatementMain.data'
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain'
import * as CustomerStatementDetailApi from '@/api/wms/customerStatementDetail'
defineOptions({ name: 'CustomerToolApportStatementForecastMain' })
@ -76,6 +103,13 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(CustomerToolApportStatementForecastMain.allSchemas.tableColumns)
const apiPage = ref(CustomerStatementDetailApi.getCustomerStatementDetailPage)
const DetailAllSchemas = ref(CustomerToolApportStatementForecastDetail.allSchemas)
const tabsExtend = ref(false)
const tableObjectExtend = ref()
const otherHeadButttonData = ref()
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
@ -91,7 +125,8 @@ const updataTableColumns = (val) => {
}
const { tableObject, tableMethods } = useTable({
getListApi: CustomerToolApportStatementForecastMainApi.getCustomerToolApportStatementForecastMainPage //
// getListApi: CustomerToolApportStatementForecastMainApi.getCustomerToolApportStatementForecastMainPage //
getListApi: CustomerStatementMainApi.getCustomerStatementMainPage //
})
//
@ -178,7 +213,9 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */
const detailRef = ref()
const chooseRow = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
chooseRow.value = row
detailRef.value.openDetail(row, titleName, titleValue, 'basicCustomerToolApportStatementForecastMain')
}
@ -234,7 +271,61 @@ const searchFormClick = (searchData) => {
}
getList() //
}
const tabCurrent = ref({})
const changeTabs = async (item) => {
tabCurrent.value = item
if (item.prop == 'Detail') {
//
tabsExtend.value = true
//
tableObjectExtend.value = [{
key: 'masterId',
value: chooseRow.value.id
}]
apiPage.value = CustomerStatementDetailApi.getCustomerStatementDetailPage
DetailAllSchemas.value = CustomerStatementDetail.allSchemas
otherHeadButttonData.value = [{
label: t(`ts.导出`).replace('ts.', ''),
name: 'exportDetail',
hide: false,
type: 'success',
icon: 'ep:download',
color: '',
hasPermi: ''
}]
} else if (item.prop == 'ForecastWithBilltDifference') {
//
tabsExtend.value = true
//
tableObjectExtend.value = [{
key: 'masterId',
value: chooseRow.value.id
}]
DetailAllSchemas.value = ForecastWithBillDifference.allSchemas
apiPage.value = CustomerStatementMainApi.getCustomerStatementMainPage
otherHeadButttonData.value = [
{
label: t(`ts.导出`).replace('ts.', ''),
name: 'exportForecastWithBilltDifference',
hide: false,
type: 'success',
icon: 'ep:download',
color: '',
hasPermi: ''
}]
} else{
tableObjectExtend.value = []
tabsExtend.value = false
apiPage.value = ''
otherHeadButttonData.value = []
}
}
//
const detailButtonBaseClick = (val, item) => {
if (val == 'exportForecastWithBilltDifference') {
//
}
}
/** 初始化 **/
onMounted(async () => {
getList()

158
src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/index.vue

@ -0,0 +1,158 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...PurchaseBarterRecordMain.allSchemas.searchSchema,...PurchaseBarterRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchaseBarterRecordMain.allSchemas"
:detailAllSchemas="PurchaseBarterRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
: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"
>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
@success="getList"
:formAllSchemas="PurchaseBarterRecordMain.allSchemas"
:tableAllSchemas="PurchaseBarterRecordDetail.allSchemas"
:isBusiness="true"
>
</BasicForm>
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="PurchaseBarterRecordMain.allSchemas"
:detailAllSchemas="PurchaseBarterRecordDetail.allSchemas"
:apiPage="PurchaseBarterRecordDetailApi.getPurchaseBarterRecordDetailPage"
:Echo="Echo"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
PurchaseBarterRecordMain,
PurchaseBarterRecordDetail
} from './purchaseBarterRecordMain.data'
import * as PurchaseBarterRecordDetailApi from '@/api/wms/purchaseBarterRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'PurchaseBarterRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...PurchaseBarterRecordMain.allSchemas.tableColumns,...PurchaseBarterRecordDetail.allSchemas.tableMainColumns])
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: PurchaseBarterRecordDetailApi.getPurchaseBarterRecordDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
const formRef = ref()
const detailRef = ref()
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
tableObject.params.detailDataType = 1
const data = await PurchaseBarterRecordDetailApi.exportPurchaseBarterRecord(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

95
src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/purchaseBarterRecordMain.data.ts

@ -0,0 +1,95 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
export const PurchaseBarterRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '记录单号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 180,
fixed: 'left'
}
},
{
label: '申请单号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 180,
}
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
isForm: false,
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
},
{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
isSearch: false,
}
]))
export const PurchaseBarterRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
isSearch: false,
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
isSearch: false,
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
isSearch: false,
},
{
label: '换货数量',
field: 'qty',
sort: 'custom',
isSearch: false,
},
{
label: '换货原因 ',
field: 'reason',
sort: 'custom',
isSearch: false,
},
]))
Loading…
Cancel
Save