Commit 64a0d720 by Denglingling

调整选择产品-耗材数量显示问题

parent 302506fe
......@@ -114,9 +114,9 @@ class ProductModel extends Component {
// 耗材清空图标回调
handleClearBack(item, index, superIndex) {
let { orginOptionList, topProcOptionList } = this.state
console.log('耗材😋=====', item, index, superIndex)
console.log('耗材😋=====', orginOptionList)
console.log('耗材😋=====', topProcOptionList)
// console.log('耗材😋=====', item, index, superIndex)
// console.log('耗材😋=====', orginOptionList)
// console.log('耗材😋=====', topProcOptionList)
// 耗材当前清空项
let allCountQuantity = 0 // 初始化
......@@ -165,8 +165,8 @@ class ProductModel extends Component {
console.log('🆕topProcOptionList=====', topProcOptionList)
console.log('🆕topProcOptionList=====', allCountQuantity)
// console.log('🆕topProcOptionList=====', topProcOptionList)
// console.log('🆕topProcOptionList=====', allCountQuantity)
this.props.changeCallBack(topProcOptionList)
......@@ -240,9 +240,9 @@ class ProductModel extends Component {
// 列表计算后回调
handleCalCallBack(item, index, superIndex) {
console.log('计算后🐒=====', item, index, superIndex)
// console.log('计算后🐒=====', item, index, superIndex)
let { topProcOptionList, topActiveIndex } = this.state
console.log('计算后🐒=====', topProcOptionList)
// console.log('计算后🐒=====', topProcOptionList)
let defauIndex = index
defauIndex = item.superIndex
if (LocalVariable.SELECTED_DATA_ARR && topProcOptionList[topActiveIndex][LocalVariable.SELECTED_DATA_ARR]) {
......@@ -292,7 +292,7 @@ class ProductModel extends Component {
// 手术套包
let deleFlag = false
let deleInd = null
console.log('listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.CHILDREN_LINE_NAME][index]--', listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.CHILDREN_LINE_NAME][index])
// console.log('listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.CHILDREN_LINE_NAME][index]--', listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.CHILDREN_LINE_NAME][index])
// 初始化 三级
listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.CHILDREN_LINE_NAME][index][LocalVariable.QUANTITY_FIELD] = 0
// listItem[LocalVariable.SELECTED_DATA_ARR][defauIndex][LocalVariable.QUANTITY_FIELD] = 0
......@@ -304,7 +304,7 @@ class ProductModel extends Component {
deleFlag = true
deleInd = chInd
}
console.log('相同🧵=====',deleInd, deleFlag)
// console.log('相同🧵=====',deleInd, deleFlag)
}
if (!chIt[LocalVariable.QUANTITY_FIELD]) {
chIt[LocalVariable.QUANTITY_FIELD] = 0
......@@ -397,8 +397,8 @@ class ProductModel extends Component {
allCountQuantity += listItem[LocalVariable.SELECTED_QUQNTITY]
})
console.log('topProcOptionList=====', topProcOptionList)
console.log('topProcOptionList=====', allCountQuantity)
// console.log('topProcOptionList=====', topProcOptionList)
// console.log('topProcOptionList=====', allCountQuantity)
this.props.changeCallBack(topProcOptionList)
......@@ -517,7 +517,7 @@ class ProductModel extends Component {
handleClearRubbish() {
let { orginOptionList, topProcOptionList } = this.state
// this.refs.ClearAllModel.show('清空当前所有数据')
console.log('清空🎹所有==--', this)
// console.log('清空🎹所有==--', this)
// this.modelClearAllCB(true)
......@@ -574,8 +574,8 @@ class ProductModel extends Component {
// 清空所有回调
modelClearAllCB(clear_flag){
console.log('clear_flag===', clear_flag)
console.log('clear_flag===', this)
// console.log('clear_flag===', clear_flag)
// console.log('clear_flag===', this)
let { orginOptionList, topProcOptionList } = this.state
let that = this
if(clear_flag){
......
......@@ -66,7 +66,8 @@ class ChooseProductPage extends Component {
[LocalVariable.SELECTED_DATA_ARR]: [],
[LocalVariable.SELECTED_QUQNTITY]: 0
}],
local_cur_options: []
local_cur_options: [],
cur_hc_opts: []
}
}
......@@ -371,7 +372,7 @@ class ChooseProductPage extends Component {
})
topProcOptionList[topActiveIndex][LocalVariable.SELECTED_QUQNTITY] = top_sel_sum
console.log('topProcOptionList---', topProcOptionList)
// console.log('topProcOptionList---', topProcOptionList)
this.setState({
topProcOptionList
})
......@@ -725,7 +726,7 @@ class ChooseProductPage extends Component {
// 返回底部按钮
renderFooterBtnItem() {
let { selectShowPopup, topProcOptionList, topActiveIndex, local_sel_options, local_cur_options} = this.state
let { selectShowPopup, topProcOptionList, topActiveIndex, local_sel_options, local_cur_options, cur_hc_opts} = this.state
let allCountQuantity = this.getAllCountQuantity()
let cur_sel_options = []
let sel_tip = this.getAllCountQuantity(true)
......@@ -772,13 +773,11 @@ class ChooseProductPage extends Component {
li_obj.left_category_name = left_item.category_name
})
}
cur_sel_options[cur_sel_options.length - 1][LocalVariable.SELECTED_DATA_ARR].push(cur_line_obj)
// let cur_has_sign = []
// cur_has_sign = cur_sel_options[cur_sel_options.length - 1][LocalVariable.SELECTED_DATA_ARR].filter(filt_obj => filt_obj.supplier_code === cur_line_obj.supplier_code)
// console.log('🏠==cur_has_sign===',cur_has_sign)
// console.log('🏠==cur_has_sign===',cur_line_obj)
// if (cur_has_sign.length > 0) {
// cur_sel_options[cur_sel_options.length - 1][LocalVariable.SELECTED_DATA_ARR].forEach(function (sel_arr) {
// if (sel_arr.supplier_code === cur_line_obj.supplier_code) {
......@@ -823,9 +822,9 @@ class ChooseProductPage extends Component {
// sel_arr[LocalVariable.CHILDREN_LINE_NAME].push(...cur_line_obj[LocalVariable.CHILDREN_LINE_NAME])
// }
// else {
// console.log('add➕🏠=====',curHasInd)
// console.log('add➕🏠=====',hasDetails)
// console.log('add➕🏠=====',hasItemCode)
// // console.log('add➕🏠=====',curHasInd)
// // console.log('add➕🏠=====',hasDetails)
// // console.log('add➕🏠=====',hasItemCode)
// // let deIndArr = []
// // sel_arr[LocalVariable.CHILDREN_LINE_NAME].forEach((ch_line, ch_ind) => {
......@@ -850,9 +849,9 @@ class ChooseProductPage extends Component {
// }
// console.log('🏠=====',has_line_sign)
// console.log('🏠=====',cur_line_obj)
// console.log('🏠=====',sel_arr)
// // console.log('🏠=====',has_line_sign)
// // console.log('🏠=====',cur_line_obj)
// // console.log('🏠=====',sel_arr)
// }
// })
// } else {
......@@ -864,11 +863,49 @@ class ChooseProductPage extends Component {
})
}
})
// console.log('传递🚢======', topProcOptionList)
// console.log('传递🚢======', topActiveIndex)
// console.log('传递🚢======', cur_sel_options)
// console.log('传递🚢======', cur_sel_options[cur_sel_options.length - 1][LocalVariable.SELECTED_DATA_ARR])
let cur_hc_arr = [], cur_obj = {}
cur_hc_arr = cloneObject(cur_hc_opts)
if(cur_sel_options[cur_sel_options.length - 1][LocalVariable.SELECTED_DATA_ARR].length >0) {
cur_sel_options[cur_sel_options.length - 1][LocalVariable.SELECTED_DATA_ARR].forEach((hc_item, hc_ind) => {
// console.log('if===', cur_obj)
// console.log('if===', cur_hc_arr)
let curHasSup = cur_hc_arr.filter(su_obj => su_obj.supplier_code === hc_item.supplier_code)
if(curHasSup.length === 0){
cur_hc_arr.push(hc_item)
}else {
cur_hc_arr.map(function (end_item) {
if(end_item.supplier_code === hc_item.supplier_code){
end_item[LocalVariable.SELECTED_QUQNTITY] += hc_item[LocalVariable.SELECTED_QUQNTITY]
for(let line_obj of hc_item[LocalVariable.CHILDREN_LINE_NAME]){
let cur_fil = end_item[LocalVariable.CHILDREN_LINE_NAME].filter(fi_obj => {
if(fi_obj.details && fi_obj.details.length > 0){
return fi_obj.category_code === line_obj.category_code
}else {
return fi_obj.item_code === line_obj.item_code
}
})
if(cur_fil.length === 0 && line_obj[LocalVariable.QUANTITY_FIELD] > 0){
end_item[LocalVariable.CHILDREN_LINE_NAME].push(line_obj)
}
}
end_item[LocalVariable.CHILDREN_LINE_NAME] = end_item[LocalVariable.CHILDREN_LINE_NAME].filter(fil_ob => fil_ob[LocalVariable.QUANTITY_FIELD] > 0)
}
})
}
})
cur_sel_options[cur_sel_options.length - 1][LocalVariable.SELECTED_DATA_ARR] = cur_hc_arr
}
// console.log('传递🚢======', cur_hc_arr)
}
// console.log('传递🚢======', topProcOptionList)
// console.log('传递🚢======', topActiveIndex)
// console.log('传递🚢======', cur_sel_options)
return (
<View style={list_common_item.sub_box}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment