瀏覽代碼

no message

Jianghan 3 年之前
父節點
當前提交
633f75c03b
共有 9 個文件被更改,包括 266 次插入111 次删除
  1. 20 25
      src/config.json
  2. 13 1
      src/front/front.go
  3. 129 48
      src/front/server.go
  4. 3 0
      src/main.go
  5. 2 2
      src/util/config.go
  6. 11 6
      src/web/templates/detail.html
  7. 16 19
      src/web/templates/list.html
  8. 1 1
      src/web/templates/re_detail.html
  9. 71 9
      src/web/templates/review.html

+ 20 - 25
src/config.json

@@ -9,7 +9,7 @@
     "redistimeout": 10,
     "bidding":{
     	"addr":"192.168.3.207:27092",
-		"db": "mxs",
+		"db": "qfw_data",
 		"coll1": "bidding",
 		"coll2": "bidding_back",
 		"size": 10,
@@ -23,20 +23,15 @@
 		"coll2": "extract",
 		"size": 10
     },
-    "fields":{
-    	"projectname": true,
-		"area": true,
-		"projectcode": true,
-		"purchasinglist": false,
-		"package": true,
-		"winnerorder": true
-	},
     "es":{
     	"addr": "http://192.168.3.206:9800",
 	    "index": "bidding",
 	    "itype": "bidding",
 	    "pool": 12
     },
+    "fields":{
+        "projectname": true
+    },
     "biaozhu": {
         "common": [
         	{
@@ -92,69 +87,69 @@
         	{
                 "key": "publishtime",
                 "descript": "发布时间"
-            }, 
+            },
             {
                 "key": "bidendtime",
                 "descript": "投标截止日期"
-            }, 
+            },
             {
                 "key": "bidopentime",
                 "descript": "开标日期"
-            }, 
+            },
             {
                 "key": "bidopenaddress",
                 "descript": "开标地点"
-            }, 
+            },
             {
                 "key": "project_startdate",
                 "descript": "开工日期"
-            }, 
+            },
             {
                 "key": "project_completedate",
                 "descript": "竣工日期"
-            }, 
+            },
             {
                 "key": "project_duration",
                 "descript": "工期时长"
-            }, 
+            },
             {
                 "key": "project_timeunit",
                 "descript": "工期单位"
-            }, 
+            },
             {
                 "key": "projectperiod",
                 "descript": "项目周期(服务周期)"
-            }, 
+            },
             {
                 "key": "projectaddr",
                 "descript": "项目地址"
-            } 
+            }
         ],
         "purchasinglist": [
             {
                 "key": "itemname",
                 "descript": "产品名称"
-            }, 
+            },
             {
                 "key": "brandname",
                 "descript": "品牌"
-            }, 
+            },
             {
                 "key": "model",
                 "descript": "规格型号"
-            }, 
+            },
             {
                 "key": "unitname",
                 "descript": "单位"
-            }, 
+            },
             {
                 "key": "number",
                 "descript": "数量"
-            }, 
+            },
             {
                 "key": "unitprice",
                 "descript": "单价"
-            }, 
+            },
             {
                 "key": "totalprice",
                 "descript": "小计"

+ 13 - 1
src/front/front.go

@@ -3,6 +3,7 @@ package front
 import (
 	"github.com/shopspring/decimal"
 	"math"
+	"strconv"
 
 	//"container/list"
 	"fmt"
@@ -72,6 +73,7 @@ func getDetail(id, coll string) map[string]interface{} {
 	// 		info[k] = v
 	// 	}
 	// }
+	info["detail"] = qu.ObjToString(info["title"]) + "</br>" + qu.ObjToString(info["detail"])
 	info["_id"] = mgo.BsonIdToSId(info["_id"])
 	//ck_pclisext, _ := info["ck_pclisext"].(bool)
 	ck_pclistag, _ := info["ck_pclistag"].(bool)
@@ -141,6 +143,7 @@ func setOtherInfo(info map[string]interface{}) (result, moreArr []map[string]int
 		zbbArr := []map[string]interface{}{}
 		for _, tmp := range otherInfo {
 			tmpInfo := tmp.(map[string]interface{})
+			tmpInfo["detail"] = qu.ObjToString(tmpInfo["title"]) + "</br>" + qu.ObjToString(tmpInfo["title"])
 			toptype := tmpInfo["toptype"]
 			subtype := tmpInfo["subtype"]
 			ptime := ""
@@ -359,7 +362,7 @@ func setPaceMap(info map[string]interface{}) ([]map[string]interface{}, []string
 						if tmpMap["bidamount"] == nil {
 							bidamount = ""
 						} else {
-							bidamount = fmt.Sprint(tmpMap["bidamount"])
+							bidamount = strconv.FormatFloat(qu.Float64All(tmpMap["bidamount"]), 'f', -1, 64)
 						}
 						bid := map[string]interface{}{
 							"descript": "标段(包)中标金额",
@@ -506,6 +509,7 @@ func BzJBZD(content []interface{}, set, unset, errset map[string]interface{}) {
 						} else {
 							if key == "budget" || key == "bidamount" || key == "biddiscount" {
 								input = qu.Float64All(input)
+								//input, _ = strconv.ParseFloat(qu.ObjToString(input), 32)
 							}
 							if key == "subtype" {
 								if topsubtype := strings.Split(qu.ObjToString(input), "-"); len(topsubtype) == 2 {
@@ -594,6 +598,7 @@ func BzBDXX(content []interface{}, set, unset, errset map[string]interface{}, is
 						isNull = true
 					} else if key == "number" || key == "unitprice" || key == "totalprice" {
 						input = qu.Float64All(input)
+						//input, _ = strconv.ParseFloat(qu.ObjToString(input), 32)
 					}
 					if !isNull { //避免数字类型的字段在没有填写值的情况默认给0
 						result[key] = input
@@ -670,6 +675,7 @@ func BzDBXX(content []interface{}, set, unset, errset map[string]interface{}, is
 							isNull = true
 						} else if key == "bidamount" || key == "budget" {
 							input = qu.Float64All(input)
+							//input, _ = strconv.ParseFloat(qu.ObjToString(input), 32)
 						}
 					}
 					if key == "winner" {
@@ -773,6 +779,7 @@ func BzZBHXRXX(content []interface{}, set, unset, errset map[string]interface{},
 						isNull = true
 					} else if key == "price" {
 						input = qu.Float64All(input)
+						//input, _ = strconv.ParseFloat(qu.ObjToString(input), 32)
 					}
 					if !isNull { //避免数字类型的字段在没有填写值的情况默认给0
 						result[key] = input
@@ -826,6 +833,7 @@ func BzQYXX(content []interface{}, set, unset, errset map[string]interface{}) {
 								input = inputTmp.Unix()
 							} else if key == "bid_bond" || key == "contract_bond" || key == "supervisorrate" || key == "agencyrate" || key == "docamount" || key == "agencyfee" {
 								input = qu.Float64All(input)
+								//input, _ = strconv.ParseFloat(qu.ObjToString(input), 32)
 							}
 							set[key] = input
 						}
@@ -1009,6 +1017,7 @@ func GetDataById1(coll string, ids []string, stype string, tmp map[string]map[st
 			if id < util.BIDDINGSTARTID {
 				tmpBidColl = util.BidColl2 //bidding_back
 			}
+			qu.Debug(tmpBidColl, id)
 			bidData, _ := util.MgoB.FindById(tmpBidColl, id, nil)
 			if bidData != nil && len(*bidData) > 0 { //bidding表数据存在
 				//查询extract
@@ -1229,6 +1238,9 @@ func GetLabeler(coll string) (labeler []string) {
 // 计算百分比
 func CountPr(c1, c2 int) string {
 	decimal.DivisionPrecision = 2
+	if c1 == 0 || c2 == 0 {
+		return "0"
+	}
 	d := decimal.NewFromInt32(int32(c1)).Div(decimal.NewFromInt32(int32(c2))).Mul(decimal.NewFromInt32(100))
 	return d.String() + "%"
 }

+ 129 - 48
src/front/server.go

@@ -46,6 +46,8 @@ type Front struct {
 	reviewSave    xweb.Mapper `xweb:"/center/reviewsave"`
 	reviewStat	  xweb.Mapper `xweb:"/center/review/result"`
 	reviewNext	  xweb.Mapper `xweb:"/center/review/next"`
+
+	logout		  xweb.Mapper `xweb:"/front/logout"`
 }
 
 var preKey = "ck_"
@@ -100,8 +102,8 @@ func (i *Front) ListInfo() error {
 		queryfield := map[string]interface{}{
 			"$exists": !hasno,
 		}
+		numMap := map[string]interface{}{}
 		if field == "budget" || field == "bidamount" { //金额区间
-			numMap := map[string]interface{}{}
 			if min != "" {
 				minint := qu.IntAll(min)
 				numMap["$gte"] = minint
@@ -110,11 +112,22 @@ func (i *Front) ListInfo() error {
 				maxint := qu.IntAll(max)
 				numMap["$lte"] = maxint
 			}
-			if len(numMap) > 0 { //给定了区间,不再判断字段存在
-				queryfield = numMap
+			//if len(numMap) > 0 { //给定了区间,不再判断字段存在
+			//	queryfield = numMap
+			//}
+		}
+		if len(numMap) > 0 {
+			if !hasno {
+				query[field] = numMap
+			}else {
+				query["$or"] = []map[string]interface{}{
+					{field: queryfield},
+					{field: numMap},
+				}
 			}
+		}else {
+			query[field] = queryfield
 		}
-		query[field] = queryfield
 	}
 	if fieldScreen && notag {
 		query[preKey+field] = map[string]interface{}{
@@ -169,7 +182,6 @@ func (i *Front) CheckId() {
 	msg := ""
 	id := i.GetString("id")
 	coll := i.GetSession("coll").(string)
-	qu.Debug(coll, id)
 	if coll != "" {
 		exists, err := redis.Exists("extcheck", coll+"_"+id)
 		if err == nil {
@@ -264,15 +276,15 @@ func (i *Front) Biaozhu() error {
 	loginuser := i.GetSession("loginuser").(string)
 	coll := i.GetSession("coll").(string)
 	data, _ := util.MgoM.FindById(coll, _id, nil) //查询标注保存前的原始信息
-	modifyuser := qu.ObjToString((*data)["modifyuser"])
+	//modifyuser := qu.ObjToString((*data)["modifyuser"])
 	//标注多次操作处理
 	if len(set) > 0 { //set中为本次标注保存的数据(ck_bidopentime:1;ck_buyer:2;buyer:"XXX")
 		for s, sv := range set {
 			//特殊字段处理
-			if s == "ck_pclistag" && (*data)["ck_pclistag"] != nil {
-				delete(set, s)
-				continue
-			}
+			//if s == "ck_pclistag" && (*data)["ck_pclistag"] != nil {
+			//	delete(set, s)
+			//	continue
+			//}
 			//区分是标记字段,还是普通字段(标记字段:ck_buyer;普通字段:buyer)
 			if strings.HasPrefix(s, preKey) {
 				status := qu.IntAll(sv)                                        //标注字段状态
@@ -361,9 +373,7 @@ func (i *Front) Biaozhu() error {
 	if len(set) > 0 {
 		set["ck_data"] = stype
 		set["updatetime"] = time.Now().Unix()
-		if modifyuser == "" {
-			set["modifyuser"] = modifyuser
-		}
+		set["modifyuser"] = loginuser
 		update["$set"] = set
 	}
 	qu.Debug("unset---", unset)
@@ -376,6 +386,7 @@ func (i *Front) Biaozhu() error {
 		if b {
 			if coll != util.Config.Fromtable && isSaveMarked { //util.coll此时的标注表  util.Config.Fromtable默认标注表
 				data, _ := util.MgoM.FindById(coll, _id, nil)
+				delete(*data, "modifyuser")
 				if data != nil && len(*data) > 0 {
 					update := map[string]interface{}{"$set": *data}
 					if len(unset) > 0 {
@@ -413,7 +424,6 @@ func (i *Front) Detail(id string) error {
 	//	return i.Render("err.html", &i.T)
 	//}
 	query, _ := i.GetSession("query").(map[string]interface{})
-	qu.Debug(coll, query)
 	rep := getDetail(id, coll)          //获取本条公告的信息
 	i.T["otherInfo"] = rep["otherInfo"] //展示关联公告信息
 	i.T["moreInfo"] = rep["moreInfo"]   //更多关联公告信息
@@ -619,7 +629,7 @@ func (i *Front) ImportByEs() {
 		if int64(len(ids)) != escount {
 			msg = "查询数据和结果不一致"
 		} else { //入库
-			_, msg, successNum = GetDataById(coll, ids, "es", map[string]map[string]interface{}{})
+			_, msg, successNum = GetDataById1(coll, ids, "es", map[string]map[string]interface{}{})
 		}
 	} else {
 		msg = "无查询数据"
@@ -777,9 +787,10 @@ func (i *Front) Elist() error {
 func (i *Front) Review() error {
 	defer qu.Catch()
 	var labeler []map[string]interface{}
+	coll := i.GetString("coll")
 	sess := util.MgoM.GetMgoConn()
 	defer util.MgoM.DestoryMongoConn(sess)
-	sess.DB(util.MgoM.DbName).C(util.Config.Fromtable).Pipe([]map[string]interface{}{
+	sess.DB(util.MgoM.DbName).C(coll).Pipe([]map[string]interface{}{
 		//查询条件
 		{
 			"$match": bson.M{
@@ -799,31 +810,31 @@ func (i *Front) Review() error {
 		},
 	}).All(&labeler)
 
-	var maps []map[string]interface{}
-	maps = append(maps, map[string]interface{}{"title": ""})
+	var maps []string
+	maps = append(maps, "")
 	for k, v := range util.Config.Fields{
 		if v {
-			m := map[string]interface{}{"title": k}
-			maps = append(maps, m)
+			maps = append(maps, k)
 		}
 	}
-	maps = append(maps, map[string]interface{}{"title": "All"})
+	maps = append(maps, "全部数据")
 	i.T["fields"] = maps
 	i.T["users"] = labeler
+	i.T["coll"] = coll
 	return i.Render("review.html", &i.T)
 }
 
 func (i *Front) ReviewList() {
 	defer qu.Catch()
 	if i.Method() == "POST" {
+		coll := i.GetSession("coll").(string)
 		user := i.GetString("user")
 		q := make(map[string]interface{})
 		q["ck_data"] = bson.M{"$gte": 1}
 		if user != "0" && user != "-1"  {
 			q["modifyuser"] = user
 		}
-		qu.Debug(q, util.Config.Fromtable)
-		datas, b := util.MgoM.Find(util.Config.Fromtable, q, bson.M{"_id": 1}, nil, false, -1, -1)
+		datas, b := util.MgoM.Find(coll, q, bson.M{"_id": 1}, nil, false, -1, -1)
 		if b && len(*datas) > 0 {
 			i.ServeJson(map[string]interface{}{
 				"rep":  b,
@@ -957,10 +968,10 @@ func (i *Front) ReviewSave() error {
 	if len(set) > 0 { //set中为本次标注保存的数据(ck_bidopentime:1;ck_buyer:2;buyer:"XXX")
 		for s, sv := range set {
 			//特殊字段处理
-			if s == "ck_pclistag" && (*data)["ck_pclistag"] != nil {
-				delete(set, s)
-				continue
-			}
+			//if s == "ck_pclistag" && (*data)["ck_pclistag"] != nil {
+			//	delete(set, s)
+			//	continue
+			//}
 			//区分是标记字段,还是普通字段(标记字段:ck_buyer;普通字段:buyer)
 			if strings.HasPrefix(s, preKey) {
 				status := qu.IntAll(sv)                                        //标注字段状态
@@ -1035,7 +1046,7 @@ func (i *Front) ReviewSave() error {
 	if len(set) > 0 {
 		if len(set) > 1 {
 			set["updatetime"] = time.Now().Unix()
-			set["modifyuser"] = loginuser
+			//set["modifyuser"] = loginuser
 		}
 		update["$set"] = set
 	}
@@ -1085,8 +1096,10 @@ func (i *Front) ReviewStat() {
 	defer qu.Catch()
 	sess := util.MgoM.GetMgoConn()
 	defer util.MgoM.DestoryMongoConn(sess)
-	result := sess.DB(util.MgoM.DbName).C(util.Config.Fromtable).Find(nil).Iter()
-	count, cmark, rmark, rgmark := 0, 0, 0, 0		// 总数, 标注数量,	审核数据,	审核数据完全正确的数据量
+	coll := i.GetSession("coll").(string)
+	qu.Debug(coll)
+	result := sess.DB(util.MgoM.DbName).C(coll).Find(nil).Iter()
+	count, cmark, rmark, rgmark := 0, 0, 0, 0		// 总数, 标注数量,	审核数据量,	审核数据完全正确的数据量
 
 	cmaps := make(map[string]int)			// 标注字段整体准确率
 	umaps := make(map[string]interface{})	// 按人员 字段准确率
@@ -1097,8 +1110,17 @@ func (i *Front) ReviewStat() {
 	}
 	for tmp := make(map[string]interface{}); result.Next(&tmp); {
 		count ++
+		user := qu.ObjToString(tmp["modifyuser"])
 		if qu.IntAll(tmp["ck_data"]) >= 1 {
 			cmark ++
+			var up map[string]int
+			if umaps[user] == nil {
+				up = make(map[string]int)
+			}else {
+				up = umaps[user].(map[string]int)
+			}
+			up["ck_count"] += 1
+			umaps[user] = up
 		}
 		if qu.IntAll(tmp["re_data"]) > 0 {
 			rmark ++
@@ -1106,7 +1128,6 @@ func (i *Front) ReviewStat() {
 				remap, _ := reField["field"].(map[string]interface{})
 				flag := true			// 数据整体准确率
 				// 按人员统计字段准备率
-				user := qu.ObjToString(tmp["modifyuser"])
 				var up map[string]int
 				if umaps[user] == nil {
 					up = make(map[string]int)
@@ -1122,19 +1143,19 @@ func (i *Front) ReviewStat() {
 						flag = false
 					}
 				}
-				up["count"] += 1
+				up["re_count"] += 1
 				umaps[user] = up
 				if flag {
 					rgmark ++
-					up["rgmark_count"] += 1
+					up["re_rg_count"] += 1
 				}
 			}
 		}
 	}
 
-	qu.Debug("count:", count, ",cmark:", cmark, ",rmark:", rmark, ",rgmark:", rgmark)
-	qu.Debug(cmaps)
-	qu.Debug(umaps)
+	//qu.Debug("count:", count, ",cmark:", cmark, ",rmark:", rmark, ",rgmark:", rgmark)
+	//qu.Debug(cmaps)
+	//qu.Debug(umaps)
 	if rmark == 0 {
 		i.ServeJson(map[string]interface{}{"rep": false, "msg": "无质检审核数据!"})
 		return
@@ -1146,31 +1167,91 @@ func (i *Front) ReviewStat() {
 	id := util.MgoM.Save("review_result", save)
 	if id != "" {
 		// 前台页面数据
-		var dataSource [][]interface{}
-		var tmp []interface{}
-		tmp  = append(tmp, "全部")
+		dataSource := make(map[string]interface{})
+		var userSelect []string
+		var dataSelect []map[string]interface{}
+		userSelect = append(userSelect, "全部")
+		tmp := make(map[string]interface{})
+		tmp["name"] = "全部"
+		tmp["num1"] = cmark
+		tmp["num2"] = rmark
+		tmp["num3"] = rgmark
+		tmp["num4"] = CountPr(rgmark, rmark)
+		dataSelect = append(dataSelect, tmp)
 		for k, v := range util.Config.Fields{
 			if v {
-				tmp = append(tmp, CountPr(cmaps[k], rmark))
+				tmp1 := make(map[string]interface{})
+				tmp1["name"] = k
+				tmp1["num1"] = cmark
+				tmp1["num2"] = rmark
+				tmp1["num3"] = cmaps[k]
+				tmp1["num4"] = CountPr(cmaps[k], rmark)
+				dataSelect = append(dataSelect, tmp1)
 			}
 		}
-		tmp = append(tmp, CountPr(rgmark, rmark))
-		dataSource = append(dataSource, tmp)
+		dataSource["全部"] = dataSelect
 		for k1, v1 := range umaps{
 			if v2, o := v1.(map[string]int); o {
-				var tmp2 []interface{}
-				tmp2 = append(tmp2, k1)
+				userSelect = append(userSelect, k1)
+				var dataSelect1 []map[string]interface{}
+				tmp2 := make(map[string]interface{})
+				tmp2["name"] = "全部"
+				tmp2["num1"] = v2["ck_count"]
+				tmp2["num2"] = v2["re_count"]
+				tmp2["num3"] = v2["re_rg_count"]
+				tmp2["num4"] = CountPr(v2["re_rg_count"], v2["re_count"])
+				dataSelect1 = append(dataSelect1, tmp2)
 				for k, v := range util.Config.Fields{
 					if v {
-						tmp2 = append(tmp2, CountPr(v2[k], v2["count"]))
+						tmp1 := make(map[string]interface{})
+						tmp1["name"] = k
+						tmp1["num1"] = v2["ck_count"]
+						tmp1["num2"] = v2["re_count"]
+						tmp1["num3"] = v2[k]
+						tmp1["num4"] = CountPr(v2[k], v2["re_count"])
+						dataSelect1 = append(dataSelect1, tmp1)
 					}
 				}
-				tmp2 = append(tmp2, CountPr(v2["rgmark_count"], v2["count"]))
-				dataSource = append(dataSource, tmp2)
+				dataSource[k1] = dataSelect1
 			}
 		}
-		i.ServeJson(map[string]interface{}{"rep": true, "data": dataSource})
+		//var dataSource [][]string
+		//var tmp []string
+		//tmp  = append(tmp, "全部")
+		//for k, v := range util.Config.Fields{
+		//	if v {
+		//		str := fmt.Sprintf("抽查字段标注数据量:%d,</br>抽查字段标注正确数量:%d,</br>占比%s", rmark, cmaps[k], CountPr(cmaps[k], rmark))
+		//		tmp = append(tmp, str)
+		//	}
+		//}
+		//str := fmt.Sprintf("抽查标注数据量:%d,</br>抽查数据标注正确数量:%d,</br>占比%s", rmark, rgmark, CountPr(rgmark, rmark))
+		//tmp = append(tmp, str)
+		//dataSource = append(dataSource, tmp)
+		//for k1, v1 := range umaps{
+		//	if v2, o := v1.(map[string]int); o {
+		//		var tmp2 []string
+		//		tmp2 = append(tmp2, k1)
+		//		for k, v := range util.Config.Fields{
+		//			if v {
+		//				str := fmt.Sprintf("抽查字段标注数据量:%d,</br>抽查字段标注正确数量:%d,</br>占比%s", v2["count"], v2[k], CountPr(v2[k], v2["count"]))
+		//				tmp2 = append(tmp2, str)
+		//			}
+		//		}
+		//		str := fmt.Sprintf("抽查标注数据量:%d,</br>抽查数据标注正确数量:%d,</br>占比%s", v2["count"], v2["rgmark_count"], CountPr(v2["rgmark_count"], v2["count"]))
+		//		tmp2 = append(tmp2, str)
+		//		dataSource = append(dataSource, tmp2)
+		//	}
+		//}
+		i.ServeJson(map[string]interface{}{"rep": true, "data": map[string]interface{}{"tableData": dataSource, "userSelect": userSelect}})
 	}else {
 		i.ServeJson(map[string]interface{}{"rep": false, "msg": "统计失败!"})
 	}
+}
+
+func (i *Front) Logout() {
+	i.DelSession("user")
+	err := i.Redirect("/")
+	if err != nil {
+		return 
+	}
 }

+ 3 - 0
src/main.go

@@ -5,6 +5,7 @@ import (
 	//"crypto/md5"
 	//"encoding/hex"
 	_ "filter"
+	"fmt"
 	"front"
 	"log"
 
@@ -22,9 +23,11 @@ import (
 // 	h.Write([]byte(appid + t + secret))
 // 	return strings.ToUpper(hex.EncodeToString(h.Sum(nil)))
 // }
+
 func init() {
 	//log.Println(MD5("jynw166_fEs2021", "1617340065", "Tgb#8diO90L"))
 	//os.Exit(0)
+	qu.Debug(fmt.Sprint(9999999.0))
 	qu.ReadConfig(&util.Config)
 	util.InitConfig()
 	//redis

+ 2 - 2
src/util/config.go

@@ -72,8 +72,8 @@ func InitConfig() {
 		MongodbAddr: qu.ObjToString(bid["addr"]),
 		DbName:      qu.ObjToString(bid["db"]),
 		Size:        qu.IntAll(bid["size"]),
-		//UserName:    qu.ObjToString(bid["username"]),
-		//Password:    qu.ObjToString(bid["password"]),
+		UserName:    qu.ObjToString(bid["username"]),
+		Password:    qu.ObjToString(bid["password"]),
 	}
 	MgoB.InitPool()
 

+ 11 - 6
src/web/templates/detail.html

@@ -262,7 +262,7 @@
                                                     </div>
                                                     <div class="label" v-else :title="uin.input">
                                                         <span @click="goText(uin.title)">[[uin.title]]&nbsp;:&nbsp;</span>
-                                                        <input type="text" v-model="uin.input" @click="goText(uin.input)" @blur="focusFn(uin, oindex, index, uindex,two,one)">
+                                                        <input type="text" v-model="uin.input" @focus="goText(uin.input)" @click="goText(uin.input)" @blur="focusFn(uin, oindex, index, uindex,two,one)">
                                                         <div class="info-box">
                                                             <div :class="{default: uin.status == '-1'}" @click="setStatus(uin,'-1', two, one)"></div>
                                                             <div :class="{ok: uin.status == '1'}" @click="setStatus(uin,'1', two, one)"></div>
@@ -299,7 +299,7 @@
                                                             <div class="input-box" v-for="(threeUin,index) in three.uInput" :key="threeUin.title">
                                                                 <div class="label">
                                                                     <span @click="goText(threeUin.title)">[[threeUin.title]]&nbsp;:&nbsp;</span>
-                                                                    <input type="text" v-model="threeUin.input" @click="goText(threeUin.input)">
+                                                                    <input type="text" v-model="threeUin.input" @focus="goText(threeUin.input)" @click="goText(threeUin.input)">
                                                                     <div class="info-box">
                                                                         <div :class="{default: threeUin.status == '-1'}" @click="threeUin.status = '-1'"></div>
                                                                         <div :class="{ok: threeUin.status == '1'}" @click="threeUin.status = '1'"></div>
@@ -328,8 +328,8 @@
                 </div>
             </div>
             <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="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('', false)" style="width:100px">保存</button>&nbsp;&nbsp;-->
                 <button  class="code" @click.stop="openHref" style="width:100px">下一条</button>
@@ -357,7 +357,6 @@
 
 </body>
 <script>
-  console.log({{ .T.otherInfo }})
   var allCheckFields  = {{.T.fields}};//本次需标注的所有字段
   // 页面数据
   var pageDataMap = {
@@ -384,6 +383,7 @@
         return
       }
     }
+
     if(event.keyCode == 82){//项目名称快捷键r
       if(event.shiftKey){
         app.changeBaseValue(0, '', 2) //删除对应文本
@@ -736,6 +736,7 @@
                     title: '标的信息',
                     show: false,
                     showCheck: true,
+                    key: 'purchasinglist',
                     //checkType: {{.T.ck_pclisext}},
                     checkAllTag: {{.T.ck_pclistag}},
                     status: {{.T.ck_purchasinglist}},
@@ -745,6 +746,7 @@
                     title: '多包信息',
                     show: false,
                     showCheck: true,
+                    key: 'package',
                     //checkType: {{.T.ck_pkgisext}},
                     status: {{.T.ck_package}},
                     content: p_content
@@ -753,6 +755,7 @@
                     title: '中标候选人信息',
                     show: false,
                     showCheck: true,
+                    key: 'winnerorder',
                     //checkType: {{.T.ck_wodrisext}},
                     status: {{.T.ck_winnerorder}},
                     content: c_content
@@ -1234,10 +1237,11 @@
             upChange: function (stype) {
                 console.log(this.editData)
                 var noTagKey = [];
+                console.log(allCheckFields)
                 this.editData.filter(function (one) {
 <!--                   console.log("title---",one.title,one.status) -->
                   if(one.title == "标的信息"||one.title == "多包信息"||one.title == "中标候选人信息"){
-                    if(allCheckFields[one.title] && one.status == -1){
+                    if(allCheckFields[one.key] && one.status == -1){
                       noTagKey.push(one.title);
                     }
                   }else{
@@ -1250,6 +1254,7 @@
                     })
                   }
                 })
+                console.log(noTagKey)
                 if (noTagKey.length >0){
                   var fieldText = noTagKey.join(",");
                   fieldText = fieldText.replace(/\([^\)]*\)/g, "");

+ 16 - 19
src/web/templates/list.html

@@ -109,8 +109,13 @@
       </div>
   </div>
   <div style="background-color: #3c8dbc;text-align: right;">
-      <div style="text-align: right;text-align: right;" class="glyphicon glyphicon-user"></div>
-      <h3  onclick="editeuser()" style=" cursor:pointer;color: #FFFFFF;margin-top: 10px;margin-right: 15px;display: -webkit-inline-box;">{{session "loginuser"}}</h3>
+    <div style="display: inline-block;">
+        <div style="text-align: right;text-align: right;" class="glyphicon glyphicon-user"></div>
+        <h3 onclick="editeuser()" style="cursor:pointer;color: #FFFFFF;margin-top: 10px;margin-right: 15px;display:-webkit-inline-box;">{{session "loginuser"}}</h3>
+    </div>
+    <div style="display: inline-block;">
+        <a href="/front/logout"><span style="font-size: 18px; color:#FFFFFF; padding: 10px;margin-right: 15px">注销</span></a>
+    </div>
   </div>
   <div class="col-md-12" style="border-right: 1px double #EEEEEE;">
          <div style="padding:10px 0px 0px 0px">
@@ -137,18 +142,18 @@
                          <label class="checkbox-inline">类型:</label>
                          <select name="type" id="topsubtype" class="form-control">
                              <option value="-1">请选择</option>
-                             <!--<option value="trailer" {{if eq .T.type "notice"}}selected{{end}}>预告</option>
+                                  <!--<option value="trailer" {{if eq .T.type "notice"}}selected{{end}}>预告</option> -->
                              <option value="tender" {{if eq .T.type "tender"}}selected{{end}}>招标</option>
-                             <option value="bid" {{if eq .T.type "bid"}}selected{{end}}>结果</option>-->
+                             <option value="bid" {{if eq .T.type "bid"}}selected{{end}}>结果</option>
                          </select>
                      </div>
                      <div class="row-box">
                          <label class="checkbox-inline">字段:</label>
                          <select name="field" id="field" class="form-control">
                              <option value="-1">请选择</option>
-                             <!--<option value="trailer" {{if eq .T.type "notice"}}selected{{end}}>预告</option>
+<!--                              <option value="trailer" {{if eq .T.type "notice"}}selected{{end}}>预告</option> -->
                              <option value="tender" {{if eq .T.type "tender"}}selected{{end}}>招标</option>
-                             <option value="bid" {{if eq .T.type "bid"}}selected{{end}}>结果</option> -->
+                             <option value="bid" {{if eq .T.type "bid"}}selected{{end}}>结果</option>
                          </select>
                          <input type="input" name="minval" id="minval" style="display:none" class="form-control"
                                 value="{{.T.min}}" placeholder="最小值"/>
@@ -171,7 +176,7 @@
                      <button type="submit" style="display: none" class="btn btn-primary" id="submitForm"></button>
                      <div  class="btn btn-primary" style="margin-left: 15px" onclick="alertsync()">查看</div>
                     <div id="markedinit"  class="btn btn-primary" style="margin-left: 15px;display:none;" onclick="markedinit()">初始化marked</div>
-<!--                     <div  class="btn btn-primary" style="margin-left: 15px" onclick="syncmarked()">同步</div>-->
+<!--                     <div  class="btn btn-primary" style="margin-left: 15px" onclick="syncmarked()">同步</div>--> -->
                  </div>
              </form>
          </div>
@@ -203,14 +208,6 @@
             </div>
             <div class="r-c-box">
               <button class="btn btn-primary" style="margin-left: 17px;" onclick="updateinfo()">刷新</button>
-              {{if ge .T.role 2}}
-              <div class="r-c-box">
-                <label class="checkbox-inline" style="word-break: keep-all; margin: 0 20px;">人员筛选:</label>
-                <select name="type" id="labeler" onchange="changelabeler(this.value)" class="form-control">
-                   <option value="-1">请选择</option>
-                </select>
-              </div>
-              {{end}}
               <button class="btn btn-primary" style="margin-left: 50px;" onclick="skipReview()">数据质检</button>
             </div>
            
@@ -282,7 +279,7 @@ $(function(){
   if(fk=="budget"||fk=="bidamount"){
     $("#maxval").css("display","");
     $("#minval").css("display","");
-    $("#boexists").css("display","none");
+    $("#boexists").css("display","");
   }
   
   $("#field").change(function(){
@@ -291,11 +288,11 @@ $(function(){
     if($(this).val()=="bidamount"||$(this).val()=="budget"){
       $("#minval").css("display","");
       $("#maxval").css("display","");
-      $("#boexists").css("display","none");
+<!--       $("#boexists").css("display","none"); -->
     }else{
       $("#minval").css("display","none");
       $("#maxval").css("display","none");
-      $("#boexists").css("display","");
+<!--       $("#boexists").css("display",""); -->
     }
   });
   $("#fromtable").on('input propertychange', function(){
@@ -634,7 +631,7 @@ function changelabeler(labeler){
 }
 
 function skipReview() {
-    window.location.href="/center/review"
+    window.location.href="/center/review?coll="+$("#fromtable").val()
 }
 
 </script>

+ 1 - 1
src/web/templates/re_detail.html

@@ -299,7 +299,7 @@
                                                             <div class="input-box" v-for="(threeUin,index) in three.uInput" :key="threeUin.title">
                                                                 <div class="label">
                                                                     <span @click="goText(threeUin.title)">[[threeUin.title]]&nbsp;:&nbsp;</span>
-                                                                    <input type="text" v-model="threeUin.input" @click="goText(threeUin.input)">
+                                                                    <input type="text" v-model="threeUin.input" @focus="goText(threeUin.input)" @click="goText(threeUin.input)">
                                                                     <div class="info-box">
                                                                         <div :class="{default: threeUin.status == '-1'}" @click="threeUin.status = '-1'"></div>
                                                                         <div :class="{ok: threeUin.status == '1'}" @click="threeUin.status = '1'"></div>

+ 71 - 9
src/web/templates/review.html

@@ -16,10 +16,15 @@
     <link rel="stylesheet" href="/css/index.css">
     <link rel="stylesheet" href="/datatables.net-bs/css/dataTables.bootstrap.min.css">
 
-    <div style="background-color: #3c8dbc;text-align: right;">
+  <div style="background-color: #3c8dbc;text-align: right;">
+    <div style="display: inline-block;">
         <div style="text-align: right;text-align: right;" class="glyphicon glyphicon-user"></div>
-        <h3 style=" cursor:pointer;color: #FFFFFF;margin-top: 10px;margin-right: 15px;display: -webkit-inline-box;">{{session "loginuser"}}</h3>
+        <h3 onclick="editeuser()" style="cursor:pointer;color: #FFFFFF;margin-top: 10px;margin-right: 15px;display:-webkit-inline-box;">{{session "loginuser"}}</h3>
     </div>
+    <div style="display: inline-block;">
+        <a href="/front/logout"><span style="font-size: 18px; color:#FFFFFF; padding: 10px;margin-right: 15px">注销</span></a>
+    </div>
+  </div>
 
     <div class="col-md-12" style="border-right: 1px double #EEEEEE;">
         <form class="form-horizontal">
@@ -58,6 +63,7 @@
                         <tr>
                         <th>编号</th>
                         <th>标题</th>
+                        <th>标注人</th>
                         </tr>
                     </thead>
                 </table>
@@ -67,18 +73,38 @@
 
     <!-- 通用标签modal -->
     <div class="modal fade" id="modal-result" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
-        <div class="modal-dialog" style="width: 50%">
+        <div class="modal-dialog" style="width: 70%">
             <div class="modal-content">
                 <div class="modal-header">
                     <div class="modal-header">
                         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                         <div class="edit-form">
                             <div class="edit-info">
-                                <span class="info"><i class="fa fa-fw fa-tags fa-lg"></i>统计结果</span>
+                                <span class="info"><i class="fa fa-fw fa-lg"></i>统计结果</span>
+                            </div>
+                            <div class="form-group" style="display: flex;flex-direction: row;align-items: center;justify-content: flex-end;">
+                                <label class="col-sm-2 control-label" style="width: auto;padding: 0px;"><span style="color:red;">* </span>人员统计选择</label>
+                                <div class="col-sm-2">
+                                    <select name="type" id="review_user" class="form-control"></select>
+                                    <script>
+                                        $('#review_user').on('change', function () {
+                                            var name = $("#review_user option:selected").val()
+                                            $('#result').dataTable().fnClearTable();
+                                            $('#result').dataTable().fnAddData(dataResult[name]);
+                                        })
+                                    </script>
+                                </div>
                             </div>
                             <div class="content">
                                 <table id="result" class="table table-bordered">
                                     <thead>
+                                    <tr>
+                                        <th>名称</th>
+                                        <th>标注数量</th>
+                                        <th>抽查数量</th>
+                                        <th>抽查正确数量</th>
+                                        <th>正确占比</th>
+                                    </tr>
                                     </thead>
                                 </table>
                             </div>
@@ -93,7 +119,24 @@
 <body>
 
 <script>
-    var fields = {{ .T.fields }}
+    var dataResult = {}
+    var coll = {{ .T.coll }}
+//     function createHeaderHTML (columns) {
+//         var htmlArr = []
+//         var rowsArr = []
+//         columns.forEach(function (row, rowIndex) {
+//             if (rowIndex === 0) {
+//                 th = '<th></th>'
+//             } else {
+//                 th = '<th>' + row + '</th>'
+//             }
+//             rowsArr.push(th)
+//         })
+//         var html = '<tr>' + rowsArr.join('') + '</tr>'
+//         htmlArr.push(html)
+//         return htmlArr.join('')
+//     }
+//     $('#result thead').html(createHeaderHTML(fields))
     var reFlag = false          // 结果统计标记
     $(document).ready(function () {
         $("#user").append("<option value=-1>请选择</option>")
@@ -135,6 +178,14 @@
                             tmp = '<a style="display: inline-block;cursor:pointer;font-size:18px;color: #428bca" onclick="skipDetail(\''+row._id+'\')">'+val+'</a>'
                         }
                         return tmp
+                }},
+                {"data": "modifyuser", width: "2%", render: function (val, a, row) {
+                        if (row["re_data"] == 1) {
+                            tmp = '<a style="display: inline-block;cursor:pointer;font-size:18px;color: green" onclick="skipDetail(\''+row._id+'\')">'+val+'</a>'
+                        }else {
+                            tmp = '<a style="display: inline-block;cursor:pointer;font-size:18px;color: #428bca" onclick="skipDetail(\''+row._id+'\')">'+val+'</a>'
+                        }
+                        return tmp
                 }}
             ],
         });
@@ -142,7 +193,7 @@
         $.ajax({
             url:"/center/reviewlist",
             type:"post",
-            data:{"user": "-1"},
+            data:{"user": "-1", "coll": coll},
             success:function(r){
                 if (r.rep) {
                     $('#dataTable').dataTable().fnClearTable();
@@ -158,14 +209,19 @@
             "ordering": false,
             "autoWidth": false,
             "serverSide": false,
-            "columns": fields,
+            "columns": [
+                {"data": "name"},
+                {"data": "num1"},
+                {"data": "num2"},
+                {"data": "num3"},
+                {"data": "num4"}
+            ],
             "language": {
                 "url": "/dataTables.chinese.lang"
             }
         });
     });
     function findData() {
-
         var name = $("#user option:selected").val()
         $.ajax({
             url:"/center/reviewlist",
@@ -196,8 +252,14 @@
            if (r.rep) {
                    reFlag = true
                    $("#modal-result").modal("show");
+                   console.log(r.data)
+                   dataResult = r.data.tableData
+
+                   for(i in r.data.userSelect){
+                       $("#review_user").append("<option value='"+r.data.userSelect[i]+"'>"+r.data.userSelect[i]+"</option>")
+                   }
                    $('#result').dataTable().fnClearTable();
-                   $('#result').dataTable().fnAddData(r.data);
+                   $('#result').dataTable().fnAddData(dataResult["全部"]);
                }else {
                    alert(r.msg)
                }