Commit ecb13036 by sunyang
parents 93225d1b 5489caaa
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
WarehouseListData, WarehouseListData,
LogisticsData, LogisticsData,
ExportParams, ExportParams,
InterceptStateGroupData,
} from '@/types/api/podUsOrder' } from '@/types/api/podUsOrder'
import axios from './axios' import axios from './axios'
import { PodMakeOrderData } from '@/types/api/podMakeOrder' import { PodMakeOrderData } from '@/types/api/podMakeOrder'
...@@ -43,12 +44,19 @@ export function getOrderTabData() { ...@@ -43,12 +44,19 @@ export function getOrderTabData() {
'/factory/podJomallOrderUs/findStateGroupList', '/factory/podJomallOrderUs/findStateGroupList',
) )
} }
// 拦截状态数量
export function getgetInterceptStateGroupList() {
return axios.get<never, BaseRespData<InterceptStateGroupData>>(
'factory/podJomallOrderUs/findInterceptStateGroupList',
)
}
export function getOrderList( export function getOrderList(
params: SearchForm, params: SearchForm,
currentPage: number, currentPage: number,
pageSize: number, pageSize: number,
) { ) {
return axios.post<never, BasePaginationData<PodUsOrderListData[]>>( return axios.post<never, BasePaginationData<PodUsOrderListData>>(
'/factory/podJomallOrderUs/list_page', '/factory/podJomallOrderUs/list_page',
{ {
...params, ...params,
...@@ -496,3 +504,25 @@ export function updateToWaitShipmentApi(params: { ...@@ -496,3 +504,25 @@ export function updateToWaitShipmentApi(params: {
params, params,
) )
} }
// 拦截状态改变
export function interceptUpdateApi(params: {
orderIds: (string | number)[]
interceptStatus: number
}) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderUs/updateInterceptStatus`,
params,
)
}
// 驳回
export function rejectToApi(params: {
orderStatus: string
productList: ProductList[]
reasonStr: string
}) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderUs/rejectTo`,
params,
)
}
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<ElTableColumn <ElTableColumn
v-if="selectionable" v-if="selectionable"
type="selection" type="selection"
width="50" width="40"
fixed="left" fixed="left"
header-align="center" header-align="center"
align="center" align="center"
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
v-if="serialNumberable" v-if="serialNumberable"
label="序号" label="序号"
type="index" type="index"
width="60" width="55"
fixed="left" fixed="left"
header-align="center" header-align="center"
align="center" align="center"
......
...@@ -6,7 +6,9 @@ export interface Tab { ...@@ -6,7 +6,9 @@ export interface Tab {
export interface ExportParams extends SearchForm { export interface ExportParams extends SearchForm {
idList?: number[] idList?: number[]
exportAll: boolean exportAll: boolean
status?: string
} }
export interface SearchForm { export interface SearchForm {
timeType?: number | null timeType?: number | null
shopNumber?: string shopNumber?: string
...@@ -32,6 +34,7 @@ export interface SearchForm { ...@@ -32,6 +34,7 @@ export interface SearchForm {
batchArrangeNumber?: string batchArrangeNumber?: string
craftCode?: string craftCode?: string
thirdStockSku?: string thirdStockSku?: string
interceptStatus?: number | string
} }
export interface PodUsOrderListData { export interface PodUsOrderListData {
id: number id: number
...@@ -95,6 +98,7 @@ export interface ProductList { ...@@ -95,6 +98,7 @@ export interface ProductList {
craftCode?: string craftCode?: string
platform?: string platform?: string
imageAry?: string imageAry?: string
previewImgs?: []
designImages?: string designImages?: string
categoryId?: number categoryId?: number
categoryName?: string categoryName?: string
...@@ -124,6 +128,7 @@ export interface ProductList { ...@@ -124,6 +128,7 @@ export interface ProductList {
supplierProductNo?: string | null supplierProductNo?: string | null
replenishmentSumNum?: number | null replenishmentSumNum?: number | null
batchArrangeNumber?: string | null batchArrangeNumber?: string | null
interceptStatus?: number | null
} }
export interface cardImages { export interface cardImages {
title: string title: string
...@@ -198,3 +203,12 @@ export interface CraftListData { ...@@ -198,3 +203,12 @@ export interface CraftListData {
craftName: string craftName: string
craftCode: string craftCode: string
} }
export interface InterceptStateGroupData {
shipment: {
[key: string]: number
}
production: {
[key: string]: number
}
}
...@@ -14,6 +14,7 @@ import { ...@@ -14,6 +14,7 @@ import {
getOperationLogApi, getOperationLogApi,
getOrderTabData, getOrderTabData,
getfaceSimplexFileApi, getfaceSimplexFileApi,
exportPodUSInfo,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import { import {
SearchForm, SearchForm,
...@@ -23,6 +24,7 @@ import { ...@@ -23,6 +24,7 @@ import {
PodUsOrderListData, PodUsOrderListData,
LogListData, LogListData,
Tab, Tab,
ExportParams,
} from '@/types/api/podUsOrder' } from '@/types/api/podUsOrder'
import platformJson from '../../../json/platform.json' import platformJson from '../../../json/platform.json'
import dayjs from 'dayjs' import dayjs from 'dayjs'
...@@ -284,7 +286,7 @@ const goodsColumns = computed(() => { ...@@ -284,7 +286,7 @@ const goodsColumns = computed(() => {
}, },
] ]
}) })
const tableData = ref<PodUsOrderListData[][]>([]) const tableData = ref<PodUsOrderListData[]>([])
const goodsData = ref<ProductList[]>([]) const goodsData = ref<ProductList[]>([])
const searchVisible = ref(false) const searchVisible = ref(false)
const goodsLoading = ref(false) const goodsLoading = ref(false)
...@@ -371,7 +373,55 @@ const getWeekRange = (weeks = 0, type: 'past' | 'future' = 'past') => { ...@@ -371,7 +373,55 @@ const getWeekRange = (weeks = 0, type: 'past' | 'future' = 'past') => {
type === 'past' ? now.subtract(weeks, 'week') : now.add(weeks, 'week') type === 'past' ? now.subtract(weeks, 'week') : now.add(weeks, 'week')
return [start.startOf('week').toDate(), start.endOf('week').toDate()] return [start.startOf('week').toDate(), start.endOf('week').toDate()]
} }
const exportLoading = ref(false)
const exportVisible = ref(false)
const exportForm = ref({
resource: '',
})
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) => { const handleSizeChange = (pageSize: number) => {
pagination.value.pageSize = pageSize pagination.value.pageSize = pageSize
getOrderListFn() getOrderListFn()
...@@ -886,6 +936,9 @@ onMounted(() => { ...@@ -886,6 +936,9 @@ onMounted(() => {
> >
</span> </span>
</ElFormItem> </ElFormItem>
<ElFormItem>
<ElButton type="success" @click="exportData">导出</ElButton>
</ElFormItem>
</ElForm> </ElForm>
</el-card> </el-card>
</template> </template>
...@@ -957,6 +1010,33 @@ onMounted(() => { ...@@ -957,6 +1010,33 @@ onMounted(() => {
</div> </div>
</template> </template>
</split-div> </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 <ResultInfo
ref="resultRefs" ref="resultRefs"
:list="resultInfo" :list="resultInfo"
......
...@@ -392,8 +392,20 @@ watch( ...@@ -392,8 +392,20 @@ watch(
{ url: d.negativeImage, title: '反面', id: d.negativeDesignId }, { url: d.negativeImage, title: '反面', id: d.negativeDesignId },
].filter((el) => el.url) ].filter((el) => el.url)
} else { } else {
arr = arr = Array.isArray(d.imageAry)
typeof d.imageAry == 'string' ? JSON.parse(d.imageAry) : 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([ arr = arr.concat([
{ url: d.negativeImage, title: '反面', id: d.negativeDesignId }, { url: d.negativeImage, title: '反面', id: d.negativeDesignId },
]) ])
...@@ -591,7 +603,10 @@ const trackcodeInput = async () => { ...@@ -591,7 +603,10 @@ const trackcodeInput = async () => {
// AAAB_60527128-9_1_JMSC250121017 新版示例 // AAAB_60527128-9_1_JMSC250121017 新版示例
const regex = /^[A-Z]{4}_/ //是否以四个大写字母加下划线开头 const regex = /^[A-Z]{4}_/ //是否以四个大写字母加下划线开头
if (regex.test(orderNumber)) { 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 { try {
const res = await getSubOrderBySubOrderNumber(orderNumber) const res = await getSubOrderBySubOrderNumber(orderNumber)
...@@ -612,7 +627,20 @@ const trackcodeInput = async () => { ...@@ -612,7 +627,20 @@ const trackcodeInput = async () => {
{ url: d.negativeImage, title: '反面', id: d.negativeDesignId }, { url: d.negativeImage, title: '反面', id: d.negativeDesignId },
].filter((el) => el.url) ].filter((el) => el.url)
} else { } 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([ arr = arr.concat([
{ url: d.negativeImage, title: '反面', id: d.negativeDesignId }, { url: d.negativeImage, title: '反面', id: d.negativeDesignId },
]) ])
......
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
'TO_BE_CONFIRMED', 'TO_BE_CONFIRMED',
'IN_PRODUCTION', 'IN_PRODUCTION',
'PART_SHIPPING', 'PART_SHIPPING',
'WAIT_SHIPMENT', 'WAIT_SHIPMENT'
].includes(status) ].includes(status)
" "
class="item" class="item"
...@@ -1449,7 +1449,20 @@ const openDetail = async (id: number) => { ...@@ -1449,7 +1449,20 @@ const openDetail = async (id: number) => {
const res = await getOrderDetail(id) const res = await getOrderDetail(id)
if (res.code == 200) { if (res.code == 200) {
if (res.data.imageAry) { 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 || {} detailData.value = res.data || {}
detailVisible.value = true detailVisible.value = true
...@@ -1457,6 +1470,8 @@ const openDetail = async (id: number) => { ...@@ -1457,6 +1470,8 @@ const openDetail = async (id: number) => {
fastType.value = 0 fastType.value = 0
} }
} catch (e) { } catch (e) {
console.log(e)
//showError(e) //showError(e)
} }
} }
...@@ -1691,7 +1706,7 @@ const [searchForm] = useValue<SearchForm>({ ...@@ -1691,7 +1706,7 @@ const [searchForm] = useValue<SearchForm>({
userMark: '', userMark: '',
customizedQuantity: '', customizedQuantity: '',
order: 'desc', order: 'desc',
platform:'' platform: '',
}) })
const tableColumns = computed<CustomColumn<CardOrderData[]>>(() => { const tableColumns = computed<CustomColumn<CardOrderData[]>>(() => {
return [ return [
......
...@@ -247,7 +247,12 @@ const props = defineProps<{ ...@@ -247,7 +247,12 @@ const props = defineProps<{
printOrder: (data: OrderData, callback: (status: boolean) => void) => void printOrder: (data: OrderData, callback: (status: boolean) => void) => void
warehouseList: WarehouseListData[] warehouseList: WarehouseListData[]
}>() }>()
const emit = defineEmits(['update:modelValue', 'set-printer', 'refresh']) const emit = defineEmits([
'update:modelValue',
'set-printer',
'refresh',
'set-warehouseId',
])
const visible = computed({ const visible = computed({
get() { get() {
return props.modelValue return props.modelValue
...@@ -259,6 +264,7 @@ const visible = computed({ ...@@ -259,6 +264,7 @@ const visible = computed({
const printDeviceList = ref<string[]>([]) const printDeviceList = ref<string[]>([])
const sheetPrinter = ref<string>('') const sheetPrinter = ref<string>('')
const productionOrder = ref<string>('') const productionOrder = ref<string>('')
const podOrderDetailsData = ref<OrderData>() const podOrderDetailsData = ref<OrderData>()
const podOrderDetailsColumns = computed(() => [ const podOrderDetailsColumns = computed(() => [
...@@ -351,7 +357,9 @@ watch(visible, async (value: boolean) => { ...@@ -351,7 +357,9 @@ watch(visible, async (value: boolean) => {
initOrderDetailBox() initOrderDetailBox()
initPrintDevice() initPrintDevice()
const locaclPrinter = localStorage.getItem('sheetPrinter') const locaclPrinter = localStorage.getItem('sheetPrinter')
const locaclWarehouseId = localStorage.getItem('locaclWarehouseId')
if (locaclPrinter) sheetPrinter.value = JSON.parse(locaclPrinter) if (locaclPrinter) sheetPrinter.value = JSON.parse(locaclPrinter)
if (locaclWarehouseId) warehouseId.value = JSON.parse(locaclWarehouseId)
} else { } else {
if (userStore.user?.factory.id) { if (userStore.user?.factory.id) {
socket.send({ socket.send({
...@@ -414,6 +422,7 @@ const renderItemBox = (bool: boolean) => { ...@@ -414,6 +422,7 @@ const renderItemBox = (bool: boolean) => {
if (renderLock) return if (renderLock) return
renderLock = true renderLock = true
let boxItem = podBoxList.value.find((item) => item.box === boxIndex.value) let boxItem = podBoxList.value.find((item) => item.box === boxIndex.value)
if (!boxItem) boxItem = { data: { productList: [] } } if (!boxItem) boxItem = { data: { productList: [] } }
const { data } = boxItem const { data } = boxItem
data?.productList?.forEach((el) => { data?.productList?.forEach((el) => {
...@@ -927,6 +936,7 @@ const handleWarehouseChange = (value: string | number) => { ...@@ -927,6 +936,7 @@ const handleWarehouseChange = (value: string | number) => {
}) })
} }
warehouseId.value = value warehouseId.value = value
emit('set-warehouseId', value)
socket.send({ socket.send({
code: 'STARTORDER', code: 'STARTORDER',
factoryNo: userStore.user?.factory.id, 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