Browse Source

不良记录
Signed-off-by: lijunqing <lijunqing@dashoo.cn>

lijunqing 6 years ago
parent
commit
1a4899eb34

+ 48 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/badrecord.go

@@ -39,7 +39,7 @@ func (this *BadRecordController) GetTList() {
 		where = where + " and Categorycode = '" + model.Categorycode + "'"
 	}
 	orderby := "Id"
-	asc := true
+	asc := false
 
 	svc := BadRecord.GetBadRecordService(utils.DBE) //获得数据库引擎
 	var list []BadRecord.Badrecord
@@ -127,6 +127,8 @@ func (this *BadRecordController) AddBadRecord() {
 		result, _ = svc.DBE.QueryString(sql)
 
 		fmt.Println(result[0]["SupplierName"])
+		model.Bak3 = "1"
+		model.Bak4 = "——"
 		model.Companyname = result[0]["SupplierName"]
 		model.Createon = time.Now()
 		model.Createby = this.User.Realname
@@ -212,7 +214,7 @@ func (this *BadRecordController) UpdateBadRecordById() {
 	model.Modifiedby = this.User.Realname
 	model.Modifieduserid, _ = utils.StrTo(this.User.Id).Int()
 
-	cols = []string{"Record", "Modifiedon", "Modifieduserid", "Modifiedby"}
+	cols = []string{"Record", "Bak2", "Modifiedon", "Modifieduserid", "Modifiedby"}
 
 	err := svc.UpdateEntityBytbl(BaseBadRecord, id, &model, cols)
 	if err == nil {
@@ -228,3 +230,47 @@ func (this *BadRecordController) UpdateBadRecordById() {
 	}
 
 }
+
+
+// @Title 通过id更新
+// @Description back by id
+// @Success 200 {object}
+// @router /backbadrecordbyid [get]
+func (this *BadRecordController) BackBadRecordById() {
+	id := this.GetString("id")
+
+	var errinfo ErrorInfo
+	var cols []string
+	if id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+	svc := BadRecord.GetBadRecordService(utils.DBE) //获得数据库引擎
+
+	var model BadRecord.Badrecord
+	model.Bak3 = "0"
+	model.Bak4 = time.Now().Format("2006-01-02")
+	model.Modifiedon = time.Now()
+	model.Modifiedby = this.User.Realname
+	model.Modifieduserid, _ = utils.StrTo(this.User.Id).Int()
+
+	cols = []string{"Bak3", "Bak4", "Modifiedon", "Modifieduserid", "Modifiedby"}
+
+	err := svc.UpdateEntityBytbl(BaseBadRecord, id, &model, cols)
+	if err == nil {
+		errinfo.Message = "修改成功!"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "修改失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+
+}

+ 6 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/oilclassorgset.js

@@ -99,5 +99,11 @@ export default {
       method: 'post',
       data: formData
     })
+  },
+  backbadrecordbyid (id, myAxios) {
+    return myAxios({
+      url: '/badrecord/backbadrecordbyid?id=' + id,
+      method: 'get'
+    })
   }
 }

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

@@ -12,13 +12,23 @@
         <span>
           <i class="icon icon-table2"></i> 不良行为记录
         </span>
-        <el-form :model="searchForm" ref="searchformRef" :inline="true" style="float: right; margin-top: -5px">
+        <el-form
+          :model="searchForm"
+          ref="searchformRef"
+          :inline="true"
+          style="float: right; margin-top: -5px"
+        >
           <el-form-item label="企业名称">
             <el-input size="mini" v-model="searchForm.Companyname" placeholder="请输入内容"></el-input>
           </el-form-item>
 
           <el-form-item label="准入类别">
-            <el-select size="mini" style="width:150px" v-model="searchForm.Categorycode" placeholder="请选择">
+            <el-select
+              size="mini"
+              style="width:150px"
+              v-model="searchForm.Categorycode"
+              placeholder="请选择"
+            >
               <el-option label="全部" value></el-option>
               <el-option label="物资类" value="01"></el-option>
               <el-option label="基建类" value="02"></el-option>
@@ -27,8 +37,14 @@
           </el-form-item>
 
           <el-form-item>
-            <el-dropdown split-button type="primary" style="margin-left:8px;" size="mini" @click="initDatas($event)"
-              @command="searchCommand">
+            <el-dropdown
+              split-button
+              type="primary"
+              style="margin-left:8px;"
+              size="mini"
+              @click="initDatas($event)"
+              @command="searchCommand"
+            >
               查询
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item command="clear">查询重置</el-dropdown-item>
@@ -42,43 +58,72 @@
       </div>
 
       <!--内框表格显示-->
-      <el-table size="mini" :data="entityList" border height="calc(100vh - 243px)" style="width: 100%">
+      <el-table
+        size="mini"
+        :data="entityList"
+        border
+        height="calc(100vh - 243px)"
+        style="width: 100%"
+      >
         <!--内框表格剩余栏显示-->
-        <el-table-column label="企业名称" prop="Companyname" align="center"></el-table-column>
-        <el-table-column label="类别名称" prop="Categoryname" align="center"></el-table-column>
-        <el-table-column label="不良行为" prop="Record" align="center"></el-table-column>
+        <el-table-column label="企业名称" prop="Companyname" align="center" width="260px"></el-table-column>
+        <el-table-column label="类别名称" prop="Categoryname" align="center" width="100px"></el-table-column>
+        <el-table-column label="不良行为时间" prop="Bak2" align="center" width="100px">
+          <template slot-scope="scope">{{changeVal(scope.row.Bak2) }}</template>
+        </el-table-column>
+        <el-table-column label="不良行为" prop="Record" align="center" width="900px"></el-table-column>
+        <el-table-column label="状态" align="center" width="100px">
+          <template slot-scope="scope">
+            <span v-if="scope.row.Bak3=='1'" style="color:#67C23A">有效</span>
+            <span v-else-if="scope.row.Bak3=='0'" style="color:#F56C6C">取消</span>
+            <span v-else>——</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="恢复时间" prop="Bak4" align="center" width="100px"></el-table-column>
 
         <!--内框表格操作栏显示-->
-        <el-table-column label="操作" min-width="35" align="center" fixed="right">
+        <el-table-column label="操作" align="center" fixed="right">
           <template slot-scope="scope">
             <el-button type="primary" plain title="编辑" size="mini" @click="edit(scope.row)">编辑</el-button>
+            <el-button
+              type="primary"
+              :disabled="scope.row.Bak3=='0'"
+              plain
+              title="恢复不良记录状态"
+              size="mini"
+              @click="back(scope.row)"
+            >恢复</el-button>
             <el-button type="primary" plain title="删除" size="mini" @click="deleterow(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
 
       <!-- 分页 -->
-      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-        :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
-        :total="currentItemCount"></el-pagination>
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="currentPage"
+        :page-sizes="[10, 15, 20, 25]"
+        :page-size="size"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="currentItemCount"
+      ></el-pagination>
     </el-card>
 
-    
-    
-    
-    
-    
-    
-    
     <!-- 添加框(默认隐藏) -->
     <el-dialog title="企业不良行为添加" :visible.sync="addshow" width="360px">
       <el-form :model="entityForm" :rules="rules" ref="EntityFormref">
         <!-- 第一行 -->
         <el-row>
           <el-col :span="24">
-            <el-form-item label="企业名称"  prop="CompanyName">
+            <el-form-item label="企业名称" prop="CompanyName">
               <el-input placeholder="请选择企业名称" v-model="entityForm.CompanyName" style="width:100%">
-                <el-button type="primary" style="width:30%" @click="companyDialog = true" slot="append">选择</el-button>
+                <el-button
+                  type="primary"
+                  style="width:30%"
+                  @click="companyDialog = true"
+                  slot="append"
+                >选择</el-button>
               </el-input>
             </el-form-item>
           </el-col>
@@ -86,8 +131,13 @@
         <!-- 第二行 -->
         <el-row>
           <el-col :span="24">
-            <el-form-item label="准入类别"  prop="Categorycode">
-              <el-select default-first-option placeholder="请选择" style="width: 100%" v-model="entityForm.Categorycode">
+            <el-form-item label="准入类别" prop="Categorycode">
+              <el-select
+                default-first-option
+                placeholder="请选择"
+                style="width: 100%"
+                v-model="entityForm.Categorycode"
+              >
                 <el-option label="物资类" value="01"></el-option>
                 <el-option label="基建类" value="02"></el-option>
                 <el-option label="技术服务类" value="03"></el-option>
@@ -95,9 +145,23 @@
             </el-form-item>
           </el-col>
         </el-row>
+
+        <el-row>
+          <el-form-item label="不良行为时间">
+            <el-date-picker
+              v-model="entityForm.Bak2"
+              type="date"
+              format="yyyy 年 MM 月 dd 日"
+              value-format="yyyy-MM-dd"
+              placeholder="选择日期"
+              style="width: 100%"
+            ></el-date-picker>
+          </el-form-item>
+        </el-row>
+
         <!-- 第叁行 -->
         <el-row>
-          <el-form-item label="不良行为"  prop="Record">
+          <el-form-item label="不良行为" prop="Record">
             <el-input type="textarea" v-model="entityForm.Record"></el-input>
           </el-form-item>
         </el-row>
@@ -108,19 +172,6 @@
       </span>
     </el-dialog>
 
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
     <!-- 编辑框(默认隐藏) -->
     <el-dialog title="企业不良行为编辑" :visible.sync="editshow" width="360px">
       <el-form :model="editForm" :rules="rules" ref="EditFormref">
@@ -146,49 +197,77 @@
           </el-col>
         </el-row>
 
+        <el-row>
+          <el-form-item label="不良行为时间">
+            <el-date-picker
+              v-model="editForm.Bak2"
+              type="date"
+              format="yyyy 年 MM 月 dd 日"
+              value-format="yyyy-MM-dd"
+              placeholder="选择日期"
+              style="width: 100%"
+            ></el-date-picker>
+          </el-form-item>
+        </el-row>
+
         <!-- 第三行 -->
         <el-row>
           <el-col :span="24">
             <el-form-item label="不良记录" required prop="Record">
-              <el-input style="width: 100%" v-model="editForm.Record"></el-input>
+              <el-input style="width: 100%" type="textarea" v-model="editForm.Record"></el-input>
             </el-form-item>
           </el-col>
         </el-row>
       </el-form>
       <span style="float: right;margin-top:-10px;">
         <el-button size="small" @click="editshow = false">取 消</el-button>
-        <el-button type="primary" size="small" @click="EditSubmit()">编 辑</el-button>
+        <el-button type="primary" size="small" @click="EditSubmit()">确 定</el-button>
       </span>
     </el-dialog>
 
-
-
     <el-dialog title="企业列表" :visible.sync="companyDialog" top="5vh">
       <span style="float: right;">
-        <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="initCompany($event)">查询
-        </el-button>
-        <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="companyDialog = false">
-          取消</el-button>
+        <el-button
+          type="primary"
+          size="mini"
+          style="margin-left:10px; margin-top: -4px;"
+          @click="initCompany($event)"
+        >查询</el-button>
+        <el-button
+          type="primary"
+          size="mini"
+          style="margin-left:10px; margin-top: -4px;"
+          @click="companyDialog = false"
+        >取消</el-button>
       </span>
       <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
         <el-form-item label="企业名称">
-          <el-input size="mini" style="width: 165px;" v-model="companyChooseName" placeholder="请输入企业名称"></el-input>
+          <el-input
+            size="mini"
+            style="width: 165px;"
+            v-model="companyChooseName"
+            placeholder="请输入企业名称"
+          ></el-input>
         </el-form-item>
       </el-form>
-      <el-table size="mini" :data="dataList" border >
+      <el-table size="mini" :data="dataList" border>
         <el-table-column label="操作" width="100px" align="center" fixed>
           <template slot-scope="scope">
             <el-button type="text" size="small" @click="getChooseCode(scope.row)">选择</el-button>
           </template>
         </el-table-column>
         <el-table-column prop="Id" label="编码" width="120px" align="center" show-overflow-tooltip></el-table-column>
-        <el-table-column prop="SupplierName" label="名称"  align="center" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="SupplierName" label="名称" align="center" show-overflow-tooltip></el-table-column>
       </el-table>
-      <el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1" :current-page="currentPage1"
-        :page-sizes="[10, 15, 20, 25]" :page-size="size1" layout="total, sizes, prev, pager, next, jumper"
-        :total="currentItemCount1">
-      </el-pagination>
-
+      <el-pagination
+        @size-change="handleSizeChange1"
+        @current-change="handleCurrentChange1"
+        :current-page="currentPage1"
+        :page-sizes="[10, 15, 20, 25]"
+        :page-size="size1"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="currentItemCount1"
+      ></el-pagination>
     </el-dialog>
   </div>
 </template>
@@ -198,247 +277,290 @@
 
 
 <script>
-  import setapi from "@/api/oilsupplier/oilclassorgset";
-  export default {
-    created() {
-      // 执行初始化方法
-      this.initDatas();
-      this.initCompany();
-    },
-    data() {
-      return {
-        companyChooseName:'',
-        companyDialog:false,
-        dataList:[],
-        addshow: false,
-        editshow: false,
-        editId: "",
-        // 定义列表数据
-        entityList: [],
-        // 分页参数
-        size: 10,
-        size1: 10,
-        currentPage: 1,
-        currentPage1: 1,
-        currentItemCount: 0,
-        currentItemCount1: 0,
-        entityForm: {
-          CompanyCode: "",
-          CompanyName:"",
-          Categorycode: "",
-          Record: ""
-        },
-        editForm: {
-          Companyname: "",
-          Categorycode: "",
-          Record: ""
-        },
-        searchForm: {
-          Companyname: "",
-          Categorycode: ""
-        },
-        rules: {
-          CompanyName: [{
+import setapi from "@/api/oilsupplier/oilclassorgset";
+export default {
+  created() {
+    // 执行初始化方法
+    this.initDatas();
+    this.initCompany();
+  },
+  data() {
+    return {
+      companyChooseName: "",
+      companyDialog: false,
+      dataList: [],
+      addshow: false,
+      editshow: false,
+      editId: "",
+      // 定义列表数据
+      entityList: [],
+      // 分页参数
+      size: 10,
+      size1: 10,
+      currentPage: 1,
+      currentPage1: 1,
+      currentItemCount: 0,
+      currentItemCount1: 0,
+      entityForm: {
+        CompanyCode: "",
+        CompanyName: "",
+        Categorycode: "",
+        Record: "",
+        Bak2: ""
+      },
+      editForm: {
+        Companyname: "",
+        Categorycode: "",
+        Record: "",
+        Bak2: ""
+      },
+      searchForm: {
+        Companyname: "",
+        Categorycode: ""
+      },
+      rules: {
+        CompanyName: [
+          {
             required: true,
             message: "请输入企业名称",
             trigger: "change"
-          }],
-          Categorycode: [{
+          }
+        ],
+        Categorycode: [
+          {
             required: true,
             message: "请选择准入类别",
             trigger: "change"
-          }],
-          Record: [{
+          }
+        ],
+        Record: [
+          {
             required: true,
             message: "请填写不良记录",
             trigger: "change"
-          }]
+          }
+        ]
+      }
+    };
+  },
+
+  methods: {
+    back(row) {
+      var id = row.Id;
+      console.log(id)
+      this.$confirm("确定恢复不良记录状态?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          setapi
+            .backbadrecordbyid(id, this.$axios)
+            .then(res => {
+              if (res.data.code === 0) {
+                //刷新列表
+                this.initDatas();
+                this.$message({
+                  type: "success",
+                  message: res.data.message
+                });
+              } else {
+                this.$message({
+                  type: "warning",
+                  message: res.data.message
+                });
+              }
+            })
+            .catch(err => {
+              console.error(err);
+            });
+        })
+        .catch(() => {});
+    },
+    changeVal(val) {
+      if (val != null && val != "") {
+        return val;
+      } else {
+        return "——";
+      }
+    },
+    getChooseCode(val) {
+      this.entityForm.CompanyCode = val.Id;
+      this.entityForm.CompanyName = val.SupplierName;
+      this.companyDialog = false;
+    },
+    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.$message({
+                  type: "success",
+                  message: res.data.message
+                });
+                this.$refs["EditFormref"].resetFields();
+              } else {
+                this.$message({
+                  type: "warning",
+                  message: res.data.message
+                });
+              }
+            })
+            .catch(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值
     },
 
-    methods: {
-      getChooseCode(val) {
-        console.log(val)
-        this.entityForm.CompanyCode=val.Id
-        this.entityForm.CompanyName=val.SupplierName
-        this.companyDialog = false
-      },
-      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.$message({
-                    type: "success",
-                    message: res.data.message
-                  });
-                  this.$refs["EditFormref"].resetFields();
-                } else {
-                  this.$message({
-                    type: "warning",
-                    message: res.data.message
-                  });
-                }
-              })
-              .catch(err => {
-                console.error(err);
-              });
-          }
-        });
-      },
-      edit(row) {
-        console.log(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值
-      },
-      deleterow(row) {
-        console.log(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.$message({
-                    type: "success",
-                    message: res.data.message
-                  });
-                } else {
-                  this.$message({
-                    type: "warning",
-                    message: res.data.message
-                  });
-                }
-              })
-              .catch(err => {
-                console.error(err);
-              });
-          })
-          .catch(() => {});
-      },
-      //增加方法
-      addAnnualAudit() {
-        this.$refs["EntityFormref"].validate(valid => {
-          if (valid) {
-            setapi
-              .addBadRecord(this.entityForm, this.$axios)
-              .then(res => {
-                if (res.data.code === 0) {
-                  //刷新列表
-                  this.initDatas();
-
-                  this.addshow = false;
-                  this.$message({
-                    type: "success",
-                    message: res.data.message
-                  });
-                  this.$refs["EntityFormref"].resetFields();
-                } else {
-                  this.$message({
-                    type: "warning",
-                    message: res.data.message
-                  });
-                }
-              })
-              .catch(err => {
-                console.error(err);
-              });
-          }
-        });
-      },
+    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.$message({
+                  type: "success",
+                  message: res.data.message
+                });
+              } else {
+                this.$message({
+                  type: "warning",
+                  message: res.data.message
+                });
+              }
+            })
+            .catch(err => {
+              console.error(err);
+            });
+        })
+        .catch(() => {});
+    },
+    //增加方法
+    addAnnualAudit() {
+      this.$refs["EntityFormref"].validate(valid => {
+        if (valid) {
+          setapi
+            .addBadRecord(this.entityForm, this.$axios)
+            .then(res => {
+              if (res.data.code === 0) {
+                //刷新列表
+                this.initDatas();
 
-      initCompany(event) {
-         if (event != null) {
-          this.currentPage1 = 1;
+                this.addshow = false;
+                this.$message({
+                  type: "success",
+                  message: res.data.message
+                });
+                this.$refs["EntityFormref"].resetFields();
+              } else {
+                this.$message({
+                  type: "warning",
+                  message: res.data.message
+                });
+              }
+            })
+            .catch(err => {
+              console.error(err);
+            });
         }
-        
-        let params = {
-          _size: this.size1,
-          _currentPage: this.currentPage1,
-          _companyName:this.companyChooseName
-        };
+      });
+    },
 
-        setapi
-          .getCompany(params,this.$axios)
-          .then(res => {
-            console.log(res.data.items);
-            this.dataList = res.data.items;
-            this.currentItemCount1 = res.data.currentItemCount;
-          })
-          .catch(err => {
-            console.error(err);
-          });
-      },
-      //初始化列表方法
-      initDatas(event) {
-        if (event != null) {
-          this.currentPage = 1;
-        }
-        let params = {
-          _size: this.size,
-          _currentPage: this.currentPage
-        };
+    initCompany(event) {
+      if (event != null) {
+        this.currentPage1 = 1;
+      }
 
-        setapi
-          .getBadRecordBySearch(params, this.searchForm, this.$axios)
-          .then(res => {
-            console.log(res.data.items);
-            this.entityList = res.data.items;
-            this.currentItemCount = res.data.currentItemCount;
-          })
-          .catch(err => {
-            console.error(err);
-          });
-      },
-      addaudit() {
-        this.addshow = true;
-      },
+      let params = {
+        _size: this.size1,
+        _currentPage: this.currentPage1,
+        _companyName: this.companyChooseName
+      };
 
-      //分页方法
-      handleCurrentChange(value) {
-        this.currentPage = value;
-        this.initDatas();
-      },
-      handleCurrentChange1(value) {
-        this.currentPage1 = value;
-        this.initCompany();
-      },
-      handleSizeChange(value) {
-        this.size = value;
+      setapi
+        .getCompany(params, this.$axios)
+        .then(res => {
+          this.dataList = res.data.items;
+          this.currentItemCount1 = res.data.currentItemCount;
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
+    //初始化列表方法
+    initDatas(event) {
+      if (event != null) {
         this.currentPage = 1;
-        this.initDatas();
-      },
-      handleSizeChange1(value){
-        this.size1 = value;
-        this.currentPage1 = 1;
-        this.initCompany();
-      },
-      searchCommand(command) {
-        if (command == "clear") {
-          this.clearSearch();
-        }
-      },
-      clearSearch() {
-        this.searchForm.Companyname = "";
-        this.searchForm.Categorycode = "";
-        this.initDatas();
       }
-    }
-  };
+      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;
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
+    addaudit() {
+      this.addshow = true;
+    },
 
+    //分页方法
+    handleCurrentChange(value) {
+      this.currentPage = value;
+      this.initDatas();
+    },
+    handleCurrentChange1(value) {
+      this.currentPage1 = value;
+      this.initCompany();
+    },
+    handleSizeChange(value) {
+      this.size = value;
+      this.currentPage = 1;
+      this.initDatas();
+    },
+    handleSizeChange1(value) {
+      this.size1 = value;
+      this.currentPage1 = 1;
+      this.initCompany();
+    },
+    searchCommand(command) {
+      if (command == "clear") {
+        this.clearSearch();
+      }
+    },
+    clearSearch() {
+      this.searchForm.Companyname = "";
+      this.searchForm.Categorycode = "";
+      this.initDatas();
+    }
+  }
+};
 </script>