YEJIAXING-PC\lenovo
1 month ago
8 changed files with 0 additions and 1954 deletions
@ -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' }) |
|||
} |
@ -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' } |
|||
], |
|||
}) |
@ -1,518 +0,0 @@ |
|||
<!-- 采购索赔申请 --> |
|||
<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" |
|||
:rules="PurchaseclaimRequestMainRules" |
|||
:formAllSchemas="PurchaseclaimRequestMain.allSchemas" |
|||
:tableAllSchemas="PurchaseclaimRequestDetail.allSchemas" |
|||
:tableFormRules="PurchaseclaimRequestDetailRules" :tableData="tableData" |
|||
:apiUpdate="PurchaseclaimRequestMainApi.updatePurchaseclaimRequestMain" |
|||
:apiCreate="PurchaseclaimRequestMainApi.createPurchaseclaimRequestMain" |
|||
:isBusiness="true" |
|||
@success="getList" |
|||
@handleAddTable="handleAddTable" |
|||
@handleDeleteTable="handleDeleteTable" |
|||
:isShowReduceButtonSelection="true" |
|||
@tableSelectionDelete="tableSelectionDelete" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
@submitForm="submitForm" |
|||
@inputStringBlur="inputStringBlur"/> |
|||
|
|||
<!-- 详情 --> |
|||
<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" |
|||
@searchTableSuccessDetail="searchTableSuccessDetail" |
|||
/> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/wms/purchaseclaim-request-main/import" :importTemplateData="importTemplateData" |
|||
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { getAccessToken } from '@/utils/auth' |
|||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|||
import download from '@/utils/download' |
|||
import * as PurchaseclaimRequestMainApi from '@/api/wms/purchaseclaimRequestMain' |
|||
import * as SupplierdeliverRecordDetailApi from '@/api/wms/supplierdeliverRecordDetail' |
|||
import * as PurchaseclaimRequestDetailApi from '@/api/wms/purchaseclaimRequestDetail' |
|||
import { PurchaseclaimRequestMain, PurchaseclaimRequestMainRules, PurchaseclaimRequestDetail, PurchaseclaimRequestDetailRules } from './purchaseclaimRequestMain.data' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
import { getJmreportBaseUrl } from '@/utils/systemParam' |
|||
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 tableColumns = ref([...PurchaseclaimRequestMain.allSchemas.tableColumns,...PurchaseclaimRequestDetail.allSchemas.tableMainColumns]) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|||
|
|||
nextTick(() => { |
|||
if (type == 'tableForm') { |
|||
|
|||
// 子表查询页赋值 |
|||
row[formField] = val[0][searchField] |
|||
row['poLine'] = val[0]['poLine'] |
|||
row['batch'] = val[0]['toBatch'] |
|||
row['altBatch'] = val[0]['altBatch'] |
|||
row['itemCode'] = val[0]['itemCode'] |
|||
row['itemName'] = val[0]['itemName'] |
|||
row['itemDesc1'] = val[0]['itemDesc1'] |
|||
row['itemDesc2'] = val[0]['itemDesc2'] |
|||
row['projectCode'] = val[0]['projectCode'] |
|||
row['qty'] = val[0]['qty'] |
|||
row['uom'] = val[0]['uom'] |
|||
} else { |
|||
// 主表查询页赋值 |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
if(formField=='asnNumber'){ |
|||
// 获取子表数据 getSupplierdeliverRecordDetailList |
|||
SupplierdeliverRecordDetailApi.getSupplierdeliverRecordDetailList({ |
|||
asnNumber: val[0]['asnNumber']}).then(res => { |
|||
if (res) tableData.value = res; |
|||
tableData.value.forEach(item=>{ |
|||
item.batch = item.toBatch |
|||
item.qty = 1 |
|||
}) |
|||
}).catch(err => { |
|||
console.log(err) |
|||
}) |
|||
} |
|||
setV['ppNumber'] = val[0]['ppNumber'] |
|||
setV['supplierCode'] = val[0]['supplierCode'] |
|||
formRef.setValues(setV) |
|||
} |
|||
}) |
|||
} |
|||
// 查询页面返回——详情 |
|||
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|||
console.log(456) |
|||
nextTick(() => { |
|||
|
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
setV['poLine'] = val[0]['poLine'] |
|||
setV['batch'] = val[0]['toBatch'] |
|||
setV['altBatch'] = val[0]['altBatch'] |
|||
setV['itemCode'] = val[0]['itemCode'] |
|||
setV['itemName'] = val[0]['itemName'] |
|||
setV['itemDesc1'] = val[0]['itemDesc1'] |
|||
setV['itemDesc2'] = val[0]['itemDesc2'] |
|||
setV['projectCode'] = val[0]['projectCode'] |
|||
setV['qty'] = val[0]['qty'] |
|||
setV['uom'] = val[0]['uom'] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: PurchaseclaimRequestDetailApi.getPurchaseclaimRequestDetailPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({ hasPermi: 'wms:purchaseclaim-request-main:create' }), // 新增 |
|||
defaultButtons.defaultImportBtn({ hasPermi: 'wms:purchaseclaim-request-main:import' }), // 导入 |
|||
defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchaseclaim-request-main:export' }), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
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 [ |
|||
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), // 打开 |
|||
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2', '4']) }), // 关闭 |
|||
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), // 提交审批 |
|||
defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), // 审批通过 |
|||
defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), // 驳回按钮 |
|||
defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:purchaseclaim-request-main:update' }), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:purchaseclaim-request-main:delete' }), // 删除 |
|||
defaultButtons.mainListDocumentPrintBtn(null), // 打印 |
|||
// 生成记录 |
|||
{ |
|||
label: '处理', |
|||
name: 'genRecords', |
|||
hide: isShowMainButton(row, ['3']), |
|||
type: 'primary', |
|||
icon: '', |
|||
color: '', |
|||
hasPermi: '', |
|||
link: true, // 文本展现按钮 |
|||
}, |
|||
] |
|||
} |
|||
|
|||
// 根据状态返回该按钮是否显示 |
|||
const isShowMainButton = (row, val) => { |
|||
if (val.indexOf(row.status) > -1) { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'mainPurPlanOpe') { // 打开 |
|||
handleOpe(row.id) |
|||
} else if (val == 'mainPurPlanClo') {// 关闭 |
|||
handleClo(row.id) |
|||
} else if (val == 'mainPlanSub') { // 提交审批 |
|||
handleSub(row.id) |
|||
} else if (val == 'mainPlanApp') { // 审批通过 |
|||
handleApp(row.id) |
|||
} else if (val == 'mainPlanTur') { // 驳回按钮 |
|||
handleTur(row.id) |
|||
}else if (val == 'genRecords') { // 驳回按钮 |
|||
genRecords(row.id) |
|||
}else if (val == 'edit') { // 编辑 |
|||
// const res = await ItempackagingApi.getItempackaging(row.id) |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} else if (val == 'documentPrint') { // 打印 |
|||
handlePoint(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const formRef = ref() |
|||
const openForm = async (type : string, row ?: number) => { |
|||
tableData.value = [] // 重置明细数据 |
|||
// if (row?.id) { |
|||
// const data= await PurchaseclaimRequestMainApi.getPurchaseclaimRequestMain(row.id) |
|||
// tableData.value = data.subList |
|||
// } |
|||
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,"requestPurchaseclaimMain") |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id : number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
tableObject.loading = true |
|||
// 发起删除 |
|||
await PurchaseclaimRequestMainApi.deletePurchaseclaimRequestMain(id) |
|||
message.success(t('common.delSuccess')) |
|||
tableObject.loading = false |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch { }finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
|
|||
/** 关闭按钮操作 */ |
|||
const handleClo = async (id : number) => { |
|||
try { |
|||
// 关闭的二次确认 |
|||
await message.confirm(t('ts.是否关闭所选中数据?')) |
|||
tableObject.loading = true |
|||
// 发起关闭 |
|||
await PurchaseclaimRequestMainApi.cloPurchaseclaimRequestMain(id) |
|||
message.success(t('ts.关闭成功!')) |
|||
tableObject.loading = false |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch { }finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 打开按钮操作 */ |
|||
const handleOpe = async (id : number) => { |
|||
try { |
|||
// 打开的二次确认 |
|||
await message.confirm(t('ts.是否打开所选中数据?')) |
|||
tableObject.loading = true |
|||
// 发起打开 |
|||
await PurchaseclaimRequestMainApi.opePurchaseclaimRequestMain(id) |
|||
message.success(t('ts.打开成功!')) |
|||
tableObject.loading = false |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch { }finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 提交审批按钮操作 */ |
|||
const handleSub = async (id : number) => { |
|||
try { |
|||
// 提交审批的二次确认 |
|||
await message.confirm(t('ts.是否提交审批所选中数据?')) |
|||
tableObject.loading = true |
|||
// 发起提交审批 |
|||
await PurchaseclaimRequestMainApi.subPurchaseclaimRequestMain(id) |
|||
message.success(t('ts.提交审批成功!')) |
|||
tableObject.loading = false |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch { }finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 审批通过按钮操作 */ |
|||
const handleApp = async (id : number) => { |
|||
try { |
|||
// 审批通过的二次确认 |
|||
await message.confirm(t('ts.是否审批通过所选中数据?')) |
|||
tableObject.loading = true |
|||
// 发起审批通过 |
|||
await PurchaseclaimRequestMainApi.appPurchaseclaimRequestMain(id) |
|||
message.success(t('ts.审批通过成功!')) |
|||
tableObject.loading = false |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch { }finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 驳回按钮操作 */ |
|||
const handleTur = async (id : number) => { |
|||
try { |
|||
// 驳回的二次确认 |
|||
await message.confirm(t('ts.是否驳回所选中数据?')) |
|||
tableObject.loading = true |
|||
// 发起驳回 |
|||
await PurchaseclaimRequestMainApi.rejPurchaseclaimRequestMain(id) |
|||
message.success(t('ts.驳回成功!')) |
|||
tableObject.loading = false |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch { }finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 处理按钮操作 */ |
|||
const genRecords = async (id : number) => { |
|||
try { |
|||
// 处理的二次确认 |
|||
await message.confirm(t('ts.是否处理所选中数据?')) |
|||
tableObject.loading = true |
|||
// 发起处理 |
|||
await PurchaseclaimRequestMainApi.genRecordsPurchaseclaimRequestMain(id) |
|||
message.success(t('ts.处理成功!')) |
|||
tableObject.loading = false |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch { }finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
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() |
|||
} |
|||
} |
|||
|
|||
const BASE_URL = getJmreportBaseUrl() |
|||
const src = ref(BASE_URL + '/jmreport/view/882550592342003712?token=' + getAccessToken()) |
|||
console.log(src) |
|||
// 打印 |
|||
const handlePoint = async (id) => { |
|||
window.open(src.value + '&id=' + id) |
|||
} |
|||
/** |
|||
* tableForm方法 |
|||
*/ |
|||
const tableFormKeys = {} |
|||
PurchaseclaimRequestDetail.allSchemas.tableFormColumns.forEach(item => { |
|||
tableFormKeys[item.field] = item.default ? item.default : '' |
|||
}) |
|||
const tableData = ref([]) |
|||
|
|||
// 添加明细 |
|||
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)) |
|||
} |
|||
|
|||
// 主子数据 提交 |
|||
const submitForm = async (formType, submitData) => { |
|||
let data = {...submitData} |
|||
if(data.masterId){ |
|||
data.id = data.masterId |
|||
} |
|||
data.subList = tableData.value // 拼接子表数据参数 |
|||
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 |
|||
// 刷新当前列表 |
|||
getList() |
|||
} 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() // 刷新当前列表 |
|||
} |
|||
const inputStringBlur =(headerItem,index,row) =>{ |
|||
// console.log("headerItem:",headerItem) |
|||
//console.log("row:",row) |
|||
if(headerItem == 'singlePrice'){ |
|||
// 输入完单价离开事件(金额 = 数量 乘以 单价) |
|||
row.amount = row.qty * row.singlePrice |
|||
} |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await PurchaseclaimRequestMainApi.importTemplate() |
|||
}) |
|||
</script> |
@ -1,597 +0,0 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import * as getRequestsettingApi from '@/api/wms/requestsetting/index' |
|||
|
|||
import * as supplierdeliverRecordMainApi from '@/api/wms/supplierdeliverRecordMain' |
|||
import * as supplierdeliverRecordDetailApi from '@/api/wms/supplierdeliverRecordDetail' |
|||
import { SupplierdeliverRecordMain, SupplierdeliverRecordDetail } from '@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/supplierdeliverRecordMain.data' |
|||
|
|||
|
|||
|
|||
const { t } = useI18n() // 国际化
|
|||
|
|||
// 获取当前操作人的部门
|
|||
import { useUserStore } from '@/store/modules/user' |
|||
import { TableColumn } from '@/types/table' |
|||
const userStore = useUserStore() |
|||
const userDept = userStore.userSelfInfo.dept |
|||
// id 转str 否则form回显匹配不到
|
|||
userDept.id = userDept.id.toString() |
|||
const userDeptArray:any = [userDept] |
|||
|
|||
|
|||
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
|
|||
const queryParams = { |
|||
pageSize:10, |
|||
pageNo:1, |
|||
code:'PurchaseClaimRequest' |
|||
} |
|||
const data = await getRequestsettingApi.getRequestsettingPage(queryParams) |
|||
const requestsettingData =data?.list[0]||{} |
|||
|
|||
/** |
|||
* @returns {Array} 采购索赔申请主表 |
|||
*/ |
|||
export const PurchaseclaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '单据号', |
|||
field: 'number', |
|||
isForm:false, |
|||
table: { |
|||
width: 180, |
|||
fixed: 'left' |
|||
}, |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '发货单号', |
|||
field: 'asnNumber', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
// labelMessage: '信息提示说明!!!',
|
|||
componentProps: { |
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择发货单号', // 输入框占位文本
|
|||
searchField: 'asnNumber', // 查询弹窗赋值字段
|
|||
searchTitle: '供应商发货记录', // 查询弹窗标题
|
|||
searchAllSchemas: SupplierdeliverRecordMain.allSchemas, // 查询弹窗所需类
|
|||
searchPage: supplierdeliverRecordMainApi.getSupplierdeliverRecordMainPage, // 查询弹窗所需分页方法
|
|||
searchCondition: [{ |
|||
key: 'available', |
|||
value: 'TRUE', |
|||
isMainValue: false |
|||
}] |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '要货计划单号', |
|||
field: 'ppNumber', |
|||
form:{ |
|||
componentProps:{ |
|||
disabled:true, |
|||
} |
|||
}, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '供应商代码', |
|||
field: 'supplierCode', |
|||
form:{ |
|||
componentProps:{ |
|||
disabled:true, |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
dictType: DICT_TYPE.REQUEST_STATUS, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
isTable: true, |
|||
isForm:false, |
|||
form: { |
|||
value:'1', |
|||
componentProps:{ |
|||
disabled:true, |
|||
} |
|||
}, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: '申请时间', |
|||
field: 'requestTime', |
|||
formatter: dateFormatter, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '截止时间', |
|||
field: 'dueTime', |
|||
formatter: dateFormatter, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '部门', |
|||
field: 'departmentCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return userDeptArray.find((account) => account.id == cellValue)?.name |
|||
}, |
|||
form: { |
|||
value: userDept.id, |
|||
component: 'Select', |
|||
api: () => userDeptArray, |
|||
componentProps: { |
|||
disabled: true, |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'id' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '业务类型', |
|||
field: 'businessType', |
|||
form:{ |
|||
value:'PurchaseClaim', |
|||
componentProps:{ |
|||
disabled:true, |
|||
} |
|||
}, |
|||
table: { |
|||
width: 130 |
|||
} |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
isTable: false |
|||
}, |
|||
{ |
|||
label: '自动提交', |
|||
field: 'autoCommit', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
isForm:false, |
|||
table: { |
|||
width: 100 |
|||
}, |
|||
form:{ |
|||
component:'Switch', |
|||
value:requestsettingData.autoCommit, |
|||
componentProps:{ |
|||
disabled:true, |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '自动通过', |
|||
field: 'autoAgree', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
isForm:false, |
|||
table: { |
|||
width: 100 |
|||
}, |
|||
form:{ |
|||
component:'Switch', |
|||
value:requestsettingData.autoAgree, |
|||
componentProps:{ |
|||
disabled:true, |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '自动执行', |
|||
field: 'autoExecute', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
isForm:false, |
|||
table: { |
|||
width: 100 |
|||
}, |
|||
form:{ |
|||
component:'Switch', |
|||
value:requestsettingData.autoExecute, |
|||
componentProps:{ |
|||
disabled:true, |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '直接生成记录', |
|||
field: 'directCreateRecord', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isSearch: false, |
|||
isForm: false, |
|||
isTable: false, |
|||
table: { |
|||
width: 120 |
|||
}, |
|||
form:{ |
|||
component:'Switch', |
|||
value:requestsettingData.available, |
|||
componentProps:{ |
|||
disabled:true, |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建者', |
|||
field: 'creator', |
|||
isForm:false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
isTable: true, |
|||
formatter: dateFormatter, |
|||
isForm:false, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
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')] |
|||
}, |
|||
}, |
|||
}, |
|||
{ |
|||
label: '最后更新者', |
|||
field: 'updater', |
|||
isForm:false, |
|||
isTable: false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: '最后更新时间', |
|||
field: 'updateTime', |
|||
isTable: false, |
|||
formatter: dateFormatter, |
|||
isForm:false, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isDetail: false, |
|||
isForm: false , |
|||
table: { |
|||
width: 300, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
|||
// 表单校验
|
|||
export const PurchaseclaimRequestMainRules = reactive({ |
|||
asnNumber: [ |
|||
{ required: true, message: '请输入发货单号', trigger: 'blur' } |
|||
], |
|||
ppNumber: [ |
|||
{ required: true, message: '请输入要货计划单号', trigger: 'blur' } |
|||
], |
|||
supplierCode: [ |
|||
{ required: true, message: '请输入供应商代码', trigger: 'change' } |
|||
], |
|||
businessType: [ |
|||
{ required: true, message: '请输入业务类型', trigger: 'change' } |
|||
], |
|||
requestTime: [ |
|||
{ required: true, message: '请选择申请时间', trigger: 'change' } |
|||
], |
|||
// dueTime: [
|
|||
// { required: true, message: '请选择截止时间', trigger: 'change' }
|
|||
// ],
|
|||
departmentCode: [ |
|||
{ required: true, message: '请选择部门', trigger: 'change' } |
|||
], |
|||
status: [ |
|||
{ required: true, message: '请选择状态', trigger: 'change' } |
|||
], |
|||
remark: [ |
|||
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|||
], |
|||
}) |
|||
|
|||
/** |
|||
* @returns {Array} 采购索赔申请子表 |
|||
*/ |
|||
export const PurchaseclaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '订单号', |
|||
field: 'poNumber', |
|||
tableForm:{ |
|||
isInpuFocusShow: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择订单号', |
|||
searchField: 'poNumber', |
|||
searchTitle: '供应商发货记录', |
|||
searchAllSchemas: SupplierdeliverRecordDetail.allSchemas, |
|||
searchPage: supplierdeliverRecordDetailApi.getSupplierdeliverRecordDetailPage |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
// labelMessage: '信息提示说明!!!',
|
|||
componentProps: { |
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择订单号', |
|||
searchField: 'poNumber', |
|||
searchTitle: '供应商发货记录', |
|||
searchAllSchemas: SupplierdeliverRecordDetail.allSchemas, |
|||
searchPage: supplierdeliverRecordDetailApi.getSupplierdeliverRecordDetailPage |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '订单行', |
|||
field: 'poLine', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '批次', |
|||
field: 'batch', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '物料代码', |
|||
field: 'itemCode', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
|
|||
}, |
|||
{ |
|||
label: '物料名称', |
|||
field: 'itemName', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '数量', |
|||
field: 'qty', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '计量单位', |
|||
field: 'uom', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.UOM, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
isTable: true, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm: { |
|||
type: 'Select' |
|||
} |
|||
}, |
|||
{ |
|||
label: '单价', |
|||
field: 'singlePrice', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '金额', |
|||
field: 'amount', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '原因', |
|||
field: 'reason', |
|||
// dictType: DICT_TYPE.PURCHASE_RETURN_REASON,
|
|||
dictClass: 'string', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
|
|||
{ |
|||
label: '单据号', |
|||
field: 'number', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form:{ |
|||
componentProps:{ |
|||
disabled:true, |
|||
} |
|||
}, |
|||
isTableForm:false, |
|||
// tableForm:{
|
|||
// disabled:true,
|
|||
// }
|
|||
}, |
|||
|
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '创建者', |
|||
field: 'creator', |
|||
isTableForm:false, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isForm:false |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
isTable: true, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
isTableForm:false, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isForm:false |
|||
}, |
|||
{ |
|||
label: '最后更新者', |
|||
field: 'updater', |
|||
isTableForm:false, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isForm:false |
|||
}, |
|||
{ |
|||
label: '最后更新时间', |
|||
field: 'updateTime', |
|||
isTable: true, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
isTableForm:false, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isForm:false |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
hiddenInMain:true, |
|||
field: 'action', |
|||
isDetail: false, |
|||
isForm: false , |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
}, |
|||
isTableForm:false, |
|||
} |
|||
])) |
|||
|
|||
// 表单校验
|
|||
export const PurchaseclaimRequestDetailRules = reactive({ |
|||
poNumber: [ |
|||
{ required: true, message: '请输入订单号', trigger: 'change' } |
|||
], |
|||
poLine: [ |
|||
{ required: true, message: '请输入订单行', trigger: 'change' }, |
|||
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|||
], |
|||
qty: [ |
|||
{ required: true, message: '请输入数量', trigger: 'blur' }, |
|||
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|||
], |
|||
uom: [ |
|||
{ required: true, message: '请输入计量单位', trigger: 'change' } |
|||
], |
|||
itemCode: [ |
|||
{ required: true, message: '请输入物料代码', trigger: 'change' }, |
|||
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|||
], |
|||
itemName: [ |
|||
{ required: true, message: '请输入物料名称', trigger: 'blur' }, |
|||
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|||
], |
|||
batch: [ |
|||
{ required: true, message: '请输入批次', trigger: 'blur' }, |
|||
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|||
], |
|||
|
|||
singlePrice: [ |
|||
{ required: true, message: '请输入单价', trigger: 'change' } |
|||
], |
|||
amount: [ |
|||
{ required: true, message: '请输入金额', trigger: 'change' } |
|||
], |
|||
reason: [ |
|||
{ required: true, message: '请输入原因', trigger: 'change' }, |
|||
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|||
], |
|||
remark: [ |
|||
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|||
], |
|||
}) |
Loading…
Reference in new issue