浏览代码

1.蜜蜂所添加冻存盒备注信息

hanmj 6 年之前
父节点
当前提交
a52934c222

+ 34 - 0
src/dashoo.cn/backend/api/controllers/equipment/shelfset.go

@@ -907,4 +907,38 @@ func (this *ShelfSetController) GetCountByBoxs() {
 	errinfo.Code = 0
 	this.Data["json"] = &errinfo
 	this.ServeJSON()
+}
+
+// @Title 更新冻存盒备注信息
+// @Description 更新冻存盒备注信息
+// @Success 200 {object} business.device.DeviceChannels
+// @router /UpdateBoxInfo [get]
+func (this *ShelfSetController) UpdateBoxInfo() {
+	// 初始化服务
+	var errinfo ErrorDataInfo
+	boxid := this.GetString("boxid")
+	remark := this.GetString("remark")
+	svc := shelfset.GetshelfsetService(utils.DBE)
+	var boxinfo shelfset.Box
+	var cols []string = []string{ "Remark", "ModifiedUserId", "ModifiedBy", "ModifiedOn"}
+	boxinfo.Remark = remark
+	boxinfo.ModifiedBy = this.User.Realname
+	boxinfo.ModifiedOn = time.Now()
+	boxinfo.ModifiedUserId,_ = utils.StrTo(this.User.Id).Int()
+	where := "Id = " + boxid
+	_,err := svc.UpdateEntityColsByWhere(boxinfo,where,cols)
+
+	// 错误检测
+	if err != nil {
+		errinfo.Message = "保存备注信息失败!"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	} else {
+		errinfo.Message = "保存成功!"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
 }

+ 86 - 1
src/dashoo.cn/frontend_animal/src/pages/equipment/_opera/manage_new.vue

@@ -201,6 +201,49 @@
 
           </el-card>
         </el-col>
+        <!--冻存盒备注信息 开始-->
+        <el-col :span="24">
+          <el-card  class="box-card" id="sampleboxcard">
+            <div slot="header">
+              <i class="icon icon-file-text"> </i> 冻存盒备注信息
+              <span style="float: right;">
+                <el-button type="primary" class="el-button--mini" @click="saveboxinfo()">保存</el-button>
+              </span>
+            </div>
+
+            <el-row>
+              <el-col :span="6">
+                <label>设备名称:{{ equipName }}</label>
+              </el-col>
+              <el-col :span="6">
+                <label>冻存架位置:第{{ selectedShelf.YStation }}层,第{{ selectedShelf.XStation }}列。</label>
+              </el-col>
+              <el-col :span="6">
+                <label>冻存架条码:{{ selectedShelf.Code }}</label>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="6">
+                <label>冻存盒位置:第{{ selectedBox.YStation }}层,第{{ selectedBox.XStation }}列 。</label>
+              </el-col>
+              <el-col :span="6">
+                <label>冻存盒条码:{{ selectedBox.Code }}</label>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="1">
+                <label>备注:</label>
+              </el-col>
+              <el-col :span="14">
+                <el-input type="textarea" v-model="selectedBox.Remark" placeholder="请输入备注信息"></el-input>
+              </el-col>
+            </el-row>
+          <el-row>
+          </el-row>
+              
+          </el-card>
+        </el-col>
+         <!--冻存盒备注信息 结束-->
         <el-col :span="24">
           <el-card v-if="Apply_flag" class="box-card sampledetail" id="equiinfocard">
             <div slot="header">
@@ -845,6 +888,7 @@
         checkPosition: '',
         samplelist: [], // 新增,新的冰箱list和冻存盒list以及冻存盒样本list
         selectedBox: [],
+        selectedShelf: {},
         boxSample: [],
         equipid: 0, // 新增,设备id
         COLORARR: ['#EAEAEA', '#13CE66', '#FF4949', '#D1EEEE', '#20A0FF', '#836FFF', '#000080',
@@ -2895,7 +2939,9 @@
         batchitem: '0', // 批量添加类型,1:由交接单存储过来,带有样本类型,样本来源信息;2:有制备存储过来,不带样本类型等信息
         batchstorages: [], // 批量存储的样本
         Apply_flag: true,
-        acc: ''
+        acc: '',
+        sampleboxinfo: {
+        }
       }
     },
     created () {
@@ -3281,6 +3327,7 @@
         var inputstr = _this.equipid + ',' + yshelf + ',' + xshelf + ',' + (xbox + 1) + ',' + (ybox + 1)
         _this.$axios.get('/shelfset/boxdraw/' + inputstr, {})
           .then(res => {
+            _this.selectedShelf = res.data.Shelfbox
             _this.selectedBox = res.data.Boxshelf
             _this.boxSample = res.data.Boxsample
             _this.TableHeight = _this.selectedBox.RowNum
@@ -4291,6 +4338,44 @@
           if (arrs[v] === (str + '')) return true
         }
         return false
+      },
+      jssubstrhandle (val, no) {
+        let position = val.split(';')
+        return position[no]
+      },
+      saveboxinfo () {
+        let _this = this
+        if (this.selectedBox.length === 0) {
+          _this.$message({
+            type: 'warning',
+            message: '请先选择冻存盒,在添加备注信息。'
+          })
+          return false
+        }
+        if (this.selectedBox.Id === 0) {
+          _this.$message({
+            type: 'warning',
+            message: '所选位置无冻存盒,无法添加备注信息。'
+          })
+          return false
+        }
+        _this.$axios.get('/shelfset/UpdateBoxInfo?boxid=' + this.selectedBox.Id + '&remark=' + this.selectedBox.Remark, {})
+          .then(res => {
+            if (res.data.code === 0) {
+              _this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
       }
     }
   }

+ 2 - 2
src/dashoo.cn/frontend_animal/src/pages/equipment/index.vue

@@ -32,7 +32,7 @@
         无显示数据
       </div>
       <el-row class="equipmentlistcss">
-        <el-col :span="6" v-for="(v, index) in list" style="min-width:240px;" :key="v">
+        <el-col :span="6" v-for="(v, index) in list" style="min-width:240px;" :key="v.Equipment.Id">
           <el-card class="devicecardlist">
             <div slot="header" style="font-weight: 800; font-size: 14px; height:12px;">
               <div style="float: left;height:23px;overflow:hidden;width:70%" :title="v.Equipment.Name">{{v.Equipment.Name}}</div>
@@ -50,7 +50,7 @@
                   <img v-if="v.Equipment.EAccCode == 'ALL'" :src="remoteurl + v.Equipment.Photo" style="height: 98px;">
                   <img v-else :src="'http://' + v.Equipment.Photo" style="height: 98px;">
                 </router-link>
-                <div class="devicesensor" v-for="sensorno in v.SensorData" :key="sensorno">
+                <div class="devicesensor" v-for="sensorno in v.SensorData" :key="sensorno.SensorNo">
                   <router-link :to="'/equipment/devicechart?sensorno='+ sensorno.SensorNo + '_6&xn=' + sensorno.SensorNo">
                     {{sensorno.Temperature}}
                   </router-link>