Jianghan 3 år sedan
förälder
incheckning
4a7dd89125

+ 3 - 1
src/front/front.go

@@ -70,6 +70,8 @@ type Front struct {
 	projectGroupTaskClose    xweb.Mapper `xweb:"/front/project/task/close"`        //用户组任务关闭
 	projectGetEntnameList    xweb.Mapper `xweb:"/front/project/getEntnameList"`    //模糊查询公司名称
 	projectIsExists          xweb.Mapper `xweb:"/front/project/isExists"`          //判断项目名称是否存在
+	projectCheckSuc          xweb.Mapper `xweb:"/front/project/check/success"`     //项目达标数据质检通过
+	projectPassSuc           xweb.Mapper `xweb:"/front/project/pass/success"`      //项目数据通过
 
 	//user task
 	userTaskSave     xweb.Mapper `xweb:"/front/user/task/save"`     //用户任务分发
@@ -110,7 +112,7 @@ func (f *Front) Index() {
 	} else if role == "3" {
 		_ = f.Render("project/check_task_list.html")
 	} else {
-		_ = f.Render("index.html")
+		_ = f.Render("project/project_list.html")
 	}
 }
 

+ 16 - 7
src/front/group.go

@@ -83,15 +83,20 @@ func (f *Front) GroupTaskListByAdmin() {
 		query := map[string]interface{}{
 			"s_stype": "group", //检索用户组任务
 		}
+		//if starttime > 0 {
+		//	query["i_starttime"] = map[string]interface{}{
+		//		"$gte": starttime,
+		//	}
+		//}
+		dataQ := make(map[string]interface{})
 		if starttime > 0 {
-			query["i_starttime"] = map[string]interface{}{
-				"$gte": starttime,
-			}
+			dataQ["$gte"] = starttime
 		}
 		if completetime > 0 {
-			query["i_completetime"] = map[string]interface{}{
-				"$lte": completetime,
-			}
+			dataQ["$lte"] = completetime
+		}
+		if len(dataQ) > 0 {
+			query["i_completetime"] = dataQ
 		}
 		if status != "-1" { //任务状态
 			query["s_status"] = status
@@ -186,7 +191,6 @@ func (f *Front) GroupUserTaskList() {
 		f.ServeJson(map[string]interface{}{"draw": draw, "data": *list, "recordsFiltered": count, "recordsTotal": count})
 	} else {
 		sourceinfo := f.GetString("s_sourceinfo")
-		qu.Debug(sourceinfo)
 		//统计数据量
 		isGiveNum := util.Mgo.Count(sourceinfo, map[string]interface{}{"s_grouptaskid": groupTaskId, "b_isgiveuser": true})     //已分发量
 		isNotGiveNum := util.Mgo.Count(sourceinfo, map[string]interface{}{"s_grouptaskid": groupTaskId, "b_isgiveuser": false}) //待分发量
@@ -201,6 +205,11 @@ func (f *Front) GroupUserTaskList() {
 		f.T["isNotGiveNum"] = isNotGiveNum
 		f.T["isTagNum"] = isTagNum
 		f.T["isNotTagNum"] = isNotTagNum
+		if f.GetString("stype") == "jy" {
+			f.T["jy"] = "jy"
+		} else {
+			f.T["group"] = "group"
+		}
 		_ = f.Render("project/task_detail.html", &f.T)
 	}
 }

+ 10 - 10
src/front/mark.go

@@ -26,9 +26,9 @@ func (f *Front) JyMarkList() {
 		max := f.GetString("maxval")
 		hasno, _ := f.GetBool("hasno")   //是否存在
 		notag, _ := f.GetBool("notag")   //是否标注
-		query := map[string]interface{}{ //剑鱼自用的标注页面,数据排除已分发已标注数据
+		query := map[string]interface{}{ //剑鱼自用的标注页面, 查询待分发的数据量
 			"b_isgivegroup": false,
-			"b_isgiveuser":  false,
+			//"b_isgiveuser":  false,
 		}
 		if istag == "true" {
 			query["b_istag"] = true
@@ -237,14 +237,14 @@ func (f *Front) JyUserDataMark() {
 	if len(tagSet) > 0 || baseInfo["purchasinglist_alltag"] != nil { //purchasinglist_alltag特殊处理
 		//1、更新数据源信息
 		setResult := map[string]interface{}{ //更新字段集
-			"i_updatetime":  time.Now().Unix(),
-			"i_ckdata":      2,
-			"b_istag":       true,
-			"s_userid":      userId,
-			"s_groupid":     groupId,
-			"b_isgiveuser":  true,
-			"b_isgivegroup": true,
-			"s_login":       username,
+			"i_updatetime": time.Now().Unix(),
+			"i_ckdata":     2,
+			"b_istag":      true,
+			"s_userid":     userId,
+			"s_groupid":    groupId,
+			//"b_isgiveuser":  true,
+			//"b_isgivegroup": true,
+			"s_login": username,
 		}
 		for field, val := range tagSet { //更新标注字段
 			setResult["v_taginfo."+field] = val

+ 59 - 16
src/front/project.go

@@ -199,8 +199,14 @@ func (f *Front) ProjectComplete() {
 	success := false
 	msg := ""
 	projectId := f.GetString("s_projectid")
-	//sourceInfo := f.GetString("s_sourceinfo")
-	status := f.GetString("s_status")
+	sourceInfo := f.GetString("s_sourceinfo")
+	//status := f.GetString("s_status")
+	info, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, projectId, `{"s_status": 1}`)
+	if len(*info) <= 0 {
+		f.ServeJson(map[string]interface{}{"success": false, "msg": "查询项目失败"})
+		return
+	}
+	status := (*info)["s_status"]
 	if status == "进行中" {
 		//查询该项目下未完成的用户组和用户任务
 		query := map[string]interface{}{
@@ -210,10 +216,9 @@ func (f *Front) ProjectComplete() {
 			},
 		}
 		taskCount := util.Mgo.Count(util.TASKCOLLNAME, query)
-		//dataCount := util.Mgo.Count(sourceInfo, map[string]interface{}{"b_istag": false}) //未标注数据个数
-		//qu.Debug("No Tag Count:", dataCount)
-		//if dataCount == 0 && taskCount == 0 { //全部完成
-		if taskCount == 0 { //全部完成
+		dataCount := util.Mgo.Count(sourceInfo, map[string]interface{}{"b_istag": false}) //未标注数据个数
+		qu.Debug("No Tag Count:", dataCount)
+		if dataCount == 0 && taskCount == 0 { //全部完成
 			success = util.Mgo.UpdateById(util.PROJECTCOLLNAME, projectId, map[string]interface{}{
 				"$set": map[string]interface{}{
 					"s_status":       "已完成",
@@ -225,13 +230,12 @@ func (f *Front) ProjectComplete() {
 			if !success {
 				msg = "更新项目失败"
 			}
-		} else {
-			if taskCount != 0 {
-				msg += "任务未全部完成;"
-			}
-			//if dataCount != 0 {
-			//	msg += "数据未全部标注;"
-			//}
+		}
+		if taskCount != 0 {
+			msg += "任务未全部完成,"
+		}
+		if dataCount != 0 {
+			msg += "数据未全部标注"
 		}
 	} else {
 		msg = "项目未开始"
@@ -398,6 +402,9 @@ func (f *Front) ProjectGroupTaskSave() {
 			groupId := qu.ObjToString(groupInfo["s_groupid"])
 			groupIdArr = append(groupIdArr, groupId)
 			givenum := qu.IntAll(groupInfo["i_givenum"])
+			if givenum == 0 {
+				continue
+			}
 			groupTaskId := primitive.NewObjectID()
 			groupTaskIdStr := mongodb.BsonIdToSId(groupTaskId)
 			groupTaskIdArr = append(groupTaskIdArr, groupTaskIdStr)
@@ -531,15 +538,20 @@ func (f *Front) ProjectGroupTaskRetrieve() {
 	username := qu.ObjToString(user["s_login"])
 	groupTaskId := f.GetString("taskid")
 	sourceInfo := f.GetString("s_sourceinfo")
-	status := f.GetString("s_status") //未开始、进行中
+	//status := f.GetString("s_status") //未开始、进行中
 	//giveNum, _ := f.GetInteger("i_givenum") //收回时要更新的分发数据量
 	msg := ""
 	success := false
 	count := 0
+	groupTask, _ := util.Mgo.FindById(util.TASKCOLLNAME, groupTaskId, map[string]interface{}{"v_sonids": 1, "s_status": 1})
+	if len(*groupTask) <= 0 {
+		f.ServeJson(map[string]interface{}{"success": false, "msg": "查询任务失败"})
+		return
+	}
+	status := qu.ObjToString((*groupTask)["s_status"])
 	if status == "未开始" { //未开始的用户组任务,暂未给用户分发任务
 		success = true
 	} else { //进行中的用户组任务需更新其下用户信息
-		groupTask, _ := util.Mgo.FindById(util.TASKCOLLNAME, groupTaskId, map[string]interface{}{"v_sonids": 1})
 		if groupTask != nil && len(*groupTask) > 0 {
 			if sonIds, ok := (*groupTask)["v_sonids"].([]interface{}); ok && len(sonIds) > 0 { //更新所有用户任务信息
 				userTaskIdStatus := map[string]string{} //封装要回收的用户任务信息
@@ -586,10 +598,16 @@ func (f *Front) ProjectGroupTaskClose() {
 	username := qu.ObjToString(user["s_login"])
 	groupTaskId := f.GetString("taskid")
 	sourceInfo := f.GetString("s_sourceinfo")
-	status := f.GetString("s_status") //未开始、进行中
+	//status := f.GetString("s_status") //未开始、进行中
 	msg := ""
 	success := false
 	count := 0
+	groupTask, _ := util.Mgo.FindById(util.TASKCOLLNAME, groupTaskId, map[string]interface{}{"s_status": 1})
+	if len(*groupTask) <= 0 {
+		f.ServeJson(map[string]interface{}{"success": false, "msg": "查询任务失败"})
+		return
+	}
+	status := qu.ObjToString((*groupTask)["s_status"])
 	if status == "未开始" { //未开始的用户组任务,暂未给用户分发任务;已完成只更新用户组任务
 		success = true
 	} else { //进行中的用户组任务需更新其下用户信息
@@ -1131,6 +1149,7 @@ func GetDataById(idInfoArr []util.Data, importType, s_sourceinfo string, success
 				baseInfoMap["b_istag"] = false       //是否已标注
 				//baseInfoMap["b_cleartag"] = false    //是否清理标注信息
 				baseInfoMap["b_isgiveuser"] = false //是否分配给用户
+				baseInfoMap["b_check"] = false      // 质检标记
 				if util.Mgo.SaveByOriID(s_sourceinfo, baseInfoMap) {
 					atomic.AddInt64(successNum, 1) //保存成功计数
 				} else {
@@ -1183,3 +1202,27 @@ func UpdateMarkColl(bidData, markData, tagInfoMap, baseInfoMap *map[string]inter
 		(*baseInfoMap)["i_ckdata"] = 1
 	}
 }
+
+func (f *Front) ProjectCheckSuc() {
+	defer qu.Catch()
+	if f.Method() == "POST" {
+		sourceinfo := f.GetString("s_sourceinfo")
+		query := map[string]interface{}{
+			"b_istagging": false,
+		}
+		b := util.Mgo.Update(sourceinfo, query, map[string]interface{}{"$set": map[string]interface{}{"b_istag": true}}, false, true)
+		f.ServeJson(map[string]interface{}{"success": b, "msg": "更新数据失败"})
+	}
+}
+
+func (f *Front) ProjectPassSuc() {
+	defer qu.Catch()
+	if f.Method() == "POST" {
+		sourceinfo := f.GetString("s_sourceinfo")
+		query := map[string]interface{}{
+			"b_istag": false,
+		}
+		b := util.Mgo.Update(sourceinfo, query, map[string]interface{}{"$set": map[string]interface{}{"b_istag": true, "i_ckdata": 2}}, false, true)
+		f.ServeJson(map[string]interface{}{"success": b, "msg": "更新数据失败"})
+	}
+}

+ 28 - 27
src/front/remark.go

@@ -649,6 +649,7 @@ func (f *Front) CheckData() {
 		query := make(map[string]interface{})
 		if tid != "" {
 			// 任务数据质检
+			query["b_istag"] = true
 			if stype == "group" {
 				query["s_grouptaskid"] = tid
 			} else {
@@ -656,37 +657,34 @@ func (f *Front) CheckData() {
 			}
 		} else {
 			if stype == "notag" {
+				query["b_istagging"] = false
 				if datatype == 1 {
 					// 待分发数据
 					query["b_isgivegroup"] = false
-					query["b_istagging"] = false
 				} else {
-					// 标注数据
-					query["i_ckdata"] = 2
-					query["b_isgivegroup"] = false
+					// 已分发 标注数据
+					query["b_istag"] = true
+					query["b_isgivegroup"] = true
 				}
-			} else if stype == "tag" {
-				query["b_istagging"] = true //未达标
+			} else if stype == "tag" { //未达标
+				query["b_istagging"] = true
 				query["i_ckdata"] = 2
 			} else {
 				query["i_ckdata"] = 2
 			}
 		}
-		ckdata, err := f.GetInteger("i_ckdata")
-		if err != nil {
-			ckdata = -1
-		}
-		if ckdata == 0 {
-			query["b_istag"] = false
-		} else if ckdata == 1 {
-			query["b_istag"] = true
+		status := f.GetString("s_status")
+		if status == "1" {
+			query["b_check"] = true
+		} else if status == "-1" {
+			query["b_check"] = false
 		}
 		if search != "" {
 			query["$or"] = []interface{}{
 				map[string]interface{}{"v_baseinfo.title": map[string]interface{}{"$regex": search}},
 			}
 		}
-		fields := map[string]interface{}{"v_baseinfo.title": 1, "b_check": 1, "i_ckdata": 1, "s_login": 1}
+		fields := map[string]interface{}{"v_baseinfo.title": 1, "b_check": 1, "i_ckdata": 1, "s_login": 1, "b_istag": 1}
 		info, _ := util.Mgo.Find(sourceinfo, query, `{"_id": 1}`, fields, false, start, limit)
 		count := util.Mgo.Count(sourceinfo, query)
 		qu.Debug(query, sourceinfo, count)
@@ -704,14 +702,15 @@ func (f *Front) CheckData() {
 			if stype == "all" {
 				query1["i_ckdata"] = 2
 			} else if stype == "notag" {
+				query1["b_istagging"] = false
 				if datatype == 1 {
 					// 待分发数据
 					query1["b_isgivegroup"] = false
-					query1["b_istagging"] = false
+					//query1["b_istagging"] = false
 				} else {
 					// 标注数据
-					query1["i_ckdata"] = 2
-					query1["b_isgivegroup"] = false
+					query1["b_istag"] = true
+					query1["b_isgivegroup"] = true
 				}
 			} else if stype == "tag" {
 				query1["b_istagging"] = true //未达标
@@ -720,10 +719,11 @@ func (f *Front) CheckData() {
 				query1["i_ckdata"] = 2
 			}
 			qu.Debug(sourceinfo, query1)
-			f.T["taskNum"] = util.Mgo.Count(sourceinfo, query1)
+			count := util.Mgo.Count(sourceinfo, query1)
+			f.T["taskNum"] = count
+			f.T["taskTagNum"] = count
 			query1["b_check"] = true // 已质检
 			checkCount := util.Mgo.Count(sourceinfo, query1)
-			f.T["taskTagNum"] = 0
 			f.T["taskCheckNum"] = checkCount
 		} else {
 			task, _ := util.Mgo.FindById(util.TASKCOLLNAME, tid, map[string]interface{}{"i_givenum": 1})
@@ -904,13 +904,13 @@ func (f *Front) CheckSave() {
 	if len(checkSet) > 0 || baseInfo["purchasinglist_alltag"] != nil { //purchasinglist_alltag特殊处理
 		//1、更新数据源信息
 		setResult := map[string]interface{}{ //更新字段集
-			"i_updatetime":  time.Now().Unix(),
-			"b_check":       true,
-			"s_checkid":     userId,
-			"b_istag":       true,
-			"b_isgivegroup": true,
-			"b_isgiveuser":  true,
-			"s_userid":      userId,
+			"i_updatetime": time.Now().Unix(),
+			"b_check":      true,
+			"s_checkid":    userId,
+			"b_istag":      true,
+			//"b_isgivegroup": true,
+			//"b_isgiveuser":  true,
+			"s_userid": userId,
 		}
 		for field, val := range checkSet { //更新质检字段
 			setResult["v_taginfo."+field] = val
@@ -1090,6 +1090,7 @@ func (f *Front) CheckResult() {
 	}
 	f.T["pid"] = pid
 	f.T["tid"] = tid
+	f.T["sourceinfo"] = sourceinfo
 	f.T["taskNum"] = allNum
 	f.T["taskTagNum"] = markNum
 	f.T["taskCheckNum"] = checkNum

+ 38 - 2
src/front/user.go

@@ -61,6 +61,20 @@ func (f *Front) Login() {
 		user, _ := Mgo.FindOne("s_user", query)
 		checked := false
 		if user != nil && len(*user) > 0 {
+			if (*user)["b_delete"] == true {
+				f.ServeJson(map[string]interface{}{
+					"checked": false,
+					"message": "用户已被删除,请联系管理员",
+				})
+				return
+			}
+			if (*user)["i_state"] == false {
+				f.ServeJson(map[string]interface{}{
+					"checked": false,
+					"message": "用户状态未启用,请联系管理员",
+				})
+				return
+			}
 			checked = true
 			f.SetSession("user", map[string]interface{}{
 				"s_groupid": (*user)["s_groupid"],
@@ -71,6 +85,7 @@ func (f *Front) Login() {
 				"id":        mgo.BsonIdToSId((*user)["_id"]),
 			})
 			UserMenu[username] = GetUserMenu(qu.IntAll((*user)["i_role"]))
+
 		}
 		f.ServeJson(map[string]interface{}{
 			"checked": checked,
@@ -120,9 +135,17 @@ func (f *Front) UserGroup() {
 		draw, _ := f.GetInteger("draw")
 		searchStr := f.GetString("search[value]")
 		search := strings.TrimSpace(searchStr)
+		status := f.GetString("s_status")
 		query := map[string]interface{}{
 			"b_delete": false,
 		}
+		if status == "1" {
+			query["i_state"] = true
+		} else if status == "-1" {
+			query["i_state"] = false
+		} else {
+			delete(query, "i_state")
+		}
 		if search != "" {
 			query["$or"] = []interface{}{
 				bson.M{"s_name": bson.M{"$regex": search}},
@@ -533,6 +556,7 @@ func (f *Front) UserNew() {
 						}
 					} else if irole == "4" {
 						oldnum := qu.IntAll((*info)["user_size"])
+						Mgo.UpdateById("s_group", gid, map[string]interface{}{"$set": map[string]interface{}{"user_size": oldnum + size}})
 						for i := 0; i < size; i++ {
 							newUser := make(map[string]interface{})
 							newUser["i_role"] = irole
@@ -751,7 +775,13 @@ func (f *Front) UserTaskRetrieve() {
 	userTaskId := f.GetString("taskid") //用户任务id
 	qu.Debug("User Task Id:", userTaskId)
 	sourceInfo := f.GetString("s_sourceinfo") //数据源表
-	status := f.GetString("s_status")
+	//status := f.GetString("s_status")
+	task, _ := Mgo.FindById(TASKCOLLNAME, userTaskId, map[string]interface{}{"s_status": 1})
+	if len(*task) <= 0 {
+		f.ServeJson(map[string]interface{}{"success": false, "msg": "查询任务失败"})
+		return
+	}
+	status := qu.ObjToString((*task)["s_status"])
 	userTaskIdStatus := map[string]string{userTaskId: status}
 	msg, count, success := RetrieveCloseTaskByUser(sourceInfo, username, userTaskIdStatus)
 	//userTask, _ := Mgo.FindById(TASKCOLLNAME, userTaskId, nil)
@@ -794,7 +824,13 @@ func (f *Front) UserTaskClose() {
 	userTaskId := f.GetString("taskid") //用户任务id
 	qu.Debug("User Task Id:", userTaskId)
 	sourceInfo := f.GetString("s_sourceinfo") //数据源表
-	status := f.GetString("s_status")
+	//status := f.GetString("s_status")
+	task, _ := Mgo.FindById(TASKCOLLNAME, userTaskId, map[string]interface{}{"s_status": 1})
+	if len(*task) <= 0 {
+		f.ServeJson(map[string]interface{}{"success": false, "msg": "查询任务失败"})
+		return
+	}
+	status := qu.ObjToString((*task)["s_status"])
 	userTaskIdStatus := map[string]string{userTaskId: status}
 	msg, count, success := RetrieveCloseTaskByUser(sourceInfo, username, userTaskIdStatus)
 	f.ServeJson(map[string]interface{}{"success": success, "count": count, "msg": msg})

+ 1 - 1
src/web/res/dist/js/dataTables.chinese.lang

@@ -10,7 +10,7 @@
 	"searchPlaceholder": "请输入要搜索内容...",
 	"url": "",
 	"thousands": "'",
-	"emptyTable": "表中数据为空",
+	"emptyTable": "暂无数据",
 	"loadingRecords": "载入中...",
 	"infoThousands": ",",
 	"paginate": {

+ 7 - 6
src/web/templates/login.html

@@ -98,7 +98,7 @@
             alert("账号和密码不能为空")
             return
         }
-        // if ($("#verifyImgCode").val().trim().replace(/\s/g, "").length === 4) {
+        if ($("#verifyImgCode").val().trim().replace(/\s/g, "").length === 4) {
             $.ajax({
                 url:"/",
                 type:"post",
@@ -107,14 +107,15 @@
                     if(r.checked){
                         window.location.href="/front/index"
                     }else{
-                        alert(r.message);
+                      $("#verifyImg")[0].src = '/code?' + Math.random()
+                      alert(r.message);
                     }
                 }
             })
-        // } else {
-        //     $("#verifyImg")[0].src = '/code?' + Math.random()
-        //     alert("图片验证码有误,请重填");
-        // }
+        } else {
+            $("#verifyImg")[0].src = '/code?' + Math.random()
+            alert("图片验证码有误,请重填");
+        }
     }
 
 </script>

+ 43 - 8
src/web/templates/project/check_data_list.html

@@ -5,10 +5,20 @@
 {{include "com/menu.html"}}
 <div class="content-wrapper">
     <section class="content-header">
-        <h1>
-            <small></small>
-        </h1>
-        <ol class="breadcrumb">
+        <h1><small></small></h1>
+        <ol class="breadcrumb" name="tab1" style="display: none">
+            <li><a href="/front/project"><i class="fa fa-dashboard"></i> 项目列表</a></li>
+            <li><a href="#"><i class="fa fa-dashboard"></i> 质检列表</a></li>
+        </ol>
+        <ol class="breadcrumb" name="tab2" style="display: none">
+            <li><a href="/front/group/admin/task/list"><i class="fa fa-dashboard"></i> 剑鱼任务列表</a></li>
+            <li><a href="#"><i class="fa fa-dashboard"></i> 质检列表</a></li>
+        </ol>
+        <ol class="breadcrumb" name="tab3" style="display: none">
+            <li><a href="/front/group/task/list"><i class="fa fa-dashboard"></i> 用户组任务列表</a></li>
+            <li><a href="#"><i class="fa fa-dashboard"></i> 质检列表</a></li>
+        </ol>
+        <ol class="breadcrumb" name="tab4" style="display: none">
             <li><a href="/front/user/check/list?"><i class="fa fa-dashboard"></i> 质检任务列表</a></li>
             <li><a href="#"><i class="fa fa-dashboard"></i> 质检列表</a></li>
         </ol>
@@ -35,15 +45,16 @@
                         <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=0>未标注</option>
-                                    <option value=1>已标注</option>
+                                    <option value="0">全部</option>
+                                    <option value="1">已质检</option>
+                                    <option value="-1">未质检</option>
                                 </select></label>
                         </div>
                         <table id="dataTable" class="table table-bordered table-hover">
                             <thead>
                             <tr>
                                 <th></th>
+                                <th>状态</th>
                                 <th>标题</th>
                                 <th>用户</th>
                             </tr>
@@ -58,6 +69,20 @@
 
 {{include "com/footer.html"}}
 <script>
+    let router = sessionStorage.getItem("check")
+    if (router === "project") {
+        $('ol[name="tab1"]').show()
+        menuActive("/front/project")
+    }else if (router === "jygroup") {
+        $('ol[name="tab2"]').show()
+        menuActive("/front/group/admin/task/list");
+    }else if (router === "group") {
+        $('ol[name="tab3"]').show()
+        menuActive("/front/group/task/list");
+    }else if (router === "task") {
+        $('ol[name="tab4"]').show()
+        menuActive("/front/user/check/list");
+    }
 
     let tid = {{ .T.tid }}
     let pid = {{ .T.pid }}
@@ -99,6 +124,15 @@
             },
             "columns": [
                 {"data": null, width: "2%"},
+                {"data": "b_istag", width: "4%", render: function (val) {
+                        let tmp;
+                        if (val) {
+                            tmp = '<span style="display: inline-block;font-size:14px;">已标注</span>'
+                        } else {
+                            tmp = '<span style="display: inline-block;font-size:14px;">未标注</span>'
+                        }
+                        return tmp
+                    }},
                 {"data": "v_baseinfo.title", render: function (val, index, row) {
                         let tmp
                         if (row["b_check"]) {
@@ -112,9 +146,10 @@
             ],
             "initComplete": function () {
                 $("#dataTable_filter").append($('#status-div'))
+                $("[type=search]").attr('placeholder', "标题")
             },
             "fnServerParams": function (e) {
-                e.i_ckdata = $("#statusSelect option:selected").val()
+                e.s_status = $("#statusSelect option:selected").val()
             }
         });
         $('#statusSelect').on('changed.bs.select', function () {

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

@@ -918,7 +918,7 @@
                         alert("请先保存数据!")
                     } else {
                         if (nextid === "") {
-                            alert("数据已经全部标注完")
+                            alert("当前已经是最后一条数据!")
                         } else {
                             window.location.href = "/front/user/check/detail/?pid="+pid+"&tid="+tid+"&did="+nextid+"&s_sourceinfo="+coll
                         }

+ 33 - 6
src/web/templates/project/check_result.html

@@ -5,12 +5,26 @@
 {{include "com/menu.html"}}
 <div class="content-wrapper">
     <section class="content-header">
-        <h1>
-            <small></small>
-        </h1>
-        <ol class="breadcrumb">
+        <h1><small></small></h1>
+        <ol class="breadcrumb" name="tab1" style="display: none">
+            <li><a href="/front/project"><i class="fa fa-dashboard"></i> 项目列表</a></li>
+            <li><a href="/front/user/check/data?pid={{.T.pid}}&s_sourceinfo={{.T.sourceinfo}}"><i class="fa fa-dashboard"></i> 质检列表</a></li>
+            <li><a href="#"><i class="fa fa-dashboard"></i> 质检结果</a></li>
+        </ol>
+        <ol class="breadcrumb" name="tab2" style="display: none">
+            <li><a href="/front/group/admin/task/list"><i class="fa fa-dashboard"></i> 剑鱼任务列表</a></li>
+            <li><a href="/front/user/check/data?pid={{.T.pid}}&tid={{.T.tid}}&s_sourceinfo={{.T.sourceinfo}}&stype=group"><i class="fa fa-dashboard"></i> 质检列表</a></li>
+            <li><a href="#"><i class="fa fa-dashboard"></i> 质检结果</a></li>
+        </ol>
+        <ol class="breadcrumb" name="tab3" style="display: none">
+            <li><a href="/front/group/task/list"><i class="fa fa-dashboard"></i> 用户组任务列表</a></li>
+            <li><a href="/front/user/check/data?pid={{.T.pid}}&tid={{.T.tid}}&s_sourceinfo={{.T.sourceinfo}}&stype=group"><i class="fa fa-dashboard"></i> 质检列表</a></li>
+            <li><a href="#"><i class="fa fa-dashboard"></i> 质检结果</a></li>
+        </ol>
+        <ol class="breadcrumb" name="tab4" style="display: none">
             <li><a href="/front/user/check/list?"><i class="fa fa-dashboard"></i> 质检任务列表</a></li>
-            <li><a href="#"><i class="fa fa-dashboard"></i> 质检列表</a></li>
+            <li><a href="/front/user/check/data?pid={{.T.pid}}&tid={{.T.tid}}&s_sourceinfo={{.T.sourceinfo}}&stype=user"><i class="fa fa-dashboard"></i> 质检列表</a></li>
+            <li><a href="#"><i class="fa fa-dashboard"></i> 质检结果</a></li>
         </ol>
     </section>
     <!-- Main content -->
@@ -56,7 +70,20 @@
 
 {{include "com/footer.html"}}
 <script>
-    menuActive("/front/user/task/list");
+    let router = sessionStorage.getItem("check")
+    if (router === "project") {
+        $('ol[name="tab1"]').show()
+        menuActive("/front/project")
+    }else if (router === "jygroup") {
+        $('ol[name="tab2"]').show()
+        menuActive("/front/group/admin/task/list");
+    }else if (router === "group") {
+        $('ol[name="tab3"]').show()
+        menuActive("/front/group/task/list");
+    }else if (router === "task") {
+        $('ol[name="tab4"]').show()
+        menuActive("/front/user/check/list");
+    }
 
     let dataResult = {{ .T.tableData }}
     let userSelect = {{ .T.userSelect }}

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

@@ -9,7 +9,7 @@
             <small></small>
         </h1>
         <ol class="breadcrumb">
-            <li><a href="#"><i class="fa fa-dashboard"></i> 任务列表</a></li>
+            <li><a href="#"><i class="fa fa-dashboard"></i> 质检任务列表</a></li>
         </ol>
     </section>
     <!-- Main content -->
@@ -121,6 +121,7 @@
             ],
             "initComplete": function () {
                 $("#dataTable_filter").append($('#status-div'))
+                $("[type=search]").attr('placeholder', "项目名称")
             },
             "fnServerParams": function (e) {
                 e.s_status = $("#statusSelect option:selected").val()
@@ -133,6 +134,7 @@
 
     function checkMethod(tid, pid, sourceinfo, status) {
         if (status !== "已关闭") {
+            sessionStorage.setItem("check", "task")
             window.location.href = "/front/user/check/data?pid="+pid+"&tid="+tid+"&s_sourceinfo="+sourceinfo+"&stype=user"
         }else {
             showTip("操作不允许")

+ 58 - 12
src/web/templates/project/project_clear.html

@@ -5,9 +5,7 @@
 {{include "com/menu.html"}}
 <div class="content-wrapper" xmlns="http://www.w3.org/1999/html">
     <section class="content-header">
-        <h1>
-            <small></small>
-        </h1>
+        <h1><small></small></h1>
         <ol class="breadcrumb">
             <li><a href="/front/project"><i class="fa fa-dashboard"></i> 项目列表</a></li>
             <li><a href="#"><i class="fa fa-dashboard"></i> 项目分发</a></li>
@@ -40,7 +38,7 @@
                                             <a type="button" class="btn btn-sm btn-primary" href="/front/user/jymark/list?pid={{.T.s_projectid}}&stype=all">标注</a>
                                             <a type="button" class="btn btn-sm btn-primary" onclick="dispatchTask('all')">分发</a>
                                             <a type="button" class="btn btn-sm btn-primary" onclick="checkMethod('all')">质检</a>
-<!--                                            <input type="button" class="btn btn-sm btn-primary" value="质检结果">-->
+                                            <a type="button" class="btn btn-sm btn-primary" onclick="checkAllSuc()">通过</a>
                                         </label>
                                     </div>
                                 </div>
@@ -60,7 +58,7 @@
                                             <a type="button" class="btn btn-sm btn-primary" href="/front/user/jymark/list?pid={{.T.s_projectid}}&stype=notag">标注</a>
                                             <a type="button" class="btn btn-sm btn-primary" onclick="dispatchTask('notag')">分发</a>
                                             <a type="button" class="btn btn-sm btn-primary" onclick="checkMethod('notag')">质检</a>
-<!--                                            <input type="button" class="btn btn-sm btn-primary" value="质检结果">-->
+                                            <a type="button" class="btn btn-sm btn-primary" onclick="checkSuc()">质检通过</a>
                                         </label>
                                     </div>
                                 </div>
@@ -177,8 +175,10 @@
     menuActive("project");
 
     let projectid = {{ .T.s_projectid }}
+    let sourceinfo = {{ .T.s_sourceinfo }}
     let allNoGiveDataNum = {{.T.allNoGiveDataNum}}
     let okNotGiveDataNum = {{.T.okNotGiveDataNum}}
+    let okIsTagDataNum = {{ .T.okIsTagDataNum }}
     let IsNotOkNotGiveDataNum = {{.T.IsNotOkNotGiveDataNum}}
     let groupList = []
     let tableData = []
@@ -250,6 +250,7 @@
             ],
             "initComplete": function () {
                 $("#dataTable_filter").append($('#status-div'))
+                $("[type=search]").attr('placeholder', "用户组名称")
             },
             "fnServerParams": function (e) {
                 e.s_status = $("#statusSelect option:selected").val()
@@ -303,7 +304,7 @@
             }
             $('#modal-num').html(allNoGiveDataNum)
         }else if (stype === "notag") {
-            if (okNotGiveDataNum === 0) {
+            if (okNotGiveDataNum === 0 || okNotGiveDataNum === okIsTagDataNum) {
                 showTip("没有可分配的数据!")
                 return
             }
@@ -323,8 +324,8 @@
                 opt.value = groupList[i]["_id"];
                 $('#group-select')[0].appendChild(opt)
             }
-            $("#group-select").selectpicker("refresh");
         }
+        $("#group-select").selectpicker("refresh");
     }
 
     function cancelModel() {
@@ -355,7 +356,7 @@
             var selectId = $(this).find("select option:checked").val()
             var inputVal = $(this).find("input").val()
             valNum += parseInt(inputVal)
-            if (inputVal === "" || valNum > num) {
+            if (inputVal === "" || valNum > num || inputVal === "0") {
                 showTip("分发数量有问题")
                 return
             }
@@ -390,13 +391,13 @@
     }
 
     // 收回
-    function retrieveTask(id, sourceinfo, status,givenum) {
+    function retrieveTask(id, sourceinfo, status, givenum) {
         if (status === "未开始" || status === "进行中") {
             showConfirm("确认要收回当前任务吗?", function () {
                 $.ajax({
                     url: "/front/project/task/retrieve",
                     type: 'POST',
-                    data: { "s_sourceinfo": sourceinfo, "taskid": id, "s_status": status,"i_givenum" :givenum},
+                    data: { "s_sourceinfo": sourceinfo, "taskid": id, "i_givenum" :givenum},
                     success: function (r) {
                         if (r.success) {
                             let msg = r.msg+"<br>"+"共收回"+r.count+"数据。"
@@ -421,7 +422,7 @@
                 $.ajax({
                     url: "/front/project/task/repulse",
                     type: 'POST',
-                    data: {"s_sourceinfo": sourceinfo, "taskid": id, "s_tatus": status},
+                    data: {"s_sourceinfo": sourceinfo, "taskid": id},
                     success: function (r) {
                         if (r.success) {
                             location.reload()
@@ -443,7 +444,7 @@
                 $.ajax({
                     url: "/front/project/task/close",
                     type: 'POST',
-                    data: {"s_sourceinfo": sourceinfo, "s_status": status, "taskid": id},
+                    data: {"s_sourceinfo": sourceinfo, "taskid": id},
                     success: function (r) {
                         if (r.success) {
                             let msg = r.msg+"<br>"+"收回数据"+r.count+"条"
@@ -517,4 +518,49 @@
         }
     }
 
+    function checkSuc() {
+        let num1 = {{ .T.okIsGiveDataNum }}     // 达标 已分发
+        let num2 = {{ .T.okNotGiveDataNum }}    // 达标 待分发
+        let num3 = {{ .T.okIsTagDataNum }}      // 达标 已标注
+        if (num2 > 0 && num1 === 0 && num3 === 0) {
+            showConfirm("确认达标数据通过质检?确认后,达标数据将无法进行标注、分发,默认完成标注。", function () {
+                $.ajax({
+                    url: "/front/project/check/success",
+                    type: 'POST',
+                    data: {"s_sourceinfo": sourceinfo},
+                    success: function (r) {
+                        if (r.success) {
+                            location.reload()
+                        } else {
+                            showTip(r.msg);
+                        }
+                    }
+                })
+            })
+        }else {
+            showTip("操作不允许", 500)
+        }
+    }
+
+    function checkAllSuc() {
+        let num0 = {{ .T.allGiveDataNum }}     // 已分发
+        if (num0 === 0) {
+            showConfirm("确认要通过数据吗?确认后,项目下未标注数据将无法进行标注、分发,默认完成标注。", function () {
+                $.ajax({
+                    url: "/front/project/pass/success",
+                    type: 'POST',
+                    data: {"s_sourceinfo": sourceinfo},
+                    success: function (r) {
+                        if (r.success) {
+                            location.reload()
+                        } else {
+                            showTip(r.msg);
+                        }
+                    }
+                })
+            })
+        }else {
+            showTip("操作不允许", 500)
+        }
+    }
 </script>

+ 14 - 11
src/web/templates/project/project_list.html

@@ -5,9 +5,7 @@
 {{include "com/menu.html"}}
 <div class="content-wrapper">
     <section class="content-header">
-        <h1>
-            <small></small>
-        </h1>
+        <h1><small></small></h1>
         <ol class="breadcrumb">
             <li><a href="/front/project"><i class="fa fa-dashboard"></i> 项目列表</a></li>
         </ol>
@@ -230,9 +228,9 @@
 </div>
 
 <div class="modal fade" id="loadingModal" backdrop="static" keyboard="false">
-    <div style="width: 200px;height:100px; z-index: 20000; position: absolute; text-align: center; left: 50%; top: 50%;margin-left:-100px;margin-top:-10px">
+    <div style="width: 250px;height:100px; z-index: 20000; position: absolute; text-align: center; left: 50%; top: 50%;margin-left:-100px;margin-top:-10px">
         <div id="loadText" class="progress progress-striped active"
-             style="margin-bottom: 0;height:50px; text-align:center;line-height: 50px;font-size:large;padding-left: 10px">
+             style="margin-bottom: 0;height:50px; text-align:center;line-height: 50px;font-size:large;padding-left: 5px">
             loading......    
         </div>
     </div>
@@ -319,7 +317,7 @@
                 {
                     "data": "_id", width: "11%", render: function (val, a, row, pos) {
                         let tmp = "";
-                        if (row.b_iscomplete) {
+                        if (row.b_isassessment) {
                             tmp = '<div>' +
                                 '<a class="btn btn-sm btn-primary" onclick="editPro(\'' + pos.row + '\')">编辑</a>&nbsp;&nbsp;' +
                                 '<a class="btn btn-sm btn-primary" onclick="clearPro(\''+ pos.row +'\')">查看</a>&nbsp;&nbsp;' +
@@ -353,6 +351,7 @@
             }],
             "initComplete": function () {
                 $("#dataTable_filter").prepend($('#status-div'))
+                $("[type=search]").attr('placeholder', "项目名称、公司名称等")
             },
             "fnServerParams": function (e) {
                 e.s_status = $("#statusSelect option:selected").val()
@@ -564,7 +563,7 @@
                 success: function (r) {
                     hideLoading()
                     if (r.success) {
-                        window.location.href="/front/project/task/list?pid=" + tmp["_id"]
+                        window.location.href="/front/project/task/list?pid="+tmp["_id"]
                     } else {
                         showTip(r.msg);
                     }
@@ -579,9 +578,9 @@
                $.ajax({
                    url: "/front/project/complete",
                    type: 'POST',
-                   data: {"s_projectid": pid, "s_sourceinfo": sourceinfo, "s_status": status},
+                   data: {"s_projectid": pid, "s_sourceinfo": sourceinfo},
                    success: function (r) {
-                       if (r.rep) {
+                       if (r.success) {
                            ttable.api().ajax.reload();
                        } else {
                            showMsg(r.msg);
@@ -595,7 +594,8 @@
     }
 
     function checkMethod(pid, sourceinfo, status) {
-        if (status === "进行中") {
+        if (status === "进行中" || status === "已完成") {
+            sessionStorage.setItem("check", "project")
             window.location.href = "/front/user/check/data?pid=" + pid + "&s_sourceinfo=" + sourceinfo
         }else {
             showTip("项目未分发任务")
@@ -611,9 +611,12 @@
                 data: {"s_name": pname},
                 success: function (r) {
                     if (r.exists) {
-                        $('#project-name').focus();
+                        // $('#project-name').focus();
                         existName = true
                         showTip("项目名称已经存在")
+                        $('#com-alert').on('hidden.bs.modal', function () {
+                            $("body").addClass("modal-open");
+                        });
                     }else {
                         existName = false
                     }

+ 10 - 8
src/web/templates/project/remark_detail.html

@@ -373,7 +373,7 @@
             <div class="save-box">
 <!--                 <button  class="code" @click.stop="showPop = true" style="width:100px">源码</button>&nbsp;&nbsp;-->
                 <!--                 <button  class="code" @click.stop="open(1)" style="width:100px">全部验证</button> -->
-                <button class="code" @click.stop="open(2)" style="width:100px">字段验证</button>
+                <button class="code" @click.stop="open(2)" style="width:100px">保存</button>
                 <!--            <button  class="code" @click.stop="open('', false)" style="width:100px">保存</button>&nbsp;&nbsp;-->
                 <button class="code" @click.stop="openHref" style="width:100px">下一条</button>
                 <!--<button  class="code" @click.stop="window.location.href='/'" style="width:100px">下一条</button>-->
@@ -917,7 +917,7 @@
                     //     alert("请先保存数据!")
                     // } else {
                         if (nextid === "") {
-                            alert("数据已经全部标注完")
+                            alert("当前已经是最后一条数据!")
                         } else {
                             window.location.href = "/front/user/remark/detail/?pid="+pid+"&tid="+tid+"&did="+nextid+"&s_sourceinfo="+coll
                         }
@@ -1365,12 +1365,12 @@
                         this.$alert("未标注完成");
                         return
                     }
-                    var d = JSON.stringify(this.editData);
-                    var _this = this
-                    if (JSON.stringify(this.originData) === d) {
-                        this.$alert("未做任何修改");
-                        return;
-                    }
+                    // var d = JSON.stringify(this.editData);
+                    // var _this = this
+                    // if (JSON.stringify(this.originData) === d) {
+                    //     this.$alert("未做任何修改");
+                    //     return;
+                    // }
                     this.$confirm('是否保存?', '提示', {
                         confirmButtonText: '确定',
                         cancelButtonText: '取消',
@@ -1382,6 +1382,8 @@
                 },
                 //保存事件
                 upChange: function (stype) {
+                    var d = JSON.stringify(this.editData);
+                    var _this = this
                     if (tid === "") {
                         $.ajax({
                             url: "/front/data/jyuser/mark",

+ 15 - 10
src/web/templates/project/task_detail.html

@@ -5,16 +5,17 @@
 {{include "com/menu.html"}}
 <div class="content-wrapper">
     <section class="content-header">
-        <h1>
-            <small></small>
-        </h1>
+        <h1><small></small></h1>
         <ol class="breadcrumb">
             {{if .T.pid}}
             <li><a href="/front/project"><i class="fa fa-dashboard"></i> 项目列表</a></li>
             <li><a href="/front/project/task/list?pid={{ .T.pid }}"><i class="fa fa-dashboard"></i> 项目分发</a></li>
             <li><a href="#"><i class="fa fa-dashboard"></i> 任务分发</a></li>
-            {{else}}
-            <li><a href="/front/group/task/list"><i class="fa fa-dashboard"></i> 任务分发</a></li>
+            {{else if .T.jy}}
+            <li><a href="/front/group/admin/task/list"><i class="fa fa-dashboard"></i> 剑鱼任务列表</a></li>
+            <li><a href="#"><i class="fa fa-dashboard"></i> 用户任务分发</a></li>
+            {{else if .T.group}}
+            <li><a href="/front/group/task/list"><i class="fa fa-dashboard"></i> 用户组任务列表</a></li>
             <li><a href="#"><i class="fa fa-dashboard"></i> 用户任务分发</a></li>
             {{end}}
         </ol>
@@ -153,13 +154,17 @@
 
 {{include "com/footer.html"}}
 <script>
-    menuActive("task/list");
-
+    if ({{ .T.pid }}) {
+        menuActive("project");
+    }else if ({{ .T.jy }}) {
+        menuActive("/front/group/admin/task/list");
+    }else {
+        menuActive("group/task/list");
+    }
     let grouptaskid = {{ .T.grouptaskid }}
     let isNotGiveNum = {{ .T.isNotGiveNum }}
     let userList = []
     let stype = "man"
-
     $(function () {
         ttable = $('#dataTable').dataTable({
             "paging": true,
@@ -418,7 +423,7 @@
                 $.ajax({
                     url: "/front/user/task/retrieve",
                     type: 'POST',
-                    data: {"s_sourceinfo": sourceinfo, "taskid": id, "s_status": status},
+                    data: {"s_sourceinfo": sourceinfo, "taskid": id},
                     success: function (r) {
                         if (r.success) {
                             let msg = r.msg+"<br>"+"共收回"+r.count+"数据。"
@@ -441,7 +446,7 @@
                 $.ajax({
                     url: "/front/user/task/close",
                     type: 'POST',
-                    data: {"s_sourceinfo": sourceinfo, "taskid": id, "s_status": status},
+                    data: {"s_sourceinfo": sourceinfo, "taskid": id},
                     success: function (r) {
                         if (r.success) {
                             location.reload()

+ 8 - 2
src/web/templates/project/task_group_list.html

@@ -9,7 +9,7 @@
             <small></small>
         </h1>
         <ol class="breadcrumb">
-            <li><a href="#"><i class="fa fa-dashboard"></i> 任务列表</a></li>
+            <li><a href="#"><i class="fa fa-dashboard"></i> 用户组任务列表</a></li>
         </ol>
     </section>
     <!-- Main content -->
@@ -115,7 +115,7 @@
                         tmp = '<div>' +
                             '<a class="btn btn-sm btn-primary" href="/front/group/user/task/list?grouptaskid=' + val + '&s_sourceinfo='+row.s_sourceinfo+'">查看</a>&nbsp;&nbsp;' +
                             // '<a class="btn btn-sm btn-warning">分发</a>&nbsp;&nbsp;' +
-                            '<a class="btn btn-sm btn-primary" href="/front/user/check/data?pid='+row.s_projectid+'&tid='+val+'&s_sourceinfo='+row.s_sourceinfo+'&stype=group">质检</a>&nbsp;&nbsp;' +
+                            '<a class="btn btn-sm btn-primary" onclick="checkMethod(\'' + row.s_projectid + '\',\'' + val + '\',\'' + row.s_sourceinfo + '\')">质检</a>&nbsp;&nbsp;' +
                             // '<a class="btn btn-sm btn-primary">质检结果</a>&nbsp;&nbsp;' +
                             '<a class="btn btn-sm btn-primary" onclick="deliverTask(\'' + val + '\',\'' + row.s_status + '\')">交付</a>&nbsp;&nbsp;' +
                             '</div>';
@@ -125,6 +125,7 @@
             ],
             "initComplete": function () {
                 $("#dataTable_filter").append($('#status-div'))
+                $("[type=search]").attr('placeholder', "项目名称")
             },
             "fnServerParams": function (e) {
                 e.s_status = $("#statusSelect option:selected").val()
@@ -156,4 +157,9 @@
             showTip("操作不允许")
         }
     }
+
+    function checkMethod(pid, tid, sourceinfo) {
+        sessionStorage.setItem("check", "group")
+        window.location.href = "/front/user/check/data?pid="+pid+"&tid="+tid+"&s_sourceinfo="+sourceinfo+"&stype=group"
+    }
 </script>

+ 12 - 9
src/web/templates/project/task_list.html

@@ -3,13 +3,11 @@
 {{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>
-        </h1>
+        <h1><small></small></h1>
         <ol class="breadcrumb">
-            <li><a href="#"><i class="fa fa-dashboard"></i> 任务列表</a></li>
+            <li><a href="#"><i class="fa fa-dashboard"></i> 剑鱼任务列表</a></li>
         </ol>
     </section>
     <!-- Main content -->
@@ -136,9 +134,9 @@
                 {
                     "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>&nbsp;&nbsp;' +
+                            '<a class="btn btn-sm btn-primary" href="/front/group/user/task/list?grouptaskid=' + val + '&s_sourceinfo='+row.s_sourceinfo+'&stype=jy">查看</a>&nbsp;&nbsp;' +
                             '<a class="btn btn-sm btn-primary" onclick="retrieveTask(\'' + val + '\',\''+row.s_sourceinfo+'\',\'' + row.s_status + '\')">收回</a>&nbsp;&nbsp;' +
-                            '<a class="btn btn-sm btn-primary" href="/front/user/check/data?pid='+row.s_projectid+'&tid=' + val + '&s_sourceinfo='+row.s_sourceinfo+'&stype=group">质检</a>&nbsp;&nbsp;' +
+                            '<a class="btn btn-sm btn-primary" onclick="checkMethod(\'' + row.s_projectid + '\',\'' + val + '\',\'' + row.s_sourceinfo + '\')">质检</a>&nbsp;&nbsp;' +
                             '<a class="btn btn-sm btn-primary" onclick="closeTask(\'' + val + '\',\''+row.s_sourceinfo+'\',\'' + row.s_status + '\')">关闭</a>&nbsp;&nbsp;' +
                             '</div>';
                         return tmp
@@ -158,6 +156,7 @@
             "initComplete": function () {
                 $("#dataTable_filter").append($('#status-div'))
                 $("#dataTable_wrapper .col-sm-6").css({width:"100%"});
+                $("[type=search]").attr('placeholder', "项目名称、公司名称等")
             },
             "fnServerParams": function (e) {
                 e.s_status = $("#statusSelect option:selected").val()
@@ -202,7 +201,7 @@
                 $.ajax({
                     url: "/front/project/task/retrieve",
                     type: 'POST',
-                    data: {"s_status": status, "taskid": id, "s_sourceinfo": sourceinfo},
+                    data: {"taskid": id, "s_sourceinfo": sourceinfo},
                     success: function (r) {
                         if (r.success) {
                             let msg = r.msg+"<br>"+"共收回"+r.count+"数据。"
@@ -224,7 +223,7 @@
                 $.ajax({
                     url: "/front/project/task/close",
                     type: 'POST',
-                    data: {"s_sourceinfo": sourceinfo, "s_status": status, "taskid": id},
+                    data: {"s_sourceinfo": sourceinfo, "taskid": id},
                     success: function (r) {
                         if (r.success) {
                             let msg = r.msg+"<br>"+"共收回"+r.count+"数据。"
@@ -264,4 +263,8 @@
         window.location.href = "/front/group/task/export?"+"i_starttime="+sttime+"&i_completetime="+edtime+"&s_search="+search+"&s_status="+status
     }
 
+    function checkMethod(pid, tid, sourceinfo) {
+        sessionStorage.setItem("check", "jygroup")
+        window.location.href = "/front/user/check/data?pid="+pid+"&tid="+tid+"&s_sourceinfo="+sourceinfo+"&stype=group"
+    }
 </script>

+ 1 - 0
src/web/templates/project/task_user_list.html

@@ -122,6 +122,7 @@
             ],
             "initComplete": function () {
                 $("#dataTable_filter").append($('#status-div'))
+                $("[type=search]").attr('placeholder', "项目名称")
             },
             "fnServerParams": function (e) {
                 e.s_status = $("#statusSelect option:selected").val()

+ 29 - 19
src/web/templates/user/user_group.html

@@ -25,10 +25,10 @@
                             <a class="btn btn-sm btn-default margin" onclick="bulkSetup(false)">批量关闭</a>
                         </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 class="form-control selectpicker" id="statusSelect">
+                                <option value="0">全部</option>
+                                <option value="1">已开启</option>
+                                <option value="-1">关闭</option>
                             </select>
                         </div>
                         <table id="dataTable" class="table table-bordered table-hover">
@@ -178,13 +178,18 @@
             ],
             "initComplete": function () {
                 $("#dataTable_filter").append($('#status-div'))
+                $("[type=search]").attr('placeholder', "用户组名称")
+            },
+            "fnServerParams": function (e) {
+                e.s_status = $("#statusSelect option:selected").val()
             }
         });
-
+        $('#statusSelect').on('changed.bs.select', function () {
+            ttable.api().ajax.reload();
+        })
     });
 
     function setupState(id, v) {
-        console.log(id, v)
         showConfirm("确定修改当前状态?", function() {
             $.ajax({
                 url: "/front/group/state",
@@ -260,21 +265,26 @@
     }
 
     function bulkSetup(val) {
-        showConfirm("确定修改全部状态吗?", function (){
-            $.ajax({
-                url: "/front/group/bulks_setup",
-                type: 'POST',
-                data: {"ids": selectIndex.toString(), "state": val},
-                success: function (r) {
-                    if (r.rep) {
-                        $("#allCheckbox").prop("checked", false)
-                        ttable.api().ajax.reload()
-                    } else {
-                        showTip("状态修改失败");
+        if (selectIndex.length > 0) {
+            showConfirm("确定修改全部状态吗?", function (){
+                $.ajax({
+                    url: "/front/group/bulks_setup",
+                    type: 'POST',
+                    data: {"ids": selectIndex.toString(), "state": val},
+                    success: function (r) {
+                        if (r.rep) {
+                            $("#allCheckbox").prop("checked", false)
+                            selectIndex.length = 0
+                            ttable.api().ajax.reload()
+                        } else {
+                            showTip("状态修改失败");
+                        }
                     }
-                }
+                })
             })
-        })
+        }else {
+            showTip("未选中任何用户组");
+        }
     }
 
     function editGroup(v){

+ 32 - 23
src/web/templates/user/user_list.html

@@ -5,9 +5,7 @@
 {{include "com/menu.html"}}
 <div class="content-wrapper">
     <section class="content-header">
-        <h1>
-            <small></small>
-        </h1>
+        <h1><small></small></h1>
         <ol class="breadcrumb">
             {{if .T.stype}}
                 <li><a href="/front/group"><i class="fa fa-dashboard"></i> 用户组管理</a></li>
@@ -40,6 +38,7 @@
                                 <th><input type="checkbox" onclick="allSelect(this)" id="allCheckbox"></th>
                                 <th>用户账号</th>
                                 <th>用户姓名</th>
+                                <th>联系方式</th>
                                 <th>用户权限</th>
                                 <th>状态</th>
                                 <th>创建时间</th>
@@ -79,7 +78,7 @@
                                 </div>
                             </div>
                             <div class="form-group margin-bottom">
-                                <label class="col-sm-3 control-label">用户名</label>
+                                <label class="col-sm-3 control-label">用户名</label>
                                 <div class="col-sm-8">
                                     <input type="text" class="form-control" id="user-name" placeholder="用户名称">
                                 </div>
@@ -226,7 +225,8 @@
                         return `<input type="checkbox" name="ckb-keyid" onclick="singleSelect(this)" style="text-align: center">`
                     }},
                 {"data": "s_login", width: "9%"},
-                {"data": "s_name", width: "9%"},
+                {"data": "s_name", width: "7%"},
+                {"data": "s_phone", width: "9%"},
                 {"data": "i_role", width:"9%", render: function (val) {
                         if (val === "0") {
                             return "超级管理员"
@@ -266,7 +266,10 @@
                             '</div>';
                         return tmp
                     }}
-            ]
+            ],
+            "initComplete": function () {
+                $("[type=search]").attr('placeholder', "用户账号")
+            },
         });
 
         $("input[name=role]").click(function(){
@@ -382,16 +385,17 @@
     }
 
     function del(id) {
-        showConfirm("确定删除该用户?", function() {
+        showConfirm("确定删除该用户?", function() {
             $.ajax({
-                url: "front/group/user/del",
+                url: "/front/group/user/del",
                 type: 'POST',
                 data: {"id": id},
                 success: function (r) {
                     if (r.rep) {
-                        ttable.ajax.reload();
+                        showTip("删除用户成功")
+                        ttable.api().ajax.reload();
                     } else {
-                        showTip("状态修改失败");
+                        showTip("删除用户失败");
                     }
                 }
             })
@@ -399,21 +403,26 @@
     }
 
     function bulkSetup(val) {
-        showConfirm("确定修改全部状态吗?", function (){
-            $.ajax({
-                url: "/front/user/bulks_setup",
-                type: 'POST',
-                data: {"ids": selectIndex.toString(), "state": val},
-                success: function (r) {
-                    if (r.rep) {
-                        $("#allCheckbox").prop("checked", false)
-                        ttable.api().ajax.reload()
-                    } else {
-                        showTip("状态修改失败");
+        if (selectIndex.length > 0) {
+            showConfirm("确定修改全部状态吗?", function (){
+                $.ajax({
+                    url: "/front/user/bulks_setup",
+                    type: 'POST',
+                    data: {"ids": selectIndex.toString(), "state": val},
+                    success: function (r) {
+                        if (r.rep) {
+                            $("#allCheckbox").prop("checked", false)
+                            selectIndex.length = 0
+                            ttable.api().ajax.reload()
+                        } else {
+                            showTip("状态修改失败");
+                        }
                     }
-                }
+                })
             })
-        })
+        }else {
+            showTip("未选中任何用户");
+        }
     }
 
     function cancelModel() {