This commit is contained in:
zhangds 2022-10-26 10:52:55 +08:00
commit 3e72ae9484
2 changed files with 8 additions and 19 deletions

View File

@ -153,6 +153,7 @@ export default class exchangeAdd extends React.Component {
} }
} }
const checkedArray = [] /* 要勾选得数据 */
/* 处理新老数据 */ /* 处理新老数据 */
if (resData.length > 0) { if (resData.length > 0) {
let new_ids = [] /* 新数据唯一id */ let new_ids = [] /* 新数据唯一id */
@ -160,6 +161,11 @@ export default class exchangeAdd extends React.Component {
codeInfo.range = resData.map((item) => { codeInfo.range = resData.map((item) => {
if (item?.id) { if (item?.id) {
/* 老数据 */ /* 老数据 */
checkedArray.push({
key: item.only,
text: item.product_name,
id: item.id
})
item.checked = true item.checked = true
old_ids.push(item.id) old_ids.push(item.id)
} else { } else {
@ -189,23 +195,6 @@ export default class exchangeAdd extends React.Component {
arr.push(obj) arr.push(obj)
return 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 */ /* 统一设置state */
this.setState({ this.setState({
@ -213,7 +202,7 @@ export default class exchangeAdd extends React.Component {
isload: true, isload: true,
tempdata: reqCopy.goods || [], tempdata: reqCopy.goods || [],
plan_time: [reqCopy.plan.start_time, reqCopy.plan.end_time], plan_time: [reqCopy.plan.start_time, reqCopy.plan.end_time],
rank: arr, rank: checkedArray,
rankoptions: arr rankoptions: arr
}) })

View File

@ -266,7 +266,7 @@ export default class acclist extends React.Component {
onPreview(e,row) { onPreview(e,row) {
let previewInfo=row[typeList[row.page]]; 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) { closePhone(e) {