Răsfoiți Sursa

bug,样本源名称修改相关样本同步,蜜蜂所样本源修改

shihang 6 ani în urmă
părinte
comite
2adeea27cb

+ 2 - 1
src/dashoo.cn/backend/api/business/samplesubpackage/samplesubpackageService.go

@@ -108,7 +108,8 @@ func (s *SampleSubpackageService) GetPagingEntitiesSerch(acccode string, pageInd
 
 	sql = ` select a.*,b.AccCode,b.SampleCode,b.SampleType,b.SampleTypeName,b.SamplingOrgan,b.SamplingOrganName,b.SamplingSite,b.SamplingSiteName,b.ReceiveDate,b.SourceId,b.SourceIdCard,b.SourceName,c.Name,c.DefaultCapacity,c.Unit,c.ValidityHours,c.WaningHours,c.SubpackageNum,c.SubpackageCapacity from 
 	` + tbldetail + ` a left join ` + tblmain + ` b on a.SampleCode = b.SampleCode  left join 
-	 SampleType c on b.SampleType = c.Id where ` + where + order
+	 SampleType c on b.SampleType = c.Id where ` + where + order +
+		` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
 	fmt.Println(sql)
 	List := make([]SamplesDetailModel, 0)
 	utils.DBE.Sql(sql).Find(&List)

+ 80 - 2
src/dashoo.cn/backend/api/controllers/biobank/samplessource.go

@@ -828,6 +828,84 @@ func (this *SamplesSourceController) SaveBee() {
 	}
 }
 
+// @Title 更新动物基本信息
+// @Description 更新动物基本信息
+// @Param	id	path	string	true		"需要修改的试管信息"
+// @Success	200	{object} controllers.Request
+// @router /editbee/:id [put]
+func (this *SamplesSourceController) EditBee() {
+	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 samplessource.AnimalInfo
+	var jsonblob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonblob, &model)
+	var entity samplessource.AnimalInfo
+	model.ModifiedBy = this.User.Username
+	model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
+	svc := samplessource.GetSamplesSourceService(utils.DBE)
+	var cols []string = []string{"Genus", "InnerNo", "Name", "Amount", "Unit", "SourceType", "Weight", "Province", "ProvinceName", "City", "CityName", "Street", "StreetName", "Address", "AreaCode", "Longitude", "Latitude", "Altitude", "SurveyDate", "ProjectId", "ProjectName", "Remark", "ModifiedBy", "ModifiedUserId"}
+	zback := svc.QueryZBackList(this.User.AccCode)
+	for i := 0; i < (len(zback)); i++ {
+		cols = append(cols, zback[i].Id)
+	}
+	opdesc := "修改样本来源-" + model.Name
+	err := svc.UpdateDonorAndWriteLogBytbl(this.User.AccCode+AnimaltbName, this.User.AccCode+DonorslogtbName, id, &model, &entity, cols, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, model.Name)
+
+	if err == nil {
+		var codemodel codecsequence.CodecSequence
+		where_seq := "AccCode = '" + this.User.AccCode + "'"
+		where_seq += " and SeqName = '" + strconv.Itoa(model.Id) + "'"
+		svc.GetEntityByWhereBytbl(CodecSequenceName, where_seq, &codemodel)
+		codemodel.MaxValue = codemodel.MinValue + model.Amount - 1
+		codemodel.ModifiedBy = this.User.Username
+		codemodel.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
+		var code_cols []string = []string{"MaxValue", "ModifiedBy", "ModifiedUserId"}
+		svc.UpdateEntityBywheretbl(CodecSequenceName, &codemodel, code_cols, where_seq)
+
+		var sourceModel samplessource.AnimalInfo
+		sourceModel.InnerNo = model.AreaCode + "-" + fmt.Sprintf("%04s", strconv.Itoa(codemodel.MinValue)) + "——" + model.AreaCode + "-" + fmt.Sprintf("%04s", strconv.Itoa(codemodel.MaxValue))
+		where_innor := "Id = '" + strconv.Itoa(model.Id) + "'"
+		var cols_source []string = []string{"InnerNo"}
+		svc.UpdateEntityBywheretbl(this.User.AccCode+AnimaltbName, &sourceModel, cols_source, where_innor)
+	}
+
+	if err == nil {
+		var list []samplesinfo.SamplesMain
+		where_list := "SourceId = '" + strconv.Itoa(model.Id) + "'"
+		svc.GetEntitysByWhere(this.User.AccCode+SamplesMaintbName, where_list, &list)
+		if len(list) > 0 {
+			for i := 0; i < len(list); i++ {
+				var SamEntity samplesinfo.SamplesMain
+				where_sam := "MId = '" + strconv.Itoa(list[i].MId) + "'"
+				SamEntity.SourceName = model.Name
+				SamEntity.MCreateBy = this.User.Username
+				SamEntity.MCreateUserId, _ = utils.StrTo(this.User.Id).Int()
+				var cols_sam []string = []string{"SourceName", "ModifiedBy", "ModifiedUserId"}
+				svc.UpdateEntityBywheretbl(this.User.AccCode+SamplesMaintbName, &SamEntity, cols_sam, where_sam)
+			}
+		}
+	}
+
+	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 新增动物来源基本信息
 // @Success	200	{object}
 // @router /saveanimal [post]
@@ -949,9 +1027,9 @@ func (this *SamplesSourceController) DelBioInfo() {
 	}
 	var entity samplessource.AnimalInfo
 	var entityempty samplessource.AnimalInfo
-	opdesc := "删除生物样本源-" + id
+	opdesc := "删除样本来源-" + entity.Name
 	svc := samplessource.GetSamplesSourceService(utils.DBE)
-	err := svc.DeleteDonorAndWriteLogBytbl(this.User.AccCode+AnimaltbName, BaseOperationLogName, id, &entity, &entityempty, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "样本来源")
+	err := svc.DeleteDonorAndWriteLogBytbl(this.User.AccCode+AnimaltbName, this.User.AccCode+DonorslogtbName, id, &entity, &entityempty, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, entity.Name)
 
 	if err == nil {
 		where_code := "SeqName = '" + id + "'"

+ 2 - 2
src/dashoo.cn/frontend_animal/src/components/samples/abstractdialog.vue

@@ -58,7 +58,7 @@
           <el-col :span="12">
             <el-form-item label="样本类型" prop="NewsSampleType" required>
               <el-select v-model="TiQuForm.NewsSampleType" @change="choosetype" style="width:100%" placeholder="请选择">
-                <el-option v-for="item in sampletypes" :label="item.Name" :value="item.Id+''" :key="item"></el-option>
+                <el-option v-for="item in sampletypes" :label="item.Name" :value="item.Id+''" :key="item.Name"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
@@ -67,7 +67,7 @@
               <el-input v-model="TiQuForm.NewCapacity" placeholder="容量" style="width:50%">
               </el-input>
               <el-select v-model="TiQuForm.NewsUnit" style="width:48%" placeholder="单位">
-                <el-option v-for="item in sampeunitlist" :label="item.Value" :value="item.Value" :key="item">
+                <el-option v-for="item in sampeunitlist" :label="item.Value" :value="item.Value" :key="item.Value">
                 </el-option>
               </el-select>
             </el-form-item>

+ 1 - 1
src/dashoo.cn/frontend_animal/src/components/samples/chooseanimal.vue

@@ -48,7 +48,7 @@
         </el-table-column> -->
       </el-table>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-        :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
+        :page-sizes="[10, 20, 50, 100]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
         :total="currentItemCount">
       </el-pagination>
     </el-dialog>

+ 11 - 6
src/dashoo.cn/frontend_animal/src/components/samples/preoperation.vue

@@ -36,13 +36,10 @@
         </el-row>
       </el-form>
       <div style="margin:-15px -5px 34px 0">
-        <el-pagination style="float: right;margin-top:0px;margin-bottom:2px" @current-change="handleCurrentChange"
-          :current-page="currentPage" layout="prev, pager, next" :page-size="pagesize" :total="currentItemCount">
-        </el-pagination>
         <el-button style="float: right;margin:3px 15px 0 0;" type="primary" class="el-button--mini" @click="seachdata">
           查询</el-button>
       </div>
-      <el-table :data="sampleyulurulist" :stripe="true" border>
+      <el-table :data="sampleyulurulist" :stripe="true" size="mini" border height="calc(100vh - 400px)">
         <el-table-column label="操作" width="80">
           <template slot-scope="scope">
             <el-button size="small" @click="handleselect(scope.row)" type="text" title="选择"><i
@@ -78,6 +75,10 @@
           </template>
         </el-table-column>
       </el-table>
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+        :page-sizes="[10, 20, 50, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper"
+        :total="currentItemCount">
+      </el-pagination>
     </el-dialog>
   </div>
 </template>
@@ -95,8 +96,7 @@
       },
       model: {}
     },
-    created() {
-    },
+    created() {},
     computed: {
       ...mapGetters({
         session: 'session',
@@ -211,6 +211,11 @@
         this.currentPage = value
         this.initData()
       },
+      handleSizeChange(value) {
+        this.pagesize = value
+        this.currentPage = 1
+        this.initData()
+      },
       // 组织器官和取材部位的连接
       choose(value) {
         this.ssoption = []

+ 1 - 1
src/dashoo.cn/frontend_animal/src/pages/biobank/source/_opera/operationb.vue

@@ -491,7 +491,7 @@
             let jsonobj = JSON.parse(jsonstr)
             // 拼接两个对象
             params = Object.assign(params, jsonobj)
-            _this.$axios.put('/samplessource/editanimal/' + _this.pid, params)
+            _this.$axios.put('/samplessource/editbee/' + _this.pid, params)
               .then(res => {
                 if (res.data.code === 0) {
                   _this.$message({

+ 4 - 2
src/dashoo.cn/frontend_animal/src/pages/equipment/_opera/manage_new.vue

@@ -2895,7 +2895,7 @@
         this.xshelf = xshelf
         this.yshelf = yshelf
         this.ybox = ybox + 1
-        this.xbox = -1
+        //this.xbox = -1
       },
 
       uploadrequest(option) {
@@ -3004,6 +3004,7 @@
         this.dchytable = -1
       },
       tableclk(v, x, y) {
+         console.log("11111111111111111111",v, x, y)
         this.checkPosition =
           `${this.equipCode}-${this.numtoupchar(this.xshelf)}${this.yshelf}-${this.numtoupchar(this.ybox)}${this.xbox}-${this.numtoupchar(x)}${y}`
         //清空状态
@@ -3407,7 +3408,8 @@
                       type: 'success',
                       message: res.data.message
                     })
-                    _this.shelfs = _this.samplelist[0]
+                    _this.getEquipPosition(_this.ybox-1,_this.xshelf,_this.yshelf)
+                    //_this.shelfs = _this.samplelist[0]
                     _this.handleclk(_this.xbox-1, _this.ybox-1, _this.xshelf, _this.yshelf)
                     // 获取附件信息
                     _this.getattachment(_this.sampleForm.BarCode, _this.sampleForm.SampleCode)

+ 17 - 7
src/dashoo.cn/frontend_animal/src/pages/samples/prerecorded/_opera/unhumanpre.vue

@@ -173,14 +173,14 @@
               </el-date-picker>
             </el-form-item>
           </el-col>
-          <el-col :span="8">
+          <!-- <el-col :span="8">
             <el-form-item label="录入人">
               <el-select ref="reflrrselect" v-model="sampleform.CreateUserId" style="width:100%">
                 <el-option v-for="item in userlist" :label="item.Realname" :value="item.Id" :key="item.Id">
                 </el-option>
               </el-select>
             </el-form-item>
-          </el-col>
+          </el-col> -->
           <el-col :span="8">
             <el-form-item label="所属分组">
               <el-select ref="refGroup" multiple filterable default-first-option v-model="GroupIdOption"
@@ -214,7 +214,8 @@
             <legend style="color:#436EEE"></legend>
             <i class="icon icon-paragraph-justify"> 样本分装预览</i>
           </div>
-          <el-table ref="multipleTable" :data="tableDataOne" border tooltip-effect="dark" style="width: 100%">
+          <el-table ref="multipleTable" :data="tableDataOne" border tooltip-effect="dark" size="mini"
+            height="calc(100vh - 410px)">
             <el-table-column label="操作" width="70px" align="center" header-align="center">
               <template slot-scope="scope">
                 <el-button type="text" size="small" title="删除" @click="deleteInfo(scope.row)" icon="el-icon-delete">
@@ -238,8 +239,8 @@
             </el-table-column>
           </el-table>
           <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-            :current-page="currentpage" :page-sizes="[10, 15, 20]" :page-size="size"
-            layout="total, sizes, prev, next, jumper" :total="currentItemCount">
+            :current-page="currentpage" :page-sizes="[10, 20, 50]" :page-size="size"
+            layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
           </el-pagination>
         </el-card>
 
@@ -811,7 +812,7 @@
             // 转换为json对象
             let jsonobj = JSON.parse(jsonstr)
             // 拼接两个对象
-            _this.sampleform.CreateBy = _this.$refs.reflrrselect.selectedLabel
+            //_this.sampleform.CreateBy = _this.$refs.reflrrselect.selectedLabel
             let params = _this.sampleform
             params = Object.assign(params, jsonobj)
             //拼接群号列表
@@ -829,7 +830,15 @@
                 ValidityDateint: _this.sampleform.ValidityDate.getTime()
               })
             }
-            _this.samplecodelist.push(_this.SampleCodeOld)
+            let codearr = this.SampleCodeOld.split('-')
+            if (codearr[1] == '全部') {
+              for (var i = 0; i < _this.groupcodeList.length - 1; i++) {
+                _this.samplecodelist.push(_this.AreaCode + '-' + _this.groupcodeList[i].label + '-' + _this
+                  .TypeCode)
+              }
+            } else {
+              _this.samplecodelist.push(_this.SampleCodeOld)
+            }
 
             if (_this.GroupIdOption.length > 0) {
               _this.GroupId = _this.GroupIdOption.join(',');
@@ -942,6 +951,7 @@
           _currentPage: _this.currentpage,
           _size: _this.size,
         }
+        console.log("11111111111111111", params)
         this.$axios.get('samplesubpackage/subpackagelist/' + _this.samplecodelist, {
             params
           })

+ 0 - 1
src/dashoo.cn/frontend_animal/src/pages/samples/prerecorded/index.vue

@@ -545,7 +545,6 @@
           SamplingOrgan: _this.selectsigorg,
           GroupName: _this.GroupName
         }
-         console.log("ddddddddddddddd",this.STNoteField)
         if (this.CreateOn && this.CreateOn.length === 2) {
           let params2 = {
             CreateOnstart: this.CreateOn[0] / 1000,

+ 9 - 3
src/dashoo.cn/frontend_web/src/components/samples/preoperation.vue

@@ -50,9 +50,6 @@
         </el-row>
       </el-form>
       <div style="margin:-15px -5px 34px 0">
-        <el-pagination style="float: right;margin-top:0px;margin-bottom:2px" @current-change="handleCurrentChange"
-          :current-page="currentPage" layout="prev, pager, next" :page-size="pagesize" :total="currentItemCount">
-        </el-pagination>
         <el-button style="float: right;margin:3px 15px 0 0;" type="primary" class="el-button--mini" @click="seachdata">
           查询</el-button>
       </div>
@@ -96,6 +93,10 @@
           </template>
         </el-table-column>
       </el-table>
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+        :page-sizes="[10, 15, 20, 50]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper"
+        :total="currentItemCount">
+      </el-pagination>
     </el-dialog>
   </div>
 </template>
@@ -220,6 +221,11 @@
         this.currentPage = value
         this.initData()
       },
+      handleSizeChange(value) {
+        this.pagesize = value
+        this.currentPage = 1
+        this.initData()
+      },
       // 组织器官和取材部位的连接
       choose(value) {
         this.ssoption = []

+ 3 - 2
src/dashoo.cn/frontend_web/src/pages/equipment/_opera/manage_new.vue

@@ -2919,7 +2919,7 @@
         this.xshelf = xshelf
         this.yshelf = yshelf
         this.ybox = ybox + 1
-        this.xbox = -1
+      //  this.xbox = -1
       },
 
       uploadrequest(option) {
@@ -3436,7 +3436,8 @@
                       type: 'success',
                       message: res.data.message
                     })
-                    _this.shelfs = _this.samplelist[0]
+                    _this.getEquipPosition(_this.ybox-1,_this.xshelf,_this.yshelf)
+                   // _this.shelfs = _this.samplelist[0]
                     _this.handleclk(_this.xbox - 1, _this.ybox - 1, _this.xshelf, _this.yshelf)
 
                     // 清空上传附件

+ 5 - 4
src/dashoo.cn/frontend_web/src/pages/samples/prerecorded/_opera/prerecordedadd.vue

@@ -177,7 +177,8 @@
             <legend style="color:#436EEE"></legend>
             <i class="icon icon-paragraph-justify"> 样本分装预览</i>
           </div>
-          <el-table ref="multipleTable" :data="tableDataOne" border tooltip-effect="dark" style="width: 100%">
+          <el-table ref="multipleTable" :data="tableDataOne" border tooltip-effect="dark" size="mini"
+            height="calc(100vh - 410px)">
             <el-table-column label="操作" width="70px" align="center" header-align="center">
               <template slot-scope="scope">
                 <el-button type="text" size="small" title="删除" @click="deleteInfo(scope.row)" icon="el-icon-delete"></el-button>
@@ -193,9 +194,9 @@
             <el-table-column prop="SourceIdCard" label="身份证号" align="center" header-align="center"
               show-overflow-tooltip></el-table-column>
           </el-table>
-          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentpage"
-            :page-sizes="[10, 15, 20]" :page-size="size" layout="total, sizes, prev, next, jumper" :total="currentItemCount">
-          </el-pagination>
+          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+            :current-page="currentpage" :page-sizes="[10, 15, 20]" :page-size="size"
+            layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
         </el-card>
 
         <el-row :gutter="20">