From 65af56af565a47e191aa76ede4a62ab3fd91e789 Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期一, 24 七月 2023 09:10:28 +0800
Subject: [PATCH] 质量巡检添添加优化

---
 igds-core/src/main/java/com/ld/igds/m/view/QualityManager.view.xml |  242 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 170 insertions(+), 72 deletions(-)

diff --git a/igds-core/src/main/java/com/ld/igds/m/view/QualityManager.view.xml b/igds-core/src/main/java/com/ld/igds/m/view/QualityManager.view.xml
index 711df16..1da57df 100644
--- a/igds-core/src/main/java/com/ld/igds/m/view/QualityManager.view.xml
+++ b/igds-core/src/main/java/com/ld/igds/m/view/QualityManager.view.xml
@@ -5,12 +5,11 @@
   <Model>
     <DataType name="dtMain">
       <ClientEvent name="onDataChange">if(arg.property ==&quot;depotId&quot;){&#xD;
-                autoByDepot(arg.newValue);&#xD;
-                }&#xD;
-                if(arg.property ==&quot;foodVariety&quot;){&#xD;
-                checkByFood(arg.newValue);&#xD;
-                }
-            </ClientEvent>
+	autoByDepot(arg.newValue);&#xD;
+}&#xD;
+if(arg.property ==&quot;foodVariety&quot;){&#xD;
+	checkByFood(arg.newValue);&#xD;
+}       </ClientEvent>
       <Property name="creationType">com.ld.igds.models.MQuality</Property>
       <PropertyDef name="id">
         <Property name="label">ID</Property>
@@ -92,20 +91,27 @@
       <PropertyDef name="checkUser">
         <Property name="label">鎵︽牱浜�</Property>
       </PropertyDef>
-      <PropertyDef name="checkNum">
+      <PropertyDef name="ypsl">
         <Property name="label">鏍峰搧鏁伴噺</Property>
-        <Property name="displayFormat">0.0%</Property>
         <Property name="dataType">Double</Property>
+        <Property name="displayFormat">0.## KG</Property>
       </PropertyDef>
       <PropertyDef name="checkTime">
         <Property name="label">鎵︽牱鏃堕棿</Property>
         <Property name="dataType">Date</Property>
       </PropertyDef>
-      <PropertyDef name="checkRepresent">
-        <Property name="label">鏍峰搧浠h〃</Property>
+      <PropertyDef name="dbsl">
+        <Property name="label">鏍峰搧浠h〃鏁伴噺</Property>
+        <Property name="dataType">Double</Property>
+        <Property name="displayFormat">0.## KG</Property>
       </PropertyDef>
-      <PropertyDef name="checkLevel">
+      <PropertyDef name="ypdj">
         <Property name="label">鏍峰搧绛夌骇</Property>
+        <Property name="mapping">
+          <Property name="mapValues">${dorado.getDataProvider(&quot;dicTriggerPR#dicTrigger&quot;).getResult(&quot;FOOD_LEVEL_&quot;)}</Property>
+          <Property name="keyProperty">code</Property>
+          <Property name="valueProperty">name</Property>
+        </Property>
       </PropertyDef>
       <PropertyDef name="normalYear">
         <Property name="label">姝e父瀛樺偍骞撮檺</Property>
@@ -203,6 +209,62 @@
       </PropertyDef>
       <PropertyDef name="remarks">
         <Property name="label">鍖栭獙缁撴灉</Property>
+      </PropertyDef>
+      <PropertyDef name="operaSymbolValue">
+        <Property/>
+      </PropertyDef>
+      <PropertyDef name="operaSymbol">
+        <Property/>
+        <Property name="label">杩愮畻绗﹀彿</Property>
+      </PropertyDef>
+      <PropertyDef name="ruleNum">
+        <Property name="dataType">Double</Property>
+        <Property name="label">鎵i噸绯绘暟</Property>
+      </PropertyDef>
+      <PropertyDef name="ruleAdd">
+        <Property name="dataType">Double</Property>
+        <Property name="label">澧為噸%</Property>
+      </PropertyDef>
+      <PropertyDef name="ruleAddEnd">
+        <Property name="dataType">Double</Property>
+        <Property name="label">澧為噸涓婇檺%</Property>
+      </PropertyDef>
+      <PropertyDef name="ruleReduce">
+        <Property name="dataType">Double</Property>
+        <Property name="label">鎵i噸鍊�%</Property>
+      </PropertyDef>
+      <PropertyDef name="rulePrice">
+        <Property name="dataType">Double</Property>
+        <Property name="label">鎵h垂绯绘暟</Property>
+      </PropertyDef>
+      <PropertyDef name="ruleReducePrice">
+        <Property name="dataType">Double</Property>
+        <Property name="label">鎵h垂</Property>
+      </PropertyDef>
+      <PropertyDef name="addNum">
+        <Property name="dataType">Double</Property>
+        <Property name="label">澧為噸</Property>
+      </PropertyDef>
+      <PropertyDef name="deNum">
+        <Property name="dataType">Double</Property>
+        <Property name="label">鎵i噸</Property>
+      </PropertyDef>
+      <PropertyDef name="addPrice">
+        <Property name="dataType">Double</Property>
+        <Property name="label">澧炰环</Property>
+      </PropertyDef>
+      <PropertyDef name="dePrice">
+        <Property name="dataType">Double</Property>
+        <Property name="label">鎵d环</Property>
+      </PropertyDef>
+      <PropertyDef name="result">
+        <Property/>
+        <Property name="label">妫�楠岀粨鏋�</Property>
+        <Property name="mapping">
+          <Property name="mapValues">${dorado.getDataProvider(&quot;inoutDataPR#triggerResult&quot;).getResult()}</Property>
+          <Property name="keyProperty">code</Property>
+          <Property name="valueProperty">name</Property>
+        </Property>
       </PropertyDef>
     </DataType>
     <DataType name="dataTypeUser">
@@ -337,30 +399,28 @@
   </Model>
   <View layout="padding:5;regionPadding:5">
     <ClientEvent name="onReady">var deptId = window.parent.DEPT_ID;//鐖堕〉闈腑鐨勫垎搴撶紪鐮�&#xD;
-            &#xD;
-            //鏍规嵁浠撳簱鑷姩鍥炲~绮鍝佺锛岀櫥璁帮紝浜у湴鏂�&#xD;
-            autoByDepot = function(depotId){&#xD;
-            view.get(&quot;#ajaxGetDepot&quot;).set(&quot;parameter&quot;,depotId).execute(function(result){&#xD;
-            if(result){&#xD;
-            var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
-            data.set(&quot;foodLocation&quot;,result.foodLocation);&#xD;
-            data.set(&quot;foodLevel&quot;,result.foodLevel);&#xD;
-            data.set(&quot;foodVariety&quot;,result.foodVariety);&#xD;
-            data.set(&quot;foodType&quot;,result.foodType);&#xD;
-            }&#xD;
-            });&#xD;
-            };&#xD;
-            &#xD;
-            //鏍规嵁绮鍝佺鏌ヨ鍖栭獙椤瑰苟鍥炴樉&#xD;
-            checkByFood = function(foodVariety){&#xD;
-            view.get(&quot;#ajaxGetCheck&quot;).set(&quot;parameter&quot;,{foodVariety:foodVariety,deptId:deptId}).execute(function(result){&#xD;
-            if(result){&#xD;
-            var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
-            data.set(&quot;checkItems&quot;,result);&#xD;
-            }&#xD;
-            }); &#xD;
-            };
-        </ClientEvent>
+&#xD;
+//鏍规嵁浠撳簱鑷姩鍥炲~绮鍝佺锛岀櫥璁帮紝浜у湴鏂�&#xD;
+autoByDepot = function(depotId){&#xD;
+   view.get(&quot;#ajaxGetDepot&quot;).set(&quot;parameter&quot;,depotId).execute(function(result){&#xD;
+     if(result){&#xD;
+     var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
+     data.set(&quot;foodLocation&quot;,result.foodLocation);&#xD;
+     data.set(&quot;foodLevel&quot;,result.foodLevel);&#xD;
+     data.set(&quot;foodVariety&quot;,result.foodVariety);&#xD;
+     data.set(&quot;foodType&quot;,result.foodType);&#xD;
+	}&#xD;
+});&#xD;
+};&#xD;
+//鏍规嵁绮鍝佺鏌ヨ鍖栭獙椤瑰苟鍥炴樉&#xD;
+checkByFood = function(foodVariety){&#xD;
+view.get(&quot;#ajaxGetCheck&quot;).set(&quot;parameter&quot;,{foodVariety:foodVariety,deptId:deptId}).execute(function(result){&#xD;
+if(result){&#xD;
+ var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
+ data.set(&quot;checkItems&quot;,result);&#xD;
+	}&#xD;
+  }); &#xD;
+};      </ClientEvent>
     <Property name="packages">font-awesome,css-common</Property>
     <DataSet id="dsMain">
       <Property name="loadMode">lazy</Property>
@@ -474,10 +534,9 @@
       </AutoForm>
       <DataGrid layoutConstraint="center padding:5px">
         <ClientEvent name="onDataRowDoubleClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
-                    if(data){&#xD;
-                    view.get(&quot;#dialogMain&quot;).show();&#xD;
-                    }
-                </ClientEvent>
+if(data){&#xD;
+    view.get(&quot;#dialogMain&quot;).show();&#xD;
+}              </ClientEvent>
         <Property name="dataSet">dsMain</Property>
         <Property name="readOnly">true</Property>
         <RowNumColumn/>
@@ -625,8 +684,8 @@
                 <Editor/>
               </AutoFormElement>
               <AutoFormElement>
-                <Property name="name">checkNum</Property>
-                <Property name="property">checkNum</Property>
+                <Property name="name">ypsl</Property>
+                <Property name="property">ypsl</Property>
                 <Editor/>
               </AutoFormElement>
               <AutoFormElement>
@@ -651,13 +710,13 @@
                 <Editor/>
               </AutoFormElement>
               <AutoFormElement>
-                <Property name="name">checkRepresent</Property>
-                <Property name="property">checkRepresent</Property>
+                <Property name="name">dbsl</Property>
+                <Property name="property">dbsl</Property>
                 <Editor/>
               </AutoFormElement>
               <AutoFormElement>
-                <Property name="name">checkLevel</Property>
-                <Property name="property">checkLevel</Property>
+                <Property name="name">ypdj</Property>
+                <Property name="property">ypdj</Property>
                 <Editor/>
               </AutoFormElement>
               <AutoFormElement>
@@ -697,51 +756,90 @@
           <Buttons/>
           <Children>
             <DataGrid id="dataGridCheckItem">
+              <ClientEvent name="onCellValueEdit">var data = arg.entity&#xD;
+if (data) {&#xD;
+	//濉啓鐨勬暟鎹��;&#xD;
+	var newValue = data.get(&quot;value&quot;);&#xD;
+	//鏍囧噯鍊�;&#xD;
+	var limit = data.get(&quot;upperLimit&quot;);&#xD;
+	//杩愮畻绗�;&#xD;
+	var symbol = data.get(&quot;operaSymbol&quot;);&#xD;
+	if (symbol &amp;&amp; limit &amp;&amp; newValue) {&#xD;
+		if (&quot;>=&quot; == symbol) {&#xD;
+			if (newValue &lt; limit) {&#xD;
+				data.set(&quot;result&quot;, &quot;0&quot;);&#xD;
+			}&#xD;
+			else {&#xD;
+				data.set(&quot;result&quot;, &quot;1&quot;);&#xD;
+			}&#xD;
+		}&#xD;
+		if (&quot;&lt;=&quot; == symbol) {&#xD;
+			if (newValue > limit) {&#xD;
+				data.set(&quot;result&quot;, &quot;0&quot;);&#xD;
+			}&#xD;
+			else {&#xD;
+				data.set(&quot;result&quot;, &quot;1&quot;);&#xD;
+			}&#xD;
+		}&#xD;
+		if (&quot;==&quot; == symbol) {&#xD;
+			if (newValue != limit) {&#xD;
+				data.set(&quot;result&quot;, &quot;0&quot;);&#xD;
+			}&#xD;
+			else {&#xD;
+				data.set(&quot;result&quot;, &quot;1&quot;);&#xD;
+			}&#xD;
+		}&#xD;
+	}&#xD;
+}</ClientEvent>
               <Property name="dataPath">#.checkItems</Property>
               <Property name="dataSet">dsMain</Property>
               <Property name="hideMode">display</Property>
               <Property name="highlightCurrentRow">false</Property>
               <Property name="visible">true</Property>
               <RowNumColumn/>
-              <DataColumn>
-                <Property name="name">standardName</Property>
+              <DataColumn name="standardName">
                 <Property name="property">standardName</Property>
                 <Property name="align">center</Property>
-                <Property name="readOnly">true</Property>
-                <Editor/>
               </DataColumn>
-              <DataColumn>
-                <Property name="name">value</Property>
+              <DataColumn name="value">
                 <Property name="property">value</Property>
                 <Property name="align">center</Property>
-                <Editor/>
               </DataColumn>
-              <DataColumn>
-                <Property name="name">upperLimit</Property>
-                <Property name="property">upperLimit</Property>
-                <Property name="align">center</Property>
-                <Property name="readOnly">true</Property>
-                <Editor/>
-              </DataColumn>
-              <DataColumn>
-                <Property name="name">lowerLimit</Property>
-                <Property name="property">lowerLimit</Property>
-                <Property name="align">center</Property>
-                <Property name="readOnly">true</Property>
-                <Editor/>
-              </DataColumn>
-              <DataColumn>
-                <Property name="name">unit</Property>
+              <DataColumn name="unit">
                 <Property name="property">unit</Property>
                 <Property name="align">center</Property>
                 <Property name="readOnly">true</Property>
-                <Editor/>
               </DataColumn>
-              <DataColumn>
-                <Property name="name">remarks</Property>
+              <DataColumn name="operaSymbolValue">
+                <Property name="property">operaSymbolValue</Property>
+                <Property name="align">center</Property>
+                <Property name="caption">鏍囧噯鍊�</Property>
+                <Property name="readOnly">true</Property>
+              </DataColumn>
+              <DataColumn name="deNum">
+                <Property name="property">deNum</Property>
+                <Property name="align">center</Property>
+              </DataColumn>
+              <DataColumn name="addNum">
+                <Property name="property">addNum</Property>
+                <Property name="align">center</Property>
+              </DataColumn>
+              <DataColumn name="dePrice">
+                <Property name="property">dePrice</Property>
+                <Property name="align">center</Property>
+              </DataColumn>
+              <DataColumn name="addPrice">
+                <Property name="property">addPrice</Property>
+                <Property name="align">center</Property>
+              </DataColumn>
+              <DataColumn name="result">
+                <Property name="property">result</Property>
+                <Property name="align">center</Property>
+                <Property name="readOnly">true</Property>
+              </DataColumn>
+              <DataColumn name="remarks">
                 <Property name="property">remarks</Property>
                 <Property name="align">center</Property>
-                <Editor/>
               </DataColumn>
             </DataGrid>
           </Children>

--
Gitblit v1.9.3