如何在哈巴狗中执行算术运算

时间:2018-03-05 05:31:28

标签: pug jade4j

我正在使用下面的代码行,我试图减去两个结果以得到第三个结果,但是我收到了一个错误。请告诉我如何在Pug中进行减法。

代码:

 mixin dispatch-summary(dispatched)
  - var count = 0
  table
    caption.align-left.font-bold DISPATCHED RECORDS
      tr
        th.align-center.font-bold S.NO
        th.align-center.font-bold Dispatch Id
        th.align-center.font-bold Projects
        th.align-center.font-bold HardwareBoxes
        th.align-center.font-bold PanelBoxes
        th.align-center.font-bold TotalParts
        th.align-center.font-bold DispatchedParts
        th.align-center.font-bold PendingParts
        th.align-center.font-bold TotalHardware
        th.align-center.font-bold TotalHardwareDispatched
        th.align-center.font-bold TotalHardwarePending


        each task in dispatched
          -var dispatch_id= task.dispatch_id
          -var project = task.project
          -var hardware_boxes = task.hardware_boxes
          -var panel_boxes = task.Panel_boxes
          -var total_parts = task.total_parts
          -var dispatched_parts = task.dispatched_parts
          -var pending_parts = (task.total_parts)-(task.dispatched_parts)
          -var total_hardware = task.total_hardware
          -var total_hardware_dispatched = task.total_hardware_dispatched
          -var total_hardware_pending =(task.total_hardware)-(task.total_hardware_dispatched)

          tr
            td.font-bold=++count
            td.align-left= dispatch_id
            td.align-left= project
            td.align-left= hardware_boxes
            td.align-left= panel_boxes
            td.align-left= total_parts
            td.align-left= dispatched_parts
            td.align-left= pending_parts
            td.align-left= total_hardware
            td.align-left= total_hardware_dispatched
            td.align-left= total_hardware_pending

注意:在上面的代码中,我想减去total_partsdispatched_parts以获得总数pending_parts

-var pending_parts =(task.total_parts) - (task.dispatched_pa​​rts)

0 个答案:

没有答案