Commit ea738a7c by qinjianhui

feat: 生产完成功能

parent df805aff
...@@ -264,7 +264,7 @@ export function getRestockListApi( ...@@ -264,7 +264,7 @@ export function getRestockListApi(
pageSize: number, pageSize: number,
) { ) {
return axios.post<never, BasePaginationData<RestockData>>( return axios.post<never, BasePaginationData<RestockData>>(
'factory/podOrderBatchDownload/list_page1', 'factory/podOrder/awaitingRestockListPage',
{ ...data, currentPage, pageSize }, { ...data, currentPage, pageSize },
) )
} }
...@@ -375,6 +375,21 @@ export function updateRemarkApi(id: number | string, remark: string) { ...@@ -375,6 +375,21 @@ export function updateRemarkApi(id: number | string, remark: string) {
) )
} }
export function applyForReplenishByIdApi(ids: (number | string)[], url: string) { export function applyForReplenishByIdApi(
ids: (number | string)[],
url: string,
) {
return axios.post<never, BaseRespData<operateOrderListData[]>>(url, ids) return axios.post<never, BaseRespData<operateOrderListData[]>>(url, ids)
} }
export function completeDeliveryApi(ids: (number | string)[]) {
return axios.post<
never,
BaseRespData<{
id: number | string
status: boolean
factoryOrderNumber: string
message: string
}[]>
>('factory/podOrderOperation/completeDelivery', ids)
}
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
/> />
</ElFormItem> </ElFormItem>
<template v-if="isAuto || !showAutoSwitch"> <template v-if="isAuto || !showAutoSwitch">
<ElFormItem label="排版类型"> <!-- <ElFormItem label="排版类型">
<el-radio-group v-model="form.type"> <el-radio-group v-model="form.type">
<el-radio label="tiff">tiff</el-radio> <el-radio label="tiff">tiff</el-radio>
<el-radio label="png">png</el-radio> <el-radio label="png">png</el-radio>
</el-radio-group> </el-radio-group>
</ElFormItem> </ElFormItem> -->
<ElFormItem label="排版宽度"> <ElFormItem label="排版宽度">
<el-radio-group v-model="form.templateWidth"> <el-radio-group v-model="form.templateWidth">
<el-radio :value="42">40+2cm</el-radio> <el-radio :value="42">40+2cm</el-radio>
...@@ -96,14 +96,14 @@ const handleSubmit = async () => { ...@@ -96,14 +96,14 @@ const handleSubmit = async () => {
return ElMessage.warning('排版类型和排版宽度为必选项') return ElMessage.warning('排版类型和排版宽度为必选项')
} }
if (!templateWidth && type) return ElMessage.warning('请选择排版宽度') if (!templateWidth && type) return ElMessage.warning('请选择排版宽度')
if (templateWidth && !type) return ElMessage.warning('请选择排版类型') // if (templateWidth && !type) return ElMessage.warning('请选择排版类型')
submitting.value = true submitting.value = true
try { try {
await arrangeFinishApi(payload.value.requestUrl, { await arrangeFinishApi(payload.value.requestUrl, {
productIdList: payload.value.productIdList, productIdList: payload.value.productIdList,
templateWidth: isAuto.value ? templateWidth : undefined, templateWidth: isAuto.value ? templateWidth : undefined,
type: isAuto.value ? type : undefined, type: isAuto.value ? 'png' : undefined,
}) })
ElMessage.success('操作成功') ElMessage.success('操作成功')
visible.value = false visible.value = false
......
...@@ -189,8 +189,8 @@ const columns = [ ...@@ -189,8 +189,8 @@ const columns = [
const open = async ( const open = async (
ids: (number | string)[], ids: (number | string)[],
adjustOrderIds: number[], adjustOrderIds?: number[],
selectedRow: PickCompleteData, selectedRow?: PickCompleteData,
) => { ) => {
const previousPickList = pickData.value?.pickingSituationList ?? [] const previousPickList = pickData.value?.pickingSituationList ?? []
selections.value = [] selections.value = []
...@@ -201,7 +201,7 @@ const open = async ( ...@@ -201,7 +201,7 @@ const open = async (
}) })
try { try {
let pickIds let pickIds
if (selectedRow && adjustOrderIds.length > 0 && !ids) { if (selectedRow && adjustOrderIds && adjustOrderIds.length > 0 && !ids) {
const adjustPickData = previousPickList.find( const adjustPickData = previousPickList.find(
(item: PickCompleteData) => (item: PickCompleteData) =>
item.thirdSkuCode === selectedRow.thirdSkuCode, item.thirdSkuCode === selectedRow.thirdSkuCode,
......
...@@ -893,12 +893,12 @@ import { ...@@ -893,12 +893,12 @@ import {
printNewPodOrderProductionOrderApi, printNewPodOrderProductionOrderApi,
syncReceiverAddress, syncReceiverAddress,
updateRemarkApi, updateRemarkApi,
completeDeliveryApi,
} from '@/api/factoryOrderNew' } from '@/api/factoryOrderNew'
import { import {
getListCraftApi, getListCraftApi,
getCustomTagListCnApi, getCustomTagListCnApi,
allErpCodeListApi, allErpCodeListApi,
updateToWaitShipmentApi,
} from '@/api/podCnOrder' } from '@/api/podCnOrder'
import { getUserMarkList, loadWarehouseListApi } from '@/api/common' import { getUserMarkList, loadWarehouseListApi } from '@/api/common'
import { getAllCountryApi } from '@/api/logistics' import { getAllCountryApi } from '@/api/logistics'
...@@ -1940,11 +1940,6 @@ const handleDownloadMaterial = async () => { ...@@ -1940,11 +1940,6 @@ const handleDownloadMaterial = async () => {
const ids = usePodOrderDownload const ids = usePodOrderDownload
? selectedRows.value.map((row) => row.id) ? selectedRows.value.map((row) => row.id)
: cardSelectList.value.map((row) => row.podOrderProductId) : cardSelectList.value.map((row) => row.podOrderProductId)
console.log(
usePodOrderDownload,
ids,
cardSelectList.value.map((row) => row.podOrderProductId),
)
const loading = ElLoading.service({ const loading = ElLoading.service({
fullscreen: true, fullscreen: true,
text: '操作中...', text: '操作中...',
...@@ -2071,15 +2066,15 @@ const handleProductionComplete = async () => { ...@@ -2071,15 +2066,15 @@ const handleProductionComplete = async () => {
background: 'rgba(0, 0, 0, 0.3)', background: 'rgba(0, 0, 0, 0.3)',
}) })
try { try {
const params = getSelectedIds().map((id) => ({ const res = await completeDeliveryApi(getSelectedIds())
id, if (res.code !== 200) return
podJomallOrderCnId: id, const status = res.data.some((item) => !item.status)
factorySubOrderNumber: '', if (status) {
version: 0, resultInfo.value = res.data.filter((item) => !item.status)
})) resultRefs.value?.showDialog()
await updateToWaitShipmentApi({ cnUpdateParams: params }) } else {
ElMessage.success('生产完成')
refreshCurrentView({ isRefreshTree: true }) refreshCurrentView({ isRefreshTree: true })
}
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} finally { } finally {
......
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