Explorar o código

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

lijunqing %!s(int64=6) %!d(string=hai) anos
pai
achega
4d14f8f304

+ 4 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/badrecord.go

@@ -40,6 +40,10 @@ func (this *BadRecordController) GetTList() {
 	if model.Categorycode != "" {
 		where = where + " and Categorycode = '" + model.Categorycode + "'"
 	}
+	
+	if this.User.IsCompanyUser==1{
+		where= where + " and CompanyName='"+this.User.Realname +"'"
+	}
 	orderby := "Id"
 	asc := false
 

+ 1223 - 0
src/dashoo.cn/frontend_web/src/pages/select/badrecordselect/index.vue

@@ -0,0 +1,1223 @@
+<template>
+  <div>
+    <!--顶部显示-->
+    <el-breadcrumb class="heading">
+      <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
+      <el-breadcrumb-item>不良行为查询</el-breadcrumb-item>
+    </el-breadcrumb>
+
+    <!--内框顶部显示-->
+    <el-card class="box-card"
+             style="height: calc(100vh - 115px);position:relative">
+      <div slot="header">
+        <span>
+          <i class="icon icon-table2"></i> 不良行为查询
+        </span>
+        <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-option label="全部" value></el-option>
+              <el-option label="物资类" value="01"></el-option>
+              <el-option label="基建类" value="02"></el-option>
+              <el-option label="技术服务类" value="03"></el-option>
+            </el-select>
+          </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-menu slot="dropdown">
+                <el-dropdown-item command="clear">查询重置</el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </el-form-item>
+          <!-- <el-form-item>
+            <el-button type="primary"
+                       size="mini"
+                       @click="addaudit">添加</el-button>
+          </el-form-item> -->
+        </el-form>
+      </div>
+
+      <!--内框表格显示-->
+      <el-table size="mini"
+                :data="entityList"
+                border
+                height="calc(100vh - 243px)"
+                style="width: 100%">
+        <!--内框表格剩余栏显示-->
+        <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="Record"
+                         align="center"></el-table-column>
+        <el-table-column label="不良行为时间"
+                         prop="Bak2"
+                         align="center"
+                         width="200px">
+          <template slot-scope="scope">{{changeVal(scope.row.Bak2) }}</template>
+        </el-table-column>
+
+        <!-- <el-table-column label="恢复时间" prop="Bak4" align="center" width="100px"></el-table-column> -->
+        <el-table-column label="录入时间"
+                         prop="Createon"
+                         align="center"
+                         width="100px">
+          <template slot-scope="scope">
+            {{ jstimehandle(scope.row.Createon+'') }}
+          </template>
+        </el-table-column>
+        <el-table-column label="类别"
+                         align="center"
+                         width="100px">
+          <template slot-scope="scope">
+            <span v-if="scope.row.Bak1=='0'">企业暂停</span>
+            <span v-else-if="scope.row.Bak1=='1'">准入范围暂停</span>
+            <span v-else>——</span>
+          </template>
+        </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=='2'"
+                  style="color:#E6A23C">暂停</span>
+            <span v-else>——</span>
+          </template>
+        </el-table-column>
+
+        <!--内框表格操作栏显示-->
+        <el-table-column label="操作"
+                         align="center"
+                         fixed="right"
+                         width="150px">
+          <template slot-scope="scope">
+            <el-button type="primary" :disabled="scope.row.Bak1!=='1'"
+                       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-card>
+
+    <!-- 添加框(默认隐藏) -->
+    <!-- <el-dialog title="企业不良行为添加"
+               :visible.sync="addshow"
+               width="400px">
+      <el-form :model="entityForm"
+               :rules="rules"
+               ref="EntityFormref"> -->
+        <!-- 第一行 -->
+        <!-- <el-row>
+          <el-col :span="24">
+            <el-form-item label="企业名称"
+                          prop="CompanyName">
+              <el-input placeholder="请选择企业名称"
+                        v-model="entityForm.CompanyName"
+                        readonly
+                        style="width:100%">
+                <el-button type="primary"
+                           style="width:30%"
+                           @click="companyDialog = true"
+                           slot="append">选择</el-button>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="准入范围">
+              <el-input placeholder="请选择准入范围"
+                        v-model="certNames"
+                        readonly
+                        style="width:100%">
+                <el-button type="primary"
+                           style="width:30%"
+                           @click="certDialog = true"
+                           slot="append">选择</el-button>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row> -->
+        <!-- 第二行 -->
+        <!-- <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-option label="物资类" value="01"></el-option>
+                <el-option label="基建类" value="02"></el-option>
+                <el-option label="技术服务类" value="03"></el-option>
+              </el-select>
+            </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-date-picker v-model="Bak2"
+                            type="daterange"
+                            range-separator="至"
+                            start-placeholder="开始日期"
+                            end-placeholder="结束日期"
+                            style="width:100%">
+            </el-date-picker>
+          </el-form-item>
+        </el-row>
+        <el-row>
+          <el-form-item label="状态"
+                        prop="Bak3">
+            <el-select v-model="entityForm.Bak3"
+                       placeholder="请选择"
+                       style="width:100%">
+              <el-option v-for="item in options"
+                         :key="item.value"
+                         :label="item.label"
+                         :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-row> -->
+        <!-- 第叁行 -->
+        <!-- <el-row>
+          <el-form-item label="不良行为"
+                        prop="Record">
+            <el-input type="textarea"
+                      v-model="entityForm.Record"></el-input>
+          </el-form-item>
+        </el-row>
+      </el-form>
+      <span style="float: right;margin-top:-10px;">
+        <el-button size="small"
+                   @click="addshow = false">取 消</el-button>
+        <el-button type="primary"
+                   size="small"
+                   @click="addAnnualAudit()">确 定</el-button>
+      </span>
+    </el-dialog> -->
+
+    <!-- 编辑框(默认隐藏) -->
+    <!-- <el-dialog title="企业不良行为编辑"
+               :visible.sync="editshow"
+               width="400px">
+      <el-form :model="editForm"
+               :rules="rules"
+               ref="EditFormref"> -->
+        <!-- 第一行 -->
+        <!-- <el-row>
+          <el-col :span="24">
+            <el-form-item label="企业名称"
+                          required
+                          prop="Companyname">
+              <el-input v-model="editForm.Companyname"
+                        disabled></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row v-if="editForm.Bak1==='1'">
+          <el-col :span="24">
+            <el-form-item label="准入范围">
+              <el-input placeholder="请选择准入范围"
+                        v-model="certNames"
+                        readonly
+                        style="width:100%">
+                <el-button type="primary"
+                           style="width:30%"
+                           @click="certDialog = true"
+                           slot="append">选择</el-button>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row> -->
+        <!-- 第二行 -->
+        <!-- <el-row>
+          <el-col :span="24">
+            <el-form-item label="准入类别" required prop="Categorycode">
+              <el-select style="width: 100%" v-model="editForm.Categorycode" disabled>
+                <el-option label="物资类" value="01"></el-option>
+                <el-option label="基建类" value="02"></el-option>
+                <el-option label="技术服务类" value="03"></el-option>
+              </el-select>
+            </el-form-item>
+          </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-date-picker v-model="Bak22"
+                            type="daterange"
+                            range-separator="至"
+                            start-placeholder="开始日期"
+                            end-placeholder="结束日期">
+            </el-date-picker>
+          </el-form-item>
+        </el-row>
+        <el-form-item label="状态"
+                      prop="Bak3">
+          <el-select v-model="editForm.Bak3"
+                     placeholder="请选择"
+                     style="width:100%">
+            <el-option v-for="item in options"
+                       :key="item.value"
+                       :label="item.label"
+                       :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item> -->
+
+        <!-- 第三行 -->
+        <!-- <el-row>
+          <el-col :span="24">
+            <el-form-item label="不良记录"
+                          required
+                          prop="Record">
+              <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>
+      </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>
+      </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-form-item>
+      </el-form>
+      <el-table size="mini"
+                :data="dataList"
+                height="400px"
+                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>
+      <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> -->
+
+    <el-dialog :title="certTitle"
+               :visible.sync="certDialog"
+               top="5vh"
+               style="z-index:99;">
+      <span style="float: right;">
+        <el-button type="primary"
+                   size="mini"
+                   style="margin-left:10px; margin-top: -4px;"
+                   @click="initCert($event)">查询</el-button>
+        <el-button type="primary"
+                   size="mini"
+                   style="margin-left:10px; margin-top: -4px;"
+                   @click="certDialog = 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="certChooseName"
+                    placeholder="请输入准入范围名称"></el-input>
+        </el-form-item>
+      </el-form>
+      <el-tabs type="border-card"
+               style="margin-top: 50px"
+               @tab-click="handleClick"
+               v-model="activeName">
+        <el-tab-pane label="物资类"
+                     name="first">
+          <el-table size="mini"
+                    :data="goodsList"
+                    border
+                    height="300px"
+                    @selection-change="handleGoodsSelectionChange">
+            <el-table-column type="selection"
+                             width="55">
+            </el-table-column>
+
+            <el-table-column prop="Code"
+                             label="编码"
+                             width="120px"
+                             align="center"
+                             show-overflow-tooltip></el-table-column>
+            <el-table-column prop="Name"
+                             label="名称"
+                             align="center"
+                             show-overflow-tooltip></el-table-column>
+          </el-table>
+          <el-pagination @size-change="handleGoodsSizeChange"
+                         @current-change="handleGoodsCurrentChange"
+                         :current-page="currentGoodsPage"
+                         :page-sizes="[10, 15, 20, 25]"
+                         :page-size="goodsSize"
+                         layout="total, sizes, prev, pager, next, jumper"
+                         :total="currentGoodsItemCount"></el-pagination>
+        </el-tab-pane>
+        <el-tab-pane label="基建类"
+                     name="second">
+          <el-table size="mini"
+                    :data="basisList"
+                    border
+                    height="300px"
+                    @selection-change="handleBasisSelectionChange">
+            <el-table-column type="selection"
+                             width="55">
+            </el-table-column>
+
+            <el-table-column prop="Code"
+                             label="编码"
+                             width="120px"
+                             align="center"
+                             show-overflow-tooltip></el-table-column>
+            <el-table-column prop="Name"
+                             label="名称"
+                             align="center"
+                             show-overflow-tooltip></el-table-column>
+          </el-table>
+          <el-pagination @size-change="handleBasisSizeChange"
+                         @current-change="handleBasisCurrentChange"
+                         :current-page="currentBasisPage"
+                         :page-sizes="[10, 15, 20, 25]"
+                         :page-size="basisSize"
+                         layout="total, sizes, prev, pager, next, jumper"
+                         :total="currentBasisItemCount"></el-pagination>
+        </el-tab-pane>
+        <el-tab-pane label="技术服务类"
+                     name="third">
+          <el-table size="mini"
+                    :data="tcList"
+                    border
+                    height="300px"
+                    @selection-change="handleTCSelectionChange">
+            <el-table-column type="selection"
+                             width="55">
+            </el-table-column>
+
+            <el-table-column prop="Code"
+                             label="编码"
+                             width="120px"
+                             align="center"
+                             show-overflow-tooltip></el-table-column>
+            <el-table-column prop="Name"
+                             label="名称"
+                             align="center"
+                             show-overflow-tooltip></el-table-column>
+          </el-table>
+          <el-pagination @size-change="handleTCSizeChange"
+                         @current-change="handleTCCurrentChange"
+                         :current-page="currentTCPage"
+                         :page-sizes="[10, 15, 20, 25]"
+                         :page-size="tcSize"
+                         layout="total, sizes, prev, pager, next, jumper"
+                         :total="currentTCItemCount"></el-pagination>
+        </el-tab-pane>
+      </el-tabs>
+      <!-- <el-input style="width:100%;margin-top:10px"
+                type="textarea"
+                readonly
+                v-model="yChooseCert"></el-input>
+      <div style="width:100%;text-align:right;margin-top:10px">
+        <el-button type="primary"
+                   size="mini"
+                   @click="savedata()">确 定</el-button>
+      </div> -->
+    </el-dialog>
+  </div>
+</template>
+
+
+
+
+
+<script>
+import setapi from '@/api/oilsupplier/oilclassorgset'
+export default {
+  created () {
+    // 执行初始化方法
+    this.initDatas()
+    this.initCompany()
+  },
+  data () {
+    return {
+      certTitle: '准入范围列表',
+      isFlag: '0',
+      goodsTemp: '',
+      basisTemp: '',
+      tcTemp: '',
+      yChooseCert: '',
+      activeName: 'first',
+      goodsSelection: [],
+      basisSelection: [],
+      tcSelection: [],
+      goodsList: [],
+      basisList: [],
+      tcList: [],
+      certNames: '',
+      options: [{
+        value: '1',
+        label: '准入',
+        style: 'color:#67C23A'
+      }, {
+        value: '2',
+        label: '暂停',
+        style: 'color:#E6A23C'
+      }],
+      companyChooseName: '',
+      certChooseName: '',
+      companyDialog: false,
+      certDialog: false,
+      dataList: [],
+      addshow: false,
+      editshow: false,
+      editId: '',
+      // 定义列表数据
+      entityList: [],
+      // 分页参数
+      companyId: 0,
+      size: 10,
+      size1: 10,
+      goodsSize: 10,
+      basisSize: 10,
+      tcSize: 10,
+      currentPage: 1,
+      currentPage1: 1,
+      currentGoodsPage: 1,
+      currentBasisPage: 1,
+      currentTCPage: 1,
+      currentItemCount: 0,
+      currentItemCount1: 0,
+      currentGoodsItemCount: 0,
+      currentBasisItemCount: 0,
+      currentTCItemCount: 0,
+      Bak2: [],
+      Bak22: [],
+      entityForm: {
+        CompanyCode: '',
+        CompanyName: '',
+        // Categorycode: '',
+        Record: '',
+        Bak2: '',
+        Bak3: '2'
+      },
+      editForm: {
+        Companyname: '',
+        Companycode: '',
+        // Categorycode: '',
+        Record: '',
+        Bak1: '',
+        Bak2: '',
+        Bak3: ''
+      },
+      searchForm: {
+        Companyname: ''
+        // Categorycode: ''
+      },
+      rules: {
+        CompanyName: [
+          {
+            required: true,
+            message: '请输入企业名称',
+            trigger: 'change'
+          }
+        ],
+        Bak3: [
+          {
+            required: true,
+            message: '请选择企业状态',
+            trigger: 'change'
+          }
+        ],
+        // Categorycode: [
+        //   {
+        //     required: true,
+        //     message: '请选择准入类别',
+        //     trigger: 'change'
+        //   }
+        // ],
+        Record: [
+          {
+            required: true,
+            message: '请填写不良记录',
+            trigger: 'change'
+          }
+        ]
+      }
+    }
+  },
+
+  methods: {
+    savedata () {
+      if (this.goodsSelection.length === 0 && this.basisSelection.length === 0 && this.tcSelection.length === 0) {
+        this.$message({
+          type: 'warning',
+          message: '请选择准入范围'
+        })
+      } else {
+        this.certDialog = false
+        this.certNames = this.yChooseCert
+      }
+    },
+    initCert (event) {
+      console.log(this.activeName)
+      if (this.activeName === 'first') {
+        this.serachGoodsCertByCompany(event)
+      } else if (this.activeName === 'second') {
+        this.serachBasisCertByCompany(event)
+      } else {
+        this.serachTCCertByCompany(event)
+      }
+    },
+    handleClick (tab) {
+      this.activeName = tab.name
+    },
+    handleGoodsSelectionChange (val) {
+      console.log(val)
+      this.goodsSelection = val
+      this.goodsTemp = ''
+      for (var i = 0; i < val.length; i++) {
+        this.goodsTemp = this.goodsTemp + (val[i].Code + ' ' + val[i].Name + ',')
+      }
+      this.yChooseCert = this.goodsTemp + this.basisTemp + this.tcTemp
+    },
+    handleBasisSelectionChange (val) {
+      console.log(val)
+      this.basisSelection = val
+      this.basisTemp = ''
+      for (var i = 0; i < val.length; i++) {
+        this.basisTemp = this.basisTemp + (val[i].Code + ' ' + val[i].Name + ',')
+      }
+      this.yChooseCert = this.goodsTemp + this.basisTemp + this.tcTemp
+    },
+    handleTCSelectionChange (val) {
+      console.log(val)
+      this.tcSelection = val
+      this.tcTemp = ''
+      for (var i = 0; i < val.length; i++) {
+        this.tcTemp = this.tcTemp + (val[i].Code + ' ' + val[i].Name + ',')
+      }
+      this.yChooseCert = this.goodsTemp + this.basisTemp + this.tcTemp
+    },
+    // 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.yChooseCert = ''
+      this.entityForm.CompanyCode = val.Id
+      this.entityForm.CompanyName = val.SupplierName
+      // 搜索该公司所具有的准入范围
+      this.serachCertByCompany(val.Id)
+      this.companyDialog = false
+    },
+    serachCertByCompany (companyId) {
+      this.companyId = companyId
+      this.serachGoodsCertByCompany()
+      this.serachBasisCertByCompany()
+      this.serachTCCertByCompany()
+    },
+
+    serachGoodsCertByCompany (event) {
+      if (event != null) {
+        this.currentGoodsPage = 1
+      }
+
+      let params = {
+        _size: this.goodsSize,
+        _currentPage: this.currentGoodsPage,
+        _companyId: this.companyId,
+        _certName: this.certChooseName,
+        _Bak1: this.editForm.Bak1
+      }
+      setapi
+        .serachGoodsCertByCompany(params, this.$axios)
+        .then(res => {
+          this.goodsList = res.data.items
+          if (res.data.currentItemCount) {
+            this.currentGoodsItemCount = res.data.currentItemCount
+          } else {
+            this.currentGoodsItemCount = 0
+          }
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    serachBasisCertByCompany (event) {
+      if (event != null) {
+        this.currentBasisPage = 1
+      }
+
+      let params = {
+        _size: this.basisSize,
+        _currentPage: this.currentBasisPage,
+        _companyId: this.companyId,
+        _certName: this.certChooseName,
+        _Bak1: this.editForm.Bak1
+      }
+      setapi
+        .serachBasisCertByCompany(params, this.$axios)
+        .then(res => {
+          this.basisList = res.data.items
+          if (res.data.currentItemCount) {
+            this.currentBasisItemCount = res.data.currentItemCount
+          } else {
+            this.currentBasisItemCount = 0
+          }
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    serachTCCertByCompany (event) {
+      if (event != null) {
+        this.currentTCPage = 1
+      }
+      let params = {
+        _size: this.tcSize,
+        _currentPage: this.currentTCPage,
+        _companyId: this.companyId,
+        _certName: this.certChooseName,
+        _Bak1: this.editForm.Bak1
+      }
+      setapi
+        .serachTCCertByCompany(params, this.$axios)
+        .then(res => {
+          this.tcList = res.data.items
+          if (res.data.currentItemCount) {
+            this.currentTCItemCount = res.data.currentItemCount
+          } else {
+            this.currentTCItemCount = 0
+          }
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    EditSubmit () {
+      if (this.Bak22 && this.Bak22.length !== 0) {
+        if (typeof (this.Bak22[0]) === 'string' || typeof (this.Bak22[1]) === 'string') {
+          this.editForm.Bak2 = this.Bak22[0] + ' 至 ' + this.Bak22[1]
+        } else {
+          var startDate = this.formatDateTime(this.Bak22[0])
+          var endDate = this.formatDateTime(this.Bak22[1])
+          this.editForm.Bak2 = startDate + ' 至 ' + endDate
+        }
+      }
+
+      var goodsString = ''
+      if (this.goodsSelection.length !== 0) {
+        for (var i = 0; i < this.goodsSelection.length; i++) {
+          goodsString = goodsString + this.goodsSelection[i].Id + ','
+        }
+        goodsString = goodsString.substring(0, goodsString.length - 1)
+      }
+
+      var basisString = ''
+      if (this.basisSelection.length !== 0) {
+        for (var j = 0; j < this.basisSelection.length; j++) {
+          basisString = basisString + this.basisSelection[j].Id + ','
+        }
+        basisString = basisString.substring(0, basisString.length - 1)
+      }
+
+      var tcString = ''
+      if (this.tcSelection.length !== 0) {
+        for (var k = 0; k < this.tcSelection.length; k++) {
+          tcString = tcString + this.tcSelection[k].Id + ','
+        }
+        tcString = tcString.substring(0, tcString.length - 1)
+      }
+
+      let params = {
+        _goodsString: goodsString,
+        _basisString: basisString,
+        _tcString: tcString,
+        _Bak1: this.editForm.Bak1
+
+      }
+      this.$refs['EditFormref'].validate(valid => {
+        if (valid) {
+          setapi
+            .updatebadrecordbyid(this.editId, this.editForm, params, 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()
+                this.certNames = ''
+                this.goodsSelection = []
+                this.basisSelection = []
+                this.tcSelection = []
+                this.goodsList = []
+                this.basisList = []
+                this.tcList = []
+                this.yChooseCert = ''
+                this.activeName = 'first'
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+              this.Bak22 = []
+              this.editForm.Bak2 = ''
+            })
+            .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.Companycode = row.Companycode // 返现类别名称根据value值
+      this.editForm.Record = row.Record // 返现类别名称根据value值
+      this.editForm.Bak3 = row.Bak3 // 返现类别名称根据value值
+      this.editForm.Bak1 = row.Bak1
+      if (row.Bak2.indexOf(' 至 ') !== -1) {
+        var arr = row.Bak2.split(' 至 ')
+        this.Bak22 = arr
+      } else {
+        this.Bak22 = []
+      }
+      if (row.Bak1 === '1') {
+        this.goodsList = []
+        this.basisList = []
+        this.tcList = []
+        this.certNames = ''
+        this.goodsSize = 10
+        this.basisSize = 10
+        this.tcSize = 10
+
+        this.currentGoodsPage = 1
+        this.currentBasisPage = 1
+        this.currentTCPage = 1
+
+        this.currentGoodsItemCount = 0
+        this.currentBasisItemCount = 0
+        this.currentTCItemCount = 0
+        this.activeName = 'first'
+        // 执行方法整这个企业的准入项
+
+        this.serachCertByCompany(row.Companycode)
+        this.certTitle = '已暂停准入范围列表'
+        this.certDialog = true
+      }
+    },
+
+    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 () {
+      // 处理时间段
+      if (this.Bak2 && this.Bak2.length !== 0) {
+        var startDate = this.formatDateTime(this.Bak2[0])
+        var endDate = this.formatDateTime(this.Bak2[1])
+        this.entityForm.Bak2 = startDate + ' 至 ' + endDate
+      }
+      // 判断是什么暂停
+      if (this.certNames !== '') {
+        this.isFlag = '1'
+      } else {
+        this.isFlag = '0'
+      }
+      // 处理选中的数组
+      var goodsString = ''
+      if (this.goodsSelection.length !== 0) {
+        for (var i = 0; i < this.goodsSelection.length; i++) {
+          goodsString = goodsString + this.goodsSelection[i].Id + ','
+        }
+        goodsString = goodsString.substring(0, goodsString.length - 1)
+      }
+
+      var basisString = ''
+      if (this.basisSelection.length !== 0) {
+        for (var j = 0; j < this.basisSelection.length; j++) {
+          basisString = basisString + this.basisSelection[j].Id + ','
+        }
+        basisString = basisString.substring(0, basisString.length - 1)
+      }
+
+      var tcString = ''
+      if (this.tcSelection.length !== 0) {
+        for (var k = 0; k < this.tcSelection.length; k++) {
+          tcString = tcString + this.tcSelection[k].Id + ','
+        }
+        tcString = tcString.substring(0, tcString.length - 1)
+      }
+      let params = {
+        _isFlag: this.isFlag,
+        _goodsString: goodsString,
+        _basisString: basisString,
+        _tcString: tcString
+      }
+      this.$refs['EntityFormref'].validate(valid => {
+        if (valid) {
+          setapi
+            .addBadRecord(this.entityForm, params, 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()
+                this.Bak2 = []
+                this.entityForm.Bak2 = ''
+                this.certNames = ''
+                this.goodsSelection = []
+                this.basisSelection = []
+                this.tcSelection = []
+                this.yChooseCert = ''
+                this.activeName = 'first'
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+            })
+            .catch(err => {
+              console.error(err)
+            })
+        }
+      })
+    },
+
+    initCompany (event) {
+      if (event != null) {
+        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
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    // 初始化列表方法
+    initDatas (event) {
+      if (event != null) {
+        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
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    addaudit () {
+      this.certTitle = '准入范围列表'
+      this.goodsList = []
+      this.basisList = []
+      this.tcList = []
+      this.certNames = ''
+      this.goodsSize = 10
+      this.basisSize = 10
+      this.tcSize = 10
+
+      this.entityForm.CompanyName = ''
+      this.currentGoodsPage = 1
+      this.currentBasisPage = 1
+      this.currentTCPage = 1
+
+      this.currentGoodsItemCount = 0
+      this.currentBasisItemCount = 0
+      this.currentTCItemCount = 0
+      this.activeName = 'first'
+      this.editForm.Bak1 = ''
+      this.addshow = true
+    },
+
+    // 分页方法
+    handleCurrentChange (value) {
+      this.currentPage = value
+      this.initDatas()
+    },
+    handleCurrentChange1 (value) {
+      this.currentPage1 = value
+      this.initCompany()
+    },
+    handleGoodsCurrentChange (value) {
+      this.currentGoodsPage = value
+      this.serachGoodsCertByCompany()
+    },
+    handleBasisCurrentChange (value) {
+      this.currentBasisPage = value
+      this.serachBasisCertByCompany()
+    },
+    handleTCCurrentChange (value) {
+      this.currentTCPage = value
+      this.serachTCCertByCompany()
+    },
+    handleSizeChange (value) {
+      this.size = value
+      this.currentPage = 1
+      this.initDatas()
+    },
+    handleSizeChange1 (value) {
+      this.size1 = value
+      this.currentPage1 = 1
+      this.initCompany()
+    },
+    handleGoodsSizeChange (value) {
+      this.goodsSize = value
+      this.currentGoodsPage = 1
+      this.serachGoodsCertByCompany()
+    },
+    handleBasisSizeChange (value) {
+      this.basisSize = value
+      this.currentBasisPage = 1
+      this.serachBasisCertByCompany()
+    },
+    handleTCSizeChange (value) {
+      this.tcSize = value
+      this.currentTCPage = 1
+      this.serachTCCertByCompany()
+    },
+    searchCommand (command) {
+      if (command === 'clear') {
+        this.clearSearch()
+      }
+    },
+    clearSearch () {
+      this.searchForm.Companyname = ''
+      this.searchForm.Categorycode = ''
+      this.initDatas()
+    },
+    jstimehandle (val) {
+      if (val === '') {
+        return '----'
+      } else if (val === '0001-01-01T08:00:00+08:00') {
+        return '----'
+      } else if (val === '5000-01-01T23:59:59+08:00') {
+        return '永久'
+      } else {
+        val = val.replace('T', ' ')
+        return val.substring(0, 10)
+      }
+    },
+
+    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
+      return y + '-' + m + '-' + d
+    }
+
+  }
+}
+</script>