|
@@ -118,6 +118,157 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+<% if (is_dz2) { %>
|
|
|
+<!--决策大屏六设置-->
|
|
|
+<div class="modal fade" id="dpsix-set" data-backdrop="static">
|
|
|
+ <div class="modal-dialog" role="document">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h5 class="modal-title">数据统计设置</h5>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <ul class="list-unstyled">
|
|
|
+ <li class="d-flex justify-content-start align-items-center mb-3">
|
|
|
+ <span class="col-auto">工程收入:</span>
|
|
|
+ <span class="mr-2">
|
|
|
+ <select class="form-control form-control-sm" id="sr_cate_select">
|
|
|
+ <option value="0">请选择分类</option>
|
|
|
+ <% for (const c of categoryData) { %>
|
|
|
+ <option value="<%- c.id %>"><%- c.name %></option>
|
|
|
+ <% } %>
|
|
|
+ </select>
|
|
|
+ </span>
|
|
|
+ <span>
|
|
|
+ <select class="form-control form-control-sm" id="sr_cate_value_select">
|
|
|
+ <option value="0">请选择值</option>
|
|
|
+ </select>
|
|
|
+ </span>
|
|
|
+ </li>
|
|
|
+ <li class="d-flex justify-content-start align-items-center mb-3">
|
|
|
+ <span class="col-auto">工程成本:</span>
|
|
|
+ <span class="mr-2">
|
|
|
+ <select class="form-control form-control-sm" id="cb_cate_select">
|
|
|
+ <option value="0">请选择分类</option>
|
|
|
+ <% for (const c of categoryData) { %>
|
|
|
+ <option value="<%- c.id %>"><%- c.name %></option>
|
|
|
+ <% } %>
|
|
|
+ </select>
|
|
|
+ </span>
|
|
|
+ <span>
|
|
|
+ <select class="form-control form-control-sm" id="cb_cate_value_select">
|
|
|
+ <option value="0">请选择值</option>
|
|
|
+ </select>
|
|
|
+ </span>
|
|
|
+ </li>
|
|
|
+ <li class="d-flex justify-content-start align-items-center mb-3">
|
|
|
+ <span class="col-auto">工程成本费用分类(最多只能选择4个,界面只有4个):</span>
|
|
|
+ <span class="mr-2">
|
|
|
+ <div class="dropdown show">
|
|
|
+ <button class="btn btn-sm dropdown-toggle text-primary" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">请选择值</button>
|
|
|
+ <div class="dropdown-menu pb-1" aria-labelledby="dropdownMenuButton" x-placement="bottom-start" >
|
|
|
+ <div class="px-3" id="cb_show_select">
|
|
|
+ <% const xmgl = categoryData.find(item => item.name === '管理类别'); %>
|
|
|
+ <% if (xmgl && xmgl.value && xmgl.value.length !== 0) { %>
|
|
|
+ <% for (const v of xmgl.value) { %>
|
|
|
+ <div class="form-check py-1">
|
|
|
+ <input class="form-check-input" type="checkbox" id="xmgl_value_<%- v.id %>" value="<%- v.id %>">
|
|
|
+ <label class="form-check-label" for="xmgl_value_<%- v.id %>"><%- v.value %></label>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
|
|
|
+ <button type="button" class="btn btn-sm btn-primary" id="dp06_save_btn">确定</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<script>
|
|
|
+ const daPing06Set = JSON.parse(unescape('<%- escape(JSON.stringify(daPing06Set)) %>'));
|
|
|
+ $(function () {
|
|
|
+ $('#sr_cate_select').change(function () {
|
|
|
+ const val = $(this).val()
|
|
|
+ const cate = category.find(item => item.id === parseInt(val))
|
|
|
+ $('#sr_cate_value_select').html(cate ? cate.value.map(item => `<option value="${item.id}">${item.value}</option>`).join('') : '<option value="0">请选择值</option>');
|
|
|
+ })
|
|
|
+ $('#cb_cate_select').change(function () {
|
|
|
+ const val = $(this).val()
|
|
|
+ const cate = category.find(item => item.id === parseInt(val))
|
|
|
+ $('#cb_cate_value_select').html(cate ? cate.value.map(item => `<option value="${item.id}">${item.value}</option>`).join('') : '<option value="0">请选择值</option>');
|
|
|
+ });
|
|
|
+ $('#dpsix-set').on('show.bs.modal', function (e) {
|
|
|
+ if (daPing06Set.sr) {
|
|
|
+ $('#sr_cate_select').val(daPing06Set.sr);
|
|
|
+ $('#sr_cate_value_select').html(category.find(item => item.id === parseInt(daPing06Set.sr)).value.map(item => `<option value="${item.id}" ${daPing06Set.sr_value === item.id ? 'selected' : ''}>${item.value}</option>`).join(''));
|
|
|
+ } else {
|
|
|
+ $('#sr_cate_value_select').html('<option value="0">请选择值</option>')
|
|
|
+ }
|
|
|
+ if (daPing06Set.cb) {
|
|
|
+ $('#cb_cate_select').val(daPing06Set.cb);
|
|
|
+ $('#cb_cate_value_select').html(category.find(item => item.id === parseInt(daPing06Set.cb)).value.map(item => `<option value="${item.id}" ${daPing06Set.cb_value === item.id ? 'selected' : ''}>${item.value}</option>`).join(''));
|
|
|
+ } else {
|
|
|
+ $('#cb_cate_value_select').html('<option value="0">请选择值</option>')
|
|
|
+ }
|
|
|
+ $('#cb_show_select').find('input').prop('checked', false);
|
|
|
+ $('#cb_show_select').find('input').each(function () {
|
|
|
+ if (daPing06Set.cb_show && daPing06Set.cb_show.length > 0 && daPing06Set.cb_show.includes(parseInt($(this).val()))) {
|
|
|
+ $(this).prop('checked', true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ $('#cb_show_select').on('click', function (e) {
|
|
|
+ e.stopPropagation();
|
|
|
+ });
|
|
|
+ $('#cb_show_select input').on('click', function () {
|
|
|
+ const checked = $('#cb_show_select input:checked');
|
|
|
+ if (checked.length > 4) {
|
|
|
+ $(this).prop('checked', false);
|
|
|
+ toastr.warning('最多只能选择4个');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#dp06_save_btn').click(function () {
|
|
|
+ if ($('#sr_cate_select').val() === '0') {
|
|
|
+ toastr.warning('请选择工程收入分类');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if ($('#sr_cate_value_select').val() === '0') {
|
|
|
+ toastr.warning('请选择工程收入分类值');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if ($('#cb_cate_select').val() === '0') {
|
|
|
+ toastr.warning('请选择工程成本费用分类');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if ($('#cb_cate_value_select').val() === '0') {
|
|
|
+ toastr.warning('请选择工程成本费用分类值');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // if ($('#cb_show_select input:checked').length === 0) {
|
|
|
+ // toastr.warning('请选择要展示的列');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ daPing06Set.sr = parseInt($('#sr_cate_select').val());
|
|
|
+ daPing06Set.sr_value = parseInt($('#sr_cate_value_select').val());
|
|
|
+ daPing06Set.cb = parseInt($('#cb_cate_select').val());
|
|
|
+ daPing06Set.cb_value = parseInt($('#cb_cate_value_select').val());
|
|
|
+ daPing06Set.cb_show = $('#cb_show_select input:checked').map((index, item) => parseInt($(item).val())).get();
|
|
|
+ console.log(daPing06Set);
|
|
|
+ postData('/setting/datacollect/save', { type: 'save-dp06', daPing06Set }, function (result) {
|
|
|
+ toastr.success('设置成功');
|
|
|
+ $('#dpsix-set').modal('hide');
|
|
|
+ })
|
|
|
+ });
|
|
|
+ })
|
|
|
+</script>
|
|
|
+<% } %>
|
|
|
<script>
|
|
|
$(function () {
|
|
|
let timer = null
|