Browse Source

getByIds url和入参修改,量表id调整

liucf 6 years ago
parent
commit
c613ae7eb0

+ 1 - 1
src/components/ChronicInfo/index.jsx

@@ -212,7 +212,7 @@ class ChronicInfo extends React.Component{
   handleRadio(item,parent){//可能结果
     let {radioVal} = this.props;
     this.setState({
-      radioVal:Object.assign({},radioVal,{[parent.id]:item.detailName})
+      radioVal:Object.assign({},radioVal,{[parent.conceptId]:item.detailName})
     })
   }
   confirmOption(parent,pIndex){//可能结果确定

+ 2 - 2
src/components/CurrentIll/index.jsx

@@ -103,9 +103,9 @@ class CurrentIll extends Component{
   }
 
   handleSearchSelect(obj){
-    const {questionId,name} = obj;
+    const {questionId,name,conceptId} = obj;
     const {fetchModules,focusIndex,span} = this.props;
-    fetchModules&&fetchModules({id:questionId,index:focusIndex,name,span});
+    fetchModules&&fetchModules({id:questionId,index:focusIndex,name,span,conceptId});
   }
 
   getInlineTag(){  

+ 5 - 4
src/containers/CurrentIll.js

@@ -69,8 +69,8 @@ function mapDispatchToProps(dispatch) {
        async setData(info){//设置现病史使用模板
         // let idsArr = info.mainIds;
         let idsArr = info.mainTailIds.filter((it,i)=>{return it});
-        let ids = idsArr.join(",");
-        let labelModule = await getModules(ids);
+        // let ids = idsArr.join(",");
+        let labelModule = await getModules(idsArr);
         if(labelModule.data.code==0){//根据id获取标签模板
           dispatch({
             type:SET_LABEL_MODULE,
@@ -103,7 +103,7 @@ function mapDispatchToProps(dispatch) {
         })
       },
         fetchModules(param){
-            const {id,name,index,span} = param;
+            const {id,name,index,span,conceptId} = param;
             getModule(id).then((res)=>{
                 if(res.data.code=='0'){
                   dispatch({
@@ -112,7 +112,8 @@ function mapDispatchToProps(dispatch) {
                       name,
                       data: res.data.data,
                       span,
-                      isReplace:false
+                      isReplace:false,
+                      conceptId
                   })
                   dispatch({
                     type:ISREAD

+ 6 - 3
src/containers/SpreadDrop.js

@@ -144,7 +144,8 @@ function currentIll(dispatch,store,params){
   let ikey = getLabelIndex(index);
   let existsId = exists && exists.length>0?getIds(exists):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
-  const ids = (existsId.concat(withsId)).join(",");
+  // const ids = (existsId.concat(withsId)).join(",");
+  const ids = existsId.concat(withsId);
   let has = [],wes=[];
   //获取选中项目模板
   fetchModules(ids).then((res)=>{
@@ -196,7 +197,8 @@ function otherHisConfirm(dispatch,store,params){
   }
   let existsId = getIds(exists);
   let withsId = getIds(withs);
-  const ids = existsId.length>0?existsId.join(",")+','+withsId.join(","):withsId.join(",");
+  // const ids = existsId.length>0?existsId.join(",")+','+withsId.join(","):withsId.join(",");
+  const ids = existsId.concat(withsId);console.log(555,ids)
   if(!ids&&nones){      //只有无的项目
     dispatch({
       type: CONFIRMSELECTED,
@@ -244,7 +246,8 @@ function checkBodyConfirm(dispatch,store,params){
   }
   let existsId = getIds(exists);
   let withsId = getIds(withs);
-  const ids = existsId.join(",")+','+withsId.join(",");
+  // const ids = existsId.join(",")+','+withsId.join(",");
+  const ids = existsId.concat(withsId);
   if(!ids&&nones){      //只有无的项目
     dispatch({
       type: CHECKCONFIRMSELECTED,

+ 4 - 3
src/store/actions/currentIll.js

@@ -357,7 +357,7 @@ export const confirm = (state,action) =>{
   withs.map((v,i)=>{
     withConpId.push(v.conceptId);
   })
-  res.symptomIds = res.symptomIds.concat(existsId,withsId,noneIds);//搜索去重
+  res.symptomIds = res.symptomIds.concat(existConpId,withConpId,noneIds);//搜索去重
   // 伴 标签
   const banText = JSON.stringify(ban)=='{}'?'':{id:ban.id,name:ban.name,value:ban.name,tagType:config.tagType};
 
@@ -724,7 +724,7 @@ export function setCheckText(state,action) {
 //搜索 插入标签数据
 export function insertLabelData(state,action){
   let res = Object.assign({},state); 
-  const {index,data,isReplace,span}=action;
+  const {index,data,isReplace,span,conceptId}=action;
   let id = data.id;
   let searchData = action.name;
   // res.symptomIds.push(id);
@@ -758,7 +758,8 @@ export function insertLabelData(state,action){
     const value = innerText.replace(searchStr,"");
     const pText = Object.assign({},textEmpty,{value:value});
     if(data.itemType==0){//症状
-      res.symptomIds.push(id);
+      // res.symptomIds.push(id);
+      res.symptomIds.push(conceptId);
       // 没有伴展开主诉symptomType=0/1的尾巴,有伴一>第一个点选上去的伴为依据,伴前展开主诉,伴后展开伴随;多余的伴以及手动输入的伴不做处理(2-25)
       if(banIdx==-1){
 

+ 2 - 2
src/store/async-actions/diagnosticList.js

@@ -44,7 +44,7 @@ export const isChronicMag = (item) => {
                  getChronic().then(() =>{
                     chronicList = JSON.parse(storageLocal.get('chronic'));
                     for(let i=0; i<chronicList.length; i++){
-                        if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
+                        if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
                             //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
                             // 是--引用   否--走慢病流程
                             dispatch({
@@ -65,7 +65,7 @@ export const isChronicMag = (item) => {
                  });
              } else {
                 for(let i=0; i<chronicList.length; i++){
-                    if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
+                    if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
                         //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
                         // 是--引用   否--走慢病流程
                         dispatch({

+ 2 - 1
src/store/async-actions/fetchModules.js

@@ -12,7 +12,8 @@ import {CURRENT_CHRONIC} from '@store/types/currentIll';
 import {MODI_LOADING} from '@store/types/homePage.js';
 
 const api={
-  getSpreadModule:'/questionInfo/getByIds',
+  // getSpreadModule:'/questionInfo/getByIds',
+  getSpreadModule:'/questionInfo/getByIds2',//优化
   getModule:'/questionInfo/getById',
   searchURL: '/retrieval/getTagInfos',
   getOtherHisRecord: '/inquiryInfo/getLastOther',

+ 1 - 1
src/store/async-actions/homePage.js

@@ -34,7 +34,7 @@ export const getInitModules= (dispatch,getStore)=>{
   const chronicMagItem = state.diagnosticList.chronicMagItem;//诊断入口
   // const chronicId = chronicMagItem?chronicMagItem.id:'';
   const chronicDesease = state.mainSuit.chronicDesease; //主诉入口
-  const chronicId = chronicDesease&&chronicDesease.id||chronicMagItem&&chronicMagItem.id||'';
+  const chronicId = chronicDesease&&chronicDesease.id||chronicMagItem&&chronicMagItem.conceptId||'';
   const param = {
     age:message.patientAge,
     sexType:message.sex,