Commit 89116767 by wong.peiyi

修复自助下单耗材会变2倍问题

parent 30835c4d
......@@ -1548,7 +1548,8 @@ class SelfOrderPage extends Component {
local_lines.forEach(sup_item => {
if (sup_item[LocalVariable.SELECTED_QUQNTITY] > 0 && sup_item.leftOptionList && sup_item.leftOptionList.length > 0) {
sup_item.leftOptionList.map(lef_item => {
let select_arr = lef_item[LocalVariable.SELECTED_DATA_ARR]
// let select_arr = lef_item[LocalVariable.SELECTED_DATA_ARR]
let select_arr = lef_item.selectedArr || []
if (lef_item[LocalVariable.SELECTED_QUQNTITY] > 0 && select_arr && select_arr.length > 0) {
if (lef_item.category_code === LocalVariable.SURGICAL_TEMPLATE) {
// 手术套包
......
......@@ -12,6 +12,7 @@ import { reqPurSupplierSearch, reqProCategorySearch, reqSurTempHeadSearch, reqNa
import LoadingModel from '../../common/listDataComponent/LoadingModel';
import LocalVariable from '../../common/LocalVariable';
import { exitLoginStatus } from '../../../action/LoginAction';
import * as R from 'ramda';
class ChooseProductPage extends Component {
constructor(props) {
......@@ -363,21 +364,16 @@ class ChooseProductPage extends Component {
if (leIndex === leftActiveIndex) {
// 当前选择项
leItem[LocalVariable.SELECTED_QUQNTITY] = count
if (leItem[LocalVariable.LOCAL_SECOND_DATA].length > 0) {
leItem[LocalVariable.SELECTED_DATA_ARR] = []
leItem[LocalVariable.LOCAL_SECOND_DATA].forEach(function (chItem) {
if (chItem[coutFieName]) {
leItem[LocalVariable.SELECTED_DATA_ARR].push(chItem)
}
})
}
const selectData = R.filter(R.compose(R.lt(0), R.prop(coutFieName)))(leItem[LocalVariable.LOCAL_SECOND_DATA])
leItem.selectedArr = selectData
// 原本是赋值给这个对象属性的,但不知道哪里这个对象属性会把第四个以后的所选耗材放到第四个上,
// 所以最后计算的时候使用属性 selectedArr
leItem[LocalVariable.SELECTED_DATA_ARR] = R.clone(selectData)
}
top_sel_sum += leItem[LocalVariable.SELECTED_QUQNTITY]
})
topProcOptionList[topActiveIndex][LocalVariable.SELECTED_QUQNTITY] = top_sel_sum
this.setState({
topProcOptionList
})
this.setState({ topProcOptionList })
}
// 关闭已选弹窗
......@@ -543,7 +539,6 @@ class ChooseProductPage extends Component {
})
}
})
this.setState({
topProcOptionList: topProcOptionList
})
......
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