Commit 936e9002 by linjinhong

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

parent 94b18ef2
......@@ -626,3 +626,11 @@ export function getCustomTagListApi() {
`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 {
batchArrangeNumber?: string | null
interceptStatus?: number | null
sizeType?: number | null
productMark?: string | null
customTagList?: { name: string }[]
}
export interface cardImages {
......
......@@ -172,6 +172,7 @@
@click="podOrderDetailsData && print(podOrderDetailsData, true)"
>手动打印</ElButton
>
<ElButton type="primary" @click="printNormal">普货拣货 </ElButton>
<ElButton type="success" @click="handlePrintFinish"
>打单完成</ElButton
>
......@@ -234,11 +235,13 @@ import {
getPackingDataApi,
getPodBoxListApi,
submitInspectionApi,
printNormalPickPdfApi,
} from '@/api/podUsOrder'
import useUserStore from '@/store/user'
import { Check } from '@element-plus/icons-vue'
import socket from '@/utils/websocket'
import { WarehouseListData } from '@/types/api/podUsOrder'
import { filePath } from '@/api/axios.ts'
const { getCLodop } = useLodop()
......@@ -274,7 +277,6 @@ const podOrderDetailsColumns = computed(() => [
width: 250,
slot: 'image',
align: 'center',
},
{
label: '生产单号',
......@@ -410,7 +412,9 @@ watch(
if (el.productMark === 'custom_normal') {
el.previewImgs = [{ url: el.variantImage || '' }]
} else {
el.previewImgs = el.imageAry ? JSON.parse(el.imageAry) : [{url: el.variantImage}]
el.previewImgs = el.imageAry
? JSON.parse(el.imageAry)
: [{ url: el.variantImage }]
}
}
})
......@@ -711,7 +715,9 @@ const initOrderDetailBox = async () => {
if (el.productMark === 'custom_normal') {
el.previewImgs = [{ url: el.variantImage || '' }]
} 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) => {
_warehouseId.value = value
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>
<style scoped lang="scss">
......
......@@ -732,6 +732,11 @@
</ElButton>
</span>
</ElFormItem>
<ElFormItem v-if="['WAIT_SHIPMENT'].includes(status)">
<span class="item">
<ElButton type="primary" @click="printNormal"> 普货拣货 </ElButton>
</span>
</ElFormItem>
<ElFormItem
v-if="
[
......@@ -2938,6 +2943,7 @@ import {
countTrackRegisterApi,
getCustomTagListApi,
getLogisticsWayApi,
printNormalPickPdfApi,
} from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api'
......@@ -2961,7 +2967,7 @@ import {
CraftListData,
ExportParams,
InterceptStateGroupData,
IAllList
IAllList,
} from '@/types/api/podUsOrder'
import usePageList from '@/utils/hooks/usePageList'
import { useValue } from '@/utils/hooks/useValue'
......@@ -6310,6 +6316,37 @@ const isPermissionBtn = globalProperties?.$isPermissionBtn
useRouter().beforeEach((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>
<style lang="scss" scoped>
.header-filter-form {
......
......@@ -15,13 +15,7 @@
所有生产单按{{ getLabels(item.groupField) }}进行自动排单
</div>
<div class="box">批次数量:{{ item.arrangeMax }}</div>
<div class="box">
每天{{
`${item.hour || '00'}:${item.minute || '00'}:${
item.second || '00'
}`
}}开始自动排单
</div>
<div class="box">每天{{ getTime(item) }}开始自动排单</div>
</div>
<div class="action">
......@@ -387,8 +381,8 @@ const save = debounce(async () => {
type: 'success',
offset: window.innerHeight / 2,
})
getList()
cancelFn()
getList()
} catch (e) {
return
}
......@@ -438,6 +432,24 @@ const changeSwitch = () => {
editForm.value.type = 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>
<style lang="scss" scoped>
......
......@@ -8,6 +8,21 @@ import vueJsx from '@vitejs/plugin-vue-jsx'
// https://vitejs.dev/config/
export default defineConfig({
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: [
vue(),
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