<template>
    <div>
        <el-descriptions :column="2" border>
            <el-descriptions-item label="创建者">{{ form.nickName }}</el-descriptions-item>
            <el-descriptions-item label="创建时间">
                <span>{{ parseTime(form.createTime) }}</span>
            </el-descriptions-item>
            <!-- <el-descriptions-item label="维保申请编号" :span="2">
                {{ form.maintenanceApplyId }}
            </el-descriptions-item> -->
            <el-descriptions-item label="状态" :span="2">
                <dict-tag :options="com_apply_state" :value="form.state" />
            </el-descriptions-item>
            <el-descriptions-item label="说明" :span="2">{{ form.maintenanceApplyExplain }}</el-descriptions-item>
        </el-descriptions>
        <el-divider content-position="center">
            维保记录详情列表
        </el-divider>
        <Index :list="form.maintenanceApplyDetailsList" :editable="false" />
    </div>
</template>

<script setup>
import Index from "@/components/MaintenanceApplyDetails/index";
import { listRole } from "@/api/system/role";
import { listDept } from "@/api/system/dept";
const { proxy } = getCurrentInstance();
const { com_apply_state } = proxy.useDict('com_apply_state');
const props = defineProps({
    form: {
        type: [Object],
        default: null,
    },
});
const { form } = toRefs(props);

const roleList = ref([]);
const deptList = ref([]);

listDept({
    pageNum: 1,
    pageSize: 9999,
}).then(response => {
    deptList.value = response.data;
});
listRole(proxy.addDateRange({
    pageNum: 1,
    pageSize: 9999,
}, undefined)).then(response => {
    roleList.value = response.rows;
});
</script>