|
@@ -78,10 +78,14 @@
|
|
|
v-if="orderList.length > 0"
|
|
|
class="order-list-wrap"
|
|
|
scroll-y="true"
|
|
|
- :scroll-top="50"
|
|
|
- @scrolltoupper="loadPreList"
|
|
|
+ :scroll-top="0"
|
|
|
+ refresher-enabled="true"
|
|
|
+ :refresher-triggered="trigger"
|
|
|
+
|
|
|
+ @refresherrefresh="loadPreList"
|
|
|
@scrolltolower="loadMoreList"
|
|
|
>
|
|
|
+ <!-- @scrolltoupper="loadPreList" -->
|
|
|
<template v-for="(v,i) in orderList" :key="i">
|
|
|
<orderCard v-if="v " :s="s" :v="v" :work-Status="workStatus" :c="tabActive"
|
|
|
@emit-select="emitSelect"
|
|
@@ -112,6 +116,7 @@ import debounce from 'lodash.debounce'
|
|
|
|
|
|
// import { ID_INJECTION_KEY } from 'element-plus'
|
|
|
|
|
|
+const trigger = ref(false)
|
|
|
|
|
|
const userInfo = ref({})
|
|
|
const workStatus = ref('0')
|
|
@@ -208,8 +213,10 @@ onLoad(async () => {
|
|
|
if (res.code === 200) {
|
|
|
total.value = res.total
|
|
|
orderList.value = res.rows
|
|
|
- if(orderList.value.length < pageSize.value){
|
|
|
+ if(total.value == orderList.value.length){
|
|
|
isBottom.value = true
|
|
|
+ } else {
|
|
|
+ isBottom.value = false
|
|
|
}
|
|
|
if(tabActive.value ==0){
|
|
|
tabList.value[0].leng = orderList.value.length
|
|
@@ -238,12 +245,19 @@ const updateUser = (v)=>{
|
|
|
|
|
|
const emitSelect = (v)=>{
|
|
|
console.log('emitSelect', v)
|
|
|
+
|
|
|
+ const index1 = orderList.value.findIndex(x=>x.id==v.id)
|
|
|
+ if (index1>-1){
|
|
|
+ orderList.value[index1].selected = v.selected
|
|
|
+ }
|
|
|
// 查在ids中查找v,如果存在就删除,如果不存在就添加
|
|
|
- const index = ids.value.findIndex(x=>x==v)
|
|
|
+ const index = ids.value.findIndex(x=>x==v.id)
|
|
|
+
|
|
|
+
|
|
|
if (index>-1){
|
|
|
ids.value.splice(index, 1)
|
|
|
} else {
|
|
|
- ids.value.push(v)
|
|
|
+ ids.value.push(v.id)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -268,8 +282,10 @@ const handleSearch = debounce(async()=>{
|
|
|
if (res.code === 200) {
|
|
|
total.value = res.total
|
|
|
orderList.value = res.rows
|
|
|
- if(orderList.value.length < pageSize.value){
|
|
|
+ if(total.value == orderList.value.length){
|
|
|
isBottom.value = true
|
|
|
+ } else {
|
|
|
+ isBottom.value = false
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -296,9 +312,11 @@ const handleSearch = debounce(async()=>{
|
|
|
if (res.code === 200) {
|
|
|
total.value = res.total
|
|
|
orderList.value = res.rows
|
|
|
- if(orderList.value.length < pageSize.value){
|
|
|
+ if(total.value == orderList.value.length){
|
|
|
isBottom.value = true
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ isBottom.value = false
|
|
|
+ }
|
|
|
if(tabActive.value ==0){
|
|
|
tabList.value[0].leng = orderList.value.length
|
|
|
}
|
|
@@ -306,7 +324,7 @@ const handleSearch = debounce(async()=>{
|
|
|
}
|
|
|
},500)
|
|
|
|
|
|
-const handleRefresh = debounce(()=>{
|
|
|
+const handleRefresh = async()=>{
|
|
|
|
|
|
console.log('yijianshifang >orderList>>', orderList.value)
|
|
|
// let ids = ''
|
|
@@ -316,6 +334,28 @@ const handleRefresh = debounce(()=>{
|
|
|
// }})
|
|
|
|
|
|
// console.log('yijianshifang >orderList>>666',ids)
|
|
|
+ const params = {
|
|
|
+ token: uni.getStorageSync('token'),
|
|
|
+ data: JSON.stringify({
|
|
|
+ currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
|
|
|
+ name: searchVal.value.trim(),
|
|
|
+ pageNum: page.value,
|
|
|
+ pageSize: pageSize.value,
|
|
|
+ status: tabList.value[tabActive.value].status,
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ const {data:res} = await receiveOrderList(params)
|
|
|
+ if (res.code === 200) {
|
|
|
+ total.value = res.total
|
|
|
+ orderList.value = res.rows
|
|
|
+ if(total.value == orderList.value.length){
|
|
|
+ isBottom.value = true
|
|
|
+ } else {
|
|
|
+ isBottom.value = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
s.value = '0'
|
|
|
console.log('handleRefresh>>ids.value ',ids.value)
|
|
|
ids.value = []
|
|
@@ -347,12 +387,12 @@ const handleRefresh = debounce(()=>{
|
|
|
// ids.value = []
|
|
|
// }
|
|
|
// }
|
|
|
-},500)
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-const handleRelease = debounce(async()=>{
|
|
|
+const handleRelease = async()=>{
|
|
|
console.log('ids.value.length',ids.value.length)
|
|
|
|
|
|
const params = {
|
|
@@ -387,10 +427,12 @@ const handleRelease = debounce(async()=>{
|
|
|
console.log('refresh orderList checkIndex params',paramss)
|
|
|
const {data:ress} = await receiveOrderList(paramss)
|
|
|
if (ress.code === 200) {
|
|
|
- total.value = res.total
|
|
|
+ total.value = ress.total
|
|
|
orderList.value = ress.rows
|
|
|
- if(orderList.value.length < pageSize.value){
|
|
|
+ if(total.value == orderList.value.length){
|
|
|
isBottom.value = true
|
|
|
+ } else {
|
|
|
+ isBottom.value = false
|
|
|
}
|
|
|
if(tabActive.value ==0){
|
|
|
tabList.value[0].leng = orderList.value.length
|
|
@@ -398,13 +440,6 @@ const handleRelease = debounce(async()=>{
|
|
|
}
|
|
|
s.value = '1'
|
|
|
console.log('after refresh orderList handleRelease ids.value', ids.value)
|
|
|
-},500)
|
|
|
-
|
|
|
-
|
|
|
-const handleSelect = ()=>{
|
|
|
- console.log('handleSelect>>',props.v.id)
|
|
|
- emit('emitSelect', props.v.id)
|
|
|
- oselected.value = !oselected.value
|
|
|
}
|
|
|
|
|
|
const handleGetOffice = (e)=>{
|
|
@@ -538,7 +573,7 @@ const handleGetTags = (v)=>{
|
|
|
}
|
|
|
|
|
|
// 更新处方列表
|
|
|
-const checkIndex = debounce(async(index) => {
|
|
|
+const checkIndex = async(index) => {
|
|
|
tabActive.value = index
|
|
|
page.value= 1
|
|
|
console.log('index',index)
|
|
@@ -561,8 +596,10 @@ const checkIndex = debounce(async(index) => {
|
|
|
if (res.code === 200) {
|
|
|
total.value = res.total
|
|
|
orderList.value = res.rows
|
|
|
- if(orderList.value.length < pageSize.value){
|
|
|
+ if(total.value == orderList.value.length){
|
|
|
isBottom.value = true
|
|
|
+ } else {
|
|
|
+ isBottom.value = false
|
|
|
}
|
|
|
if(tabActive.value ==0){
|
|
|
tabList.value[0].leng = orderList.value.length
|
|
@@ -585,17 +622,14 @@ const checkIndex = debounce(async(index) => {
|
|
|
console.log('selectDepartment officeArr.value', officeArr.value)
|
|
|
}
|
|
|
}
|
|
|
-},500)
|
|
|
-
|
|
|
-const openTime = ()=>{
|
|
|
- proxy.$refs.timeslot.open()
|
|
|
}
|
|
|
|
|
|
-const loadMoreList = debounce(async()=>{
|
|
|
- if(s.value=='0'){
|
|
|
- console.log('一键释放模式中,不需要加载更多')
|
|
|
- return
|
|
|
- }
|
|
|
+
|
|
|
+const loadMoreList = async()=>{
|
|
|
+ // if(s.value=='0'){
|
|
|
+ // console.log('一键释放模式中,不需要加载更多')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
console.log('loadMoreList>>>')
|
|
|
if(isBottom.value){
|
|
|
return
|
|
@@ -632,21 +666,24 @@ const loadMoreList = debounce(async()=>{
|
|
|
console.log('orderList.value after',orderList.value)
|
|
|
if(total.value == orderList.value.length){
|
|
|
isBottom.value = true
|
|
|
+ } else {
|
|
|
+ isBottom.value = false
|
|
|
}
|
|
|
if(tabActive.value ==0){
|
|
|
console.log('tabActive===',)
|
|
|
tabList.value[0].leng = orderList.value.length
|
|
|
}
|
|
|
}
|
|
|
-},500)
|
|
|
+}
|
|
|
|
|
|
|
|
|
-const loadPreList = debounce(async()=>{
|
|
|
+const loadPreList = async()=>{
|
|
|
console.log('loadPreList>>>')
|
|
|
- if(s.value=='0'){
|
|
|
- console.log('一键释放模式中,不需要刷新')
|
|
|
- return
|
|
|
- }
|
|
|
+ // if(s.value=='0'){
|
|
|
+ // console.log('一键释放模式中,不需要刷新')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ trigger.value = true;
|
|
|
page.value = 1
|
|
|
const params = {
|
|
|
token: uni.getStorageSync('token'),
|
|
@@ -671,12 +708,17 @@ const loadPreList = debounce(async()=>{
|
|
|
orderList.value = res.rows
|
|
|
if(orderList.value.length < pageSize.value){
|
|
|
isBottom.value = true
|
|
|
+ } else {
|
|
|
+ isBottom.value = false
|
|
|
}
|
|
|
if(tabActive ==0){
|
|
|
tabList.value[0].leng = orderList.value.length
|
|
|
}
|
|
|
}
|
|
|
-},500)
|
|
|
+ setTimeout(() => {
|
|
|
+ trigger.value = false;
|
|
|
+ }, 1000)
|
|
|
+}
|
|
|
|
|
|
|
|
|
</script>
|