jianghan7 vor 1 Jahr
Ursprung
Commit
174e0f6c9b

+ 2 - 2
exportData/config.json

@@ -1,5 +1,5 @@
 {
-  "mgoAddr": "127.0.0.1:27092",
+  "mgoAddr": "192.168.3.71:29099",
   "mgoDbName": "wjh",
   "mgoColl": "bidding",
   "mgoSize": 10,
@@ -9,7 +9,7 @@
   "fieldsSort": ["matchkey", "area", "city", "title", "subtype", "detail", "publishtime", "href", "jybxhref", "projectname",
     "projectcode", "projectscope", "budget", "bidamount", "bidopentime", "buyer", "buyerperson", "buyertel", "agency", "s_winner",
     "winnerperson", "winnertel", "company_phone", "company_email", "id"],
-  "fields_purchase": [ "area", "city", "title", "subtype", "detail", "publishtime", "href", "jybxhref", "projectname",
+  "fields_purchase": ["area", "city", "title", "subtype", "detail", "publishtime", "href", "jybxhref", "projectname",
     "projectcode", "projectscope", "id"],
   "fields": {
     "matchkey": "信息匹配词",

+ 2 - 2
exportData/main.go

@@ -310,7 +310,7 @@ func main() {
 									if util.ObjToString(a1["winner"]) != "" {
 										winner = append(winner, util.ObjToString(a1["winner"]))
 									}
-									bidamount += util.Float64All(a1["bidamount"])
+									bidamount = util.Float64All(a1["bidamount"])
 								}
 							}
 						}
@@ -318,7 +318,7 @@ func main() {
 					for _, v := range FieldsArr {
 						if v == "s_winner" && len(winner) > 0 {
 							row.AddCell().SetValue(strings.Join(winner, ","))
-						} else if v == "bidamount" && bidamount != 0 {
+						} else if v == "bidamount" {
 							row.AddCell().SetValue(bidamount)
 						} else if v == "winnerperson" || v == "winnertel" {
 							row.AddCell().SetValue("")

+ 129 - 0
isrepeat/main.go

@@ -0,0 +1,129 @@
+package main
+
+import (
+	"flag"
+	"fmt"
+	"github.com/tealeg/xlsx"
+	"go.mongodb.org/mongo-driver/bson"
+	mgo "mongodb"
+	qu "qfw/util"
+	"util"
+)
+
+var (
+	path string
+
+	Mgo *mgo.MongodbSim
+)
+
+func init() {
+	Mgo = &mgo.MongodbSim{
+		MongodbAddr: "192.168.3.166:27082", // 127.0.0.1:27084
+		Size:        5,
+		DbName:      "jyqykhfw",
+	}
+	Mgo.InitPool()
+}
+
+func main() {
+	flag.StringVar(&path, "f", "", "文件路径")
+	flag.Parse()
+	if path != "" {
+		file, err := xlsx.OpenFile(path)
+		if err != nil {
+			panic(err)
+		}
+		sheet := file.Sheets[0]
+		cellFieldName := map[int]string{}
+		for rn, row := range sheet.Rows {
+			if rn == 0 {
+				for index, cell := range row.Cells {
+					//if cell.Value == "招标人" || cell.Value == "中标人" || cell.Value == "中标金额" {
+					//	qu.Debug(cell.Value, index)
+					//}
+					if v := FieldsMap[cell.Value]; v != "" {
+						cellFieldName[index] = v
+					}
+				}
+			} else {
+				q := bson.M{}
+				for i, f := range cellFieldName {
+					if val := row.Cells[i].Value; val != "" && (f == "s_winner" || f == "buyer") {
+						q[f] = val
+					}
+					if val := row.Cells[i].Value; val != "" && f == "bidamount" {
+						if qu.Float64All(val) != 0 {
+							q[f] = qu.Float64All(val)
+						}
+					}
+				}
+				info, _ := Mgo.FindOne("zglt_history", q)
+				if len(*info) > 0 {
+					row.Cells[12].SetValue(-1)
+				} else {
+					row.Cells[12].SetValue(1)
+				}
+			}
+		}
+		err = file.Save(path)
+	} else {
+		flag.PrintDefaults()
+	}
+}
+
+var FieldsMap = map[string]string{
+	"是否优选":    "is_push",
+	"运营商中标标签": "tagname",
+	"主体公司":    "tagname2",
+	"中标人":     "s_winner",
+	"招标人":     "buyer",
+	"中标金额":    "bidamount",
+}
+
+func main1() {
+	flag.StringVar(&path, "f", "", "文件路径")
+	flag.Parse()
+	if path != "" {
+		file, err := xlsx.OpenFile(path)
+		if err != nil {
+			panic(err)
+		}
+		sheet := file.Sheets[0]
+		idcolnum := -1
+		cellFieldName := map[int]string{}
+		update := make(map[string]interface{})
+		for rn, row := range sheet.Rows {
+			if rn == 0 {
+				for index, cell := range row.Cells {
+					if cell.Value == "唯一标识" || cell.Value == "标讯编码(infoID)" { //id所在列
+						idcolnum = index
+					}
+					if v := FieldsMap[cell.Value]; v != "" {
+						cellFieldName[index] = v
+					}
+				}
+				if idcolnum == -1 {
+					break
+				}
+				continue
+			} else {
+				id := row.Cells[idcolnum].String()
+				id = util.SE.DecodeString(id)
+				for i, f := range cellFieldName {
+					if val := row.Cells[i].Value; val != "" {
+						if f == "is_push" {
+							update[f] = qu.IntAll(val)
+						} else {
+							update[fmt.Sprintf("v_baseinfo.%s", f)] = val
+						}
+					}
+				}
+				qu.Debug(id, update)
+				Mgo.UpdateById("f_sourceinfo_chinaunicom_zb_data", id, bson.M{"$set": update})
+			}
+		}
+		err = file.Save(path)
+	} else {
+		flag.PrintDefaults()
+	}
+}

+ 4 - 0
src/front/front.go

@@ -71,11 +71,13 @@ type Front struct {
 	projectGroupTaskRetrieve xweb.Mapper `xweb:"/front/project/task/retrieve"`     //用户组任务收回
 	projectGroupTaskRepulse  xweb.Mapper `xweb:"/front/project/task/repulse"`      //用户组任务打回
 	projectGroupTaskClose    xweb.Mapper `xweb:"/front/project/task/close"`        //用户组任务关闭
+	taskSyncJy               xweb.Mapper `xweb:"/front/project/task/syncjycm"`     //数据推送剑鱼客户管理平台
 	projectGetEntnameList    xweb.Mapper `xweb:"/front/project/getEntnameList"`    //模糊查询公司名称
 	projectIsExists          xweb.Mapper `xweb:"/front/project/isExists"`          //判断项目名称是否存在
 	projectCheckSuc          xweb.Mapper `xweb:"/front/project/check/success"`     //项目达标数据质检通过
 	projectPassSuc           xweb.Mapper `xweb:"/front/project/pass/success"`      //项目数据通过
 	projectTagNum            xweb.Mapper `xweb:"/front/project/tagNum"`            //项目标注数据量
+	projectData              xweb.Mapper `xweb:"/front/project/data"`
 
 	//user task
 	userTaskSave       xweb.Mapper `xweb:"/front/user/task/save"`        //用户任务分发
@@ -94,6 +96,8 @@ type Front struct {
 	groupUserTaskList    xweb.Mapper `xweb:"/front/group/user/task/list"`    //用户组下用户任务列表
 	groupStatsTask       xweb.Mapper `xweb:"/front/group/task/stats"`        //剑鱼任务组统计
 	groupStatsTaskExport xweb.Mapper `xweb:"/front/group/task/stats/export"` //剑鱼任务组统计任务导出
+	groupExportData      xweb.Mapper `xweb:"/front/project/task/exportdata"` //任务组数据导出
+	groupImportData      xweb.Mapper `xweb:"/front/project/task/importdata"` //任务组数据导入
 
 	checkResultWb xweb.Mapper `xweb:"/front/group/check/wb/result"` //外包质检结果
 

+ 197 - 5
src/front/group.go

@@ -5,12 +5,15 @@ import (
 	"fmt"
 	"github.com/shopspring/decimal"
 	"github.com/tealeg/xlsx"
+	"go.mongodb.org/mongo-driver/bson"
+	"io"
 	"mongodb"
 	"os"
 	qu "qfw/util"
 	"sort"
 	"strconv"
 	"strings"
+	"sync"
 	"time"
 	"util"
 )
@@ -287,6 +290,63 @@ func (f *Front) GroupTaskDeliver() {
 	f.ServeJson(map[string]interface{}{"success": success, "msg": msg})
 }
 
+func (f *Front) TaskSyncJy() {
+	defer qu.Catch()
+	pid := f.GetString("pid")
+	sourceinfo := f.GetString("s_sourceinfo")
+	groupTaskId := f.GetString("taskid")
+	c := syncJyData(sourceinfo, groupTaskId, pid)
+	//info, _ := util.Mgo.FindById(util.TASKCOLLNAME, groupTaskId, bson.M{"i_givenum": 1})
+	if c > 0 {
+		util.Mgo.UpdateById(util.TASKCOLLNAME, groupTaskId, bson.M{"$set": bson.M{"sendflag": true}})
+		f.ServeJson(map[string]interface{}{"success": true, "msg": "数据推送成功", "count": c})
+	} else {
+		f.ServeJson(map[string]interface{}{"success": false, "msg": "数据推送失败"})
+	}
+
+}
+
+func syncJyData(source, tid, pid string) int {
+	sess := util.Mgo.GetMgoConn()
+	defer util.Mgo.DestoryMongoConn(sess)
+
+	ch := make(chan bool, 5)
+	wg := &sync.WaitGroup{}
+
+	var q bson.M
+	if pid == "650c310bc88c29b90a54b1c4" {
+		// 联通中标数据 特殊处理
+		q = bson.M{"s_grouptaskid": tid, "is_push": 1}
+	} else {
+		q = bson.M{"s_grouptaskid": tid, "sendflag": nil}
+	}
+	query := sess.DB(util.Mgo.DbName).C(source).Find(q).Select(nil).Iter()
+	count := 0
+	for tmp := make(map[string]interface{}); query.Next(&tmp); count++ {
+		ch <- true
+		wg.Add(1)
+		go func(tmp map[string]interface{}) {
+			defer func() {
+				<-ch
+				wg.Done()
+			}()
+			info := tmp["v_baseinfo"].(map[string]interface{})
+			info["createtime"] = time.Now().Unix()
+			if qu.ObjToString(info["id"]) == "" {
+				info["id"] = tmp["id"]
+			}
+			info["isOptimization"] = 1
+			util.MgoJy.Save("usermail", info)
+			util.Mgo.UpdateById(source, tmp["_id"], bson.M{"$set": bson.M{"sendflag": true}})
+
+		}(tmp)
+		tmp = make(map[string]interface{})
+	}
+	wg.Wait()
+	qu.Debug(fmt.Sprintf("推送数据成功,推送成功: %d条", count))
+	return count
+}
+
 func checkStat(sourceinfo, groupTaskId, pid string, mp map[string]interface{}) {
 	sess := util.Mgo.GetMgoConn()
 	defer util.Mgo.DestoryMongoConn(sess)
@@ -303,14 +363,26 @@ func checkStat(sourceinfo, groupTaskId, pid string, mp map[string]interface{}) {
 	query := map[string]interface{}{"s_grouptaskid": groupTaskId}
 	result := sess.DB(util.Mgo.DbName).C(sourceinfo).Find(query).Iter()
 
-	fields := (*projcet)["v_fields"].(map[string]interface{})
+	fields := qu.ObjArrToMapArr((*projcet)["v_fields"].([]interface{}))
+	fs := make(map[string]string)
+	for _, v := range fields {
+		key := qu.ObjToString(v["key"])
+		if key == "extend" && v["child"] != nil {
+			for _, v1 := range qu.ObjArrToMapArr(v["child"].([]interface{})) {
+				key1 := qu.ObjToString(v1["key"])
+				fs[key1] = qu.ObjToString(v1["descript"])
+			}
+		} else {
+			fs[key] = qu.ObjToString(v["descript"])
+		}
+	}
 	purchasingTag := false // 标的物统计标识
 	var strs []string
-	if fields["purchasinglist"] != nil {
+	if fs["purchasinglist"] != "" {
 		purchasingTag = true
-		delete(fields, "purchasinglist")
+		delete(fs, "purchasinglist")
 	}
-	for k := range fields {
+	for k := range fs {
 		strs = append(strs, k)
 	}
 	pNum, pEffNum := 0, 0               // 标的物数量, 标的物有效数量
@@ -403,7 +475,7 @@ func checkStat(sourceinfo, groupTaskId, pid string, mp map[string]interface{}) {
 	sort.Strings(strs)
 	for _, v := range strs {
 		tmp1 := make(map[string]interface{})
-		tmp1["name"] = fields[v]
+		tmp1["name"] = fs[v]
 		tmp1["num1"] = markNum
 		tmp1["num2"] = checkNum
 		tmp1["num3"] = cmaps[v]
@@ -733,5 +805,125 @@ func (f *Front) CheckResultWb() {
 		f.T["userSelect"] = userSelect
 		_ = f.Render("project/check_result.html", &f.T)
 	}
+}
 
+func (f *Front) GroupExportData() {
+	defer qu.Catch()
+	sourceinfo := f.GetString("s_sourceinfo")
+	tid := f.GetString("taskid")
+	q := bson.M{"s_grouptaskid": tid}
+	count := util.Mgo.Count(sourceinfo, q)
+	if count > 0 {
+		file, err := xlsx.OpenFile("web/model/taskexportdata.xlsx")
+		if err != nil {
+			qu.Debug("Load Excel Model Error")
+			f.ServeJson("加载脚本失败")
+			return
+		}
+		sheet := file.Sheets[0]
+		fields := map[string]interface{}{
+			"id":                      1,
+			"v_baseinfo.s_winner":     1,
+			"v_baseinfo.buyer":        1,
+			"v_baseinfo.projectcode":  1,
+			"v_baseinfo.projectname":  1,
+			"v_baseinfo.title":        1,
+			"v_baseinfo.bidamount":    1,
+			"v_baseinfo.area":         1,
+			"v_baseinfo.city":         1,
+			"tagname":                 1,
+			"tagname2":                1,
+			"v_baseinfo.is_effective": 1,
+		}
+		list, _ := util.Mgo.Find(sourceinfo, q, nil, fields, false, -1, -1)
+		for _, l := range *list {
+			row := sheet.AddRow()
+			baseinfo := l["v_baseinfo"].(map[string]interface{})
+			row.AddCell().SetValue(qu.ObjToString(l["id"]))
+			row.AddCell().SetValue(qu.ObjToString(baseinfo["s_winner"]))
+			row.AddCell().SetValue(qu.ObjToString(baseinfo["buyer"]))
+			row.AddCell().SetValue(qu.ObjToString(baseinfo["projectcode"]))
+			row.AddCell().SetValue(qu.ObjToString(baseinfo["projectname"]))
+			row.AddCell().SetValue(qu.ObjToString(baseinfo["title"]))
+			row.AddCell().SetValue(qu.ObjToString(baseinfo["bidamount"]))
+			row.AddCell().SetValue(qu.ObjToString(baseinfo["area"]))
+			row.AddCell().SetValue(qu.ObjToString(baseinfo["city"]))
+			row.AddCell().SetValue(qu.ObjToString(l["tagname"]))
+			row.AddCell().SetValue(qu.ObjToString(l["tagname2"]))
+			row.AddCell().SetValue(qu.ObjToString(baseinfo["is_effective"]))
+		}
+		fname := fmt.Sprintf(modelpath, time.Now().Unix())
+		qu.Debug("File Name:", fname)
+		err = file.Save(fname)
+		if err != nil {
+			qu.Debug("Save Excel" + fname + "Error")
+			f.ServeJson("导出失败")
+			return
+		}
+		arr := strings.Split(fname, "/")
+		f.ResponseWriter.Header().Add("Content-Disposition", fmt.Sprintf("attachment; filename=%s", arr[len(arr)-1]))
+		f.ServeFile(fname)
+		go func(path string) {
+			time.Sleep(time.Second * 30)
+			os.Remove(path)
+		}(fname)
+	} else {
+		f.ServeJson("没有数据")
+	}
+}
+
+var FieldsMap = map[string]string{
+	"是否优选":    "is_push",
+	"运营商中标标签": "tagname",
+	"主体公司":    "tagname2",
+	"中标人":     "s_winner",
+	"招标人":     "buyer",
+	"中标金额":    "bidamount",
+}
+
+func (f *Front) GroupImportData() {
+	defer qu.Catch()
+	sourceinfo := f.GetString("s_sourceinfo")
+	mf, _, err := f.GetFile("xlsx")
+	if err != nil {
+		f.ServeJson(map[string]interface{}{"success": false, "msg": "数据导入失败"})
+	}
+	binary, _ := io.ReadAll(mf)
+	xls, _ := xlsx.OpenBinary(binary)
+	sheet := xls.Sheets[0]
+	rows := sheet.Rows
+	idcolnum := -1
+	cellFieldName := map[int]string{}
+	update := make(map[string]interface{})
+	count := 0
+	for rn, row := range rows {
+		if rn == 0 {
+			for index, cell := range row.Cells {
+				if cell.Value == "唯一标识" || cell.Value == "信息标识" { //id所在列
+					idcolnum = index
+				}
+				if v := FieldsMap[cell.Value]; v != "" {
+					cellFieldName[index] = v
+				}
+			}
+			if idcolnum == -1 {
+				break
+			}
+			continue
+		} else {
+			id := row.Cells[idcolnum].String()
+			for i, f := range cellFieldName {
+				if val := row.Cells[i].Value; val != "" {
+					if f == "is_push" {
+						update[f] = qu.IntAll(val)
+					} else {
+						update[fmt.Sprintf("v_baseinfo.%s", f)] = val
+					}
+				}
+			}
+			util.Mgo.UpdateById(sourceinfo, id, bson.M{"$set": update})
+			count++
+		}
+	}
+	f.ServeJson(map[string]interface{}{"success": true, "msg": "数据导入成功", "count": count})
 }

+ 28 - 1
src/front/project.go

@@ -1370,7 +1370,7 @@ func (f *Front) ProjectTagNum() {
 }
 
 func (f *Front) ProjectField() {
-	defer qu.Catch() //项目id
+	defer qu.Catch()
 	if f.Method() == "POST" {
 		pid := f.GetString("pid")
 		d1 := f.GetString("fields") //配置字段
@@ -1444,3 +1444,30 @@ func (f *Front) ProjectField() {
 		_ = f.Render("project/project_field.html", &f.T)
 	}
 }
+
+func (f *Front) ProjectData() {
+	defer qu.Catch() //项目id
+	pid := f.GetString("pid")
+	sourceinfo := f.GetString("sourceinfo")
+	if f.Method() == "POST" {
+		start, _ := f.GetInteger("start")
+		limit, _ := f.GetInteger("length")
+		draw, _ := f.GetInteger("draw")
+		searchStr := f.GetString("search[value]")
+		searchStr = strings.TrimSpace(searchStr)
+		query := map[string]interface{}{}
+		if searchStr != "" {
+			query["$or"] = []interface{}{
+				map[string]interface{}{"v_baseinfo.projectname": map[string]interface{}{"$regex": searchStr}},
+				map[string]interface{}{"v_baseinfo.title": map[string]interface{}{"$regex": searchStr}},
+			}
+		}
+		list, _ := util.Mgo.Find(sourceinfo, query, bson.M{"_id": 1}, nil, false, start, limit)
+		count := util.Mgo.Count(sourceinfo, query)
+		f.ServeJson(map[string]interface{}{"draw": draw, "data": *list, "recordsFiltered": count, "recordsTotal": count})
+	} else {
+		f.T["pid"] = pid
+		f.T["sourceinfo"] = sourceinfo
+		_ = f.Render("project/project_data.html", &f.T)
+	}
+}

+ 206 - 189
src/front/remark.go

@@ -48,11 +48,9 @@ func (f *Front) RemarkList() {
 				bson.M{"v_baseinfo.title": bson.M{"$regex": search}},
 			}
 		}
-		qu.Debug(query)
 		field := map[string]interface{}{"v_baseinfo.title": 1, "b_istag": 1, "i_ckdata": 1}
 		info, _ := util.Mgo.Find(sourceinfo, query, `{"_id": 1}`, field, false, start, limit)
 		count := util.Mgo.Count(sourceinfo, query)
-		qu.Debug(query, sourceinfo, count)
 		f.ServeJson(map[string]interface{}{
 			"draw":            draw,
 			"data":            *info,
@@ -74,9 +72,9 @@ func (f *Front) RemarkDetail() {
 	coll := f.GetString("s_sourceinfo")
 	project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, `{"v_fields": 1}`)
 	fs, _ := (*project)["v_fields"].([]interface{})
-	rep := getDetail(did, coll, qu.ObjArrToMapArr(fs)) //获取本条公告的信息
-	f.T["otherInfo"] = rep["otherInfo"]                //展示关联公告信息
-	f.T["moreInfo"] = rep["moreInfo"]                  //更多关联公告信息
+	rep := getDetail(did, coll, "remark", qu.ObjArrToMapArr(fs)) //获取本条公告的信息
+	f.T["otherInfo"] = rep["otherInfo"]                          //展示关联公告信息
+	f.T["moreInfo"] = rep["moreInfo"]                            //更多关联公告信息
 	f.T["pid"] = pid
 	f.T["tid"] = tid
 	f.T["did"] = did
@@ -93,7 +91,6 @@ func (f *Front) RemarkDetail() {
 		f.T["PurchasinglistField"] = m["field"]
 	}
 	if rep["proc"] != nil {
-		qu.Debug(rep["proc"])
 		m := rep["proc"].(map[string]interface{})
 		f.T["procurementlist"] = m["procurementlist"]
 		f.T["pcl_new_1"] = m["pcl_new_1"]
@@ -118,12 +115,12 @@ func (f *Front) RemarkDetail() {
 	f.T["ck_winnerorder"] = rep["ck_winnerorder"]
 	f.T["keyword"] = rep["matchkey"]
 	f.T["nextid"] = GetNextDataId(did, coll, tid) //下一条id
+	f.T["lastid"] = GetLastDataId(did, coll, tid) //上一条id
 	_ = f.Render("project/remark_detail.html", &f.T)
 }
 
-func getDetail(id, coll string, fs []map[string]interface{}) map[string]interface{} {
+func getDetail(id, coll, stype string, fs []map[string]interface{}) map[string]interface{} {
 	rep := map[string]interface{}{}
-	qu.Debug(fs)
 	infoTmp, _ := util.Mgo.FindById(coll, id, ``)
 	rep["s_excp_info"] = (*infoTmp)["s_excp_info"]
 	baseInfo := (*infoTmp)["v_baseinfo"].(map[string]interface{}) //字段值
@@ -143,7 +140,7 @@ func getDetail(id, coll string, fs []map[string]interface{}) map[string]interfac
 	}
 	rep["matchkey"] = baseInfo["matchkey"]
 	rep["info"] = baseInfo
-	common, other, pruM, proM, pkgM, winM, enbArr := setExtComMap(baseInfo, bzInfo, fs)
+	common, other, pruM, proM, pkgM, winM, enbArr := setExtComMap(baseInfo, bzInfo, fs, stype)
 	rep["common"] = common
 	rep["other"] = other
 	rep["pkg"] = pkgM                             // 多包信息
@@ -174,7 +171,7 @@ func getDetail(id, coll string, fs []map[string]interface{}) map[string]interfac
 }
 
 // 拼装抽取common值
-func setExtComMap(info, bzInfo map[string]interface{}, fs []map[string]interface{}) ([]interface{}, []interface{},
+func setExtComMap(info, bzInfo map[string]interface{}, fs []map[string]interface{}, stype string) ([]interface{}, []interface{},
 	map[string]interface{}, map[string]interface{}, map[string]interface{}, map[string]interface{}, []string) {
 	var common []interface{}             // 基本字段信息
 	var other []interface{}              //自定义字段信息
@@ -190,7 +187,7 @@ func setExtComMap(info, bzInfo map[string]interface{}, fs []map[string]interface
 			if v["child"] != nil {
 				enbArr = append(enbArr, key)
 				child := qu.ObjArrToMapArr(v["child"].([]interface{}))
-				purchasinglist, isNewStatus := setPurchasingMap(info, child)
+				purchasinglist, isNewStatus := setPurchasingMap(info, child, stype)
 				purM["purchasinglist"] = purchasinglist
 				purM["pcl_new"] = isNewStatus
 				var m []map[string]string
@@ -205,8 +202,7 @@ func setExtComMap(info, bzInfo map[string]interface{}, fs []map[string]interface
 			if v["child"] != nil {
 				enbArr = append(enbArr, key)
 				child := qu.ObjArrToMapArr(v["child"].([]interface{}))
-				purchasinglist_1, isNewStatus1 := setPurchasingMap1(info, child)
-				qu.Debug(purchasinglist_1, isNewStatus1)
+				purchasinglist_1, isNewStatus1 := setPurchasingMap1(info, child, stype)
 				proM["procurementlist"] = purchasinglist_1
 				proM["pcl_new_1"] = isNewStatus1
 				var m []map[string]string
@@ -221,7 +217,7 @@ func setExtComMap(info, bzInfo map[string]interface{}, fs []map[string]interface
 			if v["child"] != nil {
 				enbArr = append(enbArr, key)
 				child := qu.ObjArrToMapArr(v["child"].([]interface{}))
-				packs, packskey, pkg_new := setPaceMap(info, child)
+				packs, packskey, pkg_new := setPaceMap(info, child, stype)
 				pkgM["packs"] = packs
 				pkgM["packskey"] = packskey
 				pkgM["pkg_new"] = pkg_new
@@ -237,7 +233,7 @@ func setExtComMap(info, bzInfo map[string]interface{}, fs []map[string]interface
 			if v["child"] != nil {
 				enbArr = append(enbArr, key)
 				child := qu.ObjArrToMapArr(v["child"].([]interface{}))
-				worder, worderNew := setWorderMap(info, child)
+				worder, worderNew := setWorderMap(info, child, stype)
 				winM["worder"] = worder
 				winM["worder_new"] = worderNew
 				var m []map[string]string
@@ -252,7 +248,11 @@ func setExtComMap(info, bzInfo map[string]interface{}, fs []map[string]interface
 			if v["child"] != nil {
 				enbArr = append(enbArr, key)
 				for _, tm := range qu.ObjArrToMapArr(v["child"].([]interface{})) {
-					tm["status"] = "1"
+					if stype == "remark" {
+						tm["status"] = "1"
+					} else {
+						tm["status"] = "-1"
+					}
 					tm["value"] = info[qu.ObjToString(tm["key"])]
 					other = append(other, tm)
 				}
@@ -275,7 +275,11 @@ func setExtComMap(info, bzInfo map[string]interface{}, fs []map[string]interface
 			} else {
 				v["value"] = info[key]
 			}
-			v["status"] = "1"
+			if stype == "remark" {
+				v["status"] = "1"
+			} else {
+				v["status"] = "-1"
+			}
 			common = append(common, v)
 		}
 	}
@@ -286,7 +290,7 @@ func setExtComMap(info, bzInfo map[string]interface{}, fs []map[string]interface
 }
 
 // 拼装子包信息
-func setPaceMap(info map[string]interface{}, confpack []map[string]interface{}) ([]map[string]interface{}, []string, []bool) {
+func setPaceMap(info map[string]interface{}, confpack []map[string]interface{}, stype string) ([]map[string]interface{}, []string, []bool) {
 	//bzpack := bzInfo["package"].(map[string]interface{})
 	packs := map[string]map[string]interface{}{}
 	var sortpackskey []string
@@ -296,7 +300,7 @@ func setPaceMap(info map[string]interface{}, confpack []map[string]interface{})
 			if tmppack, ok := tmpackage.(map[string]interface{}); ok {
 				isNew, _ := tmppack["isnew"].(bool)
 				status := "-1"
-				if tmppack["package_son"] != nil {
+				if stype == "remark" && tmppack["package_son"] != nil {
 					status = "1"
 				}
 				isNewPkg[k] = isNew
@@ -311,8 +315,8 @@ func setPaceMap(info map[string]interface{}, confpack []map[string]interface{})
 						"key":      key,
 						"descript": cpack["descript"],
 					}
-					if tmppack[fmt.Sprint(tp["key"])] != nil {
-						tp["value"] = tmppack[qu.ObjToString(tp["key"])]
+					if tmppack[key] != nil {
+						tp["value"] = tmppack[key]
 					} else {
 						tp["value"] = ""
 					}
@@ -378,7 +382,7 @@ func setPaceMap(info map[string]interface{}, confpack []map[string]interface{})
 }
 
 // 拼装标的物
-func setPurchasingMap(info map[string]interface{}, pur []map[string]interface{}) ([]interface{}, []map[string]interface{}) {
+func setPurchasingMap(info map[string]interface{}, pur []map[string]interface{}, stype string) ([]interface{}, []map[string]interface{}) {
 	var purchasinglists []interface{}
 	//isNewPcl := []bool{} //记录子包是否是新增的
 	var isNewAndStatus []map[string]interface{}
@@ -388,7 +392,7 @@ func setPurchasingMap(info map[string]interface{}, pur []map[string]interface{})
 				//isNew, _ := pcl["isnew"].(bool)
 				isNew := false
 				status := "-1"
-				if pcl["purchasinglist_son"] != nil {
+				if stype == "remark" && pcl["purchasinglist_son"] != nil {
 					status = "1"
 				}
 				//isNewPcl = append(isNewPcl, isNew)
@@ -420,7 +424,7 @@ func setPurchasingMap(info map[string]interface{}, pur []map[string]interface{})
 }
 
 // 采购意向
-func setPurchasingMap1(info map[string]interface{}, pro []map[string]interface{}) ([]interface{}, []map[string]interface{}) {
+func setPurchasingMap1(info map[string]interface{}, pro []map[string]interface{}, stype string) ([]interface{}, []map[string]interface{}) {
 	var procurementlists []interface{}
 	//isNewPcl := []bool{} //记录子包是否是新增的
 	var isNewAndStatus []map[string]interface{}
@@ -430,7 +434,7 @@ func setPurchasingMap1(info map[string]interface{}, pro []map[string]interface{}
 				//isNew, _ := pcl["isnew"].(bool)
 				isNew := false
 				status := "-1"
-				if pcl["purchasinglist_son"] != nil {
+				if stype == "remark" && pcl["purchasinglist_son"] != nil {
 					status = "1"
 				}
 				//isNewPcl = append(isNewPcl, isNew)
@@ -462,7 +466,7 @@ func setPurchasingMap1(info map[string]interface{}, pro []map[string]interface{}
 }
 
 // 拼装中标候选人
-func setWorderMap(info map[string]interface{}, winnerorder []map[string]interface{}) ([]interface{}, []map[string]interface{}) {
+func setWorderMap(info map[string]interface{}, winnerorder []map[string]interface{}, stype string) ([]interface{}, []map[string]interface{}) {
 	//基本参数--中标候选人
 	worders := []interface{}{}
 	isNewAndStatus := []map[string]interface{}{}
@@ -472,7 +476,7 @@ func setWorderMap(info map[string]interface{}, winnerorder []map[string]interfac
 				//isNew, _ := wd["isnew"].(bool)
 				isNew := false
 				status := "-1"
-				if wd["winnerorder_son"] != nil {
+				if stype == "remark" && wd["winnerorder_son"] != nil {
 					status = "1"
 				}
 				isNewAndStatus = append(isNewAndStatus, map[string]interface{}{"isnew": isNew, "status": status})
@@ -600,7 +604,7 @@ func DealData(tmpLen int, publishtime float64, tmp []map[string]interface{}, mor
 // GetNextDataId 获取当前数据下一条的id
 func GetNextDataId(id, coll, tid string) string {
 	nextIdQuery := map[string]interface{}{
-		"b_istag": false,
+		//"b_istag": false,
 		"_id": map[string]interface{}{
 			"$gt": mgo.StringTOBsonId(id),
 		},
@@ -608,21 +612,44 @@ func GetNextDataId(id, coll, tid string) string {
 	if tid != "" {
 		nextIdQuery["s_usertaskid"] = tid
 	}
-	qu.Debug(nextIdQuery)
 	one, _ := util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
-	qu.Debug((*one)[0])
 	if len(*one) == 1 && len((*one)[0]) > 0 {
 		return mgo.BsonIdToSId((*one)[0]["_id"])
 	} else {
-		delete(nextIdQuery, "_id")
-		qu.Debug(nextIdQuery)
-		one, _ = util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
-		if len(*one) == 1 && len((*one)[0]) > 0 {
-			if mgo.BsonIdToSId((*one)[0]["_id"]) == id {
-				return ""
-			}
-			return mgo.BsonIdToSId((*one)[0]["_id"])
-		}
+		//delete(nextIdQuery, "_id")
+		//one, _ = util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
+		//if len(*one) == 1 && len((*one)[0]) > 0 {
+		//	if mgo.BsonIdToSId((*one)[0]["_id"]) == id {
+		//		return ""
+		//	}
+		//	return mgo.BsonIdToSId((*one)[0]["_id"])
+		//}
+	}
+	return ""
+}
+
+func GetLastDataId(id, coll, tid string) string {
+	nextIdQuery := map[string]interface{}{
+		//"b_istag": false,
+		"_id": map[string]interface{}{
+			"$lt": mgo.StringTOBsonId(id),
+		},
+	}
+	if tid != "" {
+		nextIdQuery["s_usertaskid"] = tid
+	}
+	one, _ := util.Mgo.Find(coll, nextIdQuery, `{"_id":-1}`, `{"_id":1}`, true, 0, 1)
+	if len(*one) == 1 && len((*one)[0]) > 0 {
+		return mgo.BsonIdToSId((*one)[0]["_id"])
+	} else {
+		//delete(nextIdQuery, "_id")
+		//one, _ = util.Mgo.Find(coll, nextIdQuery, `{"_id":-1}`, `{"_id":-1}`, true, 0, 1)
+		//if len(*one) == 1 && len((*one)[0]) > 0 {
+		//	if mgo.BsonIdToSId((*one)[0]["_id"]) == id {
+		//		return ""
+		//	}
+		//	return mgo.BsonIdToSId((*one)[0]["_id"])
+		//}
 	}
 	return ""
 }
@@ -633,7 +660,7 @@ func GetNextDataId1(id, coll, tid, tag string) string {
 		"_id": map[string]interface{}{
 			"$gt": mgo.StringTOBsonId(id),
 		},
-		"b_check": false,
+		//"b_check": false,
 	}
 	if tid != "" {
 		// 数据有任务 查询带上标注标记
@@ -646,19 +673,52 @@ func GetNextDataId1(id, coll, tid, tag string) string {
 	} else {
 		nextIdQuery["i_ckdata"] = 2
 	}
-	qu.Debug(nextIdQuery, coll)
 	one, _ := util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
 	if len(*one) == 1 && len((*one)[0]) > 0 {
 		return mgo.BsonIdToSId((*one)[0]["_id"])
 	} else {
-		delete(nextIdQuery, "_id")
-		one, _ = util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
-		if len(*one) == 1 && len((*one)[0]) > 0 {
-			if mgo.BsonIdToSId((*one)[0]["_id"]) == id {
-				return ""
-			}
-			return mgo.BsonIdToSId((*one)[0]["_id"])
+		//delete(nextIdQuery, "_id")
+		//one, _ = util.Mgo.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
+		//if len(*one) == 1 && len((*one)[0]) > 0 {
+		//	if mgo.BsonIdToSId((*one)[0]["_id"]) == id {
+		//		return ""
+		//	}
+		//	return mgo.BsonIdToSId((*one)[0]["_id"])
+		//}
+	}
+	return ""
+}
+
+func GetLastDataId1(id, coll, tid, tag string) string {
+	nextIdQuery := map[string]interface{}{
+		"_id": map[string]interface{}{
+			"$lt": mgo.StringTOBsonId(id),
+		},
+		//"b_check": false,
+	}
+	if tid != "" {
+		// 数据有任务 查询带上标注标记
+		nextIdQuery["i_ckdata"] = 2
+		if tag == "group" {
+			nextIdQuery["s_grouptaskid"] = tid
+		} else {
+			nextIdQuery["s_usertaskid"] = tid
 		}
+	} else {
+		nextIdQuery["i_ckdata"] = 2
+	}
+	one, _ := util.Mgo.Find(coll, nextIdQuery, `{"_id":-1}`, `{"_id":1}`, true, 0, 1)
+	if len(*one) == 1 && len((*one)[0]) > 0 {
+		return mgo.BsonIdToSId((*one)[0]["_id"])
+	} else {
+		//delete(nextIdQuery, "_id")
+		//one, _ = util.Mgo.Find(coll, nextIdQuery, `{"_id":-1}`, `{"_id":1}`, true, 0, 1)
+		//if len(*one) == 1 && len((*one)[0]) > 0 {
+		//	if mgo.BsonIdToSId((*one)[0]["_id"]) == id {
+		//		return ""
+		//	}
+		//	return mgo.BsonIdToSId((*one)[0]["_id"])
+		//}
 	}
 	return ""
 }
@@ -693,7 +753,6 @@ func (f *Front) CheckList() {
 				map[string]interface{}{"s_projectname": map[string]interface{}{"$regex": search}},
 			}
 		}
-		qu.Debug("Query:", query)
 		count := util.Mgo.Count(util.TASKCOLLNAME, query)
 		list, _ := util.Mgo.Find(util.TASKCOLLNAME, query, bson.M{"_id": -1}, nil, false, start, limit)
 		for _, l := range *list {
@@ -744,7 +803,6 @@ func (f *Front) CheckData() {
 		} else if s_excp == "-1" {
 			query["s_excp"] = map[string]interface{}{"$exists": true}
 		}
-		qu.Debug(query)
 		count := util.Mgo.Count(sourceinfo, query)
 		fields := map[string]interface{}{"v_baseinfo.title": 1, "b_check": 1, "i_ckdata": 1, "s_login": 1, "b_istag": 1, "s_excp": 1, "s_excp_info": 1}
 		info, _ := util.Mgo.Find(sourceinfo, query, `{"_id": 1}`, fields, false, start, limit)
@@ -822,6 +880,14 @@ func (f *Front) CheckJyData() {
 		max := f.GetString("maxval")
 		hasno, _ := f.GetBool("hasno") //是否存在
 		notag, _ := f.GetBool("notag") //是否标注
+		searchStr := f.GetString("search[value]")
+		searchStr = strings.TrimSpace(searchStr)
+		if searchStr != "" {
+			query["$or"] = []interface{}{
+				map[string]interface{}{"v_baseinfo.projectname": map[string]interface{}{"$regex": searchStr}},
+				map[string]interface{}{"v_baseinfo.title": map[string]interface{}{"$regex": searchStr}},
+			}
+		}
 		if status == "1" {
 			query["b_check"] = true
 		} else if status == "-1" {
@@ -906,7 +972,6 @@ func (f *Front) CheckJyData() {
 		} else if !fieldScreen && notag {
 			query["i_ckdata"] = 0
 		}
-		qu.Debug(query)
 		count := util.Mgo.Count(sourceinfo, query)
 		fields := map[string]interface{}{"v_baseinfo.title": 1, "b_check": 1, "i_ckdata": 1, "s_login": 1, "b_istag": 1, "s_excp": 1, "s_excp_info": 1, "b_isEff": 1}
 		info, _ := util.Mgo.Find(sourceinfo, query, `{"_id": 1}`, fields, false, start, limit)
@@ -944,7 +1009,6 @@ func (f *Front) CheckJyData() {
 				f.T["taskNum"] = (*project)["i_importnum"]
 				query1["i_ckdata"] = 2
 			}
-			qu.Debug(sourceinfo, query1)
 			count := util.Mgo.Count(sourceinfo, query1)
 			//f.T["taskNum"] = count
 			f.T["taskTagNum"] = count
@@ -987,9 +1051,9 @@ func (f *Front) CheckDetail() {
 	coll := f.GetString("s_sourceinfo")
 	project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, `{"v_fields": 1}`)
 	fs, _ := (*project)["v_fields"].([]interface{})
-	rep := getDetail(did, coll, qu.ObjArrToMapArr(fs)) //获取本条公告的信息
-	f.T["otherInfo"] = rep["otherInfo"]                //展示关联公告信息
-	f.T["moreInfo"] = rep["moreInfo"]                  //更多关联公告信息
+	rep := getDetail(did, coll, "check", qu.ObjArrToMapArr(fs)) //获取本条公告的信息
+	f.T["otherInfo"] = rep["otherInfo"]                         //展示关联公告信息
+	f.T["moreInfo"] = rep["moreInfo"]                           //更多关联公告信息
 	f.T["s_excp_info"] = rep["s_excp_info"]
 	f.T["pid"] = pid
 	f.T["tid"] = tid
@@ -1007,7 +1071,6 @@ func (f *Front) CheckDetail() {
 		f.T["PurchasinglistField"] = m["field"]
 	}
 	if rep["proc"] != nil {
-		qu.Debug(rep["proc"])
 		m := rep["proc"].(map[string]interface{})
 		f.T["procurementlist"] = m["procurementlist"]
 		f.T["pcl_new_1"] = m["pcl_new_1"]
@@ -1030,13 +1093,9 @@ func (f *Front) CheckDetail() {
 	f.T["ck_purchasinglist"] = rep["ck_purchasinglist"]
 	f.T["ck_package"] = rep["ck_package"]
 	f.T["ck_winnerorder"] = rep["ck_winnerorder"]
-	f.T["worder"] = rep["worder"]
-	f.T["packs"] = rep["packs"]
-	f.T["packskey"] = rep["packskey"]
-	f.T["timeplace"] = rep["timeplace"]
-	f.T["purchasinglist"] = rep["purchasinglist"]
 	f.T["topsubtype"] = util.TopSubStypeArr2
 	f.T["nextid"] = GetNextDataId1(did, coll, tid, qu.ObjToString(f.GetSession("check"))) //下一条id
+	f.T["lastid"] = GetLastDataId1(did, coll, tid, qu.ObjToString(f.GetSession("check"))) //下一条id
 	_ = f.Render("project/check_detail.html", &f.T)
 }
 
@@ -1052,7 +1111,6 @@ func (f *Front) CheckSave() {
 	infoId := f.GetString("s_infoid")
 	sourceInfo := f.GetString("s_sourceinfo")
 	pid := f.GetString("pid")
-	qu.Debug("Data ID:", infoId)
 	project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"s_name": 1, "v_fields": 1})
 	data := f.GetString("data")
 	err := json.Unmarshal([]byte(data), &obj)
@@ -1089,10 +1147,10 @@ func (f *Front) CheckSave() {
 		}
 	} else {
 		for _, val := range obj {
-			title := qu.ObjToString(obj[0]["title"])
+			title := qu.ObjToString(val["title"])
 			content, ok := val["content"].([]interface{})
 			status := qu.IntAll(val["status"])
-			if !ok {
+			if !ok && len(content) > 0 {
 				qu.Debug("Content Error")
 				continue
 			}
@@ -1121,7 +1179,7 @@ func (f *Front) CheckSave() {
 			status := qu.IntAll(tmpStatus)            //此次被标注字段的状态
 			markedStatus := qu.IntAll(tagInfo[field]) //历史标注状态
 			if status == 1 && markedStatus != 0 {     //此次标注结果为正确,且有历史标注记录,不做修改
-				qu.Debug("已标注字段field---", field)
+				//qu.Debug("已标注字段field---", field)
 				//delete(tagSet, field)
 				delete(baseSet, field)
 				//continue
@@ -1139,16 +1197,20 @@ func (f *Front) CheckSave() {
 	for k, _ := range baseUnset {
 		allTagFields[k] = nil
 	}
-	//qu.Debug("allTagFields===", allTagFields)
-	//qu.Debug("tagSet===", tagSet)
-
 	// 质检时,标注标记变成质检标记
-	checkFields, _ := (*project)["v_fields"].(map[string]interface{})
+	checkFields := qu.ObjArrToMapArr((*project)["v_fields"].([]interface{}))
 	//datatype := qu.ObjToString((*project)["s_datatype"])
-	qu.Debug(checkFields)
 	checkSet := make(map[string]interface{})
-	for k := range checkFields {
-		checkSet[k] = tagSet[k]
+	for _, v := range checkFields {
+		key := qu.ObjToString(v["key"])
+		if key == "extend" && v["child"] != nil {
+			for _, v1 := range qu.ObjArrToMapArr(v["child"].([]interface{})) {
+				key1 := qu.ObjToString(v1["key"])
+				checkSet[key1] = tagSet[key1]
+			}
+		} else {
+			checkSet[key] = tagSet[key]
+		}
 	}
 
 	if len(tagSet) > 0 || baseInfo["purchasinglist_alltag"] != nil { //purchasinglist_alltag特殊处理
@@ -1168,12 +1230,12 @@ func (f *Front) CheckSave() {
 		setResult["v_checkinfo"] = checkSet
 		for field, val := range baseSet { //更新基本字段
 			setResult["v_baseinfo."+field] = val
-			baseInfo[field] = val
+			//baseInfo[field] = val
 		}
 		baseUnsetResult := map[string]interface{}{} //删除字段集
 		for field, _ := range baseUnset {           //删除基本字段
 			baseUnsetResult["v_baseinfo."+field] = ""
-			delete(baseInfo, field)
+			//delete(baseInfo, field)
 		}
 		ex, exp := DataException(baseInfo)
 		if ex != "" {
@@ -1192,20 +1254,16 @@ func (f *Front) CheckSave() {
 		success = util.Mgo.UpdateById(sourceInfo, infoId, set)
 		//2、更新marked表
 		tmp, _ := util.Mgo.FindById(sourceInfo, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1, "i_ckdata": 1})
-		qu.Debug("infoId:", infoId)
 		delete(*tmp, "_id")
 		(*tmp)["updatetime"] = time.Now().Unix()
-		b := util.Mgo.Update(util.AllToColl, map[string]interface{}{"_id": mgo.StringTOBsonId(infoId)}, map[string]interface{}{"$set": tmp}, true, false)
-		qu.Debug("Update Marked:", b)
+		_ = util.Mgo.Update(util.AllToColl, map[string]interface{}{"_id": mgo.StringTOBsonId(infoId)}, map[string]interface{}{"$set": tmp}, true, false)
 	}
 	//3、保存标注日志
-	b := SaveLog(infoId, "", username, userId, userRole, qu.ObjToString((*project)["s_name"]), "质检", baseInfo, allTagFields)
-	qu.Debug("Save Log:", b)
+	_ = SaveLog(infoId, "", username, userId, userRole, qu.ObjToString((*project)["s_name"]), "质检", baseInfo, allTagFields)
 	f.ServeJson(map[string]interface{}{"success": success, "msg": msg})
 }
 
 func (f *Front) CheckResult() {
-	qu.Catch()
 	pid := f.GetString("pid")
 	tid := f.GetString("tid")
 	sourceinfo := f.GetString("s_sourceinfo")
@@ -1218,10 +1276,23 @@ func (f *Front) CheckResult() {
 
 	markNum, checkNum, checkNumR := 0, 0, 0 // 标注数量,	审核数据量,	审核数据完全正确的数据量
 	cmaps := make(map[string]int)           // 标注字段整体准确率
-	umaps := make(map[string]interface{})   // 按人员 字段准确率
-	for k := range (*projcet)["v_fields"].(map[string]interface{}) {
-		cmaps[k] = 0
+	cmaps_m := make(map[string]string)
+	umaps := make(map[string]interface{}) // 按人员 字段准确率
+	for _, v := range qu.ObjArrToMapArr((*projcet)["v_fields"].([]interface{})) {
+		key := qu.ObjToString(v["key"])
+		if key == "extend" && v["child"] != nil {
+			for _, v1 := range qu.ObjArrToMapArr(v["child"].([]interface{})) {
+				key1 := qu.ObjToString(v1["key"])
+				cmaps[key1] = 0
+				cmaps_m[key1] = qu.ObjToString(v1["descript"])
+			}
+		} else {
+			cmaps[key] = 0
+			cmaps_m[key] = qu.ObjToString(v["descript"])
+		}
+
 	}
+	qu.Debug(cmaps)
 	sess := util.Mgo.GetMgoConn()
 	defer util.Mgo.DestoryMongoConn(sess)
 	query := make(map[string]interface{})
@@ -1254,7 +1325,6 @@ func (f *Front) CheckResult() {
 		}
 	}
 	query["b_check"] = true
-	qu.Debug(query)
 	checkNum = util.Mgo.Count(sourceinfo, query)
 	result := sess.DB(util.Mgo.DbName).C(sourceinfo).Find(query).Iter()
 	if checkNum == 0 {
@@ -1262,14 +1332,13 @@ func (f *Front) CheckResult() {
 		return
 	}
 	// 排序
-	fields := (*projcet)["v_fields"].(map[string]interface{})
 	purchasingTag := false // 标的物统计标识
 	var strs []string
-	if fields["purchasinglist"] != nil {
+	if cmaps["purchasinglist"] != 0 {
 		purchasingTag = true
-		delete(fields, "purchasinglist")
+		delete(cmaps, "purchasinglist")
 	}
-	for k := range fields {
+	for k := range cmaps {
 		strs = append(strs, k)
 	}
 	pNum, pEffNum := 0, 0               // 标的物数量, 标的物有效数量
@@ -1345,8 +1414,6 @@ func (f *Front) CheckResult() {
 			}
 		}
 	}
-	qu.Debug(cmaps)
-	qu.Debug(umaps)
 	pResult := method(fieldNumMap, tagNumMap, rightNumMap)
 	// 前台页面数据
 	dataSource := make(map[string]interface{})
@@ -1364,7 +1431,7 @@ func (f *Front) CheckResult() {
 	sort.Strings(strs)
 	for _, v := range strs {
 		tmp1 := make(map[string]interface{})
-		tmp1["name"] = fields[v]
+		tmp1["name"] = cmaps_m[v]
 		tmp1["num1"] = markNum
 		tmp1["num2"] = checkNum
 		tmp1["num3"] = cmaps[v]
@@ -1383,7 +1450,7 @@ func (f *Front) CheckResult() {
 			tmp2["num3"] = v2["re_rg_count"]
 			tmp2["num4"] = CountPr(v2["re_rg_count"], v2["re_count"])
 			dataSelect1 = append(dataSelect1, tmp2)
-			for k, v := range fields {
+			for k, v := range cmaps_m {
 				tmp1 := make(map[string]interface{})
 				tmp1["name"] = v
 				tmp1["num1"] = v2["ck_count"]
@@ -1395,8 +1462,6 @@ func (f *Front) CheckResult() {
 			dataSource[k1] = dataSelect1
 		}
 	}
-	qu.Debug("字段统计---", dataSource)
-	qu.Debug("字段统计---", pResult)
 	f.T["pid"] = pid
 	f.T["tid"] = tid
 	f.T["sourceinfo"] = sourceinfo
@@ -1658,7 +1723,6 @@ func (f *Front) JyMarkList() {
 			query["i_ckdata"] = 0
 		}
 		count := util.Mgo.Count(sourceInfo, query)
-		qu.Debug("query:", query, sourceInfo, count)
 		fields := map[string]interface{}{"v_baseinfo.title": 1, "b_istag": 1, "i_ckdata": 1}
 		list, _ := util.Mgo.Find(sourceInfo, query, map[string]interface{}{"_id": 1}, fields, false, start, limit)
 		//checkedNum, allNum := GetCheckedAndAllDataInfo(query, coll) //已标和总数信息
@@ -1678,7 +1742,6 @@ func (f *Front) JyMarkList() {
 // JyUserDataMark 剑鱼管理人员数据标注
 func (f *Front) JyUserDataMark() {
 	defer qu.Catch()
-	qu.Debug("jy save...")
 	success := false
 	msg := ""
 	user := f.GetSession("user").(map[string]interface{})
@@ -1689,11 +1752,10 @@ func (f *Front) JyUserDataMark() {
 	obj := []map[string]interface{}{}
 	infoId := f.GetString("s_infoid")
 	sourceInfo := f.GetString("s_sourceinfo")
-	remark := f.GetString("remark")
 	isEff, _ := f.GetBool("isEff")
 	pid := f.GetString("pid")
-	qu.Debug("Data ID:", infoId)
 	data := f.GetString("data")
+
 	err := json.Unmarshal([]byte(data), &obj)
 	if err != nil {
 		qu.Debug("Json Unmarshal Error")
@@ -1752,25 +1814,26 @@ func (f *Front) JyUserDataMark() {
 			}
 		}
 	}
+	qu.Debug("baseUnset===", baseUnset)
 	dataInfo, _ := util.Mgo.FindById(sourceInfo, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1}) //查询标注保存前的原始信息
-	tagInfo, _ := (*dataInfo)["v_taginfo"].(map[string]interface{})
+	//tagInfo, _ := (*dataInfo)["v_taginfo"].(map[string]interface{})
 	baseInfo, _ := (*dataInfo)["v_baseinfo"].(map[string]interface{})
-	if tagInfo != nil && len(tagInfo) > 0 {
-		for field, tmpStatus := range tagSet { //比对本次标注信息和历史标注信息
-			status := qu.IntAll(tmpStatus)            //此次被标注字段的状态
-			markedStatus := qu.IntAll(tagInfo[field]) //历史标注状态
-			if status == 1 && markedStatus != 0 {     //此次标注结果为正确,且有历史标注记录,不做修改
-				qu.Debug("已标注字段field---", field)
-				delete(tagSet, field)
-				delete(baseSet, field)
-				//continue
-			}
-			//else {
-			//	qu.Debug("未标注字段field---", field, status)
-			//}
-		}
-	}
+	//if tagInfo != nil && len(tagInfo) > 0 {
+	//	for field, tmpStatus := range tagSet { //比对本次标注信息和历史标注信息
+	//		status := qu.IntAll(tmpStatus)            //此次被标注字段的状态
+	//		markedStatus := qu.IntAll(tagInfo[field]) //历史标注状态
+	//		if status == 1 && markedStatus != 0 {     //此次标注结果为正确,且有历史标注记录,不做修改
+	//			delete(tagSet, field)
+	//			delete(baseSet, field)
+	//			//continue
+	//		}
+	//		//else {
+	//		//	qu.Debug("未标注字段field---", field, status)
+	//		//}
+	//	}
+	//}
 	//
+	qu.Debug("baseSet===", baseSet)
 	allTagFields := map[string]interface{}{} //记录此此标注所有标注信息,用于日志记录
 	for k, _ := range tagSet {
 		allTagFields[k] = true
@@ -1781,9 +1844,6 @@ func (f *Front) JyUserDataMark() {
 	for k, _ := range baseUnset {
 		allTagFields[k] = nil
 	}
-	qu.Debug("allTagFields===", allTagFields)
-	qu.Debug("tagSet===", tagSet)
-
 	if len(tagSet) >= 0 || baseInfo["purchasinglist_alltag"] != nil { //purchasinglist_alltag特殊处理
 		//1、更新数据源信息
 		setResult := map[string]interface{}{ //更新字段集
@@ -1806,9 +1866,6 @@ func (f *Front) JyUserDataMark() {
 		for field, _ := range baseUnset {           //删除基本字段
 			baseUnsetResult["v_baseinfo."+field] = ""
 		}
-		if remark != "" {
-			setResult["v_taginfo.reamrk"] = remark
-		}
 		setResult["isEff"] = isEff
 		set := map[string]interface{}{
 			"$set": setResult,
@@ -1816,15 +1873,12 @@ func (f *Front) JyUserDataMark() {
 		if len(baseUnsetResult) > 0 {
 			set["$unset"] = baseUnsetResult
 		}
-		qu.Debug("set---", set)
 		success = util.Mgo.UpdateById(sourceInfo, infoId, set)
 		//2、更新marked表
 		tmp, _ := util.Mgo.FindById(sourceInfo, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1, "i_ckdata": 1})
-		qu.Debug("infoId:", infoId)
 		delete((*tmp), "_id")
 		(*tmp)["updatetime"] = time.Now().Unix()
-		b := util.Mgo.Update(util.AllToColl, map[string]interface{}{"_id": mgo.StringTOBsonId(infoId)}, map[string]interface{}{"$set": tmp}, true, false)
-		qu.Debug("Update Marked:", b)
+		_ = util.Mgo.Update(util.AllToColl, map[string]interface{}{"_id": mgo.StringTOBsonId(infoId)}, map[string]interface{}{"$set": tmp}, true, false)
 	}
 	/*
 		} else {
@@ -1833,8 +1887,7 @@ func (f *Front) JyUserDataMark() {
 	*/
 	//3、保存标注日志
 	project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"s_name": 1})
-	b := SaveLog(infoId, "", username, userId, userRole, qu.ObjToString((*project)["s_name"]), "标注", baseInfo, allTagFields)
-	qu.Debug("Save Log:", b)
+	_ = SaveLog(infoId, "", username, userId, userRole, qu.ObjToString((*project)["s_name"]), "标注", baseInfo, allTagFields)
 	f.ServeJson(map[string]interface{}{"success": success, "msg": msg})
 }
 
@@ -1847,12 +1900,10 @@ func (f *Front) UserDataMark() {
 	username := qu.ObjToString(user["s_login"]) //当前登录用户
 	userId := qu.ObjToString(user["id"])        //当前登录用户标识
 	userRole := qu.ObjToString(user["i_role"])  //当前登录用户权限
-	remark := f.GetString("remark")
 	isEff, _ := f.GetBool("isEff")
 	obj := []map[string]interface{}{}
 	infoId := f.GetString("s_infoid")
 	userTaskId := f.GetString("s_usertaskid")
-	qu.Debug("Task ID:", userTaskId, "	Data ID:", infoId)
 	data := f.GetString("data")
 	err := json.Unmarshal([]byte(data), &obj)
 	if err != nil {
@@ -1889,7 +1940,6 @@ func (f *Front) UserDataMark() {
 		}
 	} else {
 		for _, val := range obj {
-			qu.Debug("---", val)
 			title := qu.ObjToString(val["title"])
 			content, ok := val["content"].([]interface{})
 			status := qu.IntAll(val["status"])
@@ -1922,24 +1972,23 @@ func (f *Front) UserDataMark() {
 	}
 	sourceInfo := qu.ObjToString((*userTask)["s_sourceinfo"])                                                     //数据源表
 	dataInfo, _ := util.Mgo.FindById(sourceInfo, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1}) //查询标注保存前的原始信息
-	tagInfo, _ := (*dataInfo)["v_taginfo"].(map[string]interface{})
+	//tagInfo, _ := (*dataInfo)["v_taginfo"].(map[string]interface{})
 	baseInfo, _ := (*dataInfo)["v_baseinfo"].(map[string]interface{})
-	if tagInfo != nil && len(tagInfo) > 0 {
-		for field, tmpStatus := range tagSet { //比对本次标注信息和历史标注信息
-			status := qu.IntAll(tmpStatus)            //此次被标注字段的状态
-			markedStatus := qu.IntAll(tagInfo[field]) //历史标注状态
-			if status == 1 && markedStatus != 0 {     //此次标注结果为正确,且有历史标注记录,不做修改
-				qu.Debug("已标注字段field---", field)
-				delete(tagSet, field)
-				delete(baseSet, field)
-				//continue
-			}
-			//else {
-			//	qu.Debug("未标注字段field---", field, status)
-			//}
-		}
-	}
-	//
+	//if tagInfo != nil && len(tagInfo) > 0 {
+	//	for field, tmpStatus := range tagSet { //比对本次标注信息和历史标注信息
+	//		status := qu.IntAll(tmpStatus)            //此次被标注字段的状态
+	//		markedStatus := qu.IntAll(tagInfo[field]) //历史标注状态
+	//		if status == 1 && markedStatus != 0 {     //此次标注结果为正确,且有历史标注记录,不做修改
+	//			qu.Debug("已标注字段field---", field)
+	//			delete(tagSet, field)
+	//			delete(baseSet, field)
+	//			//continue
+	//		}
+	//		//else {
+	//		//	qu.Debug("未标注字段field---", field, status)
+	//		//}
+	//	}
+	//}
 	allTagFields := map[string]interface{}{} //记录此此标注所有标注信息,用于日志记录
 	for k, _ := range tagSet {
 		allTagFields[k] = true
@@ -1950,8 +1999,6 @@ func (f *Front) UserDataMark() {
 	for k, _ := range baseUnset {
 		allTagFields[k] = nil
 	}
-	qu.Debug("allTagFields===", allTagFields)
-	qu.Debug("tagSet===", tagSet)
 	if len(tagSet) >= 0 || baseInfo["purchasinglist_alltag"] != nil { //purchasinglist_alltag特殊处理
 		//1、更新数据源信息
 		setResult := map[string]interface{}{ //更新字段集
@@ -1964,22 +2011,18 @@ func (f *Front) UserDataMark() {
 		}
 		for field, val := range baseSet { //更新基本字段
 			setResult["v_baseinfo."+field] = val
-			baseInfo[field] = val
+			//baseInfo[field] = val
 		}
 		baseUnsetResult := map[string]interface{}{} //删除字段集
 		for field, _ := range baseUnset {           //删除基本字段
 			baseUnsetResult["v_baseinfo."+field] = ""
-			delete(baseInfo, field)
+			//delete(baseInfo, field)
 		}
 		ex, exp := DataException(baseInfo)
 		if ex != "" {
 			setResult["s_excp"] = ex
 			setResult["s_excp_info"] = exp
 		}
-		// todo
-		if remark != "" {
-			setResult["v_taginfo.reamrk"] = remark
-		}
 		setResult["isEff"] = isEff
 		set := map[string]interface{}{
 			"$set": setResult,
@@ -1987,15 +2030,12 @@ func (f *Front) UserDataMark() {
 		if len(baseUnsetResult) > 0 {
 			set["$unset"] = baseUnsetResult
 		}
-		qu.Debug("set---", set)
 		success = util.Mgo.UpdateById(sourceInfo, infoId, set)
 		//2、更新marked表
 		tmp, _ := util.Mgo.FindById(sourceInfo, infoId, map[string]interface{}{"v_baseinfo": 1, "v_taginfo": 1, "i_ckdata": 1})
-		qu.Debug("infoId:", infoId)
 		delete((*tmp), "_id")
 		(*tmp)["updatetime"] = time.Now().Unix()
-		b := util.Mgo.Update(util.AllToColl, map[string]interface{}{"_id": mgo.StringTOBsonId(infoId)}, map[string]interface{}{"$set": tmp}, true, false)
-		qu.Debug("Update Marked:", b)
+		_ = util.Mgo.Update(util.AllToColl, map[string]interface{}{"_id": mgo.StringTOBsonId(infoId)}, map[string]interface{}{"$set": tmp}, true, false)
 	}
 	/*
 		} else {
@@ -2003,7 +2043,7 @@ func (f *Front) UserDataMark() {
 		}
 	*/
 	//3、修改任务状态
-	b := util.Mgo.Update(util.TASKCOLLNAME, map[string]interface{}{"_id": (*userTask)["_id"], "s_status": "未开始"}, map[string]interface{}{
+	_ = util.Mgo.Update(util.TASKCOLLNAME, map[string]interface{}{"_id": (*userTask)["_id"], "s_status": "未开始"}, map[string]interface{}{
 		"$set": map[string]interface{}{
 			"i_starttime":    time.Now().Unix(),
 			"i_updatetime":   time.Now().Unix(),
@@ -2011,10 +2051,8 @@ func (f *Front) UserDataMark() {
 			"s_status":       "进行中",
 		},
 	}, false, false)
-	qu.Debug("Update UserTask:", b)
 	//4、保存标注日志
-	b = SaveLog(infoId, userTaskId, username, userId, userRole, qu.ObjToString((*userTask)["s_projectname"]), "标注", baseInfo, allTagFields)
-	qu.Debug("Save Log:", b)
+	_ = SaveLog(infoId, userTaskId, username, userId, userRole, qu.ObjToString((*userTask)["s_projectname"]), "标注", baseInfo, allTagFields)
 	f.ServeJson(map[string]interface{}{"success": success, "msg": msg})
 }
 
@@ -2063,9 +2101,6 @@ func MarkBase(content []interface{}, tagSet, baseSet, baseUnset map[string]inter
 			}
 		}
 	}
-	qu.Debug("tagSet===", tagSet)
-	qu.Debug("baseSet===", baseSet)
-	qu.Debug("baseUnset===", baseUnset)
 }
 
 // MarkTimePlace 标注时间地点
@@ -2098,9 +2133,6 @@ func MarkTimePlace(content []interface{}, tagSet, baseSet, baseUnset map[string]
 			}
 		}
 	}
-	qu.Debug("tagSet===", tagSet)
-	qu.Debug("baseSet===", baseSet)
-	qu.Debug("baseUnset===", baseUnset)
 }
 
 func MarkPurchasinglist(content []interface{}, tagSet, baseSet, baseUnset map[string]interface{}, istag bool, status int) {
@@ -2149,7 +2181,6 @@ func MarkPurchasinglist(content []interface{}, tagSet, baseSet, baseUnset map[st
 			}
 		}
 	}
-	qu.Debug("purchasinglist", len(purchasinglist))
 	if len(purchasinglist)+delpclson == len(content) {
 		if len(purchasinglist) > 0 {
 			baseSet["purchasinglist"] = purchasinglist
@@ -2161,9 +2192,6 @@ func MarkPurchasinglist(content []interface{}, tagSet, baseSet, baseUnset map[st
 	} else {
 		qu.Debug("Purchasinglist Tag Error")
 	}
-	qu.Debug("tagSet===", tagSet)
-	qu.Debug("baseSet===", baseSet)
-	qu.Debug("baseUnset===", baseUnset)
 }
 
 func MarkProcurementList(content []interface{}, tagSet, baseSet, baseUnset map[string]interface{}, istag bool, status int) {
@@ -2212,7 +2240,6 @@ func MarkProcurementList(content []interface{}, tagSet, baseSet, baseUnset map[s
 			}
 		}
 	}
-	qu.Debug("procurementlist", len(procurementlist))
 	if len(procurementlist)+delpclson == len(content) {
 		if len(procurementlist) > 0 {
 			baseSet["procurementlist"] = procurementlist
@@ -2220,13 +2247,10 @@ func MarkProcurementList(content []interface{}, tagSet, baseSet, baseUnset map[s
 			baseUnset["procurementlist"] = ""
 		}
 		//tagSet["purchasinglist"] = status
-		tagSet["procurementlist"] = procurementlistStatus
+		tagSet["procurementlist"] = status
 	} else {
 		qu.Debug("ProcurementList Tag Error")
 	}
-	qu.Debug("tagSet===", tagSet)
-	qu.Debug("baseSet===", baseSet)
-	qu.Debug("baseUnset===", baseUnset)
 }
 
 // MarkPackage 标注多包信息
@@ -2235,6 +2259,7 @@ func MarkPackage(content []interface{}, tagSet, baseSet, baseUnset map[string]in
 		return
 	}
 	pkgs := map[string]interface{}{}
+	total := 0.0
 	newNum := 1
 	delpkgson := 0 //记录子包删除个数
 	var sw []string
@@ -2303,6 +2328,7 @@ func MarkPackage(content []interface{}, tagSet, baseSet, baseUnset map[string]in
 						sw = append(sw, qu.ObjToString(w))
 					}
 					if b != nil {
+						total += qu.Float64All(b)
 						wbMap["bidamount"] = b
 					}
 					if len(wbMap) > 0 {
@@ -2320,12 +2346,12 @@ func MarkPackage(content []interface{}, tagSet, baseSet, baseUnset map[string]in
 			}
 		}
 	}
-	qu.Debug("pkgs", len(pkgs))
 	if len(pkgs)+delpkgson == len(content) {
 		if len(pkgs) > 0 {
 			baseSet["package"] = pkgs
 			baseSet["s_winner"] = strings.Join(sw, ",")
-		} else if len(content) > 0 && delpkgson == len(content) { //只有删除
+			baseSet["bidamount"] = total
+		} else if len(content) == 0 { //只有删除
 			baseUnset["package"] = ""
 		}
 		tagSet["package"] = status
@@ -2374,7 +2400,6 @@ func MarkWonderorder(content []interface{}, tagSet, baseSet, baseUnset map[strin
 			}
 		}
 	}
-	qu.Debug("winnerorder", len(winnerorder))
 	if len(winnerorder)+delwodrson == len(content) {
 		if len(winnerorder) > 0 {
 			baseSet["winnerorder"] = winnerorder
@@ -2385,9 +2410,6 @@ func MarkWonderorder(content []interface{}, tagSet, baseSet, baseUnset map[strin
 	} else {
 		qu.Debug("Winnerorder Tag Error")
 	}
-	qu.Debug("tagSet===", tagSet)
-	qu.Debug("baseSet===", baseSet)
-	qu.Debug("baseUnset===", baseUnset)
 }
 
 // 标注其他信息
@@ -2425,14 +2447,11 @@ func MarkOther(content []interface{}, tagSet, baseSet, baseUnset map[string]inte
 			}
 		}
 	}
-	qu.Debug("tagSet===", tagSet)
-	qu.Debug("baseSet===", baseSet)
-	qu.Debug("baseUnset===", baseUnset)
 }
 
 // SaveLog 标注日志保存
 func SaveLog(s_infoid, s_usertaskid, username, userid, role, projectname, s_stype string, baseInfo, allTagFields map[string]interface{}) (success bool) {
-	defer qu.Debug()
+	defer qu.Catch()
 	v_before := map[string]interface{}{}
 	for f, v := range allTagFields {
 		if _, ok := v.(bool); ok && f != "purchasinglist_alltag" { //表示此次标注status=1的字段
@@ -2498,8 +2517,6 @@ func (f *Front) CheckDataPurchase() {
 		}
 		util.Mgo.UpdateById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"$set": map[string]interface{}{"purchasinglist_key": keyword}})
 		query["v_baseinfo.purchasinglist"] = map[string]interface{}{"$exists": true}
-		count := util.Mgo.Count(sourceinfo, query)
-		qu.Debug(query, count)
 		info, _ := util.Mgo.Find(sourceinfo, query, `{"_id": 1}`, `{"v_baseinfo": 1, "b_isEff": 1, "v_checkinfo": 1, "v_taginfo": 1}`, false, -1, -1)
 		var updateArr [][]map[string]interface{}
 		for _, m := range *info {

+ 2 - 0
src/util/config.go

@@ -36,6 +36,8 @@ var (
 	TopSubStypeArr      []string
 	TopSubStypeArr2     []string
 	FieldsArr           []map[string]interface{}
+
+	MgoBulkSize = 200
 )
 
 var (

BIN
src/web/model/taskexportdata.xlsx


+ 2 - 1
src/web/templates/project/check_data_list.html

@@ -144,7 +144,7 @@
         ttable = $('#dataTable').dataTable({
             "paging": true,
             "lengthChange": false,
-            "searching": false,
+            "searching": true,
             "processing": true,
             // "pageLength": 20,
             "ordering": false,
@@ -205,6 +205,7 @@
             ],
             "initComplete": function () {
                 $("#dataTable_filter").append($('#status-div'))
+                $("[type=search]").attr('placeholder', "项目名称、标题")
             },
             "fnServerParams": function (e) {
                 e.s_status = $("#statusSelect option:selected").val()

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

@@ -830,7 +830,7 @@
                     if (uin.key === "bidendtime" || uin.key === "bidopentime" || uin.key === "project_startdate" || uin.key === "project_completedate" ||
                         uin.key === "publishtime" || uin.key === "signaturedate") {
                         var val = uin.input
-                        if (val !== "") {
+                        if (val !== null && 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)) {
@@ -943,7 +943,7 @@
                     if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
                         key === "publishtime" || key === "signaturedate") {
                         var val = witch.input
-                        if (val !== "") {
+                        if (val !== null && 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)) {
@@ -1145,7 +1145,7 @@
                         if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
                             key === "publishtime" || key === "signaturedate") {
                             var val = v.input
-                            if (val !== "") {
+                            if (val !== null && 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)) {
@@ -1196,7 +1196,7 @@
                                 if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
                                     key === "publishtime" || key === "signaturedate") {
                                     var val = value.input
-                                    if (val !== "") {
+                                    if (val !== null && 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)) {

+ 137 - 19
src/web/templates/project/project_clear.html

@@ -113,6 +113,7 @@
                                 </tr>
                                 </thead>
                             </table>
+                            <iframe srcdoc="<form id='uploadform' method='post' enctype='multipart/form-data' action='/center/taskfile'><input type='file' name='xlsx' /></form>" height=0 scrolling=no class="hide"  id="taskfileframe"></iframe>
                         </div>
                     </div>
                     <!-- /.box-body -->
@@ -170,6 +171,15 @@
     </div><!-- /.modal -->
 </div>
 
+<div class="modal fade" id="loadingModal" backdrop="static" keyboard="false">
+    <div style="width: 250px;height:100px; z-index: 20000; position: absolute; text-align: center; left: 50%; top: 50%;margin-left:-100px;margin-top:-10px">
+        <div id="loadText" class="progress progress-striped active"
+             style="margin-bottom: 0;height:50px; text-align:center;line-height: 50px;font-size:large;padding-left: 5px">
+            loading......    
+        </div>
+    </div>
+</div>
+
 {{include "com/footer.html"}}
 <script>
     menuActive("project");
@@ -187,18 +197,6 @@
     let tableData = []
     let stype = ""                                  // 分发类型:所有数据:all 达标数据:notag 未达标:tag
 
-    //展示loading框
-    showLoading = function (text){
-        if(text){
-            $("#loadText").html(text)
-        }
-        $('#loadingModal').modal({backdrop: 'static', keyboard: false});
-    }
-    //隐藏掉loading框
-    hideLoading = function (){
-        $('#loadingModal').modal('hide');
-    }
-
     $(function () {
         ttable = $('#dataTable').dataTable({
             "paging": true,
@@ -252,13 +250,31 @@
                 },
                 {
                     "data": "_id", width: "11%", render: function (val, a, row, pos) {
-                        tmp = '<div>' +
-                            '<a class="btn btn-sm btn-primary" href="/front/group/user/task/list?pid='+projectid+'&grouptaskid='+val+'&s_groupid='+row.s_groupid+'&s_sourceinfo='+row.s_sourceinfo+'">查看</a>&nbsp;&nbsp;' +
-                            '<a class="btn btn-sm btn-primary" onclick="retrieveTask(\''+val+'\',\''+row.s_sourceinfo+'\',\''+row.s_status+'\')">收回</a>&nbsp;&nbsp;' +
-                            '<a class="btn btn-sm btn-primary" onclick="checkMethod1(\'' + row.s_projectid + '\',\'' + val + '\',\'' + row.s_sourceinfo + '\')">质检</a>&nbsp;&nbsp;' +
-                            '<a class="btn btn-sm btn-primary" onclick="repulseTask(\''+val+'\',\''+row.s_sourceinfo+'\',\''+row.s_status+'\')">打回</a>&nbsp;&nbsp;' +
-                            '<a class="btn btn-sm btn-primary" onclick="closeTask(\'' + val + '\',\''+row.s_sourceinfo+'\',\'' + row.s_status + '\')">关闭</a>&nbsp;&nbsp;' +
-                            '</div>';
+                        if (row.s_status === '已完成') {
+                            if (row.sendflag) {
+                                tmp = '<div>' +
+                                    '<a class="btn btn-sm btn-primary" href="/front/group/user/task/list?pid='+projectid+'&grouptaskid='+val+'&s_groupid='+row.s_groupid+'&s_sourceinfo='+row.s_sourceinfo+'">查看</a>&nbsp;&nbsp;' +
+                                    '<a class="btn btn-sm btn-primary" onclick="checkMethod1(\'' + row.s_projectid + '\',\'' + val + '\',\'' + row.s_sourceinfo + '\')">质检</a>&nbsp;&nbsp;' +
+                                    '<a class="btn btn-sm btn-primary" onclick="#">已推送</a>&nbsp;&nbsp;' +
+                                    '</div>';
+                            } else {
+                                tmp = '<div>' +
+                                    '<a class="btn btn-sm btn-primary" href="/front/group/user/task/list?pid='+projectid+'&grouptaskid='+val+'&s_groupid='+row.s_groupid+'&s_sourceinfo='+row.s_sourceinfo+'">查看</a>&nbsp;&nbsp;' +
+                                    '<a class="btn btn-sm btn-primary" onclick="checkMethod1(\'' + row.s_projectid + '\',\'' + val + '\',\'' + row.s_sourceinfo + '\')">质检</a>&nbsp;&nbsp;' +
+                                    '<a class="btn btn-sm btn-primary" onclick="syncJyCm(\'' + val + '\',\''+row.s_sourceinfo+'\',\'' + row.s_status + '\')">推送</a>&nbsp;&nbsp;' +
+                                    '<a class="btn btn-sm btn-primary" onclick="exportData(\'' + val + '\',\''+row.s_sourceinfo+'\')">导出</a>&nbsp;&nbsp;' +
+                                    '<a class="btn btn-sm btn-primary" onclick="importData(\'' + val + '\',\''+row.s_sourceinfo+'\')">导入</a>&nbsp;&nbsp;' +
+                                    '</div>';
+                            }
+                        }else {
+                            tmp = '<div>' +
+                                '<a class="btn btn-sm btn-primary" href="/front/group/user/task/list?pid='+projectid+'&grouptaskid='+val+'&s_groupid='+row.s_groupid+'&s_sourceinfo='+row.s_sourceinfo+'">查看</a>&nbsp;&nbsp;' +
+                                '<a class="btn btn-sm btn-primary" onclick="retrieveTask(\''+val+'\',\''+row.s_sourceinfo+'\',\''+row.s_status+'\')">收回</a>&nbsp;&nbsp;' +
+                                '<a class="btn btn-sm btn-primary" onclick="checkMethod1(\'' + row.s_projectid + '\',\'' + val + '\',\'' + row.s_sourceinfo + '\')">质检</a>&nbsp;&nbsp;' +
+                                '<a class="btn btn-sm btn-primary" onclick="repulseTask(\''+val+'\',\''+row.s_sourceinfo+'\',\''+row.s_status+'\')">打回</a>&nbsp;&nbsp;' +
+                                '<a class="btn btn-sm btn-primary" onclick="closeTask(\'' + val + '\',\''+row.s_sourceinfo+'\',\'' + row.s_status + '\')">关闭</a>&nbsp;&nbsp;' +
+                                '</div>';
+                        }
                         return tmp
                     }
                 }
@@ -474,6 +490,108 @@
         }
     }
 
+    // 推送数据
+    function syncJyCm(id, sourceinfo, status) {
+        if (status === "已完成") {
+            showConfirm("确认要否推送当前数据到剑鱼客户管理服务平台?", function () {
+                showLoading("正在推送数据,请稍候...")
+                $.ajax({
+                    url: "/front/project/task/syncjycm",
+                    type: 'POST',
+                    data: {"s_sourceinfo": sourceinfo, "taskid": id, "pid": projectid},
+                    success: function (r) {
+                        hideLoading()
+                        if (r.success) {
+                            let msg = r.msg+"<br>"+"一共推送"+r.count+"条数据"
+                            showMsg(msg, function (){
+                                location.reload()
+                            })
+                        } else {
+                            showMsg(r.msg, function (){
+                                location.reload()
+                            })
+                        }
+                    }
+                })
+            })
+        }else {
+            showTip("操作不允许")
+        }
+    }
+
+    function exportData(id, sourceinfo) {
+        showConfirm("确认从标注平台导出任务数据?", function () {
+            showLoading("正在导出数据,请稍候...")
+            $.ajax({
+                url: "/front/project/task/exportdata",
+                type: 'POST',
+                data: {"s_sourceinfo": sourceinfo, "taskid": id},
+                xhrFields: { responseType: 'arraybuffer'},
+                success: function (r, status, xhr) {
+                    hideLoading()
+                    downloadFile(r, "下载")
+                }
+            })
+        })
+    }
+
+    function downloadFile(res, fileName) { // res为后端传来的文件流,// fileName为文件名称,自己根据实际情况赋值
+        if (!res) {
+            return
+        }
+        if (window.navigator.msSaveBlob) { // IE以及IE内核的浏览器
+            try {
+                window.navigator.msSaveBlob(res, fileName) // res为接口返回数据,这里请求的时候已经处理了,如果没处理需要在此之前自行处理var data = new Blob([res.data]) 注意这里需要是数组形式的,fileName就是下载之后的文件名
+                // window.navigator.msSaveOrOpenBlob(res, fileName);  //此方法类似上面的方法,区别可自行百度
+            } catch (e) {
+                console.log(e)
+            }
+        } else {
+            let url = window.URL.createObjectURL(new Blob([res], {
+                type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' // 前后端一定要同意utf-8编码,否则会是乱码
+            }));
+            let link = document.createElement('a')
+            link.style.display = 'none'
+            link.href = url
+            link.setAttribute('download', fileName) // 文件名
+            document.body.appendChild(link)
+            link.click()
+            document.body.removeChild(link) // 下载完成移除元素
+            window.URL.revokeObjectURL(url) // 释放掉blob对象
+        }
+    }
+
+    function importData(id, sourceinfo) {
+        let input = $("<input>").attr("type", "file").hide();
+        $(input).on("change", function() {
+            showLoading("正在导出数据,请稍候...")
+            let file = this.files[0];
+            // 创建FormData对象,用于上传文件
+            let formData = new FormData();
+            formData.append("s_sourceinfo", sourceinfo)
+            formData.append("taskid", id)
+            formData.append("xlsx", file);
+            $.ajax({
+                url: "/front/project/task/importdata",
+                type: "POST",
+                data: formData,
+                processData: false,
+                contentType: false,
+                success: function(r) {
+                    hideLoading()
+                    if (r.success) {
+                        showTip("导入数据成功,一共导入"+r.count+"条数据", 4000);
+                    }
+                },
+                error: function(xhr, status, error) {
+                    hideLoading()
+                    showMsg(error);
+                }
+            });
+        });
+        $(input).click();
+    }
+
     function checkMethod(stype) {
         // if (stype === "all") {
         //     if (num2 <= 0) {

+ 89 - 0
src/web/templates/project/project_data.html

@@ -0,0 +1,89 @@
+{{include "com/inc.html"}}
+<!-- Main Header -->
+{{include "com/header.html"}}
+<!-- Left side column. 权限菜单 -->
+{{include "com/menu.html"}}
+<div class="content-wrapper">
+    <section class="content-header">
+        <h1><small></small></h1>
+        <ol class="breadcrumb">
+            <li><a href="/front/project"><i class="fa fa-dashboard"></i> 项目列表</a></li>
+            <li><a href="#"><i class="fa fa-dashboard"></i> 项目分发</a></li>
+        </ol>
+    </section>
+    <!-- Main content -->
+    <section class="content">
+        <div class="row">
+            <div class="col-xs-12">
+                <div class="box">
+                    <div class="box-body">
+                        <table id="dataTable" class="table table-bordered table-hover">
+                            <thead>
+                            <tr>
+                                <th>序号</th>
+                                <th>标题</th>
+                            </tr>
+                            </thead>
+                        </table>
+                    </div>
+                    <!-- /.box-body -->
+                </div>
+                <!-- /.box -->
+            </div>
+        </div>
+    </section>
+</div>
+
+{{include "com/footer.html"}}
+<script>
+    menuActive("project");
+    let _id = {{ .T.id }}
+    let coll = {{ .T.sourceinfo }}
+    $(function () {
+        ttable = $('#dataTable').dataTable({
+            "paging": true,
+            "lengthChange": false,
+            "searching": true,
+            "ordering": false,
+            "info": true,
+            "autoWidth": false,
+            "serverSide": true,
+            "ajax": {
+                "url": "/front/project/data",
+                "type": "post",
+                data: {"id": _id, "sourceinfo": coll},
+            },
+            "language": {
+                "url": "/dist/js/dataTables.chinese.lang"
+            },
+            "fnDrawCallback": function () {
+                $("ul.pagination").prepend("&nbsp;&nbsp;&nbsp;转到第 <input type='text' id='changePage'   style='width:20px;'> 页    <a type='text' href='javascript:void(0);' id='dataTable-btn' style='text-align:center'>GO</a>");
+                $('#dataTable-btn').click(function (e) {
+                    var redirectpage = 0
+                    if ($("#changePage").val() && $("#changePage").val() > 0) {
+                        var redirectpage = $("#changePage").val() - 1;
+                    }
+                    ttable.api().page(redirectpage).draw(false);
+                });
+                this.api().column(0).nodes().each(function (cell, i) {
+                    cell.innerHTML = i + 1;
+                });
+            },
+            "columns": [
+                {"data": null, width: "3%"},
+                {"data": "v_baseinfo.title", render: function (val, index, row) {
+                        return '<a style="color: #428bca" target="_blank" href='+ row.v_baseinfo.jybxhref +'>'+val+'</a>'
+
+                    }}
+            ],
+            "columnDefs": [{
+            }],
+            "initComplete": function () {
+                $("[type=search]").attr('placeholder', "项目名称、标题")
+            },
+            "fnServerParams": function (e) {}
+        })
+    });
+
+
+</script>

+ 16 - 4
src/web/templates/project/project_field.html

@@ -166,12 +166,26 @@
       resetData () {
         this.editForm.data = this.getFormData()
       },
+      checkRequiredState (groupKey, keys, group) {
+        const waitList = group.find(v => v.key === groupKey)
+        if (waitList.enable) {
+          const result = keys.filter(c => waitList.child.find(s => s.key === c).enable).length === keys.length
+          return result
+        } else {
+          return true
+        }
+      },
       submitData () {
         const baseForm = this.editForm.data.slice(0, -1)
         const extendForm = this.editForm.data.slice(-1)[0]
-        console.log('baseForm', baseForm)
-        console.log('extendForm', extendForm)
         const m1 = []
+
+        // 检查数据
+        const packageState = this.checkRequiredState('package', ['origin','name'], baseForm)
+        if (!packageState) {
+          return alert('请检查是否选中多包必需字段(标段编号、标段名称)')
+        }
+
         baseForm.forEach(function (v) {
           if (v.enable) {
             if (v.descript === "基本字段") {
@@ -193,12 +207,10 @@
           }
         })
 
-        console.log(extendForm)
         if (extendForm.child.length > 0) {
           extendForm.child.forEach(v => delete v._id)
           m1.push(extendForm)
         }
-        console.log('m1', m1)
         if (m1.length <= 0) {
           alert('未选中字段')
           return

+ 2 - 0
src/web/templates/project/project_list.html

@@ -397,6 +397,7 @@
                                 '<br>' +
                                 // '<a class="btn btn-sm btn-primary" href="">质检结果</a>&nbsp;&nbsp;' +
                                 '<a class="btn btn-sm btn-primary" href="/front/project/field?id='+row._id+'">字段配置</a>&nbsp;&nbsp;' +
+                                '<a class="btn btn-sm btn-primary" href="/front/project/data?id='+row._id+'&sourceinfo='+row.s_sourceinfo+'">数据预览</a>&nbsp;&nbsp;' +
                                 '<a class="btn btn-sm btn-primary" style="margin-top: 5px" onclick="completePro(\'' + val + '\',\''+row.s_sourceinfo+'\',\'' + row.s_status + '\')">完成</a>&nbsp;&nbsp;' +
                                 '</div>';
                         }else {
@@ -408,6 +409,7 @@
                                 '<br>' +
                                 // '<a class="btn btn-sm btn-primary" href="">质检结果</a>&nbsp;&nbsp;' +
                                 '<a class="btn btn-sm btn-primary" href="/front/project/field?id='+row._id+'">字段配置</a>&nbsp;&nbsp;' +
+                                '<a class="btn btn-sm btn-primary" href="/front/project/data?id='+row._id+'">数据预览</a>&nbsp;&nbsp;' +
                                 '<a class="btn btn-sm btn-primary" style="margin-top: 5px" onclick="completePro(\'' + val + '\',\''+row.s_sourceinfo+'\',\'' + row.s_status + '\')">完成</a>&nbsp;&nbsp;' +
                                 '</div>';
                         }

+ 59 - 103
src/web/templates/project/remark_detail.html

@@ -209,10 +209,9 @@
             <!--edit-box-->
             <div class="edit-box">
                 <!--edit-->
-                <div style="padding: 5px;margin-left: 20px">
-                    <label style="color: red">备注:<input type="text" id="remark" style="height: 25px;width: 300px;display: inline-block;"></label>
+                <div style="padding: 10px;margin-left: 20px;">
                     <label style="color: red" id="keyword">关键词:</label>
-                    <label>数据是否有效:<input id="group-switch-pwd" name="switch-pwd" type="checkbox"></label>
+                    <label style="display: none">数据是否有效:<input id="group-switch-pwd" name="switch-pwd" type="checkbox"></label>
                 </div>
                 <div class="edit one" v-for="(one,oindex) in editData" :key="oindex">
                     <!--one-->
@@ -336,9 +335,10 @@
             <div class="save-box">
 <!--                 <button  class="code" @click.stop="showPop = true" style="width:100px">源码</button>&nbsp;&nbsp;-->
                 <!--                 <button  class="code" @click.stop="open(1)" style="width:100px">全部验证</button> -->
+                <button class="code" @click.stop="openHref(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="openHref(2)" style="width:100px">下一条</button>
                 <!--<button  class="code" @click.stop="window.location.href='/'" style="width:100px">下一条</button>-->
             </div>
         </div>
@@ -392,76 +392,6 @@
             html: '{{ .T.info.filetext }}',
         },
     }
-    //快捷键
-    $(document).keydown(function (event) {
-        if (!event.shiftKey) {
-            var text = getSelectedContents();//获取选中文本
-            if (!text.trim().length) {
-                return
-            }
-        }
-        if (event.keyCode === 82) {//项目名称快捷键r
-            if (event.shiftKey) {
-                app.changeBaseValue(0, '', 2) //删除对应文本
-            } else {
-                app.changeBaseValue(0, text, 2)//填充
-            }
-        } else if (event.keyCode === 81) {//省份快捷键q
-            if (event.shiftKey) {
-                app.changeBaseValue(1, '', 2) //删除对应文本
-            } else {
-                app.changeBaseValue(1, text, 2)//填充
-            }
-        } else if (event.keyCode === 84) {//项目编号快捷键t
-            if (event.shiftKey) {
-                app.changeBaseValue(2, '', 2) //删除对应文本
-            } else {
-                app.changeBaseValue(2, text, 2)//填充
-            }
-        } else if (event.keyCode === 87) {//城市快捷键w
-            if (event.shiftKey) {
-                app.changeBaseValue(3, '', 2) //删除对应文本
-            } else {
-                app.changeBaseValue(3, text, 2)//填充
-            }
-        } else if (event.keyCode === 69) {//区县快捷键e
-            if (event.shiftKey) {
-                app.changeBaseValue(5, '', 2) //删除对应文本
-            } else {
-                app.changeBaseValue(5, text, 2)//填充
-            }
-        } else if (event.keyCode === 65) {//采购单位快捷键a
-            if (event.shiftKey) {
-                app.changeBaseValue(6, '', 2) //删除对应文本
-            } else {
-                app.changeBaseValue(6, text, 2)//填充
-            }
-        } else if (event.keyCode === 90) {//预算快捷键z
-            if (event.shiftKey) {
-                app.changeBaseValue(7, '', 2) //删除对应文本
-            } else {
-                app.changeBaseValue(7, text, 2)//填充
-            }
-        } else if (event.keyCode === 83) {//代理机构快捷键s
-            if (event.shiftKey) {
-                app.changeBaseValue(8, '', 2) //删除对应文本
-            } else {
-                app.changeBaseValue(8, text, 2)//填充
-            }
-        } else if (event.keyCode === 88) {//中标金额快捷键x
-            if (event.shiftKey) {
-                app.changeBaseValue(9, '', 2) //删除对应文本
-            } else {
-                app.changeBaseValue(9, text, 2)//填充
-            }
-        } else if (event.keyCode === 68) {//中标单位快捷键d
-            if (event.shiftKey) {
-                app.changeBaseValue(10, '', 2) //删除对应文本
-            } else {
-                app.changeBaseValue(10, text, 2)//填充
-            }
-        }
-    });
 
     //获取鼠标选中的文本
     function getSelectedContents() {
@@ -492,11 +422,15 @@
     // 是否需要显示 Group
     var canShowGroupsList = []
 
-    //记录是否点击保存
-    var issave = false;
+
     var isEff = true
     var _id = {{ .T.did }}
+
+    //记录是否点击保存
+
+    var issave = Boolean(sessionStorage.getItem(_id + '_save'))
     var nextid = {{ .T.nextid }}
+    var lastid = {{ .T.lastid }}
     //基本信息
     var common = {{ .T.common }}
     var uInput = [];
@@ -784,7 +718,7 @@
                 content: pcl_content_1
                 }, {
                 title: '多包信息',
-                show:false,
+                show:true,
                 showCheck: true,
                 key: 'package',
                 // checkType: {{.T.ck_pkgisext}},
@@ -800,7 +734,7 @@
                 content: c_content
                 }, {
                 title: '自定义字段',
-                show:false,
+                show:true,
                 key: 'extend',
                 status:"1",
                 content:[{
@@ -876,7 +810,7 @@
                     if (uin.key === "bidendtime" || uin.key === "bidopentime" || uin.key === "project_startdate" || uin.key === "project_completedate" ||
                         uin.key === "publishtime" || uin.key === "signaturedate") {
                         var val = uin.input
-                        if (val !== "") {
+                        if (val !== null && 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)) {
@@ -922,16 +856,30 @@
                         }
                         this.setStatus(uni, status, two, one)
                     },
-                openHref() {
-                    // if (!issave) {
-                    //     alert("请先保存数据!")
-                    // } else {
+                openHref (i) {
+                    if (i === 1) {
                         if (nextid === "") {
-                            alert("当前已经是最后一条数据!")
+                            alert("当前数据是第一条数据,没有上一条数据!")
                         } else {
-                            window.location.href = "/front/user/remark/detail/?pid="+pid+"&tid="+tid+"&did="+nextid+"&s_sourceinfo="+coll
+                            window.location.href = "/front/user/remark/detail/?pid="+pid+"&tid="+tid+"&did="+lastid+"&s_sourceinfo="+coll
                         }
-                    // }
+                    } else {
+                        if (issave) {
+                            this.openHrefBefore()
+                        } else {
+                            this.open(2, () => {
+                                this.openHrefBefore()
+                            })
+                        }
+                    }
+                },
+                openHrefBefore () {
+                    if (nextid === "") {
+                        alert("当前已经是最后一条数据!")
+                    } else {
+                        sessionStorage.removeItem(_id + '_save')
+                        window.location.href = "/front/user/remark/detail/?pid="+pid+"&tid="+tid+"&did="+nextid+"&s_sourceinfo="+coll
+                    }
                 },
                 // 检查一级是否需要改变状态
                 checkOneStatus: function (config) {
@@ -988,7 +936,7 @@
                     if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
                         key === "publishtime" || key === "signaturedate") {
                         var val = witch.input
-                        if (val !== "") {
+                        if (val !== null && 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)) {
@@ -1019,13 +967,13 @@
                 delNewTwo: function (one, index, two) {
                     //two.ck_isnew = false //目前点删除按钮页面直接不显示,但是集合索引位置不变,所以加了此代码
                     //two.show = false
-                    if (two.isnew) {
+                    // if (two.isnew) {
                         one.content.splice(index, 1)
-                    } else {
-                        two.show = false
-                        two.status = "4"
-                        this.saveDataTwo(two, "4", one)
-                    }
+                    // } else {
+                    //     two.show = false
+                    //     two.status = "4"
+                    //     this.saveDataTwo(two, "4", one)
+                    // }
                     this.checkOneStatus({
                         one: one,
                         two: two,
@@ -1194,7 +1142,7 @@
                         if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
                             key === "publishtime" || key === "signaturedate") {
                             var val = v.input
-                            if (val !== "") {
+                            if (val !== null && 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)) {
@@ -1245,7 +1193,7 @@
                                 if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
                                     key === "publishtime" || key === "signaturedate") {
                                     var val = value.input
-                                    if (val !== "") {
+                                    if (val !== null && 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)) {
@@ -1277,7 +1225,7 @@
                     });
                 },
                 //验证保存提示
-                open:function (stype) {
+                open:function (stype, callback) {
                     var noTagKey = [];
                     this.editData.filter(function (one) {
                         if (one.title === "标的信息" || one.title === "采购意向信息" || one.title === "多包信息" || one.title === "中标候选人信息") {
@@ -1287,7 +1235,6 @@
                         } else {
                             one.content.filter(function (v) {
                                 v.uInput.filter(function (u) {
-                                    console.log(u.key, u.status)
                                     if (u.status === "-1") {
                                         noTagKey.push(u.title);
                                     }
@@ -1401,21 +1348,19 @@
                         cancelButtonText: '取消',
                         type: 'warning'
                     }).then(() => {
-                        this.upChange(stype)
+                        this.upChange(stype, callback)
                     }).catch(() => {
                     });
                 },
                 //保存事件
-                upChange: function (stype) {
+                upChange: function (stype, callback) {
                     var d = JSON.stringify(this.editData);
-                    console.log(this.editData)
-                    let remark = $('#remark').val()
                     var _this = this
                     if (tid === "") {
                         $.ajax({
                             url: "/front/data/jyuser/mark",
                             method: "post",
-                            data: {"data": d, "s_infoid": _id, "pid": pid, "s_sourceinfo": coll, "remark": remark, "isEff": isEff},
+                            data: {"data": d, "s_infoid": _id, "pid": pid, "s_sourceinfo": coll, "isEff": isEff},
                             success: function (res) {
                                 if (res) {
                                     _this.$message({
@@ -1425,6 +1370,11 @@
                                         offset: 300
                                     });
                                     issave = true//保存成功
+                                    sessionStorage.setItem(_id + '_save', issave)
+                                    if (callback) {
+                                        return callback()
+                                    }
+                                    location.reload()
                                 }
                             },
                             error: function (err) {
@@ -1432,10 +1382,11 @@
                             }
                         });
                     }else {
+                        console.log(d)
                         $.ajax({
                             url: "/front/data/user/mark",
                             method: "post",
-                            data: {"data": d, "s_infoid": _id, "s_usertaskid": tid, "remark": remark, "isEff": isEff},
+                            data: {"data": d, "s_infoid": _id, "s_usertaskid": tid, "isEff": isEff},
                             success: function (res) {
                                 if (res) {
                                     _this.$message({
@@ -1445,6 +1396,11 @@
                                         offset: 300
                                     });
                                     issave = true//保存成功
+                                    sessionStorage.setItem(_id + '_save', issave)
+                                    if (callback) {
+                                        return callback()
+                                    }
+                                    location.reload()
                                 }
                             },
                             error: function (err) {

+ 1 - 1
src/web/templates/user/user_list.html

@@ -364,7 +364,7 @@
 
         let r = {{(session "user").i_role}}
         console.log(r)
-        if (r == 0 || r == 1){
+        if (r == 0 || r == 1 || r == 2){
             $("#look-btn").show()
         }else {
             $("#look-btn").hide()