Commit 8eaf66bb by qinjianhui

Merge branch 'release' into dev

parents 7d5b27b1 0fdc9778
...@@ -70,6 +70,15 @@ export interface ILogisticsCompany { ...@@ -70,6 +70,15 @@ export interface ILogisticsCompany {
basicType: number // int(11) basicType: number // int(11)
} }
export interface LogisticsWayData {
id: number
name: string
code: string
status: boolean
createTime: string
updateTime: string
}
interface ILogisticsParams { interface ILogisticsParams {
logType: string logType: string
relaId: number | string relaId: number | string
...@@ -148,6 +157,15 @@ export function getUniuniList() { ...@@ -148,6 +157,15 @@ export function getUniuniList() {
}, },
) )
} }
// 根据物流公司筛选物流方式
export function getLogisticsWayListByCompanyId(companyId: number) {
return axios.get<never, BaseRespData<LogisticsWayData[]>>(
'logisticsWay/getUsableWaysByCompanyId',
{
params: { companyId },
},
)
}
// 获取tictok物流承运商 // 获取tictok物流承运商
export function getTiktokCarrier() { export function getTiktokCarrier() {
return axios.get<never, BaseRespData<{ name: string; id: string,typeCode:string,label:string }[]>>( return axios.get<never, BaseRespData<{ name: string; id: string,typeCode:string,label:string }[]>>(
......
...@@ -246,9 +246,9 @@ export function productionQueryApi(id: number, podJomallOrderCnId: number) { ...@@ -246,9 +246,9 @@ export function productionQueryApi(id: number, podJomallOrderCnId: number) {
}, },
) )
} }
export function printProductionOrderApi(orderIds: number[]) { export function printProductionOrderApi(url: string, orderIds: number[]) {
return axios.post<never, BaseRespData<string>>( return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderProductCn/printProducePdf', url,
orderIds, orderIds,
) )
} }
...@@ -639,10 +639,10 @@ export function updateToWaitShipmentApi(params: { ...@@ -639,10 +639,10 @@ export function updateToWaitShipmentApi(params: {
} }
//创建物流订单 //创建物流订单
export function createLogisticsOrdersApi(orderIds: (string | number)[]) { export function createLogisticsOrdersApi(orderIdList: (string | number)[], logisticsWayId: number | null) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderCn/createLogisticsOrders`, `factory/podJomallOrderCn/createLogisticsOrders`,
orderIds, { orderIdList, logisticsWayId },
) )
} }
...@@ -791,3 +791,11 @@ export function updateProductOutOfStockApi(params: { ...@@ -791,3 +791,11 @@ export function updateProductOutOfStockApi(params: {
params, params,
) )
} }
// 打印普胚生产单
export function printNormalProducePdf(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderProductCn/printNormalProducePdf',
orderIds,
)
}
...@@ -179,9 +179,9 @@ export function productionQueryApi(id: number, podJomallOrderUsId: number) { ...@@ -179,9 +179,9 @@ export function productionQueryApi(id: number, podJomallOrderUsId: number) {
}, },
) )
} }
export function printProductionOrderApi(orderIds: number[]) { export function printProductionOrderApi(url: string, orderIds: number[]) {
return axios.post<never, BaseRespData<string>>( return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderProductUs/printProducePdf', url,
orderIds, orderIds,
) )
} }
......
...@@ -121,11 +121,7 @@ ...@@ -121,11 +121,7 @@
style="display: flex; margin-left: 10px" style="display: flex; margin-left: 10px"
> >
<div class="text-green"> <div class="text-green">
{{ {{ statisticData?.compareYesterdayShipmentOrderNum }}
statisticData?.compareYesterdayShipmentOrderNum.toFixed(
2,
)
}}
</div> </div>
<div class="up-icon-green"></div> <div class="up-icon-green"></div>
</div> </div>
...@@ -134,7 +130,7 @@ ...@@ -134,7 +130,7 @@
{{ {{
Math.abs( Math.abs(
statisticData?.compareYesterdayShipmentOrderNum || 0, statisticData?.compareYesterdayShipmentOrderNum || 0,
).toFixed(2) )
}} }}
</div> </div>
<div class="down-icon-red"></div> <div class="down-icon-red"></div>
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, nextTick, ref, watch, defineProps, defineEmits } from 'vue' import { computed, nextTick, ref, watch } from 'vue'
import useLodop from '@/utils/hooks/useLodop' import useLodop from '@/utils/hooks/useLodop'
import TableView from '@/components/TableView.vue' import TableView from '@/components/TableView.vue'
import { OrderData, ProductList, IorderItem } from '@/types/api/podMakeOrder' import { OrderData, ProductList, IorderItem } from '@/types/api/podMakeOrder'
...@@ -499,14 +499,12 @@ async function barcodeInput() { ...@@ -499,14 +499,12 @@ async function barcodeInput() {
console.log('pending', pending) console.log('pending', pending)
await submitInspection(pending, async () => { await submitInspection(pending, async () => {
await inputActive()
await getPackingData(code)
noObj.value = {} noObj.value = {}
}) })
} else {
await inputActive()
await getPackingData(code)
} }
await inputActive()
await getPackingData(code)
isLock.value = false isLock.value = false
} }
async function submitInspection(objs?: OrderData, callback?: () => void) { async function submitInspection(objs?: OrderData, callback?: () => void) {
...@@ -525,12 +523,10 @@ async function submitInspection(objs?: OrderData, callback?: () => void) { ...@@ -525,12 +523,10 @@ async function submitInspection(objs?: OrderData, callback?: () => void) {
ElMessage.success(res.message) ElMessage.success(res.message)
coverImage.value = '' coverImage.value = ''
testingData.value = {} testingData.value = {}
await inputActive()
isLock.value = false isLock.value = false
callback?.() callback?.()
} catch (e) { } catch (e) {
console.error(e) console.error(e)
await inputActive()
isLock.value = false isLock.value = false
} }
} }
...@@ -591,7 +587,7 @@ async function getPackingData(code: string) { ...@@ -591,7 +587,7 @@ async function getPackingData(code: string) {
async function printFile(data: OrderData) { async function printFile(data: OrderData) {
// await props.printOrderOne(data) // await props.printOrderOne(data)
await printOrderOne(data) await printOrderOne(data)
noObj.value[data.id!] = data noObj.value[data.id as number] = data
await inputActive() await inputActive()
} }
function printOrderOne(item: OrderData): Promise<void> { function printOrderOne(item: OrderData): Promise<void> {
......
<template>
<el-dialog
v-model="createLogisticDialogVisible"
:close-on-click-modal="false"
title="创建物流订单"
>
<div style="display: flex; align-items: center; gap: 20px">
<span style="font-weight: 500">是否自动匹配物流方式</span>
<el-radio-group v-model="isAutoMatch">
<el-radio :value="false"></el-radio>
<el-radio :value="true"></el-radio>
</el-radio-group>
</div>
<div
v-if="!isAutoMatch && logisticCompanyList.length > 0"
style="margin: 10px; border: 1px solid #e0e0e0; display: flex"
>
<div
style="
display: flex;
flex-direction: column;
width: 200px;
font-weight: 500;
"
>
<div
v-for="item in logisticCompanyList"
:key="item.id"
class="logistic-company-item"
:class="{
'selected-logistic-company':
selectedLogisticCompany?.id === item.id,
}"
@click="selectLogisticCompany(item)"
>
{{ item.name }}
</div>
</div>
<div
style="
width: 100%;
min-height: 220px;
display: flex;
justify-content: center;
align-items: flex-start;
"
>
<div
v-if="logisticsWayList.length > 0"
style="
padding: 0 10px;
width: 100%;
display: flex;
align-items: center;
"
>
<el-radio-group v-model="logisticsWayId">
<el-radio
v-for="item in logisticsWayList"
:key="item.id"
:value="item.id"
style="width: 200px; height: 40px"
>
{{ item.name }}
</el-radio>
</el-radio-group>
</div>
<el-empty v-else description="暂无数据" :image-size="80" />
</div>
</div>
<template #footer>
<el-button @click="cancelDialog"> 取消 </el-button>
<el-button type="primary" @click="confirmDialog"> 确定 </el-button>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import {
getLogisticsCompanyList,
ILogisticsCompany,
getLogisticsWayListByCompanyId,
LogisticsWayData,
} from '@/api/logistics'
import { createLogisticsOrdersApi } from '@/api/podCnOrder'
const createLogisticDialogVisible = ref(false)
const isAutoMatch = ref(false)
const logisticCompanyList = ref<ILogisticsCompany[]>([])
const selectedLogisticCompany = ref<ILogisticsCompany | null>(null)
const logisticsWayList = ref<LogisticsWayData[]>([])
const logisticsWayId = ref<number | null>(null)
const orderIdList = ref<(string | number)[]>([])
const cancelDialog = () => {
logisticsWayList.value = []
logisticCompanyList.value = []
selectedLogisticCompany.value = null
logisticsWayId.value = null
orderIdList.value = []
isAutoMatch.value = false
createLogisticDialogVisible.value = false
}
// 获取物流公司列表
const getLogisticsCompanyListFn = async () => {
const { data } = await getLogisticsCompanyList()
logisticCompanyList.value = data as unknown as ILogisticsCompany[]
if (logisticCompanyList.value.length > 0) {
selectedLogisticCompany.value = logisticCompanyList.value[0]
await getLogisticsWayListFn(selectedLogisticCompany.value.id)
}
}
// 获取物流方式列表
const getLogisticsWayListFn = async (id: number) => {
const { data } = await getLogisticsWayListByCompanyId(id)
logisticsWayList.value = data
}
// 选择物流公司
const selectLogisticCompany = async (item: ILogisticsCompany) => {
selectedLogisticCompany.value = item
await getLogisticsWayListFn(item.id)
}
const confirmDialog = async () => {
await createLogisticsOrdersApi(orderIdList.value, logisticsWayId.value)
.then((res) => {
emits('show-result', res.data)
})
.finally(() => {
logisticsWayList.value = []
logisticCompanyList.value = []
selectedLogisticCompany.value = null
logisticsWayId.value = null
orderIdList.value = []
isAutoMatch.value = false
createLogisticDialogVisible.value = false
})
}
const showDialog = async (ids: (string | number)[]) => {
await getLogisticsCompanyListFn()
orderIdList.value = ids
createLogisticDialogVisible.value = true
}
const emits = defineEmits<{
(
e: 'show-result',
data: Array<{
id: string | number
status: boolean
factoryOrderNumber?: string
message: string
}>,
): void
}>()
defineExpose({
showDialog,
})
watch(isAutoMatch, (newVal) => {
if (newVal) {
getLogisticsCompanyListFn()
}
})
</script>
<style lang="scss" scoped>
.logistic-company-item {
padding: 10px 10px;
cursor: pointer;
&:hover {
background-color: #f0f0f0;
}
}
.selected-logistic-company {
background-color: #f0f0f0;
}
</style>
...@@ -702,14 +702,14 @@ ...@@ -702,14 +702,14 @@
单件打单 单件打单
</ElButton> </ElButton>
</span> </span>
<span <!-- <span
v-if="status === 'WAIT_SHIPMENT' && isSuperFactory" v-if="status === 'WAIT_SHIPMENT' && isSuperFactory"
class="item" class="item"
> >
<ElButton type="danger" @click="printSuperPodOrder"> <ElButton type="danger" @click="printSuperPodOrder">
超级播种墙配货 超级播种墙配货
</ElButton> </ElButton>
</span> </span> -->
<span v-if="status === 'CREATE_LOGISTICS'" class="item"> <span v-if="status === 'CREATE_LOGISTICS'" class="item">
<ElButton type="warning" @click="logisticsToPicking"> <ElButton type="warning" @click="logisticsToPicking">
转至待排单 转至待排单
...@@ -753,7 +753,7 @@ ...@@ -753,7 +753,7 @@
selection.length === 0 || selection.length === 0 ||
selection.some((item) => item.shipmentType !== 1) selection.some((item) => item.shipmentType !== 1)
" "
@click="getOrderByIdApi('createLogisticsOrder')" @click="handleCreateLogistic()"
>创建物流订单</ElDropdownItem >创建物流订单</ElDropdownItem
> >
<ElDropdownItem <ElDropdownItem
...@@ -847,6 +847,11 @@ ...@@ -847,6 +847,11 @@
<span v-if="['WAIT_SHIPMENT'].includes(status)" class="item"> <span v-if="['WAIT_SHIPMENT'].includes(status)" class="item">
<ElButton type="primary" @click="printNormal"> 普货拣货 </ElButton> <ElButton type="primary" @click="printNormal"> 普货拣货 </ElButton>
</span> </span>
<span v-if="['WAIT_SHIPMENT'].includes(status)" class="item">
<ElButton type="primary" @click="printNormalProductionOrder">
打印普胚生产单
</ElButton>
</span>
<span <span
v-if=" v-if="
status === 'STOCK_OUT' || status === 'STOCK_OUT' ||
...@@ -931,6 +936,13 @@ ...@@ -931,6 +936,13 @@
</template> </template>
</ElDropdown> </ElDropdown>
</span> </span>
<span v-if="['COMPLETE'].includes(status)" class="item">
<ElButton
type="warning"
@click="getOrderByIdApi('getTrackingNumber')"
>获取跟踪号</ElButton
>
</span>
<span <span
v-if="['WAIT_TRACK', 'COMPLETE', 'IN_TRANSIT'].includes(status)" v-if="['WAIT_TRACK', 'COMPLETE', 'IN_TRANSIT'].includes(status)"
class="item" class="item"
...@@ -1798,7 +1810,9 @@ ...@@ -1798,7 +1810,9 @@
> >
<span class="operate-item"> <span class="operate-item">
<ElButton <ElButton
:disabled="!row.url && !row.tiffUrl" :disabled="
(!row.url && !row.tiffUrl) || row.enableArrange === false
"
link link
type="primary" type="primary"
@click="handleDownload(row)" @click="handleDownload(row)"
...@@ -1822,7 +1836,7 @@ ...@@ -1822,7 +1836,7 @@
type="primary" type="primary"
@click="printPickingOrderItem(row, 1)" @click="printPickingOrderItem(row, 1)"
> >
打印拣货单 拣货单
</ElButton> </ElButton>
</span> </span>
<span class="operate-item"> <span class="operate-item">
...@@ -1831,19 +1845,19 @@ ...@@ -1831,19 +1845,19 @@
type="primary" type="primary"
@click="printPickingOrderItem(row, 2)" @click="printPickingOrderItem(row, 2)"
> >
打印生产单 生产单
</ElButton> </ElButton>
</span> </span>
<span class="operate-item"> <span class="operate-item">
<ElButton <ElButton
:disabled="row.productNum > 50" :disabled="row.productNum > 50 || row.enableArrange === false"
link link
type="warning" type="warning"
:loading="reComposingLoadingMap[row.id]" :loading="reComposingLoadingMap[row.id]"
@click="showArrange(1, row)" @click="showArrange(1, row)"
> >
新排版
</ElButton> </ElButton>
</span> </span>
<span class="operate-item"> <span class="operate-item">
...@@ -2074,6 +2088,17 @@ ...@@ -2074,6 +2088,17 @@
</template> </template>
<template #operations> <template #operations>
<div <div
v-if="
(cardItem?.productMark === 'custom_normal' ||
cardItem?.productMark === 'normal') &&
(status == 'TO_BE_ARRANGE' || status == 'PICKING')
"
class="customizedQuantity"
:title="`类型:${getProductMarkt(cardItem?.productMark)}面`"
>
{{ getProductMarkt(cardItem?.productMark) }}
</div>
<div
v-if="cardItem?.customizedQuantity" v-if="cardItem?.customizedQuantity"
class="customizedQuantity" class="customizedQuantity"
:title="`类型:${getQuantityText( :title="`类型:${getQuantityText(
...@@ -2766,6 +2791,11 @@ ...@@ -2766,6 +2791,11 @@
} }
" "
></ChangeWayDialog> ></ChangeWayDialog>
<CreateLogisticDialog
ref="createLogisticDialogRef"
:row-data="currentItem"
@show-result="handleShowResult"
/>
<print-warehouse-sku-tag ref="printWarehouseSkuDialogRef" /> <print-warehouse-sku-tag ref="printWarehouseSkuDialogRef" />
<weight-dialog <weight-dialog
ref="weightDialogRef" ref="weightDialogRef"
...@@ -2849,6 +2879,7 @@ import { ...@@ -2849,6 +2879,7 @@ import {
batchDownloadRecomposingApi, batchDownloadRecomposingApi,
getCustomTagListCnApi, getCustomTagListCnApi,
printNormalPdf, printNormalPdf,
printNormalProducePdf,
changeLogisticsApi, changeLogisticsApi,
getEmployeeListApi, getEmployeeListApi,
allErpCodeListApi, allErpCodeListApi,
...@@ -2858,6 +2889,7 @@ import { ...@@ -2858,6 +2889,7 @@ import {
// import { logisticsCompanyAllCodelist } from '@/api/logistics.ts' // import { logisticsCompanyAllCodelist } from '@/api/logistics.ts'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
import ChangeWayDialog from './components/ChangeWayDialog.vue' import ChangeWayDialog from './components/ChangeWayDialog.vue'
import CreateLogisticDialog from './components/CreateLogisticDialog.vue'
import UpdateAddress from './components/updateAddress.vue' import UpdateAddress from './components/updateAddress.vue'
import { useEnterKeyTrigger } from '@/utils/hooks/useEnterKeyTrigger.ts' import { useEnterKeyTrigger } from '@/utils/hooks/useEnterKeyTrigger.ts'
...@@ -2897,7 +2929,7 @@ import RightClickMenu from '@/components/RightClickMenu.vue' ...@@ -2897,7 +2929,7 @@ import RightClickMenu from '@/components/RightClickMenu.vue'
import ResultInfo from './components/ResultInfo.vue' import ResultInfo from './components/ResultInfo.vue'
import { isArray, isString } from '@/utils/validate' import { isArray, isString } from '@/utils/validate'
import platformJson from '../../../json/platform.json' import platformJson from '../../../json/platform.json'
import useUserStore from '@/store/user' // import useUserStore from '@/store/user'
import BigNumber from 'bignumber.js' import BigNumber from 'bignumber.js'
import { import {
useRouter, useRouter,
...@@ -2921,9 +2953,9 @@ declare global { ...@@ -2921,9 +2953,9 @@ declare global {
} }
} }
const userStore = useUserStore() // const userStore = useUserStore()
const isSuperFactory: boolean = userStore.user?.factory.dropShipping || false // const isSuperFactory: boolean = userStore.user?.factory.dropShipping || false
const tabsNav = ref<Tab[]>() const tabsNav = ref<Tab[]>()
const isAuto = ref(true) const isAuto = ref(true)
...@@ -2931,6 +2963,7 @@ const printWarehouseSkuDialogRef = ref() ...@@ -2931,6 +2963,7 @@ const printWarehouseSkuDialogRef = ref()
const weightDialogRef = ref() const weightDialogRef = ref()
const updateCustomDeclarationInfoDialogRef = ref() const updateCustomDeclarationInfoDialogRef = ref()
const updateCustomDeclarationInfoDialogVisible = ref(false) const updateCustomDeclarationInfoDialogVisible = ref(false)
const createLogisticDialogRef = ref()
const calculatedPrice = (item: ProductList) => { const calculatedPrice = (item: ProductList) => {
const templatePrice = new BigNumber(item.templatePrice || 0) const templatePrice = new BigNumber(item.templatePrice || 0)
const craftPrice = new BigNumber(item.craftPrice || 0) const craftPrice = new BigNumber(item.craftPrice || 0)
...@@ -3296,6 +3329,42 @@ const printNormal = async () => { ...@@ -3296,6 +3329,42 @@ const printNormal = async () => {
window.open(filePath + res.message) window.open(filePath + res.message)
} }
const printNormalProductionOrder = async () => {
const orderIds: number[] = []
if (!selection.value.length) {
return ElMessage.warning('请选择订单')
}
selection.value.forEach((s) => {
s.productList &&
s.productList.forEach((p) => {
if (p.productMark === 'normal' || p.productMark === 'custom_normal') {
orderIds.push(p.id)
}
})
})
if (!orderIds.length) {
ElMessage.warning('暂无可打印的普胚生产单')
return
}
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await printNormalProducePdf(orderIds)
if (res.code !== 200) return
ElMessage.success('操作成功')
window.open(filePath + res.message)
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const completeDelivery = async () => { const completeDelivery = async () => {
if (selection.value.length === 0) { if (selection.value.length === 0) {
return ElMessage.warning('请选择订单') return ElMessage.warning('请选择订单')
...@@ -3804,7 +3873,7 @@ const tableColumns = computed(() => { ...@@ -3804,7 +3873,7 @@ const tableColumns = computed(() => {
{ {
label: '操作', label: '操作',
slot: 'operate', slot: 'operate',
width: 350, width: 260,
align: 'center', align: 'center',
fixed: 'right', fixed: 'right',
prop: 'operate', prop: 'operate',
...@@ -4451,8 +4520,12 @@ const printProductionOrder = async () => { ...@@ -4451,8 +4520,12 @@ const printProductionOrder = async () => {
text: '操作中...', text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)', background: 'rgba(0, 0, 0, 0.3)',
}) })
const url =
status.value === 'TO_BE_REPLENISHMENT'
? 'factory/podJomallOrderProductCn/replenishmentPrintProducePdf'
: 'factory/podJomallOrderProductCn/printProducePdf'
try { try {
const res = await printProductionOrderApi(orderIds) const res = await printProductionOrderApi(url, orderIds)
if (res.code !== 200) return if (res.code !== 200) return
ElMessage.success('操作成功') ElMessage.success('操作成功')
window.open(filePath + res.message) window.open(filePath + res.message)
...@@ -4808,7 +4881,33 @@ const showArrange = async (type: number, data?: PodCnOrderListData) => { ...@@ -4808,7 +4881,33 @@ const showArrange = async (type: number, data?: PodCnOrderListData) => {
if (type === 1 || type === 3) { if (type === 1 || type === 3) {
typesettingRow.value = data typesettingRow.value = data
} else if (type === 2) { } else if (type === 2) {
const ALLOWED_PRODUCT_MARKS = ['custom_normal', 'normal']
const selectedIds = cardSelection.value.map((item) => item.id) const selectedIds = cardSelection.value.map((item) => item.id)
const isProductMark = cardSelection.value.find((item) =>
ALLOWED_PRODUCT_MARKS.includes(item.productMark as string),
)
if (isProductMark) {
const bool = cardSelection.value.every((item) =>
ALLOWED_PRODUCT_MARKS.includes(item.productMark as string),
)
if (!bool) {
return await ElMessageBox.confirm(
'无法排单,你选择的生产单包含多种商品类型,排单不支持多种商品类型混排,请选择同一类型的商品对应的生产单后再试!',
'错误提示',
{
confirmButtonText: '确定',
type: 'warning',
},
)
} else {
await ElMessageBox.confirm('确认对所选择的生产单进行排单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
return arrangeFinish()
}
}
if (selectedIds.length === 0) { if (selectedIds.length === 0) {
return ElMessage({ return ElMessage({
...@@ -4928,13 +5027,13 @@ const podDistributionOrderShow = async () => { ...@@ -4928,13 +5027,13 @@ const podDistributionOrderShow = async () => {
podDistributionOrderVisible.value = true 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)
if (!lodop) return // if (!lodop) return
sheetPrinter.value = lodop.GET_PRINTER_NAME(0) // sheetPrinter.value = lodop.GET_PRINTER_NAME(0)
superPodOrderVisible.value = true // superPodOrderVisible.value = true
} // }
/** /**
* @description: 创建物流、获取跟踪号、获取打印面单、更改物流、取消物流订单 * @description: 创建物流、获取跟踪号、获取打印面单、更改物流、取消物流订单
...@@ -4951,10 +5050,7 @@ const getOrderByIdApi = async (type: string) => { ...@@ -4951,10 +5050,7 @@ const getOrderByIdApi = async (type: string) => {
Fn: (orderIds: (string | number)[]) => Promise<BaseRespData<never>> Fn: (orderIds: (string | number)[]) => Promise<BaseRespData<never>>
} }
} = { } = {
createLogisticsOrder: {
message: '创建物流订单',
Fn: createLogisticsOrdersApi,
},
getTrackingNumber: { getTrackingNumber: {
message: '获取跟踪号', message: '获取跟踪号',
Fn: getTrackingNumberApi, Fn: getTrackingNumberApi,
...@@ -5807,6 +5903,12 @@ function getQuantityText(qty: number) { ...@@ -5807,6 +5903,12 @@ function getQuantityText(qty: number) {
if (!qty || qty <= 0) return '' if (!qty || qty <= 0) return ''
return Math.floor(qty) === 1 ? '单' : '多' return Math.floor(qty) === 1 ? '单' : '多'
} }
function getProductMarkt(productMark: string) {
if (!productMark) return ''
if (productMark === 'custom_normal') return 'CB'
if (productMark === 'normal') return 'G'
return ''
}
const handleMark = (mark: string) => { const handleMark = (mark: string) => {
switch (mark) { switch (mark) {
...@@ -5900,6 +6002,26 @@ const handleStockOut = async (row: PodCnOrderListData) => { ...@@ -5900,6 +6002,26 @@ const handleStockOut = async (row: PodCnOrderListData) => {
}) })
} }
// 创建物流订单
const handleCreateLogistic = () => {
const ids = selection.value.map((item) => item.id)
nextTick(() => {
createLogisticDialogRef.value?.showDialog(ids)
})
}
const handleShowResult = (data: Array<{
id: string | number
status: boolean
factoryOrderNumber?: string
message: string
}>) => {
resultInfo.value = data || []
if (resultInfo.value.length > 0) {
resultRefs.value?.showDialog()
}
}
const getNewImageFn = (img: string) => { const getNewImageFn = (img: string) => {
try { try {
if (img.startsWith('http')) return img if (img.startsWith('http')) return img
......
...@@ -1984,7 +1984,7 @@ ...@@ -1984,7 +1984,7 @@
class="operate-box-vertical" class="operate-box-vertical"
> >
<el-link <el-link
:disabled="row.isUpload" :disabled="row.isUpload || row.enableArrange === false"
underline="never" underline="never"
type="success" type="success"
@click="uploadFile(row)" @click="uploadFile(row)"
...@@ -1998,7 +1998,7 @@ ...@@ -1998,7 +1998,7 @@
<Loading /> <Loading />
</el-icon> </el-icon>
<el-link <el-link
:disabled="!row.prnUrl" :disabled="!row.prnUrl || row.enableArrange === false"
style="margin-left: 8px" style="margin-left: 8px"
underline="never" underline="never"
:title="fileName(row)" :title="fileName(row)"
...@@ -2052,7 +2052,9 @@ ...@@ -2052,7 +2052,9 @@
</span> </span>
<span class="operate-item"> <span class="operate-item">
<ElButton <ElButton
:disabled="!row.url && !row.tiffUrl" :disabled="
(!row.url && !row.tiffUrl) || row.enableArrange === false
"
link link
type="primary" type="primary"
@click="handleDownload(row)" @click="handleDownload(row)"
...@@ -2065,7 +2067,7 @@ ...@@ -2065,7 +2067,7 @@
</span> </span>
<span class="operate-item"> <span class="operate-item">
<ElButton <ElButton
:disabled="row.productNum > 50" :disabled="row.productNum > 50 || row.enableArrange === false"
link link
title="重新排版" title="重新排版"
type="warning" type="warning"
...@@ -2337,6 +2339,17 @@ ...@@ -2337,6 +2339,17 @@
</template> </template>
<template #operations> <template #operations>
<div <div
v-if="
(cardItem?.productMark === 'custom_normal' ||
cardItem?.productMark === 'normal') &&
(status == 'TO_BE_ARRANGE' || status == 'PICKING')
"
class="customizedQuantity"
:title="`类型:${getProductMarkt(cardItem?.productMark)}面`"
>
{{ getProductMarkt(cardItem?.productMark) }}
</div>
<div
v-if="cardItem?.customizedQuantity" v-if="cardItem?.customizedQuantity"
class="customizedQuantity" class="customizedQuantity"
:title="`类型:${getQuantityText( :title="`类型:${getQuantityText(
...@@ -3265,7 +3278,7 @@ import { ...@@ -3265,7 +3278,7 @@ import {
CircleCheckFilled, CircleCheckFilled,
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import { Column, ElFormItem, ElMessage } from 'element-plus' import { Column, ElFormItem, ElMessage } from 'element-plus'
import { computed, onMounted, ref, nextTick, reactive } from 'vue' import { computed, onMounted, ref, nextTick, reactive, h } 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'
...@@ -4825,37 +4838,6 @@ const assignOrder = async () => { ...@@ -4825,37 +4838,6 @@ const assignOrder = async () => {
currentOrderIds.value = selection.value.map((item) => item.id) currentOrderIds.value = selection.value.map((item) => item.id)
exceptionDialogVisible.value = true exceptionDialogVisible.value = true
} }
// const handleExceptionOrder = async () => {
// if (selection.value.length === 0) {
// return ElMessage.warning('请选择数据')
// }
// try {
// await showConfirm('确定处理异常吗?', {
// confirmButtonText: '确认',
// cancelButtonText: '取消',
// type: 'warning',
// })
// } catch {
// return
// }
// const orderIds = selection.value.map((item) => item.id)
// const loading = ElLoading.service({
// fullscreen: true,
// text: '操作中...',
// background: 'rgba(0, 0, 0, 0.3)',
// })
// try {
// const res = await handleExceptionOrderApi(orderIds)
// if (res.code !== 200) return
// ElMessage.success('操作成功')
// search()
// loadTabData()
// } catch (e) {
// console.error(e)
// } finally {
// loading.close()
// }
// }
const printProductionOrder = async ( const printProductionOrder = async (
type: 1 | 2, type: 1 | 2,
item: PodUsOrderListData | null, item: PodUsOrderListData | null,
...@@ -4871,8 +4853,12 @@ const printProductionOrder = async ( ...@@ -4871,8 +4853,12 @@ const printProductionOrder = async (
text: '操作中...', text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)', background: 'rgba(0, 0, 0, 0.3)',
}) })
const url =
status.value === 'TO_BE_REPLENISHMENT'
? 'factory/podJomallOrderProductUs/replenishmentPrintProducePdf'
: 'factory/podJomallOrderProductUs/printProducePdf'
try { try {
const res = await printProductionOrderApi(orderIds) const res = await printProductionOrderApi(url, orderIds)
if (res.code !== 200) return if (res.code !== 200) return
ElMessage.success('操作成功') ElMessage.success('操作成功')
window.open(filePath + res.message) window.open(filePath + res.message)
...@@ -5318,44 +5304,68 @@ const showArrange = async (type: number, data?: PodUsOrderListData) => { ...@@ -5318,44 +5304,68 @@ const showArrange = async (type: number, data?: PodUsOrderListData) => {
offset: window.innerHeight / 2, offset: window.innerHeight / 2,
}) })
} }
const bool = hasDifferentCraftCodeWithSet(cardSelection.value)
if (bool) {
try {
await ElMessageBox.confirm(
'选中排单的生产单存在多个工艺类型, 是否继续排单?',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
},
)
typesettingVisible.value = true // 是否全是cb和g类
} catch (error) { const allCBOrG = cardSelection.value.every(
return (typesettingVisible.value = false) (item) =>
} item.productMark === 'custom_normal' || item.productMark === 'normal',
} )
}
typesettingVisible.value = true
}
function hasDifferentCraftCodeWithSet(items: ProductList[]) { // 是否全是cp类
if (items.length <= 1) return false const allCP = cardSelection.value.every(
(item) =>
item.productMark !== 'custom_normal' && item.productMark !== 'normal',
)
const seen = new Set() // cb和g类排单
for (const item of items) { if (allCBOrG) {
if (seen.has(item.craftType)) { ElMessageBox.confirm('确认对所选择生产单进行排单?', '提示', {
if (seen.size > 1) return true confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
isAuto.value = false
submitTypesetting()
})
} else if (allCP) {
typesettingVisible.value = true
} else { } else {
seen.add(item.craftType) // 不支持混排
if (seen.size > 1) return true await ElMessageBox.alert(
h('p', null, [
h('span', null, '无法排单。'),
h('br'),
h(
'span',
null,
'原因:你选择的生产单包含多种商品类型,排单不支持多种商品类型混排,请选择同一类型的商品对应的生产单后再试!',
),
]),
'提示',
{
confirmButtonText: '确定',
},
)
return
} }
} }
return false
} }
// function hasDifferentCraftCodeWithSet(items: ProductList[]) {
// if (items.length <= 1) return false
// const seen = new Set()
// for (const item of items) {
// if (seen.has(item.craftType)) {
// if (seen.size > 1) return true
// } else {
// seen.add(item.craftType)
// if (seen.size > 1) return true
// }
// }
// return false
// }
const arrangeFinish = async () => { const arrangeFinish = async () => {
const loading = ElLoading.service({ const loading = ElLoading.service({
fullscreen: true, fullscreen: true,
...@@ -6566,6 +6576,12 @@ function getQuantityText(qty: number) { ...@@ -6566,6 +6576,12 @@ function getQuantityText(qty: number) {
if (!qty || qty <= 0) return '' if (!qty || qty <= 0) return ''
return Math.floor(qty) === 1 ? '单' : '多' return Math.floor(qty) === 1 ? '单' : '多'
} }
function getProductMarkt(productMark: string) {
if (!productMark) return ''
if (productMark === 'custom_normal') return 'CB'
if (productMark === 'normal') return 'G'
return ''
}
const dialogVisible = ref(false) const dialogVisible = ref(false)
const dialogImageUrl = ref('') const dialogImageUrl = ref('')
......
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