|
@@ -17,6 +17,8 @@ import {
|
|
|
CHECK_OFF_ON_NEW,
|
|
|
RENEWADVICEDATA,
|
|
|
CLEARNEWADVICEDATA,
|
|
|
+ SELECTJITYPE,
|
|
|
+ HANDLESELECTSHOW,
|
|
|
} from '../types/newAdvice';
|
|
|
import store from '@store';
|
|
|
import {getStringPlus,getPushLists,getPushList,getCurrentDate} from '@utils/tools.js';
|
|
@@ -45,6 +47,37 @@ const initSearchList = {
|
|
|
}
|
|
|
|
|
|
export default (state = initSearchList, action) => {
|
|
|
+ if (action.type == HANDLESELECTSHOW) {
|
|
|
+ const newState = Object.assign({}, state);
|
|
|
+ let tempArr = newState.labelListBig;
|
|
|
+ for(let i = 0;i < tempArr.length;i++){
|
|
|
+ if(action.idx == i){
|
|
|
+ let flg = tempArr[i].selectShow;
|
|
|
+ tempArr[i].selectShow = action.sign==1?true:action.sign==0?false:!flg
|
|
|
+ tempArr[i].activeIdx = action.idx
|
|
|
+ // if(action.sign==1||!flg){
|
|
|
+
|
|
|
+ // }else{
|
|
|
+
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ newState.labelListBig = [...tempArr]
|
|
|
+ return newState;
|
|
|
+ }
|
|
|
+ if (action.type == SELECTJITYPE) {
|
|
|
+ const newState = Object.assign({}, state);
|
|
|
+ let tempArr = newState.labelListBig;
|
|
|
+ for(let i = 0;i < tempArr.length;i++){
|
|
|
+ if(action.idx == i){
|
|
|
+ tempArr[i].selectShow = false
|
|
|
+ tempArr[i].selectName = action.part.name
|
|
|
+ tempArr[i].selectVal = action.part.val
|
|
|
+ }
|
|
|
+ }
|
|
|
+ newState.labelListBig = [...tempArr]
|
|
|
+ return newState;
|
|
|
+ }
|
|
|
if (action.type == CHECK_OFF_ON_NEW) {
|
|
|
const newState = Object.assign({}, state);
|
|
|
let tempArr = newState.labelListBig;
|
|
@@ -139,7 +172,7 @@ export default (state = initSearchList, action) => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- newState.labelListBig = [...tempArr]
|
|
|
+ newState.labelListBig = tempArr
|
|
|
}else if(tmpLis.flg == 6){//手术
|
|
|
for(let i= 0;i < tempArrs.length;i++){
|
|
|
if(action.tip == i){
|
|
@@ -147,7 +180,7 @@ export default (state = initSearchList, action) => {
|
|
|
tempArrs[i].dateValue = action.value
|
|
|
}
|
|
|
}
|
|
|
- newState.labelListSmall = [...tempArrs]
|
|
|
+ newState.labelListSmall = tempArrs
|
|
|
}if(tmpLis.flg == 8){//输血
|
|
|
for(let i= 0;i < tmpArr.length;i++){
|
|
|
if(action.tip == i){
|
|
@@ -159,9 +192,8 @@ export default (state = initSearchList, action) => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- newState.labelListBlood = [...tmpArr]
|
|
|
+ newState.labelListBlood = tmpArr
|
|
|
}
|
|
|
- // console.log(newState,'newState');
|
|
|
return newState;
|
|
|
}
|
|
|
if (action.type == SEARCH_TYPE_NEW) {
|