From 34ecc6cc18bb3398064df1d4f3c7ced3ce20ac3e Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期二, 05 一月 2021 15:26:50 +0800
Subject: [PATCH] 代码上传

---
 src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs |   47 ++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 36 insertions(+), 11 deletions(-)

diff --git a/src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs b/src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs
index 2286bd4..106122c 100644
--- a/src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs
+++ b/src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs
@@ -1,18 +1,14 @@
-锘縰sing Kingdee.BOS.App.Data;
-using Kingdee.BOS.Core.DynamicForm;
+锘縰sing Kingdee.BOS.Core.DynamicForm;
 using Kingdee.BOS.Core.DynamicForm.PlugIn;
-using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
-using Kingdee.BOS.Core.Metadata.EntityElement;
 using Kingdee.BOS.Orm.DataEntity;
 using Kingdee.BOS.Util;
 using System;
-using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
-using System.Linq;
-using System.Text;
 using Kingdee.BOS.ServiceHelper;
-using System.Threading.Tasks;
+using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
+using Kingdee.BOS.Core.Metadata.EntityElement;
+using Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel;
 
 namespace Demo.BillView
 {
@@ -27,6 +23,7 @@
             if (this.View.OpenParameter.GetCustomParameter("FHMainICMOInterID") == null)
             {
                 SearchList();
+                ChangeColor();
             }
             else
             {
@@ -49,6 +46,7 @@
                         this.Model.SetValue("FLackCount", dt.Rows[i]["FLackCount"], i);//缂烘枡鏁伴噺  
                         this.Model.SetValue("FPassableCount", dt.Rows[i]["FHLeftQty"].ToString(), i);//鍙敤鏁伴噺   
                         this.Model.SetValue("FMateralCount", dt.Rows[i]["FHStockQty"].ToString(), i);//鐗╂枡鏁伴噺   
+                        this.Model.SetValue("FOccupyCount", dt.Rows[i]["FOccupyCount"].ToString(), i);//鍗犵敤鏁伴噺   
                         this.Model.SetValue("FCompleteDetailStatus", dt.Rows[i]["FComPlete"].ToString(), i);//鏄惁榻愬   
                         this.Model.SetValue("FHMainICMOInterIDr", dt.Rows[i]["FHMainICMOInterIDr"].ToString(), i);//鐢熶骇璁㈠崟鍐呯爜   
                         this.Model.SetValue("FPRDBillNo", dt.Rows[i]["FPRDBillNo"].ToString(), i);//鐢熶骇璁㈠崟鍐呯爜   
@@ -58,15 +56,35 @@
                         this.Model.SetValue("FOwnerId", dt.Rows[i]["FOwnerId"], i);//璐т富 
                     }
                 }
-                did = true;
+
+                ChangeColor();
+                 did = true;
             }
         }
+
+        private void ChangeColor() {
+            Entity entity = this.View.BillBusinessInfo.GetEntity("FEntity");
+            //鍗曟嵁浣撲俊鎭浆鎹负鍒楄〃闆嗗悎
+            DynamicObjectCollection entityDataObjoct = this.View.Model.GetEntityDataObject(entity);
+            EntryGrid grid = this.View.GetControl<EntryGrid>("FEntity");
+            int _i = 0;
+            foreach (DynamicObject current in entityDataObjoct)
+            {
+                if (Convert.ToString(current["FCompleteDetailStatus"]) == "鏈綈濂�")
+                {
+                    grid.SetRowBackcolor("#FF0000", _i);
+                }
+                _i++;
+            }
+        }
+       
         public override void BarItemClick(BarItemClickEventArgs e)
         {
             base.BarItemClick(e);
             if (e.BarItemKey.ToUpper() == "TBFILTER")
             {
                 SearchList();
+                ChangeColor();
             }
         }
         /// <summary>
@@ -120,7 +138,13 @@
             sql += sqlwhere;
             sql += "order by FPlanDate, FHStockQty desc ,FHMaterID";
             DataTable dt = DBServiceHelper.ExecuteDataSet(this.Context, sql).Tables[0];
-            this.Model.DeleteEntryData("FEntity");
+            //this.Model.DeleteEntryData("FEntity");
+            while (this.Model.GetEntryRowCount("FEntity") > 0)
+            {
+                this.Model.DeleteEntryRow("FEntity", 0);
+            }
+            //this.View.Refresh();
+
             if (dt.Rows.Count > 0)
             {
                 for (int i = 0; i < dt.Rows.Count; i++)
@@ -142,7 +166,8 @@
                     this.Model.SetValue("FOwnerId", dt.Rows[i]["FOwnerId"], i);//璐т富 
                 }
             }
-            this.View.UpdateView();
+
+            //this.View.UpdateView();
             did = true;
         }
     }

--
Gitblit v1.9.1