|
|
@@ -1,52 +1,85 @@
|
|
|
<template>
|
|
|
<div class="inline-16">
|
|
|
<el-button icon="el-icon-edit" type="text" size="mini" @click="onShow(dialogFormVisible = true)" :disabled="status === '已结案' || status === '已失败'">编 辑</el-button>
|
|
|
- <el-dialog title="编辑跟进动态" width="600px" append-to-body :visible.sync="dialogFormVisible">
|
|
|
- <el-form ref="form" :model="form" label-position="top" label-width="80px">
|
|
|
- <el-form-item label="跟进动态" prop="content" :rules="{ required: true, message: '请填写跟进动态', trigger: 'blur'}">
|
|
|
- <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 18 }" v-model="form.content" placeholder="请输入跟进动态" autocomplete="off"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <div class="flex-align-center flex-between pionter" v-for="file in data.attinfos" :key="file.index">
|
|
|
- <div class="flex-align-center">
|
|
|
- <img width="30" :src="checkFileType(file.postfix) === 'file'?require('@/assets/file_icons/file.svg'):file.url" class="inline-16" alt="">
|
|
|
- <div class="file__link inline-16">
|
|
|
- <a :href="file.url">{{file.document}}</a>
|
|
|
- <p>{{(file.contentlength / 1024).toFixed(2)}}kb</p>
|
|
|
+ <el-drawer title="编辑跟进动态" size="600px" append-to-body :visible.sync="dialogFormVisible" @close="onClose">
|
|
|
+ <div class="drawer__panel">
|
|
|
+ <el-form ref="form" :model="form" label-position="top" label-width="80px">
|
|
|
+ <el-form-item v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'" label="跟进类型" prop="type" :rules="{ required: true, message: '请选择跟进类型', trigger: 'change'}">
|
|
|
+ <el-select v-model="form.type" placeholder="请选择" style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in followUpType"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'" label="跟进对象" prop="dataextend.contactsid" :rules="{ required: true, message: '请选择跟进对象', trigger: 'change'}">
|
|
|
+ <el-tag
|
|
|
+ style="float: left;margin-right: 5px;margin-bottom: 5px"
|
|
|
+ v-for="tag in selectTag"
|
|
|
+ :key="tag.index"
|
|
|
+ closable
|
|
|
+ @close="closeTag(tag)"
|
|
|
+ :type="tag.type">
|
|
|
+ {{tag.name}}
|
|
|
+ </el-tag>
|
|
|
+ <contactsList style="float: left" @onSelect="onSelect" ref="listData" :selects="form.dataextend.contactsid" :sys_enterpriseid="sys_enterpriseid"></contactsList>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="跟进动态" prop="content" :rules="{ required: true, message: '请填写跟进动态', trigger: 'blur'}">
|
|
|
+ <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 18 }" v-model="form.content" placeholder="请输入跟进动态" autocomplete="off"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <div class="flex-align-center flex-between pionter" v-for="file in data.attinfos" :key="file.index">
|
|
|
+ <div class="flex-align-center">
|
|
|
+ <img width="30" :src="checkFileType(file.postfix) === 'file'?require('@/assets/file_icons/file.svg'):file.url" class="inline-16" alt="">
|
|
|
+ <div class="file__link inline-16">
|
|
|
+ <a :href="file.url">{{file.document}}</a>
|
|
|
+ <p>{{(file.contentlength / 1024).toFixed(2)}}kb</p>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <i style="color:red;" class="el-icon-delete" @click="deleteFile(file)"></i>
|
|
|
</div>
|
|
|
- <i style="color:red;" class="el-icon-delete" @click="deleteFile(file)"></i>
|
|
|
- </div>
|
|
|
- <upload
|
|
|
- :folderid="folderid"
|
|
|
- btntype="icon"
|
|
|
- @onSuccess="onSuccess"
|
|
|
- :hidemediastock="false"
|
|
|
- :bindData=" {ownertable: 'sys_datafollowup', ownerid: data.sys_datafollowupid,usetype: 'default'}">
|
|
|
- </upload>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button size="small" @click="dialogFormVisible = false">取 消</el-button>
|
|
|
+ <upload
|
|
|
+ :folderid="folderid"
|
|
|
+ btntype="icon"
|
|
|
+ @onSuccess="onSuccess"
|
|
|
+ :hidemediastock="false"
|
|
|
+ :bindData=" {ownertable: 'sys_datafollowup', ownerid: data.sys_datafollowupid,usetype: 'default'}">
|
|
|
+ </upload>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div class="fixed__btn__panel">
|
|
|
+ <el-button size="small" @click="onClose">取 消</el-button>
|
|
|
<el-button type="warning" size="small" @click="submitLog">保 存</el-button>
|
|
|
</div>
|
|
|
- </el-dialog>
|
|
|
+ </el-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import upload from '@/components/upload/hw_obs_upload.vue'
|
|
|
import previewImage from '@/components/previewImage/index.vue'
|
|
|
+import contactsList from '@/template/projectChange/contactsList.vue'
|
|
|
export default {
|
|
|
props:['data','ownertable','status'],
|
|
|
components:{
|
|
|
upload,
|
|
|
- previewImage
|
|
|
+ previewImage,
|
|
|
+ contactsList
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
dialogFormVisible:false,
|
|
|
+ sys_enterpriseid:'',
|
|
|
form:{
|
|
|
- content:''
|
|
|
+ content:'',
|
|
|
+ type:'',
|
|
|
+ dataextend: {
|
|
|
+ contactsid: [] // 跟进对象
|
|
|
+ }//扩展参数
|
|
|
},
|
|
|
+ followUpType:[],
|
|
|
+ selectTag:[],
|
|
|
folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
|
|
|
attachmentids:[]
|
|
|
}
|
|
|
@@ -55,6 +88,14 @@ export default {
|
|
|
methods:{
|
|
|
onShow () {
|
|
|
this.form = Object.assign({},this.form,this.data)
|
|
|
+ console.log(this.form,'表单数据')
|
|
|
+ this.selectTag = this.form.contacts
|
|
|
+ this.queryFollowUpType()
|
|
|
+ },
|
|
|
+ /*获取跟进类型*/
|
|
|
+ async queryFollowUpType(){
|
|
|
+ const res = await this.$store.dispatch('optiontypeselect','datafollowuptype')
|
|
|
+ this.followUpType = res.data
|
|
|
},
|
|
|
onSuccess(res) {
|
|
|
res.attinfos = JSON.parse(res.attinfos)
|
|
|
@@ -72,8 +113,11 @@ export default {
|
|
|
"sys_datafollowupid":this.data.sys_datafollowupid,
|
|
|
"ownertable":this.ownertable,
|
|
|
"ownerid":this.$route.query.id,
|
|
|
- "type":"",
|
|
|
- "content":this.form.content
|
|
|
+ "type":this.form.type,
|
|
|
+ "content":this.form.content,
|
|
|
+ "dataextend": {
|
|
|
+ "contactsid": this.form.dataextend.contactsid // 跟进对象
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
@@ -114,6 +158,26 @@ export default {
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
this.queryLogs()
|
|
|
})
|
|
|
+ },
|
|
|
+ onSelect(row){
|
|
|
+ this.selectTag = row
|
|
|
+ this.form.dataextend.contactsid = row.map(item=>item.contactsid)
|
|
|
+ this.$refs.form.validateField('dataextend.contactsid')
|
|
|
+ },
|
|
|
+ closeTag(row){
|
|
|
+ for (var i=0;i<this.selectTag.length;i++){
|
|
|
+ if (row.contactsid === this.selectTag[i].contactsid){
|
|
|
+ this.selectTag.splice(i,1)
|
|
|
+ this.form.dataextend.contactsid.splice(i,1)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onClose(){
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.selectTag = []
|
|
|
+ this.form.dataextend.contactsid = []
|
|
|
+ this.$refs.form.resetFields()
|
|
|
}
|
|
|
}
|
|
|
}
|