ljlong_2630
1 month ago
102 changed files with 3834 additions and 3151 deletions
@ -0,0 +1,41 @@ |
|||
import request from '@/config/axios' |
|||
// 获得采购索赔子分页
|
|||
export const getPurchaseClaimRequestDetailPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/purchase-claim-request-detai/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/purchase-claim-request-detai/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 创建采购索赔子
|
|||
export const createPurchaseClaimRequestDetail = async (data) => { |
|||
return await request.post({ url: `/wms/purchase-claim-request-detail/create`, data }) |
|||
} |
|||
|
|||
// 修改采购索赔子
|
|||
export const updatePurchaseClaimRequestDetail = async (data) => { |
|||
return await request.put({ url: `/wms/purchase-claim-request-detail/update`, data }) |
|||
} |
|||
// 删除采购索赔子
|
|||
export const deletePurchaseClaimRequestDetail = async (id) => { |
|||
return await request.delete({ url: `/wms/purchase-claim-request-detail/delete?id=` + id }) |
|||
} |
|||
|
|||
// 获得采购索赔子
|
|||
export const getPurchaseClaimRequestDetail = async (id) => { |
|||
return await request.get({ url: `/wms/purchase-claim-request-detail/get?id=` + id }) |
|||
} |
|||
|
|||
|
|||
// 导出采购索赔子 Excel
|
|||
export const exportPurchaseClaimRequestDetailExcel = async (params) => { |
|||
if (params.isSearch) { |
|||
const data = {...params} |
|||
return await request.downloadPost({url: `/wms/purchase-claim-request-detail/export-excel-senior`, data}) |
|||
} else { |
|||
return await request.download({ url: `/wms/purchase-claim-request-detail/export-excel`, params }) |
|||
} |
|||
} |
@ -0,0 +1,55 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface PurchaseClaimRequestMainVO { |
|||
id: number |
|||
number: string |
|||
supplierCode: string |
|||
claimTime: Date |
|||
status: string |
|||
supplierinvoiceNumber: string |
|||
remark: string |
|||
available: string |
|||
siteId: string |
|||
concurrencyStamp: string |
|||
} |
|||
|
|||
// 查询采购索赔主列表
|
|||
export const getPurchaseClaimRequestMainPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/purchaseClaim-request-main/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/purchaseClaim-request-main/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询采购索赔主详情
|
|||
export const getPurchaseClaimRequestMain = async (id: number) => { |
|||
return await request.get({ url: `/wms/purchaseClaim-request-main/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增采购索赔主
|
|||
export const createPurchaseClaimRequestMain = async (data: PurchaseClaimRequestMainVO) => { |
|||
return await request.post({ url: `/wms/purchaseClaim-request-main/create`, data }) |
|||
} |
|||
|
|||
// 修改采购索赔主
|
|||
export const updatePurchaseClaimRequestMain = async (data: PurchaseClaimRequestMainVO) => { |
|||
return await request.put({ url: `/wms/purchaseClaim-request-main/update`, data }) |
|||
} |
|||
|
|||
// 删除采购索赔主
|
|||
export const deletePurchaseClaimRequestMain = async (id: number) => { |
|||
return await request.delete({ url: `/wms/purchaseClaim-request-main/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出采购索赔主 Excel
|
|||
export const exportPurchaseClaimRequestMain = async (params) => { |
|||
return await request.download({ url: `/wms/purchaseClaim-request-main/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/wms/purchaseClaim-request-main/get-import-template' }) |
|||
} |
@ -1,66 +0,0 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface PurchaseclaimRecordDetailVO { |
|||
batch: string |
|||
altBatch: string |
|||
poNumber: string |
|||
poLine: string |
|||
reason: string |
|||
singlePrice: number |
|||
amount: number |
|||
number: string |
|||
itemCode: string |
|||
remark: string |
|||
createTime: Date |
|||
creator: string |
|||
itemName: string |
|||
itemDesc1: string |
|||
itemDesc2: string |
|||
projectCode: string |
|||
qty: number |
|||
uom: string |
|||
code: string |
|||
interfaceType: string |
|||
jobDetailId: string |
|||
} |
|||
|
|||
// 查询采购索赔记录子列表
|
|||
export const getPurchaseclaimRecordDetailPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/purchaseclaim-record-detail/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/purchaseclaim-record-detail/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询采购索赔记录子详情
|
|||
export const getPurchaseclaimRecordDetail = async (id: number) => { |
|||
return await request.get({ url: `/wms/purchaseclaim-record-detail/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增采购索赔记录子
|
|||
export const createPurchaseclaimRecordDetail = async (data: PurchaseclaimRecordDetailVO) => { |
|||
return await request.post({ url: `/wms/purchaseclaim-record-detail/create`, data }) |
|||
} |
|||
|
|||
// 修改采购索赔记录子
|
|||
export const updatePurchaseclaimRecordDetail = async (data: PurchaseclaimRecordDetailVO) => { |
|||
return await request.put({ url: `/wms/purchaseclaim-record-detail/update`, data }) |
|||
} |
|||
|
|||
// 删除采购索赔记录子
|
|||
export const deletePurchaseclaimRecordDetail = async (id: number) => { |
|||
return await request.delete({ url: `/wms/purchaseclaim-record-detail/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出采购索赔记录子 Excel
|
|||
export const exportPurchaseclaimRecordDetail = async (params) => { |
|||
return await request.download({ url: `/wms/purchaseclaim-record-detail/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/wms/purchaseclaim-record-detail/get-import-template' }) |
|||
} |
@ -1,64 +0,0 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface PurchaseclaimRecordMainVO { |
|||
requestNumber: string |
|||
asnNumber: string |
|||
ppNumber: string |
|||
supplierCode: string |
|||
outTransactionType: string |
|||
inTransactionType: string |
|||
executeTime: Date |
|||
activeDate: Date |
|||
requestTime: Date |
|||
dueTime: Date |
|||
departmentCode: string |
|||
interfaceType: string |
|||
number: string |
|||
businessType: string |
|||
remark: string |
|||
createTime: Date |
|||
creator: string |
|||
code: string |
|||
available: string |
|||
} |
|||
|
|||
// 查询采购索赔记录主列表
|
|||
export const getPurchaseclaimRecordMainPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/purchaseclaim-record-main/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/purchaseclaim-record-main/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询采购索赔记录主详情
|
|||
export const getPurchaseclaimRecordMain = async (id: number) => { |
|||
return await request.get({ url: `/wms/purchaseclaim-record-main/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增采购索赔记录主
|
|||
export const createPurchaseclaimRecordMain = async (data: PurchaseclaimRecordMainVO) => { |
|||
return await request.post({ url: `/wms/purchaseclaim-record-main/create`, data }) |
|||
} |
|||
|
|||
// 修改采购索赔记录主
|
|||
export const updatePurchaseclaimRecordMain = async (data: PurchaseclaimRecordMainVO) => { |
|||
return await request.put({ url: `/wms/purchaseclaim-record-main/update`, data }) |
|||
} |
|||
|
|||
// 删除采购索赔记录主
|
|||
export const deletePurchaseclaimRecordMain = async (id: number) => { |
|||
return await request.delete({ url: `/wms/purchaseclaim-record-main/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出采购索赔记录主 Excel
|
|||
export const exportPurchaseclaimRecordMain = async (params) => { |
|||
return await request.download({ url: `/wms/purchaseclaim-record-main/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/wms/purchaseclaim-record-main/get-import-template' }) |
|||
} |
@ -1,53 +0,0 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface PurchaseclaimRequestDetailVO { |
|||
altBatch: string |
|||
amount: Number |
|||
batch: Number |
|||
id: string |
|||
itemCode: string |
|||
itemDesc1: string |
|||
itemDesc2: string |
|||
itemName: string |
|||
number: string |
|||
poLine: string |
|||
poNumber: string |
|||
projectCode: string |
|||
qty: Number |
|||
reason: string |
|||
remark: string |
|||
singlePrice: Number |
|||
uom: string |
|||
} |
|||
|
|||
// 查询采购索赔申请子列表
|
|||
export const getPurchaseclaimRequestDetailPage = async (params) => { |
|||
// return await request.get({ url: `/wms/purchaseclaim-request-detail/page`, params })
|
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return request.post({ url: '/wms/purchaseclaim-request-detail/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/purchaseclaim-request-detail/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询采购索赔申请子详情
|
|||
export const getPurchaseclaimRequesDetail = async (id: number) => { |
|||
return await request.get({ url: `/wms/purchaseclaim-request-detail/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增采购索赔申请子
|
|||
export const createPurchaseclaimRequestDetail = async (data: PurchaseclaimRequestDetailVO) => { |
|||
return await request.post({ url: `/wms/purchaseclaim-request-detail/create`, data }) |
|||
} |
|||
|
|||
// 修改采购索赔申请子
|
|||
export const updatePurchaseclaimRequestDetail = async (data: PurchaseclaimRequestDetailVO) => { |
|||
return await request.put({ url: `/wms/purchaseclaim-request-detail/update`, data }) |
|||
} |
|||
|
|||
// 删除采购索赔申请子
|
|||
export const deletePurchaseclaimRequestDetail = async (id: number) => { |
|||
return await request.delete({ url: `/wms/purchaseclaim-request-detail/delete?id=` + id }) |
|||
} |
@ -1,92 +0,0 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface PurchaseclaimRequestMainVO { |
|||
asnNumber: string |
|||
ppNumber: string |
|||
supplierCode: string |
|||
number: string |
|||
businessType: string |
|||
remark: string |
|||
createTime: Date |
|||
creator: string |
|||
requestTime: Date |
|||
dueTime: Date |
|||
departmentCode: string |
|||
status: string |
|||
updateTime: Date |
|||
updater: string |
|||
autoCommit: string |
|||
autoAgree: string |
|||
autoExecute: string |
|||
directCreateRecord: string |
|||
} |
|||
|
|||
// 查询采购索赔申请主列表
|
|||
export const getPurchaseclaimRequestMainPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return request.post({ url: '/wms/purchaseclaim-request-main/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/purchaseclaim-request-main/page`, params }) |
|||
} |
|||
} |
|||
// 查询采购索赔申请主详情
|
|||
export const getPurchaseclaimRequestMain = async (id: number) => { |
|||
return await request.get({ url: `/wms/purchaseclaim-request-main/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增采购索赔申请主
|
|||
export const createPurchaseclaimRequestMain = async (data: PurchaseclaimRequestMainVO) => { |
|||
return await request.post({ url: `/wms/purchaseclaim-request-main/create`, data }) |
|||
} |
|||
|
|||
// 修改采购索赔申请主
|
|||
export const updatePurchaseclaimRequestMain = async (data: PurchaseclaimRequestMainVO) => { |
|||
return await request.put({ url: `/wms/purchaseclaim-request-main/update`, data }) |
|||
} |
|||
|
|||
// 删除采购索赔申请主
|
|||
export const deletePurchaseclaimRequestMain = async (id: number) => { |
|||
return await request.delete({ url: `/wms/purchaseclaim-request-main/delete?id=` + id }) |
|||
} |
|||
|
|||
// 打开供应商发货申请主
|
|||
export const opePurchaseclaimRequestMain = async (id: number) => { |
|||
return await request.post({ url: `/wms/purchaseclaim-request-main/open?id=` + id }) |
|||
} |
|||
// 关闭供应商发货申请主
|
|||
export const cloPurchaseclaimRequestMain = async (id: number) => { |
|||
return await request.post({ url: `/wms/purchaseclaim-request-main/close?id=` + id }) |
|||
} |
|||
// 提交审批供应商发货申请主
|
|||
export const subPurchaseclaimRequestMain = async (id: number) => { |
|||
return await request.post({ url: `/wms/purchaseclaim-request-main/sub?id=` + id }) |
|||
} |
|||
// 审批通过供应商发货申请主
|
|||
export const appPurchaseclaimRequestMain = async (id: number) => { |
|||
return await request.post({ url: `/wms/purchaseclaim-request-main/app?id=` + id }) |
|||
} |
|||
// 驳回供应商发货申请主
|
|||
export const rejPurchaseclaimRequestMain = async (id: number) => { |
|||
return await request.post({ url: `/wms/purchaseclaim-request-main/rej?id=` + id }) |
|||
} |
|||
// 处理
|
|||
export const genRecordsPurchaseclaimRequestMain = async (id) => { |
|||
return await request.post({ url: `/wms/purchaseclaim-request-main/genRecords?id=` + id }) |
|||
} |
|||
// 导出采购索赔申请主 Excel
|
|||
export const exportPurchaseclaimRequestMain = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = { ...params } |
|||
return await request.downloadPost({ url: `/wms/purchaseclaim-request-main/export-excel-senior`, data }) |
|||
} else { |
|||
return await request.download({ url: `/wms/purchaseclaim-request-main/export-excel`, params }) |
|||
} |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/wms/purchaseclaim-request-main/get-import-template' }) |
|||
} |
@ -0,0 +1,287 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import { |
|||
CustomerStatementMain, |
|||
} from '../../../deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data' |
|||
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain' |
|||
|
|||
// 表单校验
|
|||
export const PurchaseClaimRequestMainRules = reactive({ |
|||
beforeTaxAmount: [required], |
|||
taxRate: [required], |
|||
taxAmount: [required], |
|||
adTaxAmount: [required], |
|||
}) |
|||
|
|||
export const PurchaseClaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '单据号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false, |
|||
// 0:新增1:已发布2已作废
|
|||
}, |
|||
{ |
|||
label: '客户对账单', |
|||
field: 'customerStatementNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
enterSearch: true, |
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本
|
|||
searchField: 'number', // 查询弹窗赋值字段
|
|||
searchTitle: '客户对账单信息', // 查询弹窗标题
|
|||
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
|
|||
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
|
|||
searchCondition: [{ |
|||
key: 'available', |
|||
value: 'TRUE', |
|||
isMainValue: false |
|||
}] |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '客户代码', |
|||
field: 'customer', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '客户名称', |
|||
field: 'customerName', |
|||
sort: 'custom', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '未税金额', |
|||
field: 'beforeTaxAmount', |
|||
sort: 'custom', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '税率(%)', |
|||
field: 'taxRate', |
|||
dictType: DICT_TYPE.TAX_RATE_DICT, |
|||
dictClass: 'string', |
|||
sortTableDefault: 3, |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '税额', |
|||
field: 'taxAmount', |
|||
sort: 'custom', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '价税合计金额', |
|||
field: 'adTaxAmount', |
|||
sort: 'custom', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
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, |
|||
isForm: 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' |
|||
} |
|||
} |
|||
])) |
|||
// 表单校验
|
|||
export const PurchaseClaimRequestDetailRules = reactive({ |
|||
beforeTaxAmount: [required], |
|||
taxRate: [required], |
|||
taxAmount: [required], |
|||
adTaxAmount: [required], |
|||
}) |
|||
|
|||
export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '品番', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false, |
|||
tableForm: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
{ |
|||
label: '品号', |
|||
field: 'articleNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false, |
|||
// 0:新增1:已发布2已作废
|
|||
}, |
|||
{ |
|||
label: '数量', |
|||
field: 'qty', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
enterSearch: true, |
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本
|
|||
searchField: '', // 查询弹窗赋值字段
|
|||
searchTitle: '客户对账单信息', // 查询弹窗标题
|
|||
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
|
|||
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
|
|||
searchCondition: [{ |
|||
key: 'available', |
|||
value: 'TRUE', |
|||
isMainValue: false |
|||
}] |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '销售单价', |
|||
field: 'price', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '模具分摊单价', |
|||
field: 'allocationPrice', |
|||
sort: 'custom', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '合计单价', |
|||
field: 'beforeTaxAmount', |
|||
sort: 'custom', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '未税金额', |
|||
field: 'taxRate', |
|||
sort: 'custom', |
|||
}, |
|||
{ |
|||
label: '税额', |
|||
field: 'taxAmount', |
|||
sort: 'custom', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '含税金额', |
|||
field: 'adTaxAmount', |
|||
sort: 'custom', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
|
|||
])) |
@ -0,0 +1,408 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="[...PurchaseClaimRequestMain.allSchemas.searchSchema,...PurchaseClaimRequestDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="PurchaseClaimRequestMain.allSchemas" |
|||
:detailAllSchemas="PurchaseClaimRequestDetail.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" |
|||
:rules="PurchaseClaimRequestMainRules" |
|||
:formAllSchemas="PurchaseClaimRequestMain.allSchemas" |
|||
:tableAllSchemas="PurchaseClaimRequestDetail.allSchemas" |
|||
:tableFormRules="PurchaseClaimRequestDetailRules" |
|||
:tableData="tableData" |
|||
:apiUpdate="PurchaseClaimRequestMainApi.updatePurchaseClaimRequestMain" |
|||
:apiCreate="PurchaseClaimRequestMainApi.createPurchaseClaimRequestMain" |
|||
:isBusiness="true" |
|||
@handleAddTable="handleAddTable" |
|||
@handleDeleteTable="handleDeleteTable" |
|||
:isShowReduceButtonSelection="true" |
|||
@tableSelectionDelete="tableSelectionDelete" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
@submitForm="submitForm" |
|||
/> |
|||
<!-- 详情 --> |
|||
<Detail |
|||
ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="PurchaseClaimRequestMain.allSchemas" |
|||
:detailAllSchemas="PurchaseClaimRequestDetail.allSchemas" |
|||
:detailAllSchemasRules="PurchaseClaimRequestDetailRules" |
|||
:apiCreate="PurchaseClaimRequestDetailApi.createPurchaseClaimRequestDetail" |
|||
:apiUpdate="PurchaseClaimRequestDetailApi.updatePurchaseClaimRequestDetail" |
|||
:apiPage="PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailPage" |
|||
:apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail" |
|||
/> |
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/wms/deliver-plan-main/import" :importTemplateData="importTemplateData" |
|||
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :extend= "businessType"/> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { PurchaseClaimRequestMain,PurchaseClaimRequestMainRules,PurchaseClaimRequestDetailRules,PurchaseClaimRequestDetail} from './PurchaseClaimRequestMain.data' |
|||
import * as PurchaseClaimRequestMainApi from '@/api/wms/PurchaseClaimRequestMain' |
|||
import * as PurchaseClaimRequestDetailApi from '@/api/wms/purchaseClaimRequestDetail' |
|||
import * as CustomerStatementDetailApi from '@/api/wms/customerStatementDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import { formatDate } from '@/utils/formatTime' |
|||
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|||
const { loadStart, loadDone } = usePageLoading() |
|||
defineOptions({ name: 'purchaseClaimRequestMain' }) |
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const businessType = ref() |
|||
const tableColumns = ref([...PurchaseClaimRequestMain.allSchemas.tableColumns,...PurchaseClaimRequestDetail.allSchemas.tableMainColumns]) |
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: PurchaseClaimRequestMainApi.getPurchaseClaimRequestMainPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
const tableData = ref([]) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
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 |
|||
val.forEach(item=>{ |
|||
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|||
row[formField] = item[searchField] |
|||
newRow['uom'] = item['customerUom'] |
|||
newRow['id'] = item['id'] |
|||
.push(newRow) |
|||
}) |
|||
}else{ |
|||
row[formField] = val[0][searchField] |
|||
} |
|||
// if(formField == 'itemCode') { |
|||
// row['uom'] = val[0]['customerUom'] |
|||
// } |
|||
// 明细查询页赋值 |
|||
|
|||
} else { |
|||
const setV = {} |
|||
if(formField == 'customerStatementNumber') { |
|||
//客户对账单 |
|||
setV['customer'] = val[0]['customerCode'] |
|||
setV['customerName'] = val[0]['customerName'] |
|||
CustomerStatementDetailApi.getCustomerStatementDetailPage({ |
|||
pageNo:1, |
|||
pageNSize: 100, |
|||
masterId:val[0]['id'] |
|||
}).then((res) => { |
|||
console.log(55,res) |
|||
tableData.value = res.list && res.list.length > 0 ?res.list : [] |
|||
}) |
|||
// tableData.value = [] |
|||
|
|||
} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
} |
|||
}) |
|||
} |
|||
// 查询页面返回——详情 |
|||
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
// setV['soLine'] = val[0]['lineNumber'] |
|||
// setV['lineNumber'] = val[0]['lineNumber'] |
|||
// setV['itemCode'] = val[0]['itemCode'] |
|||
setV['remark'] = val[0]['remark'] |
|||
setV['uom'] = val[0]['customerUom'] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:`wms:${routeName.value}:create` }), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:`wms:${routeName.value}:import` }), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:`wms:${routeName.value}: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') { // 刷新 |
|||
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.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:`wms:${routeName.value}:open`}), // 打开 |
|||
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:`wms:${routeName.value}:close`}), // 关闭 |
|||
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:submit`}), // 提交审批 |
|||
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:reject`}), // 驳回 |
|||
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:agree`}), // 审批通过 |
|||
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:`wms:${routeName.value}:publish`}), // 发布 |
|||
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:`wms:${routeName.value}:resetting`}), // 重置 |
|||
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:update`}), // 编辑 |
|||
] |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.masterId) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const formRef = ref() |
|||
const openForm =async (type: string, row?: number) => { |
|||
tableData.value = [] // 重置明细数据 |
|||
formRef.value.open(type, row) |
|||
} |
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue,'planDeliverMain') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
tableObject.loading = true |
|||
// 发起删除 |
|||
await PurchaseClaimRequestMainApi.deletePurchaseClaimRequestMain(id) |
|||
tableObject.loading = false |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
buttonBaseClick('refresh',null) |
|||
} catch {} |
|||
} |
|||
/** 导出按钮操作 */ |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
loadStart() |
|||
const excelTitle = ref(route.meta.title) |
|||
const data = await PurchaseClaimRequestMainApi.exportPurchaseClaimRequestMain(tableObject.params) |
|||
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
|||
} catch { |
|||
} finally { |
|||
loadDone() |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* tableForm方法 |
|||
*/ |
|||
const tableFormKeys = {} |
|||
PurchaseClaimRequestDetail.allSchemas.tableFormColumns.forEach(item => { |
|||
tableFormKeys[item.field] = item.default ? item.default : '' |
|||
}) |
|||
|
|||
// 添加明细 |
|||
const handleAddTable = () => { |
|||
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
|||
} |
|||
// 删除明细 |
|||
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)) |
|||
} |
|||
//为true表示子表数据中存在数量为0的数据 |
|||
const flag = ref(false) |
|||
|
|||
// 主子数据 提交 |
|||
const submitForm = async (formType, submitData) => { |
|||
let data = {...submitData} |
|||
if(data.masterId){ |
|||
data.id = data.masterId |
|||
} |
|||
data.subList = tableData.value // 拼接子表数据参数 |
|||
data.subList.forEach(item=>{ |
|||
item.toWarehouseCode = data.toWarehouseCode |
|||
item.toLocationCode = data.toLocationCode |
|||
}) |
|||
data.businessType = businessType.value |
|||
// 判断是否重复物料 |
|||
let isExist = false |
|||
tableData.value.forEach(item => { |
|||
let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode)) |
|||
if(rs.length > 1) isExist = true |
|||
}) |
|||
if (isExist) { |
|||
formRef.value.formLoading = false |
|||
return message.warning('物料代码重复') |
|||
} |
|||
data.subList.forEach(obj => { |
|||
if(obj.qty == 0){ |
|||
message.error(`数量不能为0!`) |
|||
flag.value = true |
|||
return; |
|||
} |
|||
}) |
|||
if(flag.value){ |
|||
return |
|||
} |
|||
var isHave =PurchaseClaimRequestMain.allSchemas.formSchema.some(function (item) { |
|||
return item.field === 'beginTime' || item.field === 'endTime'; |
|||
}); |
|||
if(isHave){ |
|||
if(data.beginTime && data.endTime && data.beginTime >=data.expireTime){ |
|||
message.error('结束时间要大于开始时间') |
|||
return; |
|||
} |
|||
} |
|||
console.log(data.beginTime) |
|||
if(!data.beginTime)data.beginTime = null; |
|||
if(!data.planDate)data.planDate = null; |
|||
if(!data.endTime)data.endTime = null; |
|||
formRef.value.formLoading = true |
|||
try { |
|||
if (formType === 'create') { |
|||
await PurchaseClaimRequestMainApi.createPurchaseClaimRequestMain(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await PurchaseClaimRequestMainApi.updatePurchaseClaimRequestMain(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
formRef.value.dialogVisible = false |
|||
// 刷新当前列表 |
|||
if (formType === 'create') { |
|||
getList() |
|||
}else{ |
|||
buttonBaseClick('refresh',null) |
|||
} |
|||
} finally { |
|||
formRef.value.formLoading = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
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() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await PurchaseClaimRequestMainApi.importTemplate() |
|||
}) |
|||
</script> |
@ -1,182 +0,0 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="[...PurchaseclaimRecordMain.allSchemas.searchSchema,...PurchaseclaimRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="PurchaseclaimRecordMain.allSchemas" |
|||
:detailAllSchemas="PurchaseclaimRecordDetail.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" |
|||
@success="getList" |
|||
:rules="PurchaseclaimRecordMainRules" |
|||
:formAllSchemas="PurchaseclaimRecordMain.allSchemas" |
|||
:tableAllSchemas="PurchaseclaimRecordDetail.allSchemas" |
|||
:tableFormRules="PurchaseclaimRecordDetailRules" |
|||
:isBusiness="true" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail |
|||
ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="PurchaseclaimRecordMain.allSchemas" |
|||
:detailAllSchemas="PurchaseclaimRecordDetail.allSchemas" |
|||
:detailAllSchemasRules="PurchaseclaimRecordDetailRules" |
|||
:apiPage="PurchaseclaimRecordDetailApi.getPurchaseclaimRecordDetailPage" |
|||
/> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { PurchaseclaimRecordMain,PurchaseclaimRecordMainRules,PurchaseclaimRecordDetail,PurchaseclaimRecordDetailRules } from './purchaseclaimRecordMain.data' |
|||
import * as PurchaseclaimRecordMainApi from '@/api/wms/purchaseclaimRecordMain' |
|||
import * as PurchaseclaimRecordDetailApi from '@/api/wms/purchaseclaimRecordDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|||
import { formatDate } from '@/utils/formatTime' |
|||
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|||
const { loadStart, loadDone } = usePageLoading() |
|||
// 采购索赔记录主 |
|||
defineOptions({ name: 'PurchaseclaimRecordMain' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref([...PurchaseclaimRecordMain.allSchemas.tableColumns,...PurchaseclaimRecordDetail.allSchemas.tableMainColumns]) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: PurchaseclaimRecordDetailApi.getPurchaseclaimRecordDetailPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultExportBtn({hasPermi:'wms:purchaseclaim-record-main:export'}), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == '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 butttondata = (row,$index) => { |
|||
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|||
if(findIndex>-1&&findIndex<$index){ |
|||
return [] |
|||
} |
|||
return [] |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, 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,"recordPurchaseclaimMain") |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
loadStart() |
|||
const excelTitle = ref(route.meta.title) |
|||
const data = await PurchaseclaimRecordMainApi.exportPurchaseclaimRecordMain(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> |
@ -1,382 +0,0 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime' |
|||
|
|||
/** |
|||
* @returns {Array} 采购索赔记录主表 |
|||
*/ |
|||
export const PurchaseclaimRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '单据号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180, |
|||
fixed: 'left' |
|||
}, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '申请单号', |
|||
field: 'requestNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '发货单号', |
|||
field: 'asnNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '要货计划单号', |
|||
field: 'ppNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '供应商代码', |
|||
field: 'supplierCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '出库事务类型', |
|||
field: 'outTransactionType', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '入库事务类型', |
|||
field: 'inTransactionType', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '执行时间', |
|||
field: 'executeTime', |
|||
isTable: true, |
|||
formatter: dateFormatter, |
|||
deatil: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '生效日期', |
|||
field: 'activeDate', |
|||
isTable: true, |
|||
formatter: dateFormatter2, |
|||
deatil: { |
|||
dateFormat: 'YYYY-MM-DD' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '申请时间', |
|||
field: 'requestTime', |
|||
isTable: true, |
|||
formatter: dateFormatter, |
|||
deatil: { |
|||
dateFormatter: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '截止时间', |
|||
field: 'dueTime', |
|||
isTable: true, |
|||
formatter: dateFormatter, |
|||
deatil: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '部门', |
|||
field: 'departmentCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '代码', |
|||
field: 'code', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '接口类型', |
|||
field: 'interfaceType', |
|||
dictType: DICT_TYPE.INTERFACE_TYPE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '是否可用', |
|||
field: 'available', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
isTable: true, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form:{ |
|||
component:'Switch', |
|||
componentProps:{ |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
// {
|
|||
// label: '创建者',
|
|||
// field: 'creator',
|
|||
// sort: 'custom',
|
|||
// table: {
|
|||
// width: 150
|
|||
// }
|
|||
// },
|
|||
// {
|
|||
// label: '创建时间',
|
|||
// field: 'createTime',
|
|||
// isTable: true,
|
|||
// formatter: dateFormatter,
|
|||
// detail: {
|
|||
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
|
|||
// },
|
|||
// sort: 'custom',
|
|||
// table: {
|
|||
// width: 180
|
|||
// }
|
|||
// },
|
|||
])) |
|||
|
|||
//表单校验
|
|||
export const PurchaseclaimRecordMainRules = reactive({ |
|||
requestNumber: [ |
|||
{ required: true, message: '请选择申请单号', trigger: 'change' } |
|||
], |
|||
supplierCode: [ |
|||
{ required: true, message: '请选择供应商代码', trigger: 'change' } |
|||
], |
|||
outTransaction: [ |
|||
{ required: true, message: '请输入出库事务类型', trigger: 'blur' } |
|||
], |
|||
inTransaction: [ |
|||
{ required: true, message: '请输入入库事务类型', trigger: 'blur' } |
|||
], |
|||
executeTime: [ |
|||
{ required: true, message: '请输入执行时间', trigger: 'blur' } |
|||
], |
|||
activeDate: [ |
|||
{ required: true, message: '请输入生效日期', trigger: 'blur' } |
|||
], |
|||
available: [ |
|||
{ required: true, message: '请输入是否可用', trigger: 'blur' } |
|||
], |
|||
departmentCode: [ |
|||
{ required: true, message: '请输入部门', trigger: 'blur' } |
|||
], |
|||
interfaceType: [ |
|||
{ required: true, message: '请选择接口类型', trigger: 'change' } |
|||
], |
|||
number: [ |
|||
{ required: true, message: '请输入单据号', trigger: 'blur' } |
|||
], |
|||
businessType: [ |
|||
{ required: true, message: '请输入业务类型', trigger: 'blur' } |
|||
], |
|||
createTime: [ |
|||
{ required: true, message: '请输入创建时间', trigger: 'blur' } |
|||
], |
|||
creator: [ |
|||
{ required: true, message: '请输入创建者', trigger: 'blur' } |
|||
], |
|||
}) |
|||
|
|||
/** |
|||
* @returns {Array} 采购索赔记录子表 |
|||
*/ |
|||
export const PurchaseclaimRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '批次', |
|||
field: 'batch', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '订单号', |
|||
field: 'poNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '订单行', |
|||
field: 'poLine', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '原因', |
|||
field: 'reason', |
|||
isTable: true, |
|||
dictClass: 'string', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '单价', |
|||
field: 'singlePrice', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
} |
|||
}, |
|||
{ |
|||
label: '金额', |
|||
field: 'amount', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
} |
|||
}, |
|||
{ |
|||
label: '单据号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '代码', |
|||
field: 'code', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '是否可用', |
|||
field: 'available', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form:{ |
|||
component:'Switch', |
|||
componentProps:{ |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建者', |
|||
field: 'creator', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
isTable: true, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
}, |
|||
}, |
|||
}, |
|||
])) |
|||
|
|||
//表单校验
|
|||
export const PurchaseclaimRecordDetailRules = reactive({ |
|||
batch: [ |
|||
{ required: true, message: '请输入批次', trigger: 'blur' } |
|||
], |
|||
poNumber: [ |
|||
{ required: true, message: '请选择订单号', trigger: 'change' } |
|||
], |
|||
poLine: [ |
|||
{ required: true, message: '请输入订单行', trigger: 'blur' } |
|||
], |
|||
reason: [ |
|||
{ required: true, message: '请输入原因', trigger: 'blur' } |
|||
], |
|||
number: [ |
|||
{ required: true, message: '请输入单据号', trigger: 'blur' } |
|||
], |
|||
itemCode: [ |
|||
{ required: true, message: '请选择物料代码', trigger: 'change' } |
|||
], |
|||
createTime: [ |
|||
{ required: true, message: '请输入创建时间', trigger: 'blur' } |
|||
], |
|||
creator: [ |
|||
{ required: true, message: '请输入创建者', trigger: 'blur' } |
|||
], |
|||
}) |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue