diff --git a/src/pages/exchangecode/exchangecodeAdd/index.jsx b/src/pages/exchangecode/exchangecodeAdd/index.jsx index 2556e75b..a26d7666 100644 --- a/src/pages/exchangecode/exchangecodeAdd/index.jsx +++ b/src/pages/exchangecode/exchangecodeAdd/index.jsx @@ -153,6 +153,7 @@ export default class exchangeAdd extends React.Component { } } + const checkedArray = [] /* 要勾选得数据 */ /* 处理新老数据 */ if (resData.length > 0) { let new_ids = [] /* 新数据唯一id */ @@ -160,6 +161,11 @@ export default class exchangeAdd extends React.Component { codeInfo.range = resData.map((item) => { if (item?.id) { /* 老数据 */ + checkedArray.push({ + key: item.only, + text: item.product_name, + id: item.id + }) item.checked = true old_ids.push(item.id) } else { @@ -189,23 +195,6 @@ export default class exchangeAdd extends React.Component { arr.push(obj) return obj }) - // is_delete 有值,不勾选 - _.map(reqCopy.goods, (item) => { - if (item.type === 2) { - if (item.origin.is_delete) { - item.checked = false - } else { - item.checked = true - } - } else { - if (item.is_delete) { - item.checked = false - } else { - item.checked = true - } - } - return item - }) /* 统一设置state */ this.setState({ @@ -213,7 +202,7 @@ export default class exchangeAdd extends React.Component { isload: true, tempdata: reqCopy.goods || [], plan_time: [reqCopy.plan.start_time, reqCopy.plan.end_time], - rank: arr, + rank: checkedArray, rankoptions: arr }) diff --git a/src/pages/exchangepage/main/main.js b/src/pages/exchangepage/main/main.js index 20fbbcc8..f7ecbb85 100644 --- a/src/pages/exchangepage/main/main.js +++ b/src/pages/exchangepage/main/main.js @@ -266,7 +266,7 @@ export default class acclist extends React.Component { onPreview(e,row) { let previewInfo=row[typeList[row.page]]; - this.setState({ preview_visible: true,previewData:previewInfo}); + this.setState({ preview_visible: true,previewData:previewInfo,showType:row.page}); } closePhone(e) {