Opnp.vue 6.74 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
<template>
	<div class="eibs-tab">
		<c-col :span="24">
			<c-col :span="12" style="padding-right: 20px;">
				<c-col :span="24">
					<el-form-item label="业务编号" prop="fcdgrp.rec.ownref">
						<c-fullbox>
							<c-input disabled maxlength="16" placeholder="请输入保函编号" v-model="model.fcdgrp.rec.ownref"></c-input>
							<template slot="footer">
								<c-button :disabled="model.fcdgrp.apl.pts.ptainr === '' || model.trmtyp === ''" @click="queryOwnref" size="small" style="margin: 0 0" type="primary">
									获取
								</c-button>
							</template>
						</c-fullbox>
					</el-form-item>
				</c-col>
				<c-col :span="24">
					<c-ptap :argadr="{title: '申请人', grp: 'fcdgrp', rol: 'apl'}" :disabled="true" :haveAdrLabel="true" :isAdrVisible="false" :isAdrblk="false" :model="model" :noRef='true' @handleChange="getCshVoList" bchinr='00000047' chooseLanguage="CN" ptytyp="C"></c-ptap>
				</c-col>
			</c-col>
			<c-col :span="12" style="padding-left: 20px;">
				<c-col :span="24">
					<c-col :span="13">
						<el-form-item label="保证金科目" prop="trmtyp">
							<c-select @change="changeTrmtyp" placeholder="请选择科目" v-model="model.trmtyp">
								<el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in codes.yewudh" />
							</c-select>
						</el-form-item>
					</c-col>

					<c-col :span="11">
						<el-form-item label="账号" label-width="75px" prop="cashacc">
							<c-select :allow-create="true" :default-first-option="true" :filterable="true" @blur="autoAssign($event)" @change="defaultCashacc" placeholder="请选择保证金账号" v-model="model.cashacc">
								<el-option :key="index" :label="item.label" :value="item.value" v-for="(item, index) in cashaccList">
								</el-option>
							</c-select>
						</el-form-item>
					</c-col>

				</c-col>

				<c-col :span="24">
					<c-fullbox>
						<c-col :span="11">
							<el-form-item label="金额" prop="cashcur">
								<c-select @change="getCashacc" dbCode="curtxt" placeholder="请选择币种" sort="SRT" style="width: 100%" v-model="model.cashcur">
								</c-select>
							</el-form-item>
						</c-col>

						<c-col :span="13">
							<el-form-item label="" label-width="5px" prop="cashamt">
								<c-input-currency :currency="model.cashcur" :disabled="isTimeMargin" placeholder="请输入金额" v-model="model.cashamt"></c-input-currency>
							</el-form-item>
						</c-col>
						<template slot="footer">
							<c-button :disabled="model.cashacc === ''" @click="getCashamt" size="small" style="margin-left: 10px; padding: 0 12px" type="primary" v-if="isTimeMargin">
								获取
							</c-button>
							<c-button :disabled="model.cashacc === ''" @click="call_8023" size="small" style="margin-left: 10px; padding: 0 12px" type="primary" v-else>
								查询
							</c-button>
						</template>
					</c-fullbox>
				</c-col>
				<c-col :span="24">

				</c-col>
				<c-col :span="24">
					<c-col :span="16">
						<el-form-item label="说明" prop="reason">
							<c-input maxlength="40" placeholder="请输入说明" v-model="model.reason"></c-input>
						</el-form-item>
					</c-col>
					<c-col :span="3">
						<el-form-item label="" label-width="0px" prop="gleflg">
							<c-checkbox :disabled="isTimeMargin" false-label="N" true-label="Y" v-model="model.gleflg">是否过账
							</c-checkbox>
						</el-form-item>
					</c-col>
					<c-col :span="5">
						<el-form-item label-width="0px" prop="showFlg">
							<c-checkbox false-label="" true-label="X" v-model="model.showFlg">查看历史保证金</c-checkbox>
						</el-form-item>
					</c-col>
				</c-col>
			</c-col>
		</c-col>
		<el-col :span="24" v-if="model.showFlg ==='X'" style="margin-top: 10px;margin-bottom: 10px;">
			<c-button @click="exportExcel" class="medium_bcs" size="medium" style="margin-left: 20px;" type="success">
				导出Excel
			</c-button>
		</el-col>
		<c-col :span="24" v-if="model.showFlg ==='X'">
			<el-table :data="model.cshVoList" :highlight-current-row="true" size="medium" style="width:100%" v-loading="load">
				<!--                <el-table-column align="left" label="INR" prop="inr" width="150"/>-->
				<el-table-column align="left" label="业务编号" prop="ownref" width="150">
					<template slot-scope="scope">
						<div style="text-align: left;">{{scope.row.ownref}}</div>
					</template>
				</el-table-column>
				<el-table-column align="left" label="收取日期" prop="credat" width="150" />
				<el-table-column align="left" label="币种" prop="cur" width="100" />
				<el-table-column align="left" label="金额" prop="amt" width="150">
					<template slot-scope="scope">
						<span> {{moneyFormat(scope.row.amt, scope.row.cur) }}
						</span>
					</template>
				</el-table-column>
				<!--                <el-table-column align="left" label="机构号" prop="extact" width="150"/>-->
				<el-table-column :formatter="formatEngact" align="left" label="保证金账号" prop="engact" width="200" />
				<el-table-column :formatter="formatGleflg" align="left" label="是否过账" prop="gleflg" width="100" />
				<el-table-column :formatter="formatRelflg" align="left" label="是否到账" prop="relflg" width="100" />
				<el-table-column :formatter="formatUseflg" align="left" label="是否被用" prop="useflg" width="100" />
				<el-table-column align="left" label="说明" min-width="150" prop="reason" />
				<el-table-column align="left" label="被用在交易" prop="regref" width="150" />
			</el-table>
      <el-pagination layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" :page-size="pagination.pageSize" :current-page="pagination.pageNum" @size-change="handleSizeChange" @current-change="currentChange">
      </el-pagination>
		</c-col>
	</div>
</template>
<script>
import event from "../event";
import Default from "../model/default";

export default {
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [event, Default],
  data() {
    return {
      load: false,
      cashaccList: [],
      pagination: {
        pageNum: 1,
        pageSize: 10,
        total: 0
      },
    };
  },
  methods: {
    formatEngact(row, column) {
      return row.extact + row.engact;
    },
    formatGleflg(row, column) {
      if (row.gleflg === "Y") return "是";
      if (row.gleflg === "N") return "否";
    },
    formatRelflg(row, column) {
      if (row.relflg === "Y") return "是";
      if (row.relflg === "N") return "否";
    },
    formatUseflg(row, column) {
      if (row.useflg === "U") return "是";
      if (row.useflg === "N") return "否";
    }
  },
  computed:{
    isTimeMargin(){
      if ( this.model.trmtyp === '0432' || this.model.trmtyp === '0436'
        || this.model.trmtyp === '1438' || this.model.trmtyp === '1422') {
          return true; 
      }
      return false;
    }
  },
};
</script>
<style>
</style>