Commit 4f9a5a4d28c950a067dbc38858a8f95becc76cfe
1 parent
996bb84b
快速报价app
Showing
2 changed files
with
31 additions
and
27 deletions
src/components/Common/Typesetting/typesetting.js
| ... | ... | @@ -270,7 +270,6 @@ const Typesetting = props => { |
| 270 | 270 | const isCustomized = bAdvancedSetting; |
| 271 | 271 | |
| 272 | 272 | let remaining = isVertical ? commonHeightCheck : commonWidthCheck; |
| 273 | - console.log(commonWidthCheck,commonHeightCheck,remainingWidth,remainingHeight,remaining,'remaining'); | |
| 274 | 273 | |
| 275 | 274 | // 判断 |
| 276 | 275 | // const remaining = false; | ... | ... |
src/mobile/quotation/detailNew.jsx
| ... | ... | @@ -1152,7 +1152,7 @@ const QuotationDetail = props => { |
| 1152 | 1152 | item.iColValue = viewConfigs[0].iColValue; |
| 1153 | 1153 | }); |
| 1154 | 1154 | } |
| 1155 | - if (selectedNode.sTypeKey !== "danye") { | |
| 1155 | + if (selectedNode && selectedNode.sTypeKey && selectedNode.sTypeKey !== "danye") { | |
| 1156 | 1156 | if (lengthData) { |
| 1157 | 1157 | lengthData.showName = "高(D)"; |
| 1158 | 1158 | lengthData.sChinese = "高(D)"; |
| ... | ... | @@ -1237,7 +1237,10 @@ const MasterComponent = props => { |
| 1237 | 1237 | ...props, |
| 1238 | 1238 | itemDetail: sDeliverName, |
| 1239 | 1239 | }; |
| 1240 | - | |
| 1240 | + console.log(viewConfigs, "viewConfigs"); | |
| 1241 | + const viewConfigsList = viewConfigs.filter( | |
| 1242 | + x => x.sName !== "sCustomerName" && x.sName !== "sProductName" && x.sName !== "dLength" && x.sName !== "dWidth" && x.sName !== "dHeight" | |
| 1243 | + ); | |
| 1241 | 1244 | return ( |
| 1242 | 1245 | <div> |
| 1243 | 1246 | <div className={styles.customer}> |
| ... | ... | @@ -1281,19 +1284,19 @@ const MasterComponent = props => { |
| 1281 | 1284 | )} |
| 1282 | 1285 | </div> |
| 1283 | 1286 | </div> |
| 1284 | - <div className={styles.sizeBox}> | |
| 1285 | - <div className={styles.customer}> | |
| 1286 | - <div>数量</div> | |
| 1287 | - <SelectInput {...dProductQtyProps} bCanInput={true} /> | |
| 1288 | - </div> | |
| 1289 | - <div className={styles.customer}> | |
| 1290 | - <div>单位</div> | |
| 1291 | - <SelectInput {...sProductUnitProps} /> | |
| 1292 | - </div> | |
| 1293 | - <div className={styles.customer}> | |
| 1294 | - <div>收货方式</div> | |
| 1295 | - <SelectInput {...sDeliverNameProps} /> | |
| 1296 | - </div> | |
| 1287 | + <div > | |
| 1288 | + <Grid columns={3} gap={8}> | |
| 1289 | + {viewConfigsList.map(item => { | |
| 1290 | + return ( | |
| 1291 | + <Grid.Item> | |
| 1292 | + <div className={styles.customer}> | |
| 1293 | + <div>{item.showName}</div> | |
| 1294 | + <SelectInput {...props} itemDetail={item} /> | |
| 1295 | + </div> | |
| 1296 | + </Grid.Item> | |
| 1297 | + ); | |
| 1298 | + })} | |
| 1299 | + </Grid> | |
| 1297 | 1300 | </div> |
| 1298 | 1301 | </div> |
| 1299 | 1302 | ); |
| ... | ... | @@ -1504,14 +1507,15 @@ const BoxComponent = props => { |
| 1504 | 1507 | // if(!masterData) return |
| 1505 | 1508 | if ( |
| 1506 | 1509 | (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) || |
| 1507 | - (Number(sStripType) === 1 && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) | |
| 1510 | + (Number(sStripType) === 1 && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) || | |
| 1511 | + slaveRowData.sName === "卡牌" | |
| 1508 | 1512 | ) { |
| 1509 | - const slaveNewData = slaveRowData.upAbleConfigsExtra; | |
| 1513 | + const slaveNewData = slaveRowData.upAbleConfigsExtra || JSON.parse(slaveRowData.sColumnNameConfig); | |
| 1510 | 1514 | const tables = [ |
| 1511 | 1515 | { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, |
| 1512 | 1516 | { name: "盒身", value: slaveRowData.sBoxBody, type: slaveRowData.sTypes }, |
| 1513 | - { name: "盒长", value: masterData.dLength ? Number(masterData.dLength) : 0, type: null }, | |
| 1514 | - { name: "盒宽", value: masterData.dWidth ? Number(masterData.dWidth) : 0, type: null }, | |
| 1517 | + { name: "盒长", value: slaveRowData.dL ? slaveRowData.dL : masterData.dLength ? Number(masterData.dLength) : 0, type: null }, | |
| 1518 | + { name: "盒宽", value: slaveRowData.dW ? slaveRowData.dW : masterData.dWidth ? Number(masterData.dWidth) : 0, type: null }, | |
| 1515 | 1519 | { name: "盒高", value: masterData.dHeight ? Number(masterData.dHeight) : 0, type: null }, |
| 1516 | 1520 | ]; |
| 1517 | 1521 | const titleList1 = [ |
| ... | ... | @@ -1531,23 +1535,24 @@ const BoxComponent = props => { |
| 1531 | 1535 | // 提取公式中的变量名 |
| 1532 | 1536 | const variableNames = formula.match(/\b[a-zA-Z_][a-zA-Z0-9_]*\b/g) || []; |
| 1533 | 1537 | // 构建函数参数 |
| 1534 | - const params = variableNames.join(","); | |
| 1538 | + const params = variableNames.join(",") + ",Math"; | |
| 1535 | 1539 | // 替换公式中的变量为实际值 |
| 1536 | 1540 | const func = new Function(params, `return ${formula}`); |
| 1537 | 1541 | // 提取变量值 |
| 1538 | 1542 | const args = variableNames.map(name => Number(variables[name]) || 0); |
| 1539 | 1543 | // 执行函数并返回结果 |
| 1540 | - return func(...args); | |
| 1544 | + return func(...args, Math); | |
| 1541 | 1545 | } catch (error) { |
| 1546 | + console.error("公式执行错误:", error); | |
| 1542 | 1547 | return 0; |
| 1543 | 1548 | } |
| 1544 | 1549 | }; |
| 1545 | 1550 | |
| 1546 | 1551 | // 确认是竖向排列还是横向排列 |
| 1547 | - const L = masterData?.dLength; | |
| 1548 | - const W = masterData?.dWidth; | |
| 1549 | - const H = masterData?.dWidth; | |
| 1550 | - const D = masterData?.dHeight; | |
| 1552 | + const L = masterData?.dLength || 0; | |
| 1553 | + const W = masterData?.dWidth || 0; | |
| 1554 | + const H = masterData?.dWidth || 0; | |
| 1555 | + const D = masterData?.dHeight || 0; | |
| 1551 | 1556 | const variables = { |
| 1552 | 1557 | L, |
| 1553 | 1558 | W, |
| ... | ... | @@ -2377,7 +2382,7 @@ const PrintParamsComponent = props => { |
| 2377 | 2382 | // ? props.showConfig.showDropDown |
| 2378 | 2383 | // : commonUtils.objectToArr(commonUtils.convertStrToObj(props.showConfig.showDropDown)); |
| 2379 | 2384 | const showDropDown = item.showDropDown; |
| 2380 | - console.log("🚀 ~ showDropDown:", showDropDown,props.showConfig); | |
| 2385 | + console.log("🚀 ~ showDropDown:", showDropDown, props.showConfig); | |
| 2381 | 2386 | }); |
| 2382 | 2387 | const result = []; |
| 2383 | 2388 | for (let i = 0; i < printParams.length + 1; i++) { | ... | ... |