|
@@ -25,6 +25,7 @@ const initSearchList = {
|
|
|
allCheck: false, //全选反选
|
|
|
checkedList: [], //选中的小项
|
|
|
checkedListImport: [], //辅检导入
|
|
|
+ allCheckLis:[],//所有导入数据
|
|
|
msgObj:{
|
|
|
name:'',
|
|
|
patientNum:''
|
|
@@ -38,7 +39,7 @@ export default (state = initSearchList, action) => {
|
|
|
const newState = Object.assign({}, state);
|
|
|
let tmpGroup = JSON.parse(JSON.stringify(newState.selectGroupList))
|
|
|
let tmpListImport = JSON.parse(JSON.stringify(newState.checkedListImport))
|
|
|
- let tempArrs = newState.assistLabel,tmpString ='',importLis=[];
|
|
|
+ let tempArrs = JSON.parse(JSON.stringify(newState.assistLabel)),importLis=[];
|
|
|
for (let i = 0; i < tmpGroup.length; i++) {
|
|
|
for (let k = 0; k < tmpGroup[i].pacsResultDTO.length; k++) {
|
|
|
let tmpObj = {}
|
|
@@ -53,12 +54,8 @@ export default (state = initSearchList, action) => {
|
|
|
}
|
|
|
tmpListImport.push(importLis)
|
|
|
newState.checkedListImport = [...tmpListImport]
|
|
|
- for (let j = 0; j < tempArrs.length; j++) {
|
|
|
- let tmpVal = tempArrs[j].value ? tempArrs[j].value.trim() : tempArrs[j].value;
|
|
|
- tmpString += (tempArrs[j].name + (tmpVal ? (':' + tmpVal) + ', ' : ': ') + (tempArrs[j].time ? '报告日期:' + tempArrs[j].time : '') + ';')
|
|
|
- }
|
|
|
- newState.assistLabel = [...tempArrs]
|
|
|
- newState.dataString = tmpString
|
|
|
+ newState.allCheckLis = [...tempArrs]
|
|
|
+ newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
|
|
|
|
|
|
newState.hospitalPac = [] //医院检索到的
|
|
|
newState.hospitalPacObj = {} //组对应的明细(单选多选全选)
|
|
@@ -191,39 +188,33 @@ export default (state = initSearchList, action) => {
|
|
|
newState.hospitalPacObj = {}
|
|
|
return newState;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
if (action.type == ADD_ASSIST_LABEL) {
|
|
|
const newState = Object.assign({}, state);
|
|
|
- let tempArr = newState.assistLabel,
|
|
|
- tmpString = '';
|
|
|
+ let tempArr = newState.assistLabel;
|
|
|
for (let i = 0; i < action.lis.length; i++) {
|
|
|
tempArr.push(action.lis[i]);
|
|
|
}
|
|
|
-
|
|
|
for (let i = 0; i < tempArr.length; i++) {
|
|
|
if (i == action.idx) {
|
|
|
tempArr[i].time = action.date
|
|
|
newState.assistLabel = [...tempArr]
|
|
|
}
|
|
|
- let tmpVal = tempArr[i].value ? tempArr[i].value.trim() : tempArr[i].value;
|
|
|
- tmpString += (tempArr[i].name + (tmpVal ? (':' + tmpVal) + ', ' : ': ') + (tempArr[i].time ? '报告日期:' + tempArr[i].time : '') + ';')
|
|
|
}
|
|
|
newState.assistLabel = [...tempArr]
|
|
|
- newState.dataString = tmpString
|
|
|
+ newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
|
|
|
return newState;
|
|
|
}
|
|
|
if (action.type == GET_ASSIST_SEARCH_LIST) { //右侧推送添加到左侧
|
|
|
const newState = Object.assign({}, state);
|
|
|
newState.list = action.list
|
|
|
newState.assistVal = action.val
|
|
|
+ newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
|
|
|
return newState;
|
|
|
}
|
|
|
if (action.type == GET_ASSIST_LABEL) { //默认
|
|
|
const newState = Object.assign({}, state);
|
|
|
const tempArrs = newState.assistLabel;
|
|
|
let tempArr = [];
|
|
|
- let tmpString = '';
|
|
|
let tmpCommonLis = store.getState().homePage.assistList;
|
|
|
if (action.sign == 'common') {
|
|
|
let tmpAssistList = JSON.parse(JSON.stringify(tmpCommonLis))
|
|
@@ -232,78 +223,78 @@ export default (state = initSearchList, action) => {
|
|
|
tempArr = newState.list
|
|
|
}
|
|
|
for (let i = 0; i < tempArr.length; i++) {
|
|
|
- if (tempArr[i].questionId == action.id && i == action.idx) {
|
|
|
+ if (tempArr[i].conceptId == action.id && i == action.idx) {
|
|
|
tempArr[i].time = getCurrentDate(1);
|
|
|
tempArrs.push(tempArr[i]);
|
|
|
newState.assistLabel = [...tempArrs];
|
|
|
}
|
|
|
}
|
|
|
- for (let j = 0; j < tempArrs.length; j++) {
|
|
|
- let tmpVal = tempArrs[j].value ? tempArrs[j].value.trim() : tempArrs[j].value;
|
|
|
- tmpString += (tempArrs[j].name + (tmpVal ? (':' + tmpVal) + ', ' : ': ') + (tempArrs[j].time ? '报告日期:' + tempArrs[j].time : '') + ';')
|
|
|
- }
|
|
|
- newState.dataString = tmpString
|
|
|
+ newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
|
|
|
return newState;
|
|
|
}
|
|
|
if (action.type == DEL_ASSIST_LABEL) { //删除
|
|
|
const newState = Object.assign({}, state);
|
|
|
- let tempArr = newState.assistLabel,
|
|
|
- tempArrs = [];
|
|
|
- let tmpString = '';
|
|
|
- // tempArr.splice(action.idx, 1)
|
|
|
- // let tempArrs = tempArr.slice()
|
|
|
- for (let k = 0; k < tempArr.length; k++) {
|
|
|
- if (k != action.idx) {
|
|
|
- tempArrs.push(tempArr[k])
|
|
|
+ let tempArr = newState.assistLabel,tempArrs = [];
|
|
|
+ let tmpImportLis = newState.checkedListImport;
|
|
|
+ if(action.flg == 0){//删除辅检导入
|
|
|
+ tmpImportLis.splice(action.idx,1)
|
|
|
+ }else{
|
|
|
+ for (let k = 0; k < tempArr.length; k++) {
|
|
|
+ if (k != action.idx) {
|
|
|
+ tempArrs.push(tempArr[k])
|
|
|
+ }
|
|
|
}
|
|
|
+ newState.assistLabel = [...tempArrs]
|
|
|
}
|
|
|
- if (tempArrs == []) {
|
|
|
- tmpString == ''
|
|
|
- return
|
|
|
- }
|
|
|
- for (let i = 0; i < tempArrs.length; i++) {
|
|
|
- let tmpVal = tempArrs[i].value ? tempArrs[i].value.trim() : tempArrs[i].value;
|
|
|
- tmpString += (tempArrs[i].name + (tmpVal ? (':' + tmpVal) + ', ' : ': ') + (tempArrs[i].time ? '报告日期:' + tempArrs[i].time : '') + ';')
|
|
|
- }
|
|
|
- newState.assistLabel = [...tempArrs]
|
|
|
- newState.dataString = tmpString
|
|
|
+ newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
|
|
|
return newState;
|
|
|
}
|
|
|
if (action.type == CHANGE_ASSIST_VAL) { //改变输入值
|
|
|
const newState = Object.assign({}, state);
|
|
|
const tempArr = newState.assistLabel;
|
|
|
- let tmpString = '';
|
|
|
for (let i = 0; i < tempArr.length; i++) {
|
|
|
if (i == action.idx) {
|
|
|
tempArr[i].value = action.val
|
|
|
newState.assistLabel = [...tempArr]
|
|
|
}
|
|
|
- let tmpVal = tempArr[i].value ? tempArr[i].value.trim() : tempArr[i].value;
|
|
|
- tmpString += (tempArr[i].name + (tmpVal ? (':' + tmpVal) + ', ' : ': ') + (tempArr[i].time ? '报告日期:' + tempArr[i].time : '') + ';')
|
|
|
}
|
|
|
- newState.dataString = tmpString
|
|
|
+ newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
|
|
|
return newState;
|
|
|
}
|
|
|
if (action.type == CHANGE_DATE) { //新增
|
|
|
const newState = Object.assign({}, state);
|
|
|
const tempArr = newState.assistLabel;
|
|
|
- let tmpString = '';
|
|
|
for (let i = 0; i < tempArr.length; i++) {
|
|
|
if (i == action.idx) {
|
|
|
tempArr[i].time = action.date
|
|
|
newState.assistLabel = [...tempArr]
|
|
|
}
|
|
|
- let tmpVal = tempArr[i].value ? tempArr[i].value.trim() : tempArr[i].value;
|
|
|
- tmpString += (tempArr[i].name + (tmpVal ? (':' + tmpVal) + ', ' : ': ') + (tempArr[i].time ? '报告日期:' + tempArr[i].time : '') + ';')
|
|
|
}
|
|
|
- newState.dataString = tmpString
|
|
|
+ newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
|
|
|
return newState;
|
|
|
}
|
|
|
if (action.type == CLEAR_ASSIST_DATA) {
|
|
|
const newState = Object.assign({}, state);
|
|
|
newState.assistLabel = [...action.data];
|
|
|
newState.dataString = action.saveText;
|
|
|
+ newState.checkedListImport = action.checkedListImport;
|
|
|
return newState;
|
|
|
}
|
|
|
return state;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+function getAllString(checkedListImport,assistLabel){
|
|
|
+ let tmpImportLis = [],tmpString='';
|
|
|
+ for(let i = 0;i < checkedListImport.length;i++){
|
|
|
+ for(let j = 0;j < checkedListImport[i].length;j++){
|
|
|
+ tmpImportLis.push(checkedListImport[i][j])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let tempArr = tmpImportLis.concat(assistLabel)
|
|
|
+ for (let i = 0; i < tempArr.length; i++) {
|
|
|
+ let tmpVal = tempArr[i].value ? tempArr[i].value.trim() : tempArr[i].value;
|
|
|
+ tmpString += (tempArr[i].name + (tmpVal ? (':' + tmpVal) + ', ' : ': ') + (tempArr[i].time ? '报告日期:' + tempArr[i].time : '') + ';')
|
|
|
+ }
|
|
|
+ return tmpString;
|
|
|
}
|