ソースを参照

部分bug修复

laiguoran 5 年 前
コミット
a9134bc0dc

+ 1 - 1
app/controller/profile_controller.js

@@ -65,7 +65,7 @@ module.exports = app => {
                 const baseRule = ctx.service.projectAccount.rule('profileBase');
                 ctx.helper.validate(baseRule);
 
-                const result = await ctx.service.projectAccount.save(ctx.request.body, sessionUser.accountId);
+                const result = await ctx.service.projectAccount.saveInfo(ctx.request.body, sessionUser.accountId);
                 if (!result) {
                     throw '保存信息失败';
                 }

+ 4 - 4
app/controller/tender_controller.js

@@ -73,9 +73,9 @@ module.exports = app => {
             }
         }
 
-        async _list(view, renderData, modal = '') {
+        async _list(view, renderData, modal = '', list_status = '') {
             try {
-                renderData.tenderList = await this.ctx.service.tender.getList('', renderData.userPermission);
+                renderData.tenderList = await this.ctx.service.tender.getList(list_status, renderData.userPermission);
 
                 for (const t of renderData.tenderList) {
                     if (t.ledger_status === auditConst.ledger.status.checked) {
@@ -145,9 +145,9 @@ module.exports = app => {
             if (userPermission !== null && userPermission.tender !== undefined && userPermission.tender.indexOf('1') !== -1) {
                 const renderData = {
                     accountInfo,
-                    userPermission
+                    userPermission,
                 };
-                await this._list('tender/manage.ejs', renderData, 'tender/manage_modal.ejs')
+                await this._list('tender/manage.ejs', renderData, 'tender/manage_modal.ejs', 'manage');
                 // 获取用户新建标段权利
                 // const accountInfo = await this.ctx.service.projectAccount.getDataById(this.ctx.session.sessionUser.accountId);
                 // const userPermission = accountInfo !== undefined && accountInfo.permission !== '' ? JSON.parse(accountInfo.permission) : null;

+ 16 - 0
app/service/project_account.js

@@ -352,6 +352,22 @@ module.exports = app => {
         }
 
         /**
+         * 修改账号资料
+         *
+         * @param {Object} data - post过来的数据
+         * @return {Boolean} - 返回修改结果
+         */
+        async saveInfo(data, id) {
+            if (data._csrf !== undefined) {
+                delete data._csrf;
+            }
+            data.id = parseInt(id);
+            const operate = await this.db.update(this.tableName, data);
+            return operate.affectedRows > 0;
+        }
+
+
+        /**
          * 修改密码
          *
          * @param {Number} accountId - 账号id

+ 1 - 1
app/view/change/info_modal.ejs

@@ -203,7 +203,7 @@
                         <div style="height:400px;overflow-y:hidden">
                             <table class="table table-striped table-bordered table-hover table-sm fixed_headers2">
                                 <thead>
-                                <tr><th>项目节编号</th><th>名称</th><th>部位明细</th><th>部位数量</th><th>选择</th></tr>
+                                <tr><th>项目节编号</th><th>名称</th><th>计量单元</th><th>数量</th><th>选择</th></tr>
                                 </thead>
                                 <tbody id="code-list" data-index="">
                                 </tbody>

+ 1 - 1
app/view/tender/manage.ejs

@@ -12,4 +12,4 @@
     const categoryType = JSON.parse('<%- JSON.stringify(settingConst.cType) %>');
     const category = JSON.parse('<%- JSON.stringify(categoryData) %>');
     const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
-</script>
+</script>