|
|
@@ -1,9 +1,13 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-button :disabled="data.status == '已完成'" class="inline-16" :type="data.status == '已完成'?'':'primary'" size="mini" @click="dialogFormVisible = true" >完成任务</el-button>
|
|
|
- <el-dialog title="完成任务" :visible.sync="dialogFormVisible" append-to-body width="500px">
|
|
|
- <el-form :model="form" label-position="top" label-width="90px">
|
|
|
- <el-form-item label="完成说明">
|
|
|
+ <el-button :disabled="data.status == '已完成'" :type="data.status == '已完成'?'':'primary'" size="mini" @click="onFinish" >完成任务</el-button>
|
|
|
+ <el-dialog title="完成任务" :visible.sync="dialogFormVisible" append-to-body width="450px">
|
|
|
+ <div style="display: flex;justify-content: space-between">
|
|
|
+ <span>完成说明</span>
|
|
|
+ <el-button type="primary" size="mini" @click="$refs.followRef.dialogTableVisible = true;$refs.followRef.listData()" :disabled="followParam.content.ownerid === ''">同步跟进内容</el-button>
|
|
|
+ </div>
|
|
|
+ <el-form :model="form" label-position="top" label-width="90px" style="margin-top: 10px">
|
|
|
+ <el-form-item>
|
|
|
<el-input v-model="form.finishnotes" type="textarea" :autosize="{minRows:5}" autocomplete="off" placeholder="输入任务完成说明"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
@@ -12,10 +16,12 @@
|
|
|
<el-button type="primary" @click="completeTask" size="small">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <followData ref="followRef" :param="followParam" @follow="follow"></followData>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import followData from "@/HManagement/task/components/followData";
|
|
|
export default {
|
|
|
props:['data'],
|
|
|
data () {
|
|
|
@@ -24,10 +30,24 @@ export default {
|
|
|
form:{
|
|
|
finishnotes:''
|
|
|
},
|
|
|
- nowUserid: JSON.parse(sessionStorage.getItem('active_account')).userid
|
|
|
+ nowUserid: JSON.parse(sessionStorage.getItem('active_account')).userid,
|
|
|
+ /*跟进列表*/
|
|
|
+ followParam:{
|
|
|
+ "id": 20231207130504,
|
|
|
+ "content": {
|
|
|
+ "ownertable": "",
|
|
|
+ "ownerid": ""
|
|
|
+ },
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
+ components:{followData},
|
|
|
methods:{
|
|
|
+ onFinish(){
|
|
|
+ this.dialogFormVisible = true
|
|
|
+ this.followParam.content.ownerid = this.data.ownerid
|
|
|
+ this.followParam.content.ownertable = this.data.ownertable
|
|
|
+ },
|
|
|
async completeTask () {
|
|
|
const res = await this.$api.requested({
|
|
|
"id":20221211112501,
|
|
|
@@ -41,10 +61,36 @@ export default {
|
|
|
this.form.finishnotes = ''
|
|
|
this.$emit('onSuccess')
|
|
|
})
|
|
|
+ },
|
|
|
+ follow(content,type,contacts,data){
|
|
|
+ if (this.followParam.content.ownertable === 'sa_customers' || this.followParam.content.ownertable === 'sa_project'){
|
|
|
+ if (contacts.length === 0){
|
|
|
+ this.form.finishnotes = '跟进类型:'+type+'\n'+ '跟进对象:'+'\n' + content
|
|
|
+ }else {
|
|
|
+ let obj = ''
|
|
|
+ contacts.forEach((item,index)=>{
|
|
|
+ if (index === contacts.length -1){
|
|
|
+ obj = obj + item
|
|
|
+ }else {
|
|
|
+ obj = obj + item + ','
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.form.finishnotes = '跟进类型:'+type+'\n'+ '跟进对象:'+obj+'\n' + content
|
|
|
+ }
|
|
|
+ }else if (this.followParam.content.ownertable === 'sa_customers'){
|
|
|
+ this.form.finishnotes = '跟进类型:'+ data.followupmode+'\n'+ content
|
|
|
+ } else {
|
|
|
+ this.form.finishnotes = content
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
-<style>
|
|
|
+<style scoped>
|
|
|
+ /deep/ .el-dialog__footer {
|
|
|
+ padding: 0px 20px 20px 20px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
</style>
|