Commit 45159bb9 authored by dragondean@qq.com's avatar dragondean@qq.com

入仓单打印增加汇总

parent 16dbb0c8
......@@ -60,6 +60,35 @@
</td>
</tr>
</template>
<tr>
<td style="text-align:center;width: 50px;" v-if="!preview">
</td>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;">
</td>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;">
</td>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;">
{{calcTotal('cartonsNum')}}
</td>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;">
</td>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;">
{{calcTotal('volume')}}
</td>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;">
{{calcTotal('weight')}}
</td>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;">
</td>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;" v-if="!preview">
</td>
</tr>
</table>
</div>
<!--edit by liuyc 20210121 结尾增加文字-->
......@@ -80,6 +109,7 @@ import {parseTime} from '@/utils/ruoyi'
import lodop from '@/utils/lodop'
import {getOrderWarehouseIn, getOrderDetail} from '@/api/ecw/order'
import qrcode from 'qrcode'
import Decimal from 'decimal.js'
export default {
filters: {parseTime},
components: { },
......@@ -136,6 +166,17 @@ export default {
})
})
return arr
},
calcTotal(){
return field =>{
let total = new Decimal(0)
this.items.forEach(item => {
if(!this.preview || item.checked){
total = total.plus(item[field] || 0)
}
})
return total.toNumber()
}
}
},
watch:{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment