Commit e63ec0ef by wuqian

入库单初版接口

parent e0b8b1b1
...@@ -4,92 +4,92 @@ import { ...@@ -4,92 +4,92 @@ import {
warehouseSearchForm, warehouseSearchForm,
InterWarehousePage, InterWarehousePage,
InterWarehouseTree, InterWarehouseTree,
InterWarehouseDetail,
InterskuList, InterskuList,
InterWarehouseList, InterWarehouseList,
ILocation, ILocation,
InRecordEditForm, InRecordEditForm,
} from '@/types/api/warehouse' } from '@/types/api/warehouse'
export interface LogListData{ export interface LogListData {
createTime:string createTime: string
description:string description: string
} }
export interface PrintData{ export interface PrintData {
code:string code: string
list:{locationName:string,pickingLocation:string}[] list: { locationName: string; pickingLocation: string }[]
} }
export interface factoryWarehouseInfo { export interface factoryWarehouseInfo {
pageSize: number pageSize: number
currentPage: number currentPage: number
total?: number total?: number
warehouseId?: string; warehouseId?: string
locationName?: string; locationName?: string
remark?: string; remark?: string
} }
export interface WarehouseInventory { export interface WarehouseInventory {
pageSize: number; pageSize: number
currentPage: number; currentPage: number
total?: number; total?: number
warehouseId: string; warehouseId: string
skuName: string; skuName: string
warehouseSku: string; warehouseSku: string
occupyInventory: string; occupyInventory: string
freezeInventory: string; freezeInventory: string
inventory: string; inventory: string
upperLimit: string; upperLimit: string
usableInventoryStart: string; usableInventoryStart: string
usableInventoryEnd: string; usableInventoryEnd: string
occupyInventoryEnd: string; occupyInventoryEnd: string
occupyInventoryStart: string; occupyInventoryStart: string
floorLimit: string; floorLimit: string
} }
export interface UpdateDefaulted { export interface UpdateDefaulted {
id?: number | string; id?: number | string
defaulted: number; defaulted: number
} }
export interface UpdateStatus { export interface UpdateStatus {
id?: number; id?: number
status: number | undefined; status: number | undefined
} }
export interface warehouseInfo { export interface warehouseInfo {
id?: number | string; id?: number | string
name: string; name: string
code: string; code: string
sort: string; sort: string
defaulted: number; defaulted: number
factoryId?: number; factoryId?: number
factoryCode?: string; factoryCode?: string
remarks: string remarks: string
} }
export interface WarehouseWarning { export interface WarehouseWarning {
id: number | string; id: number | string
locationCode: string; locationCode: string
locationName: string; locationName: string
} }
export interface positionInfo { export interface positionInfo {
id?: number; id?: number
warehouseId?: string | number; warehouseId?: string | number
locationName: string; locationName: string
pickingOrder: string; pickingOrder: string
locationCode: string; locationCode: string
warehouseName?: string; warehouseName?: string
status?: number; status?: number
remark: string remark: string
} }
export interface positionFormInfo { export interface positionFormInfo {
id?: number; id?: number
warehouseId?: number | string; warehouseId?: number | string
locationName: string; locationName: string
pickingOrder: string; pickingOrder: string
locationCode: string; locationCode: string
warehouseName: string; warehouseName: string
remark: string remark: string
status: number status: number
} }
...@@ -152,10 +152,10 @@ export function factoryLogWarehouseLog(id: number | string | undefined) { ...@@ -152,10 +152,10 @@ export function factoryLogWarehouseLog(id: number | string | undefined) {
) )
} }
export function factoryWarehouseInfoPrint(data:PrintData) { export function factoryWarehouseInfoPrint(data: PrintData) {
return axios.post<never, BaseRespData<LogListData[]>>( return axios.post<never, BaseRespData<LogListData[]>>(
'/factoryWarehouseInfo/print', '/factoryWarehouseInfo/print',
data data,
) )
} }
...@@ -249,18 +249,24 @@ export function warehouseInRecordListPageApi( ...@@ -249,18 +249,24 @@ export function warehouseInRecordListPageApi(
} }
export function addInRecordApi(form: InRecordEditForm) { export function addInRecordApi(form: InRecordEditForm) {
return axios.post<never, BaseRespData<never>>('factory/warehouseInRecord/add', { return axios.post<never, BaseRespData<never>>(
'factory/warehouseInRecord/add',
{
...form, ...form,
}) },
)
} }
export function updateInRecordApi(form: InRecordEditForm) { export function updateInRecordApi(form: InRecordEditForm) {
return axios.post<never, BaseRespData<never>>('factory/warehouseInRecord/update', { return axios.post<never, BaseRespData<never>>(
'factory/warehouseInRecord/update',
{
...form, ...form,
}) },
)
} }
export function getWarehouseInRecordDetailApi(id: number) { export function getWarehouseInRecordDetailApi(id: number) {
return axios.get<never, BaseRespData<never>>( return axios.get<never, BaseRespData<InterWarehouseDetail[]>>(
'factory/warehouseInRecord/get', 'factory/warehouseInRecord/get',
{ {
params: { params: {
...@@ -280,7 +286,10 @@ export function getBySkuApi(warehouseId: number, sku: string | null) { ...@@ -280,7 +286,10 @@ export function getBySkuApi(warehouseId: number, sku: string | null) {
}, },
) )
} }
export function getByWareHouseIdAndCodeApi(wareHouseId: number, code: string | null) { export function getByWareHouseIdAndCodeApi(
wareHouseId: number,
code: string | null,
) {
return axios.get<never, BaseRespData<ILocation[]>>( return axios.get<never, BaseRespData<ILocation[]>>(
'factoryWarehouseLocation/getByWareHouseIdAndCode', 'factoryWarehouseLocation/getByWareHouseIdAndCode',
{ {
...@@ -302,6 +311,13 @@ export function getWarehouseListApi() { ...@@ -302,6 +311,13 @@ export function getWarehouseListApi() {
'factoryWarehouseInfo/getAll', 'factoryWarehouseInfo/getAll',
) )
} }
interface WarehouseParams {
id: number
dataVersion: number
}
export function auditOrderApi(url: string, data: WarehouseParams[]) {
return axios.post(url, data)
}
export function deleteWarehouseInRecordApi(ids: string) { export function deleteWarehouseInRecordApi(ids: string) {
return axios.get<never, BaseRespData<never>>( return axios.get<never, BaseRespData<never>>(
'factory/warehouseInRecord/delete', 'factory/warehouseInRecord/delete',
...@@ -310,6 +326,11 @@ export function deleteWarehouseInRecordApi(ids: string) { ...@@ -310,6 +326,11 @@ export function deleteWarehouseInRecordApi(ids: string) {
}, },
) )
} }
export function getInRecordLogApi(inRecordId?: number) {
return axios.get<never, BaseRespData<LogListData[]>>(
`factory/warehouseInRecord/log/${inRecordId}`,
)
}
// 出库单 // 出库单
export function getOutRecordStatusTree() { export function getOutRecordStatusTree() {
return axios.get<never, BaseRespData<InterWarehouseTree[]>>( return axios.get<never, BaseRespData<InterWarehouseTree[]>>(
......
<template> <template>
<div <div
class="image-view"
ref="imageViewRef" ref="imageViewRef"
class="image-view"
@mouseover="(ev) => mouseoverImg(ev, src)" @mouseover="(ev) => mouseoverImg(ev, src)"
@mouseleave="mouseleaveImg" @mouseleave="mouseleaveImg"
> >
......
...@@ -7,8 +7,23 @@ export interface warehouseSearchForm { ...@@ -7,8 +7,23 @@ export interface warehouseSearchForm {
sku?: string sku?: string
warehouseId?: number warehouseId?: number
} }
// 主表列表ts,看新增时是不是一样 export interface InterProductList {
export interface InterWarehousePage { createTime?: string
id?: number
inId?: number
productNo?: string | null //custom的货号
buyStored?: number | null
remark?: string | null
skuImage?: string
skuName?: string
costPrice?: number | null
totalPrice?: number | null
updateTime?: string
warehouseSku?: string
locationId?: number | null
locationCode?: string | null
}
export interface InterWarehouseBase {
id: number id: number
factoryId?: number factoryId?: number
factoryCode?: string factoryCode?: string
...@@ -16,28 +31,20 @@ export interface InterWarehousePage { ...@@ -16,28 +31,20 @@ export interface InterWarehousePage {
warehouseName?: string warehouseName?: string
inNo?: string inNo?: string
shipmentNumber?: string shipmentNumber?: string
skuAmount?: string skuAmount?: number
total?: number total?: number
totalPrice?: number totalPrice?: number
billStatus?: string billStatus?: string
remark?: string remark?: string | null
productList?: InterProductList[] dataVersion?: number
createTime?: string | null
updateTime?: string | null
} }
export interface InterWarehouseDetail { // 主表列表ts
id?: string export interface InterWarehousePage extends InterWarehouseBase {}
inId?: string // 子表列表ts
productNo?: string export interface InterWarehouseDetail extends InterWarehouseBase {
warehouseSku?: string productList: InterProductList[]
skuImage?: string
skuName?: string
buyStored?: string
totalPrice?: number
rejectsAmount?: string
rejectsReason?: string
remark?: string
factoryId?: number
createTime?: string
updateTime?: string
} }
export interface InterWarehouseTree { export interface InterWarehouseTree {
id: number id: number
...@@ -49,14 +56,13 @@ export interface InterWarehouseTree { ...@@ -49,14 +56,13 @@ export interface InterWarehouseTree {
} }
export interface InterProductList { export interface InterProductList {
createTime?: string createTime?: string
factoryId?: number
id?: number id?: number
inId?: number inId?: number
productNo?: string | null //货号 productNo?: string | null //货号
buyStored?: number | null //入库数量 buyStored?: number | null //入库数量
rejectsAmount?: number // rejectsAmount?: number
rejectsReason?: string // rejectsReason?: string
remark?: string remark?: string | null
skuImage?: string skuImage?: string
skuName?: string skuName?: string
costPrice?: number | null costPrice?: number | null
......
...@@ -10,8 +10,34 @@ export default function useImagePreview() { ...@@ -10,8 +10,34 @@ export default function useImagePreview() {
img.style.width = '300px' img.style.width = '300px'
div.appendChild(img) div.appendChild(img)
document.body.appendChild(div) document.body.appendChild(div)
let currentTarget: HTMLElement | null = null
const mousemoveHandler = (ev: MouseEvent) => {
if (!currentTarget) return
const rect = currentTarget.getBoundingClientRect()
const inOrigin =
ev.clientX >= rect.left &&
ev.clientX <= rect.right &&
ev.clientY >= rect.top &&
ev.clientY <= rect.bottom
const divRect = div.getBoundingClientRect()
const inPreview =
ev.clientX >= divRect.left &&
ev.clientX <= divRect.right &&
ev.clientY >= divRect.top &&
ev.clientY <= divRect.bottom
if (!inOrigin && !inPreview) {
div.style.display = 'none'
show.value = false
window.removeEventListener('mousemove', mousemoveHandler)
currentTarget = null
}
}
const mouseoverImg = (ev: MouseEvent, url: string) => { const mouseoverImg = (ev: MouseEvent, url: string) => {
console.log(url, ev.clientY, ev.clientX)
ev.preventDefault() ev.preventDefault()
if (show.value === true) return if (show.value === true) return
img.src = url img.src = url
...@@ -30,12 +56,16 @@ export default function useImagePreview() { ...@@ -30,12 +56,16 @@ export default function useImagePreview() {
div.style.top = y + 'px' div.style.top = y + 'px'
div.style.display = 'block' div.style.display = 'block'
show.value = true show.value = true
currentTarget = ev.currentTarget as HTMLElement
window.addEventListener('mousemove', mousemoveHandler)
} }
} }
const mouseleaveImg = () => { const mouseleaveImg = () => {
if (show.value === false) return if (show.value === false) return
div.style.display = 'none' div.style.display = 'none'
show.value = false show.value = false
} }
return { mouseoverImg, mouseleaveImg } return { mouseoverImg, mouseleaveImg }
} }
...@@ -884,7 +884,7 @@ const { ...@@ -884,7 +884,7 @@ const {
warehouseOutRecordListPage( warehouseOutRecordListPage(
{ {
...searchForm.value, ...searchForm.value,
// status: nodeId.value === -1 ? null : nodeId.value, billStatus: nodeId.value === -1 ? null : nodeId.value,
createTimeStart: tradingTime.value && tradingTime.value[0], createTimeStart: tradingTime.value && tradingTime.value[0],
createTimeEnd: tradingTime.value && tradingTime.value[1], createTimeEnd: tradingTime.value && tradingTime.value[1],
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment