¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-card class="box-card"> |
| | | <template #header> |
| | | <div class="card-header"> |
| | | <span>åå
¬ç©èµç³è¯·ç®¡ç</span> |
| | | <el-button type="primary" @click="showApplyDialog = true"> |
| | | <el-icon><Plus /></el-icon> |
| | | æ°å»ºç³è¯· |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | |
| | | <!-- æç´¢åºå --> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> |
| | | <el-form-item label="ç³è¯·ç¼å·" prop="applyNo"> |
| | | <el-input |
| | | v-model="queryParams.applyNo" |
| | | placeholder="请è¾å
¥ç³è¯·ç¼å·" |
| | | clearable |
| | | style="width: 200px" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç³è¯·äºº" prop="applicant"> |
| | | <el-input |
| | | v-model="queryParams.applicant" |
| | | placeholder="请è¾å
¥ç³è¯·äºº" |
| | | clearable |
| | | style="width: 200px" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç³è¯·ç¶æ" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="è¯·éæ©ç¶æ" clearable style="width: 200px"> |
| | | <el-option label="å¾
审æ¹" value="pending" /> |
| | | <el-option label="å·²éè¿" value="approved" /> |
| | | <el-option label="å·²æç»" value="rejected" /> |
| | | <el-option label="已忾" value="issued" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleQuery"> |
| | | <el-icon><Search /></el-icon> |
| | | æç´¢ |
| | | </el-button> |
| | | <el-button @click="resetQuery"> |
| | | <el-icon><Refresh /></el-icon> |
| | | éç½® |
| | | </el-button> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleExport"> |
| | | <el-icon><Download /></el-icon> |
| | | å¯¼åº |
| | | </el-button> |
| | | <el-button type="success" @click="handleBatchApprove" :disabled="multipleSelection.length === 0"> |
| | | <el-icon><Check /></el-icon> |
| | | æ¹éå®¡æ¹ |
| | | </el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <!-- è¡¨æ ¼åºå --> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="suppliesList" |
| | | @selection-change="handleSelectionChange" |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="ç³è¯·ç¼å·" align="center" prop="applyNo" width="180" /> |
| | | <el-table-column label="ç³è¯·äºº" align="center" prop="applicant" width="120" /> |
| | | <el-table-column label="é¨é¨" align="center" prop="department" width="120" /> |
| | | <el-table-column label="ç©èµç±»å" align="center" prop="supplyType" width="120" /> |
| | | <el-table-column label="ç³è¯·æ°é" align="center" prop="quantity" width="100" /> |
| | | <el-table-column label="ç³è¯·åå " align="center" prop="reason" min-width="200" show-overflow-tooltip /> |
| | | <el-table-column label="ç³è¯·ç¶æ" align="center" prop="status" width="100"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusType(scope.row.status)"> |
| | | {{ getStatusText(scope.row.status) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç³è¯·æ¶é´" align="center" prop="applyTime" width="180" /> |
| | | <el-table-column label="审æ¹äºº" align="center" prop="approver" width="120" /> |
| | | <el-table-column label="å®¡æ¹æ¶é´" align="center" prop="approveTime" width="180" /> |
| | | <el-table-column label="åæ¾æ¶é´" align="center" prop="issueTime" width="180" /> |
| | | <el-table-column label="æä½" align="center" fixed="right" class-name="small-padding fixed-width" width="200"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | v-if="scope.row.status === 'pending'" |
| | | type="primary" |
| | | link |
| | | @click="handleApprove(scope.row)" |
| | | > |
| | | å®¡æ¹ |
| | | </el-button> |
| | | <el-button |
| | | v-if="scope.row.status === 'approved'" |
| | | type="success" |
| | | link |
| | | @click="handleIssue(scope.row)" |
| | | > |
| | | åæ¾ |
| | | </el-button> |
| | | <el-button |
| | | type="info" |
| | | link |
| | | @click="handleDetail(scope.row)" |
| | | > |
| | | 详æ
|
| | | </el-button> |
| | | <el-button |
| | | v-if="scope.row.status === 'pending'" |
| | | type="danger" |
| | | link |
| | | @click="handleDelete(scope.row)" |
| | | > |
| | | å é¤ |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <!-- å页 --> |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </el-card> |
| | | |
| | | <!-- ç³è¯·å¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | v-model="showApplyDialog" |
| | | title="åå
¬ç©èµç³è¯·" |
| | | width="600px" |
| | | append-to-body |
| | | > |
| | | <el-form ref="applyFormRef" :model="applyForm" :rules="applyRules" label-width="100px"> |
| | | <el-form-item label="ç©èµç±»å" prop="supplyType"> |
| | | <el-select v-model="applyForm.supplyType" placeholder="è¯·éæ©ç©èµç±»å" style="width: 100%"> |
| | | <el-option label="åå
¬ç¨å" value="office" /> |
| | | <el-option label="çµå设å¤" value="electronic" /> |
| | | <el-option label="æ¸
æ´ç¨å" value="cleaning" /> |
| | | <el-option label="å
¶ä»" value="other" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å
·ä½ç©å" prop="itemName"> |
| | | <el-input v-model="applyForm.itemName" placeholder="请è¾å
¥å
·ä½ç©ååç§°" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç³è¯·æ°é" prop="quantity"> |
| | | <el-input-number v-model="applyForm.quantity" :min="1" :max="999" style="width: 100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç³è¯·åå " prop="reason"> |
| | | <el-input |
| | | v-model="applyForm.reason" |
| | | type="textarea" |
| | | :rows="3" |
| | | placeholder="请è¾å
¥ç³è¯·åå " |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç´§æ¥ç¨åº¦" prop="urgency"> |
| | | <el-radio-group v-model="applyForm.urgency"> |
| | | <el-radio label="normal">æ®é</el-radio> |
| | | <el-radio label="urgent">ç´§æ¥</el-radio> |
| | | <el-radio label="very_urgent">é常紧æ¥</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="showApplyDialog = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="submitApply">ç¡® å®</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <!-- 审æ¹å¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | v-model="showApproveDialog" |
| | | title="审æ¹ç³è¯·" |
| | | width="500px" |
| | | append-to-body |
| | | > |
| | | <el-form ref="approveFormRef" :model="approveForm" :rules="approveRules" label-width="100px"> |
| | | <el-form-item label="审æ¹ç»æ" prop="approveResult"> |
| | | <el-radio-group v-model="approveForm.approveResult"> |
| | | <el-radio label="approved">éè¿</el-radio> |
| | | <el-radio label="rejected">æç»</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="å®¡æ¹æè§" prop="approveComment"> |
| | | <el-input |
| | | v-model="approveForm.approveComment" |
| | | type="textarea" |
| | | :rows="3" |
| | | placeholder="请è¾å
¥å®¡æ¹æè§" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="showApproveDialog = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="submitApprove">ç¡® å®</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <!-- 详æ
å¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | v-model="showDetailDialog" |
| | | title="ç³è¯·è¯¦æ
" |
| | | width="700px" |
| | | append-to-body |
| | | > |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="ç³è¯·ç¼å·">{{ currentDetail.applyNo }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·äºº">{{ currentDetail.applicant }}</el-descriptions-item> |
| | | <el-descriptions-item label="é¨é¨">{{ currentDetail.department }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç©èµç±»å">{{ currentDetail.supplyType }}</el-descriptions-item> |
| | | <el-descriptions-item label="å
·ä½ç©å">{{ currentDetail.itemName }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·æ°é">{{ currentDetail.quantity }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·åå " :span="2">{{ currentDetail.reason }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·ç¶æ"> |
| | | <el-tag :type="getStatusType(currentDetail.status)"> |
| | | {{ getStatusText(currentDetail.status) }} |
| | | </el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·æ¶é´">{{ currentDetail.applyTime }}</el-descriptions-item> |
| | | <el-descriptions-item label="审æ¹äºº">{{ currentDetail.approver || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å®¡æ¹æ¶é´">{{ currentDetail.approveTime || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å®¡æ¹æè§" :span="2">{{ currentDetail.approveComment || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="åæ¾æ¶é´">{{ currentDetail.issueTime || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="åæ¾äºº">{{ currentDetail.issuer || '-' }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { Plus, Search, Refresh, Download, Check } from '@element-plus/icons-vue' |
| | | |
| | | // ååºå¼æ°æ® |
| | | const loading = ref(false) |
| | | const showSearch = ref(true) |
| | | const showApplyDialog = ref(false) |
| | | const showApproveDialog = ref(false) |
| | | const showDetailDialog = ref(false) |
| | | const multipleSelection = ref([]) |
| | | const total = ref(0) |
| | | const suppliesList = ref([]) |
| | | const currentDetail = ref({}) |
| | | |
| | | // æ¥è¯¢åæ° |
| | | const queryParams = reactive({ |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | applyNo: '', |
| | | applicant: '', |
| | | status: '' |
| | | }) |
| | | |
| | | // ç³è¯·è¡¨å |
| | | const applyForm = reactive({ |
| | | supplyType: '', |
| | | itemName: '', |
| | | quantity: 1, |
| | | reason: '', |
| | | urgency: 'normal' |
| | | }) |
| | | |
| | | // 审æ¹è¡¨å |
| | | const approveForm = reactive({ |
| | | approveResult: 'approved', |
| | | approveComment: '' |
| | | }) |
| | | |
| | | // è¡¨åæ ¡éªè§å |
| | | const applyRules = { |
| | | supplyType: [{ required: true, message: 'è¯·éæ©ç©èµç±»å', trigger: 'change' }], |
| | | itemName: [{ required: true, message: '请è¾å
¥å
·ä½ç©ååç§°', trigger: 'blur' }], |
| | | quantity: [{ required: true, message: '请è¾å
¥ç³è¯·æ°é', trigger: 'blur' }], |
| | | reason: [{ required: true, message: '请è¾å
¥ç³è¯·åå ', trigger: 'blur' }] |
| | | } |
| | | |
| | | const approveRules = { |
| | | approveResult: [{ required: true, message: 'è¯·éæ©å®¡æ¹ç»æ', trigger: 'change' }], |
| | | approveComment: [{ required: true, message: '请è¾å
¥å®¡æ¹æè§', trigger: 'blur' }] |
| | | } |
| | | |
| | | // åæ°æ® |
| | | const mockData = [ |
| | | { |
| | | id: 1, |
| | | applyNo: 'WS20241201001', |
| | | applicant: 'éå¿å¼º', |
| | | department: 'ææ¯é¨', |
| | | supplyType: 'åå
¬ç¨å', |
| | | itemName: 'A4æå°çº¸', |
| | | quantity: 10, |
| | | reason: 'æ¥å¸¸åå
¬æå°éè¦', |
| | | status: 'pending', |
| | | applyTime: '2025-12-01 09:30:00', |
| | | approver: '', |
| | | approveTime: '', |
| | | approveComment: '', |
| | | issueTime: '', |
| | | issuer: '' |
| | | }, |
| | | { |
| | | id: 2, |
| | | applyNo: 'WS20241201002', |
| | | applicant: 'åé
å©·', |
| | | department: '人äºé¨', |
| | | supplyType: 'çµå设å¤', |
| | | itemName: 'æ çº¿é¼ æ ', |
| | | quantity: 2, |
| | | reason: 'æ°åå·¥å
¥èé
å¤', |
| | | status: 'approved', |
| | | applyTime: '2025-12-01 10:15:00', |
| | | approver: 'ç建å½', |
| | | approveTime: '2025-12-01 14:20:00', |
| | | approveComment: 'åæç³è¯·ï¼è¯·åæ¶åæ¾', |
| | | issueTime: '', |
| | | issuer: '' |
| | | }, |
| | | { |
| | | id: 3, |
| | | applyNo: 'WS20241201003', |
| | | applicant: 'ç建å½', |
| | | department: 'è´¢å¡é¨', |
| | | supplyType: 'æ¸
æ´ç¨å', |
| | | itemName: 'æ´ææ¶²', |
| | | quantity: 5, |
| | | reason: 'åå
¬å®¤æ¸
æ´ç¨åè¡¥å
', |
| | | status: 'issued', |
| | | applyTime: '2025-12-01 11:00:00', |
| | | approver: 'åé
å©·', |
| | | approveTime: '2025-12-01 15:30:00', |
| | | approveComment: 'åæç³è¯·', |
| | | issueTime: '2025-12-01 16:00:00', |
| | | issuer: 'é±ä¼æ' |
| | | }, |
| | | { |
| | | id: 4, |
| | | applyNo: 'WS20241201004', |
| | | applicant: '赵丽å', |
| | | department: 'å¸åºé¨', |
| | | supplyType: 'å
¶ä»', |
| | | itemName: 'æä»¶å¤¹', |
| | | quantity: 20, |
| | | reason: '项ç®èµææ´çéè¦', |
| | | status: 'rejected', |
| | | applyTime: '2025-12-01 13:45:00', |
| | | approver: 'éå¿å¼º', |
| | | approveTime: '2025-12-01 17:00:00', |
| | | approveComment: 'æ°éè¿å¤ï¼å»ºè®®åå°å°10个', |
| | | issueTime: '', |
| | | issuer: '' |
| | | }, |
| | | { |
| | | id: 5, |
| | | applyNo: 'WS20241202001', |
| | | applicant: 'é±ä¼æ', |
| | | department: 'è¿è¥é¨', |
| | | supplyType: 'åå
¬ç¨å', |
| | | itemName: 'ç¾åç¬', |
| | | quantity: 50, |
| | | reason: 'é¨é¨æ¥å¸¸åå
¬ç¨åè¡¥å
', |
| | | status: 'pending', |
| | | applyTime: '2025-12-02 08:30:00', |
| | | approver: '', |
| | | approveTime: '', |
| | | approveComment: '', |
| | | issueTime: '', |
| | | issuer: '' |
| | | }, |
| | | { |
| | | id: 6, |
| | | applyNo: 'WS20241202002', |
| | | applicant: 'åæå', |
| | | department: 'ææ¯é¨', |
| | | supplyType: 'çµå设å¤', |
| | | itemName: 'é®ç', |
| | | quantity: 3, |
| | | reason: 'æ°å工设å¤é
å¤', |
| | | status: 'approved', |
| | | applyTime: '2025-12-02 14:20:00', |
| | | approver: 'éå¿å¼º', |
| | | approveTime: '2025-12-02 16:00:00', |
| | | approveComment: 'åæç³è¯·', |
| | | issueTime: '', |
| | | issuer: '' |
| | | }, |
| | | { |
| | | id: 7, |
| | | applyNo: 'WS20241203001', |
| | | applicant: 'å¨ç¾ç²', |
| | | department: '人äºé¨', |
| | | supplyType: 'æ¸
æ´ç¨å', |
| | | itemName: '纸巾', |
| | | quantity: 30, |
| | | reason: 'åå
¬åºåæ¸
æ´ç¨åè¡¥å
', |
| | | status: 'issued', |
| | | applyTime: '2025-12-03 09:15:00', |
| | | approver: '赵丽å', |
| | | approveTime: '2025-12-03 10:30:00', |
| | | approveComment: 'åæç³è¯·', |
| | | issueTime: '2025-12-03 11:00:00', |
| | | issuer: 'åæå' |
| | | }, |
| | | { |
| | | id: 8, |
| | | applyNo: 'WS20241203002', |
| | | applicant: 'å´å¿å¼º', |
| | | department: 'è´¢å¡é¨', |
| | | supplyType: 'å
¶ä»', |
| | | itemName: '计ç®å¨', |
| | | quantity: 2, |
| | | reason: 'è´¢å¡æ ¸ç®å·¥ä½éè¦', |
| | | status: 'rejected', |
| | | applyTime: '2025-12-03 15:45:00', |
| | | approver: 'ç建å½', |
| | | approveTime: '2025-12-03 17:20:00', |
| | | approveComment: 'å·²æè®¡ç®å¨ï¼æä¸éè¦', |
| | | issueTime: '', |
| | | issuer: '' |
| | | } |
| | | ] |
| | | |
| | | // è·ååè¡¨æ°æ® |
| | | const getList = () => { |
| | | loading.value = true |
| | | // 模æå¼æ¥è¯·æ± |
| | | setTimeout(() => { |
| | | let filteredData = [...mockData] |
| | | |
| | | // æ ¹æ®æ¥è¯¢æ¡ä»¶è¿æ»¤ |
| | | if (queryParams.applyNo) { |
| | | filteredData = filteredData.filter(item => |
| | | item.applyNo.toLowerCase().includes(queryParams.applyNo.toLowerCase()) |
| | | ) |
| | | } |
| | | if (queryParams.applicant) { |
| | | filteredData = filteredData.filter(item => |
| | | item.applicant.toLowerCase().includes(queryParams.applicant.toLowerCase()) |
| | | ) |
| | | } |
| | | if (queryParams.status) { |
| | | filteredData = filteredData.filter(item => |
| | | item.status === queryParams.status |
| | | ) |
| | | } |
| | | |
| | | // æç³è¯·æ¶é´ååºæå |
| | | filteredData.sort((a, b) => new Date(b.applyTime) - new Date(a.applyTime)) |
| | | |
| | | total.value = filteredData.length |
| | | suppliesList.value = filteredData.slice( |
| | | (queryParams.pageNum - 1) * queryParams.pageSize, |
| | | queryParams.pageNum * queryParams.pageSize |
| | | ) |
| | | loading.value = false |
| | | }, 500) |
| | | } |
| | | |
| | | // æ¥è¯¢ |
| | | const handleQuery = () => { |
| | | queryParams.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | // éç½®æ¥è¯¢ |
| | | const resetQuery = () => { |
| | | queryParams.applyNo = '' |
| | | queryParams.applicant = '' |
| | | queryParams.status = '' |
| | | handleQuery() |
| | | } |
| | | |
| | | // å¤é |
| | | const handleSelectionChange = (selection) => { |
| | | multipleSelection.value = selection |
| | | } |
| | | |
| | | // è·åç¶æç±»å |
| | | const getStatusType = (status) => { |
| | | const statusMap = { |
| | | pending: 'warning', |
| | | approved: 'success', |
| | | rejected: 'danger', |
| | | issued: 'info' |
| | | } |
| | | return statusMap[status] || 'info' |
| | | } |
| | | |
| | | // è·åç¶æææ¬ |
| | | const getStatusText = (status) => { |
| | | const statusMap = { |
| | | pending: 'å¾
审æ¹', |
| | | approved: 'å·²éè¿', |
| | | rejected: 'å·²æç»', |
| | | issued: '已忾' |
| | | } |
| | | return statusMap[status] || status |
| | | } |
| | | |
| | | // æäº¤ç³è¯· |
| | | const submitApply = () => { |
| | | const newApply = { |
| | | id: mockData.length + 1, |
| | | applyNo: `WS${new Date().getTime()}`, |
| | | applicant: 'å½åç¨æ·', |
| | | department: 'ææ¯é¨', |
| | | supplyType: applyForm.supplyType, |
| | | itemName: applyForm.itemName, |
| | | quantity: applyForm.quantity, |
| | | reason: applyForm.reason, |
| | | status: 'pending', |
| | | applyTime: new Date().toLocaleString(), |
| | | approver: '', |
| | | approveTime: '', |
| | | approveComment: '', |
| | | issueTime: '', |
| | | issuer: '' |
| | | } |
| | | |
| | | mockData.unshift(newApply) |
| | | showApplyDialog.value = false |
| | | ElMessage.success('ç³è¯·æäº¤æå') |
| | | getList() |
| | | |
| | | // é置表å |
| | | Object.assign(applyForm, { |
| | | supplyType: '', |
| | | itemName: '', |
| | | quantity: 1, |
| | | reason: '', |
| | | urgency: 'normal' |
| | | }) |
| | | } |
| | | |
| | | // å®¡æ¹ |
| | | const handleApprove = (row) => { |
| | | currentDetail.value = row |
| | | showApproveDialog.value = true |
| | | } |
| | | |
| | | // æäº¤å®¡æ¹ |
| | | const submitApprove = () => { |
| | | const index = mockData.findIndex(item => item.id === currentDetail.value.id) |
| | | if (index !== -1) { |
| | | mockData[index].status = approveForm.approveResult |
| | | mockData[index].approver = 'å½å审æ¹äºº' |
| | | mockData[index].approveTime = new Date().toLocaleString() |
| | | mockData[index].approveComment = approveForm.approveComment |
| | | } |
| | | |
| | | showApproveDialog.value = false |
| | | ElMessage.success('审æ¹å®æ') |
| | | getList() |
| | | |
| | | // é置表å |
| | | Object.assign(approveForm, { |
| | | approveResult: 'approved', |
| | | approveComment: '' |
| | | }) |
| | | } |
| | | |
| | | // åæ¾ |
| | | const handleIssue = (row) => { |
| | | const index = mockData.findIndex(item => item.id === row.id) |
| | | if (index !== -1) { |
| | | mockData[index].status = 'issued' |
| | | mockData[index].issueTime = new Date().toLocaleString() |
| | | mockData[index].issuer = 'å½ååæ¾äºº' |
| | | } |
| | | |
| | | ElMessage.success('忾宿') |
| | | getList() |
| | | } |
| | | |
| | | // æ¥ç详æ
|
| | | const handleDetail = (row) => { |
| | | currentDetail.value = row |
| | | showDetailDialog.value = true |
| | | } |
| | | |
| | | // å é¤ |
| | | const handleDelete = (row) => { |
| | | ElMessageBox.confirm('确认å é¤è¯¥ç³è¯·åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const index = mockData.findIndex(item => item.id === row.id) |
| | | if (index !== -1) { |
| | | mockData.splice(index, 1) |
| | | } |
| | | ElMessage.success('å 餿å') |
| | | getList() |
| | | }) |
| | | } |
| | | |
| | | // æ¹éå®¡æ¹ |
| | | const handleBatchApprove = () => { |
| | | if (multipleSelection.value.length === 0) { |
| | | ElMessage.warning('è¯·éæ©è¦å®¡æ¹çè®°å½') |
| | | return |
| | | } |
| | | |
| | | ElMessageBox.confirm(`确认æ¹é审æ¹éä¸ç ${multipleSelection.value.length} æ¡è®°å½åï¼`, 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | multipleSelection.value.forEach(row => { |
| | | const index = mockData.findIndex(item => item.id === row.id) |
| | | if (index !== -1) { |
| | | mockData[index].status = 'approved' |
| | | mockData[index].approver = 'å½å审æ¹äºº' |
| | | mockData[index].approveTime = new Date().toLocaleString() |
| | | mockData[index].approveComment = 'æ¹é审æ¹éè¿' |
| | | } |
| | | }) |
| | | ElMessage.success('æ¹é审æ¹å®æ') |
| | | getList() |
| | | }) |
| | | } |
| | | |
| | | // å¯¼åº |
| | | const handleExport = () => { |
| | | ElMessage.success('导åºåè½å¼åä¸...') |
| | | } |
| | | |
| | | // 页é¢å è½½æ¶è·åæ°æ® |
| | | onMounted(() => { |
| | | getList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .app-container { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .card-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .mb8 { |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .dialog-footer { |
| | | text-align: right; |
| | | } |
| | | |
| | | :deep(.el-descriptions__label) { |
| | | width: 120px; |
| | | } |
| | | </style> |