|
@@ -8,65 +8,153 @@
|
|
|
<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 { %>
|
|
|
+ <nav class="nav nav-tabs m-3" role="tablist">
|
|
|
+ <a class="nav-item nav-link active" data-toggle="tab" href="#user-purview" role="tab">业务配置</a>
|
|
|
+ <a class="nav-item nav-link" data-toggle="tab" href="#user-list" role="tab">标段列表</a>
|
|
|
+ </nav>
|
|
|
<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 class="tab-content">
|
|
|
+ <div class="tab-pane active" id="user-purview">
|
|
|
+ <div class="col-4">
|
|
|
+ <legend>工序报验</legend>
|
|
|
+ <table class="table table-hover table-bordered">
|
|
|
+ <thead><tr><th>值</th><th>名称</th><th>允许计量</th></tr></thead>
|
|
|
+ <tbody id="gxby_list">
|
|
|
+ <% for (const s of ctx.session.sessionProject.gxby_status) { %>
|
|
|
+ <tr>
|
|
|
+ <td><%- s.value %></td>
|
|
|
+ <td><%- s.name %></td>
|
|
|
+ <td>
|
|
|
+ <div class="form-check form-check-inline">
|
|
|
+ <input class="form-check-input" type="checkbox" id="inlineCheckbox-g<%- s.value %>" <% if (s.limit) { %>checked<% } %> status="<%- s.value %>" onchange="updateStatusLimit(this, 'gxby');">
|
|
|
+ <label class="form-check-label" for="inlineCheckbox-g<%- s.value %>"></label>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <% } %>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ <legend>档案管理</legend>
|
|
|
+ <table class="table table-hover table-bordered">
|
|
|
+ <thead><tr><th>值</th><th>名称</th><th>允许计量</th><th>计量比例</th></tr></thead>
|
|
|
+ <% for (const s of ctx.session.sessionProject.dagl_status) { %>
|
|
|
+ <tbody id="dagl_list">
|
|
|
+ <tr>
|
|
|
+ <td><%- s.value %></td>
|
|
|
+ <td><%- s.name %></td>
|
|
|
+ <td>
|
|
|
+ <div class="form-check form-check-inline">
|
|
|
+ <input class="form-check-input" type="checkbox" id="inlineCheckbox-d<%- s.value %>" <% if (s.limit) { %>checked<% } %> status="<%- s.value %>" onchange="updateStatusLimit(this, 'dagl');">
|
|
|
+ <label class="form-check-label" for="inlineCheckbox-d<%- s.value %>"></label>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <% if (s.value === 0) { %>
|
|
|
+ <td>-</td>
|
|
|
+ <% } else { %>
|
|
|
+ <td>
|
|
|
+ <div class="input-group input-group-sm" style="width:90px">
|
|
|
+ <input type="number" class="form-control" max="100" min="0" step="2" value="100" value="<%- s.ratio || 100 %>" status="<%- s.value %>" onchange="updateStatusRatio(this);">
|
|
|
+ <div class="input-group-append">
|
|
|
+ <span class="input-group-text">%</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <% } %>
|
|
|
+ </tr>
|
|
|
+ <% } %>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="tab-pane" id="user-list">
|
|
|
+ <!--没有标段数据-->
|
|
|
+ <% if (tenders.length === 0) { %>
|
|
|
+ <div class="jumbotron m-3">
|
|
|
+ <h3 class="display-6">没有标段数据</h3>
|
|
|
+ </div>
|
|
|
+ <% } else { %>
|
|
|
+ <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>
|
|
|
</div>
|
|
|
</div>
|
|
|
<script>
|
|
|
+ const updateStatusLimit = function (obj, type) {
|
|
|
+ const data = { type };
|
|
|
+ data.status = parseInt(obj.getAttribute('status'));
|
|
|
+ data.limit = obj.checked;
|
|
|
+ postData('api/update-status', data, function(result) {
|
|
|
+ }, function () {
|
|
|
+ obj.checked = !obj.checked;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ const updateStatusRatio = function (obj) {
|
|
|
+
|
|
|
+ const data = { type: 'dagl' };
|
|
|
+ data.status = parseInt(obj.getAttribute('status'));
|
|
|
+ try {
|
|
|
+ data.ratio = parseFloat(obj.value);
|
|
|
+ } catch (error) {
|
|
|
+ toastr.warning('请输入0-100间的数字');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ postData('api/update-status', data, function(result) {
|
|
|
+ obj.org = result.ratio;
|
|
|
+ obj.value = result.ratio;
|
|
|
+ }, function () {
|
|
|
+ obj.value = obj.org;
|
|
|
+ });
|
|
|
+ }
|
|
|
const updateS2bSetting = function (obj) {
|
|
|
try {
|
|
|
const name = obj.getAttribute('name');
|