3
2
فهرست منبع

計量bug修改

huahaiyan 6 سال پیش
والد
کامیت
ebdfbc835a

+ 1 - 1
src/dashoo.cn/frontend_web/src/api/meter/reportalertorkr.js

@@ -15,7 +15,7 @@ export default {
   getEntity (entityId, AlertorId, myAxios) {
     return myAxios({
       url: '/limsreportalerkrgas/get/' + entityId + '?AlertorId=' + AlertorId,
-      method: 'GET',
+      method: 'GET'
     })
   },
   addEntity (formData, myAxios) {

+ 159 - 167
src/dashoo.cn/frontend_web/src/pages/lims/reportalertorkrgasdetect/_opera/operation.vue

@@ -487,7 +487,7 @@
     },
     name: 's5ovelimsreportalertorEdit',
 
-    data() {
+    data () {
       return {
         ProoFreadShow: false,
         acceptUsers: [],
@@ -545,7 +545,7 @@
           InstrumentLevel: '',
           DielecStrength: ''
         },
-        //证书编号
+        // 证书编号
         formcer: [],
         formCertificateData: {
           Id: 0,
@@ -588,7 +588,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }],
-        //certificateDataAll: [],
+        // certificateDataAll: [],
         certificateData: [{
           Id: 0,
           value: 1,
@@ -620,7 +620,7 @@
           StanDevice: '',
           InstrumentNo: ''
         }],
-        //报警误差
+        // 报警误差
         alerValData: [{
           Id: 0,
           AlertFunc: [],
@@ -652,7 +652,7 @@
           value: '1',
           label: '不正常'
         }],
-        //示值误差及响应时间
+        // 示值误差及响应时间
         deviationData: [{
           Id: 0,
           GasValue: 10,
@@ -684,7 +684,7 @@
           DeviationRelative: '0',
           Deviation: ''
         }],
-        //响应时间
+        // 响应时间
         responseTimeData: [{
           Id: 0,
           GasValue: 40.2,
@@ -693,7 +693,7 @@
           Value3: '',
           Deviation: ''
         }],
-        //重复性
+        // 重复性
         RepeatForm: {
           Id: 0,
           GasValue: '',
@@ -718,7 +718,7 @@
           AvgValue: '',
           RepeatValue: ''
         }],
-        //漂移
+        // 漂移
         ShiftData: [{
           Id: 0,
           ValueType: '零点示值',
@@ -743,14 +743,14 @@
           Value6: '',
           ZeroValue: '/',
           ShowValue: '/'
-        }],
-        //下拉选择项
-        //wellNoOptions: [],
-        //supervisersOptions: [],
+        }]
+        // 下拉选择项
+        // wellNoOptions: [],
+        // supervisersOptions: [],
 
       }
     },
-    created() {
+    created () {
       this.queryParams.EId = this.$route.query.eid
       this.queryParams.TaskBalanceId = this.$route.query.tbid
       this.queryParams.DataEntryId = this.$route.query.deid
@@ -763,7 +763,7 @@
       this.initDatas()
       this.getUsersByRole()
       this.getdevice()
-      //this.getDictOptions();
+      // this.getDictOptions();
       // if (this.serviceId != 'add' && this.serviceId > 0) {
       //   this.formData.Id = this.serviceId;
       //   this.initDatas();
@@ -772,25 +772,25 @@
       // }
     },
     methods: {
-      initDatas() {
+      initDatas () {
+        console.log(this.formData.DataEntryId, 'this.formData.DataEntryId')
         if (this.formData.DataEntryId) {
-          api.getEntity(this.formData.DataEntryId, this.$axios).then(res => {
-            console.log("------res------", res.data)
-            this.formData = res.data.mainitem;
+          api.getEntity(this.formData.DataEntryId, '', this.$axios).then(res => {
+            console.log('------res------', res.data)
+            this.formData = res.data.mainitem
             this.formData.DetectBasis = 'JJG 693-2011《 可燃气体检测报警器》检定规程'
             this.formData.StandardDesc = '可燃气体检测报警器检定装置'
-            if (this.formData.CheckDate == "0001-01-01T00:00:00Z") {
-              this.formData.CheckDate = new Date();
+            if (this.formData.CheckDate == '0001-01-01T00:00:00Z') {
+              this.formData.CheckDate = new Date()
             }
             if (res.data.ceritem != null) {
               for (var i = 0; i < res.data.ceritem.length - 1; i++) {
-                this.certificateData[i].Id = res.data.ceritem[i].Id;
-                this.certificateData[i].CerNum = res.data.ceritem[i].CerNum;
-                this.certificateData[i].StandVal = res.data.ceritem[i].StandVal;
-                this.certificateData[i].Uncertainty = res.data.ceritem[i].Uncertainty;
-                this.certificateData[i].EffectDate = res.data.ceritem[i].EffectDate;
-                this.certificateData[i].StanDevice = res.data.ceritem[i].StanDevice;
-
+                this.certificateData[i].Id = res.data.ceritem[i].Id
+                this.certificateData[i].CerNum = res.data.ceritem[i].CerNum
+                this.certificateData[i].StandVal = res.data.ceritem[i].StandVal
+                this.certificateData[i].Uncertainty = res.data.ceritem[i].Uncertainty
+                this.certificateData[i].EffectDate = res.data.ceritem[i].EffectDate
+                this.certificateData[i].StanDevice = res.data.ceritem[i].StanDevice
               }
               this.formCertificateData.Id = res.data.ceritem[3].Id
               this.formCertificateData.StanDevice = res.data.ceritem[3].StanDevice
@@ -802,75 +802,75 @@
               this.formData.StanDevice = res.data.ceritem[0].StanDevice
               this.formData.InstrumentNo = res.data.ceritem[0].StanDevice
             }
-            console.log("-----this.formData---", this.formData)
+            console.log('-----this.formData---', this.formData)
             if (res.data.alvalitem != null) {
               for (var i = 0; i < res.data.alvalitem.length; i++) {
-                this.alerValData[i] = res.data.alvalitem[i];
+                this.alerValData[i] = res.data.alvalitem[i]
                 this.alerValData[i].AlertFunc = []
-                if (this.alerValData[i].AlertFunction != "") {
+                if (this.alerValData[i].AlertFunction != '') {
                   this.alerValData[i].AlertFunc.push(this.alerValData[i].AlertFunction)
                 }
               }
             }
             if (res.data.deviitem != null) {
               for (var i = 0; i < res.data.deviitem.length; i++) {
-                this.deviationData[i].Id = res.data.deviitem[i].Id;
-                this.deviationData[i].GasValue = res.data.deviitem[i].GasValue;
-                this.deviationData[i].Value1 = res.data.deviitem[i].Value1;
-                this.deviationData[i].Value2 = res.data.deviitem[i].Value2;
-                this.deviationData[i].Value3 = res.data.deviitem[i].Value3;
-                this.deviationData[i].AvgValue = res.data.deviitem[i].AvgValue + "";
-                this.deviationData[i].DeviationAbs = res.data.deviitem[i].DeviationAbs;
-                this.deviationData[i].DeviationRelative = res.data.deviitem[i].DeviationRelative;
-                this.deviationData[i].Deviation = res.data.deviitem[i].Deviation;
+                this.deviationData[i].Id = res.data.deviitem[i].Id
+                this.deviationData[i].GasValue = res.data.deviitem[i].GasValue
+                this.deviationData[i].Value1 = res.data.deviitem[i].Value1
+                this.deviationData[i].Value2 = res.data.deviitem[i].Value2
+                this.deviationData[i].Value3 = res.data.deviitem[i].Value3
+                this.deviationData[i].AvgValue = res.data.deviitem[i].AvgValue + ''
+                this.deviationData[i].DeviationAbs = res.data.deviitem[i].DeviationAbs
+                this.deviationData[i].DeviationRelative = res.data.deviitem[i].DeviationRelative
+                this.deviationData[i].Deviation = res.data.deviitem[i].Deviation
               }
             }
             if (res.data.responitem != null) {
               for (var i = 0; i < res.data.responitem.length; i++) {
-                this.responseTimeData[i] = res.data.responitem[i];
+                this.responseTimeData[i] = res.data.responitem[i]
               }
             }
             if (res.data.repeatitem != null) {
               for (var i = 0; i < res.data.repeatitem.length; i++) {
-                this.RepeatData[i] = res.data.repeatitem[i];
-                this.RepeatData[i].AvgValue = res.data.repeatitem[i].AvgValue + ""
-                this.deviationData[i].RepeatValue = res.data.deviitem[i].RepeatValue;
+                this.RepeatData[i] = res.data.repeatitem[i]
+                this.RepeatData[i].AvgValue = res.data.repeatitem[i].AvgValue + ''
+                this.deviationData[i].RepeatValue = res.data.deviitem[i].RepeatValue
               }
             }
             if (res.data.shiftitem != null) {
               for (var i = 0; i < res.data.shiftitem.length; i++) {
-                this.ShiftData[i] = res.data.shiftitem[i];
+                this.ShiftData[i] = res.data.shiftitem[i]
                 this.ShiftData[i].ZeroValue = '/'
                 this.ShiftData[i].ShowValue = '/'
               }
             }
           }).catch(err => {
             console.error(err)
-          });
+          })
         }
       },
-      getdevice() {
+      getdevice () {
         let _this = this
         _this.$axios.get('/instrument/initlistdata', {})
           .then(function (response) {
-            console.log("jkkfddf", response.data.items)
+            console.log('jkkfddf', response.data.items)
             _this.DeviceList = response.data.items
-            console.log("-_this._this.DeviceList------", _this.DeviceList)
+            console.log('-_this._this.DeviceList------', _this.DeviceList)
             if (!_this.DeviceList) {
               return false
             }
             for (var i = 0; i < _this.DeviceList.length; i++) {
               let devicelist = _this.DeviceList[i]
-              instapi.getList(_this.DeviceList[i].Id, "", _this.$axios).then(res => {
+              instapi.getList(_this.DeviceList[i].Id, '', _this.$axios).then(res => {
                 if (res.data.currentItemCount === 1) {
                   _this.StanDeviceoptions2.push({
                     id: devicelist.Id,
-                    name: devicelist.Name,
+                    name: devicelist.Name
                   })
                 } else {
                   _this.StanDeviceoptions.push({
                     id: devicelist.Id,
-                    name: devicelist.Name,
+                    name: devicelist.Name
                   })
                 }
               }).catch(err => {
@@ -882,37 +882,35 @@
             console.log(error)
           })
       },
-      chooseCertify2(value) {
-        let _this = this
-        let obj = {};
+      chooseCertify2 (value) {
+        let obj = {}
         obj = this.StanDeviceoptions2.find((item) => {
-          return item.id === value;
-        });
+          return item.id === value
+        })
         this.formCertificateData.StanDevice = obj.name
         let instrumentno = value
-        //访问接口
-        instapi.getList(instrumentno, "", this.$axios).then(res => {
+        // 访问接口
+        instapi.getList(instrumentno, '', this.$axios).then(res => {
           this.certificateDataform = res.data.items
           this.formCertificateData.CerNum = this.certificateDataform[0].CerNum
           this.formCertificateData.Uncertainty = this.certificateDataform[0].Uncertainty
           this.formCertificateData.StandVal = this.certificateDataform[0].StandVal
           this.formCertificateData.EffectDate = this.certificateDataform[0].EffectDate
-
         }).catch(err => {
           console.error(err)
         })
       },
-      chooseCertify(value) {
-        let obj = {};
+      chooseCertify (value) {
+        let obj = {}
         obj = this.StanDeviceoptions.find((item) => {
-          return item.id === value;
-        });
+          return item.id === value
+        })
         this.formData.StanDevice = obj.name
-        console.log(obj.name);
+        console.log(obj.name)
         let _this = this
         _this.InstrumentNo = value
-        //访问接口
-        instapi.getList(_this.InstrumentNo, "", this.$axios).then(res => {
+        // 访问接口
+        instapi.getList(_this.InstrumentNo, '', this.$axios).then(res => {
           this.certificateDataform = res.data.items
           for (var i = 0; i < this.certificateDataform.length; i++) {
             this.certificateData[i].CerNum = this.certificateDataform[i].CerNum
@@ -925,7 +923,7 @@
         })
       },
       // 获取校核人列表
-      getUsersByRole() {
+      getUsersByRole () {
         // request
         this.$axios.get('/limsdataentry/getuserlistbyjhrole/', {})
           .then(res => {
@@ -938,7 +936,7 @@
             console.error(err)
           })
       },
-      discountHeaderStyle1({
+      discountHeaderStyle1 ({
         row,
         column,
         rowIndex,
@@ -950,16 +948,16 @@
           }
         }
       },
-      getDictOptions() {
+      getDictOptions () {
         api.getDictList(this.$axios).then(res => {
-          //this.wellNoOptions = res.data.items['WellNo']
-          //this.supervisersOptions = res.data.items['Supervisers']
+          // this.wellNoOptions = res.data.items['WellNo']
+          // this.supervisersOptions = res.data.items['Supervisers']
         }).catch(err => {
           console.error(err)
         })
       },
 
-      getDeValueAvg(row) {
+      getDeValueAvg (row) {
         var divisor = 0
         var sum = 0
         if (row.Value1 !== '' && parseFloat(row.Value1) !== 0) {
@@ -985,45 +983,45 @@
           row.Deviation = 0
         }
       },
-      getRepeValueAvg(row) {
+      getRepeValueAvg (row) {
         var divisor = 0
         var sum = 0.00
-        if (row.Value1 !== '' &&  parseFloat(row.Value1) !== 0) {
+        if (row.Value1 !== '' && parseFloat(row.Value1) !== 0) {
           divisor++
-          sum = sum +  parseFloat(row.Value1)
+          sum = sum + parseFloat(row.Value1)
         }
-        if (row.Value2 !== '' &&  parseFloat(row.Value2) !== 0) {
+        if (row.Value2 !== '' && parseFloat(row.Value2) !== 0) {
           divisor++
-          sum = sum +  parseFloat(row.Value2)
+          sum = sum + parseFloat(row.Value2)
         }
-        if (row.Value3 !== '' &&  parseFloat(row.Value3) !== 0) {
+        if (row.Value3 !== '' && parseFloat(row.Value3) !== 0) {
           divisor++
-          sum = sum +  parseFloat(row.Value3)
+          sum = sum + parseFloat(row.Value3)
         }
-        if (row.Value4 !== '' &&  parseFloat(row.Value4) !== 0) {
+        if (row.Value4 !== '' && parseFloat(row.Value4) !== 0) {
           divisor++
-          sum = sum +  parseFloat(row.Value4)
+          sum = sum + parseFloat(row.Value4)
         }
-        if (row.Value5 !== '' &&  parseFloat(row.Value5) !== 0) {
+        if (row.Value5 !== '' && parseFloat(row.Value5) !== 0) {
           divisor++
-          sum = sum +  parseFloat(row.Value5)
+          sum = sum + parseFloat(row.Value5)
         }
-        if (row.Value6 !== '' &&  parseFloat(row.Value6) !== 0) {
+        if (row.Value6 !== '' && parseFloat(row.Value6) !== 0) {
           divisor++
-          sum = sum +  parseFloat(row.Value6)
+          sum = sum + parseFloat(row.Value6)
         }
         if (divisor !== 0) {
           row.AvgValue = (sum / divisor).toFixed(2)
         } else {
           row.AvgValue = '0'
         }
-        if (row.AvgValue !== '' &&  parseFloat(row.AvgValue) !== 0 &&
-          row.Value1 !== '' &&  parseFloat(row.Value1) !== 0 &&
-          row.Value2 !== '' &&  parseFloat(row.Value2) !== 0 &&
-          row.Value3 !== '' &&  parseFloat(row.Value3) !== 0 &&
-          row.Value4 !== '' &&  parseFloat(row.Value4) !== 0 &&
-          row.Value5 !== '' &&  parseFloat(row.Value5) !== 0 &&
-          row.Value6 !== '' &&  parseFloat(row.Value6) !== 0) {
+        if (row.AvgValue !== '' && parseFloat(row.AvgValue) !== 0 &&
+          row.Value1 !== '' && parseFloat(row.Value1) !== 0 &&
+          row.Value2 !== '' && parseFloat(row.Value2) !== 0 &&
+          row.Value3 !== '' && parseFloat(row.Value3) !== 0 &&
+          row.Value4 !== '' && parseFloat(row.Value4) !== 0 &&
+          row.Value5 !== '' && parseFloat(row.Value5) !== 0 &&
+          row.Value6 !== '' && parseFloat(row.Value6) !== 0) {
           var v1 = (parseFloat(row.AvgValue) - parseFloat(row.Value1)).toFixed(2)
           var v2 = (parseFloat(row.AvgValue) - parseFloat(row.Value2)).toFixed(2)
           var v3 = (parseFloat(row.AvgValue) - parseFloat(row.Value3)).toFixed(2)
@@ -1032,35 +1030,35 @@
           var v6 = (parseFloat(row.AvgValue) - parseFloat(row.Value6)).toFixed(2)
           var sumsq = v1 * v1 + v2 * v2 + v3 * v3 + v4 * v4 + v5 * v5 + v6 * v6
           var sqthen = Math.sqrt(sumsq / 5)
-          console.log("--sqthen----",sqthen)
+          console.log('--sqthen----', sqthen)
           row.RepeatValue = Number((parseFloat(sqthen) / parseFloat(row.AvgValue) * 100).toFixed(2))
-          console.log("--row.RepeatValue----",row.RepeatValue)
+          console.log('--row.RepeatValue----', row.RepeatValue)
         } else {
           row.RepeatValue = 0
         }
       },
-      getReTimeAvg(row) {
+      getReTimeAvg (row) {
         var divisor = 0
         var sum = 0
-        if (row.Value1 !== '' &&  parseFloat(row.Value1) !== 0) {
+        if (row.Value1 !== '' && parseFloat(row.Value1) !== 0) {
           divisor++
-          sum = sum +  parseFloat(row.Value1)
+          sum = sum + parseFloat(row.Value1)
         }
-        if (row.Value2 !== '' &&  parseFloat(row.Value2) !== 0) {
+        if (row.Value2 !== '' && parseFloat(row.Value2) !== 0) {
           divisor++
-          sum = sum +  parseFloat(row.Value2)
+          sum = sum + parseFloat(row.Value2)
         }
-        if (row.Value3 !== '' &&  parseFloat(row.Value3) !== 0) {
+        if (row.Value3 !== '' && parseFloat(row.Value3) !== 0) {
           divisor++
-          sum = sum +  parseFloat(row.Value3)
+          sum = sum + parseFloat(row.Value3)
         }
         if (divisor !== 0) {
-          row.Deviation =Number( (parseFloat(sum) / divisor).toFixed(2))
+          row.Deviation = Number((parseFloat(sum) / divisor).toFixed(2))
         } else {
           row.Deviation = 0
         }
       },
-      getShiftValue(row) {
+      getShiftValue (row) {
         // var shift = 0
         // var shift1 = 0
         // var shift2 = 0
@@ -1111,19 +1109,19 @@
         //   } else if (row.ValueType === '量程示值') {
         //     row.ShowValue = shift
         //     row.ZeroValue = "/"
-        //   } 
+        //   }
         // }
       },
-      setProoFreadShow() {
+      setProoFreadShow () {
         this.ProoFreadShow = true
       },
       // 提交校核
-      makesure() {
+      makesure () {
         this.$confirm('确定提交校核!', '提示', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          })
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
           .then(() => {
             this.ProoFreadShow = false
             this.checkstatus()
@@ -1132,14 +1130,14 @@
           .catch(() => {})
       },
       // 添加运行记录
-      addRunRecord() {
-        this.$axios.post('/limsZuhq/addRunRecord/' + this.formData.DataEntryId, ).then(res => {
+      addRunRecord () {
+        this.$axios.post('/limsZuhq/addRunRecord/' + this.formData.DataEntryId).then(res => {
 
         }).catch(error => {
           console.log(error)
         })
       },
-      checkstatus() {
+      checkstatus () {
         this.shenhesubmitForm.SuccessStatus = 1
         this.shenhesubmitForm.DataEntryId = parseInt(this.formData.DataEntryId)
         let params = this.shenhesubmitForm
@@ -1167,27 +1165,26 @@
           })
       },
 
-      //保存信息
-      saveEntity() {
+      // 保存信息
+      saveEntity () {
         this.$refs['formData'].validate((valid) => {
           if (valid) {
             if (!this.formData.Id) {
-              this.addEntityMain();
+              this.addEntityMain()
             } else {
-              this.updateEntity();
+              this.updateEntity()
             }
-
           } else {
             return false
           }
         })
       },
-      //添加数据
-      addEntityMain() {
+      // 添加数据
+      addEntityMain () {
         let _this = this
         if (this.certificateData != null) {
           for (var i = 0; i < this.certificateData.length; i++) {
-            if (this.certificateData[i].StanDevice === "") {
+            if (this.certificateData[i].StanDevice === '') {
               this.certificateData[i].InstrumentNo = this.formData.InstrumentNo
               this.certificateData[i].StanDevice = this.formData.StanDevice
             }
@@ -1230,41 +1227,39 @@
           this.ShiftData[i].Value4 = parseFloat(this.ShiftData[i].Value4)
           this.ShiftData[i].Value5 = parseFloat(this.ShiftData[i].Value5)
           this.ShiftData[i].Value6 = parseFloat(this.ShiftData[i].Value6)
-
         }
         let allform = {
           BenMainform: this.formData,
-          CertiArrayList: this.certificateData, //添加证书数据
-          AlertValArrayList: this.alerValData, //添加报警数据
-          DeviationArrayList: this.deviationData, //添加示值误差数据
-          ResponTimeArrayList: this.responseTimeData, //添加响应时间数据
-          RepeatArrayList: this.RepeatData, //添加重复性数据
-          ShiftArrayList: this.ShiftData, //添加漂移数据
+          CertiArrayList: this.certificateData, // 添加证书数据
+          AlertValArrayList: this.alerValData, // 添加报警数据
+          DeviationArrayList: this.deviationData, // 添加示值误差数据
+          ResponTimeArrayList: this.responseTimeData, // 添加响应时间数据
+          RepeatArrayList: this.RepeatData, // 添加重复性数据
+          ShiftArrayList: this.ShiftData // 添加漂移数据
         }
         allform = Object.assign(allform, this.formCertificateData)
-        console.log("---------allform", allform)
+        console.log('---------allform', allform)
         api.addEntity(allform, this.$axios).then(res => {
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
-            this.formData.Id = res.data.item;
-            this.initDatas();
+            // 保存成功后,初始化数据,变成修改
+            this.formData.Id = res.data.item
+            this.initDatas()
             this.$message({
               type: 'success',
               message: res.data.message
-            });
+            })
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
+            })
           }
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
 
-
-      updateEntity() {
+      updateEntity () {
         let _this = this
         if (this.certificateData != null) {
           for (var i = 0; i < this.certificateData.length; i++) {
@@ -1309,44 +1304,42 @@
           this.ShiftData[i].Value4 = parseFloat(this.ShiftData[i].Value4)
           this.ShiftData[i].Value5 = parseFloat(this.ShiftData[i].Value5)
           this.ShiftData[i].Value6 = parseFloat(this.ShiftData[i].Value6)
-
         }
         let allform = {
           BenMainform: this.formData,
-          CertiArrayList: this.certificateData, //添加证书数据
-          AlertValArrayList: this.alerValData, //添加报警数据
-          DeviationArrayList: this.deviationData, //添加示值误差数据
-          ResponTimeArrayList: this.responseTimeData, //添加响应时间数据
-          RepeatArrayList: this.RepeatData, //添加重复性数据
-          ShiftArrayList: this.ShiftData, //添加漂移数据
+          CertiArrayList: this.certificateData, // 添加证书数据
+          AlertValArrayList: this.alerValData, // 添加报警数据
+          DeviationArrayList: this.deviationData, // 添加示值误差数据
+          ResponTimeArrayList: this.responseTimeData, // 添加响应时间数据
+          RepeatArrayList: this.RepeatData, // 添加重复性数据
+          ShiftArrayList: this.ShiftData // 添加漂移数据
         }
         allform = Object.assign(allform, this.formCertificateData)
-        console.log("-------allform--------", allform)
+        console.log('-------allform--------', allform)
         api.updateEntity(this.formData.DataEntryId, allform, this.$axios).then(res => {
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
-            this.initDatas();
+            // 保存成功后,初始化数据,变成修改
+            this.initDatas()
             this.$message({
               type: 'success',
               message: res.data.message
-            });
-
+            })
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
+            })
           }
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
       // 返回
-      backFunc() {
+      backFunc () {
         this.$router.go(-1)
       },
 
-      renderHeader(createElement, {
+      renderHeader (createElement, {
         column,
         _self
       }) {
@@ -1354,14 +1347,14 @@
         const label = column.label
         const labelArr = label.split(',')
         return createElement(
-          'span', //创建最外层的标签可随意
+          'span', // 创建最外层的标签可随意
           [
             createElement('span', { // 创建第一个元素的标签可随意
               attrs: {
                 type: 'text'
               }
             }, [labelArr[0]]),
-            createElement('p', { // 创建第二个元素的标签可随意 
+            createElement('p', { // 创建第二个元素的标签可随意
               attrs: {
                 type: 'text',
                 style: 'font-size:12px'
@@ -1371,7 +1364,7 @@
         )
       },
 
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -1384,20 +1377,19 @@
         }
       },
 
-      formatDateTime(date) {
-        var y = date.getFullYear();
-        var m = date.getMonth() + 1;
-        m = m < 10 ? ('0' + m) : m;
-        var d = date.getDate();
-        d = d < 10 ? ('0' + d) : d;
-        var h = date.getHours();
-        var minute = date.getMinutes();
-        minute = minute < 10 ? ('0' + minute) : minute;
-        return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
+      formatDateTime (date) {
+        var y = date.getFullYear()
+        var m = date.getMonth() + 1
+        m = m < 10 ? ('0' + m) : m
+        var d = date.getDate()
+        d = d < 10 ? ('0' + d) : d
+        var h = date.getHours()
+        var minute = date.getMinutes()
+        minute = minute < 10 ? ('0' + minute) : minute
+        return y + '-' + m + '-' + d + ' ' + h + ':' + minute
       }
     }
   }
-
 </script>
 
 <style lang="scss">