Browse Source

采购收货记录

master
陈薪名 1 year ago
parent
commit
3af3fcf72f
  1. 90
      src/api/wms/purchasereceiptRecordDetail/index.ts
  2. 75
      src/api/wms/purchasereceiptRecordMain/index.ts
  3. 165
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue
  4. 831
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data.ts

90
src/api/wms/purchasereceiptRecordDetail/index.ts

@ -0,0 +1,90 @@
import request from '@/config/axios'
export interface PurchasereceiptRecordDetailVO {
fromPackingNumber: string
toPackingNumber: string
fromContainerNumber: string
toContainerNumber: string
fromBatch: string
altBatch: string
arriveDate: Date
produceDate: Date
expireDate: Date
inventoryStatus: string
fromLocationCode: string
toLocationCode: string
fromLocationGroupCode: string
toLocationGroupCode: string
fromAreaCodes: string
toAreaCodes: string
poNumber: string
poLine: string
stdPackQty: number
stdPackUnit: string
qty: number
uom: string
supplierQty: number
supplierUom: string
convertRate: number
visualInspectResult: string
visualInspectPhotos: string
failedReason: string
singlePrice: number
amount: number
jobDetailId: string
itemCode: string
itemName: string
itemDesc1: string
itemDesc2: string
number: string
remark: string
createTime: Date
creator: string
projectCode: string
code: string
interfaceType: string
fromOwnerCode: string
toOwnerCode: string
toBatch: string
}
// 查询采购收货记录子列表
export const getPurchasereceiptRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchasereceipt-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/purchasereceipt-record-detail/page`, params })
}
}
// 查询采购收货记录子详情
export const getPurchasereceiptRecordDetail = async (id: number) => {
return await request.get({ url: `/wms/purchasereceipt-record-detail/get?id=` + id })
}
// 新增采购收货记录子
export const createPurchasereceiptRecordDetail = async (data: PurchasereceiptRecordDetailVO) => {
return await request.post({ url: `/wms/purchasereceipt-record-detail/create`, data })
}
// 修改采购收货记录子
export const updatePurchasereceiptRecordDetail = async (data: PurchasereceiptRecordDetailVO) => {
return await request.put({ url: `/wms/purchasereceipt-record-detail/update`, data })
}
// 删除采购收货记录子
export const deletePurchasereceiptRecordDetail = async (id: number) => {
return await request.delete({ url: `/wms/purchasereceipt-record-detail/delete?id=` + id })
}
// 导出采购收货记录子 Excel
export const exportPurchasereceiptRecordDetail = async (params) => {
return await request.download({ url: `/wms/purchasereceipt-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchasereceipt-record-detail/get-import-template' })
}

75
src/api/wms/purchasereceiptRecordMain/index.ts

@ -0,0 +1,75 @@
import request from '@/config/axios'
export interface PurchasereceiptRecordMainVO {
requestNumber: string
jobNumber: string
asnNumber: string
ppNumber: string
supplierCode: string
toDockCode: string
carrierCode: string
transferMode: string
vehiclePlateNumber: string
fromWarehouseCode: string
toWarehouseCode: string
outTransaction: string
inTransaction: 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
fromLocationTypes: string
toLocationTypes: string
fromAreaCodes: string
toAreaCodes: string
available: string
}
// 查询采购收货记录主列表
export const getPurchasereceiptRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchasereceipt-record-main/senior', data })
} else {
return await request.get({ url: `/wms/purchasereceipt-record-main/page`, params })
}
}
// 查询采购收货记录主详情
export const getPurchasereceiptRecordMain = async (id: number) => {
return await request.get({ url: `/wms/purchasereceipt-record-main/get?id=` + id })
}
// 新增采购收货记录主
export const createPurchasereceiptRecordMain = async (data: PurchasereceiptRecordMainVO) => {
return await request.post({ url: `/wms/purchasereceipt-record-main/create`, data })
}
// 修改采购收货记录主
export const updatePurchasereceiptRecordMain = async (data: PurchasereceiptRecordMainVO) => {
return await request.put({ url: `/wms/purchasereceipt-record-main/update`, data })
}
// 删除采购收货记录主
export const deletePurchasereceiptRecordMain = async (id: number) => {
return await request.delete({ url: `/wms/purchasereceipt-record-main/delete?id=` + id })
}
// 导出采购收货记录主 Excel
export const exportPurchasereceiptRecordMain = async (params) => {
return await request.download({ url: `/wms/purchasereceipt-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchasereceipt-record-main/get-import-template' })
}

165
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue

@ -0,0 +1,165 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PurchasereceiptRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchasereceiptRecordMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="PurchasereceiptRecordMainRules"
:formAllSchemas="PurchasereceiptRecordMain.allSchemas"
:tableAllSchemas="PurchasereceiptRecordDetail.allSchemas"
:tableFormRules="PurchasereceiptRecordDetailRules"
:isBusiness="true"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="PurchasereceiptRecordMain.allSchemas"
:detailAllSchemas="PurchasereceiptRecordDetail.allSchemas"
:detailAllSchemasRules="PurchasereceiptRecordDetailRules"
:apiPage="PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PurchasereceiptRecordMain,PurchasereceiptRecordMainRules,PurchasereceiptRecordDetail,PurchasereceiptRecordDetailRules } from './purchasereceiptRecordMain.data'
import * as PurchasereceiptRecordMainApi from '@/api/wms/purchasereceiptRecordMain'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
//
defineOptions({ name: 'PurchasereceiptRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PurchasereceiptRecordMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: PurchasereceiptRecordMainApi.getPurchasereceiptRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-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') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = (row) => {
return []
}
// -
const buttonTableClick = async (val, row) => {
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMain(setSearchParams)
download.excel(data, '采购收货记录主.xls')
} catch {
} finally {
exportLoading.value = false
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

831
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data.ts

@ -0,0 +1,831 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
/**
* @returns {Array}
*/
export const PurchasereceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '任务单号',
field: 'jobNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '发货单号',
field: 'asnNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '要货计划单号',
field: 'ppNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到月台代码',
field: 'toDockCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '承运商',
field: 'carrierCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '运输方式',
field: 'transferMode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '车牌号',
field: 'vehiclePlateNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位类型范围',
field: 'fromLocationTypes',
dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库位类型范围',
field: 'toLocationTypes',
dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
table: {
width: 150
},
},
{
label: '出库事务类型',
field: 'outTransaction',
sort: 'custom',
table: {
width: 150
},
},
{
label: '入库事务类型',
field: 'inTransaction',
sort: 'custom',
table: {
width: 150
},
},
{
label: '执行时间',
field: 'executeTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '生效日期',
field: 'activeDate',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '截止时间',
field: 'dueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
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',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
}
]))
// 表单校验
export const PurchasereceiptRecordMainRules = reactive({
requestNumber: [required],
supplierCode: [required],
toWarehouseCode: [required],
outTransaction: [required],
inTransaction: [required],
executeTime: [required],
activeDate: [required],
toLocationTypes: [required],
available: [required],
})
/**
* @returns {Array}
*/
export const PurchasereceiptRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '从包装号',
field: 'fromPackingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到包装号',
field: 'toPackingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从器具号',
field: 'fromContainerNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到器具号',
field: 'toContainerNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从批次',
field: 'fromBatch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到批次',
field: 'toBatch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '替代批次',
field: 'altBatch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到货日期',
field: 'arriveDate',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '生产日期',
field: 'produceDate',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '过期日期',
field: 'expireDate',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位组代码',
field: 'fromLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库位组代码',
field: 'toLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库区代码',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库区代码',
field: 'toAreaCodes',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150
},
},
{
label: '标包数量',
field: 'stdPackQty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '标包单位',
field: 'stdPackUnit',
dictType: DICT_TYPE.PACK_UNIT,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '供应商计量数量',
field: 'supplierQty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '供应商计量单位',
field: 'supplierUom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '转换率',
field: 'convertRate',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '目检结果',
field: 'visualInspectResult',
sort: 'custom',
table: {
width: 150
},
},
{
label: '目检照片',
field: 'visualInspectPhotos',
sort: 'custom',
table: {
width: 150
},
},
{
label: '不合格原因',
field: 'failedReason',
dictType: DICT_TYPE.PURCHASE_RETURN_REASON,
dictClass: 'string',
isSearch: true,
isTable: true,
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: '任务明细ID',
field: 'jobDetailId',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150
},
},
{
label: '代码',
field: 'code',
sort: 'custom',
table: {
width: 150
},
},
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
}
]))
// 表单校验
export const PurchasereceiptRecordDetailRules = reactive({
fromPackingNumber: [required],
})
Loading…
Cancel
Save