ソースを参照

Merge branch '1.2.1_zxc' into test

zhangxc 5 年 前
コミット
51b306b922

+ 9 - 2
src/css/assertType.less

@@ -42,12 +42,12 @@
     .main-body{
         margin: 20px 0;
         padding: 0 35px;
-        min-width: 1090px;
+        // min-width: 1090px;
         /*width: 100%;*/
     }
     table{
         .table;
-        min-width: 1090px;
+        // min-width: 1090px;
         th,td{
             text-align: center;
         }
@@ -141,6 +141,13 @@
             padding: 0 10px;
             box-sizing: border-box;
         }
+        input:focus{
+            border: 1px solid @activeColor ;
+            outline: 0;
+            -webkit-box-shadow:@activeColor  0px 0px 2px;
+            -moz-box-shadow: @activeColor  0px 0px 2px;
+            box-shadow: @activeColor  0px 0px 2px;
+        }
     }
     
     .filterDropList{

+ 128 - 7
src/css/assertTypeDetail.less

@@ -13,14 +13,14 @@
     .main-body{
         margin: 20px 0;
         padding: 0 35px;
-        min-width: 1090px;
+        // min-width: 1090px;
         /*width: 100%;*/
     }
     .filterItem{
         position: relative;
         height: 40px;
         line-height: 40px;
-        margin: 0 20px 15px 0;
+        margin: 0 0px 15px 0;
         float: none !important;
         span{
             display: inline-block;
@@ -38,10 +38,17 @@
             border-radius:4px;
             border: 1px solid #E2E5EF;
             outline: none;
-            margin-right: 10px;
+            // margin-right: 10px;
             padding: 0 10px;
             box-sizing: border-box;
         }
+        input:focus{
+            border: 1px solid @activeColor ;
+            outline: 0;
+            -webkit-box-shadow:@activeColor  0px 0px 2px;
+            -moz-box-shadow: @activeColor  0px 0px 2px;
+            box-shadow: @activeColor  0px 0px 2px;
+        }
     }
     
     .selectLevel,.selectDept{
@@ -77,13 +84,127 @@
         width: 160px;
         max-height: 400px;
     }
+    .qcItemTitle{
+        float: left;
+        line-height: 40px;
+    }
     .listTypeAll {
-        li {
-            height: 48px;
-            line-height: 48px;
+        margin-left: 80px; 
+        .caseEntryBlcok {
+            box-sizing: border-box;
+            border: 1px solid #E2E5EF;
+            border-radius: 4px;
+            margin: 0 0 10px 0;
+        }
+        .caseEntryName {
+            // height: 48px;
+            line-height: 34px;
             background-color: #fff;
             cursor: pointer;
-            padding-bottom: 1px solid #ebeef5;
+            padding: 0 10px;
+            position: relative;
+            // border-bottom: 1px solid #ebeef5;
+            img{
+                width: 10px;
+                position: absolute;
+                right: 10px;
+            }
+        }
+        .tabTitle,.tabInfo{
+            line-height: 30px;
+            position: relative;
+        }
+        .caseEntryDetail{
+            display: none;
+            padding: 10px 20px;
+            border-top: 1px solid #E2E5EF;
+        }
+        .opera,.qcItem,.qcUsed{
+            display: inline-block;
+            text-align: center;
+        }
+        .opera{
+            width: 11%;
+        }
+        .qcItem{
+            width: 76%;
+        }
+        .qcUsed{
+            width: 13%;
+        }
+        .tabTitle{
+            background: #EFF0F9;
+            font-size: 14px;
+            font-weight: 500;
+        }
+        .tabInfo{
+            box-sizing: border-box;
+            border-left: 1px solid #E2E5EF;
+            border-right: 1px solid #E2E5EF;
+            border-bottom: 1px solid #E2E5EF;
+        }
+        .tabInfo{
+            .opera,.qcItem,.qcUsed{
+                box-sizing: border-box;
+            }
+            .qcItem{
+                border-left: 1px solid #E2E5EF;
+                border-right: 1px solid #E2E5EF;
+            }
+            .opera{
+                width: 11%;
+                position: absolute;
+                height: 100%;
+            }
+            .qcItem{
+                width: 76%;
+                position: relative;
+                left: 11%;
+            }
+            .qcUsed{
+                position: absolute;
+                left: 87%;
+                width: 13%;
+                height: 100%;
+            }
+        }
+        .tabInfo:nth-child(2n+1){
+            background:#F5F6FA;
         }
     }
+}
+// .borderTop{
+//     border-top: 1px solid #ebeef5;
+// }
+.iconCheck{
+    width: 14px;
+    cursor: pointer;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    margin: -7px 0 0 -7px;
+}
+.usedRes{
+    display: inline-block;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    margin: -15px 0 0 -7px;
+}
+.submitBox{
+    text-align: right;
+}
+.submit{
+    display: inline-block;
+    width:60px;
+    height:32px;
+    background:@activeColor;
+    border-radius:4px;
+    color: #fff;
+    text-align: center;
+    line-height: 32px;
+    position: relative;
+    top: 2px;
+    cursor: pointer;
+    margin: 0 20px 22px 0;
 }

+ 9 - 9
src/html/assertTypeDetail.html

@@ -26,21 +26,21 @@
                 </div>    -->
                 <div class="filterItem typeFilter">
                     <span class="explainL">质控类型:</span>
-                    <input class="patientNumInp" style="width: 148px;" type="text" placeholder="请输入质控类型">
+                    <input class="patientNumInp"  type="text" placeholder="请输入质控类型">
                 </div>
-                <div class="filterItem typeFilter">
-                    <span class="">质控条目:</span>
-                    <ul class="listTypeAll">
-                        <li>
+                <div class=" clearfix">
+                    <div class="qcItemTitle">质控条目:</div>
+                    <div class="listTypeAll">
+                        <!-- <div>
                             <span>病案首页</span><i></i>
-                        </li>
-                    </ul>
+                        </div> -->
+                    </div>
                 </div>
                 <!-- <span class="filter">查询</span>
                 <span class="addTypeAssert"><a href="assertTypeDetail.html">添加质控类型</a></span> -->
             </div>
-
-            <div class="pagination"></div>
+            <div class="submitBox"><span class="submit">确定</span></div>
+            <!-- <div class="pagination"></div> -->
         </div>
     </div>
 </body>

BIN
src/images/arrow_down22.png


src/images/下收起_深色背景@2x.png → src/images/arrow_up11.png


BIN
src/images/arrow_up22.png


+ 16 - 0
src/js/assertType.js

@@ -214,6 +214,7 @@ function scoreDetail(id,age,hid,code){
     window.open(`./qcScore.html?id=${id}&age=${age}&hid=${hid}&code=${code}`)
 }
 function bindScoreDetail(hisId){
+    //删除
     $('.assertTypeDel').on('click',function(e){
         const index = $(this).attr("data-index")
         const id = $(this).attr("data-id")
@@ -221,6 +222,21 @@ function bindScoreDetail(hisId){
         const item = tabList[index]
         midifyMsgBox(item,type,id)
     })
+    //修改
+    $('.assertTypeEdit').on('click',function(e){
+        const index = $(this).attr("data-index")
+        const id = $(this).attr("data-id")
+        const type = $(this).attr("data-type")
+        $(parent.document).find("#contentIframe").attr("src",`assertTypeDetail.html?id=${id}&type="edit"`)
+        console.log('修改')
+    })
+    //复制
+    $('.assertTypeCopy').on('click',function(e){
+        const index = $(this).attr("data-index")
+        const id = $(this).attr("data-id")
+        const type = $(this).attr("data-type")
+        $(parent.document).find("#contentIframe").attr("src",`assertTypeDetail.html?id=${id}&type="copy"`)
+    })
 }
 
   

+ 143 - 9
src/js/assertTypeDetail.js

@@ -2,23 +2,157 @@ const $ = require('jquery');
 require("../css/assertTypeDetail.less");
 require('./modal.js');
 const {api} = require('./api.js')
-const {post,getCookie,getUrlArgObjectNew} = require('./utils.js')
-
+const {post,getCookie,getUrlArgObjectNew,getUrlArgObject} = require('./utils.js')
+const iconCheck= require("./../images/icon_check.png")
+const iconUnCheck = require("./../images/icon_unchecked.png")
+const arrowUp = require("./../images/arrow_up22.png")
+const arrowDown = require("./../images/arrow_down22.png")
 
+let dataCopy,paramType,paramId,submitMsg="新增成功~"
 $(function(){
-    getList()//获取条目列表
+    let srcUrl = $("#contentIframe",parent.document).attr("src")
+    paramType = getUrlArgObject("type")||""
+    paramId = getUrlArgObject("id")||""
+    getList(paramType)//获取条目列表
 
 })
-function getList(){
-    post(api.getEntryByHospital,{}).then(res =>{
+const filterBoxWidth = $('.filterBox').width()
+$('.patientNumInp').css('width', filterBoxWidth-82-15 +'px')
+function getList(type){
+    console.log('type',type)
+    if(!type){
+        post(api.getEntryByHospital,{}).then(res =>{
+            let result = res.data
+            if(result.code == '0'){
+                const data = result.data;
+                console.log(data)
+                renderData(data)
+                
+            }else{
+                
+            }
+        }).catch((e) =>{
+        
+        })
+    }else{
+        if(type =='"edit"'){
+            $('.partTitle p').html('质控类型维护/修改')
+            submitMsg="修改成功~"
+        }else{
+            $('.partTitle p').html('质控类型维护/复制')
+            submitMsg="复制成功~"
+        }
+        post(api.typeGetById,{id: paramId}).then(res =>{
+            let result = res.data
+            if(result.code == '0'){
+                const data = result.data;
+                const qcName = data.name
+                const tabData = data.entryMap
+                if(type =='"edit"'){
+                    $('.patientNumInp').val(qcName)
+                }
+                renderData(tabData)
+                
+            }else{
+                
+            }
+        }).catch((e) =>{
+        
+        })
+    }
+    
+}
+
+function renderData(data){
+    dataCopy = data
+    const dataKeys = Object.keys(dataCopy)
+    let str = ""
+    for(let i = 0; i < dataKeys.length; i++){
+        str += `<div class="caseEntryBlcok ${i===0 ? 'borderTop':''}"><div class="caseEntryName">${dataKeys[i]} <img class="arrow" src=${arrowDown}></div>`
+        if(dataCopy[dataKeys[i]].length > 0){
+            str += `<div class="caseEntryDetail"><div class="tabTitle"><span class="opera">操作</span><span class="qcItem">质控条目</span><span class="qcUsed">是否启用</span></div>`
+        }
+        for(let j = 0; j < dataCopy[dataKeys[i]].length; j++){
+            const dataItem = dataCopy[dataKeys[i]][j]
+            str += `<div class="tabInfo"><span  data-pIndex=${dataKeys[i]} data-index=${j} class="opera">${dataItem.sel == '1' ? `<img  class="iconCheck" src=${iconCheck} />`:`<img class="iconCheck" src=${iconUnCheck} />`}</span><span class="qcItem">${dataItem.name}</span><span class="qcUsed"><span class="usedRes">${dataItem.isUsed == '1' ? "是":"否"}</span></span></div>`
+        }
+        if(dataCopy[dataKeys[i]].length > 0){
+            str += `</div>`
+        }
+        str += `</div>`
+    }
+  
+    $('.listTypeAll').html(str)
+    bindBlockSlideToggle()
+    bindCheck()
+}
+function bindBlockSlideToggle(){
+ $('.caseEntryName').click(function(){
+     const display =  $(this).parent().find('.caseEntryDetail').css("display");
+     if(display === "none"){
+        $(this).find('img').attr('src', arrowUp)
+        $('.caseEntryDetail').slideUp()
+        $(this).parent().find('.caseEntryDetail').slideDown()
+     } else{
+        $(this).find('img').attr('src', arrowDown)
+        $('.caseEntryDetail').slideUp()
+     }
+    
+ })
+}
+
+function bindCheck(){
+    $('.iconCheck').click(function(){
+        const checked =  $(this).attr('src') == iconCheck;
+        const index = $(this).parent().attr('data-index')
+        const pIndex = $(this).parent().attr('data-pIndex')
+        if(checked){
+            dataCopy[pIndex][index].sel = 0
+            $(this).attr('src',iconUnCheck)
+        } else{
+            dataCopy[pIndex][index].sel = 1
+            $(this).attr('src',iconCheck)
+        }
+    })
+}
+
+$('.submit').click(function(){
+    const qcName = $('.patientNumInp').val().trim();
+    if(!qcName){
+        $.alerModal({"message":"质控类型不能为空~",type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+        return
+    }
+    let qcTypeCasesEntryVOList = []
+    const dataKeys = Object.keys(dataCopy)
+    for(let i = 0; i < dataKeys.length; i++){
+        for(let j = 0; j < dataCopy[dataKeys[i]].length; j++){
+            const dataItem = dataCopy[dataKeys[i]][j]
+            if(dataItem.sel == '1'){
+                qcTypeCasesEntryVOList.push({
+                    caseEntryId: dataItem.id
+                })
+            }
+        }
+      
+    }
+
+    const param = {
+        id:paramId,
+        name: qcName,
+        qcTypeCasesEntryVOList
+    }
+   
+    post(api.saveOrUpdate,param).then(res =>{
         let result = res.data
         if(result.code == '0'){
-            const data = result.data;
-            console.log(data)
+            $.alerModal({"message":submitMsg,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+            setTimeout(function(){
+                $(parent.document).find("#contentIframe").attr("src","./assertType.html")
+            },1000)
         }else{
-            
+            $.alerModal({"message":res.data.msg,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
         }
     }).catch((e) =>{
     
     })
-}
+})

+ 1 - 1
src/js/utils.js

@@ -1,7 +1,7 @@
 const qs = require('qs');
 const $ = require("jquery");
 var Utils = require('./rePromise');
-const baseUrl = "http://192.168.2.241:5858"
+const baseUrl = "http://192.168.2.236:5858"
 //页面映射
 const pageMap={
   'YH-KZT':'console.html',