Kaynağa Gözat

Merge branch 'master' of http://git.yvanui.com/hust/wuhan_epi into test_branch

lange 5 yıl önce
ebeveyn
işleme
ceaa00f79a

+ 47 - 43
whepi-ui/templates/lingyun/ribao.ftl

@@ -208,58 +208,62 @@
                         <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                             <div style="height: 5vh; line-height: 5vh; width: 55%;">是否出行</div>
                             <input id="js_input_sf" class="weui-input" type="text" placeholder="请选择"
-                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 145%"/>
+                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 145%" onchange="selectinput6(this)"/>
                         </div>
                         <br/>
                     <#--<div style="text-align: center;height: 1vh;">出行情况上报</div>-->
-                        <div class="weui-loadmore weui-loadmore_line" style="width: 100%;height: 1vh;">
-                            <span class="weui-loadmore__tips">出行情况上报</span>
-                        </div>
-                        <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 6vh;">
-                            <div style="height: 5vh; line-height: 5vh; width: 55%;">出发地</div>
-                            <input id="js_input_cfd" class="weui-input" type="text" placeholder="请选择"
-                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%" onchange="selectinput3(this)"/>
-                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                            <input id="js_input_cfdq" placeholder="其它地点" disabled="disabled" type="text" style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;" />
-                        </div>
-                        <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                            <div style="height: 5vh; line-height: 5vh; width: 55%;">目的地</div>
-                            <input id="js_input_mdd" class="weui-input" type="text" placeholder="请选择"
-                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%" onchange="selectinput4(this)"/>
-                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                            <input id="js_input_mddq" placeholder="其它地点" disabled="disabled" type="text" style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;" />
-                        </div>
-                        <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                            <div style="height: 5vh; line-height: 5vh; width: 55%;">出行方式</div>
-                            <input id="js_input_cxfs" class="weui-input" type="text" placeholder="请选择出行方式"
-                                   style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%" onchange="selectinput5(this)"/>
-                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                            <input id="js_input_cxfsq" placeholder="车次/航班/车牌" type="text" style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;" />
 
-                        </div>
-                        <div class="weui-cell__ft" style="margin-top: 1vh;">
-                            <button id="btnAdd" href="javascript:" style="height:5vh; margin-right: 0vh;width: 70px;"
-                                    class="weui-btn weui-btn_mini weui-btn_primary" onclick="insertlingyun()">添加
-                            </button>
-                        </div>
-                        <div class="weui-loadmore tt" style="width: 100%;height: 1vh;margin-top: 1vh;">
-                        </div>
-                        <div>
-                            <table cellspacing="0" cellpadding="0" style="width: 100%">
-                                <tbody id="tabtr"><#--border="1" cellspacing="0" cellpadding="0"-->
-                                <tr style="background-color: #f8f8f8;">
-                                <#-- <td style="text-align: center;">序号</td>
+                        <div id="none">
+                            <div class="weui-loadmore weui-loadmore_line" style="width: 100%;height: 1vh;">
+                                <span class="weui-loadmore__tips">出行情况上报</span>
+                            </div>
+                            <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 6vh;">
+                                <div style="height: 5vh; line-height: 5vh; width: 55%;">出发地</div>
+                                <input id="js_input_cfd" class="weui-input" type="text" placeholder="请选择"
+                                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%" onchange="selectinput3(this)"/>
+                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                <input id="js_input_cfdq" placeholder="其它地点" disabled="disabled" type="text" style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;" />
+                            </div>
+                            <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                                <div style="height: 5vh; line-height: 5vh; width: 55%;">目的地</div>
+                                <input id="js_input_mdd" class="weui-input" type="text" placeholder="请选择"
+                                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%" onchange="selectinput4(this)"/>
+                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                <input id="js_input_mddq" placeholder="其它地点" disabled="disabled" type="text" style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;" />
+                            </div>
+                            <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                                <div style="height: 5vh; line-height: 5vh; width: 55%;">出行方式</div>
+                                <input id="js_input_cxfs" class="weui-input" type="text" placeholder="请选择出行方式"
+                                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;width: 50%" onchange="selectinput5(this)"/>
+                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                <input id="js_input_cxfsq" placeholder="车次/航班/车牌" type="text" style="width: 80%;text-align: center;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-color: #75859f;height: 5vh;font-size:inherit;color:inherit;" />
+
+                            </div>
+                            <div class="weui-cell__ft" style="margin-top: 1vh;">
+                                <button id="btnAdd" href="javascript:" style="height:5vh; margin-right: 0vh;width: 70px;"
+                                        class="weui-btn weui-btn_mini weui-btn_primary" onclick="insertlingyun()">添加
+                                </button>
+                            </div>
+                            <div class="weui-loadmore tt" style="width: 100%;height: 1vh;margin-top: 1vh;">
+                            </div>
+                            <div>
+                                <table cellspacing="0" cellpadding="0" style="width: 100%">
+                                    <tbody id="tabtr"><#--border="1" cellspacing="0" cellpadding="0"-->
+                                    <tr style="background-color: #f8f8f8;">
+                                    <#-- <td style="text-align: center;">序号</td>
                                 <td style="text-align: center;">出发地</td>
                                 <td style="text-align: center;">目的地</td>
                                 <td style="text-align: center;">出行方式</td>
                                 <td style="text-align: center;">车次/航班/车牌</td>-->
-                                </tr>
-                                </tbody>
-                            </table>
-                            <table id="tab5" class="new_tab" align="left" cellpadding="0" cellspacing="0"
-                                   style="width: 100%;">
-                            </table>
+                                    </tr>
+                                    </tbody>
+                                </table>
+                                <table id="tab5" class="new_tab" align="left" cellpadding="0" cellspacing="0"
+                                       style="width: 100%;">
+                                </table>
+                            </div>
                         </div>
+
                     </div>
                     <div style="display: flex; justify-content: center;">
                         <div style="width: 70%;color: red; text-align: center;">

+ 21 - 3
whepi-ui/templates/lingyun/ribao.js

@@ -380,16 +380,34 @@ function selectinput5(obj){
     }
 
 }
-//添加出行详情
 var listcx = [];
-var person=new Object();
+function selectinput6(obj){
+    var grender = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
+    if(grender == 0){
+        $('#none')[0].style.display = 'none';
+        $("#js_input_cxfs").val("");
+        $("#js_input_cfd").val("");
+        $("#js_input_mdd").val("");
+        $('#js_input_cxfsq').val("");
+        $('#js_input_cfdq').val("");
+        $('#js_input_mddq').val("");
+        listcx.splice(0,listcx.length);
+        $('#tabtr').empty();
+    }else if(grender == 1){
+        $('#none')[0].style.display = '';
+    }
+
+}
+//添加出行详情
+
+
 function insertlingyun(){
     var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
     if(sf == 0 || sf == 3){
         $.alert("请选择是否出行");
         return;
     }
-
+    var person=new Object();
     var cxfs = $("#js_input_cxfs").attr("data-values") == undefined ? 0 : $("#js_input_cxfs").attr("data-values");
     var cfd = $("#js_input_cfd").attr("data-values") == undefined ? 0 : $("#js_input_cfd").attr("data-values");
     var mdd = $("#js_input_mdd").attr("data-values") == undefined ? 0 : $("#js_input_mdd").attr("data-values");