3
2
Quellcode durchsuchen

计量报告生成

huahaiyan vor 6 Jahren
Ursprung
Commit
ba3e3387d3
22 geänderte Dateien mit 752 neuen und 432 gelöschten Zeilen
  1. 2 2
      src/dashoo.cn/backend/api/business/limsreportalerkrgas/limsreportalerkrgasSessionService.go
  2. 108 0
      src/dashoo.cn/backend/api/business/limsreportdetHSgas/limsreportdetHSgasSessionService.go
  3. 96 0
      src/dashoo.cn/backend/api/business/limsreportdetelectoxygen/limsreportdetelectoxygenSessionService.go
  4. 1 1
      src/dashoo.cn/backend/api/business/workflow/ActivitiService.go
  5. 22 5
      src/dashoo.cn/backend/api/controllers/lims/limscreatereport.go
  6. 12 7
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportalercarbon.go
  7. 2 2
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportalerfhgas.go
  8. 20 8
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportalerkrgas.go
  9. 14 8
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportanal1carbonredgas.go
  10. 12 7
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportanal2carbonredgas.go
  11. 12 6
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportben.go
  12. 20 9
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportdetHSgas.go
  13. 10 5
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportdetelectoxygen.go
  14. 4 3
      src/dashoo.cn/frontend_web/src/pages/lims/createreport/reporttodo.vue
  15. 22 8
      src/dashoo.cn/frontend_web/src/pages/lims/reportalertorbendetect/_opera/operation.vue
  16. 24 10
      src/dashoo.cn/frontend_web/src/pages/lims/reportalertorcarbondetect/_opera/operation.vue
  17. 21 7
      src/dashoo.cn/frontend_web/src/pages/lims/reportalertorfhgasdetect/_opera/operation.vue
  18. 63 76
      src/dashoo.cn/frontend_web/src/pages/lims/reportalertorkrgasdetect/_opera/operation.vue
  19. 22 15
      src/dashoo.cn/frontend_web/src/pages/lims/reportanalyzer1carbonredgas/_opera/operation.vue
  20. 22 8
      src/dashoo.cn/frontend_web/src/pages/lims/reportanalyzer2carbonredgas/_opera/operation.vue
  21. 155 152
      src/dashoo.cn/frontend_web/src/pages/lims/reportdetectorHSgas/_opera/operation.vue
  22. 88 93
      src/dashoo.cn/frontend_web/src/pages/lims/reportdetectorelectoxygen/_opera/operation.vue

+ 2 - 2
src/dashoo.cn/backend/api/business/limsreportalerkrgas/limsreportalerkrgasSessionService.go

@@ -57,7 +57,7 @@ func (s *LimsReportAlerKRSessionService) DataToExcelReport(
 	s.GetEntitysByOrderbyWhere(AlertorRepeatName, where, "Id desc", &alertrepeatlist)
 	s.GetEntitysByOrderbyWhere(AlertorShiftName, where, "Id desc", &alertshiftlist)
 	datamap := StructToMapDemo(mainmodel)
-	datamap["CheckDate"] = mainmodel.CheckDate.Format("2006年01月02日")
+	datamap["CheckDate"] = mainmodel.CheckDate.Format("20160102")
 	for i := 0; i < len(cervaluelist); i++ {
 		datamap["StanDevice"+utils.ToStr(i)] = cervaluelist[i].StanDevice
 		datamap["CerNum"+utils.ToStr(i)] = cervaluelist[i].CerNum
@@ -79,7 +79,7 @@ func (s *LimsReportAlerKRSessionService) DataToExcelReport(
 	for i:=0; i<len(alertdeviationlist); i++ {
 		SumDeia +=  alertdeviationlist[i].Deviation
 	}
-	AvgDeia = SumDeia/float64(len(alertvaluelist))
+	AvgDeia = SumDeia/float64(len(alertdeviationlist))
 	datamap["Deviation"] = AvgDeia
 	if AvgDeia >= -5 && AvgDeia <= 5 {
 		datamap["Result1"] = "合格"

+ 108 - 0
src/dashoo.cn/backend/api/business/limsreportdetHSgas/limsreportdetHSgasSessionService.go

@@ -3,8 +3,12 @@ package limsreportdetHSgas
 
 import (
 	"dashoo.cn/backend/api/business/limsreportalertor"
+	"dashoo.cn/backend/api/business/workflow"
+	"errors"
 	"fmt"
+	"reflect"
 	"strconv"
+	"strings"
 
 	. "dashoo.cn/backend/api/mydb"
 	. "dashoo.cn/utils/db"
@@ -22,6 +26,110 @@ func GetLimsReportDetHsSessionService(xormEngine *xorm.Session) *LimsReportDetHs
 	return s
 }
 
+func (s *LimsReportDetHsSessionService) DataToExcelReport(
+	dataentryName string,
+	creatreportName string,
+	AlertorName string,
+	AlertorCertificateName string,
+	AlertorValueName string,
+	AlertorDeviationName string,
+	AlertorResponseTimeName string,
+	AlertorRepeatName string,
+	AlertorShiftName string,
+	seqStr string,
+	retUrl string,
+	entrustId string,
+	dataentryIds string) (reportUrl string, err error) {
+	var mainmodel limsreportalertor.LimsAlertorMainModel
+	var alertvaluelist []limsreportalertor.LimsReportAlertorValue
+	var cervaluelist []limsreportalertor.LimsReportAlertorCertificate
+	var alertdeviationlist []limsreportalertor.LimsReportAlertorDeviation
+	var alertresponsetimelist []limsreportalertor.LimsReportAlertorResponseTime
+	var alertrepeatlist []limsreportalertor.LimsReportAlertorRepeat
+	var alertshiftlist []limsreportalertor.LimsReportAlertorShift
+	where := " DataEntryId = " + dataentryIds
+	mainmodel = s.GetEntityByOrderbyWhereMain(dataentryName, AlertorName, "a.Id", dataentryIds)
+	fmt.Println(mainmodel)
+	s.GetEntitysByOrderbyWhere(AlertorCertificateName, where, "Id", &cervaluelist)
+	s.GetEntitysByOrderbyWhere(AlertorValueName, where, "Id desc", &alertvaluelist)
+	s.GetEntitysByOrderbyWhere(AlertorDeviationName, where, "Id desc", &alertdeviationlist)
+	s.GetEntitysByOrderbyWhere(AlertorResponseTimeName, where, "Id desc", &alertresponsetimelist)
+	s.GetEntitysByOrderbyWhere(AlertorRepeatName, where, "Id desc", &alertrepeatlist)
+	s.GetEntitysByOrderbyWhere(AlertorShiftName, where, "Id desc", &alertshiftlist)
+	datamap := StructToMapDemo(mainmodel)
+	datamap["CheckDate"] = mainmodel.CheckDate.Format("20160102")
+	for i := 0; i < len(cervaluelist); i++ {
+		datamap["StanDevice"+utils.ToStr(i)] = cervaluelist[i].StanDevice
+		datamap["CerNum"+utils.ToStr(i)] = cervaluelist[i].CerNum
+		datamap["Uncertainty"+utils.ToStr(i)] = cervaluelist[i].Uncertainty
+		datamap["EffectDate"+utils.ToStr(i)] = cervaluelist[i].EffectDate.Format("2006年01月02日")
+	}
+	checkstatus := 1
+	for i:= 0;i < len(alertvaluelist); i++ {
+		datamap["AllowValue"] = alertvaluelist[i].AllowValue
+		if alertvaluelist[i].AllowValue >= -5 && alertvaluelist[i].AllowValue <= 5 {
+			datamap["Result4"] = "合格"
+		}else {
+			datamap["Result4"] = "不合格"
+			checkstatus = 0
+		}
+	}
+	SumDeia := 0.0
+	AvgDeia := 0.0
+	for i:=0; i<len(alertdeviationlist); i++ {
+		SumDeia +=  alertdeviationlist[i].Deviation
+	}
+	AvgDeia = SumDeia/float64(len(alertdeviationlist))
+	datamap["Deviation"] = AvgDeia
+	if AvgDeia >= -5 && AvgDeia <= 5 {
+		datamap["Result1"] = "合格"
+	}else {
+		datamap["Result1"] = "不合格"
+		checkstatus = 0
+	}
+	datamap["RepeatValue"] = alertrepeatlist[0].RepeatValue
+	if alertrepeatlist[0].RepeatValue > 2{
+		datamap["Result2"] = "不合格"
+		checkstatus = 0
+	}else {
+		datamap["Result2"] = "合格"
+	}
+	datamap["TimeDeviation"] = alertresponsetimelist[0].Deviation
+	if alertresponsetimelist[0].Deviation > 60{
+		datamap["Result3"] = "不合格"
+		checkstatus = 0
+	}else {
+		datamap["Result3"] = "合格"
+	}
+	if checkstatus == 1{
+		datamap["CheckResult"] = "合格"
+	}else {
+		datamap["CheckResult"] = "不合格"
+	}
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	if (retUrl !="") {
+		urlArr := strings.Split(retUrl, "|")
+		templateUrl := "http://" + urlArr[0]
+		fileName := urlArr[1]
+		reportUrl = svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
+		err = nil
+	} else {
+		reportUrl = ""
+		err = errors.New("")
+	}
+	return reportUrl, err
+}
+
+func StructToMapDemo(obj interface{}) map[string]interface{} {
+	obj1 := reflect.TypeOf(obj)
+	obj2 := reflect.ValueOf(obj)
+	var data = make(map[string]interface{})
+	for i := 0; i < obj1.NumField(); i++ {
+		data[obj1.Field(i).Name] = obj2.Field(i).Interface()
+	}
+	return data
+}
+
 //获取ben信息
 func (s *LimsReportDetHsSessionService) GetAllPagingEntitiesWithOrderBytbl(tblbalance string, tblentry string, pageIndex, itemsPerPage int64, order, where string) (int64, []LimsReportBenModel) {
 	var err error

+ 96 - 0
src/dashoo.cn/backend/api/business/limsreportdetelectoxygen/limsreportdetelectoxygenSessionService.go

@@ -2,8 +2,12 @@ package limsreportdetelectoxygen
 
 import (
 	"dashoo.cn/backend/api/business/limsreportalertor"
+	"dashoo.cn/backend/api/business/workflow"
+	"errors"
 	"fmt"
+	"reflect"
 	"strconv"
+	"strings"
 
 	. "dashoo.cn/backend/api/mydb"
 	. "dashoo.cn/utils/db"
@@ -21,6 +25,98 @@ func GetLimsReportOxygenSessionService(xormEngine *xorm.Session) *LimsReportOxyg
 	return s
 }
 
+func (s *LimsReportOxygenSessionService) DataToExcelReport(
+	dataentryName string,
+	creatreportName string,
+	AlertorName string,
+	AlertorCertificateName string,
+	AlertorDeviationName string,
+	AlertorResponseTimeName string,
+	AlertorRepeatName string,
+	AlertorShiftName string,
+	seqStr string,
+	retUrl string,
+	entrustId string,
+	dataentryIds string) (reportUrl string, err error) {
+	var mainmodel limsreportalertor.LimsAlertorMainModel
+	var cervaluelist []limsreportalertor.LimsReportAlertorCertificate
+	var alertdeviationlist []limsreportalertor.LimsReportAlertorDeviation
+	var alertresponsetimelist []limsreportalertor.LimsReportAlertorResponseTime
+	var alertrepeatlist []limsreportalertor.LimsReportAlertorRepeat
+	var alertshiftlist []limsreportalertor.LimsReportAlertorShift
+	where := " DataEntryId = " + dataentryIds
+	mainmodel = s.GetEntityByOrderbyWhereMain(dataentryName, AlertorName, "a.Id", dataentryIds)
+	fmt.Println(mainmodel)
+	s.GetEntitysByOrderbyWhere(AlertorCertificateName, where, "Id", &cervaluelist)
+	s.GetEntitysByOrderbyWhere(AlertorDeviationName, where, "Id desc", &alertdeviationlist)
+	s.GetEntitysByOrderbyWhere(AlertorResponseTimeName, where, "Id desc", &alertresponsetimelist)
+	s.GetEntitysByOrderbyWhere(AlertorRepeatName, where, "Id desc", &alertrepeatlist)
+	s.GetEntitysByOrderbyWhere(AlertorShiftName, where, "Id desc", &alertshiftlist)
+	datamap := StructToMapDemo(mainmodel)
+	datamap["CheckDate"] = mainmodel.CheckDate.Format("20160102")
+	for i := 0; i < len(cervaluelist); i++ {
+		datamap["StanDevice"+utils.ToStr(i)] = cervaluelist[i].StanDevice
+		datamap["CerNum"+utils.ToStr(i)] = cervaluelist[i].CerNum
+		datamap["Uncertainty"+utils.ToStr(i)] = cervaluelist[i].Uncertainty
+		datamap["EffectDate"+utils.ToStr(i)] = cervaluelist[i].EffectDate.Format("2006年01月02日")
+	}
+	checkstatus := 1
+	SumDeia := 0.0
+	AvgDeia := 0.0
+	for i:=0; i<len(alertdeviationlist); i++ {
+		SumDeia +=  alertdeviationlist[i].Deviation
+	}
+	AvgDeia = SumDeia/float64(len(alertdeviationlist))
+	sAvgDeia:= fmt.Sprintf("%.1f", AvgDeia)
+	datamap["Deviation"] = sAvgDeia
+	if AvgDeia >= -5 && AvgDeia <= 5 {
+		datamap["Result1"] = "合格"
+	}else {
+		datamap["Result1"] = "不合格"
+		checkstatus = 0
+	}
+	datamap["RepeatValue"] = alertrepeatlist[0].RepeatValue
+	if alertrepeatlist[0].RepeatValue > 1{
+		datamap["Result2"] = "不合格"
+		checkstatus = 0
+	}else {
+		datamap["Result2"] = "合格"
+	}
+	datamap["TimeDeviation"] = alertresponsetimelist[0].Deviation
+	if alertresponsetimelist[0].Deviation > 60{
+		datamap["Result3"] = "不合格"
+		checkstatus = 0
+	}else {
+		datamap["Result3"] = "合格"
+	}
+	if checkstatus == 1{
+		datamap["CheckResult"] = "合格"
+	}else {
+		datamap["CheckResult"] = "不合格"
+	}
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	if (retUrl !="") {
+		urlArr := strings.Split(retUrl, "|")
+		templateUrl := "http://" + urlArr[0]
+		fileName := urlArr[1]
+		reportUrl = svcActiviti.FillWordTemplate(datamap, templateUrl, fileName)
+		err = nil
+	} else {
+		reportUrl = ""
+		err = errors.New("")
+	}
+	return reportUrl, err
+}
+
+func StructToMapDemo(obj interface{}) map[string]interface{} {
+	obj1 := reflect.TypeOf(obj)
+	obj2 := reflect.ValueOf(obj)
+	var data = make(map[string]interface{})
+	for i := 0; i < obj1.NumField(); i++ {
+		data[obj1.Field(i).Name] = obj2.Field(i).Interface()
+	}
+	return data
+}
 //获取ben信息
 func (s *LimsReportOxygenSessionService) GetAllPagingEntitiesWithOrderBytbl(tblbalance string, tblentry string, pageIndex, itemsPerPage int64, order, where string) (int64, []LimsReportBenModel) {
 	var err error

+ 1 - 1
src/dashoo.cn/backend/api/business/workflow/ActivitiService.go

@@ -32,7 +32,7 @@ func GetActivitiService(xormEngine *xorm.Engine) *ActivitiService {
 	s := new(ActivitiService)
 	s.DBE = xormEngine
 	//s.BaseUrl = "http://123.56.168.26:8080/activiti-rest/service"
-	//s.BaseUrl = "http://192.168.0.166:8081/api/acti"
+	//s.BaseUrl = "http://192.168.0.167:8081/api/acti"
 	s.BaseUrl = "http://47.92.212.59:8080/acti-api/api/acti"
 	//s.BaseUrl = "http://localhost:8081/api/acti"
 	s.AposeUrl = "http://47.92.212.59:8080/acti-api/api/apose"

+ 22 - 5
src/dashoo.cn/backend/api/controllers/lims/limscreatereport.go

@@ -2,6 +2,8 @@ package lims
 
 import (
 	"dashoo.cn/backend/api/business/limsreportalerkrgas"
+	"dashoo.cn/backend/api/business/limsreportdetHSgas"
+	"dashoo.cn/backend/api/business/limsreportdetelectoxygen"
 	"encoding/base64"
 	"encoding/json"
 	"fmt"
@@ -738,17 +740,19 @@ func (this *CreateReportController) ReportCreateThen(reportUrl string, UnHGRepor
 		svcActiviti := workflow.GetActivitiService(utils.DBE)
 		var processInstanceId string
 		var receiveVal string
-		users = svc.GetUserByRole("10000184", this.User.AccCode)
+
+
+		var RoleSet auditsetting.Base_OilAuditSetting
+		rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
+		rsvc.GetAuditStepRoleEntity(OilAuditSettingName, this.User.DepartmentId, workflow.REPORTAUDIT, &RoleSet)
+
+		users = svc.GetUserByRole(strconv.Itoa(RoleSet.RoleId), this.User.AccCode)
 		var userIds string
 		for _, tmpUser := range users {
 			userIds += strconv.FormatInt(tmpUser.Id, 10) + ","
 		}
 		userIds = strings.Trim(userIds, ",")
 
-		var RoleSet auditsetting.Base_OilAuditSetting
-		rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
-		rsvc.GetAuditStepRoleEntity(OilAuditSettingName, this.User.DepartmentId, workflow.REPORTAUDIT, &RoleSet)
-
 		processInstanceId = svcActiviti.StartProcess(RoleSet.WorkFlowCord, strconv.Itoa(reportEntity.Id), this.User.Id)
 		emptyEntity.FlowKey = processInstanceId
 		err = svcReport.UpdateEntityBytbl(this.User.AccCode+LimsCreateReportName, reportEntity.Id, &emptyEntity, []string{"FlowKey"})
@@ -956,6 +960,19 @@ func (this *CreateReportController) generateExcelReportN(entrustMain limsentrust
 		sessions := utils.DBE.NewSession()
 		svc := limsreportalerkrgas.GetLimsReportAlerKRSessionService(sessions)
 		reportUrl, err = svc.DataToExcelReport(this.User.AccCode+LimsDateEntryName, this.User.AccCode+LimsCreateReportName, this.User.AccCode+LimsReportAlertorName, this.User.AccCode+LimsReportAlertorCertificateName, this.User.AccCode+LimsReportAlertorValueName, this.User.AccCode+LimsReportAlertorDeviationName, this.User.AccCode+LimsReportAlertorResponseTimeName, this.User.AccCode+LimsReportAlertorRepeatName, this.User.AccCode+LimsReportAlertorShiftName, seqStr, docTemplate.FileURL, entrustId, dataentryIds)
+	//硫化氢气体检测仪检定证书
+	case limsdoctemplate.DAYT_REPORTDETECTORHSGAS_REPORT:
+		seqStr := entrustMain.EntrustNo
+		sessions := utils.DBE.NewSession()
+		svc := limsreportdetHSgas.GetLimsReportDetHsSessionService(sessions)
+		reportUrl, err = svc.DataToExcelReport(this.User.AccCode+LimsDateEntryName, this.User.AccCode+LimsCreateReportName, this.User.AccCode+LimsReportAlertorName, this.User.AccCode+LimsReportAlertorCertificateName, this.User.AccCode+LimsReportAlertorValueName, this.User.AccCode+LimsReportAlertorDeviationName, this.User.AccCode+LimsReportAlertorResponseTimeName, this.User.AccCode+LimsReportAlertorRepeatName, this.User.AccCode+LimsReportAlertorShiftName, seqStr, docTemplate.FileURL, entrustId, dataentryIds)
+		//电化学氧测定仪检定证书
+	case limsdoctemplate.DAYT_REPORTDETECTORELECTOXYGEN_REPORT:
+		seqStr := entrustMain.EntrustNo
+		sessions := utils.DBE.NewSession()
+		svc := limsreportdetelectoxygen.GetLimsReportOxygenSessionService(sessions)
+		reportUrl, err = svc.DataToExcelReport(this.User.AccCode+LimsDateEntryName, this.User.AccCode+LimsCreateReportName, this.User.AccCode+LimsReportAlertorName, this.User.AccCode+LimsReportAlertorCertificateName, this.User.AccCode+LimsReportAlertorDeviationName, this.User.AccCode+LimsReportAlertorResponseTimeName, this.User.AccCode+LimsReportAlertorRepeatName, this.User.AccCode+LimsReportAlertorShiftName, seqStr, docTemplate.FileURL, entrustId, dataentryIds)
+
 	}
 
 	return reportUrl, UnHGReportUrl, err

+ 12 - 7
src/dashoo.cn/backend/api/controllers/limsmetering/limsreportalercarbon.go

@@ -84,7 +84,7 @@ func (this *LimsReportAlerCarbonController) AddCarbonEntity() {
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
 	svc := limsreportalercarbon.GetlimsReportAlerCarbonSessionService(sessions)
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1
@@ -320,7 +320,7 @@ func (this *LimsReportAlerCarbonController) UpdatecarbonEntity() {
 	svc := limsreportalercarbon.GetlimsReportAlerCarbonSessionService(sessions)
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1
@@ -410,7 +410,8 @@ func (this *LimsReportAlerCarbonController) UpdatecarbonEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity, cercols, alwhere)
+				cerwhere := "Id = "+utils.ToStr( model.CertiArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity, cercols, cerwhere)
 			} else {
 				if cerentity.CerNum != "" || cerentity.StandardUnit != "" || cerentity.StandVal != "" || cerentity.Uncertainty != "" || cerentity.InstrumentNo != "" || cerentity.StanDevice != "" {
 					cerentity.EId = model.EId
@@ -450,7 +451,8 @@ func (this *LimsReportAlerCarbonController) UpdatecarbonEntity() {
 			"ModifiedBy",
 			"ModifiedUserId",
 		}
-		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, alwhere)
+		cer2where := "Id =" +utils.ToStr(model.Id)
+		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, cer2where)
 	} else {
 		if cerentity2.CerNum != "" || cerentity2.StandardUnit != "" || cerentity2.StandVal != "" || cerentity2.Uncertainty != "" || cerentity2.InstrumentNo != "" || cerentity2.StanDevice != "" {
 			cerentity2.EId = model.EId
@@ -515,7 +517,8 @@ func (this *LimsReportAlerCarbonController) UpdatecarbonEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, alwhere)
+				deviwhere := "Id = "+ utils.ToStr(model.DeviationArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, deviwhere)
 			} else {
 				if devientity.GasValue != 0 || devientity.Value1 != 0 || devientity.Value2 != 0 || devientity.Value3 != 0 || devientity.AvgValue != 0 || devientity.DeviationRelative != 0 || devientity.DeviationAbs != 0 {
 					devientity.EId = model.EId
@@ -598,7 +601,8 @@ func (this *LimsReportAlerCarbonController) UpdatecarbonEntity() {
 				"ModifiedBy",
 				"ModifiedUserId",
 			}
-			err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorRepeatName, &repeatentity, repeacols, alwhere)
+			repewhere := "Id = "+utils.ToStr(model.RepeatArrayList[0].Id)
+			err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorRepeatName, &repeatentity, repeacols, repewhere)
 		}else {
 			if repeatentity.GasValue != 0 || repeatentity.Value1 != 0 || repeatentity.Value2 != 0 || repeatentity.Value3 != 0 || repeatentity.Value4 != 0 || repeatentity.Value5 != 0 || repeatentity.Value6 != 0 || repeatentity.AvgValue != 0 || repeatentity.RepeatValue != 0 {
 				repeatentity.EId = model.EId
@@ -644,7 +648,8 @@ func (this *LimsReportAlerCarbonController) UpdatecarbonEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorShiftName, &shiftentity, shiftcols, alwhere)
+				shiftwhere := "Id = "+utils.ToStr(model.ShiftArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorShiftName, &shiftentity, shiftcols, shiftwhere)
 			}else {
 				if shiftentity.Value0 != 0 || shiftentity.Value1 != 0 || shiftentity.Value2 != 0 || shiftentity.Value3 != 0 || shiftentity.Value4 != 0 || shiftentity.Value5 != 0 || shiftentity.Value6 != 0 || shiftentity.ZeroValue != 0 || shiftentity.ShowValue != 0 {
 					shiftentity.EId = model.EId

+ 2 - 2
src/dashoo.cn/backend/api/controllers/limsmetering/limsreportalerfhgas.go

@@ -87,7 +87,7 @@ func (this *LimsReportAlerFHController) AddFHEntity() {
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
 	svc := limsreportalerfhgas.GetLimsReportAlerFHSessionService(sessions)
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1
@@ -321,7 +321,7 @@ func (this *LimsReportAlerFHController) UpdatefhEntity() {
 	svc := limsreportalerfhgas.GetLimsReportAlerFHSessionService(sessions)
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1

+ 20 - 8
src/dashoo.cn/backend/api/controllers/limsmetering/limsreportalerkrgas.go

@@ -87,12 +87,13 @@ func (this *LimsReportAlerKRController) AddKREntity() {
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
 	svc := limsreportalerkrgas.GetLimsReportAlerKRSessionService(sessions)
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1
 	dataentrymodel.DetectBasis = model.BenMainform.DetectBasis
 	dataentrymodel.CustomerName = model.BenMainform.CustomerName
+	dataentrymodel.CheckDate = model.BenMainform.CheckDate
 	dataentrymodel.Temperature = model.BenMainform.Temperature
 	dataentrymodel.StandardDesc = model.BenMainform.StandardDesc
 	dataentrymodel.PositionCheck = model.BenMainform.PositionCheck
@@ -103,6 +104,7 @@ func (this *LimsReportAlerKRController) AddKREntity() {
 	dataentrycols := []string{
 		"CustomerName",
 		"StandardDesc",
+		"CheckDate",
 		"Instrument1",
 		"PositionCheck",
 		"Temperature",
@@ -320,7 +322,7 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 	svc := limsreportalerkrgas.GetLimsReportAlerKRSessionService(sessions)
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1
@@ -328,6 +330,7 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 	dataentrymodel.CustomerName = model.BenMainform.CustomerName
 	dataentrymodel.Temperature = model.BenMainform.Temperature
 	dataentrymodel.StandardDesc = model.BenMainform.StandardDesc
+	dataentrymodel.CheckDate = model.BenMainform.CheckDate
 	dataentrymodel.PositionCheck = model.BenMainform.PositionCheck
 	dataentrymodel.ModifiedOn = time.Now()
 	dataentrymodel.ModifiedBy = this.User.Realname
@@ -351,6 +354,7 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 	almodel.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
 	dataentrycols := []string{
 		"CustomerName",
+		"CheckDate",
 		"StandardDesc",
 		"Instrument1",
 		"Temperature",
@@ -410,7 +414,8 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity, cercols, alwhere)
+				cerwhere := "Id = "+utils.ToStr( model.CertiArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity, cercols, cerwhere)
 			} else {
 				if cerentity.CerNum != "" || cerentity.StandardUnit != "" || cerentity.StandVal != "" || cerentity.Uncertainty != "" || cerentity.InstrumentNo != "" || cerentity.StanDevice != "" {
 					cerentity.EId = model.EId
@@ -450,7 +455,8 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 			"ModifiedBy",
 			"ModifiedUserId",
 		}
-		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, alwhere)
+		cer2where := "Id =" +utils.ToStr(model.Id)
+		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, cer2where)
 	}else {
 		if cerentity2.CerNum != "" || cerentity2.StandardUnit != "" || cerentity2.StandVal != "" || cerentity2.Uncertainty != "" || cerentity2.InstrumentNo != "" || cerentity2.StanDevice != "" {
 			cerentity2.EId = model.EId
@@ -488,7 +494,8 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 						"ModifiedBy",
 						"ModifiedUserId",
 					}
-					err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorValueName, &avalentity, alvalcols, alwhere)
+					valwhere := "Id = "+utils.ToStr(model.AlertValArrayList[i].Id)
+					err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorValueName, &avalentity, alvalcols, valwhere)
 				}else {
 					if avalentity.AlertFunction != "" || avalentity.Value1 != 0 || avalentity.Value2 != 0 || avalentity.Value3 != 0 || avalentity.ActionValue != 0 {
 						avalentity.EId = model.EId
@@ -531,7 +538,8 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, alwhere)
+				deviwhere := "Id = "+ utils.ToStr(model.DeviationArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, deviwhere)
 			}else {
 				if devientity.GasValue != 0 || devientity.Value1 != 0 || devientity.Value2 != 0 || devientity.Value3 != 0 || devientity.AvgValue != 0 || devientity.Deviation != 0 {
 					devientity.EId = model.EId
@@ -614,7 +622,8 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 				"ModifiedBy",
 				"ModifiedUserId",
 			}
-			err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorRepeatName, &repeatentity, repeacols, alwhere)
+			repewhere := "Id = "+utils.ToStr(model.RepeatArrayList[0].Id)
+			err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorRepeatName, &repeatentity, repeacols, repewhere)
 		}else {
 			if repeatentity.GasValue != 0 || repeatentity.Value1 != 0 || repeatentity.Value2 != 0 || repeatentity.Value3 != 0 || repeatentity.Value4 != 0 || repeatentity.Value5 != 0 || repeatentity.Value6 != 0 || repeatentity.AvgValue != 0 || repeatentity.RepeatValue != 0 {
 				repeatentity.EId = model.EId
@@ -633,6 +642,7 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 		for i := 0; i < len(model.ShiftArrayList); i++ {
 			var shiftentity limsreportalertor.LimsReportAlertorShift
 			shiftentity.ValueType = model.ShiftArrayList[i].ValueType
+			shiftentity.Value0 = model.ShiftArrayList[i].Value0
 			shiftentity.Value1 = model.ShiftArrayList[i].Value1
 			shiftentity.Value2 = model.ShiftArrayList[i].Value2
 			shiftentity.Value3 = model.ShiftArrayList[i].Value3
@@ -648,6 +658,7 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 				shiftentity.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
 				shiftcols := []string{
 					"ValueType",
+					"Value0",
 					"Value1",
 					"Value2",
 					"Value3",
@@ -660,7 +671,8 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorShiftName, &shiftentity, shiftcols, alwhere)
+				shiftwhere := "Id = "+utils.ToStr(model.ShiftArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorShiftName, &shiftentity, shiftcols, shiftwhere)
 			}else {
 				if shiftentity.Value0 != 0 || shiftentity.Value1 != 0 || shiftentity.Value2 != 0 || shiftentity.Value3 != 0 || shiftentity.Value4 != 0 || shiftentity.Value5 != 0 || shiftentity.Value6 != 0 || shiftentity.ZeroValue != 0 || shiftentity.ShowValue != 0 {
 					shiftentity.EId = model.EId

+ 14 - 8
src/dashoo.cn/backend/api/controllers/limsmetering/limsreportanal1carbonredgas.go

@@ -99,7 +99,7 @@ func (this *LimsReportAnCarbon1Controller) AddCarbon1Entity() {
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
 	svc := limsreportanal1carbonredgas.GetLimsReportAlCarbon1SessionService(sessions)
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1
@@ -331,7 +331,7 @@ func (this *LimsReportAnCarbon1Controller) Updatecarbon1Entity() {
 	svc := limsreportanal1carbonredgas.GetLimsReportAlCarbon1SessionService(sessions)
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1
@@ -421,7 +421,8 @@ func (this *LimsReportAnCarbon1Controller) Updatecarbon1Entity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity, cercols, alwhere)
+				cerwhere := "Id = "+utils.ToStr( model.CertiArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity, cercols, cerwhere)
 			} else {
 				if cerentity.CerNum != "" || cerentity.StandardUnit != "" || cerentity.StandVal != "" || cerentity.Uncertainty != "" || cerentity.InstrumentNo != "" || cerentity.StanDevice != "" {
 					cerentity.EId = model.EId
@@ -461,7 +462,8 @@ func (this *LimsReportAnCarbon1Controller) Updatecarbon1Entity() {
 			"ModifiedBy",
 			"ModifiedUserId",
 		}
-		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, alwhere)
+		cer2where := "Id =" +utils.ToStr(model.Id)
+		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, cer2where)
 	} else {
 		if cerentity2.CerNum != "" || cerentity2.StandardUnit != "" || cerentity2.StandVal != "" || cerentity2.Uncertainty != "" || cerentity2.InstrumentNo != "" || cerentity2.StanDevice != "" {
 			cerentity2.EId = model.EId
@@ -500,7 +502,8 @@ func (this *LimsReportAnCarbon1Controller) Updatecarbon1Entity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorOtherName, &avalentity, alvalcols, alwhere)
+				valwhere := "Id = "+utils.ToStr(model.AlertOtherList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorOtherName, &avalentity, alvalcols, valwhere)
 			} else {
 				if avalentity.Value1 != 0 || avalentity.Value2 != 0 || avalentity.Value3 != 0 || avalentity.OtherValue != 0 {
 					avalentity.EId = model.EId
@@ -541,7 +544,8 @@ func (this *LimsReportAnCarbon1Controller) Updatecarbon1Entity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, alwhere)
+				deviwhere := "Id = "+ utils.ToStr(model.DeviationArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, deviwhere)
 			}else {
 				if devientity.GasValue != 0 || devientity.Value1 != 0 || devientity.Value2 != 0 || devientity.Value3 != 0 || devientity.AvgValue != 0 || devientity.Deviation != 0 {
 					devientity.EId = model.EId
@@ -623,7 +627,8 @@ func (this *LimsReportAnCarbon1Controller) Updatecarbon1Entity() {
 				"ModifiedBy",
 				"ModifiedUserId",
 			}
-			err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorRepeatName, &repeatentity, repeacols, alwhere)
+			repewhere := "Id = "+utils.ToStr(model.RepeatArrayList[0].Id)
+			err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorRepeatName, &repeatentity, repeacols, repewhere)
 		}else {
 			if repeatentity.GasValue != 0 || repeatentity.Value1 != 0 || repeatentity.Value2 != 0 || repeatentity.Value3 != 0 || repeatentity.Value4 != 0 || repeatentity.Value5 != 0 || repeatentity.Value6 != 0 || repeatentity.AvgValue != 0 || repeatentity.RepeatValue != 0 {
 				repeatentity.EId = model.EId
@@ -669,7 +674,8 @@ func (this *LimsReportAnCarbon1Controller) Updatecarbon1Entity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorShiftName, &shiftentity, shiftcols, alwhere)
+				shiftwhere := "Id = "+utils.ToStr(model.ShiftArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorShiftName, &shiftentity, shiftcols, shiftwhere)
 			}else {
 				if shiftentity.Value0 != 0 || shiftentity.Value1 != 0 || shiftentity.Value2 != 0 || shiftentity.Value3 != 0 || shiftentity.Value4 != 0 || shiftentity.Value5 != 0 || shiftentity.Value6 != 0 || shiftentity.ZeroValue != 0 || shiftentity.ShowValue != 0 {
 					shiftentity.EId = model.EId

+ 12 - 7
src/dashoo.cn/backend/api/controllers/limsmetering/limsreportanal2carbonredgas.go

@@ -88,7 +88,7 @@ func (this *LimsReportAlerCarbon2Controller) AddCarbon2Entity() {
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
 	svc := limsreportanal2carbonredgas.GetLimsReportAlCarbon2SessionService(sessions)
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1
@@ -321,7 +321,7 @@ func (this *LimsReportAlerCarbon2Controller) Updatecarbon2Entity() {
 	svc := limsreportanal2carbonredgas.GetLimsReportAlCarbon2SessionService(sessions)
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1
@@ -450,7 +450,8 @@ func (this *LimsReportAlerCarbon2Controller) Updatecarbon2Entity() {
 			"ModifiedBy",
 			"ModifiedUserId",
 		}
-		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, alwhere)
+		cer2where := "Id =" +utils.ToStr(model.Id)
+		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, cer2where)
 	}else {
 		if cerentity2.CerNum != "" || cerentity2.StandardUnit != "" || cerentity2.StandVal != "" || cerentity2.Uncertainty != "" || cerentity2.InstrumentNo != "" || cerentity2.StanDevice != "" {
 			cerentity2.CreateOn = time.Now()
@@ -486,7 +487,8 @@ func (this *LimsReportAlerCarbon2Controller) Updatecarbon2Entity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorOtherName, &avalentity, alvalcols, alwhere)
+				valwhere := "Id = "+utils.ToStr(model.AlertOtherList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorOtherName, &avalentity, alvalcols, valwhere)
 			} else {
 				if avalentity.Value1 != 0 || avalentity.Value2 != 0 || avalentity.Value3 != 0 || avalentity.OtherValue != 0 {
 					avalentity.EId = model.EId
@@ -526,7 +528,8 @@ func (this *LimsReportAlerCarbon2Controller) Updatecarbon2Entity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, alwhere)
+				deviwhere := "Id = "+ utils.ToStr(model.DeviationArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, deviwhere)
 			}else {
 				if devientity.GasValue != 0 || devientity.Value1 != 0 || devientity.Value2 != 0 || devientity.Value3 != 0 || devientity.AvgValue != 0 || devientity.Deviation != 0 {
 					devientity.EId = model.EId
@@ -609,7 +612,8 @@ func (this *LimsReportAlerCarbon2Controller) Updatecarbon2Entity() {
 				"ModifiedBy",
 				"ModifiedUserId",
 			}
-			err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorRepeatName, &repeatentity, repeacols, alwhere)
+			repewhere := "Id = "+utils.ToStr(model.RepeatArrayList[0].Id)
+			err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorRepeatName, &repeatentity, repeacols, repewhere)
 		}else {
 			if repeatentity.GasValue != 0 || repeatentity.Value1 != 0 || repeatentity.Value2 != 0 || repeatentity.Value3 != 0 || repeatentity.Value4 != 0 || repeatentity.Value5 != 0 || repeatentity.Value6 != 0 || repeatentity.AvgValue != 0 || repeatentity.RepeatValue != 0 {
 				repeatentity.EId = model.EId
@@ -656,7 +660,8 @@ func (this *LimsReportAlerCarbon2Controller) Updatecarbon2Entity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorShiftName, &shiftentity, shiftcols, alwhere)
+				shiftwhere := "Id = "+utils.ToStr(model.ShiftArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorShiftName, &shiftentity, shiftcols, shiftwhere)
 			}else {
 				if shiftentity.Value0 != 0 || shiftentity.Value1 != 0 || shiftentity.Value2 != 0 || shiftentity.Value3 != 0 || shiftentity.Value4 != 0 || shiftentity.Value5 != 0 || shiftentity.Value6 != 0 || shiftentity.ZeroValue != 0 || shiftentity.ShowValue != 0 {
 					shiftentity.EId = model.EId

+ 12 - 6
src/dashoo.cn/backend/api/controllers/limsmetering/limsreportben.go

@@ -466,7 +466,8 @@ func (this *LimsReportBenController) UpdateEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity, cercols, alwhere)
+				cerwhere := "Id = "+utils.ToStr( model.CertiArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity, cercols, cerwhere)
 			} else {
 				if cerentity.CerNum != "" || cerentity.StandardUnit != "" || cerentity.StandVal != "" || cerentity.Uncertainty != "" || cerentity.InstrumentNo != "" || cerentity.StanDevice != "" {
 					cerentity.CreateOn = time.Now()
@@ -505,7 +506,8 @@ func (this *LimsReportBenController) UpdateEntity() {
 			"ModifiedBy",
 			"ModifiedUserId",
 		}
-		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, alwhere)
+		cer2where := "Id =" +utils.ToStr(model.Id)
+		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, cer2where)
 	}else {
 		if cerentity2.CerNum != "" || cerentity2.StandardUnit != "" || cerentity2.StandVal != "" || cerentity2.Uncertainty != "" || cerentity2.InstrumentNo != "" || cerentity2.StanDevice != "" {
 			cerentity2.CreateOn = time.Now()
@@ -542,7 +544,8 @@ func (this *LimsReportBenController) UpdateEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorValueName, &avalentity, alvalcols, alwhere)
+				valwhere := "Id = "+utils.ToStr(model.AlertValArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorValueName, &avalentity, alvalcols, valwhere)
 			}else {
 				if avalentity.AlertFunction != "" || avalentity.Value1 != 0 || avalentity.Value2 != 0 || avalentity.Value3 != 0 || avalentity.ActionValue != 0 {
 					avalentity.CreateOn = time.Now()
@@ -583,7 +586,8 @@ func (this *LimsReportBenController) UpdateEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, alwhere)
+				deviwhere := "Id = "+ utils.ToStr(model.DeviationArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, deviwhere)
 			}else {
 				if devientity.GasValue != 0 || devientity.Value1 != 0 || devientity.Value2 != 0 || devientity.Value3 != 0 || devientity.AvgValue != 0 || devientity.Deviation != 0 {
 					devientity.CreateOn = time.Now()
@@ -667,7 +671,8 @@ func (this *LimsReportBenController) UpdateEntity() {
 				"ModifiedBy",
 				"ModifiedUserId",
 			}
-			err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorRepeatName, &repeatentity, repeacols, alwhere)
+			repewhere := "Id = "+utils.ToStr(model.RepeatArrayList[0].Id)
+			err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorRepeatName, &repeatentity, repeacols, repewhere)
 		} else {
 			if repeatentity.GasValue != 0 || repeatentity.Value1 != 0 || repeatentity.Value2 != 0 || repeatentity.Value3 != 0 || repeatentity.Value4 != 0 || repeatentity.Value5 != 0 || repeatentity.Value6 != 0 || repeatentity.AvgValue != 0 || repeatentity.RepeatValue != 0 {
 				repeatentity.CreateOn = time.Now()
@@ -714,7 +719,8 @@ func (this *LimsReportBenController) UpdateEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorShiftName, &shiftentity, shiftcols, alwhere)
+				shiftwhere := "Id = "+utils.ToStr(model.ShiftArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorShiftName, &shiftentity, shiftcols, shiftwhere)
 			}else {
 				if shiftentity.Value0 != 0 || shiftentity.Value1 != 0 || shiftentity.Value2 != 0 || shiftentity.Value3 != 0 || shiftentity.Value4 != 0 || shiftentity.Value5 != 0 || shiftentity.Value6 != 0 || shiftentity.ZeroValue != 0 || shiftentity.ShowValue != 0 {
 					shiftentity.CreateOn = time.Now()

+ 20 - 9
src/dashoo.cn/backend/api/controllers/limsmetering/limsreportdetHSgas.go

@@ -87,11 +87,12 @@ func (this *LimsReportDeHSController) AddHSEntity() {
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
 	svc := limsreportdetHSgas.GetLimsReportDetHsSessionService(sessions)
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1
 	dataentrymodel.DetectBasis = model.BenMainform.DetectBasis
+	dataentrymodel.CheckDate = model.BenMainform.CheckDate
 	dataentrymodel.CustomerName = model.BenMainform.CustomerName
 	dataentrymodel.Temperature = model.BenMainform.Temperature
 	dataentrymodel.StandardDesc = model.BenMainform.StandardDesc
@@ -104,6 +105,7 @@ func (this *LimsReportDeHSController) AddHSEntity() {
 		"CustomerName",
 		"StandardDesc",
 		"Instrument1",
+		"CheckDate",
 		"PositionCheck",
 		"Temperature",
 		"DetectBasis",
@@ -323,7 +325,7 @@ func (this *LimsReportDeHSController) UpdatehsEntity() {
 	svc := limsreportdetHSgas.GetLimsReportDetHsSessionService(sessions)
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1
@@ -331,6 +333,7 @@ func (this *LimsReportDeHSController) UpdatehsEntity() {
 	dataentrymodel.CustomerName = model.BenMainform.CustomerName
 	dataentrymodel.Temperature = model.BenMainform.Temperature
 	dataentrymodel.StandardDesc = model.BenMainform.StandardDesc
+	dataentrymodel.CheckDate = model.BenMainform.CheckDate
 	dataentrymodel.PositionCheck = model.BenMainform.PositionCheck
 	dataentrymodel.ModifiedOn = time.Now()
 	dataentrymodel.ModifiedBy = this.User.Realname
@@ -357,6 +360,7 @@ func (this *LimsReportDeHSController) UpdatehsEntity() {
 		"StandardDesc",
 		"Instrument1",
 		"Temperature",
+		"CheckDate",
 		"DetectBasis",
 		"PositionCheck",
 		"ModifiedOn",
@@ -412,7 +416,8 @@ func (this *LimsReportDeHSController) UpdatehsEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity, cercols, alwhere)
+				cerwhere := "Id = "+utils.ToStr( model.CertiArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity, cercols, cerwhere)
 			} else {
 				if cerentity.CerNum != "" || cerentity.StandardUnit != "" || cerentity.StandVal != "" || cerentity.Uncertainty != "" || cerentity.InstrumentNo != "" || cerentity.StanDevice != "" {
 					cerentity.EId = model.EId
@@ -451,7 +456,8 @@ func (this *LimsReportDeHSController) UpdatehsEntity() {
 			"ModifiedBy",
 			"ModifiedUserId",
 		}
-		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, alwhere)
+		cer2where := "Id =" +utils.ToStr(model.Id)
+		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, cer2where)
 	} else {
 		if cerentity2.CerNum != "" || cerentity2.StandardUnit != "" || cerentity2.StandVal != "" || cerentity2.Uncertainty != "" || cerentity2.InstrumentNo != "" || cerentity2.StanDevice != "" {
 			cerentity2.EId = model.EId
@@ -490,7 +496,8 @@ func (this *LimsReportDeHSController) UpdatehsEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorValueName, &avalentity, alvalcols, alwhere)
+				valwhere := "Id = "+utils.ToStr(model.AlertValArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorValueName, &avalentity, alvalcols, valwhere)
 			} else {
 				if avalentity.SureValue != 0 || avalentity.Value1 != 0 || avalentity.Value2 != 0 || avalentity.Value3 != 0 || avalentity.MaxValue != 0 || avalentity.AllowValue != 0 {
 					avalentity.EId = model.EId
@@ -530,7 +537,8 @@ func (this *LimsReportDeHSController) UpdatehsEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, alwhere)
+				deviwhere := "Id = "+ utils.ToStr(model.DeviationArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, deviwhere)
 			} else {
 				if devientity.GasValue != 0 || devientity.Value1 != 0 || devientity.Value2 != 0 || devientity.Value3 != 0 || devientity.AvgValue != 0 || devientity.Deviation != 0 {
 					devientity.EId = model.EId
@@ -612,7 +620,8 @@ func (this *LimsReportDeHSController) UpdatehsEntity() {
 				"ModifiedBy",
 				"ModifiedUserId",
 			}
-			err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorRepeatName, &repeatentity, repeacols, alwhere)
+			repewhere := "Id = "+utils.ToStr(model.RepeatArrayList[0].Id)
+			err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorRepeatName, &repeatentity, repeacols, repewhere)
 		} else {
 			if repeatentity.GasValue != 0 || repeatentity.Value1 != 0 || repeatentity.Value2 != 0 || repeatentity.Value3 != 0 || repeatentity.Value4 != 0 || repeatentity.Value5 != 0 || repeatentity.Value6 != 0 || repeatentity.AvgValue != 0 || repeatentity.RepeatValue != 0 {
 				repeatentity.EId = model.EId
@@ -631,6 +640,7 @@ func (this *LimsReportDeHSController) UpdatehsEntity() {
 		for i := 0; i < len(model.ShiftArrayList); i++ {
 			var shiftentity limsreportalertor.LimsReportAlertorShift
 			shiftentity.ValueType = model.ShiftArrayList[i].ValueType
+			shiftentity.Value0 = model.ShiftArrayList[i].Value0
 			shiftentity.Value1 = model.ShiftArrayList[i].Value1
 			shiftentity.Value2 = model.ShiftArrayList[i].Value2
 			shiftentity.Value3 = model.ShiftArrayList[i].Value3
@@ -639,13 +649,13 @@ func (this *LimsReportDeHSController) UpdatehsEntity() {
 			shiftentity.Value6 = model.ShiftArrayList[i].Value6
 			shiftentity.ZeroValue = model.ShiftArrayList[i].ZeroValue
 			shiftentity.ShowValue = model.ShiftArrayList[i].ShowValue
-
 			if model.ShiftArrayList[i].Id != 0 {
 				shiftentity.ModifiedOn = time.Now()
 				shiftentity.ModifiedBy = this.User.Realname
 				shiftentity.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
 				shiftcols := []string{
 					"ValueType",
+					"Value0",
 					"Value1",
 					"Value2",
 					"Value3",
@@ -658,7 +668,8 @@ func (this *LimsReportDeHSController) UpdatehsEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorShiftName, &shiftentity, shiftcols, alwhere)
+				shiftwhere := "Id = "+utils.ToStr(model.ShiftArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorShiftName, &shiftentity, shiftcols, shiftwhere)
 			} else {
 				if shiftentity.Value0 != 0 || shiftentity.Value1 != 0 || shiftentity.Value2 != 0 || shiftentity.Value3 != 0 || shiftentity.Value4 != 0 || shiftentity.Value5 != 0 || shiftentity.Value6 != 0 || shiftentity.ZeroValue != 0 || shiftentity.ShowValue != 0 {
 					shiftentity.EId = model.EId

+ 10 - 5
src/dashoo.cn/backend/api/controllers/limsmetering/limsreportdetelectoxygen.go

@@ -87,7 +87,7 @@ func (this *LimsReportDeOxygenController) AddOxygenEntity() {
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
 	svc := limsreportdetelectoxygen.GetLimsReportOxygenSessionService(sessions)
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1
@@ -321,7 +321,7 @@ func (this *LimsReportDeOxygenController) UpdateoxygenEntity() {
 	svc := limsreportdetelectoxygen.GetLimsReportOxygenSessionService(sessions)
 	var dataentrymodel limsdataentry.LimsDateEntry
 	var almodel limsreportalertor.LimsReportAlertor
-	model.Id = model.BenMainform.DataEntryId
+	//model.Id = model.BenMainform.DataEntryId
 	model.EId = model.BenMainform.EId
 	model.TaskBalanceId = model.BenMainform.TaskBalanceId
 	dataentrymodel.Instrument1 = model.BenMainform.Instrument1
@@ -411,7 +411,8 @@ func (this *LimsReportDeOxygenController) UpdateoxygenEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity, cercols, alwhere)
+				cerwhere := "Id = "+utils.ToStr( model.CertiArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity, cercols, cerwhere)
 			} else {
 				if cerentity.CerNum != "" || cerentity.StandardUnit != "" || cerentity.StandVal != "" || cerentity.Uncertainty != "" || cerentity.InstrumentNo != "" || cerentity.StanDevice != "" {
 					cerentity.EId = model.EId
@@ -451,7 +452,8 @@ func (this *LimsReportDeOxygenController) UpdateoxygenEntity() {
 			"ModifiedBy",
 			"ModifiedUserId",
 		}
-		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, alwhere)
+		cer2where := "Id =" +utils.ToStr(model.Id)
+		err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorCertificateName, &cerentity2, cer2cols, cer2where)
 	} else {
 		if cerentity2.CerNum != "" || cerentity2.StandardUnit != "" || cerentity2.StandVal != "" || cerentity2.Uncertainty != "" || cerentity2.InstrumentNo != "" || cerentity2.StanDevice != "" {
 			cerentity2.EId = model.EId
@@ -514,7 +516,8 @@ func (this *LimsReportDeOxygenController) UpdateoxygenEntity() {
 					"ModifiedBy",
 					"ModifiedUserId",
 				}
-				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, alwhere)
+				deviwhere := "Id = "+ utils.ToStr(model.DeviationArrayList[i].Id)
+				err = svc.UpdateEntityBywheretbl(this.User.AccCode+LimsReportAlertorDeviationName, &devientity, devicols, deviwhere)
 			} else {
 				if devientity.GasValue != 0 || devientity.Value1 != 0 || devientity.Value2 != 0 || devientity.Value3 != 0 || devientity.AvgValue != 0 || devientity.DeviationRelative != 0 || devientity.DeviationAbs != 0 {
 					devientity.EId = model.EId
@@ -616,6 +619,7 @@ func (this *LimsReportDeOxygenController) UpdateoxygenEntity() {
 		for i := 0; i < len(model.ShiftArrayList); i++ {
 			var shiftentity limsreportalertor.LimsReportAlertorShift
 			shiftentity.ValueType = model.ShiftArrayList[i].ValueType
+			shiftentity.Value0 = model.ShiftArrayList[i].Value0
 			shiftentity.Value1 = model.ShiftArrayList[i].Value1
 			shiftentity.Value2 = model.ShiftArrayList[i].Value2
 			shiftentity.Value3 = model.ShiftArrayList[i].Value3
@@ -631,6 +635,7 @@ func (this *LimsReportDeOxygenController) UpdateoxygenEntity() {
 				shiftentity.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
 				shiftcols := []string{
 					"ValueType",
+					"Value0",
 					"Value1",
 					"Value2",
 					"Value3",

+ 4 - 3
src/dashoo.cn/frontend_web/src/pages/lims/createreport/reporttodo.vue

@@ -712,11 +712,12 @@
         api.getReporturl(val.Id, this.$axios).then(res => {
           // response
           if (res.data.code === 0) {
+            console.log("---res.data.item-----",res.data.item)
             this.ReportRequest = res.data.item
             this.reportid = this.ReportRequest.ReportId
-            this.reporturl = this.ReportRequest.ReportUrl
-            this.reportname = this.ReportRequest.ReportName
-            location.href = "petrotool://furl=" + this.reporturl + "&fname=" + this.reportname +
+            let reporturl = this.ReportRequest.ReportUrl
+            let reportname = this.ReportRequest.ReportName
+            location.href = "petrotool://furl=" + reporturl + "&fname=" + reportname +
               "&doctype=report&id=" + this.reportid +
               "&act=edit"
           }

+ 22 - 8
src/dashoo.cn/frontend_web/src/pages/lims/reportalertorbendetect/_opera/operation.vue

@@ -447,7 +447,7 @@
       </el-table>
       <template>
         <div style="text-align: center; margin-top: 15px;">
-          <el-button type="primary" size="small" @click="saveEntity"><i class="el-icon-circle-check"></i>
+          <el-button type="primary" size="small" @click="saveEntity" :disabled="DataStatus != 0 && DataStatus != 5&& DataStatus!=3"><i class="el-icon-circle-check"></i>
             保存
           </el-button>
         </div>
@@ -756,6 +756,24 @@
             if (this.formData.CheckDate == "0001-01-01T00:00:00Z"){
               this.formData.CheckDate = new Date();
             }
+            if (res.data.ceritem != null) {
+              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
+                this.certificateData[i].Id = res.data.ceritem[i].Id;
+                this.certificateData[i].CerNum = res.data.ceritem[i].CerNum;
+                this.certificateData[i].StandVal = res.data.ceritem[i].StandVal;
+                this.certificateData[i].Uncertainty = res.data.ceritem[i].Uncertainty;
+                this.certificateData[i].EffectDate = res.data.ceritem[i].EffectDate;
+                this.certificateData[i].StanDevice = res.data.ceritem[i].StanDevice;
+
+              }
+              this.formCertificateData.Id = res.data.ceritem[3].Id
+              this.formCertificateData.StanDevice = res.data.ceritem[3].StanDevice
+              this.formCertificateData.StandVal = res.data.ceritem[3].StandVal
+              this.formCertificateData.CerNum = res.data.ceritem[3].CerNum
+              this.formCertificateData.Uncertainty = res.data.ceritem[3].Uncertainty
+              this.formCertificateData.EffectDate = res.data.ceritem[3].EffectDate
+              this.formData.StanDevice = this.certificateData[0].StanDevice
+            }
             if (res.data.alvalitem != null) {
               for (var i = 0; i < res.data.alvalitem.length; i++) {
                 this.alerValData[i] = res.data.alvalitem[i];
@@ -786,12 +804,14 @@
             if (res.data.repeatitem != null) {
               for (var i = 0; i < res.data.repeatitem.length; i++) {
                 this.RepeatData[i] = res.data.repeatitem[i];
+                this.RepeatData[i].AvgValue = res.data.repeatitem[i].AvgValue + ""
+                this.deviationData[i].RepeatValue = res.data.deviitem[i].RepeatValue;
               }
             }
             if (res.data.shiftitem != null) {
               for (var i = 0; i < res.data.shiftitem.length; i++) {
                 this.ShiftData[i].ValueType = res.data.shiftitem[i].ValueType;
-                this.ShiftData[i].value0 = res.data.shiftitem[i].value0;
+                this.ShiftData[i].Value0 = res.data.shiftitem[i].Value0;
                 this.ShiftData[i].Value1 = res.data.shiftitem[i].Value1;
                 this.ShiftData[i].Value2 = res.data.shiftitem[i].Value2;
                 this.ShiftData[i].Value3 = res.data.shiftitem[i].Value3;
@@ -802,12 +822,6 @@
                 this.ShiftData[i].ShowValue = res.data.shiftitem[i].ShowValue;
               }
             }
-            if (res.data.ceritem != null) {
-              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
-                this.certificateData[i] = res.data.ceritem[i];
-              }
-              this.formCertificateData = res.data.ceritem[3]
-            }
           }).catch(err => {
             console.error(err)
           });

+ 24 - 10
src/dashoo.cn/frontend_web/src/pages/lims/reportalertorcarbondetect/_opera/operation.vue

@@ -88,7 +88,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="标准器名称:">
-              <el-input v-model="formData.ElectrifyCheck" placeholder="请输入" style="width: 100%"></el-input>
+              <el-input v-model="formData.StanDevice" placeholder="请输入" style="width: 100%"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -194,7 +194,7 @@
       <el-table :data="deviationData" border style="width: 100%">
         <el-table-column align="center" prop="GasValue" label="标准气体浓度值(×10-6 mol/mol)" width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.GasValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.01" v-model.number="scope.row.GasValue" style="width: 100%" size="mini" :disabled="true"></el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" label="仪器示值(×10-6 mol/mol)" min-width="180">
@@ -218,7 +218,7 @@
           </el-table-column>
           <el-table-column align="center" prop="AvgValue" label="平均值">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.01" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini" :disabled="true"></el-input>
             </template>
           </el-table-column>
         </el-table-column>
@@ -382,7 +382,7 @@
       </el-table>
       <template>
         <div style="text-align: center; margin-top: 15px;">
-          <el-button type="primary" size="small" @click="saveEntity"><i class="el-icon-circle-check"></i>
+          <el-button type="primary" size="small" @click="saveEntity" :disabled="DataStatus != 0 && DataStatus != 5&& DataStatus!=3"><i class="el-icon-circle-check"></i>
             保存
           </el-button>
         </div>
@@ -675,6 +675,24 @@
             if (this.formData.CheckDate == "0001-01-01T00:00:00Z"){
               this.formData.CheckDate = new Date();
             }
+            if (res.data.ceritem != null) {
+              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
+                this.certificateData[i].Id = res.data.ceritem[i].Id;
+                this.certificateData[i].CerNum = res.data.ceritem[i].CerNum;
+                this.certificateData[i].StandVal = res.data.ceritem[i].StandVal;
+                this.certificateData[i].Uncertainty = res.data.ceritem[i].Uncertainty;
+                this.certificateData[i].EffectDate = res.data.ceritem[i].EffectDate;
+                this.certificateData[i].StanDevice = res.data.ceritem[i].StanDevice;
+
+              }
+              this.formCertificateData.Id = res.data.ceritem[3].Id
+              this.formCertificateData.StanDevice = res.data.ceritem[3].StanDevice
+              this.formCertificateData.StandVal = res.data.ceritem[3].StandVal
+              this.formCertificateData.CerNum = res.data.ceritem[3].CerNum
+              this.formCertificateData.Uncertainty = res.data.ceritem[3].Uncertainty
+              this.formCertificateData.EffectDate = res.data.ceritem[3].EffectDate
+              this.formData.StanDevice = this.certificateData[0].StanDevice
+            }
             if (res.data.deviitem != null) {
               for (var i = 0; i < res.data.deviitem.length; i++) {
                 this.deviationData[i].Id = res.data.deviitem[i].Id;
@@ -696,6 +714,8 @@
             if (res.data.repeatitem != null) {
               for (var i = 0; i < res.data.repeatitem.length; i++) {
                 this.RepeatData[i] = res.data.repeatitem[i];
+                this.RepeatData[i].AvgValue = res.data.repeatitem[i].AvgValue + ""
+                this.deviationData[i].RepeatValue = res.data.deviitem[i].RepeatValue;
               }
             }
             if (res.data.shiftitem != null) {
@@ -712,12 +732,6 @@
                 this.ShiftData[i].ShowValue = res.data.shiftitem[i].ShowValue;
               }
             }
-            if (res.data.ceritem != null) {
-              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
-                this.certificateData[i] = res.data.ceritem[i];
-              }
-              this.formCertificateData = res.data.ceritem[3]
-            }
           }).catch(err => {
             console.error(err)
           });

+ 21 - 7
src/dashoo.cn/frontend_web/src/pages/lims/reportalertorfhgasdetect/_opera/operation.vue

@@ -413,7 +413,7 @@
       </el-table>
       <template>
         <div style="text-align: center; margin-top: 15px;">
-          <el-button type="primary" size="small" @click="saveEntity"><i class="el-icon-circle-check"></i>
+          <el-button type="primary" size="small" @click="saveEntity" :disabled="DataStatus != 0 && DataStatus != 5&& DataStatus!=3"><i class="el-icon-circle-check"></i>
             保存
           </el-button>
         </div>
@@ -705,6 +705,24 @@
             if (this.formData.CheckDate == "0001-01-01T00:00:00Z"){
               this.formData.CheckDate = new Date();
             }
+            if (res.data.ceritem != null) {
+              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
+                this.certificateData[i].Id = res.data.ceritem[i].Id;
+                this.certificateData[i].CerNum = res.data.ceritem[i].CerNum;
+                this.certificateData[i].StandVal = res.data.ceritem[i].StandVal;
+                this.certificateData[i].Uncertainty = res.data.ceritem[i].Uncertainty;
+                this.certificateData[i].EffectDate = res.data.ceritem[i].EffectDate;
+                this.certificateData[i].StanDevice = res.data.ceritem[i].StanDevice;
+
+              }
+              this.formCertificateData.Id = res.data.ceritem[3].Id
+              this.formCertificateData.StanDevice = res.data.ceritem[3].StanDevice
+              this.formCertificateData.StandVal = res.data.ceritem[3].StandVal
+              this.formCertificateData.CerNum = res.data.ceritem[3].CerNum
+              this.formCertificateData.Uncertainty = res.data.ceritem[3].Uncertainty
+              this.formCertificateData.EffectDate = res.data.ceritem[3].EffectDate
+              this.formData.StanDevice = this.certificateData[0].StanDevice
+            }
             if (res.data.alvalitem != null) {
               for (var i = 0; i < res.data.alvalitem.length; i++) {
                 this.alerValData[i] = res.data.alvalitem[i];
@@ -735,6 +753,8 @@
             if (res.data.repeatitem != null) {
               for (var i = 0; i < res.data.repeatitem.length; i++) {
                 this.RepeatData[i] = res.data.repeatitem[i];
+                this.RepeatData[i].AvgValue = res.data.repeatitem[i].AvgValue + ""
+                this.deviationData[i].RepeatValue = res.data.deviitem[i].RepeatValue;
               }
             }
             if (res.data.shiftitem != null) {
@@ -751,12 +771,6 @@
                 this.ShiftData[i].ShowValue = res.data.shiftitem[i].ShowValue;
               }
             }
-            if (res.data.ceritem != null) {
-              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
-                this.certificateData[i] = res.data.ceritem[i];
-              }
-              this.formCertificateData = res.data.ceritem[3]
-            }
           }).catch(err => {
             console.error(err)
           });

+ 63 - 76
src/dashoo.cn/frontend_web/src/pages/lims/reportalertorkrgasdetect/_opera/operation.vue

@@ -248,13 +248,13 @@
           </el-table-column>
           <el-table-column align="center" prop="AvgValue" label="平均值">
             <template slot-scope="scope">
-              <el-input type="number" step="0.1" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini"  :disabled="true"></el-input>
             </template>
           </el-table-column>
         </el-table-column>
         <el-table-column align="center" prop="Deviation" label="示值误差(%FS)" min-width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.1" v-model.number="scope.row.Deviation" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Deviation" style="width: 100%" size="mini"  :disabled="true"></el-input>
           </template>
         </el-table-column>
       </el-table>
@@ -338,13 +338,13 @@
           </el-table-column>
           <el-table-column align="center" prop="AvgValue" label="平均值">
             <template slot-scope="scope">
-              <el-input type="number" step="0.1" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini" :disabled="true"></el-input>
             </template>
           </el-table-column>
         </el-table-column>
         <el-table-column align="center" prop="RepeatValue" label="重复性(%)" min-width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.1" v-model.number="scope.row.RepeatValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.RepeatValue" style="width: 100%" size="mini" :disabled="true"></el-input>
           </template>
         </el-table-column>
       </el-table>
@@ -405,7 +405,7 @@
       </el-table>
       <template>
         <div style="text-align: center; margin-top: 15px;">
-          <el-button type="primary" size="small" @click="saveEntity"><i class="el-icon-circle-check"></i>
+          <el-button type="primary" size="small" @click="saveEntity" :disabled="DataStatus != 0 && DataStatus != 5&& DataStatus!=3"><i class="el-icon-circle-check"></i>
             保存
           </el-button>
         </div>
@@ -476,7 +476,7 @@
           MeterRange: '',
           DataEntryCode: '',
           MeasurementRange: '',
-          DetectBasis: '',
+          DetectBasis: 'JJG 693-2011《 可燃气体检测报警器》检定规程',
           FaceCheck: '',
           FlagCheck: '',
           ElectrifyCheck: '',
@@ -489,7 +489,7 @@
           TestDepartId: 0,
           Instrument1: '',
           Temperature: '',
-          StandardDesc: '',
+          StandardDesc: '可燃气体检测报警器检定装置',
           StanDevice: '',
           RelativeHumanity: '',
           ManuCompany: '',
@@ -694,9 +694,29 @@
           api.getEntity(this.formData.DataEntryId, this.$axios).then(res => {
             console.log("------res------", res.data)
             this.formData = res.data.mainitem;
+            this.formData.DetectBasis = 'JJG 693-2011《 可燃气体检测报警器》检定规程'
+            this.formData.StandardDesc = '可燃气体检测报警器检定装置'
             if (this.formData.CheckDate == "0001-01-01T00:00:00Z"){
               this.formData.CheckDate = new Date();
             }
+            if (res.data.ceritem != null) {
+              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
+                this.certificateData[i].Id = res.data.ceritem[i].Id;
+                this.certificateData[i].CerNum = res.data.ceritem[i].CerNum;
+                this.certificateData[i].StandVal = res.data.ceritem[i].StandVal;
+                this.certificateData[i].Uncertainty = res.data.ceritem[i].Uncertainty;
+                this.certificateData[i].EffectDate = res.data.ceritem[i].EffectDate;
+                this.certificateData[i].StanDevice = res.data.ceritem[i].StanDevice;
+
+              }
+              this.formCertificateData.Id = res.data.ceritem[3].Id
+              this.formCertificateData.StanDevice = res.data.ceritem[3].StanDevice
+              this.formCertificateData.StandVal = res.data.ceritem[3].StandVal
+              this.formCertificateData.CerNum = res.data.ceritem[3].CerNum
+              this.formCertificateData.Uncertainty = res.data.ceritem[3].Uncertainty
+              this.formCertificateData.EffectDate = res.data.ceritem[3].EffectDate
+              this.formData.StanDevice = this.certificateData[0].StanDevice
+            }
             if (res.data.alvalitem != null) {
               for (var i = 0; i < res.data.alvalitem.length; i++) {
                 this.alerValData[i] = res.data.alvalitem[i];
@@ -727,28 +747,24 @@
             if (res.data.repeatitem != null) {
               for (var i = 0; i < res.data.repeatitem.length; i++) {
                 this.RepeatData[i] = res.data.repeatitem[i];
+                this.RepeatData[i].AvgValue = res.data.repeatitem[i].AvgValue + ""
+                this.deviationData[i].RepeatValue = res.data.deviitem[i].RepeatValue;
               }
             }
             if (res.data.shiftitem != null) {
               for (var i = 0; i < res.data.shiftitem.length; i++) {
-                this.ShiftData[i].ValueType = res.data.shiftitem[i].ValueType;
-                this.ShiftData[i].value0 = res.data.shiftitem[i].value0;
-                this.ShiftData[i].Value1 = res.data.shiftitem[i].Value1;
-                this.ShiftData[i].Value2 = res.data.shiftitem[i].Value2;
-                this.ShiftData[i].Value3 = res.data.shiftitem[i].Value3;
-                this.ShiftData[i].Value4 = res.data.shiftitem[i].Value4;
-                this.ShiftData[i].Value5 = res.data.shiftitem[i].Value5;
-                this.ShiftData[i].Value6 = res.data.shiftitem[i].Value6;
-                this.ShiftData[i].ZeroValue = res.data.shiftitem[i].ZeroValue;
-                this.ShiftData[i].ShowValue = res.data.shiftitem[i].ShowValue;
+                this.ShiftData[i] = res.data.shiftitem[i];
+                // this.ShiftData[i].value0 = res.data.shiftitem[i].value0;
+                // this.ShiftData[i].Value1 = res.data.shiftitem[i].Value1;
+                // this.ShiftData[i].Value2 = res.data.shiftitem[i].Value2;
+                // this.ShiftData[i].Value3 = res.data.shiftitem[i].Value3;
+                // this.ShiftData[i].Value4 = res.data.shiftitem[i].Value4;
+                // this.ShiftData[i].Value5 = res.data.shiftitem[i].Value5;
+                // this.ShiftData[i].Value6 = res.data.shiftitem[i].Value6;
+                // this.ShiftData[i].ZeroValue = res.data.shiftitem[i].ZeroValue;
+                // this.ShiftData[i].ShowValue = res.data.shiftitem[i].ShowValue;
               }
             }
-            if (res.data.ceritem != null) {
-              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
-                this.certificateData[i] = res.data.ceritem[i];
-              }
-              this.formCertificateData = res.data.ceritem[3]
-            }
           }).catch(err => {
             console.error(err)
           });
@@ -809,6 +825,11 @@
         } else {
           row.AvgValue = '0'
         }
+        if (row.AvgValue !== '' && parseInt(row.AvgValue) !== 0) {
+          row.Deviation = Number((row.AvgValue - row.GasValue).toFixed(1))
+        } else {
+          row.Deviation = 0
+        }
       },
       getRepeValueAvg(row) {
         var divisor = 0
@@ -842,6 +863,25 @@
         } else {
           row.AvgValue = '0'
         }
+        if (row.AvgValue !== '' && parseInt(row.AvgValue) !== 0 &&
+          row.Value1 !== '' && parseInt(row.Value1) !== 0 &&
+          row.Value2 !== '' && parseInt(row.Value2) !== 0 &&
+          row.Value3 !== '' && parseInt(row.Value3) !== 0 &&
+          row.Value4 !== '' && parseInt(row.Value4) !== 0 &&
+          row.Value5 !== '' && parseInt(row.Value5) !== 0 &&
+          row.Value6 !== '' && parseInt(row.Value6) !== 0) {
+          var v1 = (row.AvgValue - row.Value1).toFixed(1)
+          var v2 = (row.AvgValue - row.Value2).toFixed(1)
+          var v3 = (row.AvgValue - row.Value3).toFixed(1)
+          var v4 = (row.AvgValue - row.Value4).toFixed(1)
+          var v5 = (row.AvgValue - row.Value5).toFixed(1)
+          var v6 = (row.AvgValue - row.Value6).toFixed(1)
+          var sumsq = v1 * v1 + v2 * v2 + v3 * v3 + v4 * v4 + v5 * v5 + v6 * v6
+          var sqthen = Math.sqrt(sumsq / 5)
+          row.RepeatValue = Number((sqthen / row.AvgValue * 100).toFixed(1))
+        }else{
+          row.RepeatValue = 0
+        }
       },
       setProoFreadShow() {
           this.ProoFreadShow = true
@@ -928,29 +968,6 @@
             }
           }
         }
-        this.deviationData.AvgValue = this.deviationData.AvgValue+""
-        this.RepeatData.AvgValue = this.RepeatData.AvgValue + ""
-        // this.alerValData.ActionValue = parseInt(this.alerValData.ActionValue)
-        // this.alerValData.Value1 = parseInt(this.alerValData.Value1)
-        // this.alerValData.Value2 = parseInt(this.alerValData.Value2)
-        // this.alerValData.Value3 = parseInt(this.alerValData.Value3)
-        // this.deviationData.GasValue = parseInt(this.deviationData.GasValue)
-        // this.deviationData.Deviation = parseInt(this.deviationData.Deviation)
-        // this.responseTimeData.GasValue = parseInt(this.responseTimeData.GasValue)
-        // this.responseTimeData.Value1 = parseInt(this.responseTimeData.Value1)
-        // this.responseTimeData.Value2 = parseInt(this.responseTimeData.Value2)
-        // this.responseTimeData.Value3 = parseInt(this.responseTimeData.Value3)
-        // this.responseTimeData.Deviation = parseInt(this.responseTimeData.Deviation)
-        // this.RepeatData.GasValue = parseInt(this.RepeatData.GasValue)
-        // this.RepeatData.RepeatValue = parseInt(this.RepeatData.RepeatValue)
-        // this.ShiftData.Value1 = parseInt(this.ShiftData.Value1)
-        // this.ShiftData.Value2 = parseInt(this.ShiftData.Value2)
-        // this.ShiftData.Value3 = parseInt(this.ShiftData.Value3)
-        // this.ShiftData.Value4 = parseInt(this.ShiftData.Value4)
-        // this.ShiftData.Value5 = parseInt(this.ShiftData.Value5)
-        // this.ShiftData.Value6 = parseInt(this.ShiftData.Value6)
-        // this.ShiftData.ZeroValue = parseInt(this.ShiftData.ZeroValue)
-        // this.ShiftData.ShowValue = parseInt(this.ShiftData.ShowValue)
         let allform = {
           BenMainform: this.formData,
           CertiArrayList: this.certificateData, //添加证书数据
@@ -997,37 +1014,7 @@
               _this.alerValData[i].AlertFunction = _this.alerValData[i].AlertFunc[0]
             }
           }
-          // this.alerValData.ActionValue = parseInt(this.alerValData.ActionValue)
-          // this.alerValData.Value1 = parseInt(this.alerValData.Value1)
-          // this.alerValData.Value2 = parseInt(this.alerValData.Value2)
-          // this.alerValData.Value3 = parseInt(this.alerValData.Value3)
         }
-        // if (this.deviationData != null) {
-        //   this.deviationData.GasValue = parseInt(this.deviationData.GasValue)
-        //   this.deviationData.Deviation = parseInt(this.deviationData.Deviation)
-        // }
-
-        // if (this.responseTimeData != null) {
-        //   this.responseTimeData.GasValue = parseInt(this.responseTimeData.GasValue)
-        //   this.responseTimeData.Value1 = parseInt(this.responseTimeData.Value1)
-        //   this.responseTimeData.Value2 = parseInt(this.responseTimeData.Value2)
-        //   this.responseTimeData.Value3 = parseInt(this.responseTimeData.Value3)
-        //   this.responseTimeData.Deviation = parseInt(this.responseTimeData.Deviation)
-        // }
-        // if (this.RepeatData != null) {
-        //   this.RepeatData.GasValue = parseInt(this.RepeatData.GasValue)
-        //   this.RepeatData.RepeatValue = parseInt(this.RepeatData.RepeatValue)
-        // }
-        // if (this.ShiftData != null) {
-        //   this.ShiftData.Value1 = parseInt(this.ShiftData.Value1)
-        //   this.ShiftData.Value2 = parseInt(this.ShiftData.Value2)
-        //   this.ShiftData.Value3 = parseInt(this.ShiftData.Value3)
-        //   this.ShiftData.Value4 = parseInt(this.ShiftData.Value4)
-        //   this.ShiftData.Value5 = parseInt(this.ShiftData.Value5)
-        //   this.ShiftData.Value6 = parseInt(this.ShiftData.Value6)
-        //   this.ShiftData.ZeroValue = parseInt(this.ShiftData.ZeroValue)
-        //   this.ShiftData.ShowValue = parseInt(this.ShiftData.ShowValue)
-        // }
         let allform = {
           BenMainform: this.formData,
           CertiArrayList: this.certificateData, //添加证书数据

+ 22 - 15
src/dashoo.cn/frontend_web/src/pages/lims/reportanalyzer1carbonredgas/_opera/operation.vue

@@ -92,7 +92,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="标准器名称:">
-              <el-input v-model="formData.ElectrifyCheck" placeholder="请输入" style="width: 100%"></el-input>
+              <el-input v-model="formData.StanDevice" placeholder="请输入" style="width: 100%"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -391,7 +391,7 @@
       </el-table>
       <template>
         <div style="text-align: center; margin-top: 15px;">
-          <el-button type="primary" size="small" @click="saveEntity"><i class="el-icon-circle-check"></i>
+          <el-button type="primary" size="small" @click="saveEntity" :disabled="DataStatus != 0 && DataStatus != 5&& DataStatus!=3"><i class="el-icon-circle-check"></i>
             保存
           </el-button>
         </div>
@@ -699,6 +699,24 @@
             if (this.formData.CheckDate == "0001-01-01T00:00:00Z"){
               this.formData.CheckDate = new Date();
             }
+            if (res.data.ceritem != null) {
+              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
+                this.certificateData[i].Id = res.data.ceritem[i].Id;
+                this.certificateData[i].CerNum = res.data.ceritem[i].CerNum;
+                this.certificateData[i].StandVal = res.data.ceritem[i].StandVal;
+                this.certificateData[i].Uncertainty = res.data.ceritem[i].Uncertainty;
+                this.certificateData[i].EffectDate = res.data.ceritem[i].EffectDate;
+                this.certificateData[i].StanDevice = res.data.ceritem[i].StanDevice;
+
+              }
+              this.formCertificateData.Id = res.data.ceritem[3].Id
+              this.formCertificateData.StanDevice = res.data.ceritem[3].StanDevice
+              this.formCertificateData.StandVal = res.data.ceritem[3].StandVal
+              this.formCertificateData.CerNum = res.data.ceritem[3].CerNum
+              this.formCertificateData.Uncertainty = res.data.ceritem[3].Uncertainty
+              this.formCertificateData.EffectDate = res.data.ceritem[3].EffectDate
+              this.formData.StanDevice = this.certificateData[0].StanDevice
+            }
             if (res.data.alvalitem != null) {
               for (var i = 0; i < res.data.alvalitem.length; i++) {
                 this.alerValData[i] = res.data.alvalitem[i];
@@ -728,14 +746,9 @@
             }
             if (res.data.repeatitem != null) {
               for (var i = 0; i < res.data.repeatitem.length; i++) {
+                this.deviationData[i] = res.data.deviitem[i];
+                this.RepeatData[i].AvgValue = res.data.repeatitem[i].AvgValue + ""
                 this.deviationData[i].RepeatValue = res.data.deviitem[i].RepeatValue;
-                this.RepeatData[i].AvgValue = res.data.repeatitem[i].AvgValue + "";
-                this.deviationData[i].Value1 = res.data.deviitem[i].Value1;
-                this.deviationData[i].Value2 = res.data.deviitem[i].Value2;
-                this.deviationData[i].Value3 = res.data.deviitem[i].Value3;
-                this.deviationData[i].Value4 = res.data.deviitem[i].Value4;
-                this.deviationData[i].Value5 = res.data.deviitem[i].Value5;
-                this.deviationData[i].Value6 = res.data.deviitem[i].Value6;
               }
             }
             if (res.data.shiftitem != null) {
@@ -752,12 +765,6 @@
                 this.ShiftData[i].ShowValue = res.data.shiftitem[i].ShowValue;
               }
             }
-            if (res.data.ceritem != null) {
-              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
-                this.certificateData[i] = res.data.ceritem[i];
-              }
-              this.formCertificateData = res.data.ceritem[3]
-            }
             if (res.data.otheritem != null) {
               for (var i = 0; i < res.data.otheritem.length; i++) {
                 this.ReportAlerOtherData[i] = res.data.otheritem[i];

+ 22 - 8
src/dashoo.cn/frontend_web/src/pages/lims/reportanalyzer2carbonredgas/_opera/operation.vue

@@ -92,7 +92,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="标准器名称:">
-              <el-input v-model="formData.ElectrifyCheck" placeholder="请输入" style="width: 100%"></el-input>
+              <el-input v-model="formData.StanDevice" placeholder="请输入" style="width: 100%"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -391,7 +391,7 @@
       </el-table>
       <template>
         <div style="text-align: center; margin-top: 15px;">
-          <el-button type="primary" size="small" @click="saveEntity"><i class="el-icon-circle-check"></i>
+          <el-button type="primary" size="small" @click="saveEntity" :disabled="DataStatus != 0 && DataStatus != 5&& DataStatus!=3"><i class="el-icon-circle-check"></i>
             保存
           </el-button>
         </div>
@@ -677,6 +677,24 @@
             if (this.formData.CheckDate == "0001-01-01T00:00:00Z"){
               this.formData.CheckDate = new Date();
             }
+            if (res.data.ceritem != null) {
+              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
+                this.certificateData[i].Id = res.data.ceritem[i].Id;
+                this.certificateData[i].CerNum = res.data.ceritem[i].CerNum;
+                this.certificateData[i].StandVal = res.data.ceritem[i].StandVal;
+                this.certificateData[i].Uncertainty = res.data.ceritem[i].Uncertainty;
+                this.certificateData[i].EffectDate = res.data.ceritem[i].EffectDate;
+                this.certificateData[i].StanDevice = res.data.ceritem[i].StanDevice;
+
+              }
+              this.formCertificateData.Id = res.data.ceritem[3].Id
+              this.formCertificateData.StanDevice = res.data.ceritem[3].StanDevice
+              this.formCertificateData.StandVal = res.data.ceritem[3].StandVal
+              this.formCertificateData.CerNum = res.data.ceritem[3].CerNum
+              this.formCertificateData.Uncertainty = res.data.ceritem[3].Uncertainty
+              this.formCertificateData.EffectDate = res.data.ceritem[3].EffectDate
+              this.formData.StanDevice = this.certificateData[0].StanDevice
+            }
             if (res.data.alvalitem != null) {
               for (var i = 0; i < res.data.alvalitem.length; i++) {
                 this.alerValData[i] = res.data.alvalitem[i];
@@ -707,6 +725,8 @@
             if (res.data.repeatitem != null) {
               for (var i = 0; i < res.data.repeatitem.length; i++) {
                 this.RepeatData[i] = res.data.repeatitem[i];
+                this.RepeatData[i].AvgValue = res.data.repeatitem[i].AvgValue + ""
+                this.deviationData[i].RepeatValue = res.data.deviitem[i].RepeatValue;
               }
             }
             if (res.data.shiftitem != null) {
@@ -723,12 +743,6 @@
                 this.ShiftData[i].ShowValue = res.data.shiftitem[i].ShowValue;
               }
             }
-            if (res.data.ceritem != null) {
-              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
-                this.certificateData[i] = res.data.ceritem[i];
-              }
-              this.formCertificateData = res.data.ceritem[3]
-            }
             if (res.data.otheritem != null) {
               for (var i = 0; i < res.data.otheritem.length; i++) {
                 this.ReportAlerOtherData[i] = res.data.otheritem[i];

+ 155 - 152
src/dashoo.cn/frontend_web/src/pages/lims/reportdetectorHSgas/_opera/operation.vue

@@ -20,12 +20,14 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="编码:">
-              <el-input v-model="formData.DataEntryCode" placeholder="请输入" style="width: 100%" :disabled="true"></el-input>
+              <el-input v-model="formData.DataEntryCode" placeholder="请输入" style="width: 100%" :disabled="true">
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="检定地点:">
-              <el-input v-model="formData.PositionCheck" placeholder="请输入" style="width: 100%" :disabled="true"></el-input>
+              <el-input v-model="formData.PositionCheck" placeholder="请输入" style="width: 100%" :disabled="true">
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -52,7 +54,8 @@
           </el-col>
           <el-col :span="16">
             <el-form-item label="送检单位:">
-              <el-input v-model="formData.CustomerName" placeholder="请输入" style="width: 100%" :disabled="true"></el-input>
+              <el-input v-model="formData.CustomerName" placeholder="请输入" style="width: 100%" :disabled="true">
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -146,8 +149,8 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="有效期至:">
-            <el-date-picker style="width: 100%" v-model="formCertificateData.EffectDate" type="date" format="yyyy 年 MM 月 dd 日"
-              placeholder="请选择">
+            <el-date-picker style="width: 100%" v-model="formCertificateData.EffectDate" type="date"
+              format="yyyy 年 MM 月 dd 日" placeholder="请选择">
             </el-date-picker>
           </el-form-item>
         </el-col>
@@ -163,12 +166,17 @@
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="二.绝缘强度:">
+            <el-form-item label="二、通电检查:" label-width="150px">
+              <el-input v-model="formData.ElectrifyCheck" placeholder="请输入" style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="三.绝缘强度:">
               <el-input v-model="formData.DielecStrength" placeholder="请输入" style="width: 100%"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="三.绝缘电阻:">
+            <el-form-item label=".绝缘电阻:">
               <el-input v-model="formData.Insulation" placeholder="请输入" style="width: 100%"></el-input>
             </el-form-item>
           </el-col>
@@ -183,34 +191,40 @@
       <el-table :data="alerValData" border style="width: 100%" :header-cell-style="discountHeaderStyle1">
         <el-table-column align="center" prop="SureValue" label="仪器设定报警点(×10-6mol/mol)">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.SureValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.SureValue" style="width: 100%" size="mini">
+            </el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" label="实际报警浓度值(×10-6mol/mol)">
           <el-table-column align="center" label="" prop="Value1">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.Value1" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.Value1" style="width: 100%" size="mini">
+              </el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" label="" prop="Value2">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.Value2" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.Value2" style="width: 100%" size="mini">
+              </el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" label="" prop="Value3">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.Value3" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.Value3" style="width: 100%" size="mini">
+              </el-input>
             </template>
           </el-table-column>
         </el-table-column>
         <el-table-column prop="MaxValue" align="center" label="报警浓度最大值(×10-6mol/mol)" min-width="90">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.MaxValue" style="width: 160px" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.MaxValue" style="width: 160px" size="mini">
+            </el-input>
           </template>
         </el-table-column>
         <el-table-column prop="AllowValue" align="center" label="报警设置误差(%)" min-width="90">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.AllowValue" style="width: 160px" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.AllowValue" style="width: 160px" size="mini">
+            </el-input>
           </template>
         </el-table-column>
       </el-table>
@@ -223,37 +237,40 @@
       <el-table :data="deviationData" border style="width: 100%">
         <el-table-column align="center" prop="GasValue" label="标准气体浓度值(×10-6 mol/mol)" width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.GasValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.GasValue" style="width: 100%" size="mini"
+              :disabled="true"></el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" label="仪器示值(×10-6mol/mol)" min-width="180">
           <el-table-column align="center" prop="Value1" label="1">
             <template slot-scope="scope">
-              <el-input @blur="getDeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value1"
+              <el-input @blur="getDeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value1"
                 style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value2" label="2">
             <template slot-scope="scope">
-              <el-input @blur="getDeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value2"
+              <el-input @blur="getDeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value2"
                 style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value3" label="3">
             <template slot-scope="scope">
-              <el-input @blur="getDeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value3"
+              <el-input @blur="getDeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value3"
                 style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="AvgValue" label="平均值">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini"
+                :disabled="true"></el-input>
             </template>
           </el-table-column>
         </el-table-column>
         <el-table-column align="center" prop="Deviation" label="示值引用误差  (%FS)" min-width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Deviation" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Deviation" style="width: 100%" size="mini"
+              :disabled="true"></el-input>
           </template>
         </el-table-column>
       </el-table>
@@ -266,28 +283,33 @@
       <el-table :data="responseTimeData" border style="width: 100%">
         <el-table-column align="center" prop="GasValue" label="标准气体浓度值(×10-6  mol/mol)" width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.GasValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.GasValue" style="width: 100%" size="mini">
+            </el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" label="时间" min-width="180">
           <el-table-column align="center" prop="Value1" label="1">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.Value1" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.Value1" style="width: 100%" size="mini">
+              </el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value2" label="2">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.Value2" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.Value2" style="width: 100%" size="mini">
+              </el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value3" label="3">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.Value3" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.Value3" style="width: 100%" size="mini">
+              </el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Deviation" label="响应时间">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.Deviation" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.Deviation" style="width: 100%" size="mini">
+              </el-input>
             </template>
           </el-table-column>
         </el-table-column>
@@ -301,55 +323,58 @@
       <el-table :data="RepeatData" border style="width: 100%">
         <el-table-column align="center" prop="GasValue" label="标准气体浓度值(×10-6 mol/mol)" width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.GasValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.GasValue" style="width: 100%" size="mini"
+              :disabled="true"></el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" prop="name" label="仪器示值(×10-6mol/mol)" min-width="180">
           <el-table-column align="center" prop="Value1" label="1">
             <template slot-scope="scope">
-              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value1"
+              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value1"
                 style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value2" label="2">
             <template slot-scope="scope">
-              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value2"
+              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value2"
                 style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value3" label="3">
             <template slot-scope="scope">
-              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value3"
+              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value3"
                 style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value4" label="4">
             <template slot-scope="scope">
-              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value4"
+              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value4"
                 style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value5" label="5">
             <template slot-scope="scope">
-              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value5"
+              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value5"
                 style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value6" label="6">
             <template slot-scope="scope">
-              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value6"
+              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value6"
                 style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="AvgValue" label="平均值">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini"
+                :disabled="true"></el-input>
             </template>
           </el-table-column>
         </el-table-column>
         <el-table-column align="center" prop="RepeatValue" label="重复性(%)" min-width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.RepeatValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.RepeatValue" style="width: 100%" size="mini"
+              :disabled="true"></el-input>
           </template>
         </el-table-column>
       </el-table>
@@ -362,55 +387,64 @@
       <el-table :data="ShiftData" border style="width: 100%">
         <el-table-column align="center" prop="ValueType" label="时间">
         </el-table-column>
-        <el-table-column prop="value0" align="center" label="0">
+        <el-table-column prop="Value0" align="center" label="0">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Value0" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Value0" style="width: 100%" size="mini">
+            </el-input>
           </template>
         </el-table-column>
-        <el-table-column prop="value1" align="center" label="1h   (10min)" min-width="80">
+        <el-table-column prop="Value1" align="center" label="1h   (10min)" min-width="80">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Value1" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Value1" style="width: 100%" size="mini">
+            </el-input>
           </template>
         </el-table-column>
-        <el-table-column prop="value2" align="center" label="2h   (20min)" min-width="80">
+        <el-table-column prop="Value2" align="center" label="2h   (20min)" min-width="80">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Value2" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Value2" style="width: 100%" size="mini">
+            </el-input>
           </template>
         </el-table-column>
-        <el-table-column prop="value3" align="center" label="3h   (30min)" min-width="80">
+        <el-table-column prop="Value3" align="center" label="3h   (30min)" min-width="80">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Value3" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Value3" style="width: 100%" size="mini">
+            </el-input>
           </template>
         </el-table-column>
-        <el-table-column prop="value4" align="center" label="4h   (40min)" min-width="80">
+        <el-table-column prop="Value4" align="center" label="4h   (40min)" min-width="80">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Value4" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Value4" style="width: 100%" size="mini">
+            </el-input>
           </template>
         </el-table-column>
-        <el-table-column prop="value5" align="center" label="5h   (50min)" min-width="80">
+        <el-table-column prop="Value5" align="center" label="5h   (50min)" min-width="80">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Value5" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Value5" style="width: 100%" size="mini">
+            </el-input>
           </template>
         </el-table-column>
-        <el-table-column prop="value6" align="center" label="6h   (60min)" min-width="80">
+        <el-table-column prop="Value6" align="center" label="6h   (60min)" min-width="80">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Value6" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Value6" style="width: 100%" size="mini">
+            </el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" prop="ZeroValue" label="零点漂移 ×10-6 mol/mol" min-width="150">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.ZeroValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.ZeroValue" style="width: 100%" size="mini">
+            </el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" prop="ShowValue" label="示值漂移 ×10-6 mol/mol" min-width="150">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.ShowValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.ShowValue" style="width: 100%" size="mini">
+            </el-input>
           </template>
         </el-table-column>
       </el-table>
       <template>
         <div style="text-align: center; margin-top: 15px;">
-          <el-button type="primary" size="small" @click="saveEntity"><i class="el-icon-circle-check"></i>
+          <el-button type="primary" size="small" @click="saveEntity" :disabled="this.DataStatus != 0 && this.DataStatus != 5&& this.DataStatus!=3"><i class="el-icon-circle-check"></i>
             保存
           </el-button>
         </div>
@@ -459,7 +493,7 @@
         ProoFreadShow: false,
         acceptUsers: [],
         serviceId: '',
-        DataStatus: '0',
+        DataStatus: 0,
         sign: '2',
         // 校核提交
         shenhesubmitForm: {
@@ -481,7 +515,7 @@
           MeterRange: '',
           DataEntryCode: '',
           MeasurementRange: '',
-          DetectBasis: '',
+          DetectBasis: 'JJG 695-2003《硫化氢气体检测仪》检定规程',
           FaceCheck: '',
           FlagCheck: '',
           ElectrifyCheck: '',
@@ -494,7 +528,7 @@
           TestDepartId: 0,
           Instrument1: '',
           Temperature: '',
-          StandardDesc: '',
+          StandardDesc: '硫化氢气体检测仪检定装置',
           StanDevice: '',
           RelativeHumanity: '',
           ManuCompany: '',
@@ -585,7 +619,7 @@
         //示值误差及响应时间
         deviationData: [{
           Id: 0,
-          GasValue: '',
+          GasValue: 20.8,
           Value1: '',
           Value2: '',
           Value3: '',
@@ -595,7 +629,7 @@
           Deviation: ''
         }, {
           Id: 0,
-          GasValue: '',
+          GasValue: 52.6,
           Value1: '',
           Value2: '',
           Value3: '',
@@ -605,7 +639,7 @@
           Deviation: ''
         }, {
           Id: 0,
-          GasValue: '',
+          GasValue: 82.1,
           Value1: '',
           Value2: '',
           Value3: '',
@@ -626,7 +660,7 @@
         //重复性
         RepeatData: [{
           Id: 0,
-          GasValue: '',
+          GasValue: 52.6,
           Value1: '',
           Value2: '',
           Value3: '',
@@ -640,7 +674,7 @@
         ShiftData: [{
           Id: 0,
           ValueType: '零点示值',
-          value0: '',
+          Value0: '',
           Value1: '',
           Value2: '',
           Value3: '',
@@ -652,7 +686,7 @@
         }, {
           Id: 0,
           ValueType: '量程示值',
-          value0: '',
+          Value0: '',
           Value1: '',
           Value2: '',
           Value3: '',
@@ -678,26 +712,37 @@
       this.formData.DataEntryId = this.queryParams.DataEntryId
       this.formData.TaskBalanceId = this.queryParams.TaskBalanceId
       this.formData.EId = this.queryParams.EId
-      console.log("--this.$route.query.tbid--",this.formData.TaskBalanceId)
       this.initDatas();
       this.getUsersByRole()
-      //this.getDictOptions();
-      // if (this.serviceId != 'add' && this.serviceId > 0) {
-      //   this.formData.Id = this.serviceId;
-      //   this.initDatas();
-      // } else {
-      //   this.formData.Id = 0;
-      // }
     },
     methods: {
       initDatas() {
         if (this.formData.DataEntryId) {
           api.getEntity(this.formData.DataEntryId, this.$axios).then(res => {
             this.formData = res.data.mainitem;
-            console.log("----this.formData----",this.formData)
-            if (this.formData.CheckDate == "0001-01-01T00:00:00Z"){
+            this.formData.DetectBasis = 'JJG 693-2011《 可燃气体检测报警器》检定规程'
+            this.formData.StandardDesc = '可燃气体检测报警器检定装置'
+            if (this.formData.CheckDate == "0001-01-01T00:00:00Z") {
               this.formData.CheckDate = new Date();
             }
+            if (res.data.ceritem != null) {
+              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
+                this.certificateData[i].Id = res.data.ceritem[i].Id;
+                this.certificateData[i].CerNum = res.data.ceritem[i].CerNum;
+                this.certificateData[i].StandVal = res.data.ceritem[i].StandVal;
+                this.certificateData[i].Uncertainty = res.data.ceritem[i].Uncertainty;
+                this.certificateData[i].EffectDate = res.data.ceritem[i].EffectDate;
+                this.certificateData[i].StanDevice = res.data.ceritem[i].StanDevice;
+
+              }
+              this.formCertificateData.Id = res.data.ceritem[3].Id
+              this.formCertificateData.StanDevice = res.data.ceritem[3].StanDevice
+              this.formCertificateData.StandVal = res.data.ceritem[3].StandVal
+              this.formCertificateData.CerNum = res.data.ceritem[3].CerNum
+              this.formCertificateData.Uncertainty = res.data.ceritem[3].Uncertainty
+              this.formCertificateData.EffectDate = res.data.ceritem[3].EffectDate
+              this.formData.StanDevice = this.certificateData[0].StanDevice
+            }
             if (res.data.alvalitem != null) {
               for (var i = 0; i < res.data.alvalitem.length; i++) {
                 this.alerValData[i] = res.data.alvalitem[i];
@@ -706,7 +751,6 @@
             if (res.data.deviitem != null) {
               for (var i = 0; i < res.data.deviitem.length; i++) {
                 this.deviationData[i].Id = res.data.deviitem[i].Id;
-                this.deviationData[i].GasValue = res.data.deviitem[i].GasValue;
                 this.deviationData[i].Value1 = res.data.deviitem[i].Value1;
                 this.deviationData[i].Value2 = res.data.deviitem[i].Value2;
                 this.deviationData[i].Value3 = res.data.deviitem[i].Value3;
@@ -724,28 +768,25 @@
             if (res.data.repeatitem != null) {
               for (var i = 0; i < res.data.repeatitem.length; i++) {
                 this.RepeatData[i] = res.data.repeatitem[i];
+                this.RepeatData[i].AvgValue = res.data.repeatitem[i].AvgValue + ""
+                this.deviationData[i].RepeatValue = res.data.deviitem[i].RepeatValue;
               }
             }
             if (res.data.shiftitem != null) {
               for (var i = 0; i < res.data.shiftitem.length; i++) {
-                this.ShiftData[i].ValueType = res.data.shiftitem[i].ValueType;
-                this.ShiftData[i].value0 = res.data.shiftitem[i].value0;
-                this.ShiftData[i].Value1 = res.data.shiftitem[i].Value1;
-                this.ShiftData[i].Value2 = res.data.shiftitem[i].Value2;
-                this.ShiftData[i].Value3 = res.data.shiftitem[i].Value3;
-                this.ShiftData[i].Value4 = res.data.shiftitem[i].Value4;
-                this.ShiftData[i].Value5 = res.data.shiftitem[i].Value5;
-                this.ShiftData[i].Value6 = res.data.shiftitem[i].Value6;
-                this.ShiftData[i].ZeroValue = res.data.shiftitem[i].ZeroValue;
-                this.ShiftData[i].ShowValue = res.data.shiftitem[i].ShowValue;
-              }
-            }
-            if (res.data.ceritem != null) {
-              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
-                this.certificateData[i] = res.data.ceritem[i];
+                this.ShiftData[i] = res.data.shiftitem[i];
+                // this.ShiftData[i].Value0 = res.data.shiftitem[i].Value0;
+                // this.ShiftData[i].Value1 = res.data.shiftitem[i].Value1;
+                // this.ShiftData[i].Value2 = res.data.shiftitem[i].Value2;
+                // this.ShiftData[i].Value3 = res.data.shiftitem[i].Value3;
+                // this.ShiftData[i].Value4 = res.data.shiftitem[i].Value4;
+                // this.ShiftData[i].Value5 = res.data.shiftitem[i].Value5;
+                // this.ShiftData[i].Value6 = res.data.shiftitem[i].Value6;
+                // this.ShiftData[i].ZeroValue = res.data.shiftitem[i].ZeroValue;
+                // this.ShiftData[i].ShowValue = res.data.shiftitem[i].ShowValue;
               }
-              this.formCertificateData = res.data.ceritem[3]
             }
+            
           }).catch(err => {
             console.error(err)
           });
@@ -802,10 +843,15 @@
           sum = sum + parseInt(row.Value3)
         }
         if (divisor !== 0) {
-          row.AvgValue = (sum / divisor).toFixed(2)
+          row.AvgValue = (sum / divisor).toFixed(1)
         } else {
           row.AvgValue = '0'
         }
+        if (row.AvgValue !== '' && parseInt(row.AvgValue) !== 0) {
+          row.Deviation = Number((row.AvgValue - row.GasValue).toFixed(1))
+        } else {
+          row.Deviation = 0
+        }
       },
       getRepeValueAvg(row) {
         var divisor = 0
@@ -835,13 +881,32 @@
           sum = sum + parseInt(row.Value6)
         }
         if (divisor !== 0) {
-          row.AvgValue = (sum / divisor).toFixed(2)
+          row.AvgValue = (sum / divisor).toFixed(1)
         } else {
           row.AvgValue = '0'
         }
+        if (row.AvgValue !== '' && parseInt(row.AvgValue) !== 0 &&
+          row.Value1 !== '' && parseInt(row.Value1) !== 0 &&
+          row.Value2 !== '' && parseInt(row.Value2) !== 0 &&
+          row.Value3 !== '' && parseInt(row.Value3) !== 0 &&
+          row.Value4 !== '' && parseInt(row.Value4) !== 0 &&
+          row.Value5 !== '' && parseInt(row.Value5) !== 0 &&
+          row.Value6 !== '' && parseInt(row.Value6) !== 0) {
+          var v1 = (row.AvgValue - row.Value1).toFixed(1)
+          var v2 = (row.AvgValue - row.Value2).toFixed(1)
+          var v3 = (row.AvgValue - row.Value3).toFixed(1)
+          var v4 = (row.AvgValue - row.Value4).toFixed(1)
+          var v5 = (row.AvgValue - row.Value5).toFixed(1)
+          var v6 = (row.AvgValue - row.Value6).toFixed(1)
+          var sumsq = v1 * v1 + v2 * v2 + v3 * v3 + v4 * v4 + v5 * v5 + v6 * v6
+          var sqthen = Math.sqrt(sumsq / 5)
+          row.RepeatValue = Number((sqthen / row.AvgValue * 100).toFixed(1))
+        }else{
+          row.RepeatValue = 0
+        }
       },
       setProoFreadShow() {
-          this.ProoFreadShow = true
+        this.ProoFreadShow = true
       },
       // 提交校核
       makesure() {
@@ -859,7 +924,7 @@
       },
       // 添加运行记录
       addRunRecord() {
-        this.$axios.post('/limsZuhq/addRunRecord/' + this.formData.DataEntryId,).then(res => {
+        this.$axios.post('/limsZuhq/addRunRecord/' + this.formData.DataEntryId, ).then(res => {
 
         }).catch(error => {
           console.log(error)
@@ -895,7 +960,6 @@
 
       //保存信息
       saveEntity() {
-        console.log("------this.formData.Id----", this.formData.Id)
         this.$refs['formData'].validate((valid) => {
           if (valid) {
             if (!this.formData.Id) {
@@ -911,37 +975,11 @@
       },
       //添加数据
       addEntityMain() {
-        console.log("-------this.formdata---", this.formData)
         if (this.certificateData != null) {
           for (var i = 0; i < this.certificateData.length; i++) {
             this.certificateData[i].StanDevice = this.formData.StanDevice
           }
         }
-        this.deviationData.AvgValue = this.deviationData.AvgValue + ""
-        this.RepeatData.AvgValue = this.RepeatData.AvgValue + ""
-        // this.alerValData.AllowValue = parseInt(this.alerValData.AllowValue)
-        // this.alerValData.MaxValue = parseInt(this.alerValData.MaxValue)
-        // this.alerValData.Value1 = parseInt(this.alerValData.Value1)
-        // this.alerValData.Value2 = parseInt(this.alerValData.Value2)
-        // this.alerValData.Value3 = parseInt(this.alerValData.Value3)
-        // this.deviationData.GasValue = parseInt(this.deviationData.GasValue)
-        // this.deviationData.Deviation = parseInt(this.deviationData.Deviation)
-        // this.responseTimeData.GasValue = parseInt(this.responseTimeData.GasValue)
-        // this.responseTimeData.Value1 = parseInt(this.responseTimeData.Value1)
-        // this.responseTimeData.Value2 = parseInt(this.responseTimeData.Value2)
-        // this.responseTimeData.Value3 = parseInt(this.responseTimeData.Value3)
-        // this.responseTimeData.Deviation = parseInt(this.responseTimeData.Deviation)
-        // this.RepeatData.GasValue = parseInt(this.RepeatData.GasValue)
-        // this.RepeatData.RepeatValue = parseInt(this.RepeatData.RepeatValue)
-        // this.ShiftData.Value0 = parseInt(this.ShiftData.Value0)
-        // this.ShiftData.Value1 = parseInt(this.ShiftData.Value1)
-        // this.ShiftData.Value2 = parseInt(this.ShiftData.Value2)
-        // this.ShiftData.Value3 = parseInt(this.ShiftData.Value3)
-        // this.ShiftData.Value4 = parseInt(this.ShiftData.Value4)
-        // this.ShiftData.Value5 = parseInt(this.ShiftData.Value5)
-        // this.ShiftData.Value6 = parseInt(this.ShiftData.Value6)
-        // this.ShiftData.ZeroValue = parseInt(this.ShiftData.ZeroValue)
-        // this.ShiftData.ShowValue = parseInt(this.ShiftData.ShowValue)
         let allform = {
           BenMainform: this.formData,
           CertiArrayList: this.certificateData, //添加证书数据
@@ -952,7 +990,6 @@
           ShiftArrayList: this.ShiftData, //添加漂移数据
         }
         allform = Object.assign(allform, this.formCertificateData)
-        console.log("---------allform", allform)
         api.addEntity(allform, this.$axios).then(res => {
           if (res.data.code === 0) {
             //保存成功后,初始化数据,变成修改
@@ -975,45 +1012,11 @@
 
 
       updateEntity() {
-        console.log("------updatethis.formData.Id----", this.formData.Id)
         if (this.certificateData != null) {
           for (var i = 0; i < this.certificateData.length; i++) {
             this.certificateData[i].StanDevice = this.formData.StanDevice
           }
         }
-        // if (this.alerValData != null) {
-        //   this.alerValData.AllowValue = parseInt(this.alerValData.AllowValue)
-        //   this.alerValData.MaxValue = parseInt(this.alerValData.MaxValue)
-        //   this.alerValData.Value1 = parseInt(this.alerValData.Value1)
-        //   this.alerValData.Value2 = parseInt(this.alerValData.Value2)
-        //   this.alerValData.Value3 = parseInt(this.alerValData.Value3)
-        // }
-        // if (this.deviationData != null) {
-        //   this.deviationData.GasValue = parseInt(this.deviationData.GasValue)
-        //   this.deviationData.Deviation = parseInt(this.deviationData.Deviation)
-        // }
-
-        // if (this.responseTimeData != null) {
-        //   this.responseTimeData.GasValue = parseInt(this.responseTimeData.GasValue)
-        //   this.responseTimeData.Value1 = parseInt(this.responseTimeData.Value1)
-        //   this.responseTimeData.Value2 = parseInt(this.responseTimeData.Value2)
-        //   this.responseTimeData.Value3 = parseInt(this.responseTimeData.Value3)
-        //   this.responseTimeData.Deviation = parseInt(this.responseTimeData.Deviation)
-        // }
-        // if (this.RepeatData != null) {
-        //   this.RepeatData.GasValue = parseInt(this.RepeatData.GasValue)
-        //   this.RepeatData.RepeatValue = parseInt(this.RepeatData.RepeatValue)
-        // }
-        // if (this.ShiftData != null) {
-        //   this.ShiftData.Value1 = parseInt(this.ShiftData.Value1)
-        //   this.ShiftData.Value2 = parseInt(this.ShiftData.Value2)
-        //   this.ShiftData.Value3 = parseInt(this.ShiftData.Value3)
-        //   this.ShiftData.Value4 = parseInt(this.ShiftData.Value4)
-        //   this.ShiftData.Value5 = parseInt(this.ShiftData.Value5)
-        //   this.ShiftData.Value6 = parseInt(this.ShiftData.Value6)
-        //   this.ShiftData.ZeroValue = parseInt(this.ShiftData.ZeroValue)
-        //   this.ShiftData.ShowValue = parseInt(this.ShiftData.ShowValue)
-        // }
         let allform = {
           BenMainform: this.formData,
           CertiArrayList: this.certificateData, //添加证书数据

+ 88 - 93
src/dashoo.cn/frontend_web/src/pages/lims/reportdetectorelectoxygen/_opera/operation.vue

@@ -87,7 +87,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="标准器名称:">
-              <el-input v-model="formData.ElectrifyCheck" placeholder="请输入" style="width: 100%"></el-input>
+              <el-input v-model="formData.StanDevice" placeholder="请输入" style="width: 100%"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -182,34 +182,34 @@
       <el-table :data="deviationData" border style="width: 100%">
         <el-table-column align="center" prop="GasValue" label="标准气体浓度值(%)" width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.GasValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.GasValue" style="width: 100%" size="mini" :disabled="true"></el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" label="仪器示值(%)" min-width="180">
           <el-table-column align="center" prop="Value1" label="1">
             <template slot-scope="scope">
-              <el-input @blur="getDeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value1" style="width: 100%" size="mini"></el-input>
+              <el-input @blur="getDeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value1" style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value2" label="2">
             <template slot-scope="scope">
-              <el-input @blur="getDeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value2" style="width: 100%" size="mini"></el-input>
+              <el-input @blur="getDeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value2" style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value3" label="3">
             <template slot-scope="scope">
-              <el-input @blur="getDeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value3" style="width: 100%" size="mini"></el-input>
+              <el-input @blur="getDeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value3" style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="AvgValue" label="平均值">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini" :disabled="true"></el-input>
             </template>
           </el-table-column>
         </el-table-column>
         <el-table-column align="center" prop="Deviation" label="示值引用误差  (%FS)" min-width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Deviation" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Deviation" style="width: 100%" size="mini" :disabled="true"></el-input>
           </template>
         </el-table-column>
       </el-table>
@@ -222,28 +222,28 @@
       <el-table :data="responseTimeData" border style="width: 100%">
         <el-table-column align="center" prop="GasValue" label="标准气体浓度值(%)" width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.GasValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.GasValue" style="width: 100%" size="mini"></el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" label="时间(S)" min-width="180">
           <el-table-column align="center" prop="Value1" label="1">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.Value1" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.Value1" style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value2" label="2">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.Value2" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.Value2" style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value3" label="3">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.Value3" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.Value3" style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Deviation" label="响应时间">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.Deviation" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.Deviation" style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
         </el-table-column>
@@ -257,49 +257,49 @@
       <el-table :data="RepeatData" border style="width: 100%">
         <el-table-column align="center" prop="GasValue" label="标准气体浓度值(%)" width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.GasValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.GasValue" style="width: 100%" size="mini" :disabled="true"></el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" prop="name" label="仪器示值(%)" min-width="180">
           <el-table-column align="center" prop="Value1" label="1">
             <template slot-scope="scope">
-              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value1" style="width: 100%" size="mini"></el-input>
+              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value1" style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value2" label="2">
             <template slot-scope="scope">
-              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value2" style="width: 100%" size="mini"></el-input>
+              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value2" style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value3" label="3">
             <template slot-scope="scope">
-              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value3" style="width: 100%" size="mini"></el-input>
+              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value3" style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value4" label="4">
             <template slot-scope="scope">
-              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value4" style="width: 100%" size="mini"></el-input>
+              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value4" style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value5" label="5">
             <template slot-scope="scope">
-              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value5" style="width: 100%" size="mini"></el-input>
+              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value5" style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="Value6" label="6">
             <template slot-scope="scope">
-              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.01" v-model.number="scope.row.Value6" style="width: 100%" size="mini"></el-input>
+              <el-input @blur="getRepeValueAvg(scope.row)" type="number" step="0.1" v-model.number="scope.row.Value6" style="width: 100%" size="mini"></el-input>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="AvgValue" label="平均值">
             <template slot-scope="scope">
-              <el-input type="number" step="0.01" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini"></el-input>
+              <el-input type="number" step="0.1" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini" :disabled="true"></el-input>
             </template>
           </el-table-column>
         </el-table-column>
         <el-table-column align="center" prop="RepeatValue" label="重复性(%)" min-width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.RepeatValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.RepeatValue" style="width: 100%" size="mini" :disabled="true"></el-input>
           </template>
         </el-table-column>
       </el-table>
@@ -312,45 +312,45 @@
       <el-table :data="ShiftData" border style="width: 100%">
         <el-table-column align="center" prop="ValueType" label="时间">
         </el-table-column>
-        <el-table-column prop="value0" align="center" label="0">
+        <el-table-column prop="Value0" align="center" label="0">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Value0" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Value0" style="width: 100%" size="mini"></el-input>
           </template>
         </el-table-column>
-        <el-table-column prop="value1" align="center" label="1h   (15min)" min-width="90">
+        <el-table-column prop="Value1" align="center" label="1h   (15min)" min-width="90">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Value1" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Value1" style="width: 100%" size="mini"></el-input>
           </template>
         </el-table-column>
-        <el-table-column prop="value2" align="center" label="2h   (30min)" min-width="90">
+        <el-table-column prop="Value2" align="center" label="2h   (30min)" min-width="90">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Value2" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Value2" style="width: 100%" size="mini"></el-input>
           </template>
         </el-table-column>
-        <el-table-column prop="value3" align="center" label="3h   (45min)" min-width="90">
+        <el-table-column prop="Value3" align="center" label="3h   (45min)" min-width="90">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Value3" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Value3" style="width: 100%" size="mini"></el-input>
           </template>
         </el-table-column>
-        <el-table-column prop="value4" align="center" label="4h   (60min)" min-width="90">
+        <el-table-column prop="Value4" align="center" label="4h   (60min)" min-width="90">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.Value4" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.Value4" style="width: 100%" size="mini"></el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" prop="ZeroValue" label="零点漂移(%FS)" min-width="170">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.ZeroValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.ZeroValue" style="width: 100%" size="mini"></el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" prop="ShowValue" label="量程漂移(%FS)" min-width="130">
           <template slot-scope="scope">
-            <el-input type="number" step="0.01" v-model.number="scope.row.ShowValue" style="width: 100%" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.ShowValue" style="width: 100%" size="mini"></el-input>
           </template>
         </el-table-column>
       </el-table>
       <template>
         <div style="text-align: center; margin-top: 15px;">
-          <el-button type="primary" size="small" @click="saveEntity"><i class="el-icon-circle-check"></i>
+          <el-button type="primary" size="small" @click="saveEntity" :disabled="DataStatus != 0 && DataStatus != 5&& DataStatus!=3"><i class="el-icon-circle-check"></i>
             保存
           </el-button>
         </div>
@@ -421,7 +421,7 @@
           MeterRange: '',
           DataEntryCode: '',
           MeasurementRange: '',
-          DetectBasis: '',
+          DetectBasis: 'JJG 365-2008《 电化学氧测定仪》检定规程',
           FaceCheck: '',
           FlagCheck: '',
           ElectrifyCheck: '',
@@ -434,7 +434,7 @@
           TestDepartId: 0,
           Instrument1: '',
           Temperature: '',
-          StandardDesc: '',
+          StandardDesc: '电化学氧测定仪检定装置',
           StanDevice: '',
           RelativeHumanity: '',
           ManuCompany: '',
@@ -518,7 +518,7 @@
         }],
         //示值误差及响应时间
         deviationData: [{
-          GasValue: '',
+          GasValue: 5.13,
           Value1: '',
           Value2: '',
           Value3: '',
@@ -527,7 +527,7 @@
           DeviationRelative: '0',
           Deviation: ''
         }, {
-          GasValue: '',
+          GasValue: 12.7,
           Value1: '',
           Value2: '',
           Value3: '',
@@ -536,7 +536,7 @@
           DeviationRelative: '0',
           Deviation: ''
         }, {
-          GasValue: '',
+          GasValue: 20.05,
           Value1: '',
           Value2: '',
           Value3: '',
@@ -561,19 +561,8 @@
           Deviation: ''
         }],
         //重复性
-        RepeatForm: {
-          GasValue: '',
-          Value1: '',
-          Value2: '',
-          Value3: '',
-          Value4: '',
-          Value5: '',
-          Value6: '',
-          AvgValue: '',
-          RepeatValue: ''
-        },
         RepeatData: [{
-          GasValue: '',
+          GasValue: 12.7,
           Value1: '',
           Value2: '',
           Value3: '',
@@ -639,9 +628,29 @@
           api.getEntity(this.formData.DataEntryId, this.$axios).then(res => {
             console.log("------res------", res.data)
             this.formData = res.data.mainitem;
+            this.formData.DetectBasis = 'JJG 365-2008《 电化学氧测定仪》检定规程'
+            this.formData.StandardDesc = '电化学氧测定仪检定装置'
             if (this.formData.CheckDate == "0001-01-01T00:00:00Z"){
               this.formData.CheckDate = new Date();
             }
+            if (res.data.ceritem != null) {
+              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
+                this.certificateData[i].Id = res.data.ceritem[i].Id;
+                this.certificateData[i].CerNum = res.data.ceritem[i].CerNum;
+                this.certificateData[i].StandVal = res.data.ceritem[i].StandVal;
+                this.certificateData[i].Uncertainty = res.data.ceritem[i].Uncertainty;
+                this.certificateData[i].EffectDate = res.data.ceritem[i].EffectDate;
+                this.certificateData[i].StanDevice = res.data.ceritem[i].StanDevice;
+
+              }
+              this.formCertificateData.Id = res.data.ceritem[3].Id
+              this.formCertificateData.StanDevice = res.data.ceritem[3].StanDevice
+              this.formCertificateData.StandVal = res.data.ceritem[3].StandVal
+              this.formCertificateData.CerNum = res.data.ceritem[3].CerNum
+              this.formCertificateData.Uncertainty = res.data.ceritem[3].Uncertainty
+              this.formCertificateData.EffectDate = res.data.ceritem[3].EffectDate
+              this.formData.StanDevice = this.certificateData[0].StanDevice
+            }
             if (res.data.deviitem != null) {
               for (var i = 0; i < res.data.deviitem.length; i++) {
                 this.deviationData[i].Id = res.data.deviitem[i].Id;
@@ -663,12 +672,14 @@
             if (res.data.repeatitem != null) {
               for (var i = 0; i < res.data.repeatitem.length; i++) {
                 this.RepeatData[i] = res.data.repeatitem[i];
+                this.RepeatData[i].AvgValue = res.data.repeatitem[i].AvgValue + ""
+                this.deviationData[i].RepeatValue = res.data.deviitem[i].RepeatValue;
               }
             }
             if (res.data.shiftitem != null) {
               for (var i = 0; i < res.data.shiftitem.length; i++) {
-                this.ShiftData[i].ValueType = res.data.shiftitem[i].ValueType;
-                this.ShiftData[i].value0 = res.data.shiftitem[i].value0;
+                this.ShiftData[i].Id = res.data.shiftitem[i].Id;
+                this.ShiftData[i].Value0 = res.data.shiftitem[i].Value0;
                 this.ShiftData[i].Value1 = res.data.shiftitem[i].Value1;
                 this.ShiftData[i].Value2 = res.data.shiftitem[i].Value2;
                 this.ShiftData[i].Value3 = res.data.shiftitem[i].Value3;
@@ -679,12 +690,6 @@
                 this.ShiftData[i].ShowValue = res.data.shiftitem[i].ShowValue;
               }
             }
-            if (res.data.ceritem != null) {
-              for (var i = 0; i < res.data.ceritem.length - 1; i++) {
-                this.certificateData[i] = res.data.ceritem[i];
-              }
-              this.formCertificateData = res.data.ceritem[3]
-            }
           }).catch(err => {
             console.error(err)
           });
@@ -733,6 +738,11 @@
         } else {
           row.AvgValue = '0'
         }
+        if (row.AvgValue !== '' && parseInt(row.AvgValue) !== 0) {
+          row.Deviation = Number((row.AvgValue - row.GasValue).toFixed(1))
+        } else {
+          row.Deviation = 0
+        }
       },
       getRepeValueAvg(row) {
         var divisor = 0
@@ -766,6 +776,25 @@
         } else {
           row.AvgValue = '0'
         }
+        if (row.AvgValue !== '' && parseInt(row.AvgValue) !== 0 &&
+          row.Value1 !== '' && parseInt(row.Value1) !== 0 &&
+          row.Value2 !== '' && parseInt(row.Value2) !== 0 &&
+          row.Value3 !== '' && parseInt(row.Value3) !== 0 &&
+          row.Value4 !== '' && parseInt(row.Value4) !== 0 &&
+          row.Value5 !== '' && parseInt(row.Value5) !== 0 &&
+          row.Value6 !== '' && parseInt(row.Value6) !== 0) {
+          var v1 = (row.AvgValue - row.Value1).toFixed(1)
+          var v2 = (row.AvgValue - row.Value2).toFixed(1)
+          var v3 = (row.AvgValue - row.Value3).toFixed(1)
+          var v4 = (row.AvgValue - row.Value4).toFixed(1)
+          var v5 = (row.AvgValue - row.Value5).toFixed(1)
+          var v6 = (row.AvgValue - row.Value6).toFixed(1)
+          var sumsq = v1 * v1 + v2 * v2 + v3 * v3 + v4 * v4 + v5 * v5 + v6 * v6
+          var sqthen = Math.sqrt(sumsq / 5)
+          row.RepeatValue = Number((sqthen / row.AvgValue * 100).toFixed(1))
+        }else{
+          row.RepeatValue = 0
+        }
       },
       setProoFreadShow() {
           this.ProoFreadShow = true
@@ -842,24 +871,6 @@
         for (var i = 0; i < this.certificateData.length; i++) {
           this.certificateData[i].StanDevice = this.formData.StanDevice
         }
-        this.deviationData.AvgValue = this.deviationData.AvgValue+""
-        this.RepeatData.AvgValue = this.RepeatData.AvgValue + ""
-        // this.deviationData.GasValue = parseInt(this.deviationData.GasValue)
-        // this.deviationData.Deviation = parseInt(this.deviationData.Deviation)
-        // this.responseTimeData.GasValue = parseInt(this.responseTimeData.GasValue)
-        // this.responseTimeData.Value1 = parseInt(this.responseTimeData.Value1)
-        // this.responseTimeData.Value2 = parseInt(this.responseTimeData.Value2)
-        // this.responseTimeData.Value3 = parseInt(this.responseTimeData.Value3)
-        // this.responseTimeData.Deviation = parseInt(this.responseTimeData.Deviation)
-        // this.RepeatData.GasValue = parseInt(this.RepeatData.GasValue)
-        // this.RepeatData.RepeatValue = parseInt(this.RepeatData.RepeatValue)
-        // this.ShiftData.Value0 = parseInt(this.ShiftData.Value0)
-        // this.ShiftData.Value1 = parseInt(this.ShiftData.Value1)
-        // this.ShiftData.Value2 = parseInt(this.ShiftData.Value2)
-        // this.ShiftData.Value3 = parseInt(this.ShiftData.Value3)
-        // this.ShiftData.Value4 = parseInt(this.ShiftData.Value4)
-        // this.ShiftData.ZeroValue = parseInt(this.ShiftData.ZeroValue)
-        // this.ShiftData.ShowValue = parseInt(this.ShiftData.ShowValue)
         let allform = {
           BenMainform: this.formData,
           CertiArrayList: this.certificateData, //添加证书数据
@@ -896,22 +907,6 @@
         for (var i = 0; i < this.certificateData.length; i++) {
           this.certificateData[i].StanDevice = this.formData.StanDevice
         }
-        // this.deviationData.GasValue = parseInt(this.deviationData.GasValue)
-        // this.deviationData.Deviation = parseInt(this.deviationData.Deviation)
-        // this.responseTimeData.GasValue = parseInt(this.responseTimeData.GasValue)
-        // this.responseTimeData.Value1 = parseInt(this.responseTimeData.Value1)
-        // this.responseTimeData.Value2 = parseInt(this.responseTimeData.Value2)
-        // this.responseTimeData.Value3 = parseInt(this.responseTimeData.Value3)
-        // this.responseTimeData.Deviation = parseInt(this.responseTimeData.Deviation)
-        // this.RepeatData.GasValue = parseInt(this.RepeatData.GasValue)
-        // this.RepeatData.RepeatValue = parseInt(this.RepeatData.RepeatValue)
-        // this.ShiftData.Value0 = parseInt(this.ShiftData.Value0)
-        // this.ShiftData.Value1 = parseInt(this.ShiftData.Value1)
-        // this.ShiftData.Value2 = parseInt(this.ShiftData.Value2)
-        // this.ShiftData.Value3 = parseInt(this.ShiftData.Value3)
-        // this.ShiftData.Value4 = parseInt(this.ShiftData.Value4)
-        // this.ShiftData.ZeroValue = parseInt(this.ShiftData.ZeroValue)
-        // this.ShiftData.ShowValue = parseInt(this.ShiftData.ShowValue)
         let allform = {
           BenMainform: this.formData,
           CertiArrayList: this.certificateData, //添加证书数据