1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <% include ./sub_menu.ejs %>
- <div class="panel-content">
- <div class="panel-title">
- <div class="title-main">
- <h2>API设置</h2>
- </div>
- </div>
- <div class="content-wrap">
- <div class="c-body">
- <div class="sjs-height-0">
- <% if (tenders.length === 0) { %>
- <div class="jumbotron m-3">
- <h3 class="display-6">没有标段数据</h3>
- </div>
- <% } else { %>
- <div class="m-3">
- <table class="table table-hover table-bordered">
- <thead>
- <tr>
- <th class="text-center" >名称</th>
- <th class="text-center" >计量模式</th>
- <th class="text-center" >计量期数</th>
- <th class="text-center" >创建人</th>
- <th class="text-center" >标段创建时间/期审批时间</th>
- <th class="text-center">工序报验</th>
- <th class="text-center">档案管理</th>
- </tr>
- </thead>
- <% for (const t of tenders) { %>
- <tr tid="<%- t.id %>">
- <td><%- t.name %></td>
- <td><%- t.measure_type_str %></td>
- <td><%- t.stage_count_str %></td>
- <td><%- t.user_str %></td>
- <td><%- ctx.moment(t.show_time).format('YYYY-MM-DD HH:mm:ss') %></td>
- <td class="text-center">
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" id="inlineCheckbox1" <% if (t.s2b_gxby_check) { %>checked<% } %> name="gxby_check" onchange="updateS2bSetting(this);" value="<%- t.s2b_gxby_check %>">
- <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
- <label class="form-check-label" for="inlineCheckbox1">检查计量</label>
- </div>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" id="inlineCheckbox2" <% if (t.s2b_gxby_limit) { %>checked<% } %> name="gxby_limit" onchange="updateS2bSetting(this);" value="<%- t.s2b_gxby_limit %>">
- <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
- <label class="form-check-label" for="inlineCheckbox2">限制上报</label>
- </div>
- </td>
- <td class="text-center">
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" id="inlineCheckbox3" <% if (t.s2b_dagl_check) { %>checked<% } %> name="dagl_check" onchange="updateS2bSetting(this);" value="<%- t.s2b_dagl_check %>">
- <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
- <label class="form-check-label" for="inlineCheckbox3">检查计量</label>
- </div>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" id="inlineCheckbox4" <% if (t.s2b_dagl_limit) { %>checked<% } %> name="dagl_limit" onchange="updateS2bSetting(this);" value="<%- t.s2b_dagl_limit %>">
- <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
- <label class="form-check-label" for="inlineCheckbox4">限制上报</label>
- </div>
- </td>
- </tr>
- <% } %>
- </table>
- </div>
- <% } %>
- </div>
- </div>
- </div>
- </div>
- <script>
- const updateS2bSetting = function (obj) {
- try {
- const name = obj.getAttribute('name');
- const tid = parseInt(obj.parentNode.parentNode.parentNode.getAttribute('tid'));
- if (!name) return;
- const data = { tid };
- data[name] = obj.checked;
- postData('api/update', data, function() {
- obj.setAttribute('value', obj.checked);
- }, function () {
- obj.checked = obj.getAttribute('value') === true;
- })
- } catch (err) {
- obj.checked = obj.getAttribute('value') === true;
- }
- }
- $(() => {
- autoFlashHeight();
- })
- </script>
|