Commit b704e3b1 by wusiyi

Merge branch 'wusiyi/podus' into dev

parents 54b5a2d7 6c06ee86
...@@ -88,6 +88,21 @@ declare global { ...@@ -88,6 +88,21 @@ declare global {
// for type re-export // for type re-export
declare global { declare global {
// @ts-ignore // @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' export type {
Component,
ComponentPublicInstance,
ComputedRef,
DirectiveBinding,
ExtractDefaultPropTypes,
ExtractPropTypes,
ExtractPublicPropTypes,
InjectionKey,
PropType,
Ref,
MaybeRef,
MaybeRefOrGetter,
VNode,
WritableComputedRef,
} from 'vue'
import('vue') import('vue')
} }
...@@ -32,13 +32,13 @@ declare module 'vue' { ...@@ -32,13 +32,13 @@ declare module 'vue' {
ElImage: typeof import('element-plus/es')['ElImage'] ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput'] ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElLink: typeof import('element-plus/es')['ElLink']
ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption'] ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination'] ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover'] ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio'] ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow'] ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect'] ElSelect: typeof import('element-plus/es')['ElSelect']
......
...@@ -370,6 +370,15 @@ export function updateLogisticsToPickingApi(params: { ids: string }) { ...@@ -370,6 +370,15 @@ export function updateLogisticsToPickingApi(params: { ids: string }) {
}, },
) )
} }
// 转至待排单
export function updateLogisticsToArrangeApi(params: { ids: string }) {
return axios.get<never, BaseRespData<never>>(
`factory/podJomallOrderUs/updateLogisticsToArrange`,
{
params,
},
)
}
//创建物流订单 //创建物流订单
export function createLogisticsOrdersApi(orderIds: (string | number)[]) { export function createLogisticsOrdersApi(orderIds: (string | number)[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
...@@ -419,3 +428,18 @@ export function toOutOfStockApi(ids: number[]) { ...@@ -419,3 +428,18 @@ export function toOutOfStockApi(ids: number[]) {
ids, ids,
) )
} }
// 排单完成
export function arrangeFinishApi(ids: number[]) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderProductUs/arrangeFinish`,
ids,
)
}
// 获取工艺
export function getListCraftApi() {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderProductUs/listCraft`,
)
}
...@@ -15,6 +15,7 @@ export interface SearchForm { ...@@ -15,6 +15,7 @@ export interface SearchForm {
factorySubOrderNumber: string factorySubOrderNumber: string
status: string status: string
customizedQuantity: string customizedQuantity: string
multi: boolean | null
startTime: string | null startTime: string | null
endTime: string | null endTime: string | null
exceptionHandling: number | undefined exceptionHandling: number | undefined
...@@ -22,7 +23,9 @@ export interface SearchForm { ...@@ -22,7 +23,9 @@ export interface SearchForm {
productionClient: string productionClient: string
warehouseId: string | number warehouseId: string | number
thirdSkuCode: string thirdSkuCode: string
supplierProductNo:string supplierProductNo: string
batchArrangeNumber: string
craftCode: string
} }
export interface PodUsOrderListData { export interface PodUsOrderListData {
id: number id: number
...@@ -109,6 +112,7 @@ export interface ProductList { ...@@ -109,6 +112,7 @@ export interface ProductList {
thirdSkuCode?: string | null thirdSkuCode?: string | null
supplierProductNo?: string | null supplierProductNo?: string | null
replenishmentSumNum?: number | null replenishmentSumNum?: number | null
batchArrangeNumber?: string | null
} }
export interface cardImages { export interface cardImages {
title: string title: string
...@@ -179,3 +183,7 @@ export interface LogisticsFormData { ...@@ -179,3 +183,7 @@ export interface LogisticsFormData {
expressSheetUrl: string expressSheetUrl: string
expressSheet: File | null expressSheet: File | null
} }
export interface CraftListData {
craftName: string
craftCode: string
}
...@@ -30,21 +30,46 @@ ...@@ -30,21 +30,46 @@
> >
</el-date-picker> </el-date-picker>
</ElFormItem> </ElFormItem>
<ElFormItem label="定制类型"> <ElFormItem label="类型">
<el-radio-group v-model="searchForm.customizedQuantity">
<el-radio-button label="single">单面</el-radio-button>
<el-radio-button label="multiple">多面</el-radio-button>
</el-radio-group>
</ElFormItem>
<ElFormItem label="数量">
<el-radio-group v-model="searchForm.multi">
<el-radio-button :label="false">单件</el-radio-button>
<el-radio-button :label="true">多件</el-radio-button>
</el-radio-group>
</ElFormItem>
<ElFormItem label="工艺">
<ElSelect <ElSelect
v-model="searchForm.customizedQuantity" v-model="searchForm.craftCode"
placeholder="定制类型"
clearable clearable
style="width: 100px" filterable
placeholder="请输入工艺"
style="width: 150px"
> >
<ElOption label="单面" value="single" /> <el-option
<ElOption label="多面" value="multiple" /> v-for="item in craftList"
:key="item.craftCode"
:label="item.craftName"
:value="item.craftCode"
></el-option>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="库存SKU">
<ElInput
v-model.trim="searchForm.thirdSkuCode"
placeholder="库存SKU"
clearable
style="width: 150px"
></ElInput>
</ElFormItem>
<ElFormItem label="供应货号"> <ElFormItem label="供应货号">
<ElInput <ElInput
v-model="searchForm.supplierProductNo" v-model="searchForm.supplierProductNo"
placeholder="生产单号" placeholder="供应货号"
clearable clearable
style="width: 150px" style="width: 150px"
/> />
...@@ -65,6 +90,14 @@ ...@@ -65,6 +90,14 @@
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="批次号">
<ElInput
v-model="searchForm.batchArrangeNumber"
placeholder="批次号"
clearable
style="width: 150px"
/>
</ElFormItem>
<ElFormItem label="店铺单号"> <ElFormItem label="店铺单号">
<ElInput <ElInput
v-model="searchForm.shopNumber" v-model="searchForm.shopNumber"
...@@ -74,10 +107,6 @@ ...@@ -74,10 +107,6 @@
/> />
</ElFormItem> </ElFormItem>
<ElFormItem> <ElFormItem>
<ElButton type="primary" @click="search">查询</ElButton>
</ElFormItem>
<ElFormItem>
<ElPopover placement="bottom" width="600" trigger="click"> <ElPopover placement="bottom" width="600" trigger="click">
<ElForm <ElForm
:model="searchForm" :model="searchForm"
...@@ -165,22 +194,14 @@ ...@@ -165,22 +194,14 @@
style="width: 150px" style="width: 150px"
></ElInput> ></ElInput>
</ElFormItem> </ElFormItem>
<ElFormItem label="Base SKU"> <!-- <ElFormItem label="Base SKU">
<ElInput <ElInput
v-model.trim="searchForm.baseSku" v-model.trim="searchForm.baseSku"
placeholder=" Base SKU" placeholder=" Base SKU"
clearable clearable
style="width: 150px" style="width: 150px"
></ElInput> ></ElInput>
</ElFormItem> </ElFormItem> -->
<ElFormItem label="库存SKU">
<ElInput
v-model.trim="searchForm.thirdSkuCode"
placeholder="库存SKU"
clearable
style="width: 150px"
></ElInput>
</ElFormItem>
<ElFormItem label="物流跟踪号"> <ElFormItem label="物流跟踪号">
<ElInput <ElInput
v-model.trim="searchForm.logisticsTracking" v-model.trim="searchForm.logisticsTracking"
...@@ -217,6 +238,12 @@ ...@@ -217,6 +238,12 @@
</template> </template>
</ElPopover> </ElPopover>
</ElFormItem> </ElFormItem>
<ElFormItem>
<ElButton type="primary" @click="search">查询</ElButton>
</ElFormItem>
<ElFormItem>
<ElButton type="danger" @click="resetSearchForm">清空</ElButton>
</ElFormItem>
</ElForm> </ElForm>
</div> </div>
<div class="header-filter-tab"> <div class="header-filter-tab">
...@@ -235,7 +262,7 @@ ...@@ -235,7 +262,7 @@
blue: item.quantity && item.quantity > 0, blue: item.quantity && item.quantity > 0,
red: item.status === 'EXCEPTION_ORDER', red: item.status === 'EXCEPTION_ORDER',
}" }"
>{{ item.quantity }}</span >{{ item.quantity }}</span
> >
</div> </div>
<!-- <div <!-- <div
...@@ -302,7 +329,7 @@ ...@@ -302,7 +329,7 @@
<ElButton <ElButton
:loading="tifDownloadLoading" :loading="tifDownloadLoading"
type="warning" type="warning"
@click="downloadTif('tiff','tiff')" @click="downloadTif('tiff', 'tiff')"
> >
TIF排版 TIF排版
</ElButton> </ElButton>
...@@ -311,7 +338,7 @@ ...@@ -311,7 +338,7 @@
<ElButton <ElButton
:loading="pngDownloadLoading" :loading="pngDownloadLoading"
type="warning" type="warning"
@click="downloadTif('png','composingPNG')" @click="downloadTif('png', 'composingPNG')"
> >
PNG排版 PNG排版
</ElButton> </ElButton>
...@@ -406,7 +433,7 @@ ...@@ -406,7 +433,7 @@
</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">
转至待拣胚 转至待排单
</ElButton> </ElButton>
</span> </span>
<span <span
...@@ -420,19 +447,19 @@ ...@@ -420,19 +447,19 @@
<template #dropdown> <template #dropdown>
<ElDropdownMenu> <ElDropdownMenu>
<ElDropdownItem @click="getOrderByIdApi('createLogisticsOrder')" <ElDropdownItem @click="getOrderByIdApi('createLogisticsOrder')"
>创建物流订单</ElDropdownItem >创建物流订单</ElDropdownItem
> >
<ElDropdownItem @click="getOrderByIdApi('getTrackingNumber')" <ElDropdownItem @click="getOrderByIdApi('getTrackingNumber')"
>获取跟踪号</ElDropdownItem >获取跟踪号</ElDropdownItem
> >
<ElDropdownItem @click="getOrderByIdApi('getPrintOrder')" <ElDropdownItem @click="getOrderByIdApi('getPrintOrder')"
>获取打印面单</ElDropdownItem >获取打印面单</ElDropdownItem
> >
<ElDropdownItem @click="getOrderByIdApi('cancelLogisticsOrder')" <ElDropdownItem @click="getOrderByIdApi('cancelLogisticsOrder')"
>取消物流订单</ElDropdownItem >取消物流订单</ElDropdownItem
> >
<ElDropdownItem @click="getOrderByIdApi('batchChangeLogistics')" <ElDropdownItem @click="getOrderByIdApi('batchChangeLogistics')"
>更换物流</ElDropdownItem >更换物流</ElDropdownItem
> >
</ElDropdownMenu> </ElDropdownMenu>
</template> </template>
...@@ -446,7 +473,9 @@ ...@@ -446,7 +473,9 @@
转至待创建物流 转至待创建物流
</ElButton> </ElButton>
</span> </span>
<span v-if="status === 'TO_BE_ARRANGE'" class="item">
<ElButton type="warning" @click="arrangeFinish">排单完成</ElButton>
</span>
<span class="item"> <span class="item">
<ElButton type="primary" @click="downloadMaterial">下载素材</ElButton> <ElButton type="primary" @click="downloadMaterial">下载素材</ElButton>
</span> </span>
...@@ -469,7 +498,8 @@ ...@@ -469,7 +498,8 @@
v-if=" v-if="
status !== 'IN_PRODUCTION' && status !== 'IN_PRODUCTION' &&
status !== 'PICKING' && status !== 'PICKING' &&
status !== 'TO_BE_REPLENISHMENT' status !== 'TO_BE_REPLENISHMENT' &&
status !== 'TO_BE_ARRANGE'
" "
v-loading="loading" v-loading="loading"
element-loading-text="加载中..." element-loading-text="加载中..."
...@@ -580,7 +610,7 @@ ...@@ -580,7 +610,7 @@
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label" <span class="goods-item-info-item-label"
>第三方生产单号:</span >第三方生产单号:</span
> >
<span <span
class="goods-item-info-item-value" class="goods-item-info-item-value"
...@@ -613,9 +643,8 @@ ...@@ -613,9 +643,8 @@
> >
<!-- <span class="goods-item-info-item-label">补胚状态:</span> --> <!-- <span class="goods-item-info-item-label">补胚状态:</span> -->
<el-tag size="small" effect="dark" type="danger" <el-tag size="small" effect="dark" type="danger"
>补胚中 >补胚中
</el-tag </el-tag>
>
</div> </div>
</div> </div>
<div class="goods-item-info"> <div class="goods-item-info">
...@@ -646,13 +675,13 @@ ...@@ -646,13 +675,13 @@
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">{{ <span class="goods-item-info-item-label">{{
status === 'EXCEPTION_ORDER' || status === 'EXCEPTION_ORDER' ||
status === 'PICKING' || status === 'PICKING' ||
status === 'TO_BE_CONFIRMED' || status === 'TO_BE_CONFIRMED' ||
status === 'STOCK_OUT' status === 'STOCK_OUT'
? '数量:' ? '数量:'
: '已生产数量:' : '已生产数量:'
}}</span> }}</span>
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ {{
status === 'EXCEPTION_ORDER' || status === 'EXCEPTION_ORDER' ||
...@@ -681,9 +710,8 @@ ...@@ -681,9 +710,8 @@
size="small" size="small"
type="success" type="success"
@click="applyForReplenishment(item)" @click="applyForReplenishment(item)"
>申请补胚 >申请补胚
</el-button </el-button>
>
<!-- f --> <!-- f -->
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
...@@ -868,17 +896,17 @@ ...@@ -868,17 +896,17 @@
<el-timeline-item <el-timeline-item
:color="row.createTime ? '#409EFF' : ''" :color="row.createTime ? '#409EFF' : ''"
:timestamp="row.createTime" :timestamp="row.createTime"
>创建时间 >创建时间
</el-timeline-item> </el-timeline-item>
<el-timeline-item <el-timeline-item
:color="row.startStockingTime ? '#E6A23C' : ''" :color="row.startStockingTime ? '#E6A23C' : ''"
:timestamp="row.startStockingTime" :timestamp="row.startStockingTime"
>确认时间 >确认时间
</el-timeline-item> </el-timeline-item>
<el-timeline-item <el-timeline-item
:color="row.finishTime ? '#67C23A' : ''" :color="row.finishTime ? '#67C23A' : ''"
:timestamp="row.finishTime" :timestamp="row.finishTime"
>完成时间 >完成时间
</el-timeline-item> </el-timeline-item>
</el-timeline> </el-timeline>
<!-- <div class="order-time-box"> <!-- <div class="order-time-box">
...@@ -1051,7 +1079,7 @@ ...@@ -1051,7 +1079,7 @@
<div class="grid-container"> <div class="grid-container">
<div class="grid-item" title="商品名称"> <div class="grid-item" title="商品名称">
<span class="grid-item-value" <span class="grid-item-value"
>{{ cardItem?.productName }} >{{ cardItem?.productName }}
</span> </span>
</div> </div>
<div <div
...@@ -1103,18 +1131,27 @@ ...@@ -1103,18 +1131,27 @@
</div> </div>
<div class="grid-item"> <div class="grid-item">
<span class="grid-item-label">供应货号:</span> <span class="grid-item-label">供应货号:</span>
<span title="供应货号" class="grid-item-value"> <span
:title="`供应货号: ${cardItem?.supplierProductNo}`"
class="grid-item-value"
>
{{ cardItem?.supplierProductNo }} {{ cardItem?.supplierProductNo }}
</span> </span>
</div> </div>
<div class="grid-item" title="店铺单号"> <div class="grid-item" title="店铺单号">
<span class="grid-item-value"> <span
class="grid-item-value"
@click="copy(cardItem?.shopNumber || '')"
>
{{ cardItem?.shopNumber }} {{ cardItem?.shopNumber }}
</span> </span>
</div> </div>
<div class="grid-item" title="订单号"> <div class="grid-item" title="订单号">
<span class="grid-item-value"> <span
class="grid-item-value"
@click="copy(cardItem?.factoryOrderNumber || '')"
>
{{ cardItem?.factoryOrderNumber }} {{ cardItem?.factoryOrderNumber }}
</span> </span>
</div> </div>
...@@ -1130,11 +1167,22 @@ ...@@ -1130,11 +1167,22 @@
{{ cardItem?.thirdSubOrderNumber }} {{ cardItem?.thirdSubOrderNumber }}
</span> </span>
</div> </div>
<div
class="grid-item"
title="批次号"
v-if="cardItem.batchArrangeNumber"
>
<span
class="grid-item-value"
@click="copy(cardItem?.batchArrangeNumber || '')"
>
{{ cardItem?.batchArrangeNumber }}
</span>
</div>
<div v-if="cardItem.isReplenishment" class="grid-item"> <div v-if="cardItem.isReplenishment" class="grid-item">
<el-tag size="small" type="danger" effect="dark" <el-tag size="small" type="danger" effect="dark"
>补胚中 >补胚中
</el-tag </el-tag>
>
</div> </div>
</div> </div>
</template> </template>
...@@ -1531,7 +1579,8 @@ import { ...@@ -1531,7 +1579,8 @@ import {
composingDesignImages, composingDesignImages,
changeLogisticsApi, changeLogisticsApi,
createLogisticsOrderApi, createLogisticsOrderApi,
updateLogisticsToPickingApi, // updateLogisticsToPickingApi,
updateLogisticsToArrangeApi,
createLogisticsOrdersApi, createLogisticsOrdersApi,
syncReceiverAddress, syncReceiverAddress,
refreshAddressApi, refreshAddressApi,
...@@ -1543,6 +1592,8 @@ import { ...@@ -1543,6 +1592,8 @@ import {
applyForReplenishmentApi, applyForReplenishmentApi,
replenishmentSuccessApi, replenishmentSuccessApi,
toOutOfStockApi, toOutOfStockApi,
arrangeFinishApi,
getListCraftApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
...@@ -1563,6 +1614,7 @@ import { ...@@ -1563,6 +1614,7 @@ import {
AddressInfo, AddressInfo,
LogisticsData, LogisticsData,
LogisticsFormData, LogisticsFormData,
CraftListData,
} 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'
...@@ -1584,7 +1636,7 @@ import platformJson from '../../../json/platform.json' ...@@ -1584,7 +1636,7 @@ import platformJson from '../../../json/platform.json'
declare global { declare global {
interface Window { interface Window {
ActiveXObject: { ActiveXObject: {
new(type: string): XMLHttpRequest new (type: string): XMLHttpRequest
} }
VBS_BinaryToArray: { VBS_BinaryToArray: {
(data: unknown): { toArray(): number[] } (data: unknown): { toArray(): number[] }
...@@ -1632,7 +1684,7 @@ const confirmSelectionData = ref<LogisticsData[]>([]) ...@@ -1632,7 +1684,7 @@ const confirmSelectionData = ref<LogisticsData[]>([])
const confirmRowData = ref<ProductList | null>(null) const confirmRowData = ref<ProductList | null>(null)
const status = ref('TO_BE_CONFIRMED') const status = ref('TO_BE_CONFIRMED')
const detailData = ref({}) const detailData = ref({})
const [searchForm] = useValue<SearchForm>({ const [searchForm, resetSearchForm] = useValue<SearchForm>({
timeType: null, timeType: null,
shopNumber: '', shopNumber: '',
shipmentType: '', shipmentType: '',
...@@ -1644,6 +1696,7 @@ const [searchForm] = useValue<SearchForm>({ ...@@ -1644,6 +1696,7 @@ const [searchForm] = useValue<SearchForm>({
factorySubOrderNumber: '', factorySubOrderNumber: '',
status: '', status: '',
customizedQuantity: '', customizedQuantity: '',
multi: null,
startTime: null, startTime: null,
endTime: null, endTime: null,
exceptionHandling: undefined, exceptionHandling: undefined,
...@@ -1652,6 +1705,8 @@ const [searchForm] = useValue<SearchForm>({ ...@@ -1652,6 +1705,8 @@ const [searchForm] = useValue<SearchForm>({
warehouseId: '', warehouseId: '',
thirdSkuCode: '', thirdSkuCode: '',
supplierProductNo: '', supplierProductNo: '',
batchArrangeNumber: '',
craftCode: '',
}) })
const exceptionStatus = ref(1) const exceptionStatus = ref(1)
const userMarkList = ref<string[]>([]) const userMarkList = ref<string[]>([])
...@@ -1903,7 +1958,7 @@ const { ...@@ -1903,7 +1958,7 @@ const {
pageSize, pageSize,
total, total,
data: tableData, data: tableData,
refresh: search, refresh,
onCurrentPageChange: handleCurrentChange, onCurrentPageChange: handleCurrentChange,
onPageSizeChange: handleSizeChange, onPageSizeChange: handleSizeChange,
} = usePageList({ } = usePageList({
...@@ -1911,7 +1966,8 @@ const { ...@@ -1911,7 +1966,8 @@ const {
if ( if (
status.value !== 'IN_PRODUCTION' && status.value !== 'IN_PRODUCTION' &&
status.value !== 'PICKING' && status.value !== 'PICKING' &&
status.value !== 'TO_BE_REPLENISHMENT' status.value !== 'TO_BE_REPLENISHMENT' &&
status.value !== 'TO_BE_ARRANGE'
) { ) {
return getOrderList( return getOrderList(
{ {
...@@ -1954,6 +2010,11 @@ const { ...@@ -1954,6 +2010,11 @@ const {
}, },
}) })
const search = () => {
selection.value = []
cardSelection.value = []
refresh()
}
const currentChange = (row: LogisticsData) => { const currentChange = (row: LogisticsData) => {
if (row) { if (row) {
confirmSelectionData.value = [row] confirmSelectionData.value = [row]
...@@ -2466,7 +2527,8 @@ const rightChange = async (code: string) => { ...@@ -2466,7 +2527,8 @@ const rightChange = async (code: string) => {
const flat = const flat =
status.value !== 'IN_PRODUCTION' && status.value !== 'IN_PRODUCTION' &&
status.value !== 'PICKING' && status.value !== 'PICKING' &&
status.value !== 'TO_BE_REPLENISHMENT' status.value !== 'TO_BE_REPLENISHMENT' &&
status.value !== 'TO_BE_ARRANGE'
if (code === 'select-all') { if (code === 'select-all') {
if (flat) { if (flat) {
tableRef.value?.toggleAllSelection() tableRef.value?.toggleAllSelection()
...@@ -2547,6 +2609,44 @@ const downloadMaterial = async () => { ...@@ -2547,6 +2609,44 @@ const downloadMaterial = async () => {
loading.close() loading.close()
} }
} }
// 排单完成
const arrangeFinish = async () => {
const selectedIds = cardSelection.value.map((item) => item.id)
if (selectedIds.length === 0) {
return ElMessage({
message: '请选择订单',
type: 'warning',
offset: window.innerHeight / 2,
})
}
try {
await ElMessageBox.confirm('确定排单完成吗?', '提示', {
cancelButtonText: '取消',
confirmButtonText: '确认',
type: 'warning',
})
} catch {
return
}
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await arrangeFinishApi(selectedIds)
if (res.code !== 200) return
ElMessage.success('操作成功')
search()
loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const logList = ref<LogListData[]>([]) const logList = ref<LogListData[]>([])
const logVisible = ref(false) const logVisible = ref(false)
const operationLog = async (id: number, e: MouseEvent | null) => { const operationLog = async (id: number, e: MouseEvent | null) => {
...@@ -2807,7 +2907,7 @@ const stockOutCheck = async () => { ...@@ -2807,7 +2907,7 @@ const stockOutCheck = async () => {
) )
tableData.value = [...success, ...others] tableData.value = [...success, ...others]
// 等待DOM更新后再设置选中状态 // 等待DOM更新后再设置选中状态
await nextTick() await nextTick()
// 更新补货成功的行ID // 更新补货成功的行ID
...@@ -2858,21 +2958,21 @@ const toBePicking = async () => { ...@@ -2858,21 +2958,21 @@ const toBePicking = async () => {
loading.close() loading.close()
} }
} }
//转至待拣胚 //转至待排单
const logisticsToPicking = async () => { const logisticsToPicking = async () => {
if (selection.value.length === 0) { if (selection.value.length === 0) {
return ElMessage.warning('请选择数据') return ElMessage.warning('请选择数据')
} }
if ( // if (
selection.value.some( // selection.value.some(
(el) => // (el) =>
el.trackingNumber == null || String(el.trackingNumber).trim() === '', // el.trackingNumber == null || String(el.trackingNumber).trim() === '',
) // )
) { // ) {
return ElMessage.warning('选中数据中有未创建物流的订单,请先创建物流') // return ElMessage.warning('选中数据中有未创建物流的订单,请先创建物流')
} // }
try { try {
await ElMessageBox.confirm('确定转至待拣胚吗?', '提示', { await ElMessageBox.confirm('确定转至待排单吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
...@@ -2886,7 +2986,7 @@ const logisticsToPicking = async () => { ...@@ -2886,7 +2986,7 @@ const logisticsToPicking = async () => {
background: 'rgba(0, 0, 0, 0.3)', background: 'rgba(0, 0, 0, 0.3)',
}) })
try { try {
const res = await updateLogisticsToPickingApi({ const res = await updateLogisticsToArrangeApi({
ids: selection.value.map((item) => item.id).join(','), ids: selection.value.map((item) => item.id).join(','),
}) })
if (res.code !== 200) return if (res.code !== 200) return
...@@ -3127,6 +3227,18 @@ const loadWarehouseList = async () => { ...@@ -3127,6 +3227,18 @@ const loadWarehouseList = async () => {
console.error(e) console.error(e)
} }
} }
// 获取工艺列表
const craftList = ref<CraftListData[]>([])
const loadCraftList = async () => {
try {
const res = await getListCraftApi()
if (res.code !== 200) return
craftList.value = res.data
} catch (e) {
console.error(e)
}
}
const refreshMaterial = async () => { const refreshMaterial = async () => {
if (status.value === 'PICKING' || status.value === 'TO_BE_REPLENISHMENT') { if (status.value === 'PICKING' || status.value === 'TO_BE_REPLENISHMENT') {
if (cardSelection.value.length === 0) { if (cardSelection.value.length === 0) {
...@@ -3174,6 +3286,7 @@ onMounted(() => { ...@@ -3174,6 +3286,7 @@ onMounted(() => {
getUserMark() getUserMark()
loadProductionClient() loadProductionClient()
loadWarehouseList() loadWarehouseList()
loadCraftList()
}) })
const expressSheetUpload = async (file: File) => { const expressSheetUpload = async (file: File) => {
......
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