ソースを参照

一些已知bug修复

ellisran 1 年間 前
コミット
58a67d2963

+ 1 - 0
app/controller/setting_controller.js

@@ -324,6 +324,7 @@ module.exports = app => {
                     accountGroup,
                     unitList,
                     user_total,
+                    company: null,
                     fujianOssPath: ctx.app.config.fujianOssPath,
                     jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.setting.user),
                 };

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

@@ -251,7 +251,6 @@ $(document).ready(() => {
     });
 
     $('#one_unit input').blur(function () {
-        console.log('hello');
         const val_name = $(this).data('name');
         let val = _.trim($(this).val()) !== '' ? _.trim($(this).val()) : null;
         if (!oneUnit) {

+ 2 - 2
app/service/change.js

@@ -1286,8 +1286,6 @@ module.exports = app => {
                     },
                 };
                 await this.transaction.update(this.tableName, change_update, options);
-                await this.transaction.commit();
-                result = true;
                 const sms = new SMS(this.ctx);
                 const code = await sms.contentChange(changeData.code);
                 const shenpiUrl = await this.ctx.helper.urlToShort(
@@ -1317,6 +1315,8 @@ module.exports = app => {
                     template: wxConst.template.change,
                     wx_data: wechatData,
                 });
+                await this.transaction.commit();
+                result = true;
             } catch (error) {
                 console.log(error);
                 await this.transaction.rollback();

+ 1 - 1
app/view/setting/user_add_modal.ejs

@@ -43,7 +43,7 @@
                     <select class="form-control form-control-sm" name="company" id="add_user_company">
                         <option>请选择</option>
                         <% for (const u of unitList) { %>
-                            <option><%- u.name %></option>
+                            <option <% if (company && company === u.name) { %>selected<% } %>><%- u.name %></option>
                         <% } %>
                     </select>
                 </div>

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

@@ -23,7 +23,7 @@
                     <a class="nav-item nav-link active" href="/setting/user/unit">参建单位</a>
                 </nav>
                 <div class="tab-content m-3">
-                    <div id="unit-list" class="tab-pane active">
+                    <div class="tab-pane active">
                         <div class="row">
                             <div class="col-6">
                                 <table class="table table-hover table-bordered table-sm">