Ver código fonte

格式化

Signed-off-by: lijunqing <lijunqing@dashoo.cn>
lijunqing 6 anos atrás
pai
commit
2cb7aca8d9

+ 136 - 136
src/dashoo.cn/frontend_web/src/pages/oilsupplier/badrecord/index.vue

@@ -277,21 +277,21 @@
 
 
 <script>
-import setapi from "@/api/oilsupplier/oilclassorgset";
+import setapi from '@/api/oilsupplier/oilclassorgset'
 export default {
-  created() {
+  created () {
     // 执行初始化方法
-    this.initDatas();
-    this.initCompany();
+    this.initDatas()
+    this.initCompany()
   },
-  data() {
+  data () {
     return {
-      companyChooseName: "",
+      companyChooseName: '',
       companyDialog: false,
       dataList: [],
       addshow: false,
       editshow: false,
-      editId: "",
+      editId: '',
       // 定义列表数据
       entityList: [],
       // 分页参数
@@ -302,265 +302,265 @@ export default {
       currentItemCount: 0,
       currentItemCount1: 0,
       entityForm: {
-        CompanyCode: "",
-        CompanyName: "",
-        Categorycode: "",
-        Record: "",
-        Bak2: ""
+        CompanyCode: '',
+        CompanyName: '',
+        Categorycode: '',
+        Record: '',
+        Bak2: ''
       },
       editForm: {
-        Companyname: "",
-        Categorycode: "",
-        Record: "",
-        Bak2: ""
+        Companyname: '',
+        Categorycode: '',
+        Record: '',
+        Bak2: ''
       },
       searchForm: {
-        Companyname: "",
-        Categorycode: ""
+        Companyname: '',
+        Categorycode: ''
       },
       rules: {
         CompanyName: [
           {
             required: true,
-            message: "请输入企业名称",
-            trigger: "change"
+            message: '请输入企业名称',
+            trigger: 'change'
           }
         ],
         Categorycode: [
           {
             required: true,
-            message: "请选择准入类别",
-            trigger: "change"
+            message: '请选择准入类别',
+            trigger: 'change'
           }
         ],
         Record: [
           {
             required: true,
-            message: "请填写不良记录",
-            trigger: "change"
+            message: '请填写不良记录',
+            trigger: 'change'
           }
         ]
       }
-    };
+    }
   },
 
   methods: {
-    back(row) {
-      var id = row.Id;
+    back (row) {
+      var id = row.Id
       console.log(id)
-      this.$confirm("确定恢复不良记录状态?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
+      this.$confirm('确定恢复不良记录状态?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       })
         .then(() => {
           setapi
             .backbadrecordbyid(id, this.$axios)
             .then(res => {
               if (res.data.code === 0) {
-                //刷新列表
-                this.initDatas();
+                // 刷新列表
+                this.initDatas()
                 this.$message({
-                  type: "success",
+                  type: 'success',
                   message: res.data.message
-                });
+                })
               } else {
                 this.$message({
-                  type: "warning",
+                  type: 'warning',
                   message: res.data.message
-                });
+                })
               }
             })
             .catch(err => {
-              console.error(err);
-            });
+              console.error(err)
+            })
         })
-        .catch(() => {});
+        .catch(() => {})
     },
-    changeVal(val) {
-      if (val != null && val != "") {
-        return val;
+    changeVal (val) {
+      if (val != null && val !== '') {
+        return val
       } else {
-        return "——";
+        return '——'
       }
     },
-    getChooseCode(val) {
-      this.entityForm.CompanyCode = val.Id;
-      this.entityForm.CompanyName = val.SupplierName;
-      this.companyDialog = false;
+    getChooseCode (val) {
+      this.entityForm.CompanyCode = val.Id
+      this.entityForm.CompanyName = val.SupplierName
+      this.companyDialog = false
     },
-    EditSubmit() {
-      this.$refs["EditFormref"].validate(valid => {
+    EditSubmit () {
+      this.$refs['EditFormref'].validate(valid => {
         if (valid) {
           setapi
             .updatebadrecordbyid(this.editId, this.editForm, this.$axios)
             .then(res => {
               if (res.data.code === 0) {
-                this.initDatas();
-                this.editshow = false;
+                this.initDatas()
+                this.editshow = false
                 this.$message({
-                  type: "success",
+                  type: 'success',
                   message: res.data.message
-                });
-                this.$refs["EditFormref"].resetFields();
+                })
+                this.$refs['EditFormref'].resetFields()
               } else {
                 this.$message({
-                  type: "warning",
+                  type: 'warning',
                   message: res.data.message
-                });
+                })
               }
             })
             .catch(err => {
-              console.error(err);
-            });
+              console.error(err)
+            })
         }
-      });
+      })
     },
-    edit(row) {
-      this.editId = row.Id; //记录将更新的id
-      this.editshow = true; //显示界面
-      this.editForm.Companyname = row.Companyname; //反显名称
-      this.editForm.Categorycode = row.Categorycode; //返现类别名称根据value值
-      this.editForm.Record = row.Record; //返现类别名称根据value值
-      this.editForm.Bak2 = row.Bak2; //返现类别名称根据value值
+    edit (row) {
+      this.editId = row.Id // 记录将更新的id
+      this.editshow = true // 显示界面
+      this.editForm.Companyname = row.Companyname // 反显名称
+      this.editForm.Categorycode = row.Categorycode // 返现类别名称根据value值
+      this.editForm.Record = row.Record // 返现类别名称根据value值
+      this.editForm.Bak2 = row.Bak2 // 返现类别名称根据value值
     },
 
-    deleterow(row) {
-      var id = row.Id;
-      this.$confirm("确定删除?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
+    deleterow (row) {
+      var id = row.Id
+      this.$confirm('确定删除?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       })
         .then(() => {
           setapi
             .deletebadrecordbyid(id, this.$axios)
             .then(res => {
               if (res.data.code === 0) {
-                //刷新列表
-                this.initDatas();
+                // 刷新列表
+                this.initDatas()
                 this.$message({
-                  type: "success",
+                  type: 'success',
                   message: res.data.message
-                });
+                })
               } else {
                 this.$message({
-                  type: "warning",
+                  type: 'warning',
                   message: res.data.message
-                });
+                })
               }
             })
             .catch(err => {
-              console.error(err);
-            });
+              console.error(err)
+            })
         })
-        .catch(() => {});
+        .catch(() => {})
     },
-    //增加方法
-    addAnnualAudit() {
-      this.$refs["EntityFormref"].validate(valid => {
+    // 增加方法
+    addAnnualAudit () {
+      this.$refs['EntityFormref'].validate(valid => {
         if (valid) {
           setapi
             .addBadRecord(this.entityForm, this.$axios)
             .then(res => {
               if (res.data.code === 0) {
-                //刷新列表
-                this.initDatas();
+                // 刷新列表
+                this.initDatas()
 
-                this.addshow = false;
+                this.addshow = false
                 this.$message({
-                  type: "success",
+                  type: 'success',
                   message: res.data.message
-                });
-                this.$refs["EntityFormref"].resetFields();
+                })
+                this.$refs['EntityFormref'].resetFields()
               } else {
                 this.$message({
-                  type: "warning",
+                  type: 'warning',
                   message: res.data.message
-                });
+                })
               }
             })
             .catch(err => {
-              console.error(err);
-            });
+              console.error(err)
+            })
         }
-      });
+      })
     },
 
-    initCompany(event) {
+    initCompany (event) {
       if (event != null) {
-        this.currentPage1 = 1;
+        this.currentPage1 = 1
       }
 
       let params = {
         _size: this.size1,
         _currentPage: this.currentPage1,
         _companyName: this.companyChooseName
-      };
+      }
 
       setapi
         .getCompany(params, this.$axios)
         .then(res => {
-          this.dataList = res.data.items;
-          this.currentItemCount1 = res.data.currentItemCount;
+          this.dataList = res.data.items
+          this.currentItemCount1 = res.data.currentItemCount
         })
         .catch(err => {
-          console.error(err);
-        });
+          console.error(err)
+        })
     },
-    //初始化列表方法
-    initDatas(event) {
+    // 初始化列表方法
+    initDatas (event) {
       if (event != null) {
-        this.currentPage = 1;
+        this.currentPage = 1
       }
       let params = {
         _size: this.size,
         _currentPage: this.currentPage
-      };
+      }
 
       setapi
         .getBadRecordBySearch(params, this.searchForm, this.$axios)
         .then(res => {
-          this.entityList = res.data.items;
-          this.currentItemCount = res.data.currentItemCount;
+          this.entityList = res.data.items
+          this.currentItemCount = res.data.currentItemCount
         })
         .catch(err => {
-          console.error(err);
-        });
+          console.error(err)
+        })
     },
-    addaudit() {
-      this.addshow = true;
+    addaudit () {
+      this.addshow = true
     },
 
-    //分页方法
-    handleCurrentChange(value) {
-      this.currentPage = value;
-      this.initDatas();
+    // 分页方法
+    handleCurrentChange (value) {
+      this.currentPage = value
+      this.initDatas()
     },
-    handleCurrentChange1(value) {
-      this.currentPage1 = value;
-      this.initCompany();
+    handleCurrentChange1 (value) {
+      this.currentPage1 = value
+      this.initCompany()
     },
-    handleSizeChange(value) {
-      this.size = value;
-      this.currentPage = 1;
-      this.initDatas();
+    handleSizeChange (value) {
+      this.size = value
+      this.currentPage = 1
+      this.initDatas()
     },
-    handleSizeChange1(value) {
-      this.size1 = value;
-      this.currentPage1 = 1;
-      this.initCompany();
+    handleSizeChange1 (value) {
+      this.size1 = value
+      this.currentPage1 = 1
+      this.initCompany()
     },
-    searchCommand(command) {
-      if (command == "clear") {
-        this.clearSearch();
+    searchCommand (command) {
+      if (command === 'clear') {
+        this.clearSearch()
       }
     },
-    clearSearch() {
-      this.searchForm.Companyname = "";
-      this.searchForm.Categorycode = "";
-      this.initDatas();
+    clearSearch () {
+      this.searchForm.Companyname = ''
+      this.searchForm.Categorycode = ''
+      this.initDatas()
     }
   }
-};
+}
 </script>