页面调整

This commit is contained in:
2025-08-26 16:07:25 +08:00
parent f259275adb
commit 0e673b853d
6 changed files with 1278 additions and 1241 deletions

View File

@@ -2,15 +2,15 @@
<view class="container">
<!-- 筛选及搜索区域 -->
<view class="search-bar">
<input v-model="searchParams.visitorName" class="search-input" placeholder="访客姓名" />
<input v-model="searchParams.visitedPerson" class="search-input" placeholder="被访人" />
<input v-model="searchParams.visitedUnit" class="search-input" placeholder="被访单位" />
<picker mode="selector" :range="statusOptions" @change="onStatusChange">
<view class="picker-view">
{{ searchParams.bookStatus || '预约状态' }}
</view>
</picker>
<input v-model="searchParams.phoneSuffix" class="search-input" placeholder="手机号后四位" />
<input v-model="searchParams.visitorName" class="search-input" placeholder="访客姓名"/>
<input v-model="searchParams.visitedPerson" class="search-input" placeholder="被访人"/>
<input v-model="searchParams.visitedUnit" class="search-input" placeholder="被访单位"/>
<!-- <picker mode="selector" :range="statusOptions" @change="onStatusChange">
<view class="picker-view">
{{ searchParams.bookStatus || '预约状态' }}
</view>
</picker> -->
<input v-model="searchParams.phoneSuffix" class="search-input" placeholder="手机号后四位"/>
<button class="search-btn" @click="handleSearch">搜索</button>
<button class="reset-btn" @click="handleReset">重置</button>
</view>
@@ -27,10 +27,10 @@
<view class="table-cell">被访单位</view>
<view class="table-cell">拜访事由</view>
<view class="table-cell">拜访时间</view>
<view class="table-cell">是否预约车位</view>
<view class="table-cell">预约状态</view>
<!-- <view class="table-cell">是否预约车位</view>
<view class="table-cell">预约状态</view> -->
<view class="table-cell">提交时间</view>
<view class="table-cell">操作</view>
<!-- <view class="table-cell">操作</view> -->
</view>
<view v-for="(item, index) in filteredList" :key="index" class="table-row">
<view class="table-cell">{{ index + 1 }}</view>
@@ -42,29 +42,30 @@
<view class="table-cell">{{ item.interviewedUnit || '无' }}</view>
<view class="table-cell">{{ item.visitingReason }}</view>
<view class="table-cell">{{ item.visitingBeginTime }}</view>
<view class="table-cell">{{ item.bookingParkingSpace === 1 ? '是' : '否' }}</view>
<view class="table-cell" :class="{'status-confirm': item.serveStatus === 1, 'status-wait': item.serveStatus === 0}">
{{ item.serveStatus === 1 ? '已确认' : '待确认' }}
</view>
<!-- <view class="table-cell">{{ item.bookingParkingSpace === 1 ? '是' : '否' }}</view>
<view class="table-cell" :class="{'status-confirm': item.serveStatus === 1, 'status-wait': item.serveStatus === 0}">
{{ item.serveStatus === 1 ? '已确认' : '待确认' }}
</view> -->
<view class="table-cell">{{ item.createTime }}</view>
<view class="table-cell operation-cell">
<button class="operation-btn" @click="handleDetail(item)">详情</button>
<button class="operation-btn" @click="handleAudit(item)">确认</button>
</view>
<!-- <view class="table-cell operation-cell">
<button class="operation-btn" @click="handleDetail(item)">详情</button>
<button class="operation-btn" @click="handleAudit(item)">确认</button>
</view> -->
</view>
</view>
<VisitorDetailModal
:visible="showDetailModal"
:visitorInfo="currentVisitor"
:showActionButtons="currentVisitor.serveStatus === 0"
@close="closeDetailModal"
@audit="handleAudit"
<VisitorDetailModal
:visible="showDetailModal"
:visitorInfo="currentVisitor"
:showActionButtons="currentVisitor.serveStatus === 0"
@close="closeDetailModal"
@audit="handleAudit"
/>
</view>
</template>
<script>
import VisitorDetailModal from '@/components/VisitorDetailModal.vue';
export default {
components: {
VisitorDetailModal
@@ -82,7 +83,7 @@ export default {
bookStatus: '',
phoneSuffix: ''
},
statusOptions: ['已确认', '待确认']
statusOptions: ['已确认', '待确认']
}
},
computed: {
@@ -92,7 +93,7 @@ export default {
if (this.searchParams.visitedPerson && !item.interviewedPerson.includes(this.searchParams.visitedPerson)) return false;
if (this.searchParams.visitedUnit && !item.interviewedUnit.includes(this.searchParams.visitedUnit)) return false;
if (this.searchParams.bookStatus) {
const statusMap = { '已确认': 1, '待确认': 0 };
const statusMap = {'已确认': 1, '待确认': 0};
return item.serveStatus === statusMap[this.searchParams.bookStatus];
}
if (this.searchParams.phoneSuffix) {
@@ -104,9 +105,9 @@ export default {
}
},
onLoad() {
// #ifdef APP-PLUS
plus.screen.lockOrientation('default');
// #endif
// #ifdef APP-PLUS
plus.screen.lockOrientation('default');
// #endif
this.onload();
},
methods: {
@@ -119,24 +120,24 @@ export default {
this.showDetailModal = false;
},
handleAudit(item) {
console.log("eee",item)
console.log("eee", item)
this.loading = true;
item.serveStatus=1
this.$u.api.spfk(item).then(res=>{
console.log(res)
})
item.serveStatus = 1
this.$u.api.spfk(item).then(res => {
console.log(res)
})
},
onReady() {
// #ifdef APP-PLUS
plus.screen.lockOrientation('landscape-primary');
// #endif
},
onReady() {
// #ifdef APP-PLUS
plus.screen.lockOrientation('landscape-primary');
// #endif
},
onload() {
this.$u.api.fklist().then(res => {
this.tableData = res.rows;
}).catch(err => {
console.error('获取数据失败:', err);
uni.showToast({ title: '获取数据失败', icon: 'none' });
uni.showToast({title: '获取数据失败', icon: 'none'});
});
},
onStatusChange(e) {
@@ -144,7 +145,7 @@ export default {
this.searchParams.bookStatus = this.statusOptions[index];
},
handleSearch() {
this.onload();
this.onload();
console.log('当前筛选参数:', this.searchParams);
},
handleReset() {
@@ -155,12 +156,12 @@ export default {
bookStatus: '',
phoneSuffix: ''
};
this.onload();
this.onload();
},
// handleAudit(item) {
// console.log('审核操作,当前数据:', item);
// handleAudit(item)
// }
// handleAudit(item) {
// console.log('审核操作,当前数据:', item);
// handleAudit(item)
// }
}
};
</script>
@@ -169,12 +170,14 @@ export default {
.container {
padding: 10px;
}
.search-bar {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 10px;
}
.search-input {
flex: 1;
min-width: 120px;
@@ -182,6 +185,7 @@ export default {
border: 1px solid #ddd;
border-radius: 4px;
}
.picker-view {
padding: 8px;
border: 1px solid #ddd;
@@ -189,34 +193,44 @@ export default {
min-width: 120px;
text-align: center;
}
.search-btn,
.reset-btn {
padding: 8px 15px;
border-radius: 4px;
color: #fff;
height: 40px;
text-align: center;
line-height: 24px;
}
.search-btn {
background-color: #007aff;
border: none;
}
.reset-btn {
background-color: #f0f0f0;
color: #333;
border: none;
}
.table-wrap {
overflow-x: auto;
}
.table-header,
.table-row {
display: flex;
flex-direction: row;
border: 1px solid #eee;
}
.table-header {
background-color: #f8f8f8;
font-weight: bold;
}
.table-cell {
flex: 1;
text-align: center;
@@ -226,22 +240,27 @@ export default {
text-overflow: ellipsis;
white-space: nowrap;
}
.table-cell:last-child {
border-right: none;
}
.operation-cell {
display: flex;
justify-content: space-around;
flex: 2;
}
.operation-btn {
margin: 0 5px;
padding: 5px 10px;
font-size: 12px;
}
.status-confirm {
color: #52c41a;
}
.status-wait {
color: #fa8c16;
}