瀏覽代碼

修复bug

laiguoran 2 年之前
父節點
當前提交
d540defbdb

+ 1 - 1
app/public/js/payment_index.js

@@ -77,7 +77,7 @@ $(function () {
             if (node.uid === uid || is_admin) {
                 html.push('<a class="dropdown-item edit_name_btn" data-type="'+ (node.parent_id === undefined ? 'tender' : 'folder') +'" data-id="'+ node.id +'" href="javascript:void(0);"><i class="fa fa-edit mr-2"></i>重命名</a>\n');
             }
-            if (!node.had_tender && node.uid === uid || is_admin) {
+            if (!node.had_tender && (node.uid === uid || is_admin)) {
                 if (node.have_detail) {
                     html.push('<a class="dropdown-item" style="cursor:not-allowed" href="javascript:void(0);" data-toggle="tooltip" data-placement="bottom" title="请先删除所有审批期数据"><i class="fa fa-remove mr-2"></i>删除</a>\n');
                 } else {

+ 9 - 5
app/public/js/payment_process.js

@@ -56,8 +56,10 @@ $(function () {
                         <span class="text-muted">${item.role || ''}</span>
                     </dd>`
                 });
-                $('#' + code + '_dropdownMenu .book-list').empty();
-                $('#' + code + '_dropdownMenu .book-list').append(html);
+                $(this).parents('.dropdown-menu').children('.book-list').empty();
+                $(this).parents('.dropdown-menu').children('.book-list').append(html);
+                // $('#' + code + '_dropdownMenu .book-list').empty();
+                // $('#' + code + '_dropdownMenu .book-list').append(html);
             } else {
                 if (!$('#' + code + '_dropdownMenu .acc-btn').length) {
                     accountGroup.forEach((group, idx) => {
@@ -76,8 +78,10 @@ $(function () {
                         });
                         html += '</div>';
                     });
-                    $('#' + code + '_dropdownMenu .book-list').empty();
-                    $('#' + code + '_dropdownMenu .book-list').append(html);
+                    // $('#' + code + '_dropdownMenu .book-list').empty();
+                    // $('#' + code + '_dropdownMenu .book-list').append(html);
+                    $(this).parents('.dropdown-menu').children('.book-list').empty();
+                    $(this).parents('.dropdown-menu').children('.book-list').append(html);
                 }
             }
         }, 400);
@@ -178,7 +182,7 @@ $(function () {
             html +='<div><span class="d-inline-block">\n' +
                 '                                                <div class="dropdown text-right">\n' +
                 '                                                    <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="' + tr_id + '_dropdownMenuButton2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n' +
-                '                                                        选择审批人\n' +
+                '                                                        选择上报人\n' +
                 '                                                    </button>\n' +
                 '                                                    <div class="dropdown-menu dropdown-menu-right" id="' + tr_id + '_dropdownMenu2" aria-labelledby="' + tr_id + '_dropdownMenuButton2" style="width:220px">\n' +
                 '                                                        <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"\n' +

+ 13 - 1
app/service/payment_folder.js

@@ -64,7 +64,19 @@ module.exports = app => {
                     throw '您没有权限删除此目录';
                 }
                 let ids = [info.id];
-                if (info.parent_path) {
+                if (info.parent_id === 0) {
+                    const childList = await this.getAllDataByCondition({ where: { parent_id: info.id } });
+                    if (childList.length > 0) {
+                        ids = [...ids, ...this._.map(childList, 'id')];
+                        for (const c of childList) {
+                            const deleteData = await this.getDataByParentPath(this.tableName, c.parent_path + '-' + c.id + '%', transaction);
+                            if (deleteData.length > 0) {
+                                const delids = this._.map(deleteData, 'id');
+                                ids = [...ids, ...delids];
+                            }
+                        }
+                    }
+                } else if (info.parent_path) {
                     const deleteData = await this.getDataByParentPath(this.tableName, info.parent_path + '-' + info.id + '%', transaction);
                     if (deleteData.length > 0) {
                         const delids = this._.map(deleteData, 'id');

+ 2 - 2
app/service/payment_tender.js

@@ -35,13 +35,13 @@ module.exports = app => {
             if (typeValues.length === 0) {
                 return -1;
             }
-            const sql = 'SELECT pt.*, pa.name as user_name FROM ?? as pt LEFT JOIN ?? as pa ON pt.`uid` = pa.`id` WHERE pid = ? AND pt.`uid` = ? ' +
+            const sql = 'SELECT pt.*, pa.name as user_name FROM ?? as pt LEFT JOIN ?? as pa ON pt.`uid` = pa.`id` WHERE pid = ? AND (pt.`uid` = ? ' +
                 'OR pt.`id` in (SELECT pr.`tender_id` FROM ?? as pr WHERE pr.`uid` = ? AND pr.`type` IN (' + this.ctx.helper.getInArrStrSqlFilter(typeValues) + '))' +
                 'OR pt.`id` in (SELECT pd.`tender_id` FROM ?? as pd WHERE pd.`uid` = ?)' +
                 'OR pt.`id` in (SELECT pda.`tender_id` FROM ?? as pda LEFT JOIN ?? as pd ON pda.`tender_id` = pd.`tender_id` ' +
                 'WHERE pd.`status` != ' + auditConst.status.uncheck + ' AND pda.`aid` = ?)' +
                 'OR pt.`id` in (SELECT pra.`tender_id` FROM ?? as pra LEFT JOIN ?? as pd ON pra.`tender_id` = pd.`tender_id` ' +
-                'WHERE pd.`status` != ' + auditConst.status.uncheck + ' AND pd.`status` !=' + auditConst.status.checkNo + ' AND pra.`uid` = ?)';
+                'WHERE pd.`status` != ' + auditConst.status.uncheck + ' AND pd.`status` !=' + auditConst.status.checkNo + ' AND pra.`uid` = ?))';
             const params = [this.tableName, this.ctx.service.projectAccount.tableName, this.ctx.session.sessionProject.id, uid,
                 this.ctx.service.paymentTenderRpt.tableName, uid,
                 this.ctx.service.paymentDetail.tableName, uid,

+ 1 - 0
app/view/payment/detail.ejs

@@ -23,6 +23,7 @@
                 ) { %>
                 <a href="#sub-sp5" data-toggle="modal" data-target="#sub-sp5" class="btn btn-sm btn-primary pull-right mr-2">签字意见</a>
                 <% } %>
+                <a href="#sign-flow" data-toggle="modal" data-target="#sign-flow" class="btn btn-sm btn-outline-success pull-right mr-2">签署进度</a>
                 <% } %>
             </div>
         </div>

+ 76 - 0
app/view/payment/detail_modal.ejs

@@ -100,4 +100,80 @@
     </div>
 </div>
 <% } %>
+<!--签署进度-->
+<div class="modal fade" id="sign-flow" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">签署进度</h5>
+            </div>
+            <div class="modal-body">
+                <table class="table table-bordered">
+                    <thead class="text-center">
+                    <tr>
+                        <th>序号</th>
+                        <th>表单角色</th>
+                        <th>签署人</th>
+                        <th>签字</th>
+                        <th>签章</th>
+                    </tr>
+                    </thead>
+                    <tbody>
+                    <tr class="text-center">
+                        <td>1</td>
+                        <td>监理公司</td>
+                        <td>仁温书</td>
+                        <td><i class="fa fa-check text-success"></i></td>
+                        <td><img src="img/seal.png" alt="" > </td>
+                    </tr>
+                    <tr class="text-center">
+                        <td>2</td>
+                        <td>造价咨询单位</td>
+                        <td>玉安然</td>
+                        <td><i class="fa fa-check text-success"></i></td>
+                        <td></td>
+                    </tr>
+                    <tr class="text-center">
+                        <td>3</td>
+                        <td>经办人</td>
+                        <td>李四</td>
+                        <td><i class="fa fa-check text-success"></i></td>
+                        <td></td>
+                    </tr>
+                    <tr class="text-center">
+                        <td>4</td>
+                        <td>合同管理人</td>
+                        <td>王五</td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr class="text-center">
+                        <td>5</td>
+                        <td>相关科室负责人</td>
+                        <td>张三</td>
+                        <td><i class="fa fa-check text-success"></i></td>
+                        <td><img src="img/seal.png" alt="" class="img-fluid"> </td>
+                    </tr>
+                    <tr class="text-center">
+                        <td>6</td>
+                        <td>计划财务科科长</td>
+                        <td>老六</td>
+                        <td><i class="fa fa-check text-success"></i></td>
+                    </tr>
+                    <tr class="text-center">
+                        <td>7</td>
+                        <td>分管领导</td>
+                        <td>邓莹洁</td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    </tbody>
+                </table>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
 <% include ./audit_modal.ejs %>

+ 1 - 1
app/view/payment/list_modal.ejs

@@ -75,7 +75,7 @@
                     <div class="form-group">
                         <!--<a href="#" class="float-right"><i class="fa fa-cog"></i></a>-->
                         <label for="add-detail-code">期数</label>
-                        <input type="text" class="form-control form-control-sm"  value="第<%- !trDetailList ? 1 : (trDetailList && trDetailList.length >= 1 ? trDetailList[0].order + 1 : '') %>期" readonly>
+                        <input type="text" class="form-control form-control-sm"  value="第<%- (!trDetailList || trDetailList.length === 0 ? '1' : (trDetailList && trDetailList.length >= 1 ? trDetailList[0].order + 1 : '')) %>期" readonly>
                     </div>
                     <div class="form-group">
                         <!--<a href="#" class="float-right"><i class="fa fa-cog"></i></a>-->