SmhMessage.vue 3.21 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
<template>
	<div class="eibs-tab">
			
					<el-row>
			<div>
        <el-row>
          <el-col :span="3" style="text-align:left">
          <el-checkbox v-model="rcvSmh" true-label="X" false-label="" >历史/当前交易来报</el-checkbox>
          </el-col>
          <el-col :span="3" :offset="5" style="text-align:left">
          <el-checkbox v-model="allSmh" true-label="X" false-label="">历史交易往报/面函</el-checkbox>
          </el-col>
        </el-row>
        <br/>
        <br/> 
				<el-table :data="messageData" style="width: 100%">
					<el-table-column prop="nam" label="描述" :show-overflow-tooltip="true" width="300">
					</el-table-column>
          <el-table-column prop="crefrm" label="交易代码" width="150">
					</el-table-column>
          <el-table-column prop="creusr" label="创建人" width="150">
					</el-table-column>
					<el-table-column prop="cortyp" label="报文类型" width="150">
					</el-table-column>
					<el-table-column prop="credattim" label="时间" :show-overflow-tooltip="true" width="150">
					</el-table-column>
					<c-table-column fixed="right" prop="op" label="操作" width="">
						<template slot-scope="{ scope }">
							<el-button type="primary" @click="showMsg(scope.row)">查看</el-button>
						</template>
					</c-table-column>
				</el-table>
			</div>
		<!-- 报文 -->
      <message-view ref="msgView"></message-view>
	</el-row>
		</div>
	
</template>
<script>
import Api from "~/service/Api";
import MessageView from "./MessageView"

export default {
  props: {
    objtyp: {
      type: String,
      default: ""
    },
    objinr: {
      type: String,
      default: ""
    },
    smhinr: {
      type: String,
      default: ""
    }
  },
  components: {MessageView},
  data() {
    return {
      messageData: [],
      rcvmessageData: [],
      sndmessageData: [],
      opType: "",
      rcvSmh: "",
			allSmh: "",
			activeNames:'fft'
    };
  },
  mounted(){
    this.$nextTick(() => {
      this.rcvSmh = 'X';
      this.allSmh = 'X';
    })
  },
  methods: {
    async showMsg(row) {
      this.$refs.msgView.fileViewDispaly(-1,{smhinr:row.inr})
    },
    async querySmh(){
        this.messageData = []
        this.rcvmessageData = []
        this.sndmessageData = []
        if(this.rcvSmh){
          let params = {
            objtyp:this.objtyp,
            objinr:this.objinr,
            smhinr:this.smhinr,
          }
          let res = await Api.post(`/${this.moduleRouter()}/smhQuery/listRcvSmhByObj`, params);
          console.log(res);
          if (res.respCode == SUCCESS) {
            this.rcvmessageData = res.data
          }
        }

        if(this.allSmh){
          let params = {
            objtyp:this.objtyp,
            objinr:this.objinr
          }
          let res = await Api.post(`/${this.moduleRouter()}/smhQuery/listSndSmhByObj`, params);
          console.log(res);
          if (res.respCode == SUCCESS) {
            this.sndmessageData = res.data
          }
        }
       this.messageData = [...this.rcvmessageData, ...this.sndmessageData];
    }
   
  },
  watch:{
    "rcvSmh":function(){
      this.querySmh()
    },
    "allSmh":function(){
      this.querySmh()
    }
  }
};
</script>
<style scoped lang="less">
</style>