什么?又是自查表问卷?

真的很费脑筋 , 简易在写逻辑的时候找个清净点的地方   废话不多说  直接撸代码

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="jsxx_ckjgNew.aspx.cs" Inherits="wjtwh_Default" %>

<!DOCTYPE html>
<html lang="zh-cn">
<head runat="server">
<meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>上城区自查表模板(2020年06月份)</title>
    <link rel="stylesheet" type="text/css" href="../css/css.css" />
    <script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="../js/layer.min.js" type="text/javascript"> </script>

    <style>
        body{
            min-width: 420px;
            font-family: '宋体';
            font-size: 10pt;
            background-color: #fff;
        }
        td{
            font-family:verdana;
            cursor:default;
            font-size:14px;
        }
        .t-lanmu{
            background-image:url('../images/untitled.png');
            color:#4d4d4d;
            font-weight: bolder;
            font-size:12px;
            width: 35%;
        }
        a {
            text-decoration:none;
        }
        a:link {
            color: #000000;
        }
        a:visited {
            color: #000000;
        }
        a:hover {
            color: #006da6;
            text-decoration:underline;
        }
        .pop_img .mask{ position:fixed; left:0;top:0; width:100%; height:100%; background:#000; opacity:0.6; filter:alpha(opacity=60);-moz-opacity:0.6;  z-index:105; display:none;   }
        .pop_img .popover{ width: 650px;height: 610px;  position:fixed; left:50%; top:50%;margin: -305px 0 0 -350px;text-align:center; z-index:106;  text-align:center; font-size:14px;  box-shadow:0px 1px 3px rgba(0,0,0,.1); display:none; }
        .pop_img .popover>img{
            max-width: 100%;
            max-height: 100%;
        }
        .pop_img .close{ position:absolute; top:10px; right:10px; font-size:20px; color:#666;}
        .pop_img .popover h1{ font-size:20px; margin-top:120px;}
        .tac{text-align: center;}
        #Title{font-size: 20px;/*color: #5A83E5*/;padding-top: 50px;}
        .eachOne{border-bottom: 1px solid #f2f2f2;padding: 0.8rem 0;/*box-shadow: 0 2px 3px -1px  #bbe8ff;*/}
        .eachOne input{
            padding: 0 5px;
            border: 0;
            margin-right: 8px;
            border-bottom: 1px solid #5A83E5;
            /*color: #5A83E5;
            font-weight: 700;*/
        }
        .eachOne input[type=radio]{
            zoom: 1.7;
            vertical-align: bottom;

        }
        .ask>input{
            padding: 8px 5px;
            background-color: #f2f2f2;
            border: 0;
            margin-left: 10px;
            font-size: 18px;
        }
        #record{
            width: 80%;
            padding:0 50px ;
            margin: auto;
            font-family: "微软雅黑";
            box-shadow:0px 1px 6px 0px rgba(205,220,245,1)
        }
        .company{
            font-size: 14px;
            color: #999;
            /*line-height: 1.5;
            background-color: #F3F3F3;
            border-top: 1px solid #b9b9b9;*/
        }
        .qustList{
            font-family: verdana;
            cursor: default;
            font-size: 18px
        }
        .answer ul,.aboutImg{
            display: inline-block;
            vertical-align: top;
            margin: auto;
            margin-bottom: 5px;
        }
        .answer ul{
            width: 38%;
        }
        .answer ul li{
            font-size: 16px;
            color: #666;
            padding: 5px 0;
        }
        .aboutImg{
            width: 60%;
            font-size: 14px;
            color: #666;
        }
        .aboutImg img{vertical-align: middle;margin-right: 5px;}
        /* .answer li:hover{background-color: rgb(239, 239, 239);} */
        .comp .btn{padding: 15px 0;}
        .comp footer{
            font-size: 13px;
            color: #fff;
            padding: 10px 0;
            background-color: #017EC0;
        }
    </style>
    <script type="text/javascript" language="javascript">
        window.name = "curWindow123";

        function gbps() {
            window.close();
            return false;
        }
        var flag = false;
        function DrawImage(ImgD, iwidth, iheight) {
            //参数(图片,允许的宽度,允许的高度)  
            var image = new Image();
            image.src = ImgD.src;
            if (image.width > 0 && image.height > 0) {
                flag = true;
                if (image.width / image.height >= iwidth / iheight) {
                    if (image.width > iwidth) {
                        ImgD.width = iwidth;
                        ImgD.height = (image.height * iwidth) / image.width;
                    } else {
                        ImgD.width = image.width;
                        ImgD.height = image.height;
                    }
                    ImgD.alt = image.width + "×" + image.height;
                }
                else {
                    if (image.height > iheight) {
                        // ImgD.height = iheight;
                        ImgD.height = (image.width * iheight) / image.height;
                        ImgD.width = (image.width * iheight) / image.height;
                    } else {
                        ImgD.width = image.width;
                        ImgD.height = image.height;
                    }
                    ImgD.alt = image.width + "×" + image.height;
                }
            }
        }
        var oXL;
        var oWB;
        function ExportExcel() {
            try {
                if (oXL == null) {
                    oXL = new ActiveXObject("Excel.Application");
                }
                //var oXL = new ActiveXObject("Excel.Application"); //创建excel应用程序对象
                oWB = oXL.Workbooks.Add();        //创建工作簿
                var oSheet = oWB.ActiveSheet;        //获取当前活动的工作簿
                var sel = document.body.createTextRange();
                sel.moveToElementText(record);
                sel.select();
                sel.execCommand("Copy");  //复制
                oSheet.Paste();  //粘贴
                oXL.Visible = true; //设置Excel的属性
                oXL.UserControl = true;
                oXL = null;
                oWB = null;
                oSheet = null;
            } catch (e) {
                alert("要导出该表,您必须安装Excel电子表格软件,同时浏览器须使用ActiveX 控件,请确认您的浏览器设置启用所有的ActiveX 控件。");
                return "";
            }
        }

        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <!-- 当前位置 -->
    <div id="Table1">
        <p id="tab1">当前位置:首页>>卫生管理员维护>>自查工作</p>
        <section id="record">
            <h1 id="Title" class="tac">上城区自查表模板(2020年06月份)</h1>
            <p class="company tac">填写单位: <span id="xianqu"></span></p>
            <div class="qustList">
                <!-- 问卷列表 -->



            </div>
            <!-- 弹出层图片 -->
            <div class="pop_img">
                <div class="mask"></div>
                <div class="popover">
                    <img src="" alt="">
                    <p id="rotate">
                        <svg t="1591000697612" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5741" width="32" height="32"><path d="M941.728 137.152C941.728 122.304 932.576 109.152 919.456 103.424 905.728 97.728 889.728 100.576 879.456 111.424L805.152 185.152C724.576 109.152 615.456 64 502.88 64 261.152 64 64 261.152 64 502.88 64 744.576 261.152 941.728 502.88 941.728 633.728 941.728 757.152 884 840.576 783.424 846.304 776 846.304 765.152 839.456 758.88L761.152 680C757.152 676.576 752 674.88 746.88 674.88 741.728 675.424 736.576 677.728 733.728 681.728 677.728 754.304 593.728 795.424 502.88 795.424 341.728 795.424 210.304 664 210.304 502.88 210.304 341.728 341.728 210.304 502.88 210.304 577.728 210.304 648.576 238.88 702.304 288.576L623.456 367.424C612.576 377.728 609.728 393.728 615.456 406.88 621.152 420.576 634.304 429.728 649.152 429.728L905.152 429.728C925.152 429.728 941.728 413.152 941.728 393.152L941.728 137.152Z" p-id="5742" fill="#0075ff"></path></svg>
                    </p>
                </div>
            </div>
            
        </section>
        <!-- 尾部 -->
        <div class="tac comp" style="opacity: 0;">
            <div class="btn">
                <input type="image" name="Button22" id="Button22" src="http://scq.139379.com:1168/images/excel.gif" style="cursor:hand;margin-right: 7%;">
                <input type="image" name="Button1" id="Button1" src="http://scq.139379.com:1168/images/guanbi.png" onclick="return gbps();" style="cursor:hand">
            </div>
            <footer>
                <p>上城区卫生局卫生监督所 </p>
                <p>技术支持:北京克里克科技有限公司</p>
            </footer>
        </div>
    </div>
<script>
    $(function () {
        
        //加载eachOne数据//获取父级地址栏参数

        var urls = window.location.href;
        var pos1 = urls.indexOf("dwmc");
        var pos2 = urls.indexOf("dwid");
        var pos3 = urls.indexOf("type");
        var dwmc = urls.substring(pos1 + 5).split("&")[0].toString();
        var dwid = urls.substring(pos2 + 5).split("&")[0].toString();
        var type = urls.substring(pos3 + 5).split("&")[0].toString();
        $.ajax({
            type: "get",
            url: "../data/helper.ashx",
            data: {
                action: "getZcwcqk",
                type: type,
                dwid: dwid,
                dwmc: dwmc,
            },
            dataType: 'json',
            contentType: "application/json",
            async: false,
            success: function (data) {
                console.log(data);
                //console.log(dwmc);
                //$("#xianqu").html(dwmc);

                if (!jQuery.isEmptyObject(data)) {
                    json = eval(data);
                    //console.log(json);
                    var length = json.length;
                    //console.log(length);
                    var str = '';

                    for (var i = 0; i < length; i++) {
                        if (json[i].type == 0) { //二选一
                            str += '<div class="eachOne"><p class="ask"> ' + json[i].xuhao + '' + json[i].nr + '</p>';
                            if (json[i].hfnr == "1") {
                                str += '<div class="answer"> <ul> <li>' + '<input value="是" name= "all' + json[i].id + '"  type="radio" id="xzttsd' + json[i].id + '" checked>' + 'A、是 </li>';
                                str += '<li><input type="radio"   name="all' + json[i].id + '" runat="server" value="否"  disabled>B、否</li></ul>'
                            } else {
                                str += '<div class="answer"> <ul> <li>' + '<input value="是" name= "all' + json[i].id + '"  type="radio" id="xzttsd' + json[i].id + '" disabled >' + 'A、是 </li>';
                                str += '<li><input type="radio"   name="all' + json[i].id + '" runat="server" value="否"  checked>B、否</li></ul>'
                            }

                            if (json[i].hfimgpath.indexOf("@@") != -1) {//相关图片
                                    var arr1 = json[i].hfimgpath.split("@@");
                                    //console.log(json[i].hfimgpath);
                                    //console.log(arr1);
                                    str += '<div class="aboutImg">相关照片:'
                                    for (var s = 0; s < arr1.length; s++) {
                                        str += '<img src="https://www.bjclick.cn/zichagongzuo/testFile22/1234abcd/' + json[0].ydmid +'/' + arr1[s] + '"  onload="javascript:DrawImage(this,1000,200)" >'
                                    }
                                    str += '</div>'
                            } else if(json[i].hfimgpath != ""){
                                str += '<div class="aboutImg">相关照片:' + '<img src="https://www.bjclick.cn/zichagongzuo/testFile22/1234abcd/' + json[0].ydmid + '/' + json[i].hfimgpath + '"  onload="javascript:DrawImage(this,1000,200)" >' + '</div>'
                            }
                            str += '</div></div>';

                        } else if(json[i].type == 1){ //三选一
                            str += '<div class="eachOne"><p class="ask"> ' + json[i].xuhao + '' + json[i].nr + '</p>';
                            str += '<div class="answer"> <ul> <li>' + '<input value="是" name= "all' + json[i].id + '"  type="radio" id="xzttsd' + json[i].id + '" checked>' + 'A、是 </li>';
                            str += '<li><input type="radio"   name="all' + json[i].id + '" runat="server" value="否"  disabled>B、否</li></ul>';
                            if (json[i].hfimgpath.indexOf("@@") != -1) {//相关图片
                                var arr1 = json[i].hfimgpath.split("@@");
                                str += '<div class="aboutImg">相关照片:'
                                for (var s = 0; s < arr1.length; s++) {
                                    str += '<img src="https://www.bjclick.cn/zichagongzuo/testFile22/1234abcd/' + json[0].ydmid + '/' + arr1[s] + '"  onload="javascript:DrawImage(this,1000,200)" >'
                                }
                                str += '</div>'
                            } else if (json[i].hfimgpath != "") {
                                str += '<div class="aboutImg">相关照片:' + '<img src="https://www.bjclick.cn/zichagongzuo/testFile22/1234abcd/' + json[0].ydmid + '/' + json[i].hfimgpath + '"  onload="javascript:DrawImage(this,1000,200)" >' + '</div>'
                            }
                            str += '</div></div>';
                        } else if(json[i].type == 2){//多选复选框
                            str += '<div class="eachOne"><p class="ask"> ' + json[i].xuhao + '' + json[i].nr + '</p>';
                            str += '<div class="answer"> <ul> <li>' + '<input value="是" name= "all' + json[i].id + '"  type="radio" id="xzttsd' + json[i].id + '" checked>' + 'A、是 </li>';
                            str += '<li><input type="radio"   name="all' + json[i].id + '" runat="server" value="否"  disabled>B、否</li></ul>'
                            str += '</div></div>';
                        } else {//3文本
                            str += '<div class="eachOne"><p class="ask"> ' + json[i].xuhao + '' + json[i].nr + '<input name="Text' + json[i].id + '" type="text" id="Text' + json[i].id + '" value="' + json[i].hfnr + '" disabled>' + json[i].szh_str + '</p></div>';
                        }
                        
                    }
                    $('.qustList').append(str);
                }

            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                //floatNotify.simple("检索错误信息:" + XMLHttpRequest.status + "-" + XMLHttpRequest.readyState + "-" + textStatus);
                console.log("other*error");
            }
        });

        var reg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;
        $('input:text').each(function () {
            var vals = $(this).val();
            var textLength = $(this).val().length;
            //console.log(isNaN(vals));
            if (isNaN(vals)) {
                inputWidth = textLength * 18;//18是文字的宽度
                $(this).width(inputWidth);
            } else {
                inputWidth = textLength * 10.1;//10是数字的宽度
                $(this).width(inputWidth);
            }
        })
        /*------------event----------*/
        $('.aboutImg img').click(function () {
            var src = $(this).attr('src');
            console.log(src)
            $('.pop_img .popover img').attr('src', src);
            $(".pop_img .mask").css("display", "block");
            $(".pop_img .popover").slideDown();
        });

        $(".pop_img .close").click(function () {

            $(".mask").css("display", "none");
            $(".popover").slideUp();
            $('.pop_img .popover img').attr('src', '');
        })
        $(".pop_img .mask").click(function () {
            $(".mask").css("display", "none");
            $(".popover").slideUp(100);
            $('.pop_img .popover img').attr('src', '');
            $('.pop_img .popover img').css('transform', 'rotate(' + 0 + 'deg)');
        })
        var deg = 0;
        $("#rotate").click(function () {
            deg += 90;
            $('.pop_img .popover img').css('transform', 'rotate(' + deg + 'deg)');
        })
        /*禁用所有单选*/
        $("input[type='radio']").each(function () {
            //$(this).prop("disabled",true);  
        });
    })
</script>
    </form>
</body>
</html>

什么  看不懂 ?

http://scq.139379.com:1168/css/css.css  完整链接    需要拷走 测试

连多选答案都读出来了 完整版本

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="jsxx_ckjgNew.aspx.cs" Inherits="wjtwh_Default" %>

<!DOCTYPE html>
<html lang="zh-cn">
<head runat="server">
<meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>上城区自查表模板(2020年06月份)</title>
    <link rel="stylesheet" type="text/css" href="../css/css.css" />
    <script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="../js/layer.min.js" type="text/javascript"> </script>

    <style>
        body{
            min-width: 420px;
            font-family: '宋体';
            font-size: 10pt;
            background-color: #fff;
        }
        td{
            font-family:verdana;
            cursor:default;
            font-size:14px;
        }
        .t-lanmu{
            background-image:url('../images/untitled.png');
            color:#4d4d4d;
            font-weight: bolder;
            font-size:12px;
            width: 35%;
        }
        a {
            text-decoration:none;
        }
        a:link {
            color: #000000;
        }
        a:visited {
            color: #000000;
        }
        a:hover {
            color: #006da6;
            text-decoration:underline;
        }
        .pop_img .mask{ position:fixed; left:0;top:0; width:100%; height:100%; background:#000; opacity:0.6; filter:alpha(opacity=60);-moz-opacity:0.6;  z-index:105; display:none;   }
        .pop_img .popover{ width: 650px;height: 610px;  position:fixed; left:50%; top:50%;margin: -305px 0 0 -350px;text-align:center; z-index:106;  text-align:center; font-size:14px;  box-shadow:0px 1px 3px rgba(0,0,0,.1); display:none; }
        .pop_img .popover>img{
            max-width: 100%;
            max-height: 100%;
        }
        .pop_img .close{ position:absolute; top:10px; right:10px; font-size:20px; color:#666;}
        .pop_img .popover h1{ font-size:20px; margin-top:120px;}
        .tac{text-align: center;}
        #Title{font-size: 20px;/*color: #5A83E5*/;padding-top: 50px;}
        .eachOne{border-bottom: 1px solid #f2f2f2;padding: 0.8rem 0;/*box-shadow: 0 2px 3px -1px  #bbe8ff;*/}
        .eachOne input{
            padding: 0 5px;
            border: 0;
            margin-right: 8px;
            border-bottom: 1px solid #5A83E5;
            /*color: #5A83E5;
            font-weight: 700;*/
        }
        .eachOne input[type=radio]{
            zoom: 1.7;
            vertical-align: bottom;

        }
        .ask>input{
            padding: 8px 5px;
            background-color: #f2f2f2;
            border: 0;
            margin-left: 10px;
            font-size: 18px;
        }
        #record{
            width: 80%;
            padding:0 50px ;
            margin: auto;
            font-family: "微软雅黑";
            box-shadow:0px 1px 6px 0px rgba(205,220,245,1)
        }
        .company{
            font-size: 14px;
            color: #999;
            /*line-height: 1.5;
            background-color: #F3F3F3;
            border-top: 1px solid #b9b9b9;*/
        }
        .qustList{
            font-family: verdana;
            cursor: default;
            font-size: 18px
        }
        .answer ul,.aboutImg{
            display: inline-block;
            vertical-align: top;
            margin: auto;
            margin-bottom: 5px;
        }
        .answer ul{
            width: 38%;
        }
        .answer ul li{
            font-size: 16px;
            color: #666;
            padding: 5px 0;
        }
        .aboutImg{
            width: 60%;
            font-size: 14px;
            color: #666;
        }
        .aboutImg img{vertical-align: middle;margin-right: 5px;}
        /* .answer li:hover{background-color: rgb(239, 239, 239);} */
        .comp .btn{padding: 15px 0;}
        .comp footer{
            font-size: 13px;
            color: #fff;
            padding: 10px 0;
            background-color: #017EC0;
        }
        #rotate{position:relative}
    </style>
    <script type="text/javascript" language="javascript">
        window.name = "curWindow123";

        function gbps() {
            window.close();
            return false;
        }
        var flag = false;
        function DrawImage(ImgD, iwidth, iheight) {
            //参数(图片,允许的宽度,允许的高度)  
            var image = new Image();
            image.src = ImgD.src;
            if (image.width > 0 && image.height > 0) {
                flag = true;
                if (image.width / image.height >= iwidth / iheight) {
                    if (image.width > iwidth) {
                        ImgD.width = iwidth;
                        ImgD.height = (image.height * iwidth) / image.width;
                    } else {
                        ImgD.width = image.width;
                        ImgD.height = image.height;
                    }
                    ImgD.alt = image.width + "×" + image.height;
                }
                else {
                    if (image.height > iheight) {
                        // ImgD.height = iheight;
                        ImgD.height = (image.width * iheight) / image.height;
                        ImgD.width = (image.width * iheight) / image.height;
                    } else {
                        ImgD.width = image.width;
                        ImgD.height = image.height;
                    }
                    ImgD.alt = image.width + "×" + image.height;
                }
            }
        }
        var oXL;
        var oWB;
        function ExportExcel() {
            try {
                if (oXL == null) {
                    oXL = new ActiveXObject("Excel.Application");
                }
                //var oXL = new ActiveXObject("Excel.Application"); //创建excel应用程序对象
                oWB = oXL.Workbooks.Add();        //创建工作簿
                var oSheet = oWB.ActiveSheet;        //获取当前活动的工作簿
                var sel = document.body.createTextRange();
                sel.moveToElementText(record);
                sel.select();
                sel.execCommand("Copy");  //复制
                oSheet.Paste();  //粘贴
                oXL.Visible = true; //设置Excel的属性
                oXL.UserControl = true;
                oXL = null;
                oWB = null;
                oSheet = null;
            } catch (e) {
                alert("要导出该表,您必须安装Excel电子表格软件,同时浏览器须使用ActiveX 控件,请确认您的浏览器设置启用所有的ActiveX 控件。");
                return "";
            }
        }

        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <!-- 当前位置 -->
    <div id="Table1">
        <p id="tab1">当前位置:首页>>卫生管理员维护>>自查工作</p>
        <section id="record">
            <h1 id="Title" class="tac">上城区自查表模板(2020年06月份)</h1>
            <p class="company tac">填写单位: <span id="xianqu"></span></p>
            <div class="qustList">
                <!-- 问卷列表 -->



            </div>
            <!-- 弹出层图片 -->
            <div class="pop_img">
                <div class="mask"></div>
                <div class="popover">
                    <img src="" alt="">
                    <p id="rotate">
                        <svg t="1591000697612" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5741" width="32" height="32"><path d="M941.728 137.152C941.728 122.304 932.576 109.152 919.456 103.424 905.728 97.728 889.728 100.576 879.456 111.424L805.152 185.152C724.576 109.152 615.456 64 502.88 64 261.152 64 64 261.152 64 502.88 64 744.576 261.152 941.728 502.88 941.728 633.728 941.728 757.152 884 840.576 783.424 846.304 776 846.304 765.152 839.456 758.88L761.152 680C757.152 676.576 752 674.88 746.88 674.88 741.728 675.424 736.576 677.728 733.728 681.728 677.728 754.304 593.728 795.424 502.88 795.424 341.728 795.424 210.304 664 210.304 502.88 210.304 341.728 341.728 210.304 502.88 210.304 577.728 210.304 648.576 238.88 702.304 288.576L623.456 367.424C612.576 377.728 609.728 393.728 615.456 406.88 621.152 420.576 634.304 429.728 649.152 429.728L905.152 429.728C925.152 429.728 941.728 413.152 941.728 393.152L941.728 137.152Z" p-id="5742" fill="#0075ff"></path></svg>
                    </p>
                </div>
            </div>
            
        </section>
        <!-- 尾部 -->
        <div class="tac comp" style="opacity: 0;">
            <div class="btn">
                <input type="image" name="Button22" id="Button22" src="http://scq.139379.com:1168/images/excel.gif" style="cursor:hand;margin-right: 7%;">
                <input type="image" name="Button1" id="Button1" src="http://scq.139379.com:1168/images/guanbi.png" onclick="return gbps();" style="cursor:hand">
            </div>
            <footer>
                <p>上城区卫生局卫生监督所 </p>
                <p>技术支持:北京克里克科技有限公司</p>
            </footer>
        </div>
    </div>
<script>
    $(function () {
        
        //加载eachOne数据//获取父级地址栏参数

        var urls = window.location.href;
        var pos1 = urls.indexOf("dwmc");
        var pos2 = urls.indexOf("dwid");
        var pos3 = urls.indexOf("type");
        var dwmc = urls.substring(pos1 + 5).split("&")[0].toString();
        var dwid = urls.substring(pos2 + 5).split("&")[0].toString();
        var type = urls.substring(pos3 + 5).split("&")[0].toString();
        $.ajax({
            type: "get",
            url: "../data/helper.ashx",
            data: {
                action: "getZcwcqk",
                type: type,
                dwid: dwid,
                dwmc: dwmc,
            },
            dataType: 'json',
            contentType: "application/json",
            async: false,
            success: function (data) {
                console.log(data);
                //console.log(dwmc);
                //$("#xianqu").html(dwmc);

                if (!jQuery.isEmptyObject(data)) {
                    json = eval(data);
                    //console.log(json);
                    var length = json.length;
                    //console.log(length);
                    var str = '';

                    for (var i = 0; i < length; i++) {
                        if (json[i].type == 0) { //二选一
                            str += '<div class="eachOne"><p class="ask"> ' + json[i].xuhao + '' + json[i].nr + '</p>';
                            if (json[i].hfnr == "1") {
                                str += '<div class="answer"> <ul> <li>' + '<input value="是" name= "all' + json[i].id + '"  type="radio" id="xzttsd' + json[i].id + '" checked>' + 'A、是 </li>';
                                str += '<li><input type="radio"   name="all' + json[i].id + '" runat="server" value="否"  disabled>B、否</li></ul>'
                            } else {
                                str += '<div class="answer"> <ul> <li>' + '<input value="是" name= "all' + json[i].id + '"  type="radio" id="xzttsd' + json[i].id + '" disabled >' + 'A、是 </li>';
                                str += '<li><input type="radio"   name="all' + json[i].id + '" runat="server" value="否"  checked>B、否</li></ul>'
                            }

                            if (json[i].hfimgpath.indexOf("@@") != -1) {//相关图片
                                    var arr1 = json[i].hfimgpath.split("@@");
                                    //console.log(json[i].hfimgpath);
                                    //console.log(arr1);
                                    str += '<div class="aboutImg">相关照片:'
                                    for (var s = 0; s < arr1.length; s++) {
                                        str += '<img src="https://www.bjclick.cn/zichagongzuo/testFile22/1234abcd/' + json[0].ydmid +'/' + arr1[s] + '"  onload="javascript:DrawImage(this,1000,200)" >'
                                    }
                                    str += '</div>'
                            } else if(json[i].hfimgpath != ""){
                                str += '<div class="aboutImg">相关照片:' + '<img src="https://www.bjclick.cn/zichagongzuo/testFile22/1234abcd/' + json[0].ydmid + '/' + json[i].hfimgpath + '"  onload="javascript:DrawImage(this,1000,200)" >' + '</div>'
                            }
                            str += '</div></div>';

                        } else if (json[i].type == 1) { //三选一
                            $.ajax({
                                type: "get",
                                url: "../data/helper.ashx",
                                data: {
                                    action: "getZcwcqkBy1",
                                    id: json[i].id,
                                },
                                dataType: 'json',
                                contentType: "application/json",
                                async: false,
                                success: function (data) {
                                    console.log(data);
                                    var jsonp = eval(data);
                                    str += '<div class="eachOne"><p class="ask"> ' + json[i].xuhao + '' + json[i].nr + '</p>';
                                    str += '<div class="answer"> <ul>';
                                    var bo = ['A', 'B', 'C', 'D', 'E', 'F', 'G'];
                                    for (var b = 0; b < jsonp.length; b++) {
                                        if (jsonp[b].id == json[i].hfnr) {
                                            str += '<li>' + '<input value="' + jsonp[b].nr + '" name= "all' + jsonp[b].id + '"  type="radio" id="xzttsd' + jsonp[b].id + '" checked >' + bo[b] + '' + jsonp[b].nr + '</li>';
                                        } else {
                                            str += '<li>' + '<input value="' + jsonp[b].nr + '" name= "all' + jsonp[b].id + '"  type="radio" id="xzttsd' + jsonp[b].id + '" disabled >' + bo[b] + '' + jsonp[b].nr + '</li>';
                                        }
                                        
                                    }

                                    str += '</ul>';
                                    if (json[i].hfimgpath.indexOf("@@") != -1) {//相关图片
                                        var arr1 = json[i].hfimgpath.split("@@");
                                        str += '<div class="aboutImg">相关照片:'
                                        for (var s = 0; s < arr1.length; s++) {
                                            str += '<img src="https://www.bjclick.cn/zichagongzuo/testFile22/1234abcd/' + json[0].ydmid + '/' + arr1[s] + '"  onload="javascript:DrawImage(this,1000,200)" >'
                                        }
                                        str += '</div>'
                                    } else if (json[i].hfimgpath != "") {
                                        str += '<div class="aboutImg">相关照片:' + '<img src="https://www.bjclick.cn/zichagongzuo/testFile22/1234abcd/' + json[0].ydmid + '/' + json[i].hfimgpath + '"  onload="javascript:DrawImage(this,1000,200)" >' + '</div>'
                                    }
                                    str += '</div></div>';  
                                }
                            })



                            
                        } else if(json[i].type == 2){//多选复选框
                            str += '<div class="eachOne"><p class="ask"> ' + json[i].xuhao + '' + json[i].nr + '</p>';
                            str += '<div class="answer"> <ul> <li>' + '<input value="是" name= "all' + json[i].id + '"  type="radio" id="xzttsd' + json[i].id + '" checked>' + 'A、是 </li>';
                            str += '<li><input type="radio"   name="all' + json[i].id + '" runat="server" value="否"  disabled>B、否</li></ul>'
                            str += '</div></div>';
                        } else {//3文本
                            str += '<div class="eachOne"><p class="ask"> ' + json[i].xuhao + '' + json[i].nr + '<input name="Text' + json[i].id + '" type="text" id="Text' + json[i].id + '" value="' + json[i].hfnr + '" disabled>' + json[i].szh_str + '</p></div>';
                        }
                        
                    }
                    $('.qustList').append(str);
                }

            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                //floatNotify.simple("检索错误信息:" + XMLHttpRequest.status + "-" + XMLHttpRequest.readyState + "-" + textStatus);
                console.log("other*error");
            }
        });

        var reg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;
        $('input:text').each(function () {
            var vals = $(this).val();
            var textLength = $(this).val().length;
            //console.log(isNaN(vals));
            if (isNaN(vals)) {
                inputWidth = textLength * 18;//18是文字的宽度
                $(this).width(inputWidth);
            } else {
                inputWidth = textLength * 10.1;//10是数字的宽度
                $(this).width(inputWidth);
            }
        })
        /*------------event----------*/
        $('.aboutImg img').click(function () {
            var src = $(this).attr('src');
            console.log(src)
            $('.pop_img .popover img').attr('src', src);
            $(".pop_img .mask").css("display", "block");
            $(".pop_img .popover").slideDown();
        });

        $(".pop_img .close").click(function () {

            $(".mask").css("display", "none");
            $(".popover").slideUp();
            $('.pop_img .popover img').attr('src', '');
        })
        $(".pop_img .mask").click(function () {
            $(".mask").css("display", "none");
            $(".popover").slideUp(100);
            $('.pop_img .popover img').attr('src', '');
            $('.pop_img .popover img').css('transform', 'rotate(' + 0 + 'deg)');
        })
        var deg = 0;
        $("#rotate").click(function () {
            deg += 90;
            $('.pop_img .popover img').css('transform', 'rotate(' + deg + 'deg)');
        })
        /*禁用所有单选*/
        $("input[type='radio']").each(function () {
            //$(this).prop("disabled",true);  
        });
    })
</script>
    </form>
</body>
</html>

 

posted @ 2020-06-04 15:51  一智独秀  阅读(195)  评论(0编辑  收藏  举报