Blame view

src/views/zsgl/zsff/zsff.vue 5.55 KB
jiaozeping@pashanhoo.com committed
1 2 3 4
<template>
  <div class="from-clues">
    <!-- 表单部分 -->
    <div class="from-clues-header">
任超 committed
5
      <el-form :model="ruleForm" @submit.native.prevent label-width="80px">
jiaozeping@pashanhoo.com committed
6 7
        <el-row>
          <el-col :span="5">
任超 committed
8
            <el-form-item label="分发编号" label-width="70px">
任超 committed
9
              <el-input v-model="ruleForm.batchno" @clear="queryClick()" clearable placeholder="分发编号"></el-input>
jiaozeping@pashanhoo.com committed
10 11
            </el-form-item>
          </el-col>
任超 committed
12 13 14 15 16 17 18 19 20 21

          <el-col :span="5">
            <el-form-item label="开始日期">
              <el-date-picker v-model="ruleForm.ffkssj" :picker-options="pickerOptionsStart" type="date"
                placeholder="开始日期" value-format="yyyy-MM-dd" clearable>
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="结束时间">
22 23
              <el-date-picker v-model="ruleForm.ffjssj" :picker-options="pickerOptionsEnd" type="date" placeholder="结束日期"
                value-format="yyyy-MM-dd" clearable>
任超 committed
24 25 26
              </el-date-picker>
            </el-form-item>
          </el-col>
任超 committed
27 28

          <el-col :span="9" class="btnColRight">
jiaozeping@pashanhoo.com committed
29
            <el-form-item>
yangwei committed
30
              <el-button type="primary" native-type="submit" @click="handleSearch">查询</el-button>
蔡俊立 committed
31
              <el-button type="primary" @click="openDialog()">新增</el-button>
jiaozeping@pashanhoo.com committed
32 33 34 35 36 37 38
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <!-- 表格 -->
    <div class="from-clues-content">
蔡俊立 committed
39
      <lb-table :page-size="pageData.size" border :current-page.sync="pageData.current" :total="tableData.total"
任超 committed
40 41
        @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
        :data="tableData.data">
jiaozeping@pashanhoo.com committed
42 43 44 45 46
      </lb-table>
    </div>
  </div>
</template>
<script>
47 48
  import table from "@/utils/mixin/table";
  import { datas, sendThis } from "./zsffdata";
xiaomiao committed
49
  import { mapGetters } from "vuex";
50
  import { getZsglffList, removeZsgl, confirmZsff } from "@/api/zsgl.js"
xiaomiao committed
51 52 53 54
 export default {
  computed: {
    ...mapGetters(["userInfo"]),
  },
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
    name: "zsff",
    mixins: [table],
    mounted () {
      sendThis(this);
    },
    activated () {
      this.queryClick()
    },
    data () {
      return {
        value: '',
        ruleForm: {
          batchno: '',
          ffkssj: '',
          ffjssj: ''
        },
        tableData: {
          total: 0,
          columns: datas.columns(),
          data: [],
        },
        // 开始结束日期限制
        pickerOptionsStart: {
          disabledDate: (time) => {
            if (this.ruleForm.ffjssj) {
              return (
                time.getTime() >= new Date(this.ruleForm.ffjssj).getTime()
              );
            }
任超 committed
84
          }
85 86 87 88 89 90 91 92 93
        },
        // 结束日期限制
        pickerOptionsEnd: {
          disabledDate: (time) => {
            if (this.ruleForm.ffkssj) {
              return (
                time.getTime() <= new Date(this.ruleForm.ffkssj).getTime()
              );
            }
任超 committed
94 95 96
          }
        }
      }
蔡俊立 committed
97
    },
98 99 100 101 102 103 104 105
    methods: {
      // 查看弹框
      /**
       * @description: 查看弹框
       * @param {*} bsmBatch
       * @author: renchao
       */
      openDialog (bsmBatch) {
xiaomiao committed
106
        console.log("this.userInfo",this.userInfo);
107
        this.$popupDialog("证书分发", "zsgl/zsff/components/addDialog", {
xiaomiao committed
108 109
          bsmBatch: bsmBatch,
          organizationId:this.userInfo.organizationId
110 111 112 113 114 115 116 117 118 119 120 121
        }, "50%")
      },
      /**
       * @description: queryClick
       * @author: renchao
       */
      queryClick () {
        getZsglffList({ ...this.ruleForm, ...this.pageData }).then(res => {
          if (res.code === 200) {
            let { total, records } = res.result
            this.tableData.total = total;
            this.tableData.data = records ? records : []
蔡俊立 committed
122 123
          }
        })
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
      },
      //确定证书分发
      /**
       * @description: 确定证书分发
       * @param {*} item
       * @author: renchao
       */
      confrimVerify (item) {
        this.$confirm('是否确定分发', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          confirmZsff({ "bsmBatch": item.bsmBatch }).then(res => {
            if (res.code == 200) {
              this.$message.success("分发成功")
              this.queryClick();
            } else {
              this.$message.error(res.message)
            }
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消审核'
          });
蔡俊立 committed
150
        });
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
      },
      //删除证书分发数据
      /**
       * @description: 删除证书分发数据
       * @param {*} item
       * @author: renchao
       */
      delZsff (item) {
        this.$confirm('确定要删除吗, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          removeZsgl({ "bsmBatch": item.bsmBatch }).then(res => {
            if (res.code == 200) {
              this.$message.success("删除成功")
              this.handleDel()
              this.queryClick()
            } else {
              this.$message.error(res.message)
            }
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          })
178
        })
179
      }
180 181
    }
  }
jiaozeping@pashanhoo.com committed
182 183
</script>
<style scoped lang="scss">
184
  @import "~@/styles/public.scss";
任超 committed
185

186 187 188
  /deep/.el-icon-date {
    display: none;
  }
jiaozeping@pashanhoo.com committed
189
</style>