Commit ba93e883 by zhuzhequan

Merge remote-tracking branch 'origin/zzq_bill_order' into zzq_bill_order

# Conflicts:
#	src/api/warehouse.ts
parents 2583792b e63ec0ef
...@@ -4,19 +4,20 @@ import { ...@@ -4,19 +4,20 @@ 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:{ list:{
locationName:string, locationName:string;
pickingLocation?:string pickingLocation?:string
skuName?:string skuName?:string
warehouseSku?:string warehouseSku?:string
...@@ -28,9 +29,9 @@ export interface factoryWarehouseInfo { ...@@ -28,9 +29,9 @@ 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 {
...@@ -54,55 +55,54 @@ export interface WarehouseInventory { ...@@ -54,55 +55,54 @@ export interface WarehouseInventory {
} }
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
skuName: string; skuName: string;
warehouseSku: string; warehouseSku: string;
productNumber: string; productNumber: string;
number: string; number: 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
} }
...@@ -165,10 +165,10 @@ export function factoryLogWarehouseLog(id: number | string | undefined) { ...@@ -165,10 +165,10 @@ export function factoryLogWarehouseLog(id: number | string | undefined) {
) )
} }
export function factoryWarehouseInfoPrint(data:PrintData) { export function factoryWarehouseInfoPrint(data: PrintData) {
return axios.post<never, BaseRespData<never[]>>( return axios.post<never, BaseRespData<never[]>>(
'/factoryWarehouseInfo/print', '/factoryWarehouseInfo/print',
data data,
) )
} }
...@@ -260,7 +260,7 @@ export function deleteWarehouseInventory(ids: string) { ...@@ -260,7 +260,7 @@ export function deleteWarehouseInventory(ids: string) {
// 入库单 // 入库单
export function warehouseInRecordListPage( export function warehouseInRecordListPageApi(
data: warehouseSearchForm, data: warehouseSearchForm,
currentPage: number, currentPage: number,
pageSize: number, pageSize: number,
...@@ -276,19 +276,24 @@ export function warehouseInRecordListPage( ...@@ -276,19 +276,24 @@ export function warehouseInRecordListPage(
} }
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 getWarehouseInRecordDetail(id: number) { return axios.get<never, BaseRespData<InterWarehouseDetail[]>>(
return axios.get<never, BaseRespData<never>>(
'factory/warehouseInRecord/get', 'factory/warehouseInRecord/get',
{ {
params: { params: {
...@@ -297,8 +302,7 @@ export function getWarehouseInRecordDetail(id: number) { ...@@ -297,8 +302,7 @@ export function getWarehouseInRecordDetail(id: number) {
}, },
) )
} }
export function getBySkuApi(warehouseId: number, sku: string | null) {
export function getBySku(warehouseId: number, sku: string | null) {
return axios.get<never, BaseRespData<InterskuList[]>>( return axios.get<never, BaseRespData<InterskuList[]>>(
'customProductItem/getBySku', 'customProductItem/getBySku',
{ {
...@@ -309,8 +313,10 @@ export function getBySku(warehouseId: number, sku: string | null) { ...@@ -309,8 +313,10 @@ export function getBySku(warehouseId: number, sku: string | null) {
}, },
) )
} }
export function getByWareHouseIdAndCodeApi(
export function getByWareHouseIdAndCode(wareHouseId: number, code: string | null) { wareHouseId: number,
code: string | null,
) {
return axios.get<never, BaseRespData<ILocation[]>>( return axios.get<never, BaseRespData<ILocation[]>>(
'factoryWarehouseLocation/getByWareHouseIdAndCode', 'factoryWarehouseLocation/getByWareHouseIdAndCode',
{ {
...@@ -321,8 +327,7 @@ export function getByWareHouseIdAndCode(wareHouseId: number, code: string | null ...@@ -321,8 +327,7 @@ export function getByWareHouseIdAndCode(wareHouseId: number, code: string | null
}, },
) )
} }
export function getInRecordStatusTree() {
export function getWarehouseStatusTree() {
return axios.get<never, BaseRespData<InterWarehouseTree[]>>( return axios.get<never, BaseRespData<InterWarehouseTree[]>>(
'factory/warehouseInRecord/status_tree', 'factory/warehouseInRecord/status_tree',
) )
...@@ -333,3 +338,51 @@ export function getWarehouseListApi() { ...@@ -333,3 +338,51 @@ 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) {
return axios.get<never, BaseRespData<never>>(
'factory/warehouseInRecord/delete',
{
params: { ids },
},
)
}
export function getInRecordLogApi(inRecordId?: number) {
return axios.get<never, BaseRespData<LogListData[]>>(
`factory/warehouseInRecord/log/${inRecordId}`,
)
}
// 出库单
export function getOutRecordStatusTree() {
return axios.get<never, BaseRespData<InterWarehouseTree[]>>(
'factory/warehouseOutRecord/status_tree',
)
}
export function warehouseOutRecordListPage(
data: warehouseSearchForm,
currentPage: number,
pageSize: number,
) {
return axios.post<never, BasePaginationData<InterWarehousePage>>(
'factory/warehouseOutRecord/list_page',
{
...data,
currentPage,
pageSize,
},
)
}
export function deleteWarehouseOutRecordApi(ids: string) {
return axios.get<never, BaseRespData<never>>(
'factory/warehouseOutRecord/delete',
{
params: { ids },
},
)
}
<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 }
} }
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