<template>
	<el-dialog title="废品详情" v-model="visible" width="900px" height="400px" @close="close" append-to-body draggable  style="font-size: 14px;">
		<el-table ref="dialogTable" :data="recordsList" size="small" v-loading="loading" border height="500px" header-row-class-name="list-header-row" row-class-name="list-row" >
			<el-table-column label="工序" align="center" prop="processAlias" />
			<el-table-column
              label="类型"
              width="150px"
              align="center"
              prop="dayworkAuxiliaryItemId"
            >
              <template #default="scope">
                <dict-tag
                  :options="is_auxiliary_reject"
                  :value="scope.row.dayworkAuxiliaryItemId"
                />
              </template>
            </el-table-column>
			<el-table-column label="废品原因" align="center" prop="reason" />
			<el-table-column label="废品数量" align="center" prop="rejectNum" />
			<el-table-column label="提交人" align="center" prop="nickName" />
			<el-table-column label="提交时间" align="center" prop="createTime" />
		</el-table>
	</el-dialog>
</template>
<script setup>
import { rejectRecords } from "@/api/business/dayworkItemReject";
/** 历史记录变量 */
const recordsList = ref([])
const visible = ref(false)
const loading = ref(false)
const { proxy } = getCurrentInstance();
const { is_auxiliary_reject } = proxy.useDict("is_auxiliary_reject");
/**
 * 对话框打开 事件
 */
function open(data) {
	visible.value = true
	rejectRecords(data).then(res =>{
		recordsList.value = res.rows
	})
	console.log(data)
}

/**
 * 对话框关闭 事件
 */
function close() {
	visible.value = false
}

defineExpose({
	open
})
</script>
<style scoped>
.el-table--small {
    font-size: 14px;
}</style>
