From 7583978e1c6046b4cdfe9e1a18efd328a3b73e5d Mon Sep 17 00:00:00 2001
From: liulijun <liulijun@hnkhzn.com>
Date: 星期二, 10 三月 2026 17:26:22 +0800
Subject: [PATCH] 优化老厂排程单信息页面(添加物料编号和幅宽的数据显示)
---
项目代码/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs | 26 +-
项目代码/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs | 49 ++++
项目代码/WMS/WMSClient/src/views/outbound/outSGOrder.vue | 495 ++++++++++++++++++++++++------------------------
3 files changed, 310 insertions(+), 260 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrder.vue"
index 0e7cd71..b8d9f4c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrder.vue"
@@ -1,71 +1,137 @@
-
<template>
- <view-grid
- ref="grid"
- :columns="columns"
- :detail="detail"
- :editFormFields="editFormFields"
- :editFormOptions="editFormOptions"
- :searchFormFields="searchFormFields"
- :searchFormOptions="searchFormOptions"
- :table="table"
- :extend="extend"
- >
- </view-grid>
- </template>
- <script>
- import extend from "@/extension/outbound/outSGOrder.js";
- import { ref, defineComponent } from "vue";
- export default defineComponent({
- setup() {
- const table = ref({
- key: "id",
- footer: "Foots",
- cnName: "鐢熺鎺掔▼鍗�",
- name: "outSGOrder",
- url: "/OutSGOrder/",
- sortName: "id",
- });
- const editFormFields = ref({
- boardMpsNo:""
- });
- const editFormOptions = ref([
- [
- {
- field: "boardMpsNo",
- title: "鍗曟嵁缂栧彿",
- type: "string",
- readonly:true
- }
- ],
- ]);
- const searchFormFields = ref({
- outSGOrderNo: "",
- boardMpsId: "",
- orderId: "",
- outSGOrderStatus: "",
- warehouseId: "",
- shortName: "",
- });
- const searchFormOptions = ref([
- [
- { title: "WMS鍗曞彿", field: "outSGOrderNo", type: "like" },
- { title: "鍑哄簱涓婃父ID", field: "boardMpsId", type: "like" },
- { title: "涓婃父鐢熶骇鍗曞彿", field: "orderId", type: "like" },
- {
- title: "鍗曟嵁鐘舵��",
- field: "outSGOrderStatus",
- type: "select",
- dataKey: "outboundStatusEnum",
- data: [],
- },
- ],
- [
- { title: "浠撳簱", field: "warehouseId",type: "selectList",dataKey: "warehouses",data: [],},
- { title: "瀹㈡埛绠�绉�", field: "shortName", type: "like" },
- ],
- ]);
- const columns = ref([
+ <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
+ :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
+ :table="table" :extend="extend">
+ </view-grid>
+</template>
+<script>
+import extend from "@/extension/outbound/outSGOrder.js";
+import { ref, defineComponent } from "vue";
+export default defineComponent({
+ setup() {
+ const table = ref({
+ key: "id",
+ footer: "Foots",
+ cnName: "鐢熺鎺掔▼鍗�",
+ name: "outSGOrder",
+ url: "/OutSGOrder/",
+ sortName: "id",
+ });
+ const editFormFields = ref({
+ boardMpsNo: ""
+ });
+ const editFormOptions = ref([
+ [
+ {
+ field: "boardMpsNo",
+ title: "鍗曟嵁缂栧彿",
+ type: "string",
+ readonly: true
+ }
+ ],
+ ]);
+ const searchFormFields = ref({
+ outSGOrderNo: "",
+ boardMpsId: "",
+ orderId: "",
+ outSGOrderStatus: "",
+ warehouseId: "",
+ shortName: "",
+ });
+ const searchFormOptions = ref([
+ [
+ { title: "WMS鍗曞彿", field: "outSGOrderNo", type: "like" },
+ { title: "鍑哄簱涓婃父ID", field: "boardMpsId", type: "like" },
+ { title: "涓婃父鐢熶骇鍗曞彿", field: "orderId", type: "like" },
+ {
+ title: "鍗曟嵁鐘舵��",
+ field: "outSGOrderStatus",
+ type: "select",
+ dataKey: "outboundStatusEnum",
+ data: [],
+ },
+ ],
+ [
+ { title: "浠撳簱", field: "warehouseId", type: "selectList", dataKey: "warehouses", data: [], },
+ { title: "瀹㈡埛绠�绉�", field: "shortName", type: "like" },
+ ],
+ ]);
+ const columns = ref([
+ {
+ field: "id",
+ title: "Id",
+ type: "int",
+ width: 90,
+ hidden: true,
+ readonly: true,
+ require: true,
+ align: "left",
+ },
+ {
+ field: "warehouseId",
+ title: "浠撳簱",
+ type: "string",
+ width: 90,
+ align: "left",
+ bind: { key: "warehouses", data: [] }
+ },
+ {
+ field: "outSGOrderNo",
+ title: "WMS鍗曞彿",
+ type: "string",
+ width: 160,
+ align: "left",
+ // link: true,
+ },
+ {
+ field: "boardMpsId",
+ title: "涓婃父鍗曟嵁ID",
+ type: "int",
+ width: 160,
+ align: "left",
+ // link: true,
+ },
+ {
+ field: "orderId",
+ title: "涓婃父鐢熶骇鍗曞彿",
+ type: "string",
+ width: 160,
+ align: "left",
+ },
+ {
+ field: "shortName",
+ title: "瀹㈡埛绠�绉�",
+ type: "string",
+ width: 90,
+ align: "left",
+ },
+ {
+ field: "outSGOrderStatus",
+ title: "鍑哄簱鍗曠姸鎬�",
+ type: "string",
+ width: 110,
+ align: "left",
+ bind: { key: "outboundStatusEnum", data: [] },
+ },
+ {
+ field: "createDate",
+ title: "鍒涘缓鏃堕棿",
+ type: "datetime",
+ width: 160,
+ align: "left",
+ },
+ {
+ field: "materialNoWidth",
+ title: "鐗╂枡缂栧彿锛堝箙瀹斤級",
+ type: "string",
+ width: 160,
+ align: "left",
+ },
+ ]);
+ const detail = ref({
+ cnName: "鍑哄簱鏄庣粏鍗�",
+ table: "OutSGOrderDetail",
+ columns: [
{
field: "id",
title: "Id",
@@ -77,48 +143,114 @@
align: "left",
},
{
- field: "warehouseId",
- title: "浠撳簱",
+ field: "outSGOrderId",
+ title: "鍑哄簱鍗曚富閿�",
type: "string",
width: 90,
align: "left",
- bind:{key: "warehouses", data: []}
- },
- {
- field: "outSGOrderNo",
- title: "WMS鍗曞彿",
- type: "string",
- width: 160,
- align: "left",
- // link: true,
+ hidden: true,
},
{
field: "boardMpsId",
- title: "涓婃父鍗曟嵁ID",
- type: "int",
- width: 160,
- align: "left",
- // link: true,
- },
- {
- field: "orderId",
- title: "涓婃父鐢熶骇鍗曞彿",
- type: "string",
- width: 160,
- align: "left",
- },
- {
- field: "shortName",
- title: "瀹㈡埛绠�绉�",
+ title: "鍏宠仈鐨勪富琛↖D(涓婃父)",
type: "string",
width: 90,
align: "left",
},
{
- field: "outSGOrderStatus",
- title: "鍑哄簱鍗曠姸鎬�",
+ field: "boardMpsDetailId",
+ title: "鍏宠仈鏄庣粏ID(涓婃父)",
+ type: "string",
+ width: 90,
+ align: "left",
+ },
+ {
+ field: "materialNo",
+ title: "鐗╂枡缂栧彿",
+ type: "string",
+ width: 150,
+ align: "left",
+ edit: { type: "string" },
+ required: true,
+ },
+ {
+ field: "materielName",
+ title: "鐗╂枡鍚嶇О",
+ type: "string",
+ width: 150,
+ align: "left",
+ edit: { type: "string" },
+ },
+ {
+ field: "boardFluteNo",
+ title: "妤炲埆",
type: "string",
width: 110,
+ align: "left",
+ edit: { type: "string" },
+ },
+ {
+ field: "machineName",
+ title: "鏈哄彴浣�",
+ type: "string",
+ width: 110,
+ align: "left",
+ edit: { type: "string" },
+ required: true,
+ },
+ {
+ field: "width",
+ title: "骞呭",
+ type: "string",
+ width: 110,
+ align: "left",
+ edit: { type: "string" },
+ required: true,
+ },
+ {
+ field: "xqLen",
+ title: "闇�姹傞暱搴�",
+ type: "string",
+ width: 110,
+ align: "left",
+ edit: { type: "number" },
+ required: true,
+ },
+ {
+ field: "totalUsage",
+ title: "鎬荤敤閲�",
+ type: "string",
+ width: 90,
+ align: "left",
+ edit: { type: "number" },
+ required: true,
+ },
+ {
+ field: "procurementLength",
+ title: "閲囪喘闀垮害",
+ type: "string",
+ width: 110,
+ align: "left",
+ },
+ {
+ field: "assignTotalUsage",
+ title: "宸插垎閰嶇敤閲�",
+ type: "string",
+ width: 110,
+ align: "left",
+ },
+ {
+ field: "outTotalUsage",
+ title: "宸插嚭鐢ㄩ噺",
+ type: "string",
+ width: 110,
+ align: "left",
+ },
+ {
+ field: "outBSTOrderDetailStatus",
+ title: "璁㈠崟鏄庣粏鐘舵��",
+ type: "string",
+ width: 180,
align: "left",
bind: { key: "outboundStatusEnum", data: [] },
},
@@ -128,156 +260,21 @@
type: "datetime",
width: 160,
align: "left",
- },
- ]);
- const detail = ref({
- cnName: "鍑哄簱鏄庣粏鍗�",
- table: "OutSGOrderDetail",
- columns: [
- {
- field: "id",
- title: "Id",
- type: "int",
- width: 90,
- hidden: true,
- readonly: true,
- require: true,
- align: "left",
- },
- {
- field: "outSGOrderId",
- title: "鍑哄簱鍗曚富閿�",
- type: "string",
- width: 90,
- align: "left",
- hidden: true,
- },
- {
- field: "boardMpsId",
- title: "鍏宠仈鐨勪富琛↖D(涓婃父)",
- type: "string",
- width: 90,
- align: "left",
- },
- {
- field: "boardMpsDetailId",
- title: "鍏宠仈鏄庣粏ID(涓婃父)",
- type: "string",
- width: 90,
- align: "left",
- },
- {
- field: "materialNo",
- title: "鐗╂枡缂栧彿",
- type: "string",
- width: 150,
- align: "left",
- edit: { type: "string" },
- required: true,
- },
- {
- field: "materielName",
- title: "鐗╂枡鍚嶇О",
- type: "string",
- width: 150,
- align: "left",
- edit: { type: "string" },
- },
- {
- field: "boardFluteNo",
- title: "妤炲埆",
- type: "string",
- width: 110,
- align: "left",
- edit: { type: "string" },
- },
- {
- field: "machineName",
- title: "鏈哄彴浣�",
- type: "string",
- width: 110,
- align: "left",
- edit: { type: "string" },
- required: true,
- },
- {
- field: "width",
- title: "骞呭",
- type: "string",
- width: 110,
- align: "left",
- edit: { type: "string" },
- required: true,
- },
- {
- field: "xqLen",
- title: "闇�姹傞暱搴�",
- type: "string",
- width: 110,
- align: "left",
- edit: { type: "number" },
- required: true,
- },
- {
- field: "totalUsage",
- title: "鎬荤敤閲�",
- type: "string",
- width: 90,
- align: "left",
- edit: { type: "number" },
- required: true,
- },
- {
- field: "procurementLength",
- title: "閲囪喘闀垮害",
- type: "string",
- width: 110,
- align: "left",
- },
- {
- field: "assignTotalUsage",
- title: "宸插垎閰嶇敤閲�",
- type: "string",
- width: 110,
- align: "left",
- },
- {
- field: "outTotalUsage",
- title: "宸插嚭鐢ㄩ噺",
- type: "string",
- width: 110,
- align: "left",
- },
- {
- field: "outBSTOrderDetailStatus",
- title: "璁㈠崟鏄庣粏鐘舵��",
- type: "string",
- width: 180,
- align: "left",
- bind: { key: "outboundStatusEnum", data: [] },
- },
- {
- field: "createDate",
- title: "鍒涘缓鏃堕棿",
- type: "datetime",
- width: 160,
- align: "left",
- }
- ],
- sortName: "id",
- key: "id",
- });
- return {
- table,
- extend,
- editFormFields,
- editFormOptions,
- searchFormFields,
- searchFormOptions,
- columns,
- detail,
- };
- },
- });
- </script>
-
\ No newline at end of file
+ }
+ ],
+ sortName: "id",
+ key: "id",
+ });
+ return {
+ table,
+ extend,
+ editFormFields,
+ editFormOptions,
+ searchFormFields,
+ searchFormOptions,
+ columns,
+ detail,
+ };
+ },
+});
+</script>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs"
index 60d83f3..7e0d6be 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs"
@@ -1,4 +1,4 @@
-锘縰sing SqlSugar;
+using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -67,15 +67,21 @@
public int OutSGOrderStatus { get; set; }
/// <summary>
- /// 澶囨敞
- /// </summary>
- [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")]
- public string Remark { get; set; }
+ /// 澶囨敞
+ /// </summary>
+ [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")]
+ public string Remark { get; set; }
- /// <summary>
- /// 閲囪喘鍒楄〃
- /// </summary>
- [Navigate(NavigateType.OneToMany, nameof(Dt_OutSGOrderDetail.OutSGOrderId), nameof(Id))]
- public List<Dt_OutSGOrderDetail> Details { get; set; }
+ /// <summary>
+ /// 鐗╂枡缂栧彿锛堝箙瀹斤級
+ /// </summary>
+ [SugarColumn(IsIgnore = true, ColumnDescription = "鐗╂枡缂栧彿锛堝箙瀹斤級")]
+ public string MaterialNoWidth { get; set; }
+
+ /// <summary>
+ /// 閲囪喘鍒楄〃
+ /// </summary>
+ [Navigate(NavigateType.OneToMany, nameof(Dt_OutSGOrderDetail.OutSGOrderId), nameof(Id))]
+ public List<Dt_OutSGOrderDetail> Details { get; set; }
}
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs"
index 14554e5..4c9f433 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs"
@@ -1,4 +1,4 @@
-锘縰sing AutoMapper;
+using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -23,6 +23,8 @@
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Http;
using HslCommunication;
+using SqlSugar;
+using WIDESEA_Core.Enums;
namespace WIDESEA_OutboundService
{
@@ -45,6 +47,51 @@
_mapper = mapper;
_unitOfWorkManage = unitOfWorkManage;
}
+
+ public override PageGridData<Dt_OutSGOrder> GetPageData(PageDataOptions options)
+ {
+ // 1. 璋冪敤鍩虹被鏂规硶鑾峰彇鍒嗛〉鏁版嵁
+ PageGridData<Dt_OutSGOrder> pageData = base.GetPageData(options);
+
+ // 2. 濡傛灉鏈夋暟鎹紝澶勭悊姣忎釜璁㈠崟鐨勭墿鏂欑紪鍙峰拰骞呭
+ if (pageData.Rows != null && pageData.Rows.Count > 0)
+ {
+ // 鑾峰彇鎵�鏈夎鍗旾D
+ var orderIds = pageData.Rows.Select(o => o.Id).ToList();
+
+ // 鎵归噺鏌ヨ鎵�鏈夊叧鑱旂殑鏄庣粏锛岃繃婊ゆ帀鐗╂枡缂栧彿涓虹┖鐨勬暟鎹�
+ var allDetails = BaseDal.Db.Queryable<Dt_OutSGOrderDetail>()
+ .Where(d => orderIds.Contains(d.OutSGOrderId) && !string.IsNullOrEmpty(d.MaterialNo))
+ .ToList();
+
+ // 鎸夎鍗旾D鍒嗙粍
+ var detailsByOrderId = allDetails.GroupBy(d => d.OutSGOrderId).ToDictionary(g => g.Key, g => g.ToList());
+
+ // 澶勭悊姣忎釜璁㈠崟
+ foreach (var order in pageData.Rows)
+ {
+ if (detailsByOrderId.TryGetValue(order.Id, out var details))
+ {
+ // 鎸夌墿鏂欑紪鍙峰拰骞呭鐨勭粍鍚堝垎缁勶細鑻ョ墿鏂欎唬鐮佺浉鍚屼絾骞呭涓嶅悓锛屼細琚垎鎴愪笉鍚岀殑缁�
+ var materialGroups = details
+ .GroupBy(d => new {
+ MaterialNo = d.MaterialNo,
+ Width = d.Width
+ })
+ .Select(g => $"{g.Key.MaterialNo}({g.Key.Width})").ToList();
+
+ // 灏嗗垎缁勭粨鏋滃悎骞朵负涓�涓瓧绗︿覆锛屽涓粍涔嬮棿鐢ㄩ�楀彿鍒嗛殧
+ order.MaterialNoWidth = string.Join(",", materialGroups);
+ }
+ else
+ {
+ order.MaterialNoWidth = "";
+ }
+ }
+ }
+
+ return pageData;
+ }
public WebResponseContent AddOutSGOrder(List<SGOutOrderDTO> outOrderDTOs)
{
--
Gitblit v1.9.3