工单池
This commit is contained in:
parent
1e987bd5ca
commit
12f061ac11
|
|
@ -0,0 +1,5 @@
|
|||
import { get, post, put, del } from '../utils/request';
|
||||
|
||||
export const ticketPoolList = (data : any = {}) => get('v1/ticket/pool/list', data);
|
||||
|
||||
// export const bannerList = (data : any = {}) => get('v2/banner/list', data);
|
||||
|
|
@ -9,34 +9,35 @@
|
|||
<text class="li-text-42">工单大厅</text>
|
||||
</view>
|
||||
<wd-drop-menu class="li-w-100%">
|
||||
<wd-drop-menu-item v-model="value1" :options="option1" @change="handleChange1" />
|
||||
<wd-drop-menu-item v-model="value2" :options="option2" @change="handleChange2" />
|
||||
<wd-drop-menu-item v-model="query.type" :options="option1" @change="refresh" />
|
||||
<wd-drop-menu-item v-model="query.timeRange" :options="option2" @change="refresh" />
|
||||
</wd-drop-menu>
|
||||
</view>
|
||||
<!-- list -->
|
||||
<view class="li-w-92% li-mx-auto">
|
||||
<view v-for="(item , index) in taskList" :key="index"
|
||||
<view v-for="(item, index) in taskList" :key="index"
|
||||
class="li-task-card li-bg-white li-mt-20 li-rd-15 li-pt-25 li-pb-30 li-px-30">
|
||||
<view class="li-flex li-items-center li-justify-between li-bottom-border2 li-pb-15">
|
||||
<text class="li-text-28">工单编号: {{item.number}}</text>
|
||||
<text class="li-text-28">工单编号: {{item.ticket_no}}</text>
|
||||
<view class="li-flex li-items-center">
|
||||
<text class="ri-bookmark-3-line li-text-32 li-text-#9a9a9a"></text>
|
||||
<text
|
||||
class="li-text-26 li-text-#323232 li-ml-6">{{item.type==1?'商城':(item.type==2?'维修':'量房')}}</text>
|
||||
<text v-if="item.type=='F2'" class="li-text-26 li-text-#323232 li-ml-6">商城</text>
|
||||
<text v-if="item.type=='F6'" class="li-text-26 li-text-#323232 li-ml-6">维修</text>
|
||||
<text v-if="item.type=='F4'" class="li-text-26 li-text-#323232 li-ml-6">量房</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="li-flex li-items-center li-justify-between li-text-26 li-mt-20">
|
||||
<text class="li-text-#9a9a9a">上门地址</text>
|
||||
<text>{{item.address}}</text>
|
||||
<text>{{item.order.region_name}}{{item.order.cell_name}}{{item.order.house_name}}{{item.order.address}}</text>
|
||||
</view>
|
||||
<view class="li-flex li-items-center li-justify-between li-text-26 li-mt-20">
|
||||
<text class="li-text-#9a9a9a">业主姓名</text>
|
||||
<text>{{item.name}}</text>
|
||||
<text>{{item.order.name}}</text>
|
||||
</view>
|
||||
<view class="li-flex li-items-center li-justify-between li-text-26 li-mt-20">
|
||||
<text class="li-text-#9a9a9a">联系方式</text>
|
||||
<text>{{item.phone}}</text>
|
||||
<text>{{item.order.mobile}}</text>
|
||||
</view>
|
||||
<view v-if="item.type==2" class="li-flex li-items-center li-justify-between li-text-26 li-mt-20">
|
||||
<text class="li-text-#9a9a9a">维修类型</text>
|
||||
|
|
@ -45,8 +46,8 @@
|
|||
<wd-tag custom-class="space" v-if="item.RepairType==2" color="#0083ff"
|
||||
bg-color="#d0e8ff">房屋维修</wd-tag>
|
||||
</view>
|
||||
<view class="li-mt-20 bg-#f9f9f9 li-rd-10 li-p-15 li-text-24">
|
||||
<text>{{item.remarks}}</text>
|
||||
<view class="li-mt-20 bg-#f9f9f9 li-rd-10 li-p-15 li-text-24" v-if="item.order.remark">
|
||||
<text>{{item.order.remark}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="li-flex li-items-center li-justify-between li-mt-20">
|
||||
|
|
@ -66,8 +67,10 @@
|
|||
<script setup lang="ts">
|
||||
import SafeAreaTop from '@/components/SafeAreaTop/index.vue'
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
||||
import { useNavigation } from '@/hooks/useNavigation'
|
||||
import { ticketPoolList } from '@/api/ticket'
|
||||
|
||||
// 使用导航 composable
|
||||
const {
|
||||
hasMultiplePages, // 是否有多个页面在路由栈中
|
||||
|
|
@ -77,15 +80,34 @@
|
|||
|
||||
onLoad(() => {
|
||||
checkRouteStack()
|
||||
poolList()
|
||||
})
|
||||
|
||||
const value1 = ref<number>(0)
|
||||
const value2 = ref<number>(0)
|
||||
onPullDownRefresh(() => {
|
||||
refresh()
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
|
||||
onReachBottom(() => {
|
||||
if (finish.value) return
|
||||
query.value.page++
|
||||
poolList()
|
||||
})
|
||||
|
||||
const query = ref({
|
||||
page: 1,
|
||||
limit: 10,
|
||||
type: "",
|
||||
timeRange: 0
|
||||
})
|
||||
|
||||
var finish = ref<boolean>()
|
||||
|
||||
const option1 = ref<Record<string, any>>([
|
||||
{ label: '全部类型', value: 0 },
|
||||
{ label: '商品工单', value: 1 },
|
||||
{ label: '维修工单', value: 2 },
|
||||
{ label: '量房工单', value: 2 }
|
||||
{ label: '全部类型', value: '' },
|
||||
{ label: '商品工单', value: 'F2' },
|
||||
{ label: '维修工单', value: 'F6' },
|
||||
{ label: '量房工单', value: 'F4' }
|
||||
])
|
||||
const option2 = ref<Record<string, any>>([
|
||||
{ label: '全部时间', value: 0 },
|
||||
|
|
@ -94,37 +116,7 @@
|
|||
{ label: '最近30天', value: 3 },
|
||||
])
|
||||
|
||||
const taskList = ref([
|
||||
{
|
||||
number: 'JD1232122932919',
|
||||
type: 1, //1 商城 2 维修 3量房
|
||||
time: '2025/02/21',
|
||||
name: '王先生',
|
||||
phone: "177****4485",
|
||||
address: '中金北区17号楼一单元201室',
|
||||
commission: 7.65,
|
||||
remarks: "最近不在家,送到了就放在门口吧,谢谢。",
|
||||
},
|
||||
{
|
||||
number: 'JD57656575675545',
|
||||
type: 2, //1 商城 2 维修 3量房
|
||||
time: '2025/02/18',
|
||||
name: '李先生',
|
||||
phone: "164****7544",
|
||||
RepairType: 1, // 1公共维修 2房屋维修
|
||||
address: '中金北区6栋左侧第二个路灯',
|
||||
remarks: "路灯一个星期前坏了,到现在还没修,影响出行,请尽快维修。",
|
||||
},
|
||||
{
|
||||
number: 'JD423343243243422',
|
||||
type: 3, //1 商城 2 维修 3量房
|
||||
time: '2025/02/21',
|
||||
name: '张先生',
|
||||
phone: "134****6556",
|
||||
address: '中金北区14号楼三单元3301室',
|
||||
remarks: "新房需要量房装修,麻烦物业尽快上门",
|
||||
}
|
||||
])
|
||||
const taskList = ref([])
|
||||
|
||||
const toPages = (item : any) => {
|
||||
switch (item.type) {
|
||||
|
|
@ -143,11 +135,17 @@
|
|||
}
|
||||
}
|
||||
|
||||
function handleChange1({ value }) {
|
||||
console.log(value)
|
||||
const refresh = () => {
|
||||
taskList.value = []
|
||||
poolList()
|
||||
}
|
||||
function handleChange2({ value }) {
|
||||
console.log(value)
|
||||
|
||||
const poolList = async () => {
|
||||
const res = await ticketPoolList(query.value)
|
||||
if (res.data.length < query.value.limit) {
|
||||
finish.value = true
|
||||
}
|
||||
taskList.value.push(...res.data)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue