| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <el-form :model="searchForm" :inline="true"> |
| | | <el-form-item label="客æ·åç§°ï¼"> |
| | | <el-input |
| | | v-model="searchForm.customerName" |
| | | placeholder="请è¾å
¥å®¢æ·åç§°" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 200px" |
| | | @change="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æè®¿äººï¼"> |
| | | <el-input |
| | | v-model="searchForm.visitingPeople" |
| | | placeholder="请è¾å
¥æè®¿äºº" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 200px" |
| | | @change="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleQuery">æç´¢</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="table_list"> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | v-loading="tableLoading" |
| | | style="width: 100%" |
| | | height="calc(100vh - 18.5em)" |
| | | > |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="客æ·åç§°" prop="customerName" width="150" show-overflow-tooltip /> |
| | | <el-table-column label="è系人" prop="contact" width="120" show-overflow-tooltip /> |
| | | <el-table-column label="èç³»çµè¯" prop="contactPhone" width="140" show-overflow-tooltip /> |
| | | <el-table-column label="æè®¿ç®ç" prop="purposeVisit" width="150" show-overflow-tooltip /> |
| | | <el-table-column label="æè®¿æ¶é´" prop="purposeDate" width="180" show-overflow-tooltip /> |
| | | <el-table-column label="æè®¿å°ç¹" prop="visitAddress" min-width="200" show-overflow-tooltip /> |
| | | <el-table-column label="æè®¿äºº" prop="visitingPeople" width="120" show-overflow-tooltip /> |
| | | <el-table-column fixed="right" label="æä½" width="100" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="viewDetail(scope.row)">æ¥ç</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :page="page.current" |
| | | :limit="page.size" |
| | | @pagination="paginationChange" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 详æ
å¼¹çª --> |
| | | <el-dialog |
| | | v-model="detailVisible" |
| | | title="å®¢æ·æè®¿è®°å½è¯¦æ
" |
| | | width="600px" |
| | | @close="closeDetail" |
| | | > |
| | | <div class="content-container"> |
| | | <!-- 客æ·ä¿¡æ¯ --> |
| | | <div class="section"> |
| | | <div class="section-title">客æ·ä¿¡æ¯</div> |
| | | <div class="info-item"> |
| | | <span class="info-label">客æ·åç§°</span> |
| | | <span class="info-value">{{ detailForm.customerName || '-' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="info-label">è系人</span> |
| | | <span class="info-value">{{ detailForm.contact || '-' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="info-label">èç³»çµè¯</span> |
| | | <span class="info-value">{{ detailForm.contactPhone || '-' }}</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- æè®¿ä¿¡æ¯ --> |
| | | <div class="section"> |
| | | <div class="section-title">æè®¿ä¿¡æ¯</div> |
| | | <div class="info-item"> |
| | | <span class="info-label">æè®¿ç®ç</span> |
| | | <span class="info-value">{{ detailForm.purposeVisit || '-' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="info-label">æè®¿æ¶é´</span> |
| | | <span class="info-value">{{ detailForm.purposeDate || '-' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="info-label">æè®¿å°ç¹</span> |
| | | <span class="info-value multi-line">{{ detailForm.visitAddress || '-' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="info-label">æè®¿äºº</span> |
| | | <span class="info-value">{{ detailForm.visitingPeople || '-' }}</span> |
| | | </div> |
| | | <div class="info-item" v-if="detailForm.latitude && detailForm.longitude"> |
| | | <span class="info-label">ç»çº¬åº¦</span> |
| | | <span class="info-value">{{ detailForm.latitude }}, {{ detailForm.longitude }}</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 夿³¨ä¿¡æ¯ --> |
| | | <div class="section"> |
| | | <div class="section-title">夿³¨ä¿¡æ¯</div> |
| | | <div class="info-item remark-item"> |
| | | <span class="info-label">夿³¨</span> |
| | | <span class="info-value multi-line">{{ detailForm.remark || '-' }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="closeDetail">å
³é</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted, getCurrentInstance } from 'vue' |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { getVisitRecords } from '@/api/collaborativeApproval/customerVisit.js' |
| | | |
| | | const { proxy } = getCurrentInstance() |
| | | const tableData = ref([]) |
| | | const tableLoading = ref(false) |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | }) |
| | | const total = ref(0) |
| | | |
| | | // æç´¢è¡¨å |
| | | const searchForm = reactive({ |
| | | customerName: '', |
| | | visitingPeople: '', |
| | | }) |
| | | |
| | | // 详æ
ç¸å
³ |
| | | const detailVisible = ref(false) |
| | | const detailForm = ref({}) |
| | | |
| | | // æ¥è¯¢å表 |
| | | const handleQuery = () => { |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | |
| | | // å页åå |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page |
| | | page.size = obj.limit |
| | | getList() |
| | | } |
| | | |
| | | // è·ååè¡¨æ°æ® |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | getVisitRecords({ ...searchForm, ...page }) |
| | | .then((res) => { |
| | | tableLoading.value = false |
| | | if (res.code === 200) { |
| | | tableData.value = res.data?.records || res.records || [] |
| | | total.value = res.data?.total || res.total || 0 |
| | | } else { |
| | | proxy.$modal.msgError(res.msg || 'è·åæ°æ®å¤±è´¥') |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | tableLoading.value = false |
| | | }) |
| | | } |
| | | |
| | | // æ¥ç详æ
|
| | | const viewDetail = (row) => { |
| | | detailForm.value = { ...row } |
| | | detailVisible.value = true |
| | | } |
| | | |
| | | // å
³é详æ
|
| | | const closeDetail = () => { |
| | | detailVisible.value = false |
| | | detailForm.value = {} |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | |
| | | .content-container { |
| | | padding: 10px; |
| | | } |
| | | |
| | | .section { |
| | | margin-bottom: 24px; |
| | | |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | } |
| | | |
| | | .section-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | color: #303133; |
| | | margin-bottom: 16px; |
| | | padding-bottom: 8px; |
| | | border-bottom: 1px solid #e4e7ed; |
| | | } |
| | | |
| | | .info-item { |
| | | display: flex; |
| | | margin-bottom: 12px; |
| | | line-height: 1.6; |
| | | |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | &.remark-item { |
| | | flex-direction: column; |
| | | align-items: flex-start; |
| | | |
| | | .info-label { |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .info-value { |
| | | width: 100%; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .info-label { |
| | | font-weight: 500; |
| | | color: #606266; |
| | | min-width: 100px; |
| | | margin-right: 12px; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .info-value { |
| | | color: #303133; |
| | | flex: 1; |
| | | word-break: break-all; |
| | | |
| | | &.multi-line { |
| | | white-space: pre-wrap; |
| | | word-break: break-word; |
| | | } |
| | | } |
| | | </style> |