Blame view

src/components/Business/ktfZhYhydzb.vue 3.61 KB
yangwei committed
1 2 3 4 5 6 7 8 9 10
<template>
  <div class="islandCoordinates itemForm">
    <el-form :model="ruleForm" :rules="rules" ref="formList" label-width="100px" :key="key">
      <el-row>
        <el-col :span="8">
          <el-form-item prop="ZHHDDM">
            <span slot="label">
              宗海/海岛代码: <br />
              <p class="label-detail">(ZHHDDM)</p>
            </span>
11
            <el-input :disabled="$store.state.business.Edit" v-model="ruleForm.ZHHDDM" maxlength="19"></el-input>
yangwei committed
12 13 14 15 16 17 18 19 20 21
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item prop="XH" :rules="{ type: 'number' }">
            <span slot="label">
              序号: <br />
              <p class="label-detail">(XH)</p>
            </span>
            <el-input-number controls-position="right" :disabled="$store.state.business.Edit"
22 23
              v-model.number="ruleForm.XH" type="number" v-only-number="{ max: 999999, min: 0, precision: 0 }">
            </el-input-number>
yangwei committed
24 25 26 27 28 29 30 31 32 33
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item prop="BW" :rules="{ type: 'number' }">
            <span slot="label">
              北纬: <br />
              <p class="label-detail">(BW)</p>
            </span>
            <el-input-number controls-position="right" :disabled="$store.state.business.Edit"
34 35
              v-model.number="ruleForm.BW" type="number" v-only-number="{ max: 999999999999999, min: 0, precision: 8 }">
            </el-input-number>
yangwei committed
36 37 38 39 40 41 42 43 44 45 46 47
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="8">
          <el-form-item prop="DJ" :rules="{ type: 'number' }">
            <span slot="label">
              东经: <br />
              <p class="label-detail">(DJ)</p>
            </span>
            <el-input-number controls-position="right" :disabled="$store.state.business.Edit"
48 49
              v-model.number="ruleForm.DJ" type="number" v-only-number="{ max: 999999999999999, min: 0, precision: 8 }">
            </el-input-number>
yangwei committed
50 51 52 53 54 55 56 57 58
          </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>
59
            <el-input :disabled="$store.state.business.Edit" v-model="ruleForm.QXDM"></el-input>
yangwei committed
60 61 62 63 64 65 66 67 68
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <message-tips ref="msg" />
  </div>
</template>
<script>
// 用海、用岛坐标
69 70
import ktfZhYhydzb from "@/api/ktfZhYhydzb";
import ruleMixin from "@/mixins/ruleMixin.js";
yangwei committed
71 72 73 74 75
export default {
  mixins: [ruleMixin],
  props: {
    bsmSjsb: {
      type: String,
76
      default: "",
yangwei committed
77 78 79
    },
    bsmYwsjb: {
      type: String,
80 81
      default: "",
    },
yangwei committed
82
  },
83
  data() {
yangwei committed
84 85
    return {
      ruleForm: {
86 87 88 89 90 91 92
        ZHHDDM: "",
        XH: "",
        BW: "",
        DJ: "",
        QXDM: "",
      },
    };
yangwei committed
93 94
  },
  methods: {
95
    async featchData() {
yangwei committed
96
      try {
97 98 99 100
        let { result: res } = await ktfZhYhydzb.getKtfZhYhydzbById(
          this.bsmSjsb
        );
        this.ruleForm = res;
yangwei committed
101 102
        //this.featchRule()
      } catch (error) {
103
        this.$refs.msg.messageShow();
yangwei committed
104 105
      }
    },
106
    handleUpdateForm() {
yangwei committed
107 108
      return new Promise(async (resolve, reject) => {
        try {
109
          let res = await ktfZhYhydzb.updateKtfZhYhydzb(this.ruleForm);
yangwei committed
110
          // this.$refs['formList'].resetFields();
111
          resolve(res.code);
yangwei committed
112
        } catch (error) {
113
          this.$refs.msg.messageShow();
yangwei committed
114
        }
115 116 117 118
      });
    },
  },
};
yangwei committed
119 120 121 122 123 124
</script>
<style scoped lang="scss">
@import "./css/itemForm.scss";
</style>