From d4f1d60996bcec152e100b231c37589270c5fae6 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期三, 21 九月 2022 09:07:10 +0800
Subject: [PATCH] 优化拜访客户

---
 zhengcaioa/zhengcaioa/Views/IntentionVisit/Edit.cshtml |   57 +++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 39 insertions(+), 18 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Views/IntentionVisit/Edit.cshtml b/zhengcaioa/zhengcaioa/Views/IntentionVisit/Edit.cshtml
index 2619500..52d436f 100644
--- a/zhengcaioa/zhengcaioa/Views/IntentionVisit/Edit.cshtml
+++ b/zhengcaioa/zhengcaioa/Views/IntentionVisit/Edit.cshtml
@@ -135,27 +135,43 @@
 
                                     <label class="text-right col-sm-1 col-md-1 control-label">鎰忓悜瀹㈡埛<i class="red">*</i></label>
                                     <div class="col-sm-2 col-md-2">
-                                        <select id="Viscustomer" class="form-control" name="Viscustomer" data-placeholder="閫夋嫨 搴忓垪 ..." style="font-weight:normal;">
-                                            <option value="" hassubinfo="true">璇烽�夋嫨</option>
-                                            @foreach (var item in customer)
-                                            {
-                                                @if (!item.Id.Equals(Model.Viscustomer))
+                                        @if (customer.Count > 0)
+                                        {
+                                            <select id="Viscustomer" class="form-control" name="Viscustomer" data-placeholder="閫夋嫨 搴忓垪 ..." style="font-weight:normal;">
+                                                <option value="" hassubinfo="true">璇烽�夋嫨</option>
+                                                @foreach (var item in customer)
                                                 {
-                                                    <option value="@item.Id" hassubinfo="true">
-                                                        @item.Name
-                                                    </option>
-                                                }
-                                                else
-                                                {
-                                                    <option value="@item.Id" hassubinfo="true" selected="selected">
-                                                        @item.Name
-                                                    </option>
+                                                    @if (!item.Id.Equals(Model.Viscustomer))
+                                                    {
+                                                        <option value="@item.Id" hassubinfo="true">
+                                                            @item.Name
+                                                        </option>
+                                                    }
+                                                    else
+                                                    {
+                                                        <option value="@item.Id" hassubinfo="true" selected="selected">
+                                                            @item.Name
+                                                        </option>
+                                                    }
+
                                                 }
 
-                                            }
-                                            }
 
-                                        </select>
+
+                                                }
+
+                                            </select>
+                                        }
+                                        else
+                                        {
+                                            @Model.ViscustomerName
+                                            <input type="hidden" id="Viscustomer" name="Viscustomer" value="@Model.Viscustomer" />
+                                        }
+
+
+
+
+
                                         <input type="hidden" id="Id" name="Id" value="@Model.Id" />
                                         <input type="hidden" id="IsYwjl" name="IsYwjl" value="@IsYwjl" />
                                     </div>
@@ -444,7 +460,12 @@
         };
 
         laydate({ elem: "#Vistime", format: 'YYYY/MM/DD', istime: true, event: "focus" });
-        $("#Viscustomer").chosen();
+
+            if ( @customer.Count > 0)
+            {
+  $("#Viscustomer").chosen();
+            }
+
         var id = '@Model.Id';
         var bUpload = false;
         var bAdd = false; // 鏂板鎿嶄綔

--
Gitblit v1.9.1