|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view class="main">
|
|
|
- <NavBar :user-info="userInfo" @update-user="updateUser" />
|
|
|
+ <NavBar :user-info="userInfo" :work-Status="workStatus" @update-user="updateUser" />
|
|
|
<view class="body">
|
|
|
<view class="tab-box">
|
|
|
<view class="tab-bar">
|
|
@@ -15,7 +15,7 @@
|
|
|
<uni-easyinput prefixIcon="search" v-model="searchVal" placeholder="请输入姓名" />
|
|
|
</view>
|
|
|
<button type="primary" @click="handleSearch" class="search-button">搜 索</button>
|
|
|
- <button type="primary" :disabled="userInfo.workStatus==='1'?false:true" @click="handleRefresh" :class="userInfo.workStatus==='1'?'refresh':'refresh active'">一键释放</button>
|
|
|
+ <button type="primary" :disabled="workStatus==='1'?false:true" @click="handleRefresh" :class="workStatus==='1'?'refresh':'refresh active'">一键释放</button>
|
|
|
</view>
|
|
|
<view v-else class="history">
|
|
|
<view class="searchchoice">
|
|
@@ -80,8 +80,8 @@
|
|
|
@scrolltolower="loadMoreList"
|
|
|
>
|
|
|
<template v-for="(v,i) in orderList" :key="i">
|
|
|
- <orderCard v-if="v" :v="v" :index="i" :c=tabActive class="order-card"
|
|
|
- @update-list="updateList"
|
|
|
+ <orderCard v-if="v" :v="v" :state="workStatus" :index="i" :c=tabActive class="order-card"
|
|
|
+ @emit-select="emitSelect"
|
|
|
/>
|
|
|
</template>
|
|
|
</scroll-view>
|
|
@@ -108,6 +108,7 @@ import {releaseOrder} from "@/static/js/request.js"
|
|
|
// import { ID_INJECTION_KEY } from 'element-plus'
|
|
|
|
|
|
const userInfo = ref({})
|
|
|
+const workStatus = ref('0')
|
|
|
const searchVal = ref('')
|
|
|
const tabList = ref([
|
|
|
{title:"今日待完成", status: '0', leng:0},
|
|
@@ -161,6 +162,8 @@ const total = ref(0)
|
|
|
const pageSize = ref(10)
|
|
|
const status = ref('')
|
|
|
|
|
|
+const ids = ref([])
|
|
|
+
|
|
|
const today =ref({
|
|
|
leng: 0,
|
|
|
})
|
|
@@ -180,7 +183,7 @@ onMounted(() => {
|
|
|
onLoad(async () => {
|
|
|
const token = uni.getStorageSync('token')
|
|
|
userInfo.value.name = uni.getStorageSync('username')
|
|
|
- userInfo.value.workStatus = uni.getStorageSync('workStatus') || '0'
|
|
|
+ workStatus.value = uni.getStorageSync('workStatus') || '0'
|
|
|
const params = {
|
|
|
token: token,
|
|
|
data:JSON.stringify({
|
|
@@ -204,11 +207,18 @@ onLoad(async () => {
|
|
|
// 子传父,更新userInfo
|
|
|
const updateUser = (v)=>{
|
|
|
console.log('updateUserStatus', v)
|
|
|
- userInfo.value.workStatus = v
|
|
|
+ workStatus.value = v
|
|
|
}
|
|
|
|
|
|
-const updateList = (v)=>{
|
|
|
- console.log('updateList', v)
|
|
|
+const emitSelect = (v)=>{
|
|
|
+ console.log('emitSelect', v)
|
|
|
+ // 查在ids中查找v,如果存在就删除,如果不存在就添加
|
|
|
+ const index = ids.value.findIndex(x=>x==v)
|
|
|
+ if (index>-1){
|
|
|
+ ids.splice(index, 1)
|
|
|
+ } else {
|
|
|
+ ids.value.push(v)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const handleSearch = async()=>{
|
|
@@ -266,17 +276,18 @@ const handleSearch = async()=>{
|
|
|
const handleRefresh = async()=>{
|
|
|
|
|
|
console.log('yijianshifang >orderList>>', orderList.value)
|
|
|
- let ids = ''
|
|
|
- orderList.value.forEach((v)=>{if(v.id){
|
|
|
- ids= ids+v.id+','
|
|
|
- console.log('yijianshifang >orderList>>',ids)
|
|
|
- }})
|
|
|
+ // let ids = ''
|
|
|
+ // orderList.value.forEach((v)=>{if(v.id){
|
|
|
+ // ids= ids+v.id+','
|
|
|
+ // console.log('yijianshifang >orderList>>',ids)
|
|
|
+ // }})
|
|
|
|
|
|
- console.log('yijianshifang >orderList>>666',ids)
|
|
|
+ // console.log('yijianshifang >orderList>>666',ids)
|
|
|
const params = {
|
|
|
token: uni.getStorageSync('token'),
|
|
|
- data:{ids:ids}
|
|
|
+ data:{ids:ids.value.toString()}
|
|
|
}
|
|
|
+ console.log('handleRefresh >params>>666',params)
|
|
|
const {data:res} = await releaseOrder(params)
|
|
|
if (res.code === 200) {
|
|
|
const paramss = {
|
|
@@ -403,6 +414,7 @@ const checkIndex = async(index) => {
|
|
|
tabActive.value = index
|
|
|
page.value= 1
|
|
|
console.log('index',index)
|
|
|
+ ids.value = []
|
|
|
tabName.value = tabList.value[index].title
|
|
|
currentStatus.value = parseInt(tabList.value[index].status)
|
|
|
const token = uni.getStorageSync('token')
|