|
@@ -36,6 +36,7 @@ const initSearchList = {
|
|
|
shType:2,
|
|
|
labelListBig:[],//大项
|
|
|
labelListSmall:[],//小项
|
|
|
+ totalOrder:[],//开单项
|
|
|
}
|
|
|
|
|
|
export default (state = initSearchList, action) => {
|
|
@@ -43,8 +44,7 @@ export default (state = initSearchList, action) => {
|
|
|
const newState = Object.assign({}, state);
|
|
|
let tempArr = newState.labelListBig;
|
|
|
let tempArrs = newState.labelListSmall;
|
|
|
- let tmpLis = action.item
|
|
|
-
|
|
|
+ let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempTotalOrder=[];
|
|
|
if(tmpLis&&tmpLis.flg == 1){
|
|
|
for(let i = 0;i < tempArr.length;i++){
|
|
|
if(tempArr[i].time == tmpLis.time){
|
|
@@ -62,13 +62,17 @@ export default (state = initSearchList, action) => {
|
|
|
}
|
|
|
newState.labelListSmall = [...tempArrs]
|
|
|
}
|
|
|
+ tempBigOrder = tempArr.filter((item)=>item.check)
|
|
|
+ tempSmallOrder = tempArrs.filter((item)=>item.check)
|
|
|
+ tempTotalOrder=tempBigOrder.concat(tempSmallOrder)
|
|
|
+ newState.totalOrder=[...tempTotalOrder]
|
|
|
return newState;
|
|
|
}
|
|
|
if (action.type == DEL_ONE_PIC) {
|
|
|
const newState = Object.assign({}, state);
|
|
|
let tempArr = newState.labelListBig;
|
|
|
let tempArrs = newState.labelListSmall;
|
|
|
- let tmpLis = action.item
|
|
|
+ let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempTotalOrder=[];
|
|
|
if(tmpLis&&tmpLis.flg == 1){//大项
|
|
|
tempArr = tempArr.filter((item)=>item.time != tmpLis.time)
|
|
|
newState.labelListBig = [...tempArr]
|
|
@@ -76,6 +80,10 @@ export default (state = initSearchList, action) => {
|
|
|
tempArrs = tempArrs.filter((item)=> item.time != tmpLis.time )
|
|
|
newState.labelListSmall = [...tempArrs]
|
|
|
}
|
|
|
+ tempBigOrder = tempArr.filter((item)=>item.check)
|
|
|
+ tempSmallOrder = tempArrs.filter((item)=>item.check)
|
|
|
+ tempTotalOrder=tempBigOrder.concat(tempSmallOrder)
|
|
|
+ newState.totalOrder=[...tempTotalOrder]
|
|
|
return newState;
|
|
|
}
|
|
|
|
|
@@ -86,7 +94,11 @@ export default (state = initSearchList, action) => {
|
|
|
let tmpLis = action.item
|
|
|
tempArrs = tempArrs.filter((item)=>{
|
|
|
if(item.time == tmpLis.time){
|
|
|
- item.value = action.value
|
|
|
+ if(isNumber(action.value-0)){
|
|
|
+ item.value = action.value
|
|
|
+ }else{
|
|
|
+ item.otherValue = action.value
|
|
|
+ }
|
|
|
}
|
|
|
return item
|
|
|
})
|
|
@@ -312,3 +324,6 @@ function getString(lists) {
|
|
|
})
|
|
|
return tmpString;
|
|
|
}
|
|
|
+function isNumber(obj) {
|
|
|
+ return typeof obj === 'number' && !isNaN(obj)
|
|
|
+}
|