Commit 392711a5 by linjinhong

Merge remote-tracking branch 'origin/master' into linjinhong

parents 27bd0959 8b05892d
......@@ -32,7 +32,6 @@ declare module 'vue' {
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElLink: typeof import('element-plus/es')['ElLink']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
......@@ -53,7 +52,6 @@ declare module 'vue' {
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload']
Icon: typeof import('./src/components/Icon.vue')['default']
ImageView: typeof import('./src/components/ImageView.vue')['default']
LogList: typeof import('./src/components/LogList.vue')['default']
......
......@@ -7,6 +7,7 @@ import {
LogListData,
ProductionClient,
WarehouseListData,
LogisticsData,
} from '@/types/api/podUsOrder'
import axios from './axios'
import { PodMakeOrderData } from '@/types/api/podMakeOrder'
......@@ -23,14 +24,18 @@ export interface AddressInfo {
receiverAddress2: string
receiverPostCode: string
}
export interface LogisticsData {
logisticsWayName: string // 物流名称
warehouseName: string // 发货仓库
status: boolean
logisticsWayCode: string // 物流编码
partition: string // 所在分区
logisticsWayId?: number | null
// 同步收货地址
export function syncReceiverAddress(data: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/syncReceiverAddress',
data,
)
}
export function refreshAddressApi(idList: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/syncReceiverAddress',
idList,
)
}
export function getOrderTabData() {
......@@ -38,7 +43,6 @@ export function getOrderTabData() {
'/factory/podJomallOrderUs/findStateGroupList',
)
}
export function getOrderList(
params: SearchForm,
currentPage: number,
......@@ -53,14 +57,12 @@ export function getOrderList(
},
)
}
export function handleExceptionOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/processExceptionOrders',
orderIds,
)
}
export function getCardOrderList(
params: SearchForm,
currentPage: number,
......@@ -75,7 +77,6 @@ export function getCardOrderList(
},
)
}
export function confirmOrderApi(
data: number[],
productionClient: string,
......@@ -92,13 +93,11 @@ export function confirmOrderApi(
},
)
}
export function getProductionClientApi() {
return axios.get<never, BaseRespData<ProductionClient[]>>(
'factory/podJomallOrderUs/getProductionClientList',
)
}
export function updateExceptionOrderApi(data: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/updateExceptionOrders',
......@@ -107,15 +106,6 @@ export function updateExceptionOrderApi(data: number[]) {
},
)
}
// 同步收货地址
export function syncReceiverAddress(data: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/syncReceiverAddress',
data,
)
}
export function changeExceptionOrderApi(
url: string,
ids: number[],
......@@ -128,7 +118,6 @@ export function changeExceptionOrderApi(
exceptionReason: value,
})
}
export function cancelOrderApi(ids: number[], value: string) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/cancelOrders',
......@@ -138,13 +127,11 @@ export function cancelOrderApi(ids: number[], value: string) {
},
)
}
export function getOperationLogApi(id: number) {
return axios.get<never, BaseRespData<LogListData[]>>(
`factory/podJomallOrderUsLog/getPodJomallOrderUsLog?id=${id}`,
)
}
export function getSubOrderBySubOrderNumber(factorySubOrderNumber: string) {
return axios.get<never, BaseRespData<ProductList>>(
'factory/podJomallOrderProductUs/getProductUsByFactorySubOrderNumber',
......@@ -155,14 +142,12 @@ export function getSubOrderBySubOrderNumber(factorySubOrderNumber: string) {
},
)
}
export function downloadMaterialApi(id: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderProductUs/downloadDesignImages',
id,
)
}
export function productionQueryApi(id: number, podJomallOrderUsId: number) {
return axios.post<never, BasePaginationData<never>>(
'factory/podJomallOrderProductUs/completeDelivery',
......@@ -172,14 +157,12 @@ export function productionQueryApi(id: number, podJomallOrderUsId: number) {
},
)
}
export function printProductionOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderUs/printProducePdf',
orderIds,
)
}
export function printPrintOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderUs/printPickPdf',
......@@ -188,7 +171,6 @@ export function printPrintOrderApi(orderIds: number[]) {
},
)
}
export function printPickingOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderUs/pickingComplete',
......@@ -197,13 +179,11 @@ export function printPickingOrderApi(orderIds: number[]) {
},
)
}
export function stockOutCheckApi(orderIds: number[]) {
return axios.get<never, BaseRespData<number[]>>(
`factory/podJomallOrderUs/replenishVerify?ids=${orderIds.join(',')}`,
)
}
export function toBePickingApi(orderIds: number[]) {
return axios.get<never, BaseRespData<never>>(
`factory/podJomallOrderUs/updateStockOutOrderToPicking?ids=${orderIds.join(
......@@ -211,13 +191,11 @@ export function toBePickingApi(orderIds: number[]) {
)}`,
)
}
export function getOrderDetailById(id: number) {
return axios.get<never, BaseRespData<ProductList>>(
`factory/podJomallOrderProductUs/getProductUsById?id=${id}`,
)
}
export function getPackingDataApi(
code: string,
factoryNo: number,
......@@ -236,7 +214,6 @@ export function getPackingDataApi(
},
)
}
export function getPodBoxListApi(
factoryNo: number | string,
warehouseId: number | string,
......@@ -261,7 +238,6 @@ export function submitInspectionApi(
},
)
}
export function clearBoxApi(
factoryNo: number,
box: number | null,
......@@ -274,13 +250,11 @@ export function clearBoxApi(
},
)
}
export function clearAllBoxApi() {
return axios.get<never, BaseRespData<never>>(
'factory/podJomallOrderUs/delPodBoxOrderDetails',
)
}
export function updateRemarkApi(id: number, content: string) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/addRemark',
......@@ -288,40 +262,23 @@ export function updateRemarkApi(id: number, content: string) {
)
}
export function refreshAddressApi(idList: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/syncReceiverAddress',
idList,
)
}
export function updateAddressApi(data: PodUsOrderListData) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/updateReceiverAddress',
data,
)
}
export function getLogisticsCalculation(id: number) {
return axios.get<never, BaseRespData<never>>(
'factory/podJomallOrderUs/getLogisticsCalculation',
{ params: { id } },
)
}
export function loadWarehouseListApi() {
return axios.get<never, BaseRespData<WarehouseListData[]>>(
'factoryWarehouseInfo/getAll',
)
}
export function refreshMaterialApi(orderIds: string) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderProductUs/refreshDesignImages ',
{ orderIds },
)
}
// 获取跟踪号
export function getTrackingNumberApi(orderIds: (string | number)[]) {
return axios.post<never, BaseRespData<never>>(
......@@ -329,7 +286,6 @@ export function getTrackingNumberApi(orderIds: (string | number)[]) {
orderIds,
)
}
// 获取打印面单
export function getfaceSimplexFileApi(orderIds: (string | number)[]) {
return axios.post<never, BaseRespData<never>>(
......@@ -337,7 +293,6 @@ export function getfaceSimplexFileApi(orderIds: (string | number)[]) {
orderIds,
)
}
// 取消物流订单
export function cancelLogisticsOrderApi(orderIds: (string | number)[]) {
return axios.post<never, BaseRespData<never>>(
......@@ -345,7 +300,6 @@ export function cancelLogisticsOrderApi(orderIds: (string | number)[]) {
orderIds,
)
}
// 更改物流
export function changeLogisticsApi(params: {
updateByIdParam: {
......@@ -359,7 +313,6 @@ export function changeLogisticsApi(params: {
params,
)
}
// 创建物流
export function createLogisticsOrderApi(params: {
updateByIdParam: {
......@@ -381,7 +334,6 @@ export function composingDesignImages(data: number[]) {
data,
)
}
// 转至待拣胚
export function updateLogisticsToPickingApi(params: { ids: string }) {
return axios.get<never, BaseRespData<never>>(
......@@ -391,7 +343,6 @@ export function updateLogisticsToPickingApi(params: { ids: string }) {
},
)
}
//创建物流订单
export function createLogisticsOrdersApi(orderIds: (string | number)[]) {
return axios.post<never, BaseRespData<never>>(
......
......@@ -5,7 +5,7 @@
<div class="upload-area" @click="triggerFileInput">
<el-icon class="el-icon--upload"><UploadFilled /></el-icon>
<div class="el-upload__text">
将文件拖到此处,或<span style="color: #409eff">点击上传</span>
<span style="color: #409eff">点击上传</span>
</div>
</div>
<input
......@@ -46,7 +46,14 @@
<script setup lang="ts">
import * as XLSX from 'xlsx'
import { ref, watch, defineProps, defineEmits, computed } from 'vue'
import {
ref,
watch,
defineProps,
defineEmits,
computed,
defineExpose,
} from 'vue'
import { UploadFilled, Document, Close } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import { uploadFileApi } from '@/api/common'
......@@ -89,7 +96,7 @@ watch(
const triggerFileInput = () => {
if (loading.value) return
fileInputRef.value?.click()
if (fileInputRef.value) fileInputRef.value?.click()
}
const downloadFile = (path: string) => {
window.open(path)
......@@ -120,8 +127,17 @@ const onFileChange = async (e: Event) => {
ElMessage.error('文件大小不能超过50MB')
return
}
if (props.importType === 'local') {
// 本地解析
if (props.importType === 'localAndUpload') {
// 本地直接获取上传内容
emit('imported', { path: file.name, data: file })
if (fileInputRef.value) {
fileInputRef.value.value = ''
}
loading.value = false
return
}
if (props.importType === 'localAndXlsx') {
// 本地解析,并自行处理xlsx数据
const reader = new FileReader()
reader.onload = (evt) => {
const data = evt.target?.result
......@@ -134,6 +150,7 @@ const onFileChange = async (e: Event) => {
fileList.value = [{ path: file.name, filename: file.name }]
value.value = file.name || ''
ElMessage.success('导入成功')
loading.value = false
}
reader.readAsBinaryString(file)
if (fileInputRef.value) fileInputRef.value.value = ''
......@@ -143,7 +160,18 @@ const onFileChange = async (e: Event) => {
await fileUpload(file)
if (fileInputRef.value) fileInputRef.value.value = ''
}
const resetUpload = () => {
fileList.value = []
value.value = ''
if (fileInputRef.value) {
fileInputRef.value.value = ''
}
}
// 暴露重置方法给父组件
defineExpose({
resetUpload,
})
const fileUpload = async (file: File) => {
const formData = new FormData()
const filename = file.name
......
......@@ -15,7 +15,8 @@ export interface Ilogistics {
}
export interface IsortingInfo {
id?: number
sortingFacility?: string | null
sortingArea: number | null
sortingAreaName?: string | null
serviceCode: string | null
}
}
\ No newline at end of file
......@@ -101,6 +101,10 @@ export interface ProductList {
lanshouAddress?: string | null
shopNumber?: string | null
factoryOrderNumber?: string | null
replenishmentNum?: number | null
isReplenishment?: boolean
thirdSkuCode?: string | null
supplierProductNo?: string | null
}
export interface cardImages {
title: string
......@@ -145,3 +149,23 @@ export interface WarehouseListData {
remarks?: string
sort?: number
}
export interface LogisticsData {
logisticsWayName: string // 物流名称
warehouseName: string // 发货仓库
status: boolean
logisticsWayCode: string // 物流编码
partition: string // 所在分区
logisticsWayId?: number | null
}
export interface AddressInfo {
id?: string
receiverName: string
receiverPhone: string
receiverCountry: string
receiverProvince: string
receiverCity: string
receiverDistrict: string
receiverAddress1: string
receiverAddress2: string
receiverPostCode: string
}
<script setup lang="ts">
import { Ilogistics, IsortingInfo } from '@/types/api/logistics'
import { Edit, Delete } from '@element-plus/icons-vue'
import { Edit, Delete, CirclePlus } from '@element-plus/icons-vue'
import {
getsortingConfigListApi,
usableAllList,
createSortingApi,
updateSortingApi,
deleteSortingApi,
} from '@/api/logistics.ts'
} from '@/api/logistics'
import { nextTick, ref } from 'vue'
import SplitDiv from '@/components/splitDiv/splitDiv.vue'
import usePageList from '@/utils/hooks/usePageList'
import { ElMessage, ElMessageBox } from 'element-plus'
interface InterForm {
id?: number
sortingFacility?: string | null
sortingArea: number | null
sortingAreaName?: string | null
serviceCode: string[]
}
const searchForm = ref({
sortingFacility: '',
sortingArea: null,
serviceCode: '',
serviceCode: [],
})
const selections = ref<IsortingInfo[]>([])
const formRef = ref()
const form = ref<IsortingInfo>({
const form = ref<InterForm>({
sortingFacility: '',
sortingArea: null,
sortingAreaName: '',
serviceCode: '',
serviceCode: [],
})
const createData = ref({
title: '',
show: false,
isEdit: false,
form: {
sortingFacility: '',
sortingArea: null,
sortingAreaName: '',
serviceCode: '',
serviceCode: [],
},
})
const rules = {
sortingFacility: [
{ required: true, message: '请输入分拣设备', trigger: 'blur' },
],
sortingArea: [{ required: true, message: '请选择分拣口', trigger: 'change' }],
serviceCode: [
{ required: true, message: '请选择物流方式', trigger: 'change' },
......@@ -51,6 +65,7 @@ const {
getsortingConfigListApi(
{
...searchForm.value,
serviceCode: searchForm.value.serviceCode.join(','),
},
page,
pageSize,
......@@ -100,7 +115,7 @@ const sortingList = ref<interSorting[]>([
},
{
label: 'E0',
value: 9,
value: 99,
},
])
const handleSelectionChange = (data: IsortingInfo[]) => {
......@@ -109,9 +124,15 @@ const handleSelectionChange = (data: IsortingInfo[]) => {
const handleConfirm = async () => {
await formRef.value?.validate()
if (!createData.value.isEdit) {
await createSortingApi(form.value)
await createSortingApi({
...form.value,
serviceCode: form.value.serviceCode.join(','),
})
} else {
await updateSortingApi(form.value)
await updateSortingApi({
...form.value,
serviceCode: form.value.serviceCode.join(','),
})
}
createData.value.show = false
ElMessage.success('操作成功')
......@@ -134,15 +155,34 @@ const handleBatchDelete = async (row: IsortingInfo | null) => {
ElMessage.success('删除成功')
await search()
}
const addLogistics = () => {
ElMessageBox.prompt('', '物流方式', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputErrorMessage: '请输入物流方式',
inputPlaceholder: '请输入物流方式',
}).then(({ value }: { value: string }) => {
if (!value.trim()) {
ElMessage.error('物流方式不能为空')
return
}
if (form.value.serviceCode.includes(value)) {
ElMessage.warning('物流方式已存在')
return
}
form.value.serviceCode.push(value)
ElMessage.success('添加成功')
})
}
const createWarehouse = () => {
createData.value.show = true
createData.value.isEdit = false
createData.value.title = '新增'
form.value = {
sortingFacility: '',
sortingArea: null,
sortingAreaName: '',
serviceCode: '',
serviceCode: [],
}
nextTick(() => {
formRef.value?.clearValidate()
......@@ -153,9 +193,11 @@ const updateSorting = (item: IsortingInfo) => {
createData.value.isEdit = true
createData.value.title = '修改'
form.value = {
id: item.id,
sortingFacility: item.sortingFacility,
sortingArea: item.sortingArea,
sortingAreaName: item.sortingAreaName,
serviceCode: item.serviceCode,
serviceCode: item.serviceCode ? item.serviceCode.split(',') : [],
}
nextTick(() => {
formRef.value?.clearValidate()
......@@ -173,6 +215,13 @@ const sortingChange = (v: number) => {
<template #top>
<el-card>
<el-form inline :model="searchForm">
<el-form-item label="分拣设备">
<el-input
v-model.trim="searchForm.sortingFacility"
placeholder="分拣设备"
clearable
></el-input>
</el-form-item>
<el-form-item label="分拣口">
<el-select
v-model="searchForm.sortingArea"
......@@ -192,6 +241,7 @@ const sortingChange = (v: number) => {
v-model="searchForm.serviceCode"
clearable
filterable
multiple
style="width: 160px"
>
<el-option
......@@ -225,7 +275,19 @@ const sortingChange = (v: number) => {
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" />
<el-table-column type="index" label="序号" width="60" />
<el-table-column
type="index"
label="序号"
width="60"
align="center"
/>
<el-table-column
align="center"
label="分拣设备"
width="540"
show-overflow-tooltip
prop="sortingFacility"
></el-table-column>
<el-table-column
align="center"
label="分拣口名称"
......@@ -234,6 +296,8 @@ const sortingChange = (v: number) => {
<el-table-column
align="center"
label="物流编码"
width="540"
show-overflow-tooltip
prop="serviceCode"
></el-table-column>
<el-table-column label="操作" align="center" width="100">
......@@ -261,15 +325,6 @@ const sortingChange = (v: number) => {
</el-table>
</div>
<div class="pagination">
<!-- <el-pagination
v-model:current-page="pagination.currentPage"
v-model:page-size="pagination.pageSize"
:page-sizes="[50, 100, 150, 200]"
layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/> -->
<ElPagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
......@@ -295,6 +350,13 @@ const sortingChange = (v: number) => {
:rules="rules"
:model="form"
>
<el-form-item label="分拣设备" prop="sortingFacility">
<el-input
v-model.trim="form.sortingFacility"
placeholder="分拣设备"
clearable
></el-input>
</el-form-item>
<el-form-item label="分拣口" prop="sortingArea">
<el-select
v-model="form.sortingArea"
......@@ -310,14 +372,31 @@ const sortingChange = (v: number) => {
</el-select>
</el-form-item>
<el-form-item label="物流方式" prop="serviceCode">
<el-select v-model="form.serviceCode" clearable filterable>
<el-option
v-for="item in logisticsMethodsList"
:key="item.serviceCode"
:label="item.serviceCode"
:value="item.serviceCode"
></el-option>
</el-select>
<div class="flex">
<el-select
v-model="form.serviceCode"
style="width: 320px"
clearable
filterable
multiple
>
<el-option
v-for="item in logisticsMethodsList"
:key="item.serviceCode"
:label="item.serviceCode"
:value="item.serviceCode"
></el-option>
</el-select>
&ensp;
<el-icon
color="#409eff"
size="30"
title="添加物流方式"
class="add-btn"
@click="addLogistics"
><CirclePlus
/></el-icon>
</div>
</el-form-item>
</el-form>
<template #footer>
......@@ -379,4 +458,7 @@ const sortingChange = (v: number) => {
}
}
}
.add-btn :hover {
cursor: pointer;
}
</style>
......@@ -247,7 +247,7 @@
<span v-if="status === 'PICKING'" class="item">
<ElButton
:loading="downloadLoading"
type="primary"
type="warning"
@click="downloadTif"
>
排版
......@@ -263,7 +263,7 @@
v-if="status === 'EXCEPTION_ORDER' && exceptionStatus === 3"
class="item"
>
<ElButton type="success" @click="asyncOrderAddress">
<ElButton type="warning" @click="asyncOrderAddress">
同步收货地址
</ElButton>
</span>
......@@ -400,6 +400,7 @@
:selectionable="true"
:paginated-data="tableData"
:cell-style="onCellStyle"
:cell-class-name="onCellClassName"
@selection-change="handleSelectionChange"
>
<template #goods="{ row }">
......@@ -442,6 +443,18 @@
</el-icon>
</div>
<div class="goods-item-info-item">
<span class="goods-item-info-item-label">库存SKU:</span>
<span class="goods-item-info-item-value">
{{ item.thirdSkuCode }}
</span>
<el-icon
class="icon"
@click="copy(item.thirdSkuCode || '')"
>
<DocumentCopy />
</el-icon>
</div>
<div class="goods-item-info-item">
<span class="goods-item-info-item-label">工艺:</span>
<span class="goods-item-info-item-value">
{{ item.craftName }}
......@@ -505,9 +518,9 @@
</span>
</div>
<div class="goods-item-info-item">
<span class="goods-item-info-item-label">货号:</span>
<span class="goods-item-info-item-label">供应货号:</span>
<span class="goods-item-info-item-value">
{{ item.thirdSkuCode }}
{{ item.supplierProductNo }}
</span>
</div>
</div>
......@@ -775,7 +788,7 @@
</div> -->
</template>
<template #exceptionReason="{ row }">
<div v-html="row.exceptionReason"></div>
<div style="white-space: pre-line">{{ row.exceptionReason }}</div>
</template>
<template #innerLabel="{ row }">
<div v-if="row.internalMemoList" class="inner-label-box">
......@@ -794,10 +807,7 @@
</template>
<template #operate="{ row }">
<div class="operate-box">
<span
class="operate-item"
style="display: flex; flex-direction: column"
>
<span class="operate-item">
<ElButton
link
type="primary"
......@@ -805,31 +815,34 @@
>
操作日志
</ElButton>
<!-- <ElButton
v-if="!row.expressSheet && row.status === 'TO_BE_CONFIRMED'"
link
type="primary"
@click="confirm(row)"
>
</span>
<!-- <span
v-if="!row.expressSheet && row.status === 'TO_BE_CONFIRMED'"
class="operate-item"
>
<ElButton link type="primary" @click="confirm(row)">
确认
</ElButton> -->
<ElButton
v-if="
row.shipmentType === 1 &&
['CREATE_LOGISTICS', 'WAIT_SHIPMENT'].includes(status)
"
link
type="primary"
@click="handleUpdateAddress(row)"
>
</ElButton>
</span> -->
<span
v-if="
row.shipmentType === 1 &&
['CREATE_LOGISTICS', 'WAIT_SHIPMENT'].includes(status)
"
class="operate-item"
>
<ElButton link type="primary" @click="handleUpdateAddress(row)">
修改地址
</ElButton>
</span>
<span
v-if="
row.shipmentType === 0 &&
['CREATE_LOGISTICS', 'WAIT_SHIPMENT'].includes(status)
"
class="operate-item"
>
<ElButton
v-if="
row.shipmentType === 0 &&
['CREATE_LOGISTICS', 'WAIT_SHIPMENT'].includes(status)
"
link
type="primary"
@click="handleRefreshAddress(row)"
......@@ -932,10 +945,17 @@
</span>
</div>
<div class="grid-item">
<span title="Variant SKU" class="grid-item-value">
{{ cardItem?.variantSku }}
<span title="库存SKU" class="grid-item-value">
{{ cardItem?.thirdSkuCode }}
</span>
</div>
<div class="grid-item">
<span class="grid-item-label">供应货号:</span>
<span title="供应货号" class="grid-item-value">
{{ cardItem?.supplierProductNo }}
</span>
</div>
<div class="grid-item" title="店铺单号">
<span class="grid-item-value">
{{ cardItem?.shopNumber }}
......@@ -1268,6 +1288,7 @@
</template>
<script setup lang="ts">
import { getUserMarkList } from '@/api/common'
import { ArrowDown, WarningFilled } from '@element-plus/icons-vue'
import {
getCardOrderList,
......@@ -1290,7 +1311,6 @@ import {
loadWarehouseListApi,
getLogisticsCalculation,
refreshMaterialApi,
LogisticsData,
getTrackingNumberApi,
getfaceSimplexFileApi,
cancelLogisticsOrderApi,
......@@ -1301,13 +1321,16 @@ import {
createLogisticsOrdersApi,
syncReceiverAddress,
refreshAddressApi,
AddressInfo,
confirmProductApi,
confirmProductToRiinApi,
// handleExceptionOrderApi,
} from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api'
import UpdateAddress from './components/updateAddress.vue'
import { getAllCountryApi } from '@/api/logistics.ts'
import TableView from '@/components/TableView.vue'
import {
LogListData,
......@@ -1318,6 +1341,8 @@ import {
Tab,
WarehouseListData,
cardImages,
AddressInfo,
LogisticsData,
} from '@/types/api/podUsOrder'
import usePageList from '@/utils/hooks/usePageList'
import { useValue } from '@/utils/hooks/useValue'
......@@ -1335,7 +1360,6 @@ import RightClickMenu from '@/components/RightClickMenu.vue'
import ResultInfo from './components/ResultInfo.vue'
import { isArray, isString } from '@/utils/validate'
import platformJson from '../../../json/platform.json'
import { getAllCountryApi } from '@/api/logistics.ts'
declare global {
interface Window {
ActiveXObject: {
......@@ -1350,15 +1374,9 @@ declare global {
responseBody?: unknown
}
}
const updateAddVisible = ref(false)
const tabsNav = ref<Tab[]>()
const countryList = ref([])
const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null)
const confirmDialogShow = ref(false)
const downloadLoading = ref(false)
const isChangeWay = ref(false)
const confirmData = ref([])
const logisticsWayData = ref([])
const currentRow = ref<AddressInfo>({
receiverName: '',
receiverPhone: '',
......@@ -1370,6 +1388,14 @@ const currentRow = ref<AddressInfo>({
receiverAddress2: '',
receiverPostCode: '',
})
const updateAddVisible = ref(false)
const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null)
const confirmDialogShow = ref(false)
const downloadLoading = ref(false)
const isChangeWay = ref(false)
const confirmData = ref([])
const logisticsWayData = ref([])
const confirmSelectionData = ref<LogisticsData[]>([])
const confirmRowData = ref<ProductList | null>(null)
const status = ref('TO_BE_CONFIRMED')
......@@ -1519,17 +1545,18 @@ const tableColumns = computed(() => [
prop: 'time',
align: 'left',
},
{
label: '内部便签',
slot: 'innerLabel',
width: 300,
prop: 'innerLabel',
},
// {
// label: '内部便签',
// slot: 'innerLabel',
// width: 300,
// prop: 'innerLabel',
// },
{
label: '异常原因',
width: 300,
prop: 'exceptionReason',
slot: 'exceptionReason',
align: 'left',
},
{
label: '操作',
......@@ -1606,11 +1633,17 @@ const onCellStyle = ({ column }: { column: Column }) => {
column.property === 'time' ||
column.property === 'innerLabel' ||
column.property === 'goods' ||
column.property === 'operate'
column.property === 'operate' ||
column.property === 'exceptionReason'
) {
return { verticalAlign: 'top' }
}
}
const onCellClassName = ({ column }: { column: Column }) => {
if (column.property === 'exceptionReason') {
return 'exception-reason'
}
}
const loadTabData = async () => {
try {
const res = await getOrderTabData()
......@@ -1901,7 +1934,6 @@ const updateOrder = async () => {
loading.close()
}
}
const assignOrder = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
......@@ -2800,7 +2832,13 @@ const handleExceptionCommand = (command: number) => {
font-weight: 600;
}
}
.table-wrapper {
:deep(.exception-reason) {
.cell {
white-space: wrap;
}
}
}
.goods-item {
display: grid;
grid-template-columns: 100px 1fr minmax(180px, 1fr) 140px;
......@@ -2981,14 +3019,13 @@ const handleExceptionCommand = (command: number) => {
}
}
.operate-item {
.el-button {
margin-left: 0 !important;
margin-top: 20px !important;
}
.operate-box {
display: flex;
flex-direction: column;
gap: 10px;
}
</style>
<style>
<style lang="scss">
.customize-select-style {
.el-select-dropdown__list {
width: 500px;
......
......@@ -319,10 +319,10 @@
style="width: 130px"
/>
</el-form-item>
<el-form-item label="供应货号">
<el-form-item label="供应货号">
<el-input
v-model="detailForm.supplierItemNo"
placeholder="请输入供应货号"
placeholder="请输入供应货号"
clearable
style="width: 130px"
/>
......@@ -501,7 +501,7 @@
show-overflow-tooltip
></el-table-column>
<el-table-column
label="供应货号"
label="供应货号"
prop="supplier_item_no"
header-align="center"
align="center"
......
......@@ -272,7 +272,7 @@ const priceModification = (type: 1 | 3 | 4) => {
show-overflow-tooltip
></el-table-column>
<el-table-column
label="供应货号"
label="供应货号"
prop="supplier_item_no"
header-align="center"
align="center"
......
......@@ -71,11 +71,11 @@
style="width: 160px"
/>
</ElFormItem>
<ElFormItem style="margin-right: 10px" label="SKU">
<ElFormItem style="margin-right: 10px" label="库存SKU">
<ElInput
v-model.trim="searchForm.warehouseSku"
clearable
placeholder="请输入SKU"
placeholder="请输入库存SKU"
style="width: 160px"
/>
</ElFormItem>
......@@ -119,7 +119,7 @@
</el-button>
<el-button type="success" @click="handleExport"> 导出 </el-button>
<el-button type="primary" @click="printProductTag">
打印商品SKU标签
打印库存SKU标签
</el-button>
<el-button
v-if="nodeCode === 'PENDING_AUDIT'"
......@@ -308,20 +308,20 @@
<ElTableColumn
show-overflow-tooltip
align="center"
label="商品SKU"
label="库存SKU"
prop="warehouseSku"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="SKU名称"
label="库存SKU"
prop="skuName"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="货号"
label="供应货号"
prop="productNo"
/>
<ElTableColumn
......@@ -400,10 +400,16 @@
:close-on-click-modal="false"
>
<div class="import-dialog">
<div class="import-header">
<el-button type="primary" link @click="downloadTemplate">
<el-icon><Download /></el-icon>
下载模板
</el-button>
</div>
<div class="import-content">
<UploadExcel
v-model="importedFileUrl"
:import-type="'local'"
:import-type="'localAndXlsx'"
@imported="handleLocalImport"
/>
</div>
......@@ -481,20 +487,20 @@
<ElTableColumn
show-overflow-tooltip
align="center"
label="商品SKU"
label="库存SKU"
prop="warehouseSku"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="SKU名称"
label="商品名称"
prop="skuName"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="货号"
label="供应货号"
prop="productNo"
/>
<ElTableColumn
......@@ -566,7 +572,7 @@
<div>
<el-input
v-model.trim="selectSku"
placeholder="商品SKU"
placeholder="库存SKU"
style="width: 200px; margin: 0 10px"
clearable
size="small"
......@@ -595,7 +601,7 @@
<ElTableColumn
show-overflow-tooltip
align="center"
label="商品SKU"
label="库存SKU"
width="200"
prop="skuName"
/>
......@@ -604,13 +610,13 @@
show-overflow-tooltip
align="center"
width="200"
label="SKU名称"
label="库存SKU"
prop="warehouseSku"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="货号"
label="供应货号"
prop="productNo"
/>
<ElTableColumn
......@@ -732,7 +738,7 @@
<el-table-column
align="center"
prop="warehouseSku"
label="商品SKU"
label="库存SKU"
></el-table-column>
<el-table-column
align="center"
......@@ -742,7 +748,7 @@
<el-table-column
align="center"
prop="supplierItemNo"
label="货号"
label="供应货号"
></el-table-column>
<el-table-column align="center" prop="number" label="打印数量">
<template #default="{ row }">
......@@ -791,7 +797,7 @@
<script setup lang="ts">
import { ElMessage, ElRadioGroup, ElTree } from 'element-plus'
import { CirclePlusFilled } from '@element-plus/icons-vue'
import { CirclePlusFilled,Download } from '@element-plus/icons-vue'
import splitDiv from '@/components/splitDiv/splitDiv.vue'
import { ElTable } from 'element-plus'
import usePageList from '@/utils/hooks/usePageList'
......@@ -951,6 +957,14 @@ function getStartTime() {
const day = date.getDate()
return `${year}-${month}-${day} 00:00:00`
}
const downloadTemplate = () => {
const link = document.createElement('a')
link.href = '/files/outboundOrder.xlsx'
link.download = 'outboundOrder.xlsx'
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
const selectSku = ref('')
const treeData = ref<InterWarehouseTree[]>()
const [searchForm, resetSearchForm] = useValue<warehouseSearchForm>({})
......@@ -1097,15 +1111,15 @@ const batchAddCommodity = async (sku: string): Promise<InterskuList[]> => {
}
}
interface InterImportData {
warehouseSku: string;
remark?: string | null;
buyStored?: string | number | null | object; // 扩大 buyStored 类型,以兼容原始数据
warehouseSku: string
remark?: string | null
buyStored?: string | number | null | object // 扩大 buyStored 类型,以兼容原始数据
[propName: string]: string | number | boolean | undefined | unknown
}
// 前端导入Excel
const excelFieldMap: Record<string, keyof InterImportData> = {
// SKU图片: 'skuImage',
商品SKU: 'warehouseSku',
库存SKU: 'warehouseSku',
// SKU名称: 'skuName',
// 出库数量: 'outCount',
// 可用库存数量: 'usableInventory',
......@@ -1119,94 +1133,111 @@ const handleLocalImport = async ({
data,
}: {
path: string
data: Record<string, any>[]
data: Record<string, unknown>[]
}) => {
// 1. 将原始导入数据映射到 InterImportData[]
const importedData: InterImportData[] = data.map(item => {
const obj: InterImportData = { warehouseSku: '' };
Object.keys(excelFieldMap).forEach(excelKey => {
const field = excelFieldMap[excelKey];
const value = item[excelKey];
const importedData: InterImportData[] = data
.map((item) => {
const obj: InterImportData = { warehouseSku: '' }
Object.keys(excelFieldMap).forEach((excelKey) => {
const field = excelFieldMap[excelKey]
const value = item[excelKey]
if (field === 'warehouseSku') {
obj[field] = typeof value === 'string' ? value : String(value ?? '');
obj[field] = typeof value === 'string' ? value : String(value ?? '')
} else if (field === 'remark') {
obj[field] = typeof value === 'string' ? value : (value === null || value === undefined ? null : String(value));
obj[field] =
typeof value === 'string'
? value
: value === null || value === undefined
? null
: String(value)
} else if (field === 'buyStored') {
// 处理 buyStored: 确保它是一个数字、数字字符串,否则设置为 null
if (typeof value === 'number') {
obj[field] = String(value); // 将数字转换为字符串
} else if (typeof value === 'string' && !isNaN(Number(value))) {
obj[field] = value; // 保持有效的数字字符串
} else {
// 如果不是数字或有效的数字字符串,则设置为 null
obj[field] = null;
}
// 处理 buyStored: 确保它是一个数字、数字字符串,否则设置为 null
if (typeof value === 'number') {
obj[field] = String(value) // 将数字转换为字符串
} else if (typeof value === 'string' && !isNaN(Number(value))) {
obj[field] = value // 保持有效的数字字符串
} else {
// 如果不是数字或有效的数字字符串,则设置为 null
obj[field] = null
}
} else {
obj[field] = value;
obj[field] = value
}
});
return obj;
}).filter(item => item.warehouseSku);
})
return obj
})
.filter((item) => item.warehouseSku)
if (importedData.length === 0) {
ElMessage.warning('导入数据中没有有效的商品SKU');
ElMessage.warning('导入数据中没有有效的库存SKU');
importDialogVisible.value = false;
return;
}
// 2. 提取导入的 SKU 列表
const importedSkus = importedData.map(item => item.warehouseSku).join(',');
const importedSkus = importedData.map((item) => item.warehouseSku).join(',')
// 3. 调用 batchAddCommodity 获取商品的完整信息并过滤掉已有的 SKU
const filteredSkusList = await batchAddCommodity(importedSkus);
const filteredSkusList = await batchAddCommodity(importedSkus)
if (filteredSkusList.length === 0) {
ElMessage.warning('导入的商品SKU已存在或无效');
ElMessage.warning('导入的库存SKU已存在或无效');
importedFileUrl.value = path;
importDialogVisible.value = false;
return;
}
// 4. 将备注信息合并到获取到的商品列表中
const mergedProductList = filteredSkusList.map(skuItem => {
const importedItem = importedData.find(item => item.warehouseSku === skuItem.warehouseSku);
let outCountValueForBigNumber: string | number = '0'; // 初始化为安全默认值
const mergedProductList = filteredSkusList.map((skuItem) => {
const importedItem = importedData.find(
(item) => item.warehouseSku === skuItem.warehouseSku,
)
if (importedItem?.buyStored !== null && importedItem?.buyStored !== undefined) {
if (typeof importedItem.buyStored === 'string' && !isNaN(Number(importedItem.buyStored))) {
outCountValueForBigNumber = importedItem.buyStored;
} else if (typeof importedItem.buyStored === 'number') {
outCountValueForBigNumber = importedItem.buyStored;
} else {
// 如果是对象或其他意外类型,则默认为 '0'
outCountValueForBigNumber = '0';
}
let outCountValueForBigNumber: string | number = '0' // 初始化为安全默认值
if (
importedItem?.buyStored !== null &&
importedItem?.buyStored !== undefined
) {
if (
typeof importedItem.buyStored === 'string' &&
!isNaN(Number(importedItem.buyStored))
) {
outCountValueForBigNumber = importedItem.buyStored
} else if (typeof importedItem.buyStored === 'number') {
outCountValueForBigNumber = importedItem.buyStored
} else {
// 如果是对象或其他意外类型,则默认为 '0'
outCountValueForBigNumber = '0'
}
const calculatedOutCount = new BigNumber(outCountValueForBigNumber).toNumber();
}
return {
skuImage: skuItem.image,
warehouseSku: skuItem.warehouseSku,
skuName: skuItem.skuName,
productNo: skuItem.productNumber,
locationCode: skuItem.locationCode ?? '',
locationId: skuItem.locationId ?? null,
costPrice: skuItem.price,
outCount: calculatedOutCount,
totalPrice: new BigNumber(calculatedOutCount).multipliedBy(skuItem.price ?? 0).toNumber(),
usableInventory: skuItem.usableInventory,
inventoryId: skuItem.id,
remark: importedItem?.remark ?? skuItem.remark ?? null,
} as InterProductList;
});
const calculatedOutCount = new BigNumber(
outCountValueForBigNumber,
).toNumber()
return {
skuImage: skuItem.image,
warehouseSku: skuItem.warehouseSku,
skuName: skuItem.skuName,
productNo: skuItem.productNumber,
locationCode: skuItem.locationCode ?? '',
locationId: skuItem.locationId ?? null,
costPrice: skuItem.price,
outCount: calculatedOutCount,
totalPrice: new BigNumber(calculatedOutCount)
.multipliedBy(skuItem.price ?? 0)
.toNumber(),
usableInventory: skuItem.usableInventory,
inventoryId: skuItem.id,
remark: importedItem?.remark ?? skuItem.remark ?? null,
} as InterProductList
})
// 5. 更新 otherPurchaseData
otherPurchaseData.value = [...otherPurchaseData.value, ...mergedProductList];
otherPurchaseData.value = [...otherPurchaseData.value, ...mergedProductList]
importedFileUrl.value = path
importDialogVisible.value = false
......@@ -1974,7 +2005,7 @@ $border: solid 1px #ddd;
}
.import-content {
padding: 20px 0;
padding-bottom: 20px;
}
}
......
......@@ -13,11 +13,57 @@ import {
factoryWarehouseInfoPrint,
importWarehouseLocation,
} from '@/api/warehouse.ts'
const uploadExcelRef = ref()
import { Download } from '@element-plus/icons-vue'
import { nextTick, ref } from 'vue'
import SplitDiv from '@/components/splitDiv/splitDiv.vue'
import { filePath } from '@/api/axios.ts'
const importLoading = ref(false)
import UploadExcel from '@/components/UploadExcel.vue'
const importDialogVisible = ref(false)
const importedFileUrl = ref('')
const importLocation = async () => {
importDialogVisible.value = true
importedFileUrl.value = ''
nextTick(() => {
uploadExcelRef.value?.resetUpload()
})
}
const handleLocalImport = async ({
path,
data,
}: {
path: string
data: Blob
}) => {
try {
const formData = new FormData()
formData.append('importExcel', data)
const res = await importWarehouseLocation(formData)
if (res.code == 200) {
importedFileUrl.value = path
ElMessage.success('导入成功')
await getData()
} else {
importedFileUrl.value = ''
ElMessage.error(res.message || '导入失败')
}
} catch (error) {
importedFileUrl.value = ''
ElMessage.error('导入失败')
} finally {
importDialogVisible.value = false
importedFileUrl.value = ''
}
}
const downloadTemplate = () => {
const link = document.createElement('a')
link.href = '/files/warehouseLocationTemplate.xlsx'
link.download = 'warehouseLocationTemplate.xlsx'
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
// const importLoading = ref(false)
const searchForm = ref({
warehouseId: '',
locationCode: '',
......@@ -60,9 +106,7 @@ const rules = {
pickingOrder: [
{ required: true, message: '请输入拣货顺序', trigger: 'blur' },
],
warehouseId: [
{ required: true, message: '请选择仓库', trigger: 'change' },
],
warehouseId: [{ required: true, message: '请选择仓库', trigger: 'change' }],
}
const leftData = ref<positionInfo[]>([])
const pagination = ref<factoryWarehouseInfo>({
......@@ -129,41 +173,43 @@ const handleBatchDelete = async (row: positionInfo | null) => {
cancelButtonText: '取消',
type: 'warning',
})
const str = row && row.id ? row.id?.toString() : selections.value.map((el) => el.id).join(',')
const str =
row && row.id
? row.id?.toString()
: selections.value.map((el) => el.id).join(',')
await deleteLocationApi(str)
ElMessage.success('删除成功')
await getData()
}
const importLocation = async () => {
const i = document.createElement('input')
i.type = 'file'
i.style.display = 'none'
i.accept = '.xlsx,.xls'
i.click()
i.onchange = async () => {
if (i && i.files) {
importLoading.value = true
try {
console.log(i.files[0])
const formData = new FormData()
formData.append('importExcel', i.files[0])
await importWarehouseLocation(formData)
ElMessage.success('导入成功')
await getData()
} finally {
importLoading.value = false
}
// const importLocation = async () => {
// const i = document.createElement('input')
// i.type = 'file'
// i.style.display = 'none'
// i.accept = '.xlsx,.xls'
// i.click()
}
}
}
// i.onchange = async () => {
// if (i && i.files) {
// importLoading.value = true
// try {
// console.log(i.files[0])
// // const formData = new FormData()
// // formData.append('importExcel', i.files[0])
// // await importWarehouseLocation(formData)
// // ElMessage.success('导入成功')
// // await getData()
// } finally {
// importLoading.value = false
// }
// }
// }
// }
const createWarehouse = () => {
createData.value.show = true
createData.value.isEdit = false
createData.value.title = '新增库位'
const warehouse = warehouseList.value.find(w => w.defaulted === 1)
const warehouse = warehouseList.value.find((w) => w.defaulted === 1)
form.value = {
locationName: '',
locationCode: '',
......@@ -207,7 +253,7 @@ const getWarehouse = async () => {
warehouseList.value = data
}
const warehouseChange = (v: number) => {
const warehouse = warehouseList.value.find(w => w.id == v)
const warehouse = warehouseList.value.find((w) => w.id == v)
form.value.warehouseName = warehouse ? warehouse.name : ''
}
getWarehouse()
......@@ -219,37 +265,75 @@ getWarehouse()
<el-card>
<el-form inline :model="searchForm">
<el-form-item label="仓库">
<el-select v-model="searchForm.warehouseId" placeholder="请选择仓库" clearable filterable
style="width: 150px;">
<el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id"></el-option>
<el-select
v-model="searchForm.warehouseId"
placeholder="请选择仓库"
clearable
filterable
style="width: 150px"
>
<el-option
v-for="item in warehouseList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="库位名称">
<el-input
v-model="searchForm.locationName" style="width: 140px;" placeholder="请输入库位名称"
clearable></el-input>
v-model="searchForm.locationName"
style="width: 140px"
placeholder="请输入库位名称"
clearable
></el-input>
</el-form-item>
<el-form-item label="库位编码">
<el-input
v-model="searchForm.locationCode" style="width: 140px;" placeholder="请输入库位编码"
clearable></el-input>
v-model="searchForm.locationCode"
style="width: 140px"
placeholder="请输入库位编码"
clearable
></el-input>
</el-form-item>
<el-form-item label="备注">
<el-input
v-model="searchForm.remark" style="width: 140px;" placeholder="请输入备注"
clearable></el-input>
v-model="searchForm.remark"
style="width: 140px"
placeholder="请输入备注"
clearable
></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="searchForm.status" placeholder="请选择状态" clearable filterable style="width: 150px;">
<el-option v-for="(item,index) in ['禁用','启用']" :key="index" :label="item" :value="index"></el-option>
<el-select
v-model="searchForm.status"
placeholder="请选择状态"
clearable
filterable
style="width: 150px"
>
<el-option
v-for="(item, index) in ['禁用', '启用']"
:key="index"
:label="item"
:value="index"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getData">查询</el-button>
<el-button type="success" @click="createWarehouse">新增库位</el-button>
<el-button :loading="importLoading" type="primary" @click="importLocation">导入库位</el-button>
<el-button type="primary" @click="printLocationTag">打印库位标签</el-button>
<el-button type="danger" @click="handleBatchDelete(null)">删除</el-button>
<el-button type="success" @click="createWarehouse"
>新增库位</el-button
>
<el-button type="primary" @click="importLocation"
>导入库位</el-button
>
<el-button type="primary" @click="printLocationTag"
>打印库位标签</el-button
>
<el-button type="danger" @click="handleBatchDelete(null)"
>删除</el-button
>
</el-form-item>
</el-form>
</el-card>
......@@ -257,30 +341,66 @@ getWarehouse()
<template #bottom>
<el-card style="height: 100%">
<div class="manage">
<div class="table-flex">
<div class="left-table">
<div class="table-container">
<el-table height="100%" :data="leftData" border @selection-change="handleSelectionChange">
<el-table
height="100%"
:data="leftData"
border
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" />
<el-table-column type="index" label="序号" width="60" />
<el-table-column width="100" label="启用状态" prop="status" align="center">
<template #default="{row}">
<el-table-column
width="100"
label="启用状态"
prop="status"
align="center"
>
<template #default="{ row }">
<el-switch
v-model="row.status" :active-value="1" :inactive-value="0"
@click="updateStatus(row)"></el-switch>
v-model="row.status"
:active-value="1"
:inactive-value="0"
@click="updateStatus(row)"
></el-switch>
</template>
</el-table-column>
<el-table-column align="center" label="所属仓库" prop="warehouseName"></el-table-column>
<el-table-column align="center" label="库位名称" prop="locationName"></el-table-column>
<el-table-column align="center" label="库位编码" prop="locationCode"></el-table-column>
<el-table-column align="center" label="拣货顺序" prop="pickingOrder"></el-table-column>
<el-table-column align="center" label="备注" prop="remark"></el-table-column>
<el-table-column
align="center"
label="所属仓库"
prop="warehouseName"
></el-table-column>
<el-table-column
align="center"
label="库位名称"
prop="locationName"
></el-table-column>
<el-table-column
align="center"
label="库位编码"
prop="locationCode"
></el-table-column>
<el-table-column
align="center"
label="拣货顺序"
prop="pickingOrder"
></el-table-column>
<el-table-column
align="center"
label="备注"
prop="remark"
></el-table-column>
<el-table-column label="操作" align="center">
<template #default="{row}">
<el-button type="primary" @click="updateWarehouse(row)">编辑</el-button>
<el-button type="danger" @click="handleBatchDelete(row)">删除</el-button>
<template #default="{ row }">
<el-button type="primary" @click="updateWarehouse(row)"
>编辑</el-button
>
<el-button type="danger" @click="handleBatchDelete(row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -296,40 +416,68 @@ getWarehouse()
@current-change="handleCurrentChange"
/>
</div>
</div>
</div>
<el-dialog v-model="createData.show" width="500px" :title="createData.title">
<el-form ref="formRef" label-width="110px" :rules="rules" :model="form">
<el-dialog
v-model="createData.show"
width="500px"
:title="createData.title"
>
<el-form
ref="formRef"
label-width="110px"
:rules="rules"
:model="form"
>
<el-form-item label="库位名称" prop="locationName">
<el-input v-model="form.locationName" clearable placeholder="请输入库位名称"></el-input>
<el-input
v-model="form.locationName"
clearable
placeholder="请输入库位名称"
></el-input>
</el-form-item>
<el-form-item label="库位编码" prop="locationCode">
<el-input v-model="form.locationCode" clearable placeholder="请输入库位编码(例如:A1-01-03)"></el-input>
<el-input
v-model="form.locationCode"
clearable
placeholder="请输入库位编码(例如:A1-01-03)"
></el-input>
</el-form-item>
<el-form-item label="拣货顺序" prop="pickingOrder">
<el-input-number v-model="form.pickingOrder" placeholder="拣货顺序"></el-input-number>
<el-input-number
v-model="form.pickingOrder"
placeholder="拣货顺序"
></el-input-number>
</el-form-item>
<el-form-item label="所属仓库" prop="warehouseId">
<el-select v-model="form.warehouseId" @change="warehouseChange">
<el-option
v-for="item in warehouseList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
v-for="item in warehouseList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark" type="textarea" :rows="4" clearable
placeholder="请输入备注"></el-input>
v-model="form.remark"
type="textarea"
:rows="4"
clearable
placeholder="请输入备注"
></el-input>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-switch
v-model="form.status" :active-value="1" :inactive-value="0"
v-model="form.status"
:active-value="1"
:inactive-value="0"
></el-switch>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="createData.show=false">取消</el-button>
<el-button @click="createData.show = false">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
</template>
</el-dialog>
......@@ -337,6 +485,29 @@ getWarehouse()
</el-card>
</template>
</split-div>
<ElDialog
v-model="importDialogVisible"
title="导入"
width="500px"
:close-on-click-modal="false"
>
<div class="import-dialog">
<div class="import-header">
<el-button type="primary" link @click="downloadTemplate">
<el-icon><Download /></el-icon>
下载模板
</el-button>
</div>
<div class="import-content">
<UploadExcel
ref="uploadExcelRef"
v-model="importedFileUrl"
:import-type="'localAndUpload'"
@imported="handleLocalImport"
/>
</div>
</div>
</ElDialog>
</template>
<style scoped lang="scss">
......@@ -345,7 +516,16 @@ getWarehouse()
height: 100%;
}
}
.import-dialog {
.import-header {
display: flex;
justify-content: flex-end;
}
.import-content {
padding-bottom: 20px;
}
}
.manage {
height: 100%;
display: flex;
......
......@@ -71,11 +71,11 @@
style="width: 160px"
/>
</ElFormItem>
<ElFormItem style="margin-right: 10px" label="SKU">
<ElFormItem style="margin-right: 10px" label="库存SKU">
<ElInput
v-model="searchForm.warehouseSku"
clearable
placeholder="请输入SKU"
placeholder="请输入库存SKU"
style="width: 160px"
/>
</ElFormItem>
......@@ -119,7 +119,7 @@
</el-button>
<el-button type="success" @click="handleExport"> 导出</el-button>
<el-button type="primary" @click="printProductTag">
打印商品SKU标签
打印库存SKU标签
</el-button>
<el-button
v-if="nodeCode === 'PENDING_AUDIT'"
......@@ -316,20 +316,20 @@
<ElTableColumn
show-overflow-tooltip
align="center"
label="商品SKU"
label="库存SKU"
prop="warehouseSku"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="SKU名称"
label="商品名称"
prop="skuName"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="货号"
label="供应货号"
prop="productNo"
/>
<ElTableColumn
......@@ -432,16 +432,16 @@
:close-on-click-modal="false"
>
<div class="import-dialog">
<!-- <div class="import-header">
<div class="import-header">
<el-button type="primary" link @click="downloadTemplate">
<el-icon><Download /></el-icon>
下载模板
</el-button>
</div> -->
</div>
<div class="import-content">
<UploadExcel
v-model="importedFileUrl"
:import-type="'local'"
:import-type="'localAndXlsx'"
@imported="handleLocalImport"
/>
</div>
......@@ -519,20 +519,20 @@
<ElTableColumn
show-overflow-tooltip
align="center"
label="商品SKU"
label="库存SKU"
prop="warehouseSku"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="SKU名称"
label="商品名称"
prop="skuName"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="货号"
label="供应货号"
prop="productNo"
/>
<ElTableColumn align="center" label="入库数量" prop="buyStored">
......@@ -602,7 +602,7 @@
<div>
<el-input
v-model.trim="selectSku"
placeholder="商品SKU"
placeholder="库存SKU"
style="width: 200px; margin: 0 10px"
clearable
size="small"
......@@ -631,7 +631,7 @@
<ElTableColumn
show-overflow-tooltip
align="center"
label="商品SKU"
label="库存SKU"
width="200"
prop="skuName"
/>
......@@ -640,13 +640,13 @@
show-overflow-tooltip
align="center"
width="200"
label="SKU名称"
label="库存SKU"
prop="sku"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="货号"
label="供应货号"
prop="productNo"
/>
<ElTableColumn
......@@ -770,7 +770,7 @@
<el-table-column
align="center"
prop="warehouseSku"
label="商品SKU"
label="库存SKU"
></el-table-column>
<el-table-column
align="center"
......@@ -780,7 +780,7 @@
<el-table-column
align="center"
prop="supplierItemNo"
label="货号"
label="供应货号"
></el-table-column>
<el-table-column align="center" prop="number" label="打印数量">
<template #default="{ row }">
......@@ -829,7 +829,7 @@
<script setup lang="ts">
import { ElMessage, ElRadioGroup, ElTree } from 'element-plus'
import { CirclePlusFilled } from '@element-plus/icons-vue'
import { CirclePlusFilled,Download } from '@element-plus/icons-vue'
import splitDiv from '@/components/splitDiv/splitDiv.vue'
import { ElTable } from 'element-plus'
import usePageList from '@/utils/hooks/usePageList'
......@@ -989,7 +989,14 @@ function getStartTime() {
const day = date.getDate()
return `${year}-${month}-${day} 00:00:00`
}
const downloadTemplate = () => {
const link = document.createElement('a')
link.href = '/files/warehousingEntry.xlsx'
link.download = 'warehousingEntry.xlsx'
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
const selectSku = ref('')
const treeData = ref<InterWarehouseTree[]>()
const [searchForm, resetSearchForm] = useValue<warehouseSearchForm>({})
......@@ -1146,7 +1153,7 @@ interface InterImportData {
// 前端导入Excel
const excelFieldMap: Record<string, keyof InterProductList> = {
// SKU图片: 'skuImage',
商品SKU: 'warehouseSku',
库存SKU: 'warehouseSku',
// SKU名称: 'skuName',
入库数量: 'buyStored',
// '成本价(¥)': 'costPrice',
......@@ -1960,7 +1967,7 @@ $border: solid 1px #ddd;
}
.import-content {
padding: 20px 0;
padding-bottom: 20px;
}
}
......
......@@ -194,7 +194,7 @@ getWarehouse()
<el-table-column
align="center"
prop="warehouseSku"
label="商品SKU"
label="库存SKU"
></el-table-column>
<el-table-column
align="center"
......@@ -204,7 +204,7 @@ getWarehouse()
<el-table-column
align="center"
prop="productNo"
label="货号 "
label="供应货号 "
></el-table-column>
<el-table-column align="center" prop="number" label="打印数量">
<template #default="{ row }">
......@@ -242,11 +242,11 @@ getWarehouse()
></el-option>
</el-select>
</el-form-item>
<el-form-item label="商品SKU">
<el-form-item label="库存SKU">
<el-input
v-model="searchForm.warehouseSku"
style="width: 140px"
placeholder="请输入商品SKU"
placeholder="请输入库存SKU"
clearable
></el-input>
</el-form-item>
......@@ -258,7 +258,7 @@ getWarehouse()
clearable
></el-input>
</el-form-item>
<el-form-item label="货号">
<el-form-item label="供应货号">
<el-input
v-model="searchForm.productNo"
style="width: 140px"
......@@ -316,7 +316,7 @@ getWarehouse()
</el-form-item>
<el-form-item style="margin-top: 5px">
<el-button type="primary" @click="printProductTag"
>打印商品SKU标签</el-button
>打印库存SKU标签</el-button
>
</el-form-item>
<el-form-item style="margin-top: 5px">
......@@ -382,7 +382,7 @@ getWarehouse()
<el-table-column
align="center"
prop="warehouseSku"
label="商品SKU"
label="库存SKU"
width="180"
></el-table-column>
<el-table-column
......@@ -394,7 +394,7 @@ getWarehouse()
<el-table-column
align="center"
prop="productNo"
label="货号"
label="供应货号"
width="150"
></el-table-column>
<el-table-column
......
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