|
|
@@ -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()
|
|
|
}
|