فهرست منبع

添加账号单位默认

ellisran 1 سال پیش
والد
کامیت
27a792d98c

+ 1 - 0
app/public/js/setting.js

@@ -448,6 +448,7 @@ function setUnitRightHtml(id) {
             $('#upload-sign').show();
         }
         oneUnit = one;
+        $('#add_user_company').val(one.name);
     }
 }
 

+ 2 - 2
app/public/js/setting_unit_list_order.js

@@ -68,9 +68,9 @@ const unitListOrder = (function () {
         if (unitList.length > 0) {
             for (const [index, u] of unitList.entries()) {
                 html += `<tr ${index === 0 ? 'class="table-warning"' : ''} data-id="${u.id}">
-                                        <td width="50px">${index+1}</td>
+                                        <td class="text-center" width="50px">${index+1}</td>
                                         <td ><a href="javascript:void(0)">${u.name}</a></td>
-                                        <td width="80px">${u.account_num}</td>
+                                        <td class="text-right" width="80px">${u.account_num}</td>
                                         <td width="100px">${accountGroup[u.type]}</td>
                                         <td width="150px">${u.basic ? u.basic : ''}</td>
                                     </tr>`;

+ 3 - 7
app/view/setting/user_modal.ejs

@@ -42,11 +42,9 @@
                     <!--<input class="form-control form-control-sm" name="company" value="" type="text">-->
                     <input value="7" name="account_group" type="hidden">
                     <select class="form-control form-control-sm" name="company">
-                        <% if (unitList.length === 0) { %>
                         <option>请选择</option>
-                        <% } %>
                         <% for (const u of unitList) { %>
-                            <option><%- u.name %></option>
+                            <option <% if (company && company === u.name) { %>selected<% } %>><%- u.name %></option>
                         <% } %>
                     </select>
                 </div>
@@ -121,11 +119,9 @@
                     <!--<input class="form-control form-control-sm" value="" name="company" type="text">-->
                     <input value="" name="account_group" type="hidden">
                     <select class="form-control form-control-sm" name="company">
-                        <% if (unitList.length === 0) { %>
-                            <option>请选择</option>
-                        <% } %>
+                        <option>请选择</option>
                         <% for (const u of unitList) { %>
-                            <option><%- u.name %></option>
+                            <option <% if (company && company === u.name) { %>selected<% } %>><%- u.name %></option>
                         <% } %>
                     </select>
                 </div>

+ 2 - 4
app/view/setting/user_permission_modal.ejs

@@ -41,11 +41,9 @@
                     <label>单位名称<b class="text-danger">*</b></label>
                     <input value="7" name="account_group" type="hidden">
                     <select class="form-control form-control-sm" name="company">
-                        <% if (unitList.length === 0) { %>
-                            <option>请选择</option>
-                        <% } %>
+                        <option>请选择</option>
                         <% for (const u of unitList) { %>
-                            <option><%- u.name %></option>
+                            <option <% if (company && company === u.name) { %>selected<% } %>><%- u.name %></option>
                         <% } %>
                     </select>
                 </div>

+ 2 - 2
app/view/setting/user_unit.ejs

@@ -37,9 +37,9 @@
                                     <% if (unitList.length > 0) { %>
                                     <% for (const [index, u] of unitList.entries()) { %>
                                     <tr <% if (index === 0) { %>class="table-warning" <% } %> data-id="<%- u.id %>">
-                                        <td width="50px"><%- index+1 %></td>
+                                        <td class="text-center" width="50px"><%- index+1 %></td>
                                         <td ><a href="javascript:void(0)"><%- u.name %></a></td>
-                                        <td width="80px"><%- u.account_num %></td>
+                                        <td class="text-right" width="80px"><%- u.account_num %></td>
                                         <td width="100px"><%- accountGroup[u.type] %></td>
                                         <td width="150px"><%- u.basic %></td>
                                     </tr>

+ 2 - 4
app/view/setting/user_unit_modal.ejs

@@ -40,10 +40,8 @@
                 <div class="form-group">
                     <label>单位名称<b class="text-danger">*</b></label>
                     <input value="7" name="account_group" type="hidden">
-                    <select class="form-control form-control-sm" name="company">
-                        <% if (unitList.length === 0) { %>
-                            <option>请选择</option>
-                        <% } %>
+                    <select class="form-control form-control-sm" name="company" id="add_user_company">
+                        <option>请选择</option>
                         <% for (const u of unitList) { %>
                             <option><%- u.name %></option>
                         <% } %>