Ptap.vue 5.64 KB
Newer Older
zhengxiaokui committed
1
<template>
liushikai committed
2
  <div>
zhengxiaokui committed
3
    <c-col v-if="!noRef" :span="24">
4 5 6
      <c-form-item :label="`${argadr.title}参考号`" :prop="`${argadr.grp}.${argadr.rol}.pts.ref`">
        <c-input :disabled="disabledRef" v-model="model[argadr.grp][argadr.rol].pts.ref" :placeholder="'请输入' + argadr.title + '参考号'"
          ></c-input>
潘际乾 committed
7
      </c-form-item>
zhengxiaokui committed
8 9
    </c-col>

10
    <c-col :span="24" v-if="!editExtLabel">
11 12
      <el-form-item :label="`${argadr.title}ID`" :prop="`${argadr.grp}.${argadr.rol}.pts.extkey`" style="width: 100%"
        :disabled="disabledExtkey">
fukai committed
13
        <c-fullbox>
14 15
          <c-input v-model="model[argadr.grp][argadr.rol].pts.extkey" :placeholder="'请输入' + argadr.title + 'Extkey'"
            :disabled="disabledExtkey" @keyup.enter.native="
fukai committed
16
              showGridPromptDialog(`${argadr.grp}.${argadr.rol}.pts.extkey`)
17
            " @change="valueChange"></c-input>
fukai committed
18
          <template slot="footer">
19 20
            <c-button style="margin:0 10px 0 10px;padding: 0 12px;" size="small" type="primary" icon="el-icon-search"
              :disabled="disabledExtkey" @click="onSeainf(`${argadr.grp}.${argadr.rol}.pts.extkey`)">
fukai committed
21
            </c-button>
22
            <c-button style="margin:0 0" size="small" type="primary" @click="onAplpDet" :disabled="disabledExtkey">
fukai committed
23 24 25 26
              {{ $t('buttons.details') }}
            </c-button>
          </template>
        </c-fullbox>
zhengxiaokui committed
27 28 29
      </el-form-item>
    </c-col>

30
    <c-col :span="24" v-else>
31
      <el-form-item :label="`${argadr.title}`" :prop="`${argadr.grp}.${argadr.rol}.pts.extkey`" style="width: 100%">
32
        <c-fullbox>
33 34
          <c-input :disabled="disabledExtkey" v-model="model[argadr.grp][argadr.rol].pts.extkey"
            :placeholder="'请输入' + argadr.title + 'Extkey'" @keyup.enter.native="
35
              showGridPromptDialog(`${argadr.grp}.${argadr.rol}.pts.extkey`)
36
            " @change="valueChange"></c-input>
37
          <template slot="footer">
38 39
            <c-button :disabled="disabledExtkey" style="margin:0 10px 0 10px;padding: 0 12px;" size="small"
              type="primary" icon="el-icon-search" @click="onSeainf(`${argadr.grp}.${argadr.rol}.pts.extkey`)">
40
            </c-button>
41
            <c-button style="margin:0 0" size="small" type="primary" @click="onAplpDet">
42 43 44 45 46 47 48
              {{ $t('buttons.details') }}
            </c-button>
          </template>
        </c-fullbox>
      </el-form-item>
    </c-col>

zhengxiaokui committed
49 50
    <template v-if="!onlySearch">
      <c-col v-if="isAdrblk" :span="24">
51 52 53
        <el-form-item label="名称地址" :prop="`${argadr.grp}.${argadr.rol}.pts.adrblk`">
          <c-input type="textarea" :rows="4" v-model="model[argadr.grp][argadr.rol].pts.adrblk" maxlength="150"
            show-word-limit placeholder="请输入名称地址" :disabled="disabled"></c-input>
54 55 56
        </el-form-item>
      </c-col>
      <c-col v-else-if="!haveAdrLabel" :span="24">
57 58 59
        <el-form-item label="" :prop="`${argadr.grp}.${argadr.rol}.pts.adrblk`">
          <c-input type="textarea" :rows="4" v-model="model[argadr.grp][argadr.rol].pts.adrblk" maxlength="150"
            show-word-limit placeholder="请输入名称地址" :disabled="disabled"></c-input>
zhengxiaokui committed
60 61
        </el-form-item>
      </c-col>
zhengxiaokui committed
62 63
      <template v-else>
        <c-col :span="24">
64 65 66 67
          <el-form-item :label="`${argadr.title}名称`" :prop="`${argadr.grp}.${argadr.rol}.namelc`">
            <c-input type="textarea" v-model="model[argadr.grp][argadr.rol].namelc"
              :placeholder="'请输入' + argadr.title + '名称'" :disabled="disabled" :rows="2" maxlength="35" show-word-limit>
            </c-input>
zhengxiaokui committed
68 69
          </el-form-item>
        </c-col>
zhengxiaokui committed
70

zhengxiaokui committed
71
        <c-col :span="24">
72 73 74
          <el-form-item :label="`${argadr.title}地址`" :prop="`${argadr.grp}.${argadr.rol}.adrelc`">
            <c-input type="textarea" :rows="2" v-model="model[argadr.grp][argadr.rol].adrelc"
              :placeholder="'请输入' + argadr.title + '地址'" :disabled="disabled" maxlength="35" show-word-limit></c-input>
zhengxiaokui committed
75 76 77
          </el-form-item>
        </c-col>
      </template>
zhengxiaokui committed
78
    </template>
zhengxiaokui committed
79 80 81 82
  </div>
</template>
<script>
import Api from "~/service/Api";
wangren committed
83
import commonProcess from "~/mixin/commonProcess";
zhengxiaokui committed
84 85 86
// 机构信息模块
export default {
  inject: ["root"],
wangren committed
87
  mixins: [commonProcess],
zhengxiaokui committed
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104

  props: {
    model: {
      type: Object,
      default: undefined,
    },
    argadr: {
      type: Object,
      default: function () {
        return {
          title: "", //角色名称
          rol: "", //角色
          grp: "", //所属模块
        };
      },
    },
    disabled: {
zhengxiaokui committed
105
      //名称地址是否灰显
zhengxiaokui committed
106 107 108
      type: Boolean,
      default: false,
    },
109 110 111 112 113 114 115 116 117 118
    disabledRef: {
      //ref是否灰显
      type: Boolean,
      default: false,
    },
    disabledExtkey: {
      //extkey是否灰显
      type: Boolean,
      default: false,
    },
zhengxiaokui committed
119 120 121 122 123 124

    isAdrblk: {
      //名称地址是否为大字段
      type: Boolean,
      default: true,
    },
zhengxiaokui committed
125 126 127 128 129 130 131 132 133 134
    onlySearch: {
      //是否只展示extkey
      type: Boolean,
      default: false,
    },
    noRef: {
      //无需参考号
      type: Boolean,
      default: false,
    },
135 136 137 138 139 140 141 142 143 144
    editExtLabel: {
      //自定义ID label
      type: Boolean,
      default: true,
    },
    haveAdrLabel: {
      //有无名称地址 label
      type: Boolean,
      default: true,
    },
zhengxiaokui committed
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
  },
  data() {
    return {
      data: [],
    };
  },
  watch: {},
  methods: {
    onSeainf(data) {
      this.$emit("onSeainf", data);
    },

    onAplpDet() {
      this.$emit("onAplpDet");
    },
zhengxiaokui committed
160

zhengxiaokui committed
161
    valueChange() {
zhengxiaokui committed
162
      if (this.onlySearch) return;
liushikai committed
163 164 165
      // this.showGridPromptDialog(
      //   `${this.argadr.grp}.${this.argadr.rol}.pts.extkey`
      // );
zhengxiaokui committed
166
    },
zhengxiaokui committed
167
  },
zhengxiaokui committed
168

169
  created: function () { },
zhengxiaokui committed
170 171 172 173
};
</script>
<style>
</style>