Commit 9bbaad08 by zhuzhequan

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

parents 9a50b196 b894be94
...@@ -15,7 +15,7 @@ import { ...@@ -15,7 +15,7 @@ import {
ProductionClient, ProductionClient,
} from '@/types/api/podUsOrder' } from '@/types/api/podUsOrder'
import axios from './axios' import axios from './axios'
import { PodMakeOrderData } from '@/types/api/podMakeOrder' import { PodMakeOrderData, OrderData } from '@/types/api/podMakeOrder'
export function exportPodCnInfo(data: ExportParams) { export function exportPodCnInfo(data: ExportParams) {
return axios.post<never, BasePaginationData<never>>( return axios.post<never, BasePaginationData<never>>(
'factory/podJomallOrderCn/exportPodCnOrder', 'factory/podJomallOrderCn/exportPodCnOrder',
...@@ -56,7 +56,31 @@ export function getPackingCnDataApi( ...@@ -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( export function getSuperPackingCnDataApi(
code: string, code: string,
...@@ -298,14 +322,19 @@ export function printNormalPdf(ids: string) { ...@@ -298,14 +322,19 @@ export function printNormalPdf(ids: string) {
// 播种墙配货 打单完成 // 播种墙配货 打单完成
export function submitInspectionApi( export function submitInspectionApi(
data: { id: number; version?: number }[], data: { id: number; version?: number }[],
boxIndex: number | null,
warehouseId: number | string, 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>>( return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderCn/podPrintOrderComplete?box=${boxIndex}&warehouseId=${warehouseId}`, `factory/podJomallOrderCn/podPrintOrderComplete?${params.toString()}`,
{ { orderParamList: data },
orderParamList: data,
},
) )
} }
// 超级播种墙配货 打单完成 // 超级播种墙配货 打单完成
......
...@@ -221,3 +221,10 @@ export interface CraftListData { ...@@ -221,3 +221,10 @@ export interface CraftListData {
craftName: string craftName: string
craftCode: 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 { ...@@ -9,7 +9,8 @@ export interface OrderData {
shipmentsNote?: string shipmentsNote?: string
filePath?: string filePath?: string
fileData?: string fileData?: string
logisticsWayName?: string logisticsWayName?: string | null
company?: string | null
orderStatus?: number orderStatus?: number
salesPlatform?: string salesPlatform?: string
logisticsCompanyId?: number logisticsCompanyId?: number
......
...@@ -275,7 +275,12 @@ const props = defineProps<{ ...@@ -275,7 +275,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
...@@ -364,17 +369,12 @@ watch(visible, async (value: boolean) => { ...@@ -364,17 +369,12 @@ watch(visible, async (value: boolean) => {
if (value) { if (value) {
podOrderDetailsData.value = {} podOrderDetailsData.value = {}
currentCode = '' currentCode = ''
// warehouseId.value = props.warehouseList[0].id const localRaw = sessionStorage.getItem('locaclCnWarehouseId')
// _warehouseId.value = props.warehouseList[0].id const localId = localRaw ? JSON.parse(localRaw) : ''
const locaclWarehouseId = sessionStorage.getItem('locaclCnWarehouseId') /* 先找一次,确认本地值是否存在于列表 */
// 设置仓库ID,优先使用本地存储的值,否则使用列表中的第一个仓库 const hit = props.warehouseList.find((w) => w.id === localId)
warehouseId.value = locaclWarehouseId warehouseId.value = hit ? localId : props.warehouseList[0].id
? JSON.parse(locaclWarehouseId) _warehouseId.value = hit ? localId : props.warehouseList[0].id
: props.warehouseList[0].id
_warehouseId.value = locaclWarehouseId
? JSON.parse(locaclWarehouseId)
: props.warehouseList[0].id
if (userStore.user?.factory.id) { if (userStore.user?.factory.id) {
try { try {
await socket.init( await socket.init(
...@@ -691,8 +691,8 @@ const submitInspection = async (callback: () => void) => { ...@@ -691,8 +691,8 @@ const submitInspection = async (callback: () => void) => {
try { try {
const res = await submitInspectionApi( const res = await submitInspectionApi(
data, data,
boxIndex.value,
warehouseId.value, warehouseId.value,
boxIndex.value,
) )
if (res.code !== 200) return if (res.code !== 200) return
ElMessage.warning(res.message) ElMessage.warning(res.message)
...@@ -1012,6 +1012,7 @@ const handleWarehouseChange = (value: string | number) => { ...@@ -1012,6 +1012,7 @@ const handleWarehouseChange = (value: string | number) => {
}) })
} }
warehouseId.value = value warehouseId.value = value
emit('set-warehouseId', value)
socket.send({ socket.send({
code: 'STARTORDERCN', code: 'STARTORDERCN',
factoryNo: userStore.user?.factory.id, factoryNo: userStore.user?.factory.id,
......
...@@ -525,10 +525,15 @@ ...@@ -525,10 +525,15 @@
</ElButton> </ElButton>
</span> </span>
<span v-if="status === 'WAIT_SHIPMENT'" class="item"> <span v-if="status === 'WAIT_SHIPMENT'" class="item">
<ElButton type="warning" @click="printPodOrder"> <ElButton type="success" @click="printPodOrder">
播种墙配货 播种墙配货
</ElButton> </ElButton>
</span> </span>
<span v-if="status === 'WAIT_SHIPMENT'" class="item">
<ElButton type="primary" @click="podDistributionOrderShow">
单件打单
</ElButton>
</span>
<span <span
v-if="status === 'WAIT_SHIPMENT' && isSuperFactory" v-if="status === 'WAIT_SHIPMENT' && isSuperFactory"
class="item" class="item"
...@@ -971,7 +976,7 @@ ...@@ -971,7 +976,7 @@
> >
<img <img
:src="img.url" :src="img.url"
alt="商品图片" alt="商品图片222"
style="cursor: pointer" style="cursor: pointer"
@click="handlePictureCardPreview(img.url)" @click="handlePictureCardPreview(img.url)"
/> />
...@@ -2181,6 +2186,14 @@ ...@@ -2181,6 +2186,14 @@
@set-warehouse-id="handleWarehouseIdChange" @set-warehouse-id="handleWarehouseIdChange"
@refresh="onFastRefresh" @refresh="onFastRefresh"
/> />
<!-- :print-order-one="printOrderOne" -->
<PodDistributionOrder
v-model="podDistributionOrderVisible"
:print-order="printOrder"
:warehouse-list="warehouseList"
@set-printer="handlePrinterChange"
@refresh="onFastRefresh"
/>
<SuperPodMakeOrder <SuperPodMakeOrder
v-model="superPodOrderVisible" v-model="superPodOrderVisible"
:print-order="printOrder" :print-order="printOrder"
...@@ -2524,6 +2537,7 @@ import { computed, onMounted, ref, nextTick, reactive } from 'vue' ...@@ -2524,6 +2537,7 @@ import { computed, onMounted, ref, nextTick, reactive } from 'vue'
import FastProduction from './FastProduction.vue' import FastProduction from './FastProduction.vue'
import { filePath } from '@/api/axios' import { filePath } from '@/api/axios'
import PodMakeOrder from './PodMakeOrder.vue' import PodMakeOrder from './PodMakeOrder.vue'
import PodDistributionOrder from './PodDistributionOrder.vue'
import SuperPodMakeOrder from './SuperPodMakeOrder.vue' import SuperPodMakeOrder from './SuperPodMakeOrder.vue'
import { OrderData } from '@/types/api/podMakeOrder' import { OrderData } from '@/types/api/podMakeOrder'
import useLodop, { LODOPObject } from '@/utils/hooks/useLodop' import useLodop, { LODOPObject } from '@/utils/hooks/useLodop'
...@@ -4426,7 +4440,10 @@ const printPodOrder = async () => { ...@@ -4426,7 +4440,10 @@ const printPodOrder = async () => {
sheetPrinter.value = lodop.GET_PRINTER_NAME(0) sheetPrinter.value = lodop.GET_PRINTER_NAME(0)
podOrderVisible.value = true podOrderVisible.value = true
} }
const podDistributionOrderVisible = ref(false)
const podDistributionOrderShow = async () => {
podDistributionOrderVisible.value = true
}
const superPodOrderVisible = ref(false) const superPodOrderVisible = ref(false)
const printSuperPodOrder = async () => { const printSuperPodOrder = async () => {
const lodop = getCLodop(null, null) const lodop = getCLodop(null, null)
...@@ -4803,6 +4820,7 @@ const lodopCall = (fn: (lodop: LODOPObject) => string) => { ...@@ -4803,6 +4820,7 @@ const lodopCall = (fn: (lodop: LODOPObject) => string) => {
_lodopCallback[id] = resolve _lodopCallback[id] = resolve
}) })
} }
const downloadPDF = (url: string) => { const downloadPDF = (url: string) => {
if (!/^https?:/i.test(url)) return url if (!/^https?:/i.test(url)) return url
let xhr, 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