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 {
warehouseSearchForm,
InterWarehousePage,
InterWarehouseTree,
InterWarehouseDetail,
InterskuList,
InterWarehouseList,
ILocation,
InRecordEditForm,
} from '@/types/api/warehouse'
export interface LogListData{
createTime:string
description:string
export interface LogListData {
createTime: string
description: string
}
export interface PrintData{
code:string
list:{
locationName:string,
locationName:string;
pickingLocation?:string
skuName?:string
warehouseSku?:string
......@@ -28,9 +29,9 @@ export interface factoryWarehouseInfo {
pageSize: number
currentPage: number
total?: number
warehouseId?: string;
locationName?: string;
remark?: string;
warehouseId?: string
locationName?: string
remark?: string
}
export interface WarehouseInventory {
......@@ -54,55 +55,54 @@ export interface WarehouseInventory {
}
export interface UpdateDefaulted {
id?: number | string;
defaulted: number;
id?: number | string
defaulted: number
}
export interface UpdateStatus {
id?: number;
status: number | undefined;
id?: number
status: number | undefined
}
export interface warehouseInfo {
id?: number | string;
name: string;
code: string;
sort: string;
defaulted: number;
factoryId?: number;
factoryCode?: string;
id?: number | string
name: string
code: string
sort: string
defaulted: number
factoryId?: number
factoryCode?: string
remarks: string
}
export interface WarehouseWarning {
id: number | string;
locationCode: string;
id: number | string
locationCode: string
skuName: string;
warehouseSku: string;
productNumber: string;
number: string;
locationName: string;
locationName: string
}
export interface positionInfo {
id?: number;
warehouseId?: string | number;
locationName: string;
pickingOrder: string;
locationCode: string;
warehouseName?: string;
status?: number;
id?: number
warehouseId?: string | number
locationName: string
pickingOrder: string
locationCode: string
warehouseName?: string
status?: number
remark: string
}
export interface positionFormInfo {
id?: number;
warehouseId?: number | string;
locationName: string;
pickingOrder: string;
locationCode: string;
warehouseName: string;
id?: number
warehouseId?: number | string
locationName: string
pickingOrder: string
locationCode: string
warehouseName: string
remark: string
status: number
}
......@@ -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[]>>(
'/factoryWarehouseInfo/print',
data
data,
)
}
......@@ -260,7 +260,7 @@ export function deleteWarehouseInventory(ids: string) {
// 入库单
export function warehouseInRecordListPage(
export function warehouseInRecordListPageApi(
data: warehouseSearchForm,
currentPage: number,
pageSize: number,
......@@ -276,19 +276,24 @@ export function warehouseInRecordListPage(
}
export function addInRecordApi(form: InRecordEditForm) {
return axios.post<never, BaseRespData<never>>('factory/warehouseInRecord/add', {
...form,
})
return axios.post<never, BaseRespData<never>>(
'factory/warehouseInRecord/add',
{
...form,
},
)
}
export function updateInRecordApi(form: InRecordEditForm) {
return axios.post<never, BaseRespData<never>>('factory/warehouseInRecord/update', {
...form,
})
return axios.post<never, BaseRespData<never>>(
'factory/warehouseInRecord/update',
{
...form,
},
)
}
export function getWarehouseInRecordDetail(id: number) {
return axios.get<never, BaseRespData<never>>(
export function getWarehouseInRecordDetailApi(id: number) {
return axios.get<never, BaseRespData<InterWarehouseDetail[]>>(
'factory/warehouseInRecord/get',
{
params: {
......@@ -297,8 +302,7 @@ export function getWarehouseInRecordDetail(id: number) {
},
)
}
export function getBySku(warehouseId: number, sku: string | null) {
export function getBySkuApi(warehouseId: number, sku: string | null) {
return axios.get<never, BaseRespData<InterskuList[]>>(
'customProductItem/getBySku',
{
......@@ -309,8 +313,10 @@ export function getBySku(warehouseId: number, sku: string | null) {
},
)
}
export function getByWareHouseIdAndCode(wareHouseId: number, code: string | null) {
export function getByWareHouseIdAndCodeApi(
wareHouseId: number,
code: string | null,
) {
return axios.get<never, BaseRespData<ILocation[]>>(
'factoryWarehouseLocation/getByWareHouseIdAndCode',
{
......@@ -321,8 +327,7 @@ export function getByWareHouseIdAndCode(wareHouseId: number, code: string | null
},
)
}
export function getWarehouseStatusTree() {
export function getInRecordStatusTree() {
return axios.get<never, BaseRespData<InterWarehouseTree[]>>(
'factory/warehouseInRecord/status_tree',
)
......@@ -333,3 +338,51 @@ export function getWarehouseListApi() {
'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>
<div
class="image-view"
ref="imageViewRef"
class="image-view"
@mouseover="(ev) => mouseoverImg(ev, src)"
@mouseleave="mouseleaveImg"
>
......
......@@ -7,8 +7,23 @@ export interface warehouseSearchForm {
sku?: string
warehouseId?: number
}
// 主表列表ts,看新增时是不是一样
export interface InterWarehousePage {
export interface InterProductList {
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
factoryId?: number
factoryCode?: string
......@@ -16,28 +31,20 @@ export interface InterWarehousePage {
warehouseName?: string
inNo?: string
shipmentNumber?: string
skuAmount?: string
skuAmount?: number
total?: number
totalPrice?: number
billStatus?: string
remark?: string
productList?: InterProductList[]
remark?: string | null
dataVersion?: number
createTime?: string | null
updateTime?: string | null
}
export interface InterWarehouseDetail {
id?: string
inId?: string
productNo?: string
warehouseSku?: string
skuImage?: string
skuName?: string
buyStored?: string
totalPrice?: number
rejectsAmount?: string
rejectsReason?: string
remark?: string
factoryId?: number
createTime?: string
updateTime?: string
// 主表列表ts
export interface InterWarehousePage extends InterWarehouseBase {}
// 子表列表ts
export interface InterWarehouseDetail extends InterWarehouseBase {
productList: InterProductList[]
}
export interface InterWarehouseTree {
id: number
......@@ -49,14 +56,13 @@ export interface InterWarehouseTree {
}
export interface InterProductList {
createTime?: string
factoryId?: number
id?: number
inId?: number
productNo?: string | null //货号
buyStored?: number | null //入库数量
rejectsAmount?: number
rejectsReason?: string
remark?: string
// rejectsAmount?: number
// rejectsReason?: string
remark?: string | null
skuImage?: string
skuName?: string
costPrice?: number | null
......
......@@ -10,8 +10,34 @@ export default function useImagePreview() {
img.style.width = '300px'
div.appendChild(img)
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) => {
console.log(url, ev.clientY, ev.clientX)
ev.preventDefault()
if (show.value === true) return
img.src = url
......@@ -30,12 +56,16 @@ export default function useImagePreview() {
div.style.top = y + 'px'
div.style.display = 'block'
show.value = true
currentTarget = ev.currentTarget as HTMLElement
window.addEventListener('mousemove', mousemoveHandler)
}
}
const mouseleaveImg = () => {
if (show.value === false) return
div.style.display = 'none'
show.value = false
}
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