Browse Source

计价规范下,项目节、工程量清单,可选列表按添加顺序排序

MaiXinRong 5 years ago
parent
commit
14d3ba578a
1 changed files with 6 additions and 0 deletions
  1. 6 0
      app/service/valuation.js

+ 6 - 0
app/service/valuation.js

@@ -45,10 +45,16 @@ module.exports = app => {
                 where: {id: billsId},
                 columns: ['id', 'name'],
             });
+            billsList.sort(function (a, b) {
+                return billsId.indexOf(a.id) - billsList.indexOf(b.id);
+            });
             const chapterList = await this.db.select('zh_std_xmj_list', {
                 where: {id: chaptersId},
                 columns: ['id', 'name'],
             });
+            chapterList.sort(function (a, b) {
+                return chaptersId.indexOf(a.id) - chapterList.indexOf(b.id);
+            });
             return [billsList, chapterList];
         }