Commit b10be96f by wuqian

Merge branch 'dev'

parents c1efd740 ad05ba1e
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
export {} export {}
declare global { declare global {
const EffectScope: typeof import('vue')['EffectScope'] const EffectScope: typeof import('vue')['EffectScope']
const ElInput: typeof import('element-plus/es')['ElInput']
const ElLoading: typeof import('element-plus/es')['ElLoading'] const ElLoading: typeof import('element-plus/es')['ElLoading']
const ElMessage: typeof import('element-plus/es')['ElMessage'] const ElMessage: typeof import('element-plus/es')['ElMessage']
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
......
...@@ -32,7 +32,6 @@ declare module 'vue' { ...@@ -32,7 +32,6 @@ 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']
...@@ -51,7 +50,6 @@ declare module 'vue' { ...@@ -51,7 +50,6 @@ declare module 'vue' {
ElTag: typeof import('element-plus/es')['ElTag'] ElTag: typeof import('element-plus/es')['ElTag']
ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree'] ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload']
Icon: typeof import('./src/components/Icon.vue')['default'] Icon: typeof import('./src/components/Icon.vue')['default']
ImageView: typeof import('./src/components/ImageView.vue')['default'] ImageView: typeof import('./src/components/ImageView.vue')['default']
LogList: typeof import('./src/components/LogList.vue')['default'] LogList: typeof import('./src/components/LogList.vue')['default']
......
...@@ -9,7 +9,7 @@ import { AddDeclarationRuleObj } from '@/views/logistics/types/declarationRule' ...@@ -9,7 +9,7 @@ import { AddDeclarationRuleObj } from '@/views/logistics/types/declarationRule'
import { LogisticsQuotation } from '@/views/logistics/types/logisticsQuotation' import { LogisticsQuotation } from '@/views/logistics/types/logisticsQuotation'
import { LogisticsPartitionObj } from '@/views/logistics/types/logisticsPartition' import { LogisticsPartitionObj } from '@/views/logistics/types/logisticsPartition'
import { ShippingAddressObj } from '@/views/logistics/types/shippingAddress' import { ShippingAddressObj } from '@/views/logistics/types/shippingAddress'
import { IsortingInfo } from '@/types/api/logistics'
export interface ILogisticsList { export interface ILogisticsList {
code: string code: string
basicsName: string basicsName: string
...@@ -433,3 +433,37 @@ export function logisticsCompanyAllCodelist() { ...@@ -433,3 +433,37 @@ export function logisticsCompanyAllCodelist() {
'/logisticsCompany/allCodelist', '/logisticsCompany/allCodelist',
) )
} }
export function getsortingConfigListApi(
data: IsortingInfo,
currentPage: number,
pageSize: number,
) {
return axios.post<never, BasePaginationData<IsortingInfo>>(
'logistics/sortingConfig/list_page',
{
...data,
currentPage,
pageSize,
},
)
}
export function createSortingApi(data: IsortingInfo) {
return axios.post<never, BaseRespData<never>>(
'logistics/sortingConfig/add',
data,
)
}
export function updateSortingApi(data: IsortingInfo) {
return axios.post<never, BaseRespData<never>>(
'logistics/sortingConfig/update',
data,
)
}
export function deleteSortingApi(ids: string) {
return axios.get<never, BaseRespData<never>>(
'logistics/sortingConfig/delete',
{
params: { ids },
},
)
}
...@@ -37,6 +37,12 @@ export function getOrderList( ...@@ -37,6 +37,12 @@ export function getOrderList(
}, },
) )
} }
export function handleExceptionOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/processExceptionOrders',
orderIds,
)
}
export function getCardOrderList( export function getCardOrderList(
params: SearchForm, params: SearchForm,
currentPage: number, currentPage: number,
...@@ -80,14 +86,17 @@ export function updateExceptionOrderApi(data: number[]) { ...@@ -80,14 +86,17 @@ export function updateExceptionOrderApi(data: number[]) {
}, },
) )
} }
export function changeExceptionOrderApi(ids: number[], value: string) { export function changeExceptionOrderApi(
return axios.post<never, BaseRespData<never>>( url: string,
'factory/podJomallOrderUs/exceptionOrders', ids: number[],
{ type: string,
value: string,
) {
return axios.post<never, BaseRespData<never>>(url, {
orderIds: ids, orderIds: ids,
exceptionType: type,
exceptionReason: value, exceptionReason: value,
}, })
)
} }
export function cancelOrderApi(ids: number[], value: string) { export function cancelOrderApi(ids: number[], value: string) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
......
...@@ -177,6 +177,13 @@ const router = createRouter({ ...@@ -177,6 +177,13 @@ const router = createRouter({
component: () => import('@/views/logistics/logisticsCalculate.vue'), component: () => import('@/views/logistics/logisticsCalculate.vue'),
}, },
{ {
path: '/logistics/sortingConfiguration',
meta: {
title: '分拣配置',
},
component: () => import('@/views/logistics/sortingConfiguration.vue'),
},
{
path: '/warehouse/manage', path: '/warehouse/manage',
meta: { meta: {
title: '仓库管理', title: '仓库管理',
......
...@@ -56,6 +56,11 @@ const menu: MenuItem[] = [ ...@@ -56,6 +56,11 @@ const menu: MenuItem[] = [
id: 6, id: 6,
label: '运费试算', label: '运费试算',
}, },
{
index: '/logistics/sortingConfiguration',
id: 7,
label: '分拣配置',
},
], ],
}, },
{ {
......
export interface Ilogistics {
id: number
name: string
warehouseId: number
warehouseName: string
uinuinWarehouseId: number | null
companyId: number | null
company: string | null
serviceCode: string
siteUrl: string
status: number
factoryId: number
createTime: string
updateTime: string | null
}
export interface IsortingInfo {
id?: number
sortingArea: number | null
sortingAreaName?: string | null
serviceCode: string | null
}
...@@ -16,6 +16,7 @@ export interface SearchForm { ...@@ -16,6 +16,7 @@ export interface SearchForm {
customizedQuantity: string customizedQuantity: string
startTime: string | null startTime: string | null
endTime: string | null endTime: string | null
exceptionHandling: number | undefined
} }
export interface PodUsOrderListData { export interface PodUsOrderListData {
id: number id: number
......
<script setup lang="ts">
import { Ilogistics, IsortingInfo } from '@/types/api/logistics'
import { Edit, Delete } from '@element-plus/icons-vue'
import {
getsortingConfigListApi,
usableAllList,
createSortingApi,
updateSortingApi,
deleteSortingApi,
} from '@/api/logistics.ts'
import { nextTick, ref } from 'vue'
import SplitDiv from '@/components/splitDiv/splitDiv.vue'
import usePageList from '@/utils/hooks/usePageList'
const searchForm = ref({
sortingArea: null,
serviceCode: '',
})
const selections = ref<IsortingInfo[]>([])
const formRef = ref()
const form = ref<IsortingInfo>({
sortingArea: null,
sortingAreaName: '',
serviceCode: '',
})
const createData = ref({
title: '',
show: false,
isEdit: false,
form: {
sortingArea: null,
sortingAreaName: '',
serviceCode: '',
},
})
const rules = {
sortingArea: [{ required: true, message: '请选择分拣口', trigger: 'change' }],
serviceCode: [
{ required: true, message: '请选择物流方式', trigger: 'change' },
],
}
const {
currentPage,
pageSize,
total,
data: tableData,
refresh: search,
onCurrentPageChange: handleCurrentChange,
onPageSizeChange: handleSizeChange,
} = usePageList({
query: (page, pageSize) =>
getsortingConfigListApi(
{
...searchForm.value,
},
page,
pageSize,
).then((res) => res.data),
})
const logisticsMethodsList = ref<Ilogistics[]>([])
const getlogisticsMethods = async () => {
const res = await usableAllList()
logisticsMethodsList.value = res.data || []
}
interface interSorting {
label: string
value: number
}
const sortingList = ref<interSorting[]>([
{
label: 'L1',
value: 1,
},
{
label: 'R1',
value: 2,
},
{
label: 'L2',
value: 3,
},
{
label: 'R2',
value: 4,
},
{
label: 'L3',
value: 5,
},
{
label: 'R3',
value: 6,
},
{
label: 'L4',
value: 7,
},
{
label: 'R4',
value: 8,
},
{
label: 'E0',
value: 9,
},
])
const handleSelectionChange = (data: IsortingInfo[]) => {
selections.value = data
}
const handleConfirm = async () => {
await formRef.value?.validate()
if (!createData.value.isEdit) {
await createSortingApi(form.value)
} else {
await updateSortingApi(form.value)
}
createData.value.show = false
ElMessage.success('操作成功')
await search()
}
const handleBatchDelete = async (row: IsortingInfo | null) => {
if (!row && !selections.value.length) {
return ElMessage.warning('请选择要删除的数据')
}
await ElMessageBox.confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
const str =
row && row.id
? row.id?.toString()
: selections.value.map((el: IsortingInfo) => el.id).join(',')
await deleteSortingApi(str)
ElMessage.success('删除成功')
await search()
}
const createWarehouse = () => {
createData.value.show = true
createData.value.isEdit = false
createData.value.title = '新增'
form.value = {
sortingArea: null,
sortingAreaName: '',
serviceCode: '',
}
nextTick(() => {
formRef.value?.clearValidate()
})
}
const updateSorting = (item: IsortingInfo) => {
createData.value.show = true
createData.value.isEdit = true
createData.value.title = '修改'
form.value = {
sortingArea: item.sortingArea,
sortingAreaName: item.sortingAreaName,
serviceCode: item.serviceCode,
}
nextTick(() => {
formRef.value?.clearValidate()
})
}
getlogisticsMethods()
const sortingChange = (v: number) => {
const warehouse = sortingList.value.find((w: interSorting) => w.value == v)
form.value.sortingAreaName = warehouse ? warehouse.label : ''
}
</script>
<template>
<split-div>
<template #top>
<el-card>
<el-form inline :model="searchForm">
<el-form-item label="分拣口">
<el-select
v-model="searchForm.sortingArea"
clearable
style="width: 160px"
>
<el-option
v-for="item in sortingList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="物流方式">
<el-select
v-model="searchForm.serviceCode"
clearable
filterable
style="width: 160px"
>
<el-option
v-for="item in logisticsMethodsList"
:key="item.serviceCode"
:label="item.serviceCode"
:value="item.serviceCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="search">查询</el-button>
<el-button type="success" @click="createWarehouse">新增</el-button>
<el-button type="danger" @click="handleBatchDelete(null)"
>删除</el-button
>
</el-form-item>
</el-form>
</el-card>
</template>
<template #bottom>
<el-card style="height: 100%">
<div class="manage">
<div class="table-flex">
<div class="left-table">
<div class="table-container">
<el-table
height="100%"
:data="tableData"
border
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" />
<el-table-column type="index" label="序号" width="60" />
<el-table-column
align="center"
label="分拣口名称"
prop="sortingAreaName"
></el-table-column>
<el-table-column
align="center"
label="物流编码"
prop="serviceCode"
></el-table-column>
<el-table-column label="操作" align="center" width="100">
<template #default="{ row }">
<el-icon
size="24"
title="编辑"
color="#EF6C00"
style="cursor: pointer; vertical-align: middle"
@click="updateSorting(row)"
>
<Edit />
</el-icon>
<el-icon
size="24"
title="删除"
color="#f56c6c"
style="cursor: pointer; vertical-align: middle"
@click="handleBatchDelete(row)"
>
<Delete />
</el-icon>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination">
<!-- <el-pagination
v-model:current-page="pagination.currentPage"
v-model:page-size="pagination.pageSize"
:page-sizes="[50, 100, 150, 200]"
layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/> -->
<ElPagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[100, 200, 300, 400, 500]"
background
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin: 10px auto 0; text-align: right"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
></ElPagination>
</div>
</div>
</div>
<el-dialog
v-model="createData.show"
width="500px"
:title="createData.title"
>
<el-form
ref="formRef"
label-width="110px"
:rules="rules"
:model="form"
>
<el-form-item label="分拣口" prop="sortingArea">
<el-select
v-model="form.sortingArea"
clearable
@change="sortingChange"
>
<el-option
v-for="item in sortingList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="物流方式" prop="serviceCode">
<el-select v-model="form.serviceCode" clearable filterable>
<el-option
v-for="item in logisticsMethodsList"
:key="item.serviceCode"
:label="item.serviceCode"
:value="item.serviceCode"
></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="createData.show = false">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
</template>
</el-dialog>
</div>
</el-card>
</template>
</split-div>
</template>
<style scoped lang="scss">
.el-card {
::v-deep(.el-card__body) {
height: 100%;
}
}
.manage {
height: 100%;
display: flex;
flex-direction: column;
.header {
margin-bottom: 10px;
}
.table-flex {
flex: 1;
flex-shrink: 0;
overflow: hidden;
display: flex;
}
.right-table {
flex: 1;
margin-left: 10px;
flex-shrink: 0;
}
.left-table {
height: 100%;
display: flex;
width: 100%;
flex-direction: column;
.pagination {
display: flex;
margin-top: 10px;
justify-content: center;
}
.table-container {
flex: 1;
flex-shrink: 0;
overflow: hidden;
}
}
}
</style>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
v-model="searchForm.userMark" v-model="searchForm.userMark"
clearable clearable
filterable filterable
style="width: 180px" style="width: 100px"
placeholder="客户" placeholder="客户"
> >
<el-option <el-option
...@@ -46,12 +46,23 @@ ...@@ -46,12 +46,23 @@
></el-option> ></el-option>
</el-select> </el-select>
</ElFormItem> </ElFormItem>
<ElFormItem label="定制类型">
<ElSelect
v-model="searchForm.customizedQuantity"
placeholder="定制类型"
clearable
style="width: 100px"
>
<ElOption label="单面" value="single" />
<ElOption label="多面" value="multiple" />
</ElSelect>
</ElFormItem>
<ElFormItem label="SKU"> <ElFormItem label="SKU">
<ElInput <ElInput
v-model.trim="searchForm.sku" v-model.trim="searchForm.sku"
placeholder=" SKU" placeholder=" SKU"
clearable clearable
style="width: 180px" style="width: 150px"
></ElInput> ></ElInput>
</ElFormItem> </ElFormItem>
<ElFormItem label="Base SKU"> <ElFormItem label="Base SKU">
...@@ -59,7 +70,7 @@ ...@@ -59,7 +70,7 @@
v-model.trim="searchForm.baseSku" v-model.trim="searchForm.baseSku"
placeholder=" Base SKU" placeholder=" Base SKU"
clearable clearable
style="width: 180px" style="width: 150px"
></ElInput> ></ElInput>
</ElFormItem> </ElFormItem>
<ElFormItem label="物流跟踪号"> <ElFormItem label="物流跟踪号">
...@@ -67,7 +78,7 @@ ...@@ -67,7 +78,7 @@
v-model.trim="searchForm.logisticsTracking" v-model.trim="searchForm.logisticsTracking"
placeholder="物流跟踪号" placeholder="物流跟踪号"
clearable clearable
style="width: 180px" style="width: 150px"
></ElInput> ></ElInput>
</ElFormItem> </ElFormItem>
<ElFormItem label="生产单号"> <ElFormItem label="生产单号">
...@@ -75,7 +86,7 @@ ...@@ -75,7 +86,7 @@
v-model="searchForm.factorySubOrderNumber" v-model="searchForm.factorySubOrderNumber"
placeholder="生产单号" placeholder="生产单号"
clearable clearable
style="width: 180px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="订单号"> <ElFormItem label="订单号">
...@@ -83,7 +94,7 @@ ...@@ -83,7 +94,7 @@
v-model="searchForm.factoryOrderNumber" v-model="searchForm.factoryOrderNumber"
placeholder="订单号" placeholder="订单号"
clearable clearable
style="width: 180px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="店铺单号"> <ElFormItem label="店铺单号">
...@@ -91,20 +102,10 @@ ...@@ -91,20 +102,10 @@
v-model="searchForm.shopNumber" v-model="searchForm.shopNumber"
placeholder="店铺单号" placeholder="店铺单号"
clearable clearable
style="width: 180px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="定制类型">
<ElSelect
v-model="searchForm.customizedQuantity"
placeholder="定制类型"
clearable
style="width: 180px"
>
<ElOption label="单面" value="single" />
<ElOption label="多面" value="multiple" />
</ElSelect>
</ElFormItem>
<ElFormItem> <ElFormItem>
<ElButton type="primary" @click="search">查询</ElButton> <ElButton type="primary" @click="search">查询</ElButton>
</ElFormItem> </ElFormItem>
...@@ -120,11 +121,74 @@ ...@@ -120,11 +121,74 @@
@click="changeTab(item)" @click="changeTab(item)"
> >
<span class="tabs-node_label">{{ item.statusName }}</span> <span class="tabs-node_label">{{ item.statusName }}</span>
<span class="tabs-node_count">{{ `(${item.quantity})` }}</span> <span
class="tabs-node_count"
:class="{
blue: item.quantity && item.quantity > 0,
red: item.status === 'EXCEPTION_ORDER',
}"
>{{ item.quantity }}</span
>
</div> </div>
<!-- <div
v-if="item.status === 'EXCEPTION_ORDER'"
:key="item.status"
class="tabs-node"
>
<el-dropdown @command="handleExceptionCommand">
<div>
<span
class="tabs-node_label"
style="color: #000; font-weight: 500"
>
异常单
</span>
<span
class="tabs-node_count"
:class="{
blue: item.quantity && item.quantity > 0,
red: item.status === 'EXCEPTION_ORDER',
}"
>{{ item.quantity }}</span
>
<el-icon class="el-icon--right"><arrow-down /></el-icon>
</div>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="1">待分派</el-dropdown-item>
<el-dropdown-item command="2">待处理</el-dropdown-item>
<el-dropdown-item command="3">已处理</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div> -->
</div> </div>
</div> </div>
<div class="order-content flex-1 flex-column overflow-hidden mt-10"> <div class="order-content flex-1 flex-column overflow-hidden mt-10">
<div v-if="status === 'EXCEPTION_ORDER'" class="sub-status mb-10">
<div
class="sub-status-item"
:class="exceptionStatus === 1 ? 'sub-active' : ''"
@click="handleExceptionCommand(1)"
>
<span class="sub-status-item-label">待分派</span>
</div>
<div
class="sub-status-item"
:class="exceptionStatus === 2 ? 'sub-active' : ''"
@click="handleExceptionCommand(2)"
>
<span class="sub-status-item-label">待处理</span>
</div>
<div
class="sub-status-item"
:class="exceptionStatus === 3 ? 'sub-active' : ''"
@click="handleExceptionCommand(3)"
>
<span class="sub-status-item-label">已处理</span>
</div>
</div>
<div class="operation-box mb-10"> <div class="operation-box mb-10">
<span v-if="status === 'TO_BE_CONFIRMED'" class="item"> <span v-if="status === 'TO_BE_CONFIRMED'" class="item">
<ElButton type="success" @click="confirmOrder"> 确认 </ElButton> <ElButton type="success" @click="confirmOrder"> 确认 </ElButton>
...@@ -132,6 +196,20 @@ ...@@ -132,6 +196,20 @@
<span v-if="status === 'EXCEPTION_ORDER'" class="item"> <span v-if="status === 'EXCEPTION_ORDER'" class="item">
<ElButton type="success" @click="updateOrder"> 转至待确认 </ElButton> <ElButton type="success" @click="updateOrder"> 转至待确认 </ElButton>
</span> </span>
<span
v-if="status === 'EXCEPTION_ORDER' && exceptionStatus === 1"
class="item"
>
<ElButton type="warning" @click="assignOrder"> 分派 </ElButton>
</span>
<span
v-if="status === 'EXCEPTION_ORDER' && exceptionStatus === 2"
class="item"
>
<ElButton type="warning" @click="handleExceptionOrder">
处理异常
</ElButton>
</span>
<span v-if="status === 'PICKING'" class="item"> <span v-if="status === 'PICKING'" class="item">
<ElButton type="primary" @click="printProductionOrder"> <ElButton type="primary" @click="printProductionOrder">
打印生产单 打印生产单
...@@ -1004,7 +1082,7 @@ ...@@ -1004,7 +1082,7 @@
@open="handleExceptionDialogOpen" @open="handleExceptionDialogOpen"
> >
<ElForm ref="exceptionFormRef" :model="exceptionForm" label-width="100px"> <ElForm ref="exceptionFormRef" :model="exceptionForm" label-width="100px">
<!-- <ElFormItem <ElFormItem
label="异常类型" label="异常类型"
prop="exceptionType" prop="exceptionType"
:rules="{ required: true, message: '请选择异常类型' }" :rules="{ required: true, message: '请选择异常类型' }"
...@@ -1013,6 +1091,7 @@ ...@@ -1013,6 +1091,7 @@
v-model="exceptionForm.exceptionType" v-model="exceptionForm.exceptionType"
style="width: 100%" style="width: 100%"
placeholder="请选择异常类型" placeholder="请选择异常类型"
clearable
> >
<ElOption <ElOption
v-for="type in exceptionTypes" v-for="type in exceptionTypes"
...@@ -1021,12 +1100,8 @@ ...@@ -1021,12 +1100,8 @@
:value="type.value" :value="type.value"
/> />
</ElSelect> </ElSelect>
</ElFormItem> --> </ElFormItem>
<ElFormItem <ElFormItem label="异常原因" prop="exceptionReason">
label="异常原因"
prop="exceptionReason"
:rules="{ required: true, message: '请输入异常原因' }"
>
<ElInput <ElInput
v-model="exceptionForm.exceptionReason" v-model="exceptionForm.exceptionReason"
style="width: 100%" style="width: 100%"
...@@ -1079,6 +1154,7 @@ import { ...@@ -1079,6 +1154,7 @@ import {
createLogisticsOrderApi, createLogisticsOrderApi,
updateLogisticsToPickingApi, updateLogisticsToPickingApi,
createLogisticsOrdersApi, createLogisticsOrdersApi,
handleExceptionOrderApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
...@@ -1145,7 +1221,9 @@ const [searchForm] = useValue<SearchForm>({ ...@@ -1145,7 +1221,9 @@ const [searchForm] = useValue<SearchForm>({
customizedQuantity: '', customizedQuantity: '',
startTime: null, startTime: null,
endTime: null, endTime: null,
exceptionHandling: undefined,
}) })
const exceptionStatus = ref(1)
const userMarkList = ref<string[]>([]) const userMarkList = ref<string[]>([])
const selection = ref<PodUsOrderListData[]>([]) const selection = ref<PodUsOrderListData[]>([])
const pickerOptions = { const pickerOptions = {
...@@ -1335,6 +1413,10 @@ const { ...@@ -1335,6 +1413,10 @@ const {
? timeRange.value[1] ? timeRange.value[1]
: null, : null,
status: status.value, status: status.value,
exceptionHandling:
status.value === 'EXCEPTION_ORDER'
? exceptionStatus.value || undefined
: undefined,
}, },
page, page,
pageSize, pageSize,
...@@ -1511,6 +1593,44 @@ const updateOrder = async () => { ...@@ -1511,6 +1593,44 @@ const updateOrder = async () => {
loading.close() loading.close()
} }
} }
const assignOrder = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
currentOrderIds.value = selection.value.map((item) => item.id)
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 () => {
if (selection.value.length === 0) { if (selection.value.length === 0) {
return ElMessage.warning('请选择数据') return ElMessage.warning('请选择数据')
...@@ -1584,12 +1704,10 @@ const pickingComplete = async () => { ...@@ -1584,12 +1704,10 @@ const pickingComplete = async () => {
loading.close() loading.close()
} }
} }
const exceptionType = ref('') const exceptionTypes = [
const exceptionReason = ref('') { value: '1', label: '客户' },
// const exceptionTypes = [ { value: '2', label: '工厂' },
// { value: '1', label: '客户' }, ]
// { value: '2', label: '工厂' },
// ]
const exceptionDialogVisible = ref(false) const exceptionDialogVisible = ref(false)
const currentOrderIds = ref<number[]>([]) const currentOrderIds = ref<number[]>([])
const exceptionForm = ref({ const exceptionForm = ref({
...@@ -1602,10 +1720,6 @@ const changeExceptionOrder = async () => { ...@@ -1602,10 +1720,6 @@ const changeExceptionOrder = async () => {
return ElMessage.warning('请选择数据') return ElMessage.warning('请选择数据')
} }
currentOrderIds.value = selection.value.map((item) => item.id) currentOrderIds.value = selection.value.map((item) => item.id)
// 重置状态
exceptionType.value = ''
exceptionReason.value = ''
exceptionDialogVisible.value = true exceptionDialogVisible.value = true
} }
...@@ -1621,10 +1735,15 @@ const handleExceptionConfirm = async () => { ...@@ -1621,10 +1735,15 @@ const handleExceptionConfirm = async () => {
text: '操作中...', text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)', background: 'rgba(0, 0, 0, 0.3)',
}) })
const url =
status.value === 'EXCEPTION_ORDER'
? 'factory/podJomallOrderUs/distributionExceptionOrders'
: 'factory/podJomallOrderUs/exceptionOrders'
try { try {
const res = await changeExceptionOrderApi( const res = await changeExceptionOrderApi(
url,
currentOrderIds.value, currentOrderIds.value,
// exceptionForm.value.exceptionType, exceptionForm.value.exceptionType,
exceptionForm.value.exceptionReason, exceptionForm.value.exceptionReason,
) )
if (res.code !== 200) return if (res.code !== 200) return
...@@ -2304,6 +2423,11 @@ onMounted(() => { ...@@ -2304,6 +2423,11 @@ onMounted(() => {
loadProductionClient() loadProductionClient()
loadWarehouseList() loadWarehouseList()
}) })
const handleExceptionCommand = (command: number) => {
exceptionStatus.value = command
search()
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header-filter-form { .header-filter-form {
...@@ -2326,6 +2450,7 @@ onMounted(() => { ...@@ -2326,6 +2450,7 @@ onMounted(() => {
color: #000; color: #000;
cursor: pointer; cursor: pointer;
height: 40px; height: 40px;
font-weight: 500;
} }
.tabs-node:hover { .tabs-node:hover {
...@@ -2394,6 +2519,29 @@ onMounted(() => { ...@@ -2394,6 +2519,29 @@ onMounted(() => {
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
} }
.tabs-node_count {
display: inline-block;
min-width: 20px;
height: 20px;
line-height: 20px;
border-radius: 50%;
font-size: 14px;
text-align: center;
margin-left: 4px;
background: #f2f3f5; // 默认灰色
color: #666;
font-weight: 500;
}
.tabs-node_count.blue {
background: rgb(219, 234, 254);
color: rgb(30, 64, 175);
}
.tabs-node_count.red {
background: rgb(254 226 226);
color: rgb(153 27 27);
}
.empty { .empty {
height: 100%; height: 100%;
...@@ -2462,4 +2610,31 @@ onMounted(() => { ...@@ -2462,4 +2610,31 @@ onMounted(() => {
} }
} }
} }
.sub-status {
display: flex;
align-items: center;
border-bottom: 1px solid #e5e6eb;
background: #fff;
.sub-status-item {
position: relative;
font-size: 16px;
cursor: pointer;
padding: 6px 24px 6px 24px;
border: 1px solid #e5e6eb;
background: #f7f8fa;
color: #606266;
margin-bottom: -1px;
transition: background 0.2s, color 0.2s;
&:not(:last-child) {
border-right: none;
}
&.sub-active {
background: #fff;
color: #1d2129;
font-weight: 600;
border-bottom: 1px solid transparent;
z-index: 2;
}
}
}
</style> </style>
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