ktfZhYhzk.vue 4.03 KB
<!--
 * @Description  :用海状况表单组件
 * @Autor        : miaofang
 * @LastEditTime : 2023-05-17 17:08:29
-->
<template>
  <div class="seaUse itemForm">
    <el-form :model="ruleForm" :rules="rules" ref="formList" label-width="100px" :key="key">
      <el-row>
        <el-col :span="8">
          <el-form-item prop="ZHDM">
            <span slot="label">
              宗海代码: <br />
              <p class="label-detail">(ZHDM)</p>
            </span>
            <el-input :disabled="$store.state.business.Edit" v-model="ruleForm.ZHDM"></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item prop="YHFS">
            <span slot="label">
              用海方式: <br />
              <p class="label-detail">(YHFS)</p>
            </span>
            <el-select :disabled="$store.state.business.Edit" v-model="ruleForm.YHFS">
              <el-option v-for="item in dicData['A51']" :key="item.DCODE" :label="item.DNAME" :value="item.DCODE">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item prop="YHMJ" :rules="{ type: 'number' }">
            <span slot="label">
              用海面积: <br />
              <p class="label-detail">(YHMJ)</p>
            </span>
            <el-input-number controls-position="right" :disabled="$store.state.business.Edit"
              v-model.number="ruleForm.YHMJ" title="" type="number" v-only-number="{ max: 999999, min: 1, precision: 2 }">
            </el-input-number>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="8">
          <el-form-item prop="JTYT">
            <span slot="label">
              具体用途: <br />
              <p class="label-detail">(JTYT)</p>
            </span>
            <el-input :disabled="$store.state.business.Edit" v-model="ruleForm.JTYT"></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item prop="SYJES" :rules="{ type: 'number' }">
            <span slot="label">
              使用金额数: <br />
              <p class="label-detail">(SYJES)</p>
            </span>
            <el-input-number controls-position="right" :disabled="$store.state.business.Edit"
              v-model.number="ruleForm.SYJES" title="" type="number" v-only-number="{ max: 999999, min: 0, precision: 2 }">
            </el-input-number>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item prop="QXDM">
            <span slot="label">
              区县代码: <br />
              <p class="label-detail">(QXDM)</p>
            </span>
            <el-input :disabled="$store.state.business.Edit" v-model="ruleForm.QXDM"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <message-tips ref="msg" />
  </div>
</template>
<script>
// 用海状况
import ktfZhYhzk from "@/api/ktfZhYhzk";
import ruleMixin from "@/mixins/ruleMixin.js";
export default {
  mixins: [ruleMixin],
  props: {
    bsmSjsb: {
      type: String,
      default: "",
    },
    bsmYwsjb: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      ruleForm: {
        ZHDM: "",
        YHFS: "",
        YHMJ: "",
        JTYT: "",
        SYJES: "",
        QXDM: "",
      },
    };
  },
  methods: {
    async featchData() {
      try {
        let { result: res } = await ktfZhYhzk.getKtfZhYhzkById(this.bsmSjsb);
        this.ruleForm = res;
        //this.featchRule()
      } catch (error) {
        this.$refs.msg.messageShow();
      }
    },
    handleUpdateForm() {
      return new Promise(async (resolve) => {
        try {
          let res = await ktfZhYhzk.updateKtfZhYhzk(this.ruleForm);
          // this.$refs['formList'].resetFields();
          resolve(res.code);
        } catch (error) {
          this.$refs.msg.messageShow();
        }
      });
    },
  },
};
</script>
<style scoped lang="scss">
@import "./css/itemForm.scss";
</style>