From 7bfa3796ce60a29c4fe2244a7b7a553149773483 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期日, 26 十月 2025 12:13:40 +0800
Subject: [PATCH] 优化PDA功能
---
新建文件夹/PDA/pages/stash/CheckFinish.vue | 8 +
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs | 7 -
新建文件夹/PDA/pages/stash/outboundorderDetail.vue | 76 +++++++++++-------
新建文件夹/PDA/pages/stash/CheckoutorderDetail.vue | 77 +++++++++++++------
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/Business.cs | 58 ++++++++------
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs | 7 +
6 files changed, 145 insertions(+), 88 deletions(-)
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckFinish.vue" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckFinish.vue"
index 3275a7c..7422c9d 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckFinish.vue"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckFinish.vue"
@@ -470,9 +470,15 @@
title: "鐩樼偣鎴愬姛",
type: "success"
})
- this.Inqty=res.message;
+ // this.Inqty=res.message;
// this.order_Inqty="宸插嚭搴撴暟閲忥細"+this.Inqty;
this.barcode="";
+ uni.setStorageSync('checkTask',true);
+ setTimeout(() => {
+ uni.navigateBack({
+ delta: 1
+ });
+ }, 600);
// this.materSn="";
} else {
this.$refs.uToast.show({
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckoutorderDetail.vue" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckoutorderDetail.vue"
index b1db7ea..28c0618 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckoutorderDetail.vue"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckoutorderDetail.vue"
@@ -40,19 +40,29 @@
orderNo: "",
pageNo: 1,
scrollTop: 0,
+ checkTask: false,
warehouseId: ""
}
},
onLoad(res) {
this.warehouseId = res.warehouseId;
this.orderNo = res.orderNo;
- this.allReceivingOrders=res.detail;
- this.page = this.page + "orderNo=" + this.orderNo +"&warehouseId=" + this.warehouseId + "&locationCode=";
+ this.allReceivingOrders = res.detail;
+ this.page = this.page + "orderNo=" + this.orderNo + "&warehouseId=" + this.warehouseId + "&locationCode=";
this.getData();
},
onReachBottom() {
this.pageNo += 1;
this.getData();
+ },
+ onShow() {
+ this.checkTask = uni.getStorageSync('checkTask');
+ if (this.checkTask) {
+ uni.removeStorageSync('checkTask');
+ this.pageNo = 1;
+ // 浠庡叾浠栭〉闈㈣繑鍥炴椂鍒锋柊
+ this.getData();
+ }
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
@@ -72,37 +82,56 @@
locationCode: this.searchValue,
orderNo: this.orderNo,
pageNo: this.pageNo,
- isCheck:true,
+ isCheck: true,
},
}
if (this.pageNo == 1) this.allReceivingOrders = [];
- this.$u.post('/api/DeliveryOrder/GetCheckOutTasks',postData).then((
+ this.$u.post('/api/DeliveryOrder/GetCheckOutTasks', postData).then((
res) => {
- if (res.status) {
- if (res.data.length > 0) {
- if (this.searchValue == '') {
- this.allReceivingOrders = this.allReceivingOrders.concat(res.data);
- // this.allReceivingOrders = res.data;
- if (this.allReceivingOrders.length > 3) {
- this.loadVisible = true;
- } else {
- this.loadVisible = false;
- }
+ if (res.status) {
+ if (res.data.length > 0) {
+ if (this.searchValue == '') {
+ this.allReceivingOrders = this.allReceivingOrders.concat(res.data);
+ // this.allReceivingOrders = res.data;
+ if (this.allReceivingOrders.length > 3) {
+ this.loadVisible = true;
} else {
- this.allReceivingOrders = res.data;
- if (this.allReceivingOrders.length > 3) {
- this.loadVisible = true;
- } else {
- this.loadVisible = false;
- }
+ this.loadVisible = false;
}
} else {
- this.status = 'noMore';
- //this.allReceivingOrders = [];
- this.loadVisible = true;
+ this.allReceivingOrders = res.data;
+ if (this.allReceivingOrders.length > 3) {
+ this.loadVisible = true;
+ } else {
+ this.loadVisible = false;
+ }
+ }
+ } else {
+ this.status = 'noMore';
+ //this.allReceivingOrders = [];
+ this.loadVisible = true;
+ if (this.allReceivingOrders.length < 1) {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '鐩樼偣宸插畬鎴愶紝鏄惁杩斿洖棣栭〉锛�',
+ success: (res) => {
+ if (res.confirm) {
+ // 鐢ㄦ埛鐐瑰嚮纭畾
+ setTimeout(() => {
+ uni.navigateBack({
+ delta: 2
+ });
+ }, 500);
+ } else {
+ // 鐢ㄦ埛鐐瑰嚮鍙栨秷锛屽彲浠ュ仠鐣欏湪褰撳墠椤甸潰
+ // 鎴栬�呮墽琛屽叾浠栨搷浣�
+ }
+ }
+ });
}
}
- })
+ }
+ })
}
}
}
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/outboundorderDetail.vue" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/outboundorderDetail.vue"
index 5c29554..996296a 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/outboundorderDetail.vue"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/outboundorderDetail.vue"
@@ -40,15 +40,15 @@
orderNo: "",
pageNo: 1,
scrollTop: 0,
- outTask:false,
+ outTask: false,
warehouseId: ""
}
},
onLoad(res) {
this.warehouseId = res.warehouseId;
this.orderNo = res.orderNo;
- this.allReceivingOrders=res.detail;
- this.page = this.page + "orderNo=" + this.orderNo +"&warehouseId=" + this.warehouseId + "&locationCode=";
+ this.allReceivingOrders = res.detail;
+ this.page = this.page + "orderNo=" + this.orderNo + "&warehouseId=" + this.warehouseId + "&locationCode=";
this.getData();
},
onReachBottom() {
@@ -59,6 +59,7 @@
this.outTask = uni.getStorageSync('outTask');
if (this.outTask) {
uni.removeStorageSync('outTask');
+ this.pageNo = 1;
// 浠庡叾浠栭〉闈㈣繑鍥炴椂鍒锋柊
this.getData();
}
@@ -120,43 +121,56 @@
locationCode: this.searchValue,
orderNo: this.orderNo,
pageNo: this.pageNo,
- isCheck:false,
+ isCheck: false,
},
}
if (this.pageNo == 1) this.allReceivingOrders = [];
- this.$u.post('/api/DeliveryOrder/GetCheckOutTasks',postData).then((
+ this.$u.post('/api/DeliveryOrder/GetCheckOutTasks', postData).then((
res) => {
- if (res.status) {
- if (res.data.length > 0) {
- if (this.searchValue == '') {
- this.allReceivingOrders = this.allReceivingOrders.concat(res.data);
- // this.allReceivingOrders = res.data;
- if (this.allReceivingOrders.length > 3) {
- this.loadVisible = true;
- } else {
- this.loadVisible = false;
- }
+ if (res.status) {
+ if (res.data.length > 0) {
+ if (this.searchValue == '') {
+ this.allReceivingOrders = this.allReceivingOrders.concat(res.data);
+ // this.allReceivingOrders = res.data;
+ if (this.allReceivingOrders.length > 3) {
+ this.loadVisible = true;
} else {
- this.allReceivingOrders = res.data;
- if (this.allReceivingOrders.length > 3) {
- this.loadVisible = true;
- } else {
- this.loadVisible = false;
- }
+ this.loadVisible = false;
}
} else {
- this.status = 'noMore';
- //this.allReceivingOrders = [];
- this.loadVisible = true;
- uni.setStorageSync('isout',true);
- setTimeout(() => {
- uni.navigateBack({
- delta: 1
- });
- }, 600);
+ this.allReceivingOrders = res.data;
+ if (this.allReceivingOrders.length > 3) {
+ this.loadVisible = true;
+ } else {
+ this.loadVisible = false;
+ }
+ }
+ } else {
+ this.status = 'noMore';
+ //this.allReceivingOrders = [];
+ this.loadVisible = true;
+ if (this.allReceivingOrders.length < 1) {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '鍑哄簱宸插畬鎴愶紝鏄惁杩斿洖棣栭〉锛�',
+ success: (res) => {
+ if (res.confirm) {
+ // 鐢ㄦ埛鐐瑰嚮纭畾
+ setTimeout(() => {
+ uni.navigateBack({
+ delta: 2
+ });
+ }, 500);
+ } else {
+ // 鐢ㄦ埛鐐瑰嚮鍙栨秷锛屽彲浠ュ仠鐣欏湪褰撳墠椤甸潰
+ // 鎴栬�呮墽琛屽叾浠栨搷浣�
+ }
+ }
+ });
}
}
- })
+ }
+ })
}
}
}
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/Business.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/Business.cs"
index f475cd1..b534138 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/Business.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/Business.cs"
@@ -97,20 +97,21 @@
return responseContent.OK("鎵�鏈夊叆搴撳崟宸插瓨鍦紝鏃犻渶鏂板");
}
- _unitOfWorkManage.BeginTran();
- try
- {
- List<Dt_CabinOrder> _CabinOrders = new List<Dt_CabinOrder>();
- //瀛樺偍鍏ュ簱鍗曞彿
- List<string> orderNos = new List<string>();
+ //瀛樺偍鍏ュ簱鍗曞彿
+ List<string> orderNos = new List<string>();
- foreach (var order in newOrders)
+ foreach (var order in newOrders)
+ {
+ try
{
+ _unitOfWorkManage.BeginTran();
if (order.order_type == "1") //姝e父鍏ュ簱
{
responseContent = _cabinOrderServices.CreateInboundOrder(order);
+ if (!responseContent.Status) throw new Exception(responseContent.Message);
List<Dt_CabinOrder>? dt_CabinOrders = responseContent.Data as List<Dt_CabinOrder>;
- if (dt_CabinOrders != null) _CabinOrders.AddRange(dt_CabinOrders);
+ if (dt_CabinOrders != null)
+ _cabinOrderServices.Db.InsertNav(dt_CabinOrders).Include(x => x.Details).ExecuteCommand();
}
else if (order.order_type == "3")//鍏ュ簱閫�鏂�
{
@@ -134,28 +135,30 @@
};
upstramOutOrderInfo.details.Add(detail);
}
- _deliveryOrderServices.CreateOutboundOrder(upstramOutOrderInfo);
+ var content = _deliveryOrderServices.CreateOutboundOrder(upstramOutOrderInfo);
+ if (!content.Status) throw new Exception(content.Message);
#endregion
}
else if (order.order_type == "5")//鎶ユ孩鍏ュ簱
{
- _cabinOrderServices.CreateCheckInOrder(order);
+ var content = _cabinOrderServices.CreateCheckInOrder(order);
+ if (!content.Status) throw new Exception(content.Message);
}
- };
- _cabinOrderServices.Db.InsertNav(_CabinOrders).Include(x => x.Details).ExecuteCommand();
+ _unitOfWorkManage.CommitTran();
+ }
+ catch (Exception ex)
+ {
+ _unitOfWorkManage.RollbackTran();
+ SendErrorToUpstream(1, "", ex.Message, "");
+ return responseContent.Error("鍚屾澶辫触: " + ex.Message);
+ }
+ };
- //鍦ㄤ笅鍙戠粰wcs
- //EdiIn(); //鍙戠粰涓嬫父
- //濡傛灉杩欎釜鏂规硶鎴愬姛浜嗭紝閭d箞灏辫皟鐢–ompleteOrder鎺ュ彛锛岀劧鍚庢敼鍙�
- _unitOfWorkManage.CommitTran();
- return responseContent.OK("鍚屾鍏ュ簱鍗曟垚鍔�");
- }
- catch (Exception ex)
- {
- _unitOfWorkManage.RollbackTran();
- SendErrorToUpstream(1, "", ex.Message, "");
- return responseContent.Error("鍚屾澶辫触: " + ex.Message);
- }
+ //鍦ㄤ笅鍙戠粰wcs
+ //EdiIn(); //鍙戠粰涓嬫父
+ //濡傛灉杩欎釜鏂规硶鎴愬姛浜嗭紝閭d箞灏辫皟鐢–ompleteOrder鎺ュ彛锛岀劧鍚庢敼鍙�
+ return responseContent.OK("鍚屾鍏ュ簱鍗曟垚鍔�");
+
}
catch (Exception ex)
{
@@ -225,7 +228,8 @@
{
if (outorder.order_type == "1") // 姝e父鍑哄簱鍗�
{
- _deliveryOrderServices.CreateOutboundOrder(outorder);//鍒涘缓鍑哄簱鍗曘�佸鐞嗗簱瀛樸�佹坊鍔犲嚭搴撲换鍔�
+ var content = _deliveryOrderServices.CreateOutboundOrder(outorder);
+ if (!content.Status) throw new Exception(content.Message);
}
else if (outorder.order_type == "2")//鍑哄簱閫�璐�
{
@@ -252,6 +256,7 @@
order.details.Add(detail);
}
responseContent = _cabinOrderServices.CreateInboundOrder(order);
+ if (!responseContent.Status) throw new Exception(responseContent.Message);
List<Dt_CabinOrder>? dt_CabinOrders = responseContent.Data as List<Dt_CabinOrder>;
if (dt_CabinOrders != null && dt_CabinOrders.Count > 0)
_cabinOrderServices.Db.InsertNav(dt_CabinOrders).Include(x => x.Details).ExecuteCommand();
@@ -259,7 +264,8 @@
}
else if (outorder.order_type == "6")//鎶ユ崯鍑哄簱
{
- _deliveryOrderServices.CreateCheckOutOrder(outorder);
+ var content = _deliveryOrderServices.CreateCheckOutOrder(outorder);
+ if (!content.Status) throw new Exception(content.Message);
}
}
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs"
index c2c41ea..5c62803 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs"
@@ -858,7 +858,7 @@
Dt_SupplyTask supplyTask = _supplyTaskService.Repository.QueryFirst(x => x.TaskId == TaskId && x.TaskStatus == SupplyStatusEnum.NewOut.ObjToInt());
if (supplyTask == null) throw new Exception("褰撳墠鍑哄簱浠诲姟宸插畬鎴�");
if (supplyTask.LocationCode != LocationCode) throw new Exception($"褰撳墠鍑哄簱璐т綅銆恵LocationCode}銆戜笌浠诲姟鍒嗛厤璐т綅涓嶅尮閰�");
- OutTaskFinish(supplyTask);
+ content = OutTaskFinish(supplyTask);
}
catch (Exception ex)
{
@@ -872,11 +872,10 @@
WebResponseContent content = new WebResponseContent();
try
{
-
- Dt_DeliveryOrder cabinOrder = BaseDal.Db.Queryable<Dt_DeliveryOrder>().Where(x => x.Out_no == supplyTask.OrderNo && x.Warehouse_no == supplyTask.WarehouseCode).Includes(x => x.Details).First();
+ Dt_DeliveryOrder? cabinOrder = BaseDal.Db.Queryable<Dt_DeliveryOrder>().Where(x => x.Out_no == supplyTask.OrderNo && x.Warehouse_no == supplyTask.WarehouseCode).Includes(x => x.Details).First();
if (cabinOrder == null) return WebResponseContent.Instance.Error($"鍑哄簱鍗曞凡瀹屾垚");
- Dt_DeliveryOrderDetail cabinOrderDetail = cabinOrder.Details.Where(x => x.Batch_num == supplyTask.BatchNo && x.Reservoirarea == supplyTask.WarehouseCode && x.Goods_no == supplyTask.MaterielCode).First();
+ Dt_DeliveryOrderDetail? cabinOrderDetail = cabinOrder.Details.Where(x => x.Batch_num == supplyTask.BatchNo && x.Reservoirarea == supplyTask.WarehouseCode && x.Goods_no == supplyTask.MaterielCode).FirstOrDefault();
if (cabinOrderDetail == null) return WebResponseContent.Instance.Error($"鍑哄簱鍗曟槑缁嗗凡瀹屾垚");
Dt_MaterielInfo materielInfo = _basicService.MaterielInfoService.Repository.QueryFirst(x => x.MaterielCode == cabinOrderDetail.Goods_no);
if (materielInfo == null) return WebResponseContent.Instance.Error($"璇风淮鎶ょ墿鏂欑紪鍙枫�恵cabinOrderDetail.Goods_no}銆戠殑鐗╂枡淇℃伅");
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs"
index 4410ea2..eecd900 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs"
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.StockEnum;
@@ -351,7 +352,8 @@
#endregion
#region 澶勭悊鍑哄簱鍗曘�佸簱瀛樹俊鎭�佸嚭搴撲换鍔°�佽皟鎷ㄤ换鍔�
- _deliveryOrderServices.OutTaskFinish(supplyTask);
+ var content = _deliveryOrderServices.OutTaskFinish(supplyTask);
+ if (!content.Status) throw new Exception(content.Message);
#endregion
}
}
@@ -375,7 +377,8 @@
{
supplyTask.SupplyQuantity = supplyTask.StockQuantity;
}
- _deliveryOrderServices.CheckTaskFinish(supplyTask);
+ var content = _deliveryOrderServices.CheckTaskFinish(supplyTask);
+ if (!content.Status) throw new Exception(content.Message);
}
break;
}
--
Gitblit v1.9.3