maxiaoshan 4 年之前
父節點
當前提交
21d65f905d

+ 29 - 16
src/config.json

@@ -1,14 +1,13 @@
 {
     "port": "5111",
-    "dbaddress": "192.168.3.166:27082",
-    "dbname": "chenmz",
+    "dbaddress": "192.168.3.207:27092",
+    "dbname": "mxs",
     "size": 10,
-    "redis": "extcheck=192.168.3.207:2679",
-    "fromtable": "bidding",
-    "totablel": "extcheck",
+    "fromtable": "marked",
+    "totablel": "errdata",
     "bidding":{
     	"addr":"192.168.3.207:27092",
-		"db": "qfw",
+		"db": "mxs",
 		"coll1": "bidding",
 		"coll2": "bidding_back",
 		"size": 10,
@@ -17,7 +16,7 @@
     },
     "extract":{
     	"addr": "192.168.3.207:27092",
-		"db": "qfw",
+		"db": "mxs",
 		"coll1": "extract",
 		"coll2": "extract",
 		"size": 10
@@ -48,7 +47,7 @@
             },
             {
                 "key": "subtype",
-                "descript": "公告二级"
+                "descript": "公告类别"
             },
             {
                 "key": "district",
@@ -74,6 +73,11 @@
                 "key": "buyer",
                 "descript": "采购单位"
             },
+            {
+                "key": "buyerclass",
+                "descript": "类型"
+               
+            },
             {
                 "key": "buyerperson",
                 "descript": "采购联系人"
@@ -90,11 +94,6 @@
                 "key": "buyerzipcode",
                 "descript": "采购邮编"
             },
-            {
-                "key": "",
-                "descript": ""
-               
-            },
             {
                 "key": "agency",
                 "descript": "代理机构"
@@ -309,7 +308,7 @@
                 "descript": "费率、折扣类报价"
             },
             {
-                "key": "agency_rate",
+                "key": "agencyrate",
                 "descript": "招标代理费率(中标服务费率)"
             },
             {
@@ -317,11 +316,11 @@
                 "descript": "招标文件购买金额"
             },
             {
-                "key": "agency_fee",
+                "key": "agencyfee",
                 "descript": "招标代理费(中标服务费)"
             },
             {
-                "key": "bidmode",
+                "key": "bidway",
                 "descript": "投标方式"
             },
             {
@@ -347,5 +346,19 @@
 		"招标": ["变更","邀标","询价","竞谈","单一","竞价","招标","其它"],
 		"结果": ["废标","流标","结果变更","中标","成交","其它"],
 		"其它": ["合同","验收","违规","其它"]
+	},
+	"customerfield":{
+		"剑鱼标讯地址": "jybyhref",
+		"剑鱼地址": "jybyhref",
+		"行业": "buyer_type",
+		"行业归属": "buyer_type",
+		"采购方式": "bidtype",
+		"项目标识": "projectId",
+		"中标人模型": "winner_type",
+		"中标类型": "winner_style",
+		"标签": "tagname",
+		"附加词": "tagname",
+		"信息匹配词": "matchkey",
+		"附件": "filetext"
 	}
 }

+ 373 - 133
src/front/front.go

@@ -2,15 +2,16 @@
 package front
 
 import (
-	"container/list"
+	//"container/list"
 	"encoding/json"
 	"fmt"
 	"io/ioutil"
 	qu "qfw/util"
+	"sync/atomic"
 
 	//"qfw/util/mongodb"
 	mgo "mongodb"
-	"qfw/util/redis"
+	//"qfw/util/redis"
 	"sort"
 	"strings"
 	"sync"
@@ -25,7 +26,7 @@ import (
 
 type Front struct {
 	*xweb.Action
-	index xweb.Mapper `xweb:"/"`
+	//index xweb.Mapper `xweb:"/"`
 	// pack          xweb.Mapper `xweb:"/package"`
 	listInfo      xweb.Mapper `xweb:"/list"`
 	elist         xweb.Mapper `xweb:"/elist"`
@@ -35,16 +36,17 @@ type Front struct {
 	importByExcel xweb.Mapper `xweb:"/importbyexcel"`
 	importByEs    xweb.Mapper `xweb:"/importbyes"`
 	getEsCount    xweb.Mapper `xweb:"/getescount"`
+	finishCheck   xweb.Mapper `xweb:"/finishcheck"`
 }
 
-var IdList *list.List //所有数据
+//var IdList *list.List //所有数据
 //var IdPackList *list.List //含有分包的数据
 var preKey = "ck_"
 var preErr = "err_"
 var SE = qu.SimpleEncrypt{Key: "topJYBX2019"}
 var Max, Min string
-
-const BIDDINGID = "5a862f0640d2d9bbe88e3cec" //bidding表最小id
+var HasNo bool                       //预算和中标金额是否存在标记
+var QueryFind map[string]interface{} //查询
 
 /*
 	status
@@ -54,6 +56,7 @@ const BIDDINGID = "5a862f0640d2d9bbe88e3cec" //bidding表最小id
 		3:修改
 		4:删除
 */
+/**
 //查询初始化的数据
 func (i *Front) Index() error {
 	_id := ""
@@ -90,9 +93,9 @@ func (i *Front) Index() error {
 	i.T["worder"] = rep["worder"]
 	i.T["packs"] = rep["packs"]
 	i.T["packskey"] = rep["packskey"]
-	i.T["pcl_isext"] = rep["pcl_isext"]
-	i.T["wodr_isext"] = rep["wodr_isext"]
-	i.T["pkg_isext"] = rep["pkg_isext"]
+	i.T["ck_pclisext"] = rep["ck_pclisext"]
+	i.T["ck_wodrisext"] = rep["ck_wodrisext"]
+	i.T["ck_pkgisext"] = rep["ck_pkgisext"]
 	i.T["timeplace"] = rep["timeplace"]
 	i.T["purchasinglist"] = rep["purchasinglist"]
 	i.T["other"] = rep["other"]
@@ -109,7 +112,7 @@ func (i *Front) Index() error {
 
 	return i.Render("detail.html", &i.T)
 }
-
+*/
 //列表
 func (i *Front) ListInfo() error {
 	spidercode := i.GetString("spidercode")
@@ -118,7 +121,11 @@ func (i *Front) ListInfo() error {
 	stype := i.GetString("type")
 	Min = i.GetString("minval")
 	Max = i.GetString("maxval")
-
+	HasNo, _ = i.GetBool("hasno")
+	pagenum, _ := i.GetInteger("pagenum")
+	if pagenum == 0 {
+		pagenum = 1
+	}
 	if coll != "" { //指定表
 		util.Coll = coll
 	}
@@ -128,24 +135,29 @@ func (i *Front) ListInfo() error {
 	if field == "" {
 		field = "-1"
 	}
-	listData := getListInfo(spidercode, stype, field)
-	if len(listData) > 0 { //每次查询更新内存中标注数据
-		IdList = list.New()
-		for _, v := range listData {
-			IdList.PushBack(mgo.BsonIdToSId(v["_id"]))
-		}
-	}
+	listData := getListInfo(spidercode, stype, field, pagenum)
+	//if len(listData) > 0 { //每次查询更新内存中标注数据
+	//	IdList = list.New()
+	//	for _, v := range listData {
+	//		IdList.PushBack(mgo.BsonIdToSId(v["_id"]))
+	//	}
+	//}
 	i.T["list"] = listData
 	i.T["type"] = stype
 	i.T["field"] = field
 	i.T["spidercode"] = spidercode
 	i.T["coll"] = coll
 	i.T["topsubtype"] = util.TopSubStypeArr
-	i.T["allfield"] = util.AllField
+	i.T["allfield"] = util.AllFieldArr
 	i.T["fromtable"] = util.Coll
 	i.T["dbname"] = util.Config.Dbname
 	i.T["max"] = Max
 	i.T["min"] = Min
+	i.T["hasno"] = HasNo
+	checkedNum, allNum := GetCheckedAndAllDataInfo() //已标和总数信息
+	i.T["checkednum"] = checkedNum
+	i.T["allnum"] = allNum
+	i.T["pagenum"] = pagenum
 	return i.Render("list.html", &i.T)
 }
 
@@ -170,6 +182,7 @@ func (i *Front) Biaozhu() error {
 	//ispackage := i.GetString("ispackage")
 	key := i.GetString("key")
 	_id := i.GetString("_id")
+	stype, _ := i.GetInteger("stype")
 	err := json.Unmarshal([]byte(key), &obj)
 	if err != nil {
 		i.ServeJson(b)
@@ -233,9 +246,61 @@ func (i *Front) Biaozhu() error {
 	// qu.Debug("errset---", errset)
 	// qu.Debug("set---", set)
 	// qu.Debug("unset---", unset)
+	unerrset := map[string]interface{}{} //记录errdata错误信息表删除
+	data, _ := util.MgoM.FindById(util.Coll, _id, nil)
+	//标注误操作处理
+	if len(set) > 0 { //set中为本次标注保存的数据(ck_bidopentime:1;ck_buyer:2;buyer:"XXX")
+		for s, sv := range set {
+			//区分是标记字段,还是普通字段(标记字段:ck_buyer;普通字段:buyer)
+			if strings.HasPrefix(s, preKey) { //标记字段
+				status := qu.IntAll(sv)
+				field := s[3:] //去除前缀,获得字段
+				if s == preKey+"package" || s == preKey+"purchasinglist" || s == preKey+"winnerorder" {
+					if (*data)[s] != nil { //package、purchasinglist、winnerorder已标注,不再修改
+						delete(set, s)
+						delete(set, field)
+						continue
+					}
+				}
+				if set[field] == nil && status != 4 { //表示该字段没有要修改的值,此时标记为1或4(亦或是ck_wodrisext;ck_pkgisext;ck_pclisext)
+					continue
+				} else { //此时有修改的值和标记2、3、4
+					if checkedStatus := qu.IntAll((*data)[s]); checkedStatus != 0 { //已有标注信息的状态
+						if status == 2 && checkedStatus == 4 { //4>2,errdata删除,marked新增该字段,标记变为1
+							unerrset[field] = ""
+							set[s] = 1
+						} else if status == 3 {
+							if checkedStatus == 2 { //2>3,marked 修改该字段,标记变为2
+								set[s] = 2
+							} else if checkedStatus == 3 { //3>3,对比errdata错误值:相等变为1,errdata删除;不等变为3,marked修改该字段
+								errdata, _ := util.MgoM.FindById(util.Config.Totablel, _id, `{"`+field+`":1}`)
+								if errdata != nil && len(*errdata) != 0 {
+									errText := fmt.Sprint((*errdata)[field])
+									text := fmt.Sprint(set[field])
+									if errText == text {
+										set[s] = 1
+										unerrset[field] = ""
+									}
+								}
+							}
+						} else if status == 4 {
+							if checkedStatus == 2 { //2>4,errdata删除,marked删除该字段,标记变为1
+								unerrset[field] = ""
+								set[s] = 1
+								unset[field] = ""
+							} else if checkedStatus == 3 { //3>4,marked删除该字段,标记变为4
+								set[s] = 4
+								unset[field] = ""
+							}
+						}
+					}
+				}
+			}
+		}
+	}
 	//存储原错误信息
+	errUpdata := map[string]interface{}{}
 	if len(errset) > 0 {
-		data, _ := util.MgoM.FindById(util.Coll, _id, nil)
 		for f, v := range errset {
 			if (*data)[preKey+f] != nil { //已标注保存过不再记录错误信息
 				delete(errset, f)
@@ -279,35 +344,52 @@ func (i *Front) Biaozhu() error {
 			}
 		}
 		if len(errset) > 0 {
-			util.MgoM.Update(util.Config.Totablel, `{"_id":"`+_id+`"}`, map[string]interface{}{"$set": errset}, true, false)
+			//qu.Debug("errset---", errset)
+			errUpdata["$set"] = errset
 		}
 	}
+	if len(unerrset) > 0 {
+		//qu.Debug("unerrset---", unerrset)
+		errUpdata["$unset"] = unerrset
+	}
+	if len(errUpdata) > 0 {
+		util.MgoM.Update(util.Config.Totablel, `{"_id":"`+_id+`"}`, errUpdata, true, false)
+	}
+	//qu.Debug("set---", set)
 	//更新正确信息
 	update := map[string]interface{}{}
 	if len(set) > 0 {
+		set["ck_data"] = stype
 		update["$set"] = set
 	}
 	if len(unset) > 0 {
 		update["$unset"] = unset
 	}
-	b = util.MgoM.Update(util.Coll, `{"_id":"`+_id+`"}`, update, false, false)
-	if b {
-		for e := IdList.Front(); e != nil; e = e.Next() { //遍历IdList,删除元素
-			if _id == qu.ObjToString(e.Value) {
-				IdList.Remove(e)
-				break
-			}
-		}
-		if util.Coll != util.Config.Fromtable && isSaveMarked { //util.coll此时的标注表  util.Config.Fromtable默认标注表
-			data, _ := util.MgoM.FindById(util.Coll, _id, nil)
-			if data != nil && len(*data) > 0 {
-				if !util.MgoM.Update(util.Config.Fromtable, map[string]interface{}{"_id": (*data)["_id"]}, map[string]interface{}{"$set": *data}, true, false) {
-					qu.Debug("同步marked失败,", _id)
+	if len(update) > 0 {
+		b = util.MgoM.Update(util.Coll, `{"_id":"`+_id+`"}`, update, false, false)
+		if b {
+			//for e := IdList.Front(); e != nil; e = e.Next() { //遍历IdList,删除元素
+			//	if _id == qu.ObjToString(e.Value) {
+			//		IdList.Remove(e)
+			//		break
+			//	}
+			//}
+			if util.Coll != util.Config.Fromtable && isSaveMarked { //util.coll此时的标注表  util.Config.Fromtable默认标注表
+				data, _ := util.MgoM.FindById(util.Coll, _id, nil)
+				if data != nil && len(*data) > 0 {
+					update := map[string]interface{}{"$set": *data}
+					if len(unset) > 0 {
+						update["$unset"] = unset
+					}
+					if !util.MgoM.Update(util.Config.Fromtable, map[string]interface{}{"_id": (*data)["_id"]}, update, true, false) {
+						qu.Debug("同步marked失败,", _id)
+					}
 				}
 			}
 		}
+		i.ServeJson(b)
 	}
-	i.ServeJson(b)
+
 	return nil
 }
 
@@ -320,9 +402,9 @@ func (i *Front) Detail(id string) error {
 	i.T["worder"] = rep["worder"]
 	i.T["packs"] = rep["packs"]
 	i.T["packskey"] = rep["packskey"]
-	i.T["pcl_isext"] = rep["pcl_isext"]
-	i.T["wodr_isext"] = rep["wodr_isext"]
-	i.T["pkg_isext"] = rep["pkg_isext"]
+	i.T["ck_pclisext"] = rep["ck_pclisext"]
+	i.T["ck_wodrisext"] = rep["ck_wodrisext"]
+	i.T["ck_pkgisext"] = rep["ck_pkgisext"]
 	i.T["timeplace"] = rep["timeplace"]
 	i.T["purchasinglist"] = rep["purchasinglist"]
 	i.T["other"] = rep["other"]
@@ -335,17 +417,23 @@ func (i *Front) Detail(id string) error {
 	i.T["worder_new"] = rep["worder_new"]
 	i.T["pcl_new"] = rep["pcl_new"]
 	i.T["pkg_new"] = rep["pkg_new"]
+	i.T["nextid"] = GetNextDataId(id)                //下一条id
+	checkedNum, allNum := GetCheckedAndAllDataInfo() //已标和总数信息
+	i.T["checkednum"] = checkedNum
+	i.T["allnum"] = allNum
 	return i.Render("detail.html", &i.T)
 }
 
 //通过excel表格导入
 func (i *Front) ImportByExcel() {
 	defer qu.Catch()
-	success := false
+	//success := false
 	msg := ""
+	importNum := 0
+	successNum := int64(0)
 	coll := i.GetString("excelcoll")
 	if coll == "" {
-		i.ServeJson(map[string]interface{}{"success": success, "msg": "表名错误"})
+		i.ServeJson(map[string]interface{}{"msg": "表名错误"})
 		return
 	}
 	mf, _, err := i.GetFile("xlsx")
@@ -356,28 +444,46 @@ func (i *Front) ImportByExcel() {
 		rows := sheet.Rows
 		idcolnum := -1
 		ids := []string{}
-		for i, row := range rows {
-			if i == 0 {
+		cellFieldName := map[int]string{}             //记录客户需求字段所在的列
+		tmpMap := map[string]map[string]interface{}{} //excel表中需要保存字段集合
+		for rn, row := range rows {
+			if rn == 0 {
 				for j, cell := range row.Cells {
-					if cell.Value == "唯一标识" {
+					val := cell.Value
+					if fieldName := util.Config.CustomerField[val]; fieldName != "" { //客户需求字段
+						cellFieldName[j] = fieldName
+					}
+					if val == "唯一标识" || val == "信息标识" { //id所在列
 						idcolnum = j
-						break
 					}
 				}
+				if idcolnum == -1 {
+					break
+				}
 				continue
 			}
-			if idcolnum == -1 {
-				success = false
+			if len(row.Cells) != len(rows[0].Cells) {
+				break
+			}
+			tmp := map[string]interface{}{}
+			for j, f := range cellFieldName {
+				tmp[f] = row.Cells[j].Value
+			}
+			id := row.Cells[idcolnum].String() //加密的id
+			if id == "" {
 				break
 			}
-			id := row.Cells[idcolnum].String()
-			ids = append(ids, SE.DecodeString(id))
+			id = SE.DecodeString(id) //解密后id
+			tmpMap[id] = tmp
+			ids = append(ids, id)
 		}
-		if len(ids) > 0 {
-			success, msg = GetDataById(coll, ids, "excel")
+		importNum = len(ids) //excel表数据个数
+		if importNum > 0 {
+			_, msg, successNum = GetDataById(coll, ids, "excel", tmpMap)
 		}
 	}
-	i.ServeJson(map[string]interface{}{"success": success, "msg": msg})
+	msg = fmt.Sprintf("共查询%d条,导入成功%d条\n", importNum, successNum) + msg
+	i.ServeJson(map[string]interface{}{"msg": msg})
 }
 
 func (i *Front) GetEsCount() {
@@ -397,12 +503,13 @@ func (i *Front) GetEsCount() {
 //通过es语句导入
 func (i *Front) ImportByEs() {
 	defer qu.Catch()
-	success := false
+	//success := false
 	msg := ""
+	successNum := int64(0)
 	estext := i.GetString("estext") //es查询语句
 	coll := i.GetString("coll")     //导入表
 	if coll == "" {
-		i.ServeJson(map[string]interface{}{"success": success, "msg": "表名错误"})
+		i.ServeJson(map[string]interface{}{"msg": "表名错误"})
 		return
 	}
 	client := util.Es.GetEsConn()
@@ -433,7 +540,6 @@ func (i *Front) ImportByEs() {
 				searchResult, err := client.Scroll(util.Index).Size(200).ScrollId(scrollId).Do() //查询
 				if err != nil {
 					if err.Error() == "EOS" { //迭代完毕
-						success = true
 						qu.Debug("Es Search Data Over:", err)
 					} else {
 						qu.Debug("Es Search Data Error:", err)
@@ -473,15 +579,15 @@ func (i *Front) ImportByEs() {
 		}
 		//判断数量
 		if int64(len(ids)) != escount {
-			success = false
 			msg = "查询数据和结果不一致"
 		} else { //入库
-			success, msg = GetDataById(coll, ids, "es")
+			_, msg, successNum = GetDataById(coll, ids, "es", map[string]map[string]interface{}{})
 		}
 	} else {
 		msg = "无查询数据"
 	}
-	i.ServeJson(map[string]interface{}{"success": success, "msg": msg})
+	msg = fmt.Sprintf("共查询%d条,导入成功%d条\n", escount, successNum) + msg
+	i.ServeJson(map[string]interface{}{"msg": msg})
 }
 
 //统计抽查
@@ -543,21 +649,32 @@ func (i *Front) Tj() error {
 	return i.Render("tj.html", &i.T)
 }
 
+//标注完成
+func (i *Front) FinishCheck() {
+	i.Render("finish.html")
+}
+
 //查询列表数据
-func getListInfo(spidercode, stype, field string) []map[string]interface{} {
-	query := map[string]interface{}{}
+func getListInfo(spidercode, stype, field string, currentpage int) []map[string]interface{} {
+	QueryFind = map[string]interface{}{}
 	if spidercode != "" {
-		query["spidercode"] = spidercode
+		QueryFind["spidercode"] = spidercode
 	}
 	if stype != "-1" && stype != "" {
-		subtype := strings.Split(stype, "-")[1]
-		query["subtype"] = subtype
+		if stype == util.SPECIALTYPE {
+			QueryFind["subtype"] = map[string]interface{}{
+				"$exists": false,
+			}
+		} else {
+			subtype := strings.Split(stype, "-")[1]
+			QueryFind["subtype"] = subtype
+		}
 	}
 	if field != "-1" && field != "" {
-		query[field] = map[string]interface{}{
-			"$exists": true, //字段存在
-		}
-		query[preKey+field] = map[string]interface{}{
+		//query[field] = map[string]interface{}{
+		//	"$exists": true, //字段存在
+		//}
+		QueryFind[preKey+field] = map[string]interface{}{
 			"$exists": false, //field未曾标记
 		}
 		if field == "budget" || field == "bidamount" { //金额区间
@@ -570,32 +687,43 @@ func getListInfo(spidercode, stype, field string) []map[string]interface{} {
 				maxint := qu.IntAll(Max)
 				numMap["$lte"] = maxint
 			}
-			if len(numMap) > 0 { //给定了区间,查询此区间或者budget、bidamount不存在的数据
-				//query[field] = numMap
-				delete(query, field)
-				query["$or"] = []interface{}{
-					map[string]interface{}{
-						field: map[string]interface{}{
-							"$exists": false,
-						},
+			queryArr := []interface{}{}
+			if HasNo { //包含field不存在的数据
+				queryArr = append(queryArr, map[string]interface{}{
+					field: map[string]interface{}{
+						"$exists": false,
 					},
-					map[string]interface{}{
-						field: numMap,
-					},
-				}
+				})
 			}
-
+			if len(numMap) > 0 { //给定了区间,查询此区间或者budget、bidamount不存在的数据
+				queryArr = append(queryArr, map[string]interface{}{
+					field: numMap,
+				})
+			}
+			if len(queryArr) > 0 {
+				QueryFind["$or"] = queryArr
+			}
+		} else {
+			HasNo = false //当字段不是budget、bidamount时,HasNo改为false,仅作用于页面展示
 		}
 	}
-	qu.Debug("query:", util.Coll, query)
-	infoList, _ := util.MgoM.Find(util.Coll, query, nil, `{"_id":1,"title":1,"detail":1,"site":1,"href":1}`, false, 0, 50)
+	qu.Debug("query:", util.Coll, QueryFind)
+	start := (currentpage - 1) * 50
+	infoList, _ := util.MgoM.Find(util.Coll, QueryFind, `{"_id":1}`, `{"_id":1,"title":1,"detail":1,"site":1,"href":1,"ck_data":1}`, false, start, 50)
 	for k, v := range *infoList {
+		ck_data := qu.IntAll(v["ck_data"])
+		if ck_data > 0 {
+			v["checked"] = true
+		} else {
+			v["checked"] = false
+		}
 		href := fmt.Sprint(v["href"])
 		if !strings.HasPrefix(href, "http") {
 			v["href"] = "http://" + href
 		}
 		v["_id"] = mgo.BsonIdToSId(v["_id"])
 		(*infoList)[k] = v
+		v["num"] = k + 1 + start
 	}
 	return *infoList
 }
@@ -611,12 +739,12 @@ func getDetail(id string) map[string]interface{} {
 	// 	}
 	// }
 	info["_id"] = mgo.BsonIdToSId(info["_id"])
-	pcl_isext, _ := info["pcl_isext"].(bool)
-	wodr_isext, _ := info["wodr_isext"].(bool)
-	pkg_isext, _ := info["pkg_isext"].(bool)
-	rep["pcl_isext"] = pcl_isext
-	rep["wodr_isext"] = wodr_isext
-	rep["pkg_isext"] = pkg_isext
+	ck_pclisext, _ := info["ck_pclisext"].(bool)
+	ck_wodrisext, _ := info["ck_wodrisext"].(bool)
+	ck_pkgisext, _ := info["ck_pkgisext"].(bool)
+	rep["ck_pclisext"] = ck_pclisext
+	rep["ck_wodrisext"] = ck_wodrisext
+	rep["ck_pkgisext"] = ck_pkgisext
 	href := qu.ObjToString(info["href"])
 	if !strings.HasPrefix(href, "http") {
 		info["href"] = "http://" + href
@@ -667,7 +795,7 @@ func setWorderMap(info map[string]interface{}) ([]interface{}, []bool) {
 	if tmpwds, ok := info["winnerorder"].([]interface{}); ok {
 		for _, v := range tmpwds {
 			if wd, ok := v.(map[string]interface{}); ok {
-				isNew, _ := wd["isnew"].(bool)
+				isNew, _ := wd["ck_isnew"].(bool)
 				isNewWorder = append(isNewWorder, isNew)
 				wds := []interface{}{}
 				for _, cp := range winnerorder {
@@ -699,7 +827,7 @@ func setPurchasingMap(info map[string]interface{}) ([]interface{}, []bool) {
 	if tmpcls, ok := info["purchasinglist"].([]interface{}); ok {
 		for _, v := range tmpcls {
 			if pcl, ok := v.(map[string]interface{}); ok {
-				isNew, _ := pcl["isnew"].(bool)
+				isNew, _ := pcl["ck_isnew"].(bool)
 				isNewPcl = append(isNewPcl, isNew)
 				pcls := []interface{}{}
 				for _, ps := range purchasinglist {
@@ -737,7 +865,7 @@ func setPaceMap(info map[string]interface{}) ([]map[string]interface{}, []string
 	if packages, ok := info["package"].(map[string]interface{}); ok && len(packages) > 0 {
 		for k, tmpackage := range packages { //遍历分包
 			if tmppack, ok := tmpackage.(map[string]interface{}); ok {
-				isNew, _ := tmppack["isnew"].(bool)
+				isNew, _ := tmppack["ck_isnew"].(bool)
 				isNewPkg[k] = isNew
 				sortpackskey = append(sortpackskey, k)
 				pack := []interface{}{}
@@ -920,15 +1048,20 @@ func BzBDXX(content []interface{}, set, unset, errset map[string]interface{}, is
 	if status == -1 {
 		return
 	}
-	set["pcl_isext"] = isext //标的信息是否抽取标记
+	set["ck_pclisext"] = isext //标的信息是否抽取标记
 	purchasinglist := []interface{}{}
 	errList := []interface{}{}
+	delpclson := 0
 	for _, con := range content {
 		info, _ := con.(map[string]interface{})
-		isNew, _ := info["isNew"].(bool) //是否是新增子包
+		isNew, _ := info["ck_isnew"].(bool) //是否是新增子包
+		pclSonStatus := qu.IntAll(info["status"])
+		if pclSonStatus == 4 {
+			delpclson++
+		}
 		if uInputs, ok := info["uInput"].([]interface{}); ok {
 			result := map[string]interface{}{
-				"isnew": isNew,
+				"ck_isnew": isNew,
 			}
 			errResult := map[string]interface{}{}
 			for _, tmp := range uInputs {
@@ -936,24 +1069,32 @@ func BzBDXX(content []interface{}, set, unset, errset map[string]interface{}, is
 					key := qu.ObjToString(tmpMap["key"]) //字段
 					input := tmpMap["input"]             //值
 					status := qu.IntAll(tmpMap["status"])
+					isNull := false
 					if key == "number" || key == "unitprice" || key == "totalprice" {
-						input = qu.Float64All(input)
+						if input != "" { //有值
+							isNull = false
+							input = qu.Float64All(input)
+						} else {
+							isNull = true
+						}
+					}
+					if !isNull { //避免数字类型的字段在没有填写值的情况默认给0
+						result[key] = input
 					}
-					result[key] = input
 					result[preKey+key] = status
 					if !isNew && (status == 2 || status == 3 || status == 4) {
 						errResult[key] = status //记录哪个字段错误
 					}
 				}
 			}
-			if len(result) > 0 {
+			if len(result) > 0 && pclSonStatus != 4 {
 				purchasinglist = append(purchasinglist, result)
 			}
 			errList = append(errList, errResult)
 		}
 	}
 	errset["purchasinglist"] = errList
-	if len(purchasinglist) == len(content) {
+	if len(purchasinglist)+delpclson == len(content) {
 		set["purchasinglist"] = purchasinglist
 		set[preKey+"purchasinglist"] = status
 	}
@@ -965,21 +1106,26 @@ func BzDBXX(content []interface{}, set, unset, errset map[string]interface{}, is
 	if status == -1 {
 		return
 	}
-	set["pkg_isext"] = isext //多包是否抽取标记
+	set["ck_pkgisext"] = isext //多包是否抽取标记
 	pkgs := map[string]interface{}{}
 	errMap := map[string]interface{}{}
 	newNum := 1
+	delpkgson := 0 //记录子包删除个数
 	for _, con := range content {
 		info, _ := con.(map[string]interface{})
-		num := qu.ObjToString(info["num"]) //包号
-		isNew, _ := info["isNew"].(bool)   //是否是新增子包
-		if isNew {                         //新增子包新建包名
+		pkgSonStatus := qu.IntAll(info["status"])
+		if pkgSonStatus == 4 {
+			delpkgson++
+		}
+		num := fmt.Sprint(info["num"])      //包号
+		isNew, _ := info["ck_isnew"].(bool) //是否是新增子包
+		if isNew {                          //新增子包新建包名
 			num = "new" + fmt.Sprint(newNum)
 			newNum++
 		}
 		if uInputs, ok := info["uInput"].([]interface{}); ok {
 			result := map[string]interface{}{
-				"isnew": isNew,
+				"ck_isnew": isNew,
 			}
 			errResult := map[string]interface{}{}
 			for _, tmp := range uInputs {
@@ -987,10 +1133,18 @@ func BzDBXX(content []interface{}, set, unset, errset map[string]interface{}, is
 					key := qu.ObjToString(tmpMap["key"]) //字段
 					input := tmpMap["input"]             //值
 					status := qu.IntAll(tmpMap["status"])
+					isNull := false
 					if key == "bidamount" || key == "budget" {
-						input = qu.Float64All(input)
+						if input != "" { //有值
+							isNull = false
+							input = qu.Float64All(input)
+						} else {
+							isNull = true
+						}
+					}
+					if !isNull { //避免数字类型的字段在没有填写值的情况默认给0
+						result[key] = input
 					}
-					result[key] = input
 					result[preKey+key] = status
 					if !isNew && (status == 2 || status == 3 || status == 4) {
 						errResult[key] = status //记录哪个字段错误
@@ -1000,7 +1154,7 @@ func BzDBXX(content []interface{}, set, unset, errset map[string]interface{}, is
 			if len(errResult) > 0 {
 				errMap[num] = errResult
 			}
-			if len(result) > 0 {
+			if len(result) > 0 && pkgSonStatus != 4 { //要删除的子包不再保存
 				pkgs[num] = result
 			}
 		}
@@ -1008,7 +1162,7 @@ func BzDBXX(content []interface{}, set, unset, errset map[string]interface{}, is
 	if len(errMap) > 0 {
 		errset["package"] = errMap
 	}
-	if len(pkgs) == len(content) {
+	if len(pkgs)+delpkgson == len(content) {
 		set["package"] = pkgs
 		set[preKey+"package"] = status
 	}
@@ -1022,15 +1176,20 @@ func BzZBHXRXX(content []interface{}, set, unset, errset map[string]interface{},
 	if status == -1 {
 		return
 	}
-	set["wodr_isext"] = isext //中标候选人是否抽取标记
+	set["ck_wodrisext"] = isext //中标候选人是否抽取标记
 	winnerorder := []interface{}{}
 	errList := []interface{}{}
+	delwodrson := 0
 	for _, con := range content {
 		info, _ := con.(map[string]interface{})
-		isNew, _ := info["isNew"].(bool) //是否是新增子包
+		isNew, _ := info["ck_isnew"].(bool) //是否是新增子包
+		wodrSonStatus := qu.IntAll(info["status"])
+		if wodrSonStatus == 4 {
+			delwodrson++
+		}
 		if uInputs, ok := info["uInput"].([]interface{}); ok {
 			result := map[string]interface{}{
-				"isnew": isNew,
+				"ck_isnew": isNew,
 			}
 			errResult := map[string]interface{}{}
 			for _, tmp := range uInputs {
@@ -1038,24 +1197,32 @@ func BzZBHXRXX(content []interface{}, set, unset, errset map[string]interface{},
 					key := qu.ObjToString(tmpMap["key"]) //字段
 					input := tmpMap["input"]             //值
 					status := qu.IntAll(tmpMap["status"])
+					isNull := false
 					if key == "price" {
-						input = qu.Float64All(input)
+						if input != "" { //有值
+							isNull = false
+							input = qu.Float64All(input)
+						} else {
+							isNull = true
+						}
+					}
+					if !isNull { //避免数字类型的字段在没有填写值的情况默认给0
+						result[key] = input
 					}
-					result[key] = input
 					result[preKey+key] = status
 					if !isNew && (status == 2 || status == 3 || status == 4) {
 						errResult[key] = status //记录哪个字段错误
 					}
 				}
 			}
-			if len(result) > 0 {
+			if len(result) > 0 && wodrSonStatus != 4 {
 				winnerorder = append(winnerorder, result)
 			}
 			errList = append(errList, errResult)
 		}
 	}
 	errset["winnerorder"] = errList
-	if len(winnerorder) == len(content) {
+	if len(winnerorder)+delwodrson == len(content) {
 		set["winnerorder"] = winnerorder
 		set[preKey+"winnerorder"] = status
 	}
@@ -1079,7 +1246,7 @@ func BzQYXX(content []interface{}, set, unset, errset map[string]interface{}) {
 						} else if key == "signaturedate" { //
 							inputTmp, _ := time.ParseInLocation(qu.Date_Full_Layout, input.(string), time.Local)
 							input = inputTmp.Unix()
-						} else if key == "bid_bond" || key == "contract_bond" || key == "supervisorrate" || key == "agency_rate" || key == "docamount" || key == "agency_fee" {
+						} else if key == "bid_bond" || key == "contract_bond" || key == "supervisorrate" || key == "agencyrate" || key == "docamount" || key == "agencyfee" {
 							input = qu.Float64All(input)
 						}
 						set[key] = input
@@ -1121,13 +1288,14 @@ func mapIntAdd(k, val string, tmp map[string]map[string]int) map[string]map[stri
 }
 
 //通过id查询数据
-func GetDataById(coll string, ids []string, stype string) (bool, string) {
+func GetDataById(coll string, ids []string, stype string, tmp map[string]map[string]interface{}) (bool, string, int64) {
 	defer qu.Catch()
 	success := true
 	msg := ""
 	wg := &sync.WaitGroup{}
 	lock := &sync.Mutex{}
 	ch := make(chan bool, 5)
+	n := int64(0)
 	for i, id := range ids {
 		wg.Add(1)
 		ch <- true
@@ -1138,11 +1306,11 @@ func GetDataById(coll string, ids []string, stype string) (bool, string) {
 			}()
 			tmpBidColl := util.BidColl1 //bidding
 			//查询bidding
-			if id < "5a862f0640d2d9bbe88e3cec" {
+			if id < util.BIDDINGSTARTID {
 				tmpBidColl = util.BidColl2 //bidding_back
 			}
 			bidData, _ := util.MgoB.FindById(tmpBidColl, id, nil)
-			if bidData != nil && len(*bidData) > 0 {
+			if bidData != nil && len(*bidData) > 0 { //bidding表数据存在
 				//查询extract
 				extData, _ := util.MgoE.FindById(util.ExtColl1, id, nil)
 				if extData == nil || len(*extData) == 0 {
@@ -1154,41 +1322,113 @@ func GetDataById(coll string, ids []string, stype string) (bool, string) {
 						(*bidData)[k] = v
 					}
 				}
-				markData, _ := util.MgoM.FindById(coll, id, nil)
+				//对比marked表是否已标注该数据
+				markData, _ := util.MgoM.FindById(util.Config.Fromtable, id, nil)
+				if markData != nil && len(*markData) > 0 {
+					UpdateMarkColl(bidData, markData) //比对更新数据
+				} else {
+					(*bidData)["ck_data"] = 0 //设置ck_data默认值0
+				}
+				//合并导入表中客户所需的字段
+				if len(tmp) > 0 {
+					for k, v := range tmp[id] {
+						(*bidData)[k] = v
+					}
+				}
+				//多包、中标候选人、标的信息是否抽取
+				if packageMap, ok := (*bidData)["package"].(map[string]interface{}); ok && len(packageMap) > 0 {
+					(*bidData)["ck_pkgisext"] = true
+				} else {
+					(*bidData)["ck_pkgisext"] = false
+				}
+				if winorderArr, ok := (*bidData)["winnerorder"].([]interface{}); ok && len(winorderArr) > 0 {
+					(*bidData)["ck_wodrisext"] = true
+				} else {
+					(*bidData)["ck_wodrisext"] = false
+				}
+				if purchArr, ok := (*bidData)["purchasinglist"].([]interface{}); ok && len(purchArr) > 0 {
+					(*bidData)["ck_pclisext"] = true
+				} else {
+					(*bidData)["ck_pclisext"] = false
+				}
+				//补充id
+				(*bidData)["id"] = id
 				//保存数据
-				if len(*markData) == 0 { //直接保存
-					qu.Debug("---直接保存---")
-					util.MgoM.SaveByOriID(coll, bidData)
+				if util.MgoM.SaveByOriID(coll, bidData) {
+					atomic.AddInt64(&n, 1) //计数
 				} else {
-					qu.Debug("---更新---")
-					UpdateMarkColl(bidData, markData, coll) //比对更新数据
+					lock.Lock()
+					*success = false
+					if stype == "excel" {
+						*msg += "第" + fmt.Sprint(i+2) + "行未查询到数据:" + id + ";\n"
+					} else {
+						*msg += "未查询到数据:" + id + ";\n"
+					}
+					lock.Unlock()
 				}
 			} else {
 				lock.Lock()
 				*success = false
 				if stype == "excel" {
-					*msg += "第" + fmt.Sprint(i+2) + "行未查询到数据;\n"
+					*msg += "第" + fmt.Sprint(i+2) + "行未查询到数据:" + id + ";\n"
 				} else {
-					*msg += id + " 未查询到数据;\n"
+					*msg += "未查询到数据:" + id + ";\n"
 				}
 				lock.Unlock()
 			}
 		}(i, id, &success, &msg)
 	}
 	wg.Wait()
-	return success, msg
+	return success, msg, n
 }
 
 //更新数据
-func UpdateMarkColl(bidData, markData *map[string]interface{}, coll string) {
+func UpdateMarkColl(bidData, markData *map[string]interface{}) {
 	defer qu.Catch()
-	set := map[string]interface{}{}
-	for k, v := range *bidData {
-		if k != "_id" && (*markData)[preKey+k] == nil { //只更新未标注过的字段
-			set[k] = v
+	ck_data := qu.IntAll((*markData)["ck_data"])
+	if ck_data == 2 { //某些字段已标注
+		for fk, fv := range *markData {
+			ckFieldArr := strings.Split(fk, preKey)
+			if len(ckFieldArr) == 2 {
+				field := ckFieldArr[1]
+				(*bidData)[fk] = fv //补充标记
+				if (*markData)[field] != nil {
+					(*bidData)[field] = (*markData)[field] //字段更新
+				}
+			}
 		}
+		(*markData)["ck_data"] = 0 //marked表中该条数据如果为字段验证,临时表ck_data:0;若为数据验证ck_data:1
 	}
-	if len(set) > 0 {
-		util.MgoM.Update(coll, map[string]interface{}{"_id": (*bidData)["_id"]}, map[string]interface{}{"$set": set}, false, false)
+}
+
+//获取当前数据下一条的id
+func GetNextDataId(id string) string {
+	nextIdQuery := map[string]interface{}{
+		"_id": map[string]interface{}{
+			"$gt": mgo.StringTOBsonId(id),
+		},
+	}
+	for k, v := range QueryFind {
+		nextIdQuery[k] = v
+	}
+	one, _ := util.MgoM.Find(util.Coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
+	if one != nil && len(*one) == 1 {
+		return mgo.BsonIdToSId((*one)[0]["_id"])
+	}
+	return id
+}
+
+//获取已标注和数据总数的信息
+func GetCheckedAndAllDataInfo() (int, int) {
+	allCount := util.MgoM.Count(util.Coll, QueryFind)
+	ckDataQuery := map[string]interface{}{
+		"ck_data": map[string]interface{}{
+			"$gt": 0,
+		},
+	}
+	for k, v := range QueryFind {
+		ckDataQuery[k] = v
 	}
+	checkedCount := util.MgoM.Count(util.Coll, ckDataQuery)
+	return checkedCount, allCount
 }

+ 8 - 12
src/main.go

@@ -2,16 +2,12 @@
 package main
 
 import (
-	"container/list"
 	"crypto/md5"
 	"encoding/hex"
 	"front"
 	"log"
 
-	//"os"
-	mgo "mongodb"
 	qu "qfw/util"
-	"qfw/util/redis"
 	"strings"
 	"util"
 
@@ -24,13 +20,13 @@ func MD5(appid, t, secret string) string {
 	return strings.ToUpper(hex.EncodeToString(h.Sum(nil)))
 }
 func init() {
-	log.Println(MD5("jynw166_fEs2021", "1617340065", "Tgb#8diO90L"))
+	//log.Println(MD5("jynw166_fEs2021", "1617340065", "Tgb#8diO90L"))
 	//os.Exit(0)
 	qu.ReadConfig(&util.Config)
 	util.InitConfig()
 	//util.InitInfluxdb(util.Config.InfluxdbUrl)
 	//redis
-	redis.InitRedis(util.Config.Redis)
+	//redis.InitRedis(util.Config.Redis)
 	//oss
 	util.InitOss()
 	//xweb框架配置
@@ -47,15 +43,15 @@ func init() {
 	xweb.AddAction(&front.Front{})
 	//_id初始化内存
 	log.Println("_id初始化内存...")
-	front.IdList = list.New()
+	//front.IdList = list.New()
 
 	//加载所有数据,存入IdList
 	//ls, _ := util.MgoM.Find(util.Config.Fromtable, `{"check":{"$exists":0}}`, nil, `{"_id":1}`, false, -1, -1)
-	ls, _ := util.MgoM.Find(util.Coll, nil, nil, `{"_id":1}`, false, -1, -1)
-	for _, v := range *ls {
-		front.IdList.PushBack(mgo.BsonIdToSId(v["_id"]))
-	}
-	qu.Debug("_id初始化内存完成", front.IdList.Len())
+	//ls, _ := util.MgoM.Find(util.Coll, nil, nil, `{"_id":1}`, false, -1, -1)
+	//for _, v := range *ls {
+	//	front.IdList.PushBack(mgo.BsonIdToSId(v["_id"]))
+	//}
+	//qu.Debug("_id初始化内存完成", front.IdList.Len())
 	// front.IdPackList = list.New()
 	// //加载所有未标注数据且含有分包信息的数据
 	// lspack, _ := util.MgoM.Find(util.Config.Fromtable, `{"check":{"$exists":0},"package":{"$exists":1}}`, nil, `{"_id":1}`, false, -1, -1)

+ 21 - 17
src/util/config.go

@@ -12,21 +12,25 @@ import (
 
 //系统配置
 type config struct {
-	Port        string                 `json:"port"`
-	Dbaddress   string                 `json:"dbaddress"`
-	Dbname      string                 `json:"dbname"`
-	Size        int                    `json:"size"`
-	Fromtable   string                 `json:"fromtable"`
-	Totablel    string                 `json:"totablel"`
-	Biaozhu     map[string]interface{} `json:"biaozhu"`
-	InfluxdbUrl string                 `json:"influxdbUrl"`
-	Redis       string                 `json:"redis"`
-	Bidding     map[string]interface{} `json:"bidding"`
-	Extract     map[string]interface{} `json:"extract"`
-	Elas        map[string]interface{} `json:"es"`
-	TopSubType  map[string]interface{} `json:"topsubtype"`
+	Port          string                 `json:"port"`
+	Dbaddress     string                 `json:"dbaddress"`
+	Dbname        string                 `json:"dbname"`
+	Size          int                    `json:"size"`
+	Fromtable     string                 `json:"fromtable"`
+	Totablel      string                 `json:"totablel"`
+	Biaozhu       map[string]interface{} `json:"biaozhu"`
+	InfluxdbUrl   string                 `json:"influxdbUrl"`
+	Redis         string                 `json:"redis"`
+	Bidding       map[string]interface{} `json:"bidding"`
+	Extract       map[string]interface{} `json:"extract"`
+	Elas          map[string]interface{} `json:"es"`
+	TopSubType    map[string]interface{} `json:"topsubtype"`
+	CustomerField map[string]string      `json:"customerfield"`
 }
 
+const SPECIALTYPE = "二级不存在"
+const BIDDINGSTARTID = "5a862f0640d2d9bbe88e3cec"
+
 var (
 	Config   config
 	MgoB     *mgo.MongodbSim //bidding
@@ -41,7 +45,7 @@ var (
 	Itype    string
 	Coll     string
 	//
-	AllField            []map[string]string
+	AllFieldArr         []map[string]string
 	PurchasinglistField []map[string]string
 	PackageField        []map[string]string
 	WinnerorderField    []map[string]string
@@ -94,7 +98,7 @@ func InitConfig() {
 	//
 	tmpAllField := Arr{}
 	AllFieldMap := map[string]string{}
-	AllField = []map[string]string{}
+	AllFieldArr = []map[string]string{}
 	common, _ := Config.Biaozhu["common"].([]interface{})
 	timeplace, _ := Config.Biaozhu["timeplace"].([]interface{})
 	other, _ := Config.Biaozhu["other"].([]interface{})
@@ -130,7 +134,7 @@ func InitConfig() {
 	AllFieldMap["中标候选人"] = "winnerorder"
 	sort.Sort(tmpAllField)
 	for _, f := range tmpAllField {
-		AllField = append(AllField, map[string]string{AllFieldMap[f]: f})
+		AllFieldArr = append(AllFieldArr, map[string]string{AllFieldMap[f]: f})
 	}
 	//
 	PurchasinglistField = []map[string]string{}
@@ -166,7 +170,7 @@ func InitConfig() {
 			TopSubStypeArr = append(TopSubStypeArr, top+"-"+qu.ObjToString(sub))
 		}
 	}
-
+	TopSubStypeArr = append(TopSubStypeArr, SPECIALTYPE)
 	//coll
 	Coll = Config.Fromtable
 }

+ 136 - 0
src/web/staticres/css/page.css

@@ -0,0 +1,136 @@
+.clearfix {
+	clear: both;
+}
+.clearfix:after {
+	clear: both;
+	content: "";
+	display: block;
+	height: 0;
+	visibility: hidden;
+}
+.fl {
+	float: left;
+}
+
+.fr {
+	float: right;
+}
+
+.pager {
+	max-width: 800px;
+	text-align: center;
+	margin-bottom: 30px;
+	display: inline-block;
+}
+
+.pager a {
+	cursor: pointer;
+}
+
+.pager a,
+.pager span {
+	/* 按钮内数字 */
+	width: 45px;
+	height: 40px;
+	border: 1px solid #EBEBEB;
+	margin-left: -1px;
+	color: #8a8a8a;
+	display: inline-block;
+	line-height: 40px;
+	float: left;
+	font-size: 15px;
+	text-decoration: none;
+	margin: 0 2px;
+	border-radius: 6px;
+}
+.pager a:hover,
+.pager span:hover {
+	border-color: #3897cd;
+	color: #3897cd;
+	position: relative;
+	z-index: 1;
+}
+
+.pager span.current {
+	background-color: #222A35;
+	color: #fff;
+	border-color: #EBEBEB;
+	position: relative;
+	z-index: 1;
+}
+
+.pager .pg-first,
+.pager .pg-prev,
+.pager .pg-next,
+.pager .pg-last {
+	background: white url(../img/page_bg.jpg)  8px 7px no-repeat;
+}
+
+.pager .pg-first:hover,
+.pager .pg-prev:hover,
+.pager .pg-next:hover,
+.pager .pg-last:hover {
+	background: white url(../img/page_bg_hover.jpg)  8px 7px no-repeat;
+}
+
+.pager .pg-prev,
+.pager .pg-prev:hover {
+	background-position: 7px -21px;
+}
+
+.pager .pg-next,
+.pager .pg-next:hover {
+	background-position: -21px -21px;
+}
+
+.pager .pg-last,
+.pager .pg-last:hover {
+	background-position: -21px 7px;
+}
+
+.pager .pg-prev[disabled='true'],
+.pager .pg-prev[disabled='true']:hover {
+	cursor: default;
+	background-image: url(../img/page_bg.jpg);
+}
+
+.pager .pg-next[disabled='true'],
+.pager .pg-next[disabled='true']:hover {
+	cursor: default;
+	background-image: url(../img/page_bg.jpg);
+}
+
+.pager .pg-prev[disabled='true'],
+.pager .pg-next[disabled='true'] {
+	border-color: #eeeeee;
+}
+
+.pager span.els {
+	border-color: transparent;
+}
+
+.pagerHtmlWrap {
+	width: 800px;
+	margin: 30px auto;
+}
+
+.pagerHtmlWrap .cc_cells {
+	width: 100%;
+	height: 35px;
+	padding: 5px 0;
+	border-bottom: 1px #cccccc solid;
+}
+
+.pagerHtmlWrap .cc_cells a {
+	color: #454545;
+	font-size: 14px;
+	line-height: 35px;
+	text-decoration: none;
+}
+
+.pagerHtmlWrap .cc_cells a span {
+	display: inline-block;
+	width: 25%;
+	text-align: left;
+	margin: 0;
+}

二進制
src/web/staticres/img/page_bg.jpg


二進制
src/web/staticres/img/page_bg_hover.jpg


+ 312 - 0
src/web/staticres/js/jquery-page.js

@@ -0,0 +1,312 @@
+;(function($){
+	var methods = {
+		pageInit: function(options){
+			/**
+			 * [opts this plug propertys]
+			 * @type {Obeject}
+			 */
+			var opts = $.extend({},$.fn.zPager.defaults,options);
+			return $(this).each(function(k,v){
+				var _v = $(v);
+				_v.data("options",opts);
+				methods.pageData(_v, opts.current, true);
+			})
+		},
+		pageData: function(_v, _current, type){
+			if (typeof  type === 'undefined') {
+				typeof window.submitform === 'function' ? window.submitform(_current) : null
+			}
+			var opts = _v.data("options");
+			var t = opts.totalData, p = opts.pageData, ajaxOpts = null;
+			if(opts.ajaxSetData&&(typeof(opts.ajaxSetData)==='boolean')){
+				if(opts.url!=='' && typeof(opts.url)==='string'){
+					ajaxOpts = methods.ajaxData(opts.url, _current);
+					t = opts.totalData = ajaxOpts.total;
+					if(ajaxOpts.rows.length>0){
+						var ishasDataRender = (opts.dataRender && typeof(opts.dataRender)==='function');
+							ishasDataRender ? opts.dataRender(ajaxOpts.rows) : methods.dataRender(_v, ajaxOpts.rows);
+					}
+				}else{
+					$.pageError(2);
+				}
+			}
+			if(t%p === 0){
+                opts.pageCount = parseInt(t/p);
+            }else{
+                opts.pageCount = parseInt(t/p)+1;
+            }
+            if(opts.pageCount>0){
+            	_v.data("options",opts);
+            	methods.pageRender(_v, _current);
+            }
+		},
+		dataRender: function(_v, _data){
+			
+			var opts = _v.data("options");
+			var cells = '';
+				for(var i=0;i<_data.length;i++){
+					cells += '<div class="cc_cells"><a href=""><span>'+_data[i].id+'-'+Math.random()+'</span>';
+					cells += '<span>'+_data[i].title+'</span>';
+					cells += '<span>'+_data[i].starttime+'</span>';
+					cells += '<span>'+_data[i].endtime+'</span>';
+					cells += '</a></div>';
+				}
+			if(opts.htmlBox===''||(typeof(opts.htmlBox)!=='Obeject')){
+				var abx = _v.prev();
+				if(!abx.hasClass('pagerHtmlWrap')){
+					var d = '<div class="pagerHtmlWrap"></div>';
+					_v.before(d);
+				}
+				_v.prev().html(cells);
+			}else{
+				opts.htmlBox.html(cells);
+			}
+		},
+		pageRender: function(_v, _current){
+			// 页码操作
+			currentPage(_current, false);
+			
+			/**
+			 * [o this plug propertys]
+			 * @type {Obeject}
+			 */
+			var o = _v.data("options");
+			var _page = o.pageCount;
+
+			var _middle = parseInt(o.pageStep/2);
+			var _tep = _middle-2;
+			var _html = '';
+			if(_page>o.pageStep&&_current<=_page){
+				_html += methods.setPrevNext(o, 'prev');
+				if(_current<=_middle){
+					_html += methods.forEach(1, o.pageStep, _current, o.active);
+					_html += methods.elliPsis();
+				}else if(_current>_middle&&_current<(_page-_tep)){
+					_html += methods.pageBtn(1);
+					_html += methods.elliPsis();
+					_html += methods.forEach(_current-_tep, _current-(-_tep)-(-1), _current, o.active);
+					_html += methods.elliPsis();
+				}else if(_current>=(_page-_tep)){
+					_html += methods.pageBtn(1);
+					_html += methods.elliPsis();
+					_html += methods.forEach(_page-2*_tep-1, _page-(-1), _current, o.active);
+				}
+				_html += methods.setPrevNext(o, 'next');
+			}else if(_page<=o.pageStep){
+				if(_page>o.minPage){
+					_html += methods.setPrevNext(o, 'prev');
+				}
+				_html += methods.forEach(1, _page-(-1), _current, o.active);
+				if(_page>o.minPage){
+					_html += methods.setPrevNext(o, 'next');
+				}	
+			}
+			_v.html(_html);
+			methods.bindEvent(_v);
+		},
+		bindEvent: function(_v){
+			/**
+			 * [o this plug propertys]
+			 * @type {Obeject}
+			 */
+			var o = _v.data("options");
+			var _a = _v.find("a");
+				$.each(_a,function(index,item){
+					var _this = $(this);
+					_this.on("click",function(){
+						if(_this.attr("disabled")){
+							return false;
+						}
+						var _p = _this.attr("page-id");
+						o.current = _p;
+						_v.data("options",o);
+						// methods.options.current = _p;
+						methods.pageData(_v, _p);
+					})
+				})
+		},
+		forEach: function(_start,length,_current,curclass){
+			/**
+			 * [s page elements]
+			 * @type {String}
+			 */
+			var s = '';
+			for(var i = _start;i<length;i++){
+				if(i === parseInt(_current)){
+					s += methods.pageCurrent(i,curclass);
+				}else{
+					s += methods.pageBtn(i);
+				}
+			}
+			return s;
+		},
+		pageCurrent: function(_id,_class){
+			/**
+			 * [class current page element calss]
+			 * @type {String}
+			 */
+			return '<span class="'+_class+'" page-id="'+_id+'">'+_id+'</span>';
+		},
+		elliPsis: function(){
+			/**
+			 * [class ellipses...]
+			 * @type {String}
+			 */
+			return '<span class="els">...</span>';
+		},
+		pageBtn: function(_id){
+			/**
+			 * [id page id]
+			 * @type {String}
+			 */
+			return '<a page-id="'+_id+'">'+_id+'</a>';
+		},
+		addBtn: function(_property, _page, _count){
+			/**
+			 * [disabled is it can click button]
+			 * @type {Boolean}
+			 */
+			var disabled = '';
+			if(_count){
+				disabled = (_page === 0 || _page === _count-(-1)) ? 'disabled="true"':'';
+			}
+			return '<a class="'+_property+'" page-id="'+_page+'" '+disabled+'></a>';
+		},
+		setPrevNext: function(_o, _type){
+			/**
+			 * [s string create prev or next buttons elements]
+			 * @type {String}
+			 */
+			var s = '';
+			function prev(){
+				if(_o.btnShow){
+					s += methods.addBtn(_o.firstBtn, 1); 
+				}
+				if(_o.btnBool){
+					s += methods.addBtn(_o.prevBtn, _o.current-1, _o.pageCount);
+				}
+				return s;
+			}
+			function next(){
+				if(_o.btnBool){
+					s += methods.addBtn(_o.nextBtn, _o.current-(-1), _o.pageCount);
+				}
+				if(_o.btnShow){
+					s += methods.addBtn(_o.lastBtn, _o.pageCount);
+				}
+				return s;
+			}
+			return _type==='prev'? prev(): next();
+		},
+		ajaxData: function(_url, _current){
+			/**
+			 * [ajax get data and pagenumber]
+			 * @param  {Object} ){ var parms [ajax url,current page number]
+			 * @return {[type]}            [obj total rows]
+			 */
+			var _total = $.fn.zPager.defaults.totalData;
+			return (function(){
+				var parms = {'total':_total,'rows':[]};
+				$.ajax({
+					url: _url,
+					type: 'get',
+					data: {"page":_current},
+	                dataType: 'json',
+	                cache : false,  
+        			async : false,
+	                success: function(data) {
+	                	if(data.total && (data.total!==0)){
+	                        parms['total'] = data.total;
+	                        parms['rows'] = data.rows;
+	                	}else{
+	                		$.pageError(3);
+	                	}
+	                },
+					error: function(XMLHttpRequest,textStatus,errorThrown) {
+						var msg = '';
+						switch(XMLHttpRequest.readyState){
+							case 0:
+								msg = '(未初始化)还没有调用send()方法';
+								break;
+							case 1:
+								msg = '(载入)已调用send()方法,正在发送请求';
+								break;
+							case 2:
+								msg = '(载入完成)send()方法执行完成,已经接收到全部响应内容';
+								break;
+							case 3:
+								msg = '(交互)正在解析响应内容';
+								break;
+							case 4:
+								msg = '(完成)响应内容解析完成,可以在客户端调用了';
+								break;
+						}
+						console.log(textStatus+':'+XMLHttpRequest.readyState+'-'+msg);
+					}
+				})
+				return parms;
+			})();
+		}
+	}
+
+	$.extend({
+		pageError:function(type){
+			/**
+			 * [switch error type]
+			 * @param  {[type]} type [no this function]
+			 * @return {[type]}      [ajax error]
+			 */
+			switch(type){
+				case 1:
+					console.log('method'+method+'dose not exist on jQuery.zPager');
+					break;
+				case 2:
+					console.log('no ajax');
+					break;
+				case 3:
+					console.log('no data');
+					break;
+				default:
+					console.log('default error');
+			}
+		}
+	})
+
+	$.fn.extend({
+		zPager:function(method){
+			/**
+			 * [if has this method]
+			 * @param  {[type]} methods[method] [apply this method]
+			 * @return {[type]}                 [return property]
+			 */
+			if(methods[method]){
+				return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
+			}else if(typeof method === 'object' || !method){
+				return methods.pageInit.apply(this, arguments);
+			}else{
+				$.pageError(1);
+			}
+		}
+	})
+
+	$.fn.zPager.defaults = {
+		totalData: 10, //数据总条数
+		pageData: 5, //每页数据条数
+		pageCount: 0, //总页数
+		current: 1, //当前页码数
+		pageStep: 8, //当前可见最多页码个数
+		minPage: 5, //最小页码数,页码小于此数值则不显示上下分页按钮
+		active: 'current', //当前页码样式
+		prevBtn: 'pg-prev', //上一页按钮
+		nextBtn: 'pg-next', //下一页按钮
+		btnBool: true, //是否显示上一页下一页
+		firstBtn: 'pg-first', //第一页按钮
+		lastBtn: 'pg-last', //最后一页按钮
+		btnShow: true, //是否显示第一页和最后一页按钮
+		disabled: true, //按钮失效样式
+		ajaxSetData: true, //是否使用ajax获取数据 此属性为真时需要url和htmlBox不为空
+		url: '', //ajax路由
+		htmlBox: '' //ajax数据写入容器
+	}
+
+})(jQuery)

+ 894 - 734
src/web/templates/detail.html

@@ -3,28 +3,28 @@
 <head>
     <meta charset="UTF-8">
     <title>抽查</title>
-	  <script src="/js/jquery.js"></script>
- 	  <link href="/css/normalize.min.css" rel="stylesheet">
+    <script src="/js/jquery.js"></script>
+    <link href="/css/normalize.min.css" rel="stylesheet">
     <link href="/css/animate.min.css" rel="stylesheet">
-	  <link rel="stylesheet" href="/css/zz.css">
+    <link rel="stylesheet" href="/css/zz.css">
     <link rel="stylesheet" href="/css/index.css">
     <script src="/js/vue.min.js"></script>
     <script src="/js/index.js"></script>
     <script src="/js/model.js"></script>
     <style>
         .add-tip {
-        	width: 24px;
-        	height: 22px;
-          line-height: 22px;
-          text-align: center;
-          color: #fff;
-			    margin: 0;
-			    padding: 0;
-			    border: 1px solid #ccc;
-			    background-color: #fdfdfd;
+            width: 24px;
+            height: 22px;
+            line-height: 22px;
+            text-align: center;
+            color: #fff;
+            margin: 0;
+            padding: 0;
+            border: 1px solid #ccc;
+            background-color: #fdfdfd;
         }
         .info-box > * {
-        	cursor: pointer;
+            cursor: pointer;
         }
         .button-group {
             display: flex;
@@ -33,105 +33,107 @@
             justify-content: space-between;
         }
         .button-group .info-box {
-          margin-left: -60px;
+            margin-left: -60px;
         }
         .edit-box .edit.two .edit-title {
-          padding-right: 4px;
+            padding-right: 4px;
         }
         .edit-box .edit .edit-input .label > span {
-          max-width: unset;
-          text-align: left;
-          padding: 0 1em;
+            max-width: unset;
+            text-align: left;
+            padding: 0 1em;
         }
         .a-button {
-          color: #4169e3;
-          margin: 8px 15px;
-          padding: 4px 10px;
+            color: #4169e3;
+            margin: 8px 15px;
+            padding: 4px 10px;
         }
         .button-box.delete-box {
-          margin-right: 22px !important;
-          margin-left: -419px !important;
+            margin-right: 22px !important;
+            margin-left: -419px !important;
         }
         .button-box.delete-box .pass {
-          background-color: #f56c6c !important;
+            background-color: #f56c6c !important;
         }
         .pass.success {
-              background-color: #09bb07 !important;
+            background-color: #09bb07 !important;
         }
         .pass.default {
-              background-color: #adadad !important;
+            background-color: #adadad !important;
         }
     </style>
-  <script>
-function prettyPrint(obj) {
-    var ENDLINE = "\n";
-    var COMMA_ENDLINE = ",\n";
-    var OBJ_BEGIN = "{";
-    var OBJ_END   = "}";
-    var ARR_BEGIN = "[";
-    var ARR_END   = "]";
-    var INDNET_SPACES = 4;
+    <script>
+        function prettyPrint(obj) {
+            console.log(obj)
+            var ENDLINE = "\n";
+            var COMMA_ENDLINE = ",\n";
+            var OBJ_BEGIN = "{";
+            var OBJ_END   = "}";
+            var ARR_BEGIN = "[";
+            var ARR_END   = "]";
+            var INDNET_SPACES = 4;
 
-    return (function innerPrettyPrint(obj, spaces) {
-      var type = typeof obj;
+            return (function innerPrettyPrint(obj, spaces) {
+                var type = typeof obj;
+                console.log(obj,type)
+                if (type == "number" || type == "boolean") {
+                    return obj.toString();
+                } else if (type == "string") {
+                    if( obj!="" && !isNaN(Number(obj))){
+                        return Number(obj)
+                    }
+                    return '"' + obj + '"';
+                } else {
+                    var entries = [];
+                    var thisIndent = ' '.repeat(spaces);
+                    var subIndent  = thisIndent + ' '.repeat(INDNET_SPACES);
+                    var subSpaces = spaces + INDNET_SPACES;
 
-      if (type == "number" || type == "boolean") {
-        return obj.toString();
-      } else if (type == "string") {
-		if( obj!="" && !isNaN(Number(obj))){
-			return Number(obj)
-		}
-        return '"' + obj + '"';
-      } else {
-        var entries = [];
-        var thisIndent = ' '.repeat(spaces);
-        var subIndent  = thisIndent + ' '.repeat(INDNET_SPACES);
-        var subSpaces = spaces + INDNET_SPACES;
-
-        if (Object.prototype.toString.call(obj) == '[object Object]') {
-          for(var k in obj) {
-            entries.push('"' + k + '": ' + innerPrettyPrint(obj[k], subSpaces));
-          }
+                    if (Object.prototype.toString.call(obj) == '[object Object]') {
+                        for(var k in obj) {
+                            entries.push('"' + k + '": ' + innerPrettyPrint(obj[k], subSpaces));
+                        }
 
-          return OBJ_BEGIN + ENDLINE + subIndent + entries.join(COMMA_ENDLINE + subIndent) + ENDLINE + thisIndent + OBJ_END;
-        } else if (Object.prototype.toString.call(obj) == '[object Array]') {
-          obj.forEach(function(a) {
-            entries.push(innerPrettyPrint(a, subSpaces));
-          });
+                        return OBJ_BEGIN + ENDLINE + subIndent + entries.join(COMMA_ENDLINE + subIndent) + ENDLINE + thisIndent + OBJ_END;
+                    } else if (Object.prototype.toString.call(obj) == '[object Array]') {
+                        obj.forEach(function(a) {
+                            entries.push(innerPrettyPrint(a, subSpaces));
+                        });
 
-          return ARR_BEGIN + ENDLINE + subIndent + entries.join(COMMA_ENDLINE + subIndent) + ENDLINE + thisIndent + ARR_END;
-        }  else if (obj === null) {
-          return "null";
-        } else {
-          return obj.toString();
+                        return ARR_BEGIN + ENDLINE + subIndent + entries.join(COMMA_ENDLINE + subIndent) + ENDLINE + thisIndent + ARR_END;
+                    }  else if (obj === null) {
+                        return "null";
+                    } else {
+                        return obj.toString();
+                    }
+                }
+            })(obj, 0);
         }
-      }
-    })(obj, 0);
- }
-</script>
+    </script>
 </head>
 <body>
 <main id="app">
     <div class="content" :class="{mm:showPop}">
         <!--文章区-->
         <div class="article" >
-          <br><a href="{{.T.info.href}}" target="_blank">查看原文</a>
+            <h4>
+                已验/总数:{{.T.checkednum}}/{{.T.allnum}}
+            </h4>
+            <hr style="border:1 double;" width="100%">
+            <br><a href="{{.T.info.href}}" target="_blank">查看原文</a>
             <h3>{{.T.info.title}}</h3><br>
 
             {{if .T.info.detail}}
-            <div v-html="dataHtml">
-                {{Html (Regexp (Regexp .T.info.detail "(`|\\n|\\\\n)\\s+" "\n") "(`|\\n|\\\\n)+" "<br/>")}}
-            </div>
+            <div v-html="dataHtml"></div>
             {{end}}
-            
+
             {{if .T.info.filetext}}
-              <br><h3>附件内容</h3>
-              <div>
-                {{Html (Regexp (Regexp .T.info.filetext "(`|\\n|\\\\n)\\s+" "\n") "(`|\\n|\\\\n)+" "<br/>")}}
-              </div>
+            <br><h3>附件内容</h3>
+            <div v-html="fileHtml"></div>
             {{end}}
         </div>
         <!--操作区-->
+
         <div class="operation">
             <!--edit-box-->
             <div class="edit-box">
@@ -141,161 +143,163 @@ function prettyPrint(obj) {
                     <div class="edit-title" @click="one.show = !one.show">
                         <span>[[one.title]]</span>
                         <div class="button-group">
-                          <div v-if="one.showCheck">
-                            <input :id="one.title" @click.stop type="checkbox" v-model="one.checkType">
-                            <label @click.stop :for="one.title">是否抽取</label>
-                          </div>
-                          <div class="button-box">
-                          <!--v-show="one.title == '基本字段'"-->
-              							<button  class="pass success" @click.stop="saveDataOne(one,'1')" style="font-size: 14px;width: auto;float:left;">通过</button>
-              							<button  class="pass default" @click.stop="saveDataOne(one,'-1')" style="font-size: 14px;width: auto;float:left">取消</button>
-              						  <button class="pass" @click.stop="open(one, true)"  style="font-size: 14px;width: auto;float:left">保存</button>
-                          </div>
-  						            <!--<button class="add" v-show="one.title != '基本'" @click.stop="one.content.push(getTemp(2));goMark2(500)">+</button>-->
-                          <!--<button class="add" v-show="one.title == '基本'" @click.stop="one.content[0].content.push(getTemp(3));goMark2(60)">+</button>-->
-                          <div class="info-box" @click.stop v-show="one.showCheck">
-                              <div :class="{default: one.status == '-1'}" @click="setStatus(one,'-1')"></div>
-                              <!--<div :class="{ok: one.status == '1'}" @click="one.status = '1'"></div>-->
-                             <div :class="{ok: one.status == '1'}" @click="setStatus(one,'1')"></div>
-                              <!--<div :class="{err: one.status == '0'}" @click="one.status = '0'"></div>-->
-                              <el-popover trigger="click" >
-                                <div style="text-align: right; margin: 0">
-                                 <el-button type="success" size="mini" @click="setStatus(one,'2')">新增</el-button>
-                                  <el-button type="warning" size="mini" @click="setStatus(one,'3')">修改</el-button>
-                                  <el-button type="danger" size="mini" @click="setStatus(one,'4')">删除</el-button>
-                                 <!-- <el-button type="success" size="mini" @click="one.status = '2'">新增</el-button>
-                                  <el-button type="warning" size="mini" @click="one.status = '3'">修改</el-button>
-                                  <el-button type="danger" size="mini" @click="one.status = '4'">删除</el-button>-->
-                                </div>
-                                <div class="add-tip" slot="reference" :class="{err: (one.status != '1' && one.status != '-1')}">[[textMap[one.status] || '']]</div>
-                              </el-popover>
-                          </div>
-              
+                            <div v-if="one.showCheck">
+                                <input :id="one.title" @click.stop type="checkbox" v-model="one.checkType">
+                                <label @click.stop :for="one.title">是否抽取</label>
+                            </div>
+                            <div class="button-box">
+                                <!--v-show="one.title == '基本字段'"-->
+                                <button  class="pass success" @click.stop="saveDataOne(one,'1')" style="font-size: 14px;width: auto;float:left;">通过</button>
+                                <button  class="pass default" @click.stop="saveDataOne(one,'-1')" style="font-size: 14px;width: auto;float:left">取消</button>
+                                <!--              						  <button class="pass" @click.stop="open(one, true)"  style="font-size: 14px;width: auto;float:left">保存</button>-->
+                            </div>
+                            <!--<button class="add" v-show="one.title != '基本'" @click.stop="one.content.push(getTemp(2));goMark2(500)">+</button>-->
+                            <!--<button class="add" v-show="one.title == '基本'" @click.stop="one.content[0].content.push(getTemp(3));goMark2(60)">+</button>-->
+                            <div class="info-box" @click.stop v-show="one.showCheck">
+                                <div :class="{default: one.status == '-1'}" @click="setStatus(one,'-1')"></div>
+                                <!--<div :class="{ok: one.status == '1'}" @click="one.status = '1'"></div>-->
+                                <div :class="{ok: one.status == '1'}" @click="setStatus(one,'1')"></div>
+                                <!--<div :class="{err: one.status == '0'}" @click="one.status = '0'"></div>-->
+                                <el-popover trigger="click" >
+                                    <div style="text-align: right; margin: 0">
+                                        <el-button type="success" size="mini" @click="setStatus(one,'2')">新增</el-button>
+                                        <el-button type="warning" size="mini" @click="setStatus(one,'3')">修改</el-button>
+                                        <el-button type="danger" size="mini" @click="setStatus(one,'4')">删除</el-button>
+                                        <!-- <el-button type="success" size="mini" @click="one.status = '2'">新增</el-button>
+                                         <el-button type="warning" size="mini" @click="one.status = '3'">修改</el-button>
+                                         <el-button type="danger" size="mini" @click="one.status = '4'">删除</el-button>-->
+                                    </div>
+                                    <div class="add-tip" slot="reference" :class="{err: (one.status != '1' && one.status != '-1')}">[[textMap[one.status] || '']]</div>
+                                </el-popover>
+                            </div>
+
                         </div>
                     </div>
                     <transition tag="div">
-                      <div>
-                        <div class="button-box"  v-if="one.showCheck&&one.show">
-            							<button  class="pass a-button" @click.stop="addChild(one)" style="font-size: 14px;width: auto;float:left;">新增子包</button>
-            						</div>
-                        <div class="edit-content" :class="{t:one.title == '基本字段'}"  v-show="one.show">
-                            <!--two-->
-                             
-                            <span v-show="one.content.length === 0">当前您还没有添加子包</span>
-                            <div class="edit two" v-for="(two,index) in one.content" :key="index">
-                                <div class="edit-title" v-if="two.title" @click="two.show = !two.show">
-                                    <span>[[two.title]]</span>
-                  									<div class="button-box">
-                  										<button class="pass success" @click.stop="saveDataTwo(two,'1')" style="font-size: 14px;width: auto;float:left;">通过</button>
-                  										<button class="pass default" @click.stop="saveDataTwo(two,'-1')" style="font-size: 14px;width: auto;float:left">取消</button>
-                  									</div>
-                                    <div  class="button-box delete-box" v-show="two.isNew">
-                                      <button class="pass" @click.stop="delNewTwo(one, index)">删除</button>
+                        <div>
+                            <div class="button-box"  v-if="one.showCheck&&one.show">
+                                <button  class="pass a-button" @click.stop="addChild(one)" style="font-size: 14px;width: auto;float:left;">新增[[one.title]]</button>
+                            </div>
+                            <div class="edit-content" :class="{t:one.title == '基本字段'}"  v-show="one.show">
+                                <!--two-->
+
+                                <span v-show="one.content.length === 0">当前您还没有添加子包</span>
+                                <div class="edit two" v-for="(two,index) in one.content" :key="index">
+                                    <div class="edit-title" v-if="two.title" @click="two.show = !two.show">
+                                        <span>[[two.title]]</span>
+                                        <div class="button-box">
+                                            <button class="pass success" @click.stop="saveDataTwo(two,'1',one)" style="font-size: 14px;width: auto;float:left;">通过</button>
+                                            <button class="pass default" @click.stop="saveDataTwo(two,'-1',one)" style="font-size: 14px;width: auto;float:left">取消</button>
+                                        </div>
+                                        <div  class="button-box delete-box">
+                                            <button class="pass" @click.stop="delNewTwo(one, index, two)">删除</button>
+                                        </div>
                                     </div>
-                                </div>
-                                <transition tag="div" v-show="two.show">
-                                    <div class="edit-content" v-show="two.show">
-                                        <!--input-->
-                                        <div class="edit-input">
-                                            <div v-for="uin of two.uInput" class="input-box" :key="uin.title">
-                                                <div class="label" v-if="uin.selectArr">
-                                                    <span>[[uin.title]]&nbsp;:&nbsp;</span>
-                                                    <select v-model="uin.select">
-                                                        <option disabled value="">请选择</option>
-                                                        <option v-for="o in uin.selectArr">[[o]]</option>
-                                                    </select>
-                                                    <div class="info-box">
-                                                        <div :class="{default: uin.status == '-1'}" @click="setStatus(uin,'-1')"></div>
-                                                        <div :class="{ok: uin.status == '1'}" @click="setStatus(uin,'1')"></div>
-                                                        <!--<div :class="{err: uin.status == '0'}" @click="uin.status = '0'"></div>-->
-                                                        <el-popover trigger="click" >
-                                                          <div style="text-align: right; margin: 0">
-                                                            <el-button type="success" size="mini" @click="setStatus(uin,'2')">新增</el-button>
-                                                            <el-button type="warning" size="mini" @click="setStatus(uin,'3')">修改</el-button>
-                                                            <el-button type="danger" size="mini" @click="setStatus(uin,'4')">删除</el-button>
-                                                          </div>
-                                                          <div class="add-tip" slot="reference" :class="{err: (uin.status != '1' && uin.status != '-1')}">[[textMap[uin.status] || '']]</div>
-                                                        </el-popover>
+                                    <transition tag="div">
+                                        <div class="edit-content" v-show="two.show">
+                                            <!--input-->
+                                            <div class="edit-input">
+                                                <div v-for="uin of two.uInput" class="input-box" :key="uin.title">
+                                                    <div class="label" v-if="uin.selectArr">
+                                                        <span>[[uin.title]]&nbsp;:&nbsp;</span>
+                                                        <select v-model="uin.select">
+                                                            <option disabled value="">请选择</option>
+                                                            <option v-for="o in uin.selectArr">[[o]]</option>
+                                                        </select>
+                                                        <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>
+                                                            <!--<div :class="{err: uin.status == '0'}" @click="uin.status = '0'"></div>-->
+                                                            <el-popover trigger="click" >
+                                                                <div style="text-align: right; margin: 0">
+                                                                    <el-button type="success" size="mini" @click="setStatus(uin,'2', two, one)">新增</el-button>
+                                                                    <el-button type="warning" size="mini" @click="setStatus(uin,'3', two, one)">修改</el-button>
+                                                                    <el-button type="danger" size="mini" @click="setStatus(uin,'4', two, one)">删除</el-button>
+                                                                </div>
+                                                                <div class="add-tip" slot="reference" :class="{err: (uin.status != '1' && uin.status != '-1')}">[[textMap[uin.status] || '']]</div>
+                                                            </el-popover>
+                                                        </div>
+                                                    </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)">
+                                                        <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>
+                                                            <!--<div :class="{err: uin.status == '0'}" @click="uin.status = '0'"></div>-->
+                                                            <el-popover trigger="click" >
+                                                                <div style="text-align: right; margin: 0">
+                                                                    <el-button type="success" size="mini" @click="setStatus(uin,'2', two, one)">新增</el-button>
+                                                                    <el-button type="warning" size="mini" @click="setStatus(uin,'3', two, one)">修改</el-button>
+                                                                    <el-button type="danger" size="mini" @click="setStatus(uin,'4', two, one)">删除</el-button>
+                                                                </div>
+                                                                <div class="add-tip" slot="reference" :class="{err: (uin.status != '1' && uin.status != '-1')}">[[textMap[uin.status] || '']]</div>
+                                                            </el-popover>
+                                                        </div>
                                                     </div>
                                                 </div>
-                                                <div class="label" v-else>
-                                                    <span @click="goText(uin.title)">[[uin.title]]&nbsp;:&nbsp;</span>
-                                                    <input type="text" v-model="uin.input" @click="goText(uin.input)">
-                                                    <div class="info-box">
-                                                        <div :class="{default: uin.status == '-1'}" @click="setStatus(uin,'-1')"></div>
-                                                        <div :class="{ok: uin.status == '1'}" @click="setStatus(uin,'1')"></div>
-                                                        <!--<div :class="{err: uin.status == '0'}" @click="uin.status = '0'"></div>-->
+                                            </div>
+                                            <!--three-->
+                                            <!--<div>
+                                                                     <div class="edit-title" v-show="one.title == '基本字段'">
+                                                    <span>候选人</span>
+                                                    <div class="info-box" >
+                                                        <div :class="{default: two.wstatus == '-1'}" @click="two.wstatus = '-1'"></div>
+                                                        <div :class="{ok: two.wstatus == '1'}" @click="two.wstatus = '1'"></div>
                                                         <el-popover trigger="click" >
                                                           <div style="text-align: right; margin: 0">
-                                                            <el-button type="success" size="mini" @click="setStatus(uin,'2')">新增</el-button>
-                                                            <el-button type="warning" size="mini" @click="setStatus(uin,'3')">修改</el-button>
-                                                            <el-button type="danger" size="mini" @click="setStatus(uin,'4')">删除</el-button>
+                                                            <el-button type="success" size="mini" @click="two.wstatus = '2'">新增</el-button>
+                                                            <el-button type="warning" size="mini" @click="two.wstatus = '3'">修改</el-button>
+                                                            <el-button type="danger" size="mini" @click="two.wstatus = '4'">删除</el-button>
                                                           </div>
-                                                          <div class="add-tip" slot="reference" :class="{err: (uin.status != '1' && uin.status != '-1')}">[[textMap[uin.status] || '']]</div>
+                                                          <div class="add-tip" slot="reference" :class="{err: (two.wstatus != '1' && two.wstatus != '-1')}">[[textMap[two.wstatus] || '']]</div>
                                                         </el-popover>
                                                     </div>
                                                 </div>
-                                            </div>
-                                        </div>
-                                        <!--three-->
-                                        <!--<div>
-										 	                    <div class="edit-title" v-show="one.title == '基本字段'">
-                                                <span>候选人</span>
-                                                <div class="info-box" >
-                                                    <div :class="{default: two.wstatus == '-1'}" @click="two.wstatus = '-1'"></div>
-                                                    <div :class="{ok: two.wstatus == '1'}" @click="two.wstatus = '1'"></div>
-                                                    <el-popover trigger="click" >
-                                                      <div style="text-align: right; margin: 0">
-                                                        <el-button type="success" size="mini" @click="two.wstatus = '2'">新增</el-button>
-                                                        <el-button type="warning" size="mini" @click="two.wstatus = '3'">修改</el-button>
-                                                        <el-button type="danger" size="mini" @click="two.wstatus = '4'">删除</el-button>
-                                                      </div>
-                                                      <div class="add-tip" slot="reference" :class="{err: (two.wstatus != '1' && two.wstatus != '-1')}">[[textMap[two.wstatus] || '']]</div>
-                                                    </el-popover>
-                                                </div>
-                                            </div>
-                                            <div class="edit three" v-for="(three,index) in two.content" :key="index">
-                                                <div class="edit-title" @click="three.show = !three.show">
-                                                    <span>[[three.title]]</span>
-                                                </div>
-                                                <div class="edit-content" v-show="three.show">
-                                                    <div class="edit-input">
-                                                        <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)">
-                                                                <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>
-                                                                  <el-popover trigger="click" >
-                                                                    <div style="text-align: right; margin: 0">
-                                                                      <el-button type="success" size="mini" @click="threeUin.status = '2'">新增</el-button>
-                                                                      <el-button type="warning" size="mini" @click="threeUin.status = '3'">修改</el-button>
-                                                                      <el-button type="danger" size="mini" @click="threeUin.status = '4'">删除</el-button>
+                                                <div class="edit three" v-for="(three,index) in two.content" :key="index">
+                                                    <div class="edit-title" @click="three.show = !three.show">
+                                                        <span>[[three.title]]</span>
+                                                    </div>
+                                                    <div class="edit-content" v-show="three.show">
+                                                        <div class="edit-input">
+                                                            <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)">
+                                                                    <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>
+                                                                      <el-popover trigger="click" >
+                                                                        <div style="text-align: right; margin: 0">
+                                                                          <el-button type="success" size="mini" @click="threeUin.status = '2'">新增</el-button>
+                                                                          <el-button type="warning" size="mini" @click="threeUin.status = '3'">修改</el-button>
+                                                                          <el-button type="danger" size="mini" @click="threeUin.status = '4'">删除</el-button>
+                                                                        </div>
+                                                                        <div class="add-tip" slot="reference" :class="{err: (threeUin.status != '1' && threeUin.status != '-1')}">[[textMap[threeUin.status] || '']]</div>
+                                                                      </el-popover>
                                                                     </div>
-                                                                    <div class="add-tip" slot="reference" :class="{err: (threeUin.status != '1' && threeUin.status != '-1')}">[[textMap[threeUin.status] || '']]</div>
-                                                                  </el-popover> 
                                                                 </div>
                                                             </div>
                                                         </div>
                                                     </div>
                                                 </div>
-                                            </div>
-                                        </div>--> 
-                                         
-                                    </div>
-                                </transition>
+                                            </div>-->
+
+                                        </div>
+                                    </transition>
+                                </div>
                             </div>
                         </div>
-                      </div>  
                     </transition>
                 </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('', false)" style="width:100px">保存</button>&nbsp;&nbsp;
-						  <button  class="code" @click.stop="window.location.href='/'" style="width:100px">下一条</button>
-						  <!--<button  class="code" @click.stop="window.location.href='/'" 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>
+                <!--<button  class="code" @click.stop="window.location.href='/'" style="width:100px">下一条</button>-->
             </div>
         </div>
     </div>
@@ -319,140 +323,146 @@ function prettyPrint(obj) {
 
 </body>
 <script>
-//基本信息
-var common={{.T.common}}
-var uInput=[];
-for(k in common){
-	var tmp={}
-	tmp.title=common[k].descript
-	tmp.input=common[k].value
-	tmp.key=common[k].key
-	if(common[k].key=="attach_discern"){
-		tmp.select=common[k].value
-    tmp.selectArr=['识别有效','识别无效']
-	}
-  if(common[k].key=="attach_ext"){ 
-		tmp.select=common[k].value
-    tmp.selectArr=['抽取正确','抽取错误']
-	}
-	tmp.status=common[k].status
-	uInput[k]=tmp	
-}
-//时间地点
-var timeplace={{.T.timeplace}}
-var tpInput=[];
-for(k in timeplace){
-	var tmp={}
-	tmp.title=timeplace[k].descript
-	tmp.input=timeplace[k].value
-	tmp.key=timeplace[k].key
-	tmp.status=timeplace[k].status
-	tpInput[k]=tmp	
-}
+    //记录是否点击保存
+    var issave = false;
+    var _id = {{.T.info._id}};
+    var nextid = {{.T.nextid}};
+    //基本信息
+    var common={{.T.common}};
+    var uInput=[];
+    for(k in common){
+        var tmp={}
+        tmp.title=common[k].descript
+        tmp.input=common[k].value
+        tmp.key=common[k].key
+        if(common[k].key=="attach_discern"){
+            tmp.select=common[k].value
+            tmp.selectArr=['识别有效','识别无效']
+        }
+        if(common[k].key=="attach_ext"){
+            tmp.select=common[k].value
+            tmp.selectArr=['抽取正确','抽取错误']
+        }
+        tmp.status=common[k].status
+        uInput[k]=tmp
+    }
+    //时间地点
+    var timeplace={{.T.timeplace}}
+    var tpInput=[];
+    for(k in timeplace){
+        var tmp={}
+        tmp.title=timeplace[k].descript
+        tmp.input=timeplace[k].value
+        tmp.key=timeplace[k].key
+        tmp.status=timeplace[k].status
+        tpInput[k]=tmp
+    }
 
-//其他信息
-var other={{.T.other}}
-var otherInput=[];
-for(k in other){
-	var tmp={}
-	tmp.title=other[k].descript
-	tmp.input=other[k].value
-	tmp.key=other[k].key
-	tmp.status=other[k].status
-  if(other[k].key=="isppp"||other[k].key=="contract_guarantee"||other[k].key=="bid_guarantee"){
-		tmp.select=other[k].value
-    tmp.selectArr=['是','否']
-	}
-	otherInput[k]=tmp	
-}
+    //其他信息
+    var other={{.T.other}}
+    var otherInput=[];
+    for(k in other){
+        var tmp={}
+        tmp.title=other[k].descript
+        tmp.input=other[k].value
+        tmp.key=other[k].key
+        tmp.status=other[k].status
+        if(other[k].key=="isppp"||other[k].key=="contract_guarantee"||other[k].key=="bid_guarantee"){
+            tmp.select=other[k].value
+            tmp.selectArr=['是','否']
+        }
+        otherInput[k]=tmp
+    }
 
-//中标候选人
-var c_worder={{.T.worder}}
-var worder_new={{.T.worder_new}}
-var c_content=[];
-for(k in c_worder){
-	var c_uInput=[];
-	for(i in c_worder[k]){
-		var tmp={}
-		tmp.title=c_worder[k][i].descript
-		tmp.input=c_worder[k][i].value
-		tmp.key=c_worder[k][i].key
-		tmp.status=c_worder[k][i].status
-		c_uInput[i]=tmp	
-	}
-	var content={};
-	content.title="候选人"
-	content.show=true
-	content.uInput=c_uInput
-  content.isNew=worder_new[k]
-	content.content=[]
-	c_content[k]=content
-}
+    //中标候选人
+    var c_worder={{.T.worder}}
+    var worder_new={{.T.worder_new}}
+    var c_content=[];
+    for(k in c_worder){
+        var c_uInput=[];
+        for(i in c_worder[k]){
+            var tmp={}
+            tmp.title=c_worder[k][i].descript
+            tmp.input=c_worder[k][i].value||''
+            tmp.key=c_worder[k][i].key
+            tmp.status=c_worder[k][i].status
+            c_uInput[i]=tmp
+        }
+        var content={};
+        content.title="候选人"
+        content.show=true
+        content.status=-1
+        content.uInput=c_uInput
+        content.ck_isnew=worder_new[k] || false
+        content.content=[]
+        c_content[k]=content
+    }
 
-//标的信息
-var purchasinglist={{.T.purchasinglist}}
-var pcl_new={{.T.pcl_new}}
-var pcl_content=[];
-for(k in purchasinglist){
-  console.log(k,pcl_new[k])
-	var c_uInput=[];
-	for(i in purchasinglist[k]){
-		var tmp={}
-		tmp.title=purchasinglist[k][i].descript
-		tmp.input=purchasinglist[k][i].value
-		tmp.key=purchasinglist[k][i].key
-		tmp.status=purchasinglist[k][i].status
-		c_uInput[i]=tmp	
-	}
-	var content={};
-	content.title="标的物"
-	content.show=true
-	content.uInput=c_uInput
-  content.isNew=pcl_new[k]
-	content.content=[]
-	pcl_content[k]=content
-}
+    //标的信息
+    var purchasinglist={{.T.purchasinglist}}
+    var pcl_new={{.T.pcl_new}}
+    var pcl_content=[];
+    for(k in purchasinglist){
+        var c_uInput=[];
+        for(i in purchasinglist[k]){
+            var tmp={}
+            tmp.title=purchasinglist[k][i].descript
+            tmp.input=purchasinglist[k][i].value
+            tmp.key=purchasinglist[k][i].key
+            tmp.status=purchasinglist[k][i].status
+            c_uInput[i]=tmp
+        }
+        var content={};
+        content.title="标的物"
+        content.show=true
+        content.status=-1
+        content.uInput=c_uInput
+        content.ck_isnew=pcl_new[k] || false
+        content.content=[]
+        pcl_content[k]=content
+    }
 
 
-//var ispackage='{{.T.ispackage}}'
-//子包信息
-var packs={{.T.packs}}
-var packskey={{.T.packskey}}
-var pkg_new={{.T.pkg_new}}
-//var ck_package='{{.T.ck_package}}'
-//分包抽查,若果有分包,默认ok
-//if(packs.length>0&&ispackage=="1"){
-//	ck_package="1"
-//}
-var p_content=[];
-for(k in packs){
-	//子包基本信息
-	var uInputs=[];
-	var pack=packs[k]["pack"]
-	for(i in pack){
-		var tmp={}
-		tmp.title=pack[i].descript
-		tmp.input=pack[i].value
-		tmp.key=pack[i].key
-		//if(pack[i].key=="bidstatus"){ 
-		//	tmp.select=pack[i].value
-	  //    	tmp.selectArr=['预告','招标','成交', '中标', '废标','流标']
-		//}
-		tmp.status=pack[i].status
-		uInputs[i]=tmp
-	}
-	var content={};
-	content.title="子包";
-	content.show=true;
-	content.uInput=uInputs;
-  content.isNew=pkg_new[k]
-  content.num = packskey[k];
-  p_content[k]=content;
-  /**
-	//子包候选人
-	var pworder=packs[k]["pack_worder"]
-	var p_in_content=[];
-	for(i in pworder){
+    //var ispackage='{{.T.ispackage}}'
+    //子包信息
+    var packs={{.T.packs}}
+    var packskey={{.T.packskey}}
+    var pkg_new={{.T.pkg_new}}
+    //var ck_package='{{.T.ck_package}}'
+    //分包抽查,若果有分包,默认ok
+    //if(packs.length>0&&ispackage=="1"){
+    //	ck_package="1"
+    //}
+    var p_content=[];
+    for(k in packs){
+        //子包基本信息
+        var uInputs=[];
+        var pack=packs[k]["pack"]
+        for(i in pack){
+            var tmp={}
+            tmp.title=pack[i].descript
+            tmp.input=pack[i].value
+            tmp.key=pack[i].key
+            //if(pack[i].key=="bidstatus"){
+            //	tmp.select=pack[i].value
+            //    	tmp.selectArr=['预告','招标','成交', '中标', '废标','流标']
+            //}
+            tmp.status=pack[i].status
+            uInputs[i]=tmp
+        }
+        var content={};
+        content.title="子包";
+        content.show=true;
+        content.status=-1
+        content.uInput=uInputs;
+        content.ck_isnew=pkg_new[k] || false
+        content.num = packskey[k];
+        p_content[k]=content;
+        /**
+         //子包候选人
+         var pworder=packs[k]["pack_worder"]
+         var p_in_content=[];
+         for(i in pworder){
 		var in_uInputs=[];
 		for(n in pworder[i]){
 			var tmp={}
@@ -472,412 +482,562 @@ for(k in packs){
 	  in_content.uInput=in_uInputs;
 		p_in_content[i]=in_content
 	}
-	content.content=p_in_content;
-	p_content[k]=content;
-  */
-}
-
-var _id = {{.T.info._id}};
-var pclf = {{.T.PurchasinglistField}};
-var pclfInput = []
-for(i in pclf){
-  for(key in pclf[i]){
-    pclfInput.push({
-      input:"",
-      key:key,
-      status:"-1",
-      title:pclf[i][key]
-    })
-  }
-}
-
-var wodf = {{.T.WinnerorderField}};
-var wodfInput = []
-for(i in wodf){
-  for(key in wodf[i]){
-    wodfInput.push({
-      input:"",
-      key:key,
-      status:"-1",
-      title:wodf[i][key]
-    })
-  }
-}
+         content.content=p_in_content;
+         p_content[k]=content;
+         */
+    }
 
-var pf = {{.T.PackageField}};
-var pfInput = []
-for(i in pf){
-  for(key in pf[i]){
-    pfInput.push({
-      input:"",
-      key:key,
-      status:"-1",
-      title:pf[i][key]
-    })
-  }
-}
-var app = new Vue({
-    el: '#app',
-	  delimiters:["[[","]]"],
-    data: {
-      textMap: ['','','增', '改', '删'],
-	    tempHtml: `{{Html (Regexp (Regexp .T.info.detail "(\\n|\\\\n)\\s+" "\n") "(`|\\n|\\\\n)+" "<br/>")}}`,
-      dataHtml: `{{Html (Regexp (Regexp .T.info.detail "(\\n|\\\\n)\\s+" "\n") "(`|\\n|\\\\n)+" "<br/>")}}`,
-      showPop: false,
-      editData: [
-        {
-          title: '基本字段',
-          show:true,
-          status:"-1",
-          content: [
-            {
-              title: '',
-              show: true,
-			        //wstatus:"-1",
-              uInput: uInput
-              //content: c_content
-            }
-          ]
-        },
-        {
-          title: '时间地点',
-          show:false,
-          status:"-1",
-          content: [
-            {
-              title: '',
-              show: true,
-			        //wstatus:"-1",
-              uInput: tpInput
-            }
-          ]
-        },
-        {
-          title: '标的信息',
-          show: false,
-          showCheck: true,
-          checkType: {{.T.pcl_isext}},
-          status: {{.T.ck_purchasinglist}},
-          content: pcl_content
-        },
-        {
-          title: '多包信息',
-          show: false,
-          showCheck: true,
-          checkType: {{.T.pkg_isext}},
-		      status: {{.T.ck_package}},
-          content: p_content
-        },
-        {
-          title: '中标候选人信息',
-          show: false,
-          showCheck: true,
-          checkType: {{.T.wodr_isext}},
-		      status: {{.T.ck_winnerorder}},
-          content: c_content
-        },
-        {
-          title: '其余信息',
-          show:false,
-          status:"-1",
-          content: [
-            {
-              title: '',
-              show: true,
-			        //wstatus:"-1",
-              uInput: otherInput
-            }
-          ]
-        }
-      ]
-    },
-    methods: {
-      //切换状态按钮
-      setStatus:function(witch,s){
-        var key = witch.key
-        //校验日期格式
-        if(key=="bidendtime"||key=="bidopentime"||key=="project_startdate"||key=="project_completedate"||key=="publishtime"||key=="signaturedate"){
-          var val = witch.input
-          var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
-          var regExp = new RegExp(reg);
-          if(!regExp.test(val)){
-            alert(witch.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
-            return
-          }
-        }
-        witch.status = s;
-      },
-      //一级保存
-      saveOneData: function (one) {
-        console.log(one.status)
-        if (one.title=="标的信息"||one.title=="多包信息"||one.title=="中标候选人信息"){
-          if(one.status ==  "-1"){
-            this.$alert(one.title+" 未标注完成")
-            return
-          }else if (one.status !="-1"){
-            var isAlert = one.content.filter(function(v) {
-              return v.uInput.filter(function (u) {
-                return u.status == '-1'
-              }).length
+    var pclf = {{.T.PurchasinglistField}};
+    var pclfInput = []
+    for(i in pclf){
+        for(key in pclf[i]){
+            pclfInput.push({
+                input:"",
+                key:key,
+                status:"2",
+                title:pclf[i][key]
             })
-            if (isAlert.length) {
-              this.$alert(one.title+" 未标注完成")
-              return
-            }
-          }
-        }
-        onetext = "["+ JSON.stringify(one) +"]";
-        console.log(onetext)
-        $.ajax({
-    			url:"/biaozhu",
-    			method:"post",
-    			data: {key:onetext,_id:_id},
-    			success:function(res){
-    				if(res){
-    					document.getElementById("com-alert-val").innerHtml="保存成功";
-    					var label1 = document.getElementById("com-alert");
-    					label1.style.display="block";
-    					setTimeout(function(){
-    						label1.style.display="none";
-    					},
-    					1000)
-    				}
-    			},
-    			error:function(err){
-    				alert(err);
-    			}
-    		});
-      },
-      //二级删除
-      delNewTwo: function (one, index) {
-        one.content.splice(index, 1)
-      },
-       /*add style*/
-      addStyle: function (data) {
-		//console.dir(data)
-        return prettyPrint(data).replace(/(checkType|showCheck|wstatus|status|key|title|input|content|uInput|selectArr|select|show|true)/g, "<mark>$1</mark>")
-      },
-      /*同步修改源码*/
-      changeText: function (boolean) {
-        try {
-          var tempText = JSON.parse(this.$refs.text.innerText.replace(/(\n|\s)/g, ''))
-          if(boolean){
-            this.tagvalues = tempText
-          }else{
-            this.editData = tempText
-          }
-        } catch (err) {
-          alert('源码修改失败')
         }
-      },
-      /*保存事件*/
-      upChange: function () {
-        var isAn =this.editData.filter(function(one){
-          if (one.title=="标的信息"||one.title=="多包信息"||one.title=="中标候选人信息"){
-            if(one.status == "-1"){
-              return false
-            }else{
-              var isAlert = one.content.filter(function(v) {
-                return v.uInput.filter(function (u) {
-                  return u.status == '-1'
-                }).length
-              })
-              return isAlert.length
-            }
-          } else {
-            return false
-          }
-        })
-        if (isAn.length) {
-          this.$alert("未标注完成")
-          return
-        }
-    		d= JSON.stringify(this.editData);
-    		$.ajax({
-    			url:"/biaozhu",
-    			method:"post",
-    			data: {key:d,_id:_id},
-    			success:function(res){
-    				if(res){
-    					document.getElementById("com-alert-val").innerHtml="保存成功";
-    					var label1 = document.getElementById("com-alert");
-    					label1.style.display="block";
-    					setTimeout(function(){
-    						label1.style.display="none";
-    					},
-    					1000)
-    				}
-    			},
-    			error:function(err){
-    				alert(err);
-    			}
-    		});
-	    },
-	    goText: function (value) {
-  		/*重置Html*/
-        this.dataHtml = this.tempHtml
-        if (!value) {return false}
-        var rs = new RegExp('(' + value + ')', 'gi')
-        
-        if (rs.test(this.dataHtml)) {
-          this.dataHtml = this.dataHtml.replace(rs, '<mark>$1</mark>')
-          /*延迟查询dom,防止dom未插入*/
-          var $this = this
-          setTimeout(function () {
-            $this.goMark()
-          }, 150)
-        } else {
-          /*重置Html*/
-          this.dataHtml = this.tempHtml
+    }
+
+    var wodf = {{.T.WinnerorderField}};
+    var wodfInput = []
+    for(i in wodf){
+        for(key in wodf[i]){
+            wodfInput.push({
+                input:"",
+                key:key,
+                status:"2",
+                title:wodf[i][key]
+            })
         }
-      },
-      goMark: function () {
-        /*滚动到第一个mark*/
-        var temp = document.querySelectorAll('mark')[0]
-        document.querySelector('.article').scrollTop = offset(temp).top - window.screen.height / 2
-      },
-	    markTag:function(n){
-    		$.ajax({
-    			url:"/markTag",
-    			method:"post",
-    			data: {tag:n,_id:_id},
-    			success:function(res){
-    				if(res){
-    					document.getElementById("com-alert-val").innerHtml="标记成功";
-    					var label1 = document.getElementById("com-alert");
-    					label1.style.display="block";
-    					setTimeout(function(){label1.style.display="none";},1000)
-    				}
-    			}
-    		});
-	    },
-      addChild: function (one) {
-        var tempNode = {}
-        switch (one.title) {
-          case "标的信息": {
-            tempNode = {
-              content: [],
-              show:true,
-              isNew: true,
-              title:"标的物",
-              uInput: JSON.parse(JSON.stringify(pclfInput))
-            }
-            break
-          }
-          case "多包信息": {pfInput
-            tempNode = {
-              content: [],
-              show:true,
-              isNew: true,
-              title:"子包",
-              uInput: JSON.parse(JSON.stringify(pfInput))
-            }
-            break
-          }
-          case "中标候选人信息": {
-            tempNode = {
-              content: [],
-              show:true,
-              isNew: true,
-              title:"候选人",
-              uInput: JSON.parse(JSON.stringify(wodfInput))
-            }
-            break
-          }
+    }
+    var pf = {{.T.PackageField}};
+    var pfInput = []
+    for(i in pf){
+        for(key in pf[i]){
+            pfInput.push({
+                input:"",
+                key:key,
+                status:"2",
+                title:pf[i][key]
+            })
         }
-        one.content.push(tempNode)
-      },
-      //保存
-      saveDataTwo:function(two,n){
-        two.uInput.forEach(function(v) {
-          var key = v.key
-            if(key=="bidendtime"||key=="bidopentime"||key=="project_startdate"||key=="project_completedate"||key=="publishtime"||key=="signaturedate"){
-              var val = v.input
-              var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
-              var regExp = new RegExp(reg);
-              if(!regExp.test(val)){
-                alert(v.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
-                return
-              }
-            }
-        	if(n =="1" && v.status == "-1"){
-            v.status = n
-          }else if (n=="-1"){
-            v.status = n
-          }
-        });
-        /**
-        two.content.forEach(function(v) {
-        	v.uInput.forEach(function(value) {
-        		if (value.input && value.input != '') {
-        			value.status = n
-        		}
-        	})
-        })
-        */
-      },
-      //保存提示
-      open:function(one, type) {
-        this.$confirm('是否保存?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          if (type) {
-            this.saveOneData(one)
-          } else {
-            this.upChange()
-          }
-        }).catch(() => {
-        });
-      },
-      saveDataOne:function(one,n){
-        //保存后的样式
-        one.content.forEach(function(v) {
-        	v.uInput.forEach(function(value) {
-            var key = value.key
-            if(key=="bidendtime"||key=="bidopentime"||key=="project_startdate"||key=="project_completedate"||key=="publishtime"||key=="signaturedate"){
-              var val = value.input
-              var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
-              var regExp = new RegExp(reg);
-              if(!regExp.test(val)){
-                alert(value.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
-                return
+    }
+    var app = new Vue({
+        el: '#app',
+        delimiters:["[[","]]"],
+        data: {
+            textMap: ['','','增', '改', '删'],
+            tempHtml: `{{Html (Regexp (Regexp .T.info.detail "(\\n|\\\\n)\\s+" "\n") "(`|\\n|\\\\n)+" "<br/>")}}`,
+            dataHtml: `{{Html (Regexp (Regexp .T.info.detail "(\\n|\\\\n)\\s+" "\n") "(`|\\n|\\\\n)+" "<br/>")}}`,
+            fileHtml: `{{Html (Regexp (Regexp .T.info.filetext "(\\n|\\\\n)\\s+" "\n") "(`|\\n|\\\\n)+" "<br/>")}}`,
+            showPop: false,
+            editData: [
+                {
+                    title: '基本字段',
+                    show:true,
+                    status:"-1",
+                    content: [
+                        {
+                            title: '',
+                            show: true,
+                            delete: false,
+                            //wstatus:"-1",
+                            uInput: uInput
+                            //content: c_content
+                        }
+                    ]
+                },
+                {
+                    title: '时间地点',
+                    show:false,
+                    status:"-1",
+                    content: [
+                        {
+                            title: '',
+                            show: true,
+                            delete: false,
+                            //wstatus:"-1",
+                            uInput: tpInput
+                        }
+                    ]
+                },
+                {
+                    title: '标的信息',
+                    show: false,
+                    showCheck: true,
+                    checkType: {{.T.ck_pclisext}},
+                    status: {{.T.ck_purchasinglist}},
+                    content: pcl_content
+                },
+                {
+                    title: '多包信息',
+                    show: false,
+                    showCheck: true,
+                    checkType: {{.T.ck_pkgisext}},
+                    status: {{.T.ck_package}},
+                    content: p_content
+                },
+                {
+                    title: '中标候选人信息',
+                    show: false,
+                    showCheck: true,
+                    checkType: {{.T.ck_wodrisext}},
+                    status: {{.T.ck_winnerorder}},
+                    content: c_content
+                },
+                {
+                    title: '其余信息',
+                        show:false,
+                        status:"-1",
+                        content: [
+                        {
+                            title: '',
+                            show: true,
+                            delete: false,
+                            //wstatus:"-1",
+                            uInput: otherInput
+                        }
+                    ]
+                }
+            ]
+        },
+        methods: {
+            openHref () {
+              if(!issave){
+                 alert("请先保存数据!")
+                 return
+              }else{
+                  window.location.href = nextid ? `/detail/${nextid}.html` : '/finishcheck';
               }
+            },
+            checkOneStatus: function (config) {
+                var tempObj = {
+                    obj: config.type ? config.one : config.two
+                }
+                if (config.type) {
+                    tempObj.list = config.one.content
+                } else {
+                    tempObj.list = config.two.uInput
+                }
+
+                var statusList = [0,0,0,0,0]
+                for(var i in tempObj.list) {
+                    var tempList = tempObj.list[i]
+                    var tempIndex = Number(tempList.status)
+                    if (tempIndex == -1) {
+                     tempIndex = 0
+                    }
+                    statusList[tempIndex] = Number(statusList[tempIndex]) + 1
+                }
+
+                if (statusList[1] > 0) {
+                    tempObj.obj.status = 1
+                }
+
+                if (statusList[4] > 0 || statusList[3] > 0 || statusList[2] > 0) {
+                    tempObj.obj.status = 3
+                }
+                if (statusList[4] === tempObj.list.length) {
+                    tempObj.obj.status = 4
+                }
+                if (statusList[3] === tempObj.list.length) {
+                    tempObj.obj.status = 3
+                }
+                if (statusList[2] === tempObj.list.length) {
+                    tempObj.obj.status = 2
+                }
+                if (statusList[0] === tempObj.list.length) {
+                    tempObj.obj.status = -1
+                }
+                if (!config.type) {
+                    this.checkOneStatus({
+                        one: config.one,
+                        two: config.two,
+                        type: true
+                    })
+                }
+            },
+            //切换状态按钮
+            setStatus:function(witch,s, two, one){
+                var key = witch.key
+                //校验日期格式
+                if(key=="bidendtime"||key=="bidopentime"||key=="project_startdate"||key=="project_completedate"||key=="publishtime"||key=="signaturedate"){
+                    var val = witch.input
+                    if(val!=""){
+                        var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
+                        var regExp = new RegExp(reg);
+                        if(!regExp.test(val)){
+                            alert(witch.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
+                            return
+                        }
+                    }
+                }
+                witch.status = s;
+                if (two) {
+                    this.checkOneStatus({
+                        one: one,
+                        two: two,
+                        type: false
+                    })
+                }
+            },
+            //二级删除
+            delNewTwo: function (one, index, two) {
+                if (two.ck_isnew) {
+                    one.content.splice(index, 1)
+                } else {
+                    two.status = 4
+                    this.saveDataTwo(two, 4, one)
+                }
+                this.checkOneStatus({
+                    one: one,
+                    two: two,
+                    type: true
+                })
+            },
+            /*add style*/
+            addStyle: function (data) {
+                //console.dir(data)
+                return prettyPrint(data).replace(/(checkType|showCheck|wstatus|status|key|title|input|content|uInput|selectArr|select|show|true)/g, "<mark>$1</mark>")
+            },
+            /*同步修改源码*/
+            changeText: function (boolean) {
+                try {
+                    var tempText = JSON.parse(this.$refs.text.innerText.replace(/(\n|\s)/g, ''))
+                    if(boolean){
+                        this.tagvalues = tempText
+                    }else{
+                        this.editData = tempText
+                    }
+                } catch (err) {
+                    alert('源码修改失败')
+                }
+            },
+            goText: function (value) {
+                /*重置Html*/
+                this.dataHtml = this.tempHtml
+                if (!value) {return false}
+                var rs = new RegExp('(' + value + ')', 'gi')
+
+                if (rs.test(this.dataHtml)) {
+                    this.dataHtml = this.dataHtml.replace(rs, '<mark>$1</mark>')
+                    /*延迟查询dom,防止dom未插入*/
+                    var $this = this
+                    setTimeout(function () {
+                        $this.goMark()
+                    }, 150)
+                } else {
+                    /*重置Html*/
+                    this.dataHtml = this.tempHtml
+                }
+            },
+            goMark: function () {
+                /*滚动到第一个mark*/
+                var temp = document.querySelectorAll('mark')[0]
+                document.querySelector('.article').scrollTop = offset(temp).top - window.screen.height / 2
+            },
+            markTag:function(n){
+                $.ajax({
+                    url:"/markTag",
+                    method:"post",
+                    data: {tag:n,_id:_id},
+                    success:function(res){
+                        if(res){
+                            document.getElementById("com-alert-val").innerHtml="标记成功";
+                            var label1 = document.getElementById("com-alert");
+                            label1.style.display="block";
+                            setTimeout(function(){label1.style.display="none";},1000)
+                        }
+                    }
+                });
+            },
+            addChild: function (one) {
+                var tempNode = {}
+                switch (one.title) {
+                    case "标的信息": {
+                        tempNode = {
+                            content: [],
+                            show:true,
+                            ck_isnew: true,
+                            status: 2,
+                            title:"标的物",
+                            uInput: JSON.parse(JSON.stringify(pclfInput))
+                        }
+                        break
+                    }
+                    case "多包信息": {pfInput
+                        tempNode = {
+                            content: [],
+                            show:true,
+                            status: 2,
+                            ck_isnew: true,
+                            title:"子包",
+                            uInput: JSON.parse(JSON.stringify(pfInput))
+                        }
+                        break
+                    }
+                    case "中标候选人信息": {
+                        tempNode = {
+                            content: [],
+                            show:true,
+                            status: 2,
+                            ck_isnew: true,
+                            title:"候选人",
+                            uInput: JSON.parse(JSON.stringify(wodfInput))
+                        }
+                        break
+                    }
+                }
+                // if (one.status >= 2) {
+                //     one.status = '2'
+                // }
+                one.content.push(tempNode)
+                this.checkOneStatus({
+                    one: one,
+                    type: true
+                })
+            },
+            //保存
+            saveDataTwo:function(two,n, one){
+                two.uInput.forEach(function(v) {
+                    var key = v.key
+                    if(key=="bidendtime"||key=="bidopentime"||key=="project_startdate"||key=="project_completedate"||key=="publishtime"||key=="signaturedate"){
+                        var val = v.input
+                        if(val!=""){
+                            var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
+                            var regExp = new RegExp(reg);
+                            if(!regExp.test(val)){
+                                alert(v.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
+                                return
+                            }
+                        }
+                    }
+                    if(n =="1" && v.status == "-1"){
+                        v.status = n
+                    } else if (n=="-1"){
+                        v.status = n
+                    } else if (n=="4"){
+                        v.status = n
+                    }
+                });
+                two.status = n
+                this.checkOneStatus({
+                    one: one,
+                    two: two,
+                    type: false
+                })
+                /**
+                 two.content.forEach(function(v) {
+                v.uInput.forEach(function(value) {
+                    if (value.input && value.input != '') {
+                        value.status = n
+                    }
+                })
+            })
+                 */
+            },
+            saveDataOne:function(one,n){
+                //保存后的样式
+                var _this = this
+                one.content.forEach(function(v) {
+                    v.uInput.forEach(function(value) {
+                        var key = value.key
+                        if(n==1){
+                            if(key=="bidendtime"||key=="bidopentime"||key=="project_startdate"||key=="project_completedate"||key=="publishtime"||key=="signaturedate"){
+                                var val = value.input
+                                if(val != ""){
+                                    var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
+                                    var regExp = new RegExp(reg);
+                                    if(!regExp.test(val)){
+                                        alert(value.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
+                                        return
+                                    }
+                                }
+                            }
+                        }
+                        // 取消全部,通过时判断状态是否处于修改新增等
+                        if (n =="1" && value.status == "-1"){
+                            value.status = n
+                        }else if (n=="-1"){
+                            value.status = n
+                        }
+                    })
+
+                    _this.checkOneStatus({
+                        two: v,
+                        one: one,
+                        type: false
+                    })
+                });
+                // one.content.forEach(function(v) {
+                //     if (v.content) {
+                //         v.content.forEach(function(i) {
+                //             i.uInput.forEach(function(value) {
+                //                 if (value.input && value.input != '') {
+                //                     value.status = n
+                //                 }
+                //             })
+                //         })
+                //     }
+                // });
+                //保存当前标记
+            },
+            //验证保存提示
+            open:function(stype) {
+                this.$confirm('是否保存?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    this.upChange(stype)
+                }).catch(() => {
+                });
+            },
+            //保存事件
+            upChange: function (stype) {
+                var resultStatus = false
+
+                if (stype == 1) {
+                    var checkAllKey = this.editData.filter(function (one) {
+                        var otherOne = one.content.filter(function(v) {
+                            return v.uInput.filter(function (u) {
+                                return u.status == '-1'
+                            }).length
+                        })
+                        if ((one.title=="标的信息"||one.title=="多包信息"||one.title=="中标候选人信息") && (one.status == "-1")) {
+                            return true
+                        } else {
+                            return otherOne.length
+                        }
+                    })
+                    resultStatus = !Boolean(checkAllKey.length)
+                } else {
+                    var checkOnlyKey = this.editData.filter(function (one) {
+                        if (one.title=="标的信息"||one.title=="多包信息"||one.title=="中标候选人信息") {
+                            if (one.status == "-1") {
+                                return false
+                            } else {
+                                if (one.content.length === 0) {
+                                    return true
+                                }
+                                var otherOne = one.content.filter(function(v) {
+                                    return v.uInput.filter(function (u) {
+                                        return u.status == '-1'
+                                    }).length
+                                })
+                                return !(otherOne.length > 0)
+                            }
+                        } else {
+                            var otherOne = one.content.filter(function(v) {
+                                return v.uInput.filter(function (u) {
+                                    return u.status != '-1'
+                                }).length
+                            })
+                            return otherOne.length
+                        }
+                    })
+                    resultStatus = Boolean(checkOnlyKey.length)
+                }
+
+                if (!resultStatus) {
+                    this.$alert("未标注完成");
+                    return
+                }
+                var d= JSON.stringify(this.editData);
+                console.log(d)
+                $.ajax({
+                    url:"/biaozhu",
+                    method:"post",
+                    data: {key:d,_id:_id,stype:stype},
+                    success:function(res){
+                        if(res){
+                            document.getElementById("com-alert-val").innerHtml="保存成功";
+                            var label1 = document.getElementById("com-alert");
+                            label1.style.display="block";
+                            setTimeout(function(){
+                                label1.style.display="none";
+                            },1000)
+                            issave = true//保存成功
+                        }
+                    },
+                    error:function(err){
+                        alert(err);
+                    }
+                });
             }
-            if (n =="1" && value.status == "-1"){
-              value.status = n
-            }else if (n=="-1"){
-               value.status = n
-            }
-        	})
-        });
-        one.content.forEach(function(v) {
-          if (v.content) {
-            v.content.forEach(function(i) {
-        		i.uInput.forEach(function(value) {
-        			if (value.input && value.input != '') {
-        				value.status = n
-        			}
-        		})
-        	  })
-          }
-        });
-        //保存当前标记
-      }
-    }
-  })
-function offset(elem) {
-    if(!elem) elem = this;
+            /**
+            //保存提示
+            open:function(one, type) {
+                this.$confirm('是否保存?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    if (type) {
+                        this.saveOneData(one)
+                    } else {
+                        this.upChange()
+                    }
+                }).catch(() => {
+                });
+            },
+            //一级保存
+            saveOneData: function (one) {
+                console.log(one.status)
+                if (one.title=="标的信息"||one.title=="多包信息"||one.title=="中标候选人信息"){
+                    if(one.status ==  "-1"){
+                        this.$alert(one.title+" 未标注完成")
+                        return
+                    }else if (one.status !="-1"){
+                        var isAlert = one.content.filter(function(v) {
+                            return v.uInput.filter(function (u) {
+                                return u.status == '-1'
+                            }).length
+                        })
+                        if (isAlert.length) {
+                            this.$alert(one.title+" 未标注完成")
+                            return
+                        }
+                    }
+                }
+                onetext = "["+ JSON.stringify(one) +"]";
+                console.log(onetext)
+                $.ajax({
+                    url:"/biaozhu",
+                    method:"post",
+                    data: {key:onetext,_id:_id},
+                    success:function(res){
+                        if(res){
+                            document.getElementById("com-alert-val").innerHtml="保存成功";
+                            var label1 = document.getElementById("com-alert");
+                            label1.style.display="block";
+                            setTimeout(function(){
+                                    label1.style.display="none";
+                                },
+                                1000)
+                        }
+                    },
+                    error:function(err){
+                        alert(err);
+                    }
+                });
+            },
+             */
+        }
+    })
+    function offset(elem) {
+        if(!elem) elem = this;
 
-    var x = elem.offsetLeft;
-    var y = elem.offsetTop;
+        var x = elem.offsetLeft;
+        var y = elem.offsetTop;
 
-    while (elem = elem.offsetParent) {
-        x += elem.offsetLeft;
-        y += elem.offsetTop;
+        while (elem = elem.offsetParent) {
+            x += elem.offsetLeft;
+            y += elem.offsetTop;
+        }
+        return { left: x, top: y };
     }
-    return { left: x, top: y };
-}
 </script>
 </html>

+ 224 - 144
src/web/templates/list.html

@@ -1,42 +1,50 @@
 <!doctype html>
 <html lang="en">
- <head>
-	<meta charset="UTF-8">
-	<title>信息抽查</title>
-	<link href="css/bootstrap.min.css" rel="stylesheet">
-	<script src="js/jquery.js"></script>
-	<script src="js/bootstrap.min.js"></script>
-	<script src="js/util.js"></script>
-  <script src="/js/vue.min.js"></script>
+<head>
+    <meta charset="UTF-8">
+    <title>信息抽查</title>
+    <link href="css/bootstrap.min.css" rel="stylesheet">
+    <link href="css/page.css" rel="stylesheet">
+    <script src="js/jquery.js"></script>
+    <script src="js/bootstrap.min.js"></script>
+    <script src="js/util.js"></script>
+    <script src="/js/vue.min.js"></script>
     <script src="/js/index.js"></script>
-   <link rel="stylesheet" href="/css/index.css">
-  <style>
-  .form-horizontal {
-    min-height: 40px;
-  }
-  .row-box label{
-    white-space: nowrap;
-  }
-  .row-box select {
-    width: 100px;
-  }
-  .row-box input {
-    margin-left: 15px;
-    width: 5em;
-  }
-  .row-box + .row-box {
-    margin-left: 15px;
-  }
-  .row-box + button {
-    margin-left: 15px;
-  }
-  .row-box {
-    display: flex;
-    flex-direction: row;
-    align-items: center;
-  }
-  </style>
- </head>
+    <script src="/js/jquery-page.js"></script>
+    <link rel="stylesheet" href="/css/index.css">
+    <style>
+        .form-horizontal {
+            min-height: 40px;
+        }
+
+        .row-box label {
+            white-space: nowrap;
+        }
+
+        .row-box select {
+            width: 100px;
+        }
+
+        .row-box input {
+            margin-left: 15px;
+            width: 5em;
+        }
+
+        .row-box + .row-box {
+            margin-left: 15px;
+        }
+
+        .row-box + button {
+            margin-left: 15px;
+        }
+
+        .row-box {
+            display: flex;
+            flex-direction: row;
+            align-items: center;
+        }
+    </style>
+</head>
  <body>
  <div>
   <div class="modal fade" id="loadingModal" backdrop="static" keyboard="false">
@@ -47,87 +55,118 @@
           </div>
       </div>
   </div>
-
-	<div class="col-md-12" style="border-right: 1px double #EEEEEE;">
-		<div style="padding:30px 0px 0px 0px">
-			<form action="/list" class="form-horizontal"  role="form">
-				<div class="col-md-3">
-					<input type="input" name="spidercode" class="form-control" value="{{.T.spidercode}}" placeholder="请输入爬虫代码"/>
-				</div>
-        <div class="col-md-1" style="padding-left: 0;">
-          <input type="input" name="db" disabled class="form-control" value="{{.T.dbname}}" placeholder="请输入库名"/>
-        </div>
-        <div class="col-md-1"  style="padding-left: 0">
-          <input type="input" name="coll" class="form-control" value="{{.T.fromtable}}" placeholder="请输入表名"/>
-        </div>
-				<div class="col-md-7 row-box"  style="padding-left: 0">
-					<div class=" row-box"  style="padding-left: 0">
-            <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="tender" {{if eq .T.type "tender"}}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="tender" {{if eq .T.type "tender"}}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="最小值"/>
-            <input type="input" name="maxval" id="maxval" style="display:none" class="form-control" value="{{.T.max}}" placeholder="最大值"/>
-					</div>
-					<!--<div class="col-md-2">
-					  	<label class="checkbox-inline">
-					     	<input type="checkbox" name="ispackage"  value="1">分包数据
-					    </label>
-					</div>-->
-					<button type="submit" class="btn btn-primary">查看</button>
-				</div>
-			</form>
-		</div>
-  	
-    <div class="col-md-12">
-      <div class="form-group col-md-6" style="padding-left: 0">
-            <textarea class="form-control" name="descript" id="es"></textarea>
-      </div>
-      <div class="form-group col-md-5" style="margin-top: 10px;margin-left: -14px;">
-        <div class="col-md-2"  style="padding-left: 0">
-          <input type="input" id="importcoll" class="form-control" value="" placeholder="库表名"/>
-        </div>
-        <button class="btn btn-primary" onclick='getescount()'>
-  				Es导入数据
-  			</button>
-        <button class="btn btn-primary" onclick='importbyexcel()'>
-				  导入Excel
-			  </button>
-      </div>
-			<iframe srcdoc="<form id='uploadform' method='post' enctype='multipart/form-data' action='/importbyexcel'><input type='file' name='xlsx' /><input type='input' id='excelcoll' name='excelcoll' /></form>" height=0 scrolling=no class="hide"  id="fileframe">
-			</iframe>
-		</div>
-		<hr style="border:1 double" width="100%">
-		<div id="spcontent" class="column">
-			{{range $k,$v:=.T.list}}
-			 <div>
-				<span style="font-size:18px"><script>document.write({{$k}}+1)</script>:</span>&nbsp;
-				<a href="/detail/{{$v._id}}.html" target="_blank" style="font-size:18px">{{$v.title}}</a>
-			</div>
-			{{end}}
-		</div>
+  <div class="col-md-12" style="border-right: 1px double #EEEEEE;">
+         <div style="padding:30px 0px 0px 0px">
+             <form action="/list" class="form-horizontal" role="form">
+                 <div style="display: none">
+                     <input type="input" name="pagenum" id="pagenum"  class="form-control" value="{{.T.pagenum}}"/>
+                 </div>
+                 <div class="col-md-3">
+                     <input type="input" name="spidercode" class="form-control" value="{{.T.spidercode}}"
+                            placeholder="请输入爬虫代码"/>
+                 </div>
+                 <div class="col-md-1" style="padding-left: 0;">
+                     <input type="input" name="db" disabled class="form-control" value="{{.T.dbname}}"
+                            placeholder="请输入库名"/>
+                 </div>
+                 <div class="col-md-1" style="padding-left: 0">
+                     <input type="input" name="coll" class="form-control" value="{{.T.fromtable}}" placeholder="请输入表名"/>
+                 </div>
+                 <div class="col-md-7 row-box" style="padding-left: 0">
+                     <div class=" row-box" style="padding-left: 0">
+                         <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="tender" {{if eq .T.type "tender"}}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="tender" {{if eq .T.type "tender"}}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="最小值"/>
+                         <input type="input" name="maxval" id="maxval" style="display:none" class="form-control"
+                                value="{{.T.max}}" placeholder="最大值"/>
+                         <div id="boexists" style="display:none;margin-left: -29px;">
+<!--                             <label class="checkbox-inline">-->
+<!--                                 <input type="checkbox" id="hasno" name="hasno"  value="1">是否存在-->
+<!--                             </label>-->
+                             <input id="hasno" type="checkbox" name="hasno" value="true"/>
+                             <label style="margin-left: -28px;">包含不存在</label>
+                         </div>
+                     </div>
+                     <!--<div class="col-md-2">
+                           <label class="checkbox-inline">
+                              <input type="checkbox" name="ispackage"  value="1">分包数据
+                         </label>
+                     </div>-->
+                     <button type="submit" class="btn btn-primary" id="submitForm">查看</button>
+                 </div>
+             </form>
+		 </div>
+         <div class="col-md-12">
+             <div class="form-group col-md-5" style="padding-left: 0">
+                 <textarea class="form-control" name="descript" id="es"></textarea>
+             </div>
+             <div class="form-group col-md-6" style="margin-top: 10px;margin-left: -14px;">
+                 <div class="col-md-3" style="padding-left: 0">
+                     <input type="input" id="importcoll" class="form-control" value="" placeholder="库表名"/>
+                 </div>
+                 <button class="btn btn-primary" onclick='getescount()'>
+                     Es导入数据
+                 </button>
+                 <button class="btn btn-primary" onclick='importbyexcel()'>
+                     导入Excel
+                 </button>
+             </div>
+             <iframe srcdoc="<form id='uploadform' method='post' enctype='multipart/form-data' action='/importbyexcel'><input type='file' name='xlsx' /><input type='input' id='excelcoll' name='excelcoll' /></form>"
+                     height=0 scrolling=no class="hide" id="fileframe">
+             </iframe>
+         </div>
+         <hr style="border:1 double" width="100%">
+         <div  class="col-md-12">
+             <div class="form-group col-md-5" style="margin-left: -15px;">
+                 <h4>
+                     已验/总数:{{.T.checkednum}}/{{.T.allnum}}
+                 </h4>
+             </div>
+             <div>
+                 <button class="btn btn-primary" style="margin-left: 17px;" onclick="updateinfo()">刷新</button>
+             </div>
+         </div>
+         <hr style="border:1 double" width="100%">
+         <div id="spcontent" class="column">
+             {{range $k,$v:=.T.list}}
+             <div>
+                 <span style="font-size:18px"><script>document.write({{ $v }}["num"])</script>:</span>&nbsp;
+                 <a href="/detail/{{$v._id}}.html" target="_blank" style="font-size:18px;color:{{if $v.checked}}green{{else}}#428bca{{end}}">{{$v.title}}</a>
+             </div>
+             {{end}}
+         </div>
 	</div>
+  <div style="text-align: center;">
+     <div id="pager" class="pager clearfix">
+     </div>
+  </div>
 </div>
- 
+
  </body>
 
 <script>
 var vueApp = new Vue()
 $(function(){
+  //是否不存在标记
+  if( {{.T.hasno}} ){
+    $("#hasno").attr("checked",true);
+  }
   for(i in {{.T.topsubtype}}){
-    var val = {{.T.topsubtype}}[i]
     var selected = ""
     if({{.T.type}} == {{.T.topsubtype}}[i]){
       selected = "selected"
@@ -148,8 +187,9 @@ $(function(){
   if(fk=="budget"||fk=="bidamount"){
     $("#maxval").css("display","");
     $("#minval").css("display","");
+    $("#boexists").css("display","");
   }
-  
+
 })
 function getescount(){
   var importcoll = $("#importcoll").val();
@@ -173,7 +213,7 @@ function getescount(){
 }
 
 function importbyes(count,msg,text,coll){
-  vueApp.$confirm('数据量:'+count, msg, {
+  vueApp.$confirm('es查询数据量:'+count, msg, {
     confirmButtonText: '确认导入',
     cancelButtonText: '取消',
     type: 'warning'
@@ -185,20 +225,25 @@ function importbyes(count,msg,text,coll){
 
 function importes(estext,coll){
   //showLoading()
-  $.ajax({
-    	url:"/importbyes",
-    	method:"post",
-    	data: {"estext":estext,"coll":coll},
-    	success:function(res){
-        hideLoading()
-    		if(res&&res.success){
-          alert("数据导入成功")
-          //setTimeout(alert("数据导入成功"),200)
-    		}else{
-          alert(res.msg)
-          //setTimeout(alert(res.msg),200)
+    $.ajax({
+        url: "/importbyes",
+        method: "post",
+        data: {"estext": estext, "coll": coll},
+        success: function (r) {
+            hideLoading()
+            if(r){
+                alert(r.msg)
+            }else{
+                alert("导入失败")
+            }
+            // if (res && res.success) {
+            //     alert("数据导入成功")
+            //     //setTimeout(alert("数据导入成功"),200)
+            // } else {
+            //     alert(res.msg)
+            //     //setTimeout(alert(res.msg),200)
+            // }
         }
-    	}
     });
 }
 
@@ -208,7 +253,7 @@ function importbyexcel(){
     alert("请输入导入表!")
     return
   }
-   $("#excelcoll").val(importcoll);
+  $("#excelcoll").val(importcoll);
   $("#fileframe").contents().find("#excelcoll").val(importcoll);
 	var f=$("#fileframe").contents().find("input");
 		f.get(0).click();
@@ -218,25 +263,31 @@ function importbyexcel(){
     		showMsg("文件格式非法",
     		function() {});
     	} else {
-    		$(this).parent().submit();
-        showLoading()
-    		var ret = setInterval(function() {
-    			var f = $(window.frames[0].document).find("form");
-    			if (f.length == 0) {
-            hideLoading()
-    				var b = $(window.frames[0].document).find("body").text();
-            if (b){
-              var r = JSON.parse(b)
-              if(r&&r.success){
-                alert("数据导入成功")
-              }else{
-                alert(r.msg)
-              }
-            }
-            $(window.frames[0].document).find("body").append("<form id='uploadform' method='post' enctype='multipart/form-data' action='/importbyexcel'><input type='file' name='xlsx' /><input type='input' id='excelcoll' name='excelcoll' /></form>");
-    			}
-    		},
-    		500)
+            $(this).parent().submit();
+            showLoading()
+            var ret = setInterval(function () {
+                var f = $(window.frames[0].document).find("form");
+                if (f.length == 0) {
+                    hideLoading()
+                    var b = $(window.frames[0].document).find("body").text();
+                    if (b) {
+                        var r = JSON.parse(b)
+                        if(r){
+                            console.log(r.msg)
+                            alert(r.msg)
+                        }else{
+                            alert("导入失败")
+                        }
+                        // if (r && r.success) {
+                        //     alert("数据导入成功")
+                        // } else {
+                        //     alert(r.msg)
+                        // }
+                    }
+                    $(window.frames[0].document).find("body").append("<form id='uploadform' method='post' enctype='multipart/form-data' action='/importbyexcel'><input type='file' name='xlsx' /><input type='input' id='excelcoll' name='excelcoll' /></form>");
+                }
+            },
+            500)
     	}
     })
 }
@@ -254,11 +305,40 @@ $("#field").change(function(){
   if($(this).val()=="bidamount"||$(this).val()=="budget"){
     $("#minval").css("display","");
     $("#maxval").css("display","");
+    $("#boexists").css("display","");
   }else{
     $("#minval").css("display","none");
     $("#maxval").css("display","none");
+    $("#boexists").css("display","none");
   }
 });
+
+//分页
+$("#pager").zPager({
+    totalData: {{.T.allnum}},//数据总条数
+    current: {{.T.pagenum}},
+    pageData: 50,//每页数据条数
+    //htmlBox: $('#wraper'),
+    btnShow: true,
+    ajaxSetData: false
+});
+function currentPage(currentPage, type){
+    /*
+        触发页码数位置: Page/js/jquery.z-pager.js 64行
+    */
+    console.log("当前页码数:" + currentPage);
+}
+
+
+function submitform(number){
+    console.log(number,{{.T.pagenum}})
+    $("#pagenum").val(number);
+    $("#submitForm").trigger('click');
+}
+
+function updateinfo(){
+    $("#submitForm").trigger('click');
+}
 </script>
 
 </html>