Commit c85eb33d by wuqian

Merge branch 'dev'

parents 7190baff 7d2db864
......@@ -10,7 +10,14 @@ import {
} from '@/types/api/podUsOrder'
import axios from './axios'
import { PodMakeOrderData } from '@/types/api/podMakeOrder'
export interface LogisticsData {
logisticsWayName: string // 物流名称
warehouseName: string // 发货仓库
status: boolean
logisticsWayCode: string // 物流编码
partition: string // 所在分区
logisticsWayId?: number | null
}
export interface AddressInfo {
id?:string
receiverName: string,
......@@ -23,22 +30,31 @@ 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 updateAddressApi(data: PodUsOrderListData) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/updateReceiverAddress',
data,
)
}
export function getOrderTabData() {
return axios.get<never, BaseRespData<Tab[]>>(
'/factory/podJomallOrderUs/findStateGroupList',
)
}
export function getOrderList(
params: SearchForm,
currentPage: number,
......@@ -53,14 +69,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 +89,6 @@ export function getCardOrderList(
},
)
}
export function confirmOrderApi(
data: number[],
productionClient: string,
......@@ -92,13 +105,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 +118,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 +130,6 @@ export function changeExceptionOrderApi(
exceptionReason: value,
})
}
export function cancelOrderApi(ids: number[], value: string) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/cancelOrders',
......@@ -138,13 +139,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 +154,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 +169,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 +183,6 @@ export function printPrintOrderApi(orderIds: number[]) {
},
)
}
export function printPickingOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderUs/pickingComplete',
......@@ -197,13 +191,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 +203,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 +226,6 @@ export function getPackingDataApi(
},
)
}
export function getPodBoxListApi(
factoryNo: number | string,
warehouseId: number | string,
......@@ -261,7 +250,6 @@ export function submitInspectionApi(
},
)
}
export function clearBoxApi(
factoryNo: number,
box: number | null,
......@@ -274,13 +262,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 +274,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 +298,6 @@ export function getTrackingNumberApi(orderIds: (string | number)[]) {
orderIds,
)
}
// 获取打印面单
export function getfaceSimplexFileApi(orderIds: (string | number)[]) {
return axios.post<never, BaseRespData<never>>(
......@@ -337,7 +305,6 @@ export function getfaceSimplexFileApi(orderIds: (string | number)[]) {
orderIds,
)
}
// 取消物流订单
export function cancelLogisticsOrderApi(orderIds: (string | number)[]) {
return axios.post<never, BaseRespData<never>>(
......@@ -345,7 +312,6 @@ export function cancelLogisticsOrderApi(orderIds: (string | number)[]) {
orderIds,
)
}
// 更改物流
export function changeLogisticsApi(params: {
updateByIdParam: {
......@@ -359,7 +325,6 @@ export function changeLogisticsApi(params: {
params,
)
}
// 创建物流
export function createLogisticsOrderApi(params: {
updateByIdParam: {
......@@ -375,13 +340,12 @@ export function createLogisticsOrderApi(params: {
}
// 更改物流
export function composingDesignImages(data: number[]) {
export function composingDesignImages(data:number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/composingDesignImages',
data,
data
)
}
// 转至待拣胚
export function updateLogisticsToPickingApi(params: { ids: string }) {
return axios.get<never, BaseRespData<never>>(
......@@ -391,7 +355,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
......
......@@ -19,7 +19,7 @@ export interface SearchForm {
endTime: string | null
exceptionHandling: number | undefined
platform: string
productionClient:string
productionClient: string
}
export interface PodUsOrderListData {
id: number
......@@ -93,6 +93,7 @@ export interface ProductList {
tagIds?: string
isProduction?: boolean
createTime?: string
startStockingTime?: string | null
updateTime?: string
remark?: string | null
version?: number
......
......@@ -101,6 +101,7 @@ const [editForm, resetEditForm] = useValue<AddDeclarationRuleObj>({
currency: 'USD',
})
const {
loading,
currentPage,
pageSize,
total,
......@@ -466,7 +467,7 @@ const tableConfig = ref<TableColumn[]>([
},
])
const loading = ref(false)
// const loading = ref(false)
/**
* @description: 取消按钮
......
......@@ -436,7 +436,7 @@ onMounted(() => {
})
async function search() {
loading.value = true
// loading.value = true
const isEqual =
JSON.stringify(searchForm.value) === JSON.stringify({ logisticsIdList: [] })
try {
......@@ -448,7 +448,7 @@ async function search() {
} catch (e) {
console.log(e)
} finally {
loading.value = false
// loading.value = false
}
}
......@@ -729,6 +729,7 @@ function handleSizeChange(val: number) {
}
async function getList() {
loading.value = true
try {
const { data } = await getlogisticsQuotationPage({
...searchForm.value,
......@@ -741,10 +742,13 @@ async function getList() {
mergeCells.value = []
} catch (error) {
console.log(error)
} finally {
loading.value = false
}
}
const templeData = ref<LogisticsQuotation[]>([])
async function getSearchList() {
loading.value = true
try {
const { data } = await getlogisticsQuotationList({
...searchForm.value,
......@@ -784,6 +788,8 @@ async function getSearchList() {
mergeCells.value = newMergeCells
} catch (error) {
console.log(error)
} finally {
loading.value = false
}
}
......
......@@ -74,7 +74,7 @@ const checkAll = ref(false)
const selectedList = ref<(string | number)[]>([])
// 显示弹窗
const showDialog = (type: string) => {
const showDialog = (type?: string) => {
console.log(type)
resultDialog.value = true
......
......@@ -153,7 +153,7 @@
style="width: 130px"
>
<ElOption
v-for="(item, index) in ['自有物流','工厂物流']"
v-for="(item, index) in ['自有物流', '工厂物流']"
:key="index"
:value="index"
:label="item"
......@@ -245,7 +245,13 @@
</div>
<div class="operation-box mb-10">
<span v-if="status === 'PICKING'" class="item">
<ElButton :loading="downloadLoading" type="warning" @click="downloadTif"> 排版 </ElButton>
<ElButton
:loading="downloadLoading"
type="primary"
@click="downloadTif"
>
排版
</ElButton>
</span>
<span v-if="status === 'TO_BE_CONFIRMED'" class="item">
<ElButton type="success" @click="confirmOrder"> 确认 </ElButton>
......@@ -253,8 +259,13 @@
<span v-if="status === 'EXCEPTION_ORDER'" class="item">
<ElButton type="success" @click="updateOrder"> 转至待确认 </ElButton>
</span>
<span v-if="status === 'EXCEPTION_ORDER' && exceptionStatus === 3" class="item">
<ElButton type="success" @click="asyncOrderAddress"> 同步收货地址 </ElButton>
<span
v-if="status === 'EXCEPTION_ORDER' && exceptionStatus === 3"
class="item"
>
<ElButton type="success" @click="asyncOrderAddress">
同步收货地址
</ElButton>
</span>
<span
v-if="status === 'EXCEPTION_ORDER' && exceptionStatus === 1"
......@@ -596,7 +607,7 @@
<div class="order-detail-item">
<span class="order-detail-item-label">物流类型:</span>
<span class="order-detail-item-value">
{{ ['自有物流','工厂物流'][row.shipmentType] }}
{{ ['自有物流', '工厂物流'][row.shipmentType] }}
</span>
</div>
<div class="order-detail-item">
......@@ -697,6 +708,15 @@
{{ row.lanshouAddress }}
</span>
</div>
<div
v-if="['TO_BE_CONFIRMED', 'STOCK_OUT'].includes(status)"
class="order-detail-item"
>
<span class="order-detail-item-label">订单延期时间:</span>
<span class="order-detail-item-value red-time">
{{ calculateDelayTime(row) }}
</span>
</div>
</div>
</template>
<template #price="{ row }">
......@@ -758,6 +778,9 @@
</div>
</div> -->
</template>
<template #exceptionReason="{ row }">
<div v-html="row.exceptionReason"></div>
</template>
<template #innerLabel="{ row }">
<div v-if="row.internalMemoList" class="inner-label-box">
<div
......@@ -775,8 +798,10 @@
</template>
<template #operate="{ row }">
<div class="operate-box">
<span class="operate-item" style="display: flex;flex-direction: column">
<span
class="operate-item"
style="display: flex; flex-direction: column"
>
<ElButton
link
type="primary"
......@@ -793,7 +818,10 @@
确认
</ElButton>
<ElButton
v-if="row.shipmentType===1 && ['CREATE_LOGISTICS','WAIT_SHIPMENT'].includes(status)"
v-if="
row.shipmentType === 1 &&
['CREATE_LOGISTICS', 'WAIT_SHIPMENT'].includes(status)
"
link
type="primary"
@click="handleUpdateAddress(row)"
......@@ -801,7 +829,10 @@
修改地址
</ElButton>
<ElButton
v-if="row.shipmentType===0 && ['CREATE_LOGISTICS','WAIT_SHIPMENT'].includes(status)"
v-if="
row.shipmentType === 0 &&
['CREATE_LOGISTICS', 'WAIT_SHIPMENT'].includes(status)
"
link
type="primary"
@click="handleRefreshAddress(row)"
......@@ -1172,7 +1203,13 @@
</el-button>
</template>
</el-dialog>
<UpdateAddress v-if="updateAddVisible" v-model:form="currentRow" v-model:visible="updateAddVisible" :country-list="countryList" @success="search"></UpdateAddress>
<UpdateAddress
v-if="updateAddVisible"
v-model:form="currentRow"
v-model:visible="updateAddVisible"
:country-list="countryList"
@success="search"
></UpdateAddress>
<ElDialog
v-model="exceptionDialogVisible"
title="转为异常单"
......@@ -1233,8 +1270,8 @@
</ElDialog>
</template>
<script setup lang="ts">
import { getUserMarkList } from '@/api/common'
import { ArrowDown, WarningFilled } from '@element-plus/icons-vue'
import {
getCardOrderList,
......@@ -1265,11 +1302,15 @@ import {
changeLogisticsApi,
createLogisticsOrderApi,
updateLogisticsToPickingApi,
createLogisticsOrdersApi, syncReceiverAddress, refreshAddressApi, AddressInfo,
createLogisticsOrdersApi,
syncReceiverAddress,
refreshAddressApi,
AddressInfo,
// handleExceptionOrderApi,
} from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api'
import UpdateAddress from './components/updateAddress.vue'
import { BaseRespData } from '@/types/api'
import { getAllCountryApi } from '@/api/logistics.ts'
import TableView from '@/components/TableView.vue'
import {
LogListData,
......@@ -1286,7 +1327,7 @@ import { useValue } from '@/utils/hooks/useValue'
import { showConfirm } from '@/utils/ui'
import { DocumentCopy, EditPen } from '@element-plus/icons-vue'
import { Column, ElFormItem } from 'element-plus'
import { computed, onMounted, ref, nextTick } from 'vue'
import { computed, onMounted, ref, nextTick, onBeforeUnmount } from 'vue'
import FastProduction from './FastProduction.vue'
import { filePath } from '@/api/axios'
import PodMakeOrder from './PodMakeOrder.vue'
......@@ -1297,7 +1338,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: {
......@@ -1312,26 +1352,14 @@ declare global {
responseBody?: unknown
}
}
const updateAddVisible = ref(false)
const tabsNav = ref<Tab[]>()
const countryList = ref([])
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 currentRow = ref<AddressInfo>({
receiverName: '',
receiverPhone: '',
receiverCountry: '',
receiverProvince: '',
receiverCity: '',
receiverDistrict: '',
receiverAddress1: '',
receiverAddress2: '',
receiverPostCode: '',
})
const confirmSelectionData = ref<LogisticsData[]>([])
const confirmRowData = ref<ProductList | null>(null)
const status = ref('TO_BE_CONFIRMED')
......@@ -1354,6 +1382,18 @@ const [searchForm] = useValue<SearchForm>({
platform: '',
productionClient: '',
})
const countryList = ref([])
const currentRow = ref<AddressInfo>({
receiverName: '',
receiverPhone: '',
receiverCountry: '',
receiverProvince: '',
receiverCity: '',
receiverDistrict: '',
receiverAddress1: '',
receiverAddress2: '',
receiverPostCode: '',
})
const exceptionStatus = ref(1)
const userMarkList = ref<string[]>([])
const selection = ref<PodUsOrderListData[]>([])
......@@ -1412,21 +1452,7 @@ const getDateRange = (days = 0, type: 'past' | 'future' = 'past') => {
type === 'past' ? end.subtract(days, 'day') : end.add(days, 'day')
return [start.startOf('day').toDate(), end.endOf('day').toDate()]
}
const getMonthRange = (months = 0, type: 'past' | 'future' = 'past') => {
const now = dayjs()
const start =
type === 'past' ? now.subtract(months, 'month') : now.add(months, 'month')
return [start.startOf('month').toDate(), start.endOf('month').toDate()]
}
const getWeekRange = (weeks = 0, type: 'past' | 'future' = 'past') => {
const now = dayjs()
const start =
type === 'past' ? now.subtract(weeks, 'week') : now.add(weeks, 'week')
return [start.startOf('week').toDate(), start.endOf('week').toDate()]
}
const handleRefreshAddress = async (row:PodUsOrderListData) => {
const handleRefreshAddress = async (row: PodUsOrderListData) => {
try {
await showConfirm('确定刷新地址吗?', {
confirmButtonText: '确认',
......@@ -1437,19 +1463,36 @@ const handleRefreshAddress = async (row:PodUsOrderListData) => {
return
}
await refreshAddressApi([row.id])
await ElMessageBox.alert('请修改/刷新地址后取消物流重新创建物流订单、获取跟踪号、获取打印面单。', '提示', {
await ElMessageBox.alert(
'请修改/刷新地址后取消物流重新创建物流订单、获取跟踪号、获取打印面单。',
'提示',
{
type: 'warning',
confirmButtonText:'确定',
cancelButtonText:'取消',
confirmButtonText: '确定',
cancelButtonText: '取消',
showCancelButton: true,
})
},
)
}
const handleUpdateAddress = async (row:PodUsOrderListData) => {
const handleUpdateAddress = async (row: PodUsOrderListData) => {
const { data } = await getAllCountryApi()
countryList.value = data
currentRow.value = JSON.parse(JSON.stringify(row))
updateAddVisible.value = true
}
const getMonthRange = (months = 0, type: 'past' | 'future' = 'past') => {
const now = dayjs()
const start =
type === 'past' ? now.subtract(months, 'month') : now.add(months, 'month')
return [start.startOf('month').toDate(), start.endOf('month').toDate()]
}
const getWeekRange = (weeks = 0, type: 'past' | 'future' = 'past') => {
const now = dayjs()
const start =
type === 'past' ? now.subtract(weeks, 'week') : now.add(weeks, 'week')
return [start.startOf('week').toDate(), start.endOf('week').toDate()]
}
const tableColumns = computed(() => [
{
label: '商品',
......@@ -1482,10 +1525,12 @@ const tableColumns = computed(() => [
slot: 'innerLabel',
width: 300,
prop: 'innerLabel',
},{
},
{
label: '异常原因',
width: 300,
prop: 'exceptionReason',
slot: 'exceptionReason',
},
{
label: '操作',
......@@ -1511,6 +1556,44 @@ const handleSelectionChange = (val: PodUsOrderListData[]) => {
stockOutSuccessIds.value = []
}
}
const asyncOrderAddress = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
try {
await showConfirm('确定同步收货地址吗?', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
const ids = selection.value.map((item) => item.id)
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await syncReceiverAddress(ids)
if (res.code !== 200) return
await ElMessageBox.alert('同步收货地址成功,请刷新查看。', '提示', {
type: 'warning',
confirmButtonText: '确定',
cancelButtonText: '取消',
showCancelButton: true,
})
search()
await loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const changeTab = (item: Tab) => {
status.value = item.status || ''
selection.value = []
......@@ -1688,19 +1771,17 @@ const confirmOrder = async () => {
}
const downloadTif = async () => {
if(!selection.value.length) {
if (!selection.value.length) {
return ElMessage.warning('请选择数据')
}
downloadLoading.value = true
try {
const res= await composingDesignImages(selection.value.map(el=>el.id))
window.open('http://ps.jomalls.com/tiff/'+res.message, '_blank')
const res = await composingDesignImages(selection.value.map((el) => el.id))
window.open(filePath + res.message, '_blank')
downloadLoading.value = false
}catch (e){
console.log(e)
} catch (e) {
downloadLoading.value = false
}
}
const loadProductionClient = async () => {
......@@ -1767,37 +1848,6 @@ const updateOrder = async () => {
loading.close()
}
}
const asyncOrderAddress = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
try {
await showConfirm('确定同步收货地址吗?', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
const ids = selection.value.map((item) => item.id)
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await syncReceiverAddress(ids)
if (res.code !== 200) return
ElMessage.success('同步成功')
search()
await loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const assignOrder = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
......@@ -2181,7 +2231,7 @@ const getOrderByIdApi = async (type: string) => {
const res = await operation.Fn(ids)
if (res.code === 200) {
if (isArray(res.data)) {
resultInfo.value = res.data
resultInfo.value = res.data || []
resultRefs.value?.showDialog(type)
} else if (isString(res.data)) {
window.open(filePath + res.data)
......@@ -2191,6 +2241,7 @@ const getOrderByIdApi = async (type: string) => {
}
loading.close()
} catch (e) {
resultInfo.value = []
console.error(e)
}
} else {
......@@ -2393,10 +2444,13 @@ const logisticsToPicking = async () => {
ids: selection.value.map((item) => item.id).join(','),
})
if (res.code !== 200) return
resultInfo.value = res.data || []
resultRefs.value?.showDialog()
ElMessage.success('操作成功')
search()
loadTabData()
} catch (e) {
resultInfo.value = []
console.error(e)
} finally {
loading.close()
......@@ -2637,13 +2691,56 @@ const refreshMaterial = async () => {
loading.close()
}
}
// 当前时间响应式变量(每60秒更新一次)
const currentTime = ref(new Date())
// 定时器实例
let timer: number | null = null
onMounted(() => {
loadTabData()
getUserMark()
loadProductionClient()
loadWarehouseList()
// 每60秒更新一次当前时间
timer = window.setInterval(() => {
currentTime.value = new Date()
}, 60000)
})
// 计算时间差(小时数)并向上取整
const calculateHoursDifference = (startDateString?: string): string => {
if (!startDateString) return '--'
try {
const startTime = new Date(startDateString)
const diffInMs = currentTime.value.getTime() - startTime.getTime()
// 转换为小时并取整:ceil向上或者round:四舍五入
const hours = Math.round(diffInMs / (1000 * 60 * 60))
return `${hours}小时`
} catch (error) {
console.error('日期解析错误:', error)
return '--'
}
}
// 根据订单状态计算延期时间
const calculateDelayTime = computed(() => (row: ProductList) => {
switch (status.value) {
case 'TO_BE_CONFIRMED':
return row.createTime ? calculateHoursDifference(row.createTime) : '--'
case 'STOCK_OUT':
return row.startStockingTime
? calculateHoursDifference(row.startStockingTime)
: '--'
default:
return '--'
}
})
onBeforeUnmount(() => {
// 组件卸载时清除定时器
if (timer) {
clearInterval(timer)
timer = null
}
})
const handleExceptionCommand = (command: number) => {
exceptionStatus.value = command
search()
......@@ -2729,6 +2826,10 @@ const handleExceptionCommand = (command: number) => {
text-overflow: ellipsis;
white-space: nowrap;
}
.red-time {
color: red;
font-weight: bold;
}
}
.card-list {
......@@ -2739,12 +2840,6 @@ const handleExceptionCommand = (command: number) => {
height: 100%;
overflow-y: auto;
}
.operate-item{
.el-button{
margin-left: 0 !important;
margin-top: 20px !important;
}
}
.tabs-node_count {
display: inline-block;
min-width: 20px;
......@@ -2863,8 +2958,15 @@ const handleExceptionCommand = (command: number) => {
}
}
}
.operate-item {
.el-button {
margin-left: 0 !important;
margin-top: 20px !important;
}
}
</style>
<style>
<style lang="scss">
.customize-select-style {
.el-select-dropdown__list {
width: 500px;
......
......@@ -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>
......@@ -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,9 +1111,9 @@ 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
......@@ -1122,70 +1136,87 @@ const handleLocalImport = async ({
data: Record<string, any>[]
}) => {
// 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); // 将数字转换为字符串
obj[field] = String(value) // 将数字转换为字符串
} else if (typeof value === 'string' && !isNaN(Number(value))) {
obj[field] = value; // 保持有效的数字字符串
obj[field] = value // 保持有效的数字字符串
} else {
// 如果不是数字或有效的数字字符串,则设置为 null
obj[field] = 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');
importDialogVisible.value = false;
return;
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已存在或无效');
importedFileUrl.value = path;
importDialogVisible.value = false;
return;
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);
const mergedProductList = filteredSkusList.map((skuItem) => {
const importedItem = importedData.find(
(item) => item.warehouseSku === skuItem.warehouseSku,
)
let outCountValueForBigNumber: string | number = '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;
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;
outCountValueForBigNumber = importedItem.buyStored
} else {
// 如果是对象或其他意外类型,则默认为 '0'
outCountValueForBigNumber = '0';
outCountValueForBigNumber = '0'
}
}
const calculatedOutCount = new BigNumber(outCountValueForBigNumber).toNumber();
const calculatedOutCount = new BigNumber(
outCountValueForBigNumber,
).toNumber()
return {
skuImage: skuItem.image,
......@@ -1196,17 +1227,17 @@ const handleLocalImport = async ({
locationId: skuItem.locationId ?? null,
costPrice: skuItem.price,
outCount: calculatedOutCount,
totalPrice: new BigNumber(calculatedOutCount).multipliedBy(skuItem.price ?? 0).toNumber(),
totalPrice: new BigNumber(calculatedOutCount)
.multipliedBy(skuItem.price ?? 0)
.toNumber(),
usableInventory: skuItem.usableInventory,
inventoryId: skuItem.id,
remark: importedItem?.remark ?? skuItem.remark ?? null,
} as InterProductList;
});
} 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;
......
......@@ -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>
......@@ -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>({})
......@@ -1960,7 +1967,7 @@ $border: solid 1px #ddd;
}
.import-content {
padding: 20px 0;
padding-bottom: 20px;
}
}
......
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