USER-20230908AJ\Administrator hai 1 ano
pai
achega
b6b7da02be

+ 2 - 2
common/task/task-item.vue

@@ -72,7 +72,7 @@
 			},
 			iconStatus: {
 				type: Number,
-				default: 0
+				default: 1
 			},
 			leftImgStatus: {
 				type: Number,
@@ -127,7 +127,7 @@
 			},
 			onTaskDetails(item) {
 				uni.navigateTo({
-					url: '/page_task/task_details/task_details'
+					url: '/page_task/task_details/task_details?taskId='+item.id
 				})
 			}
 		}

+ 1 - 0
page_task/module/task_ima_tab.vue → common/task/task_ima_tab.vue

@@ -23,6 +23,7 @@
 	import {getTaskType} from "@/api/task";
 
   export default {
+    name:'task-ima-tab',
 		data() {
 			return {
 				current: 0,

+ 1 - 1
page_task/apply/apply.vue

@@ -220,7 +220,7 @@
 </template>
 <!-- correct -->
 <script>
-	import TaskImgTab from "@/page_task/module/task_ima_tab.vue"
+	import TaskImgTab from "@/common/task/task_ima_tab.vue"
 	import WhInput from "@/page_task/module/wh-input.vue"
 
 	export default {

+ 1 - 1
page_task/creation_task/creation_task.vue

@@ -18,7 +18,7 @@
 </template>
 
 <script>
-	import TaskImgTab from "@/page_task/module/task_ima_tab.vue"
+	import TaskImgTab from "@/common/task/task_ima_tab.vue"
 
 	export default {
 		components: {

+ 1 - 1
page_task/gain_task/gain_task.vue

@@ -13,7 +13,7 @@
 
 <script>
 	import TaskItem from "@/common/task/task-item.vue"
-	import TaskImgTab from "@/page_task/module/task_ima_tab.vue"
+	import TaskImgTab from "@/common/task/task_ima_tab.vue"
   import {getTaskReceiving, takeTask} from "@/api/task";
   import tools from "@/service/tools";
 

+ 1 - 1
page_task/identity/identity.vue

@@ -92,7 +92,7 @@
 </template>
 <!-- correct -->
 <script>
-	import TaskImgTab from "@/page_task/module/task_ima_tab.vue"
+	import TaskImgTab from "@/common/task/task_ima_tab.vue"
 	import WhInput from "@/page_task/module/wh-input.vue"
 
 	export default {

+ 1 - 1
page_task/information/information.vue

@@ -28,7 +28,7 @@
 </template>
 
 <script>
-	import TaskImgTab from "@/page_task/module/task_ima_tab.vue"
+	import TaskImgTab from "@/common/task/task_ima_tab.vue"
 
 	export default {
 		components: {

+ 12 - 0
pages.json

@@ -191,5 +191,17 @@
 				"pagePath": "pages/statistics/statistics"
 			}
 		]
+	},
+	"condition": {
+		"current": 0,
+		"list": [
+
+			{
+				"name": "任务详情",
+				"path": "/pages/add-client/new-add",
+				"query": "taskId=4273"
+			}
+
+		]
 	}
 }

+ 117 - 44
pages/task/task.vue

@@ -8,19 +8,19 @@
 					:bar-style="{background:'#10B261'}" :inactive-style="{fontWeight:'bold',fontSize:'28rpx'}"
 					:current="current" :bar-animate-mode="'worm'" @change="tabsChange" />
 			</view>
-		</view>
-		<!-- 带Swiper -->
-		<!-- 		<swiper style="height: 100vh;" :current="current" @transition="swiperTransition"
-			@animationfinish="swiperAnimationfinish">
-			<swiper-item v-for="(item, index) in tabsList" :key="index">
-				<EnScroll ref="scroll" :navHeight="125" @onRefresh="onRefresh" @onScrollBottom="onScrollBottom">
-					<TaskItem :type="1" is_bottom></TaskItem>
-				</EnScroll>
-			</swiper-item>
-		</swiper> -->
-		<!-- 不带Swiper -->
+    </view>	<view class="task-tabs m-t30">
+    <!--        <TaskImgTab @setProductId="setProductId"></TaskImgTab>-->
+    <task-ima-tab @setProductId="setProductId"></task-ima-tab>
+  </view>
+
 		<EnScroll ref="scroll" :navHeight="105" is_tabHeight @onRefresh="onRefresh" @onScrollBottom="onScrollBottom">
-			<TaskItem :type="1" is_bottom></TaskItem>
+      <view v-if="current===1">
+        <TaskItem :type="1" is_bottom :task-list="backlogList"></TaskItem>
+      </view>
+      <view v-else>
+        <TaskItem :type="1" is_bottom :task-list="taskList"></TaskItem>
+      </view>
+
 		</EnScroll>
 		<Tab :tab-index="1"></Tab>
 	</view>
@@ -28,9 +28,12 @@
 <script>
 	// 任务列表
 	import TaskItem from "@/common/task/task-item.vue";
+  import TaskImaTab from "@/common/task/task_ima_tab.vue";
+  import {getDayBacklogList, getTaskList} from "@/api/task";
 
 	export default {
 		components: {
+      TaskImaTab,
 			TaskItem,
 		},
 		data() {
@@ -41,66 +44,136 @@
 				tabsList: [{
 					name: '全部',
 					dot_color: 'red',
-					disabled: false
+					disabled: false,
+          'id': 0,
 				}, {
 					name: '新进',
 					dot_color: 'yellow',
-					disabled: false
+					disabled: false,
+          'id': 6,
 				}, {
+          'id': 1,
 					name: '待办',
 					dot_color: '',
 					disabled: false
 				}, {
+          'id': 2,
 					name: '完成',
 					dot_color: '',
 					disabled: false
 				}, {
+          'id': 3,
 					name: '拒绝',
 					dot_color: '',
 					disabled: false
 				}],
+        selectStr: '',
+        startDate: '',
+        endDate: '',
+        phone: '',
+        name: '',
+        productId: 0,
+        stageId: [],
+        departmentId: [],
+        totalNum: 99999,
+        taskList: [],
+        page: 1,
+        isAjax: false,
+        backlogList: [],
 			}
 		},
-		methods: {
+    mounted() {
+      this.startList()
+    },
+    methods: {
+      setProductId(productId){
+        console.log('productId:'+productId)
+        this.productId=productId
+        this.startList()
+      },
+      startList() {
+        if(this.current===1){
+          this.getDayBacklogList()
+        }else {
+          this.totalNum = 999;
+          this.taskList = [];
+          this.page = 1;
+          this.isAjax = false;
+          this.getTaskReceiving();
+        }
+
+      },
+      getDayBacklogList(){
+        getDayBacklogList({'selectStr':this.selectStr}).then((res)=>{
+          if(res.code===1){
+            this.backlogList=res.data
+          }
+        })
+      },
+      getTaskReceiving() {
+        if (this.isAjax || (this.totalNum <= this.taskList.length)) {
+          return;
+        }
+        this.isAjax = true;
+        getTaskList({
+          'status': this.tabsList[this.current].id,
+          'selectStr': this.selectStr,
+          'phone': this.phone,
+          'name': this.name,
+          'productId': this.productId,
+          'stageId': this.stageId,
+          'departmentId': this.departmentId,
+          'startDate': this.startDate,
+          'endDate': this.endDate,
+          'page': this.page,
+        }).then((res) => {
+          this.isAjax = false;
+          if (res.code === 1) {
+            this.totalNum = res.data.totalNum
+            this.taskList.push(...res.data.items)
+            ++this.page;
+          }
+        })
+      },
 			tabsChange(index) {
-				this.current = index;
+        if(index!==this.current){
+          this.current = index;
+        }
 			},
 			// 下拉刷新
 			onRefresh() {
-				uni.showLoading({
-					title: '数据加载中'
-				})
-				setTimeout(() => {
-					uni.showToast({
-						title: '加载完成',
-						icon: 'none'
-					})
-					this.$refs.scroll.onEndPulling()
-				}, 1000)
+				// uni.showLoading({
+				// 	title: '数据加载中'
+				// })
+				// setTimeout(() => {
+				// 	uni.showToast({
+				// 		title: '加载完成',
+				// 		icon: 'none'
+				// 	})
+				// 	this.$refs.scroll.onEndPulling()
+				// }, 1000)
 				console.log("下拉刷新");
+        this.startList()
 			},
 			// 滚动到底部
 			onScrollBottom() {
-				uni.showLoading({
-					title: '数据加载中'
-				})
-				setTimeout(() => {
-					uni.showToast({
-						title: '加载完成',
-						icon: 'none'
-					})
-				}, 1000)
+				// uni.showLoading({
+				// 	title: '数据加载中'
+				// })
+        if(this.current===1){
+          this.getDayBacklogList()
+        }else {
+          this.getTaskReceiving();
+        }
+				// setTimeout(() => {
+				// 	uni.showToast({
+				// 		title: '加载完成',
+				// 		icon: 'none'
+				// 	})
+				// }, 1000)
 				console.log("到底部了");
 			},
-			//swiper滑动中
-			swiperTransition(e) {
-				this.$refs.tabs.setDx(e.detail.dx);
-			},
-			//swiper滑动结束
-			swiperAnimationfinish(e) {
-				this.current = e.detail.current;
-				this.$refs.tabs.unlockDx();
-			}
+
 		},
 	}
 </script>