Commit 049e27ad authored by LeeJiancong's avatar LeeJiancong

'物流栈溢出问题'

parent d47152e5
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Date: 2020-07-28 11:25:30 * @Date: 2020-07-28 11:25:30
* @LastEditors: LeeJiancong * @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com * @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-29 10:05:44 * @LastEditTime: 2020-09-29 10:54:58
*/ */
import React, { Component, useEffect, useRef, useState, ReactNode } from 'react' import React, { Component, useEffect, useRef, useState, ReactNode } from 'react'
...@@ -36,6 +36,7 @@ import { ...@@ -36,6 +36,7 @@ import {
useFormSpy, useFormSpy,
createFormActions createFormActions
} from '@formily/antd' } from '@formily/antd'
import createAscyncActions from '@formily/antd/esm'
import { import {
Input, Input,
NumberPicker, NumberPicker,
...@@ -543,10 +544,11 @@ const Deatail: React.FC<{}> = () => { ...@@ -543,10 +544,11 @@ const Deatail: React.FC<{}> = () => {
const useTabEffect = () => { const useTabEffect = () => {
const { setFieldValue } = createFormActions() const { setFieldValue } = createFormActions()
onFieldValueChange$('detailList').subscribe(({ value }) => { onFieldValueChange$('detailList').subscribe(({ value }) => {
setFieldValue('detailList', value) // setFieldValue('detailList', [...value])
let detailData = value let detailData = [...value]
computedALL(detailData) computedALL(detailData)
}) })
} }
/** /**
...@@ -555,8 +557,12 @@ const Deatail: React.FC<{}> = () => { ...@@ -555,8 +557,12 @@ const Deatail: React.FC<{}> = () => {
* @return {type} * @return {type}
*/ */
const computedALL = (data) => { const computedALL = (data) => {
let _totalCarton = 0, _totalVolume = 0, _totalWeight = 0 let _totalCarton = 0, _totalVolume = 0, _totalWeight = 0
if (data && data.length > 0) { if (data && data.length > 0) {
console.log('全部',data)
data.forEach(v => { data.forEach(v => {
if (v.amount && v.carton) { if (v.amount && v.carton) {
_totalCarton += Number(v.carton) _totalCarton += Number(v.carton)
...@@ -569,6 +575,7 @@ const Deatail: React.FC<{}> = () => { ...@@ -569,6 +575,7 @@ const Deatail: React.FC<{}> = () => {
} }
}); });
} }
setTotalCarton(_totalCarton) setTotalCarton(_totalCarton)
setTotalVolume(_totalVolume) setTotalVolume(_totalVolume)
setTotalWeight(_totalWeight) setTotalWeight(_totalWeight)
......
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