|
@@ -6,7 +6,7 @@
|
|
|
<view class="tab-bar">
|
|
|
<view class="tab_item" v-for="(tab, index) in tabList" :key="index"
|
|
|
:class="{'active':tabActive==index}" @click="checkIndex(index)">
|
|
|
- <text class="text">{{tab.title}}{{index===0?"("+orderList.length+")":""}}</text>
|
|
|
+ <text class="text">{{tab.title}}{{index===0 && tabList[0].leng>0?"("+tabList[0].leng+")":""}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="search-bar">
|
|
@@ -110,8 +110,8 @@ import {releaseOrder} from "@/static/js/request.js"
|
|
|
const userInfo = ref({})
|
|
|
const searchVal = ref('')
|
|
|
const tabList = ref([
|
|
|
- {title:"今日待完成", status: 0},
|
|
|
- {title:"历史处方", status: 1},
|
|
|
+ {title:"今日待完成", status: '0', leng:0},
|
|
|
+ {title:"历史处方", status: '1'},
|
|
|
])
|
|
|
|
|
|
const currentStatus = ref(0)
|
|
@@ -161,6 +161,10 @@ const total = ref(0)
|
|
|
const pageSize = ref(10)
|
|
|
const status = ref('')
|
|
|
|
|
|
+const today =ref({
|
|
|
+ leng: 0,
|
|
|
+})
|
|
|
+
|
|
|
|
|
|
// app.provide(ID_INJECTION_KEY, {
|
|
|
// prefix: Math.floor(Math.random() * 10000),
|
|
@@ -183,7 +187,7 @@ onLoad(async () => {
|
|
|
currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
|
|
|
page: page.value,
|
|
|
pageSize: pageSize.value,
|
|
|
- status: currentStatus.value
|
|
|
+ status: '0'
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -191,6 +195,9 @@ onLoad(async () => {
|
|
|
if (res.code === 200) {
|
|
|
total.value = res.total
|
|
|
orderList.value = res.rows
|
|
|
+ if(tabActive.value ==0){
|
|
|
+ tabList.value[0].leng = orderList.value.length
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -210,7 +217,7 @@ const handleSearch = async()=>{
|
|
|
console.log('handleSearch searchVal', searchVal.value)
|
|
|
console.log('currentStatus.value', currentStatus.value)
|
|
|
searchVal.value = searchVal.value.trim()
|
|
|
- if(currentStatus.value ===0 && searchVal.value) {
|
|
|
+ if(tabActive.value ===0 && searchVal.value) {
|
|
|
const params = {
|
|
|
token: uni.getStorageSync('token'),
|
|
|
data: JSON.stringify({
|
|
@@ -218,7 +225,7 @@ const handleSearch = async()=>{
|
|
|
name: searchVal.value,
|
|
|
page: page.value,
|
|
|
pageSize: pageSize.value,
|
|
|
- status: currentStatus.value
|
|
|
+ status: tabList.value[tabActive.value].status
|
|
|
})
|
|
|
}
|
|
|
const {data:res} = await receiveOrderList(params)
|
|
@@ -227,7 +234,7 @@ const handleSearch = async()=>{
|
|
|
orderList.value = res.rows
|
|
|
}
|
|
|
}
|
|
|
- if(currentStatus.value===1){
|
|
|
+ if(tabActive.value===1){
|
|
|
const params = {
|
|
|
token: uni.getStorageSync('token'),
|
|
|
data: JSON.stringify({
|
|
@@ -241,7 +248,7 @@ const handleSearch = async()=>{
|
|
|
preMzZy: searchPreMzZy.value || '',
|
|
|
page: page.value,
|
|
|
pageSize: pageSize.value,
|
|
|
- status: currentStatus.value || 0
|
|
|
+ status: tabList.value[tabActive.value].status
|
|
|
})
|
|
|
}
|
|
|
console.log('params',params)
|
|
@@ -249,6 +256,9 @@ const handleSearch = async()=>{
|
|
|
if (res.code === 200) {
|
|
|
total.value = res.total
|
|
|
orderList.value = res.rows
|
|
|
+ if(tabActive.value ==0){
|
|
|
+ tabList.value[0].leng = orderList.value.length
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -275,7 +285,7 @@ const handleRefresh = async()=>{
|
|
|
currentUserId: parseInt(uni.getStorageSync('userId')),
|
|
|
page: page.value,
|
|
|
pageSize: pageSize.value,
|
|
|
- status: currentStatus.value
|
|
|
+ status: tabList.value[tabActive.value].status
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -283,6 +293,9 @@ const handleRefresh = async()=>{
|
|
|
if (res.code === 200) {
|
|
|
total.value = res.total
|
|
|
orderList.value = res.rows
|
|
|
+ if(tabActive.value ==0){
|
|
|
+ tabList.value[0].leng = orderList.value.length
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -388,22 +401,28 @@ const handleGetTags = (v)=>{
|
|
|
// 更新处方列表
|
|
|
const checkIndex = async(index) => {
|
|
|
tabActive.value = index
|
|
|
+ page.value= 1
|
|
|
+ console.log('index',index)
|
|
|
tabName.value = tabList.value[index].title
|
|
|
currentStatus.value = parseInt(tabList.value[index].status)
|
|
|
const token = uni.getStorageSync('token')
|
|
|
- const params = {
|
|
|
- token: token,
|
|
|
- data: {
|
|
|
- status: currentStatus.value,
|
|
|
+ const paramss = {
|
|
|
+ token: uni.getStorageSync('token'),
|
|
|
+ data:JSON.stringify({
|
|
|
+ currentUserId: parseInt(uni.getStorageSync('userId')),
|
|
|
page: page.value,
|
|
|
pageSize: pageSize.value,
|
|
|
- }
|
|
|
+ status: tabList.value[tabActive.value].status
|
|
|
+ })
|
|
|
}
|
|
|
- console.log('checkIndex params',params)
|
|
|
- const {data:res} = await receiveOrderList(params)
|
|
|
+ console.log('checkIndex params',paramss)
|
|
|
+ const {data:res} = await receiveOrderList(paramss)
|
|
|
if (res.code === 200) {
|
|
|
total.value = res.total
|
|
|
orderList.value = res.rows
|
|
|
+ if(tabActive.value ==0){
|
|
|
+ tabList.value[0].leng = orderList.value.length
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -421,7 +440,7 @@ const loadMoreList =async()=>{
|
|
|
name: searchVal.value,
|
|
|
page: page.value,
|
|
|
pageSize: pageSize.value,
|
|
|
- status: currentStatus.value
|
|
|
+ status: tabActive.value + ''
|
|
|
})
|
|
|
}
|
|
|
const {data:res} = await receiveOrderList(params)
|
|
@@ -434,6 +453,10 @@ const loadMoreList =async()=>{
|
|
|
})
|
|
|
|
|
|
console.log('orderList.value after',orderList.value)
|
|
|
+ if(tabActive.value ==0){
|
|
|
+ console.log('tabActive===',)
|
|
|
+ tabList.value[0].leng = orderList.value.length
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -447,13 +470,16 @@ const loadPreList = async()=>{
|
|
|
name: searchVal.value,
|
|
|
page: page.value,
|
|
|
pageSize: pageSize.value,
|
|
|
- status: currentStatus.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(tabActive ==0){
|
|
|
+ tabList.value[0].leng = orderList.value.length
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|