4
0
shiyi преди 6 години
родител
ревизия
73a7f9e283

+ 6 - 2
src/dashoo.cn/backend/api/business/samplessource/samplessource.go

@@ -124,8 +124,12 @@ type AnimalInfo struct {
 	Latitude       string    `xorm:"VARCHAR(50)"`
 	Altitude       string    `xorm:"VARCHAR(50)"`
 	SurveyDate     time.Time `xorm:"DATE`
-	ProjectId      int       `xorm:"INT(10)"`
-	ProjectName    string    `xorm:"VARCHAR(50)"`
+	ProjectId      int       `xorm:"INT(10)"`		//项目Id
+	ProjectName    string    `xorm:"VARCHAR(50)"`	//项目名称
+	AuditorId      int       `xorm:"INT(10)"`		//审核人Id
+	AuditorName    string    `xorm:"VARCHAR(50)"`	//审核人姓名
+	AuditorStatus  int    	 `xorm:"INT(10)"`		//审核状态 0 未审核 1 审核成功 2 审核失败
+	AuditorRemark  string  	 `xorm:"VARCHAR(200)"`	//审核说明
 	CreateUserId   int       `xorm:"INT(10)"`
 	CreateBy       string    `xorm:"VARCHAR(255)"`
 	CreateOn       time.Time `xorm:"DATETIME created"`

+ 12 - 12
src/dashoo.cn/backend/api/controllers/biobank/samplesbook.go

@@ -383,26 +383,26 @@ func (this *SamplesBookController) Getcollectioninfo() {
 	var entity samplesbook.SamplesBook
 	svc := samplesbook.GetSamplesBookService(utils.DBE)
 	where := " Id ='" + id + "'"
-	protocolno := this.GetString("protocolno")
-	collectionno := this.GetString("collectionno")
+	ProtocolNo := this.GetString("ProtocolNo")
+	CollectionNo := this.GetString("CollectionNo")
 	SampleCode := this.GetString("SampleCode")
-	rongqibianhao := this.GetString("rongqibianhao")
-	caijirenyuan := this.GetString("caijirenyuan")
+	ContainerNo := this.GetString("ContainerNo")
+	Collectors := this.GetString("Collectors")
 	CollectionDate := this.GetString("CollectionDate")
-	if protocolno != "" {
-		where = where + " and protocolno like '%" + protocolno + "%'"
+	if ProtocolNo != "" {
+		where = where + " and ProtocolNo like '%" + ProtocolNo + "%'"
 	}
-	if collectionno != "" {
-		where = where + " and collectionno like '%" + collectionno + "%'"
+	if CollectionNo != "" {
+		where = where + " and CollectionNo like '%" + CollectionNo + "%'"
 	}
 	if SampleCode != "" {
 		where = where + " and SampleCode like '%" + SampleCode + "%'"
 	}
-	if rongqibianhao != "" {
-		where = where + " and rongqibianhao like '%" + rongqibianhao + "%'"
+	if ContainerNo != "" {
+		where = where + " and ContainerNo like '%" + ContainerNo + "%'"
 	}
-	if caijirenyuan != "" {
-		where = where + " and caijirenyuan like '%" + caijirenyuan + "%'"
+	if Collectors != "" {
+		where = where + " and Collectors like '%" + Collectors + "%'"
 	}
 	if CollectionDate != "" {
 		dates := strings.Split(CollectionDate, ",")

+ 51 - 0
src/dashoo.cn/backend/api/controllers/biobank/samplessource.go

@@ -667,6 +667,8 @@ func (this *SamplesSourceController) AnimalList() {
 	CreateOn := this.GetString("CreateOn")
 	SourceType := this.GetString("SourceType")
 	Address := this.GetString("Address")
+	AuditorStatus := this.GetString("AuditorStatus")
+	AuditorName := this.GetString("AuditorName")
 
 	svc := samplessource.GetSamplesSourceService(utils.DBE)
 	where := " 1=1"
@@ -711,6 +713,12 @@ func (this *SamplesSourceController) AnimalList() {
 	if Address != "" {
 		where = where + " and ( ProvinceName like '%" + Address + "% or CityName like '%" + Address + "% or StreetName like '%" + Address + "% or Address like '%" + Address + "%)'"
 	}
+	if AuditorStatus != "" {
+		where = where + " and AuditorStatus = '" + AuditorStatus + "'"
+	}
+	if AuditorName != "" {
+		where = where + " and AuditorName = '" + AuditorName + "'"
+	}
 
 	total := svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, page.CurrentPage, page.Size, orderby, asc, &list, where)
 	var datainfo DataInfo
@@ -897,6 +905,49 @@ func (this *SamplesSourceController) DelBioInfo() {
 	}
 }
 
+// @Title 审核生物样本来源信息
+// @Description 审核生物样本来源信息
+// @Param	id	path	string	true
+// @Success	200	{object}
+// @router /auditoranimal/:id [put]
+func (this *SamplesSourceController) AuditorAnimal() {
+
+	//进行部分修改
+	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.AuditorName = this.User.Realname
+	model.AuditorId, _ = utils.StrTo(this.User.Id).Int()
+	model.ModifiedBy = this.User.Realname
+	model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
+	svc := samplessource.GetSamplesSourceService(utils.DBE)
+	opdesc := "审核样本来源-" + model.Name
+	var cols []string = []string{"AuditorStatus", "AuditorId", "AuditorName", "AuditorRemark", "ModifiedBy", "ModifiedUserId"}
+	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, "样本采集")
+
+	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 get user by token
 // @Success 200 {object} models.Userblood

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

@@ -22,7 +22,14 @@
           <el-breadcrumb-item>{{pagetitle}}</el-breadcrumb-item>
         </el-breadcrumb>
         <span style="float: right;">
-          <el-button type="primary" style="margin-left: 8px" class="el-button--mini" @click="savedata">保存</el-button>
+
+          <!--审核模块 暂未进行任何修改版本-->
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="auditorshow"
+                     :disabled="samplesForm.AuditorStatus != 0">审核</el-button>
+          <!--审核模块结束-->
+
+          <el-button type="primary" style="margin-left: 8px" class="el-button--mini" @click="savedata"
+                     :disabled="samplesForm.AuditorStatus != 0">保存</el-button>
           <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px"
             onclick="window.history.go(-1)">返回</el-button>
         </span>
@@ -174,6 +181,26 @@
         </el-tabs>
       </el-form>
     </el-card>
+
+
+    <el-dialog title="审核信息" :visible.sync="auditorShow" top="5vh">
+      <el-form :model="shenheForm" label-width="130px" ref="shenheForm">
+        <el-form-item label="审核状态">
+          <template>
+            <el-radio class="radio" v-model="shenheForm.SuccessStatus" :label="1">审核通过</el-radio>
+            <el-radio class="radio" v-model="shenheForm.SuccessStatus" :label="2">审核异常</el-radio>
+          </template>
+        </el-form-item>
+        <el-form-item label="审核说明">
+          <el-input type="textarea" v-model="shenheForm.AuditorRemark" placeholder="请输入审核说明"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer" style="margin-top: -25px">
+        <el-button size="small" @click="auditorShow = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="auditor()">确 定</el-button>
+      </div>
+    </el-dialog>
+
     <el-dialog :title="ImageTitle" width="80%" :visible.sync="imageDialog">
       <el-upload action="" :before-upload="beforeAvatarUpload" :on-preview="handlePictureCardPreview"
         :http-request="uploadrequest" :on-success="handleAvatarSuccess" :on-remove="handleRemove"
@@ -246,8 +273,18 @@
           SurveyDate: new Date(),
           ProjectId: '',
           ProjectName: '',
+          AuditorId: '',
+          AuditorName: '',
+          AuditorStatus: '',
+          AuditorRemark: '',
           Remark: '',
         },
+        //审核按钮可否点击
+        auditorShow: false,
+        shenheForm: {
+          SuccessStatus: 1,
+          AuditorRemark: ''
+        },
         extendForm: {},
         sampeunitlist: [],
         genuslist: [],
@@ -451,6 +488,53 @@
           }
         })
       },
+      // 打开审核弹窗
+      auditorshow() {
+        let _this = this
+        _this.auditorShow = true
+      },
+      auditor() {
+        let _this = this
+        _this.$confirm("确定审核该样本来源?审核后所有信息将不可修改!", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            if (_this.shenheForm.SuccessStatus == 1) {
+              _this.samplesForm.AuditorStatus = 1
+            } else {
+              _this.samplesForm.AuditorStatus = 2
+            }
+            _this.samplesForm.AuditorRemark = _this.shenheForm.AuditorRemark
+            _this.auditorShow = false
+            _this.saveauditor()
+          })
+          .catch(() => {})
+      },
+      saveauditor() {
+        let _this = this
+        _this.$axios.put('/samplessource/auditoranimal/' + _this.pid, _this.samplesForm)
+          .then(res => {
+            // response
+            if (res.data.code === 0) {
+              _this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+              _this.getanimalinfo()
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+      },
       // 获取样本单位
       getsampetypeunit() {
         let _this = this

+ 28 - 0
src/dashoo.cn/frontend_animal/src/pages/biobank/source/animal.vue

@@ -68,6 +68,14 @@
             <p>{{scope.row.Amount}} {{scope.row.Unit}}</p>
           </template>
         </el-table-column>
+        <el-table-column prop="AuditorStatus" sortable label="审核状态" align="center" min-width="80">
+          <template slot-scope="scope">
+            <el-tag v-show="scope.row.AuditorStatus=='0'" type="warning">未审核</el-tag>
+            <el-tag v-show="scope.row.AuditorStatus=='1'" type="success">审核成功</el-tag>
+            <el-tag v-show="scope.row.AuditorStatus=='2'" type="danger">审核失败</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column prop="AuditorName" sortable label="审核人" align="center" show-overflow-tooltip></el-table-column>
         <el-table-column prop="SurveyDate" sortable align="center" label="采样日期" min-width="80" show-overflow-tooltip>
           <template slot-scope="scope">
             <p>{{jstimehandle(scope.row.SurveyDate)}}</p>
@@ -130,6 +138,22 @@
               </el-select>
             </el-form-item>
           </el-col>
+          <el-col :span="12">
+            <el-form-item label="审核状态">
+              <el-select ref="refplace" v-model="searchform.AuditorStatus" size="mini" style="width: 240px"
+                         placeholder="请选择样本来源">
+                <el-option label="未审核" value="0"></el-option>
+                <el-option label="审核成功" value="1"></el-option>
+                <el-option label="审核失败" value="2"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="审核人名称">
+              <el-input size="mini" v-model="searchform.AuditorName" style="width:100%" placeholder="请输入审核人名称"></el-input>
+            </el-form-item>
+          </el-col>
+
           <!-- <el-col :span="12">
             <el-form-item label="数量">
               <el-input size="mini" v-model="searchform.Amount" style="width:100%" placeholder="请输入数量(群)"></el-input>
@@ -168,6 +192,8 @@
           Name: '',
           Weight: '',
           SourceType: '',
+          AuditorStatus: '',
+          AuditorName: '',
           Tive: '',
           remark: '',
           starttime: null,
@@ -311,6 +337,8 @@
         this.searchform.InnerNo = ''
         this.searchform.SourceType = ''
         this.searchform.Name = ''
+        this.searchform.AuditorStatus = ''
+        this.searchform.AuditorName = ''
         this.SurveyDate = []
         this.CreateOn = []
         this.initdata()