3
2
lining 6 жил өмнө
parent
commit
404bf22888

+ 4 - 0
src/dashoo.cn/backend/api/business/limsdoctemplate/limstemplateenum.go

@@ -101,4 +101,8 @@ const (
 	DAYT_LIMSREPORTMOTOR_DETAIL string = "DAYT.LimsReportMotor.Detail"
 	// 电泵井
 	DAYT_LIMSREPORTELECPUMPWELL_DETAIL string = "DAYT.LimsReportElecPumpWell.Detail"
+	//螺杆泵
+	DAYT_LIMSREPORTSCREWPUMP_DETAIL string = "DAYT.LimsReportScrewPump.Detail"
+	// 油田专用变压器
+	DAYT_LIMSREPORTSPECIALFIELD_DETAIL string = "DAYT.LimsReportSpecialField.Detail"
 )

+ 55 - 6
src/dashoo.cn/backend/api/controllers/lims/limsdataentry.go

@@ -5,6 +5,8 @@ import (
 	"dashoo.cn/backend/api/business/limsreportliquidtransportation"
 	"dashoo.cn/backend/api/business/limsreportmotor"
 	"dashoo.cn/backend/api/business/limsreportpistonpumpunit"
+	"dashoo.cn/backend/api/business/limsreportscrewpump"
+	"dashoo.cn/backend/api/business/limsreportspecialfield"
 	"encoding/base64"
 	"encoding/json"
 	"errors"
@@ -1317,13 +1319,15 @@ func (this *LimsDataEntryController) exportdatatoexcel(fileurl string, dataentry
 		svc := limsreportliquidtransportation.GetLimsReportLiquidTransportationService(utils.DBE)
 		where1 := "DataEntryId=" + strconv.Itoa(dataentrylist.Id)
 		has := svc.GetEntityByWhere(this.User.AccCode+LimsReportLiquidTransportationName, where1, &model)
+		datamap := StructToMapDemo(model)
+		svcActiviti := workflow.GetActivitiService(utils.DBE)
+		var template limsdoctemplate.LimsDocTemplate
+		wheretem := "Id=" + strconv.Itoa(entrustlist[0].DocId)
+		has = svc.GetEntityByWhere(this.User.AccCode+LimsDocTemplateName, wheretem, &template)
 		if (has) {
-			datamap := StructToMapDemo(model)
-			svcActiviti := workflow.GetActivitiService(utils.DBE)
-			//weed1.labsop.cn:9390/5,185d7c489668|离心泵机组液体输送系统.doc
-			// weed1.labsop.cn:9390/1,1866fd6844ea|test.docx
-			templateUrl := "http://" + entrustlist[0].DocAddress
-			fileName := entrustlist[0].DocName
+			urlArr := strings.Split(template.FileURL, "|")
+			templateUrl := "http://" + urlArr[0]
+			fileName := urlArr[1]
 			DocUrl = svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
 			err = nil
 		} else {
@@ -1395,6 +1399,51 @@ func (this *LimsDataEntryController) exportdatatoexcel(fileurl string, dataentry
 			DocUrl = ""
 			err = errors.New("")
 		}
+	case limsdoctemplate.DAYT_LIMSREPORTSCREWPUMP_DETAIL:
+		// 螺杆泵
+		var model limsreportscrewpump.LimsReportScrewPump
+		svc := limsreportscrewpump.GetLimsReportScrewPumpService(utils.DBE)
+		where1 := "DataEntryId=" + strconv.Itoa(dataentrylist.Id)
+		has := svc.GetEntityByWhere(this.User.AccCode+LimsReportScrewPumpName, where1, &model)
+		datamap := StructToMapDemo(model)
+		datamap["CheckDate"] = model.CheckDate.Format("2006年01月02日")
+		svcActiviti := workflow.GetActivitiService(utils.DBE)
+		var template limsdoctemplate.LimsDocTemplate
+		wheretem := "Id=" + strconv.Itoa(entrustlist[0].DocId)
+		has = svc.GetEntityByWhere(this.User.AccCode+LimsDocTemplateName, wheretem, &template)
+		if (has) {
+			urlArr := strings.Split(template.FileURL, "|")
+			templateUrl := "http://" + urlArr[0]
+			fileName := urlArr[1]
+			DocUrl = svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
+			err = nil
+		} else {
+			DocUrl = ""
+			err = errors.New("")
+		}
+	case limsdoctemplate.DAYT_LIMSREPORTSPECIALFIELD_DETAIL:
+		// 油田专用变压器
+		var model limsreportspecialfield.LimsReportSpecialField
+		svc := limsreportspecialfield.GetLimsReportSpecialFieldService(utils.DBE)
+		where1 := "DataEntryId=" + strconv.Itoa(dataentrylist.Id)
+		has := svc.GetEntityByWhere(this.User.AccCode+LimsReportSpecialFieldName, where1, &model)
+		datamap := StructToMapDemo(model)
+		datamap["ProductionDate"] = model.ProductionDate.Format("2006年01月02日")
+		datamap["TestTime"] = model.TestTime.Format("2006年01月02日")
+		svcActiviti := workflow.GetActivitiService(utils.DBE)
+		var template limsdoctemplate.LimsDocTemplate
+		wheretem := "Id=" + strconv.Itoa(entrustlist[0].DocId)
+		has = svc.GetEntityByWhere(this.User.AccCode+LimsDocTemplateName, wheretem, &template)
+		if (has) {
+			urlArr := strings.Split(template.FileURL, "|")
+			templateUrl := "http://" + urlArr[0]
+			fileName := urlArr[1]
+			DocUrl = svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
+			err = nil
+		} else {
+			DocUrl = ""
+			err = errors.New("")
+		}
 	}
 	return DocUrl, err
 }

+ 14 - 0
src/dashoo.cn/frontend_web/src/pages/lims/dataentry/alltask.vue

@@ -745,6 +745,20 @@
               query: queryParams
             })
             break
+          // 螺杆泵
+          case 'DAYT.LimsReportScrewPump.Detail':
+            this.$router.push({
+              path: '/lims/reportscrewpump/operation',
+              query: queryParams
+            })
+            break
+          // 油田专用变压器
+          case 'DAYT.LimsReportSpecialField.Detail':
+            this.$router.push({
+              path: '/lims/reportspecialfield/operation',
+              query: queryParams
+            })
+            break
           default:
             this.$message.warning('无模板类型相匹配,请重试');
         }

+ 3 - 3
src/dashoo.cn/frontend_web/src/pages/lims/reportscrewpump/_opera/operation.vue

@@ -387,9 +387,9 @@
       }
     },
     created () {
-      // this.EId = this.$route.query.eid
-      // this.TaskBalanceId = this.$route.query.tbid
-      this.DataEntryId = 15// this.$route.query.deid
+      this.EId = this.$route.query.eid
+      this.TaskBalanceId = this.$route.query.tbid
+      this.DataEntryId = this.$route.query.deid
       this.formData.DataEntryId = parseInt(this.DataEntryId)
       this.initData()
     },

+ 3 - 3
src/dashoo.cn/frontend_web/src/pages/lims/reportspecialfield/_opera/operation.vue

@@ -340,9 +340,9 @@
       }
     },
     created () {
-      // this.EId = this.$route.query.eid
-      // this.TaskBalanceId = this.$route.query.tbid
-      this.DataEntryId = 15// this.$route.query.deid
+      this.EId = this.$route.query.eid
+      this.TaskBalanceId = this.$route.query.tbid
+      this.DataEntryId = this.$route.query.deid
       this.formData.DataEntryId = parseInt(this.DataEntryId)
       this.initData()
     },