Commit a6d5f49a683c171394538ccbe98164c58265f748
1 parent
1cd19c95
1.增加恢复生产,托盘计数需要叠加恢复生产的dQtyUp数据值
Showing
1 changed file
with
12 additions
and
4 deletions
src/components/Common/CommonTable/index.js
| ... | ... | @@ -1912,7 +1912,7 @@ class CommonTableRc extends React.Component { |
| 1912 | 1912 | |
| 1913 | 1913 | if (dQty) { |
| 1914 | 1914 | dQty.render = (value, record) => { |
| 1915 | - const { iJobStatus } = record; | |
| 1915 | + const { iJobStatus, dQtyUp = 0 } = record; | |
| 1916 | 1916 | if (iJobStatus !== 1) { |
| 1917 | 1917 | return ( |
| 1918 | 1918 | <span class="noInput"> |
| ... | ... | @@ -1922,7 +1922,7 @@ class CommonTableRc extends React.Component { |
| 1922 | 1922 | } else { |
| 1923 | 1923 | return ( |
| 1924 | 1924 | <span class="noInput"> |
| 1925 | - <DqtyComponent /> | |
| 1925 | + <DqtyComponent dQtyUp={dQtyUp} /> | |
| 1926 | 1926 | </span> |
| 1927 | 1927 | ); |
| 1928 | 1928 | } |
| ... | ... | @@ -12535,7 +12535,7 @@ const TEndDateComponent = () => { |
| 12535 | 12535 | return <span>{value}</span>; |
| 12536 | 12536 | }; |
| 12537 | 12537 | |
| 12538 | -const DqtyComponent = () => { | |
| 12538 | +const DqtyComponent = ({ dQtyUp = 0 }) => { | |
| 12539 | 12539 | const oDTrayQty = document.querySelector("#MesDynamicNum_dTrayQty"); |
| 12540 | 12540 | if (!oDTrayQty) return <span>0</span>; |
| 12541 | 12541 | |
| ... | ... | @@ -12543,7 +12543,15 @@ const DqtyComponent = () => { |
| 12543 | 12543 | useEffect(() => { |
| 12544 | 12544 | const getValue = () => { |
| 12545 | 12545 | const temp = oDTrayQty.innerHTML?.replace(/\,/g, ""); |
| 12546 | - setValue(temp); | |
| 12546 | + let showNum = temp; | |
| 12547 | + // 只有dQtyUp不为0才叠加,等于0就保持原值 | |
| 12548 | + if (Number(dQtyUp) !== 0) { | |
| 12549 | + const rawNum = Number(temp); | |
| 12550 | + const total = rawNum + Number(dQtyUp); | |
| 12551 | + showNum = String(total); | |
| 12552 | + } | |
| 12553 | + | |
| 12554 | + setValue(showNum); | |
| 12547 | 12555 | }; |
| 12548 | 12556 | |
| 12549 | 12557 | getValue(); | ... | ... |