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/DTO/IntentionVisitDTO.cs | 1
zhengcaioa/zhengcaioa/Controllers/Customer/IntentionVisitController.cs | 16 ++++
zhengcaioa/zhengcaioa/Views/IntentionVisit/Edit.cshtml | 57 +++++++++++++------
zhengcaioa/DTO/CooperVisitDTO.cs | 2
zhengcaioa/zhengcaioa/Controllers/Customer/CooperVisitController.cs | 20 ++++++
zhengcaioa/zhengcaioa/Views/CooperVisit/Edit.cshtml | 46 +++++++++-----
6 files changed, 103 insertions(+), 39 deletions(-)
diff --git a/zhengcaioa/DTO/CooperVisitDTO.cs b/zhengcaioa/DTO/CooperVisitDTO.cs
index 7e39880..a5c1d63 100644
--- a/zhengcaioa/DTO/CooperVisitDTO.cs
+++ b/zhengcaioa/DTO/CooperVisitDTO.cs
@@ -12,6 +12,8 @@
public string VisType { get; set; }
public string VisTypeName { get; set; }
public string Viscustomer { get; set; }
+
+ public string ViscustomerName { get; set; }
public string Jtype { get; set; }
public string JtypeName { get; set; }
public string Jdr { get; set; }
diff --git a/zhengcaioa/DTO/IntentionVisitDTO.cs b/zhengcaioa/DTO/IntentionVisitDTO.cs
index a524127..6543abf 100644
--- a/zhengcaioa/DTO/IntentionVisitDTO.cs
+++ b/zhengcaioa/DTO/IntentionVisitDTO.cs
@@ -12,6 +12,7 @@
public string VisType { get; set; }
public string VisTypeName { get; set; }
public string Viscustomer { get; set; }
+ public string ViscustomerName { get; set; }
public string Jtype { get; set; }
public string JtypeName { get; set; }
public string Jdr { get; set; }
diff --git a/zhengcaioa/zhengcaioa/Controllers/Customer/CooperVisitController.cs b/zhengcaioa/zhengcaioa/Controllers/Customer/CooperVisitController.cs
index 478e3ba..e25676f 100644
--- a/zhengcaioa/zhengcaioa/Controllers/Customer/CooperVisitController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/Customer/CooperVisitController.cs
@@ -134,9 +134,25 @@
{
dto.Viscustomer = Viscustomer;
dto.Vistime = DateTime.Now;
+ if (!string.IsNullOrWhiteSpace(Viscustomer))
+ {
+
+ var cooperatecustomCustomerDTO = _cooperatecustomCustomerService.Get(Viscustomer);
+ if (cooperatecustomCustomerDTO != null)
+ {
+ dto.ViscustomerName = cooperatecustomCustomerDTO.Name;
+ }
+ }
}
-
- ViewData["customer"] = _cooperatecustomCustomerService.GetList();
+ if (!string.IsNullOrWhiteSpace(Viscustomer))
+ {
+ ViewData["customer"] = new List<CooperatecustomCustomerDTO>();
+ }
+ else
+ {
+ ViewData["customer"] = _cooperatecustomCustomerService.GetList();
+ }
+
diff --git a/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionVisitController.cs b/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionVisitController.cs
index 9c398df..595188a 100644
--- a/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionVisitController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionVisitController.cs
@@ -149,6 +149,11 @@
if (!string.IsNullOrWhiteSpace(Viscustomer))
{
dto.Viscustomer = Viscustomer;
+ var intentionCustomerDTO = _intentionCustomerService.Get(Viscustomer);
+ if (intentionCustomerDTO != null)
+ {
+ dto.ViscustomerName = intentionCustomerDTO.Name;
+ }
IntentionVisitDTOSearch searchEntity = new IntentionVisitDTOSearch();
searchEntity.page = 1;
searchEntity.rows = 1000;
@@ -173,9 +178,16 @@
}
+ if (!string.IsNullOrWhiteSpace(Viscustomer))
+ {
+ ViewData["customer"] = new List<IntentionCustomerDTO>();
+ }
+ else
+ {
+ ViewData["customer"] = _intentionCustomerService.GetList();
+ }
-
- ViewData["customer"] = _intentionCustomerService.GetList();
+
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; // 鏂板鎿嶄綔
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