Blame view

src/views/workflow/components/dialog/zslq.vue 5.21 KB
1
<!--
yuanbo committed
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-07-24 10:22:41
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
          if (res.code === 200) {
            this.tableData.data = res.result.list;
126 127 128
            if(this.tableData.data.length>0) {
              this.ruleForm.lzrxm = this.tableData.data[0].qlr
            }
xiaomiao committed
129 130 131
            this.ruleForm.fzrmc = res.result.fzrmc
            this.ruleForm.fzsj = res.result.fzsj
            this.ruleForm.fzsl = res.result.fzsl
xiaomiao committed
132
            this.ruleForm.bdcqzList = res.result.list;
xiaomiao committed
133 134 135
          }
        })
      },
yuanbo committed
136 137 138 139 140
      /**
       * @description: handleSelectionChange
       * @param {*} val
       * @author: renchao
       */
141 142 143
      handleSelectionChange (val) {
        this.ruleForm.bdcqzList = val
      },
yuanbo committed
144 145 146 147 148
      /**
       * @description: handleRowClick
       * @param {*} row
       * @author: renchao
       */
149 150 151
      handleRowClick (row) {
        this.$refs.table.toggleRowSelection(row)
      },
yuanbo committed
152 153 154 155
      /**
       * @description: handleSubmit
       * @author: renchao
       */
xiaomiao committed
156 157 158 159 160 161
      handleSubmit () {
        this.$refs.ruleForm.validate(valid => {
          if (valid) {
            issueCertificate(this.ruleForm).then(res => {
              if (res.code == 200) {
                this.$message.success('保存成功');
162 163
                //刷新列表
                store.dispatch('user/refreshPage', true)
xiaomiao committed
164
                this.$popupCacel()
xiaomiao committed
165 166 167 168 169 170 171 172
              } else {
                this.$message.error(res.message)
              }
            })
          } else {
            this.$message.error("请填写领取人信息!")
            return false;
          }
173 174
        })
      }
xiaomiao committed
175
    }
蔡俊立 committed
176 177 178
  }
</script>
<style scoped lang="scss">
xiaomiao committed
179
  @import "~@/styles/mixin.scss";
蔡俊立 committed
180
</style>
181

182