| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-card header="åºç¡æ°æ®æ£æµ"> |
| | | <el-checkbox-group v-model="selectedModules"> |
| | | <el-checkbox label="sales">é宿¨¡å</el-checkbox> |
| | | <el-checkbox label="purchase">éè´æ¨¡å</el-checkbox> |
| | | <el-checkbox label="quality">è´¨éæ¨¡å</el-checkbox> |
| | | </el-checkbox-group> |
| | | <div style="margin-top: 16px"> |
| | | <el-button type="primary" @click="handleCheck" :loading="checking"> |
| | | å¼å§æ£æµ |
| | | </el-button> |
| | | </div> |
| | | </el-card> |
| | | |
| | | <el-card v-if="checkResult" header="æ£æµç»æ" style="margin-top: 16px"> |
| | | <el-alert |
| | | :title="`éè¿ ${checkResult.passedItems} / ${checkResult.totalItems} 项`" |
| | | :type="checkResult.passedItems === checkResult.totalItems ? 'success' : 'warning'" |
| | | :closable="false" |
| | | show-icon |
| | | /> |
| | | <el-table :data="checkResult.items" style="margin-top: 12px" border> |
| | | <el-table-column prop="module" label="模å" width="100" /> |
| | | <el-table-column prop="itemName" label="æ£æµé¡¹" width="160" /> |
| | | <el-table-column prop="minRequired" label="æä½è¦æ±" width="80" align="center" /> |
| | | <el-table-column prop="currentCount" label="å½åæ°é" width="80" align="center" /> |
| | | <el-table-column label="ç¶æ" width="80" align="center"> |
| | | <template #default="{ row }"> |
| | | <el-tag :type="row.passed ? 'success' : 'danger'"> |
| | | {{ row.passed ? "éè¿" : "æªéè¿" }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="message" label="æç¤º" min-width="200" /> |
| | | </el-table> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import { dataCheck } from "@/api/mock/dataCheck.js"; |
| | | |
| | | const selectedModules = ref(["sales", "purchase", "quality"]); |
| | | const checking = ref(false); |
| | | const checkResult = ref(null); |
| | | |
| | | const handleCheck = async () => { |
| | | if (selectedModules.value.length === 0) { |
| | | ElMessage.warning("请è³å°éæ©ä¸ä¸ªæ¨¡å"); |
| | | return; |
| | | } |
| | | checking.value = true; |
| | | try { |
| | | const res = await dataCheck(selectedModules.value); |
| | | checkResult.value = res.data; |
| | | } finally { |
| | | checking.value = false; |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped></style> |