Commit f4a56ad5 by zhuzhequan

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

parents aea0bb48 389c0c09
......@@ -8,7 +8,7 @@ import {
ProductionClient,
WarehouseListData,
LogisticsData,
ExportParams
ExportParams,
} from '@/types/api/podUsOrder'
import axios from './axios'
import { PodMakeOrderData } from '@/types/api/podMakeOrder'
......@@ -48,7 +48,7 @@ export function getOrderList(
currentPage: number,
pageSize: number,
) {
return axios.post<never, BasePaginationData<PodUsOrderListData[]>>(
return axios.post<never, BasePaginationData<PodUsOrderListData>>(
'/factory/podJomallOrderUs/list_page',
{
...params,
......@@ -338,7 +338,7 @@ export function createLogisticsOrderApi(params: {
)
}
// 创建物流
// 物流面单上传
export function uploadExpressSheet(params: {
trackingNumber: string
file: File
......@@ -347,7 +347,8 @@ export function uploadExpressSheet(params: {
'factory/podJomallOrderUs/uploadExpressSheet',
params,
)
} // 创建物流
}
// 更新物流信息确认
export function updateSelfLogistics(params: {
trackingNumber: string
expressSheet: string
......
......@@ -12,7 +12,7 @@
<ElTableColumn
v-if="selectionable"
type="selection"
width="50"
width="40"
fixed="left"
header-align="center"
align="center"
......@@ -21,7 +21,7 @@
v-if="serialNumberable"
label="序号"
type="index"
width="60"
width="55"
fixed="left"
header-align="center"
align="center"
......
......@@ -6,7 +6,9 @@ export interface Tab {
export interface ExportParams extends SearchForm {
idList?: number[]
exportAll: boolean
status?:string
}
export interface SearchForm {
timeType?: number | null
shopNumber?: string
......@@ -95,6 +97,7 @@ export interface ProductList {
craftCode?: string
platform?: string
imageAry?: string
previewImgs?: []
designImages?: string
categoryId?: number
categoryName?: string
......
......@@ -14,6 +14,7 @@ import {
getOperationLogApi,
getOrderTabData,
getfaceSimplexFileApi,
exportPodUSInfo,
} from '@/api/podUsOrder'
import {
SearchForm,
......@@ -23,6 +24,7 @@ import {
PodUsOrderListData,
LogListData,
Tab,
ExportParams,
} from '@/types/api/podUsOrder'
import platformJson from '../../../json/platform.json'
import dayjs from 'dayjs'
......@@ -284,7 +286,7 @@ const goodsColumns = computed(() => {
},
]
})
const tableData = ref<PodUsOrderListData[][]>([])
const tableData = ref<PodUsOrderListData[]>([])
const goodsData = ref<ProductList[]>([])
const searchVisible = ref(false)
const goodsLoading = ref(false)
......@@ -371,16 +373,62 @@ const getWeekRange = (weeks = 0, type: 'past' | 'future' = 'past') => {
type === 'past' ? now.subtract(weeks, 'week') : now.add(weeks, 'week')
return [start.startOf('week').toDate(), start.endOf('week').toDate()]
}
const exportLoading = ref(false)
const exportVisible = ref(false)
const exportForm = ref({
resource: '',
})
async function getData() {}
const exportData = () => {
exportVisible.value = true
}
const submitExportForm = async () => {
if (exportForm.value.resource === '') {
return ElMessage.error('请选择导出类型')
}
exportLoading.value = true
const resourceType = Number(exportForm.value.resource)
const params: ExportParams = {
exportAll: false,
idList: [],
}
// 使用函数封装映射逻辑
const mapIds = (items: PodUsOrderListData[]) =>
items.map((el) => Number(el.id))
switch (resourceType) {
case 0:
params.idList = mapIds(tableData.value as PodUsOrderListData[])
break
case 1:
params.idList = mapIds(selection.value)
break
case 2:
params.exportAll = true
params.idList = undefined
break
default:
console.error('未知的资源类型:', resourceType)
}
try {
const res = await exportPodUSInfo({
...params,
...(resourceType === 2 ? searchForm.value : {}),
})
window.open(filePath + res.message, '_blank')
exportVisible.value = false
exportLoading.value = false
} catch (e) {
exportVisible.value = false
exportLoading.value = false
}
}
const handleSizeChange = (pageSize: number) => {
pagination.value.pageSize = pageSize
getData()
getOrderListFn()
}
const handleCurrentChange = (currentPage: number) => {
pagination.value.currentPage = currentPage
getData()
getOrderListFn()
}
const productionClient = ref<ProductionClient[]>()
......@@ -508,7 +556,7 @@ const resultInfo = ref<
const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null)
/**
* @description: 创建物流、获取跟踪号、获取打印面单、更改物流、取消物流订
* @description: 获取打印面
*/
const getOrderByIdApi = async (type: string) => {
......@@ -593,7 +641,6 @@ loadTabData()
loadProductionClient()
getUserMark()
loadCraftList()
getData()
getWarehouse()
onMounted(() => {
......@@ -889,6 +936,9 @@ onMounted(() => {
>
</span>
</ElFormItem>
<ElFormItem>
<ElButton type="success" @click="exportData">导出</ElButton>
</ElFormItem>
</ElForm>
</el-card>
</template>
......@@ -960,6 +1010,33 @@ onMounted(() => {
</div>
</template>
</split-div>
<ElDialog
v-model="exportVisible"
title="导出选项"
width="500px"
:close-on-click-modal="false"
>
<el-form :model="exportForm" label-width="80px">
<el-form-item label="" prop="resource">
<el-radio-group v-model="exportForm.resource">
<el-radio :label="0">导出本页</el-radio>
<el-radio :label="1">导出选中</el-radio>
<el-radio :label="2">全部</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="exportVisible = false">取消</el-button>
<el-button
:loading="exportLoading"
type="primary"
@click="submitExportForm"
>确认</el-button
>
</span>
</template>
</ElDialog>
<ResultInfo
ref="resultRefs"
:list="resultInfo"
......
......@@ -392,8 +392,20 @@ watch(
{ url: d.negativeImage, title: '反面', id: d.negativeDesignId },
].filter((el) => el.url)
} else {
arr =
typeof d.imageAry == 'string' ? JSON.parse(d.imageAry) : d.imageAry
arr = Array.isArray(d.imageAry)
? d.imageAry
: typeof d.imageAry === 'string'
? (() => {
try {
const parsed = JSON.parse(d.imageAry)
return parsed
} catch {
return [{ url: d.imageAry }]
}
})()
: [d.imageAry]?.filter?.((v) => v != null) || []
// arr =
// typeof d.imageAry == 'string' ? JSON.parse(d.imageAry) : d.imageAry
arr = arr.concat([
{ url: d.negativeImage, title: '反面', id: d.negativeDesignId },
])
......@@ -591,7 +603,10 @@ const trackcodeInput = async () => {
// AAAB_60527128-9_1_JMSC250121017 新版示例
const regex = /^[A-Z]{4}_/ //是否以四个大写字母加下划线开头
if (regex.test(orderNumber)) {
orderNumber = orderNumber.split('_')[0] + "-"+ orderNumber.split('_')[orderNumber.split('_').length - 1]
orderNumber =
orderNumber.split('_')[0] +
'-' +
orderNumber.split('_')[orderNumber.split('_').length - 1]
}
try {
const res = await getSubOrderBySubOrderNumber(orderNumber)
......@@ -612,7 +627,20 @@ const trackcodeInput = async () => {
{ url: d.negativeImage, title: '反面', id: d.negativeDesignId },
].filter((el) => el.url)
} else {
arr = typeof d.imageAry == 'string' ? JSON.parse(d.imageAry) : d.imageAry
arr = Array.isArray(d.imageAry)
? d.imageAry
: typeof d.imageAry === 'string'
? (() => {
try {
const parsed = JSON.parse(d.imageAry)
return parsed
} catch {
return [{ url: d.imageAry }]
}
})()
: [d.imageAry]?.filter?.((v) => v != null) || []
// arr = typeof d.imageAry == 'string' ? JSON.parse(d.imageAry) : d.imageAry
arr = arr.concat([
{ url: d.negativeImage, title: '反面', id: d.negativeDesignId },
])
......
......@@ -220,7 +220,7 @@
'TO_BE_CONFIRMED',
'IN_PRODUCTION',
'PART_SHIPPING',
'WAIT_SHIPMENT',
'WAIT_SHIPMENT'
].includes(status)
"
class="item"
......@@ -1449,7 +1449,20 @@ const openDetail = async (id: number) => {
const res = await getOrderDetail(id)
if (res.code == 200) {
if (res.data.imageAry) {
res.data.imageAry = JSON.parse(res.data.imageAry as string)
const newarr = res.data.imageAry
res.data.imageAry = Array.isArray(newarr)
? newarr
: typeof newarr === 'string'
? (() => {
try {
const parsed = JSON.parse(newarr)
return parsed
} catch {
return [{ url: newarr }]
}
})()
: [newarr]?.filter?.((v) => v != null) || []
// res.data.imageAry = JSON.parse(res.data.imageAry as string)
}
detailData.value = res.data || {}
detailVisible.value = true
......@@ -1457,6 +1470,8 @@ const openDetail = async (id: number) => {
fastType.value = 0
}
} catch (e) {
console.log(e)
//showError(e)
}
}
......@@ -1691,7 +1706,7 @@ const [searchForm] = useValue<SearchForm>({
userMark: '',
customizedQuantity: '',
order: 'desc',
platform:''
platform: '',
})
const tableColumns = computed<CustomColumn<CardOrderData[]>>(() => {
return [
......
......@@ -247,7 +247,12 @@ const props = defineProps<{
printOrder: (data: OrderData, callback: (status: boolean) => void) => void
warehouseList: WarehouseListData[]
}>()
const emit = defineEmits(['update:modelValue', 'set-printer', 'refresh'])
const emit = defineEmits([
'update:modelValue',
'set-printer',
'refresh',
'set-warehouseId',
])
const visible = computed({
get() {
return props.modelValue
......@@ -259,6 +264,7 @@ const visible = computed({
const printDeviceList = ref<string[]>([])
const sheetPrinter = ref<string>('')
const productionOrder = ref<string>('')
const podOrderDetailsData = ref<OrderData>()
const podOrderDetailsColumns = computed(() => [
......@@ -351,7 +357,9 @@ watch(visible, async (value: boolean) => {
initOrderDetailBox()
initPrintDevice()
const locaclPrinter = localStorage.getItem('sheetPrinter')
const locaclWarehouseId = localStorage.getItem('locaclWarehouseId')
if (locaclPrinter) sheetPrinter.value = JSON.parse(locaclPrinter)
if (locaclWarehouseId) warehouseId.value = JSON.parse(locaclWarehouseId)
} else {
if (userStore.user?.factory.id) {
socket.send({
......@@ -927,6 +935,7 @@ const handleWarehouseChange = (value: string | number) => {
})
}
warehouseId.value = value
emit('set-warehouseId', value)
socket.send({
code: 'STARTORDER',
factoryNo: userStore.user?.factory.id,
......
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