Commit cced51fc5f94a6684cade60d650c578c541de2f6
1 parent
c999b859
处理默认值不能置空问题;
Showing
1 changed file
with
14 additions
and
11 deletions
src/components/QuickQuote/index.jsx
| @@ -174,13 +174,16 @@ const QuickQuoteEvent = props => { | @@ -174,13 +174,16 @@ const QuickQuoteEvent = props => { | ||
| 174 | if (downAbleConfigsNew.length) { | 174 | if (downAbleConfigsNew.length) { |
| 175 | const slaveDataNew = slaveData.map(item => { | 175 | const slaveDataNew = slaveData.map(item => { |
| 176 | let sBackProcessData = []; | 176 | let sBackProcessData = []; |
| 177 | - downAbleConfigsNew.forEach(({ sChineseDropDown: sChineseDropDownStr, sDefaultProcessId, sName }) => { | 177 | + downAbleConfigsNew.forEach(({ sChineseDropDown: sChineseDropDownStr, sDefaultProcessId, sName, sId }) => { |
| 178 | const sChineseDropDown = commonUtils.convertStrToObj(sChineseDropDownStr, []); | 178 | const sChineseDropDown = commonUtils.convertStrToObj(sChineseDropDownStr, []); |
| 179 | const defaultProcess = sChineseDropDown.find(item => item.sId === sDefaultProcessId); | 179 | const defaultProcess = sChineseDropDown.find(item => item.sId === sDefaultProcessId); |
| 180 | const name = `slaveDown${item.sBoxModel}`; | 180 | const name = `slaveDown${item.sBoxModel}`; |
| 181 | const sFieldName = sName; | 181 | const sFieldName = sName; |
| 182 | const changeValue = { [sFieldName]: defaultProcess.sId }; | 182 | const changeValue = { [sFieldName]: defaultProcess.sId }; |
| 183 | - const dropDownData = sChineseDropDown; | 183 | + const dropDownData = sChineseDropDown.map(item => ({ |
| 184 | + ...item, | ||
| 185 | + sProductClassifyId: sId, | ||
| 186 | + })); | ||
| 184 | const slaveDataReturn = onDataChange(name, sFieldName, changeValue, item.sId, dropDownData, true); | 187 | const slaveDataReturn = onDataChange(name, sFieldName, changeValue, item.sId, dropDownData, true); |
| 185 | sBackProcessData = [...sBackProcessData, ...slaveDataReturn.sBackProcessData]; | 188 | sBackProcessData = [...sBackProcessData, ...slaveDataReturn.sBackProcessData]; |
| 186 | }); | 189 | }); |
| @@ -2105,14 +2108,14 @@ const BoxComponent = props => { | @@ -2105,14 +2108,14 @@ const BoxComponent = props => { | ||
| 2105 | if ( | 2108 | if ( |
| 2106 | (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) || | 2109 | (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) || |
| 2107 | (Number(sStripType) === 1 && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) || | 2110 | (Number(sStripType) === 1 && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) || |
| 2108 | - slaveRowData.sName ==='卡牌' | 2111 | + slaveRowData.sName === "卡牌" |
| 2109 | ) { | 2112 | ) { |
| 2110 | const slaveNewData = slaveRowData.upAbleConfigsExtra || JSON.parse(slaveRowData.sColumnNameConfig); | 2113 | const slaveNewData = slaveRowData.upAbleConfigsExtra || JSON.parse(slaveRowData.sColumnNameConfig); |
| 2111 | const tables = [ | 2114 | const tables = [ |
| 2112 | { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, | 2115 | { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, |
| 2113 | { name: "盒身", value: slaveRowData.sBoxBody, type: slaveRowData.sTypes }, | 2116 | { name: "盒身", value: slaveRowData.sBoxBody, type: slaveRowData.sTypes }, |
| 2114 | - { name: "盒长", value:slaveRowData.dL ? slaveRowData.dL : masterData.dLength ? Number(masterData.dLength) : 0, type: null }, | ||
| 2115 | - { name: "盒宽", value: slaveRowData.dW ? slaveRowData.dW :masterData.dWidth ? Number(masterData.dWidth) : 0, type: null }, | 2117 | + { name: "盒长", value: slaveRowData.dL ? slaveRowData.dL : masterData.dLength ? Number(masterData.dLength) : 0, type: null }, |
| 2118 | + { name: "盒宽", value: slaveRowData.dW ? slaveRowData.dW : masterData.dWidth ? Number(masterData.dWidth) : 0, type: null }, | ||
| 2116 | { name: "盒高", value: masterData.dHeight ? Number(masterData.dHeight) : 0, type: null }, | 2119 | { name: "盒高", value: masterData.dHeight ? Number(masterData.dHeight) : 0, type: null }, |
| 2117 | ]; | 2120 | ]; |
| 2118 | const titleList1 = [ | 2121 | const titleList1 = [ |
| @@ -2146,7 +2149,7 @@ const BoxComponent = props => { | @@ -2146,7 +2149,7 @@ const BoxComponent = props => { | ||
| 2146 | }; | 2149 | }; |
| 2147 | 2150 | ||
| 2148 | // 确认是竖向排列还是横向排列 | 2151 | // 确认是竖向排列还是横向排列 |
| 2149 | - const L = masterData?.dLength || 0; | 2152 | + const L = masterData?.dLength || 0; |
| 2150 | const W = masterData?.dWidth || 0; | 2153 | const W = masterData?.dWidth || 0; |
| 2151 | const H = masterData?.dWidth || 0; | 2154 | const H = masterData?.dWidth || 0; |
| 2152 | const D = masterData?.dHeight || 0; | 2155 | const D = masterData?.dHeight || 0; |
| @@ -2202,8 +2205,8 @@ const BoxComponent = props => { | @@ -2202,8 +2205,8 @@ const BoxComponent = props => { | ||
| 2202 | dSvgBoxHeight: 200, | 2205 | dSvgBoxHeight: 200, |
| 2203 | showNew: 1, | 2206 | showNew: 1, |
| 2204 | }; | 2207 | }; |
| 2205 | - console.log(boxList,'boxList'); | ||
| 2206 | - | 2208 | + console.log(boxList, "boxList"); |
| 2209 | + | ||
| 2207 | // upViewProps.viewRow = | 2210 | // upViewProps.viewRow = |
| 2208 | 2211 | ||
| 2209 | const isShowImg = boxList.find(x => x.sName === "盒身")?.type !== "" || false; | 2212 | const isShowImg = boxList.find(x => x.sName === "盒身")?.type !== "" || false; |
| @@ -2218,8 +2221,8 @@ const BoxComponent = props => { | @@ -2218,8 +2221,8 @@ const BoxComponent = props => { | ||
| 2218 | { src: slaveRowData.sPackDetailPathUpLoad, alt: "展开图" }, | 2221 | { src: slaveRowData.sPackDetailPathUpLoad, alt: "展开图" }, |
| 2219 | { src: slaveRowData.sPackPath, alt: "立体图" }, | 2222 | { src: slaveRowData.sPackPath, alt: "立体图" }, |
| 2220 | ]; | 2223 | ]; |
| 2221 | - console.log(state,'activeKey'); | ||
| 2222 | - const {activeKey = 0} = state | 2224 | + console.log(state, "activeKey"); |
| 2225 | + const { activeKey = 0 } = state; | ||
| 2223 | return ( | 2226 | return ( |
| 2224 | <Tabs | 2227 | <Tabs |
| 2225 | key={boxModel} | 2228 | key={boxModel} |
| @@ -2270,7 +2273,7 @@ const BoxComponent = props => { | @@ -2270,7 +2273,7 @@ const BoxComponent = props => { | ||
| 2270 | props.setState(pre => ({ | 2273 | props.setState(pre => ({ |
| 2271 | ...pre, | 2274 | ...pre, |
| 2272 | slaveData: [...slaveData], | 2275 | slaveData: [...slaveData], |
| 2273 | - activeKey:1 | 2276 | + activeKey: 1, |
| 2274 | })); | 2277 | })); |
| 2275 | }} | 2278 | }} |
| 2276 | value={radioValue} | 2279 | value={radioValue} |