Browse Source

tab切换,xlsx居左居右

xuzhiheng 5 years ago
parent
commit
0320183a9b

+ 7 - 2
src/history/util_history.go

@@ -891,8 +891,8 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile bool)
 					}
 					row.AddCell().SetValue(v["href"])
 					row.AddCell().SetValue(v["jybxhref"])
-					row.AddCell().SetValue(v["projectcode"])
 					row.AddCell().SetValue(v["projectname"])
+					row.AddCell().SetValue(v["projectcode"])
 					row.AddCell().SetValue(v["projectscope"])
 					if v["budget"] != nil {
 						row.AddCell().SetFloat(qu.Float64All(v["budget"]))
@@ -919,6 +919,8 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile bool)
 					row.AddCell().SetValue(v["legal_person"])
 					row.AddCell().SetValue(v["company_phone"])
 					row.AddCell().SetValue(v["company_email"])
+					ids := SE.EncodeString(qu.ObjToString(v["id"]))
+					row.AddCell().SetValue(ids)
 					if isfile {
 						row.AddCell().SetValue(v["filetext"])
 					}
@@ -993,8 +995,8 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile bool)
 					}
 					row.AddCell().SetValue(v["href"])
 					row.AddCell().SetValue(v["jybxhref"])
-					row.AddCell().SetValue(v["projectcode"])
 					row.AddCell().SetValue(v["projectname"])
+					row.AddCell().SetValue(v["projectcode"])
 					row.AddCell().SetValue(v["projectscope"])
 					if v["budget"] != nil {
 						row.AddCell().SetFloat(qu.Float64All(v["budget"]))
@@ -1021,9 +1023,12 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile bool)
 					row.AddCell().SetValue(v["legal_person"])
 					row.AddCell().SetValue(v["company_phone"])
 					row.AddCell().SetValue(v["company_email"])
+					ids := SE.EncodeString(qu.ObjToString(v["id"]))
+					row.AddCell().SetValue(ids)
 				}
 				xf.Sheets = xf.Sheets[3:4]
 			}
+			xf.Sheets[0].Name = "详细数据"
 			//生文件
 			t := strconv.FormatInt(time.Now().Unix(), 10)
 			dir := "./web/res/xlsx/" + t + "/"

+ 3 - 2
src/service/second_push.go

@@ -440,8 +440,8 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
 					}
 					row.AddCell().SetValue(v["href"])
 					row.AddCell().SetValue(v["jybxhref"])
-					row.AddCell().SetValue(v["projectcode"])
 					row.AddCell().SetValue(v["projectname"])
+					row.AddCell().SetValue(v["projectcode"])
 					row.AddCell().SetValue(v["projectscope"])
 					if v["budget"] != nil {
 						row.AddCell().SetFloat(qu.Float64All(v["budget"]))
@@ -531,8 +531,8 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
 					}
 					row.AddCell().SetValue(v["href"])
 					row.AddCell().SetValue(v["jybxhref"])
-					row.AddCell().SetValue(v["projectcode"])
 					row.AddCell().SetValue(v["projectname"])
+					row.AddCell().SetValue(v["projectcode"])
 					row.AddCell().SetValue(v["projectscope"])
 					if v["budget"] != nil {
 						row.AddCell().SetFloat(qu.Float64All(v["budget"]))
@@ -564,6 +564,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
 				}
 				xf.Sheets = xf.Sheets[3:4]
 			}
+			xf.Sheets[0].Name = "详细数据"
 			//生文件
 			t := strconv.FormatInt(time.Now().Unix(), 10)
 			dir := "./web/res/xlsx/" + t + "/"

+ 3 - 3
src/util/parsxlsx.go

@@ -284,7 +284,7 @@ func ResponseXlsx_Data(id string) string {
 					row.AddCell().SetValue(v["s_jyhref"])
 				}
 				xf.Sheets = xf.Sheets[:1]
-
+				xf.Sheets[0].Name = "详细数据"
 				fname := fmt.Sprintf(bzpath, time.Now().Unix())
 				err := xf.Save(fname)
 				if err != nil {
@@ -310,8 +310,8 @@ func ResponseXlsx_Data(id string) string {
 					}
 					row.AddCell().SetValue(v["href"])
 					row.AddCell().SetValue(v["s_jyhref"])
-					row.AddCell().SetValue(v["projectcode"])
 					row.AddCell().SetValue(v["projectname"])
+					row.AddCell().SetValue(v["projectcode"])
 					row.AddCell().SetValue(v["projectscope"])
 					if v["budget"] != nil {
 						row.AddCell().SetFloat(util.Float64All(v["budget"]))
@@ -342,7 +342,7 @@ func ResponseXlsx_Data(id string) string {
 					row.AddCell().SetValue(ids)
 				}
 				xf.Sheets = xf.Sheets[1:2]
-
+				xf.Sheets[0].Name = "详细数据"
 				fname := fmt.Sprintf(gjpath, time.Now().Unix())
 				err := xf.Save(fname)
 				if err != nil {

BIN
src/web/res/fields.xlsx


+ 21 - 6
src/web/templates/private/historylog_list.html

@@ -319,7 +319,19 @@
             ]
         });
 
-    });
+    });
+    
+    if (sessionStorage.secondpush){
+        $("#history-task-list").hide();
+        $("#second-push-list").show();
+        $("#showHistory").removeClass("active");
+        $("#showSecondPush").addClass("active");
+    }else if (sessionStorage.historywork){
+        $("#second-push-list").hide();
+        $("#history-task-list").show();
+        $("#showSecondPush").removeClass("active");
+        $("#showHistory").addClass("active");
+    }
     
     function historyWork(obj){
         var ok = confirm("是否确定执行?");
@@ -404,13 +416,16 @@
     }
 
     $("#showHistory").on("click",function () {
-        $("#second-push-list").hide()
-        $("#history-task-list").show()
+        $("#second-push-list").hide();
+        $("#history-task-list").show();
+        sessionStorage.historywork = true;
+        sessionStorage.removeItem("secondpush");
     })
 
     $("#showSecondPush").on("click",function () {
-        $("#history-task-list").hide()
-        $("#second-push-list").show()
-
+        $("#history-task-list").hide();
+        $("#second-push-list").show();
+        sessionStorage.secondpush = true;
+        sessionStorage.removeItem("historywork");
     })
 </script>