Commit a2757fc6 by linjinhong

Merge remote-tracking branch 'origin/master' into linjinhong

parents 69dcc0d0 c7f5bad4
......@@ -88,6 +88,21 @@ declare global {
// for type re-export
declare global {
// @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')
}
......@@ -32,13 +32,13 @@ declare module 'vue' {
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElLink: typeof import('element-plus/es')['ElLink']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect']
......
......@@ -174,9 +174,17 @@ export function printPickingOrderApi(orderIds: number[]) {
)
}
export function stockOutCheckApi(orderIds: number[]) {
return axios.get<never, BaseRespData<number[]>>(
`factory/podJomallOrderUs/replenishVerify?ids=${orderIds.join(',')}`,
)
return axios.get<
never,
BaseRespData<
{
id: number
status: boolean
message?: string
factoryOrderNumber?: string
}[]
>
>(`factory/podJomallOrderUs/replenishVerify?ids=${orderIds.join(',')}`)
}
export function toBePickingApi(orderIds: number[]) {
return axios.get<never, BaseRespData<never>>(
......@@ -326,16 +334,16 @@ export function createLogisticsOrderApi(params: {
// 创建物流
export function uploadExpressSheet(params: {
trackingNumber:string
trackingNumber: string
file: File
}) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/uploadExpressSheet',
params,
)
}// 创建物流
} // 创建物流
export function updateSelfLogistics(params: {
trackingNumber:string
trackingNumber: string
expressSheet: string
processNumber: string
id?: string
......@@ -347,9 +355,9 @@ export function updateSelfLogistics(params: {
}
// 更改物流
export function composingDesignImages(data: number[]) {
export function composingDesignImages(data: number[],type:string) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/composingDesignImages',
`factory/podJomallOrderUs/composingDesignImages?type=${type}`,
data,
)
}
......@@ -362,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)[]) {
return axios.post<never, BaseRespData<never>>(
......@@ -411,3 +428,18 @@ export function toOutOfStockApi(ids: number[]) {
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 {
factorySubOrderNumber: string
status: string
customizedQuantity: string
multi: boolean | null
startTime: string | null
endTime: string | null
exceptionHandling: number | undefined
......@@ -22,7 +23,9 @@ export interface SearchForm {
productionClient: string
warehouseId: string | number
thirdSkuCode: string
supplierProductNo:string
supplierProductNo: string
batchArrangeNumber: string
craftCode: string
}
export interface PodUsOrderListData {
id: number
......@@ -109,6 +112,7 @@ export interface ProductList {
thirdSkuCode?: string | null
supplierProductNo?: string | null
replenishmentSumNum?: number | null
batchArrangeNumber?: string | null
}
export interface cardImages {
title: string
......@@ -179,3 +183,7 @@ export interface LogisticsFormData {
expressSheetUrl: string
expressSheet: File | null
}
export interface CraftListData {
craftName: string
craftCode: string
}
......@@ -74,11 +74,10 @@ const resultDialog = ref(false)
const isIndeterminate = ref(false)
const checkAll = ref(false)
const selectedList = ref<IList[]>([])
let key = ''
// 显示弹窗
const showDialog = (type?: string) => {
console.log(type)
key = type || ''
resultDialog.value = true
selectedList.value = []
checkAll.value = false
......@@ -127,6 +126,7 @@ const copyAllCode = (field: string) => {
}
function closedFn() {
if (key === 'stockOut') return
emits('confirm', selectedList.value)
}
......
......@@ -30,21 +30,46 @@
>
</el-date-picker>
</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
v-model="searchForm.customizedQuantity"
placeholder="定制类型"
v-model="searchForm.craftCode"
clearable
style="width: 100px"
filterable
placeholder="请输入工艺"
style="width: 150px"
>
<ElOption label="单面" value="single" />
<ElOption label="多面" value="multiple" />
<el-option
v-for="item in craftList"
:key="item.craftCode"
:label="item.craftName"
:value="item.craftCode"
></el-option>
</ElSelect>
</ElFormItem>
<ElFormItem label="库存SKU">
<ElInput
v-model.trim="searchForm.thirdSkuCode"
placeholder="库存SKU"
clearable
style="width: 150px"
></ElInput>
</ElFormItem>
<ElFormItem label="供应货号">
<ElInput
v-model="searchForm.supplierProductNo"
placeholder="生产单号"
placeholder="供应货号"
clearable
style="width: 150px"
/>
......@@ -65,6 +90,14 @@
style="width: 150px"
/>
</ElFormItem>
<ElFormItem label="批次号">
<ElInput
v-model="searchForm.batchArrangeNumber"
placeholder="批次号"
clearable
style="width: 150px"
/>
</ElFormItem>
<ElFormItem label="店铺单号">
<ElInput
v-model="searchForm.shopNumber"
......@@ -74,10 +107,6 @@
/>
</ElFormItem>
<ElFormItem>
<ElButton type="primary" @click="search">查询</ElButton>
</ElFormItem>
<ElFormItem>
<ElPopover placement="bottom" width="600" trigger="click">
<ElForm
:model="searchForm"
......@@ -165,22 +194,14 @@
style="width: 150px"
></ElInput>
</ElFormItem>
<ElFormItem label="Base SKU">
<!-- <ElFormItem label="Base SKU">
<ElInput
v-model.trim="searchForm.baseSku"
placeholder=" Base SKU"
clearable
style="width: 150px"
></ElInput>
</ElFormItem>
<ElFormItem label="库存SKU">
<ElInput
v-model.trim="searchForm.thirdSkuCode"
placeholder="库存SKU"
clearable
style="width: 150px"
></ElInput>
</ElFormItem>
</ElFormItem> -->
<ElFormItem label="物流跟踪号">
<ElInput
v-model.trim="searchForm.logisticsTracking"
......@@ -207,12 +228,22 @@
</ElForm>
<template #reference>
<el-button type="warning" @click="searchVisible = !searchVisible">
<el-icon v-if="searchVisible"><CaretTop /></el-icon>
<el-icon v-else><CaretBottom /></el-icon>
<el-icon v-if="searchVisible">
<CaretTop />
</el-icon>
<el-icon v-else>
<CaretBottom />
</el-icon>
</el-button>
</template>
</ElPopover>
</ElFormItem>
<ElFormItem>
<ElButton type="primary" @click="search">查询</ElButton>
</ElFormItem>
<ElFormItem>
<ElButton type="danger" @click="resetSearchForm">清空</ElButton>
</ElFormItem>
</ElForm>
</div>
<div class="header-filter-tab">
......@@ -296,11 +327,20 @@
<div class="operation-box mb-10">
<span v-if="status === 'PICKING'" class="item">
<ElButton
:loading="downloadLoading"
:loading="tifDownloadLoading"
type="warning"
@click="downloadTif('tiff', 'tiff')"
>
TIF排版
</ElButton>
</span>
<span v-if="status === 'PICKING'" class="item">
<ElButton
:loading="pngDownloadLoading"
type="warning"
@click="downloadTif"
@click="downloadTif('png', 'composingPNG')"
>
排版
PNG排版
</ElButton>
</span>
<span v-if="status === 'TO_BE_CONFIRMED'" class="item">
......@@ -393,7 +433,7 @@
</span>
<span v-if="status === 'CREATE_LOGISTICS'" class="item">
<ElButton type="warning" @click="logisticsToPicking">
转至待拣胚
转至待排单
</ElButton>
</span>
<span
......@@ -433,7 +473,9 @@
转至待创建物流
</ElButton>
</span>
<span v-if="status === 'TO_BE_ARRANGE'" class="item">
<ElButton type="warning" @click="arrangeFinish">排单完成</ElButton>
</span>
<span class="item">
<ElButton type="primary" @click="downloadMaterial">下载素材</ElButton>
</span>
......@@ -456,7 +498,8 @@
v-if="
status !== 'IN_PRODUCTION' &&
status !== 'PICKING' &&
status !== 'TO_BE_REPLENISHMENT'
status !== 'TO_BE_REPLENISHMENT' &&
status !== 'TO_BE_ARRANGE'
"
v-loading="loading"
element-loading-text="加载中..."
......@@ -466,7 +509,6 @@
<TableView
ref="tableRef"
:columns="tableColumns"
:stripe="true"
:serial-numberable="true"
:selectionable="true"
:paginated-data="tableData"
......@@ -601,8 +643,8 @@
>
<!-- <span class="goods-item-info-item-label">补胚状态:</span> -->
<el-tag size="small" effect="dark" type="danger"
>补胚中</el-tag
>
>补胚中
</el-tag>
</div>
</div>
<div class="goods-item-info">
......@@ -668,8 +710,8 @@
size="small"
type="success"
@click="applyForReplenishment(item)"
>申请补胚</el-button
>
>申请补胚
</el-button>
<!-- f -->
</div>
<div class="goods-item-info-item">
......@@ -1089,18 +1131,27 @@
</div>
<div class="grid-item">
<span class="grid-item-label">供应货号:</span>
<span title="供应货号" class="grid-item-value">
<span
:title="`供应货号: ${cardItem?.supplierProductNo}`"
class="grid-item-value"
>
{{ cardItem?.supplierProductNo }}
</span>
</div>
<div class="grid-item" title="店铺单号">
<span class="grid-item-value">
<span
class="grid-item-value"
@click="copy(cardItem?.shopNumber || '')"
>
{{ cardItem?.shopNumber }}
</span>
</div>
<div class="grid-item" title="订单号">
<span class="grid-item-value">
<span
class="grid-item-value"
@click="copy(cardItem?.factoryOrderNumber || '')"
>
{{ cardItem?.factoryOrderNumber }}
</span>
</div>
......@@ -1116,10 +1167,22 @@
{{ cardItem?.thirdSubOrderNumber }}
</span>
</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">
<el-tag size="small" type="danger" effect="dark"
>补胚中</el-tag
>
>补胚中
</el-tag>
</div>
</div>
</template>
......@@ -1297,7 +1360,7 @@
<ResultInfo
ref="resultRefs"
:list="resultInfo"
@confirm="resultConfim"
@confirm="resultConfirm"
></ResultInfo>
<el-dialog
......@@ -1516,7 +1579,8 @@ import {
composingDesignImages,
changeLogisticsApi,
createLogisticsOrderApi,
updateLogisticsToPickingApi,
// updateLogisticsToPickingApi,
updateLogisticsToArrangeApi,
createLogisticsOrdersApi,
syncReceiverAddress,
refreshAddressApi,
......@@ -1528,6 +1592,8 @@ import {
applyForReplenishmentApi,
replenishmentSuccessApi,
toOutOfStockApi,
arrangeFinishApi,
getListCraftApi,
} from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api'
......@@ -1548,6 +1614,7 @@ import {
AddressInfo,
LogisticsData,
LogisticsFormData,
CraftListData,
} from '@/types/api/podUsOrder'
import usePageList from '@/utils/hooks/usePageList'
import { useValue } from '@/utils/hooks/useValue'
......@@ -1607,7 +1674,8 @@ const logistics = {
const logisticsForm = ref<LogisticsFormData>(logistics)
const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null)
const confirmDialogShow = ref(false)
const downloadLoading = ref(false)
const tifDownloadLoading = ref(false)
const pngDownloadLoading = ref(false)
const isChangeWay = ref(false)
const confirmData = ref([])
const logisticsWayData = ref([])
......@@ -1616,7 +1684,7 @@ const confirmSelectionData = ref<LogisticsData[]>([])
const confirmRowData = ref<ProductList | null>(null)
const status = ref('TO_BE_CONFIRMED')
const detailData = ref({})
const [searchForm] = useValue<SearchForm>({
const [searchForm, resetSearchForm] = useValue<SearchForm>({
timeType: null,
shopNumber: '',
shipmentType: '',
......@@ -1628,6 +1696,7 @@ const [searchForm] = useValue<SearchForm>({
factorySubOrderNumber: '',
status: '',
customizedQuantity: '',
multi: null,
startTime: null,
endTime: null,
exceptionHandling: undefined,
......@@ -1635,7 +1704,9 @@ const [searchForm] = useValue<SearchForm>({
productionClient: '',
warehouseId: '',
thirdSkuCode: '',
supplierProductNo:''
supplierProductNo: '',
batchArrangeNumber: '',
craftCode: '',
})
const exceptionStatus = ref(1)
const userMarkList = ref<string[]>([])
......@@ -1796,8 +1867,8 @@ const rightClick = (e: MouseEvent) => {
const handleSelectionChange = (val: PodUsOrderListData[]) => {
selection.value = val
// 只在手动清空选择时,且当前没有补货成功的行时,才清除补货成功状态
if (val.length === 0 && stockOutSuccessIds.value.length === 0) {
// 当清空选择时,清除补货校验成功的状态
if (val.length === 0) {
stockOutSuccessIds.value = []
}
}
......@@ -1844,7 +1915,7 @@ const changeTab = (item: Tab) => {
selection.value = []
cardSelection.value = []
stockOutSuccessIds.value = []
search(true)
search()
}
const onCellStyle = ({ column }: { column: Column }) => {
if (
......@@ -1887,7 +1958,7 @@ const {
pageSize,
total,
data: tableData,
refresh: search,
refresh,
onCurrentPageChange: handleCurrentChange,
onPageSizeChange: handleSizeChange,
} = usePageList({
......@@ -1895,7 +1966,8 @@ const {
if (
status.value !== 'IN_PRODUCTION' &&
status.value !== 'PICKING' &&
status.value !== 'TO_BE_REPLENISHMENT'
status.value !== 'TO_BE_REPLENISHMENT' &&
status.value !== 'TO_BE_ARRANGE'
) {
return getOrderList(
{
......@@ -1938,6 +2010,11 @@ const {
},
})
const search = () => {
selection.value = []
cardSelection.value = []
refresh()
}
const currentChange = (row: LogisticsData) => {
if (row) {
confirmSelectionData.value = [row]
......@@ -2106,20 +2183,33 @@ const productionClientVisible = ref(false)
// productionClientVisible.value = true
// }
const downloadTif = async () => {
const downloadTif = async (type: string, dir: string) => {
if (!cardSelection.value.length) {
return ElMessage.warning('请选择数据')
}
downloadLoading.value = true
if (type === 'tiff') {
tifDownloadLoading.value = true
} else {
pngDownloadLoading.value = true
}
try {
const res = await composingDesignImages(
cardSelection.value.map((el) => el.id),
type,
)
window.open('https://ps.jomalls.com/tiff/' + res.message, '_blank')
downloadLoading.value = false
window.open(`https://ps.jomalls.com/${dir}/` + res.message, '_blank')
if (type === 'tiff') {
tifDownloadLoading.value = true
} else {
pngDownloadLoading.value = true
}
} catch (e) {
console.log(e)
downloadLoading.value = false
if (type === 'tiff') {
tifDownloadLoading.value = true
} else {
pngDownloadLoading.value = true
}
}
}
......@@ -2437,7 +2527,8 @@ const rightChange = async (code: string) => {
const flat =
status.value !== 'IN_PRODUCTION' &&
status.value !== 'PICKING' &&
status.value !== 'TO_BE_REPLENISHMENT'
status.value !== 'TO_BE_REPLENISHMENT' &&
status.value !== 'TO_BE_ARRANGE'
if (code === 'select-all') {
if (flat) {
tableRef.value?.toggleAllSelection()
......@@ -2518,6 +2609,44 @@ const downloadMaterial = async () => {
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 logVisible = ref(false)
const operationLog = async (id: number, e: MouseEvent | null) => {
......@@ -2617,7 +2746,7 @@ const getOrderByIdApi = async (type: string) => {
factoryOrderNumber?: string
message: string
}[]) || []
resultRefs.value?.showDialog()
resultRefs.value?.showDialog()
} else if (isString(res.data)) {
window.open(filePath + res.data)
}
......@@ -2642,7 +2771,7 @@ const resultInfo = ref<
message: string
}[]
>([])
const resultConfim = () => {
const resultConfirm = () => {
search()
loadTabData()
}
......@@ -2741,14 +2870,27 @@ const stockOutCheck = async () => {
const res = await stockOutCheckApi(selectedIds)
if (res.code !== 200) return
const successIds = res.data || []
if (successIds.length === 0) {
ElMessage.warning('未补到货')
return
const successIds = res.data.filter((e) => e.status).map((ee) => ee.id) || []
// if (successIds.length === 0) {
// ElMessage.warning('未补到货')
// return
// }
resultInfo.value =
(res.data as {
id: string | number
status: boolean
factoryOrderNumber?: string
message: string
}[]) || []
if (
Array.isArray(res.data) &&
(res.data as { status: boolean }[]).some((item) => !item.status)
) {
resultRefs.value?.showDialog('stockOut')
} else {
ElMessage.success('操作成功')
}
ElMessage.success('操作成功')
const { success, others } = (
tableData.value as PodUsOrderListData[]
).reduce(
......@@ -2765,11 +2907,11 @@ const stockOutCheck = async () => {
)
tableData.value = [...success, ...others]
// 更新补货成功的行ID
stockOutSuccessIds.value = successIds
// 等待DOM更新后再设置选中状态
await nextTick()
// 更新补货成功的行ID
stockOutSuccessIds.value = successIds
// 清除所有选中状态
tableRef.value?.clearSelection()
// 选中补货成功的行
......@@ -2816,21 +2958,21 @@ const toBePicking = async () => {
loading.close()
}
}
//转至待拣胚
//转至待排单
const logisticsToPicking = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
if (
selection.value.some(
(el) =>
el.trackingNumber == null || String(el.trackingNumber).trim() === '',
)
) {
return ElMessage.warning('选中数据中有未创建物流的订单,请先创建物流')
}
// if (
// selection.value.some(
// (el) =>
// el.trackingNumber == null || String(el.trackingNumber).trim() === '',
// )
// ) {
// return ElMessage.warning('选中数据中有未创建物流的订单,请先创建物流')
// }
try {
await ElMessageBox.confirm('确定转至待拣胚吗?', '提示', {
await ElMessageBox.confirm('确定转至待排单吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
......@@ -2844,7 +2986,7 @@ const logisticsToPicking = async () => {
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await updateLogisticsToPickingApi({
const res = await updateLogisticsToArrangeApi({
ids: selection.value.map((item) => item.id).join(','),
})
if (res.code !== 200) return
......@@ -3085,6 +3227,18 @@ const loadWarehouseList = async () => {
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 () => {
if (status.value === 'PICKING' || status.value === 'TO_BE_REPLENISHMENT') {
if (cardSelection.value.length === 0) {
......@@ -3132,6 +3286,7 @@ onMounted(() => {
getUserMark()
loadProductionClient()
loadWarehouseList()
loadCraftList()
})
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