USER-20230908AJ\Administrator 1 ano atrás
pai
commit
c2d86a6331

+ 4 - 1
components/en-utils/en-select/en-select.vue

@@ -16,7 +16,7 @@
 				</view>
 			</scroll-view>
 		</view>
-		<EnButton :is_fixed="false"></EnButton>
+		<EnButton :is_fixed="false" text="确认"  @onSubmit="setAffirm(true)" @onLeftSubmit="setAffirm(false)"></EnButton>
 	</view>
 </template>
 
@@ -61,6 +61,9 @@
 			}
 		},
 		methods: {
+      setAffirm(type){
+        this.$emit('setAffirm',type)
+      },
 			onSelect(index) {
 				this.$emit('onChange', index)
 				this.$emit('input', this.localData[index][this.itemKey])

+ 4 - 2
page_task/task_details/module/record.vue

@@ -89,7 +89,7 @@
     },
     watch:{
       'businessId':function () {
-        this.getMsgList()
+
       }
     },
 		data() {
@@ -107,8 +107,10 @@
       }
 		},
 		methods: {
+      startData(){
+        this.getMsgList()
+      },
       setMsg() {
-        console.log('------butClick--------------')
         if (this.isAjax) {
           return;
         }

+ 3 - 0
page_task/task_details/module/send_chat.vue

@@ -82,6 +82,9 @@
       }
     },
 		methods: {
+      showImg(item, index) {
+
+      },
       clickBut(){
         console.log('------butClick--------------')
           this.$emit('butClick')

+ 105 - 8
page_task/task_details/task_details.vue

@@ -61,11 +61,20 @@
 					</z-swiper>
 				</view>
 			</view>
-			<Record v-show="current === 3" :business-id="businessId"></Record>
+			<Record v-show="current === 3" ref="recordObj" :business-id="businessId"></Record>
 			<Steps v-show="current === 4" :business-id="businessId"></Steps>
 		</view>
-		<EnButton :text="'冲销'" v-if="current === 1"></EnButton>
-		<EnButton is_both :leftText="'交接'" :rightText="'操作'" v-if="current === 2" @onSubmit="onSubmit"></EnButton>
+    <view v-if="isExecute>0 && business.status<4">
+      <EnButton :text="'领取'"  v-if="isExecute===3" @onSubmit="takeTask"></EnButton>
+      <EnButton :text="'完成'"  v-else-if="isExecute===5" @onSubmit="endTask"></EnButton>
+
+    </view>
+<!--		<EnButton :text="'冲销'" v-if="current === 1"></EnButton>-->
+		<EnButton is_both :leftText="'交接'" :rightText="'操作'"  @onSubmit="setTaskOperate(1)" @onLeftSubmit="openExecute"></EnButton>
+    <uni-popup ref="executePopup" type="bottom">
+      <EnSelect title="请选择任务接收人"  :local-data="executeData" ref="system" v-model="executeId" @setAffirm="setNewExecute"></EnSelect>
+    </uni-popup>
+
 	</view>
 </template>
 
@@ -84,13 +93,17 @@
 	// 跟进记录
 	import Record from "./module/record.vue"
 	import tools from "@/service/tools";
-	import {
-		getStageList,
-		getTaskDetail
-	} from "@/api/task";
+  import {
+    endTask,
+    getExecuteList,
+    getStageList,
+    getTaskDetail, setExecute, takeTask
+  } from "@/api/task";
+  import EnSelect from "@/components/en-utils/en-select/en-select.vue";
 
 	export default {
 		components: {
+      EnSelect,
 			TaskTab,
 			Identity,
 			ThirdParty,
@@ -150,7 +163,8 @@
 					imgList: [],
 					videoList: [],
 				},
-				videoUrl: ''
+				videoUrl: '',
+        executeId:''
 			}
 		},
 		onLoad(data) {
@@ -162,6 +176,88 @@
 			}
 		},
 		methods: {
+      endTask() {
+        uni.showModal({
+          title: '提示',
+          content: '是否完成当前任务?',
+          success: (res) => {
+            console.log(res)
+            if (res.confirm) {
+
+              endTask({
+                'id': this.business.id
+              }).then((res) => {
+                if (res.code === 1) {
+                  this.business.status = 4;
+                  this.isExecute = 0;
+                  tools.success(res.msg)
+                  uni.$emit('newReceiving')
+                } else {
+                  tools.error(res.msg)
+                }
+              })
+            }
+          }
+        });
+      },
+      takeTask() {
+        if (this.isAjax) {
+          // return;
+        }
+        this.isAjax = true;
+        takeTask({
+          'id': this.business.id
+        }).then((res) => {
+          if (res.code === 1) {
+            tools.success('领取成功')
+            uni.$emit('newReceiving')
+            this.getTaskDetail()
+          } else {
+            this.isAjax = false;
+            tools.error(res.msg)
+          }
+        })
+      },
+      setNewExecute(type) {
+        if(type){
+          //设置新执行人
+          if(this.executeId<=0){
+            tools.error('请选择执行人')
+            return
+          }
+          setExecute({
+            'business_id': this.businessId,
+            'user_id': this.executeId
+          }).then((res) => {
+            if (res.code === 1) {
+              tools.success(res.msg)
+              uni.$emit('newReceiving')
+              this.getTaskDetail()
+
+            } else {
+              tools.error(res.msg)
+            }
+          })
+        }
+        this.$refs.executePopup.close('bottom')
+
+      },
+      openExecute() {
+        this.executeData = [];
+        getExecuteList({
+          'business_id': this.businessId
+        }).then((res) => {
+          if (res.code === 1) {
+            this.executeData=res.data
+            this.$refs.executePopup.open('bottom')
+          }
+        })
+      },
+      setTaskOperate(type){
+          uni.navigateTo({
+            'url':'/page_task/task_operate/task_operate?businessId='+this.businessId+'&type='+type
+          })
+      },
 			async getTaskDetail() {
 				const res = await getTaskDetail({
 					id: this.businessId
@@ -178,6 +274,7 @@
 					this.stageData = res.data.stageData
 					this.isExecute = res.data.isExecute
 					this.businessFile = res.data.businessFile
+          this.$refs.recordObj.startData()
 				} else {
 					tools.leftClick()
 				}

+ 1 - 1
pages.json

@@ -187,7 +187,7 @@
 			{
 				"name": "任务详情",
 				"path": "/page_task/task_details/task_details",
-				"query": "taskId=1793"
+				"query": "taskId=4278"
 			}
 
 		]