3
2
Ver Fonte

仪器关联证书

huahaiyan há 6 anos atrás
pai
commit
a92e817a29
25 ficheiros alterados com 1147 adições e 148 exclusões
  1. 18 1
      src/dashoo.cn/backend/api/business/instrument/instrument.go
  2. 2 1
      src/dashoo.cn/backend/api/controllers/base.go
  3. 225 0
      src/dashoo.cn/backend/api/controllers/instrument/instrument.go
  4. 5 5
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportalercarbon.go
  5. 5 5
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportalerfhgas.go
  6. 6 6
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportalerkrgas.go
  7. 5 5
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportanal1carbonredgas.go
  8. 5 5
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportanal2carbonredgas.go
  9. 6 6
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportben.go
  10. 5 5
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportdetHSgas.go
  11. 5 5
      src/dashoo.cn/backend/api/controllers/limsmetering/limsreportdetelectoxygen.go
  12. 1 0
      src/dashoo.cn/frontend_web/nuxt.config.ignore.js
  13. 48 0
      src/dashoo.cn/frontend_web/src/api/system/instrument.js
  14. 1 1
      src/dashoo.cn/frontend_web/src/layouts/default.vue
  15. 5 5
      src/dashoo.cn/frontend_web/src/pages/instrument/_opera/instrumentedit.vue
  16. 216 10
      src/dashoo.cn/frontend_web/src/pages/instrument/index.vue
  17. 85 23
      src/dashoo.cn/frontend_web/src/pages/instrument/instrumentadd.vue
  18. 1 1
      src/dashoo.cn/frontend_web/src/pages/lims/reportalertorbendetect/_opera/operation.vue
  19. 16 1
      src/dashoo.cn/frontend_web/src/pages/lims/reportalertorcarbondetect/_opera/operation.vue
  20. 16 1
      src/dashoo.cn/frontend_web/src/pages/lims/reportalertorfhgasdetect/_opera/operation.vue
  21. 232 52
      src/dashoo.cn/frontend_web/src/pages/lims/reportalertorkrgasdetect/_opera/operation.vue
  22. 18 1
      src/dashoo.cn/frontend_web/src/pages/lims/reportanalyzer1carbonredgas/_opera/operation.vue
  23. 16 1
      src/dashoo.cn/frontend_web/src/pages/lims/reportanalyzer2carbonredgas/_opera/operation.vue
  24. 99 4
      src/dashoo.cn/frontend_web/src/pages/lims/reportdetectorHSgas/_opera/operation.vue
  25. 106 4
      src/dashoo.cn/frontend_web/src/pages/lims/reportdetectorelectoxygen/_opera/operation.vue

+ 18 - 1
src/dashoo.cn/backend/api/business/instrument/instrument.go

@@ -31,7 +31,7 @@ type Instrumenstate struct {
 	Id             int       `xorm:"not null pk autoincr INT(10)"`
 	Code           string    `xorm:"VARCHAR(50)"`      //设备编码
 	UpdatedTime    time.Time `xorm:"DATETIME updated"` //上报时间 time.Time
-	ReportTime     int64                               //上报时间 int64
+	ReportTime     int64     //上报时间 int64
 	ServiceTime    time.Time `xorm:"DATETIME created"` //服务器时间
 	CreateOn       time.Time `xorm:"DATETIME created"`
 	CreateUserId   int       `xorm:"INT(10)"`
@@ -116,3 +116,20 @@ type LimsInstrumentGroup struct {
 	ModifiedBy     string    `xorm:"VARCHAR(50)"`
 	Remark         string    `xorm:"VARCHAR(50)"`
 }
+
+type LimsCertificate struct {
+	Id             int       `xorm:"not null pk autoincr INT(10)"`
+	InstrumentNo   int       `xorm:"not null default 0 comment('仪器编号') INT(10)"`
+	InstrumentName string    `xorm:"comment('仪器名称') VARCHAR(255)"`
+	CerNum         string    `xorm:"comment('证书编号') VARCHAR(255)"`
+	StandardUnit   string    `xorm:"comment('标准值') VARCHAR(255)"`
+	StandVal       string    `xorm:"comment('标准值') VARCHAR(255)"`
+	Uncertainty    string    `xorm:"comment('不确定度') VARCHAR(255)"`
+	EffectDate     time.Time `xorm:"comment('有效期') DATETIME"`
+	CreateOn       time.Time `xorm:"DATETIME"`
+	CreateUserId   int       `xorm:"INT(10)"`
+	CreateBy       string    `xorm:"VARCHAR(50)"`
+	ModifiedOn     time.Time `xorm:"DATETIME"`
+	ModifiedUserId int       `xorm:"INT(10)"`
+	ModifiedBy     string    `xorm:"VARCHAR(50)"`
+}

+ 2 - 1
src/dashoo.cn/backend/api/controllers/base.go

@@ -253,7 +253,8 @@ var (
 	LimsPipeDrillPipeName                    string = "LimsPipeDrillPipe"              //  石油专用管材钻杆检验记录
 	OilAuditSettingName                      string = "Base_OilAuditSetting"           // 单位审批步骤自定义配置
 	LimsReportDrillCollarName                string = "LimsReportDrillCollar"          //  石油专用管材钻铤检验记录
-	LimsPetroleUmPipeName                    string = "LimsReportPetroleumPipe"              //  石油专用管材方钻杆检验记录
+	LimsPetroleUmPipeName                    string = "LimsReportPetroleumPipe"        //  石油专用管材方钻杆检验记录
+	LimsCertificateName                      string = "LimsCertificate"                //  关联证书表
 )
 
 //分页信息及数据

+ 225 - 0
src/dashoo.cn/backend/api/controllers/instrument/instrument.go

@@ -141,6 +141,231 @@ func (this *InstrumentController) Addinstument() {
 	}
 }
 
+
+// @Title 获取列表
+// @Description get user by token
+// @Success 200 {object} []instrument.LimsCertificate
+// @router /cerlist/:id [get]
+func (this *InstrumentController) GetEntityList() {
+	//获取分页信息
+	page := this.GetPageInfoForm()
+	where := " 1=1 "
+	orderby := "Id"
+	asc := false
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		}
+	}
+	InstrumentNo := this.Ctx.Input.Param(":id")
+	if InstrumentNo != "" {
+		where = where + " and InstrumentNo = " + InstrumentNo
+	}
+
+	svc := instrument.GetInstrumentService(utils.DBE)
+	var list []instrument.LimsCertificate
+	total := svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	datainfo.PageIndex = page.CurrentPage
+	datainfo.ItemsPerPage = page.Size
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
+// @Title 获取实体  ---设备证书
+// @Description 获取实体
+// @Success 200 {object} instrument.LimsCertificate
+// @router /getcer/:id [get]
+func (this *InstrumentController) GetEntity() {
+	Id := this.Ctx.Input.Param(":id")
+
+	var model instrument.LimsCertificate
+	svc := instrument.GetInstrumentService(utils.DBE)
+	svc.GetEntityByIdBytbl(this.User.AccCode+LimsCertificateName, Id, &model)
+
+	this.Data["json"] = &model
+	this.ServeJSON()
+}
+
+// @Title 添加  ---设备证书
+// @Description 新增
+// @Param 	body body instrument.LimsCertificate
+// @Success	200	{object} controllers.Request
+// @router /addcer [post]
+func (this *InstrumentController) AddCerEntity() {
+	var model instrument.LimsCertificate
+	var jsonBlob = this.Ctx.Input.RequestBody
+	svc := instrument.GetInstrumentService(utils.DBE)
+
+	json.Unmarshal(jsonBlob, &model)
+	model.CreateOn = time.Now()
+	model.CreateBy = this.User.Realname
+	model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+	//model.OrganizeId, _ = utils.StrTo(this.User.DepartmentId).Int()
+
+	_, err := svc.InsertEntityBytbl(this.User.AccCode+LimsCertificateName, &model)
+
+	var errinfo ErrorDataInfo
+	if err == nil {
+		//新增
+		errinfo.Message = "添加成功!"
+		errinfo.Code = 0
+		errinfo.Item = model.Id
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "添加失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}
+
+// @Title 修改实体  ---设备证书
+// @Description 修改实体
+// @Param 	body body instrument.LimsCertificate
+// @Success	200	{object} controllers.Request
+// @router /updatecer/:id [post]
+func (this *InstrumentController) UpdateEntity() {
+	id := this.Ctx.Input.Param(":id")
+	var errinfo ErrorInfo
+	if id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+	var model instrument.LimsCertificate
+	svc := instrument.GetInstrumentService(utils.DBE)
+
+	var jsonBlob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonBlob, &model)
+	model.ModifiedOn = time.Now()
+	model.ModifiedBy = this.User.Realname
+	model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
+
+	cols := []string{
+
+		"Id",
+
+		"InstrumentNo",
+
+		"InstrumentName",
+
+		"CerNum",
+
+		"StandardUnit",
+
+		"StandVal",
+
+		"Uncertainty",
+
+		"EffectDate",
+
+		"CreateOn",
+
+		"CreateUserId",
+
+		"CreateBy",
+
+		"ModifiedOn",
+
+		"ModifiedUserId",
+
+		"ModifiedBy",
+
+
+	}
+	err := svc.UpdateEntityBytbl(this.User.AccCode+LimsCertificateName, id, &model, cols)
+	if err == nil {
+		errinfo.Message = "修改成功!"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "修改失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}
+
+// @Title 删除单条信息  ---设备证书
+// @Description
+// @Success 200 {object} ErrorInfo
+// @Failure 403 :id 为空
+// @router /deletecer/:Id [delete]
+func (this *InstrumentController) DeleteEntity() {
+	Id := this.Ctx.Input.Param(":Id")
+	var errinfo ErrorInfo
+	if Id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+	var model instrument.LimsCertificate
+	var entityempty instrument.LimsCertificate
+	svc := instrument.GetInstrumentService(utils.DBE)
+	opdesc := "删除-" + Id
+	err := svc.DeleteOperationAndWriteLogBytbl(this.User.AccCode+LimsCertificateName, BaseOperationLogName, Id, &model, &entityempty, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "钻井日报")
+	if err == nil {
+		errinfo.Message = "删除成功"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "删除失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}
+
+
+// @Title 删除信息  ---设备证书
+// @Description
+// @Success 200 {object} ErrorInfo
+// @Failure 403 :id 为空
+// @router /deletecerall/:Id [delete]
+func (this *InstrumentController) DeleteAllEntity() {
+	InstrumentNo := this.Ctx.Input.Param(":Id")
+	var errinfo ErrorInfo
+	if InstrumentNo == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+	var where string
+	if InstrumentNo != "" {
+		where = where + " InstrumentNo = " + InstrumentNo
+	}
+	svc := instrument.GetInstrumentService(utils.DBE)
+	err := svc.DeleteEntityBytbl(this.User.AccCode+LimsCertificateName,where)
+	if err == nil {
+		errinfo.Message = "删除成功"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "删除失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}
+
+
 // @Title 获取设备编辑信息
 // @Description
 // @Success 200

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

@@ -33,7 +33,7 @@ type LimsCarbonAllModel struct {
 	StandVal            string
 	StandardUnit        string
 	Uncertainty         string
-	InstrumentNo        string
+	InstrumentNo        int
 	EId                 int
 	TaskBalanceId       int
 }
@@ -145,7 +145,7 @@ func (this *LimsReportAlerCarbonController) AddCarbonEntity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 			cerentity.EId = model.EId
 			cerentity.TaskBalanceId = model.TaskBalanceId
@@ -164,7 +164,7 @@ func (this *LimsReportAlerCarbonController) AddCarbonEntity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 	cerentity2.EId = model.EId
 	cerentity2.TaskBalanceId = model.TaskBalanceId
@@ -391,7 +391,7 @@ func (this *LimsReportAlerCarbonController) UpdatecarbonEntity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 
 			if model.CertiArrayList[i].Id != 0 {
@@ -432,7 +432,7 @@ func (this *LimsReportAlerCarbonController) UpdatecarbonEntity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 
 	if model.Id != 0 {

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

@@ -33,7 +33,7 @@ type LimsFHAllModel struct {
 	StandVal            string
 	StandardUnit        string
 	Uncertainty         string
-	InstrumentNo        string
+	InstrumentNo        int
 	EId                 int
 	TaskBalanceId       int
 }
@@ -145,7 +145,7 @@ func (this *LimsReportAlerFHController) AddFHEntity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 			cerentity.EId = model.EId
 			cerentity.TaskBalanceId = model.TaskBalanceId
@@ -164,7 +164,7 @@ func (this *LimsReportAlerFHController) AddFHEntity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 	cerentity2.EId = model.EId
 	cerentity2.TaskBalanceId = model.TaskBalanceId
@@ -393,7 +393,7 @@ func (this *LimsReportAlerFHController) UpdatefhEntity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 
 			if model.CertiArrayList[i].Id != 0 {
@@ -432,7 +432,7 @@ func (this *LimsReportAlerFHController) UpdatefhEntity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 	if model.Id != 0 {
 		cerentity2.ModifiedOn = time.Now()

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

@@ -33,7 +33,7 @@ type LimsKRAllModel struct {
 	StandVal            string
 	StandardUnit        string
 	Uncertainty         string
-	InstrumentNo        string
+	InstrumentNo        int
 	EId                 int
 	TaskBalanceId       int
 }
@@ -147,7 +147,7 @@ func (this *LimsReportAlerKRController) AddKREntity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 			cerentity.EId = model.EId
 			cerentity.TaskBalanceId = model.TaskBalanceId
@@ -167,7 +167,7 @@ func (this *LimsReportAlerKRController) AddKREntity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 	cerentity2.EId = model.EId
 	cerentity2.TaskBalanceId = model.TaskBalanceId
@@ -395,7 +395,7 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 
 			if model.CertiArrayList[i].Id != 0 {
@@ -436,7 +436,7 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 
 	if model.Id != 0 {
@@ -523,7 +523,7 @@ func (this *LimsReportAlerKRController) UpdatekrEntity() {
 			devientity.AvgValue, _ = strconv.ParseFloat(model.DeviationArrayList[i].AvgValue, 64)
 			devientity.Deviation = model.DeviationArrayList[i].Deviation
 
-			if model.AlertValArrayList[i].Id != 0 {
+			if model.DeviationArrayList[i].Id != 0 {
 				devientity.ModifiedOn = time.Now()
 				devientity.ModifiedBy = this.User.Realname
 				devientity.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()

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

@@ -34,7 +34,7 @@ type LimsCarbon1Model struct {
 	StandVal            string
 	StandardUnit        string
 	Uncertainty         string
-	InstrumentNo        string
+	InstrumentNo        int
 	EId                 int
 	TaskBalanceId       int
 }
@@ -157,7 +157,7 @@ func (this *LimsReportAnCarbon1Controller) AddCarbon1Entity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 			cerentity.EId = model.EId
 			cerentity.TaskBalanceId = model.TaskBalanceId
@@ -177,7 +177,7 @@ func (this *LimsReportAnCarbon1Controller) AddCarbon1Entity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 	cerentity2.EId = model.EId
 	cerentity2.TaskBalanceId = model.TaskBalanceId
@@ -402,7 +402,7 @@ func (this *LimsReportAnCarbon1Controller) Updatecarbon1Entity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 
 			if model.CertiArrayList[i].Id != 0 {
@@ -443,7 +443,7 @@ func (this *LimsReportAnCarbon1Controller) Updatecarbon1Entity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 
 	if model.Id != 0 {

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

@@ -34,7 +34,7 @@ type LimsCarbon2AllModel struct {
 	StandVal            string
 	StandardUnit        string
 	Uncertainty         string
-	InstrumentNo        string
+	InstrumentNo        int
 	EId                 int
 	TaskBalanceId       int
 }
@@ -146,7 +146,7 @@ func (this *LimsReportAlerCarbon2Controller) AddCarbon2Entity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 			cerentity.EId = model.EId
 			cerentity.TaskBalanceId = model.TaskBalanceId
@@ -165,7 +165,7 @@ func (this *LimsReportAlerCarbon2Controller) AddCarbon2Entity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 	cerentity2.EId = model.EId
 	cerentity2.TaskBalanceId = model.TaskBalanceId
@@ -392,7 +392,7 @@ func (this *LimsReportAlerCarbon2Controller) Updatecarbon2Entity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 
 			if model.CertiArrayList[i].Id != 0 {
@@ -431,7 +431,7 @@ func (this *LimsReportAlerCarbon2Controller) Updatecarbon2Entity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 
 	if model.Id != 0 {

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

@@ -33,7 +33,7 @@ type LimsBenAllModel struct {
 	StandVal            string
 	StandardUnit        string
 	Uncertainty         string
-	InstrumentNo        string
+	InstrumentNo        int
 	EId                 int
 	TaskBalanceId       int
 }
@@ -45,7 +45,7 @@ type Certilist struct {
 	StandardUnit string
 	Uncertainty  string
 	StanDevice   string
-	InstrumentNo string
+	InstrumentNo int
 }
 type AlertValList struct {
 	Id            int
@@ -203,7 +203,7 @@ func (this *LimsReportBenController) AddEntity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 			cerentity.EId = model.BenMainform.EId
 			cerentity.TaskBalanceId = model.BenMainform.TaskBalanceId
@@ -222,7 +222,7 @@ func (this *LimsReportBenController) AddEntity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 	cerentity2.EId = model.BenMainform.EId
 	cerentity2.TaskBalanceId = model.BenMainform.TaskBalanceId
@@ -447,7 +447,7 @@ func (this *LimsReportBenController) UpdateEntity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 
 			if model.CertiArrayList[i].Id != 0 {
@@ -487,7 +487,7 @@ func (this *LimsReportBenController) UpdateEntity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 
 	if model.Id != 0 {

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

@@ -33,7 +33,7 @@ type LimsHSAllModel struct {
 	StandVal            string
 	StandardUnit        string
 	Uncertainty         string
-	InstrumentNo        string
+	InstrumentNo        int
 	EId                 int
 	TaskBalanceId       int
 }
@@ -147,7 +147,7 @@ func (this *LimsReportDeHSController) AddHSEntity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 			cerentity.EId = model.EId
 			cerentity.TaskBalanceId = model.TaskBalanceId
@@ -167,7 +167,7 @@ func (this *LimsReportDeHSController) AddHSEntity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 	cerentity2.EId = model.EId
 	cerentity2.TaskBalanceId = model.TaskBalanceId
@@ -398,7 +398,7 @@ func (this *LimsReportDeHSController) UpdatehsEntity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 			if model.CertiArrayList[i].Id != 0 {
 				cerentity.ModifiedOn = time.Now()
@@ -438,7 +438,7 @@ func (this *LimsReportDeHSController) UpdatehsEntity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 	if model.Id != 0 {
 		cerentity2.ModifiedOn = time.Now()

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

@@ -33,7 +33,7 @@ type LimsOxygonAllModel struct {
 	StandVal            string
 	StandardUnit        string
 	Uncertainty         string
-	InstrumentNo        string
+	InstrumentNo        int
 	EId                 int
 	TaskBalanceId       int
 }
@@ -145,7 +145,7 @@ func (this *LimsReportDeOxygenController) AddOxygenEntity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 			cerentity.EId = model.EId
 			cerentity.TaskBalanceId = model.TaskBalanceId
@@ -165,7 +165,7 @@ func (this *LimsReportDeOxygenController) AddOxygenEntity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 	cerentity2.EId = model.EId
 	cerentity2.TaskBalanceId = model.TaskBalanceId
@@ -392,7 +392,7 @@ func (this *LimsReportDeOxygenController) UpdateoxygenEntity() {
 			cerentity.StandVal = model.CertiArrayList[i].StandVal
 			cerentity.Uncertainty = model.CertiArrayList[i].Uncertainty
 			cerentity.EffectDate = model.CertiArrayList[i].EffectDate
-			cerentity.InstrumentNo = model.CertiArrayList[i].InstrumentNo
+			cerentity.InstrumentNo = utils.ToStr(model.CertiArrayList[i].InstrumentNo)
 			cerentity.StanDevice = model.CertiArrayList[i].StanDevice
 
 			if model.CertiArrayList[i].Id != 0 {
@@ -433,7 +433,7 @@ func (this *LimsReportDeOxygenController) UpdateoxygenEntity() {
 	cerentity2.StandVal = model.StandVal
 	cerentity2.Uncertainty = model.Uncertainty
 	cerentity2.EffectDate = model.EffectDate
-	cerentity2.InstrumentNo = model.InstrumentNo
+	cerentity2.InstrumentNo = utils.ToStr(model.InstrumentNo)
 	cerentity2.StanDevice = model.StanDevice
 
 	if model.Id != 0 {

+ 1 - 0
src/dashoo.cn/frontend_web/nuxt.config.ignore.js

@@ -133,6 +133,7 @@ module.exports = {
 
   axios: {
     baseURL: '//localhost:10091/api/' // 本机开发使用
+    //baseURL: '//47.92.212.59:10091/api/' // Lims使用
     // baseURL: '//api09.labsop.cn/api/'
     // baseURL: '//52.80.133.197:10091/api/' // DQM 爱萨尔发布使用
     // baseURL: '//192.168.0.211:10091/api/' // 花生所系统

+ 48 - 0
src/dashoo.cn/frontend_web/src/api/system/instrument.js

@@ -0,0 +1,48 @@
+
+export default {
+  getList(instrumentno, params, myAxios) {
+    return myAxios({
+      url: '/instrument/cerlist/'+instrumentno,
+      method: 'GET',
+      params: params
+    });
+  },
+  getDictList(myAxios) {
+    return myAxios({
+      url: '/instrument/dictcerlist/',
+      method: 'GET'
+    });
+  },
+  getEntity(entityId, myAxios) {
+    return myAxios({
+      url: '/instrument/getcer/'+entityId,
+      method: 'GET',
+    })
+  },
+  addEntity(formData, myAxios) {
+    return myAxios({
+      url: '/instrument/addcer',
+      method: 'post',
+      data: formData
+    })
+  },
+  updateEntity(entityId, formData, myAxios) {
+    return myAxios({
+      url: '/instrument/updatecer/'+entityId,
+      method: 'post',
+      data: formData
+    })
+  },
+  deleteEntity(entityId, myAxios) {
+    return myAxios({
+      url: '/instrument/deletecer/'+entityId,
+      method: 'delete'
+    })
+  },
+  deleteAllEntity(entityId, myAxios) {
+    return myAxios({
+      url: '/instrument/deletecerall/'+entityId,
+      method: 'delete'
+    })
+  },
+}

+ 1 - 1
src/dashoo.cn/frontend_web/src/layouts/default.vue

@@ -5,7 +5,7 @@
 	<section class="main">
       <sidebar></sidebar>
       <main class="content">
-        <nuxt class="inner"></nuxt>
+        <nuxt class="inner" style="height: calc(100vh - 90px);"></nuxt>
       </main>
     </section>
     <div>

+ 5 - 5
src/dashoo.cn/frontend_web/src/pages/instrument/_opera/instrumentedit.vue

@@ -29,25 +29,25 @@
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="品牌名称" required prop="Brand" label-width="120px">
+            <el-form-item label="品牌名称" prop="Brand" label-width="120px">
               <el-input v-model="testlistform.Brand" placeholder="请输入品牌名称" style="width:100%"></el-input>
             </el-form-item>
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="供应商" required prop="Supplier" label-width="120px">
+            <el-form-item label="供应商" prop="Supplier" label-width="120px">
               <el-input v-model="testlistform.Supplier" placeholder="请输入供应商" style="width:100%"></el-input>
             </el-form-item>
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="型号" required prop="Model" label-width="120px">
+            <el-form-item label="型号" prop="Model" label-width="120px">
               <el-input v-model="testlistform.Model" placeholder="请输入型号" style="width:100%"></el-input>
             </el-form-item>
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="设备大类" required prop="Classification" label-width="120px">
+            <el-form-item label="设备大类" prop="Classification" label-width="120px">
               <el-select ref="reftube" v-model="testlistform.Classification" placeholder="请输入设备大类" style="width:100%">
                 <el-option v-for="item in classificationlist" :label="item.Value" :value="item.Value" :key="item.Value">
                 </el-option>
@@ -57,7 +57,7 @@
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="设备状态" required prop="State" label-width="120px">
+            <el-form-item label="设备状态" prop="State" label-width="120px">
               <el-select v-model="testlistform.State" placeholder="请选择设备状态" style="width:100%">
                 <el-option v-for="item in statelist" :key="item.Id" :label="item.stateName" :value="item.Id">
                 </el-option>

+ 216 - 10
src/dashoo.cn/frontend_web/src/pages/instrument/index.vue

@@ -26,16 +26,17 @@
               </el-col>
               <el-col :span="8">
                 <el-form-item label="设备大类">
-                  <el-select style="width:100%" v-model="search.Name" placeholder="请选择设备大类" clearable="true">
-                    <el-option v-for="item in classificationlist" :key="item.Value" :label="item.Value" :value="item.Value" >
+                  <el-select style="width:100%" v-model="search.Name" placeholder="请选择设备大类" clearable>
+                    <el-option v-for="item in classificationlist" :key="item.Value" :label="item.Value"
+                      :value="item.Value">
                     </el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="8">
                 <el-form-item label="校准时间">
-                  <el-date-picker v-model="CalibrationTime" type="daterange" range-separator="至" start-placeholder="开始日期"
-                    end-placeholder="结束日期" style="width:100%"></el-date-picker>
+                  <el-date-picker v-model="CalibrationTime" type="daterange" range-separator="至"
+                    start-placeholder="开始日期" end-placeholder="结束日期" style="width:100%"></el-date-picker>
                 </el-form-item>
               </el-col>
             </el-row>
@@ -44,14 +45,14 @@
             </el-row>
             <el-row :gutter="0" style="text-align:right;margin-top:10px;">
               <el-button type="primary" class="el-button--small" @click="searchdata()">查 询</el-button>
-              <el-button type="primary" class="el-button--small" @click="clearSearch" style="margin-left:8px">重 置</el-button>
+              <el-button type="primary" class="el-button--small" @click="clearSearch" style="margin-left:8px">重 置
+              </el-button>
             </el-row>
           </el-form>
         </el-collapse-item>
       </el-collapse>
       <el-col :span="24">
-        <el-table ref="multipleTable" :data="activities" border tooltip-effect="dark" style="width: 100%"
-          @selection-change="handleSelectionChange" @sort-change="orderby">
+        <el-table ref="multipleTable" :data="activities" border tooltip-effect="dark" style="width: 100%" @sort-change="orderby">
           <el-table-column label="操作" width="200px" align="center" fixed>
             <template slot-scope="scope">
               <router-link :to="'/instrument/' + scope.row.Id + '/instrumentedit'">
@@ -82,6 +83,12 @@
                       </el-button>
                     </router-link>
                   </el-dropdown-item>
+                  <el-dropdown-item>
+                    <el-button size="small" title="证书关联" type="text" style="margin-left:3px;"
+                      @click="cershowclick(scope.row)">
+                      <!--<i class="icon icon-spinner4"></i>-->证书关联
+                    </el-button>
+                  </el-dropdown-item>
                 </el-dropdown-menu>
               </el-dropdown>
               <!--<el-button @click="deleteinstrument(scope.row)" type="primary" size="small" title="删除" style="margin-left: 0px">删除</el-button>-->
@@ -100,7 +107,8 @@
           <el-table-column prop="Code" sortable label="设备编码" align="center"></el-table-column>
           <el-table-column prop="Name" sortable label="设备名称" align="center" show-overflow-tooltip></el-table-column>
           <el-table-column prop="Brand" sortable label="品牌" align="center" show-overflow-tooltip></el-table-column>
-          <el-table-column prop="Classification" sortable align="center" label="设备大类" show-overflow-tooltip></el-table-column>
+          <el-table-column prop="Classification" sortable align="center" label="设备大类" show-overflow-tooltip>
+          </el-table-column>
           <el-table-column prop="State" sortable label="设备状态" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-alert v-if="scope.row.State==1" :closable="false" style="background:rgba(255,255,255,0.2)" title="正常"
@@ -136,15 +144,84 @@
         </el-pagination>
       </el-col>
     </el-card>
+    <el-dialog title="证书关联列表" :visible.sync="cershow">
+      <el-button type="primary" size="mini" style="float: right; margin-top: -10px;margin-left :5px"
+        @click="deletecerdataall()">删除所有关联证书</el-button>
+      <el-button type="primary" size="mini" style="float: right; margin-top: -10px" @click="addCerShowClick">添加
+      </el-button>
+      <br />
+      <el-table :data="cerList" border>
+        <el-table-column label="操作" align="center">
+          <template slot-scope="scope">
+            <el-button size="small" type="text" style="margin-left:3px" icon="el-icon-delete" title="删除"
+              @click="deletecerdata(scope.row)"></el-button>
+          </template>
+        </el-table-column>
+        <el-table-column prop="CerNum" align="center" label="证书编号" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="StandVal" align="center" label="标准值"></el-table-column>
+        <el-table-column prop="Uncertainty" align="center" label="不确定度" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="EffectDate" align="center" label="有效期">
+          <template slot-scope="scope">
+            {{ jstimehandle(scope.row.EffectDate +'') }}
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <!-- <el-pagination @size-change="handCerSizeChange" @current-change="handleCerCurrentChange" :current-page="currentCerPage"
+        :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentCerItemCount">
+      </el-pagination> -->
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="userDialogVisible = false">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 添加证书 -->
+    <el-dialog title="添加证书" :visible.sync="addCerShow" top="5vh">
+      <el-form :model="certifForm" label-width="90px" ref="certifForm">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="证书编号" prop="CerNum">
+              <el-input v-model="certifForm.CerNum" placeholder="请输入证书编号" style="width:100%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="标准值" prop="StandVal">
+              <el-input v-model="certifForm.StandVal" placeholder="请输入标准值" style="width:100%"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="不确定度" prop="Uncertainty">
+              <el-input v-model="certifForm.Uncertainty" placeholder="请输入不确定度" style="width:100%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="有效期" prop="EffectDate">
+              <el-date-picker style="width: 100%" v-model="certifForm.EffectDate" type="date" format="yyyy 年 MM 月 dd 日"
+                placeholder="请选择">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer" style="margin-top: -25px">
+        <el-button size="small" @click="addCerShow = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="savecertify()">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
+  import api from '@/api/system/instrument'
   export default {
     name: 'instrument',
     data() {
       return {
         name: '',
+        cershow: false,
+        addCerShow: false,
         details: false,
         totalsize: 0,
         currpage: 1,
@@ -162,6 +239,23 @@
           Name: '',
           Code: ''
         },
+        cerList: [],
+        certifForm: {
+          Id: '',
+          InstrumentNo: '',
+          InstrumentName: '',
+          CerNum: '',
+          StandardUnit: '',
+          StandVal: '',
+          Uncertainty: '',
+          EffectDate: new Date(),
+          CreateOn: '',
+          CreateUserId: '',
+          CreateBy: '',
+          ModifiedOn: '',
+          ModifiedUserId: '',
+          ModifiedBy: '',
+        },
         statelist: [{
           stateName: '正常',
           Id: 1,
@@ -225,8 +319,9 @@
             }
             for (let i = 0; i < _this.activities.length; i++) {
               _this.activities[i].CalibrationDeadline = _this.activities[i].CalibrationDeadline + ''
-              _this.activities[i].CalibrationDeadline = _this.activities[i].CalibrationDeadline + '' + _this.activities[
-                i].CalibrationDeadlineType
+              _this.activities[i].CalibrationDeadline = _this.activities[i].CalibrationDeadline + '' + _this
+                .activities[
+                  i].CalibrationDeadlineType
             }
             _this.totalsize = response.data.currentItemCount
           })
@@ -234,6 +329,117 @@
             console.log(error)
           })
       },
+      cershowclick(val) {
+        this.certifForm.InstrumentNo = val.Id
+        this.certifForm.InstrumentName = val.Name
+        this.getcerdata();
+        this.cershow = true
+      },
+      addCerShowClick() {
+        this.certifForm.Id = ''
+        this.certifForm.CerNum = ''
+        this.certifForm.Uncertainty = ''
+        this.certifForm.StandVal = ''
+        this.addCerShow = true
+      },
+      getcerdata() {
+        this.cerList = []
+        //分页及列表条件
+        let params = {
+          _currentPage: this.currentPage,
+          _size: this.size,
+          Order: this.Column.Order,
+          Prop: this.Column.Prop,
+        };
+        //访问接口
+        api.getList(this.certifForm.InstrumentNo, params, this.$axios).then(res => {
+          this.cerList = res.data.items
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      //增加证书
+      savecertify() {
+        api.addEntity(this.certifForm, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            //保存成功后,初始化数据,变成修改
+            this.certifForm.Id = res.data.item;
+            this.getcerdata();
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            });
+            this.addCerShow = false
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            });
+          }
+        }).catch(err => {
+          console.error(err)
+        });
+      },
+
+      updatecer() {
+        api.updateEntity(this.certifForm.Id, this.certifForm, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            //保存成功后,初始化数据,变成修改
+            this.getcerdata();
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            });
+
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            });
+          }
+        }).catch(err => {
+          console.error(err)
+        });
+      },
+      deletecerdataall() {
+        api.deleteAllEntity(this.certifForm.InstrumentNo, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            this.getcerdata();
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            });
+
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            });
+          }
+        }).catch(err => {
+          console.error(err)
+        });
+      },
+      deletecerdata(row) {
+        row.deleteConfirmFlag = false;
+        api.deleteEntity(row.Id, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            this.getcerdata();
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            });
+
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            });
+          }
+        }).catch(err => {
+          console.error(err)
+        });
+      },
       handleSizeChange(val) {
         this.size = val
         this.currpage = 1

+ 85 - 23
src/dashoo.cn/frontend_web/src/pages/instrument/instrumentadd.vue

@@ -11,6 +11,8 @@
           <i class="icon icon-table2"></i> 设备管理
         </span>
         <span style="float: right;">
+          <el-button type="primary" @click="addcer('testlistform')" class="el-button--small" v-if="addcerview">添加证书
+          </el-button>
           <el-button type="primary" @click="getCode('testlistform')" class="el-button--small">保存</el-button>
           <el-button type="primary" class="el-button--small" onclick="window.history.go(-1)">返回</el-button>
         </span>
@@ -29,25 +31,25 @@
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="品牌名称" required prop="Brand" label-width="120px">
+            <el-form-item label="品牌名称" prop="Brand" label-width="120px">
               <el-input v-model="testlistform.Brand" placeholder="请输入品牌名称" style="width:100%"></el-input>
             </el-form-item>
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="供应商" required prop="Supplier" label-width="120px">
+            <el-form-item label="供应商" prop="Supplier" label-width="120px">
               <el-input v-model="testlistform.Supplier" placeholder="请输入供应商" style="width:100%"></el-input>
             </el-form-item>
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="型号" required prop="Model" label-width="120px">
+            <el-form-item label="型号" prop="Model" label-width="120px">
               <el-input v-model="testlistform.Model" placeholder="请输入型号" style="width:100%"></el-input>
             </el-form-item>
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="设备大类" required prop="Classification" label-width="120px">
+            <el-form-item label="设备大类" prop="Classification" label-width="120px">
               <el-select ref="reftube" v-model="testlistform.Classification" placeholder="请输入设备大类" style="width:100%">
                 <el-option v-for="item in classificationlist" :label="item.Value" :value="item.Value" :key="item.Value">
                 </el-option>
@@ -57,29 +59,27 @@
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="设备状态" required prop="State" label-width="120px">
+            <el-form-item label="设备状态" prop="State" label-width="120px">
               <el-select v-model="testlistform.State" placeholder="请选择设备状态" style="width:100%">
                 <el-option v-for="item in statelist" :key="item.Id" :label="item.stateName" :value="item.Id">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
-
           <el-col :span="8">
             <el-form-item label="校准时间" label-width="120px" prop="CalibrationTime">
-              <el-date-picker v-model="testlistform.CalibrationTime" type="datetime" style="width:100%" placeholder="请选择校准时间">
+              <el-date-picker v-model="testlistform.CalibrationTime" type="datetime" style="width:100%"
+                placeholder="请选择校准时间">
               </el-date-picker>
             </el-form-item>
           </el-col>
-
-
-
-
           <el-col :span="8">
             <el-form-item label="校准使用期限" label-width="120px">
-              <el-input v-model="testlistform.CalibrationDeadline" placeholder="请输入校准使用期限" style="width: 49%"></el-input>
+              <el-input v-model="testlistform.CalibrationDeadline" placeholder="请输入校准使用期限" style="width: 49%">
+              </el-input>
 
-              <el-select v-model="testlistform.CalibrationDeadlineType" placeholder="请选择设备状态" style="width: 49%;float:right">
+              <el-select v-model="testlistform.CalibrationDeadlineType" placeholder="请选择设备状态"
+                style="width: 49%;float:right">
                 <el-option v-for="item in timeType" :key="item.Id" :label="item.stateName" :value="item.Id">
                 </el-option>
               </el-select>
@@ -94,20 +94,49 @@
                   </el-date-picker>
                 </el-form-item>
           </el-col> -->
-
           <el-col :span="24">
             <el-form-item label="备注信息" label-width="120px">
-              <el-input v-model="testlistform.Remarks" type="textarea" :rows=3 placeholder="请输入备注信息" style="width:100%"></el-input>
+              <el-input v-model="testlistform.Remarks" type="textarea" :rows=3 placeholder="请输入备注信息" style="width:100%">
+              </el-input>
             </el-form-item>
           </el-col>
-
-
-
-
-
         </el-row>
       </el-form>
     </el-card>
+    <el-dialog title="添加证书" :visible.sync="CerShow" top="5vh">
+      <el-form :model="certifForm" label-width="130px" ref="certifForm">
+        <el-row>
+          <el-col :span="6">
+            <el-form-item label="证书编号" prop="CerNum">
+              <el-input v-model="certifForm.CerNum" placeholder="请输入证书编号" style="width:100%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="标准值" prop="StandardUnit">
+              <el-input v-model="certifForm.StandardUnit" placeholder="请输入标准值" style="width:100%"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-col :span="6">
+            <el-form-item label="不确定度" prop="Uncertainty">
+              <el-input v-model="certifForm.Uncertainty" placeholder="请输入不确定度" style="width:100%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="有效期" prop="EffectDate">
+              <el-date-picker style="width: 100%" v-model="certifForm.EffectDate" type="date"
+              format="yyyy 年 MM 月 dd 日" placeholder="请选择">
+            </el-date-picker>
+            </el-form-item>
+          </el-col>
+        <el-row>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer" style="margin-top: -25px">
+        <el-button size="small" @click="CerShow = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="savecer()">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 
 </template>
@@ -118,8 +147,18 @@
     data() {
 
       return {
+        CerShow: false,
+        addcerview: false,
         formtype: '1',
         disabledbarcode: false,
+        certifForm: {
+          InstrumentNo: '',
+          InstrumentName: '',
+          CerNum: '',
+          StandardUnit: '',
+          Uncertainty: '',
+          EffectDate: '',
+        },
         testlistform: {
           Code: '',
           Name: '',
@@ -206,7 +245,6 @@
     },
     methods: {
       savedata() {
-
         let _this = this
         _this.testlistform.CalibrationDeadline = parseInt(_this.testlistform.CalibrationDeadline)
         _this.$axios.post('instrument/addinstument', _this.testlistform)
@@ -216,10 +254,9 @@
               _this.$message({
                 type: 'success',
                 message: res.data.message
-
-
               })
               window.history.go(-1)
+              //this.addcerview = true
             } else {
               _this.$message({
                 type: 'warning',
@@ -232,6 +269,31 @@
             console.error(err)
           })
       },
+      addcer(formName) {
+        this.CerShow = true
+      },
+      savecer(){
+         this.$axios.post('instrument/addinstumentcer', this.certifForm)
+          .then(res => {
+            // response
+            if (res.data.code === 0) {
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+              window.history.go(-2)
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+      },
       getCode(formName) {
         let _this = this
         this.$refs[formName].validate((valid) => {

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

@@ -772,7 +772,7 @@
               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
+              this.formData.StanDevice = res.data.ceritem[0].StanDevice
             }
             if (res.data.alvalitem != null) {
               for (var i = 0; i < res.data.alvalitem.length; i++) {

+ 16 - 1
src/dashoo.cn/frontend_web/src/pages/lims/reportalertorcarbondetect/_opera/operation.vue

@@ -481,6 +481,7 @@
         },
         //证书编号
         formCertificateData: {
+          Id: 0,
           StanDevice: '',
           CerNum: '',
           StandardUnit: '',
@@ -491,6 +492,7 @@
         },
         //certificateDataAll: [],
         certificateData: [{
+          Id: 0,
           value: 1,
           CerNum: '',
           StandardUnit: '',
@@ -500,6 +502,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }, {
+          Id: 0,
           value: 2,
           CerNum: '',
           StandardUnit: '',
@@ -509,6 +512,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }, {
+          Id: 0,
           value: 3,
           CerNum: '',
           StandardUnit: '',
@@ -520,6 +524,7 @@
         }],
         //报警误差
         alerValData: [{
+          Id: 0,
           AlertFunc: [],
           AlertFunction: [],
           Value1: '',
@@ -530,6 +535,7 @@
           MaxValue: '0',
           AllowValue: '0'
         }, {
+          Id: 0,
           AlertFunc: [],
           AlertFunction: [],
           Value1: '',
@@ -550,6 +556,7 @@
         }],
         //示值误差及响应时间
         deviationData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -559,6 +566,7 @@
           DeviationRelative: '',
           Deviation: '0'
         }, {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -568,6 +576,7 @@
           DeviationRelative: '',
           Deviation: '0'
         }, {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -579,6 +588,7 @@
         }],
         //响应时间
         responseTimeForm: {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -586,6 +596,7 @@
           Deviation: ''
         },
         responseTimeData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -594,6 +605,7 @@
         }],
         //重复性
         RepeatForm: {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -605,6 +617,7 @@
           RepeatValue: ''
         },
         RepeatData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -617,6 +630,7 @@
         }],
         //漂移
         ShiftData: [{
+          Id: 0,
           ValueType: '零点示值',
           value0: '',
           Value1: '',
@@ -628,6 +642,7 @@
           ZeroValue: '',
           ShowValue: ''
         }, {
+          Id: 0,
           ValueType: '量程示值',
           value0: '',
           Value1: '',
@@ -691,7 +706,7 @@
               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
+              this.formData.StanDevice = res.data.ceritem[0].StanDevice
             }
             if (res.data.deviitem != null) {
               for (var i = 0; i < res.data.deviitem.length; i++) {

+ 16 - 1
src/dashoo.cn/frontend_web/src/pages/lims/reportalertorfhgasdetect/_opera/operation.vue

@@ -512,6 +512,7 @@
         },
         //证书编号
         formCertificateData: {
+          Id: 0,
           StanDevice: '',
           CerNum: '',
           StandardUnit: '',
@@ -522,6 +523,7 @@
         },
         //certificateDataAll: [],
         certificateData: [{
+          Id: 0,
           value: 1,
           CerNum: '',
           StandardUnit: '',
@@ -531,6 +533,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }, {
+          Id: 0,
           value: 2,
           CerNum: '',
           StandardUnit: '',
@@ -540,6 +543,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }, {
+          Id: 0,
           value: 3,
           CerNum: '',
           StandardUnit: '',
@@ -551,6 +555,7 @@
         }],
         //报警误差
         alerValData: [{
+          Id: 0,
           AlertFunc: [],
           AlertFunction: [],
           Value1: '',
@@ -561,6 +566,7 @@
           MaxValue: '0',
           AllowValue: '0'
         }, {
+          Id: 0,
           AlertFunc: [],
           AlertFunction: [],
           Value1: '',
@@ -581,6 +587,7 @@
         }],
         //示值误差及响应时间
         deviationData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -590,6 +597,7 @@
           DeviationRelative: '0',
           Deviation: ''
         }, {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -599,6 +607,7 @@
           DeviationRelative: '0',
           Deviation: ''
         }, {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -610,6 +619,7 @@
         }],
         //响应时间
         responseTimeForm: {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -617,6 +627,7 @@
           Deviation: ''
         },
         responseTimeData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -625,6 +636,7 @@
         }],
         //重复性
         RepeatForm: {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -636,6 +648,7 @@
           RepeatValue: ''
         },
         RepeatData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -648,6 +661,7 @@
         }],
         //漂移
         ShiftData: [{
+          Id: 0,
           ValueType: '零点示值',
           value0: '',
           Value1: '',
@@ -659,6 +673,7 @@
           ZeroValue: '',
           ShowValue: ''
         }, {
+          Id: 0,
           ValueType: '量程示值',
           value0: '',
           Value1: '',
@@ -721,7 +736,7 @@
               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
+              this.formData.StanDevice = res.data.ceritem[0].StanDevice
             }
             if (res.data.alvalitem != null) {
               for (var i = 0; i < res.data.alvalitem.length; i++) {

+ 232 - 52
src/dashoo.cn/frontend_web/src/pages/lims/reportalertorkrgasdetect/_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">
@@ -87,7 +90,12 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="标准器名称:">
-              <el-input v-model="formData.StanDevice" placeholder="请输入" style="width: 100%"></el-input>
+              <el-select ref="refDevice" v-model="formData.InstrumentNo" clearable placeholder="请选择"
+                @change="chooseCertify" style="width: 100%">
+                <el-option v-for="item in StanDeviceoptions" :key="item.id" :label="item.name" :value="item.id">
+                </el-option>
+              </el-select>
+              <!-- <el-input v-model="formData.StanDevice" placeholder="请输入" style="width: 100%"></el-input> -->
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -126,7 +134,12 @@
       <el-form label-width="100px" ref="certificateForm" :model="formCertificateData">
         <el-col :span="8">
           <el-form-item label="标准器名称:">
-            <el-input v-model="formCertificateData.StanDevice" placeholder="请输入" style="width: 100%"></el-input>
+            <el-select ref="refDevice2" v-model="formCertificateData.InstrumentNo" clearable placeholder="请选择"
+              @change="chooseCertify2" style="width: 100%">
+              <el-option v-for="item in StanDeviceoptions2" :key="item.id" :label="item.name" :value="item.id">
+              </el-option>
+            </el-select>
+            <!-- <el-input v-model="formCertificateData.StanDevice" placeholder="请输入" style="width: 100%"></el-input> -->
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -146,8 +159,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>
@@ -198,23 +211,27 @@
         <el-table-column align="center" label="实测报警值(%LEL)">
           <el-table-column align="center" label="" prop="Value1">
             <template slot-scope="scope">
-              <el-input type="number" step="0.1" 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.1" 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.1" 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="ActionValue" align="center" label="报警动作值(%LEL)" min-width="90">
           <template slot-scope="scope">
-            <el-input  type="number" step="0.1" v-model.number="scope.row.ActionValue" style="width: 160px" size="mini"></el-input>
+            <el-input type="number" step="0.1" v-model.number="scope.row.ActionValue" style="width: 160px" size="mini">
+            </el-input>
           </template>
         </el-table-column>
       </el-table>
@@ -227,34 +244,40 @@
       <el-table :data="deviationData" border style="width: 100%">
         <el-table-column align="center" prop="GasValue" label="标准气体浓度值(%LEL)" width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.1" v-model.number="scope.row.GasValue" style="width: 100%" size="mini" :disabled="true"></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="仪器示值(%LEL)" 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.1" 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.1" 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.1" 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.1" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini"  :disabled="true"></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"  :disabled="true"></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>
@@ -267,28 +290,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.1" 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.1" 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.1" 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.1" 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.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">
+              </el-input>
             </template>
           </el-table-column>
         </el-table-column>
@@ -302,49 +330,58 @@
       <el-table :data="RepeatData" border style="width: 100%">
         <el-table-column align="center" prop="GasValue" label="标准气体浓度值(%LEL)" width="180">
           <template slot-scope="scope">
-            <el-input type="number" step="0.1" v-model.number="scope.row.GasValue" style="width: 100%" size="mini" :disabled="true"></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="仪器示值(%LEL)" 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.1" 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.1" 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.1" 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.1" 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.1" 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.1" 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.1" v-model.number="scope.row.AvgValue" style="width: 100%" size="mini" :disabled="true"></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" :disabled="true"></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>
@@ -359,53 +396,63 @@
         </el-table-column>
         <el-table-column prop="value0" align="center" label="0">
           <template slot-scope="scope">
-            <el-input type="number" step="0.1" 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">
           <template slot-scope="scope">
-            <el-input type="number" step="0.1" 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">
           <template slot-scope="scope">
-            <el-input type="number" step="0.1" 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">
           <template slot-scope="scope">
-            <el-input type="number" step="0.1" 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">
           <template slot-scope="scope">
-            <el-input type="number" step="0.1" 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">
           <template slot-scope="scope">
-            <el-input type="number" step="0.1" 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">
           <template slot-scope="scope">
-            <el-input type="number" step="0.1" 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="零点漂移(%FS)" min-width="150">
           <template slot-scope="scope">
-            <el-input type="number" step="0.1" 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="150">
           <template slot-scope="scope">
-            <el-input type="number" step="0.1" 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" :disabled="DataStatus != 0 && DataStatus != 5&& DataStatus!=3"><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>
@@ -441,6 +488,7 @@
     mapGetters
   } from 'vuex'
   import api from '@/api/meter/reportalertorkr'
+  import instapi from '@/api/system/instrument'
   export default {
     computed: {
       ...mapGetters({
@@ -453,7 +501,11 @@
       return {
         ProoFreadShow: false,
         acceptUsers: [],
+        DeviceList: [],
+        StanDeviceoptions: [],
+        StanDeviceoptions2: [],
         serviceId: '',
+        InstrumentNo: '',
         DataStatus: '0',
         sign: '2',
         // 校核提交
@@ -491,6 +543,7 @@
           Temperature: '',
           StandardDesc: '可燃气体检测报警器检定装置',
           StanDevice: '',
+          InstrumentNo: '',
           RelativeHumanity: '',
           ManuCompany: '',
           Spec: '',
@@ -503,7 +556,9 @@
           DielecStrength: ''
         },
         //证书编号
+        formcer: [],
         formCertificateData: {
+          Id: 0,
           StanDevice: '',
           CerNum: '',
           StandardUnit: '',
@@ -512,8 +567,40 @@
           EffectDate: new Date(),
           InstrumentNo: ''
         },
+        certificateDataform: [{
+          Id: 0,
+          value: 1,
+          CerNum: '',
+          StandardUnit: '',
+          StandVal: '',
+          Uncertainty: '',
+          EffectDate: new Date(),
+          StanDevice: '',
+          InstrumentNo: ''
+        }, {
+          Id: 0,
+          value: 2,
+          CerNum: '',
+          StandardUnit: '',
+          StandVal: '',
+          Uncertainty: '',
+          EffectDate: new Date(),
+          StanDevice: '',
+          InstrumentNo: ''
+        }, {
+          Id: 0,
+          value: 3,
+          CerNum: '',
+          StandardUnit: '',
+          StandVal: '',
+          Uncertainty: '',
+          EffectDate: new Date(),
+          StanDevice: '',
+          InstrumentNo: ''
+        }],
         //certificateDataAll: [],
         certificateData: [{
+          Id: 0,
           value: 1,
           CerNum: '',
           StandardUnit: '',
@@ -523,6 +610,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }, {
+          Id: 0,
           value: 2,
           CerNum: '',
           StandardUnit: '',
@@ -532,6 +620,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }, {
+          Id: 0,
           value: 3,
           CerNum: '',
           StandardUnit: '',
@@ -543,6 +632,7 @@
         }],
         //报警误差
         alerValData: [{
+          Id: 0,
           AlertFunc: [],
           AlertFunction: [],
           Value1: '',
@@ -553,6 +643,7 @@
           MaxValue: '0',
           AllowValue: '0'
         }, {
+          Id: 0,
           AlertFunc: [],
           AlertFunction: [],
           Value1: '',
@@ -573,6 +664,7 @@
         }],
         //示值误差及响应时间
         deviationData: [{
+          Id: 0,
           GasValue: 10,
           Value1: '',
           Value2: '',
@@ -582,6 +674,7 @@
           DeviationRelative: '0',
           Deviation: ''
         }, {
+          Id: 0,
           GasValue: 40.2,
           Value1: '',
           Value2: '',
@@ -591,6 +684,7 @@
           DeviationRelative: '0',
           Deviation: ''
         }, {
+          Id: 0,
           GasValue: 60.8,
           Value1: '',
           Value2: '',
@@ -602,6 +696,7 @@
         }],
         //响应时间
         responseTimeForm: {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -609,6 +704,7 @@
           Deviation: ''
         },
         responseTimeData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -617,6 +713,7 @@
         }],
         //重复性
         RepeatForm: {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -628,6 +725,7 @@
           RepeatValue: ''
         },
         RepeatData: [{
+          Id: 0,
           GasValue: 40.2,
           Value1: '',
           Value2: '',
@@ -640,6 +738,7 @@
         }],
         //漂移
         ShiftData: [{
+          Id: 0,
           ValueType: '零点示值',
           value0: '',
           Value1: '',
@@ -651,6 +750,7 @@
           ZeroValue: '',
           ShowValue: ''
         }, {
+          Id: 0,
           ValueType: '量程示值',
           value0: '',
           Value1: '',
@@ -678,8 +778,9 @@
       this.formData.DataEntryId = this.queryParams.DataEntryId
       this.formData.TaskBalanceId = this.queryParams.TaskBalanceId
       this.formData.EId = this.queryParams.EId
-      this.initDatas();
+      this.initDatas()
       this.getUsersByRole()
+      this.getdevice()
       //this.getDictOptions();
       // if (this.serviceId != 'add' && this.serviceId > 0) {
       //   this.formData.Id = this.serviceId;
@@ -696,7 +797,7 @@
             this.formData = res.data.mainitem;
             this.formData.DetectBasis = 'JJG 693-2011《 可燃气体检测报警器》检定规程'
             this.formData.StandardDesc = '可燃气体检测报警器检定装置'
-            if (this.formData.CheckDate == "0001-01-01T00:00:00Z"){
+            if (this.formData.CheckDate == "0001-01-01T00:00:00Z") {
               this.formData.CheckDate = new Date();
             }
             if (res.data.ceritem != null) {
@@ -715,8 +816,11 @@
               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
+              this.formCertificateData.InstrumentNo = res.data.ceritem[3].StanDevice
+              this.formData.StanDevice = res.data.ceritem[0].StanDevice
+              this.formData.InstrumentNo = res.data.ceritem[0].StanDevice
             }
+            console.log("-----this.formData---", this.formData)
             if (res.data.alvalitem != null) {
               for (var i = 0; i < res.data.alvalitem.length; i++) {
                 this.alerValData[i] = res.data.alvalitem[i];
@@ -770,6 +874,81 @@
           });
         }
       },
+      getdevice() {
+        let _this = this
+        _this.$axios.get('/instrument/initlistdata', {})
+          .then(function (response) {
+            console.log("jkkfddf", response.data.items)
+            _this.DeviceList = response.data.items
+            console.log("-_this._this.DeviceList------", _this.DeviceList)
+            if (!_this.DeviceList) {
+              return false
+            }
+            for (var i = 0; i < _this.DeviceList.length; i++) {
+              let devicelist = _this.DeviceList[i]
+              instapi.getList(_this.DeviceList[i].Id, "", _this.$axios).then(res => {
+                if (res.data.currentItemCount === 1) {
+                  _this.StanDeviceoptions2.push({
+                    id: devicelist.Id,
+                    name: devicelist.Name,
+                  })
+                } else {
+                  _this.StanDeviceoptions.push({
+                    id: devicelist.Id,
+                    name: devicelist.Name,
+                  })
+                }
+              }).catch(err => {
+                console.error(err)
+              })
+            }
+          })
+          .catch(function (error) {
+            console.log(error)
+          })
+      },
+      chooseCertify2(value) {
+        let _this = this
+        let obj = {};
+        obj = this.StanDeviceoptions2.find((item) => {
+          return item.id === value;
+        });
+        this.formCertificateData.StanDevice = obj.name
+        let instrumentno = value
+        //访问接口
+        instapi.getList(instrumentno, "", this.$axios).then(res => {
+          this.certificateDataform = res.data.items
+          this.formCertificateData.CerNum = this.certificateDataform[0].CerNum
+          this.formCertificateData.Uncertainty = this.certificateDataform[0].Uncertainty
+          this.formCertificateData.StandVal = this.certificateDataform[0].StandVal
+          this.formCertificateData.EffectDate = this.certificateDataform[0].EffectDate
+
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      chooseCertify(value) {
+        let obj = {};
+        obj = this.StanDeviceoptions.find((item) => {
+          return item.id === value;
+        });
+        this.formData.StanDevice = obj.name
+        console.log(obj.name);
+        let _this = this
+        _this.InstrumentNo = value
+        //访问接口
+        instapi.getList(_this.InstrumentNo, "", this.$axios).then(res => {
+          this.certificateDataform = res.data.items
+          for (var i = 0; i < this.certificateDataform.length; i++) {
+            this.certificateData[i].CerNum = this.certificateDataform[i].CerNum
+            this.certificateData[i].Uncertainty = this.certificateDataform[i].Uncertainty
+            this.certificateData[i].StandVal = this.certificateDataform[i].StandVal
+            this.certificateData[i].EffectDate = this.certificateDataform[i].EffectDate
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       // 获取校核人列表
       getUsersByRole() {
         // request
@@ -879,12 +1058,12 @@
           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{
+        } else {
           row.RepeatValue = 0
         }
       },
       setProoFreadShow() {
-          this.ProoFreadShow = true
+        this.ProoFreadShow = true
       },
       // 提交校核
       makesure() {
@@ -902,7 +1081,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)
@@ -938,7 +1117,6 @@
 
       //保存信息
       saveEntity() {
-        console.log("------this.formData.Id----", this.formData.Id)
         this.$refs['formData'].validate((valid) => {
           if (valid) {
             if (!this.formData.Id) {
@@ -955,10 +1133,12 @@
       //添加数据
       addEntityMain() {
         let _this = this
-        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
+            if (this.certificateData[i].StanDevice === "") {
+              this.certificateData[i].InstrumentNo = this.formData.InstrumentNo
+              this.certificateData[i].StanDevice = this.formData.StanDevice
+            }
           }
         }
         if (this.alerValData != null) {
@@ -1002,9 +1182,9 @@
 
       updateEntity() {
         let _this = this
-        console.log("------updatethis.formData.Id----", this.formData.Id)
         if (this.certificateData != null) {
           for (var i = 0; i < this.certificateData.length; i++) {
+            this.certificateData[i].InstrumentNo = this.formData.InstrumentNo
             this.certificateData[i].StanDevice = this.formData.StanDevice
           }
         }
@@ -1025,6 +1205,7 @@
           ShiftArrayList: this.ShiftData, //添加漂移数据
         }
         allform = Object.assign(allform, this.formCertificateData)
+        console.log("-------allform--------", allform)
         api.updateEntity(this.formData.DataEntryId, allform, this.$axios).then(res => {
           if (res.data.code === 0) {
             //保存成功后,初始化数据,变成修改
@@ -1076,7 +1257,6 @@
     }
   }
 
-
 </script>
 
 <style lang="scss">

+ 18 - 1
src/dashoo.cn/frontend_web/src/pages/lims/reportanalyzer1carbonredgas/_opera/operation.vue

@@ -490,6 +490,7 @@
         },
         //证书编号
         formCertificateData: {
+          Id: 0,
           StanDevice: '',
           CerNum: '',
           StandardUnit: '',
@@ -500,6 +501,7 @@
         },
         //certificateDataAll: [],
         certificateData: [{
+          Id: 0,
           value: 1,
           CerNum: '',
           StandardUnit: '',
@@ -509,6 +511,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }, {
+          Id: 0,
           value: 2,
           CerNum: '',
           StandardUnit: '',
@@ -518,6 +521,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }, {
+          Id: 0,
           value: 3,
           CerNum: '',
           StandardUnit: '',
@@ -529,6 +533,7 @@
         }],
         //报警误差
         alerValData: [{
+          Id: 0,
           AlertFunc: [],
           AlertFunction: [],
           Value1: '',
@@ -539,6 +544,7 @@
           MaxValue: '0',
           AllowValue: '0'
         }, {
+          Id: 0,
           AlertFunc: [],
           AlertFunction: [],
           Value1: '',
@@ -559,6 +565,7 @@
         }],
         //示值误差及响应时间
         deviationData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -568,6 +575,7 @@
           DeviationRelative: '0',
           Deviation: ''
         }, {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -577,6 +585,7 @@
           DeviationRelative: '0',
           Deviation: ''
         }, {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -588,6 +597,7 @@
         }],
         //响应时间
         responseTimeForm: {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -595,6 +605,7 @@
           Deviation: ''
         },
         responseTimeData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -603,6 +614,7 @@
         }],
         //重复性
         RepeatForm: {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -614,6 +626,7 @@
           RepeatValue: ''
         },
         RepeatData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -626,6 +639,7 @@
         }],
         //漂移
         ShiftData: [{
+          Id: 0,
           ValueType: '零点示值',
           Value0: '',
           Value1: '',
@@ -637,6 +651,7 @@
           ZeroValue: '',
           ShowValue: ''
         }, {
+          Id: 0,
           ValueType: '量程示值',
           Value0: '',
           Value1: '',
@@ -650,6 +665,7 @@
         }],
         //干扰误差
         ReportAlerOtherData:[{
+          Id: 0,
           ValueType: '非被测分组',
           Value0: '',
           Value1: '',
@@ -657,6 +673,7 @@
           Value3: '',
           OtherValue: ''
         },{
+          Id: 0,
           ValueType: '水蒸气',
           Value0: '',
           Value1: '',
@@ -715,7 +732,7 @@
               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
+              this.formData.StanDevice = res.data.ceritem[0].StanDevice
             }
             if (res.data.alvalitem != null) {
               for (var i = 0; i < res.data.alvalitem.length; i++) {

+ 16 - 1
src/dashoo.cn/frontend_web/src/pages/lims/reportanalyzer2carbonredgas/_opera/operation.vue

@@ -490,6 +490,7 @@
         },
         //证书编号
         formCertificateData: {
+          Id: 0,
           StanDevice: '',
           CerNum: '',
           StandardUnit: '',
@@ -500,6 +501,7 @@
         },
         //certificateDataAll: [],
         certificateData: [{
+          Id: 0,
           value: 1,
           CerNum: '',
           StandardUnit: '',
@@ -509,6 +511,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }, {
+          Id: 0,
           value: 2,
           CerNum: '',
           StandardUnit: '',
@@ -518,6 +521,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }, {
+          Id: 0,
           value: 3,
           CerNum: '',
           StandardUnit: '',
@@ -529,6 +533,7 @@
         }],
         //报警误差
         alerValData: [{
+          Id: 0,
           AlertFunc: [],
           AlertFunction: [],
           Value1: '',
@@ -539,6 +544,7 @@
           MaxValue: '0',
           AllowValue: '0'
         }, {
+          Id: 0,
           AlertFunc: [],
           AlertFunction: [],
           Value1: '',
@@ -559,6 +565,7 @@
         }],
         //示值误差及响应时间
         deviationData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -568,6 +575,7 @@
           DeviationRelative: '0',
           Deviation: ''
         }, {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -577,6 +585,7 @@
           DeviationRelative: '0',
           Deviation: ''
         }, {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -588,6 +597,7 @@
         }],
         //响应时间
         responseTimeData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -596,6 +606,7 @@
         }],
         //重复性
         RepeatData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -608,6 +619,7 @@
         }],
         //漂移
         ShiftData: [{
+          Id: 0,
           ValueType: '零点示值',
           Value0: '',
           Value1: '',
@@ -619,6 +631,7 @@
           ZeroValue: '',
           ShowValue: ''
         }, {
+          Id: 0,
           ValueType: '量程示值',
           Value0: '',
           Value1: '',
@@ -632,6 +645,7 @@
         }],
         //干扰误差
         ReportAlerOtherData:[{
+          Id: 0,
           ValueType: '非被测分组',
           Value0: '',
           Value1: '',
@@ -639,6 +653,7 @@
           Value3: '',
           OtherValue: ''
         },{
+          Id: 0,
           ValueType: '水蒸气',
           Value0: '',
           Value1: '',
@@ -693,7 +708,7 @@
               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
+             this.formData.StanDevice = res.data.ceritem[0].StanDevice
             }
             if (res.data.alvalitem != null) {
               for (var i = 0; i < res.data.alvalitem.length; i++) {

+ 99 - 4
src/dashoo.cn/frontend_web/src/pages/lims/reportdetectorHSgas/_opera/operation.vue

@@ -90,7 +90,12 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="标准器名称:">
-              <el-input v-model="formData.StanDevice" placeholder="请输入" style="width: 100%"></el-input>
+              <el-select ref="refDevice" v-model="formData.InstrumentNo" clearable placeholder="请选择"
+                @change="chooseCertify" style="width: 100%">
+                <el-option v-for="item in StanDeviceoptions" :key="item.id" :label="item.name" :value="item.id">
+                </el-option>
+              </el-select>
+              <!-- <el-input v-model="formData.StanDevice" placeholder="请输入" style="width: 100%"></el-input> -->
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -129,7 +134,12 @@
       <el-form label-width="100px" ref="certificateForm" :model="formCertificateData">
         <el-col :span="8">
           <el-form-item label="标准器名称:">
-            <el-input v-model="formCertificateData.StanDevice" placeholder="请输入" style="width: 100%"></el-input>
+            <el-select ref="refDevice2" v-model="formCertificateData.InstrumentNo" clearable placeholder="请选择"
+              @change="chooseCertify2" style="width: 100%">
+              <el-option v-for="item in StanDeviceoptions2" :key="item.id" :label="item.name" :value="item.id">
+              </el-option>
+            </el-select>
+            <!-- <el-input v-model="formCertificateData.StanDevice" placeholder="请输入" style="width: 100%"></el-input> -->
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -480,6 +490,7 @@
     mapGetters
   } from 'vuex'
   import api from '@/api/meter/reportalertorhs'
+  import instapi from '@/api/system/instrument'
   export default {
     computed: {
       ...mapGetters({
@@ -492,6 +503,9 @@
       return {
         ProoFreadShow: false,
         acceptUsers: [],
+        DeviceList: [],
+        StanDeviceoptions: [],
+        StanDeviceoptions2: [],
         serviceId: '',
         DataStatus: 0,
         sign: '2',
@@ -712,13 +726,15 @@
       this.formData.DataEntryId = this.queryParams.DataEntryId
       this.formData.TaskBalanceId = this.queryParams.TaskBalanceId
       this.formData.EId = this.queryParams.EId
-      this.initDatas();
+      this.initDatas()
       this.getUsersByRole()
+      this.getdevice()
     },
     methods: {
       initDatas() {
         if (this.formData.DataEntryId) {
           api.getEntity(this.formData.DataEntryId, this.$axios).then(res => {
+            console.log("---------res.data---",res.data)
             this.formData = res.data.mainitem;
             this.formData.DetectBasis = 'JJG 693-2011《 可燃气体检测报警器》检定规程'
             this.formData.StandardDesc = '可燃气体检测报警器检定装置'
@@ -741,7 +757,9 @@
               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
+              this.formCertificateData.InstrumentNo = res.data.ceritem[3].StanDevice
+              this.formData.StanDevice = res.data.ceritem[0].StanDevice
+              this.formData.InstrumentNo = res.data.ceritem[0].StanDevice
             }
             if (res.data.alvalitem != null) {
               for (var i = 0; i < res.data.alvalitem.length; i++) {
@@ -792,6 +810,81 @@
           });
         }
       },
+      getdevice() {
+        let _this = this
+        _this.$axios.get('/instrument/initlistdata', {})
+          .then(function (response) {
+            console.log("jkkfddf", response.data.items)
+            _this.DeviceList = response.data.items
+            console.log("-_this._this.DeviceList------", _this.DeviceList)
+            if (!_this.DeviceList) {
+              return false
+            }
+            for (var i = 0; i < _this.DeviceList.length; i++) {
+              let devicelist = _this.DeviceList[i]
+              instapi.getList(_this.DeviceList[i].Id, "", _this.$axios).then(res => {
+                if (res.data.currentItemCount === 1) {
+                  _this.StanDeviceoptions2.push({
+                    id: devicelist.Id,
+                    name: devicelist.Name,
+                  })
+                } else {
+                  _this.StanDeviceoptions.push({
+                    id: devicelist.Id,
+                    name: devicelist.Name,
+                  })
+                }
+              }).catch(err => {
+                console.error(err)
+              })
+            }
+          })
+          .catch(function (error) {
+            console.log(error)
+          })
+      },
+      chooseCertify2(value) {
+        let _this = this
+        let obj = {};
+        obj = this.StanDeviceoptions2.find((item) => {
+          return item.id === value;
+        });
+        this.formCertificateData.StanDevice = obj.name
+        let instrumentno = value
+        //访问接口
+        instapi.getList(instrumentno, "", this.$axios).then(res => {
+          this.certificateDataform = res.data.items
+          this.formCertificateData.CerNum = this.certificateDataform[0].CerNum
+          this.formCertificateData.Uncertainty = this.certificateDataform[0].Uncertainty
+          this.formCertificateData.StandVal = this.certificateDataform[0].StandVal
+          this.formCertificateData.EffectDate = this.certificateDataform[0].EffectDate
+
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      chooseCertify(value) {
+        let obj = {};
+        obj = this.StanDeviceoptions.find((item) => {
+          return item.id === value;
+        });
+        this.formData.StanDevice = obj.name
+        console.log(obj.name);
+        let _this = this
+        _this.InstrumentNo = value
+        //访问接口
+        instapi.getList(_this.InstrumentNo, "", this.$axios).then(res => {
+          this.certificateDataform = res.data.items
+          for (var i = 0; i < this.certificateDataform.length; i++) {
+            this.certificateData[i].CerNum = this.certificateDataform[i].CerNum
+            this.certificateData[i].Uncertainty = this.certificateDataform[i].Uncertainty
+            this.certificateData[i].StandVal = this.certificateDataform[i].StandVal
+            this.certificateData[i].EffectDate = this.certificateDataform[i].EffectDate
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       // 获取校核人列表
       getUsersByRole() {
         // request
@@ -977,6 +1070,7 @@
       addEntityMain() {
         if (this.certificateData != null) {
           for (var i = 0; i < this.certificateData.length; i++) {
+            this.certificateData[i].InstrumentNo = this.formData.InstrumentNo
             this.certificateData[i].StanDevice = this.formData.StanDevice
           }
         }
@@ -1014,6 +1108,7 @@
       updateEntity() {
         if (this.certificateData != null) {
           for (var i = 0; i < this.certificateData.length; i++) {
+            this.certificateData[i].InstrumentNo = this.formData.InstrumentNo
             this.certificateData[i].StanDevice = this.formData.StanDevice
           }
         }

+ 106 - 4
src/dashoo.cn/frontend_web/src/pages/lims/reportdetectorelectoxygen/_opera/operation.vue

@@ -87,7 +87,12 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="标准器名称:">
-              <el-input v-model="formData.StanDevice" placeholder="请输入" style="width: 100%"></el-input>
+              <el-select ref="refDevice" v-model="formData.InstrumentNo" clearable placeholder="请选择"
+                @change="chooseCertify" style="width: 100%">
+                <el-option v-for="item in StanDeviceoptions" :key="item.id" :label="item.name" :value="item.id">
+                </el-option>
+              </el-select>
+              <!-- <el-input v-model="formData.StanDevice" placeholder="请输入" style="width: 100%"></el-input> -->
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -126,7 +131,12 @@
       <el-form label-width="100px" ref="certificateForm" :model="formCertificateData">
         <el-col :span="8">
           <el-form-item label="标准器名称:">
-            <el-input v-model="formCertificateData.StanDevice" placeholder="请输入" style="width: 100%"></el-input>
+            <el-select ref="refDevice2" v-model="formCertificateData.InstrumentNo" clearable placeholder="请选择"
+              @change="chooseCertify2" style="width: 100%">
+              <el-option v-for="item in StanDeviceoptions2" :key="item.id" :label="item.name" :value="item.id">
+              </el-option>
+            </el-select>
+            <!-- <el-input v-model="formCertificateData.StanDevice" placeholder="请输入" style="width: 100%"></el-input> -->
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -386,6 +396,7 @@
     mapGetters
   } from 'vuex'
   import api from '@/api/meter/reportalertoroxygen'
+  import instapi from '@/api/system/instrument'
   export default {
     computed: {
       ...mapGetters({
@@ -449,6 +460,7 @@
         },
         //证书编号
         formCertificateData: {
+          Id: 0,
           StanDevice: '',
           CerNum: '',
           StandardUnit: '',
@@ -459,6 +471,7 @@
         },
         //certificateDataAll: [],
         certificateData: [{
+          Id: 0,
           value: 1,
           CerNum: '',
           StandardUnit: '',
@@ -468,6 +481,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }, {
+          Id: 0,
           value: 2,
           CerNum: '',
           StandardUnit: '',
@@ -477,6 +491,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }, {
+          Id: 0,
           value: 3,
           CerNum: '',
           StandardUnit: '',
@@ -488,6 +503,7 @@
         }],
         //报警误差
         alerValData: [{
+          Id: 0,
           AlertFunc: [],
           AlertFunction: [],
           Value1: '',
@@ -498,6 +514,7 @@
           MaxValue: '0',
           AllowValue: '0'
         }, {
+          Id: 0,
           AlertFunc: [],
           AlertFunction: [],
           Value1: '',
@@ -518,6 +535,7 @@
         }],
         //示值误差及响应时间
         deviationData: [{
+          Id: 0,
           GasValue: 5.13,
           Value1: '',
           Value2: '',
@@ -527,6 +545,7 @@
           DeviationRelative: '0',
           Deviation: ''
         }, {
+          Id: 0,
           GasValue: 12.7,
           Value1: '',
           Value2: '',
@@ -536,6 +555,7 @@
           DeviationRelative: '0',
           Deviation: ''
         }, {
+          Id: 0,
           GasValue: 20.05,
           Value1: '',
           Value2: '',
@@ -547,6 +567,7 @@
         }],
         //响应时间
         responseTimeForm: {
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -554,6 +575,7 @@
           Deviation: ''
         },
         responseTimeData: [{
+          Id: 0,
           GasValue: '',
           Value1: '',
           Value2: '',
@@ -562,6 +584,7 @@
         }],
         //重复性
         RepeatData: [{
+          Id: 0,
           GasValue: 12.7,
           Value1: '',
           Value2: '',
@@ -574,6 +597,7 @@
         }],
         //漂移
         ShiftData: [{
+          Id: 0,
           ValueType: '零点示值',
           value0: '',
           Value1: '',
@@ -585,6 +609,7 @@
           ZeroValue: '',
           ShowValue: ''
         }, {
+          Id: 0,
           ValueType: '量程示值',
           value0: '',
           Value1: '',
@@ -614,6 +639,7 @@
       this.formData.EId = this.queryParams.EId
       this.initDatas();
       this.getUsersByRole()
+      this.getdevice()
       //this.getDictOptions();
       // if (this.serviceId != 'add' && this.serviceId > 0) {
       //   this.formData.Id = this.serviceId;
@@ -648,8 +674,9 @@
               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
+              this.formCertificateData.InstrumentNo = res.data.ceritem[3].StanDevice
+              this.formData.StanDevice = res.data.ceritem[0].StanDevice
+              this.formData.InstrumentNo = res.data.ceritem[0].StanDevice
             }
             if (res.data.deviitem != null) {
               for (var i = 0; i < res.data.deviitem.length; i++) {
@@ -695,6 +722,81 @@
           });
         }
       },
+      getdevice() {
+        let _this = this
+        _this.$axios.get('/instrument/initlistdata', {})
+          .then(function (response) {
+            console.log("jkkfddf", response.data.items)
+            _this.DeviceList = response.data.items
+            console.log("-_this._this.DeviceList------", _this.DeviceList)
+            if (!_this.DeviceList) {
+              return false
+            }
+            for (var i = 0; i < _this.DeviceList.length; i++) {
+              let devicelist = _this.DeviceList[i]
+              instapi.getList(_this.DeviceList[i].Id, "", _this.$axios).then(res => {
+                if (res.data.currentItemCount === 1) {
+                  _this.StanDeviceoptions2.push({
+                    id: devicelist.Id,
+                    name: devicelist.Name,
+                  })
+                } else {
+                  _this.StanDeviceoptions.push({
+                    id: devicelist.Id,
+                    name: devicelist.Name,
+                  })
+                }
+              }).catch(err => {
+                console.error(err)
+              })
+            }
+          })
+          .catch(function (error) {
+            console.log(error)
+          })
+      },
+      chooseCertify2(value) {
+        let _this = this
+        let obj = {};
+        obj = this.StanDeviceoptions2.find((item) => {
+          return item.id === value;
+        });
+        this.formCertificateData.StanDevice = obj.name
+        let instrumentno = value
+        //访问接口
+        instapi.getList(instrumentno, "", this.$axios).then(res => {
+          this.certificateDataform = res.data.items
+          this.formCertificateData.CerNum = this.certificateDataform[0].CerNum
+          this.formCertificateData.Uncertainty = this.certificateDataform[0].Uncertainty
+          this.formCertificateData.StandVal = this.certificateDataform[0].StandVal
+          this.formCertificateData.EffectDate = this.certificateDataform[0].EffectDate
+
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      chooseCertify(value) {
+        let obj = {};
+        obj = this.StanDeviceoptions.find((item) => {
+          return item.id === value;
+        });
+        this.formData.StanDevice = obj.name
+        console.log(obj.name);
+        let _this = this
+        _this.InstrumentNo = value
+        //访问接口
+        instapi.getList(_this.InstrumentNo, "", this.$axios).then(res => {
+          this.certificateDataform = res.data.items
+          for (var i = 0; i < this.certificateDataform.length; i++) {
+            this.certificateData[i].CerNum = this.certificateDataform[i].CerNum
+            this.certificateData[i].Uncertainty = this.certificateDataform[i].Uncertainty
+            this.certificateData[i].StandVal = this.certificateDataform[i].StandVal
+            this.certificateData[i].EffectDate = this.certificateDataform[i].EffectDate
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       // 获取校核人列表
       getUsersByRole() {
         // request