<template>
	<div>
		<div class="title">费用明细</div>
		<div class="e-table-wrapper">
			<el-table
				:data="model.setmod.setfeg.fegmod.feslst"
				style="width: 100%"
				>
				<el-table-column
					prop="rol"
					label="角色"
					width="100">
				</el-table-column>
				<el-table-column
					prop="feecod"
					label="费用代码"
					width="150"
					>
				</el-table-column>
				<el-table-column
					prop="feetxt"
					label="费用名称"
					width="200">
		<!-- <template slot-scope="scope">
						<span>{{ findCodeLabel(codes.feecod,scope.row.feecod) }}</span>
					</template> -->
				</el-table-column>
				<el-table-column
					prop="cur"
					label="收费币种"
					width="150">
				</el-table-column>
				<el-table-column
					prop="basamt"
					label="应收金额"
					width="150">
				</el-table-column>
				<el-table-column
					prop="amt"
					label="实收金额"
					width="150">
				</el-table-column>
				<el-table-column
					prop="dsp"
					label="现收/缓收"
					width="150">
				</el-table-column>
				<el-table-column
					prop="payflg"
					label="内扣/外收"
					width="150">
				</el-table-column>
				<el-table-column
					prop=""
					label="操作"
					width="150">
					<template slot-scope="scope">
						<el-button type="text" size="small">查看</el-button>
						<el-button type="text" size="small">编辑</el-button>
					</template>
				</el-table-column>
			</el-table>
		</div>
		<el-button plain class="add-btn" @click="handleClickFeslst">+</el-button>
		<div class="title">财务明细</div>
		<div class="e-table-wrapper">
			<el-table
				:data="model.setmod.setglg.glgmod.glslst"
				style="width: 100%"
				>
				<el-table-column
					prop="debcdtflg"
					label="借/贷">
				</el-table-column>
				<el-table-column
					prop="cur"
					label="结算币种">
				</el-table-column>
				<el-table-column
					prop="amt"
					label="结算金额">
				</el-table-column>
				<el-table-column
					prop="dsp"
					label="结算方式">
				</el-table-column>
				<el-table-column
					prop="act"
					label="账户">
				</el-table-column>
				<el-table-column
					prop="acccur"
					label="原币种">
				</el-table-column>
				<el-table-column
					prop="accamt"
					label="原金额">
				</el-table-column>
				<el-table-column
					prop="rat"
					label="汇率">
				</el-table-column>
			</el-table>
		</div>
		<el-button plain class="add-btn" @click="handleClickGlslst">+</el-button>
		<el-dialog
      :visible.sync="feslstVisible"
      width="30%">
      <span slot="title"></span>
      <m-feslst-detail
        v-bind:model="feslst"
        v-bind:codes="codes" />
      <span slot="footer" class="dialog-footer">
        <el-button @click="feslstVisible = false">取 消</el-button>
        <el-button type="primary" @click="addFeslst">确 定</el-button>
      </span>
    </el-dialog>
		<el-dialog
      :visible.sync="glslstVisible"
      width="30%">
      <span slot="title"></span>
      <m-glslst-detail
        v-bind:model="glslst"
        v-bind:codes="codes" />
      <span slot="footer" class="dialog-footer">
        <el-button @click="glslstVisible = false">取 消</el-button>
        <el-button type="primary" @click="addGlslst">确 定</el-button>
      </span>
    </el-dialog>
	</div>

</template>
<script>
import FeslstDetail from './FeslstDetail'
import GlslstDetail from './GlslstDetail'

export default {
	components: {
		'm-feslst-detail': FeslstDetail,
		'm-glslst-detail': GlslstDetail
	},
	props:['model', 'codes'],
	data: function () {
		return {
			feslstVisible: false,
			glslstVisible: false,
			feslst: {
				rol: '',
				feecod: '',
				feetxt: '',
				cur: '',
				basamt: '',
				amt: '',
				dsp: '',
				payflg: ''
			},
			glslst: {
				debcdtflg: '',
				cur: '',
				amt: '',
				dsp: '',
				act: '',
				acccur: '',
				accamt: '',
				rat: ''
			}
		}
	},
	methods: {
		addFeslst () {
			this.feslstVisible = false
			this.model.setmod.setfeg.fegmod.feslst.push(this.feslst)
			this.feslst = {
				rol: '',
				feecod: '',
				feetxt: '',
				cur: '',
				basamt: '',
				amt: '',
				dsp: '',
				payflg: ''
			}
		},
		addGlslst () {
			this.glslstVisible = false
			this.model.setmod.setglg.glgmod.glslst.push(this.glslst)
			this.glslst = {
				debcdtflg: '',
				cur: '',
				amt: '',
				dsp: '',
				act: '',
				acccur: '',
				accamt: '',
				rat: ''
			}
		},
		handleClickFeslst () {
			this.feslstVisible = true
		},
		handleClickGlslst () {
			this.glslstVisible = true
		}
	}
}
</script>
<style scoped>
.title {
	color: rgba(0, 0, 0, 0.65);
	font-size: 14px;
	padding-bottom: 10px;
}
.add-btn {
	margin: 12px 0;
	text-align: center;
	width: 100%;
	color: #ccc;
}
</style>