<template>
	<view class="bzxx-list-page">
		<view class="bz-new-btn-box" v-if="list.length>0">
			<button type="default" class="phone-green-btn" @click="addBanzheng">添加</button>
		</view>
		<view class="bzxx-wrap-box" v-if="list.length>0">
			<view v-for="(item,index) in list" :key="index" class="bzxx-card-box">
				<view class="name-btn-box">
					<view class="jg-name">报证机构:{{item.jgName}}</view>
					<view class="name-btn editer-btn" @click="goEdit(item,index)">编辑</view>
					<view class="name-btn delete-btn" @click="deleteFun(item,index)">删除</view>
				</view>
				<view class="bzxx-zy-row"><icon class="zy-icon"></icon>职业名称：<text>{{item.zyName}}</text></view>
				<view class="bzxx-zy-row"><icon class="zydj-icon"></icon>职业等级：<text>{{item.zyLevelName}}</text></view>
				<view class="bzxx-time-row"><icon class="time-icon"></icon><text>申报时间：{{item.createTime}}</text></view>
			</view>
		</view>
		<view v-if="list.length>0 && status!='edit'" class="bzxx-btn-box">
			<button type="default" v-if="status!='edit'"  @click="saveBanzheng" class="phone-green-btn">保存</button>
		</view>
		<view v-if="list.length==0" class="bzxx-add-btn-box">
			<view  @click="addBanzheng" class="bzxx-add-btn"><text>+</text>添加办证信息</view>
		
		</view>
		<view v-if="status =='add'" class="page-btn-box">
			<button type="default" @click="saveBanzheng" class="phone-green-btn">保存</button>
		</view>
	</view>
</template>

<script>
	import {
		getBaozhengJigou,
		getJiazhengLevel,
		getJiazhengZhiye,
		getJiazhengBanzhengCheckKc
	} from "@/api/jiazheng.js"
	export default {
		data() {
			return {

			};
		},
		props: {
			list: {
				type: Array,
				default: () => []
			},
			status: {
				type: String,
			}
		},
		computed: {

		},
		created() {

		},
		methods: {
			addBanzheng() {
				this.$emit('addBanzheng');
			},
			saveBanzheng() {
				this.$emit('saveBanzheng');
			},
			goEdit(item, index) {
				this.$emit('editBanzheng', item, index);
			},
			deleteFun(item, index) {
				this.$emit('deleteBanzheng', item, index);
			}
		}
	};
</script>