user_unit.ejs 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <% include ./sub_menu.ejs %>
  2. <div class="panel-content">
  3. <div class="panel-title">
  4. <div class="title-main">
  5. <h2>账号管理
  6. <a href="#add-company" data-toggle="modal" data-target="#add-company" class="btn btn-primary btn-sm pull-right">添加单位</a>
  7. <% if (projectData.max_user === 0 || projectData.max_user > user_total) { %>
  8. <a href="#ver" data-toggle="modal" data-target="#add-user" class="btn btn-primary btn-sm pull-right mr-2">添加账号</a>
  9. <% } else { %>
  10. <a href="#add-unpass" data-toggle="modal" data-target="#add-unpass" class="btn btn-primary btn-sm pull-right mr-2">添加账号(受限)</a>
  11. <% } %>
  12. </h2>
  13. </div>
  14. </div>
  15. <div class="content-wrap">
  16. <div class="c-body">
  17. <div class="sjs-height-0">
  18. <nav class="nav nav-tabs m-3" role="tablist">
  19. <a class="nav-item nav-link" href="/setting/user">账号列表</a>
  20. <a class="nav-item nav-link" href="/setting/user/permission/set">账号权限</a>
  21. <a class="nav-item nav-link active" href="/setting/user/unit">参建单位</a>
  22. </nav>
  23. <div class="tab-content m-3">
  24. <div id="unit-list" class="tab-pane active">
  25. <div class="row">
  26. <div class="col-6">
  27. <table class="table table-hover table-bordered table-sm">
  28. <thead>
  29. <tr>
  30. <th>序号</th>
  31. <th>单位名称</th>
  32. <th>账号数</th>
  33. <th>类型</th>
  34. <th class="text-center">备注</th></tr>
  35. </thead>
  36. <tbody id="unit_list" style="cursor: pointer">
  37. <% if (unitList.length > 0) { %>
  38. <% for (const [index, u] of unitList.entries()) { %>
  39. <tr <% if (index === 0) { %>class="table-warning" <% } %> data-id="<%- u.id %>">
  40. <td width="50px"><%- index+1 %></td>
  41. <td ><a href="javascript:void(0)"><%- u.name %></a></td>
  42. <td width="80px"><%- u.account_num %></td>
  43. <td width="100px"><%- accountGroup[u.type] %></td>
  44. <td width="150px"><%- u.basic %></td>
  45. </tr>
  46. <% } %>
  47. <% } %>
  48. </tbody>
  49. </table>
  50. </div>
  51. <% if (unitList.length > 0) { %>
  52. <div class="col-6">
  53. <div>
  54. <div class="row px-3">
  55. <div>
  56. <legend>单位详情</legend>
  57. </div>
  58. <div class="ml-auto">
  59. <a href="#del-company" data-toggle="modal" data-target="#del-company" id="del-modal-btn" class="btn btn-outline-danger btn-sm btn-block">删除单位</a>
  60. </div>
  61. </div>
  62. <table class="table table-hover table-bordered table-sm" id="one_unit">
  63. <tr>
  64. <th width="120">单位名称</th>
  65. <td width="200"><input class="form-control form-control-sm" type="text" data-name="name" id="unit_name" value="<%- unitList[0].name %>" placeholder=""></td>
  66. <th width="120">法人代表</th>
  67. <td width="200"><input class="form-control form-control-sm" type="text" data-name="corporation" id="unit_corporation" value="<%- unitList[0].corporation %>" placeholder=""></td>
  68. </tr>
  69. <tr>
  70. <th>企业信用代码</th>
  71. <td><input class="form-control form-control-sm" type="text" data-name="credit_code" id="unit_credit_code" value="<%- unitList[0].credit_code %>" placeholder=""></td>
  72. <th>类型</th>
  73. <td>
  74. <select class="form-control form-control-sm" id="unit_type" data-name="type">
  75. <option value="0">请选择</option>
  76. <% for (const dw in accountGroup) { %>
  77. <option value="<%= dw %>" <% if (unitList[0].type === parseInt(dw)) { %>selected<% } %>><%- accountGroup[dw] %></option>
  78. <% } %>
  79. </select>
  80. </td>
  81. </tr>
  82. <tr>
  83. <th>电话</th>
  84. <td><input class="form-control form-control-sm" type="text" data-name="tel" id="unit_tel" value="<%- unitList[0].tel %>" placeholder=""></td>
  85. <th>网站</th>
  86. <td><input class="form-control form-control-sm" type="text" data-name="website" id="unit_website" value="<%- unitList[0].website %>" placeholder=""></td>
  87. </tr>
  88. <tr>
  89. <th>所属地区</th>
  90. <td><input class="form-control form-control-sm" type="text" data-name="region" id="unit_region" value="<%- unitList[0].region %>" placeholder=""></td>
  91. <th>地址</th>
  92. <td><input class="form-control form-control-sm" type="text" data-name="address" id="unit_address" value="<%- unitList[0].address %>" placeholder=""></td>
  93. </tr>
  94. <tr>
  95. <th>备注</th>
  96. <td colspan="3">
  97. <textarea class="form-control form-control-sm" id="unit_basic" data-name="basic" value="<%- unitList[0].basic %>" rows="2"></textarea>
  98. </td>
  99. </tr>
  100. </table>
  101. </div>
  102. <div <% if (unitList[0].sign_path) { %>style="display: none" <% } %> id="upload-sign" class="form-group">
  103. <label for="sign-upload">上传签章</label>
  104. <input type="file" class="form-control-file" id="sign-upload">
  105. <small class="form-text text-danger">图片大小为500x500px,格式PNG透明背景。</small>
  106. </div>
  107. <button <% if (!unitList[0].sign_path) { %>style="display: none" <% } %> type="button" class="btn btn-sm btn-danger" id="delete-sign">移除签章</button>
  108. <div class="form-group">
  109. <label>签章图预览</label>
  110. <div>
  111. <div class="position-relative">
  112. <img src="/public/images/baobiao3.png">
  113. <div class="position-absolute fixed-top" id="sign-show" style="left:290px;top:210px">
  114. <% if (unitList[0].sign_path) { %>
  115. <img src="<%- fujianOssPath + unitList[0].sign_path %>" width="120">
  116. <% } %>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. <% } %>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. <script>
  131. </script>
  132. <script src="/public/js/setting.js"></script>
  133. <script>
  134. const unitList = JSON.parse(unescape('<%- escape(JSON.stringify(unitList)) %>'));
  135. const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
  136. const fujianOssPath = JSON.parse(unescape('<%- escape(JSON.stringify(fujianOssPath)) %>'));
  137. let oneUnit = unitList.length > 0 ? unitList[0] : null;
  138. </script>
  139. <script>autoFlashHeight();</script>