浏览代码

人员管理

liuyang 5 年之前
父节点
当前提交
868e35cd26

+ 1 - 0
backend/src/dashoo.cn/modi_webapi/app/api/personnel/personnel.go

@@ -1,6 +1,7 @@
 package personnel
 
 import (
+	//"dashoo.cn/micro_libary/response"
 	"dashoo.cn/modi_webapi/app/model/personnel"
 	service "dashoo.cn/modi_webapi/app/service/personnel"
 	"dashoo.cn/modi_webapi/library/request"

+ 15 - 163
frontend_web/src/views/personnel/components/personneledit.vue

@@ -81,8 +81,6 @@
 </template>
 
 <script>
-import axios from 'axios'
-import uploadajax from '@/assets/js/uploadajax.js'
 import PersonnelApi from '@/api/personnel'
 
 export default {
@@ -144,78 +142,30 @@ export default {
   created () {
   },
   methods: {
-    // 操作规程文件上传
-    uploadrequest (option) {
+    savedata () {
       let _this = this
-      axios.post(this.$uploadFile, {})
-        .then(function (res) {
-          if (res.data && res.data.fid && res.data.fid !== '') {
-            option.action = `http://${res.data.url}/${res.data.fid}`
-            _this.uploadFile = {
-              uid: option.file.uid,
-              url: res.data.publicUrl,
-              fid: res.data.fid
-            }
-            uploadajax(option)
+      PersonnelApi.UpdatePersonnel(this.testlistform)
+        .then(res => {
+          console.log(res.data)
+          if (res.data.code === 0) {
+            // _this.$message({
+            //   type: 'success',
+            //   message: res.data.message
+            // })
+            this.dialogvisible = false
+            this.fileList = []
+            // 刷新
+            this.$emit('closeEditDialog')
           } else {
             _this.$message({
               type: 'warning',
-              message: '未上传成功!请刷新界面重新上传!'
+              message: res.data.message
             })
           }
         })
         .catch(function (error) {
           console.log(error)
-          _this.$message({
-            type: 'warning',
-            message: '未上传成功!请重新上传!'
-          })
-        })
-    },
-    handleRemove (file, fileList) {
-      this.testlistform.FileUrl = ''
-      this.testlistform.FileName = ''
-      this.FileUrl = {}
-    },
-    handleUploadSuccess (res, file) {
-      this.testlistform.FileUrl = `${this.uploadFile.url}/${this.uploadFile.fid}`
-      this.testlistform.FileName = file.name
-      this.FileUrl = URL.createObjectURL(file.raw)
-    },
-    savedata () {
-      let _this = this
-      PersonnelApi.UpdatePersonnel(this.testlistform, {})
-        .then(res => {
-          // savedataedit(_this.testlistform.Id, _this.testlistform)
-          // _this.$axios.put('/personnel/saveeditinstument/' + _this.testlistform.Id, _this.testlistform)
-          // .then(res => {
-          // response
-          // if (res.info.code === 0) {
-          // if (_this.TimeNotification) {
-          //   // _this.getttriggernow(4802)
-          // }
-          // _this.$message({
-          //   type: 'success',
-          //   message: res.info.message
-          // })
-          // window.history.go(-1)
-          // } else {
-          // _this.$message({
-          //   type: 'warning',
-          //   message: res.info.message
-          // })
-          // }
-          this.dialogvisible = false
-          this.fileList = []
-          // 刷新
-          // this.$emit('initDatas')
-          this.$emit('closeEditDialog')
         })
-        .catch(err => {
-          // handle error
-          console.error(err)
-        })
-
     },
     getEntity (pid) {
       let _this = this
@@ -238,114 +188,16 @@ export default {
           console.error(err)
         })
     },
-    // // 查询action
-    // getttriggernow (id) {
-    //   gettriggerlist({}, id)
-    //     .then(res => {
-    //       let _this = this
-    //       _this.Advancetime = res.items.Advancetime
-    //       // 查询子表 有效期
-    //       _this.addTriggerl(_this.testlistform.Id, _this.testlistform.Code, _this.testlistform.TimeNotification, _this.testlistform.Name, _this.Advancetime, _this.testlistform.CalibrationTime, _this.testlistform.CalibrationDeadline, _this.testlistform.CalibrationDeadlineType)
-    //     })
-    //     .catch(err => {
-    //       console.error(err)
-    //     })
-    // },
-    // getclassificationlist () {
-    //   // 获取样本单位
-    //   let _this = this
-    //   let params = {
-    //     code: 'PersonnelItem'
-    //   }
-    //   classificationlist(params)
-    //     .then(res => {
-    //       _this.classificationlist = res.info
-    //     })
-    // },
-    // // 添加报警
-    // addTriggerl (ID, Code, TimeNotification, Name, Advancetime, CalibrationTime, CalibrationDeadline, CalibrationDeadlineType) {
-    //   // eslint-disable-next-line no-undef
-    //   let _this = this
-    //   _this.triggerlist.Aid = '4802'
-    //   _this.triggerlist.DId = ID
-    //   _this.triggerlist.Advancetime = Advancetime// action  报警提前时间
-    //   _this.triggerlist.TimeNotification = TimeNotification // 保质期到期提醒
-    //   _this.triggerlist.ProductDate = CalibrationTime// '校准日期',
-    //   _this.triggerlist.AccCode = Code // '物品编码',
-    //   _this.triggerlist.Name = Name // '姓名',
-    //   _this.triggerlist.ValidityLong = CalibrationDeadline // '有效时长',
-    //   _this.triggerlist.ValidityLongType = CalibrationDeadlineType// '有效时长类型:1天;2周;3月;4年',
-    //   _this.triggerlist.Category = 3 // '种类 1、耗材;2:试剂'
-    //   if (CalibrationDeadlineType === 1) {
-    //     _this.triggerlist.RemindTime = new Date(_this.addDate(CalibrationTime, CalibrationDeadline))
-    //   } else if (CalibrationDeadlineType === 2) {
-    //     _this.triggerlist.RemindTime = new Date(_this.addDate(CalibrationTime, CalibrationDeadline * 7))
-    //   } else if (CalibrationDeadlineType === 3) {
-    //     _this.triggerlist.RemindTime = new Date(_this.addDate(CalibrationTime, CalibrationDeadline * 30))
-    //   } else if (CalibrationDeadlineType === 4) {
-    //     _this.triggerlist.RemindTime = new Date(_this.addDate(CalibrationTime, CalibrationDeadline * 365))
-    //   }
-    //   addTrigger(_this.triggerlist)
-    //     .then(function (response) {
-
-    //     })
-    // },
-    // 计算日期
-    addDate (date, days) {
-      if (days === undefined || days === '') {
-        days = 1
-      }
-      var dates = new Date(date)
-      dates.setDate(dates.getDate() + days)
-      var month = dates.getMonth() + 1
-      var day = dates.getDate()
-      var mm = "'" + month + "'"
-      var dd = "'" + day + "'"
-
-      // 单位数前面加0
-      if (mm.length === 3) {
-        month = '0' + month
-      }
-      if (dd.length === 3) {
-        day = '0' + day
-      }
-
-      var time = dates.getFullYear() + '-' + month + '-' + day
-      return time
-    },
-    // // 获取供应商
-    // getSupplier () {
-    //   let _this = this
-    //   let params = {
-    //     customerName: 'Supplier'
-    //   }
-    //   getsupplierlist(params)
-    //     .then(res => {
-    //       _this.getsupplierlist = res.info
-    //     })
-    // },
     // 返回当前页
     handleCloseEdit () {
-      // this.$refs['uploader'].clearFiles()
       this.fileList = []
       this.$emit('closeEditDialog')
     },
     deletedataforDid (val) {
-      deletetriggerlistfordid(val)
-        .then(res => {
-        })
-        .catch(err => {
-          // handle error
-          console.error(err)
-        })
+
     }
 
   }
-  // watch: {
-  //   PersonnelId: function (newVal) {
-  //     this.getEntity(newVal)
-  //   }
-  // }
 
 }