|
@@ -19,6 +19,7 @@ import {
|
|
|
CLEARNEWADVICEDATA,
|
|
|
SELECTJITYPE,
|
|
|
HANDLESELECTSHOW,
|
|
|
+ HANDLESUI,
|
|
|
} from '../types/newAdvice';
|
|
|
import store from '@store';
|
|
|
import {getStringPlus,getPushLists,getPushList,getCurrentDate} from '@utils/tools.js';
|
|
@@ -44,10 +45,31 @@ const initSearchList = {
|
|
|
drugOrder:[],//开单项
|
|
|
operationOrder:[],//开单项
|
|
|
transfusionOrder:[],
|
|
|
- activeIdx:''
|
|
|
+ activeIdx:'',
|
|
|
+ operationName:{}
|
|
|
}
|
|
|
|
|
|
export default (state = initSearchList, action) => {
|
|
|
+ if (action.type == HANDLESUI) {
|
|
|
+ const newState = Object.assign({}, state);
|
|
|
+ let tempArr = newState.labelListSmall;
|
|
|
+ let tmpLis = action.item
|
|
|
+ for(let i = 0;i < tempArr.length;i++){
|
|
|
+ if(action.idx == i){
|
|
|
+ tempArr[i].hasTreat = 1
|
|
|
+ }else{
|
|
|
+ tempArr[i].hasTreat = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let obj = {
|
|
|
+ "dateValue": tmpLis.dateValue,
|
|
|
+ "name": tmpLis.name,
|
|
|
+ "uniqueName": tmpLis.name
|
|
|
+ }
|
|
|
+ newState.labelListSmall = [...tempArr]
|
|
|
+ newState.operationName = obj
|
|
|
+ return newState;
|
|
|
+ }
|
|
|
if (action.type == HANDLESELECTSHOW) {
|
|
|
const newState = Object.assign({}, state);
|
|
|
let tempArr = newState.labelListBig;
|
|
@@ -72,8 +94,6 @@ export default (state = initSearchList, action) => {
|
|
|
}
|
|
|
}
|
|
|
newState.labelListBig = [...tempArr]
|
|
|
-
|
|
|
-
|
|
|
return newState;
|
|
|
}
|
|
|
if (action.type == CHECK_OFF_ON_NEW) {
|
|
@@ -120,7 +140,7 @@ export default (state = initSearchList, action) => {
|
|
|
let tempArr = newState.labelListBig;
|
|
|
let tempArrs = newState.labelListSmall;
|
|
|
let tmpArr = newState.labelListBlood;
|
|
|
- let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempBloodOrder=[],tempTotalOrder=[];
|
|
|
+ let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempBloodOrder=[],tempTotalOrder=[],num=0;
|
|
|
if(tmpLis&&tmpLis.flg == 5){
|
|
|
tempArr = tempArr.filter((item,idx)=>{
|
|
|
if(action.tip != idx){
|
|
@@ -134,6 +154,20 @@ export default (state = initSearchList, action) => {
|
|
|
return item
|
|
|
}
|
|
|
} )
|
|
|
+ for(let i = 0;i < tempArrs.length;i++){
|
|
|
+ if(!tempArrs[i].hasTreat){
|
|
|
+ ++num
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(tempArrs.length>0&&num == tempArrs.length){
|
|
|
+ tempArrs[0]['hasTreat'] = 1
|
|
|
+ let obj = {
|
|
|
+ "dateValue": tempArrs[0].dateValue,
|
|
|
+ "name": tempArrs[0].name,
|
|
|
+ "uniqueName": tempArrs[0].name
|
|
|
+ }
|
|
|
+ newState.operationName = obj
|
|
|
+ }
|
|
|
newState.labelListSmall = [...tempArrs]
|
|
|
}else if(tmpLis&&tmpLis.flg == 8){
|
|
|
tmpArr = tmpArr.filter((item,idx)=> {
|
|
@@ -176,6 +210,14 @@ export default (state = initSearchList, action) => {
|
|
|
if(action.tip == i){
|
|
|
tempArrs[i].time = action.value
|
|
|
tempArrs[i].dateValue = action.value
|
|
|
+ if(tmpLis.hasTreat){
|
|
|
+ let obj = {
|
|
|
+ "dateValue": action.value,
|
|
|
+ "name": tmpLis.name,
|
|
|
+ "uniqueName": tmpLis.name
|
|
|
+ }
|
|
|
+ newState.operationName = obj
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
newState.labelListSmall = tempArrs
|
|
@@ -204,7 +246,7 @@ export default (state = initSearchList, action) => {
|
|
|
const tempArr = newState.labelListBig;
|
|
|
const tempArrs = newState.labelListSmall;
|
|
|
const tmpArr = newState.labelListBlood;
|
|
|
- let tmpLis = action.list
|
|
|
+ let tmpLis = action.list,num=0
|
|
|
tmpLis['time'] = getCurrentDate(1)
|
|
|
tmpLis['dateValue'] = getCurrentDate(1)
|
|
|
if(tmpLis.flg == 5){
|
|
@@ -212,6 +254,20 @@ export default (state = initSearchList, action) => {
|
|
|
newState.labelListBig = [...tempArr]
|
|
|
}else if(tmpLis.flg == 6){
|
|
|
tempArrs.push(tmpLis)
|
|
|
+ for(let i = 0;i < tempArrs.length;i++){
|
|
|
+ if(!tempArrs[i].hasTreat){
|
|
|
+ ++num
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(num == tempArrs.length){
|
|
|
+ tempArrs[0]['hasTreat'] = 1
|
|
|
+ let obj = {
|
|
|
+ "dateValue": tmpLis.dateValue,
|
|
|
+ "name": tempArrs[0].name,
|
|
|
+ "uniqueName": tempArrs[0].name
|
|
|
+ }
|
|
|
+ newState.operationName = obj
|
|
|
+ }
|
|
|
newState.labelListSmall = [...tempArrs]
|
|
|
}else{
|
|
|
tmpArr.push(tmpLis)
|
|
@@ -363,7 +419,8 @@ export default (state = initSearchList, action) => {
|
|
|
newState.drugOrder = action.params[11].content.labelListBig;
|
|
|
newState.operationOrder = action.params[11].content.labelListSmall;
|
|
|
newState.labelListBlood = action.params[11].content.labelListBlood;
|
|
|
- newState.transfusionOrder = action.params[11].content.transfusionOrder;;
|
|
|
+ newState.transfusionOrder = action.params[11].content.transfusionOrder;
|
|
|
+ newState.operationName = action.params[11].content.operationName;
|
|
|
return newState;
|
|
|
}
|
|
|
if (action.type == CLEARNEWADVICEDATA) {
|
|
@@ -378,64 +435,3 @@ export default (state = initSearchList, action) => {
|
|
|
}
|
|
|
return state;
|
|
|
}
|
|
|
-
|
|
|
-function getExcelString(action,newState,tmpArr,tmpArr2) {
|
|
|
- let tmpString = '';
|
|
|
- if(JSON.stringify(action.data||{}) != '{}' && action.data.lisExcelRes.length > 0){
|
|
|
- action.data.lisExcelRes.map((item)=>{
|
|
|
- item.lisExcelItem.map((part)=>{
|
|
|
- if(part.type == 1){
|
|
|
- if(part.max != '' && (part.value-0) > (part.max-0) ) {
|
|
|
- let rate = (part.value/part.max).toFixed(2);
|
|
|
- let tmpStr = part.mealName+','+part.itemName+','+part.value+' '+part.unit+'升高'+rate+';'
|
|
|
- tmpString += tmpStr;
|
|
|
- }else if(part.min != '' && (part.value-0) < (part.min-0) ){
|
|
|
- let rate = (part.value/part.min).toFixed(2);
|
|
|
- let tmpStr = part.mealName+','+part.itemName+','+part.value+' '+part.unit+'降低'+rate+';'
|
|
|
- tmpString += tmpStr;
|
|
|
- }else{
|
|
|
- let tmpStr = part.mealName+','+part.itemName+','+part.value+' '+part.unit+'异常;'
|
|
|
- tmpString += tmpStr;
|
|
|
- }
|
|
|
- }else{
|
|
|
- let tmpStr = part.mealName+','+part.itemName+','+part.value+' '+part.unit+'正常;'
|
|
|
- tmpString += tmpStr;
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- newState.pushItem = getPushList(tmpArr,tmpArr2);
|
|
|
- newState.pushItems = getPushLists(tmpArr,tmpArr2);
|
|
|
- newState.inspectStrPlus = getStringPlus(newState.pushItems)
|
|
|
- }else{
|
|
|
- newState.inspectStrPlus = '';
|
|
|
- newState.pushItem = []
|
|
|
- }
|
|
|
-}
|
|
|
-function getString(lists) {
|
|
|
- let tmpString = '';
|
|
|
- lists.map((item)=>{
|
|
|
- if(item.show == true){
|
|
|
- item.details.map((part)=>{
|
|
|
- if(part.value){
|
|
|
- if(typeof(part.value) == "number"){
|
|
|
- if(part.maxValue != '' && (part.value-0) > (part.maxValue-0) ) {
|
|
|
- let rate = (part.value/part.maxValue).toFixed(2);
|
|
|
- let tmpStr = item.name+','+part.name+','+part.value+' '+part.labelSuffix+'升高'+rate+';'
|
|
|
- tmpString += tmpStr;
|
|
|
- }else if(part.minValue != '' && (part.value-0) < (part.minValue-0) ){
|
|
|
- let rate = (part.value/part.minValue).toFixed(2);
|
|
|
- let tmpStr = item.name+','+part.name+','+part.value+' '+part.labelSuffix+'降低'+rate+';'
|
|
|
- tmpString += tmpStr;
|
|
|
- }else{
|
|
|
- let tmpStr = item.name+','+part.name+','+part.value+' '+part.labelSuffix+';'
|
|
|
- tmpString += tmpStr;
|
|
|
- }
|
|
|
- }else{
|
|
|
- tmpString += item.name+','+part.name+','+part.value+' '+part.labelSuffix+';'
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- return tmpString;
|
|
|
-}
|