From 93ec721282fb2ef08d74d5f136809f24fcc9768b Mon Sep 17 00:00:00 2001 From: huanghongfeng <huanghongfeng@hnkhzn.com> Date: 星期六, 11 五月 2024 09:21:19 +0800 Subject: [PATCH] 库位平面图 --- 代码管理/WMS/WMS_Client/src/views/Home.vue | 151 +++++++++++++++++++++++++++++++++++-- 代码管理/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/Partial/dt_stationinfoController.cs | 11 ++ 代码管理/WMS/WMS_Server/WIDESEA_WMS/IServices/system/Partial/Idt_stationinfoService.cs | 1 代码管理/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs | 20 +++++ 4 files changed, 174 insertions(+), 9 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/Home.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/Home.vue" index 21c88a6..d6a97bb 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/Home.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/Home.vue" @@ -1,24 +1,157 @@ <template> - <div class="title">Welcome To WMS!</div> + <div> + <el-button type="success" style="width: 10%;height: 50px;" v-on:click="selList()">鍒锋柊</el-button> + </div> + <div v-for="(index,inst) in datalist.length" :key="inst" style="padding: 10px;"> + <h1 style="border-bottom: 1px dashed silver; padding: 5px;;height: 52px;"> + <span v-if="inst==0">鍙犵洏鍖�</span> + <span v-else-if="inst==1">涓婃枡鍖�</span> + <span v-else-if="inst==2">涓嬫枡鍖�</span> + <span v-else-if="inst==3">澶栧崗鍖�</span> + <span v-else-if="inst==4">鎵樼洏鍙犳斁鍖�</span> + <span v-else>{{inst-3}}搴撳尯</span> + <span style="margin-left: 40px;"> + <el-button circle style="background-color: #409eff;color: #000;">鏈夎揣</el-button> + <el-button circle style="background-color: lightgreen;color: #000;">绌鸿揣浣�</el-button> + <el-button circle style="background-color: yellow;color: #000;">鍑哄叆搴撳崰鐢�</el-button> + <el-button circle style="background-color: red;color: #000;">寮傚父</el-button> + <el-button circle style="background-color: #C0C4CC;color: #000;">绂佺敤</el-button> + </span> + </h1> + <div class="table-container"> + <div class="scrollable-table"> + <table class="one_tal"> + <tr v-for="(item, k) in datalist[inst].item2" :key="k"> + <td v-for="items in filteredItems(datalist[inst].item1, k+1)" :key="items.stationCode" + :style="{ 'background-color': getBackgroundColor(items.enable,items.location_state) }"> + <el-tooltip class="item" effect="dark" placement="right" > + <template #content v-if="items.stationType!=='' && items.bindSN !== '' && items.stationType!==null && items.bindSN !== null"> + <div>鐗╂枡绫诲瀷(鍥惧彿)锛� {{ items.stationType }}</div> + <div>鐐夊彿锛� {{ items.heatNumber }}</div> + <div>杞﹁疆SN鍙凤細{{ items.bindSN }}</div> + </template> + <template #content v-else> + <div>鐩墠鏆傛棤淇℃伅</div> + </template> + <template #content v-if="items.area==11"> + <div>灏忔墭鐩�</div> + <div>鏁伴噺锛歿{ items.quantity }}</div> + </template> + <template #content v-if="items.area==10"> + <div>澶ф墭鐩�</div> + <div>鏁伴噺锛歿{ items.quantity }}</div> + </template> + <template #content v-if="items.area==12"> + <div v-if="item.tray_type=='SmallTray'">灏忔墭鐩�</div> + <div v-else>澶ф墭鐩�</div> + <div>鏁伴噺锛歿{ items.quantity }}</div> + </template> + <div>{{ items.stationCode}}</div> + </el-tooltip> + </td> + </tr> + </table> + </div> + </div> + </div> </template> <script> -import { ref, reactive } from 'vue' - export default { - setup() { + data() { return { + visible: false, + datalist:[] + }; + }, + mounted() { + this.$nextTick(() => { + this.selList(); + }); + }, + methods: { + selList(){ + this.http.post("/api/dt_stationinfo/dt_stationinfolist").then(x => { + this.datalist = x.data; + console.log(this.datalist) + }) + .catch(error => { + console.error('璇锋眰鍑洪敊锛�', error); + }); + }, + getBackgroundColor(enable,locationState) { + + if (enable=='0') { + return '#C0C4CC'; + } + else{ + switch (locationState) { + case 'Stroge': + return '#409eff'; + case 'Empty': + return 'lightgreen'; + case 'InBusy': + return 'yellow'; + case 'OutBusy': + return 'yellow'; + case 'Abnormal': + return 'red'; + default: + return 'transparent'; + } + } + + } + }, + computed: { + filteredItems() { + return (itemList, line) => { + return itemList.filter(item => item.line === line); + }; } } -} +}; </script> <style scoped> -.title { - line-height: 70vh; +.table-container { + overflow-x: auto; +} + +.scrollable-table { + width: 100%; +} + +.one_tal { + margin-top: 10px; + padding: 5px; + white-space: nowrap; + border-spacing: 10px; + padding-right: 500px; +} +.one_tal tr{ + + margin-top: 10px; + margin-bottom: 10px; +} +.one_tal td { + width: 200px; + height: 40px; + background-color: rgb(36, 227, 241); text-align: center; - font-size: 28px; - color: orange; + border-radius: 10px; +} +.table-container::-webkit-scrollbar { + width: 1px; + height: 15px; +} + +.table-container::-webkit-scrollbar-track { + background: transparent; +} + +.table-container::-webkit-scrollbar-thumb { + background-color: #ccc; } </style> \ No newline at end of file diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/IServices/system/Partial/Idt_stationinfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/IServices/system/Partial/Idt_stationinfoService.cs" index 424a750..613f832 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/IServices/system/Partial/Idt_stationinfoService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/IServices/system/Partial/Idt_stationinfoService.cs" @@ -11,5 +11,6 @@ { WebResponseContent SetStationEnable(object parm); WebResponseContent SendAGVTask(object parm); + WebResponseContent dt_stationinfolist(); } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs" index f807711..a7492eb 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs" @@ -23,6 +23,8 @@ using WIDESEA_Core.ManageUser; using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; using static System.Collections.Specialized.BitVector32; +using WIDESEA_Core.EFDbContext; +using WIDESEA_WMS.Repositories; namespace WIDESEA_WMS.Services { @@ -172,5 +174,23 @@ return webResponse; } + + public WebResponseContent dt_stationinfolist() + { + WebResponseContent content = new WebResponseContent(); + VOLContext volContext = new VOLContext(); + Idt_stationinfoRepository dsta = new dt_stationinfoRepository(volContext); + string[] stationCodes = { "DD","S", "X", "W","A", "B", "C", "D01" }; + List<Tuple<List<dt_stationinfo>, int>> responseData = new List<Tuple<List<dt_stationinfo>, int>>(); + foreach (string code in stationCodes) + { + var data = dsta.Find(_ => true).Where(a => a.stationCode.Contains(code)).OrderBy(a => a.stationCode).ToList(); + int inst = dsta.Find(_ => true).Where(a => a.stationCode.Contains(code)).GroupBy(a => a.line).Count(); + responseData.Add(Tuple.Create(data, inst)); + } + content.Data = responseData; + return content; + } + } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/Partial/dt_stationinfoController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/Partial/dt_stationinfoController.cs" index e8241c8..826b2a9 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/Partial/dt_stationinfoController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/Partial/dt_stationinfoController.cs" @@ -52,5 +52,16 @@ { return dt_stationinfoService.Instance.SendAGVTask(parm); } + + /// <summary> + /// 灞曠ず骞抽潰鍥炬暟鎹� + /// </summary> + /// <param name="parm"></param> + /// <returns></returns> + [HttpPost, Route("dt_stationinfolist")] + public object dt_stationinfolist() + { + return dt_stationinfoService.Instance.dt_stationinfolist(); + } } } -- Gitblit v1.9.3