【愚公系列】2023年03月 WMS智能仓储系统-018.收获管理和发货管理(完结篇)
【愚公系列】2023年02月 WMS智能仓储系统-018.收获管理和发货管理(完结篇)前言
WMS智能仓储收货管理和发货管理是非常重要的两个功能
• 收货管理:收货管理主要功能是接收货物,确定货物的种类数量和质量,并记录收货信息,还可以直接将收货信息传输给仓库管理系统。
• 发货管理:发货管理的作用是实现仓库的发货功能,根据客户的要求,按照计划,按照正确的数量和质量,及时将货物发出去。
一、收获管理和发货管理
1.收获管理
WMS智能仓储收货管理的流程步骤包括:
1.到货通知:收货管理员在WMS系统中进行到货通知登记,输入货物的基本信息;
2.待到货:到货通知新建完回同时生成待到货单,单据状态就是已发车还在路上;
3.待卸货:收货管理员检查收货的货物,确认货物的数量和情况;
4.待分拣:收货管理员需要严格按照收货质量标准进行管理,以确保货物的质量,并进行分类;
5.待上架:收货管理员根据系统指令将收货的货物进行入库;
6.收获明细:入库完成生成具体的入库明细单,形成实质单据;
1.1 页面代码
<!-- Warehouse Setting -->
<template>
<div class="container">
<div>
<v-tabs v-model="data.activeTab" stacked @update:model-value="method.changeTabs">
<v-tab v-for="(item, index) of tabsConfig" :key="index" :value="item.value">
<v-icon>{{ item.icon }}</v-icon>
<p class="tabItemTitle">{{ item.tabName }}</p>
</v-tab>
</v-tabs>
<!-- Main Content -->
<v-card class="mt-5">
<v-card-text>
<v-window v-model="data.activeTab">
<v-window-item value="tabNotice">
<tabNotice ref="tabNoticeRef" />
</v-window-item>
<v-window-item value="tabToDoArrival">
<tabToDoArrival ref="tabToDoArrivalRef" />
</v-window-item>
<v-window-item value="tabToDoUnload">
<tabToDoUnload ref="tabToDoUnloadRef" />
</v-window-item>
<v-window-item value="tabToDoSorting">
<tabToDoSorting ref="tabToDoSortingRef" />
</v-window-item>
<v-window-item value="tabToDoGrounding">
<tabToDoGrounding ref="tabToDoGroundingRef" />
</v-window-item>
<v-window-item value="tabReceiptDetails">
<tabReceiptDetails ref="tabReceiptDetailsRef" />
</v-window-item>
</v-window>
</v-card-text>
</v-card>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, reactive, onMounted, watch, nextTick } from 'vue'
import i18n from '@/languages/i18n'
import tabNotice from './tabNotice.vue'
import tabToDoArrival from './tabToDoArrival.vue'
import tabToDoUnload from './tabToDoUnload.vue'
import tabToDoSorting from './tabToDoSorting.vue'
import tabToDoGrounding from './tabToDoGrounding.vue'
import tabReceiptDetails from './tabReceiptDetails.vue'
const tabNoticeRef = ref()
const tabToDoArrivalRef = ref()
const tabToDoUnloadRef = ref()
const tabToDoSortingRef = ref()
const tabToDoGroundingRef = ref()
const tabReceiptDetailsRef = ref()
const tabsConfig = [
{
value: 'tabNotice',
icon: 'mdi-checkbox-blank-badge',
tabName: i18n.global.t('wms.stockAsn.tabNotice')
},
{
value: 'tabToDoArrival',
icon: 'mdi-truck-cargo-container',
tabName: i18n.global.t('wms.stockAsn.tabToDoArrival')
},
{
value: 'tabToDoUnload',
icon: 'mdi-truck-outline',
tabName: i18n.global.t('wms.stockAsn.tabToDoUnload')
},
{
value: 'tabToDoSorting',
icon: 'mdi-dolly',
tabName: i18n.global.t('wms.stockAsn.tabToDoSorting')
},
{
value: 'tabToDoGrounding',
icon: 'mdi-grid',
tabName: i18n.global.t('wms.stockAsn.tabToDoGrounding')
},
{
value: 'tabReceiptDetails',
icon: 'mdi-file-cabinet',
tabName: i18n.global.t('wms.stockAsn.tabReceiptDetails')
}
]
const data = reactive({
activeTab: '',
isLoadNotice: false,
isLoadToDoArrival: false,
isLoadToDoUnload: false,
isLoadToDoSorting: false,
isLoadToDoGrounding: false,
isLoadReceiptDetails: false
})
const method = reactive({
changeTabs: (e: any): void => {
nextTick(() => {
switch (e) {
case 'tabNotice':
// Tips:Must be write the nextTick so that can get DOM!!
if (tabNoticeRef?.value?.getStockAsnList) {
tabNoticeRef.value.getStockAsnList()
}
break
case 'tabToDoArrival':
if (tabToDoArrivalRef?.value?.getStockAsnList) {
tabToDoArrivalRef.value.getStockAsnList()
}
break
case 'tabToDoUnload':
if (tabToDoUnloadRef?.value?.getStockAsnList) {
tabToDoUnloadRef.value.getStockAsnList()
}
break
case 'tabToDoSorting':
if (tabToDoSortingRef?.value?.getStockAsnList) {
tabToDoSortingRef.value.getStockAsnList()
}
break
case 'tabToDoGrounding':
if (tabToDoGroundingRef?.value?.getStockAsnList) {
tabToDoGroundingRef.value.getStockAsnList()
}
break
case 'tabReceiptDetails':
if (tabReceiptDetailsRef?.value?.getStockAsnList) {
tabReceiptDetailsRef.value.getStockAsnList()
}
break
}
})
}
})
onMounted(() => {})
</script>
<style scoped lang="less">
.operateArea {
width: 100%;
min-width: 760px;
display: flex;
align-items: center;
border-radius: 10px;
padding: 0 10px;
}
.col {
display: flex;
align-items: center;
}
</style>
1.2 接口代码
[Route("asn")]
[ApiController]
[ApiExplorerSettings(GroupName = "WMS")]
public class AsnController : BaseController
{
#region Args
/// <summary>
/// asn Service
/// </summary>
private readonly IAsnService _asnService;
/// <summary>
/// Localizer Service
/// </summary>
private readonly IStringLocalizer<ModernWMS.Core.MultiLanguage> _stringLocalizer;
#endregion
#region constructor
/// <summary>
/// constructor
/// </summary>
/// <param name="asnService">asn Service</param>
/// <param name="stringLocalizer">Localizer</param>
public AsnController(
IAsnService asnService
, IStringLocalizer<ModernWMS.Core.MultiLanguage> stringLocalizer
)
{
this._asnService = asnService;
this._stringLocalizer = stringLocalizer;
}
#endregion
#region Api
/// <summary>
/// page search, sqlTitle input asn_status:0 ~ 4
/// </summary>
/// <param name="pageSearch">args</param>
/// <returns></returns>
[HttpPost("list")]
public async Task<ResultModel<PageData<AsnViewModel>>> PageAsync(PageSearch pageSearch)
{
var (data, totals) = await _asnService.PageAsync(pageSearch, CurrentUser);
return ResultModel<PageData<AsnViewModel>>.Success(new PageData<AsnViewModel>
{
Rows = data,
Totals = totals
});
}
/// <summary>
/// get a record by id
/// </summary>
/// <returns>args</returns>
[HttpGet]
public async Task<ResultModel<AsnViewModel>> GetAsync(int id)
{
var data = await _asnService.GetAsync(id);
if (data != null && data.id > 0)
{
return ResultModel<AsnViewModel>.Success(data);
}
else
{
return ResultModel<AsnViewModel>.Error(_stringLocalizer["not_exists_entity"]);
}
}
/// <summary>
/// add a new record
/// </summary>
/// <param name="viewModel">args</param>
/// <returns></returns>
[HttpPost]
public async Task<ResultModel<int>> AddAsync(AsnViewModel viewModel)
{
var (id, msg) = await _asnService.AddAsync(viewModel, CurrentUser);
if (id > 0)
{
return ResultModel<int>.Success(id);
}
else
{
return ResultModel<int>.Error(msg);
}
}
/// <summary>
/// update a record
/// </summary>
/// <param name="viewModel">args</param>
/// <returns></returns>
[HttpPut]
public async Task<ResultModel<bool>> UpdateAsync(AsnViewModel viewModel)
{
var (flag, msg) = await _asnService.UpdateAsync(viewModel);
if (flag)
{
return ResultModel<bool>.Success(flag);
}
else
{
return ResultModel<bool>.Error(msg, 400, flag);
}
}
/// <summary>
/// delete a record
/// </summary>
/// <param name="id">id</param>
/// <returns></returns>
[HttpDelete]
public async Task<ResultModel<string>> DeleteAsync(int id)
{
var (flag, msg) = await _asnService.DeleteAsync(id);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// Bulk modify Goodsowner
/// </summary>
/// <param name="viewModel">args</param>
/// <returns></returns>
[HttpPut("bulk-modify-goods-owner")]
public async Task<ResultModel<bool>> BulkModifyGoodsownerAsync(AsnBulkModifyGoodsOwnerViewModel viewModel)
{
var (flag, msg) = await _asnService.BulkModifyGoodsownerAsync(viewModel);
if (flag)
{
return ResultModel<bool>.Success(flag);
}
else
{
return ResultModel<bool>.Error(msg, 400, flag);
}
}
#endregion
#region Flow Api
/// <summary>
/// Confirm Delivery
/// change the asn_status from 0 to 1
/// </summary>
/// <param name="id">id</param>
/// <returns></returns>
[HttpPut("confirm/{id}")]
public async Task<ResultModel<string>> ConfirmAsync(int id)
{
var (flag, msg) = await _asnService.ConfirmAsync(id);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// Cancel confirm, change asn_status 1 to 0
/// </summary>
/// <param name="id">id</param>
/// <returns></returns>
[HttpPut("confirm-cancel/{id}")]
public async Task<ResultModel<string>> ConfirmCancelAsync(int id)
{
var (flag, msg) = await _asnService.ConfirmCancelAsync(id);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// Unload
/// change the asn_status from 1 to 2
/// </summary>
/// <param name="id">id</param>
/// <returns></returns>
[HttpPut("unload/{id}")]
public async Task<ResultModel<string>> UnloadAsync(int id)
{
var (flag, msg) = await _asnService.UnloadAsync(id);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// Cancel unload
/// change the asn_status from 2 to 1
/// </summary>
/// <param name="id">id</param>
/// <returns></returns>
[HttpPut("unload-cancel/{id}")]
public async Task<ResultModel<string>> UnloadCancelAsync(int id)
{
var (flag, msg) = await _asnService.UnloadCancelAsync(id);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// sorting, add a new asnsort record and update asn sorted_qty
/// </summary>
/// <param name="viewModel">args</param>
/// <returns></returns>
[HttpPut("sorting")]
public async Task<ResultModel<string>> SortingAsync(AsnsortInputViewModel viewModel)
{
var (flag, msg) = await _asnService.SortingAsync(viewModel, CurrentUser);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// Sorted
/// change the asn_status from 2 to 3
/// </summary>
/// <param name="id">id</param>
/// <returns></returns>
[HttpPut("sorted/{id}")]
public async Task<ResultModel<string>> SortedAsync(int id)
{
var (flag, msg) = await _asnService.SortedAsync(id);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// Cancel sorted
/// change the asn_status from 3 to 2
/// </summary>
/// <param name="id">id</param>
/// <returns></returns>
[HttpPut("sorted-cancel/{id}")]
public async Task<ResultModel<string>> SortedCancelAsync(int id)
{
var (flag, msg) = await _asnService.SortedCancelAsync(id);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// PutAway
/// </summary>
/// <param name="viewModel">args</param>
/// <returns></returns>
[HttpPut("putaway")]
public async Task<ResultModel<string>> PutAwayAsync(AsnPutAwayInputViewModel viewModel)
{
var (flag, msg) = await _asnService.PutAwayAsync(viewModel, CurrentUser);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
#endregion
}
2.发货管理
智能仓储发货管理的流程步骤包括:
1.发货订单:对发货的货物进行订单生成;
2.预发货:发货订单新建完成就会形成预发货状态,只有确定发货才会进入到已发货状态;
3.新发货:已经确定发货;
4.待拣货:已经确定发货的货物进行仓库的取出;
5.已拣货:货物已经取出;
6.待打包:货物已经取出进行打包;
7.已打包:货物已经打包完成;
8.待称重:已打包货物进行称重;
9.已称重:货物称重完成;
10.待出库:货物全部处理和打包完成,需要进行待出库;
11.已出库:货物出库完成;
12.已签收:联系物流公司,将货物发送出去;跟踪货物,确保货物到达客户手中。
1.1 页面代码
<template>
<div class="operateArea">
<v-row no-gutters>
<!-- Operate Btn -->
<v-col cols="3" class="col">
<tooltip-btn icon="mdi-refresh" :tooltip-text="$t('system.page.refresh')" @click="method.refresh"></tooltip-btn>
<tooltip-btn icon="mdi-export-variant" :tooltip-text="$t('system.page.export')" @click="method.exportTable"> </tooltip-btn>
<tooltip-btn icon="mdi-car-cog" :tooltip-text="$t('wms.deliveryManagement.setFreight')" @click="method.setFreight"> </tooltip-btn>
<tooltip-btn icon="mdi-email-check" :tooltip-text="$t('wms.deliveryManagement.signIn')" @click="method.handleSignIn"></tooltip-btn>
</v-col>
<!-- Search Input -->
<v-col cols="9">
<v-row no-gutters @keyup.enter="method.sureSearch">
<v-col cols="4">
<v-text-field
v-model="data.searchForm.dispatch_no"
clearable
hide-details
density="comfortable"
class="searchInput ml-5 mt-1"
:label="$t('wms.deliveryManagement.dispatch_no')"
variant="solo"
>
</v-text-field>
</v-col>
<v-col cols="4">
<v-text-field
v-model="data.searchForm.customer_name"
clearable
hide-details
density="comfortable"
class="searchInput ml-5 mt-1"
:label="$t('wms.deliveryManagement.customer_name')"
variant="solo"
>
</v-text-field>
</v-col>
<v-col cols="4">
<v-text-field
v-model="data.searchForm.spu_name"
clearable
hide-details
density="comfortable"
class="searchInput ml-5 mt-1"
:label="$t('wms.deliveryManagement.spu_name')"
variant="solo"
>
</v-text-field>
</v-col>
</v-row>
</v-col>
</v-row>
</div>
<!-- Table -->
<div
class="mt-5"
:style="{
height: cardHeight
}"
>
<vxe-table ref="xTable" :column-config="{ minWidth: '100px' }" :data="data.tableData" :height="tableHeight" align="center">
<template #empty>
{{ i18n.global.t('system.page.noData') }}
</template>
<vxe-column type="seq" width="60"></vxe-column>
<vxe-column type="checkbox" width="50"></vxe-column>
<vxe-column field="dispatch_no" :title="$t('wms.deliveryManagement.dispatch_no')"></vxe-column>
<vxe-column field="spu_code" :title="$t('wms.deliveryManagement.spu_code')"></vxe-column>
<vxe-column field="spu_description" :title="$t('wms.deliveryManagement.spu_description')"></vxe-column>
<vxe-column field="spu_name" :title="$t('wms.deliveryManagement.spu_name')"></vxe-column>
<vxe-column field="sku_code" :title="$t('wms.deliveryManagement.sku_code')"></vxe-column>
<vxe-column field="bar_code" :title="$t('wms.deliveryManagement.bar_code')"></vxe-column>
<vxe-column field="qty" :title="$t('wms.deliveryManagement.order_qty')"></vxe-column>
<vxe-column field="weight" :title="$t('wms.deliveryManagement.detailWeight')">
<template #default="{ row }">
<span>{{ `${row.weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
</template>
</vxe-column>
<vxe-column field="volume" :title="$t('wms.deliveryManagement.detailVolume')">
<template #default="{ row }">
<span>{{ `${row.volume} ${GetUnit('volume', row.volume_unit)}` }}</span>
</template>
</vxe-column>
<vxe-column field="package_no" :title="$t('wms.deliveryManagement.package_no')"></vxe-column>
<vxe-column field="weighing_weight" :title="$t('wms.deliveryManagement.weighing_weight')">
<template #default="{ row }">
<span>{{ `${row.weighing_weight} ${GetUnit('weight', row.weight_unit)}` }}</span>
</template>
</vxe-column>
<vxe-column field="weighing_no" :title="$t('wms.deliveryManagement.weighing_no')"></vxe-column>
<vxe-column field="customer_name" :title="$t('wms.deliveryManagement.customer_name')"></vxe-column>
<vxe-column field="creator" :title="$t('wms.deliveryManagement.creator')"></vxe-column>
<vxe-column field="create_time" width="170px" :title="$t('wms.deliveryManagement.create_time')"></vxe-column>
<vxe-column field="operate" :title="$t('system.page.operate')" width="140" :resizable="false" show-overflow>
<template #default="{ row }">
<div style="width: 100%; display: flex; justify-content: center">
<tooltip-btn :flat="true" icon="mdi-eye-outline" :tooltip-text="$t('system.page.view')" @click="method.viewRow(row)"></tooltip-btn>
<!-- <tooltip-btn
:flat="true"
icon="mdi-email-check"
:tooltip-text="$t('wms.deliveryManagement.signIn')"
@click="method.handleSignIn(row)"
></tooltip-btn> -->
</div>
</template>
</vxe-column>
</vxe-table>
<custom-pager
:current-page="data.tablePage.pageIndex"
:page-size="data.tablePage.pageSize"
perfect
:total="data.tablePage.total"
:page-sizes="PAGE_SIZE"
:layouts="PAGE_LAYOUT"
@page-change="method.handlePageChange"
>
</custom-pager>
<!-- <ToBeSignInConfirm
:show-dialog="data.showDialog"
:dialog-default-qty="data.dialogDefaultQty"
@close="method.dialogClose"
@submit="method.dialogSubmit"
/> -->
<SignInConfirm
:dialog-title="$t('wms.deliveryManagement.signIn')"
:show-dialog="data.showDialog"
:is-weight="false"
:is-sign-in="true"
:data-list="data.confirmList"
@close="method.dialogClose"
@submit="method.dialogSubmit"
/>
<SearchDeliveredDetail :id="data.showDeliveredDetailID" :show-dialog="data.showDeliveredDetail" @close="method.closeDeliveredDetail" />
<ToBeFreightfee :show-dialog="data.showSetFreight" @close="method.freightfeeClose" @submit="method.freightfeeSubmit" />
</div>
</template>
<script lang="ts" setup>
import { computed, ref, reactive, watch } from 'vue'
import { VxePagerEvents } from 'vxe-table'
import { computedCardHeight, computedTableHeight } from '@/constant/style'
import { DeliveryManagementDetailVO, SetCarrierVO, ConfirmItem } from '@/types/DeliveryManagement/DeliveryManagement'
import { PAGE_SIZE, PAGE_LAYOUT, DEFAULT_PAGE_SIZE } from '@/constant/vxeTable'
import { hookComponent } from '@/components/system'
import { getDelivery, handleSignIn, setCarrier } from '@/api/wms/deliveryManagement'
import tooltipBtn from '@/components/tooltip-btn.vue'
import i18n from '@/languages/i18n'
// import ToBeSignInConfirm from './to-be-sign-in-confirm.vue'
import SignInConfirm from './package-confirm.vue'
import { GetUnit } from '@/constant/commodityManagement'
import ToBeFreightfee from './to-be-freightfee.vue'
import customPager from '@/components/custom-pager.vue'
import { setSearchObject } from '@/utils/common'
import { TablePage } from '@/types/System/Form'
import SearchDeliveredDetail from './search-delivered-detail.vue'
import { exportData } from '@/utils/exportTable'
import { DEBOUNCE_TIME } from '@/constant/system'
const xTable = ref()
const data = reactive({
showDeliveredDetailID: 0,
showDeliveredDetail: false,
showSetFreight: false,
showDialog: false,
dialogDefaultQty: 0,
packageRow: ref<DeliveryManagementDetailVO>(),
searchForm: {
dispatch_no: '',
customer_name: '',
spu_name: ''
},
timer: ref<any>(null),
activeTab: null,
tableData: ref<DeliveryManagementDetailVO[]>([]),
tablePage: ref<TablePage>({
total: 0,
pageIndex: 1,
pageSize: DEFAULT_PAGE_SIZE,
searchObjects: []
}),
confirmList: ref<ConfirmItem[]>([])
})
const method = reactive({
closeDeliveredDetail: () => {
data.showDeliveredDetail = false
},
viewRow: (row: DeliveryManagementDetailVO) => {
data.showDeliveredDetailID = row.id
data.showDeliveredDetail = true
},
setFreight: () => {
const $table = xTable.value
if ($table.getCheckboxRecords().length > 0) {
data.showSetFreight = true
} else {
hookComponent.$message({
type: 'error',
content: `${ i18n.global.t('base.userManagement.checkboxIsNull') }`
})
}
},
freightfeeClose: () => {
data.showSetFreight = false
},
freightfeeSubmit: async (form: { carrier: string; freightfee_id: number; waybill_no: string }) => {
const reqList: SetCarrierVO[] = []
const $table = xTable.value
for (const item of $table.getCheckboxRecords()) {
reqList.push({
id: item.id,
dispatch_no: item.dispatch_no,
dispatch_status: item.dispatch_status,
freightfee_id: form.freightfee_id,
carrier: form.carrier,
waybill_no: form.waybill_no
})
}
const { data: res } = await setCarrier(reqList)
if (!res.isSuccess) {
hookComponent.$message({
type: 'error',
content: res.errorMessage
})
return
}
hookComponent.$message({
type: 'success',
content: res.data
})
method.freightfeeClose()
method.refresh()
},
dialogClose: () => {
data.showDialog = false
},
// Callback after entering packaging value
dialogSubmit: async (list: ConfirmItem[]) => {
const SingInList = list.map((item) => ({
id: item.id,
dispatch_no: item.dispatch_no,
dispatch_status: item.dispatch_status,
damage_qty: item.qty
}))
const { data: res } = await handleSignIn(SingInList)
if (!res.isSuccess) {
hookComponent.$message({
type: 'error',
content: res.errorMessage
})
return
}
hookComponent.$message({
type: 'success',
content: res.data
})
method.dialogClose()
method.refresh()
// if (data.packageRow) {
// const { data: res } = await handleSignIn([
// {
// id: data.packageRow.id,
// dispatch_no: data.packageRow.dispatch_no,
// dispatch_status: data.packageRow.dispatch_status,
// damage_qty: qty
// }
// ])
// if (!res.isSuccess) {
// hookComponent.$message({
// type: 'error',
// content: res.errorMessage
// })
// return
// }
// hookComponent.$message({
// type: 'success',
// content: res.data
// })
// method.dialogClose()
// method.refresh()
// }
},
handleSignIn: async () => {
const $table = xTable.value
const checkTableList = $table.getCheckboxRecords()
const confirmList: ConfirmItem[] = []
if (checkTableList.length > 0) {
// Processing the data required by the window
for (const item of checkTableList) {
confirmList.push({
id: item.id,
spu_name: item.spu_name,
spu_code: item.spu_code,
sku_code: item.sku_code,
maxQty: item.picked_qty,
qty: 0,
dispatch_no: item.dispatch_no,
dispatch_status: item.dispatch_status
})
}
data.confirmList = confirmList
data.showDialog = true
} else {
hookComponent.$message({
type: 'error',
content: `${ i18n.global.t('base.userManagement.checkboxIsNull') }`
})
}
// data.packageRow = row
// data.dialogDefaultQty = row.picked_qty ? row.picked_qty : 0
// data.showDialog = true
},
// Refresh data
refresh: () => {
method.getDelivery()
},
getDelivery: async () => {
const { data: res } = await getDelivery(data.tablePage)
if (!res.isSuccess) {
hookComponent.$message({
type: 'error',
content: res.errorMessage
})
return
}
data.tableData = res.data.rows
data.tablePage.total = res.data.totals
},
handlePageChange: ref<VxePagerEvents.PageChange>(({ currentPage, pageSize }) => {
data.tablePage.pageIndex = currentPage
data.tablePage.pageSize = pageSize
method.getDelivery()
}),
exportTable: () => {
const $table = xTable.value
exportData({
table: $table,
filename: i18n.global.t('wms.deliveryManagement.outOfWarehouse'),
columnFilterMethod({ column }: any) {
return !['checkbox'].includes(column?.type) && !['operate'].includes(column?.field)
}
})
},
sureSearch: () => {
data.tablePage.searchObjects = setSearchObject(data.searchForm)
method.getDelivery()
}
})
const cardHeight = computed(() => computedCardHeight({}))
const tableHeight = computed(() => computedTableHeight({}))
watch(
() => data.searchForm,
() => {
// debounce
if (data.timer) {
clearTimeout(data.timer)
}
data.timer = setTimeout(() => {
data.timer = null
method.sureSearch()
}, DEBOUNCE_TIME)
},
{
deep: true
}
)
defineExpose({
getDelivery: method.getDelivery
})
</script>
<style lang="less" scoped>
.operateArea {
width: 100%;
min-width: 760px;
display: flex;
align-items: center;
border-radius: 10px;
padding: 0 10px;
}
.col {
display: flex;
align-items: center;
}
</style>
1.2 接口代码
[Route("dispatchlist")]
[ApiController]
[ApiExplorerSettings(GroupName = "WMS")]
public class DispatchlistController : BaseController
{
#region Args
/// <summary>
/// dispatchlist Service
/// </summary>
private readonly IDispatchlistService _dispatchlistService;
/// <summary>
/// Localizer Service
/// </summary>
private readonly IStringLocalizer<ModernWMS.Core.MultiLanguage> _stringLocalizer;
#endregion
#region constructor
/// <summary>
/// constructor
/// </summary>
/// <param name="dispatchlistService">dispatchlist Service</param>
/// <param name="stringLocalizer">Localizer</param>
public DispatchlistController(
IDispatchlistService dispatchlistService
, IStringLocalizer<ModernWMS.Core.MultiLanguage> stringLocalizer
)
{
this._dispatchlistService = dispatchlistService;
this._stringLocalizer= stringLocalizer;
}
#endregion
#region Api
/// <summary>
/// page search
/// </summary>
/// <param name="pageSearch">args</param>
/// <returns></returns>
[HttpPost("list")]
public async Task<ResultModel<PageData<DispatchlistViewModel>>> PageAsync(PageSearch pageSearch)
{
var (data, totals) = await _dispatchlistService.PageAsync(pageSearch, CurrentUser);
return ResultModel<PageData<DispatchlistViewModel>>.Success(new PageData<DispatchlistViewModel>
{
Rows = data,
Totals = totals
});
}
/// <summary>
/// advanced dispatch order page search
/// </summary>
/// <param name="pageSearch">args</param>
/// <returns></returns>
[HttpPost("advanced-list")]
public async Task<ResultModel<PageData<PreDispatchlistViewModel>>> AdvancedDispatchlistPageAsync(PageSearch pageSearch)
{
var (data, totals) = await _dispatchlistService.AdvancedDispatchlistPageAsync(pageSearch, CurrentUser);
return ResultModel<PageData<PreDispatchlistViewModel>>.Success(new PageData<PreDispatchlistViewModel>
{
Rows = data,
Totals = totals
});
}
/// <summary>
/// add a new record
/// </summary>
/// <param name="viewModel">args</param>
/// <returns></returns>
[HttpPost]
public async Task<ResultModel<string>> AddAsync(List<DispatchlistAddViewModel> viewModel)
{
var (flag, msg) = await _dispatchlistService.AddAsync(viewModel,CurrentUser);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// update dispatchlist with same dispatch_no
/// </summary>
/// <param name="viewModel">viewModel</param>
/// <returns></returns>
[HttpPut]
public async Task<ResultModel<string>> UpdateAsycn(List<DispatchlistViewModel> viewModel)
{
var (flag, msg) = await _dispatchlistService.UpdateAsycn(viewModel, CurrentUser);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// get dispatchlist by dispatch_no
/// </summary>
/// <param name="dispatch_no">dispatch_no</param>
/// <returns></returns>
[HttpGet("by-dispatch_no")]
public async Task<ResultModel<List<DispatchlistViewModel>>> GetByDispatchlistNo(string dispatch_no)
{
var datas = await _dispatchlistService.GetByDispatchlistNo(dispatch_no, CurrentUser);
return ResultModel<List<DispatchlistViewModel>>.Success(datas);
}
/// <summary>
/// get Dispatchlist details with available stock
/// </summary>
/// <param name="dispatch_no">dispatch_no</param>
/// <returns></returns>
[HttpGet("confirm-check")]
public async Task<ResultModel<List<DispatchlistConfirmDetailViewModel>>> ConfirmOrderCheck(string dispatch_no)
{
var datas = await _dispatchlistService.ConfirmOrderCheck(dispatch_no, CurrentUser);
return ResultModel<List<DispatchlistConfirmDetailViewModel>>.Success(datas);
}
/// <summary>
/// get pick list by dispatch_id
/// </summary>
/// <param name="dispatch_id">dispatch_id</param>
/// <returns></returns>
[HttpGet("pick-list")]
public async Task<ResultModel<List<DispatchpicklistViewModel>>> GetPickListByDispatchID(int dispatch_id)
{
var datas = await _dispatchlistService.GetPickListByDispatchID(dispatch_id);
return ResultModel<List<DispatchpicklistViewModel>>.Success(datas);
}
/// <summary>
/// delete a record
/// </summary>
/// <param name="dispatch_no">dispatch_no</param>
/// <returns></returns>
[HttpDelete]
public async Task<ResultModel<string>> DeleteAsync(string dispatch_no)
{
var (flag, msg) = await _dispatchlistService.DeleteAsync(dispatch_no,CurrentUser);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// Confirm orders and create dispatchpicklist
/// </summary>
/// <param name="viewModels">viewModels</param>
/// <returns></returns>
[HttpPost("confirm-order")]
public async Task<ResultModel<string >> ConfirmOrder(List<DispatchlistConfirmDetailViewModel> viewModels)
{
var (flag, msg) = await _dispatchlistService.ConfirmOrder(viewModels, CurrentUser);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// confirm dispatchpicklist picked by dispatch_no
/// </summary>
/// <param name="dispatch_no">viewModels</param>
/// <returns></returns>
[HttpPut("confirm-pick-dispatchlistno")]
public async Task<ResultModel<string>> ConfirmPickByDispatchNo(string dispatch_no)
{
var (flag, msg) = await _dispatchlistService.ConfirmPickByDispatchNo(dispatch_no, CurrentUser);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// package dispatchpicklist
/// </summary>
/// <param name="viewModels">viewModels</param>
/// <returns></returns>
[HttpPost("package")]
public async Task<ResultModel<string>> Package(List<DispatchlistPackageViewModel> viewModels)
{
var (flag, msg) = await _dispatchlistService.Package(viewModels, CurrentUser);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// weight dispatchpicklist
/// </summary>
/// <param name="viewModels">viewModels</param>
/// <returns></returns>
[HttpPost("weight")]
public async Task<ResultModel<string>> Weight(List<DispatchlistWeightViewModel> viewModels)
{
var (flag, msg) = await _dispatchlistService.Weight(viewModels, CurrentUser);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// dispatchpicklist outbound delivery
/// </summary>
/// <param name="viewModels">viewModels</param>
/// <returns></returns>
[HttpPost("delivery")]
public async Task<ResultModel<string>> Delivery(List<DispatchlistDeliveryViewModel> viewModels)
{
var (flag, msg) = await _dispatchlistService.Delivery(viewModels, CurrentUser);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// set dispatchlist freightfee
/// </summary>
/// <param name="viewModels">viewModels</param>
/// <returns></returns>
[HttpPost("freightfee")]
public async Task<ResultModel<string>> SetFreightfee(List<DispatchlistFreightfeeViewModel> viewModels)
{
var (flag, msg) = await _dispatchlistService.SetFreightfee(viewModels);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// sign for arrival
/// </summary>
/// <param name="viewModels">viewModels</param>
/// <returns></returns>
[HttpPost("sign")]
public async Task<ResultModel<string>> SignForArrival(List<DispatchlistSignViewModel> viewModels)
{
var (flag, msg) = await _dispatchlistService.SignForArrival(viewModels);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// cancel order opration
/// </summary>
/// <param name="viewModel">viewModel</param>
/// <returns></returns>
[HttpPost("cancel-order")]
public async Task<ResultModel<string>> CancelOrderOpration(CancelOrderOprationViewModel viewModel)
{
var (flag, msg) = await _dispatchlistService.CancelOrderOpration(viewModel,CurrentUser);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
/// <summary>
/// cancel dispatchlist detail opration
/// </summary>
/// <param name="id">id</param>
/// <returns></returns>
[HttpPut("cancel-order")]
public async Task<ResultModel<string>> CancelDispatchlistDetailOpration(int id)
{
var (flag, msg) = await _dispatchlistService.CancelDispatchlistDetailOpration(id);
if (flag)
{
return ResultModel<string>.Success(msg);
}
else
{
return ResultModel<string>.Error(msg);
}
}
#endregion
}
- 点赞
- 收藏
- 关注作者
评论(0)