Blame view

src/views/zsgl/zsff/zsff.vue 4.68 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 47 48
      </lb-table>
    </div>
  </div>
</template>
<script>
import table from "@/utils/mixin/table";
import { datas, sendThis } from "./zsffdata";
任超 committed
49
import { getZsglffList, removeZsgl, confirmZsff } from "@/api/zsgl.js"
jiaozeping@pashanhoo.com committed
50 51 52
export default {
  name: "zsff",
  mixins: [table],
任超 committed
53
  mounted () {
jiaozeping@pashanhoo.com committed
54 55
    sendThis(this);
  },
任超 committed
56
  data () {
jiaozeping@pashanhoo.com committed
57
    return {
任超 committed
58
      value: '',
任超 committed
59
      ruleForm: {
蔡俊立 committed
60 61 62
        batchno: '',
        ffkssj: '',
        ffjssj: ''
jiaozeping@pashanhoo.com committed
63 64
      },
      tableData: {
任超 committed
65
        total: 0,
jiaozeping@pashanhoo.com committed
66
        columns: datas.columns(),
蔡俊立 committed
67 68
        data: [],
      },
任超 committed
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
      // 开始结束日期限制
      pickerOptionsStart: {
        disabledDate: (time) => {
          if (this.ruleForm.ffjssj) {
            return (
              time.getTime() >= new Date(this.ruleForm.ffjssj).getTime()
            );
          }
        }
      },
      // 结束日期限制
      pickerOptionsEnd: {
        disabledDate: (time) => {
          if (this.ruleForm.ffkssj) {
            return (
              time.getTime() <= new Date(this.ruleForm.ffkssj).getTime()
            );
          }
        }
      }
任超 committed
89
    }
jiaozeping@pashanhoo.com committed
90 91
  },
  methods: {
92
    // 查看弹框
蔡俊立 committed
93
    openDialog (bsmBatch) {
94 95 96
      this.$popupDialog("证书分发", "zsgl/zsff/components/addDialog", {
        bsmBatch: bsmBatch
      }, "50%")
jiaozeping@pashanhoo.com committed
97
    },
蔡俊立 committed
98
    queryClick () {
99 100 101 102 103 104 105
      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
106
    },
蔡俊立 committed
107
    //确定证书分发
任超 committed
108
    confrimVerify (item) {
蔡俊立 committed
109 110 111 112 113
      this.$confirm('是否确定分发', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
任超 committed
114 115
        confirmZsff({ "bsmBatch": item.bsmBatch }).then(res => {
          if (res.code == 200) {
蔡俊立 committed
116
            this.$message.success("分发成功")
117
            this.queryClick();
任超 committed
118
          } else {
蔡俊立 committed
119 120 121 122 123 124 125 126 127 128
            this.$message.error(res.message)
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消审核'
        });
      });
    },
任超 committed
129 130
    //删除证书分发数据
    delZsff (item) {
蔡俊立 committed
131 132 133 134 135
      this.$confirm('确定要删除吗, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
任超 committed
136 137
        removeZsgl({ "bsmBatch": item.bsmBatch }).then(res => {
          if (res.code == 200) {
蔡俊立 committed
138
            this.$message.success("删除成功")
任超 committed
139
            this.handleDel()
140
            this.queryClick()
任超 committed
141
          } else {
蔡俊立 committed
142 143 144 145 146 147 148
            this.$message.error(res.message)
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
149 150 151 152 153
        })
      })
    }
  }
}
jiaozeping@pashanhoo.com committed
154 155 156
</script>
<style scoped lang="scss">
@import "~@/styles/public.scss";
任超 committed
157 158 159 160

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