| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <link href="../css/Table/table1.css" rel="stylesheet" />
- <link href="../css/init.css" rel="stylesheet" />
- <title>试卷列表修改</title>
- <style>
- table tr {
- margin-bottom: 20px;
- }
-
- table tr td {
- text-align: left;
- padding: 5px;
- }
-
- .Content {
- padding: 10px;
- }
-
- .btn {
- background: #1ab394;
- }
-
- .Btn_box {
- margin-top: 20px;
- color: #fff;
- }
-
- .inpBox select {
- width: 150px;
- padding: 3px 6px;
- }
-
- .F_Remark {
- width: 100%;
- }
-
- textarea {
- resize: none;
- }
- </style>
- </head>
- <body>
- <div>
- <div class="Content">
- <div class="tab">
- <table id="sqzx" style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <th>试卷分类:</th>
- <td>
- <div class="inpBox">
- <select name="" id="Select" disabled="disabled">
- <option value="">请选择试卷分类</option>
- </select>
- </div>
- </td>
- <!-- <th>试卷题型:</th>
- <td>
- <div class="inpBox">
- <select name="" id="CheckQuestion">
- <option value="1">问答题</option>
- <option value="2">单选题</option>
- <option value="3">多选题</option>
- </select>
- </div>
- </td> -->
- <th>试卷标题:</th>
- <td>
- <input class="F_Remark"/>
- </td>
- </tr>
- <tr>
- <th>排列序号:</th>
- <td>
- <input class="serialNumber"/>
- </td>
- </tr>
- </table>
- </div>
- <div style="text-align: center; margin-top: 50px;">
- <button class="btns add size-14">保存</button>
- </div>
- </div>
- </div>
- <script>
- var Cids = helper.request.queryString("Cids");
- var QuestionId;
- $(document).ready(function() {
- Select();
- //获取详情
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "testusertypeapi/api/TestUserType/Gettestpageinfo",
- dataType: 'json',
- async: true,
- data: {
- id: Cids,
- token: $.cookie("token")
- },
- success: function(data) {
- /*验证请求*/
- if(data.state == "success") {
- $("#Select").val(data.data[0].testtype); //试卷分类
- QuestionId = data.data[0].id;
- $(".serialNumber").val(data.data[0].testcode); //排列序号
- $('.F_Remark').val(data.data[0].testtitle) //标题
- }
- }
- });
- //切换效果
- // $("#CheckQuestion").change(function() {
- // var ss = $(this).val();
- // if(ss == "1") {
- // $(".Check_box").hide();
- // } else {
- // $(".Check_box").show();
- // }
- // });
- //试卷分类列表
- function Select() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "testusertypeapi/api/TestUserType/Gettesttype",
- dataType: 'json',
- async: false,
- data: {
- token: $.cookie("token")
- },
- success: function(data) {
- /*验证请求*/
- if(data.state == "success") {
- var html = ''
- for(var i = 0; i < data.data.rows.length; i++) {
- html += '<option value="' + data.data.rows[i].id + '">' + data.data.rows[i].Typename + '</option>'
- }
- $(html).appendTo("#Select");
- }
- }
- });
- }
- });
- // $("#Add").click(function() {
- // var index = $tableLeft.bootstrapTable('getData').length;
- // $tableLeft.bootstrapTable('insertRow', {
- // index: index,
- // row: {
- // id: '测试',
- // F_CategoryName: '测试测试'
- // }
- // });
- // });;
- //增加
- $(".add").click(function() {
- var CategoryId = $("#Select").val(); //试卷分类
- var Title = $(".F_Remark").val(); //试卷题型
- if(!CategoryId) {
- layer.msg("未选择分类");
- } else if(!Title) {
- layer.msg("标题不能为空");
- }
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "testusertypeapi/api/TestUserType/updatestpage",
- async: true,
- dataType: "json",
- data: {
- id: QuestionId, //试卷ID
- testtitle: Title, //试卷标题
- standardkey: '',
- testcode: $('.serialNumber').val(),
- testoptions: '',
- testtype: CategoryId,
- token: $.cookie("token"),
- // F_Title: Title, //试卷标题
- // F_Content: //试卷内容
- // F_Type: $("#CheckQuestion").val(), //题型(1.问答题;2.单选题;3.多选题)
- },
- success: function(data) {
- if(data.state.toLowerCase() == 'success') {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.Finish();
- parent.layer.msg("修改成功");
- }
- }
- });
- })
- </script>
- </body>
- </html>
|