ソースを参照

标注页面导航

maxiaoshan 3 年 前
コミット
01f3d3397c

+ 18 - 107
src/config.json

@@ -33,19 +33,19 @@
         "common": [
         	{
                 "key": "projectname",
-                "descript": "项目名称"
+                "descript": "项目名称(r)"
             },
             {
                 "key": "area",
-                "descript": "省份"
+                "descript": "省份(q)"
             },
             {
                 "key": "projectcode",
-                "descript": "项目编号"
+                "descript": "项目编号(t)"
             },
             {
                 "key": "city",
-                "descript": "城市"
+                "descript": "城市(w)"
             },
             {
                 "key": "subtype",
@@ -53,112 +53,27 @@
             },
             {
                 "key": "district",
-                "descript": "区县"
-            },
-            {
-                "key": "projectscope",
-                "descript": "项目规模"
-            },
-            {
-                "key": "project_scale",
-                "descript": "项目范围"
+                "descript": "区县(e)"
             },
             {
                 "key": "budget",
-                "descript": "预算"
-            },
-            {
-                "key": "biddiscount",
-                "descript": "投标折扣系数"
+                "descript": "预算(z)"
             },
             {
                 "key": "bidamount",
-                "descript": "中标金额"
-            },
-            {
-                "key": "china_bidding",
-                "descript": "信息分类"
+                "descript": "中标金额(x)"
             },
             {
                 "key": "buyer",
-                "descript": "采购单位"
-            },
-            {
-                "key": "buyerclass",
-                "descript": "类型"
-               
-            },
-            {
-                "key": "buyerperson",
-                "descript": "采购联系人"
-            },
-            {
-                "key": "buyertel",
-                "descript": "采购电话"
-            },
-             {
-                "key": "buyeraddr",
-                "descript": "采购地址"
-            },
-            {
-                "key": "buyerzipcode",
-                "descript": "采购邮编"
+                "descript": "采购单位(a)"
             },
             {
                 "key": "agency",
-                "descript": "代理机构"
-            },
-            {
-                "key": "agencyperson",
-                "descript": "代理联系人"
-            },
-            {
-                "key": "agencytel",
-                "descript": "代理电话"
-            },
-            {
-                "key": "agencyaddr",
-                "descript": "代理地址"
+                "descript": "代理机构(s)"
             },
             {
                 "key": "s_winner",
-                "descript": "s_winner"
-            },
-            {
-                "key": "winner",
-                "descript": "winner"
-            },
-            {
-                "key": "winnerperson",
-                "descript": "中标联系人"
-            },
-            {
-                "key": "winnertel",
-                "descript": "中标电话"
-            },
-            {
-                "key": "winneraddr",
-                "descript": "中标地址"
-            },
-            {
-                "key": "winnerzipcode",
-                "descript": "中标邮编"
-            },
-            {
-                "key": "purchasing",
-                "descript": "标的物"
-            },
-            {
-                "key": "attach_discern",
-                "descript": "附件识别"
-            }, 
-            {
-                "key": "attach_ext",
-                "descript": "附件抽取"
-            },
-            {
-                "key": "isrepeat",
-                "descript": "数据重复"
+                "descript": "s_winner(d)"
             }
         ],
         "timeplace":[
@@ -237,11 +152,15 @@
                 "descript": "尺寸"
             },
             {
-                "key": "blackboard_or_screen",
-                "descript": "黑板/大屏"
+                "key": "pclisover",
+                "descript": "标注完全"
             }
         ],
         "package": [
+       		{
+                "key": "serial_number",
+                "descript": "标段(包)序号"
+            },
             {
                 "key": "name",
                 "descript": "标段(包)名称"
@@ -251,24 +170,16 @@
                 "descript": "标段(包)编号"
             },
             {
-                "key": "text",
-                "descript": "标段(包)内容"
+                "key": "budget",
+                "descript": "标段(包)预算"
             },
             {
                 "key": "winner",
                 "descript": "标段(包)中标单位"
             },
-            {
-                "key": "budget",
-                "descript": "标段(包)预算"
-            },
             {
                 "key": "bidamount",
                 "descript": "标段(包)中标价"
-            },
-            {
-                "key": "serial_number",
-                "descript": "标段(包)序号"
             }
         ],
         "winnerorder": [

+ 160 - 10
src/front/front.go

@@ -2,6 +2,7 @@
 package front
 
 import (
+	"math"
 	//"container/list"
 	"encoding/json"
 	"fmt"
@@ -421,8 +422,10 @@ func (i *Front) Detail(id string) error {
 	//}
 	query, _ := i.GetSession("query").(map[string]interface{})
 	qu.Debug(coll, query)
-	rep := getDetail(id, coll)
-	i.T["jyhref"] = util.JYHREFPRE + qu.CommonEncodeArticle("content", id) + ".html"
+	rep := getDetail(id, coll)          //获取本条公告的信息
+	i.T["otherInfo"] = rep["otherInfo"] //展示关联公告信息
+	i.T["moreInfo"] = rep["moreInfo"]   //更多关联公告信息
+	//i.T["jyhref"] = util.JYHREFPRE + qu.CommonEncodeArticle("content", id) + ".html"
 	i.T["info"] = rep["info"]
 	i.T["common"] = rep["common"]
 	i.T["worder"] = rep["worder"]
@@ -769,8 +772,7 @@ func getDetail(id, coll string) map[string]interface{} {
 	if !strings.HasPrefix(href, "http") {
 		info["href"] = "http://" + href
 	}
-	info["filetext"] = util.GetFileText(info) //获取附件信息
-	qu.Debug(info["filetext"])
+	//info["filetext"] = util.GetFileText(info) //获取附件信息
 	//rep["type"] = ftype
 	rep["info"] = info
 	common, timeplace, other := setExtComMap(info) //拼装抽取common值
@@ -788,6 +790,9 @@ func getDetail(id, coll string) map[string]interface{} {
 	worder, worder_new := setWorderMap(info) //中标候选人
 	rep["worder"] = worder
 	rep["worder_new"] = worder_new
+	otherInfo, moreInfo := setOtherInfo(info) //处理公告关联信息
+	rep["otherInfo"] = otherInfo
+	rep["moreInfo"] = moreInfo
 	//
 	if info[preKey+"purchasinglist"] != nil {
 		rep[preKey+"purchasinglist"] = "1"
@@ -807,6 +812,105 @@ func getDetail(id, coll string) map[string]interface{} {
 	return rep
 }
 
+//获取公告关联信息
+func setOtherInfo(info map[string]interface{}) (result, moreArr []map[string]interface{}) {
+	if otherInfo, ok := info["info"].([]interface{}); ok && len(otherInfo) > 0 {
+		//中标,成交、合同、招标(不含变更)
+		/*
+			[
+				{},
+				{},
+			]
+		*/
+		zbArr := []map[string]interface{}{}
+		cjArr := []map[string]interface{}{}
+		htArr := []map[string]interface{}{}
+		zbbArr := []map[string]interface{}{}
+		for _, tmp := range otherInfo {
+			tmpInfo := tmp.(map[string]interface{})
+			toptype := tmpInfo["toptype"]
+			subtype := tmpInfo["subtype"]
+			ptime := ""
+			tmpPtime := qu.Int64All(tmpInfo["publishtime"])
+			if tmpPtime > 0 {
+				ptime = qu.FormatDateByInt64(&tmpPtime, qu.Date_Full_Layout)
+			}
+			tmpInfo["publishtime_str"] = ptime
+			if subtype == "中标" {
+				zbArr = append(zbArr, tmpInfo)
+			} else if subtype == "成交" {
+				cjArr = append(cjArr, tmpInfo)
+			} else if subtype == "合同" {
+				htArr = append(htArr, tmpInfo)
+			} else if toptype == "招标" && subtype != "变更" {
+				zbbArr = append(zbbArr, tmpInfo)
+			} else { //标注页不展示的信息,更多中展示
+				moreArr = append(moreArr, map[string]interface{}{
+					"publishtime": tmpInfo["publishtime_str"],
+					"subtype":     subtype,
+					"title":       tmpInfo["title"],
+					"href":        util.GetJyHref(qu.ObjToString(tmpInfo["id"])),
+				})
+			}
+		}
+		publishtime := qu.Float64All(info["publishtime"])
+		//中标信息
+		if zbLen := len(zbArr); zbLen > 0 {
+			rzb := DealData(zbLen, publishtime, zbArr, &moreArr)
+			result = append(result, rzb)
+		}
+		//成交
+		if cjLen := len(cjArr); cjLen > 0 {
+			rcj := DealData(cjLen, publishtime, cjArr, &moreArr)
+			result = append(result, rcj)
+		}
+		//合同
+		if htLen := len(htArr); htLen > 0 {
+			rht := DealData(htLen, publishtime, htArr, &moreArr)
+			result = append(result, rht)
+		}
+		result = append(result, zbbArr...)
+	}
+	return
+}
+
+func DealData(tmpLen int, publishtime float64, tmp []map[string]interface{}, moreArr *[]map[string]interface{}) (resultTmp map[string]interface{}) {
+	if tmpLen == 1 || publishtime <= 0 { //相同类型只有一条或者原公告发布时间异常取第一条公告
+		resultTmp = tmp[0]
+		for _, t := range tmp[1:] { //将过滤掉的数据加入到更多中
+			*moreArr = append(*moreArr, map[string]interface{}{
+				"publishtime": t["publishtime_str"],
+				"subtype":     t["subtype"],
+				"title":       t["title"],
+				"href":        util.GetJyHref(qu.ObjToString(t["id"])),
+			})
+		}
+		return
+	} else {
+		diff := float64(0) //记录差值
+		index := 0
+		for i, zb := range tmp {
+			pTmp := qu.Float64All(zb["publishtime"])
+			diffTmp := math.Abs(publishtime - pTmp) //绝对值
+			if i == 0 {
+				diff = diffTmp
+			} else if diffTmp < diff { //记录较小差值的数据索引位置
+				diff = diffTmp
+				index = i
+			} else { //将过滤掉的数据加入到更多中
+				*moreArr = append(*moreArr, map[string]interface{}{
+					"publishtime": zb["publishtime_str"],
+					"subtype":     zb["subtype"],
+					"title":       zb["title"],
+					"href":        util.GetJyHref(qu.ObjToString(zb["id"])),
+				})
+			}
+		}
+		resultTmp = tmp[index]
+	}
+	return
+}
+
 //拼装中标候选人
 func setWorderMap(info map[string]interface{}) ([]interface{}, []bool) {
 	//基本参数--中标候选人
@@ -892,8 +996,12 @@ func setPaceMap(info map[string]interface{}) ([]map[string]interface{}, []string
 				pack := []interface{}{}
 				for _, cpack := range confpack {
 					cpack, _ := cpack.(map[string]interface{})
+					key := qu.ObjToString(cpack["key"])
+					if key == "winner" || key == "bidamount" { //中标单位和中标金额winner_all特殊处理
+						continue
+					}
 					tp := map[string]interface{}{
-						"key":      cpack["key"],
+						"key":      key,
 						"descript": cpack["descript"],
 					}
 					if tmppack[fmt.Sprint(tp["key"])] != nil {
@@ -901,7 +1009,6 @@ func setPaceMap(info map[string]interface{}) ([]map[string]interface{}, []string
 					} else {
 						tp["value"] = ""
 					}
-
 					if tmppack[preKey+fmt.Sprint(tp["key"])] == nil {
 						tp["status"] = "-1"
 					} else {
@@ -909,9 +1016,53 @@ func setPaceMap(info map[string]interface{}) ([]map[string]interface{}, []string
 					}
 					pack = append(pack, tp)
 				}
+				//特殊处理中标单位和中标金额
+				winnerall := []interface{}{}
+				if tmpWinnerAll, ok := tmppack["winner_all"].([]interface{}); ok && len(tmpWinnerAll) > 0 {
+					status := "-1"
+					if tmppack[preKey+"winner_all"] != nil {
+						status = "1"
+					}
+					for _, tmp := range tmpWinnerAll {
+						tmpMap := tmp.(map[string]interface{})
+						win := map[string]interface{}{
+							"descript": "标段(包)中标单位",
+							"key":      "winner",
+							"status":   status,
+							"value":    qu.ObjToString(tmpMap["winner"]),
+						}
+						winnerall = append(winnerall, win)
+						var bidamount interface{}
+						if tmpMap["bidamount"] == nil {
+							bidamount = ""
+						} else {
+							bidamount = fmt.Sprint(tmpMap["bidamount"])
+						}
+						bid := map[string]interface{}{
+							"descript": "标段(包)中金额",
+							"key":      "bidamount",
+							"status":   status,
+							"value":    bidamount,
+						}
+						winnerall = append(winnerall, bid)
+					}
+				} else {
+					winnerall = append(winnerall, map[string]interface{}{
+						"descript": "标段(包)中标单位",
+						"key":      "winner",
+						"status":   "-1",
+						"value":    "",
+					})
+					winnerall = append(winnerall, map[string]interface{}{
+						"descript": "标段(包)中标价",
+						"key":      "bidamount",
+						"status":   "-1",
+						"value":    "",
+					})
+				}
 				packs[k] = map[string]interface{}{
-					"pack": pack,
-					//"pack_worder": pack_worder,
+					"pack":      pack,
+					"winnerall": winnerall,
 				}
 			}
 		}
@@ -921,7 +1072,6 @@ func setPaceMap(info map[string]interface{}) ([]map[string]interface{}, []string
 	for _, v := range sortpackskey {
 		packages = append(packages, packs[v])
 	}
-	//qu.Debug("分包---", packages)
 	return packages, sortpackskey, isNewPkg
 }
 
@@ -1115,7 +1265,7 @@ func BzBDXX(content []interface{}, set, unset, errset map[string]interface{}, is
 						} else {
 							isNull = true
 						}
-					} else if key == "blackboard_or_screen" {
+					} else if key == "pclisover" {
 						input = tmpMap["select"]
 					}
 					if !isNull { //避免数字类型的字段在没有填写值的情况默认给0

+ 4 - 0
src/front/server.go

@@ -1 +1,5 @@
 package front
+
+func getOtherInfo() {
+
+}

+ 5 - 1
src/util/util.go

@@ -201,7 +201,7 @@ func circleNumberToInt(value string) int {
 
 //oss
 var (
-	ossEndpoint        = "oss-cn-beijing-internal.aliyuncs.com" //正式环境用:oss-cn-beijing-internal.aliyuncs.com 测试:oss-cn-beijing.aliyuncs.com
+	ossEndpoint        = "oss-cn-beijing.aliyuncs.com" //正式环境用:oss-cn-beijing-internal.aliyuncs.com 测试:oss-cn-beijing.aliyuncs.com
 	ossAccessKeyId     = "LTAI4G5x9aoZx8dDamQ7vfZi"
 	ossAccessKeySecret = "Bk98FsbPYXcJe72n1bG3Ssf73acuNh"
 	ossBucketName      = "topjy"
@@ -304,3 +304,7 @@ func GetFileText(tmp map[string]interface{}) (filetext string) {
 	*/
 	return
 }
+
+func GetJyHref(id string) string {
+	return JYHREFPRE + util.CommonEncodeArticle("content", id) + ".html"
+}

+ 1 - 0
src/web/staticres/css/zz.css

@@ -95,6 +95,7 @@
 .content .article { width: 50%; padding-left: 15px; min-width: 200px; background-color: #ffef9c; }
 
 .content .article mark { background-color: red; color: white; }
+.content .article mark.focus { background-color: #09bb07; color: white; }
 
 .content .operation { width: 50%; min-width: 300px; background-color: #e6e6e6; }
 

+ 368 - 128
src/web/templates/detail.html

@@ -61,6 +61,15 @@
         .pass.default {
             background-color: #adadad !important;
         }
+        .el-table td, .el-table th {
+          padding: 4px 0;
+        }
+        .top-button-group {
+          margin-top: 20px;
+        }
+         .top-button-group button {
+          margin-bottom: 12px;
+        }
     </style>
     <script>
         function prettyPrint(obj) {
@@ -115,31 +124,48 @@
     <div class="content" :class="{mm:showPop}">
         <!--文章区-->
         <div class="article" >
-            <h4>
-                已验/总数:{{.T.checkednum}}/{{.T.allnum}}
-            </h4>
+            <div class="top-button-group">
+              <el-button-group>
+                <el-button  type="primary" plain size="mini" @click="activeLabel = '原文'">原文</el-button>
+                {{if .T.info.filetext}}
+                <el-button  type="primary" plain size="mini" @click="activeLabel = '附件'">附件</el-button>
+                {{end}}
+              </el-button-group>
+              <el-button-group v-for="(item, index) in otherInfo">
+                <el-button  type="success" plain size="mini"  @click="activeLabel = item.subtype">[[item.subtype]]</el-button>
+                <el-button type="success" plain size="mini"  v-if="item.filetext" @click="activeLabel = item.subtype + '-附件'">附件</el-button>
+              </el-button-group>
+              <el-button-group v-if="moreInfo&&moreInfo.length > 0">
+                <el-popover
+                  placement="right-end"
+                  trigger="hover">
+                  <el-table :data="moreInfo"  max-height="300">
+                    <el-table-column width="50" property="subtype" label="类型"></el-table-column>
+                    <el-table-column width="180" property="publishtime" label="发布日期"></el-table-column>
+                    <el-table-column width="220" property="title" label="标题">
+                      <template slot-scope="scope">
+                        <a href="#" @click="openLink(scope.row.href)">[[scope.row.title]]</a>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                 <el-button slot="reference" style="border-color: #d3d4d6;"  size="mini" type="info" plain>更多</el-button>
+                </el-popover>
+              </el-button-group>
+            </div>
+            
             <hr style="border:1 double;" width="100%">
-            <br><a href="{{.T.info.href}}" target="_blank">查看原文</a>
-            <a href="{{.T.jyhref}}" target="_blank">剑鱼链接</a>
-            <h3>{{.T.info.title}}</h3><br>
+            <br><a v-if="getPageInfo.href.length > 0" :href="getPageInfo.href" target="_blank">查看原文</a>
+            <!--<a href="{{.T.jyhref}}" target="_blank">剑鱼链接</a>-->
+            <h3>[[getPageInfo.title]]</h3><br>
 
-            {{if .T.info.detail}}
-            <div v-html="dataHtml"></div>
-            {{end}}
-        
-            {{if .T.info.filetext}}
-            <br><h3>附件内容</h3>
-<!--            <div>{{.T.info.filetext}}</div>-->
-            <div v-html="fileHtml"></div>
-            {{end}}
+            <div v-html="pageHtml"></div>
         </div>
         <!--操作区-->
-
         <div class="operation">
             <!--edit-box-->
             <div class="edit-box">
                 <!--edit-->
-                <div class="edit one" v-for="(one,index) in editData" :key="index">
+                <div class="edit one" v-for="(one,oindex) in editData" :key="oindex">
                     <!--one-->
                     <div class="edit-title" @click="one.show = !one.show">
                         <span>[[one.title]]</span>
@@ -161,17 +187,7 @@
                                 <!--<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 class="add-tip"  :class="{err: (one.status != '1' && one.status != '-1')}" @click="setStatus(one,'2')"></div>
                             </div>
 
                         </div>
@@ -179,7 +195,7 @@
                     <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;">新增[[one.title]]</button>
+                                <button  class="pass a-button" @click.stop="addChild(one, oindex)" 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-->
@@ -188,7 +204,8 @@
                                 <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">
+                                        <div class="button-box" :style="one.title == '多包信息' ? 'margin-right: 193px' : ''">
+                                            <button v-if="one.title == '多包信息'"  class="pass a-button" @click.stop="addThreeChild(two,'2',one)" style="font-size: 14px;margin: 0;width: auto;float:left;">新增中标信息</button>
                                             <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>
@@ -200,10 +217,10 @@
                                         <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 v-for="(uin, uindex) 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" @change="selectchange(uin,'3', two, one)">
+                                                        <select v-model="uin.select" @change="focusFn(uin, oindex,index,uindex, two, one)">
                                                             <option disabled value="">请选择</option>
                                                             <option v-for="o in uin.selectArr">[[o]]</option>
                                                         </select>
@@ -211,31 +228,19 @@
                                                             <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 class="add-tip"  @click="setStatus(uin,'2', two, one)" :class="{err: (uin.status != '1' && uin.status != '-1')}"></div>
+
                                                         </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)">
+                                                        <input type="text" v-model="uin.input" @click="goText(uin.input)" @blur="focusFn(uin, oindex, index, uindex,two,one)">
                                                         <div class="info-box">
                                                             <div :class="{default: uin.status == '-1'}" @click="setStatus(uin,'-1', two, one)"></div>
                                                             <div :class="{ok: uin.status == '1'}" @click="setStatus(uin,'1', two, one)"></div>
                                                             <!--<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 class="add-tip" @click="setStatus(uin,'2', two, one)" :class="{err: (uin.status != '1' && uin.status != '-1')}"></div>
+
                                                         </div>
                                                     </div>
                                                 </div>
@@ -295,7 +300,7 @@
                 </div>
             </div>
             <div class="save-box">
-<!--                <button  class="code" @click.stop="showPop = true" style="width:100px">源码</button>&nbsp;&nbsp;-->
+                <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;-->
@@ -324,6 +329,121 @@
 
 </body>
 <script>
+  // 页面数据
+  var pageDataMap = {
+    '原文': {
+      title: '{{.T.info.title}}',
+      href: '{{.T.info.href}}',
+      html: `{{Html (Regexp (Regexp .T.info.detail "(\\n|\\\\n)\\s+" "\n") "(`|\\n|\\\\n)+" "<br/>")}}`,
+    },
+    '附件': {
+      title: '附件内容',
+      href: '',
+      html: {{if .T.info.filetext}}{{.T.info.filetext}}.replace(/(\\n|\\\\n)\\s+/, '\n').replace(/(`|\\n|\\\\n)+/, '<br>'){{else}}``{{end}},
+    }
+  }
+  // 更多关联信息
+  var moreInfo = {{.T.moreInfo}}
+  console.log(moreInfo)
+  //公告关联信息
+  var otherInfo = {{.T.otherInfo}};
+  console.log(otherInfo)
+  //快捷键
+  $(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 == 90){//预算快捷键z
+      if(event.shiftKey){
+        app.changeBaseValue(6, '', 2) //删除对应文本
+      }else{
+        app.changeBaseValue(6, text, 2)//填充
+      }
+    }else if(event.keyCode == 88){//中标金额快捷键x
+      if(event.shiftKey){
+        app.changeBaseValue(7, '', 2) //删除对应文本
+      }else{
+        app.changeBaseValue(7, text, 2)//填充
+      }
+    }else if(event.keyCode == 65){//采购单位快捷键a
+      if(event.shiftKey){
+        app.changeBaseValue(8, '', 2) //删除对应文本
+      }else{
+        app.changeBaseValue(8, text, 2)//填充
+      }
+    }else if(event.keyCode == 83){//代理机构快捷键s
+      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(){
+    var text = "";
+    if (window.getSelection) { //chrome,firefox,opera
+      var range=window.getSelection().getRangeAt(0);
+      var container = document.createElement('div');
+      container.appendChild(range.cloneContents());
+      text = container.innerHTML;
+      //return container.innerHTML;
+      //return window.getSelection(); //只复制文本
+    }else if (document.getSelection) { //其他
+      var range=document.getSelection().getRangeAt(0);
+      var container = document.createElement('div');
+      container.appendChild(range.cloneContents());
+      text = container.innerHTML;
+      //return container.innerHTML;
+      //return document.getSelection(); //只复制文本
+    }else if (document.selection) { //IE特有的
+      text = document.selection.createRange().htmlText;
+      //return document.selection.createRange().htmlText;
+      //return document.selection.createRange().text; //只复制文本
+    }
+    text = text.replace(/(\r|\n|\s+|&nbsp;|\<br\>|\<br\/\>)/g, "")
+    return text;
+  }
+  
     //记录是否点击保存
     var issave = false;
     var _id = {{.T.info._id}};
@@ -420,9 +540,10 @@
             tmp.input=purchasinglist[k][i].value
             tmp.key=purchasinglist[k][i].key
             tmp.status=purchasinglist[k][i].status
-            if(purchasinglist[k][i].key== "blackboard_or_screen"){
-              tmp.select=purchasinglist[k][i].value
-              tmp.selectArr=['黑板','大屏','黑板/大屏']
+            if(purchasinglist[k][i].key== "pclisover"){
+              tmp.select = purchasinglist[k][i].value ? purchasinglist[k][i].value : '是'
+              //tmp.select=purchasinglist[k][i].value
+              tmp.selectArr=['是','否']
             }
             c_uInput[i]=tmp
         }
@@ -436,7 +557,6 @@
         pcl_content[k]=content
     }
 
-
     //var ispackage='{{.T.ispackage}}'
     //子包信息
     var packs={{.T.packs}}
@@ -457,13 +577,20 @@
             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 winnerall = packs[k]["winnerall"]
+        for(i in winnerall){
+          var tmp={}
+          tmp.title=winnerall[i].descript
+      		tmp.input=winnerall[i].value
+      		tmp.key=winnerall[i].key
+      		tmp.status=winnerall[i].status
+          uInputs.push(tmp)
+      	}
         var content={};
         content.title="子包";
         content.show=true;
@@ -472,53 +599,25 @@
         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={}
-			tmp.title=pworder[i][n].descript
-			tmp.input=pworder[i][n].value
-			tmp.key=pworder[i][n].key
-			tmp.status=pworder[i][n].status
-			in_uInputs[n]=tmp
-		}
-		var in_content={}
-		in_content.title="候选人";
-		if(i==0){
-			in_content.show=true;
-		}else{
-			in_content.show=false;
-		}
-	  in_content.uInput=in_uInputs;
-		p_in_content[i]=in_content
-	}
-         content.content=p_in_content;
-         p_content[k]=content;
-         */
+      
     }
 
     var pclf = {{.T.PurchasinglistField}};
     var pclfInput = []
     for(i in pclf){
-        for(key in pclf[i]){
-            var tempNode = {
-                input:"",
-                key:key,
-                status:"2",
-                title:pclf[i][key]
-            }
-            if(key== "blackboard_or_screen"){
-              tempNode.select= ''
-              tempNode.selectArr=['黑板','大屏','黑板/大屏']
-            }
-            pclfInput.push(tempNode)
-            
-          
-        }
+      for(key in pclf[i]){
+          var tempNode = {
+              input:"",
+              key:key,
+              status:"2",
+              title:pclf[i][key]
+          }
+          if(key== "pclisover"){
+            tempNode.select= '是'
+            tempNode.selectArr=['是','否']
+          }
+          pclfInput.push(tempNode)
+      }
     }
     
 
@@ -550,10 +649,15 @@
         el: '#app',
         delimiters:["[[","]]"],
         data: {
+            activeLabel: '原文',
+            otherInfo: otherInfo,
+            moreInfo: moreInfo,
+            scrollCache: {
+              value: '',
+              index: 0
+            },
             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: {{.T.info.filetext}}.replace(/(\\n|\\\\n)\\s+/, '\n').replace(/(`|\\n|\\\\n)+/, '<br>'),
+            pageHtml: `{{Html (Regexp (Regexp .T.info.detail "(\\n|\\\\n)\\s+" "\n") "(`|\\n|\\\\n)+" "<br/>")}}`,
             showPop: false,
             editData: [
                 {
@@ -623,9 +727,89 @@
                         }
                     ]
                 }
-            ]
+            ],
+            originData: []
+        },
+        watch: {
+          //切换标签时更改正文内容
+          'activeLabel': function (){
+            this.pageHtml = this.getPageInfo.html
+          }
+        },
+        computed: {
+          getPageInfo () {
+            var tempData = {
+              title: '',
+              html: this.pageHtml,
+              href: ''
+            }
+            //匹配原文或者原文附件
+            var originData = pageDataMap[this.activeLabel]
+            if (originData) {
+              tempData.title = originData.title
+              tempData.html = originData.html
+              tempData.href = originData.href
+            } else {//匹配原公告关联信息
+              var tempS = this.activeLabel.split('-')
+              var isFile = tempS.length === 2
+              var otherData = this.otherInfo.filter(v => v.subtype == tempS[0])
+              if (otherData.length > 0) {
+                tempData.title = otherData[0].title
+                tempData.html = otherData[0].detail
+                tempData.href = otherData[0].href
+                if (isFile) {
+                  tempData.title = '附件内容'
+                  tempData.html = otherData[0].filetext
+                  tempData.href = ''
+                }
+              }
+            }
+            return tempData
+          }
+        },
+        mounted () {
+          // 缓存原始数据
+          this.originData = JSON.parse(JSON.stringify([].concat(this.editData)))
         },
         methods: {
+          // 当前输入框数据与原始数据比较
+          focusFn (uin, oIndex, tIndex, uIndex, two, one) {
+            //console.log(uin,uin.input, this.originData[oIndex].content[tIndex].uInput[uIndex].input, 'item')
+            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 != ""){
+                  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)){
+                    this.$message({
+                      message: uin.title+",日期格式错误!正确格式:2006-01-02 15:04:05",
+                      type: 'warning',
+                      duration: 3000,
+                      offset: 300
+                    });
+                    return
+                  }
+              }
+            }
+            console.log(22222222222)
+            var oNode = this.originData[oIndex].content[tIndex].uInput[uIndex]
+            var changeStatus = uin.input == oNode.input
+            if (uin.select) {
+              changeStatus = uin.select == oNode.select
+            }
+            uin.status = changeStatus ? 1 : 2
+            this.setStatus(uin,uin.status,two,one);
+          },
+          openLink (link) {
+            window.open(link, '_blank')
+          },
+          // 改变基本字段属性
+          changeBaseValue (index, input, status) {
+            if (this.editData[0].content[0].uInput[index].input != input) {
+              this.editData[0].content[0].uInput[index].input = input
+              this.editData[0].content[0].uInput[index].status = status
+            }
+          },
             selectchange(uni,status,two,one){//状态更新
               if (uni.status == '-1' || uni.status == '2') {
                 status = 2
@@ -684,15 +868,14 @@
                 if (statusList[1] > 0) {
                     tempObj.obj.status = 1
                 }
-
                 if (statusList[4] > 0 || statusList[3] > 0 || statusList[2] > 0) {
-                    tempObj.obj.status = 3
+                    tempObj.obj.status = 2
                 }
                 if (statusList[4] === tempObj.list.length) {
-                    tempObj.obj.status = 4
+                    tempObj.obj.status = 2
                 }
                 if (statusList[3] === tempObj.list.length) {
-                    tempObj.obj.status = 3
+                    tempObj.obj.status = 2
                 }
                 if (statusList[2] === tempObj.list.length) {
                     tempObj.obj.status = 2
@@ -718,8 +901,14 @@
                         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
+                          this.$message({
+                            message: witch.title+",日期格式错误!正确格式:2006-01-02 15:04:05",
+                            type: 'warning',
+                            duration: 3000,
+                            offset: 300
+                          });
+                          //alert(witch.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
+                          return
                         }
                     }
                 }
@@ -737,8 +926,8 @@
                 if (two.ck_isnew) {
                     one.content.splice(index, 1)
                 } else {
-                    two.status = 4
-                    this.saveDataTwo(two, 4, one)
+                    two.status = 2
+                    this.saveDataTwo(two, 2, one)
                 }
                 this.checkOneStatus({
                     one: one,
@@ -766,25 +955,36 @@
             },
             goText: function (value) {
                 /*重置Html*/
-                this.dataHtml = this.tempHtml
-                if (!value) {return false}
+                this.pageHtml = this.getPageInfo.html
+                if (!value) {
+                  return false
+                }
                 var rs = new RegExp('(' + value + ')', 'gi')
-
-                if (rs.test(this.dataHtml)) {
-                    this.dataHtml = this.dataHtml.replace(rs, '<mark>$1</mark>')
+                //选中input框值文本高亮
+                if (rs.test(this.pageHtml)) {
+                    this.pageHtml = this.pageHtml.replace(rs, '<mark>$1</mark>')
                     /*延迟查询dom,防止dom未插入*/
                     var $this = this
                     setTimeout(function () {
-                        $this.goMark()
+                        $this.goMark(value)
                     }, 150)
                 } else {
                     /*重置Html*/
-                    this.dataHtml = this.tempHtml
+                    this.pageHtml = this.getPageInfo.html
                 }
             },
-            goMark: function () {
+            goMark: function (value) {
+                var mLength = document.querySelectorAll('mark').length
+                if (this.scrollCache.value === value) {
+                  this.scrollCache.index = (this.scrollCache.index + 1) % mLength
+                } else {
+                  this.scrollCache.index = 0
+                }
+                this.scrollCache.value = value
                 /*滚动到第一个mark*/
-                var temp = document.querySelectorAll('mark')[0]
+                var temp = document.querySelectorAll('mark')[this.scrollCache.index]
+                $("mark").removeClass('focus')
+                $(temp).addClass('focus')
                 document.querySelector('.article').scrollTop = offset(temp).top - window.screen.height / 2
             },
             //markTag:function(n){
@@ -802,12 +1002,12 @@
             //        }
             //    });
             //},
-            addChild: function (one) {
+            addChild: function (one, oindex) {
                 var tempNode = {}
                 switch (one.title) {
                     case "标的信息": {
                         tempNode = {
-                            content: [],
+                            //content: [],
                             show:true,
                             ck_isnew: true,
                             status: 2,
@@ -818,7 +1018,7 @@
                     }
                     case "多包信息": {pfInput
                         tempNode = {
-                            content: [],
+                            //content: [],
                             show:true,
                             status: 2,
                             ck_isnew: true,
@@ -829,7 +1029,7 @@
                     }
                     case "中标候选人信息": {
                         tempNode = {
-                            content: [],
+                            //content: [],
                             show:true,
                             status: 2,
                             ck_isnew: true,
@@ -847,6 +1047,34 @@
                     one: one,
                     type: true
                 })
+                this.$nextTick(() => {
+                  var tempN = $(".edit.one").eq(oindex).find(".edit-title")
+                  var goTop = tempN.eq(tempN.length - 1).offset().top
+                  setTimeout(() => {
+                    $(".operation").scrollTop(goTop)
+                  }, 150)
+                })
+            },
+            // 新增子包中标信息字段
+            addThreeChild:function(two,n, one){
+              two.uInput.push({
+                input:"",
+                key: 'winner',
+                status:"2",
+                title: '标段(包)中标单位'
+              })
+              two.uInput.push({
+                input:"",
+                key: 'bidamount',
+                status:"2",
+                title: '标段(包)中金额'
+              })
+              two.status = 2
+              this.checkOneStatus({
+                    one: one,
+                    two: two,
+                    type: false
+                })
             },
             //保存
             saveDataTwo:function(two,n, one){
@@ -858,7 +1086,13 @@
                             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")
+                                this.$message({
+                                  message: v.title+",日期格式错误!正确格式:2006-01-02 15:04:05",
+                                  type: 'warning',
+                                  duration: 3000,
+                                  offset: 300
+                                });
+                                //alert(v.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
                                 return
                             }
                         }
@@ -867,7 +1101,7 @@
                         v.status = n
                     } else if (n=="-1"){
                         v.status = n
-                    } else if (n=="4"){
+                    } else if (n=="2"){
                         v.status = n
                     }
                 });
@@ -900,7 +1134,13 @@
                                     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")
+                                      this.$message({
+                                        message: value.title+",日期格式错误!正确格式:2006-01-02 15:04:05",
+                                        type: 'warning',
+                                        duration: 3000,
+                                        offset: 300
+                                      });
+                                        //alert(value.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
                                         return
                                     }
                                 }

+ 0 - 1
src/web/templates/list.html

@@ -261,7 +261,6 @@ $(function(){
   //标注人员筛选
   for(i in {{.T.labelers}}){
     var selected = ""
-    console.log({{.T.labeler}},"----",{{.T.labelers}}[i])
     if({{.T.labeler}} == {{.T.labelers}}[i]){
       selected = "selected"
     }