|
@@ -83,7 +83,7 @@
|
|
|
@scrolltolower="loadMoreList"
|
|
|
>
|
|
|
<template v-for="(v,i) in orderList" :key="i">
|
|
|
- <orderCard v-if="v " :s="s" :v="v" :work-Status="workStatus" :c="tabActive"
|
|
|
+ <orderCard v-if="v " :s="s" :v="v" :work-Status="workStatus" :c="tabActive"
|
|
|
@emit-select="emitSelect"
|
|
|
/>
|
|
|
</template>
|
|
@@ -171,6 +171,7 @@ const status = ref('')
|
|
|
const s = ref('1')
|
|
|
const ccc = ref('一键释放')
|
|
|
|
|
|
+
|
|
|
const ids = ref([])
|
|
|
|
|
|
const today =ref({
|
|
@@ -317,6 +318,11 @@ const handleRefresh = debounce(()=>{
|
|
|
// console.log('yijianshifang >orderList>>666',ids)
|
|
|
s.value = '0'
|
|
|
console.log('handleRefresh>>ids.value ',ids.value)
|
|
|
+ ids.value = []
|
|
|
+ orderList.value.forEach((x,i)=>{
|
|
|
+ orderList.value[i].selected = false
|
|
|
+ })
|
|
|
+ console.log('yijianshifang >orderList>>forEach', orderList.value)
|
|
|
// ccc.value = '完成'
|
|
|
// const params = {
|
|
|
// token: uni.getStorageSync('token'),
|
|
@@ -347,6 +353,8 @@ const handleRefresh = debounce(()=>{
|
|
|
|
|
|
|
|
|
const handleRelease = debounce(async()=>{
|
|
|
+ console.log('ids.value.length',ids.value.length)
|
|
|
+
|
|
|
const params = {
|
|
|
token: uni.getStorageSync('token'),
|
|
|
data:{ids:ids.value.toString()}
|
|
@@ -355,28 +363,50 @@ const handleRelease = debounce(async()=>{
|
|
|
const {data:res} = await releaseOrder(params)
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
- if(ids.value.length>0){
|
|
|
- console.log('ids.value',ids.value)
|
|
|
- ids.value.forEach(x=>{
|
|
|
- console.log('orderList',orderList.value)
|
|
|
- const index = orderList.value.findIndex(y=>y.id == x)
|
|
|
- console.log('orderList index',index)
|
|
|
- if(index>-1){
|
|
|
- console.log('orderList',orderList.value)
|
|
|
- orderList.value.splice(index,1)
|
|
|
- console.log('orderList',orderList.value)
|
|
|
- }
|
|
|
- })
|
|
|
- ids.value = []
|
|
|
- uni.$showMsg(res.msg, 2000)
|
|
|
- }
|
|
|
+ console.log('after releaseOrder ids.value',ids.value)
|
|
|
+ uni.$showMsg(res.msg, 2000)
|
|
|
+ }
|
|
|
+ if(ids.value.length==0){
|
|
|
+ uni.$showMsg('尚未释放处方',2000)
|
|
|
+ s.value = '1'
|
|
|
+ return
|
|
|
} else {
|
|
|
uni.$showMsg(res.msg, 2000)
|
|
|
}
|
|
|
+
|
|
|
+ ids.value = []
|
|
|
+ const paramss = {
|
|
|
+ token: uni.getStorageSync('token'),
|
|
|
+ data:JSON.stringify({
|
|
|
+ currentUserId: parseInt(uni.getStorageSync('userId')),
|
|
|
+ pageNum: page.value,
|
|
|
+ pageSize: pageSize.value,
|
|
|
+ status: tabList.value[tabActive.value].status
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log('refresh orderList checkIndex params',paramss)
|
|
|
+ const {data:ress} = await receiveOrderList(paramss)
|
|
|
+ if (ress.code === 200) {
|
|
|
+ total.value = res.total
|
|
|
+ orderList.value = ress.rows
|
|
|
+ if(orderList.value.length < pageSize.value){
|
|
|
+ isBottom.value = true
|
|
|
+ }
|
|
|
+ if(tabActive.value ==0){
|
|
|
+ tabList.value[0].leng = orderList.value.length
|
|
|
+ }
|
|
|
+ }
|
|
|
s.value = '1'
|
|
|
- console.log('after handleRelease ids.value', ids.value)
|
|
|
+ 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)=>{
|
|
|
console.log('handleGetOffice', e.detail.value)
|
|
|
console.log('officeIndex', officeIndex)
|
|
@@ -562,8 +592,12 @@ const openTime = ()=>{
|
|
|
}
|
|
|
|
|
|
const loadMoreList = debounce(async()=>{
|
|
|
+ if(s.value=='0'){
|
|
|
+ console.log('一键释放模式中,不需要加载更多')
|
|
|
+ return
|
|
|
+ }
|
|
|
console.log('loadMoreList>>>')
|
|
|
- if(isBottom){
|
|
|
+ if(isBottom.value){
|
|
|
return
|
|
|
}
|
|
|
page.value = page.value +1
|
|
@@ -588,15 +622,17 @@ const loadMoreList = debounce(async()=>{
|
|
|
console.log('orderList.value before',orderList.value)
|
|
|
if (res.code === 200) {
|
|
|
total.value = res.total
|
|
|
- if(total.value< pageSize.value){
|
|
|
- isBottom.value = true
|
|
|
- }
|
|
|
+
|
|
|
console.log('res.rows after',res.rows)
|
|
|
- res.rows.forEach(item=>{
|
|
|
- orderList.value.push(item)
|
|
|
- })
|
|
|
+ // res.rows.forEach(item=>{
|
|
|
+ // orderList.value.push(item)
|
|
|
+ // })
|
|
|
+ orderList.value.push(...res.rows)
|
|
|
|
|
|
console.log('orderList.value after',orderList.value)
|
|
|
+ if(total.value == orderList.value.length){
|
|
|
+ isBottom.value = true
|
|
|
+ }
|
|
|
if(tabActive.value ==0){
|
|
|
console.log('tabActive===',)
|
|
|
tabList.value[0].leng = orderList.value.length
|
|
@@ -607,6 +643,10 @@ const loadMoreList = debounce(async()=>{
|
|
|
|
|
|
const loadPreList = debounce(async()=>{
|
|
|
console.log('loadPreList>>>')
|
|
|
+ if(s.value=='0'){
|
|
|
+ console.log('一键释放模式中,不需要刷新')
|
|
|
+ return
|
|
|
+ }
|
|
|
page.value = 1
|
|
|
const params = {
|
|
|
token: uni.getStorageSync('token'),
|