Browse Source

1.蜜蜂所分装剩余份数编号bug修改2.蜜蜂所样本预录入中样本来源信息修正3.系统设置中账号设计编辑功能4.兴瑞微信端显示

hanmj 7 years ago
parent
commit
52c0bc5413

+ 1 - 1
src/dashoo.cn/backend/api/controllers/samplesinfo/samplesubpackage.go

@@ -454,7 +454,7 @@ func (this *SampleSubpackageController) Subpackage() {
 		fmt.Println("ddddddddd", datadetail.Capacity)
 		if datadetail.Capacity > 0 {
 			if datadetail.BarCode == "" {
-				datadetail.BarCode = datamain.SampleCode + "01"
+				datadetail.BarCode = datamain.SampleCode + "01" + "-" + timecode
 			}
 			datamain.AccCode = this.User.AccCode
 			datamain.MCreateUserId, _ = utils.StrTo(this.User.Id).Int()

+ 77 - 81
src/dashoo.cn/frontend_animal/src/pages/samples/prerecorded/_opera/unhumanadd.vue

@@ -269,11 +269,10 @@
     computed: mapGetters({
       authUser: 'authUser'
     }),
-    data() {
+    data () {
       var checkSampleType = (rule, value, callback) => {
         if (value === '') {
           callback(new Error('请选择样本类型'))
-          return
         } else {
           callback()
         }
@@ -336,7 +335,7 @@
           InnerCode: '', // 样本内码
           SourceName: '', // 样本来源
           SourceId: 0,
-         // SourceIdCard: '',
+          // SourceIdCard: '',
           InnerNo: '',
           Genus: '',
           AddressName: '',
@@ -389,16 +388,16 @@
           }]
         },
         Tabs: '',
-        groupnameList: [], //扩展字段分组列表
+        groupnameList: [], // 扩展字段分组列表
         imageDialog: false,
         ImageTitle: '',
         imagefiles: '',
         imagefilelist: [],
-        imagenewlist: '', //删除图片时使用
+        imagenewlist: '', // 删除图片时使用
         dialogImageUrl: '',
         dialogVisible: false,
 
-        groupList: [], //合作用户分组
+        groupList: [], // 合作用户分组
         GroupIdOption: [],
         GroupId: '',
         GroupName: '',
@@ -417,10 +416,10 @@
         groupcodeList: [],
         GroupCode: '',
         TypeCode: '',
-        TimeCode: '',
+        TimeCode: ''
       }
     },
-    created() {
+    created () {
       this.getType()
       this.getsampetypeunit()
       this.getautocodedata()
@@ -437,7 +436,7 @@
       this.getGrouplist()
     },
     methods: {
-      getkuozhandata() {
+      getkuozhandata () {
         // 拼接扩展字段
         let _this = this
         let jsonstr = ''
@@ -448,14 +447,13 @@
         jsonstr = '{' + jsonstr.substring(0, jsonstr.length - 1) + '}'
         return jsonstr
       },
-      savesample() {
+      savesample () {
         let _this = this
         if (_this.GroupCode == '') {
           _this.$message({
             type: 'warning',
             message: '请选择群号!'
           })
-          return
         } else {
           if (_this.sampleform.type_flag === 'add') {
             if (_this.sampleform.InnerCode != '') {
@@ -480,9 +478,9 @@
           }
         }
       },
-      trueInnoCode() {
+      trueInnoCode () {
         let _this = this
-        _this.$axios.get("/samplepreinput/innernomakesure?InnerCode=" + this.sampleform.InnerCode, {})
+        _this.$axios.get('/samplepreinput/innernomakesure?InnerCode=' + this.sampleform.InnerCode, {})
           .then(function (response) {
             let innerTotal = response.data.items
             if (innerTotal === 0) {
@@ -495,7 +493,7 @@
             }
           })
       },
-      saveadd() {
+      saveadd () {
         let _this = this
         this.$refs['samplemanageform'].validate((valid) => {
           if (valid) {
@@ -520,19 +518,19 @@
               })
             }
             if (_this.GroupIdOption.length > 0) {
-              _this.GroupId = _this.GroupIdOption.join(',');
-              let tempOfficers = [];
+              _this.GroupId = _this.GroupIdOption.join(',')
+              let tempOfficers = []
               for (let idx in this.GroupIdOption) {
-                let selectId = this.GroupIdOption[idx];
+                let selectId = this.GroupIdOption[idx]
                 for (let idx2 in this.groupList) {
-                  let item = this.groupList[idx2];
+                  let item = this.groupList[idx2]
                   if (item.Id == selectId) {
-                    tempOfficers.push(item.Value);
-                    break;
+                    tempOfficers.push(item.Value)
+                    break
                   }
                 }
               }
-              _this.GroupName = tempOfficers.join(',');
+              _this.GroupName = tempOfficers.join(',')
             }
             _this.$axios.post('samplepreinput/subpackage?groupid=' + _this.GroupId + '&groupname=' + _this.GroupName +
                 '&timecode=' + _this.TimeCode, params)
@@ -551,7 +549,7 @@
                   if (res.data.item !== '') {
                     let printparams = res.data.item.split(',')
                     if (printparams.length === 3 && printparams[0] !== '' && printparams[1] !== '' && printparams[
-                        2] !== '') {
+                      2] !== '') {
                       // 执行打印操作
                       window.PrintReport(printparams[1], `samplespreinput,${printparams[2]},${printparams[0]}`)
                     }
@@ -570,7 +568,7 @@
           }
         })
       },
-      saveedit() {
+      saveedit () {
         let _this = this
         // 拼接扩展字段
         let jsonstr = _this.getkuozhandata()
@@ -591,19 +589,19 @@
           })
         }
         if (_this.GroupIdOption.length > 0) {
-          _this.GroupId = _this.GroupIdOption.join(',');
-          let tempOfficers = [];
+          _this.GroupId = _this.GroupIdOption.join(',')
+          let tempOfficers = []
           for (let idx in this.GroupIdOption) {
-            let selectId = this.GroupIdOption[idx];
+            let selectId = this.GroupIdOption[idx]
             for (let idx2 in this.groupList) {
-              let item = this.groupList[idx2];
+              let item = this.groupList[idx2]
               if (item.Id == selectId) {
-                tempOfficers.push(item.Value);
-                break;
+                tempOfficers.push(item.Value)
+                break
               }
             }
           }
-          _this.GroupName = tempOfficers.join(',');
+          _this.GroupName = tempOfficers.join(',')
         }
         _this.$axios.put('/samplepreinput/edit/' + _this.sampleform.id + '?groupid=' + _this.GroupId + '&groupname=' +
             _this.GroupName, params)
@@ -625,7 +623,7 @@
             console.error(err)
           })
       },
-      getSampleInfo(id) {
+      getSampleInfo (id) {
         let _this = this
         _this.$axios.get('/sampleoperation/getsamplebyanimalid?SamplesInfoId=' + id, {})
           .then(res => {
@@ -667,7 +665,7 @@
             _this.sampleform.SourceName = res.data.SourceName
             _this.sampleform.Genus = res.data.Genus
             _this.sampleform.GenusName = res.data.GenusName
-            _this.amountuni = res.data.Amount + res.data.Unit
+            _this.amountuni = res.data.Amount + res.data.SourceUni
             _this.sampleform.ProjectName = res.data.ProjectName
             _this.sampleform.AddressName = res.data.AddressName
             _this.sampleform.SurveyDate = _this.Jstimehandle(res.data.SurveyDate)
@@ -685,7 +683,7 @@
             _this.getGroup(res.data.BarCode)
           })
       },
-      getautocodedata() {
+      getautocodedata () {
         let _this = this
         // 获取冻存架信息
         _this.$axios.get('/sampleoperation/getautocodedata', {})
@@ -700,7 +698,7 @@
             console.error(err)
           })
       },
-      getsampetypeunit() {
+      getsampetypeunit () {
         // 获取样本单位
         let _this = this
         _this.$axios.get('/sampletype/sunitajax', {})
@@ -708,7 +706,7 @@
             _this.sampeunitlist = res.data
           })
       },
-      choosetype(v) {
+      choosetype (v) {
         // 获取特有扩展
         let _this = this
         _this.groupnameList = []
@@ -731,7 +729,7 @@
             })
         }
       },
-      getSpecialkz(v) {
+      getSpecialkz (v) {
         // 获取特有扩展
         let _this = this
         if (_this.sampleform.type_flag === 'add' && v !== '') {
@@ -743,7 +741,7 @@
             })
         }
       },
-      getsampetypedata(v) {
+      getsampetypedata (v) {
         // 获取样本类型数据
         let _this = this
         _this.$axios.get('/sampletype/sampletypeajax?id=' + v, {})
@@ -770,7 +768,7 @@
             // }
           })
       },
-      getautobarcode(samptype, samporg) {
+      getautobarcode (samptype, samporg) {
         // 获取自动编码
         let _this = this
         _this.$axios.get('/sampleoperation/getautobarcode?SampleType=' + samptype + '&fid=' + samporg + '&sourceid=' +
@@ -781,7 +779,7 @@
           })
       },
 
-      blursamplecode() {
+      blursamplecode () {
         let _this = this
         if (_this.sampleform.SampleCode !== '' && _this.sampleform.type_flag === 'add') {
           _this.$axios.get('/sampleoperation/getsamplebysamplecode?samplecode=' + this.sampleform.SampleCode, {})
@@ -812,7 +810,7 @@
             })
         }
       },
-      getItemGroupName(val) {
+      getItemGroupName (val) {
         // 获取特有扩展
         let _this = this
         _this.$axios.get('/sampletype/gettykzzdgroup?SampleType=' + val.SampleType, {})
@@ -826,7 +824,7 @@
             _this.getItemDetail(val)
           })
       },
-      getItemDetail(val) {
+      getItemDetail (val) {
         // 获取特有扩展并赋值
         if (val && val.SampleType > 0) {
           let _this = this
@@ -848,7 +846,7 @@
             })
         }
       },
-      geteditsampetypedata(v) {
+      geteditsampetypedata (v) {
         // 获取样本类型数据
         let _this = this
         _this.$axios.get('/sampletype/sampletypeajax?id=' + v, {})
@@ -863,7 +861,7 @@
           })
       },
 
-      goback() {
+      goback () {
         if (this.$route.query.size) {
           this.$router.push({
             name: this.$route.query.pname,
@@ -876,7 +874,7 @@
           this.$router.go(-1)
         }
       },
-      animalDialogCallback(val) {
+      animalDialogCallback (val) {
         this.sampleform.Genus = val.Genus
         this.sampleform.SourceId = val.Id
         this.sampleform.SourceName = val.Name
@@ -886,18 +884,18 @@
         this.sampleform.SurveyDate = new Date(val.SurveyDate)
         this.amountuni = val.Amount + val.Unit
         this.AreaCode = val.AreaCode
-        this.TimeCode = _this.jstimehandle(val.SurveyDate)
+        this.TimeCode = this.jstimehandle(val.SurveyDate)
         this.getGroupCode()
       },
-       getGroupCode() {
-        let _this = this;
+      getGroupCode () {
+        let _this = this
         _this.groupcodeListv = []
         let params = {
           SourceId: this.sampleform.SourceId
         }
-        _this.$axios.get("/samplessource/getgroupcode", {
-            params
-          })
+        _this.$axios.get('/samplessource/getgroupcode', {
+          params
+        })
           .then(res => {
             let minvalue = res.data.items.MinValue
             let maxvalue = res.data.items.MaxValue
@@ -905,22 +903,22 @@
               _this.groupcodeList.push({
                 label: (Array(4).join(0) + i).slice(-4),
                 value: i
-              });
+              })
             }
             _this.groupcodeList.push({
               label: '全部',
               value: maxvalue + 1
-            });
+            })
           })
           .catch(err => {
-            console.error(err);
-          });
+            console.error(err)
+          })
       },
-      microDialogCallback(val) {
+      microDialogCallback (val) {
         this.sampleform.SourceId = val.Id
         this.sampleform.SourceName = val.Name
       },
-      getType() {
+      getType () {
         let _this = this
         _this.$axios.get('/sampletype/list', {})
           .then(res => {
@@ -935,7 +933,7 @@
             }
           })
       },
-      getuserlist() {
+      getuserlist () {
         this.$axios.get('users/list', {})
           .then(res => {
             this.userlist = res.data.items
@@ -950,13 +948,12 @@
           })
       },
 
-
-      //获取当前上传图片字段
-      getitem(val) {
+      // 获取当前上传图片字段
+      getitem (val) {
         this.imagefiles = ''
         this.imagefilelist = []
         this.ImageTitle = val.Name
-        //显示已存储图片
+        // 显示已存储图片
         if (val.FieldDefault != '') {
           let imagearr = []
           imagearr = val.FieldDefault.split('|')
@@ -973,8 +970,8 @@
         this.imageDialog = true
         this.extendId = val.Id
       },
-      //扩展字段图片类型处理
-      beforeAvatarUpload(file) {
+      // 扩展字段图片类型处理
+      beforeAvatarUpload (file) {
         const isJPG = (file.type.indexOf('image/') === 0)
         const isLt2M = file.size / 1024 / 1024 < 10
         if (!isJPG) {
@@ -987,11 +984,11 @@
         }
         return true
       },
-      handlePictureCardPreview(file) {
-        this.dialogImageUrl = file.url;
-        this.dialogVisible = true;
+      handlePictureCardPreview (file) {
+        this.dialogImageUrl = file.url
+        this.dialogVisible = true
       },
-      uploadrequest(option) {
+      uploadrequest (option) {
         let _this = this
         axios.post(process.env.upfilehost, {})
           .then(function (res) {
@@ -1018,7 +1015,7 @@
             })
           })
       },
-      handleAvatarSuccess(res, file) {
+      handleAvatarSuccess (res, file) {
         for (var i = 0; i < this.typetykzlist.length; i++) {
           if (this.typetykzlist[i].Id == this.extendId) {
             this.typetykzlist[i].FieldDefault = this.typetykzlist[i].FieldDefault +
@@ -1027,8 +1024,8 @@
         }
         this.imagefiles = ''
       },
-      handleRemove(file, fileList) {
-        console.log(this.imagefilelist);
+      handleRemove (file, fileList) {
+        console.log(this.imagefilelist)
         for (var i = 0; i < this.imagefilelist.length; i++) {
           if (this.imagefilelist[i].uid != file.uid) {
             this.imagenewlist = this.imagenewlist + this.imagefilelist[i].url.substring(7, 42) + `|`
@@ -1041,15 +1038,15 @@
         }
       },
 
-      //合作用户分组处理
-      getGroup(val) {
+      // 合作用户分组处理
+      getGroup (val) {
         this.$axios.get('samplesgroup/groupbybarcode/' + val, {})
           .then(res => {
-            this.GroupIdOption = [];
-            if (res.data.GroupId != "") {
-              let tempArr = res.data.GroupId.split(',');
+            this.GroupIdOption = []
+            if (res.data.GroupId != '') {
+              let tempArr = res.data.GroupId.split(',')
               for (let idx in tempArr) {
-                this.GroupIdOption.push(parseInt(tempArr[idx]));
+                this.GroupIdOption.push(parseInt(tempArr[idx]))
               }
             }
           })
@@ -1057,14 +1054,14 @@
             console.error(err)
           })
       },
-      getGrouplist() {
+      getGrouplist () {
         let _this = this
         _this.$axios.get('/samplesgroup/grouplist', {})
           .then(res => {
             _this.groupList = res.data
           })
       },
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -1076,7 +1073,7 @@
           return val.substring(2, 6)
         }
       },
-      Jstimehandle(val) {
+      Jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -1087,11 +1084,10 @@
           val = val.replace('-', ' ')
           return val.substring(0, 10)
         }
-      },
+      }
 
     }
   }
-
 </script>
 
 <style lang="scss">

+ 204 - 205
src/dashoo.cn/frontend_animal/src/pages/samples/prerecorded/_opera/unhumanpre.vue

@@ -363,34 +363,34 @@
 <script>
   import _default, {
     mapGetters
-  } from "vuex";
-  import axios from 'axios'
+  } from 'vuex'
+import axios from 'axios'
   import uploadajax from '../../../../assets/js/uploadajax.js'
-  import ChooseAnimalDialog from "../../../../components/samples/chooseanimal";
-  export default {
-    name: "samplespreinputadd",
+  import ChooseAnimalDialog from '../../../../components/samples/chooseanimal'
+export default {
+    name: 'samplespreinputadd',
     components: {
       ChooseAnimalDialog
     },
     computed: mapGetters({
-      authUser: "authUser"
+      authUser: 'authUser'
     }),
-    data() {
+    data () {
       var checkSampleType = (rule, value, callback) => {
-        if (value === "") {
-          callback(new Error("请选择样本类型"));
-          return;
-        } else {
-          callback();
-        }
-      };
-      var checkSubpackageNum = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请选择样本类型'))
+      
+    } else {
+          callback()
+    }
+      }
+    var checkSubpackageNum = (rule, value, callback) => {
         if (!isNaN(parseInt(value)) && !isNaN(value) && value > 0 && value < 100) {
-          callback();
+          callback()
         } else {
-          callback(new Error("请输入正确数字值"));
+          callback(new Error('请输入正确数字值'))
         }
-      };
+      }
       var checkCapacity = (rule, value, callback) => {
         if (!isNaN(parseFloat(value)) && !isNaN(value)) {
           if (parseFloat(value) <= 0) {
@@ -400,12 +400,12 @@
               callback(new Error('样本取样量超过最大值'))
               this.sampleform.UsedCapacity = value
             }
-            callback();
+            callback()
           }
         } else {
-          callback(new Error("请输入正确数字值"));
+          callback(new Error('请输入正确数字值'))
         }
-      };
+      }
       var checkUsedCapacity = (rule, value, callback) => {
         if (!isNaN(parseFloat(value)) && !isNaN(value)) {
           if (parseFloat(value) <= 0) {
@@ -415,12 +415,12 @@
               callback(new Error('样本取样量超过最大值'))
               this.sampleform.UsedCapacity = this.sampleform.Capacitystr
             }
-            callback();
+            callback()
           }
         } else {
-          callback(new Error("请输入正确数字值"));
+          callback(new Error('请输入正确数字值'))
         }
-      };
+      }
       // var checkSampleCode = (rule, value, callback) => {
       //   if (value === "") {
       //     callback(new Error("请输入样本编码"));
@@ -431,7 +431,7 @@
       // };
 
       return {
-        title: "样本预录入添加",
+        title: '样本预录入添加',
         disabledbarcode: false,
         disabledsamplecode: false,
         disabledsampletype: false,
@@ -443,7 +443,7 @@
         diaabledyongjiu: false,
         disabledsamplingsite: false,
         disabledsource: false,
-        transportdialog: false, //样本分装 操作详情(修改)
+        transportdialog: false, // 样本分装 操作详情(修改)
         Isruku: false,
         tableDataOne: [],
         DonorsInfoId: 0,
@@ -452,8 +452,8 @@
         size: 10,
         Sam: '',
         SampleCodeOld: '',
-        SubpackageNum: 1, //分装份数
-        SubpackageCapacity: '', //分装容量
+        SubpackageNum: 1, // 分装份数
+        SubpackageCapacity: '', // 分装容量
         transportForm: {
           InnerCode: '',
           SubpackageCapacity: '',
@@ -476,15 +476,15 @@
           Id: ''
         },
         sourceform: {
-          InnerNo: "", // 来源内码
-          Name: "", // 样本来源姓名
+          InnerNo: '', // 来源内码
+          Name: '', // 样本来源姓名
           SourceId: 0,
-          Genus: "",
+          Genus: '',
           GenusName: '',
-          Amount: "",
-          Unit: "",
-          SourceType: "",
-          SurveyDate: new Date(),
+          Amount: '',
+          Unit: '',
+          SourceType: '',
+          SurveyDate: new Date()
         },
         amountuni: '',
         Address: '',
@@ -504,11 +504,11 @@
           ProjectName: '',
           ReceiveDatedate: new Date(), // 接收日期
           ValidityDate: '', // 有效日期
-          DefaultCapacity: 1, //默认容量
+          DefaultCapacity: 1, // 默认容量
           Capacitystr: 1, // 可用容量
-          InitCapacity: 1, //初始容量
-          Capacity: 1, //剩余容量
-          UsedCapacity: 1, //取用量
+          InitCapacity: 1, // 初始容量
+          Capacity: 1, // 剩余容量
+          UsedCapacity: 1, // 取用量
           Unit: ' ml', // 单位(容量)
           ValidityDatedate: '', // 有效日期
           InnerNo: '', // 来源内码
@@ -524,8 +524,8 @@
           autoprintchecked: false,
           CreateUserId: 0, // 录入人
           CreateBy: '', // 录入人
-          SubpackageNum: 1, //分装份数
-          SubpackageCapacity: '', //分装容量
+          SubpackageNum: 1, // 分装份数
+          SubpackageCapacity: '', // 分装容量
           IdCard: '',
           Sex: 0,
           Age: 20
@@ -537,20 +537,20 @@
           // }],
           SubpackageNum: [{
             validator: checkSubpackageNum,
-            trigger: "blur"
+            trigger: 'blur'
           }],
           SampleTypestr: [{
             validator: checkSampleType,
-            trigger: "change"
+            trigger: 'change'
           }],
           Capacitystr: [{
             validator: checkCapacity,
-            trigger: "blur"
+            trigger: 'blur'
           }],
           UsedCapacity: [{
             validator: checkUsedCapacity,
-            trigger: "blur"
-          }],
+            trigger: 'blur'
+          }]
         },
         animalSourceVisible: false,
         //  选项的基础资料
@@ -559,84 +559,84 @@
         samplequcailist: [],
         selectedorgan: [], // 级联所选组织结构
         sampleorganprops: {
-          value: "code",
-          label: "name",
-          children: "children"
+          value: 'code',
+          label: 'name',
+          children: 'children'
         },
-        samplecodelist: [], //样本编码
+        samplecodelist: [], // 样本编码
         // organlist2: [],
         typetykzlist: [], // 特有扩展
         // publickzlist: [], // 公共扩展
         userlist: [], // 录入人
 
-        groupList: [], //合作用户分组
+        groupList: [], // 合作用户分组
         GroupIdOption: [],
         GroupId: '',
         GroupName: '',
 
         Tabs: '',
-        groupnameList: [], //扩展字段分组列表
+        groupnameList: [], // 扩展字段分组列表
         imageDialog: false,
         ImageTitle: '',
         imagefiles: '',
         imagefilelist: [],
-        imagenewlist: '', //删除图片时使用
+        imagenewlist: '', // 删除图片时使用
         dialogImageUrl: '',
         dialogVisible: false,
-        acc: '',
-      };
-    },
-    created() {
+        acc: ''
+      }
+  },
+    created () {
       this.acc = this.authUser.Profile.AccCode
-      this.getType();
-      this.getsampetypeunit();
-      this.getautocodedata();
+      this.getType()
+      this.getsampetypeunit()
+      this.getautocodedata()
       this.getGrouplist()
       // this.getpublickz();
       // 获取录入人
-      this.getuserlist();
-    },
+      this.getuserlist()
+  },
     methods: {
-      getType() {
-        let _this = this;
-        _this.$axios.get("/sampletype/list", {}).then(res => {
-          _this.sampletypelist = [];
+      getType () {
+        let _this = this
+        _this.$axios.get('/sampletype/list', {}).then(res => {
+          _this.sampletypelist = []
           for (var i = 0; i < res.data.currentItemCount; i++) {
             _this.sampletypelist.push({
               label: res.data.items[i].Name,
               code: res.data.items[i].Code,
               photo: res.data.items[i].Photo,
-              value: res.data.items[i].Id + ""
-            });
+              value: res.data.items[i].Id + ''
+            })
           }
-        });
+        })
       },
-      getautocodedata() {
-        let _this = this;
+      getautocodedata () {
+        let _this = this
         // 获取自动编码数据
         _this.$axios
-          .get("/sampleoperation/getautocodedata", {})
+          .get('/sampleoperation/getautocodedata', {})
           .then(res => {
-            _this.sampleform.code_default = res.data.code_default;
-            _this.sampleform.code_codeId = res.data.code_codeId;
-            _this.sampleform.code_lastnum = res.data.code_lastnum;
+            _this.sampleform.code_default = res.data.code_default
+            _this.sampleform.code_codeId = res.data.code_codeId
+            _this.sampleform.code_lastnum = res.data.code_lastnum
             _this.sampleform.coderule_samplingorgan_flag =
-              res.data.coderule_samplingorgan_flag;
+              res.data.coderule_samplingorgan_flag
             _this.sampleform.coderule_sampletype_flag =
-              res.data.coderule_sampletype_flag;
+              res.data.coderule_sampletype_flag
           })
           .catch(err => {
-            console.error(err);
-          });
+            console.error(err)
+          })
       },
-      getsampetypeunit() {
+      getsampetypeunit () {
         // 获取样本单位
-        let _this = this;
-        _this.$axios.get("/sampletype/sunitajax", {}).then(res => {
-          _this.sampeunitlist = res.data;
-        });
+        let _this = this
+        _this.$axios.get('/sampletype/sunitajax', {}).then(res => {
+          _this.sampeunitlist = res.data
+        })
       },
-      choosetype(v) {
+      choosetype (v) {
         // 获取特有扩展
         let _this = this
         _this.groupnameList = []
@@ -656,11 +656,11 @@
               }
               _this.Tabs = _this.groupnameList[0]
               _this.getSpecialkz(v)
-              //_this.getCodeRule()
+              // _this.getCodeRule()
             })
         }
       },
-      getSpecialkz(v) {
+      getSpecialkz (v) {
         // 获取特有扩展
         let _this = this
         if (v !== '') {
@@ -672,14 +672,14 @@
             })
         }
       },
-      getsampetypedata(v) {
+      getsampetypedata (v) {
         // 获取样本类型数据
-        let _this = this;
-        _this.$axios.get("/sampletype/sampletypeajax?id=" + v, {})
+        let _this = this
+        _this.$axios.get('/sampletype/sampletypeajax?id=' + v, {})
           .then(res => {
-            _this.sampleform.Capacitystr = res.data.SampleType.DefaultCapacity + ""
+            _this.sampleform.Capacitystr = res.data.SampleType.DefaultCapacity + ''
             _this.sampleform.UsedCapacity = res.data.SampleType.SubpackageCapacity * res.data.SampleType.SubpackageNum
-            if (res.data.VHours === "5000-1-1 23:59:59") {
+            if (res.data.VHours === '5000-1-1 23:59:59') {
               _this.sampleform.ValidityDate = new Date(res.data.VHours)
               _this.sampleform.Isyongjiu = true
             } else {
@@ -708,7 +708,7 @@
             //     _this.getautobarcode(sampletypestr, sampleselectedorgan);
             //   }
             // }
-          });
+          })
       },
       // getCodeRule() {
       //   this.$axios.get('/sampleoperation/getcoderule', {})
@@ -734,7 +734,7 @@
       //       _this.sampleform.SampleCode = res.data.barcode;
       //     });
       // },
-      animalDialogCallback(val) { //样本来源选择数据显示
+      animalDialogCallback (val) { // 样本来源选择数据显示
         this.disabledsource = true
         this.sourceform.SourceId = val.Id
         this.sourceform.Genus = val.Genus
@@ -752,15 +752,15 @@
         this.TimeCode = this.jstimehandle(val.SurveyDate)
         this.getGroupCode()
       },
-      getGroupCode() {
-        let _this = this;
+      getGroupCode () {
+        let _this = this
         _this.groupcodeListv = []
         let params = {
           SourceId: this.sourceform.SourceId
         }
-        _this.$axios.get("/samplessource/getgroupcode", {
-            params
-          })
+        _this.$axios.get('/samplessource/getgroupcode', {
+          params
+        })
           .then(res => {
             let minvalue = res.data.items.MinValue
             let maxvalue = res.data.items.MaxValue
@@ -768,18 +768,18 @@
               _this.groupcodeList.push({
                 label: (Array(4).join(0) + i).slice(-4),
                 value: i
-              });
+              })
             }
             _this.groupcodeList.push({
               label: '全部',
               value: maxvalue + 1
-            });
+            })
           })
           .catch(err => {
-            console.error(err);
-          });
+            console.error(err)
+          })
       },
-      goback() {
+      goback () {
         if (this.$route.query.size) {
           this.$router.push({
             name: this.$route.query.pname,
@@ -787,29 +787,29 @@
               size: this.$route.query.size,
               currentPage: this.$route.query.currentPage
             }
-          });
+          })
         } else {
-          this.$router.go(-1);
+          this.$router.go(-1)
         }
       },
-      getkuozhandata() {
+      getkuozhandata () {
         // 拼接扩展字段
-        let _this = this;
-        let jsonstr = "";
-        // 特有扩展
-        for (let i = 0; i < _this.typetykzlist.length; i++) {
+        let _this = this
+        let jsonstr = ''
+      // 特有扩展
+      for (let i = 0; i < _this.typetykzlist.length; i++) {
           jsonstr +=
             '"' +
             _this.typetykzlist[i].FieldName +
             '" : "' +
             _this.typetykzlist[i].FieldDefault +
-            '",';
+            '",'
         }
-        jsonstr = "{" + jsonstr.substring(0, jsonstr.length - 1) + "}";
-        return jsonstr;
+        jsonstr = '{' + jsonstr.substring(0, jsonstr.length - 1) + '}'
+      return jsonstr
       },
 
-      savedata() {
+      savedata () {
         let _this = this
         this.$refs['samplemanageform'].validate((valid) => {
           if (valid) {
@@ -829,10 +829,10 @@
             // 转换为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)
-            //拼接群号列表
+            // 拼接群号列表
             if (_this.groupcodeList) {
               params = Object.assign(params, _this.groupcodeList)
             }
@@ -858,19 +858,19 @@
             }
 
             if (_this.GroupIdOption.length > 0) {
-              _this.GroupId = _this.GroupIdOption.join(',');
-              let tempOfficers = [];
+              _this.GroupId = _this.GroupIdOption.join(',')
+              let tempOfficers = []
               for (let idx in this.GroupIdOption) {
-                let selectId = this.GroupIdOption[idx];
+                let selectId = this.GroupIdOption[idx]
                 for (let idx2 in this.groupList) {
-                  let item = this.groupList[idx2];
+                  let item = this.groupList[idx2]
                   if (item.Id == selectId) {
-                    tempOfficers.push(item.Value);
-                    break;
-                  }
+                    tempOfficers.push(item.Value)
+                    break
+                }
                 }
               }
-              _this.GroupName = tempOfficers.join(',');
+              _this.GroupName = tempOfficers.join(',')
             }
             _this.$axios.post('samplesubpackage/subpackage?subpackagenum=' + _this.SubpackageNum +
                 '&subpackagecapacity=' +
@@ -882,12 +882,12 @@
                     type: 'success',
                     message: res.data.message
                   })
-                  //样本分装预览表
+                  // 样本分装预览表
                   _this.initDonorsInfo()
                   let stype = _this.sampleform.SampleTypestr + ''
                   _this.getsampetypedata(stype)
                   if (_this.Isruku) {
-                    //传递数据到入库界面
+                    // 传递数据到入库界面
                     this.$router.push({
                       path: '/biobank/sampleRK/addRK/operation',
                       query: {
@@ -904,7 +904,7 @@
                   if (res.data.item !== '') {
                     let printparams = res.data.item.split(',')
                     if (printparams.length === 3 && printparams[0] !== '' && printparams[1] !== '' && printparams[
-                        2] !== '') {
+                      2] !== '') {
                       // 执行打印操作
                       window.PrintReport(printparams[1], `samplespreinput,${printparams[2]},${printparams[0]}`)
                     }
@@ -922,7 +922,7 @@
           }
         })
       },
-      deleteInfo(val) {
+      deleteInfo (val) {
         let _this = this
         _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
@@ -948,8 +948,8 @@
             .catch(() => {})
         }).catch(() => {})
       },
-      //修改列表详情
-      subpackageedit(val) {
+      // 修改列表详情
+      subpackageedit (val) {
         this.transportdialog = true
         this.transportForm.IdCard = val.SourceIdCard
         this.transportForm.Name = val.SourceName
@@ -960,9 +960,9 @@
         this.transportForm.SampleSize = val.InitCapacity
         this.transportForm.SampleUnit = val.Unit
         this.transportForm.InnerCode = val.InnerCode
-        this.transportForm.Id = val.Id //样本子表ID
+        this.transportForm.Id = val.Id // 样本子表ID
       },
-      changeInnerCode() {
+      changeInnerCode () {
         let _this = this
         _this.$axios.put('/samplesubpackage/editinner/' + _this.transportForm.Id, _this.transportForm)
           .then(res => {
@@ -984,16 +984,16 @@
             console.error(err)
           })
       },
-      //获取样本分装预览详情列表信息
-      initDonorsInfo() {
+      // 获取样本分装预览详情列表信息
+      initDonorsInfo () {
         let _this = this // request
         let params = {
           _currentPage: _this.currentpage,
-          _size: _this.size,
+          _size: _this.size
         }
         this.$axios.get('samplesubpackage/subpackagelist/' + _this.samplecodelist, {
-            params
-          })
+          params
+        })
           .then(res => {
             _this.tableDataOne = res.data.items
             _this.currentItemCount = res.data.currentItemCount
@@ -1006,91 +1006,91 @@
       },
 
       // 分装取用量失去焦点事件
-      lostFocusSubpackageCapacityUse() {
+      lostFocusSubpackageCapacityUse () {
         this.sampleform.UsedCapacity = this.sampleform.SubpackageCapacity * this.sampleform.SubpackageNum
       },
 
-      //样本来源信息
-      getsaveReview(formName) {
+      // 样本来源信息
+      getsaveReview (formName) {
         let _this = this
         let jscapacitytotal = 0.00
         jscapacitytotal = this.sampleform.SubpackageCapacity * this.sampleform.SubpackageNum
         let last = 0.00
         last = _this.sampleform.UsedCapacity - jscapacitytotal
         this.$refs[formName].validate((valid) => {
-          if (valid) {
-            if (_this.sampleform.Capacity < 0) {
-              _this.$message({
-                type: 'warning',
-                message: '取用容量超出可用量,请调整取用容量'
-              })
-              return
-            } else if (_this.sampleform.UsedCapacity - jscapacitytotal < 0) {
-              _this.$message({
-                type: 'warning',
-                message: '取用容量与分装容量总和不一致,请调整分装容量'
-              })
-              return
-            } else {
-              if (_this.GroupCode == '') {
-                _this.$message({
-                  type: 'warning',
-                  message: '请选择群号!'
-                })
-                return
-              } else {
-                _this.savedata()
-              }
-            }
+      if (valid) {
+        if (_this.sampleform.Capacity < 0) {
+          _this.$message({
+            type: 'warning',
+            message: '取用容量超出可用量,请调整取用容量'
+          })
+          
+        } else if (_this.sampleform.UsedCapacity - jscapacitytotal < 0) {
+          _this.$message({
+            type: 'warning',
+            message: '取用容量与分装容量总和不一致,请调整分装容量'
+          })
+          
+        } else {
+          if (_this.GroupCode == '') {
+            _this.$message({
+              type: 'warning',
+              message: '请选择群号!'
+            })
+            return
           } else {
-            return false
+            _this.savedata()
           }
-        })
+        }
+      } else {
+        return false
+      }
+    })
       },
 
-      gettykzandtovalue(val) {
+      gettykzandtovalue (val) {
         // 获取特有扩展并赋值
         if (val && val.SampleType > 0) {
-          let _this = this;
+          let _this = this
           _this.$axios
-            .get("/sampletype/gettykzzd?SampleType=" + val.SampleType, {})
+            .get('/sampletype/gettykzzd?SampleType=' + val.SampleType, {})
             .then(res => {
-              _this.typetykzlist = res.data;
-              let foo = window;
-              foo.typetykzsampedit = val;
+              _this.typetykzlist = res.data
+              let foo = window
+              foo.typetykzsampedit = val
               // 给扩展信息赋值
               for (let i = 0; i < this.typetykzlist.length; i++) {
                 this.typetykzlist[i].FieldDefault = foo.eval(
-                  "typetykzsampedit." + this.typetykzlist[i].FieldName
-                );
+                  'typetykzsampedit.' + this.typetykzlist[i].FieldName
+                )
               }
-            });
+            })
         }
       },
-      getuserlist() {
-        this.$axios.get("users/list", {})
+      getuserlist () {
+        this.$axios.get('users/list', {})
           .then(res => {
-            this.userlist = res.data.items;
+            this.userlist = res.data.items
             this.userlist.unshift({
               Id: this.authUser.Profile.Id,
               Realname: this.authUser.Profile.Realname
-            });
-            this.sampleform.CreateUserId = this.authUser.Profile.Id;
+            })
+            this.sampleform.CreateUserId = this.authUser.Profile.Id
           })
           .catch(err => {
-            console.error(err);
-          });
+            console.error(err)
+          })
       },
 
-      //合作用户分组处理
-      getGroup(val) {
+      // 合作用户分组处理
+      getGroup (val) {
         this.$axios.get('samplesgroup/groupbybarcode/' + val, {})
           .then(res => {
-            this.GroupIdOption = [];
-            if (res.data.GroupId != "") {
-              let tempArr = res.data.GroupId.split(',');
+            this.GroupIdOption = []
+            if (res.data.GroupId != '') {
+              let tempArr = res.data.GroupId.split(',')
               for (let idx in tempArr) {
-                this.GroupIdOption.push(parseInt(tempArr[idx]));
+                this.GroupIdOption.push(parseInt(tempArr[idx]))
               }
             }
           })
@@ -1098,19 +1098,19 @@
             console.error(err)
           })
       },
-      getGrouplist() {
+      getGrouplist () {
         let _this = this
         _this.$axios.get('/samplesgroup/grouplist', {})
           .then(res => {
             _this.groupList = res.data
           })
       },
-      //获取当前上传图片字段
-      getitem(val) {
+      // 获取当前上传图片字段
+      getitem (val) {
         this.imagefiles = ''
         this.imagefilelist = []
         this.ImageTitle = val.Name
-        //显示已存储图片
+        // 显示已存储图片
         if (val.FieldDefault != '') {
           let imagearr = []
           imagearr = val.FieldDefault.split('|')
@@ -1128,7 +1128,7 @@
         this.extendId = val.Id
       },
 
-      beforeAvatarUpload(file) {
+      beforeAvatarUpload (file) {
         const isJPG = (file.type.indexOf('image/') === 0)
         const isLt2M = file.size / 1024 / 1024 < 10
         if (!isJPG) {
@@ -1141,11 +1141,11 @@
         }
         return true
       },
-      handlePictureCardPreview(file) {
-        this.dialogImageUrl = file.url;
-        this.dialogVisible = true;
+      handlePictureCardPreview (file) {
+        this.dialogImageUrl = file.url
+        this.dialogVisible = true
       },
-      uploadrequest(option) {
+      uploadrequest (option) {
         let _this = this
         axios.post(process.env.upfilehost, {})
           .then(function (res) {
@@ -1172,7 +1172,7 @@
             })
           })
       },
-      handleAvatarSuccess(res, file) {
+      handleAvatarSuccess (res, file) {
         for (var i = 0; i < this.animalextends.length; i++) {
           if (this.animalextends[i].Id == this.extendId) {
             this.animalextends[i].FieldDefault = this.animalextends[i].FieldDefault +
@@ -1181,7 +1181,7 @@
         }
         this.imagefiles = ''
       },
-      handleRemove(file, fileList) {
+      handleRemove (file, fileList) {
         for (var i = 0; i < this.imagefilelist.length; i++) {
           if (this.imagefilelist[i].uid != file.uid) {
             this.imagenewlist = this.imagenewlist + this.imagefilelist[i].url.substring(7, 42) + `|`
@@ -1194,16 +1194,16 @@
         }
       },
 
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentpage = value
         this.initDonorsInfo()
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentpage = 1
         this.initDonorsInfo()
       },
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -1216,8 +1216,7 @@
         }
       }
     }
-  };
-
+  }
 </script>
 
 <style lang="scss">

+ 68 - 70
src/dashoo.cn/frontend_animal/src/pages/system/users.vue

@@ -157,25 +157,25 @@
   export default {
     name: 'users',
 
-    data() {
+    data () {
       var checkusername = (rule, value, callback) => {
         if (!value) {
           callback(new Error('请输入账号'))
         } else {
-          if (this.appclient == 'lims') { //大港油田lims系统不用邮箱
-            callback()
-          }
-          let re = /^([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+.[a-zA-Z]{2,3}$/
-          if (!re.test(value)) {
-            callback(new Error('请输入正确的邮箱地址'))
-          } else {
+          if (this.appclient == 'lims') { // 大港油田lims系统不用邮箱
             callback()
           }
+          // let re = /^([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+.[a-zA-Z]{2,3}$/
+          // if (!re.test(value)) {
+          //   callback(new Error('请输入正确的邮箱地址'))
+          // } else {
+          callback()
+          // }
         }
       }
       return {
         downloading: '',
-        imghost: "",
+        imghost: '',
         organdialogVisible: false,
         currentItemCount: 0,
         currentItemCount2: 0,
@@ -209,7 +209,7 @@
           departmentname: '',
           RealnameRole: '',
           GroupId: '',
-          GroupName: '',
+          GroupName: ''
         },
         rulesuser: {
           username: [{
@@ -222,7 +222,7 @@
             trigger: 'blur'
           }]
         },
-        imageUrl: "",
+        imageUrl: '',
         operatingitem: 0,
         permissiondialogtitle: '',
         permissiondatadialogVisible: false,
@@ -241,23 +241,23 @@
         rolelistcheckall: [],
         selectedorg: [],
         userdepartment: [],
-        ischeckbj: false, // 过滤字段勾选时触发的选中事件
+        ischeckbj: false // 过滤字段勾选时触发的选中事件
       }
     },
     computed: mapGetters({
       authUser: 'authUser'
     }),
-    created() {
+    created () {
       this.appclient = process.env.appclient
-      this.imghost = process.env.limsimgserverhost;
-      this.getorgtreelist()
+      this.imghost = process.env.limsimgserverhost
+    this.getorgtreelist()
       this.initData()
       // this.loadequipsall()
       this.userdepartment.push(parseInt(this.authUser.Profile.DepartmentId))
       this.selectedorg = [parseInt(this.authUser.Profile.DepartmentId)]
     },
     methods: {
-      initData() {
+      initData () {
         let _this = this
         // paginate
         const params = {
@@ -267,8 +267,8 @@
         }
         // request
         this.$axios.get('users/list', {
-            params
-          })
+          params
+        })
           .then(res => {
             // response
             _this.list = res.data.items
@@ -292,25 +292,25 @@
             console.error(err)
           })
       },
-      handleAvatarSuccess(res, file) {
+      handleAvatarSuccess (res, file) {
         this.userform.sign = res
-        this.imageUrl = URL.createObjectURL(file.raw);
-      },
-      beforeAvatarUpload(file) {
-        console.log(file);
-        const isimg = file.type.indexOf("image/") === 0;
-        const isLt50k = file.size / 1024 / 50 < 1;
-        if (!isimg) {
-          this.$message.error("上传图片只能是 图片 格式!");
-          return false;
-        }
+        this.imageUrl = URL.createObjectURL(file.raw)
+    },
+      beforeAvatarUpload (file) {
+        console.log(file)
+      const isimg = file.type.indexOf('image/') === 0
+      const isLt50k = file.size / 1024 / 50 < 1
+      if (!isimg) {
+          this.$message.error('上传图片只能是 图片 格式!')
+        return false
+      }
         if (!isLt50k) {
-          this.$message.error("上传图片大小不能超过 50kb!");
-          return false;
-        }
-        return true;
-      },
-      roleset(val) {
+          this.$message.error('上传图片大小不能超过 50kb!')
+        return false
+      }
+        return true
+    },
+      roleset (val) {
         this.rolesettitle = '用户(' + val.Realname + ')-角色管理'
         this.rolesetVisible = true
         this.selecteduserid = val.Id + ''
@@ -319,7 +319,7 @@
         // request
         this.$axios.get('users/getuserrole/' + this.selecteduserid, {})
           .then(res => {
-            console.log("-------res----", res.data)
+            console.log('-------res----', res.data)
             _this.mustrolelist = []
             // response
             for (let i = 0; i < res.data.length; i++) {
@@ -331,14 +331,13 @@
               let rdx = 0
               for (rdx = 0; rdx < _this.rolelist.length; rdx++) {
                 if (parseInt(_this.rolelist[rdx].Id) == parseInt(res.data[i])) {
-                  flag = true;
-                  break;
+                  flag = true
+                break;
                 }
               }
               if (!flag) {
                 _this.mustrolelist.push(parseInt(res.data[i]))
               }
-
             }
 
             let checkedCount = this.selectedrole.length
@@ -350,7 +349,7 @@
             console.error(err)
           })
       },
-      rolesave() {
+      rolesave () {
         let _this = this
         for (let mdx in this.mustrolelist) {
           if (this.selectedrole.indexOf(this.mustrolelist[mdx]) == -1) {
@@ -383,16 +382,16 @@
             console.error(err)
           })
       },
-      handlecheckedrolechange() {
+      handlecheckedrolechange () {
         let checkedCount = this.selectedrole.length
         this.roleCheckAll = checkedCount === this.rolelist.length
         this.isrolecheckall = checkedCount > 0 && checkedCount < this.rolelist.length
       },
-      handleCheckAllChange(val) {
+      handleCheckAllChange (val) {
         this.selectedrole = val ? this.rolelistcheckall : []
         this.isrolecheckall = false
       },
-      roleisexist(val) {
+      roleisexist (val) {
         for (let i = 0; i < this.rolelist.length; i++) {
           if (this.rolelist[i].Id === val) {
             return true
@@ -416,32 +415,32 @@
       //       this.loading = false
       //     })
       // },
-      seachdata() {
+      seachdata () {
         this.list = []
         this.currentPage = 1
         this.initData()
       },
-      searchCommand(command) {
+      searchCommand (command) {
         if (command == 'clear') {
           this.clearSearch()
         }
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.list = []
         this.size = value
         this.currentPage = 1
         this.initData()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.list = []
         this.initData()
       },
-      jstimehandle(val) {
+      jstimehandle (val) {
         val = val.replace('T', ' ')
         return val.substring(0, 19)
       },
-      opendatadialog(item, v, index) {
+      opendatadialog (item, v, index) {
         let _this = this
         this.operatingitem = item
         this.datadialogVisible = true
@@ -484,7 +483,7 @@
             })
         }
       },
-      savedata(formName) {
+      savedata (formName) {
         let _this = this
         if (this.selectedorg.length === 0) {
           _this.$message({
@@ -546,7 +545,7 @@
           }
         })
       },
-      deletedata(val) {
+      deletedata (val) {
         let _this = this
         _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
@@ -574,10 +573,10 @@
             .catch(() => {})
         }).catch(() => {})
       },
-      resetForm(formName) {
+      resetForm (formName) {
         // this.$refs[formName].resetFields()
       },
-      clearuserForm() {
+      clearuserForm () {
         this.userform = {
           username: '',
           realname: '',
@@ -586,7 +585,7 @@
           description: ''
         }
       },
-      permission(v) {
+      permission (v) {
         let _this = this
         _this.ischeckbj = true // 过滤字段勾选时触发的选中事件
         this.userpermissdevicesselects = []
@@ -606,11 +605,11 @@
             console.error(err)
           })
       },
-      getorgbyeid(v) {
+      getorgbyeid (v) {
         let _this = this
         this.$axios.put('equipment/getorgidsbyeqids', {
-            EquipmentIds: v
-          })
+          EquipmentIds: v
+        })
           .then(res => {
             // response
             setTimeout(function () {
@@ -626,11 +625,11 @@
             console.error(err)
           })
       },
-      savepermission() {
+      savepermission () {
         let _this = this
         _this.$axios.put('users/permission/' + this.userform.id, {
-            channelids: this.userpermissdevicesselects + ''
-          })
+          channelids: this.userpermissdevicesselects + ''
+        })
           .then(res => {
             // response
             if (res.data.code === 0) {
@@ -648,7 +647,7 @@
           })
           .catch(() => {})
       },
-      resetpwd(val) {
+      resetpwd (val) {
         let _this = this
         _this.$confirm(`此操作将重置用户(${val.Realname})的密码为123456, 是否继续?`, '提示', {
           confirmButtonText: '确定',
@@ -674,7 +673,7 @@
         }).catch(() => {})
       },
       // 选择组织树时触发
-      userpermissorgcheckedchange(data, checked, indeterminate) {
+      userpermissorgcheckedchange (data, checked, indeterminate) {
         let _this = this
         if (!_this.ischeckbj) {
           if (!_this.isfristchecked) {
@@ -686,7 +685,7 @@
           }
         }
       },
-      checkorgusermanage() {
+      checkorgusermanage () {
         let orgids = []
         let selectnodes = this.$refs.userpermisstree.getCheckedNodes()
         selectnodes.forEach(row => {
@@ -697,8 +696,8 @@
         }
         let _this = this
         this.$axios.get('equipment/getidsbyoid', {
-            params
-          })
+          params
+        })
           .then(res => {
             // response
             _this.userpermissdevicesselects = []
@@ -717,15 +716,15 @@
             this.loading = false
           })
       },
-      getorgtreelist() {
+      getorgtreelist () {
         let _this = this
         // request
         let params = {
           IsInnerOrganize: 1
         }
         _this.$axios.get('organizes/list', {
-            params
-          })
+          params
+        })
           .then(res => {
             _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
           })
@@ -734,14 +733,13 @@
             console.error(err)
           })
       },
-      clearSearch() {
+      clearSearch () {
         this.keyword = ''
         this.list = []
         this.initData()
       }
     }
   }
-
 </script>
 
 <style lang="scss">

+ 65 - 67
src/dashoo.cn/frontend_star/src/pages/system/userrole.vue

@@ -38,10 +38,10 @@
                 class="icon icon-user"></i></el-button>
             <el-button size="small" type="text" style="margin-left:3px" title="菜单权限" @click="setpower(scope.row)"><i
                 class="icon icon-file-text"></i></el-button>
-            <el-button size="small" type="text" style="margin-left:3px" title="操作权限" @click="getItemPower(scope.row)"><i
+            <!-- <el-button size="small" type="text" style="margin-left:3px" title="操作权限" @click="getItemPower(scope.row)"><i
                 class="icon icon-lock"></i></el-button>
             <el-button size="small" type="text" style="margin-left:3px" title="容器权限"
-              @click="setequipmentpower(scope.row)" v-if="appclient != 'lims'"><i class="icon icon-cog"></i></el-button>
+              @click="setequipmentpower(scope.row)" v-if="appclient != 'lims'"><i class="icon icon-cog"></i></el-button> -->
           </template>
         </el-table-column>
         <el-table-column prop="Realname" align="center" label="角色名" show-overflow-tooltip></el-table-column>
@@ -174,9 +174,9 @@
     computed: mapGetters({
       session: 'session'
     }),
-    data() {
+    data () {
       return {
-        //添加用户
+        // 添加用户
         addUserShow: false,
         partuserlist: [],
         OfficerList: [],
@@ -209,8 +209,8 @@
         powerdialogVisible: false,
         powerequipmentdialogVisible: false, // 容器权限
         operationPowerDialogVisible: false, // 操作权限
-        messageviewVisible: false, //信息查看权限
-        districtVisible: false, //区域信息查看权限
+        messageviewVisible: false, // 信息查看权限
+        districtVisible: false, // 区域信息查看权限
         addRoleOpsDialogVisible: false, // 给操作添加角色
         ismessageviewcheckall: false,
         operationOrganizeData: [],
@@ -242,14 +242,14 @@
         appclient: ''
       }
     },
-    created() {
+    created () {
       this.appclient = process.env.appclient
       // initial data
       this.initData()
       this.getallequipmentlist()
     },
     methods: {
-      initData() {
+      initData () {
         let _this = this
         // paginate
         const params = {
@@ -259,8 +259,8 @@
         }
         // request
         this.$axios.get('role/list', {
-            params
-          })
+          params
+        })
           .then(res => {
             // response
             _this.list = res.data.items
@@ -273,8 +273,8 @@
             _this.exportloading = false
           })
       },
-      //角色
-      opendialog(val) {
+      // 角色
+      opendialog (val) {
         if (val === null) {
           this.dialogtitle = '添加角色'
           this.clearroleform()
@@ -286,7 +286,7 @@
         }
         this.dialogVisible = true
       },
-      savedata() {
+      savedata () {
         if (this.roleform.realname === '') {
           this.$message({
             type: 'warning',
@@ -339,7 +339,7 @@
             .catch(() => {})
         }
       },
-      deleteroledata(val) {
+      deleteroledata (val) {
         let _this = this
         _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
@@ -367,8 +367,8 @@
         }).catch(() => {})
       },
 
-      //菜单权限
-      setpower(val) {
+      // 菜单权限
+      setpower (val) {
         let _this = this
         _this.operationid = val.Id
         _this.$axios.get('role/getpower?id=' + _this.operationid, null)
@@ -381,15 +381,15 @@
                 let isParent = false
                 for (let j = 0; j < res.data.Selectemodule.length; j++) {
                   if (res.data.Selectemodule[i].id === res.data.Selectemodule[j].pId) {
-                    //是父节点
+                    // 是父节点
                     isParent = true
-                    break;
-                  }
+                    break
                 }
-                if (isParent) { //不去勾选父节点
+                }
+                if (isParent) { // 不去勾选父节点
                   continue
                 }
-                //选中
+                // 选中
                 selectmodels.push(res.data.Selectemodule[i].id)
               }
             }
@@ -399,7 +399,7 @@
         this.powerdialogtitle = '角色(' + val.Realname + ')-菜单权限设置'
         this.powerdialogVisible = true
       },
-      savepower() {
+      savepower () {
         let orgids = []
         let selectnodes = this.$refs.modulepowertree.getCheckedNodes(false, true)
         selectnodes.forEach(row => {
@@ -427,8 +427,8 @@
           .catch(() => {})
       },
 
-      //操作权限
-      getItemPower(val) {
+      // 操作权限
+      getItemPower (val) {
         console.log(val)
         let _this = this
         _this.operationid = val.Id
@@ -448,7 +448,7 @@
         this.powerdialogtitle = '用户(' + val.Realname + ')-操作权限设置'
         this.operationPowerDialogVisible = true
       },
-      saveOperatinonPower() {
+      saveOperatinonPower () {
         let orgids = []
         let selectnodes = this.$refs.operationPowerTree.getCheckedNodes()
         selectnodes.forEach(row => {
@@ -476,8 +476,8 @@
           .catch(() => {})
       },
 
-      //容器权限
-      getallequipmentlist() {
+      // 容器权限
+      getallequipmentlist () {
         let _this = this
         _this.$axios.get('/equipment/elist', {})
           .then(res => {
@@ -492,15 +492,15 @@
             console.error(err)
           })
       },
-      setequipmentpower(val) {
+      setequipmentpower (val) {
         let _this = this
         _this.operationid = val.Id
         _this.selectedequip = []
         _this.$axios.get('/role/getroleequidpower?id=' + val.Id, {})
           .then(res => {
             if (res.data && res.data != '') {
-              var arr = res.data.split(",");
-              for (let i = 0; i < arr.length; i++) {
+              var arr = res.data.split(',')
+            for (let i = 0; i < arr.length; i++) {
                 _this.selectedequip.push(arr[i])
               }
             }
@@ -511,7 +511,7 @@
           })
         _this.powerequipmentdialogVisible = true
       },
-      saveequiptmentpower() {
+      saveequiptmentpower () {
         let _this = this
         this.$axios.put('/role/saveequpipower?id=' + this.operationid + '&selectedids=' + this.selectedequip, {})
           .then(res => {
@@ -535,13 +535,13 @@
           })
       },
 
-      //用户列表
-      showUserList(val) {
+      // 用户列表
+      showUserList (val) {
         this.userDialogVisible = true
         this.selectRoleId = val.Id
         this.initUserList(val.Id)
       },
-      initUserList(rid) {
+      initUserList (rid) {
         let _this = this
         // paginate
         const params = {
@@ -549,8 +549,8 @@
           _size: this.userSize
         }
         this.$axios.get('role/getusersforrole/' + rid, {
-            params
-          })
+          params
+        })
           .then(res => {
             _this.userList = res.data.items
             _this.currentUserItemCount = res.data.currentItemCount
@@ -559,12 +559,12 @@
             console.error(err)
           })
       },
-      roleadduser() {
+      roleadduser () {
         this.addUserShow = true
         this.getpartuserlist()
         this.OfficerList = []
       },
-      getpartuserlist() {
+      getpartuserlist () {
         let _this = this
         this.$axios.get('users/list', {})
           .then(res => {
@@ -576,22 +576,22 @@
             console.error(err)
           })
       },
-      adduerinrole() {
+      adduerinrole () {
         let _this = this
-        //用户姓名
-        let tempOfficers = [];
-        for (let idx in _this.OfficerList) {
-          let selectId = _this.OfficerList[idx];
-          for (let idx2 in _this.partuserlist) {
-            let item = _this.partuserlist[idx2];
-            if (item.Id == selectId) {
-              tempOfficers.push(item.Id);
-              break;
+        // 用户姓名
+        let tempOfficers = []
+      for (let idx in _this.OfficerList) {
+          let selectId = _this.OfficerList[idx]
+        for (let idx2 in _this.partuserlist) {
+            let item = _this.partuserlist[idx2]
+          if (item.Id == selectId) {
+              tempOfficers.push(item.Id)
+            break;
             }
           }
         }
-        let useridlist = tempOfficers.join(',');
-        let useridliststring = useridlist.toString()
+        let useridlist = tempOfficers.join(',')
+      let useridliststring = useridlist.toString()
         this.$axios.put('role/setuserrole/' + useridliststring + '_' + this.selectRoleId, {})
           .then(res => {
             if (res.data.code === 0) {
@@ -612,9 +612,8 @@
           .catch(err => {
             console.error(err)
           })
-
       },
-      userlistfilter() {
+      userlistfilter () {
         try {
           let entityArray = this.userList
           let arr = this.partuserlist
@@ -637,7 +636,7 @@
           console.log(e)
         }
       },
-      deleteuserdata(val) {
+      deleteuserdata (val) {
         let _this = this
         _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
@@ -663,7 +662,7 @@
             .catch(() => {})
         }).catch(() => {})
       },
-      deleteuserdataall() {
+      deleteuserdataall () {
         let _this = this
         _this.$confirm('此操作将永久删除所有数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
@@ -691,16 +690,16 @@
         }).catch(() => {})
       },
 
-      jstimehandle(val) {
+      jstimehandle (val) {
         val = val.replace('T', ' ')
         return val.substring(0, 10)
       },
-      clicksearch() {
+      clicksearch () {
         this.currentPage = 1
         this.initData()
       },
       // 全选框控制
-      handleCheckAllChange(val) {
+      handleCheckAllChange (val) {
         this.selectedequip = []
         if (val) {
           for (let i = 0; i < this.equipalllist.length; i++) {
@@ -709,53 +708,52 @@
         }
         this.isequpicheckall = false
       },
-      handlecheckedequpichange() {
+      handlecheckedequpichange () {
         let checkedCount = this.selectedequip.length
         this.equipCheckAll = checkedCount === this.equipalllist.length
         this.isequpicheckall = checkedCount > 0 && checkedCount < this.equipalllist.length
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initData()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.initData()
       },
 
-      handleUserSizeChange(value) {
+      handleUserSizeChange (value) {
         this.userSize = value
         this.currentUserPage = 1
         this.initUserList(this.selectRoleId)
       },
-      handleUserCurrentChange(value) {
+      handleUserCurrentChange (value) {
         this.currentUserPage = value
         this.initUserList(this.selectRoleId)
       },
-      clearroleform() {
+      clearroleform () {
         this.roleform.roleid = 0
         this.roleform.realname = ''
         this.roleform.description = ''
       },
-      seachdata() {
+      seachdata () {
         this.list = []
         this.currentPage = 1
         this.initData()
       },
-      searchCommand(command) {
+      searchCommand (command) {
         if (command == 'clear') {
           this.clearSearch()
         }
       },
-      clearSearch() {
+      clearSearch () {
         this.searchform.name = ''
         this.list = []
         this.initData()
       }
     }
   }
-
 </script>
 
 <style lang="scss">

+ 68 - 70
src/dashoo.cn/frontend_star/src/pages/system/users.vue

@@ -157,25 +157,25 @@
   export default {
     name: 'users',
 
-    data() {
+    data () {
       var checkusername = (rule, value, callback) => {
         if (!value) {
           callback(new Error('请输入账号'))
         } else {
-          if (this.appclient == 'lims') { //大港油田lims系统不用邮箱
-            callback()
-          }
-          let re = /^([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+.[a-zA-Z]{2,3}$/
-          if (!re.test(value)) {
-            callback(new Error('请输入正确的邮箱地址'))
-          } else {
+          if (this.appclient == 'lims') { // 大港油田lims系统不用邮箱
             callback()
           }
+          // let re = /^([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+.[a-zA-Z]{2,3}$/
+          // if (!re.test(value)) {
+          //   callback(new Error('请输入正确的邮箱地址'))
+          // } else {
+          callback()
+          // }
         }
       }
       return {
         downloading: '',
-        imghost: "",
+        imghost: '',
         organdialogVisible: false,
         currentItemCount: 0,
         currentItemCount2: 0,
@@ -209,7 +209,7 @@
           departmentname: '',
           RealnameRole: '',
           GroupId: '',
-          GroupName: '',
+          GroupName: ''
         },
         rulesuser: {
           username: [{
@@ -222,7 +222,7 @@
             trigger: 'blur'
           }]
         },
-        imageUrl: "",
+        imageUrl: '',
         operatingitem: 0,
         permissiondialogtitle: '',
         permissiondatadialogVisible: false,
@@ -241,23 +241,23 @@
         rolelistcheckall: [],
         selectedorg: [],
         userdepartment: [],
-        ischeckbj: false, // 过滤字段勾选时触发的选中事件
+        ischeckbj: false // 过滤字段勾选时触发的选中事件
       }
     },
     computed: mapGetters({
       authUser: 'authUser'
     }),
-    created() {
+    created () {
       this.appclient = process.env.appclient
-      this.imghost = process.env.limsimgserverhost;
-      this.getorgtreelist()
+      this.imghost = process.env.limsimgserverhost
+    this.getorgtreelist()
       this.initData()
       // this.loadequipsall()
       this.userdepartment.push(parseInt(this.authUser.Profile.DepartmentId))
       this.selectedorg = [parseInt(this.authUser.Profile.DepartmentId)]
     },
     methods: {
-      initData() {
+      initData () {
         let _this = this
         // paginate
         const params = {
@@ -267,8 +267,8 @@
         }
         // request
         this.$axios.get('users/list', {
-            params
-          })
+          params
+        })
           .then(res => {
             // response
             _this.list = res.data.items
@@ -292,25 +292,25 @@
             console.error(err)
           })
       },
-      handleAvatarSuccess(res, file) {
+      handleAvatarSuccess (res, file) {
         this.userform.sign = res
-        this.imageUrl = URL.createObjectURL(file.raw);
-      },
-      beforeAvatarUpload(file) {
-        console.log(file);
-        const isimg = file.type.indexOf("image/") === 0;
-        const isLt50k = file.size / 1024 / 50 < 1;
-        if (!isimg) {
-          this.$message.error("上传图片只能是 图片 格式!");
-          return false;
-        }
+        this.imageUrl = URL.createObjectURL(file.raw)
+    },
+      beforeAvatarUpload (file) {
+        console.log(file)
+      const isimg = file.type.indexOf('image/') === 0
+      const isLt50k = file.size / 1024 / 50 < 1
+      if (!isimg) {
+          this.$message.error('上传图片只能是 图片 格式!')
+        return false
+      }
         if (!isLt50k) {
-          this.$message.error("上传图片大小不能超过 50kb!");
-          return false;
-        }
-        return true;
-      },
-      roleset(val) {
+          this.$message.error('上传图片大小不能超过 50kb!')
+        return false
+      }
+        return true
+    },
+      roleset (val) {
         this.rolesettitle = '用户(' + val.Realname + ')-角色管理'
         this.rolesetVisible = true
         this.selecteduserid = val.Id + ''
@@ -319,7 +319,7 @@
         // request
         this.$axios.get('users/getuserrole/' + this.selecteduserid, {})
           .then(res => {
-            console.log("-------res----", res.data)
+            console.log('-------res----', res.data)
             _this.mustrolelist = []
             // response
             for (let i = 0; i < res.data.length; i++) {
@@ -331,14 +331,13 @@
               let rdx = 0
               for (rdx = 0; rdx < _this.rolelist.length; rdx++) {
                 if (parseInt(_this.rolelist[rdx].Id) == parseInt(res.data[i])) {
-                  flag = true;
-                  break;
+                  flag = true
+                break;
                 }
               }
               if (!flag) {
                 _this.mustrolelist.push(parseInt(res.data[i]))
               }
-
             }
 
             let checkedCount = this.selectedrole.length
@@ -350,7 +349,7 @@
             console.error(err)
           })
       },
-      rolesave() {
+      rolesave () {
         let _this = this
         for (let mdx in this.mustrolelist) {
           if (this.selectedrole.indexOf(this.mustrolelist[mdx]) == -1) {
@@ -383,16 +382,16 @@
             console.error(err)
           })
       },
-      handlecheckedrolechange() {
+      handlecheckedrolechange () {
         let checkedCount = this.selectedrole.length
         this.roleCheckAll = checkedCount === this.rolelist.length
         this.isrolecheckall = checkedCount > 0 && checkedCount < this.rolelist.length
       },
-      handleCheckAllChange(val) {
+      handleCheckAllChange (val) {
         this.selectedrole = val ? this.rolelistcheckall : []
         this.isrolecheckall = false
       },
-      roleisexist(val) {
+      roleisexist (val) {
         for (let i = 0; i < this.rolelist.length; i++) {
           if (this.rolelist[i].Id === val) {
             return true
@@ -416,32 +415,32 @@
       //       this.loading = false
       //     })
       // },
-      seachdata() {
+      seachdata () {
         this.list = []
         this.currentPage = 1
         this.initData()
       },
-      searchCommand(command) {
+      searchCommand (command) {
         if (command == 'clear') {
           this.clearSearch()
         }
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.list = []
         this.size = value
         this.currentPage = 1
         this.initData()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.list = []
         this.initData()
       },
-      jstimehandle(val) {
+      jstimehandle (val) {
         val = val.replace('T', ' ')
         return val.substring(0, 19)
       },
-      opendatadialog(item, v, index) {
+      opendatadialog (item, v, index) {
         let _this = this
         this.operatingitem = item
         this.datadialogVisible = true
@@ -484,7 +483,7 @@
             })
         }
       },
-      savedata(formName) {
+      savedata (formName) {
         let _this = this
         if (this.selectedorg.length === 0) {
           _this.$message({
@@ -546,7 +545,7 @@
           }
         })
       },
-      deletedata(val) {
+      deletedata (val) {
         let _this = this
         _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
@@ -574,10 +573,10 @@
             .catch(() => {})
         }).catch(() => {})
       },
-      resetForm(formName) {
+      resetForm (formName) {
         // this.$refs[formName].resetFields()
       },
-      clearuserForm() {
+      clearuserForm () {
         this.userform = {
           username: '',
           realname: '',
@@ -586,7 +585,7 @@
           description: ''
         }
       },
-      permission(v) {
+      permission (v) {
         let _this = this
         _this.ischeckbj = true // 过滤字段勾选时触发的选中事件
         this.userpermissdevicesselects = []
@@ -606,11 +605,11 @@
             console.error(err)
           })
       },
-      getorgbyeid(v) {
+      getorgbyeid (v) {
         let _this = this
         this.$axios.put('equipment/getorgidsbyeqids', {
-            EquipmentIds: v
-          })
+          EquipmentIds: v
+        })
           .then(res => {
             // response
             setTimeout(function () {
@@ -626,11 +625,11 @@
             console.error(err)
           })
       },
-      savepermission() {
+      savepermission () {
         let _this = this
         _this.$axios.put('users/permission/' + this.userform.id, {
-            channelids: this.userpermissdevicesselects + ''
-          })
+          channelids: this.userpermissdevicesselects + ''
+        })
           .then(res => {
             // response
             if (res.data.code === 0) {
@@ -648,7 +647,7 @@
           })
           .catch(() => {})
       },
-      resetpwd(val) {
+      resetpwd (val) {
         let _this = this
         _this.$confirm(`此操作将重置用户(${val.Realname})的密码为123456, 是否继续?`, '提示', {
           confirmButtonText: '确定',
@@ -674,7 +673,7 @@
         }).catch(() => {})
       },
       // 选择组织树时触发
-      userpermissorgcheckedchange(data, checked, indeterminate) {
+      userpermissorgcheckedchange (data, checked, indeterminate) {
         let _this = this
         if (!_this.ischeckbj) {
           if (!_this.isfristchecked) {
@@ -686,7 +685,7 @@
           }
         }
       },
-      checkorgusermanage() {
+      checkorgusermanage () {
         let orgids = []
         let selectnodes = this.$refs.userpermisstree.getCheckedNodes()
         selectnodes.forEach(row => {
@@ -697,8 +696,8 @@
         }
         let _this = this
         this.$axios.get('equipment/getidsbyoid', {
-            params
-          })
+          params
+        })
           .then(res => {
             // response
             _this.userpermissdevicesselects = []
@@ -717,15 +716,15 @@
             this.loading = false
           })
       },
-      getorgtreelist() {
+      getorgtreelist () {
         let _this = this
         // request
         let params = {
           IsInnerOrganize: 1
         }
         _this.$axios.get('organizes/list', {
-            params
-          })
+          params
+        })
           .then(res => {
             _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
           })
@@ -734,14 +733,13 @@
             console.error(err)
           })
       },
-      clearSearch() {
+      clearSearch () {
         this.keyword = ''
         this.list = []
         this.initData()
       }
     }
   }
-
 </script>
 
 <style lang="scss">

+ 68 - 70
src/dashoo.cn/frontend_web/src/pages/system/users.vue

@@ -157,25 +157,25 @@
   export default {
     name: 'users',
 
-    data() {
+    data () {
       var checkusername = (rule, value, callback) => {
         if (!value) {
           callback(new Error('请输入账号'))
         } else {
-          if (this.appclient == 'lims') { //大港油田lims系统不用邮箱
-            callback()
-          }
-          let re = /^([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+.[a-zA-Z]{2,3}$/
-          if (!re.test(value)) {
-            callback(new Error('请输入正确的邮箱地址'))
-          } else {
+          if (this.appclient == 'lims') { // 大港油田lims系统不用邮箱
             callback()
           }
+          // let re = /^([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+.[a-zA-Z]{2,3}$/
+          // if (!re.test(value)) {
+          //   callback(new Error('请输入正确的邮箱地址'))
+          // } else {
+          callback()
+          // }
         }
       }
       return {
         downloading: '',
-        imghost: "",
+        imghost: '',
         organdialogVisible: false,
         currentItemCount: 0,
         currentItemCount2: 0,
@@ -209,7 +209,7 @@
           departmentname: '',
           RealnameRole: '',
           GroupId: '',
-          GroupName: '',
+          GroupName: ''
         },
         rulesuser: {
           username: [{
@@ -222,7 +222,7 @@
             trigger: 'blur'
           }]
         },
-        imageUrl: "",
+        imageUrl: '',
         operatingitem: 0,
         permissiondialogtitle: '',
         permissiondatadialogVisible: false,
@@ -241,23 +241,23 @@
         rolelistcheckall: [],
         selectedorg: [],
         userdepartment: [],
-        ischeckbj: false, // 过滤字段勾选时触发的选中事件
+        ischeckbj: false // 过滤字段勾选时触发的选中事件
       }
     },
     computed: mapGetters({
       authUser: 'authUser'
     }),
-    created() {
+    created () {
       this.appclient = process.env.appclient
-      this.imghost = process.env.limsimgserverhost;
-      this.getorgtreelist()
+      this.imghost = process.env.limsimgserverhost
+    this.getorgtreelist()
       this.initData()
       // this.loadequipsall()
       this.userdepartment.push(parseInt(this.authUser.Profile.DepartmentId))
       this.selectedorg = [parseInt(this.authUser.Profile.DepartmentId)]
     },
     methods: {
-      initData() {
+      initData () {
         let _this = this
         // paginate
         const params = {
@@ -267,8 +267,8 @@
         }
         // request
         this.$axios.get('users/list', {
-            params
-          })
+          params
+        })
           .then(res => {
             // response
             _this.list = res.data.items
@@ -292,25 +292,25 @@
             console.error(err)
           })
       },
-      handleAvatarSuccess(res, file) {
+      handleAvatarSuccess (res, file) {
         this.userform.sign = res
-        this.imageUrl = URL.createObjectURL(file.raw);
-      },
-      beforeAvatarUpload(file) {
-        console.log(file);
-        const isimg = file.type.indexOf("image/") === 0;
-        const isLt50k = file.size / 1024 / 50 < 1;
-        if (!isimg) {
-          this.$message.error("上传图片只能是 图片 格式!");
-          return false;
-        }
+        this.imageUrl = URL.createObjectURL(file.raw)
+    },
+      beforeAvatarUpload (file) {
+        console.log(file)
+      const isimg = file.type.indexOf('image/') === 0
+      const isLt50k = file.size / 1024 / 50 < 1
+      if (!isimg) {
+          this.$message.error('上传图片只能是 图片 格式!')
+        return false
+      }
         if (!isLt50k) {
-          this.$message.error("上传图片大小不能超过 50kb!");
-          return false;
-        }
-        return true;
-      },
-      roleset(val) {
+          this.$message.error('上传图片大小不能超过 50kb!')
+        return false
+      }
+        return true
+    },
+      roleset (val) {
         this.rolesettitle = '用户(' + val.Realname + ')-角色管理'
         this.rolesetVisible = true
         this.selecteduserid = val.Id + ''
@@ -319,7 +319,7 @@
         // request
         this.$axios.get('users/getuserrole/' + this.selecteduserid, {})
           .then(res => {
-            console.log("-------res----", res.data)
+            console.log('-------res----', res.data)
             _this.mustrolelist = []
             // response
             for (let i = 0; i < res.data.length; i++) {
@@ -331,14 +331,13 @@
               let rdx = 0
               for (rdx = 0; rdx < _this.rolelist.length; rdx++) {
                 if (parseInt(_this.rolelist[rdx].Id) == parseInt(res.data[i])) {
-                  flag = true;
-                  break;
+                  flag = true
+                break;
                 }
               }
               if (!flag) {
                 _this.mustrolelist.push(parseInt(res.data[i]))
               }
-
             }
 
             let checkedCount = this.selectedrole.length
@@ -350,7 +349,7 @@
             console.error(err)
           })
       },
-      rolesave() {
+      rolesave () {
         let _this = this
         for (let mdx in this.mustrolelist) {
           if (this.selectedrole.indexOf(this.mustrolelist[mdx]) == -1) {
@@ -383,16 +382,16 @@
             console.error(err)
           })
       },
-      handlecheckedrolechange() {
+      handlecheckedrolechange () {
         let checkedCount = this.selectedrole.length
         this.roleCheckAll = checkedCount === this.rolelist.length
         this.isrolecheckall = checkedCount > 0 && checkedCount < this.rolelist.length
       },
-      handleCheckAllChange(val) {
+      handleCheckAllChange (val) {
         this.selectedrole = val ? this.rolelistcheckall : []
         this.isrolecheckall = false
       },
-      roleisexist(val) {
+      roleisexist (val) {
         for (let i = 0; i < this.rolelist.length; i++) {
           if (this.rolelist[i].Id === val) {
             return true
@@ -416,32 +415,32 @@
       //       this.loading = false
       //     })
       // },
-      seachdata() {
+      seachdata () {
         this.list = []
         this.currentPage = 1
         this.initData()
       },
-      searchCommand(command) {
+      searchCommand (command) {
         if (command == 'clear') {
           this.clearSearch()
         }
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.list = []
         this.size = value
         this.currentPage = 1
         this.initData()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.list = []
         this.initData()
       },
-      jstimehandle(val) {
+      jstimehandle (val) {
         val = val.replace('T', ' ')
         return val.substring(0, 19)
       },
-      opendatadialog(item, v, index) {
+      opendatadialog (item, v, index) {
         let _this = this
         this.operatingitem = item
         this.datadialogVisible = true
@@ -484,7 +483,7 @@
             })
         }
       },
-      savedata(formName) {
+      savedata (formName) {
         let _this = this
         if (this.selectedorg.length === 0) {
           _this.$message({
@@ -546,7 +545,7 @@
           }
         })
       },
-      deletedata(val) {
+      deletedata (val) {
         let _this = this
         _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
@@ -574,10 +573,10 @@
             .catch(() => {})
         }).catch(() => {})
       },
-      resetForm(formName) {
+      resetForm (formName) {
         // this.$refs[formName].resetFields()
       },
-      clearuserForm() {
+      clearuserForm () {
         this.userform = {
           username: '',
           realname: '',
@@ -586,7 +585,7 @@
           description: ''
         }
       },
-      permission(v) {
+      permission (v) {
         let _this = this
         _this.ischeckbj = true // 过滤字段勾选时触发的选中事件
         this.userpermissdevicesselects = []
@@ -606,11 +605,11 @@
             console.error(err)
           })
       },
-      getorgbyeid(v) {
+      getorgbyeid (v) {
         let _this = this
         this.$axios.put('equipment/getorgidsbyeqids', {
-            EquipmentIds: v
-          })
+          EquipmentIds: v
+        })
           .then(res => {
             // response
             setTimeout(function () {
@@ -626,11 +625,11 @@
             console.error(err)
           })
       },
-      savepermission() {
+      savepermission () {
         let _this = this
         _this.$axios.put('users/permission/' + this.userform.id, {
-            channelids: this.userpermissdevicesselects + ''
-          })
+          channelids: this.userpermissdevicesselects + ''
+        })
           .then(res => {
             // response
             if (res.data.code === 0) {
@@ -648,7 +647,7 @@
           })
           .catch(() => {})
       },
-      resetpwd(val) {
+      resetpwd (val) {
         let _this = this
         _this.$confirm(`此操作将重置用户(${val.Realname})的密码为123456, 是否继续?`, '提示', {
           confirmButtonText: '确定',
@@ -674,7 +673,7 @@
         }).catch(() => {})
       },
       // 选择组织树时触发
-      userpermissorgcheckedchange(data, checked, indeterminate) {
+      userpermissorgcheckedchange (data, checked, indeterminate) {
         let _this = this
         if (!_this.ischeckbj) {
           if (!_this.isfristchecked) {
@@ -686,7 +685,7 @@
           }
         }
       },
-      checkorgusermanage() {
+      checkorgusermanage () {
         let orgids = []
         let selectnodes = this.$refs.userpermisstree.getCheckedNodes()
         selectnodes.forEach(row => {
@@ -697,8 +696,8 @@
         }
         let _this = this
         this.$axios.get('equipment/getidsbyoid', {
-            params
-          })
+          params
+        })
           .then(res => {
             // response
             _this.userpermissdevicesselects = []
@@ -717,15 +716,15 @@
             this.loading = false
           })
       },
-      getorgtreelist() {
+      getorgtreelist () {
         let _this = this
         // request
         let params = {
           IsInnerOrganize: 1
         }
         _this.$axios.get('organizes/list', {
-            params
-          })
+          params
+        })
           .then(res => {
             _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
           })
@@ -734,14 +733,13 @@
             console.error(err)
           })
       },
-      clearSearch() {
+      clearSearch () {
         this.keyword = ''
         this.list = []
         this.initData()
       }
     }
   }
-
 </script>
 
 <style lang="scss">

+ 3 - 3
src/dashoo.cn/frontend_weixin/src/pages/samples.vue

@@ -22,10 +22,10 @@
       <template v-if="showCelldetail">
         <x-textarea :value="donorslist.ZBack12" :max="200" title="细胞状态:" :show-counter="false" readonly="true"></x-textarea>
         <x-textarea :value="donorslist.ZBack11" :max="200" title="细胞出库信息:" :show-counter="false" readonly="true"></x-textarea>
-        <x-textarea :value="donorslist.SamplePosition" title="自体存储位置:" text-align="right" readonly="true"></x-textarea>
+        <x-textarea :value="donorslist.WeiZhi" title="自体存储位置:" text-align="right" readonly="true"></x-textarea>
         <cell :value="donorslist.Temperature" title="存储温度:" text-align="right"></cell>
-        <cell :value="donorslist.ReceiveDate" title="储存日期:" text-align="right" readonly="true"></cell>
-        <cell :value="donorslist.ValidityDate" title="储存年限:" text-align="right" readonly="true"></cell>
+        <cell :value="donorslist.RiQi" title="储存日期:" text-align="right" readonly="true"></cell>
+        <cell :value="donorslist.NianXian" title="储存年限:" text-align="right" readonly="true"></cell>
 
       </template>