Explorar o código

[dev]
增加新逻辑:暂停接单时,点一键释放开始进行选择订单状态,选择完订单,然后点击完成进行释放选中订单

Neo hai 1 ano
pai
achega
07ba41e89a
Modificáronse 2 ficheiros con 40 adicións e 4 borrados
  1. 5 1
      components/order-card/order-card.vue
  2. 35 3
      pages/index/index.vue

+ 5 - 1
components/order-card/order-card.vue

@@ -1,5 +1,5 @@
 <template>
-  <view class="container" v-if="props.workStatus=='0' || props.c=='1'" @click="handleDetail">
+  <view class="container" v-if="(props.workStatus=='0' && props.s=='1') || props.c=='1'" @click="handleDetail">
 		<view class="t">
 			<view class="d1"></view>
 			<view class="d2">
@@ -96,6 +96,10 @@ const props = defineProps({
 		},
 		type: Object
 	},
+	s:{
+		default:'1',
+		type: String
+	},
 	workStatus: {
 		default:'0',
 		type: String

+ 35 - 3
pages/index/index.vue

@@ -15,7 +15,8 @@
 							<uni-easyinput prefixIcon="search" v-model="searchVal" placeholder="请输入姓名" />
 						</view>
 						<button type="primary" @click="handleSearch" class="search-button">搜 索</button>
-						<button type="primary" :disabled="workStatus==='1'?false:true" @click="handleRefresh" :class="workStatus==='1'?'refresh':'refresh active'">一键释放</button>
+						<button type="primary" v-if="s=='1'" :disabled="workStatus==='1'?false:true" @click="handleRefresh" :class="workStatus==='1'?'refresh':'refresh active'">{{ccc}}</button>
+						<button type="primary" v-else  @click="handleRelease" :class="'refresh'">完成</button>
 					</view>
 					<view v-else class="history">
 						<view class="searchchoice">
@@ -82,7 +83,7 @@
 						@scrolltolower="loadMoreList"
 					>
 						<template v-for="(v,i) in orderList" :key="i">
-							<orderCard v-if="v" :v="v" :work-Status="workStatus" :index="i" :c=tabActive class="order-card"
+							<orderCard v-if="v" :s="s" :v="v" :work-Status="workStatus" :index="i" :c=tabActive class="order-card"
 								@emit-select="emitSelect"
 							/>
 						</template>
@@ -165,6 +166,9 @@ const total = ref(0)
 const pageSize = ref(10)
 const status = ref('')
 
+const s = ref('1')
+const ccc = ref('一键释放')
+
 const ids = ref([])
 
 const today =ref({
@@ -298,13 +302,41 @@ const handleRefresh = async()=>{
 	// 	}})
 		
 	// console.log('yijianshifang >orderList>>666',ids)
+	s.value = '0'
+	// ccc.value = '完成'
+	// const params = {
+	// 	token: uni.getStorageSync('token'),
+	// 	data:{ids:ids.value.toString()}
+	// }
+	// console.log('handleRefresh >params>>666',params)
+	// 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 = []
+	// 	}
+	// }
+}
+
+const handleRelease = async()=>{
 	const params = {
 		token: uni.getStorageSync('token'),
 		data:{ids:ids.value.toString()}
 	}
 	console.log('handleRefresh >params>>666',params)
 	const {data:res} = await releaseOrder(params)
-
+	
 	if (res.code === 200) {
 		if(ids.value.length>0){
 			console.log('ids.value',ids.value)