فهرست منبع

开单项数据存储

luolei 4 سال پیش
والد
کامیت
18dbf10814

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

@@ -244,8 +244,8 @@ class AddAssistCheck extends React.Component {
               </div>
               <DelToast show={idx==id&&item.name==activeName?visible:false}
                   name={activeName}
-                  right={'-34px'}
-                  top={'40px'}
+                  right={'-40px'}
+                  top={'50px'}
                   cancel={this.handleCancel}
                   confirm={()=>this.delConfirm(1)}/>
               {/* {

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

@@ -141,7 +141,7 @@
   cursor: pointer;
   position: absolute;
   right: -7px;
-  top: 2px;
+  top: -6px;
   background: @closeIcon;
   background-color: #fff;
   background-size: 100% 100%;

+ 14 - 11
src/components/AddNewInspect/SlidePic/index.jsx

@@ -155,7 +155,7 @@ class SlidePic extends Component {
           <span className={styles.pass}>化验时间:{item.time}</span>
           <span id="addClose" className={styles.partDel} onClick={()=>{this.handleDel(item.time)}}></span>
           <DelToast show={time==item.time&&activeInd?true:false}
-                    name={activeName} 
+                    name={activeName}
                     right={'-34px'}
                     top={'30px'}
                     cancel={this.handleCancel}
@@ -165,16 +165,19 @@ class SlidePic extends Component {
           <span className={styles.bigname}>{item.name}</span>
           <span className={styles.smallname}>{item.flg == 5?'药品':'手术/操作'}</span>
           <span className={styles.edit}>
-            <input disabled={canEdit} type="text" 
-              className="canEdit" 
-              onDoubleClick={this.setEdit}
-              style={{color:style==2||style==4?'red':style==1?'#D949FF':'#333'}}
-              placeholder='(填写用法计量)'
-              autoComplete="off"
-              value={value}
-              onInput={(e)=>{this.handleInput(e,item)}}
-              onBlur={()=>{this.handleBlur()}}
-              />
+            {
+              item.flg == 5?
+              <input disabled={canEdit} type="text" 
+                className="canEdit" 
+                onDoubleClick={this.setEdit}
+                style={{color:style==2||style==4?'red':style==1?'#D949FF':'#333'}}
+                placeholder='(填写用法计量)'
+                autoComplete="off"
+                value={value}
+                onInput={(e)=>{this.handleInput(e,item)}}
+                onBlur={()=>{this.handleBlur()}}
+                />:null
+            }
           </span>
           {/* <span className={styles.maxmin}></span> */}
           <span className={styles.pass}>{item.time}</span>

+ 1 - 1
src/containers/NewAdvice.js

@@ -30,7 +30,7 @@ import {
 } from '@store/async-actions/pushMessage';
 import {HIDEDROP} from '@types/homePage';
 
-function mapStateToProps(state) {console.log(state)
+function mapStateToProps(state) {//console.log(state)
   return {
     list: state.newAdvice.list,
     labelList: state.newAdvice.labelList,

+ 2 - 0
src/store/async-actions/inspect.js

@@ -30,6 +30,8 @@ export const getSearchList = (val) => {
                         let obj = {}
                         obj['uniqueName'] = arr[key];
                         obj['detailName'] = arr[key];
+                        obj['value'] = '';
+                        obj['otherValue']='';
                         obj['name'] = arr[key];
                         obj['flg'] = 1;
                         tmp.push(obj)

+ 8 - 3
src/store/reducers/assistCheck.js

@@ -26,7 +26,8 @@ const initSearchList = {
   msgObj:{
     name:'',
     patientNum:''
-  }
+  },
+  totalOrder:[],//开单项
 }
 import { getCurrentDate,getAllString} from '@utils/tools';
 
@@ -73,7 +74,7 @@ export default (state = initSearchList, action) => {
   if (action.type == CHECK_OFF_ON) { //选中开单项
     const newState = Object.assign({}, state);
     let tempArrs = newState.assistLabel;
-    let tempList = action.item
+    let tempList = action.item,tempOrder=[]
     for(let i = 0;i < tempArrs.length;i++){
         if(tempArrs[i].time == tempList.time){
             let flg = tempArrs[i].check;
@@ -81,6 +82,8 @@ export default (state = initSearchList, action) => {
         }
     }
     let tmpObj = getAllString([],newState.assistLabel)
+    tempOrder=tempArrs.filter((item)=>item.check)
+    newState.totalOrder = [...tempOrder]
     newState.assistLabel = [...tempArrs]
     newState.dataArr = tmpObj.arr
     newState.dataString = tmpObj.str
@@ -88,7 +91,7 @@ export default (state = initSearchList, action) => {
   }
   if (action.type == DEL_ASSIST_LABEL) { //删除
     const newState = Object.assign({}, state);
-    let tempArr = newState.assistLabel,tempArrs = [];
+    let tempArr = newState.assistLabel,tempArrs = [],tempOrder=[];
     let tmpImportLis = newState.checkedListImport;
     if(action.flg == 0){//删除辅检导入
       tmpImportLis.splice(action.idx,1)
@@ -101,6 +104,8 @@ export default (state = initSearchList, action) => {
       newState.assistLabel = [...tempArrs]
     }
     let tmpObj = getAllString(newState.checkedListImport,newState.assistLabel)
+    tempOrder=tempArrs.filter((item)=>item.check)
+    newState.totalOrder = [...tempOrder]
     newState.dataArr = tmpObj.arr
     newState.dataString = tmpObj.str
     return newState;

+ 19 - 4
src/store/reducers/inspect.js

@@ -36,6 +36,7 @@ const initSearchList = {
     shType:2,
     labelListBig:[],//大项
     labelListSmall:[],//小项
+    totalOrder:[],//开单项
 }
 
 export default (state = initSearchList, action) => {
@@ -43,8 +44,7 @@ export default (state = initSearchList, action) => {
         const newState = Object.assign({}, state);
         let tempArr = newState.labelListBig;
         let tempArrs = newState.labelListSmall;
-        let tmpLis = action.item
-        
+        let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempTotalOrder=[];
         if(tmpLis&&tmpLis.flg == 1){
             for(let i = 0;i < tempArr.length;i++){
                 if(tempArr[i].time == tmpLis.time){
@@ -62,13 +62,17 @@ export default (state = initSearchList, action) => {
             }
             newState.labelListSmall = [...tempArrs]
         }
+        tempBigOrder = tempArr.filter((item)=>item.check)
+        tempSmallOrder = tempArrs.filter((item)=>item.check)
+        tempTotalOrder=tempBigOrder.concat(tempSmallOrder)
+        newState.totalOrder=[...tempTotalOrder]
         return newState;
     }
     if (action.type == DEL_ONE_PIC) {
         const newState = Object.assign({}, state);
         let tempArr = newState.labelListBig;
         let tempArrs = newState.labelListSmall;
-        let tmpLis = action.item
+        let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempTotalOrder=[];
         if(tmpLis&&tmpLis.flg == 1){//大项
             tempArr = tempArr.filter((item)=>item.time != tmpLis.time)
             newState.labelListBig = [...tempArr]
@@ -76,6 +80,10 @@ export default (state = initSearchList, action) => {
             tempArrs = tempArrs.filter((item)=> item.time != tmpLis.time )
             newState.labelListSmall = [...tempArrs]
         }
+        tempBigOrder = tempArr.filter((item)=>item.check)
+        tempSmallOrder = tempArrs.filter((item)=>item.check)
+        tempTotalOrder=tempBigOrder.concat(tempSmallOrder)
+        newState.totalOrder=[...tempTotalOrder]
         return newState;
     }
 
@@ -86,7 +94,11 @@ export default (state = initSearchList, action) => {
         let tmpLis = action.item
         tempArrs = tempArrs.filter((item)=>{
             if(item.time == tmpLis.time){
-                item.value = action.value
+                if(isNumber(action.value-0)){
+                    item.value = action.value
+                }else{
+                    item.otherValue = action.value
+                }
             }
             return item
         })
@@ -312,3 +324,6 @@ function getString(lists) {
     })
     return tmpString;
 }
+function isNumber(obj) {  
+    return typeof obj === 'number' && !isNaN(obj)  
+}

+ 11 - 2
src/store/reducers/newAdvice.js

@@ -36,6 +36,7 @@ const initSearchList = {
     shType:5,
     labelListBig:[],//大项
     labelListSmall:[],//小项
+    totalOrder:[],//开单项
 }
 
 export default (state = initSearchList, action) => {
@@ -43,7 +44,7 @@ export default (state = initSearchList, action) => {
         const newState = Object.assign({}, state);
         let tempArr = newState.labelListBig;
         let tempArrs = newState.labelListSmall;
-        let tmpLis = action.item
+        let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempTotalOrder=[];
         if(tmpLis&&tmpLis.flg == 5){//药品
             for(let i = 0;i < tempArr.length;i++){
                 if(tempArr[i].time == tmpLis.time){
@@ -61,13 +62,17 @@ export default (state = initSearchList, action) => {
             }
             newState.labelListSmall = [...tempArrs]
         }
+        tempBigOrder = tempArr.filter((item)=>item.check)
+        tempSmallOrder = tempArrs.filter((item)=>item.check)
+        tempTotalOrder=tempBigOrder.concat(tempSmallOrder)
+        newState.totalOrder=[...tempTotalOrder]
         return newState;
     }
     if (action.type == DEL_ONE_PIC) {
         const newState = Object.assign({}, state);
         let tempArr = newState.labelListBig;
         let tempArrs = newState.labelListSmall;
-        let tmpLis = action.item
+        let tmpLis = action.item,tempBigOrder=[],tempSmallOrder=[],tempTotalOrder=[];
         if(tmpLis&&tmpLis.flg == 5){//大项
             tempArr = tempArr.filter((item)=>item.time != tmpLis.time)
             newState.labelListBig = [...tempArr]
@@ -75,6 +80,10 @@ export default (state = initSearchList, action) => {
             tempArrs = tempArrs.filter((item)=> item.time != tmpLis.time )
             newState.labelListSmall = [...tempArrs]
         }
+        tempBigOrder = tempArr.filter((item)=>item.check)
+        tempSmallOrder = tempArrs.filter((item)=>item.check)
+        tempTotalOrder=tempBigOrder.concat(tempSmallOrder)
+        newState.totalOrder=[...tempTotalOrder]
         return newState;
     }