Browse Source

接口参数修改

Luolei 6 years ago
parent
commit
006d4588bb

+ 7 - 7
src/components/AssistCheck/index.jsx

@@ -175,16 +175,16 @@ class AssistCheck extends React.Component {
             <div className={styles.wrapper}>
                 <div className={styles.top}>
                     <span id="assistResultData">辅检结果数据</span>
-                    <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={checkSystemIpt}>
+                    {/* <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={checkSystemIpt}>
                         <p id="importPacBtn" className={styles.importInspectBtn}>导入辅检结果</p>
-                    </div>
-                    {/* {
-                      hospitalMsg.importWayLis == 3 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>
+                    </div> */}
+                    {
+                      hospitalMsg.value == 1 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>
                         导入化验结果
                         <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
-                      </div> : hospitalMsg.importWayLis == 22 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={checkSystemIpt}>
+                      </div> : hospitalMsg.value == 2 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={checkSystemIpt}>
                         检查系统导入
-                      </div> : hospitalMsg.importWayLis == 2 ? <div className={`${styles.pushButton} ${styles.importInspect}`} onClick={showSlideImport}>
+                      </div> : hospitalMsg.value == 3 ? <div className={`${styles.pushButton} ${styles.importInspect}`} onClick={showSlideImport}>
                         <p id="importExcelBtns" className={styles.importInspectBtn}>导入化验结果</p>
                         {
                           importLis?<ul className={styles.importSelect} id="importExcelLists">
@@ -196,7 +196,7 @@ class AssistCheck extends React.Component {
                           </ul>:null
                         }
                           </div> : null
-                      } */}
+                      }
                     {
                       hide ? <WrapModalContainer title={'导入辅检数据'} width={1000} height={650} onClose={onClose}>
                         <WrapModalBodyPac

+ 25 - 20
src/components/Inspect/index.jsx

@@ -115,20 +115,25 @@ class Inspect extends React.Component {
               complete: function (err, xhr) {
                 if (!err) {
                   let res = JSON.parse(xhr.response);
-                  let message = res.data.messages;
-                  store.dispatch(getExcelList(res.data));
-                  fetchPushInfos && fetchPushInfos();
-                  if (message && message.length != 0) {
-                    that.setState({
-                      visible: true,
-                      dom: message,
-                      height: message.length
-                    })
+                  if(res.code == 0){
+                    let message = res.data.messages;
+                    store.dispatch(getExcelList(res.data));
+                    fetchPushInfos && fetchPushInfos();
+                    if (message && message.length != 0) {
+                      that.setState({
+                        visible: true,
+                        dom: message,
+                        height: message.length
+                      })
+                    }
+                  }else{
+                    Notify.error(res.msg)
                   }
                   $("#choose").val("");
                 } else {
                   let res = JSON.parse(xhr.response);
                   Notify.error(res.msg)
+                  $("#choose").val("");
                 }
               }
             });
@@ -200,29 +205,29 @@ class Inspect extends React.Component {
         <div className={styles.top}>
           <span id="inspectResultData">化验结果数据</span>
           {/* <div className={this.getStyle()} onClick={ieVersion&&ieVersion<=9?null:this.handleImportExcel}> */}
-          <div className={this.getStyle()} style={{ display: hospitalMsg.importWayLis == 0 ? 'none' : 'block' }}>
-            {/* <button disabled={ieVersion&&ieVersion>9?true:false}>导入化验结果</button> */}
-            {/* <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} /> */}
+          <div className={this.getStyle()} style={{ display: hospitalMsg.value == 0 ? 'none' : 'block' }}>
+            {/* <button disabled={ieVersion&&ieVersion>9?true:false}onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>导入化验结果</button>
+            <input accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} /> */}
 
             {/* {0没有,1本地,2医院,3本地和医院} */}
             {
-              hospitalMsg.importWayLis == 3 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>
+              hospitalMsg.value == 1 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>
                 <p className={styles.importInspectBtn}>导入化验结果</p>
-                <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
-              </div> : hospitalMsg.importWayLis == 22 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={checkSystemIpt}>
+                <input accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
+              </div> : hospitalMsg.value == 2 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={checkSystemIpt}>
                 <p className={styles.importInspectBtn}>导入化验结果</p>
-              </div> : hospitalMsg.importWayLis == 2 ? <div className={`${styles.pushButton} ${styles.importInspect}`} onClick={showSlideImport}>
+              </div> : hospitalMsg.value == 3 ? <div className={`${styles.pushButton} ${styles.importInspect}`} onClick={showSlideImport}>
                 <p id="importInspectBtn" className={styles.importInspectBtn}>导入化验结果</p>
                 {
-                  importLis?<ul className={styles.importSelect} id="importList">
+                  <ul className={styles.importSelect} style={{display:importLis?'block':'none'}} id="importList">
                     <li className={styles.excelIpt}>
                       <div onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>本地导入</div>
-                      <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
+                      <input accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
                     </li>
                     <li className={`${styles.excelIpt} ${styles.systemIpt}`} onClick={checkSystemIpt}>检查系统导入</li>
-                  </ul>:null
+                  </ul>
                 }
-                  </div> : null
+              </div> : null
             }
 
             {

+ 1 - 1
src/components/Inspect/index.less

@@ -92,7 +92,7 @@
   box-shadow: 0 10px 20px 0 #989DA3;
   border: 1px solid #dedede;
   background-color: #fff;
-  // display: none;
+  display: none;
   li {
     height: 34px;
     line-height: 34px;

+ 1 - 2
src/containers/AssistCheck.js

@@ -17,10 +17,9 @@ function mapStateToProps(state) {//console.log(state.assistCheck)
         assistList:state.homePage.assistList,
         assistVal:state.assistCheck.assistVal,
         windowHeight:state.homePage.windowHeight,
-        hospitalMsg: state.patInfo.hospitalMsg,
+        hospitalMsg: state.patInfo.hospitalMsg.pacs || {},
 
         message: state.patInfo.message,
-        hospitalMsg: state.patInfo.hospitalMsg,
         hospitalPac: state.assistCheck.hospitalPac,
         hospitalSonInspect: state.assistCheck.hospitalPacObj,
         checkedList: state.assistCheck.checkedList,

+ 1 - 1
src/containers/Inspect.js

@@ -38,7 +38,7 @@ function mapStateToProps(state) {//console.log(state.inspect)
     windowHeight: state.homePage.windowHeight,
     inspectVal: state.inspect.inspectVal,
     message: state.patInfo.message,
-    hospitalMsg: state.patInfo.hospitalMsg,
+    hospitalMsg: state.patInfo.hospitalMsg.lis || {},
     hospitalInspect: state.inspect.hospitalInspect,
     hospitalSonInspect: state.inspect.hospitalInspectObj,
     allCheck: state.inspect.allCheck,

+ 15 - 1
src/store/actions/patInfo.js

@@ -33,6 +33,20 @@ export const updatePatientMessage=(state,action)=>{
 };
 export const updateHospitalMessage=(state,action)=>{
     const res=Object.assign({},state);
-    res.hospitalMsg = action.data || {};
+    let tmpObj = {
+      lis:{},
+      pacs:{},
+      connect:{}
+    };
+    for(let i = 0;i < action.data.length;i++){
+      if(action.data[i].code == 'import_way_lis'){//化验数据
+        tmpObj.lis=action.data[i]
+      }else if(action.data[i].code == 'import_way_pacs'){//辅检数据
+        tmpObj.pacs=action.data[i]
+      }else if(action.data[i].code == 'connect'){//是否对接
+        tmpObj.connect=action.data[i]
+      }
+    }
+    res.hospitalMsg = tmpObj || {};
     return res;
 };

+ 3 - 2
src/store/async-actions/patInfo.js

@@ -19,14 +19,15 @@ export const initHospitalInfo = (dispatch, getState) => {
     let baseList = getState();
     let state = baseList.patInfo.message;
     json(api.getHospitalInfo, {
-        "code": getUrlArgObject('hospitalId'),
+        "hospitalCode":getUrlArgObject('hospitalId'),
+        "code": '',
         "id":state.hospitalId
     }).then((res) => {
         const data = res.data;
         if (data.code == 0) {
             dispatch({
               type: GET_HOSPITAL_MESSAGE,
-              data:data.data[0]
+              data:data.data.sysSetInfoData||[]
             });
         } else {
             console.log(res)

+ 0 - 1
src/store/reducers/inspect.js

@@ -314,7 +314,6 @@ export default (state = initSearchList, action) => {
         let tmpArr2 = newState.labelList;
         newState.getExcelData = action.data
 
-        console.log(action.data)
         tmpArr.push(action.data)
         newState.getExcelDataList = [...tmpArr]
         newState.pushItem = getPushList(tmpArr,tmpArr2);