Commit 9bbaad08 by zhuzhequan

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

parents 9a50b196 b894be94
......@@ -15,7 +15,7 @@ import {
ProductionClient,
} from '@/types/api/podUsOrder'
import axios from './axios'
import { PodMakeOrderData } from '@/types/api/podMakeOrder'
import { PodMakeOrderData, OrderData } from '@/types/api/podMakeOrder'
export function exportPodCnInfo(data: ExportParams) {
return axios.post<never, BasePaginationData<never>>(
'factory/podJomallOrderCn/exportPodCnOrder',
......@@ -56,7 +56,31 @@ export function getPackingCnDataApi(
},
)
}
export function getSingleQueryApi(
code: string,
factoryNo: number,
warehouseId: number | string,
) {
return axios.get<never, BaseRespData<OrderData>>(
'/factory/podJomallOrderCn/getPodDetailsBySkuOrNo',
{
params: {
podJomallCnNo: code,
factoryNo,
warehouseId,
},
},
)
}
interface LabelFile {
filePath?: string // 文件地址
fileData?: string // base64 文件流(二选一)
}
export function getPrintLogisticLabelApi(id?: number) {
return axios.get<never, BaseRespData<LabelFile>>(
`factory/podJomallOrderCn/printLogisticLabel?id=${id}`,
)
}
// 超级播种墙配货 扫码放入箱子
export function getSuperPackingCnDataApi(
code: string,
......@@ -298,14 +322,19 @@ export function printNormalPdf(ids: string) {
// 播种墙配货 打单完成
export function submitInspectionApi(
data: { id: number; version?: number }[],
boxIndex: number | null,
warehouseId: number | string,
boxIndex?: number | null,
) {
const params = new URLSearchParams()
// 先放 warehouseId,再放 boxIndex
params.set('warehouseId', String(warehouseId))
if (boxIndex !== undefined && boxIndex !== null) {
params.set('box', String(boxIndex))
}
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderCn/podPrintOrderComplete?box=${boxIndex}&warehouseId=${warehouseId}`,
{
orderParamList: data,
},
`factory/podJomallOrderCn/podPrintOrderComplete?${params.toString()}`,
{ orderParamList: data },
)
}
// 超级播种墙配货 打单完成
......
......@@ -221,3 +221,10 @@ export interface CraftListData {
craftName: string
craftCode: string
}
export interface PackingData {
podProductionNo?: string; // 生产单号(PSCD 开头)
jomallCustomNo?: string; // 一件定制号(16 位数字 或 S- 开头)
jomallPsdCustomNo?: string; // 满印定制号(JMSC/GCSC 开头)
podJomallNo?: string; // POD 平台号(JMPSC/GCPS 经过正则提取)
sku?: string; // 普通 SKU(兜底)
}
\ No newline at end of file
......@@ -9,7 +9,8 @@ export interface OrderData {
shipmentsNote?: string
filePath?: string
fileData?: string
logisticsWayName?: string
logisticsWayName?: string | null
company?: string | null
orderStatus?: number
salesPlatform?: string
logisticsCompanyId?: number
......
......@@ -275,7 +275,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
......@@ -364,17 +369,12 @@ watch(visible, async (value: boolean) => {
if (value) {
podOrderDetailsData.value = {}
currentCode = ''
// warehouseId.value = props.warehouseList[0].id
// _warehouseId.value = props.warehouseList[0].id
const locaclWarehouseId = sessionStorage.getItem('locaclCnWarehouseId')
// 设置仓库ID,优先使用本地存储的值,否则使用列表中的第一个仓库
warehouseId.value = locaclWarehouseId
? JSON.parse(locaclWarehouseId)
: props.warehouseList[0].id
_warehouseId.value = locaclWarehouseId
? JSON.parse(locaclWarehouseId)
: props.warehouseList[0].id
const localRaw = sessionStorage.getItem('locaclCnWarehouseId')
const localId = localRaw ? JSON.parse(localRaw) : ''
/* 先找一次,确认本地值是否存在于列表 */
const hit = props.warehouseList.find((w) => w.id === localId)
warehouseId.value = hit ? localId : props.warehouseList[0].id
_warehouseId.value = hit ? localId : props.warehouseList[0].id
if (userStore.user?.factory.id) {
try {
await socket.init(
......@@ -691,8 +691,8 @@ const submitInspection = async (callback: () => void) => {
try {
const res = await submitInspectionApi(
data,
boxIndex.value,
warehouseId.value,
boxIndex.value,
)
if (res.code !== 200) return
ElMessage.warning(res.message)
......@@ -1012,6 +1012,7 @@ const handleWarehouseChange = (value: string | number) => {
})
}
warehouseId.value = value
emit('set-warehouseId', value)
socket.send({
code: 'STARTORDERCN',
factoryNo: userStore.user?.factory.id,
......
......@@ -525,10 +525,15 @@
</ElButton>
</span>
<span v-if="status === 'WAIT_SHIPMENT'" class="item">
<ElButton type="warning" @click="printPodOrder">
<ElButton type="success" @click="printPodOrder">
播种墙配货
</ElButton>
</span>
<span v-if="status === 'WAIT_SHIPMENT'" class="item">
<ElButton type="primary" @click="podDistributionOrderShow">
单件打单
</ElButton>
</span>
<span
v-if="status === 'WAIT_SHIPMENT' && isSuperFactory"
class="item"
......@@ -971,7 +976,7 @@
>
<img
:src="img.url"
alt="商品图片"
alt="商品图片222"
style="cursor: pointer"
@click="handlePictureCardPreview(img.url)"
/>
......@@ -2181,6 +2186,14 @@
@set-warehouse-id="handleWarehouseIdChange"
@refresh="onFastRefresh"
/>
<!-- :print-order-one="printOrderOne" -->
<PodDistributionOrder
v-model="podDistributionOrderVisible"
:print-order="printOrder"
:warehouse-list="warehouseList"
@set-printer="handlePrinterChange"
@refresh="onFastRefresh"
/>
<SuperPodMakeOrder
v-model="superPodOrderVisible"
:print-order="printOrder"
......@@ -2524,6 +2537,7 @@ import { computed, onMounted, ref, nextTick, reactive } from 'vue'
import FastProduction from './FastProduction.vue'
import { filePath } from '@/api/axios'
import PodMakeOrder from './PodMakeOrder.vue'
import PodDistributionOrder from './PodDistributionOrder.vue'
import SuperPodMakeOrder from './SuperPodMakeOrder.vue'
import { OrderData } from '@/types/api/podMakeOrder'
import useLodop, { LODOPObject } from '@/utils/hooks/useLodop'
......@@ -4426,7 +4440,10 @@ const printPodOrder = async () => {
sheetPrinter.value = lodop.GET_PRINTER_NAME(0)
podOrderVisible.value = true
}
const podDistributionOrderVisible = ref(false)
const podDistributionOrderShow = async () => {
podDistributionOrderVisible.value = true
}
const superPodOrderVisible = ref(false)
const printSuperPodOrder = async () => {
const lodop = getCLodop(null, null)
......@@ -4803,6 +4820,7 @@ const lodopCall = (fn: (lodop: LODOPObject) => string) => {
_lodopCallback[id] = resolve
})
}
const downloadPDF = (url: string) => {
if (!/^https?:/i.test(url)) return url
let xhr,
......
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