index.vue 11.4 KB
Newer Older
fukai 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 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
<template>
  <c-row class="eibs-tab">
    <c-col :span="24" style="z-index:99">
      <el-table :data="model.docpan.doceot">
        <el-table-column label="角色" width="110">
          <template slot-scope="scope">
            <c-input :readonly="true" placeholder="请输入" style="width: 100%;" v-model="scope.row.role">
            </c-input>
          </template>
        </el-table-column>
        <el-table-column label="描述" width="300">
          <template slot-scope="scope">
            <c-input :readonly="true" placeholder="请输入" style="width: 100%;" v-model="scope.row.pandsc">
            </c-input>
          </template>
        </el-table-column>
        <el-table-column label="类型" width="150px">
          <template slot-scope="scope">
            <el-form-item :prop="'docpan.doceot.' + scope.$index + '.cortyp'" label-width="0">
              <c-select :isFixed="true" dbCode="doceotCortyp" disabled placeholder="请选择" style="width: 100%" v-model="scope.row.cortyp">
              </c-select>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column label="报文格式" width="150px">
          <template slot-scope="scope">
            <!-- @change="executeDefault('docpan.doccur.docsnf')" -->
            <c-input :disabled="scope.row.cortyp !== 'LET'" placeholder="请选择" style="width: 100%" v-if="scope.row.cortyp !== 'LET'" v-model="scope.row.docsnf">
            </c-input>
            <c-select :isFixed="true" v-else v-model="scope.row.docsnf" :disabled="scope.row.cortyp !== 'LET'" @change="customAddModify(scope.row, 'docsnf')" :customModifykey="'docpan.doceot.' + scope.$index + '.docsnf'" dbCode="docsnf" placeholder="请选择" :filterKey="scope.row.cortyp === 'LET'?['LET','LETAML','LETCOU']:undefined" style="width: 100%">
            </c-select>
          </template>
        </el-table-column>
        <!-- <el-table-column label="语言" width="150px">
					<template slot-scope="scope">
							<c-select
								@change="customAddModify(scope.row, 'docuil')"
								:customModifykey="'docpan.doceot.' + scope.$index + '.docuil'"
								dbCode="uiltxt1"
								placeholder="请选择"
								style="width: 100%"
								v-model="scope.row.docuil">
							</c-select>
					</template>
				</el-table-column> -->
        <el-table-column label="传送方式" width="110px">
          <template slot-scope="scope">
            <el-form-item :prop="'docpan.doceot.' + scope.$index + '.apf'" label-width="0">
              <c-select :isFixed="true" @change="customAddModify(scope.row, 'apf')" :customModifykey="'docpan.doceot.' + scope.$index + '.apf'" dbCode="apftxt" disabled placeholder="请选择" style="width: 100%" v-model="scope.row.apf">
              </c-select>
            </el-form-item>
          </template>
        </el-table-column>
        <!-- <el-table-column label="发送份数" width="70">
						<template slot-scope="scope">
							<c-input :readonly="true" placeholder="请选择" style="width: 100%" v-model="scope.row.apfcpy1">
							</c-input>
						</template>
				</el-table-column>
				<el-table-column label="抄送份数" width="70">
					<template slot-scope="scope">
						<c-input @change="customAddModify(scope.row, 'apfcpy2')" :customModifykey="'docpan.doceot.' + scope.$index + '.apfcpy2'"
											placeholder="请选择" style="width: 100%" v-model="scope.row.apfcpy2">
						</c-input>
					</template>
				</el-table-column> -->
        <el-table-column label="报文加押标志" width="" header-align="left">
          <template slot-scope="scope">
            <el-form-item :prop="'docpan.doceot.' + scope.$index + '.staflg'" label-width="0" style="width:300px">
              <c-select :isFixed="true" @change="customAddModify(scope.row, 'staflg')" :customModifykey="'docpan.doceot.' + scope.$index + '.staflg'" :disabled="scope.row.docsnf !=='SWT999' " :filterKey="['M']" dbCode="swttlx" placeholder="请选择" style="width: 100%" uil="EN" v-model="scope.row.staflg">
              </c-select>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="240px">
          <template slot-scope="scope">
            <div style="text-align:left">
              <el-button :disabled="scope.row.delflg==='D'" @click="handleDisplay(scope.$index, scope.row)" size="small" type="primary">
                预览
              </el-button>
              <el-button :disabled="scope.row.delflg==='D' || noPrint" @click="printContent(scope.$index, scope.row)" size="small" style="margin-left: 10px;" type="primary">
                打印
              </el-button>
              <c-button @click="active(scope.$index, scope.row)" size="small" :style="{'margin-left': '10px','border-bottom':showButtonColor(scope.row)}" :type="scope.row.delflg==='D'?'primary':''">
                {{scope.row.delflg==='D' ? "启用":"屏蔽"}}
              </c-button>
              <el-button :disabled="scope.row.delflg==='D' || isDispaly" v-if="scope.row.cortyp === 'LET'" @click="handleLETDetail(scope.$index, scope.row)" size="small" style="margin-left: 10px;" type="primary">
                详情
              </el-button>
              <el-button :disabled="scope.row.delflg==='D' || isDispaly" v-if="scope.row.cortyp === 'SWT'" @click="handleSWTDetail(scope.$index, scope.row)" size="small" style="margin-left: 10px;" type="primary">
                详情
              </el-button>
            </div>
          </template>
        </el-table-column>
      </el-table>
    </c-col>
    <c-col :span="24" style="margin-top:20px">
      <c-collapse v-model="activeNames">
        <el-collapse-item title="关联报文/面函" name="fft">
          <smh-message :objtyp="smhObjtyp" :objinr="smhObjinr" :smhinr="getSmhinr"></smh-message>
        </el-collapse-item>
        <el-collapse-item title="LOA/NOA报文" name="fftmsg" v-if="isVisibledFftBund">
          <fft-message :objtyp="smhObjtyp" :objinr="smhObjinr" :ownref="getOwnref" :bpdinr="getBpdinr" :ordinr="getOrdinr"></fft-message>
        </el-collapse-item>
      </c-collapse>
    </c-col>
    <!-- 预览弹框 -->
    <message-view ref="msgView" :model="model" :ownref="objInfo.ownref"></message-view>
    <!-- 详情弹框 -->
    <!-- <docpan-dialog :docpanDialog="docpanDialog" @docpanQueryFunc="docpanQueryFunc" ref="docpanDialog" /> -->

    <!-- SWT详情弹框 -->
    <swift-dialog :docpanDialog="docpanDialog" @docpanQueryFunc="docpanQueryFunc" ref="swtDocpanDialog" />
    <letter-dialog :docpanDialog="docpanDialog" @docpanQueryFunc="docpanQueryFunc" ref="letDocpanDialog" />

  </c-row>
</template>
<script>
import Api from "~/service/Api";
import commonDepend from "~/mixin/commonDepend.js";
// import DocpanDialog from "./DocpanDialog.vue";
import SwiftDialog from "./SwiftDialog";
import LetterDialog from "./LetterDialog";

import { cloneDeep } from "lodash";
import MessageView from "./MessageView";
import SmhMessage from "./SmhMessage";
import FftBundMessage from "./FftBundMessage";
import Print from "print-js";
import { setTimeout, setInterval, clearInterval } from "timers";
import event from "../event";

export default {
  inject: ["root"],
  mixins: [commonDepend, event],
  components: {
    MessageView,
    SmhMessage,
    SwiftDialog,
    LetterDialog,
    "fft-message": FftBundMessage
  },
  props: ["model", "codes"],
  data() {
    return {
      index: 0,
      docpanIndex: 0,
      docpanDialog: {},
      centerDialogVisible: true,
      activeNames: ["fft", "fftmsg"]
    };
  },
  computed: {
    isDispaly() {
      return this.$store.state.Status.mode === "display";
    },
    objInfo() {
      return this.root.buildCommonData(this.model, this.root.transName).rec;
    },
    noPrint() {
      return this.isDispaly && this.$route.query.noPrint == "Y";
    },
    smhObjtyp() {
      //如果子业务新开,则取父业务的
      //兼容一期保函
      if (this.objInfo.objinr == "" && this.objInfo.gidinr) {
        return "GID";
      }
      if (this.objInfo.objinr == "" && this.objInfo.nidinr) {
        return "NID";
      }
      //二期新开,取父业务
      if (this.objInfo.objinr == "" && this.objInfo.pnttyp) {
        return this.objInfo.pnttyp;
      }
      return this.objInfo.objtyp;
    },
    smhObjinr() {
      //如果子业务新开,则取父业务的
      //兼容一期保函
      if (this.objInfo.objinr == "" && this.objInfo.gidinr) {
        return this.objInfo.gidinr;
      }
      if (this.objInfo.objinr == "" && this.objInfo.nidinr) {
        return this.objInfo.nidinr;
      }
      //二期新开,取父业务
      if (this.objInfo.objinr == "" && this.objInfo.pntinr) {
        return this.objInfo.pntinr;
      }
      return this.objInfo.objinr;
    },
    getSmhinr() {
      //当前交易来报smhinr
      return this.model.spt ? this.model.spt.smhinr : "";
    },
    getOrdinr() {
      //当前交易来报smhinr
      return this.model.spt ? this.model.spt.ordinr : "";
    },
    getOwnref() {
      return this.model.bpdgrp.rec.ownref ? this.model.bpdgrp.rec.ownref : "";
    },
    getBpdinr() {
      return this.model.bpdgrp.rec.inr ? this.model.bpdgrp.rec.inr : "";
    },
    isVisibledFftBund() {
      if (this.model.bpdgrp && this.model.bpdgrp.rec.fortyp === "2") {
        return true;
      } else {
        return false;
      }
    }
  },
  methods: {
    handleDisplay(index, row) {
      this.$refs.msgView.handleDisplay(index, row);
    },
    printContent(index, row) {
      this.$refs.msgView.printContent(index, row);
    },
    // 详情
    handleSWTDetail(index, row) {
      this.docpanIndex = index;
      this.$refs.swtDocpanDialog.centerDialogVisible = true;
      this.docpanDialog = cloneDeep(row);
      this.$nextTick(() => {
        this.$refs.swtDocpanDialog.init();
      });
    },
    // 详情
    handleLETDetail(index, row) {
      this.docpanIndex = index;
      this.$refs.letDocpanDialog.centerDialogVisible = true;
      this.docpanDialog = cloneDeep(row);
      this.$nextTick(() => {
        this.$refs.letDocpanDialog.init();
      });
    },
    //详情回调
    docpanQueryFunc(val) {
      if (val.modifySet) {
        val.modifySet.forEach(element => {
          this.customAddModify(this.model.docpan.doceot[this.docpanIndex], element);
        });
      }
      this.$set(this.model.docpan.doceot[this.docpanIndex], "addtxt", val.addtxt);
      this.$set(this.model.docpan.doceot[this.docpanIndex], "addstr", val.addstr);
      this.$set(this.model.docpan.doceot[this.docpanIndex], "adrblk", val.adrblk);
      this.$set(this.model.docpan.doceot[this.docpanIndex], "tag79z", val.tag79z);
      if (val.cortyp === 'SWT') {
         if (this.model.docpan.doceot[this.docpanIndex].ptainr !== val.ptainr) {
           this.$set(this.model.docpan.doceot[this.docpanIndex], "ptainr", val.ptainr);
           //重新试算报文面函
           this.processTrndoc();
         }
      }
    },
    active(index, row) {
      if (row.delflg == "D") {
        row.delflg = " ";
      } else {
        row.delflg = "D";
      }
      this.customAddModify(row, "mdtflg");
      this.customAddModify(row, "delflg");
    },
    showButtonColor(tempObj){
      if(!this.isDispaly){
        return undefined
      }
      let propKey = 'delflg'
      if (tempObj.markSet && tempObj.markSet.length > 0 && tempObj.markSet.includes(propKey)) {
						return '3px solid red'
			}
			if (tempObj.markSetX && tempObj.markSetX.length > 0 && tempObj.markSetX.includes(propKey)) {
						return '3px solid green'
			}
    }
  },
  created() {}
};
</script>