Commit 936e9002 by linjinhong

feat:podus待发货添加普货拣货按钮以及播种墙配货添加普货拣货按钮

parent 94b18ef2
...@@ -626,3 +626,11 @@ export function getCustomTagListApi() { ...@@ -626,3 +626,11 @@ export function getCustomTagListApi() {
`factory/podJomallOrderUs/getCustomTagList`, `factory/podJomallOrderUs/getCustomTagList`,
) )
} }
// 普货拣货
export function printNormalPickPdfApi(ids: string) {
return axios.get<never, BaseRespData<string>>(
'factory/podJomallOrderUs/printNormalPickPdf',
{ params: { ids } },
)
}
...@@ -141,6 +141,7 @@ export interface ProductList { ...@@ -141,6 +141,7 @@ export interface ProductList {
batchArrangeNumber?: string | null batchArrangeNumber?: string | null
interceptStatus?: number | null interceptStatus?: number | null
sizeType?: number | null sizeType?: number | null
productMark?: string | null
customTagList?: { name: string }[] customTagList?: { name: string }[]
} }
export interface cardImages { export interface cardImages {
......
...@@ -172,6 +172,7 @@ ...@@ -172,6 +172,7 @@
@click="podOrderDetailsData && print(podOrderDetailsData, true)" @click="podOrderDetailsData && print(podOrderDetailsData, true)"
>手动打印</ElButton >手动打印</ElButton
> >
<ElButton type="primary" @click="printNormal">普货拣货 </ElButton>
<ElButton type="success" @click="handlePrintFinish" <ElButton type="success" @click="handlePrintFinish"
>打单完成</ElButton >打单完成</ElButton
> >
...@@ -234,11 +235,13 @@ import { ...@@ -234,11 +235,13 @@ import {
getPackingDataApi, getPackingDataApi,
getPodBoxListApi, getPodBoxListApi,
submitInspectionApi, submitInspectionApi,
printNormalPickPdfApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import useUserStore from '@/store/user' import useUserStore from '@/store/user'
import { Check } from '@element-plus/icons-vue' import { Check } from '@element-plus/icons-vue'
import socket from '@/utils/websocket' import socket from '@/utils/websocket'
import { WarehouseListData } from '@/types/api/podUsOrder' import { WarehouseListData } from '@/types/api/podUsOrder'
import { filePath } from '@/api/axios.ts'
const { getCLodop } = useLodop() const { getCLodop } = useLodop()
...@@ -274,7 +277,6 @@ const podOrderDetailsColumns = computed(() => [ ...@@ -274,7 +277,6 @@ const podOrderDetailsColumns = computed(() => [
width: 250, width: 250,
slot: 'image', slot: 'image',
align: 'center', align: 'center',
}, },
{ {
label: '生产单号', label: '生产单号',
...@@ -294,7 +296,7 @@ const podOrderDetailsColumns = computed(() => [ ...@@ -294,7 +296,7 @@ const podOrderDetailsColumns = computed(() => [
width: 160, width: 160,
align: 'center', align: 'center',
}, },
{ {
label: '商品名称', label: '商品名称',
prop: 'productName', prop: 'productName',
...@@ -410,7 +412,9 @@ watch( ...@@ -410,7 +412,9 @@ watch(
if (el.productMark === 'custom_normal') { if (el.productMark === 'custom_normal') {
el.previewImgs = [{ url: el.variantImage || '' }] el.previewImgs = [{ url: el.variantImage || '' }]
} else { } else {
el.previewImgs = el.imageAry ? JSON.parse(el.imageAry) : [{url: el.variantImage}] el.previewImgs = el.imageAry
? JSON.parse(el.imageAry)
: [{ url: el.variantImage }]
} }
} }
}) })
...@@ -421,7 +425,7 @@ watch( ...@@ -421,7 +425,7 @@ watch(
const podBoxIndex = computed(() => orderStore.podBoxIndex) const podBoxIndex = computed(() => orderStore.podBoxIndex)
let renderLock = false let renderLock = false
const renderItemBox = (bool: boolean) => { const renderItemBox = (bool: boolean) => {
if ( if (
!podBoxList.value || !podBoxList.value ||
...@@ -711,7 +715,9 @@ const initOrderDetailBox = async () => { ...@@ -711,7 +715,9 @@ const initOrderDetailBox = async () => {
if (el.productMark === 'custom_normal') { if (el.productMark === 'custom_normal') {
el.previewImgs = [{ url: el.variantImage || '' }] el.previewImgs = [{ url: el.variantImage || '' }]
} else { } else {
el.previewImgs = el.imageAry ? JSON.parse(el.imageAry) : [{url: el.variantImage}] el.previewImgs = el.imageAry
? JSON.parse(el.imageAry)
: [{ url: el.variantImage }]
} }
} }
}) })
...@@ -994,6 +1000,32 @@ const handleWarehouseChange = (value: string | number) => { ...@@ -994,6 +1000,32 @@ const handleWarehouseChange = (value: string | number) => {
_warehouseId.value = value _warehouseId.value = value
initOrderDetailBox() initOrderDetailBox()
} }
const printNormal = async () => {
const arr: (number | undefined)[] = []
;(podBoxList.value || []).forEach((item: PodMakeOrderData) => {
if (item.data) {
if (item.data.productList && item.data.productList.length > 0) {
const flag = item.data.productList.some((item1) => {
return (
item1.productMark == 'normal' ||
item1.productMark == 'custom_normal'
)
})
if (flag) {
arr?.push(item.data?.id)
}
}
}
})
if (!arr.length) {
ElMessage.warning('暂无可打印的普货拣货单')
return
}
const res = await printNormalPickPdfApi(arr.join())
ElMessage.success('操作成功')
window.open(filePath + res.message)
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -732,6 +732,11 @@ ...@@ -732,6 +732,11 @@
</ElButton> </ElButton>
</span> </span>
</ElFormItem> </ElFormItem>
<ElFormItem v-if="['WAIT_SHIPMENT'].includes(status)">
<span class="item">
<ElButton type="primary" @click="printNormal"> 普货拣货 </ElButton>
</span>
</ElFormItem>
<ElFormItem <ElFormItem
v-if=" v-if="
[ [
...@@ -2938,6 +2943,7 @@ import { ...@@ -2938,6 +2943,7 @@ import {
countTrackRegisterApi, countTrackRegisterApi,
getCustomTagListApi, getCustomTagListApi,
getLogisticsWayApi, getLogisticsWayApi,
printNormalPickPdfApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
...@@ -2961,7 +2967,7 @@ import { ...@@ -2961,7 +2967,7 @@ import {
CraftListData, CraftListData,
ExportParams, ExportParams,
InterceptStateGroupData, InterceptStateGroupData,
IAllList IAllList,
} from '@/types/api/podUsOrder' } from '@/types/api/podUsOrder'
import usePageList from '@/utils/hooks/usePageList' import usePageList from '@/utils/hooks/usePageList'
import { useValue } from '@/utils/hooks/useValue' import { useValue } from '@/utils/hooks/useValue'
...@@ -6310,6 +6316,37 @@ const isPermissionBtn = globalProperties?.$isPermissionBtn ...@@ -6310,6 +6316,37 @@ const isPermissionBtn = globalProperties?.$isPermissionBtn
useRouter().beforeEach((to, from, next) => { useRouter().beforeEach((to, from, next) => {
handleBeforeRouteLeave(to, from, next) handleBeforeRouteLeave(to, from, next)
}) })
const printNormal = async () => {
await showConfirm('确定普货拣货吗?', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
const arr: (number | undefined)[] = []
if (!selection.value.length) {
return ElMessage.warning('请选择订单')
}
console.log(3660, selection.value)
selection.value.forEach((s) => {
const f =
s.productList &&
s.productList.find(
(p) => p.productMark === 'normal' || p.productMark === 'custom_normal',
)
if (f) arr.push(f.id)
})
console.log(3661, arr)
if (!arr.length) {
ElMessage.warning('暂无可打印的普货拣货单')
return
}
const res = await printNormalPickPdfApi(arr.join())
ElMessage.success('操作成功')
window.open(filePath + res.message)
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header-filter-form { .header-filter-form {
......
...@@ -15,13 +15,7 @@ ...@@ -15,13 +15,7 @@
所有生产单按{{ getLabels(item.groupField) }}进行自动排单 所有生产单按{{ getLabels(item.groupField) }}进行自动排单
</div> </div>
<div class="box">批次数量:{{ item.arrangeMax }}</div> <div class="box">批次数量:{{ item.arrangeMax }}</div>
<div class="box"> <div class="box">每天{{ getTime(item) }}开始自动排单</div>
每天{{
`${item.hour || '00'}:${item.minute || '00'}:${
item.second || '00'
}`
}}开始自动排单
</div>
</div> </div>
<div class="action"> <div class="action">
...@@ -387,8 +381,8 @@ const save = debounce(async () => { ...@@ -387,8 +381,8 @@ const save = debounce(async () => {
type: 'success', type: 'success',
offset: window.innerHeight / 2, offset: window.innerHeight / 2,
}) })
getList()
cancelFn() cancelFn()
getList()
} catch (e) { } catch (e) {
return return
} }
...@@ -438,6 +432,24 @@ const changeSwitch = () => { ...@@ -438,6 +432,24 @@ const changeSwitch = () => {
editForm.value.type = undefined editForm.value.type = undefined
editForm.value.templateWidth = undefined editForm.value.templateWidth = undefined
} }
const padTimeUnit = (value: string | number): string => {
const num = Number(value)
// 若转换后是 NaN(无效值),或原始值不存在(null/undefined/''),均返回 '00'
if (isNaN(num) || !value) {
return '00'
}
// 确保结果为字符串,补位后返回
return num < 10 ? `0${num}` : `${num}`
}
const getTime = (item: BaseForm) => {
const { hour, minute, second } = item
const newHour = padTimeUnit(hour as string | number)
const newMinute = padTimeUnit(minute as string | number)
const newSecond = padTimeUnit(second as string | number)
return `${newHour}:${newMinute}:${newSecond}`
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -8,6 +8,21 @@ import vueJsx from '@vitejs/plugin-vue-jsx' ...@@ -8,6 +8,21 @@ import vueJsx from '@vitejs/plugin-vue-jsx'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
base: '/', base: '/',
server: {
port: 9527,
host: true,
proxy: {
'/api': {
target: 'http://10.168.31.142:8060',
},
'/ws': {
target: 'http://10.168.31.142:8060',
changeOrigin: true,
ws: true,
secure: false,
},
},
},
plugins: [ plugins: [
vue(), vue(),
vueJsx(), vueJsx(),
......
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