From 03421f49b51b92f675d0bd0cae9d0ba341001b92 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期三, 22 六月 2022 10:50:03 +0800
Subject: [PATCH] #

---
 static/js/utils/DataShow.js |  108 ++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 69 insertions(+), 39 deletions(-)

diff --git a/static/js/utils/DataShow.js b/static/js/utils/DataShow.js
index 8836e97..2ad810e 100644
--- a/static/js/utils/DataShow.js
+++ b/static/js/utils/DataShow.js
@@ -1,46 +1,76 @@
 
-function DataShow(type,no) {
-    this.type=type;
-    this.no=no;
-    this.colRowDistributionChart = null;
-    this.RowDistributionChart = null;
+function DataShow(type, uuid) {
+    this.type = type;
+    this.uuid = uuid;
 }
-DataShow.prototype.showHint=function(){
-    let htmltext='';
-    return htmltext='<p>浠撳簱缂栫爜锛�'+ 12312 +'</p>';
 
-    let dataAnalyze = new DataAnalyze(this.no);
-   if(this.type=='StoreSign'||this.type=='Store')
-   {
-       let store= dataAnalyze.getStore(this.no);
-       htmltext='<p>浠撳簱缂栫爜锛�'+store.No +'</p>';
-       htmltext+='<p>浠撳簱鍚嶇О锛�'+store.Name +'</p>';
-       htmltext+='<p>鎬诲簱瀛橈細'+dataAnalyze.getStoreTotalBin(this.no) +'</p>';
-       htmltext+='<p>宸插崰搴撳瓨锛�'+dataAnalyze.getStoreOccurpyBin(this.no) +'</p>';
-       htmltext+='<p>浠婃棩鍏ュ簱锛�'+dataAnalyze.getStoreTotalBin(this.no) +'</p>';
-       htmltext+='<p>浠婃棩鍑哄簱锛�'+dataAnalyze.getStoreOccurpyBin(this.no) +'</p>';
-       htmltext+='<p1>鎻愮ず锛氬弻鍑诲彲鏌ョ湅璇︾粏淇℃伅</p1>';
-   }
-    else if(this.type=='StoreGroup')
-    {
-        let group= dataAnalyze.getGroup(this.no);
-        htmltext='<p>缂栫爜锛�'+group.No +'</p>';
-        htmltext+='<p>鍚嶇О锛�'+group.Name +'</p>';
-        htmltext+='<p>鎬诲簱瀛橈細'+dataAnalyze.getGroupTotalBin(this.no) +'</p>';
-        htmltext+='<p>宸插崰搴撳瓨锛�'+dataAnalyze.getGroupOccurpyBin(this.no) +'</p>';
-        htmltext+='<p>浠婃棩鍏ュ簱锛�'+dataAnalyze.getGroupTotalBin(this.no) +'</p>';
-        htmltext+='<p>浠婃棩鍑哄簱锛�'+dataAnalyze.getGroupOccurpyBin(this.no) +'</p>';
-        htmltext+='<p1>鎻愮ず锛氬弻鍑诲彲鏌ョ湅璇︾粏淇℃伅</p1>';
+DataShow.prototype.showHint = function(){
+    let htmlText='';
+    switch (this.type) {
+        case 'locNo':
+            htmlText += '<p>搴撲綅缂栧彿锛�'+ this.uuid +'</p>';
+            $.ajax({
+                url: top.baseUrl + '/three/query/loc/detl/v1?locNo=' + this.uuid,
+                type: "GET",
+                async: false,
+                success: function (res) {
+                    if (res.code === 200) {
+                        let data = res.data;
+                        htmlText += '<p>搴撲綅鐘舵�侊細'+ data.locSts +'</p>';
+                        if (data.locDetls) {
+                            for (let locDetl of data.locDetls) {
+                                htmlText += '<p>鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��</p>';
+                                htmlText += '<p>鍟嗗搧缂栧彿锛�'+ locDetl.matnr +'</p>';
+                                htmlText += '<p>鍟嗗搧鍚嶇О锛�'+ locDetl.maktx +'</p>';
+                                if (locDetl.batch) {
+                                    htmlText += '<p>鎵瑰彿锛�'+ locDetl.batch +'</p>';
+                                }
+                                htmlText += '<p>搴撳瓨鏁伴噺锛�'+ locDetl.anfme + "" + (locDetl.unit?locDetl.unit:"") +'</p>';
+                            }
+                        }
+                    } else {
+                        console.error(res.msg);
+                    }
+                }
+            })
+            break
+        case "wrkNo":
+            htmlText+='<p>浠诲姟缂栧彿锛�'+ this.uuid +'</p>';
+            $.ajax({
+                url: top.baseUrl + '/three/query/wrk/detl/v1?wrkNo=' + this.uuid,
+                type: "GET",
+                async: false,
+                success: function (res) {
+                    if (res.code === 200) {
+                        let data = res.data;
+                        htmlText += '<p>浠诲姟鐘舵�侊細'+ data.wrkSts +'</p>';
+                        if (data.sourceLocNo) {
+                            htmlText += '<p>婧愬簱浣嶏細'+ data.sourceLocNo +'</p>';
+                        }
+                        if (data.destLocNo) {
+                            htmlText += '<p>鐩爣搴撲綅锛�'+ data.destLocNo +'</p>';
+                        }
+                        if (data.wrkDetls) {
+                            for (let wrkDetl of data.wrkDetls) {
+                                htmlText += '<p>鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��</p>';
+                                htmlText += '<p>鍟嗗搧缂栧彿锛�'+ wrkDetl.matnr +'</p>';
+                                htmlText += '<p>鍟嗗搧鍚嶇О锛�'+ wrkDetl.maktx +'</p>';
+                                if (wrkDetl.batch) {
+                                    htmlText += '<p>鎵瑰彿锛�'+ wrkDetl.batch +'</p>';
+                                }
+                                htmlText += '<p>浠诲姟鏁伴噺锛�'+ wrkDetl.anfme + "" + (wrkDetl.unit?wrkDetl.unit:"") +'</p>';
+                            }
+                        }
+                    } else {
+                        console.error(res.msg);
+                    }
+                }
+            })
+            break
+        default:
+            break
     }
-    else if(this.type=='StoreGoods')
-    {
-        let bin= dataAnalyze.getBin(this.no);
-        htmltext='<p>缂栫爜锛�'+bin.No +'</p>';
-        htmltext+='<p>鍚嶇О锛�'+bin.Name +'</p>';
-        htmltext+='<p>鏉$爜鍙凤細'+bin.Barcode +'</p>';
-        htmltext+='<p>鐘舵�侊細'+bin.State +'</p>';
-    }
-    return htmltext;
+    return htmlText;
 }
 
 

--
Gitblit v1.9.1