Jianghan пре 1 година
родитељ
комит
8aa6b0b085

+ 1 - 1
exportData/config.json

@@ -1,7 +1,7 @@
 {
   "mgoAddr": "192.168.3.71:29099",
   "mgoDbName": "wjh",
-  "mgoColl": "bidding",
+  "mgoColl": "f_data",
   "mgoSize": 10,
   "exportType": 2,
   "isMark": 1,

+ 101 - 0
exportData/main.go

@@ -60,6 +60,16 @@ func init() {
 		Fields["totalprice"] = "预计采购金额(元)"
 		Fields["expurasingtime"] = "预计采购时间"
 		Fields["cgyxxqhref"] = "采购意向详情链接"
+	} else if ExportType == 4 {
+		FieldsArr[len(FieldsArr)-1] = "itemname"
+		FieldsArr = append(FieldsArr, "brandname", "madel", "unitname", "unitprice", "number", "totalprice", "id")
+		Fields["itemname"] = "产品名称"
+		Fields["brandname"] = "品牌"
+		Fields["madel"] = "规格型号"
+		Fields["unitname"] = "单位"
+		Fields["unitprice"] = "单价"
+		Fields["number"] = "数量"
+		Fields["totalprice"] = "小计"
 	}
 	util.Debug(FieldsArr)
 }
@@ -437,6 +447,97 @@ func main() {
 				}
 				Mgo.Save(DbColl+"_cf", m)
 			}
+		case 4:
+			// 多包 标的物拆分
+			if baseInfo["package"] != nil {
+				pkg := baseInfo["package"].(map[string]interface{})
+				for _, p := range pkg {
+					p1 := p.(map[string]interface{})
+					winner := []string{}
+					bidamount := float64(0)
+					if p1["winner_all"] != nil {
+						if all := p1["winner_all"].([]interface{}); all != nil {
+							if len(all) > 0 {
+								for _, a := range all {
+									a1 := a.(map[string]interface{})
+									if util.ObjToString(a1["winner"]) != "" {
+										winner = append(winner, util.ObjToString(a1["winner"]))
+									}
+									bidamount = util.Float64All(a1["bidamount"])
+								}
+							}
+						}
+					}
+					if len(winner) <= 0 {
+						continue
+					}
+					if plist, ok := p1["purchasinglist"].([]interface{}); ok {
+						for _, p := range plist {
+							row := sheet.AddRow()
+							p1 := p.(map[string]interface{})
+							for _, v := range FieldsArr {
+								if v == "itemname" || v == "brandname" || v == "madel" || v == "unitname" || v == "unitprice" || v == "number" {
+									row.AddCell().SetValue(p1[v])
+								} else if v == "totalprice" {
+									if p1["totalprice"] != nil {
+										row.AddCell().SetValue(p1[v])
+									} else {
+										if p1["unitprice"] != nil && p1["number"] != nil {
+											d1 := decimal.NewFromFloat(util.Float64All(p1["unitprice"])).Mul(decimal.NewFromInt(int64(util.IntAll(p1["number"]))))
+											row.AddCell().SetValue(d1)
+										} else {
+											row.AddCell().SetValue("")
+										}
+									}
+								} else if v == "bidamount" {
+									row.AddCell().SetValue(bidamount)
+								} else if v == "publishtime" || v == "bidopentime" || v == "project_startdate" || v == "project_completedate" ||
+									v == "signaturedate" || v == "comeintime" || v == "createtime" {
+									str := ""
+									if baseInfo[v] != nil {
+										date := util.Int64All(baseInfo[v])
+										str = util.FormatDateByInt64(&date, util.Date_Short_Layout)
+									}
+									row.AddCell().SetValue(str)
+								} else if v == "id" {
+									if tmp["id"] != nil {
+										id := SE.EncodeString(util.ObjToString(tmp["id"]))
+										row.AddCell().SetValue(id)
+									} else {
+										id := SE.EncodeString(mongodb.BsonIdToSId(tmp["_id"]))
+										row.AddCell().SetValue(id)
+									}
+								} else {
+									row.AddCell().SetValue(baseInfo[v])
+								}
+							}
+						}
+					}
+				}
+			} else {
+				row := sheet.AddRow()
+				for _, v := range FieldsArr {
+					if v == "publishtime" || v == "bidopentime" || v == "project_startdate" || v == "project_completedate" ||
+						v == "signaturedate" || v == "comeintime" || v == "createtime" {
+						str := ""
+						if baseInfo[v] != nil {
+							date := util.Int64All(baseInfo[v])
+							str = util.FormatDateByInt64(&date, util.Date_Short_Layout)
+						}
+						row.AddCell().SetValue(str)
+					} else if v == "id" {
+						if tmp["id"] != nil {
+							id := SE.EncodeString(util.ObjToString(tmp["id"]))
+							row.AddCell().SetValue(id)
+						} else {
+							id := SE.EncodeString(mongodb.BsonIdToSId(tmp["_id"]))
+							row.AddCell().SetValue(id)
+						}
+					} else {
+						row.AddCell().SetValue(baseInfo[v])
+					}
+				}
+			}
 		}
 	}
 	util.Debug("over ---", count)

+ 16 - 0
exportData/必须.txt

@@ -0,0 +1,16 @@
+导出工具使用(配置文件)线上数据
+1、打开代理,修改对应的本地端口
+ "mgoAddr": "127.0.0.1:27080"
+
+2、导出数据修改配置文件查询条件(search)
+样例:项目全量数据
+"search": {"appid": "3214"} //客户标识
+部分数据
+"search": {"appid": "3214","xxx": "xxx"}
+
+2、导出类型(exportType)
+exportType: 0,不拆分数据
+exportType: 1, 拆分标的物
+exportType: 2, 拆分多包
+exportType: 3, 拆分采购意向
+exportType: 4, 拆分多包的标的物

+ 58 - 22
src/front/project.go

@@ -7,7 +7,7 @@ import (
 	"github.com/tealeg/xlsx"
 	"go.mongodb.org/mongo-driver/bson"
 	"go.mongodb.org/mongo-driver/bson/primitive"
-	"io/ioutil"
+	"io"
 	"mime/multipart"
 	"mongodb"
 	qu "qfw/util"
@@ -143,8 +143,18 @@ func (f *Front) ProjectSave() {
 			f.ServeJson(map[string]interface{}{"success": false, "msg": "查询数据量为0!"})
 			return
 		}
-		s_departname, s_entname, s_rulename, importDataNum = ImportDataByColl(collName, query1, &success, &msg, &successNum)
-		qu.Debug(s_departname, s_entname, s_rulename, importDataNum)
+		s_departname, s_entname, appid, s_rulename, importDataNum = ImportDataByColl(collName, query1, &success, &msg, &successNum, true)
+		appidNum := ""
+		if util.Appid[appid] != 0 {
+			i := util.Appid[appid]
+			i++
+			appidNum = fmt.Sprintf("%s-%03d", appid, i)
+			util.Appid[appid] = i
+		} else {
+			appidNum = fmt.Sprintf("%s-%03d", appid, 1)
+			util.Appid[appid] = 1
+		}
+		qu.Debug(s_departname, s_entname, appidNum, s_rulename, importDataNum)
 		//保存项目信息
 		set = map[string]interface{}{
 			"s_name":         s_name,                        //项目名称
@@ -262,7 +272,7 @@ func (f *Front) ProjectAddData() {
 					f.ServeJson(map[string]interface{}{"success": false, "msg": "查询数据量为0!"})
 					return
 				}
-				_, _, _, importDataNum = ImportDataByColl(collName, query1, &success, &msg, &successNum)
+				_, _, _, _, importDataNum = ImportDataByColl(collName, query1, &success, &msg, &successNum, false)
 				if !success {
 					f.ServeJson(map[string]interface{}{"success": success, "msg": msg})
 					return
@@ -287,10 +297,11 @@ func (f *Front) ProjectAddData() {
 				}
 				//保存项目信息
 				set := map[string]interface{}{
-					"i_importnum":  importDataNum + qu.IntAll((*info)["i_importnum"]), //导入数量
-					"s_status":     s_status,                                          //项目状态
-					"i_updatetime": time.Now().Unix(),
-					"v_add_data":   addDataTag,
+					"i_importnum":    importDataNum + qu.IntAll((*info)["i_importnum"]), //导入数量
+					"s_status":       s_status,                                          //项目状态
+					"i_updatetime":   time.Now().Unix(),
+					"v_add_data":     addDataTag,
+					"b_isassessment": false,
 				}
 				util.Mgo.UpdateById(util.PROJECTCOLLNAME, projectid, map[string]interface{}{"$set": set})
 			}
@@ -1001,14 +1012,15 @@ func UpdateSourceInfoByGroup(stype, appid string, groupIdInfo map[string]util.Ta
 }
 
 // ImportDataByExcel 通过excel获取数据源
-func ImportDataByExcel(mf multipart.File, success *bool, msg *string, successNum *int64, createindex bool) (importDataNum int, appid string) {
+func ImportDataByExcel(mf multipart.File, success *bool, msg *string, successNum *int64, newCreate bool) (importDataNum int, appidNum string) {
 	defer qu.Catch()
-	binary, _ := ioutil.ReadAll(mf)
+	binary, _ := io.ReadAll(mf)
 	xls, _ := xlsx.OpenBinary(binary)
 	sheet := xls.Sheets[0]
 	rows := sheet.Rows
 	idcolnum := -1
 	appidColnum := -1
+	appid := ""
 	cellFieldName := map[int]string{} //记录客户需求字段所在的列
 	idInfoArr := []util.Data{}        //记录数据id及需要保存的字段信息
 	for rn, row := range rows {
@@ -1064,9 +1076,20 @@ func ImportDataByExcel(mf multipart.File, success *bool, msg *string, successNum
 		}
 	}
 	importDataNum = len(idInfoArr)
+	if util.Appid[appid] != 0 {
+		i := util.Appid[appid]
+		if newCreate { // 新增/追加
+			i++
+		}
+		appidNum = fmt.Sprintf("%s-%03d", appid, i)
+		util.Appid[appid] = i
+	} else {
+		appidNum = fmt.Sprintf("%s-%03d", appid, 1)
+		util.Appid[appid] = 1
+	}
 	qu.Debug("Load Excel Count:", importDataNum, appid)
 	if importDataNum > 0 {
-		GetDataById(idInfoArr, "excel", success, msg, successNum)
+		GetDataById(idInfoArr, appidNum, "excel", success, msg, successNum)
 	} else {
 		*success = false
 		*msg = "查询数据失败"
@@ -1076,7 +1099,7 @@ func ImportDataByExcel(mf multipart.File, success *bool, msg *string, successNum
 }
 
 // ImportDataByColl 通过表获取数据源
-func ImportDataByColl(collName string, query map[string]interface{}, success *bool, msg *string, successNum *int64) (departname, entname string, rulename []string, importDataNum int) {
+func ImportDataByColl(collName string, query map[string]interface{}, success *bool, msg *string, successNum *int64, newCreate bool) (departname, entname, appid string, rulename []string, importDataNum int) {
 	defer qu.Catch()
 	rulenameMap := map[string]bool{}
 	sess := util.MgoJy.GetMgoConn()
@@ -1095,8 +1118,10 @@ func ImportDataByColl(collName string, query map[string]interface{}, success *bo
 				<-ch
 				wg.Done()
 			}()
-			id := qu.ObjToString(tmp["id"])                //bidding id
-			appid := qu.ObjToString(tmp["appid"])          //根据appid查user表获取公司名称
+			id := qu.ObjToString(tmp["id"]) //bidding id
+			if appid == "" {
+				appid = qu.ObjToString(tmp["appid"]) //根据appid查user表获取公司名称
+			}
 			departname = qu.ObjToString(tmp["departname"]) //部门名称。所有数据都应部门名称,若不一致,随机取
 			needField := map[string]interface{}{}
 			for f := range util.CustomerFieldMap_EH {
@@ -1131,8 +1156,19 @@ func ImportDataByColl(collName string, query map[string]interface{}, success *bo
 		rulename = append(rulename, r)
 	}
 	importDataNum = len(idInfoArr) //查询数据总数
+	if util.Appid[appid] != 0 {
+		i := util.Appid[appid]
+		if newCreate { // 新增
+			i++
+		}
+		appid = fmt.Sprintf("%s-%03d", appid, i)
+		util.Appid[appid] = i
+	} else {
+		appid = fmt.Sprintf("%s-%03d", appid, 1)
+		util.Appid[appid] = 1
+	}
 	if importDataNum > 0 {
-		GetDataById(idInfoArr, "coll", success, msg, successNum)
+		GetDataById(idInfoArr, appid, "coll", success, msg, successNum)
 	} else {
 		*msg = "查询数据失败"
 	}
@@ -1141,7 +1177,7 @@ func ImportDataByColl(collName string, query map[string]interface{}, success *bo
 }
 
 // GetDataById 通过id集从bidding、extract、project获取数据所有信息
-func GetDataById(idInfoArr []util.Data, importType string, success *bool, msg *string, successNum *int64) {
+func GetDataById(idInfoArr []util.Data, appid, importType string, success *bool, msg *string, successNum *int64) {
 	*success = true
 	var msgArr []string
 	wg := &sync.WaitGroup{}
@@ -1172,9 +1208,9 @@ func GetDataById(idInfoArr []util.Data, importType string, success *bool, msg *s
 			tmp := tmpData.Info
 			m, _ := util.Mgo.FindById(util.DATACOLLNAME, id, nil)
 			if len(*m) > 0 {
-				appid := qu.ObjArrToStringArr((*m)["appid"].([]interface{}))
-				if !strings.Contains(strings.Join(appid, ","), qu.ObjToString(tmp["appid"])) {
-					util.Mgo.UpdateById(util.DATACOLLNAME, id, bson.M{"$push": bson.M{"appid": qu.ObjToString(tmp["appid"])}})
+				appids := qu.ObjArrToStringArr((*m)["appid"].([]interface{}))
+				if !strings.Contains(strings.Join(appids, ","), appid) {
+					util.Mgo.UpdateById(util.DATACOLLNAME, id, bson.M{"$push": bson.M{"appid": appid}})
 				}
 			} else {
 				//markData, _ := util.MgoHM.FindById("bidding", id, nil)
@@ -1195,9 +1231,9 @@ func GetDataById(idInfoArr []util.Data, importType string, success *bool, msg *s
 				}
 				if bidData != nil && len(*bidData) > 0 { //bidding表数据存在
 					//2.查extract
-					extData, _ := util.MgoE.FindById(util.ExtColl1, id, map[string]interface{}{"attach_text": 0})
+					extData, _ := util.MgoE.FindById(util.ExtColl1, id, map[string]interface{}{"attach_text": 0, "field_source": 0, "log": 0})
 					if extData == nil || len(*extData) == 0 {
-						extData, _ = util.MgoE.FindById(util.ExtColl2, id, map[string]interface{}{"attach_text": 0, "field_source": 0})
+						extData, _ = util.MgoE.FindById(util.ExtColl2, id, map[string]interface{}{"attach_text": 0, "field_source": 0, "log": 0})
 					}
 					//抽取表字段合并到bidding
 					if extData != nil && len(*extData) > 0 {
@@ -1289,7 +1325,7 @@ func GetDataById(idInfoArr []util.Data, importType string, success *bool, msg *s
 						baseInfoMap["v_taginfo"] = tagInfoMap
 					}
 					baseInfoMap["i_createtime"] = time.Now().Unix()
-					baseInfoMap["appid"] = []string{qu.ObjToString((*bidData)["appid"])}
+					baseInfoMap["appid"] = []string{appid}
 					baseInfoMap["b_isgivegroup"] = false //是否分配给用户组
 					baseInfoMap["b_istag"] = false       //是否已标注
 					//baseInfoMap["b_cleartag"] = false    //是否清理标注信息

+ 59 - 3
src/front/remark.go

@@ -285,6 +285,17 @@ func setExtComMap(info, bzInfo map[string]interface{}, fs []map[string]interface
 	return common, other, purM, proM, pkgM, winM, enbArr
 }
 
+var mm = map[string]string{
+	"itemname":   "产品名称",
+	"brandname":  "品牌",
+	"madel":      "型号",
+	"unitname":   "计量单位",
+	"unitprice":  "单价",
+	"number":     "数量",
+	"totalprice": "总价",
+	"departroom": "科室",
+}
+
 // 拼装子包信息
 func setPaceMap(info map[string]interface{}, confpack []map[string]interface{}, stype string) ([]map[string]interface{}, []string, []bool) {
 	//bzpack := bzInfo["package"].(map[string]interface{})
@@ -359,10 +370,29 @@ func setPaceMap(info map[string]interface{}, confpack []map[string]interface{},
 						"value":    "",
 					})
 				}
+				// 子包 标的物
+				var p_inputs []interface{}
+				if plist, o1 := tmppack["purchasinglist"].([]interface{}); o1 {
+					for _, v := range plist {
+						var inputs []interface{}
+						v1 := v.(map[string]interface{})
+						for key, value := range v1 {
+							tp := map[string]interface{}{
+								"key":      key,
+								"descript": mm[key],
+							}
+							tp["value"] = value
+							tp["status"] = status
+							inputs = append(inputs, tp)
+						}
+						p_inputs = append(p_inputs, inputs)
+					}
+				}
 				packs[k] = map[string]interface{}{
-					"pack":       pack,
-					"packstatus": status,
-					"winnerall":  winnerall,
+					"pack":           pack,
+					"packstatus":     status,
+					"winnerall":      winnerall,
+					"purchasinglist": p_inputs,
 				}
 			}
 		}
@@ -2337,6 +2367,32 @@ func MarkPackage(content []interface{}, tagSet, baseSet, baseUnset map[string]in
 			if len(result) > 0 && pkgSonStatus != 4 { //要删除的子包不再保存
 				pkgs[num] = result
 			}
+
+			var purList []map[string]interface{}
+			// 处理包的标的物
+			if plist, ok := info["content"].([]interface{}); ok {
+				for _, v := range plist {
+					if v1, o1 := v.(map[string]interface{}); o1 {
+						if uts, o2 := v1["uInput"].([]interface{}); o2 {
+							m1 := make(map[string]interface{})
+							for _, tmp := range uts {
+								if temp, o3 := tmp.(map[string]interface{}); o3 {
+									if qu.ObjToString(temp["key"]) != "" && qu.ObjToString(temp["input"]) != "" {
+										m1[qu.ObjToString(temp["key"])] = qu.ObjToString(temp["input"])
+									}
+								}
+							}
+							if len(m1) > 0 {
+								purList = append(purList, m1)
+							}
+						}
+					}
+				}
+				if len(purList) > 0 {
+					result["purchasinglist"] = purList
+				}
+				qu.Debug(purList)
+			}
 		}
 	}
 	if len(pkgs)+delpkgson == len(content) {

+ 1 - 1
src/util/common.go

@@ -21,7 +21,7 @@ type Data struct {
 
 // oss
 var (
-	ossEndpoint        = "oss-cn-beijing.aliyuncs.com" //正式环境用:oss-cn-beijing-internal.aliyuncs.com 测试:oss-cn-beijing.aliyuncs.com
+	ossEndpoint        = "oss-cn-beijing-internal.aliyuncs.com" //正式环境用:oss-cn-beijing-internal.aliyuncs.com 测试:oss-cn-beijing.aliyuncs.com
 	ossAccessKeyId     = "LTAI4G5x9aoZx8dDamQ7vfZi"
 	ossAccessKeySecret = "Bk98FsbPYXcJe72n1bG3Ssf73acuNh"
 	ossBucketName      = "topjy"

+ 13 - 0
src/util/config.go

@@ -6,6 +6,8 @@ import (
 	"mongodb"
 	qu "qfw/util"
 	"sort"
+	"strconv"
+	"strings"
 	"sync"
 )
 
@@ -39,6 +41,8 @@ var (
 	MgoHM               *mongodb.MongodbSim //高质量库
 
 	MgoBulkSize = 200
+
+	Appid map[string]int
 )
 
 var (
@@ -242,4 +246,13 @@ func InitConfig() {
 	for _, f := range tmpAllField {
 		AllFieldArr = append(AllFieldArr, map[string]string{AllFieldMap[f]: f})
 	}
+
+	Appid = make(map[string]int, 50000)
+	info1, _ := Mgo.Find(PROJECTCOLLNAME, nil, nil, bson.M{"appid": 1}, false, -1, -1)
+	for _, m := range *info1 {
+		aid := qu.ObjToString(m["appid"])
+		ss := strings.Split(aid, "-")
+		intVar, _ := strconv.Atoi(ss[1])
+		Appid[ss[0]] = intVar
+	}
 }

+ 111 - 54
src/web/templates/project/check_detail.html

@@ -109,7 +109,9 @@
             -webkit-box-shadow: -1px 0 0 0 #409EFF;
             box-shadow: -1px 0 0 0 #409EFF
         }
-
+        .four {
+            margin-left: 16px;
+        }
 
     </style>
     <script>
@@ -171,7 +173,7 @@
 
                 <el-radio-group v-model="activeLabel" v-for="(item, index) in otherInfo" size="mini">
                     <el-radio-button class="success" :label="item.id">[[item.subtype]]</el-radio-button>
-                    <el-radio-button class="success" :label="item.id + '-附件'">附件</el-radio-button>
+<!--                    <el-radio-button class="success" :label="item.id + '-附件'">附件</el-radio-button>-->
                 </el-radio-group>
 
                 <el-radio-group v-if="moreInfo&&moreInfo.length > 0" size="mini">
@@ -245,11 +247,6 @@
                     </div>
                     <transition tag="div">
                         <div>
-                            <div class="button-box" v-if="one.showCheck&&one.show">
-                                <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-->
 
@@ -259,7 +256,7 @@
                                         <span>[[two.title]]</span>
                                         <div class="button-box"
                                              :style="one.title == '多包信息' ? 'margin-right: 193px' : ''">
-                                            <button v-if="one.title == '多包信息'" class="pass a-button"
+                                            <button v-if="one.title == '多包信息'  && !two.isFour" class="pass a-button"
                                                     @click.stop="addThreeChild(two,'2',one)"
                                                     style="font-size: 14px;margin: 0;width: auto;float:left;">新增子包中标信息
                                             </button>
@@ -316,52 +313,6 @@
                                                     </div>
                                                 </div>
                                             </div>
-                                            <!--three-->
-                                            <!--<div>
-                                                                     <div class="edit-title" v-show="one.title == '基本字段'">
-                                                    <span>候选人</span>
-                                                    <div class="info-box" >
-                                                        <div :class="{default: two.wstatus == '-1'}" @click="two.wstatus = '-1'"></div>
-                                                        <div :class="{ok: two.wstatus == '1'}" @click="two.wstatus = '1'"></div>
-                                                        <el-popover trigger="click" >
-                                                          <div style="text-align: right; margin: 0">
-                                                            <el-button type="success" size="mini" @click="two.wstatus = '2'">新增</el-button>
-                                                            <el-button type="warning" size="mini" @click="two.wstatus = '3'">修改</el-button>
-                                                            <el-button type="danger" size="mini" @click="two.wstatus = '4'">删除</el-button>
-                                                          </div>
-                                                          <div class="add-tip" slot="reference" :class="{err: (two.wstatus != '1' && two.wstatus != '-1')}">[[textMap[two.wstatus] || '']]</div>
-                                                        </el-popover>
-                                                    </div>
-                                                </div>
-                                                <div class="edit three" v-for="(three,index) in two.content" :key="index">
-                                                    <div class="edit-title" @click="three.show = !three.show">
-                                                        <span>[[three.title]]</span>
-                                                    </div>
-                                                    <div class="edit-content" v-show="three.show">
-                                                        <div class="edit-input">
-                                                            <div class="input-box" v-for="(threeUin,index) in three.uInput" :key="threeUin.title">
-                                                                <div class="label">
-                                                                    <span @click="goText(threeUin.title)">[[threeUin.title]]&nbsp;:&nbsp;</span>
-                                                                    <input type="text" v-model="threeUin.input" @focus="goText(threeUin.input)" @click="goText(threeUin.input)">
-                                                                    <div class="info-box">
-                                                                        <div :class="{default: threeUin.status == '-1'}" @click="threeUin.status = '-1'"></div>
-                                                                        <div :class="{ok: threeUin.status == '1'}" @click="threeUin.status = '1'"></div>
-                                                                      <el-popover trigger="click" >
-                                                                        <div style="text-align: right; margin: 0">
-                                                                          <el-button type="success" size="mini" @click="threeUin.status = '2'">新增</el-button>
-                                                                          <el-button type="warning" size="mini" @click="threeUin.status = '3'">修改</el-button>
-                                                                          <el-button type="danger" size="mini" @click="threeUin.status = '4'">删除</el-button>
-                                                                        </div>
-                                                                        <div class="add-tip" slot="reference" :class="{err: (threeUin.status != '1' && threeUin.status != '-1')}">[[textMap[threeUin.status] || '']]</div>
-                                                                      </el-popover>
-                                                                    </div>
-                                                                </div>
-                                                            </div>
-                                                        </div>
-                                                    </div>
-                                                </div>
-                                            </div>-->
-
                                         </div>
                                     </transition>
                                 </div>
@@ -630,6 +581,28 @@
             tmp.status = winnerall[i].status
             uInputs.push(tmp)
         }
+        // 包 标的物信息
+        var plist = packs[k]["purchasinglist"]
+        let pur_content = [];
+        for (i in plist) {
+            var p_inputs = []
+            for (kk in plist[i]) {
+                var tmp = {}
+                tmp.title = plist[i][kk].descript
+                tmp.input = plist[i][kk].value
+                tmp.key = plist[i][kk].key
+                tmp.status = plist[i][kk].status
+                p_inputs.push(tmp)
+            }
+            pur_content.push({
+                title: "子包-标的物信息",
+                show: true,
+                status: '2',
+                uInput: p_inputs,
+            })
+        }
+
+
         var content = {};
         content.title = "子包";
         content.show = true;
@@ -637,6 +610,7 @@
         content.uInput = uInputs;
         content.isnew = pkg_new[k] || false
         content.num = packskey[k];
+        content.content = pur_content
         p_content[k] = content;
 
     }
@@ -824,6 +798,22 @@
             mounted() {
                 // 缓存原始数据
                 this.originData = JSON.parse(JSON.stringify([].concat(this.editData)))
+                this.editData = this.tranEditData(this.editData, false)
+                $('#group-switch-pwd').bootstrapSwitch({
+                    onText : "是",
+                    offText : "否",
+                    onColor : "success",
+                    offColor : "warning",
+                }).bootstrapSwitch('size', 'small').bootstrapSwitch('state', true);
+                $("#group-switch-pwd").bootstrapSwitch(
+                    'onSwitchChange', function (event, state){
+                        if (state===true) {
+                            isEff = true
+                        }else {
+                            isEff = false
+                        }
+                    }
+                )
             },
             methods: {
                 // 当前输入框数据与原始数据比较
@@ -1139,6 +1129,32 @@
                         type: false
                     })
                 },
+                addFourChild: function (index, one, two) {
+                    console.log(one, two)
+                    var tempNode = {
+                        show: true,
+                        status: "2",
+                        isnew: true,
+                        isFour: true,
+                        parentIndex: index,
+                        title: "子包-标的物信息",
+                        uInput: [
+                            { input: "", key: "itemname", status: "2", title: "产品名称"},
+                            { input: "", key: "brandname", status: "2", title: "品牌"},
+                            { input: "", key: "madel", status: "2", title: "型号"},
+                            { input: "", key: "unitname", status: "2", title: "计量单位"},
+                            { input: "", key: "unitprice", status: "2", title: "单价"},
+                            { input: "", key: "number", status: "2", title: "数量"},
+                            { input: "", key: "totalprice", status: "2", title: "总价"},
+                            { input: "", key: "departroom", status: "2", title: "科室"},
+                        ]
+                    }
+                    one.content.splice(Number(index) + 1, 0, JSON.parse(JSON.stringify(tempNode)));
+                    this.checkOneStatus({
+                        one: one,
+                        type: true
+                    })
+                },
                 //保存
                 saveDataTwo:function (two, n, one) {
                     two.uInput.forEach(function (v) {
@@ -1228,6 +1244,47 @@
                         })
                     });
                 },
+                tranEditData: function(data, type) {
+                    var list = JSON.parse(JSON.stringify(data))
+                    for (var i = 0; i < list.length; i++) {
+                        var one = list[i]
+                        if (one.content) {
+                            for (var j = 0; j < one.content.length; j++) {
+                                var two = one.content[j]
+                                var twoIndex = j
+                                // 转回 content
+                                if (type) {
+                                    if (two.isFour) {
+                                        var parentNode = one.content[two.parentIndex]
+                                        if (!parentNode.content) {
+                                            parentNode.content = []
+                                        }
+                                        parentNode.content.push(two)
+                                    }
+                                } else {
+                                    // 转回平级
+                                    if (two.content) {
+                                        two.content = two.content.map(s => {
+                                            s.parentIndex = twoIndex
+                                            s.isFour = true
+                                            return s
+                                        })
+                                        one.content.splice(twoIndex + 1, 0, ...two.content)
+                                    }
+                                }
+                            }
+                            if (type) {
+                                one.content = one.content.filter(two => two.isFour !== true)
+                            } else {
+                                one.content = one.content.map(two => {
+                                    two.content = []
+                                    return two
+                                })
+                            }
+                        }
+                    }
+                    return list
+                },
                 //验证保存提示
                 open:function (stype) {
                     var noTagKey = [];

+ 5 - 5
src/web/templates/project/project_clear.html

@@ -35,7 +35,7 @@
                                     </div>
                                     <div class="col-xs-5 form-group">
                                         <label class="form-inline">&nbsp;操作:
-                                            <a type="button" class="btn btn-sm btn-primary" href="/front/user/jymark/list?appid={{.T.appid}}&pid={.T.s_projectid}&stype=all">标注</a>
+                                            <a type="button" class="btn btn-sm btn-primary" href="/front/user/jymark/list?appid={{.T.appid}}&pid={{.T.s_projectid}}&stype=all">标注</a>
                                             <a type="button" class="btn btn-sm btn-primary" onclick="dispatchTask('all')">分发</a>
                                             <a type="button" class="btn btn-sm btn-primary" onclick="checkMethod('all')">质检</a>
                                             <a type="button" class="btn btn-sm btn-primary" onclick="checkAllSuc()">通过</a>
@@ -55,7 +55,7 @@
                                     </div>
                                     <div class="col-xs-5 form-group">
                                         <label class="form-inline">操作:
-                                            <a type="button" class="btn btn-sm btn-primary" href="/front/user/jymark/list?appid={{.T.appid}}&pid={.T.s_projectid}&stype=notag">标注</a>
+                                            <a type="button" class="btn btn-sm btn-primary" href="/front/user/jymark/list?appid={{.T.appid}}&pid={{.T.s_projectid}}&stype=notag">标注</a>
                                             <a type="button" class="btn btn-sm btn-primary" onclick="dispatchTask('notag')">分发</a>
                                             <a type="button" class="btn btn-sm btn-primary" onclick="checkMethod('notag')">质检</a>
                                             <a type="button" class="btn btn-sm btn-primary" onclick="checkSuc()">质检通过</a>
@@ -439,13 +439,13 @@
     }
 
     // 收回
-    function retrieveTask(id, status, givenum) {
+    function retrieveTask(id, status) {
         if (status === "未开始" || status === "进行中") {
             showConfirm("确认要收回当前任务吗?", function () {
                 $.ajax({
                     url: "/front/project/task/retrieve",
                     type: 'POST',
-                    data: { "taskid": id, "i_givenum" :givenum},
+                    data: { "taskid": id, "appid" :appid},
                     success: function (r) {
                         if (r.success) {
                             let msg = r.msg+"<br>"+"共收回"+r.count+"数据。"
@@ -469,7 +469,7 @@
                 $.ajax({
                     url: "/front/project/task/repulse",
                     type: 'POST',
-                    data: {"taskid": id},
+                    data: {"taskid": id, "appid": appid},
                     success: function (r) {
                         if (r.success) {
                             location.reload()

+ 744 - 650
src/web/templates/project/remark_detail.html

@@ -112,7 +112,9 @@
             -webkit-box-shadow: -1px 0 0 0 #409EFF;
             box-shadow: -1px 0 0 0 #409EFF
         }
-
+        .four {
+            margin-left: 16px;
+        }
 
     </style>
     <script>
@@ -175,7 +177,7 @@
                 <el-radio-group v-model="activeLabel" v-for="(item, index) in otherInfo" size="mini">
                     <el-radio-button class="success" :label="item.id">[[item.subtype]]</el-radio-button>
                     <el-radio-button v-if="item.filetext && item.filetext.length > 10" class="success" :label="item.id + '-附件'">附件</el-radio-button>
-<!--                    <el-radio-button class="success" :label="item.id + '-附件'">附件</el-radio-button>-->
+                    <!--                    <el-radio-button class="success" :label="item.id + '-附件'">附件</el-radio-button>-->
                 </el-radio-group>
 
                 <el-radio-group v-if="moreInfo&&moreInfo.length > 0" size="mini">
@@ -263,10 +265,14 @@
                                         <span>[[two.title]]</span>
                                         <div class="button-box"
                                              :style="one.title == '多包信息' ? 'margin-right: 193px' : ''">
-                                            <button v-if="one.title == '多包信息'" class="pass a-button"
+                                            <button v-if="one.title == '多包信息'  && !two.isFour" class="pass a-button"
                                                     @click.stop="addThreeChild(two,'2',one)"
                                                     style="font-size: 14px;margin: 0;width: auto;float:left;">新增子包中标信息
                                             </button>
+                                            <button v-if="one.title == '多包信息' && !two.isFour" class="pass a-button"
+                                                    @click.stop="addFourChild(index, one, two)"
+                                                    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>
@@ -333,7 +339,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="openHref(1)" style="width:100px">上一条</button>
                 <button class="code" @click.stop="open(2)" style="width:100px">保存</button>
@@ -596,6 +602,28 @@
             tmp.status = winnerall[i].status
             uInputs.push(tmp)
         }
+        // 包 标的物信息
+        var plist = packs[k]["purchasinglist"]
+        let pur_content = [];
+        for (i in plist) {
+            var p_inputs = []
+            for (kk in plist[i]) {
+                var tmp = {}
+                tmp.title = plist[i][kk].descript
+                tmp.input = plist[i][kk].value
+                tmp.key = plist[i][kk].key
+                tmp.status = plist[i][kk].status
+                p_inputs.push(tmp)
+            }
+            pur_content.push({
+                title: "子包-标的物信息",
+                show: true,
+                status: '2',
+                uInput: p_inputs,
+            })
+        }
+
+
         var content = {};
         content.title = "子包";
         content.show = true;
@@ -603,8 +631,8 @@
         content.uInput = uInputs;
         content.isnew = pkg_new[k] || false
         content.num = packskey[k];
+        content.content = pur_content
         p_content[k] = content;
-
     }
 
     var pclf = {{ .T.PurchasinglistField }}
@@ -698,8 +726,8 @@
                     //wstatus:"-1",
                     uInput: uInput
                     //content: c_content
-                    }]
-                }, {
+                }]
+            }, {
                 title: '标的信息',
                 show: false,
                 showCheck: true,
@@ -708,7 +736,7 @@
                 checkAllTag: purchasing_all_tag,
                 status: purchasing_status,
                 content: pcl_content
-                }, {
+            }, {
                 title: '采购意向信息',
                 show:false,
                 showCheck: true,
@@ -716,7 +744,7 @@
                 // checkType: {{.T.ck_pkgisext}},
                 status: purchasing_status,
                 content: pcl_content_1
-                }, {
+            }, {
                 title: '多包信息',
                 show:true,
                 showCheck: true,
@@ -724,7 +752,7 @@
                 // checkType: {{.T.ck_pkgisext}},
                 status: package_status,
                 content: p_content
-                }, {
+            }, {
                 title: '中标候选人信息',
                 show: false,
                 showCheck: true,
@@ -732,7 +760,7 @@
                 // checkType: {{.T.ck_wodrisext}},
                 status: winneroder_status,
                 content: c_content
-                }, {
+            }, {
                 title: '自定义字段',
                 show:true,
                 key: 'extend',
@@ -743,727 +771,793 @@
                     delete: false,
                     //wstatus:"-1",
                     uInput: otherInput
-                  }]
-                }].filter(group => {
+                }]
+            }].filter(group => {
                 return canShowGroupsList.includes(group.key)
             }),
             originData: []},
-            watch: {
-                //切换标签时更改正文内容
-                'activeLabel':
+        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.id == 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
+        computed: {
+            getPageInfo() {
+                var tempData = {
+                    title: '',
+                    html: this.pageHtml,
+                    href: ''
                 }
-            },
-            mounted() {
-                // 缓存原始数据
-                this.originData = JSON.parse(JSON.stringify([].concat(this.editData)))
-                $('#group-switch-pwd').bootstrapSwitch({
-                    onText : "是",
-                    offText : "否",
-                    onColor : "success",
-                    offColor : "warning",
-                }).bootstrapSwitch('size', 'small').bootstrapSwitch('state', true);
-                $("#group-switch-pwd").bootstrapSwitch(
-                    'onSwitchChange', function (event, state){
-                        if (state===true) {
-                            isEff = true
-                        }else {
-                            isEff = false
+                //匹配原文或者原文附件
+                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.id == 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 = ''
                         }
                     }
-                )
-            },
-            methods: {
-                // 当前输入框数据与原始数据比较
-                focusFn(uin, oIndex, tIndex, uIndex, two, one) {
-                    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 !== 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)) {
-                                  this.$message({
-                                      message: uin.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
-                                      type: 'warning',
-                                      duration: 2000,
-                                      offset: 300
-                                  });
-                                  return
-                            }
-                        }
-                    }
-                    var newNode = this.originData[oIndex].content[tIndex]
-                    if (newNode == null) {//新增子模块处理
-                        return
-                    }
-                    var oNode = newNode.uInput[uIndex]
-                    if (oNode == null) {//新增中标人信息处理
-                        return
-                    }
-                    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
+                }
+                return tempData
+            }
+        },
+        mounted() {
+            // 缓存原始数据
+            this.originData = JSON.parse(JSON.stringify([].concat(this.editData)))
+            this.editData = this.tranEditData(this.editData, false)
+            $('#group-switch-pwd').bootstrapSwitch({
+                onText : "是",
+                offText : "否",
+                onColor : "success",
+                offColor : "warning",
+            }).bootstrapSwitch('size', 'small').bootstrapSwitch('state', true);
+            $("#group-switch-pwd").bootstrapSwitch(
+                'onSwitchChange', function (event, state){
+                    if (state===true) {
+                        isEff = true
+                    }else {
+                        isEff = false
                     }
-                },
-                selectChange(uni, status, two, one) {
-                        //状态更新
-                        if (uni.status === '-1' || uni.status === '2') {
-                            status = "2"
-                        }
-                        this.setStatus(uni, status, two, one)
-                    },
-                openHref (i) {
-                    if (i === 1) {
-                        if (nextid === "") {
-                            alert("当前数据是第一条数据,没有上一条数据!")
-                        } else {
-                            window.location.href = "/front/user/remark/detail/?pid="+pid+"&tid="+tid+"&did="+lastid
-                        }
-                    } else {
-                        if (issave) {
-                            this.openHrefBefore()
-                        } else {
-                            this.open(2, () => {
-                                this.openHrefBefore()
-                            })
+                }
+            )
+        },
+        methods: {
+            // 当前输入框数据与原始数据比较
+            focusFn(uin, oIndex, tIndex, uIndex, two, one) {
+                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 !== 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)) {
+                            this.$message({
+                                message: uin.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
+                                type: 'warning',
+                                duration: 2000,
+                                offset: 300
+                            });
+                            return
                         }
                     }
-                },
-                openHrefBefore () {
+                }
+                var newNode = this.originData[oIndex].content[tIndex]
+                if (newNode == null) {//新增子模块处理
+                    return
+                }
+                var oNode = newNode.uInput[uIndex]
+                if (oNode == null) {//新增中标人信息处理
+                    return
+                }
+                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"
+                }
+                this.setStatus(uni, status, two, one)
+            },
+            openHref (i) {
+                if (i === 1) {
                     if (nextid === "") {
-                        alert("当前已经是最后一条数据!")
+                        alert("当前数据是第一条数据,没有上一条数据!")
                     } else {
-                        sessionStorage.removeItem(_id + '_save')
-                        window.location.href = "/front/user/remark/detail/?pid="+pid+"&tid="+tid+"&did="+nextid
+                        window.location.href = "/front/user/remark/detail/?pid="+pid+"&tid="+tid+"&did="+lastid
                     }
-                },
-                // 检查一级是否需要改变状态
-                checkOneStatus: function (config) {
-                    var tempObj = {
-                        obj: config.type ? config.one : config.two
-                    }
-                    if (config.type) {
-                        tempObj.list = config.one.content
+                } else {
+                    if (issave) {
+                        this.openHrefBefore()
                     } else {
-                        tempObj.list = config.two.uInput
+                        this.open(2, () => {
+                            this.openHrefBefore()
+                        })
                     }
-                    var statusList = [0, 0, 0, 0, 0]
-                    for (var i in tempObj.list) {
+                }
+            },
+            openHrefBefore () {
+                if (nextid === "") {
+                    alert("当前已经是最后一条数据!")
+                } else {
+                    sessionStorage.removeItem(_id + '_save')
+                    window.location.href = "/front/user/remark/detail/?pid="+pid+"&tid="+tid+"&did="+nextid
+                }
+            },
+            // 检查一级是否需要改变状态
+            checkOneStatus: function (config) {
+                var tempObj = {
+                    obj: config.type ? config.one : config.two
+                }
+                if (config.type) {
+                    tempObj.list = config.one.content
+                } else {
+                    tempObj.list = config.two.uInput
+                }
+                var statusList = [0, 0, 0, 0, 0]
+                for (var i in tempObj.list) {
                     var tempList = tempObj.list[i]
                     var tempIndex = Number(tempList.status)
                     if (tempIndex === -1) {
                         tempIndex = 0
                     }
-                        statusList[tempIndex] = Number(statusList[tempIndex]) + 1
-                    }
-                    if (statusList[1] > 0) {
-                        tempObj.obj.status = "1"
-                    }
-                    if (statusList[4] > 0 || statusList[3] > 0 || statusList[2] > 0) {
-                        tempObj.obj.status = "2"
-                    }
-                    if (statusList[4] === tempObj.list.length) {
-                        tempObj.obj.status = "4"
+                    statusList[tempIndex] = Number(statusList[tempIndex]) + 1
+                }
+                if (statusList[1] > 0) {
+                    tempObj.obj.status = "1"
+                }
+                if (statusList[4] > 0 || statusList[3] > 0 || statusList[2] > 0) {
+                    tempObj.obj.status = "2"
+                }
+                if (statusList[4] === tempObj.list.length) {
+                    tempObj.obj.status = "4"
                     if (tempObj.obj.title === "标的信息" || tempObj.obj.title === "多包信息" || tempObj.obj.title === "中标候选人信息") {
                         tempObj.obj.status = "2"
+                    }
+                }
+                if (statusList[3] === tempObj.list.length) {
+                    tempObj.obj.status = "2"
+                }
+                if (statusList[2] === tempObj.list.length) {
+                    tempObj.obj.status = "2"
+                }
+                if (statusList[0] === tempObj.list.length) {
+                    tempObj.obj.status = "-1"
+                }
+                if (!config.type) {
+                    this.checkOneStatus({
+                        one: config.one,
+                        two: config.two,
+                        type: true
+                    })
+                }
+            },
+            //切换状态按钮
+            setStatus:function (witch, s, two, one) {
+                var key = witch.key
+                //校验日期格式
+                if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
+                    key === "publishtime" || key === "signaturedate") {
+                    var val = witch.input
+                    if (val !== 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)) {
+                            this.$message({
+                                message: witch.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
+                                type: 'warning',
+                                duration: 2000,
+                                offset: 300
+                            });
+                            //alert(witch.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
+                            return
                         }
                     }
-                    if (statusList[3] === tempObj.list.length) {
-                        tempObj.obj.status = "2"
+                }
+                if (s === '2' && !one && !two && witch.content.length === 0) {
+                    return
+                }
+                witch.status = s;
+                if (two) {
+                    this.checkOneStatus({
+                        one: one,
+                        two: two,
+                        type: false
+                    })
+                }
+            },
+            //二级删除
+            delNewTwo: function (one, index, two) {
+                //two.ck_isnew = false //目前点删除按钮页面直接不显示,但是集合索引位置不变,所以加了此代码
+                //two.show = false
+                // if (two.isnew) {
+                one.content.splice(index, 1)
+                // } else {
+                //     two.show = false
+                //     two.status = "4"
+                //     this.saveDataTwo(two, "4", one)
+                // }
+                this.checkOneStatus({
+                    one: one,
+                    two: two,
+                    type: true
+                })
+            },
+            /*add style*/
+            addStyle: function (data) {
+                return prettyPrint(data).replace(/(checkAllTag|checkType|showCheck|wstatus|status|key|title|input|content|uInput|selectArr|select|show|true)/g, "<mark>$1</mark>")
+            },
+            /*同步修改源码*/
+            changeText: function (boolean) {
+                try {
+                    var tempText = JSON.parse(this.$refs.text.innerText.replace(/(\n|\s)/g, ''))
+                    if (boolean) {
+                        this.tagvalues = tempText
+                    } else {
+                        this.editData = tempText
                     }
-                    if (statusList[2] === tempObj.list.length) {
-                        tempObj.obj.status = "2"
+                } catch (err) {
+                    alert('源码修改失败')
+                }
+            },
+            goText: function (value) {
+                /*重置Html*/
+                this.pageHtml = this.getPageInfo.html
+                if (!value) {
+                    return false
+                }
+                var rs = new RegExp('(' + value + ')', 'gi')
+                //选中input框值文本高亮
+                if (rs.test(this.pageHtml)) {
+                    this.pageHtml = this.pageHtml.replace(rs, '<mark>$1</mark>')
+                    /*延迟查询dom,防止dom未插入*/
+                    var $this = this
+                    setTimeout(function () {
+                        $this.goMark(value)
+                    }, 150)
+                } else {
+                    /*重置Html*/
+                    this.pageHtml = this.getPageInfo.html
+                }
+            },
+            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')[this.scrollCache.index]
+                $("mark").removeClass('focus')
+                $(temp).addClass('focus')
+                document.querySelector('.article').scrollTop = offset(temp).top - window.screen.height / 2
+            },
+            // markTag:function(n){
+            //    $.ajax({
+            //        url:"/markTag",
+            //        method:"post",
+            //        data: {tag:n,_id:_id},
+            //        success:function(res){
+            //            if(res){
+            //                document.getElementById("com-alert-val").innerHtml="标记成功";
+            //                var label1 = document.getElementById("com-alert");
+            //                label1.style.display="block";
+            //                setTimeout(function(){label1.style.display="none";},1000)
+            //            }
+            //        }
+            //    });
+            // },
+            addChild: function (one, oindex) {
+                var tempNode = {}
+                switch (one.title) {
+                    case "标的信息": {
+                        tempNode = {
+                            //content: [],
+                            show: true,
+                            isnew: true,
+                            status: "2",
+                            title: "标的物",
+                            uInput: JSON.parse(JSON.stringify(pclfInput))
+                        }
+                        break
                     }
-                    if (statusList[0] === tempObj.list.length) {
-                        tempObj.obj.status = "-1"
+                    case "采购意向信息": {
+                        tempNode = {
+                            //content: [],
+                            show: true,
+                            isnew: true,
+                            status: "2",
+                            title: "标的物",
+                            uInput: JSON.parse(JSON.stringify(pclfInput1))
+                        }
+                        break
                     }
-                    if (!config.type) {
-                        this.checkOneStatus({
-                            one: config.one,
-                            two: config.two,
-                            type: true
-                        })
+                    case "多包信息": {
+                        tempNode = {
+                            //content: [],
+                            show: true,
+                            status: "2",
+                            isnew: true,
+                            title: "子包",
+                            uInput: JSON.parse(JSON.stringify(pfInput))
+                        }
+                        break
                     }
-                },
-                //切换状态按钮
-                setStatus:function (witch, s, two, one) {
-                    var key = witch.key
-                    //校验日期格式
+                    case "中标候选人信息": {
+                        tempNode = {
+                            //content: [],
+                            show: true,
+                            status: "2",
+                            isnew: true,
+                            title: "候选人",
+                            uInput: JSON.parse(JSON.stringify(wodfInput))
+                        }
+                        break
+                    }
+                }
+                // 输入多个
+                var count = prompt('请输入需要新增的个数')
+                // if (one.status >= "2") {
+                //     one.status = '2'
+                // }
+                for (let j = 0; j < count; j++) {
+                    one.content.push(JSON.parse(JSON.stringify(tempNode)))
+                    this.checkOneStatus({
+                        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($(".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
+                })
+            },
+            addFourChild: function (index, one, two) {
+                console.log(one, two)
+                var tempNode = {
+                    show: true,
+                    status: "2",
+                    isnew: true,
+                    isFour: true,
+                    parentIndex: index,
+                    title: "子包-标的物信息",
+                    uInput: [
+                        { input: "", key: "itemname", status: "2", title: "产品名称"},
+                        { input: "", key: "brandname", status: "2", title: "品牌"},
+                        { input: "", key: "madel", status: "2", title: "型号"},
+                        { input: "", key: "unitname", status: "2", title: "计量单位"},
+                        { input: "", key: "unitprice", status: "2", title: "单价"},
+                        { input: "", key: "number", status: "2", title: "数量"},
+                        { input: "", key: "totalprice", status: "2", title: "总价"},
+                        { input: "", key: "departroom", status: "2", title: "科室"},
+                    ]
+                }
+                one.content.splice(Number(index) + 1, 0, JSON.parse(JSON.stringify(tempNode)));
+                this.checkOneStatus({
+                    one: one,
+                    type: true
+                })
+            },
+            saveDataTwo:function (two, n, one) {
+                two.uInput.forEach(function (v) {
+                    var key = v.key
                     if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
                         key === "publishtime" || key === "signaturedate") {
-                        var val = witch.input
+                        var val = v.input
                         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)) {
                                 this.$message({
-                                    message: witch.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
+                                    message: v.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
                                     type: 'warning',
                                     duration: 2000,
                                     offset: 300
                                 });
-                                //alert(witch.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
+                                //alert(v.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
                                 return
                             }
                         }
                     }
-                    if (s === '2' && !one && !two && witch.content.length === 0) {
-                        return
-                    }
-                    witch.status = s;
-                    if (two) {
-                        this.checkOneStatus({
-                            one: one,
-                            two: two,
-                            type: false
-                        })
-                    }
-                },
-                //二级删除
-                delNewTwo: function (one, index, two) {
-                    //two.ck_isnew = false //目前点删除按钮页面直接不显示,但是集合索引位置不变,所以加了此代码
-                    //two.show = false
-                    // if (two.isnew) {
-                        one.content.splice(index, 1)
-                    // } else {
-                    //     two.show = false
-                    //     two.status = "4"
-                    //     this.saveDataTwo(two, "4", one)
-                    // }
-                    this.checkOneStatus({
-                        one: one,
-                        two: two,
-                        type: true
-                    })
-                },
-                /*add style*/
-                addStyle: function (data) {
-                    return prettyPrint(data).replace(/(checkAllTag|checkType|showCheck|wstatus|status|key|title|input|content|uInput|selectArr|select|show|true)/g, "<mark>$1</mark>")
-                },
-                /*同步修改源码*/
-                changeText: function (boolean) {
-                    try {
-                        var tempText = JSON.parse(this.$refs.text.innerText.replace(/(\n|\s)/g, ''))
-                        if (boolean) {
-                            this.tagvalues = tempText
-                        } else {
-                            this.editData = tempText
-                        }
-                    } catch (err) {
-                        alert('源码修改失败')
-                    }
-                },
-                goText: function (value) {
-                    /*重置Html*/
-                    this.pageHtml = this.getPageInfo.html
-                    if (!value) {
-                        return false
-                    }
-                    var rs = new RegExp('(' + value + ')', 'gi')
-                    //选中input框值文本高亮
-                    if (rs.test(this.pageHtml)) {
-                        this.pageHtml = this.pageHtml.replace(rs, '<mark>$1</mark>')
-                        /*延迟查询dom,防止dom未插入*/
-                        var $this = this
-                        setTimeout(function () {
-                            $this.goMark(value)
-                        }, 150)
-                    } else {
-                        /*重置Html*/
-                        this.pageHtml = this.getPageInfo.html
-                    }
-                },
-                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')[this.scrollCache.index]
-                    $("mark").removeClass('focus')
-                    $(temp).addClass('focus')
-                    document.querySelector('.article').scrollTop = offset(temp).top - window.screen.height / 2
-                },
-                // markTag:function(n){
-                //    $.ajax({
-                //        url:"/markTag",
-                //        method:"post",
-                //        data: {tag:n,_id:_id},
-                //        success:function(res){
-                //            if(res){
-                //                document.getElementById("com-alert-val").innerHtml="标记成功";
-                //                var label1 = document.getElementById("com-alert");
-                //                label1.style.display="block";
-                //                setTimeout(function(){label1.style.display="none";},1000)
-                //            }
-                //        }
-                //    });
-                // },
-                addChild: function (one, oindex) {
-                    var tempNode = {}
-                    switch (one.title) {
-                        case "标的信息": {
-                            tempNode = {
-                                //content: [],
-                                show: true,
-                                isnew: true,
-                                status: "2",
-                                title: "标的物",
-                                uInput: JSON.parse(JSON.stringify(pclfInput))
-                            }
-                            break
-                        }
-                        case "采购意向信息": {
-                            tempNode = {
-                                //content: [],
-                                show: true,
-                                isnew: true,
-                                status: "2",
-                                title: "标的物",
-                                uInput: JSON.parse(JSON.stringify(pclfInput1))
-                            }
-                            break
-                        }
-                        case "多包信息": {
-                            tempNode = {
-                                //content: [],
-                                show: true,
-                                status: "2",
-                                isnew: true,
-                                title: "子包",
-                                uInput: JSON.parse(JSON.stringify(pfInput))
-                            }
-                            break
-                        }
-                        case "中标候选人信息": {
-                            tempNode = {
-                                //content: [],
-                                show: true,
-                                status: "2",
-                                isnew: true,
-                                title: "候选人",
-                                uInput: JSON.parse(JSON.stringify(wodfInput))
-                            }
-                            break
-                        }
-                    }
-                    // 输入多个
-                    var count = prompt('请输入需要新增的个数')
-                    // if (one.status >= "2") {
-                    //     one.status = '2'
-                    // }
-                    for (let j = 0; j < count; j++) {
-                        one.content.push(JSON.parse(JSON.stringify(tempNode)))
-                        this.checkOneStatus({
-                            one: one,
-                            type: true
-                        })
+                    if (n === "1" && v.status === "-1") {
+                        v.status = n
+                    } else if (n === "-1") {
+                        v.status = n
+                    } else if (n === "2") {
+                        v.status = n
+                    } else if (n === "4") {
+                        v.status = n
                     }
-                    this.$nextTick(() => {
-                        var tempN = $(".edit.one").eq(oindex).find(".edit-title")
-                        var goTop = tempN.eq(tempN.length - 1).offset().top
-                        setTimeout(() => {
-                            $(".operation").scrollTop($(".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) {
-                    two.uInput.forEach(function (v) {
-                        var key = v.key
-                        if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
-                            key === "publishtime" || key === "signaturedate") {
-                            var val = v.input
-                            if (val !== 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)) {
-                                    this.$message({
-                                        message: v.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
-                                        type: 'warning',
-                                        duration: 2000,
-                                        offset: 300
-                                    });
-                                    //alert(v.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
-                                    return
-                                }
-                            }
-                        }
-                        if (n === "1" && v.status === "-1") {
-                            v.status = n
-                        } else if (n === "-1") {
-                            v.status = n
-                        } else if (n === "2") {
-                            v.status = n
-                        } else if (n === "4") {
-                            v.status = n
-                        }
-                    });
-                    two.status = n
-                    this.checkOneStatus({
-                        one: one,
-                        two: two,
-                        type: false
-                    })
-                  /**
-                   two.content.forEach(function(v) {
+                });
+                two.status = n
+                this.checkOneStatus({
+                    one: one,
+                    two: two,
+                    type: false
+                })
+                /**
+                 two.content.forEach(function(v) {
                       v.uInput.forEach(function(value) {
                           if (value.input && value.input != '') {
                               value.status = n
                           }
                       })
                   })
-                   */
-                },
-                saveDataOne:function (one, n) {
-                    //保存后的样式
-                    var _this = this
-                    one.content.forEach(function (v) {
-                        v.uInput.forEach(function (value) {
-                            var key = value.key
-                            if (n === "1") {
-                                if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
-                                    key === "publishtime" || key === "signaturedate") {
-                                    var val = value.input
-                                    if (val !== 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)) {
-                                            this.$message({
-                                                message: value.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
-                                                type: 'warning',
-                                                duration: 2000,
-                                                offset: 300
-                                            });
-                                            //alert(value.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
-                                            return
-                                        }
+                 */
+            },
+            saveDataOne:function (one, n) {
+                //保存后的样式
+                var _this = this
+                one.content.forEach(function (v) {
+                    v.uInput.forEach(function (value) {
+                        var key = value.key
+                        if (n === "1") {
+                            if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
+                                key === "publishtime" || key === "signaturedate") {
+                                var val = value.input
+                                if (val !== 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)) {
+                                        this.$message({
+                                            message: value.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
+                                            type: 'warning',
+                                            duration: 2000,
+                                            offset: 300
+                                        });
+                                        //alert(value.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
+                                        return
                                     }
                                 }
                             }
-                            // 取消全部,通过时判断状态是否处于修改新增等
-                            if (n === "1" && value.status === "-1") {
-                                value.status = n
-                            } else if (n === "-1") {
-                                value.status = n
-                            }
-                        })
+                        }
+                        // 取消全部,通过时判断状态是否处于修改新增等
+                        if (n === "1" && value.status === "-1") {
+                            value.status = n
+                        } else if (n === "-1") {
+                            value.status = n
+                        }
+                    })
 
-                        _this.checkOneStatus({
-                            two: v,
-                            one: one,
-                            type: false
-                        })
-                    });
-                },
-                //验证保存提示
-                open:function (stype, callback) {
-                    var noTagKey = [];
-                    this.editData.filter(function (one) {
-                        if (one.title === "标的信息" || one.title === "采购意向信息" || one.title === "多包信息" || one.title === "中标候选人信息") {
-                            if (one.status === "-1") {
-                                noTagKey.push(one.title);
+                    _this.checkOneStatus({
+                        two: v,
+                        one: one,
+                        type: false
+                    })
+                });
+            },
+            tranEditData: function(data, type) {
+                var list = JSON.parse(JSON.stringify(data))
+                for (var i = 0; i < list.length; i++) {
+                    var one = list[i]
+                    if (one.content) {
+                        for (var j = 0; j < one.content.length; j++) {
+                            var two = one.content[j]
+                            var twoIndex = j
+                            // 转回 content
+                            if (type) {
+                                if (two.isFour) {
+                                    var parentNode = one.content[two.parentIndex]
+                                    if (!parentNode.content) {
+                                        parentNode.content = []
+                                    }
+                                    parentNode.content.push(two)
+                                }
+                            } else {
+                                // 转回平级
+                                if (two.content) {
+                                    two.content = two.content.map(s => {
+                                        s.parentIndex = twoIndex
+                                        s.isFour = true
+                                        return s
+                                    })
+                                    one.content.splice(twoIndex + 1, 0, ...two.content)
+                                }
                             }
+                        }
+                        if (type) {
+                            one.content = one.content.filter(two => two.isFour !== true)
                         } else {
-                            one.content.filter(function (v) {
-                                v.uInput.filter(function (u) {
-                                    if (u.status === "-1") {
-                                        noTagKey.push(u.title);
-                                    }
-                                })
+                            one.content = one.content.map(two => {
+                                two.content = []
+                                return two
                             })
                         }
-                    })
-                    if (noTagKey.length > 0) {
-                        var fieldText = noTagKey.join(",");
-                        fieldText = fieldText.replace(/\([^\)]*\)/g, "");
-                        this.$alert("未标注字段:" + fieldText);
-                        return
                     }
-                    var resultStatus = false
-                    if (stype === 1) {//全部字段验证
-                        var checkAllKey = this.editData.filter(function (one) {
-                            var otherOne = one.content.filter(function (v) {
-                                return v.uInput.filter(function (u) {
-                                    return u.status === '-1'
-                                }).length
+                }
+                return list
+            },
+            open:function (stype, callback) {
+                var noTagKey = [];
+                this.editData.filter(function (one) {
+                    if (one.title === "标的信息" || one.title === "采购意向信息" || one.title === "多包信息" || one.title === "中标候选人信息") {
+                        if (one.status === "-1") {
+                            noTagKey.push(one.title);
+                        }
+                    } else {
+                        one.content.filter(function (v) {
+                            v.uInput.filter(function (u) {
+                                if (u.status === "-1") {
+                                    noTagKey.push(u.title);
+                                }
                             })
-                            if ((one.title === "标的信息" || one.title === "采购意向信息" || one.title === "多包信息" || one.title === "中标候选人信息") && (one.status === "-1")) {
-                                return true
-                            } else {
-                                return otherOne.length
-                            }
                         })
-                        resultStatus = !Boolean(checkAllKey.length)
-                    } else {//部分字段验证
-                        var otherTag = 0 //标注状态 0:没标 1:标注成功 2:标注失败
-                        var baseTag = 0
-                        this.editData.filter(function (one) {
-                            //多包信息、中标候选人信息在为标注失败的前提下检测标注状态,一个失败不能保存
-                            if (otherTag < 2) {
-                                if (one.title === "标的信息" || one.title === "采购意向信息" || one.title === "多包信息" || one.title === "中标候选人信息") {
-                                    if (one.status === "-1") {//没标
-                                        if (otherTag !== 1) {//前一个标注成功不用记录后一个是否未标
-                                            otherTag = 0
+                    }
+                })
+                if (noTagKey.length > 0) {
+                    var fieldText = noTagKey.join(",");
+                    fieldText = fieldText.replace(/\([^\)]*\)/g, "");
+                    this.$alert("未标注字段:" + fieldText);
+                    return
+                }
+                var resultStatus = false
+                if (stype === 1) {//全部字段验证
+                    var checkAllKey = this.editData.filter(function (one) {
+                        var otherOne = one.content.filter(function (v) {
+                            return v.uInput.filter(function (u) {
+                                return u.status === '-1'
+                            }).length
+                        })
+                        if ((one.title === "标的信息" || one.title === "采购意向信息" || one.title === "多包信息" || one.title === "中标候选人信息") && (one.status === "-1")) {
+                            return true
+                        } else {
+                            return otherOne.length
+                        }
+                    })
+                    resultStatus = !Boolean(checkAllKey.length)
+                } else {//部分字段验证
+                    var otherTag = 0 //标注状态 0:没标 1:标注成功 2:标注失败
+                    var baseTag = 0
+                    this.editData.filter(function (one) {
+                        //多包信息、中标候选人信息在为标注失败的前提下检测标注状态,一个失败不能保存
+                        if (otherTag < 2) {
+                            if (one.title === "标的信息" || one.title === "采购意向信息" || one.title === "多包信息" || one.title === "中标候选人信息") {
+                                if (one.status === "-1") {//没标
+                                    if (otherTag !== 1) {//前一个标注成功不用记录后一个是否未标
+                                        otherTag = 0
+                                    }
+                                } else {
+                                    if (one.content.length === 0) {//不含子包
+                                        if (one.status === '2') {
+                                            otherTag = 2 //失败
+                                        } else {
+                                            otherTag = 1 //成功
                                         }
-                                    } else {
-                                        if (one.content.length === 0) {//不含子包
-                                            if (one.status === '2') {
-                                                otherTag = 2 //失败
-                                            } else {
-                                                otherTag = 1 //成功
-                                            }
-                                        } else {//含子包
-                                            if (one.title === "标的信息") {
-                                                var otherOne = one.content.filter(function (v) {
-                                                    if (v.status >= 1) {//子信息标注
-                                                        var twoLength = v.uInput.filter(function (u) {
-                                                            return u.status === '-1'
-                                                        })
-                                                        if (twoLength.length > 0) {
-                                                            otherTag = 2
-                                                        }
-                                                        return true //返回此条信息被标注
-                                                    }
-                                                })
-                                                if (otherTag !== 2) {
-                                                    if (otherOne.length > 0) {//
-                                                        otherTag = 1
-                                                    } else {
+                                    } else {//含子包
+                                        if (one.title === "标的信息") {
+                                            var otherOne = one.content.filter(function (v) {
+                                                if (v.status >= 1) {//子信息标注
+                                                    var twoLength = v.uInput.filter(function (u) {
+                                                        return u.status === '-1'
+                                                    })
+                                                    if (twoLength.length > 0) {
                                                         otherTag = 2
                                                     }
+                                                    return true //返回此条信息被标注
                                                 }
-                                            } else {
-                                                var otherOne = one.content.filter(function (v) {
-                                                    return v.uInput.filter(function (u) {
-                                                        return u.status === '-1'
-                                                    }).length
-                                                })
+                                            })
+                                            if (otherTag !== 2) {
                                                 if (otherOne.length > 0) {//
-                                                    otherTag = 2
-                                                } else {
                                                     otherTag = 1
+                                                } else {
+                                                    otherTag = 2
                                                 }
                                             }
+                                        } else {
+                                            var otherOne = one.content.filter(function (v) {
+                                                return v.uInput.filter(function (u) {
+                                                    return u.status === '-1'
+                                                }).length
+                                            })
+                                            if (otherOne.length > 0) {//
+                                                otherTag = 2
+                                            } else {
+                                                otherTag = 1
+                                            }
                                         }
                                     }
-                                } else {
-                                    var baseOne = one.content.filter(function (v) {
-                                        return v.uInput.filter(function (u) {
-                                            return u.status !== '-1'
-                                        }).length
-                                    })
-                                    if (baseOne.length > 0) {//基本字段
-                                        baseTag = 1
-                                    }
+                                }
+                            } else {
+                                var baseOne = one.content.filter(function (v) {
+                                    return v.uInput.filter(function (u) {
+                                        return u.status !== '-1'
+                                    }).length
+                                })
+                                if (baseOne.length > 0) {//基本字段
+                                    baseTag = 1
                                 }
                             }
-                        })
-                        if (otherTag === 0 && baseTag === 1) {
-                            resultStatus = true
-                        } else if (otherTag === 1) {
-                            resultStatus = true
                         }
+                    })
+                    if (otherTag === 0 && baseTag === 1) {
+                        resultStatus = true
+                    } else if (otherTag === 1) {
+                        resultStatus = true
                     }
-                    if (!resultStatus) {
-                        this.$alert("未标注完成");
-                        return
-                    }
-                    // var d = JSON.stringify(this.editData);
-                    // var _this = this
-                    // if (JSON.stringify(this.originData) === d) {
-                    //     this.$alert("未做任何修改");
-                    //     return;
-                    // }
-                    this.$confirm('是否保存?', '提示', {
-                        confirmButtonText: '确定',
-                        cancelButtonText: '取消',
-                        type: 'warning'
-                    }).then(() => {
-                        this.upChange(stype, callback)
-                    }).catch(() => {
-                    });
-                },
-                //保存事件
-                upChange: function (stype, callback) {
-                    var d = JSON.stringify(this.editData);
-                    var _this = this
-                    if (tid === "") {
-                        $.ajax({
-                            url: "/front/data/jyuser/mark",
-                            method: "post",
-                            data: {"data": d, "s_infoid": _id, "pid": pid, "isEff": isEff},
-                            success: function (res) {
-                                if (res) {
-                                    _this.$message({
-                                        message: '保存成功',
-                                        type: 'success',
-                                        duration: 1000,
-                                        offset: 300
-                                    });
-                                    issave = true//保存成功
-                                    sessionStorage.setItem(_id + '_save', issave)
-                                    if (callback) {
-                                        return callback()
-                                    }
-                                    location.reload()
+                }
+                if (!resultStatus) {
+                    this.$alert("未标注完成");
+                    return
+                }
+                // var d = JSON.stringify(this.editData);
+                // var _this = this
+                // if (JSON.stringify(this.originData) === d) {
+                //     this.$alert("未做任何修改");
+                //     return;
+                // }
+                this.$confirm('是否保存?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    this.upChange(stype, callback)
+                }).catch(() => {
+                });
+            },
+            //保存事件
+            upChange: function (stype, callback) {
+                var d = JSON.stringify(this.tranEditData(this.editData, true));
+                var _this = this
+                if (tid === "") {
+                    $.ajax({
+                        url: "/front/data/jyuser/mark",
+                        method: "post",
+                        data: {"data": d, "s_infoid": _id, "pid": pid, "isEff": isEff},
+                        success: function (res) {
+                            if (res) {
+                                _this.$message({
+                                    message: '保存成功',
+                                    type: 'success',
+                                    duration: 1000,
+                                    offset: 300
+                                });
+                                issave = true//保存成功
+                                sessionStorage.setItem(_id + '_save', issave)
+                                if (callback) {
+                                    return callback()
                                 }
-                            },
-                            error: function (err) {
-                                alert(err);
+                                location.reload()
                             }
-                        });
-                    }else {
-                        console.log(d)
-                        $.ajax({
-                            url: "/front/data/user/mark",
-                            method: "post",
-                            data: {"data": d, "s_infoid": _id, "s_usertaskid": tid, "isEff": isEff},
-                            success: function (res) {
-                                if (res) {
-                                    _this.$message({
-                                        message: '保存成功',
-                                        type: 'success',
-                                        duration: 1000,
-                                        offset: 300
-                                    });
-                                    issave = true//保存成功
-                                    sessionStorage.setItem(_id + '_save', issave)
-                                    if (callback) {
-                                        return callback()
-                                    }
-                                    location.reload()
+                        },
+                        error: function (err) {
+                            alert(err);
+                        }
+                    });
+                }else {
+                    console.log(d)
+                    $.ajax({
+                        url: "/front/data/user/mark",
+                        method: "post",
+                        data: {"data": d, "s_infoid": _id, "s_usertaskid": tid, "isEff": isEff},
+                        success: function (res) {
+                            if (res) {
+                                _this.$message({
+                                    message: '保存成功',
+                                    type: 'success',
+                                    duration: 1000,
+                                    offset: 300
+                                });
+                                issave = true//保存成功
+                                sessionStorage.setItem(_id + '_save', issave)
+                                if (callback) {
+                                    return callback()
                                 }
-                            },
-                            error: function (err) {
-                                alert(err);
+                                location.reload()
                             }
-                        });
-                    }
+                        },
+                        error: function (err) {
+                            alert(err);
+                        }
+                    });
                 }
-                //保存提示
-                // open:function(one, type) {
-                //     this.$confirm('是否保存?', '提示', {
-                //         confirmButtonText: '确定',
-                //         cancelButtonText: '取消',
-                //         type: 'warning'
-                //     }).then(() => {
-                //         if (type) {
-                //             this.saveOneData(one)
-                //         } else {
-                //             this.upChange()
-                //         }
-                //     }).catch(() => {
-                //     });
-                // },
-                //一级保存
-                //    saveOneData: function (one) {
-                //        if (one.title==="标的信息"||one.title==="多包信息"||one.title==="中标候选人信息"){
-                //            if(one.status ===  "-1"){
-                //                this.$alert(one.title+" 未标注完成")
-                //                return
-                //            }else if (one.status !=="-1"){
-                //                var isAlert = one.content.filter(function(v) {
-                //                    return v.uInput.filter(function (u) {
-                //                        return u.status === '-1'
-                //                    }).length
-                //                })
-                //                if (isAlert.length) {
-                //                    this.$alert(one.title+" 未标注完成")
-                //                    return
-                //                }
-                //            }
-                //        }
-                //        onetext = "["+ JSON.stringify(one) +"]";
-                //        $.ajax({
-                //            url:"/center/biaozhu",
-                //            method:"post",
-                //            data: {key:onetext,_id:_id},
-                //            success:function(res){
-                //                if(res){
-                //                    document.getElementById("com-alert-val").innerHtml="保存成功";
-                //                    var label1 = document.getElementById("com-alert");
-                //                    label1.style.display="block";
-                //                    setTimeout(function(){
-                //                            label1.style.display="none";
-                //                        },
-                //                        1000)
-                //                }
-                //            },
-                //            error:function(err){
-                //                alert(err);
-                //            }
-                //        });
-                //    },
-      }
+            }
+            //保存提示
+            // open:function(one, type) {
+            //     this.$confirm('是否保存?', '提示', {
+            //         confirmButtonText: '确定',
+            //         cancelButtonText: '取消',
+            //         type: 'warning'
+            //     }).then(() => {
+            //         if (type) {
+            //             this.saveOneData(one)
+            //         } else {
+            //             this.upChange()
+            //         }
+            //     }).catch(() => {
+            //     });
+            // },
+            //一级保存
+            //    saveOneData: function (one) {
+            //        if (one.title==="标的信息"||one.title==="多包信息"||one.title==="中标候选人信息"){
+            //            if(one.status ===  "-1"){
+            //                this.$alert(one.title+" 未标注完成")
+            //                return
+            //            }else if (one.status !=="-1"){
+            //                var isAlert = one.content.filter(function(v) {
+            //                    return v.uInput.filter(function (u) {
+            //                        return u.status === '-1'
+            //                    }).length
+            //                })
+            //                if (isAlert.length) {
+            //                    this.$alert(one.title+" 未标注完成")
+            //                    return
+            //                }
+            //            }
+            //        }
+            //        onetext = "["+ JSON.stringify(one) +"]";
+            //        $.ajax({
+            //            url:"/center/biaozhu",
+            //            method:"post",
+            //            data: {key:onetext,_id:_id},
+            //            success:function(res){
+            //                if(res){
+            //                    document.getElementById("com-alert-val").innerHtml="保存成功";
+            //                    var label1 = document.getElementById("com-alert");
+            //                    label1.style.display="block";
+            //                    setTimeout(function(){
+            //                            label1.style.display="none";
+            //                        },
+            //                        1000)
+            //                }
+            //            },
+            //            error:function(err){
+            //                alert(err);
+            //            }
+            //        });
+            //    },
+        }
     })
 
     function offset(elem) {