Blame view

src/views/workflow/components/dialog/zslq.vue 5.01 KB
1
<!--
yuanbo committed
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-05-18 10:53:49
5
-->
蔡俊立 committed
6
<template>
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
  <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px">
    <el-row>
      <el-col :span="8">
        <el-form-item label="发证人姓名">
          <el-input v-model="ruleForm.fzrmc" disabled></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="发证时间">
          <el-input v-model="ruleForm.fzsj" disabled></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="发证数量">
          <el-input v-model="ruleForm.fzsl" disabled></el-input>
        </el-form-item>
      </el-col>
    </el-row>
25

26 27 28
    <lb-table :column="tableData.columns" @row-dblclick="handleRowClick" ref="table" @selection-change="handleSelectionChange" :data="tableData.data"
      :pagination="false"
      :calcHeight="300">
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
    </lb-table>
    <el-row>
      <el-col :span="6">
        <el-form-item label="领证人" prop="lzrxm">
          <el-input v-model="ruleForm.lzrxm"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="证件类型" prop="lzrzjlb">
          <el-select v-model="ruleForm.lzrzjlb" filterable clearable placeholder="请选择">
            <el-option v-for="item in zjzlData" :key="item.dcode" :label="item.dname" :value="item.dcode">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="证件号" prop="lzrzjh">
          <el-input v-model="ruleForm.lzrzjh"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="领证人电话" prop="lzrdh">
          <el-input v-model="ruleForm.lzrdh"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-form-item class="text-center">
      <el-button @click="$popupCacel">取消</el-button>
      <el-button type="primary" @click="handleSubmit">确定</el-button>
    </el-form-item>
  </el-form>
蔡俊立 committed
60 61
</template>
<script>
62
  import Vue from 'vue'
xiaomiao committed
63 64 65
  import store from '@/store/index.js'
  import table from "@/utils/mixin/table";
  import { getUnclaimedBdcqz, issueCertificate } from "@/api/bdcqz.js";
66
  import { datas } from "../../javascript/fzxxdata";
xiaomiao committed
67 68
  export default {
    props: {
69 70 71 72 73 74
      formData: {
        type: Object,
        default: () => {
          return {}
        }
      }
田浩浩 committed
75
    },
xiaomiao committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
    mixins: [table],
    data () {
      return {
        zjzlData: store.getters.dictData['A30'],
        ruleForm: {
          fzrmc: '',
          fzsj: '',
          fzsl: '',
          bdcqzList: [],
          lzrxm: '',
          lzrzjlb: '',
          lzrzjh: '',
          lzrdh: ''
        },
        rules: {
          lzrxm: [
            { required: true, message: '请输入领证人', trigger: 'blur' }
          ],
          lzrzjlb: [
            { required: true, message: '请选择证件类型', trigger: 'change' }
          ],
          lzrzjh: [
            { required: true, message: '请输入证件号', trigger: 'blur' }
          ],
          lzrdh: [
            { required: true, message: '请输入电话号码', trigger: 'blur' }
102
          ]
xiaomiao committed
103 104 105 106
        },
        tableData: {
          total: 0,
          columns: datas.columns().lzgrid,
107 108
          data: []
        }
xiaomiao committed
109
      }
蔡俊立 committed
110
    },
111 112 113 114
    mounted () {
      this.$nextTick(() => {
        this.loadGrid()
      })
蔡俊立 committed
115
    },
xiaomiao committed
116 117
    methods: {
      //列表初始化
yuanbo committed
118 119 120 121
      /**
       * @description: 列表初始化
       * @author: renchao
       */
xiaomiao committed
122
      loadGrid () {
123
        getUnclaimedBdcqz({ bsmSlsq: Vue.prototype.$currentRoute.query.bsmSlsq }).then(res => {
xiaomiao committed
124 125 126 127 128
          if (res.code === 200) {
            this.tableData.data = res.result.list;
            this.ruleForm.fzrmc = res.result.fzrmc
            this.ruleForm.fzsj = res.result.fzsj
            this.ruleForm.fzsl = res.result.fzsl
xiaomiao committed
129
            this.ruleForm.bdcqzList = res.result.list;
xiaomiao committed
130 131 132
          }
        })
      },
yuanbo committed
133 134 135 136 137
      /**
       * @description: handleSelectionChange
       * @param {*} val
       * @author: renchao
       */
138 139 140
      handleSelectionChange (val) {
        this.ruleForm.bdcqzList = val
      },
yuanbo committed
141 142 143 144 145
      /**
       * @description: handleRowClick
       * @param {*} row
       * @author: renchao
       */
146 147 148
      handleRowClick (row) {
        this.$refs.table.toggleRowSelection(row)
      },
yuanbo committed
149 150 151 152
      /**
       * @description: handleSubmit
       * @author: renchao
       */
xiaomiao committed
153
      handleSubmit () {
xiaomiao committed
154

xiaomiao committed
155 156 157 158 159
        this.$refs.ruleForm.validate(valid => {
          if (valid) {
            issueCertificate(this.ruleForm).then(res => {
              if (res.code == 200) {
                this.$message.success('保存成功');
xiaomiao committed
160
                this.$popupCacel()
xiaomiao committed
161 162 163 164 165 166 167 168
              } else {
                this.$message.error(res.message)
              }
            })
          } else {
            this.$message.error("请填写领取人信息!")
            return false;
          }
169 170
        })
      }
xiaomiao committed
171
    }
蔡俊立 committed
172 173 174
  }
</script>
<style scoped lang="scss">
xiaomiao committed
175
  @import "~@/styles/mixin.scss";
蔡俊立 committed
176
</style>
177

178