Jianghan 3 anos atrás
pai
commit
997ef81375

+ 19 - 12
src/front/remark.go

@@ -893,7 +893,7 @@ func (f *Front) CheckResult() {
 	pid := f.GetString("pid")
 	tid := f.GetString("tid")
 	sourceinfo := f.GetString("s_sourceinfo")
-	qu.Debug("----------", tid, pid)
+	stype := f.GetString("stype")
 	task, _ := util.Mgo.FindById(util.TASKCOLLNAME, tid, map[string]interface{}{"i_givenum": 1})
 	projcet, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"v_fields": 1})
 	//tagCount := util.Mgo.Count(sourceinfo, map[string]interface{}{"s_grouptaskid": tid, "b_istag": true})
@@ -907,13 +907,24 @@ func (f *Front) CheckResult() {
 	}
 	sess := util.Mgo.GetMgoConn()
 	defer util.Mgo.DestoryMongoConn(sess)
+	query := make(map[string]interface{})
 	if tid == "" {
 
 	} else {
-
+		if stype == "group" {
+			query["s_grouptaskid"] = tid
+		} else {
+			query["s_usertaskid"] = tid
+		}
 	}
-	query := map[string]interface{}{"s_grouptaskid": tid, "b_istag": true}
+	query["b_check"] = true
+	qu.Debug(query)
+	checkNum = util.Mgo.Count(sourceinfo, query)
 	result := sess.DB(util.Mgo.DbName).C(sourceinfo).Find(query).Iter()
+	if checkNum == 0 {
+		f.ServeJson(map[string]interface{}{"rep": false, "msg": "无质检审核数据!"})
+		return
+	}
 	for tmp := make(map[string]interface{}); result.Next(&tmp); markNum++ {
 		user := qu.ObjToString(tmp["s_login"])
 		var up map[string]int
@@ -925,7 +936,6 @@ func (f *Front) CheckResult() {
 		up["ck_count"] += 1
 		umaps[user] = up
 		if tmp["b_check"].(bool) {
-			checkNum++
 			if f, ok := tmp["v_checkinfo"].(map[string]interface{}); ok {
 				flag := true // 数据整体准确率
 				// 按人员统计字段准备率
@@ -952,10 +962,7 @@ func (f *Front) CheckResult() {
 			}
 		}
 	}
-	if checkNum == 0 {
-		f.ServeJson(map[string]interface{}{"rep": false, "msg": "无质检审核数据!"})
-		return
-	}
+
 	qu.Debug(cmaps)
 	qu.Debug(umaps)
 	// 前台页面数据
@@ -970,9 +977,9 @@ func (f *Front) CheckResult() {
 	tmp["num3"] = checkNumR
 	tmp["num4"] = CountPr(checkNumR, checkNum)
 	dataSelect = append(dataSelect, tmp)
-	for k := range (*projcet)["v_fields"].(map[string]interface{}) {
+	for k, v := range (*projcet)["v_fields"].(map[string]interface{}) {
 		tmp1 := make(map[string]interface{})
-		tmp1["name"] = k
+		tmp1["name"] = v
 		tmp1["num1"] = markNum
 		tmp1["num2"] = checkNum
 		tmp1["num3"] = cmaps[k]
@@ -991,9 +998,9 @@ func (f *Front) CheckResult() {
 			tmp2["num3"] = v2["re_rg_count"]
 			tmp2["num4"] = CountPr(v2["re_rg_count"], v2["re_count"])
 			dataSelect1 = append(dataSelect1, tmp2)
-			for k := range (*projcet)["v_fields"].(map[string]interface{}) {
+			for k, v := range (*projcet)["v_fields"].(map[string]interface{}) {
 				tmp1 := make(map[string]interface{})
-				tmp1["name"] = k
+				tmp1["name"] = v
 				tmp1["num1"] = v2["ck_count"]
 				tmp1["num2"] = v2["re_count"]
 				tmp1["num3"] = v2[k]

+ 1 - 1
src/front/user.go

@@ -601,7 +601,7 @@ func (f *Front) UserTaskList() {
 		if s_role == "4" {
 			query["s_personid"] = s_personid
 		} else if s_role == "2" {
-			query["s_grouptaskid"] = gid
+			query["s_groupid"] = gid
 		}
 		if status != "-1" { //任务状态
 			query["s_status"] = status

+ 1 - 1
src/web/templates/project/check_task_list.html

@@ -131,7 +131,7 @@
 
     function checkMethod(tid, pid, sourceinfo, status) {
         if (status !== "已关闭") {
-            window.location.href = "/front/user/check/data?pid="+pid+"&tid="+tid+"&s_sourceinfo="+sourceinfo
+            window.location.href = "/front/user/check/data?pid="+pid+"&tid="+tid+"&s_sourceinfo="+sourceinfo+"&stype=user"
         }else {
             showTip("操作不允许")
         }

+ 6 - 2
src/web/templates/project/project_clear.html

@@ -399,7 +399,8 @@
                     data: { "s_sourceinfo": sourceinfo, "taskid": id, "s_status": status,"i_givenum" :givenum},
                     success: function (r) {
                         if (r.success) {
-                            showTip(r.msg, 2000, function () {
+                            let msg = r.msg+"<br>"+"共收回"+r.count+"数据。"
+                            showTip(msg, 1000, function () {
                                 location.reload()
                             });
                         } else {
@@ -446,7 +447,10 @@
                     data: {"s_sourceinfo": sourceinfo, "s_status": status, "taskid": id},
                     success: function (r) {
                         if (r.success) {
-                            location.reload()
+                            let msg = r.msg+"<br>"+"收回数据"+r.count+"条"
+                            showTip(msg, 1000, function () {
+                                location.reload()
+                            });
                         } else {
                             showTip(r.msg);
                         }

+ 5 - 4
src/web/templates/project/task_detail.html

@@ -35,14 +35,15 @@
                                         <input type="text" class="form-control" style="width: 80px" readonly value="{{.T.isTagNum}}"></label>
                                     <label class="form-inline" style="margin-left: 5px">未标注:
                                         <input type="text" class="form-control" style="width: 80px" readonly value="{{.T.isNotTagNum}}"></label>
-                                </div>
-                                <div class="col-xs-4 form-group">
                                     <label class="form-inline">操作:
                                         <input type="button" class="btn btn-sm btn-primary" onclick="dispatchTask('0')" value="分发">
-<!--                                        <a type="button" class="btn btn-sm btn-primary">质检</a>-->
-<!--                                        <input type="button" class="btn btn-sm btn-primary" value="质检结果">-->
+                                        <!--                                        <a type="button" class="btn btn-sm btn-primary">质检</a>-->
+                                        <!--                                        <input type="button" class="btn btn-sm btn-primary" value="质检结果">-->
                                     </label>
                                 </div>
+                                <div class="col-xs-4 form-group">
+
+                                </div>
                             </div>
                         </div>
                         <div id="status-div" class="col-xs-1" style="width: auto;float: right">

+ 44 - 42
src/web/templates/project/task_list.html

@@ -15,59 +15,57 @@
     <!-- Main content -->
     <section class="content">
         <div class="row">
-            <div class="col-xs-12">
-                <div class="box">
-                    <div class="box-body">
+            <div class="box">
+                <div class="box-body">
 
-                        <div id="status-div" class="col-xs-1" style="width: auto;float: right">
-                            <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>
-                            </span>
-                            <span class="input-group date date-picker" id="starttime" data-provide="datepicker">
+                    <div id="status-div" class="col-xs-1" style="width: auto;float: right">
+                        <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>
+                        </span>
+                        <span class="input-group date date-picker" id="starttime" data-provide="datepicker">
                                 <input type="text" class="form-control form-filter input-sm" readonly name="starttime" placeholder="开始日期" />
                                  <span class="input-group-addon">
                                      <i class="fa fa-calendar"></i>
                                   </span>
                             </span>
-                            <span class="input-group date date-picker" id="endtime" data-provide="datepicker">
+                        <span class="input-group date date-picker" id="endtime" data-provide="datepicker">
                                 <input type="text" class="form-control form-filter input-sm" readonly name="endtime" placeholder="结束日期" />
                                  <span class="input-group-addon">
                                      <i class="fa fa-calendar"></i>
                                   </span>
                             </span>
-                            <input type="button" class="btn btn-sm btn-primary" onclick="exportTask()" value="导出">
-<!--                            <a type="button" class="btn btn-sm btn-primary" href="/front/group/task/export">导出</a>-->
-                        </div>
-
-                        <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>
-                                <th>完成进度</th>
-                                <th>任务时间</th>
-                                <th>操作</th>
-                            </tr>
-                            </thead>
-                        </table>
+                        <input type="button" class="btn btn-sm btn-primary" onclick="exportTask()" value="导出">
+                        <!--                            <a type="button" class="btn btn-sm btn-primary" href="/front/group/task/export">导出</a>-->
                     </div>
-                    <!-- /.box-body -->
+
+                    <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>
+                            <th>完成进度</th>
+                            <th>任务时间</th>
+                            <th>操作</th>
+                        </tr>
+                        </thead>
+                    </table>
                 </div>
-                <!-- /.box -->
+                <!-- /.box-body -->
             </div>
+            <!-- /.box -->
         </div>
     </section>
 </div>
@@ -195,9 +193,10 @@
                 data: {"s_status": status, "taskid": id, "s_sourceinfo": sourceinfo},
                 success: function (r) {
                     if (r.success) {
-                        showTip(r.msg, 2000, function () {
+                        let msg = r.msg+"<br>"+"共收回"+r.count+"数据。"
+                        showTip(msg, 1000, function () {
                             ttable.api().ajax.reload()
-                        })
+                        });
                     } else {
                         showTip(r.msg);
                     }
@@ -216,7 +215,10 @@
                     data: {"s_sourceinfo": sourceinfo, "s_status": status, "taskid": id},
                     success: function (r) {
                         if (r.success) {
-                            ttable.api().ajax.reload()
+                            let msg = r.msg+"<br>"+"共收回"+r.count+"数据。"
+                            showTip(msg, 1000, function () {
+                                ttable.api().ajax.reload()
+                            });
                         } else {
                             showTip(r.msg);
                         }