Explorar o código

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

MaiXinRong %!s(int64=5) %!d(string=hai) anos
pai
achega
14d3ba578a
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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];
         }