|
@@ -18,7 +18,7 @@
|
|
|
<div class="col-4">
|
|
|
<legend>工序报验</legend>
|
|
|
<table class="table table-hover table-bordered">
|
|
|
- <thead><tr><th>值</th><th>名称</th><th>允许计量</th></tr></thead>
|
|
|
+ <thead><tr><th>值</th><th>名称</th><th>允许计量</th><th>计量比例</th></tr></thead>
|
|
|
<tbody id="gxby_list">
|
|
|
<% for (const s of ctx.session.sessionProject.gxby_status) { %>
|
|
|
<tr>
|
|
@@ -30,6 +30,18 @@
|
|
|
<label class="form-check-label" for="inlineCheckbox-g<%- s.value %>"></label>
|
|
|
</div>
|
|
|
</td>
|
|
|
+ <% if (s.ratio === undefined) { %>
|
|
|
+ <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="<%- s.ratio || 0 %>" status="<%- s.value %>" onchange="updateStatusRatio(this, 'gxby');">
|
|
|
+ <div class="input-group-append">
|
|
|
+ <span class="input-group-text">%</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <% } %>
|
|
|
</tr>
|
|
|
<% } %>
|
|
|
</tbody>
|
|
@@ -49,12 +61,12 @@
|
|
|
<label class="form-check-label" for="inlineCheckbox-d<%- s.value %>"></label>
|
|
|
</div>
|
|
|
</td>
|
|
|
- <% if (s.value === 0) { %>
|
|
|
+ <% if (s.ratio === undefined) { %>
|
|
|
<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="<%- s.ratio || 0 %>" status="<%- s.value %>" onchange="updateStatusRatio(this);">
|
|
|
+ <input type="number" class="form-control" max="100" min="0" step="2" value="<%- s.ratio || 0 %>" status="<%- s.value %>" onchange="updateStatusRatio(this, 'dagl');">
|
|
|
<div class="input-group-append">
|
|
|
<span class="input-group-text">%</span>
|
|
|
</div>
|
|
@@ -138,8 +150,8 @@
|
|
|
obj.checked = !obj.checked;
|
|
|
});
|
|
|
}
|
|
|
- const updateStatusRatio = function (obj) {
|
|
|
- const data = { type: 'dagl' };
|
|
|
+ const updateStatusRatio = function (obj, type) {
|
|
|
+ const data = { type };
|
|
|
data.status = parseInt(obj.getAttribute('status'));
|
|
|
try {
|
|
|
data.ratio = parseFloat(obj.value);
|