| | |
| | | <div class="select-list col-sm-8"> |
| | | <ul> |
| | | <li> |
| | | <select id="prodId" name="prodId" class="select2-container" onchange="testTypeChange()"> |
| | | <select id="prodId" name="prodId" class="select2-container" onchange="testTypeChange()" > |
| | | <option th:each="dict : ${userProds}" th:text="${dict.name}" |
| | | th:value="${dict.id} "></option> |
| | | </select> |
| | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">[[#{jsp.exam.productReportTemplate}]]:</label> |
| | | <div class="col-sm-8"> |
| | | <!-- <select id="reportTemplateId" name="reportTemplateId" class="form-control noselect2 selectpicker"--> |
| | | <select id="reportTemplateId" name="reportTemplateId" class="form-control noselect2 selectpicker" |
| | | multiple> |
| | | <option th:each="dict : ${templateList}" th:text="${dict['reportType']}" |
| | | th:value="${dict['id']}"></option> |
| | | </select> |
| | | <!-- <select id="reportTemplateIdAll" name="reportTemplateIdAll" class="form-control noselect2 selectpicker"--> |
| | | <!-- multiple>--> |
| | | <!-- <option th:each="dict : ${templateList}" th:text="${dict['reportType']}"--> |
| | | <!-- th:value="${dict['id']}"></option>--> |
| | | <!-- </select>--> |
| | | <ui id="tempB"> |
| | | <li> |
| | | <span th:each="temp:${templateList}" style="margin-right:10px;"> |
| | | <input type="checkbox" th:value="${temp.id}" name="templateN"> |
| | | <span th:text="${temp.reportType}" name="unitspan"></span> |
| | | </span> |
| | | </li> |
| | | </ui> |
| | | <!-- <select id="reportTemplateIdAll" name="reportTemplateIdAll" class="form-control noselect2 selectpicker"--> |
| | | <!-- multiple>--> |
| | | <!-- <option th:each="dict : ${templateList}" th:text="${dict['reportType']}"--> |
| | | <!-- th:value="${dict['id']}"></option>--> |
| | | <!-- </select>--> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | |
| | | <th:block th:include="include :: bootstrap-select-js"/> |
| | | <script type="text/javascript"> |
| | | var prefix = ctx + "exam/paper"; |
| | | |
| | | $("#form-demographyParam-edit").validate({ |
| | | focusCleanup: true |
| | | }); |
| | |
| | | $.table.init(options); |
| | | }); |
| | | |
| | | function testTypeChange() { |
| | | var prodName = $("#prodId option:selected").text(); |
| | | if ("睿邻" == prodName) { |
| | | prodName = "RuiLin"; |
| | | } |
| | | $("#tempB").empty(); |
| | | $.post(prefix + "/filterTemplate/" + prodName, function (data) { |
| | | for (var i = 0; i < data.length; i++) { |
| | | $("#tempB").append('<li><span><input type="checkbox" name="templateN" value="'+data[i].id+'">' +data[i].reportType + '</span></span></li>'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /*[[#{basis.add}]]表格行 */ |
| | | function insertRow() { |
| | | |
| | | var arr = []; |
| | | $("input[name='templateN']:checked").each(function (index, item) {// |
| | | arr.push($(this).val()); |
| | | }); |
| | | |
| | | var prodId = $("#prodId").val(); |
| | | var prodName = $("#prodId option:selected").text(); |
| | | var arr = $("#reportTemplateId").val();//取值是一个数组 |
| | | var reportTemplateId = ""; |
| | | for (var i = 0; i < arr.length; i++) { |
| | | if (i == arr.length - 1) { |
| | | reportTemplateId = reportTemplateId + arr[i] |
| | | } else { |
| | | reportTemplateId = reportTemplateId + arr[i] + ","; |
| | | for(var i = 0; i < arr.length; i++) { |
| | | if (i==arr.length-1) { |
| | | reportTemplateId=reportTemplateId+arr[i] |
| | | }else { |
| | | reportTemplateId=reportTemplateId+arr[i]+","; |
| | | } |
| | | } |
| | | |
| | | var prodId = $("#prodId").val(); |
| | | var prodName = $("#prodId option:selected").text(); |
| | | var reportTemplateText = $("#reportTemplateId option:selected").text(); |
| | | |
| | | $.post(prefix + "/reportTemplateText/" + reportTemplateId, function (data) { |
| | | if (checkDuplicate(prodId)) { |
| | | $.modal.alertWarning('存在产品包权限,不允许重复添加!'); |
| | | return; |
| | | if (checkDuplicate(prodId)) { |
| | | $.modal.alertWarning('存在产品包权限,不允许重复添加!'); |
| | | return; |
| | | } |
| | | |
| | | $.btTable.bootstrapTable('insertRow', { |
| | | index: 0, // 你想插入到哪,0表示第一行 |
| | | row: { |
| | | prodId: prodId, |
| | | reportTemplateId: reportTemplateId, |
| | | reportTemplateText: reportTemplateText, |
| | | prodName: prodName |
| | | } |
| | | |
| | | $.btTable.bootstrapTable('insertRow', { |
| | | index: 0, // 你想插入到哪,0表示第一行 |
| | | row: { |
| | | prodId: prodId, |
| | | reportTemplateId: reportTemplateId, |
| | | reportTemplateText: data, |
| | | prodName: prodName |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | }) |
| | | } |
| | | |
| | | function checkDuplicate(prodId) { |