addDialog.vue 5.56 KB
<template>
  <dialogBox title="证书分发" @submitForm="submitForm"  saveButton="保存" width="45%"  @closeDialog="closeDialog" v-model="value">
    <div>
        <el-form ref="ruleForm" :model="ruleForm" label-width="100px" :rules="rules">
          <el-row>
            <el-col :span="12">
              <el-form-item label="发放编号:" prop="batchno">
                    <el-input v-model="ruleForm.batchno" :disabled="true"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="领取时间:" prop="rksj">
                  <el-date-picker v-model="ruleForm.rksj" type="datetime" placeholder="选择日期时间"></el-date-picker>
                </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="发放人员:" prop="rkry">
                    <el-input v-model="ruleForm.rkry" :disabled="true"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="领取人:" prop="lqr">
                    <el-select v-model="ruleForm.lqr" placeholder="请选择">
                        <el-option v-for="item in usernames" :key="item" :label="item" :value="item"></el-option>
                    </el-select>
                </el-form-item>
            </el-col>
          </el-row>
            <div>
              <el-table :data="tableForm" border style="width: 100%" :header-cell-style="{'text-align':'center',background: 'rgb(236, 245, 255)'}" :cell-style="{'text-align':'center'}">
                  <el-table-column prop="name" label="纸质证书类型" width="200"></el-table-column>
                  <el-table-column prop="ksysxlh" label="开始印刷序列号" width="200"></el-table-column>
                  <el-table-column prop="bs" label="本数">
                    <template slot-scope="scope">
                       <el-input v-model="scope.row.bs" @blur="ysxlhDeal(scope.row)"></el-input>
                    </template>
                  </el-table-column>
                  <el-table-column prop="jsysxlh" label="结束印刷序列号" width="200">
                      <template slot-scope="scope">
                        <span v-if="scope.row.jsysxlh == ''" style="color:red">系统计算</span>
                        <span v-else>{{scope.row.jsysxlh}}</span>
                    </template>
                  </el-table-column>
              </el-table>
            </div>
             <el-form-item label="备注" style="margin-top:20px">
                <el-input type="textarea" v-model="ruleForm.bz" :rows="4"></el-input>
             </el-form-item>
        </el-form>
    </div>
  </dialogBox>
</template>

<script>
import { getZsStartNo,getSysSerialSingle, getZsEndNo} from "@/api/zsgl.js"
export default {
  components: {
  },
  computed: {
  },
  props: {
    value: { type: Boolean, default: false },
  },
  data () {
    return {
      tableData: {},
      ruleForm: {
          batchno: '',
          lqr: '',
          rkry: '超级管理员',
          rksj: '',
          bz: '',
          zsstarno: '',
          zsendno: '',
          zsnum: '',
          zmstarno: '',
          zmendno: '',
          zmnum: ''
        },
      tableForm: [
        {
          name: '不动产权证书',
          ksysxlh: '',
          jsysxlh: '',
          bs: '',
          zslx: 'zs'
        },
        {
          name: '不动产权登记证明',
          ksysxlh: '',
          jsysxlh: '',
          bs: '',
          zslx: 'zm'
        }
      ],  
      ywhQueryForm: {
        serialtype: 'zsffbh',
        serialname: '证书分发编号',
        serialcode: 'zsff',
        digit: '5'
      },
      usernames: ['张三','李四'],
      rules: {
          batchNo: [
            { required: true, message: '入库编号不能为空', trigger: 'blur' }
          ],
          lqr: [
            { required: true, message: '请选择领取人', trigger: 'change' }
          ],
          rkry: [
            { required: true, message: '入库人员不能为空', trigger: 'blur' }
          ],
          rksj: [
            { required: true, message: '请选择入库时间', trigger: 'change' }
          ],
        },
    }
  },
  methods: {
    //表单提交
    submitForm () {
      
    },
    //序列号获取
    ywhSerial(){
    //   getSysSerialSingle(this.ywhQueryForm).then(res => {
    //     if(res.code == 200){
    //         this.ruleForm.batchno = res.message;
    //     }
    //   })
    },
    initStartNo(){
        getZsStartNo().then(res => {
            if(res.code == 200){
                this.tableForm[0].ksysxlh = res.result.zsstarno
                this.tableForm[1].ksysxlh = res.result.zmstarno
            }
        })
    },
    //印刷序列号处理
    ysxlhDeal(item){
      getZsEndNo({"bookNumber": item.bs,"zslx": item.zslx}).then(res => {
          if(res.code == 200){
            item.jsysxlh = res.result.endno
            item.bs = res.result.bookNumber
          }else{
              this.$message.error(res.message)
          }
      })
    },
    resetTableFields() {
      this.tableForm = [
        {
          name: '不动产权证书',
          ksysxlh: '',
          jsysxlh: '',
          bs: 0,
          zslx:1
        },
        {
          name: '不动产权登记证明',
          ksysxlh: '',
          jsysxlh: '',
          bs: 0,
          zslx:2
        }
      ]
    },
    closeDialog () {
      this.$emit("input", false);
    },
  }
}
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";

</style>