Commit e90405ab by zhuzhequan

Merge branch 'dev_ware_in' into 'release'

Dev ware in

See merge request !151
parents ef266d5b 6f560892
...@@ -439,6 +439,21 @@ export function getBySkuApi( ...@@ -439,6 +439,21 @@ export function getBySkuApi(
}, },
) )
} }
export function getBySkuAndUserMarkApi(
warehouseId: number | string | undefined,
sku: string | null,
userMark: string | null | undefined,
) {
return axios.post<never, BaseRespData<InterskuList[]>>(
'factory/warehouseInRecord/getProductBySku',
{
warehouseId,
userMark,
sku,
},
)
}
export function getByWareHouseIdAndCodeApi( export function getByWareHouseIdAndCodeApi(
wareHouseId: number | string | undefined, wareHouseId: number | string | undefined,
code: string | null, code: string | null,
...@@ -702,6 +717,14 @@ export function scanBoxCodeApi(boxCode: string) { ...@@ -702,6 +717,14 @@ export function scanBoxCodeApi(boxCode: string) {
}, },
) )
} }
// 备货计划 盘点
export function getLocalFactoryList() {
return axios.get<never, BaseRespData<never>>(
'dbDiyUser/getLocalFactoryList',
)
}
// 备货计划 打印箱贴 // 备货计划 打印箱贴
export function printBarcodeApi(data: { id: number, dataVersion: number }[]) { export function printBarcodeApi(data: { id: number, dataVersion: number }[]) {
return axios.post<never, BaseRespData<never[]>>( return axios.post<never, BaseRespData<never[]>>(
......
...@@ -61,6 +61,8 @@ export interface InterWarehouseBase { ...@@ -61,6 +61,8 @@ export interface InterWarehouseBase {
export interface InterWarehousePage extends InterWarehouseBase { } export interface InterWarehousePage extends InterWarehouseBase { }
// 子表列表ts // 子表列表ts
export interface InterWarehouseDetail extends InterWarehouseBase { export interface InterWarehouseDetail extends InterWarehouseBase {
currencyName?:string
currencyCode?:string
productList: InterProductList[] productList: InterProductList[]
} }
export interface ExportInWarehouseInfo extends warehouseSearchForm { export interface ExportInWarehouseInfo extends warehouseSearchForm {
...@@ -88,7 +90,7 @@ export interface InterProductList { ...@@ -88,7 +90,7 @@ export interface InterProductList {
remark?: string | null remark?: string | null
skuImage?: string skuImage?: string
skuName?: string skuName?: string
costPrice?: number | null costPrice?: number | null | undefined
totalPrice?: number | null totalPrice?: number | null
updateTime?: string updateTime?: string
warehouseSku?: string warehouseSku?: string
...@@ -102,7 +104,13 @@ export interface InterskuList { ...@@ -102,7 +104,13 @@ export interface InterskuList {
id?: number id?: number
productId?: number productId?: number
sku?: string sku?: string
userMark?: string
customerId?: string
customerName?: string
skuName?: string skuName?: string
productName?: string
skuImage?: string
costPrice?: undefined | null | number
image?: string image?: string
factoryPrice?: number | null factoryPrice?: number | null
productNo?: string | null //货号 productNo?: string | null //货号
......
...@@ -554,7 +554,7 @@ const renderItemBox = (bool: boolean) => { ...@@ -554,7 +554,7 @@ const renderItemBox = (bool: boolean) => {
parts.length > 3 && parts[3].startsWith('CNPSC') parts.length > 3 && parts[3].startsWith('CNPSC')
? parts[3] ? parts[3]
: parts.length > 1 : parts.length > 1
? parts[1] ? currentCode
: parts[0] : parts[0]
} }
......
...@@ -6226,7 +6226,7 @@ const onUpdateCustomsDeclarationInfo = () => { ...@@ -6226,7 +6226,7 @@ const onUpdateCustomsDeclarationInfo = () => {
.goods-item { .goods-item {
display: grid; display: grid;
// grid-template-columns: 100px 1fr minmax(150px, 1fr) 150px; // grid-template-columns: 100px 1fr minmax(150px, 1fr) 150px;
grid-template-columns: 100px 254px 1fr minmax(150px, 1fr) 150px 200px; grid-template-columns: 100px 254px 1fr minmax(150px, 1fr) 220px 200px;
gap: 15px; gap: 15px;
.goods-item-img { .goods-item-img {
......
...@@ -272,6 +272,7 @@ ...@@ -272,6 +272,7 @@
header-align="center" header-align="center"
align="center" align="center"
></ElTableColumn> ></ElTableColumn>
<ElTableColumn <ElTableColumn
v-if="nodeCode === 'PENDING_SUBMIT'" v-if="nodeCode === 'PENDING_SUBMIT'"
width="100" width="100"
...@@ -386,6 +387,13 @@ ...@@ -386,6 +387,13 @@
prop="remark" prop="remark"
/> />
<ElTableColumn <ElTableColumn
label="所属客户"
show-overflow-tooltip
prop="userMark"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="创建时间" label="创建时间"
...@@ -604,6 +612,12 @@ ...@@ -604,6 +612,12 @@
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="所属客户"
prop="userMark"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
width="240" width="240"
label="备注" label="备注"
prop="remark" prop="remark"
...@@ -624,7 +638,7 @@ ...@@ -624,7 +638,7 @@
clearable clearable
size="small" size="small"
></el-input> ></el-input>
<el-popover placement="top-start" width="1000" trigger="click"> <el-popover placement="top-start" width="1200" trigger="click">
<div v-if="skuData.length > 0" style="height: 50vh"> <div v-if="skuData.length > 0" style="height: 50vh">
<ElTable size="small" :data="skuData" height="100%" border> <ElTable size="small" :data="skuData" height="100%" border>
<ElTableColumn <ElTableColumn
...@@ -687,6 +701,12 @@ ...@@ -687,6 +701,12 @@
prop="locationCode" prop="locationCode"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip
align="center"
label="所属客户"
prop="userMark"
/>
<ElTableColumn
width="80" width="80"
align="center" align="center"
header-align="center" header-align="center"
...@@ -1266,6 +1286,11 @@ const handleLocalImport = async ({ ...@@ -1266,6 +1286,11 @@ const handleLocalImport = async ({
return { return {
skuImage: skuItem.image, skuImage: skuItem.image,
customerId: skuItem.customerId,
userMark: skuItem.userMark,
customerName: skuItem.customerName,
currencyName: skuItem.currencyName,
currencyCode: skuItem.currencyCode,
warehouseSku: skuItem.warehouseSku, warehouseSku: skuItem.warehouseSku,
skuName: skuItem.skuName, skuName: skuItem.skuName,
productNo: skuItem.productNumber, productNo: skuItem.productNumber,
...@@ -1386,8 +1411,11 @@ const skudblclick = (val: InterskuList) => { ...@@ -1386,8 +1411,11 @@ const skudblclick = (val: InterskuList) => {
// 使用可选链和空值合并运算符处理可能的null值 // 使用可选链和空值合并运算符处理可能的null值
const { const {
locationCode = '', locationCode = '',
customerId = '',
customerName = '',
price = null, price = null,
productNo = '', productNo = '',
userMark = '',
warehouseSku = '', warehouseSku = '',
skuName = '', skuName = '',
image = '', image = '',
...@@ -1413,8 +1441,11 @@ const skudblclick = (val: InterskuList) => { ...@@ -1413,8 +1441,11 @@ const skudblclick = (val: InterskuList) => {
{ {
skuImage: image, skuImage: image,
warehouseSku, warehouseSku,
customerId,
customerName,
skuName, skuName,
productNo, productNo,
userMark,
locationCode: locationCode ?? '', // 确保空值处理 locationCode: locationCode ?? '', // 确保空值处理
locationId: locationId ?? null, // 确保空值处理 locationId: locationId ?? null, // 确保空值处理
costPrice: price, costPrice: price,
...@@ -1750,6 +1781,11 @@ const submitPurchase = async () => { ...@@ -1750,6 +1781,11 @@ const submitPurchase = async () => {
const mergedProductList = filteredSkusList.map((skuItem) => { const mergedProductList = filteredSkusList.map((skuItem) => {
return { return {
skuImage: skuItem.image, skuImage: skuItem.image,
customerId: skuItem.customerId,
userMark: skuItem.userMark,
customerName: skuItem.customerName,
currencyName: skuItem.currencyName,
currencyCode: skuItem.currencyCode,
warehouseSku: skuItem.warehouseSku, warehouseSku: skuItem.warehouseSku,
skuName: skuItem.skuName, skuName: skuItem.skuName,
productNo: skuItem.productNumber, productNo: skuItem.productNumber,
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<splitDiv size="50"> <splitDiv size="50">
<template #top> <template #top>
<div class="header-filter-form"> <div class="header-filter-form">
<ElForm :model="searchForm" inline ref="searchFormRef"> <ElForm ref="searchFormRef" :model="searchForm" inline>
<ElFormItem label="采购仓库"> <ElFormItem label="采购仓库">
<ElSelect <ElSelect
v-model="searchForm.warehouseId" v-model="searchForm.warehouseId"
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
/> />
</ElFormItem> </ElFormItem>
<ElFormItem> <ElFormItem>
<ElButton type="primary" @click="search" ref="searchBtnRef" <ElButton ref="searchBtnRef" type="primary" @click="search"
>查询</ElButton >查询</ElButton
> >
</ElFormItem> </ElFormItem>
...@@ -340,7 +340,9 @@ ...@@ -340,7 +340,9 @@
label="库存SKU" label="库存SKU"
width="180" width="180"
prop="warehouseSku" prop="warehouseSku"
/> >
</ElTableColumn>
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
...@@ -389,6 +391,12 @@ ...@@ -389,6 +391,12 @@
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="所属客户"
prop="userMark"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
width="240" width="240"
label="备注" label="备注"
prop="remark" prop="remark"
...@@ -457,6 +465,12 @@ ...@@ -457,6 +465,12 @@
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<div class="import-dialog"> <div class="import-dialog">
<div class="label" style="margin-bottom: 10px">
<span style="margin-right: 10px">所属客户:</span>
<el-select v-model="importUserMark" size="small" style="width: 100px;">
<el-option v-for="user in userMarkList" :key="user.userId" :label="user.userMark" :value="user.userId"></el-option>
</el-select>
</div>
<div class="import-content"> <div class="import-content">
<UploadExcel <UploadExcel
v-model="importedFileUrl" v-model="importedFileUrl"
...@@ -471,7 +485,7 @@ ...@@ -471,7 +485,7 @@
<ElDialog <ElDialog
v-model="newDialogVisible" v-model="newDialogVisible"
:title="formId ? '编辑' : '新增'" :title="formId ? '编辑' : '新增'"
width="80%" width="85%"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<div class="dialog-form"> <div class="dialog-form">
...@@ -547,13 +561,16 @@ ...@@ -547,13 +561,16 @@
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
width="140"
label="库存SKU" label="库存SKU"
prop="warehouseSku" prop="warehouseSku"
/> >
</ElTableColumn>
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
width="160"
label="商品名称" label="商品名称"
prop="skuName" prop="skuName"
/> />
...@@ -614,9 +631,15 @@ ...@@ -614,9 +631,15 @@
</template> </template>
</ElTableColumn> </ElTableColumn>
<ElTableColumn <ElTableColumn
align="center"
width="100"
label="所属客户"
prop="userMark"
/>
<ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
width="240" width="140"
label="备注" label="备注"
prop="remark" prop="remark"
> >
...@@ -628,7 +651,11 @@ ...@@ -628,7 +651,11 @@
</div> </div>
<template #footer> <template #footer>
<div class="product-dialog-footer"> <div class="product-dialog-footer">
<div> <div style="display: flex;align-items: center">
<span style="margin-right: 10px;font-style:13px;color: gray">搜索:</span>
<el-select v-model="userMark" size="small" style="width: 100px;">
<el-option v-for="user in userMarkList" :key="user.userId" :label="user.userMark" :value="user.userId"></el-option>
</el-select>
<el-input <el-input
v-model.trim="selectSku" v-model.trim="selectSku"
placeholder="库存SKU" placeholder="库存SKU"
...@@ -636,7 +663,7 @@ ...@@ -636,7 +663,7 @@
clearable clearable
size="small" size="small"
></el-input> ></el-input>
<el-popover placement="top-start" width="1000" trigger="click"> <el-popover placement="top-start" width="1200" trigger="click">
<div v-if="skuData.length > 0" style="height: 50vh"> <div v-if="skuData.length > 0" style="height: 50vh">
<ElTable size="small" :data="filterSkuData" height="100%" border> <ElTable size="small" :data="filterSkuData" height="100%" border>
<ElTableColumn <ElTableColumn
...@@ -654,15 +681,15 @@ ...@@ -654,15 +681,15 @@
prop="image" prop="image"
> >
<template #default="{ row }"> <template #default="{ row }">
<ImageView :src="row.image" width="40px" height="40px" /> <ImageView :src="row.skuImage" width="40px" height="40px" />
</template> </template>
</ElTableColumn> </ElTableColumn>
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="库存SKU" label="商品名称"
width="200" width="200"
prop="skuName" prop="productName"
/> />
<ElTableColumn <ElTableColumn
...@@ -670,7 +697,7 @@ ...@@ -670,7 +697,7 @@
align="center" align="center"
width="200" width="200"
label="库存SKU" label="库存SKU"
prop="sku" prop="warehouseSku"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
...@@ -690,7 +717,7 @@ ...@@ -690,7 +717,7 @@
align="center" align="center"
label="成本价" label="成本价"
width="80" width="80"
prop="factoryPrice" prop="costPrice"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
...@@ -699,6 +726,12 @@ ...@@ -699,6 +726,12 @@
prop="locationCode" prop="locationCode"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip
align="center"
label="所属客户"
prop="userMark"
/>
<ElTableColumn
width="80" width="80"
align="center" align="center"
header-align="center" header-align="center"
...@@ -838,6 +871,12 @@ ...@@ -838,6 +871,12 @@
width="500px" width="500px"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<div class="label" style="margin-bottom: 10px">
<span style="margin-right: 10px">所属客户:</span>
<el-select v-model="batchUserMark" size="small" style="width: 100px;">
<el-option v-for="user in userMarkList" :key="user.userId" :label="user.userMark" :value="user.userId"></el-option>
</el-select>
</div>
<div> <div>
<el-input <el-input
v-model.trim="purchaseTextarea" v-model.trim="purchaseTextarea"
...@@ -871,7 +910,6 @@ import { ...@@ -871,7 +910,6 @@ import {
getInRecordStatusTree, getInRecordStatusTree,
warehouseInRecordListPageApi, warehouseInRecordListPageApi,
getWarehouseInRecordDetailApi, getWarehouseInRecordDetailApi,
getBySkuApi,
warehouseInfoGetAll, warehouseInfoGetAll,
getByWareHouseIdAndCodeApi, getByWareHouseIdAndCodeApi,
addInRecordApi, addInRecordApi,
...@@ -884,7 +922,7 @@ import { ...@@ -884,7 +922,7 @@ import {
warehouseInfo, warehouseInfo,
InRecordBatchCheckPrintApi, InRecordBatchCheckPrintApi,
factoryWarehouseInventoryPrint, factoryWarehouseInventoryPrint,
warehouseInRecordExport, warehouseInRecordExport, getLocalFactoryList, getBySkuAndUserMarkApi,
} from '@/api/warehouse' } from '@/api/warehouse'
import { filePath } from '@/api/axios.ts' import { filePath } from '@/api/axios.ts'
import BigNumber from 'bignumber.js' import BigNumber from 'bignumber.js'
...@@ -901,10 +939,14 @@ import { ...@@ -901,10 +939,14 @@ import {
} from '@/types/api/warehouse' } from '@/types/api/warehouse'
import ImageView from '@/components/ImageView.vue' import ImageView from '@/components/ImageView.vue'
import UploadExcel from '@/components/UploadExcel.vue' import UploadExcel from '@/components/UploadExcel.vue'
// import { debounce } from 'lodash-es'
import { useEnterKeyTrigger } from '@/utils/hooks/useEnterKeyTrigger.ts' import { useEnterKeyTrigger } from '@/utils/hooks/useEnterKeyTrigger.ts'
interface UserMark{
userId: number
userMark: string
userName: string
}
const warehouseList = ref<warehouseInfo[]>([]) const warehouseList = ref<warehouseInfo[]>([])
const userMarkList = ref<UserMark[]>([])
const pickerOptions = { const pickerOptions = {
shortcuts: [ shortcuts: [
{ {
...@@ -1024,6 +1066,9 @@ function getStartTime() { ...@@ -1024,6 +1066,9 @@ function getStartTime() {
return `${year}-${month}-${day} 00:00:00` return `${year}-${month}-${day} 00:00:00`
} }
const selectSku = ref('') const selectSku = ref('')
const userMark = ref(0)
const batchUserMark = ref(0)
const importUserMark = ref(0)
const treeData = ref<InterWarehouseTree[]>() const treeData = ref<InterWarehouseTree[]>()
const [searchForm, resetSearchForm] = useValue<warehouseSearchForm>({}) const [searchForm, resetSearchForm] = useValue<warehouseSearchForm>({})
...@@ -1147,13 +1192,23 @@ async function handlePrintProductTag() { ...@@ -1147,13 +1192,23 @@ async function handlePrintProductTag() {
window.open(filePath + res.message, '_blank') window.open(filePath + res.message, '_blank')
} }
const batchAddCommodity = async (sku: string): Promise<InterskuList[]> => { const batchAddCommodity = async (sku: string,type:string): Promise<InterskuList[]> => {
if (!editForm.value.warehouseId) { if (!editForm.value.warehouseId) {
ElMessage.error('请选择仓库') ElMessage.error('请选择仓库')
return [] return []
} }
try { try {
const res = await getBySkuApi(editForm.value.warehouseId, sku) let userValue: string | number = ''
if(type==='1'){
userValue = userMark.value
}else if(type==='2'){
userValue = batchUserMark.value
}else if(type==='3'){
userValue = importUserMark.value
}
const item = userMarkList.value.find(e=>e.userId===userValue)
const user = userValue===0 ? null : item?.userMark
const res = await getBySkuAndUserMarkApi(editForm.value.warehouseId, sku,user)
const arr: InterskuList[] = res.data || [] const arr: InterskuList[] = res.data || []
const ids: Record<string, boolean> = {} const ids: Record<string, boolean> = {}
// 过滤掉商品列表已经加了的 // 过滤掉商品列表已经加了的
...@@ -1242,7 +1297,7 @@ const handleLocalImport = async ({ ...@@ -1242,7 +1297,7 @@ const handleLocalImport = async ({
// 2. 提取导入的 SKU 列表 // 2. 提取导入的 SKU 列表
const importedSkus = importedData.map((item) => item.warehouseSku).join(',') const importedSkus = importedData.map((item) => item.warehouseSku).join(',')
// 3. 调用 batchAddCommodity 获取商品的完整信息并过滤掉已有的 SKU // 3. 调用 batchAddCommodity 获取商品的完整信息并过滤掉已有的 SKU
const filteredSkusList = await batchAddCommodity(importedSkus) // 使用 await 等待结果 const filteredSkusList = await batchAddCommodity(importedSkus,'3') // 使用 await 等待结果
if (filteredSkusList.length === 0) { if (filteredSkusList.length === 0) {
ElMessage.warning('导入的商品SKU已存在或无效') ElMessage.warning('导入的商品SKU已存在或无效')
importedFileUrl.value = path importedFileUrl.value = path
...@@ -1253,24 +1308,30 @@ const handleLocalImport = async ({ ...@@ -1253,24 +1308,30 @@ const handleLocalImport = async ({
const mergedProductList = filteredSkusList.map((skuItem) => { const mergedProductList = filteredSkusList.map((skuItem) => {
// 在导入数据中找到匹配的备注信息 // 在导入数据中找到匹配的备注信息
const importedItem = importedData.find( const importedItem = importedData.find(
(item) => item.warehouseSku === skuItem.sku, (item) => skuItem.warehouseSku?.includes(item.warehouseSku),
) )
const target = locationList.value.find((item: InterProductList) => { const target = locationList.value.find((item: InterProductList) => {
return item.locationCode == importedItem?.locationCode return item.locationCode == importedItem?.locationCode
}) })
const item = userMarkList.value.find(e=>e.userId===importUserMark.value)
return { return {
skuImage: skuItem.image, customerId:importUserMark.value !== 0 ?importUserMark.value : null,
warehouseSku: skuItem.sku, customerName: importUserMark.value !== 0 ? item?.userName || '' : null,
skuName: skuItem.skuName, userMark: importUserMark.value !== 0 ? item?.userMark : null,
skuImage: skuItem.skuImage,
currencyName: skuItem.currencyName,
currencyCode: skuItem.currencyCode,
warehouseSku: skuItem.warehouseSku,
skuName: skuItem.productName,
productNo: skuItem.productNo, productNo: skuItem.productNo,
locationCode: target?.locationCode ?? '', locationCode: target?.locationCode ?? '',
locationId: target?.locationId, locationId: target?.locationId,
costPrice: skuItem.factoryPrice, costPrice: skuItem.costPrice,
buyStored: importedItem?.buyStored ?? null, buyStored: importedItem?.buyStored ?? null,
totalPrice: new BigNumber( totalPrice: new BigNumber(
(importedItem?.buyStored ?? 0) as number | string, (importedItem?.buyStored ?? 0) as number | string,
) )
.multipliedBy(skuItem.factoryPrice ?? 0) .multipliedBy(skuItem.costPrice ?? 0)
.toNumber(), .toNumber(),
usableInventory: skuItem.usableInventory, usableInventory: skuItem.usableInventory,
remark: importedItem?.remark ?? null, remark: importedItem?.remark ?? null,
...@@ -1348,7 +1409,9 @@ const skuData = ref<InterskuList[]>([]) ...@@ -1348,7 +1409,9 @@ const skuData = ref<InterskuList[]>([])
const selectbySku = async () => { const selectbySku = async () => {
if (!editForm.value.warehouseId) return ElMessage.error('请选择仓库') if (!editForm.value.warehouseId) return ElMessage.error('请选择仓库')
try { try {
const res = await getBySkuApi(editForm.value.warehouseId, selectSku.value) const item = userMarkList.value.find(e=>e.userId===userMark.value)
const user = userMark.value===0 ? null : item?.userMark
const res = await getBySkuAndUserMarkApi(editForm.value.warehouseId, selectSku.value,user)
skuData.value = res.data || [] skuData.value = res.data || []
} catch (e) { } catch (e) {
console.error(e) console.error(e)
...@@ -1358,11 +1421,11 @@ const skudblclick = (val: InterskuList) => { ...@@ -1358,11 +1421,11 @@ const skudblclick = (val: InterskuList) => {
// 使用可选链和空值合并运算符处理可能的null值 // 使用可选链和空值合并运算符处理可能的null值
const { const {
locationCode = '', locationCode = '',
factoryPrice = null, costPrice = null,
productNo = '', productNo = '',
sku = '', warehouseSku = '',
skuName = '', productName = '',
image = '', skuImage = '',
locationId = null, locationId = null,
currencyName = '', currencyName = '',
currencyCode = null, currencyCode = null,
...@@ -1377,16 +1440,20 @@ const skudblclick = (val: InterskuList) => { ...@@ -1377,16 +1440,20 @@ const skudblclick = (val: InterskuList) => {
return return
} }
} }
const item = userMarkList.value.find(e=>e.userId===userMark.value)
otherPurchaseData.value = [ otherPurchaseData.value = [
...otherPurchaseData.value, ...JSON.parse(JSON.stringify(otherPurchaseData.value)),
{ {
skuImage: image, skuImage,
warehouseSku: sku, warehouseSku,
skuName, customerId:userMark.value !== 0 ?userMark.value : null,
customerName: userMark.value !== 0 ? item?.userName || '' : null,
userMark: userMark.value !== 0 ? item?.userMark : null,
skuName:productName,
productNo, productNo,
locationCode: locationCode ?? '', // 确保空值处理 locationCode: locationCode ?? '', // 确保空值处理
locationId: locationId ?? null, // 确保空值处理 locationId: locationId ?? null, // 确保空值处理
costPrice: factoryPrice, costPrice,
buyStored: null, buyStored: null,
totalPrice: null, totalPrice: null,
currencyName, currencyName,
...@@ -1429,7 +1496,17 @@ const editFormRef = ref() ...@@ -1429,7 +1496,17 @@ const editFormRef = ref()
const editForm2 = ref({}) const editForm2 = ref({})
const formId = ref<number | undefined>(undefined) const formId = ref<number | undefined>(undefined)
const otherPurchaseData = ref<InterProductList[]>([]) const otherPurchaseData = ref<InterProductList[]>([])
const getUserMark = async () => {
const {data} = await getLocalFactoryList()
userMarkList.value = [
...[{userMark:'九猫商品', userId: 0,userName:''}],
...data
]
}
const addDialog = async (i: number, v: InterWarehousePage | null) => { const addDialog = async (i: number, v: InterWarehousePage | null) => {
await getUserMark()
if (i === 2) { if (i === 2) {
if (v) formId.value = v.id if (v) formId.value = v.id
if (v) getProduct(v.id) if (v) getProduct(v.id)
...@@ -1437,6 +1514,7 @@ const addDialog = async (i: number, v: InterWarehousePage | null) => { ...@@ -1437,6 +1514,7 @@ const addDialog = async (i: number, v: InterWarehousePage | null) => {
// editForm.value = JSON.parse(JSON.stringify(v)) // editForm.value = JSON.parse(JSON.stringify(v))
} else { } else {
await nextTick() await nextTick()
editForm.value = JSON.parse(JSON.stringify(editForm2.value)) editForm.value = JSON.parse(JSON.stringify(editForm2.value))
resetEditForm() resetEditForm()
const userJson = localStorage.getItem('user') const userJson = localStorage.getItem('user')
...@@ -1623,7 +1701,13 @@ const addOtherCurrency = async () => { ...@@ -1623,7 +1701,13 @@ const addOtherCurrency = async () => {
const filterSkuData = computed(() => { const filterSkuData = computed(() => {
const skuList = otherPurchaseData.value.map((el) => el.warehouseSku) const skuList = otherPurchaseData.value.map((el) => el.warehouseSku)
// console.log(skuList, skuData.value) // console.log(skuList, skuData.value)
return skuData.value.filter((el) => !skuList.includes(el.sku)) const item = userMarkList.value.find(u=>u.userId===userMark.value)
return skuData.value.filter((el) => !skuList.includes(el.warehouseSku)).map(e=>{
return {
...e,
userMark:userMark.value===0?'':item?.userMark
}
})
}) })
const addSection = async () => { const addSection = async () => {
const params = { ...editForm.value } const params = { ...editForm.value }
...@@ -1690,6 +1774,7 @@ const addPurchaseVisible = ref(false) ...@@ -1690,6 +1774,7 @@ const addPurchaseVisible = ref(false)
const purchaseTextarea = ref('') const purchaseTextarea = ref('')
const addPurchase = async () => { const addPurchase = async () => {
addPurchaseVisible.value = true addPurchaseVisible.value = true
batchUserMark.value = 0
purchaseTextarea.value = '' purchaseTextarea.value = ''
} }
const submitPurchase = async () => { const submitPurchase = async () => {
...@@ -1697,16 +1782,22 @@ const submitPurchase = async () => { ...@@ -1697,16 +1782,22 @@ const submitPurchase = async () => {
ElMessage.warning('请输入库存 SKU') ElMessage.warning('请输入库存 SKU')
return return
} }
const filteredSkusList = await batchAddCommodity(purchaseTextarea.value) const item = userMarkList.value.find(e=>e.userId===batchUserMark.value)
const filteredSkusList = await batchAddCommodity(purchaseTextarea.value,'2')
const mergedProductList = filteredSkusList.map((skuItem) => { const mergedProductList = filteredSkusList.map((skuItem) => {
return { return {
skuImage: skuItem.image, customerId:batchUserMark.value !== 0 ?batchUserMark.value : null,
warehouseSku: skuItem.sku, customerName: batchUserMark.value !== 0 ? item?.userName || '' : null,
skuName: skuItem.skuName, userMark: batchUserMark.value !== 0 ? item?.userMark : null,
skuImage: skuItem.skuImage,
warehouseSku: skuItem.warehouseSku,
currencyName: skuItem.currencyName,
currencyCode: skuItem.currencyCode,
skuName: skuItem.productName,
productNo: skuItem.productNo, productNo: skuItem.productNo,
locationCode: skuItem.locationCode ?? '', locationCode: skuItem.locationCode ?? '',
locationId: skuItem.locationId ?? null, locationId: skuItem.locationId ?? null,
costPrice: skuItem.factoryPrice, costPrice: skuItem.costPrice,
buyStored: null, buyStored: null,
totalPrice: null, totalPrice: null,
usableInventory: skuItem.usableInventory, usableInventory: skuItem.usableInventory,
...@@ -1729,6 +1820,7 @@ const importedFileUrl = ref('') ...@@ -1729,6 +1820,7 @@ const importedFileUrl = ref('')
const importData = async () => { const importData = async () => {
importDialogVisible.value = true importDialogVisible.value = true
importedFileUrl.value = '' importedFileUrl.value = ''
importUserMark.value = 0
} }
const handleBatchDelete = async () => { const handleBatchDelete = async () => {
if (!selections.value.length) { if (!selections.value.length) {
...@@ -1759,6 +1851,10 @@ const searchDetail = async () => { ...@@ -1759,6 +1851,10 @@ const searchDetail = async () => {
detailLoading.value = true detailLoading.value = true
try { try {
const res = await getWarehouseInRecordDetailApi(currentRow.value?.id) const res = await getWarehouseInRecordDetailApi(currentRow.value?.id)
res.data.productList.forEach(item => {
item.currencyName = res.data.currencyName || ''
item.currencyCode = res.data.currencyCode || ''
})
detailList.value = res.data?.productList || [] detailList.value = res.data?.productList || []
} catch (e) { } catch (e) {
console.error(e) console.error(e)
......
...@@ -12,7 +12,7 @@ import { ...@@ -12,7 +12,7 @@ import {
WarehouseWarning, WarehouseWarning,
factoryWarehouseInventoryPrint, factoryWarehouseInventoryPrint,
exportWarehouseInfo, exportWarehouseInfo,
loactionData, loactionData, getLocalFactoryList,
} from '@/api/warehouse.ts' } from '@/api/warehouse.ts'
import { AnyObject } from '@/types/api/warehouse' import { AnyObject } from '@/types/api/warehouse'
import { ref, computed } from 'vue' import { ref, computed } from 'vue'
...@@ -20,12 +20,18 @@ import SplitDiv from '@/components/splitDiv/splitDiv.vue' ...@@ -20,12 +20,18 @@ import SplitDiv from '@/components/splitDiv/splitDiv.vue'
import { filePath } from '@/api/axios.ts' import { filePath } from '@/api/axios.ts'
import { useEnterKeyTrigger } from '@/utils/hooks/useEnterKeyTrigger.ts' import { useEnterKeyTrigger } from '@/utils/hooks/useEnterKeyTrigger.ts'
import { getInventoryLowerLimitApi } from '@/api/externalAuth' import { getInventoryLowerLimitApi } from '@/api/externalAuth'
interface UserMark{
userId: number | string
userMark: string
userName: string
}
import { LocationInfoGetAll } from '@/api/common' import { LocationInfoGetAll } from '@/api/common'
const searchForm = ref({ const searchForm = ref({
warehouseId: '', warehouseId: '',
inventoryStart: '', inventoryStart: '',
inventoryEnd: '', inventoryEnd: '',
userMark: '',
productNo: '', productNo: '',
skuName: '', skuName: '',
warehouseSku: '', warehouseSku: '',
...@@ -38,6 +44,7 @@ const searchForm = ref({ ...@@ -38,6 +44,7 @@ const searchForm = ref({
occupyInventoryStart: '', occupyInventoryStart: '',
}) })
const warehouseList = ref<warehouseInfo[]>([]) const warehouseList = ref<warehouseInfo[]>([])
const userMarkList = ref<UserMark[]>([])
const logList = ref<LogListData[]>([]) const logList = ref<LogListData[]>([])
const selections = ref<WarehouseWarning[]>([]) const selections = ref<WarehouseWarning[]>([])
const leftData = ref<WarehouseWarning[]>([]) const leftData = ref<WarehouseWarning[]>([])
...@@ -56,6 +63,13 @@ const isSameWarehouse = computed(() => { ...@@ -56,6 +63,13 @@ const isSameWarehouse = computed(() => {
const modifyLocationDialog = ref(false) const modifyLocationDialog = ref(false)
const modifyProductNoDialog = ref(false) const modifyProductNoDialog = ref(false)
const modifyCustomSkuDialog = ref(false) const modifyCustomSkuDialog = ref(false)
const getUserMark = async () => {
const {data} = await getLocalFactoryList()
userMarkList.value = [
...[{userMark:'九猫商品', userId: 'JMP',userName:''}],
...data
]
}
/** 修改库位 */ /** 修改库位 */
const locationForm = ref({ const locationForm = ref({
...@@ -351,6 +365,7 @@ const getInventoryLowerLimit = async () => { ...@@ -351,6 +365,7 @@ const getInventoryLowerLimit = async () => {
} }
onMounted(async () => { onMounted(async () => {
getData() getData()
getUserMark()
getWarehouse() getWarehouse()
getInventoryLowerLimit() getInventoryLowerLimit()
}) })
...@@ -387,6 +402,7 @@ onMounted(async () => { ...@@ -387,6 +402,7 @@ onMounted(async () => {
prop="productNo" prop="productNo"
label="款号 " label="款号 "
></el-table-column> ></el-table-column>
<el-table-column align="center" prop="number" label="打印数量"> <el-table-column align="center" prop="number" label="打印数量">
<template #default="{ row }"> <template #default="{ row }">
<el-input <el-input
...@@ -407,10 +423,11 @@ onMounted(async () => { ...@@ -407,10 +423,11 @@ onMounted(async () => {
</el-dialog> </el-dialog>
<el-card> <el-card>
<el-form <el-form
ref="searchFormRef"
class="search-form" class="search-form"
inline inline
label-width="80px"
:model="searchForm" :model="searchForm"
ref="searchFormRef"
> >
<el-form-item label="仓库"> <el-form-item label="仓库">
<el-select <el-select
...@@ -418,7 +435,7 @@ onMounted(async () => { ...@@ -418,7 +435,7 @@ onMounted(async () => {
clearable clearable
filterable filterable
placeholder="请输入仓库" placeholder="请输入仓库"
style="width: 140px" style="width: 175px"
> >
<el-option <el-option
v-for="item in warehouseList" v-for="item in warehouseList"
...@@ -497,8 +514,21 @@ onMounted(async () => { ...@@ -497,8 +514,21 @@ onMounted(async () => {
clearable clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="所属客户">
<el-select
v-model="searchForm.userMark"
clearable
filterable
placeholder="请输入所属客户"
style="width: 140px"
>
<el-option
v-for="user in userMarkList" :key="user.userMark" :label="user.userMark" :value="user.userMark==='九猫商品'?'JMP':user.userMark"
></el-option>
</el-select>
</el-form-item>
<el-form-item style="margin-top: 5px"> <el-form-item style="margin-top: 5px">
<el-button type="primary" @click="getData" ref="searchBtnRef" <el-button ref="searchBtnRef" type="primary" @click="getData"
>查询</el-button >查询</el-button
> >
</el-form-item> </el-form-item>
...@@ -618,6 +648,11 @@ onMounted(async () => { ...@@ -618,6 +648,11 @@ onMounted(async () => {
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="userMark"
label="所属客户"
></el-table-column>
<el-table-column
align="center"
prop="unit" prop="unit"
label="单位" label="单位"
width="60" width="60"
......
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