优化老厂排程单信息页面(添加物料编号和幅宽的数据显示)
优化老厂排程单信息页面(添加物料编号和幅宽的数据显示)
| | |
| | | |
| | | <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", |
| | |
| | | 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: "å
³èç主表ID(䏿¸¸)", |
| | | 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: [] }, |
| | | }, |
| | |
| | | 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: "å
³èç主表ID(䏿¸¸)", |
| | | 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> |
| | | |
| | | } |
| | | ], |
| | | sortName: "id", |
| | | key: "id", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | |
| | | using SqlSugar; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | 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; } |
| | | } |
| | | } |
| | |
| | | using AutoMapper; |
| | | using AutoMapper; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | using System.Text.RegularExpressions; |
| | | using Microsoft.AspNetCore.Http; |
| | | using HslCommunication; |
| | | using SqlSugar; |
| | | using WIDESEA_Core.Enums; |
| | | |
| | | namespace WIDESEA_OutboundService |
| | | { |
| | |
| | | _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) |
| | | { |
| | | // è·åææè®¢åID |
| | | 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(); |
| | | |
| | | // æè®¢åIDåç» |
| | | 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) |
| | | { |