index.vue 1.27 KB
Newer Older
suwenhao committed
1 2 3 4 5 6 7 8 9 10 11 12
<template>
    <div class="eContainer-search">
      <el-form
        :model="model"
        :rules="rules"
        ref="modelForm"
        tokenKey="modelForm"
        :validate-on-rule-change="false"
        label-width="120px"
        size="small"
      >
        <c-content>
13
          <m-inftrnps :model="model" :codes="codes" ref="inftrnps" @changeModel="changeModel" />
suwenhao committed
14 15 16 17 18
        </c-content>
      </el-form>
    </div>
  </template>
  <script>
19
  import commonApi from "~/mixin/commonApi";
suwenhao committed
20 21
  import CodeTable from "~/config/CodeTable";
  import Inftrnps from "./Inftrnps";
22 23
  import Trnrel from "../model";
  import event from "../event";
suwenhao committed
24 25 26
  export default {
    name: "Trnrel",
    components: {
27
      "m-inftrnps": Inftrnps
suwenhao committed
28
    },
29
    mixins: [commonApi, event], 
suwenhao committed
30 31 32 33 34 35 36 37
    provide() {
      return {
        root: this,
      };
    },
    data() {
      return {
        trnName: "trnrel",
38
        model: new Trnrel().data,
suwenhao committed
39 40 41 42 43 44 45 46
        rules: null,
        codes: {
          dflg: CodeTable.dflg,
          bchtyp: CodeTable.bchtyp,
          usrsort: CodeTable.usrsort,
        },
      };
    },
47 48 49 50 51 52 53
    methods: {
      // 子组件改变model字段值
      changeModel(val) {
        let { cod } = val;
        this.$set(this.model.atp, 'cod', cod)
      }
    }
suwenhao committed
54 55 56 57 58
  };
  </script>
  <style>
  </style>