瀏覽代碼

1. 项目管理界面更新
2. 部位明细,不允许复制粘贴情况下,界面刷新相关

MaiXinRong 6 年之前
父節點
當前提交
5bd711f027

+ 3 - 4
app/public/js/ledger.js

@@ -771,16 +771,15 @@ $(document).ready(function() {
          * @param info
          */
         clipboardPasted: function (e, info) {
-            const self = this;
             const node = treeOperationObj.getSelectNode(ledgerSpread.getActiveSheet());
             if (node.code && (node.code !== '')) {
                 toast('项目节不可含有清单明细', 'error');
-                self.loadCurPosData();
+                posOperationObj.loadCurPosData();
                 return;
             }
             if (node.children && (node.children.length > 0)) {
                 toast('仅清单子项可以含有部位明细', 'error');
-                self.loadCurPosData();
+                posOperationObj.loadCurPosData();
                 return;
             }
 
@@ -790,7 +789,7 @@ $(document).ready(function() {
                 if (sortData.length === 0 || info.cellRange.row + info.cellRange.rowCount > sortData.length) {
                     if (info.cellRange.col !== 0) {
                         toast('新增部位请先输入名称', 'warning');
-                        self.loadCurPosData();
+                        posOperationObj.loadCurPosData();
                         return;
                     }
                 }

+ 4 - 3
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -1393,9 +1393,10 @@ const SpreadJsObj = {
          */
         getUnitCellType: function () {
             let combo = this.getActiveComboCellType();
-            combo.itemHeight(10).items(['m', 'km', 'm2', 'm3', 'kg', 't', 'm3·km', '总额', '月', '项', '处', '个', '根',
-                '棵', '块', '每一试桩', '桥长米', '公路公里', '株', '组', '座', '元', '工日', '套', '台班', '系统', '艘班', 'm/处',
-                'm/道', 'm/座', 'm2/m', 'm3/m', 'm3/处', '根/米', '亩', 'm3/m2', 'dm3']);
+            combo.itemHeight(10).items(['m', 'km', 'm2', 'm3', 'dm3', 'kg', 't', 'm3·km',
+                '总额', '月' ,'项', '处' ,'个', '根', '棵', '块', '台', '系统', '每一试桩',
+                '桥长米', '公路公里', '株', '组', '座', '元', '工日', '套', '台班', '艘班', '亩',
+                'm/处', 'm/道', 'm/座', 'm2/m', 'm3/m', 'm3/处', '根/米', 'm3/m2']);
             return combo;
         }
     }

+ 8 - 0
app/public/js/tender_list_manage.js

@@ -233,6 +233,7 @@ function initTenderTree () {
 }
 function recursiveGetTenderNodeHtml (node, arr) {
     const html = [];
+    console.log(node);
     html.push('<tr>');
     // 名称
     html.push('<td class="in-' + node.level + '">');
@@ -245,6 +246,10 @@ function recursiveGetTenderNodeHtml (node, arr) {
         html.push('<a href="javascript: void(0)" name="name" id="' + node.id + '">', node.name, '</a>');
     }
     html.push('</td>');
+    // 创建人
+    html.push('<td>', node.user_name, '</td>');
+    // 创建时间
+    html.push('<td>', node.create_time ? moment(node.create_time).format('YYYY-MM-DD hh:mm:ss') : '', '</td>');
     // 完成期数
     html.push('<td>');
     if (!node.cid) {
@@ -272,9 +277,12 @@ function getTenderTreeHeaderHtml() {
     const html = [];
     html.push('<thead>', '<tr>');
     html.push('<th>', '名称', '</th>');
+    html.push('<th>', '创建人', '</th>');
+    html.push('<th>', '创建时间', '</th>');
     html.push('<th>', '完成期数', '</th>');
     html.push('<th>', '管理', '</th>');
     html.push('</tr>', '</thead>');
+    return html.join('');
 }
 // 根据TenderTree数据获取Html代码
 function getTenderTreeHtml () {

+ 10 - 2
app/service/tender.js

@@ -78,8 +78,15 @@ module.exports = app => {
         async getList() {
             // 获取当前项目信息
             const session = this.ctx.session;
-            const sql = 'SELECT t.`id`, t.`project_id`, t.`name`, t.`status`, t.`category`, t.`ledger_times`, t.`ledger_status`, t.`measure_type`, t.`user_id` '+
+            // tender 163条数据,project_account 68条数据测试
+            // 查询两张表耗时0.003s,查询tender左连接project_account耗时0.002s
+            const sql = 'SELECT t.`id`, t.`project_id`, t.`name`, t.`status`, t.`category`, t.`ledger_times`, t.`ledger_status`, t.`measure_type`, t.`user_id`, t.`create_time`, '+
+                        '    pa.`name` As `user_name`, pa.`role` As `user_role`, pa.`company` As `user_company` ' +
+                        // '  FROM ?? As t, ?? As pa ' +
+                        // '  WHERE t.`project_id` = ? AND t.`user_id` = pa.`id` AND (' +
                         '  FROM ?? As t ' +
+                        '  Left Join ?? As pa ' +
+                        '  ON t.`user_id` = pa.`id` ' +
                         '  WHERE t.`project_id` = ? AND (' +
                         // 创建的标段
                         '    t.`user_id` = ?' +
@@ -94,11 +101,12 @@ module.exports = app => {
                         '        t.id IN ( SELECT ca.`tid` FROM ?? AS ca WHERE ca.`uid` = ? GROUP BY ca.`tid`))' +
                         // 未参与,但可见的标段
                         ')';
-            const sqlParam = [this.tableName, session.sessionProject.id, session.sessionUser.accountId,
+            const sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, session.sessionProject.id, session.sessionUser.accountId,
             this.ctx.service.ledgerAudit.tableName, session.sessionUser.accountId,
             this.ctx.service.stageAudit.tableName, session.sessionUser.accountId,
             this.ctx.service.changeAudit.tableName, session.sessionUser.accountId];
 
+            //console.log(this.db.format(sql, sqlParam));
             const list = await this.db.query(sql, sqlParam);
             for (const l of list) {
                 l.category = l.category && l.category !== '' ? JSON.parse(l.category) : null;

+ 3 - 0
app/view/tender/modal.ejs

@@ -43,6 +43,9 @@
         <div class="modal-content">
             <div class="modal-header">
                 <h5 class="modal-title">选择计量模式</h5>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true">&times;</span>
+                </button>
             </div>
             <div class="modal-body">
                 <div class="row">

+ 10 - 7
app/view/tender/sub_menu.ejs

@@ -12,16 +12,19 @@
                     <label class="btn btn-sm btn-light  <% if (ctx.url === '/list/progress') { %>active<% } %>" onclick="window.location.href='/list/progress'">
                         <input type="radio" name="options" id="option2" autocomplete="off"> 计量进度
                     </label>
-                </div>
-            </div>
-            <div class="d-inline-block ml-3">
-                <div class="form-check-inline">
-                    <label class="form-check-label" onclick="window.location.href='/list/manage'">
-                        <input class="form-check-input" type="checkbox" <% if (ctx.url === '/list/manage') { %>checked="checked"<% } %>>
-                        管理标段
+                    <label class="btn btn-sm btn-light  <% if (ctx.url === '/list/manage') { %>active<% } %>" onclick="window.location.href='/list/manage'">
+                        <input type="radio" name="options" id="option2" autocomplete="off"> 管理标段
                     </label>
                 </div>
             </div>
+            <!--<div class="d-inline-block ml-3">-->
+                <!--<div class="form-check-inline">-->
+                    <!--<label class="form-check-label" onclick="window.location.href='/list/manage'">-->
+                        <!--<input class="form-check-input" type="checkbox" <% if (ctx.url === '/list/manage') { %>checked="checked"<% } %>>-->
+                        <!--管理标段-->
+                    <!--</label>-->
+                <!--</div>-->
+            <!--</div>-->
         </div>
         <% if (userPermission !== null && userPermission.tender !== undefined && userPermission.tender.indexOf('1') !== -1) { %>
         <div>

+ 1 - 0
config/web.js

@@ -70,6 +70,7 @@ const JsFiles = {
                 files: [
                     "/public/js/ztree/jquery.ztree.core.js",
                     "/public/js/ztree/jquery.ztree.exedit.js",
+                    "/public/js/moment/moment.min.js",
                 ],
                 mergeFiles: ["/public/js/tender_list_manage.js"],
                 mergeFile: 'tender_list_manage',