3
2
Prechádzať zdrojové kódy

bug

Signed-off-by: lijunqing <lijunqing@dashoo.cn>
lijunqing 6 rokov pred
rodič
commit
14ca5e1f89

+ 22 - 0
src/dashoo.cn/backend/api/controllers/lims/limscheckequipmentlist.go

@@ -281,6 +281,28 @@ func (this *LimsCheckEquipmentListController) AddEntity() {
 	}
 }
 
+// @Title删除文件
+// @Description
+// @Success	200	{object}
+// @router /deletefile/:id [get]
+func (this *LimsCheckEquipmentListController) DeleteFile() {
+	id := this.Ctx.Input.Param(":id")
+	svc := limscheckequipmentlist.GetLimsCheckEquipmentListService(utils.DBE)
+	err:=svc.DeleteEntityBytbl("Statutefile","Id='"+id+"'")
+	var errinfo ErrorDataInfo
+	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 修改实体
 // @Param 	body body limscheckequipmentlist.LimsCheckEquipmentList

+ 27 - 3
src/dashoo.cn/frontend_web/src/pages/lims/checkequipmentlist/index.vue

@@ -361,7 +361,11 @@
                     height="150px"
                     size="mini"
                     :show-header="false">
-            <el-table-column prop="FileName">
+            <el-table-column>
+              <template slot-scope="scope">
+               <el-link :href="'http://'+scope.row.FileUrl" target="_blank" type="primary">
+                {{scope.row.FileName}}</el-link>
+              </template>
             </el-table-column>
             <el-table-column width="80">
               <template slot-scope="scope">
@@ -515,6 +519,7 @@ export default {
         }
 
       ],
+      entityId: 0,
       formData: {
         Id: 0,
         DepartmentId: 0,
@@ -566,8 +571,26 @@ export default {
     this.getDetectionCycle()
   },
   methods: {
-    handleDelete () {
-
+    handleDelete (row) {
+      let _this = this
+      _this.$axios.get('/limscheckequipmentlist/deletefile/' + row.Id, { })
+        .then(res => {
+          if (res.data.code === 0) {
+            this.initEntity(this.entityId)
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        })
+        .catch(err => {
+          console.error(err)
+        })
     },
 
     changeDetectionCycle (val) {
@@ -864,6 +887,7 @@ export default {
       this.formData.PositionID = value[1]
     },
     ShowEntityDialog (entityId) {
+      this.entityId = entityId
       this.addoredittitle = '编辑'
       this.$nextTick(() => {
         this.$refs.refmaintainlogattach.clearFiles()