Nidtxtp.vue 3.46 KB
<template>
	<div class="eibs-tab" ref="ptab">
		<c-row>
			<c-col :span="24">
				<c-col :span="24">
					<div style="display:flex">
						<c-checkbox true-label="X" false-label="" v-model="model.nitp.gidtxtmodflg" :disabled="isInDisplay" class="checkbox-left" style="margin-right: 20px;" @change="handleEdit">修改保函文本</c-checkbox>
						<c-button style="margin-right: 20px;" :disabled="model.nitp.gidtxtmodflg == ''" size="mini" type="primary" @click="handleReset">
							重置模板
						</c-button>
						<div style="width:300px">
							<el-form-item label="修改面函标题" prop="nitp.lettername" label-width="92px">
								<c-input :disabled="model.nitp.gidtxtmodflg !='X'" v-model="model.nitp.lettername" maxlength="60" placeholder="请输入面函标题"></c-input>
							</el-form-item>
						</div>
					</div>
				</c-col>
        <c-col :span="24">
            <el-form-item
              prop="nidgrp.blk.gidtxt"
            >
              <c-xml-format-editor
                v-model="model.nidgrp.blk.gidtxt"
                :disabled="model.nitp.gidtxtmodflg == '' || isInDisplay"
                placeholder="请输入保函文本可变因素"
                :chs="model.nidgrp.rec.giduil!='EN'"
                :heightStr="heightStr"
								:isShowScale="true"
								@blur="checkGidtxt"
              ></c-xml-format-editor>
            </el-form-item>
        </c-col>
      </c-col>

			<c-col :span="24">
				<c-col :span="24" style="margin-top: 20px 0 10px;">
					<div v-if="model.nidgrp.rec.hndtyp=='OA'" style="">反担保保函附加条款:</div>
				</c-col>
				<c-col :span="24">
					<el-form-item v-if="model.nidgrp.rec.hndtyp=='OA'" prop="nitp.indirectswiadd">
						<c-xml-format-editor
              line="10"
              v-model="model.nitp.indirectswiadd"
              :disabled="model.nitp.gidtxtmodflg == '' || isInDisplay"
              placeholder="请输入"
              :heightStr="heightStr"
              :isShowScale="true"
            ></c-xml-format-editor>
					</el-form-item>
				</c-col>
			</c-col>

		</c-row>
	</div>
</template>
<script>
import event from "../event";
import commonDepend from "~/mixin/commonDepend";
export default {
  components: {},
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [event, commonDepend],
  data() {
    return {
      isReset: false,
      heightStr: "400px"
    };
  },
  methods: {
    handleEdit() {
      if (!this.model.nitp.gidtxtmodflg) {
        this.$emit("changeTxt");
      }
    },
    handleReset() {
      if (this.model.nidgrp.blk.modifySet) {
        this.model.nidgrp.blk.modifySet = this.model.nidgrp.blk.modifySet.filter(
          key => key != "gidtxt"
        );
			}
			if (!this.model.nidgrp.blk.gtxgidtxt) {
				this.model.nidgrp.blk.gidtxt = ''
			}
      this.$emit("changeTxt");
    },
    handleInput() {
      this.isReset = false;
    },
    resizeFunction() {
      let height = this.$refs.ptab.offsetHeight;
      height = height - 35 - 45 - 80;
      if (height < 400) {
        height = 400;
      }
      this.heightStr = height + "px";
    }
  },
  mounted() {
    this.$ob = new ResizeObserver(() => {
      this.resizeFunction();
    });
    this.$ob.observe(this.$refs.ptab);
    this.resizeFunction();
  },
  beforeDestroy() {
    this.$ob.disconnect();
  },
  created() {}
};
</script>
<style scoped lang="less">
::v-deep .el-form-item__content {
  margin-left: 0 !important;
}
::v-deep .el-form-item__error {
	position: absolute!important;
	left: 6px!important;
}
</style>