ljlong_2630 1 month ago
parent
commit
5012378209
  1. 59
      src/api/wms/customerSaleInvoiceDetail/index.ts
  2. 59
      src/api/wms/customerSaleInvoiceMain/index.ts
  3. 27
      src/api/wms/customerStatementDetail/index.ts
  4. 51
      src/api/wms/customerStatementMain/index.ts
  5. 56
      src/api/wms/customerToolApportStatementForecastDetail/index.ts
  6. 52
      src/api/wms/customerToolApportStatementForecastMain/index.ts
  7. 27
      src/api/wms/purchaseBarterRecordDetail/index.ts
  8. 53
      src/api/wms/purchaseBarterRequestDetail/index.ts
  9. 96
      src/api/wms/purchaseBarterRequestMain/index.ts
  10. 3
      src/locales/zh-CN.ts
  11. 13
      src/utils/disposition/defaultButtons.ts
  12. 124
      src/views/wms/deliversettlementManage/customerSaleInvoiceMain/customerSaleInvoiceMain.data.ts
  13. 55
      src/views/wms/deliversettlementManage/customerSaleInvoiceMain/index.vue
  14. 20
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data.ts
  15. 3
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue
  16. 199
      src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/customerToolApportStatementForecastMain.data.ts
  17. 335
      src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/index.vue
  18. 158
      src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/index.vue
  19. 95
      src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/purchaseBarterRecordMain.data.ts
  20. 613
      src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue
  21. 277
      src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.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/customerStatementDetail/index.ts

@ -35,7 +35,7 @@ export interface CustomerStatementDetailVO {
concurrencyStamp: string concurrencyStamp: string
} }
// 查询客户对账单子信息表(WMS)列表 // 查询客户对账单子信息明细表(WMS)列表或者查询客户对账单对账差异列表 二者共用一个
export const getCustomerStatementDetailPage = async (params) => { export const getCustomerStatementDetailPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
@ -66,12 +66,27 @@ export const deleteCustomerStatementDetail = async (id: number) => {
return await request.delete({ url: `/wms/customer-statement-detail/delete?id=` + id }) return await request.delete({ url: `/wms/customer-statement-detail/delete?id=` + id })
} }
// 导出客户对账单子信息表(WMS) Excel
export const exportCustomerStatementDetail = async (params) => {
return await request.download({ url: `/wms/customer-statement-detail/export-excel`, params })
}
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/customer-statement-detail/get-import-template' }) return request.download({ url: '/wms/customer-statement-detail/get-import-template' })
}
//导出明细数据需要传masterId
export const exportCustomerStatementDetail = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/customer-statement-detail/export-excel-senior`, data })
}else{
return await request.download({ url: `/wms/customer-statement-detail/export-excel`, params })
}
}
//导出详情对账差异列表数据 需要传masterId
export const exportCustomerStatementCompareDetail = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/customer-statement-detail/export-excel-compare-senior`, data })
}else{
return await request.download({ url: `/wms/customer-statement-detail/export-excel-compare`, params })
}
} }

51
src/api/wms/customerStatementMain/index.ts

@ -52,11 +52,6 @@ export const deleteCustomerStatementMain = async (id: number) => {
return await request.delete({ url: `/wms/customer-statement-main/delete?id=` + id }) return await request.delete({ url: `/wms/customer-statement-main/delete?id=` + id })
} }
// 导出客户对账单主信息表(WMS) Excel
export const exportCustomerStatementMain = async (params) => {
return await request.download({ url: `/wms/customer-statement-main/export-excel`, params })
}
// 下载客户对账单导入模板 // 下载客户对账单导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/customer-statement-main/get-import-template' }) return request.download({ url: '/wms/customer-statement-main/get-import-template' })
@ -88,11 +83,53 @@ export const sendBack = async (id: number) => {
} }
// 导入客户模具分摊对账单前校验该客户对账单下是否存在已分摊的模具分摊对账单如果有提示 // 导入客户模具分摊对账单前校验该客户对账单下是否存在已分摊的模具分摊对账单如果有提示
export const verifyDataExistShare = async (customerId:number) => { export const verifyDataExistShare = async (customerId:number) => {//customerId为客户对账单id
return await request.get({ url: `/wms/customer-tool-apport-statement-detail/verifyDataExist?customerId=` + customerId }) return await request.get({ url: `/wms/customer-tool-apport-statement-detail/verifyDataExist?customerId=` + customerId })
} }
// 下载客户模具分摊对账单导入模板 // 下载客户模具分摊对账单导入模板
export const importShareTemplate = () => { export const importShareTemplate = () => {
return request.download({ url: '/wms/customer-tool-apport-statement-detail/get-import-template' }) return request.download({ url: '/wms/customer-tool-apport-statement-detail/get-import-template' })
} }
// 客户对账单点击发布接口
export const publish = async (id: number) => {
return await request.get({ url: `/wms/customer-statement-main/publish?id=` + id})
}
// 根据对账单主id点击确认分摊
export const confirmationShare = async (id: number) => {
return await request.get({ url: `/wms/customer-statement-main/confirmationShare?id=` + id})
}
// 客户对账单查询客户代码
export const getCustomerList = async () => {
return await request.get({ url: `/wms/customer-statement-main/confirmationShare`})
}
// 客户模具分摊对账单修改调整金额
export const updateAdjustmentAmount = async (id:number,masterId:number,amount:number) => {
return await request.get({ url: `/wms/customer-statement-main/updateAdjustmentAmount?id=` + id+'&masterId='+masterId+'&amount='+amount})
}
// 导出客户对账单Excel
export const exportCustomerStatementMain = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/eam/basic-eam-workshop/export-excel-senior`, data })
}else{
return await request.download({ url: `/wms/customer-statement-main/export-excel`, params })
}
}
// 导出客户模具分摊对账单Excel 需要传masterId
export const exportCustomerStatementShareMain = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/customer-tool-apport-statement-detail/export-excel-senior`, data })
}else{
return await request.download({ url: `/wms/customer-tool-apport-statement-detail/export-excel`, params })
}
}

56
src/api/wms/customerToolApportStatementForecastDetail/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface CustomerToolApportStatementForecastDetailVO {
id: number
number: string
masterId: number
factoryCode: string
factoryName: string
invoiceNumber: string
articleNumber: string
vehicleType: string
forecastAllocationAmount: number
remark: string
available: string
}
// 查询客户模具分摊对账单预测子表(WMS)列表
export const getCustomerToolApportStatementForecastDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/customer-tool-apport-statement-forecast-detail/senior', data })
} else {
return await request.get({ url: `/wms/customer-tool-apport-statement-forecast-detail/page`, params })
}
}
// 查询客户模具分摊对账单预测子表(WMS)详情
export const getCustomerToolApportStatementForecastDetail = async (id: number) => {
return await request.get({ url: `/wms/customer-tool-apport-statement-forecast-detail/get?id=` + id })
}
// 新增客户模具分摊对账单预测子表(WMS)
export const createCustomerToolApportStatementForecastDetail = async (data: CustomerToolApportStatementForecastDetailVO) => {
return await request.post({ url: `/wms/customer-tool-apport-statement-forecast-detail/create`, data })
}
// 修改客户模具分摊对账单预测子表(WMS)
export const updateCustomerToolApportStatementForecastDetail = async (data: CustomerToolApportStatementForecastDetailVO) => {
return await request.put({ url: `/wms/customer-tool-apport-statement-forecast-detail/update`, data })
}
// 删除客户模具分摊对账单预测子表(WMS)
export const deleteCustomerToolApportStatementForecastDetail = async (id: number) => {
return await request.delete({ url: `/wms/customer-tool-apport-statement-forecast-detail/delete?id=` + id })
}
// 导出客户模具分摊对账单预测子表(WMS) Excel
export const exportCustomerToolApportStatementForecastDetail = async (params) => {
return await request.download({ url: `/wms/customer-tool-apport-statement-forecast-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/customer-tool-apport-statement-forecast-detail/get-import-template' })
}

52
src/api/wms/customerToolApportStatementForecastMain/index.ts

@ -0,0 +1,52 @@
import request from '@/config/axios'
export interface CustomerToolApportStatementForecastMainVO {
id: number
number: string
customerCode: string
customerName: string
yearsMonth: Date
remark: string
available: string
}
// 查询客户模具分摊对账单预测主表(WMS)列表
export const getCustomerToolApportStatementForecastMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/customer-tool-apport-statement-forecast-main/senior', data })
} else {
return await request.get({ url: `/wms/customer-tool-apport-statement-forecast-main/page`, params })
}
}
// 查询客户模具分摊对账单预测主表(WMS)详情
export const getCustomerToolApportStatementForecastMain = async (id: number) => {
return await request.get({ url: `/wms/customer-tool-apport-statement-forecast-main/get?id=` + id })
}
// 新增客户模具分摊对账单预测主表(WMS)
export const createCustomerToolApportStatementForecastMain = async (data: CustomerToolApportStatementForecastMainVO) => {
return await request.post({ url: `/wms/customer-tool-apport-statement-forecast-main/create`, data })
}
// 修改客户模具分摊对账单预测主表(WMS)
export const updateCustomerToolApportStatementForecastMain = async (data: CustomerToolApportStatementForecastMainVO) => {
return await request.put({ url: `/wms/customer-tool-apport-statement-forecast-main/update`, data })
}
// 删除客户模具分摊对账单预测主表(WMS)
export const deleteCustomerToolApportStatementForecastMain = async (id: number) => {
return await request.delete({ url: `/wms/customer-tool-apport-statement-forecast-main/delete?id=` + id })
}
// 导出客户模具分摊对账单预测主表(WMS) Excel
export const exportCustomerToolApportStatementForecastMain = async (params) => {
return await request.download({ url: `/wms/customer-tool-apport-statement-forecast-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/customer-tool-apport-statement-forecast-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) {
}

53
src/api/wms/purchaseBarterRequestDetail/index.ts

@ -0,0 +1,53 @@
import request from '@/config/axios'
export interface PurchaseBarterRequestDetailVO {
masterId: number
itemCode: string
itemName: string
uom: string
batch: string
packUnit: string
qty: number
reason: string
}
// 查询采购换货申请明细列表
export const getPurchaseBarterRequestDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchase-barter-request-detail/senior', data })
} else {
return await request.get({ url: `/wms/purchase-barter-request-detail/page`, params })
}
}
// 查询采购换货申请明细详情
export const getPurchaseBarterRequestDetail = async (id: number) => {
return await request.get({ url: `/wms/purchase-barter-request-detail/get?id=` + id })
}
// 新增采购换货申请明细
export const createPurchaseBarterRequestDetail = async (data: PurchaseBarterRequestDetailVO) => {
return await request.post({ url: `/wms/purchase-barter-request-detail/create`, data })
}
// 修改采购换货申请明细
export const updatePurchaseBarterRequestDetail = async (data: PurchaseBarterRequestDetailVO) => {
return await request.put({ url: `/wms/purchase-barter-request-detail/update`, data })
}
// 删除采购换货申请明细
export const deletePurchaseBarterRequestDetail = async (id: number) => {
return await request.delete({ url: `/wms/purchase-barter-request-detail/delete?id=` + id })
}
// 导出采购换货申请明细 Excel
export const exportPurchaseBarterRequestDetail = async (params) => {
return await request.download({ url: `/wms/purchase-barter-request-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchase-barter-request-detail/get-import-template' })
}

96
src/api/wms/purchaseBarterRequestMain/index.ts

@ -0,0 +1,96 @@
import request from '@/config/axios'
export interface PurchaseBarterRequestMainVO {
id: number
number: string
status: string
supplierCode: string
supplierName: string
available: string
creatorName: string
updaterName: string
deleteTime: Date
deleter: string
deleteName: string
}
// 查询采购换货申请主列表
export const getPurchaseBarterRequestMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchase-barter-request-main/senior', data })
} else {
return await request.get({ url: `/wms/purchase-barter-request-main/page`, params })
}
}
// 查询采购换货申请主详情
export const getPurchaseBarterRequestMain = async (id: number) => {
return await request.get({ url: `/wms/purchase-barter-request-main/get?id=` + id })
}
// 新增采购换货申请主
export const createPurchaseBarterRequestMain = async (data: PurchaseBarterRequestMainVO) => {
return await request.post({ url: `/wms/purchase-barter-request-main/create`, data })
}
// 修改采购换货申请主
export const updatePurchaseBarterRequestMain = async (data: PurchaseBarterRequestMainVO) => {
return await request.put({ url: `/wms/purchase-barter-request-main/update`, data })
}
// 删除采购换货申请主
export const deletePurchaseBarterRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/purchase-barter-request-main/delete?id=` + id })
}
// 导出采购换货申请主 Excel
export const exportPurchaseBarterRequestMain = async (params) => {
return await request.download({ url: `/wms/purchase-barter-request-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchase-barter-request-main/get-import-template' })
}
// 审批通过
export async function agreePurchaseBarterRequestMain(id: number) {
return await request.put({ url: `/wms/purchase-barter-request-main/agree?id=` + id })
}
// 驳回
export async function refusedPurchaseBarterRequestMain(id: number) {
return await request.put({ url: `/wms/purchase-barter-request-main/refused?id=` + id })
}
// 提交审批
export async function submitPurchaseBarterRequestMain(id: number) {
return await request.put({ url: `/wms/purchase-barter-request-main/submit?id=` + id })
}
// 重新添加
export async function reAddPurchaseBarterRequestMain(id: number) {
return await request.put({ url: `/wms/purchase-barter-request-main/reAdd?id=` + id })
}
// 关闭
export async function closePurchaseBarterRequestMain(id: number) {
return await request.put({ url: `/wms/purchase-barter-request-main/close?id=` + id })
}
// 出库
export async function outStoragePurchaseBarterRequestMain(id: number) {
return await request.put({ url: `/wms/purchase-barter-request-main/outStorage?id=` + id })
}
// 入库
export async function inStoragePurchaseBarterRequestMain(id: number) {
return await request.put({ url: `/wms/purchase-barter-request-main/inStorage?id=` + id })
}
// 中止
export async function suspendPurchaseBarterRequestMain(id: number) {
return await request.put({ url: `/wms/purchase-barter-request-main/suspend?id=` + id })
}

3
src/locales/zh-CN.ts

@ -81,6 +81,9 @@ export default {
confirmAccept: '确认承接吗?', confirmAccept: '确认承接吗?',
confirmGiveup: '确认放弃吗?', confirmGiveup: '确认放弃吗?',
confirmPublish: '确认发布吗?', confirmPublish: '确认发布吗?',
confirmOutStorage: '确认出库吗?',
confirmInStorage: '确认入库吗?',
confirmSuspend: '确认中止吗?',
}, },
error: { error: {
noPermission: `抱歉,您无权访问此页面。`, noPermission: `抱歉,您无权访问此页面。`,

13
src/utils/disposition/defaultButtons.ts

@ -1404,6 +1404,19 @@ export function outBtn(option: any) {
hasPermi: '' hasPermi: ''
}) })
} }
export function inBtn(option: any) {
return __defaultBtnOption(option, {
label: '入库',
name: 'in',
hide: false,
type: 'danger',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-重试 // 主列表-重试
export function retryBtn(option: any) { export function retryBtn(option: any) {
return __defaultBtnOption(option, { return __defaultBtnOption(option, {

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

55
src/views/wms/deliversettlementManage/customerStatement/customerToolApportStatement/index.vue → src/views/wms/deliversettlementManage/customerSaleInvoiceMain/index.vue

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="CustomerToolApportStatementDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -11,7 +11,7 @@
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="CustomerToolApportStatementDetail.allSchemas" :allSchemas="CustomerSaleInvoiceMain.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
@ -42,31 +42,31 @@
<BasicForm <BasicForm
ref="basicFormRef" ref="basicFormRef"
@success="formsSuccess" @success="formsSuccess"
:rules="CustomerToolApportStatementDetailRules" :rules="CustomerSaleInvoiceMainRules"
:formAllSchemas="CustomerToolApportStatementDetail.allSchemas" :formAllSchemas="CustomerSaleInvoiceMain.allSchemas"
:apiUpdate="CustomerToolApportStatementDetailApi.updateCustomerToolApportStatementDetail" :apiUpdate="CustomerSaleInvoiceMainApi.updateCustomerSaleInvoiceMain"
:apiCreate="CustomerToolApportStatementDetailApi.createCustomerToolApportStatementDetail" :apiCreate="CustomerSaleInvoiceMainApi.createCustomerSaleInvoiceMain"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerToolApportStatementDetail.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerSaleInvoiceMain.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/customer-tool-apport-statement-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/wms/customer-sale-invoice-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { CustomerToolApportStatementDetail,CustomerToolApportStatementDetailRules } from './customerToolApportStatementDetail.data' import { CustomerSaleInvoiceMain,CustomerSaleInvoiceMainRules } from './customerSaleInvoiceMain.data'
import * as CustomerToolApportStatementDetailApi from '@/api/wms/customerToolApportStatementDetail' import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'CustomerToolApportStatementDetail' }) defineOptions({ name: 'CustomerSaleInvoiceMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -74,7 +74,7 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(CustomerToolApportStatementDetail.allSchemas.tableColumns) const tableColumns = ref(CustomerSaleInvoiceMain.allSchemas.tableColumns)
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -91,7 +91,7 @@ const updataTableColumns = (val) => {
} }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: CustomerToolApportStatementDetailApi.getCustomerToolApportStatementDetailPage // getListApi: CustomerSaleInvoiceMainApi.getCustomerSaleInvoiceMainPage //
}) })
// //
@ -99,9 +99,9 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:customerToolApportStatementDetail:create'}), // defaultButtons.defaultAddBtn({hasPermi:'wms:customerSaleInvoiceMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:customerToolApportStatementDetail:import'}), // defaultButtons.defaultImportBtn({hasPermi:'wms:customerSaleInvoiceMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:customerToolApportStatementDetail:export'}), // defaultButtons.defaultExportBtn({hasPermi:'wms:customerSaleInvoiceMain:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -133,8 +133,9 @@ const buttonBaseClick = (val, item) => {
// - // -
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:customerToolApportStatementDetail:update'}), // defaultButtons.mainListEditBtn({hasPermi:'wms:customerSaleInvoiceMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerToolApportStatementDetail:delete'}), // defaultButtons.mainListOrderPubBtn({hasPermi:'wms:customerSaleInvoiceMain:publish'}), //
defaultButtons.mainListOrderPubBtn({hasPermi:'wms:mainListCancelBtn:cancle'}), //
] ]
// - // -
@ -154,7 +155,7 @@ const openForm = (type: string, row?: any) => {
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType,data) => {
var isHave =CustomerToolApportStatementDetail.allSchemas.formSchema.some(function (item) { var isHave =CustomerSaleInvoiceMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime';
}); });
if(isHave){ if(isHave){
@ -166,10 +167,10 @@ const formsSuccess = async (formType,data) => {
if(data.activeTime==0)data.activeTime = null; if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null; if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') { if (formType === 'create') {
await CustomerToolApportStatementDetailApi.createCustomerToolApportStatementDetail(data) await CustomerSaleInvoiceMainApi.createCustomerSaleInvoiceMain(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await CustomerToolApportStatementDetailApi.updateCustomerToolApportStatementDetail(data) await CustomerSaleInvoiceMainApi.updateCustomerSaleInvoiceMain(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
@ -179,7 +180,7 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicCustomerToolApportStatementDetail') detailRef.value.openDetail(row, titleName, titleValue, 'basicCustomerSaleInvoiceMain')
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
@ -188,7 +189,7 @@ const handleDelete = async (id: number) => {
// //
await message.delConfirm() await message.delConfirm()
// //
await CustomerToolApportStatementDetailApi.deleteCustomerToolApportStatementDetail(id) await CustomerSaleInvoiceMainApi.deleteCustomerSaleInvoiceMain(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
@ -203,8 +204,8 @@ const handleExport = async () => {
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await CustomerToolApportStatementDetailApi.exportCustomerToolApportStatementDetail(tableObject.params) const data = await CustomerSaleInvoiceMainApi.exportCustomerSaleInvoiceMain(tableObject.params)
download.excel(data, '客户模具分摊对账单明细表(WMS).xlsx') download.excel(data, '客户销售开票主信息表(WMS).xlsx')
} catch { } catch {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
@ -219,7 +220,7 @@ const handleImport = () => {
// //
const importTemplateData = reactive({ const importTemplateData = reactive({
templateUrl: '', templateUrl: '',
templateTitle: '客户模具分摊对账单明细表(WMS)导入模版.xlsx' templateTitle: '客户销售开票主信息表(WMS)导入模版.xlsx'
}) })
// //
const importSuccess = () => { const importSuccess = () => {
@ -238,7 +239,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await CustomerToolApportStatementDetailApi.importTemplate() importTemplateData.templateUrl = await CustomerSaleInvoiceMainApi.importTemplate()
}) })
</script> </script>

20
src/views/wms/deliversettlementManage/customerStatement/customerStatement/customerStatementMain.data.ts → src/views/wms/deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data.ts

@ -1,5 +1,6 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { validateTwoNum } from '@/utils/validator'
// 表单校验 // 表单校验
export const CustomerStatementMainRules = reactive({ export const CustomerStatementMainRules = reactive({
@ -33,7 +34,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '客户名称', label: '客户名称',
field: 'customerName', field: 'customerName',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '年月', label: '年月',
@ -223,7 +224,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'createTime', field: 'createTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
@ -261,17 +262,10 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
// 表单校验 // 表单校验
export const CustomerStatementDetailRules = reactive({ export const CustomerStatementDetailRules = reactive({
releaseNumber: [required], amount: [
ingress: [required], required,
ingress2: [required], { validator: validateTwoNum, message: '小数点后最多2位', trigger: 'blur' }
itemCode: [required], ],
articleNumber: [required],
articleName: [required],
checkTime: [required],
uom: [required],
qty: [required],
price: [required],
amount: [required],
}) })
export const CustomerStatementDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const CustomerStatementDetail = useCrudSchemas(reactive<CrudSchema[]>([

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

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

199
src/views/wms/deliversettlementManage/customerStatement/customerToolApportStatement/customerToolApportStatementDetail.data.ts → src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/customerToolApportStatementForecastMain.data.ts

@ -2,103 +2,45 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const CustomerToolApportStatementDetailRules = reactive({ export const CustomerToolApportStatementForecastMainRules = reactive({
invoiceNumber: [required], customerCode: [required],
articleNumber: [required], customerName: [required],
vehicleType: [required], yearsMonth: [required],
amount: [required],
qty: [required],
allocationPrice: [required],
adjustmentAmount: [required],
}) })
export const CustomerToolApportStatementDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const CustomerToolApportStatementForecastMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: 'id', label: '单据号',
field: 'id', field: 'number',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '客户对账单单据号',
field: 'customerStatementNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
}, },
{ {
label: '年月预留字段', label: '客户代码',
field: 'yearsMonth', field: 'customerCode',
sort: 'custom',
},
{
label: '客户对账单主id',
field: 'masterId',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '账票号',
field: 'invoiceNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
}, },
{ {
label: '品号', label: '客户名称',
field: 'articleNumber', field: 'customerName',
sort: 'custom',
isSearch: true,
},
{
label: '车型',
field: 'vehicleType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '金额',
field: 'amount',
sort: 'custom',
},
{
label: '数量',
field: 'qty',
sort: 'custom', sort: 'custom',
isSearch: false,
}, },
{ {
label: '模具分摊单价', label: '年月',
field: 'allocationPrice', field: 'yearsMonth',
sort: 'custom',
},
{
label: '调整金额',
field: 'adjustmentAmount',
sort: 'custom',
},
{
label: '确认分摊时间',
field: 'verifyTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
form: { isSearch: true,
search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
type: 'datetime', valueFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x' type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
},
{
label: '已作废时间',
field: 'abrogateTime',
sort: 'custom',
formatter: dateFormatter,
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -107,20 +49,6 @@ export const CustomerToolApportStatementDetail = useCrudSchemas(reactive<CrudSch
} }
}, },
}, },
{
label: '0:新增1:已作废',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '版本号',
field: 'versionNumber',
sort: 'custom',
},
{ {
label: '备注', label: '备注',
field: 'remark', field: 'remark',
@ -130,13 +58,19 @@ export const CustomerToolApportStatementDetail = useCrudSchemas(reactive<CrudSch
label: '是否可用默认TRUE', label: '是否可用默认TRUE',
field: 'available', field: 'available',
sort: 'custom', sort: 'custom',
isTable:false
},
{
label: '创建者',
field: 'creater',
sort: 'custom',
}, },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -148,23 +82,94 @@ export const CustomerToolApportStatementDetail = useCrudSchemas(reactive<CrudSch
isForm: false, isForm: false,
}, },
{ {
label: '地点ID', label: '操作',
field: 'siteId', field: 'action',
isForm: false,
isTable:false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const CustomerToolApportStatementForecastDetailRules = reactive({
customerCode: [required],
customerName: [required],
yearsMonth: [required],
})
export const CustomerToolApportStatementForecastDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '帐票号',
field: 'number',
sort: 'custom', sort: 'custom',
isTable: false,
isSearch: true, isSearch: true,
}, },
{ {
label: '并发乐观锁', label: '品号',
field: 'concurrencyStamp', field: 'articleNumber',
sort: 'custom',
isSearch: true,
},
{
label: '车型',
field: 'vehicleType',
sort: 'custom', sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '模具预测分摊金额',
field: 'forecastAllocationAmount',
sort: 'custom',
},
{
label: '操作',
field: 'action',
isForm: false,
isTable: false, isTable: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 预测与对账单差异
export const ForecastWithBillDifference = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '车型',
field: 'number',
sort: 'custom',
isSearch: true, isSearch: true,
}, },
{
label: '模具分摊预测金额',
field: 'articleNumber',
sort: 'custom',
isSearch: true,
},
{
label: '模具分摊对账金额',
field: 'vehicleType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '差异',
field: 'forecastAllocationAmount',
sort: 'custom',
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isForm: false,
isTable: false,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'

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

@ -0,0 +1,335 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CustomerToolApportStatementForecastMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CustomerToolApportStatementForecastMain.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 #number="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)">
<span>{{ row.number }}</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="CustomerToolApportStatementForecastMainRules"
:formAllSchemas="CustomerToolApportStatementForecastMain.allSchemas"
:apiUpdate="CustomerToolApportStatementForecastMainApi.updateCustomerToolApportStatementForecastMain"
:apiCreate="CustomerToolApportStatementForecastMainApi.createCustomerToolApportStatementForecastMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<!-- <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,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' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
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(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
// getListApi: CustomerToolApportStatementForecastMainApi.getCustomerToolApportStatementForecastMainPage //
getListApi: CustomerStatementMainApi.getCustomerStatementMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:customerToolApportStatementForecastMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:customerToolApportStatementForecastMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:customerToolApportStatementForecastMain: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:customerToolApportStatementForecastMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerToolApportStatementForecastMain: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 =CustomerToolApportStatementForecastMain.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 CustomerToolApportStatementForecastMainApi.createCustomerToolApportStatementForecastMain(data)
message.success(t('common.createSuccess'))
} else {
await CustomerToolApportStatementForecastMainApi.updateCustomerToolApportStatementForecastMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const chooseRow = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
chooseRow.value = row
detailRef.value.openDetail(row, titleName, titleValue, 'basicCustomerToolApportStatementForecastMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await CustomerToolApportStatementForecastMainApi.deleteCustomerToolApportStatementForecastMain(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 CustomerToolApportStatementForecastMainApi.exportCustomerToolApportStatementForecastMain(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() //
}
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()
importTemplateData.templateUrl = await CustomerToolApportStatementForecastMainApi.importTemplate()
})
</script>

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,
},
]))

613
src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue

@ -0,0 +1,613 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...PurchaseBarterRequestMain.allSchemas.searchSchema,...PurchaseBarterRequestDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchaseBarterRequestMain.allSchemas"
:detailAllSchemas="PurchaseBarterRequestDetail.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"
>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
@success="getList"
:rules="PurchaseBarterRequestMainRules"
:formAllSchemas="PurchaseBarterRequestMain.allSchemas"
:tableAllSchemas="PurchaseBarterRequestDetail.allSchemas"
:tableFormRules="PurchaseBarterRequestDetailRules"
:tableData="tableData"
:apiUpdate="PurchaseBarterRequestMainApi.updatePurchaseBarterRequestMain"
:apiCreate="PurchaseBarterRequestMainApi.createPurchaseBarterRequestMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true"
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@inputNumberChange="inputNumberChange"
@tableFormSelectOnBlur="tableFormSelectOnBlur"
>
</BasicForm>
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="PurchaseBarterRequestMain.allSchemas"
:detailAllSchemas="PurchaseBarterRequestDetail.allSchemas"
:detailAllSchemasRules="PurchaseBarterRequestDetailRules"
@handleSubmitForm="handleDetailSubmitForm"
:apiPage="PurchaseBarterRequestDetailApi.getPurchaseBarterRequestDetailPage"
:apiDelete="PurchaseBarterRequestDetailApi.deletePurchaseBarterRequestDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail"
:detailValidate="detailValidate"
@detailOpenForm="detailOpenForm"
@onBlur="onBlur"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-barter-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template>
<script setup lang="ts">
import { addDay } from '@/utils/formatTime'
import download from '@/utils/download'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import {
PurchaseBarterRequestMain,
PurchaseBarterRequestMainRules,
PurchaseBarterRequestDetail,
PurchaseBarterRequestDetailRules
} from './purchaseBarterRequestMain.data'
import * as PurchaseBarterRequestMainApi from '@/api/wms/purchaseBarterRequestMain'
import * as PurchaseBarterRequestDetailApi from '@/api/wms/purchaseBarterRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItembasicApi from "@/api/wms/itembasic";
import { formatTime } from '@/utils'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'PurchaseBarterRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...PurchaseBarterRequestMain.allSchemas.tableColumns,...PurchaseBarterRequestDetail.allSchemas.tableMainColumns])
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(async () => {
if (type == 'tableForm') {
if(formField == 'itemCode'){
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(itemCodes.length>0){
itemCodes = itemCodes.map(item=>(item['itemCode']))
message.warning(`物料${itemCodes.join(',')}已经存在`)
}
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(val.length==0){
return
}
let newVal = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
newVal.forEach(item=>{
let tfk = JSON.parse(JSON.stringify(tableFormKeys))
tfk.batch = formatTime(new Date(), 'yyyyMMdd')
tfk['itemCode'] = item['itemCode']
tfk['itemName'] = item['itemName']
tfk['uom'] = item['supplierUom']
tfk['packUnit'] = item['packUnit']
tableData.value.push(tfk)
})
}
}
const setV = {}
if(formField === 'supplierCode'){
setV['supplierCode'] = val[0]['code']
setV['supplierName'] = val[0]['name']
}
formRef.setValues(setV)
})
}
const handleDetailSubmitForm = async (formType, data) => {
if (formType === 'create') {
await PurchaseBarterRequestDetailApi.createPurchaseBarterRequestDetail(data)
message.success(t('common.createSuccess'))
} else {
await PurchaseBarterRequestDetailApi.updatePurchaseBarterRequestDetail(data)
message.success(t('common.updateSuccess'))
}
detailRef.value.submitUpdateList()
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if(formField == 'itemCode'){
setV['itemCode'] = val[0]['itemCode']
setV['itemName'] = val[0]['itemName']
setV['uom'] = val[0]['supplierUom']
setV['packUnit'] = val[0]['packUnit']
setV['batch'] = formatTime(new Date(), 'yyyyMMdd')
}
formRef.setValues(setV)
})
}
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: PurchaseBarterRequestDetailApi.getPurchaseBarterRequestDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:purchase-barter-request-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:purchase-barter-request-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:purchase-barter-request-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else 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 isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3']),hasPermi:'wms:purchase-barter-request-main:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:purchase-barter-request-main:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchase-barter-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchase-barter-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchase-barter-request-main:agree'}), //
defaultButtons.outBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:unplannedreceipt-request-main:out'}), //
defaultButtons.inBtn({hide:isShowMainButton(row,['11']),hasPermi:'wms:unplannedreceipt-request-main:in'}), //
defaultButtons.mainListSuspend1Btn({hide:isShowMainButton(row,['11']),hasPermi:'wms:unplannedreceipt-request-main:suspend'}), //
// defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchase-barter-request-main:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchase-barter-request-main:delete'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
console.log("val",val)
if (val == 'mainClose') { //
console.log('列表-操作按钮事件-关闭')
handleClose(row.masterId)
} else if (val == 'mainReAdd') { //
console.log('列表-操作按钮事件-重新添加')
handleReAdd(row.masterId)
} else if (val == 'mainSubmit') { //
console.log('列表-操作按钮事件-提交审批')
handleSubmit(row.masterId)
} else if (val == 'mainTurnDown') { //
console.log('列表-操作按钮事件-驳回')
handleRefused(row.masterId)
} else if (val == 'mainApprove') { //
console.log('列表-操作按钮事件-审批通过')
handleAgree(row.masterId)
} else if (val == 'out') { //
console.log('列表-操作按钮事件-出库')
handleOut(row.masterId)
} else if (val == 'in') { //
console.log('列表-操作按钮事件-入库')
handleIn(row.masterId)
}else if (val == 'suspend') { //
console.log('列表-操作按钮事件-中止')
handleSuspend(row.masterId)
}else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.masterId)
}
}
/** 关闭按钮操作 */
const handleClose = async (id: number) => {
await message.confirm(t('common.confirmColse'))
tableObject.loading = true
try{
await PurchaseBarterRequestMainApi.closePurchaseBarterRequestMain(id)
message.success(t('common.closeSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}catch{
tableObject.loading = false
}
}
/** 重新添加按钮操作 */
const handleReAdd = async (id: number) => {
await message.confirm(t('common.confirmReAdd'))
tableObject.loading = true
try{
await PurchaseBarterRequestMainApi.reAddPurchaseBarterRequestMain(id)
message.success(t('common.reAddSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}catch{
tableObject.loading = false
}
}
/** 提交按钮操作 */
const handleSubmit = async (id: number) => {
await message.confirm(t('common.confirmSubmit'))
tableObject.loading = true
try{
await PurchaseBarterRequestMainApi.submitPurchaseBarterRequestMain(id)
message.success(t('common.submitSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}catch{
tableObject.loading = false
}
}
/** 审批驳回按钮操作 */
const handleRefused = async (id: number) => {
await message.confirm(t('common.confirmRefused'))
tableObject.loading = true
try{
await PurchaseBarterRequestMainApi.refusedPurchaseBarterRequestMain(id)
message.success(t('common.refusedSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}catch{
tableObject.loading = false
}
}
/** 审批通过按钮操作 */
const handleAgree = async (id: number) => {
await message.confirm(t('common.confirmAgree'))
tableObject.loading = true
try{
await PurchaseBarterRequestMainApi.agreePurchaseBarterRequestMain(id)
message.success(t('common.agreeSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}catch{
tableObject.loading = false
}
}
/** 出库按钮操作 */
const handleOut = async (id: number) => {
await message.confirm(t('common.confirmOutStorage'))
tableObject.loading = true
try {
await PurchaseBarterRequestMainApi.outStoragePurchaseBarterRequestMain(id)
message.success(t('common.handleSuccess'))
buttonBaseClick('refresh',null)
} finally {
tableObject.loading = false
}
}
const handleIn = async (id: number) => {
await message.confirm(t('common.confirmInStorage'))
tableObject.loading = true
try {
await PurchaseBarterRequestMainApi.inStoragePurchaseBarterRequestMain(id)
message.success(t('common.handleSuccess'))
buttonBaseClick('refresh',null)
} finally {
tableObject.loading = false
}
}
const handleSuspend = async (id: number) => {
await message.confirm(t('common.confirmSuspend'))
tableObject.loading = true
try {
await PurchaseBarterRequestMainApi.suspendPurchaseBarterRequestMain(id)
message.success(t('common.handleSuccess'))
buttonBaseClick('refresh',null)
} finally {
tableObject.loading = false
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
PurchaseBarterRequestMain.allSchemas.formSchema.forEach((item) => {
if(type == "update"){
}else{
}
})
tableData.value = [] //
formRef.value.open(type, row)
}
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue,'requestUnplannedreceiptMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
tableObject.loading = true
//
await PurchaseBarterRequestMainApi.deletePurchaseBarterRequestMain(id)
message.success(t('common.delSuccess'))
tableObject.loading = false
//
buttonBaseClick('refresh',null)
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
tableObject.params.detailDataType = 1
const data = await PurchaseBarterRequestMainApi.exportPurchaseBarterRequestMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
PurchaseBarterRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
let tfk = JSON.parse(JSON.stringify(tableFormKeys))
tfk.batch = formatTime(new Date(), 'yyyyMMdd')
tableData.value.push(tfk)
}
//
const handleDeleteTable = (item, index) => {
let itemIndex = tableData.value.indexOf(item)
if(itemIndex>-1){
tableData.value.splice(itemIndex, 1)
}
}
const tableSelectionDelete = (selection) => {
tableData.value = tableData.value.filter(item => !selection.includes(item))
}
//
const submitForm = async (formType, submitData) => {
let data = {...submitData}
if(data.masterId){
data.id = data.masterId
}
data.subList = tableData.value //
try {
if (formType === 'create') {
if(data.subList.length == 0){
message.warning("请添加子列表数据")
return;
}
let flag = false;
data.subList.forEach((item) => {
if(item.qty == 0){
message.warning("数量不能为0")
flag = true;
return;
}
})
if(flag){
return
}
formRef.value.formLoading = true
await PurchaseBarterRequestMainApi.createPurchaseBarterRequestMain(data)
message.success(t('common.createSuccess'))
} else {
formRef.value.formLoading = true
await PurchaseBarterRequestMainApi.updatePurchaseBarterRequestMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
if (formType === 'create') {
getList()
}else{
buttonBaseClick('refresh',null)
}
} finally {
formRef.value.formLoading = false
}
}
// /
const detailValidate = (data) => {
let tag = false;
if(data.qty <= 0){
message.warning('数量必须大于0')
tag = false;
return tag;
}else {
tag = true;
return tag;
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: `${route.meta.title}】导入模版.xlsx`
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
//
const inputNumberChange = (field, index, row, val) => {
if(field == 'qty' || field == 'singlePrice'){
row.amount = row.qty * row.singlePrice
}
}
let validityDays = 0
const detailOpenForm = (type, row)=>{
console.log('detailOpenForm',row)
if(type=='update'){
//
ItembasicApi.getItembasicPage({
code:row.itemCode
}).then((res)=>{
res.list.forEach((item,index)=>{
const findItem = tableData.value.find(item1=>item1['itemCode']==row['code'])
if(findItem){
validityDays = findItem['expireTime']
}
})
detailRef.value.formRef.formRef.formModel.expireDate = addDay(detailRef.value.formRef.formRef.formModel.produceDate,validityDays).valueOf()
})
}else{
validityDays = 0
}
}
const onBlur = (field, e) => {
if (field == 'reason') {
detailRef.value.formRef.formRef.formModel[field] = e.target.value
}
}
const tableFormSelectOnBlur = (field, val, row, index) => {
if (field == 'reason') {
tableData.value[index][field] = val.target.value
}
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await PurchaseBarterRequestMainApi.importTemplate()
})
</script>

277
src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts

@ -0,0 +1,277 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import {Supplier} from "@/views/wms/basicDataManage/supplierManage/supplier/supplier.data";
import * as SupplierApi from "@/api/wms/supplier";
import * as ItembasicApi from "@/api/wms/itembasic";
import {
Supplieritem
} from "@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data";
import * as SupplieritemApi from "@/api/wms/supplieritem";
/**
* @returns {Array}
*/
export const PurchaseBarterRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '申请单号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 180,
fixed: 'left'
}
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
isForm: false,
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '供应商', // 查询弹窗标题
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchPage: SupplierApi.getSupplierPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
}
},
{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
table: {
width: 250,
fixed: 'right'
}
}
]))
//表单校验
export const PurchaseBarterRequestMainRules = reactive({
supplierCode: [
{ required: true, message: '请输入供应商代码', trigger: 'blur' }
],
})
/**
* @returns {Array}
*/
export const PurchaseBarterRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
tableForm:{
multiple:true,//多选
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码',// 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '供应商物料信息', // 查询弹窗标题
searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类
searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
},{
key: 'supplierCode',
value: 'supplierCode',
action: '==',
message: '供应商代码不能为空!',
isFormModel:true, // filters中添加筛选的数据--取于formModel
required:true, // 前置添加必有,和isFormModel结合使用
isSearch: true,
isMainValue: false
}],
verificationPage: ItembasicApi.getItemListByCodes, // tableForm下方输入框校验失去焦点之后是否正确的方法
isShowTableFormSearch: false, //tableForm下方是否出现输入框
verificationParams: [{
key: 'itemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled:true,
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '供应商物料信息', // 查询弹窗标题
searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类
searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'supplierCode',
value: 'supplierCode',
message: '供应商代码不能为空!',
isMainValue:true
}
],
verificationParams: [
{
key: 'itemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
isSearch: false,
tableForm: {
disabled: true
},
form:{
componentProps:{
disabled:true
}
}
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
isSearch: false,
tableForm: {
disabled: true
},
form:{
componentProps:{
disabled:true
}
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true
},
form:{
componentProps:{
disabled:true
}
}
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
isSearch: false,
tableForm: {
disabled: true
},
form:{
componentProps:{
disabled:true
}
}
},
{
label: '换货数量',
field: 'qty',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '换货原因 ',
field: 'reason',
sort: 'custom',
isSearch: false,
},
{
label: '操作',
field: 'action',
isDetail: false,
hiddenInMain:true,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
isTableForm:false,
}
]))
function validateQty(rule, value, callback) {
const numericValue = Number(value);
if (Number.isInteger(numericValue) && numericValue > 0) {
callback();
} else {
callback(new Error('数量必须是一个正整数'));
}
}
//表单校验
export const PurchaseBarterRequestDetailRules = reactive({
qty:[
{ validator:validateQty, message: '数量必须是一个正整数', trigger: 'change'}
],
})
Loading…
Cancel
Save