|
@@ -3,7 +3,7 @@
|
|
|
{{include "com/header.html"}}
|
|
|
<!-- Left side column. 权限菜单 -->
|
|
|
{{include "com/menu.html"}}
|
|
|
-<div class="content-wrapper">
|
|
|
+<div class="content-wrapper" xmlns="http://www.w3.org/1999/html">
|
|
|
<section class="content-header">
|
|
|
<h1>
|
|
|
<small></small>
|
|
@@ -23,11 +23,7 @@
|
|
|
<div class="form-horizontal">
|
|
|
<div class="box-body margin">
|
|
|
<h4><i class="glyphicon glyphicon-exclamation-sign" style="margin-right: 6px"></i>数据情况</h4>
|
|
|
- <div class="form-group" style="margin-left: 15px">
|
|
|
- <span class="form-inline panel-body">分发总量/数据总量(条):
|
|
|
- <input type="text" class="form-control" readonly value="{{.T.allGiveDataNum}}/{{.T.allDataNum}}">
|
|
|
- </span>
|
|
|
- </div>
|
|
|
+ <hr>
|
|
|
<div class="form-group" style="margin-left: 10px">
|
|
|
<div class="col-xs-3" style="width: auto">
|
|
|
<label class="form-inline">数据总量:
|
|
@@ -92,34 +88,33 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div id="status-div" class="col-xs-1" style="width: auto;float:right;">
|
|
|
- <select class="form-control selectpicker" id="pushModelSelect">
|
|
|
- <option value=-1>全部</option>
|
|
|
- <option value=0>开启</option>
|
|
|
- <option value=1>关闭</option>
|
|
|
- </select>
|
|
|
+ <label for="statusSelect">状态:
|
|
|
+ <select class="form-control selectpicker" id="statusSelect">
|
|
|
+ <option value="-1">全部</option>
|
|
|
+ <option value="未开始">未开始</option>
|
|
|
+ <option value="进行中">进行中</option>
|
|
|
+ <option value="已完成">已完成</option>
|
|
|
+ <option value="已关闭">已关闭</option>
|
|
|
+ </select></label>
|
|
|
</div>
|
|
|
- <hr>
|
|
|
- <div class="form-horizontal">
|
|
|
- <div class="box-body margin">
|
|
|
- <h3><i class="glyphicon glyphicon-tasks" style="margin-right: 6px"></i>数据清洗任务列表
|
|
|
- </h3>
|
|
|
-
|
|
|
- <table id="dataTable" class="table table-bordered table-hover">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>序号</th>
|
|
|
- <th>项目名称</th>
|
|
|
- <th>用户组名称</th>
|
|
|
- <th>负责人</th>
|
|
|
- <th>分发数据量</th>
|
|
|
- <th>任务状态</th>
|
|
|
- <th>完成进度</th>
|
|
|
- <th>任务时间</th>
|
|
|
- <th>操作</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
+ <div class="box-body margin">
|
|
|
+ <h4><i class="glyphicon glyphicon-tasks" style="margin-right: 6px"></i>数据清洗任务列表</h4>
|
|
|
+ <hr>
|
|
|
+ <table id="dataTable" class="table table-bordered table-hover">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>序号</th>
|
|
|
+ <th>项目名称</th>
|
|
|
+ <th>用户组名称</th>
|
|
|
+ <th>负责人</th>
|
|
|
+ <th>分发数据量</th>
|
|
|
+ <th>任务状态</th>
|
|
|
+ <th>完成进度</th>
|
|
|
+ <th>任务时间</th>
|
|
|
+ <th>操作</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ </table>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- /.box-body -->
|
|
@@ -182,6 +177,9 @@
|
|
|
menuActive("project");
|
|
|
|
|
|
let projectid = {{ .T.s_projectid }}
|
|
|
+ let allNoGiveDataNum = {{.T.allNoGiveDataNum}}
|
|
|
+ let okNotGiveDataNum = {{.T.okNotGiveDataNum}}
|
|
|
+ let IsNotOkNotGiveDataNum = {{.T.IsNotOkNotGiveDataNum}}
|
|
|
let groupList = []
|
|
|
let tableData = []
|
|
|
let stype = "" // 分发类型:所有数据:all 达标数据:notag 未达标:tag
|
|
@@ -241,10 +239,10 @@
|
|
|
"data": "_id", width: "11%", render: function (val, a, row, pos) {
|
|
|
tmp = '<div>' +
|
|
|
'<a class="btn btn-sm btn-primary" href="/front/group/user/task/list?grouptaskid=' + val + '&s_sourceinfo='+row.s_sourceinfo+'">查看</a> ' +
|
|
|
- '<a class="btn btn-sm btn-warning" onclick="retrieveTask(\''+val+'\',\''+row.s_sourceinfo+'\',\''+row.s_status+'\')">收回</a> ' +
|
|
|
- '<a class="btn btn-sm btn-info">质检</a> ' +
|
|
|
- '<a class="btn btn-sm btn-info" onclick="repulseTask(\''+val+'\',\''+row.s_sourceinfo+'\',\''+row.s_status+'\')">打回</a> ' +
|
|
|
- '<a class="btn btn-sm btn-default" onclick="closeTask(\'' + val + '\',\''+row.s_sourceinfo+'\',\'' + row.s_status + '\')">关闭</a> ' +
|
|
|
+ '<a class="btn btn-sm btn-primary" onclick="retrieveTask(\''+val+'\',\''+row.s_sourceinfo+'\',\''+row.s_status+'\')">收回</a> ' +
|
|
|
+ '<a class="btn btn-sm btn-primary">质检</a> ' +
|
|
|
+ '<a class="btn btn-sm btn-primary" onclick="repulseTask(\''+val+'\',\''+row.s_sourceinfo+'\',\''+row.s_status+'\')">打回</a> ' +
|
|
|
+ '<a class="btn btn-sm btn-primary" onclick="closeTask(\'' + val + '\',\''+row.s_sourceinfo+'\',\'' + row.s_status + '\')">关闭</a> ' +
|
|
|
'</div>';
|
|
|
return tmp
|
|
|
}
|
|
@@ -252,16 +250,18 @@
|
|
|
],
|
|
|
"initComplete": function () {
|
|
|
$("#dataTable_filter").append($('#status-div'))
|
|
|
+ },
|
|
|
+ "fnServerParams": function (e) {
|
|
|
+ e.s_status = $("#statusSelect option:selected").val()
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$.ajax({
|
|
|
url: "/front/project/task/list",
|
|
|
type: "POST",
|
|
|
- data: {"pid": projectid},
|
|
|
+ data: {"pid": projectid, "s_status": "-1"},
|
|
|
success: function (r) {
|
|
|
if (r.data.length > 0) {
|
|
|
- console.log(r.data)
|
|
|
ttable.fnClearTable();
|
|
|
ttable.fnAddData(r.data);
|
|
|
}
|
|
@@ -274,30 +274,57 @@
|
|
|
success: function (r) {
|
|
|
if (r.rep) {
|
|
|
groupList = r.data
|
|
|
- console.log(groupList)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ $('#statusSelect').on('changed.bs.select', function () {
|
|
|
+ $.ajax({
|
|
|
+ url: "/front/project/task/list",
|
|
|
+ type: "POST",
|
|
|
+ data: {"pid": projectid, "s_status": $(this).val()},
|
|
|
+ success: function (r) {
|
|
|
+ if (r.data.length > 0) {
|
|
|
+ ttable.fnClearTable();
|
|
|
+ ttable.fnAddData(r.data);
|
|
|
+ }else {
|
|
|
+ ttable.fnClearTable();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
});
|
|
|
|
|
|
function dispatchTask(val) {
|
|
|
- console.log(val)
|
|
|
stype = val
|
|
|
if (stype === "all") {
|
|
|
- $('#modal-num').val({{.T.allGiveDataNum}})
|
|
|
+ if (allNoGiveDataNum === 0) {
|
|
|
+ showTip("没有可分配的数据!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ $('#modal-num').html(allNoGiveDataNum)
|
|
|
}else if (stype === "notag") {
|
|
|
- $('#modal-num').val({{.T.okNotGiveDataNum}})
|
|
|
+ if (okNotGiveDataNum === 0) {
|
|
|
+ showTip("没有可分配的数据!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ $('#modal-num').html(okNotGiveDataNum)
|
|
|
}else {
|
|
|
- $('#modal-num').val({{.T.IsNotOkNotGiveDataNum}})
|
|
|
+ if (IsNotOkNotGiveDataNum === 0) {
|
|
|
+ showTip("没有可分配的数据!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ $('#modal-num').html(IsNotOkNotGiveDataNum)
|
|
|
}
|
|
|
$('#modal-create-task').modal('show')
|
|
|
- for (var i in groupList) {
|
|
|
- var opt = document.createElement('option');
|
|
|
- opt.innerText = groupList[i]["s_name"];
|
|
|
- opt.value = groupList[i]["_id"];
|
|
|
- $('#group-select')[0].appendChild(opt)
|
|
|
+ if ($('#group-select option').length === 0) {
|
|
|
+ for (var i in groupList) {
|
|
|
+ var opt = document.createElement('option');
|
|
|
+ opt.innerText = groupList[i]["s_name"];
|
|
|
+ opt.value = groupList[i]["_id"];
|
|
|
+ $('#group-select')[0].appendChild(opt)
|
|
|
+ }
|
|
|
+ $("#group-select").selectpicker("refresh");
|
|
|
}
|
|
|
- $("#group-select").selectpicker("refresh");
|
|
|
}
|
|
|
|
|
|
function cancelModel() {
|
|
@@ -325,6 +352,10 @@
|
|
|
$('.group-item').each(function () {
|
|
|
var selectId = $(this).find("select option:checked").val()
|
|
|
var inputVal = $(this).find("input").val()
|
|
|
+ if (inputVal === "") {
|
|
|
+ showTip("请填写有效数字")
|
|
|
+ return
|
|
|
+ }
|
|
|
let tmp = {}
|
|
|
for (let v in groupList) {
|
|
|
if (groupList[v]["_id"] === selectId) {
|