瀏覽代碼

Merge branch 'dev2.0' of http://192.168.3.207:8080/data_processing/data_validation into dev2.0

maxiaoshan 3 年之前
父節點
當前提交
fb84915b49

+ 13 - 2
src/front/remark.go

@@ -25,12 +25,22 @@ func (f *Front) RemarkList() {
 		searchStr := f.GetString("search[value]")
 		search := strings.TrimSpace(searchStr)
 		query := map[string]interface{}{"s_usertaskid": tid}
+		ckdata, err := f.GetInteger("i_ckdata")
+		if err != nil {
+			ckdata = -1
+		}
+		if ckdata == 0 {
+			query["b_istag"] = false
+		} else if ckdata == 1 {
+			query["b_istag"] = true
+		}
 		if search != "" {
 			query["$or"] = []interface{}{
 				bson.M{"v_baseinfo.title": bson.M{"$regex": search}},
 			}
 		}
-		field := map[string]interface{}{"title": 1, "v_baseinfo": 1, "b_istag": 1}
+		qu.Debug(query)
+		field := map[string]interface{}{"title": 1, "v_baseinfo": 1, "b_istag": 1, "i_ckdata": 1}
 		info, _ := util.Mgo.Find(sourceinfo, query, `{"_id": 1}`, field, false, start, limit)
 		count := util.Mgo.Count(sourceinfo, query)
 		qu.Debug(query, sourceinfo, count)
@@ -40,7 +50,6 @@ func (f *Front) RemarkList() {
 			"recordsFiltered": count,
 			"recordsTotal":    count,
 		})
-
 	} else {
 		f.T["pid"] = pid
 		f.T["tid"] = tid
@@ -67,8 +76,10 @@ func (f *Front) RemarkDetail() {
 	rep := getDetail(did, coll)         //获取本条公告的信息
 	f.T["otherInfo"] = rep["otherInfo"] //展示关联公告信息
 	f.T["moreInfo"] = rep["moreInfo"]   //更多关联公告信息
+	f.T["pid"] = pid
 	f.T["tid"] = tid
 	f.T["did"] = did
+	f.T["coll"] = coll
 	f.T["info"] = rep["info"]
 	f.T["common"] = rep["common"]
 	f.T["worder"] = rep["worder"]

+ 31 - 25
src/web/templates/project/remark_detail.html

@@ -401,8 +401,10 @@
 </body>
 
 <script>
-    let tid = {{ .T.tid }}
-    let did = {{ .T.did }}
+    let tid = {{ .T.tid }}      // 任务id
+    let did = {{ .T.did }}      // 数据id
+    let pid = {{ .T.pid }}      // 项目id
+    let coll = {{ .T.coll }}    // 表名
     var allCheckFields = {{ .T.fields }}          //本次需标注的所有字段
     var moreInfo = {{ .T.moreInfo }}            // 更多关联信息
     var otherInfo = {{ .T.otherInfo }}          //公告关联信息
@@ -889,7 +891,7 @@
                     if (uin.select) {
                         changeStatus = uin.select === oNode.select
                     }
-                    uin.status = changeStatus ? 1 : 2
+                    uin.status = changeStatus ? "1" : "2"
                         this.setStatus(uin, uin.status, two, one);
                     },
                 openLink(link) {
@@ -905,7 +907,7 @@
                 selectChange(uni, status, two, one) {
                         //状态更新
                         if (uni.status === '-1' || uni.status === '2') {
-                            status = 2
+                            status = "2"
                         }
                         this.setStatus(uni, status, two, one)
                     },
@@ -916,7 +918,7 @@
                         if (nextid === "") {
                             showMsg("数据已经全部标注完")
                         } else {
-                            window.location.href = "/front/user/remark/detail?pid=" + {{ .T.pid }} + "&did=" + nextid + "&s_sourceinfo=" + {{ .T.s_sourceinfo }}
+                            window.location.href = "/front/user/remark/list?pid="+pid+"&tid="+tid+"&s_sourceinfo="+coll
                         }
                     }
                 },
@@ -940,25 +942,25 @@
                         statusList[tempIndex] = Number(statusList[tempIndex]) + 1
                     }
                     if (statusList[1] > 0) {
-                        tempObj.obj.status = 1
+                        tempObj.obj.status = "1"
                     }
                     if (statusList[4] > 0 || statusList[3] > 0 || statusList[2] > 0) {
-                        tempObj.obj.status = 2
+                        tempObj.obj.status = "2"
                     }
                     if (statusList[4] === tempObj.list.length) {
-                        tempObj.obj.status = 4
+                        tempObj.obj.status = "4"
                     if (tempObj.obj.title === "标的信息" || tempObj.obj.title === "多包信息" || tempObj.obj.title === "中标候选人信息") {
-                        tempObj.obj.status = 2
+                        tempObj.obj.status = "2"
                         }
                     }
                     if (statusList[3] === tempObj.list.length) {
-                        tempObj.obj.status = 2
+                        tempObj.obj.status = "2"
                     }
                     if (statusList[2] === tempObj.list.length) {
-                        tempObj.obj.status = 2
+                        tempObj.obj.status = "2"
                     }
                     if (statusList[0] === tempObj.list.length) {
-                        tempObj.obj.status = -1
+                        tempObj.obj.status = "-1"
                     }
                     if (!config.type) {
                         this.checkOneStatus({
@@ -1010,8 +1012,8 @@
                         one.content.splice(index, 1)
                     } else {
                         two.show = false
-                        two.status = 4
-                        this.saveDataTwo(two, 4, one)
+                        two.status = "4"
+                        this.saveDataTwo(two, "4", one)
                     }
                     this.checkOneStatus({
                         one: one,
@@ -1093,7 +1095,7 @@
                                 //content: [],
                                 show: true,
                                 isnew: true,
-                                status: 2,
+                                status: "2",
                                 title: "标的物",
                                 uInput: JSON.parse(JSON.stringify(pclfInput))
                             }
@@ -1103,7 +1105,7 @@
                             tempNode = {
                                 //content: [],
                                 show: true,
-                                status: 2,
+                                status: "2",
                                 isnew: true,
                                 title: "子包",
                                 uInput: JSON.parse(JSON.stringify(pfInput))
@@ -1114,7 +1116,7 @@
                             tempNode = {
                                 //content: [],
                                 show: true,
-                                status: 2,
+                                status: "2",
                                 isnew: true,
                                 title: "候选人",
                                 uInput: JSON.parse(JSON.stringify(wodfInput))
@@ -1122,7 +1124,7 @@
                             break
                         }
                     }
-                    // if (one.status >= 2) {
+                    // if (one.status >= "2") {
                     //     one.status = '2'
                     // }
                     one.content.push(tempNode)
@@ -1152,7 +1154,7 @@
                         status: "2",
                         title: '标段(包)中标金额'
                     })
-                    two.status = 2
+                    two.status = "2"
                     this.checkOneStatus({
                         one: one,
                         two: two,
@@ -1183,11 +1185,11 @@
                         }
                         if (n === "1" && v.status === "-1") {
                             v.status = n
-                        } else if (n === -1) {
+                        } else if (n === "-1") {
                             v.status = n
-                        } else if (n === 2) {
+                        } else if (n === "2") {
                             v.status = n
-                        } else if (n === 4) {
+                        } else if (n === "4") {
                             v.status = n
                         }
                     });
@@ -1213,7 +1215,7 @@
                     one.content.forEach(function (v) {
                         v.uInput.forEach(function (value) {
                             var key = value.key
-                            if (n === 1) {
+                            if (n === "1") {
                                 if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
                                     key === "publishtime" || key === "signaturedate") {
                                     var val = value.input
@@ -1266,13 +1268,13 @@
                     console.log(allCheckFields)
                     this.editData.filter(function (one) {
                         if (one.title === "标的信息" || one.title === "多包信息" || one.title === "中标候选人信息") {
-                            if (allCheckFields[one.key] && one.status === -1) {
+                            if (allCheckFields[one.key] && one.status === "-1") {
                                 noTagKey.push(one.title);
                             }
                         } else {
                             one.content.filter(function (v) {
                                 v.uInput.filter(function (u) {
-                                    if (allCheckFields[u.key] && u.status === -1) {
+                                    if (allCheckFields[u.key] && u.status === "-1") {
                                         noTagKey.push(u.title);
                                     }
                                 })
@@ -1377,6 +1379,10 @@
                     var d = JSON.stringify(this.editData);
                     console.log(d)
                     var _this = this
+                    if (JSON.stringify(this.originData) === d) {
+                        this.$alert("未做任何修改");
+                        return;
+                    }
                     $.ajax({
                         url: "/front/data/mark",
                         method: "post",

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

@@ -21,9 +21,9 @@
                         <div id="status-div" class="col-xs-1" style="width: auto;float:right;">
                             <label for="statusSelect">状态:
                                 <select class="form-control selectpicker" id="statusSelect">
-                                    <option value="-1">全部</option>
-                                    <option value="已标注">已标注</option>
-                                    <option value="未标注">未标注</option>
+                                    <option value=-1>全部</option>
+                                    <option value=0>未标注</option>
+                                    <option value=1>已标注</option>
                                 </select></label>
                         </div>
                         <table id="dataTable" class="table table-bordered table-hover">
@@ -93,7 +93,7 @@
                     }},
                 {"data": "v_baseinfo.title", render: function (val, index, row) {
                         let tmp;
-                        if (row["re_data"] === 1) {
+                        if (row["b_istag"]) {
                             tmp = '<a style="display: inline-block;cursor:pointer;font-size:16px;color: green" target="_blank" href="/front/user/remark/detail/?pid='+pid+'&did=' + row._id + '&s_sourceinfo='+sourceinfo+'">' + val + '</a>'
                         } else {
                             tmp = '<a style="display: inline-block;cursor:pointer;font-size:16px;color: #428bca" target="_blank" href="/front/user/remark/detail/?pid='+pid+'&tid=' + tid +'&did=' + row._id + '&s_sourceinfo='+sourceinfo+'">' + val + '</a>'
@@ -105,7 +105,7 @@
                 $("#dataTable_filter").append($('#status-div'))
             },
             "fnServerParams": function (e) {
-                e.s_status = $("#statusSelect option:selected").val()
+                e.i_ckdata = $("#statusSelect option:selected").val()
             }
         });
         $('#statusSelect').on('changed.bs.select', function () {

+ 19 - 0
src/web/templates/project/task_user_list.html

@@ -113,6 +113,7 @@
                     "data": "_id", width: "11%", render: function (val, a, row, pos) {
                         tmp = '<div>' +
                             '<a class="btn btn-sm btn-primary" href="/front/user/remark/list?pid='+row.s_projectid+'&tid=' + val + '&s_sourceinfo='+row.s_sourceinfo+'">标注</a>&nbsp;&nbsp;' +
+                            '<a class="btn btn-sm btn-primary" onclick="deliverTask(\'' + val + '\',\''+row.s_sourceinfo+'\',\'' + row.s_status + '\')">交付</a>&nbsp;&nbsp;' +
                             '</div>';
                         return tmp
                     }
@@ -130,4 +131,22 @@
         })
     });
 
+    function deliverTask(id, sourceinfo, status) {
+        if (status === "进行中") {
+            $.ajax({
+                url: "/front/user/task/deliver",
+                type: 'POST',
+                data: {"taskid": id, "s_sourceinfo": sourceinfo},
+                success: function (r) {
+                    if (r.success) {
+                        ttable.api().ajax.reload()
+                    } else {
+                        showTip(r.msg);
+                    }
+                }
+            })
+        }else {
+            showTip("操作不允许")
+        }
+    }
 </script>