Explorar o código

修复获取清单数量问题

laiguoran %!s(int64=3) %!d(string=hai) anos
pai
achega
ef53a6f440
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      app/controller/material_controller.js

+ 2 - 1
app/controller/material_controller.js

@@ -333,7 +333,8 @@ module.exports = app => {
                     }
                 }
                 // 取所有已被调用的工料清单表
-                renderData.materialListData = await ctx.service.materialList.getAllDataByCondition({ tid: ctx.tender.id, mid: ctx.material.id });
+                const materialListData = await ctx.service.materialList.getAllDataByCondition({ where: { tid: ctx.tender.id, mid: ctx.material.id } });
+                renderData.materialListData = ctx.helper._.uniqBy(materialListData, 'mb_id');
                 // 基数
                 // if (!ctx.material.readOnly) {
                 const stage_list = await ctx.service.stage.getStageMsgByStageId(ctx.material.stage_id);