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/CooperVisit/Edit.cshtml | 46 +++++++++++++++++++++++++++++----------------- 1 files changed, 29 insertions(+), 17 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Views/CooperVisit/Edit.cshtml b/zhengcaioa/zhengcaioa/Views/CooperVisit/Edit.cshtml index 974bbcb..b0baa39 100644 --- a/zhengcaioa/zhengcaioa/Views/CooperVisit/Edit.cshtml +++ b/zhengcaioa/zhengcaioa/Views/CooperVisit/Edit.cshtml @@ -111,27 +111,36 @@ <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> + @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> + } + } - else - { - <option value="@item.Id" hassubinfo="true" selected="selected"> - @item.Name - </option> } - } - } + </select> + } + else + { + @Model.ViscustomerName + <input type="hidden" id="Viscustomer" name="Viscustomer" value="@Model.Viscustomer" /> + } - </select> <input type="hidden" id="Id" name="Id" value="@Model.Id" /> </div> </div> @@ -346,7 +355,10 @@ }; 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