Blame view

src/views/zsgl/zsff/zsff.vue 5.22 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="分发编号">
任超 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 22 23

          <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="结束时间">
              <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>
任超 committed
30
              <el-button type="primary" native-type="submit" @click="queryClick()">查询</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
      </lb-table>
    </div>
任超 committed
44 45
    <addDialog ref="addDialog" v-model="isDialog" />
    <viewDialog v-model="viewDialog" />
jiaozeping@pashanhoo.com committed
46 47 48 49 50
  </div>
</template>
<script>
import table from "@/utils/mixin/table";
import { datas, sendThis } from "./zsffdata";
任超 committed
51 52
import viewDialog from "../components/viewDialog.vue";
import { getZsglffList, removeZsgl, confirmZsff } from "@/api/zsgl.js"
蔡俊立 committed
53
import addDialog from "./components/addDialog.vue"
jiaozeping@pashanhoo.com committed
54 55
export default {
  name: "zsff",
任超 committed
56
  components: { addDialog, viewDialog },
jiaozeping@pashanhoo.com committed
57
  mixins: [table],
任超 committed
58
  mounted () {
jiaozeping@pashanhoo.com committed
59 60
    sendThis(this);
  },
任超 committed
61
  data () {
jiaozeping@pashanhoo.com committed
62
    return {
任超 committed
63
      viewDialog: false,
蔡俊立 committed
64
      isDialog: false,
任超 committed
65
      value: '',
任超 committed
66
      ruleForm: {
蔡俊立 committed
67 68 69
        batchno: '',
        ffkssj: '',
        ffjssj: ''
jiaozeping@pashanhoo.com committed
70 71
      },
      tableData: {
任超 committed
72
        total: 0,
jiaozeping@pashanhoo.com committed
73
        columns: datas.columns(),
蔡俊立 committed
74 75
        data: [],
      },
任超 committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
      // 开始结束日期限制
      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
96
    }
jiaozeping@pashanhoo.com committed
97 98
  },
  methods: {
蔡俊立 committed
99 100 101 102 103
    init (e) {
      this.fetchData()
    },
    // 列表渲染接口
    fetchData () {
任超 committed
104
      getZsglffList({ ...this.ruleForm, ...this.pageData }).then(res => {
蔡俊立 committed
105 106 107 108 109 110 111
        if (res.code === 200) {
          let { total, records } = res.result
          this.tableData.total = total;
          this.tableData.data = records ? records : []
        }
      })
    },
蔡俊立 committed
112
    openDialog (bsmBatch) {
任超 committed
113
      if (bsmBatch) {
蔡俊立 committed
114 115 116
        this.$nextTick(() => {
          this.$refs.addDialog.getDetailInfo(bsmBatch);
        })
任超 committed
117
      } else {
蔡俊立 committed
118 119 120 121 122
        this.$nextTick(() => {
          this.$refs.addDialog.ywhSerial();
          this.$refs.addDialog.initStartNo();
        })
      }
任超 committed
123
      this.isDialog = true;
jiaozeping@pashanhoo.com committed
124
    },
蔡俊立 committed
125 126 127
    queryClick () {
      this.fetchData()
    },
蔡俊立 committed
128
    //确定证书分发
任超 committed
129
    confrimVerify (item) {
蔡俊立 committed
130 131 132 133 134
      this.$confirm('是否确定分发', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
任超 committed
135 136
        confirmZsff({ "bsmBatch": item.bsmBatch }).then(res => {
          if (res.code == 200) {
蔡俊立 committed
137 138
            this.$message.success("分发成功")
            this.fetchData();
任超 committed
139
          } else {
蔡俊立 committed
140 141 142 143 144 145 146 147 148 149
            this.$message.error(res.message)
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消审核'
        });
      });
    },
任超 committed
150 151
    //删除证书分发数据
    delZsff (item) {
蔡俊立 committed
152 153 154 155 156
      this.$confirm('确定要删除吗, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
任超 committed
157 158
        removeZsgl({ "bsmBatch": item.bsmBatch }).then(res => {
          if (res.code == 200) {
蔡俊立 committed
159
            this.$message.success("删除成功")
任超 committed
160 161
            this.handleDel()
            this.fetchData()
任超 committed
162
          } else {
蔡俊立 committed
163 164 165 166 167 168 169 170 171 172
            this.$message.error(res.message)
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
jiaozeping@pashanhoo.com committed
173 174 175 176 177
  },
};
</script>
<style scoped lang="scss">
@import "~@/styles/public.scss";
任超 committed
178 179 180 181

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