| | |
| | | return {1: "未使用", 2: "已核销"}[value] |
| | | } |
| | | }, |
| | | {title: '入园方式', field: 'goType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "手环", 2: "门票核销"}[value] || "-"; |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | TPayInfo.openAddTSite = function () { |
| | |
| | | if (TPayInfo.seItem.status === 2) { |
| | | return Feng.error("该门票已核销!"); |
| | | } |
| | | // 门票管理页提供独立模板;其他复用该脚本的页面继续使用兼容的默认模板。 |
| | | var entryMethodContent = $("#ticketEntryMethodTemplate").html() || |
| | | '<div class="form-horizontal"><div class="col-sm-11"><div class="col-sm-11"><div class="form-group">' + |
| | | '<label class="col-sm-3 control-label">请选择:</label><div class="col-sm-9" style="margin-top: 5px;">' + |
| | | '<input type="radio" id="areaType1" value="1" name="areaType" checked><label for="areaType1">手环</label>' + |
| | | '<input type="radio" id="areaType2" value="2" name="areaType"><label for="areaType2">门票核销</label>' + |
| | | '</div></div></div></div></div>'; |
| | | var index = layer.load(1, { |
| | | type: 1 |
| | | , title: '入园方式' |
| | | , area: ['50%', '50%'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" >' + |
| | | ' <div class="col-sm-11">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">请选择:</label>\n' + |
| | | ' <div class="col-sm-9" style="margin-top: 5px;">\n' + |
| | | ' <input type="radio" id="areaType1" value="1" name="areaType"> ' + |
| | | ' <label for="areaType1"> 手环 </label>\n' + |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>' |
| | | // 页面模板中集中维护选项文案与 goType 值,避免前后端页面出现两份配置。 |
| | | , content: entryMethodContent |
| | | |
| | | , btn: ['确认', '关闭'] |
| | | , btnAlign: 'c' //按钮居中 |
| | |
| | | layer.closeAll(); |
| | | }, |
| | | yes: function () { |
| | | console.log("看看id") |
| | | console.log(TPayInfo.seItem.id) |
| | | // 入园方式必须随核销请求提交,后端会保存该次核销所选方式。 |
| | | var goType = $("input[name='areaType']:checked").val(); |
| | | if (!goType) { |
| | | return Feng.error("请选择入园方式!"); |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/ticket/writeOff", function (data) { |
| | | TPayInfo.search(); |
| | | Feng.error("核销成功!") |
| | | Feng.success("核销成功!"); |
| | | }, function (data) { |
| | | Feng.error("核销失败!" + (data.responseJSON ? data.responseJSON.message : "")); |
| | | }); |
| | | ajax.set("id", TPayInfo.seItem.id); |
| | | ajax.set("goType", goType); |
| | | ajax.start(); |
| | | layer.closeAll(); |
| | | } |