Ver Fonte

前端: eslint

baichengfei há 4 anos atrás
pai
commit
c594577d24

+ 103 - 110
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-goods/_opera/evaluate.vue

@@ -189,22 +189,22 @@ export default {
     return {
       IsFinal: 0,
 
-      routeData: {},//上一页面传过来的值
-      routeDataType: '',//上一页面传过来的type
+      routeData: {}, // 上一页面传过来的值
+      routeDataType: '', // 上一页面传过来的type
 
       dialogVisibleCom: false,
-      disabled: true,//禁用
+      disabled: true, // 禁用
       // 业绩评价
       performance: {
-        disabled: false,//禁用
+        disabled: false// 禁用
       },
       // 专业处室业绩评价
       departmentPerformance: {
-        disabled: false,//禁用
+        disabled: false// 禁用
       },
       // 审批流程
       approvalProcess: {
-        disabled: true,//禁用
+        disabled: true// 禁用
       },
 
       entrydetail: {
@@ -215,13 +215,13 @@ export default {
       activeName: '1',
       serviceId: '',
       formData: {
-        Id: '',
+        Id: ''
       },
       auditstepcode: '',
-      contractData: {},//合同信息
-      //下拉选择项
-      //wellNoOptions: [],
-      //supervisersOptions: [],
+      contractData: {}, // 合同信息
+      // 下拉选择项
+      // wellNoOptions: [],
+      // supervisersOptions: [],
       evaluation_list: [],
       evaluation_list_department: [],
       auditBtn: false,
@@ -230,7 +230,7 @@ export default {
 
       departmentBoolean: false,
       checkBUtton: false,
-      saveButton: false,
+      saveButton: false
 
     }
   },
@@ -239,29 +239,29 @@ export default {
     this.routeDataType = this.$route.query.type
 
     // console.log('跳转数据', this.routeData)
-    this.serviceId = this.$route.params.opera;
+    this.serviceId = this.$route.params.opera
     // this.getDictOptions();
 
-    this.IsFinal = this.$route.query.IsFinal;
+    this.IsFinal = this.$route.query.IsFinal
 
-    if (this.IsFinal == undefined || this.IsFinal == "") this.IsFinal = 0;
+    if (this.IsFinal == undefined || this.IsFinal == '') this.IsFinal = 0
 
     if (this.serviceId != 'add' && this.serviceId > 0) {
-      this.formData.Id = this.serviceId;
+      this.formData.Id = this.serviceId
       // this.initDatas();
       this.refreshPage()
     } else {
-      this.formData.Id = 0;
+      this.formData.Id = 0
       this.formData.Status = 0
       this.approvalProcess.disabled = true
-      util.contractDetail(this.$route.query.ContractId,this.$axios).then(res => {
+      util.contractDetail(this.$route.query.ContractId, this.$axios).then(res => {
         this.contractData = res.data
       })
     }
     this.statusFun()
   },
   methods: {
-    exportExcel() {
+    exportExcel () {
       api.docexportEle(this.formData.Id, this.$axios)
         .then(res => {
           // response
@@ -280,11 +280,11 @@ export default {
             }
           }
         }).catch(err => {
-        console.error(err)
-      })
+          console.error(err)
+        })
     },
-    //状态判断
-    statusFun() {
+    // 状态判断
+    statusFun () {
       let data = {
         percode: 'oil_contract.Review.Department'
       }
@@ -323,14 +323,13 @@ export default {
         console.error(err)
       })
     },
-    //刷新数据接口
-    refreshPage() {
-      //拿id查审核流程
+    // 刷新数据接口
+    refreshPage () {
+      // 拿id查审核流程
       this.showIdDatas(this.formData.Id)
-
     },
-    //拿id查审核流程
-    showIdDatas(id) {
+    // 拿id查审核流程
+    showIdDatas (id) {
       api.getEntityAndCert(id, this.$axios).then(res => {
         console.log('拿id查编辑数据', res)
         this.entrydetail.business = ''
@@ -346,7 +345,7 @@ export default {
           this.isAccess()
         }).catch(err => {
           console.error(err)
-        });
+        })
         if (data.Status != 0) {
           this.approvalProcess.disabled = false
         } else {
@@ -358,46 +357,46 @@ export default {
         })
     },
     // 审核
-    commonAuditClick(index) {
+    commonAuditClick (index) {
       var index = Number(index)
       switch (index) {
         // 提交审核
         case 0:
-          this.onSeaveBigAdd();
+          this.onSeaveBigAdd()
           this.$refs.submitpopup.dialogVisibleCom = true
-          break;
+          break
         // 初审
         case 1:
           this.$refs.submitpopup.dialogCommonAuditMakeSureVisible = true
-          break;
+          break
         // 复审
         case 2:
           this.$refs.submitpopup.dialogCommonAuditMakeSureVisible = true
-          break;
+          break
         // 专业科室接收
         case 3:
           this.$refs.submitpopup.auditOrgChange()
           this.$refs.submitpopup.dialogBusinessOfficeSeparateAuditVisible = true
-          break;
+          break
         // 专业处室审核
         case 4:
-          this.onSeaveBigAdd();
+          this.onSeaveBigAdd()
           this.$refs.submitpopup.dialogCommonAuditMakeSureVisible = true
-          break;
+          break
         // 企管法规处
-        case 7
-          this.onSeaveBigAdd():
+        case 7:
+          this.onSeaveBigAdd()
           this.$refs.submitpopup.dialogCommonAuditMakeSureVisible = true
-          break;
+          break
       }
     },
 
-    //提交评价
-    onSubmitBigAdd() {
+    // 提交评价
+    onSubmitBigAdd () {
       this.$refs.submitpopup.dialogVisibleCom = true
     },
-    //保存评价
-    onSeaveBigAdd() {
+    // 保存评价
+    onSeaveBigAdd () {
       if (this.formData.Status <= 0) { //  普通二级用户评价evaluation_listType_one
         this.evaluation_list = this.$refs.evaluation_list_one.entityListData.entityList
         if (this.contractData.ContractClass == '02') {
@@ -408,7 +407,7 @@ export default {
         var list = this.evaluation_list
         for (var i = 0; i < list.length; i++) {
           if (Number(list[i].Score) > Number(list[i].NormalScore)) {
-            this.$message.error('业绩评价填写的分数不能大于标准分值');
+            this.$message.error('业绩评价填写的分数不能大于标准分值')
             return
           }
         }
@@ -420,7 +419,7 @@ export default {
               this.updateEvaluate()
             }
           } else {
-            this.$message.error('业绩评价填写的分数有误');
+            this.$message.error('业绩评价填写的分数有误')
           }
         })
       } else if (this.formData.Status == 4) { // 专业处室评价
@@ -428,7 +427,7 @@ export default {
         var list = this.evaluation_list
         for (var i = 0; i < list.length; i++) {
           if (Number(list[i].Score) > Number(list[i].NormalScore)) {
-            this.$message.error('业绩评价填写的分数不能大于标准分值');
+            this.$message.error('业绩评价填写的分数不能大于标准分值')
             return
           }
         }
@@ -440,7 +439,7 @@ export default {
           if (valid) {
             this.majorEvaluate()
           } else {
-            this.$message.error('业绩评价填写的分数有误');
+            this.$message.error('业绩评价填写的分数有误')
           }
         })
       } else if (this.formData.Status == 7) {
@@ -515,10 +514,10 @@ export default {
         }
       }
     },
-    //专业处室评价
-    majorEvaluate() {
+    // 专业处室评价
+    majorEvaluate () {
       var data = {
-        Items: this.evaluation_list,
+        Items: this.evaluation_list
       }
       api.saveSecEvaluation(this.formData.Id, data, this.$axios).then(res => {
         console.log('新增', res)
@@ -526,20 +525,19 @@ export default {
           this.$message({
             type: 'success',
             message: res.data.message
-          });
-          this.refreshPage();
+          })
+          this.refreshPage()
         }
       }).catch(err => {
         console.error(err)
-      });
-
+      })
     },
-    //新增评价
-    addEvaluate() {
+    // 新增评价
+    addEvaluate () {
       var formData = {
         ContractId: this.contractData.Id,
         Items: this.evaluation_list,
-        IsFinal: Number(this.IsFinal),           //是否履行,最终
+        IsFinal: Number(this.IsFinal) // 是否履行,最终
       }
       api.addContractEvaluate(formData, this.$axios).then(res => {
         console.log('新增', res)
@@ -548,18 +546,18 @@ export default {
           this.$message({
             type: 'success',
             message: res.data.message
-          });
-          this.refreshPage();
+          })
+          this.refreshPage()
         }
       }).catch(err => {
         console.error(err)
-      });
+      })
     },
-    //编辑评价
-    updateEvaluate() {
+    // 编辑评价
+    updateEvaluate () {
       var formData = {
         ContractId: this.contractData.Id,
-        Items: this.evaluation_list,
+        Items: this.evaluation_list
       }
       api.updateContractEvaluate(this.formData.Id, formData, this.$axios).then(res => {
         console.log('编辑', res)
@@ -568,16 +566,15 @@ export default {
           this.$message({
             type: 'success',
             message: res.data.message
-          });
-          this.refreshPage();
+          })
+          this.refreshPage()
         }
       }).catch(err => {
         console.error(err)
-      });
+      })
     },
 
-
-    getAuditStepCodeByStatus() {
+    getAuditStepCodeByStatus () {
       if (this.formData.Status === '1') {
         this.auditstepcode = 'FIRST_TRIAL'
       } else if (this.formData.Status === '2') {
@@ -596,7 +593,7 @@ export default {
         this.auditstepcode = 'SUB_OFFICE_WZ'
       }
     },
-    isAccess() {
+    isAccess () {
       this.getAuditStepCodeByStatus()
       let params = {
         id: this.formData.Id,
@@ -620,19 +617,18 @@ export default {
       })
     },
 
-
-    //点击下一步
-    onSubmit_contract() {
+    // 点击下一步
+    onSubmit_contract () {
       this.activeName = '2'
     },
 
-    initDatas() {
+    initDatas () {
       if (this.formData.Id) {
         api.getEntity(this.formData.Id, this.$axios).then(res => {
-          this.formData = res.data;
+          this.formData = res.data
         }).catch(err => {
           console.error(err)
-        });
+        })
       }
     },
 
@@ -645,67 +641,65 @@ export default {
     //   })
     // },
 
-    //保存信息
-    saveEntity() {
+    // 保存信息
+    saveEntity () {
       this.$refs['EntityForm'].validate((valid) => {
         if (valid) {
-          //this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
+          // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
 
           if (!this.formData.Id) {
-            this.addEntity();
+            this.addEntity()
           } else {
-            this.updateEntity();
+            this.updateEntity()
           }
-
         } else {
           return false
         }
       })
     },
 
-    addEntity() {
+    addEntity () {
       api.addEntity(this.formData, 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 () {
       api.updateEntity(this.formData.Id, this.formData, 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)
-      });
+      })
     },
 
-    jstimehandle(val) {
+    jstimehandle (val) {
       if (val === '') {
         return '----'
       } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -718,23 +712,22 @@ export default {
       }
     },
 
-    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
     },
-    onBack() {
+    onBack () {
       this.$router.go(-1)
     }
   }
 }
-
 </script>
 
 <style lang="scss">