Dorpame.vue 8.35 KB
Newer Older
huxi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
<template>
  <div class="eibs">
    <c-col :span="12" style="padding-right: 20px">
      <c-col :span="24">
        <el-form-item label="单据要求" prop="lidgrp.blk.lcrdoc">
          <c-input
            :autosize="{ minRows: 12, maxRows: 800 }"
            :disabled="this.flag1"
            type="textarea"
            v-model="model.lidgrp.blk.lcrdoc"
            maxlength="52000"
            show-word-limit
            placeholder="请输入单据要求"
          ></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item
          label="添加/删除当前修订中的文本"
          prop="litamep.lcrdocamep.usrblk"
        >
          <c-fullbox>
            <c-input
              type="textarea"
              :disabled="this.flag2"
              v-model="model.litamep.lcrdocamep.usrblk"
              maxlength="52000"
              show-word-limit
              placeholder="请输入添加/删除补充信息"
              :autosize="{ minRows: 22, maxRows: 800 }"
            ></c-input>
            <template slot="footer">
              <c-button
                size="small"
                type="primary"
                icon="el-icon-search"
                :disabled="this.flag2"
                @click="
                  showGridPromptDialog(
                    'litamep.lcrdocame.buttxmsel',
                    null,
                    null,
                    { TXT: 'litamep.lcrdocamep.usrblk' },
                    { TXT: false },
                    'doxpDialog'
                  )
                "
              >
              </c-button>
            </template>
          </c-fullbox>
        </el-form-item>
      </c-col>
    </c-col>

    <c-col :span="12" style="padding-left: 20px">
      <c-col :span="24">
        <el-form-item label="历史概述" prop="lidgrp.blk.lcrdocame">
          <c-input
            :autosize="{ minRows: 12, maxRows: 999 }"
            disabled
            type="textarea"
            v-model="model.lidgrp.blk.lcrdocame"
            maxlength="4950"
            show-word-limit
            placeholder="请输入历史概述"
          ></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="12">
        <el-form-item label=" " prop="litamep.lcrdocamep.modflg">
          <c-checkbox
            @change="open"
            class="checkbox-left"
            v-model="model.litamep.lcrdocamep.modflg"
            >修改要替换的文本</c-checkbox
          >
        </el-form-item>
      </c-col>

      <c-col :span="12">
        <c-checkbox
          @change="open1"
          style="margin: 0px 0 10px 125px"
          v-model="model.litamep.lcrdocamep.modmanflg"
          >内部修改文本</c-checkbox
        >
      </c-col>

      <c-col :span="24">
        <c-button
          style="margin: 0px 0 10px 120px"
          size="small"
          type="primary"
        >
          显示差异
        </c-button>
      </c-col>

      <c-col :span="24">
        <c-button
          style="margin: 0px 0 10px 120px"
          disabled
          size="small"
          type="primary"
        >
          添加文本
        </c-button>
      </c-col>

      <c-col :span="24">
        <c-button
          style="margin: 0px 0 10px 120px"
          disabled
          size="small"
          type="primary"
          icon="el-icon-delete"
        >
          删除文本
        </c-button>
      </c-col>
    </c-col>
  </div>
</template>
<script>
huxi committed
128
import event from '../event';
huxi committed
129 130

export default {
huxi committed
131 132
  inject: ['root'],
  props: ['model', 'codes'],
huxi committed
133 134 135 136 137 138 139 140
  mixins: [event],
  data() {
    return {
      flag1: true,
      flag2: false,
    };
  },
  watch: {
huxi committed
141
    'model.litamep.lcrdocamep.modflg': {
huxi committed
142 143 144
      immediate: true,
      handler(val, oldval) {
        if (
huxi committed
145 146
          this.model.litamep.lcrdocamep.modflg == 'X' &&
          this.model.litamep.lcrdocamep.modmanflg == ''
huxi committed
147 148 149
        ) {
          this.flag1 = false;
          this.flag2 = true;
huxi committed
150
          this.model.litamep.lcrdocamep.usrblk = '';
huxi committed
151
        } else if (
huxi committed
152 153
          this.model.litamep.lcrdocamep.modflg == 'X' &&
          this.model.litamep.lcrdocamep.modmanflg == 'X'
huxi committed
154 155 156 157
        ) {
          this.flag1 = false;
          this.flag2 = true;
        } else if (
huxi committed
158 159
          this.model.litamep.lcrdocamep.modflg == '' &&
          this.model.litamep.lcrdocamep.modmanflg == ''
huxi committed
160 161 162 163
        ) {
          this.flag1 = true;
          this.flag2 = false;
        } else if (
huxi committed
164 165
          this.model.litamep.lcrdocamep.modflg == '' &&
          this.model.litamep.lcrdocamep.modmanflg == 'X'
huxi committed
166 167 168
        ) {
          this.flag1 = false;
          this.flag2 = true;
huxi committed
169
          this.model.litamep.lcrdocamep.usrblk = '';
huxi committed
170 171 172
        }
      },
    },
huxi committed
173
    'model.litamep.lcrdocamep.modmanflg': {
huxi committed
174 175 176
      immediate: true,
      handler(val, oldval) {
        if (
huxi committed
177 178
          this.model.litamep.lcrdocamep.modflg == 'X' &&
          this.model.litamep.lcrdocamep.modmanflg == ''
huxi committed
179 180 181
        ) {
          this.flag1 = false;
          this.flag2 = true;
huxi committed
182
          this.model.litamep.lcrdocamep.usrblk = '';
huxi committed
183
        } else if (
huxi committed
184 185
          this.model.litamep.lcrdocamep.modflg == 'X' &&
          this.model.litamep.lcrdocamep.modmanflg == 'X'
huxi committed
186 187 188 189
        ) {
          this.flag1 = false;
          this.flag2 = true;
        } else if (
huxi committed
190 191
          this.model.litamep.lcrdocamep.modflg == '' &&
          this.model.litamep.lcrdocamep.modmanflg == ''
huxi committed
192 193 194 195
        ) {
          this.flag1 = true;
          this.flag2 = false;
        } else if (
huxi committed
196 197
          this.model.litamep.lcrdocamep.modflg == '' &&
          this.model.litamep.lcrdocamep.modmanflg == 'X'
huxi committed
198 199 200
        ) {
          this.flag1 = false;
          this.flag2 = true;
huxi committed
201
          this.model.litamep.lcrdocamep.usrblk = '';
huxi committed
202 203 204 205 206 207
        }
      },
    },
  },
  methods: {
    open(val) {
huxi committed
208
      if (val === '' && !(this.model.lidgrp.blk.lcrdoc == '')) {
huxi committed
209
        this.$confirm(
huxi committed
210 211
          '是否确定要重置手动修改?',
          '提示',
huxi committed
212
          {
huxi committed
213 214 215
            cancelButtonText: '撤销',
            confirmButtonText: '确定',
            type: 'warning',
huxi committed
216 217 218 219 220
            showClose: false,
          }
        )
          .then(() => {
            //yes的执行在这里写
huxi committed
221
            this.model.lidgrp.blk.lcrdoc = '';
huxi committed
222
            this.$message({
huxi committed
223 224
              type: 'success',
              message: '删除成功!',
huxi committed
225 226 227 228
            });
          })
          .catch(() => {
            //No的功能在这里写
huxi committed
229
            this.model.litamep.lcrdocamep.modflg = 'X';
huxi committed
230
            this.$message({
huxi committed
231 232
              type: 'info',
              message: '已取消',
huxi committed
233 234
            });
          });
huxi committed
235 236 237
      } else if (val == 'X' && this.model.litamep.lcrdocamep.modmanflg == 'X') {
        this.$confirm('请先重置内部修改', '提示', {
          confirmButtonText: '确定',
huxi committed
238
          showCancelButton: false,
huxi committed
239
          type: 'warning',
huxi committed
240 241 242
          showClose: false,
        }).then(() => {
          //yes的执行在这里写
huxi committed
243
          this.model.litamep.lcrdocamep.modflg = '';
huxi committed
244 245 246 247 248 249
          this.flag1 = true;
          this.flag2 = false;
        });
      }
    },
    open1(val) {
huxi committed
250
      if (val === '' && !(this.model.lidgrp.blk.lcrdoc == '')) {
huxi committed
251
        this.$confirm(
huxi committed
252 253
          '是否确定要重置手动修改?',
          '提示',
huxi committed
254
          {
huxi committed
255 256 257
            cancelButtonText: '撤销',
            confirmButtonText: '确定',
            type: 'warning',
huxi committed
258 259 260 261 262
            showClose: false,
          }
        )
          .then(() => {
            //yes的执行在这里写
huxi committed
263
            this.model.lidgrp.blk.lcrdoc = '';
huxi committed
264
            this.$message({
huxi committed
265 266
              type: 'success',
              message: '删除成功!',
huxi committed
267 268 269 270
            });
          })
          .catch(() => {
            //No的功能在这里写
huxi committed
271
            this.model.litamep.lcrdocamep.modmanflg = 'X';
huxi committed
272
            this.$message({
huxi committed
273 274
              type: 'info',
              message: '已取消',
huxi committed
275 276 277
            });
          });
      } else if (
huxi committed
278 279
        this.model.litamep.lcrdocamep.modflg == 'X' &&
        this.model.litamep.lcrdocamep.modmanflg == 'X'
huxi committed
280
      ) {
huxi committed
281 282 283
        this.$confirm('请先重置修改以替换', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '',
huxi committed
284
          showCancelButton: false,
huxi committed
285
          type: 'warning',
huxi committed
286 287 288
          showClose: false,
        }).then(() => {
          //yes的执行在这里写
huxi committed
289
          this.model.litamep.lcrdocamep.modmanflg = '';
huxi committed
290 291 292 293 294 295 296 297 298 299 300
          this.flag1 = true;
          this.flag2 = false;
        });
      }
    },
  },
  created: function () {},
};
</script>
<style>
</style>