Commit 8518a62d527c12f7857dbdf998faf635c1ed1b0d

Authored by 唐召明
1 parent 53b7be59

项目客户页面新增数据自动生成用户账号

sys/Hh.Mes.POJO/WebEntity/configure/base_client_info.cs
... ... @@ -11,69 +11,72 @@ namespace Hh.Mes.POJO.Entity
11 11 /// </summary>
12 12 [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
13 13 public int id { get; set; }
14   -
  14 +
15 15 [SugarColumn(IsNullable = false)]
16 16 public Guid keys { get; set; }
17   -
  17 +
  18 + [SugarColumn(IsIgnore = true)]
  19 + public string userAccount { get; set; }
  20 +
18 21 /// <summary>
19 22 /// 客户名称
20 23 /// </summary>
21 24 [SugarColumn(Length = 20, ColumnDescription = "客户名称", IsNullable = false)]
22 25 public string clientName { get; set; }
23   -
  26 +
24 27 /// <summary>
25 28 /// 法定代表人
26 29 /// </summary>
27 30 [SugarColumn(Length = 20, ColumnDescription = "法定代表人", IsNullable = true)]
28 31 public string legalRepresentative { get; set; }
29   -
  32 +
30 33 /// <summary>
31 34 /// 统一社会信用代码
32 35 /// </summary>
33 36 [SugarColumn(Length = 50, ColumnDescription = "统一社会信用代码", IsNullable = true)]
34 37 public string unifiedSocialCreditCode { get; set; }
35   -
  38 +
36 39 /// <summary>
37 40 /// 工商注册号
38 41 /// </summary>
39 42 [SugarColumn(Length = 50, ColumnDescription = "工商注册号", IsNullable = true)]
40 43 public string businessRegistrationCode { get; set; }
41   -
  44 +
42 45 /// <summary>
43 46 /// 电话
44 47 /// </summary>
45 48 [SugarColumn(Length = 20, ColumnDescription = "电话", IsNullable = true)]
46 49 public string telephone { get; set; }
47   -
  50 +
48 51 /// <summary>
49 52 /// 邮箱
50 53 /// </summary>
51 54 [SugarColumn(Length = 20, ColumnDescription = "邮箱", IsNullable = true)]
52 55 public string email { get; set; }
53   -
  56 +
54 57 /// <summary>
55 58 /// 注册地址
56 59 /// </summary>
57 60 [SugarColumn(Length = 100, ColumnDescription = "注册地址", IsNullable = true)]
58 61 public string registeredAddress { get; set; }
59   -
  62 +
60 63 /// <summary>
61 64 /// 成立日期
62 65 /// </summary>
63 66 [SugarColumn(ColumnDescription = "成立日期", IsNullable = true)]
64 67 public DateTime setupDate { get; set; }
65   -
  68 +
66 69 /// <summary>
67 70 /// 备注
68 71 /// </summary>
69 72 [SugarColumn(Length = 200, ColumnDescription = "备注", IsNullable = true)]
70 73 public string remark { get; set; }
71   -
  74 +
72 75 [SugarColumn(Length = 50, IsNullable = true)]
73 76 public string createBy { get; set; }
74   -
  77 +
75 78 [SugarColumn(IsNullable = true)]
76 79 public DateTime createTime { get; set; }
77   -
78   - }
  80 +
  81 + }
79 82 }
80 83 \ No newline at end of file
... ...
sys/Hh.Mes.POJO/WebEntity/sys/sys_user.cs
1 1 using System;
2 2 using SqlSugar;
3   -using System.ComponentModel.DataAnnotations.Schema;
4 3  
5 4 namespace Hh.Mes.POJO.Entity
6 5 {
... ... @@ -15,6 +14,7 @@ namespace Hh.Mes.POJO.Entity
15 14 /// id
16 15 /// </summary>
17 16 public int id { get; set; }
  17 +
18 18 public string phoneNumber { get; set; }
19 19  
20 20 /// <summary>
... ...
sys/Hh.Mes.Service/WebService/Base/SysUserService.cs
... ... @@ -96,7 +96,7 @@ namespace Hh.Mes.Service.WebService.Base
96 96 var users = Context.Queryable<SysUser>()
97 97 .Where(expression)
98 98 .OrderBy(u => u.Name)
99   - .ToOffsetPage(request.page, request.limit, ref records);
  99 + .ToOffsetPage(request.page, request.limit, ref records);
100 100  
101 101 var userViews = new List<SysUserView>();
102 102 foreach (var user in users)
... ... @@ -173,7 +173,7 @@ namespace Hh.Mes.Service.WebService.Base
173 173 Context.Insertable(list).ExecuteCommand();
174 174 });
175 175  
176   - if (result.IsSuccess == false)
  176 + if (result.IsSuccess == false)
177 177 {
178 178 return response.ResponseError(result.ErrorMessage);
179 179 }
... ... @@ -215,10 +215,15 @@ namespace Hh.Mes.Service.WebService.Base
215 215 list.Add(sysRelevance);
216 216 }
217 217  
  218 + var oldAccount = Context.Queryable<sys_user>().Where(x => x.id == view.Id).Select(x => x.account).First();
218 219 var result = Context.Ado.UseTran(() =>
219 220 {
220 221 //更新用户信息
221 222 Context.Updateable(user).UpdateColumns(t => new { t.Account, t.Name, t.Sex, t.PhoneNumber, t.Status, t.UpdateBy, t.UpdateTime }).ExecuteCommand();
  223 +
  224 + //更新项目客户关联的账户
  225 + Context.Updateable<sys_user_client_rel>().SetColumns(x => x.userAccount == user.Account).Where(x => x.userAccount == oldAccount).ExecuteCommand();
  226 +
222 227 //删除用户对应的所有组织
223 228 Context.Deleteable<SysRelevance>(t => t.FirstId == user.Id && t.RelKey == Define.USERORG).ExecuteCommand();
224 229 //新增用户对应的所有组织
... ... @@ -250,7 +255,7 @@ namespace Hh.Mes.Service.WebService.Base
250 255  
251 256 //判断是否绑定了客户
252 257 var userInfo = Context.Queryable<sys_user>().Where(t => ids.Contains(t.id)).ToList();
253   - foreach(var i in userInfo)
  258 + foreach (var i in userInfo)
254 259 {
255 260 var isBindClient = Context.Queryable<sys_user_client_rel>().Any(x => x.userAccount == i.account);
256 261 if (isBindClient)
... ... @@ -337,7 +342,7 @@ namespace Hh.Mes.Service.WebService.Base
337 342 return ExceptionsHelp.Instance.ExecuteT(() =>
338 343 {
339 344 var response = new Response();
340   - currentUser.Password = ConfigRead.GetInstance.GetAppsetConnection().ResetPwd ;
  345 + currentUser.Password = ConfigRead.GetInstance.GetAppsetConnection().ResetPwd;
341 346 if (string.IsNullOrEmpty(currentUser.Password)) return response.ResponseError("配置文件属性【ResetPwd】不存在或者值为空,请核实!");
342 347 var result = Context.Updateable(currentUser)
343 348 .UpdateColumns(t => t.Password)
... ... @@ -383,7 +388,7 @@ namespace Hh.Mes.Service.WebService.Base
383 388 inner join base_team_user_rel t2 on t1.id=t2.userId
384 389 where t2.teamCode=@teamCode ");
385 390  
386   -
  391 +
387 392 var dt = base.Context.Ado.GetDataTable(stringBuilder.ToString(), new List<SugarParameter>(){
388 393 new SugarParameter("@teamCode",teamCode)
389 394 });
... ... @@ -401,7 +406,7 @@ namespace Hh.Mes.Service.WebService.Base
401 406 if (checkeds)
402 407 {
403 408 bool isHave = Context.Queryable<sys_user_client_rel>().Any(x => x.userAccount == userAccount);
404   - if(isHave && Context.Queryable<sys_user_client_rel>().Where(x => x.userAccount == userAccount).First().clientKeys != clientKeys)
  409 + if (isHave && Context.Queryable<sys_user_client_rel>().Where(x => x.userAccount == userAccount).First().clientKeys != clientKeys)
405 410 {
406 411 response.Status = false;
407 412 response.Message = "该用户已经绑定客户,如需更改客户绑定,请先取消绑定的现有客户";
... ...
sys/Hh.Mes.Service/WebService/Configure/BaseClientInfoService.cs
... ... @@ -10,19 +10,50 @@ using System.Collections.Generic;
10 10 using System.Linq;
11 11 using System.Linq.Expressions;
12 12 using Hh.Mes.Pojo.System;
  13 +using Hh.Mes.Common;
  14 +using Hh.Mes.POJO.EnumEntitys;
  15 +using Hh.Mes.Service.SystemAuth;
13 16  
14 17 namespace Hh.Mes.Service.Configure
15 18 {
16 19 public class BaseClientInfoService : RepositorySqlSugar<base_client_info>
17 20 {
  21 + private readonly IAuth _auth;
  22 +
  23 + public BaseClientInfoService(IAuth auth)
  24 + {
  25 + _auth = auth;
  26 + }
  27 +
18 28 public dynamic Load(PageReq pageReq, base_client_info entity)
19 29 {
20 30 return ExceptionsHelp.Instance.ExecuteT(() =>
21 31 {
22 32 var result = new Response<List<base_client_info>>();
23 33 var expression = LinqWhere(entity);
  34 +
24 35 //先组合查询表达式
25   - var query = Context.Queryable<base_client_info>().Where(expression);
  36 + var query = Context.Queryable<base_client_info, sys_user_client_rel>((t1, t2) => new object[]
  37 + {
  38 + JoinType.Left,t1.keys == t2.clientKeys,
  39 + }).Where(expression).Select((t1, t2) => new base_client_info
  40 + {
  41 + id = t1.id,
  42 + keys = t1.keys,
  43 + userAccount = t2.userAccount,
  44 + clientName = t1.clientName,
  45 + businessRegistrationCode = t1.businessRegistrationCode,
  46 + unifiedSocialCreditCode = t1.unifiedSocialCreditCode,
  47 + legalRepresentative = t1.legalRepresentative,
  48 + registeredAddress = t1.registeredAddress,
  49 + setupDate = t1.setupDate,
  50 + telephone = t1.telephone,
  51 + email = t1.email,
  52 + remark = t1.remark,
  53 + createBy = t1.createBy,
  54 + createTime = t1.createTime,
  55 + });
  56 +
26 57 //Exel为ture就不分页,因为导出的话是全部导出
27 58 if (pageReq != null)
28 59 {
... ... @@ -38,22 +69,85 @@ namespace Hh.Mes.Service.Configure
38 69 return result;
39 70 }, catchRetrunValue: "list");
40 71 }
41   -
  72 +
42 73 public dynamic Ins(base_client_info entity)
43 74 {
44 75 return ExceptionsHelp.Instance.ExecuteT(() =>
45 76 {
46   - var response = new Response();
47   - entity.keys = Guid.NewGuid();
48   - entity.setupDate = DateTime.Now;
49   - entity.createBy = sysWebUser?.Account;
50   - entity.createTime = DateTime.Now;
51   - response.Status = Add(entity);
52   - if (!response.Status)response.Message = SystemVariable.dataActionError;
53   - return response;
  77 + Context.Ado.BeginTran();
  78 + try
  79 + {
  80 + var response = new Response();
  81 + entity.keys = Guid.NewGuid();
  82 + entity.setupDate = DateTime.Now;
  83 + entity.createBy = sysWebUser?.Account;
  84 + entity.createTime = DateTime.Now;
  85 +
  86 + Context.Insertable(entity).ExecuteCommand();
  87 +
  88 + var account = entity.userAccount.Trim();
  89 + //用户输入了账号,需要校验
  90 + if (!string.IsNullOrWhiteSpace(account) && Context.Queryable<sys_user>().Where(x => x.account == account).Any())
  91 + {
  92 + response.Status = false;
  93 + response.Message = $"账号“{account}”在系统中已存在,请修改后重试!";
  94 + return response;
  95 + }
  96 +
  97 + //用户未输入账号,系统自动生成
  98 + if (string.IsNullOrWhiteSpace(account))
  99 + {
  100 + //当前已存在的账户
  101 + var allUserAccount = Context.Queryable<sys_user>().Select(x => x.account).ToList();
  102 + var temps = Enumerable.Range(1, 999999).Select(x => $"iot{x.ToString().PadLeft(6, '0')}").ToList();
  103 + account = temps.Except(allUserAccount).FirstOrDefault();
  104 + if (string.IsNullOrWhiteSpace(account))
  105 + {
  106 + response.Status = false;
  107 + response.Message = "自动生成用户账号失败,请输入自定义账号,或联系系统管理员处理!";
  108 + return response;
  109 + }
  110 + }
  111 +
  112 + var user = new sys_user
  113 + {
  114 + account = account,
  115 + password = Encryption.Encrypt("123456"),
  116 + name = entity.clientName,
  117 + status = 1,
  118 + createBy = sysWebUser?.Account,
  119 + createTime = DateTime.Now,
  120 + };
  121 + var userId = Context.Insertable(user).ExecuteReturnIdentity();
  122 +
  123 + var rel = new sys_user_client_rel
  124 + {
  125 + clientKeys = entity.keys,
  126 + userAccount = user.account,
  127 + };
  128 + Context.Insertable(rel).ExecuteCommand();
  129 +
  130 + var relevance = new SysRelevance
  131 + {
  132 + RelKey = Define.USERORG,
  133 + FirstId = userId,
  134 + SecondId = _auth.GetCurrentUser().Orgs.Min(x => x.Id),
  135 + CreateBy = sysWebUser?.Account,
  136 + CreateTime = DateTime.Now
  137 + };
  138 + Context.Insertable(relevance).ExecuteCommand();
  139 +
  140 + Context.Ado.CommitTran();
  141 + return response;
  142 + }
  143 + catch (Exception ex)
  144 + {
  145 + Context.Ado.RollbackTran();
  146 + throw ex;
  147 + }
54 148 });
55 149 }
56   -
  150 +
57 151 public dynamic Upd(base_client_info entity)
58 152 {
59 153 return ExceptionsHelp.Instance.ExecuteT(() =>
... ... @@ -67,51 +161,54 @@ namespace Hh.Mes.Service.Configure
67 161 return response;
68 162 });
69 163 }
70   -
  164 +
71 165 public dynamic DelByIds(Guid[] keys)
72 166 {
73 167 return ExceptionsHelp.Instance.ExecuteT(() =>
74 168 {
75 169 var response = new Response();
  170 +
76 171 //客户绑定项目,不允许删除
77   - foreach (var i in keys)
  172 + if (Context.Queryable<base_project_client_rel>().Any(x => keys.Contains(x.clientKeys)))
78 173 {
79   - var isBindProject = Context.Queryable<base_project_client_rel>().Any(x => x.clientKeys == i);
80   - if (isBindProject)
81   - {
82   - return response.ResponseError("客户绑定了项目,不能直接删除,请先删除项目!");
83   - }
  174 + return response.ResponseError("客户绑定了项目,不能直接删除,请先删除项目!");
  175 + }
  176 +
  177 + //客户绑定用户,不允许删除
  178 + if (Context.Queryable<sys_user_client_rel>().Any(x => keys.Contains(x.clientKeys)))
  179 + {
  180 + return response.ResponseError("客户绑定了用户账号,不能直接删除,请在[系统管理]目录下的[用户管理]页面解除绑定后再试!");
84 181 }
85 182  
86 183 Context.Deleteable<base_client_info>(t => keys.Contains(t.keys)).ExecuteCommand();
87   - Context.Deleteable<sys_user_client_rel>(t=>keys.Contains(t.clientKeys)).ExecuteCommand();//删除客户时删除与用户的绑定关系;
  184 + Context.Deleteable<sys_user_client_rel>(t => keys.Contains(t.clientKeys)).ExecuteCommand();//删除客户时删除与用户的绑定关系;
88 185 return response;
89 186 });
90 187 }
91   -
  188 +
92 189 public Response ExportData(base_client_info entity)
93 190 {
94 191 return Load(null, entity);
95 192 }
96   -
97   - public Expression<Func<base_client_info, bool>> LinqWhere(base_client_info model)
  193 +
  194 + public Expression<Func<base_client_info, sys_user_client_rel, bool>> LinqWhere(base_client_info model)
98 195 {
99 196 try
100 197 {
101   - var exp = Expressionable.Create<base_client_info>();
  198 + var exp = Expressionable.Create<base_client_info, sys_user_client_rel>();
102 199 //数据过滤条件
103 200 //if (!string.IsNullOrWhiteSpace(model.XXX)) exp.And(x => x.XXX.Contains(model.XXX));
104 201 if (!string.IsNullOrWhiteSpace(model.clientName))
105 202 {
106   - exp.And(x => x.clientName.Contains(model.clientName));
  203 + exp.And((t1, t2) => t1.clientName.Contains(model.clientName));
107 204 }
108 205 if (!string.IsNullOrWhiteSpace(model.legalRepresentative))
109 206 {
110   - exp.And(x => x.legalRepresentative.Contains(model.legalRepresentative));
  207 + exp.And((t1, t2) => t1.legalRepresentative.Contains(model.legalRepresentative));
111 208 }
112 209 if (!string.IsNullOrWhiteSpace(model.unifiedSocialCreditCode))
113 210 {
114   - exp.And(x => x.unifiedSocialCreditCode.Contains(model.unifiedSocialCreditCode));
  211 + exp.And((t1, t2) => t1.unifiedSocialCreditCode.Contains(model.unifiedSocialCreditCode));
115 212 }
116 213 return exp.ToExpression();//拼接表达式
117 214 }
... ... @@ -128,16 +225,17 @@ namespace Hh.Mes.Service.Configure
128 225 /// <param name="checkeds"></param>
129 226 /// <param name="projectKeys"></param>
130 227 /// <returns></returns>
131   - public dynamic BindClientProject(Guid clientKeys,bool checkeds,Guid projectKeys)
  228 + public dynamic BindClientProject(Guid clientKeys, bool checkeds, Guid projectKeys)
132 229 {
133   - return ExceptionsHelp.Instance.ExecuteT(() => {
  230 + return ExceptionsHelp.Instance.ExecuteT(() =>
  231 + {
134 232 var response = new Response();
135 233 if (checkeds)
136 234 {
137 235 Context.Deleteable<base_project_client_rel>().Where(x => x.clientKeys == clientKeys && x.projectKeys == projectKeys).ExecuteCommand();
138 236 base_project_client_rel bpcr = new base_project_client_rel() { clientKeys = clientKeys, projectKeys = projectKeys };
139 237 Context.Insertable(bpcr).AddQueue();
140   - response.Status = Context.SaveQueues()>0;
  238 + response.Status = Context.SaveQueues() > 0;
141 239 if (!response.Status) response.Message = "添加客户项目关系表数据失败!";
142 240 }
143 241 else
... ... @@ -146,7 +244,7 @@ namespace Hh.Mes.Service.Configure
146 244 response.Status = Context.SaveQueues() > 0;
147 245 if (!response.Status) response.Message = $"取消客户绑定项目:{projectKeys}失败";
148 246 }
149   - return response;
  247 + return response;
150 248 });
151 249 }
152 250  
... ...
web/WebMvc/Areas/configure/Controllers/BaseClientInfoController.cs
1 1 using Hh.Mes.Common.Request;
2 2 using Hh.Mes.POJO.Entity;
3   -using Hh.Mes.Service;
4 3 using Hh.Mes.Service.Configure;
5 4 using Microsoft.AspNetCore.Hosting;
6 5 using Microsoft.AspNetCore.Mvc;
... ...
web/WebMvc/Areas/configure/Views/BaseClientInfo/Index.cshtml
... ... @@ -39,7 +39,7 @@
39 39 <input name="unifiedSocialCreditCode" type="text" autocomplete="off" class="layui-input">
40 40 </div>
41 41 </div>
42   -
  42 +
43 43 </div>
44 44 </div>
45 45 </fieldset>
... ... @@ -50,68 +50,74 @@
50 50  
51 51 <div id="modifyForm" class="layui-tab-item">
52 52 <form class="layui-form layui-form-pane" action="" lay-filter="modifyForm" onsubmit="return false;">
53   - <div class="layui-row">
54   - <div class="layui-col-sm6">
55   - <label class="layui-form-label layui-col-sm3">客户名称<span class="lable-required">*</span></label>
56   - <div class="layui-input-inline layui-col-sm6">
57   - <input type="text" name="clientName" lay-verify="required" autocomplete="off" class="layui-input">
  53 + <div class="layui-row">
  54 + <div class="layui-col-sm6">
  55 + <label class="layui-form-label layui-col-sm3">客户名称<span class="lable-required">*</span></label>
  56 + <div class="layui-input-inline layui-col-sm6">
  57 + <input type="text" name="clientName" lay-verify="required" autocomplete="off" class="layui-input">
  58 + </div>
58 59 </div>
59   - </div>
60   - <div class="layui-col-sm6">
61   - <label class="layui-form-label layui-col-sm3">联系人<span class="lable-required">*</span></label>
62   - <div class="layui-input-inline layui-col-sm6">
63   - <input type="text" name="legalRepresentative" lay-verify="required" autocomplete="off" class="layui-input">
  60 + <div class="layui-col-sm6">
  61 + <label class="layui-form-label layui-col-sm3">联系人<span class="lable-required">*</span></label>
  62 + <div class="layui-input-inline layui-col-sm6">
  63 + <input type="text" name="legalRepresentative" lay-verify="required" autocomplete="off" class="layui-input">
  64 + </div>
64 65 </div>
65   - </div>
66   - <div class="layui-col-sm6">
67   - <label class="layui-form-label layui-col-sm3">信用代码</label>
68   - <div class="layui-input-inline layui-col-sm6">
69   - <input type="text" name="unifiedSocialCreditCode" autocomplete="off" class="layui-input">
  66 + <div class="layui-col-sm6">
  67 + <label class="layui-form-label layui-col-sm3">用户账号</label>
  68 + <div class="layui-input-inline layui-col-sm6">
  69 + <input type="text" id="userAccount" name="userAccount" autocomplete="off" class="layui-input">
  70 + </div>
70 71 </div>
71   - </div>
72   - <div class="layui-col-sm6">
73   - <label class="layui-form-label layui-col-sm3">工商注册号</label>
74   - <div class="layui-input-inline layui-col-sm6">
75   - <input type="text" name="businessRegistrationCode" autocomplete="off" class="layui-input">
  72 + <div class="layui-col-sm6">
  73 + <label class="layui-form-label layui-col-sm3">信用代码</label>
  74 + <div class="layui-input-inline layui-col-sm6">
  75 + <input type="text" name="unifiedSocialCreditCode" autocomplete="off" class="layui-input">
  76 + </div>
76 77 </div>
77   - </div>
78   - <div class="layui-col-sm6">
79   - <label class="layui-form-label layui-col-sm3">电话</label>
80   - <div class="layui-input-inline layui-col-sm6">
81   - <input type="text" name="telephone" autocomplete="off" class="layui-input">
  78 + <div class="layui-col-sm6">
  79 + <label class="layui-form-label layui-col-sm3">工商注册号</label>
  80 + <div class="layui-input-inline layui-col-sm6">
  81 + <input type="text" name="businessRegistrationCode" autocomplete="off" class="layui-input">
  82 + </div>
82 83 </div>
83   - </div>
84   - <div class="layui-col-sm6">
85   - <label class="layui-form-label layui-col-sm3">邮箱</label>
86   - <div class="layui-input-inline layui-col-sm6">
87   - <input type="text" name="email" autocomplete="off" class="layui-input">
  84 + <div class="layui-col-sm6">
  85 + <label class="layui-form-label layui-col-sm3">电话</label>
  86 + <div class="layui-input-inline layui-col-sm6">
  87 + <input type="text" name="telephone" autocomplete="off" class="layui-input">
  88 + </div>
88 89 </div>
89   - </div>
90   - <div class="layui-col-sm6">
91   - <label class="layui-form-label layui-col-sm3">注册地址</label>
92   - <div class="layui-input-inline layui-col-sm6">
93   - <input type="text" name="registeredAddress" autocomplete="off" class="layui-input">
  90 + <div class="layui-col-sm6">
  91 + <label class="layui-form-label layui-col-sm3">邮箱</label>
  92 + <div class="layui-input-inline layui-col-sm6">
  93 + <input type="text" name="email" autocomplete="off" class="layui-input">
  94 + </div>
94 95 </div>
95   - </div>
96   - @* <div class="layui-col-sm6">
  96 + <div class="layui-col-sm6">
  97 + <label class="layui-form-label layui-col-sm3">注册地址</label>
  98 + <div class="layui-input-inline layui-col-sm6">
  99 + <input type="text" name="registeredAddress" autocomplete="off" class="layui-input">
  100 + </div>
  101 + </div>
  102 + @* <div class="layui-col-sm6">
97 103 <label class="layui-form-label layui-col-sm3">成立日期<span class="lable-required">*</span></label>
98 104 <div class="layui-input-inline layui-col-sm6">
99   - <input name="setupDate" type="text" lay-verify="required" autocomplete="off" class="layui-input layui-date" value="">
  105 + <input name="setupDate" type="text" lay-verify="required" autocomplete="off" class="layui-input layui-date" value="">
100 106 </div>
101   - </div>*@
102   - <div class="layui-col-sm6">
103   - <label class="layui-form-label layui-col-sm3">备注</label>
104   - <div class="layui-input-inline layui-col-sm6">
105   - <input type="text" name="remark" autocomplete="off" class="layui-input">
  107 + </div>*@
  108 + <div class="layui-col-sm6">
  109 + <label class="layui-form-label layui-col-sm3">备注</label>
  110 + <div class="layui-input-inline layui-col-sm6">
  111 + <input type="text" name="remark" autocomplete="off" class="layui-input">
  112 + </div>
  113 + </div>
  114 +
  115 + <div class="layui-form-item">
  116 + <!--表单验证按钮-->
  117 + <button class="layui-btn" style="display:none" name="fromAdd" lay-filter="fromAdd" lay-submit>fromAdd</button>
  118 + <button class="layui-btn" style="display:none" name="fromUpdate" lay-filter="fromUpdate" lay-submit>fromUpdate</button>
106 119 </div>
107 120 </div>
108   -
109   - <div class="layui-form-item">
110   - <!--表单验证按钮-->
111   - <button class="layui-btn" style="display:none" name="fromAdd" lay-filter="fromAdd" lay-submit>fromAdd</button>
112   - <button class="layui-btn" style="display:none" name="fromUpdate" lay-filter="fromUpdate" lay-submit>fromUpdate</button>
113   - </div>
114   - </div>
115 121 <div hidden>
116 122 <input name="id" type="text" class="layui-input">
117 123 <input name="keys" type="text" class="layui-input">
... ...
web/WebMvc/wwwroot/productjs/configure/BaseClientInfo.js
... ... @@ -23,7 +23,7 @@ layui.config({
23 23 //sendDataWhere: null,
24 24 //isAddWhereExtend: "arbitrarily",
25 25 //mainTable: app.data.tableIns,
26   - title:"<span style='color:red;'>(自动创建登入用户拼音信息,保存后无法修改登入用户请仔细核实【客户名称】)</span>",
  26 + title: "<span style='color:red;'>(自动创建登入用户拼音信息,保存后无法修改登入用户请仔细核实【客户名称】)</span>",
27 27 submit: "submit(fromAdd)"
28 28 }
29 29 return options;
... ... @@ -51,7 +51,7 @@ layui.config({
51 51 fromId: "listForm",
52 52 url: `/${areaName}/${controllerName}/Export`,
53 53 isDefault: false,
54   - sendDataWhere:{},
  54 + sendDataWhere: {},
55 55 excelCols: {
56 56 head: app.data.cols,
57 57 body: app.data.colsDesc
... ... @@ -66,7 +66,7 @@ layui.config({
66 66 fromId: "listForm",
67 67 urlExport: `/${areaName}/${controllerName}/Export`,
68 68 urlQuery: `/${areaName}/${controllerName}/Load`,
69   - sendDataWhere:{},
  69 + sendDataWhere: {},
70 70 mainTable: app.data.tableIns
71 71 }
72 72 return options;
... ... @@ -92,6 +92,8 @@ layui.config({
92 92 return options;
93 93 },
94 94 addBefore: function (callBack) {
  95 + let userAccountObj = document.getElementById('userAccount');
  96 + userAccountObj.readOnly = false;
95 97 //callBack是回调函数,如果editBefore有ajax 放在成功之后
96 98 if (callBack != null) callBack();
97 99 },
... ... @@ -101,6 +103,8 @@ layui.config({
101 103 },
102 104 editBefore: function (data, callBack) {
103 105 //data.enable = data.enable.toString();
  106 + let userAccountObj = document.getElementById('userAccount');
  107 + userAccountObj.readOnly = true;
104 108 form.val("modifyForm", data);
105 109 if (callBack != null) callBack();
106 110 },
... ... @@ -166,6 +170,7 @@ layui.config({
166 170 { field: "keys", width: 80, hide: true, title: "Keys" },
167 171 { field: "clientName", width: 300, title: "客户名称" },
168 172 { field: "legalRepresentative", width: 150, title: "联系人" },
  173 + { field: "userAccount", width: 150, title: "用户账号" },
169 174 { field: "unifiedSocialCreditCode", width: 150, title: "统一社会信用代码" },
170 175 { field: "businessRegistrationCode", width: 150, title: "工商注册号" },
171 176  
... ... @@ -174,10 +179,10 @@ layui.config({
174 179 { field: "registeredAddress", width: 150, title: "注册地址" },
175 180 { field: "setupDate", width: 150, title: "成立日期", hide: true },
176 181 { field: "remark", width: 150, title: "备注" },
177   - { field: "createBy", width: 150, title: "createBy" },
178   - { field: "createTime", width: 150, title: "createTime" },
  182 + { field: "createBy", width: 150, title: "创建人" },
  183 + { field: "createTime", width: 150, title: "创建时间" },
179 184 ]],
180   - colsDesc:null,
  185 + colsDesc: null,
181 186 tableIns: null,
182 187 tableElem: "mainList",
183 188 tableInsDesc: null,
... ... @@ -208,7 +213,7 @@ layui.config({
208 213 url: `/${areaName}/${controllerName}/Load`,
209 214 cols: sysU.columnRecord(app.data.tableElem, app.data.cols),
210 215 toolbar: '#toolbarTable',
211   - where: config,
  216 + where: config,
212 217 //height: "full-56",//如果是主明细页签,列表主体高度要设置,否则分页导航不直观展示
213 218 doneExtend: function (res, obj) {
214 219 var pageFlag = "".GetUrlParam("page"),
... ... @@ -233,7 +238,7 @@ layui.config({
233 238 },
234 239  
235 240 initSelectTable: function () {
236   - var opt1 = {
  241 + var opt1 = {
237 242 elem: ".productCode",
238 243 checkedKey: "productCode",
239 244 doneKey: {
... ... @@ -243,7 +248,7 @@ layui.config({
243 248 searchKey: "productCode",
244 249 searchName: "产品编码"
245 250 };
246   - sysU.initSelectProduct(opt1);
  251 + sysU.initSelectProduct(opt1);
247 252 },
248 253  
249 254 initFrom() {
... ...