|
@@ -38,8 +38,10 @@ const initSearchList = {
|
|
shType:5,
|
|
shType:5,
|
|
labelListBig:[],//大项
|
|
labelListBig:[],//大项
|
|
labelListSmall:[],//小项
|
|
labelListSmall:[],//小项
|
|
|
|
+ labelListBlood:[],//输血
|
|
drugOrder:[],//开单项
|
|
drugOrder:[],//开单项
|
|
operationOrder:[],//开单项
|
|
operationOrder:[],//开单项
|
|
|
|
+ transfusionOrder:[]
|
|
}
|
|
}
|
|
|
|
|
|
export default (state = initSearchList, action) => {
|
|
export default (state = initSearchList, action) => {
|
|
@@ -47,7 +49,8 @@ export default (state = initSearchList, action) => {
|
|
const newState = Object.assign({}, state);
|
|
const newState = Object.assign({}, state);
|
|
let tempArr = newState.labelListBig;
|
|
let tempArr = newState.labelListBig;
|
|
let tempArrs = newState.labelListSmall;
|
|
let tempArrs = newState.labelListSmall;
|
|
- let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempTotalOrder=[];
|
|
|
|
|
|
+ let tmpArr = newState.labelListBlood;
|
|
|
|
+ let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempBloodOrder=[],tempTotalOrder=[];
|
|
if(tmpLis&&tmpLis.flg == 5){//药品
|
|
if(tmpLis&&tmpLis.flg == 5){//药品
|
|
for(let i = 0;i < tempArr.length;i++){
|
|
for(let i = 0;i < tempArr.length;i++){
|
|
if(tempArr[i].time == tmpLis.time){
|
|
if(tempArr[i].time == tmpLis.time){
|
|
@@ -56,7 +59,7 @@ export default (state = initSearchList, action) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
newState.labelListBig = [...tempArr]
|
|
newState.labelListBig = [...tempArr]
|
|
- }else{//手术、操作
|
|
|
|
|
|
+ }else if(tmpLis&&tmpLis.flg == 6){//手术、操作
|
|
for(let i = 0;i < tempArrs.length;i++){
|
|
for(let i = 0;i < tempArrs.length;i++){
|
|
if(tempArrs[i].time == tmpLis.time){
|
|
if(tempArrs[i].time == tmpLis.time){
|
|
let flg = tempArrs[i].check;
|
|
let flg = tempArrs[i].check;
|
|
@@ -64,29 +67,46 @@ export default (state = initSearchList, action) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
newState.labelListSmall = [...tempArrs]
|
|
newState.labelListSmall = [...tempArrs]
|
|
|
|
+ }else if(tmpLis&&tmpLis.flg == 8){//输血
|
|
|
|
+ for(let i = 0;i < tmpArr.length;i++){
|
|
|
|
+ if(tmpArr[i].time == tmpLis.time){
|
|
|
|
+ let flg = tmpArr[i].check;
|
|
|
|
+ tmpArr[i].check = !flg
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ newState.labelListBlood = [...tmpArr]
|
|
}
|
|
}
|
|
tempBigOrder = tempArr.filter((item)=>item.check)
|
|
tempBigOrder = tempArr.filter((item)=>item.check)
|
|
tempSmallOrder = tempArrs.filter((item)=>item.check)
|
|
tempSmallOrder = tempArrs.filter((item)=>item.check)
|
|
|
|
+ tempBloodOrder = tmpArr.filter((item)=>item.check)
|
|
newState.drugOrder=[...tempBigOrder]
|
|
newState.drugOrder=[...tempBigOrder]
|
|
newState.operationOrder=[...tempSmallOrder]
|
|
newState.operationOrder=[...tempSmallOrder]
|
|
|
|
+ newState.transfusionOrder=[...tempBloodOrder]
|
|
return newState;
|
|
return newState;
|
|
}
|
|
}
|
|
if (action.type == DEL_ONE_PIC) {
|
|
if (action.type == DEL_ONE_PIC) {
|
|
const newState = Object.assign({}, state);
|
|
const newState = Object.assign({}, state);
|
|
let tempArr = newState.labelListBig;
|
|
let tempArr = newState.labelListBig;
|
|
let tempArrs = newState.labelListSmall;
|
|
let tempArrs = newState.labelListSmall;
|
|
- let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempTotalOrder=[];
|
|
|
|
- if(tmpLis&&tmpLis.flg == 5){//大项
|
|
|
|
|
|
+ let tmpArr = newState.labelListBlood;
|
|
|
|
+ let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempBloodOrder=[],tempTotalOrder=[];
|
|
|
|
+ if(tmpLis&&tmpLis.flg == 5){
|
|
tempArr = tempArr.filter((item)=>item.time != tmpLis.time)
|
|
tempArr = tempArr.filter((item)=>item.time != tmpLis.time)
|
|
newState.labelListBig = [...tempArr]
|
|
newState.labelListBig = [...tempArr]
|
|
- }else{//小项
|
|
|
|
|
|
+ }else if(tmpLis&&tmpLis.flg == 6){
|
|
tempArrs = tempArrs.filter((item)=> item.time != tmpLis.time )
|
|
tempArrs = tempArrs.filter((item)=> item.time != tmpLis.time )
|
|
newState.labelListSmall = [...tempArrs]
|
|
newState.labelListSmall = [...tempArrs]
|
|
|
|
+ }else if(tmpLis&&tmpLis.flg == 8){
|
|
|
|
+ tmpArr = tmpArr.filter((item)=> item.time != tmpLis.time )
|
|
|
|
+ newState.labelListBlood = [...tmpArr]
|
|
}
|
|
}
|
|
tempBigOrder = tempArr.filter((item)=>item.check)
|
|
tempBigOrder = tempArr.filter((item)=>item.check)
|
|
tempSmallOrder = tempArrs.filter((item)=>item.check)
|
|
tempSmallOrder = tempArrs.filter((item)=>item.check)
|
|
|
|
+ tempBloodOrder = tmpArr.filter((item)=>item.check)
|
|
tempTotalOrder=tempBigOrder.concat(tempSmallOrder)
|
|
tempTotalOrder=tempBigOrder.concat(tempSmallOrder)
|
|
- newState.totalOrder=[...tempTotalOrder]
|
|
|
|
|
|
+ newState.drugOrder=[...tempBigOrder]
|
|
|
|
+ newState.operationOrder=[...tempSmallOrder]
|
|
|
|
+ newState.transfusionOrder=[...tempBloodOrder]
|
|
return newState;
|
|
return newState;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -94,6 +114,7 @@ export default (state = initSearchList, action) => {
|
|
const newState = Object.assign({}, state);
|
|
const newState = Object.assign({}, state);
|
|
let tempArr = newState.labelListBig;
|
|
let tempArr = newState.labelListBig;
|
|
let tempArrs = newState.labelListSmall;
|
|
let tempArrs = newState.labelListSmall;
|
|
|
|
+ let tmpArr = newState.labelListBlood;
|
|
let tmpLis = action.item
|
|
let tmpLis = action.item
|
|
if(tmpLis.flg == 5){
|
|
if(tmpLis.flg == 5){
|
|
for(let i= 0;i < tempArr.length;i++){
|
|
for(let i= 0;i < tempArr.length;i++){
|
|
@@ -106,16 +127,28 @@ export default (state = initSearchList, action) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
|
|
+ }else if(tmpLis.flg == 6){
|
|
for(let i= 0;i < tempArrs.length;i++){
|
|
for(let i= 0;i < tempArrs.length;i++){
|
|
if(tmpLis.time == tempArrs[i].time){
|
|
if(tmpLis.time == tempArrs[i].time){
|
|
tempArrs[i].time = action.value
|
|
tempArrs[i].time = action.value
|
|
tempArrs[i].dateValue = action.value
|
|
tempArrs[i].dateValue = action.value
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ }if(tmpLis.flg == 8){
|
|
|
|
+ for(let i= 0;i < tmpArr.length;i++){
|
|
|
|
+ if(tmpLis.time == tmpArr[i].time){
|
|
|
|
+ if(action.sign == 1){
|
|
|
|
+ tmpArr[i].time = action.value
|
|
|
|
+ tmpArr[i].dateValue = action.value
|
|
|
|
+ }else{
|
|
|
|
+ tmpArr[i].value = action.value
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
newState.labelListBig = [...tempArr]
|
|
newState.labelListBig = [...tempArr]
|
|
newState.labelListSmall = [...tempArrs]
|
|
newState.labelListSmall = [...tempArrs]
|
|
|
|
+ newState.labelListBlood = [...tmpArr]
|
|
return newState;
|
|
return newState;
|
|
}
|
|
}
|
|
if (action.type == SEARCH_TYPE_NEW) {
|
|
if (action.type == SEARCH_TYPE_NEW) {
|
|
@@ -127,15 +160,19 @@ export default (state = initSearchList, action) => {
|
|
const newState = Object.assign({}, state);
|
|
const newState = Object.assign({}, state);
|
|
const tempArr = newState.labelListBig;
|
|
const tempArr = newState.labelListBig;
|
|
const tempArrs = newState.labelListSmall;
|
|
const tempArrs = newState.labelListSmall;
|
|
|
|
+ const tmpArr = newState.labelListBlood;
|
|
let tmpLis = action.list
|
|
let tmpLis = action.list
|
|
tmpLis['time'] = getCurrentDate(1)
|
|
tmpLis['time'] = getCurrentDate(1)
|
|
tmpLis['dateValue'] = getCurrentDate(1)
|
|
tmpLis['dateValue'] = getCurrentDate(1)
|
|
- if(tmpLis.flg == 5){//大项
|
|
|
|
|
|
+ if(tmpLis.flg == 5){
|
|
tempArr.push(tmpLis)
|
|
tempArr.push(tmpLis)
|
|
newState.labelListBig = [...tempArr]
|
|
newState.labelListBig = [...tempArr]
|
|
- }else{//小项
|
|
|
|
|
|
+ }else if(tmpLis.flg == 6){
|
|
tempArrs.push(tmpLis)
|
|
tempArrs.push(tmpLis)
|
|
newState.labelListSmall = [...tempArrs]
|
|
newState.labelListSmall = [...tempArrs]
|
|
|
|
+ }else{
|
|
|
|
+ tmpArr.push(tmpLis)
|
|
|
|
+ newState.labelListBlood = [...tmpArr]
|
|
}
|
|
}
|
|
return newState;
|
|
return newState;
|
|
}
|
|
}
|