|
|
@@ -3,68 +3,117 @@
|
|
|
<el-form ref="form" label-width="96px" :model="form" :rules="rules">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="跟进类型" prop="followType">
|
|
|
- <el-input v-model="form.followType" />
|
|
|
+ <el-form-item label="跟进时间" prop="followDate">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.followDate"
|
|
|
+ placeholder="选择日期"
|
|
|
+ style="width: 100%"
|
|
|
+ type="datetime"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="跟进时间" prop="followDate">
|
|
|
- <el-date-picker v-model="form.followDate" placeholder="选择日期" style="width: 100%" type="datetime" />
|
|
|
+ <el-form-item label="跟进方式" prop="followType">
|
|
|
+ <el-select v-model="form.followType" placeholder="请选择" style="width: 100%">
|
|
|
+ <el-option v-for="item in followTypeOptions" :key="item.key" :label="item.value" :value="item.key" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <!-- <el-col :span="12">-->
|
|
|
+ <!-- <el-form-item label="跟进内容" prop="followContentType">-->
|
|
|
+ <!-- <el-select v-model="form.followContentType" placeholder="请选择跟进内容" style="width: 100%">-->
|
|
|
+ <!-- <el-option-->
|
|
|
+ <!-- v-for="item in followContentTypeOptions"-->
|
|
|
+ <!-- :key="item.key"-->
|
|
|
+ <!-- :label="item.value"-->
|
|
|
+ <!-- :value="item.key" />-->
|
|
|
+ <!-- </el-select>-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
+ <!-- <el-col v-if="followContentType !== '10'" :span="12">-->
|
|
|
+ <!-- <el-form-item label="总部支持人员" prop="supportName">-->
|
|
|
+ <!-- <el-input v-model="form.supportName" />-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="跟进内容" prop="followContent">
|
|
|
<el-input
|
|
|
v-model="form.followContent"
|
|
|
- placeholder="请输入跟进内容"
|
|
|
+ placeholder="请输入拜访对象,协同拜访人员、具体沟通内容、进展或问题,下一步工作计划及完成时间"
|
|
|
rows="5"
|
|
|
show-word-limit
|
|
|
type="textarea" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="提醒对象" prop="reminders">
|
|
|
- <el-input v-model="form.reminders" />
|
|
|
+ <el-form-item label="联系人" prop="contactsName">
|
|
|
+ <el-input v-model="form.contactsName" readonly suffix-icon="el-icon-search" @focus="handleSelectContact" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="下次联系时间" prop="nextTime">
|
|
|
- <el-date-picker v-model="form.nextTime" placeholder="选择日期" style="width: 100%" type="datetime" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="备注" prop="remark">
|
|
|
- <el-input v-model="form.remark" placeholder="请输入备注信息" rows="5" show-word-limit type="textarea" />
|
|
|
+ <el-form-item label="上传附件" prop="files">
|
|
|
+ <el-upload
|
|
|
+ ref="uploadRef"
|
|
|
+ action="#"
|
|
|
+ :before-upload="
|
|
|
+ (file) => {
|
|
|
+ return beforeAvatarUpload(file)
|
|
|
+ }
|
|
|
+ "
|
|
|
+ :file-list="fileList"
|
|
|
+ :http-request="uploadrequest">
|
|
|
+ <el-button size="mini" type="primary">点击上传</el-button>
|
|
|
+ </el-upload>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <!-- <el-col :span="12">-->
|
|
|
+ <!-- <el-form-item label="提醒对象" prop="reminders">-->
|
|
|
+ <!-- <el-input v-model="form.reminders" />-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
+ <!-- <el-col :span="12">-->
|
|
|
+ <!-- <el-form-item label="下次联系时间" prop="nextTime">-->
|
|
|
+ <!-- <el-date-picker v-model="form.nextTime" placeholder="选择日期" style="width: 100%" type="datetime" />-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
+ <!-- <el-col :span="24">-->
|
|
|
+ <!-- <el-form-item label="备注" prop="remark">-->
|
|
|
+ <!-- <el-input v-model="form.remark" placeholder="请输入备注信息" rows="5" show-word-limit type="textarea" />-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="close">取 消</el-button>
|
|
|
<el-button type="primary" @click="save">确 定</el-button>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- 选择客户联系人弹窗 -->
|
|
|
+ <select-contact
|
|
|
+ ref="selectContact"
|
|
|
+ :default-customer="customerInfo"
|
|
|
+ :query-params="queryContact"
|
|
|
+ @save="selectContact" />
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import followApi from '@/api/customer/follow'
|
|
|
+ import SelectContact from '@/components/select/SelectCustomerContact'
|
|
|
+ import asyncUploadFile from '@/utils/uploadajax'
|
|
|
+ import axios from 'axios'
|
|
|
|
|
|
export default {
|
|
|
name: 'FollowAdd',
|
|
|
- props: {
|
|
|
- // 跟进信息
|
|
|
- followup: {
|
|
|
- type: Object,
|
|
|
- default() {
|
|
|
- return {}
|
|
|
- },
|
|
|
- },
|
|
|
+ components: {
|
|
|
+ SelectContact,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
form: {
|
|
|
followType: '',
|
|
|
followDate: '',
|
|
|
+ followContentType: '',
|
|
|
followContent: '',
|
|
|
targetId: '',
|
|
|
targetName: '',
|
|
|
@@ -76,36 +125,84 @@
|
|
|
reminders: '',
|
|
|
nextTime: '',
|
|
|
remark: '',
|
|
|
+ supportName: '',
|
|
|
+ files: [],
|
|
|
},
|
|
|
rules: {
|
|
|
- followType: [{ required: true, trigger: 'blur', message: '请输入跟进类型' }],
|
|
|
+ followType: [{ required: true, trigger: 'blur', message: '请输入跟进方式' }],
|
|
|
followDate: [{ required: true, trigger: 'blur', message: '请输入跟进时间' }],
|
|
|
+ followContentType: [{ required: true, trigger: 'blur', message: '请输入跟进内容类型' }],
|
|
|
followContent: [{ required: true, trigger: 'blur', message: '请输入跟进内容' }],
|
|
|
targetId: [{ required: true, trigger: 'blur', message: '请选择跟进对象' }],
|
|
|
targetName: [{ required: true, trigger: 'blur', message: '跟进对象不能为空' }],
|
|
|
- targetType: [{ required: true, trigger: 'blur', message: '请输入标题' }],
|
|
|
+ targetType: [{ required: true, trigger: 'blur', message: '跟进对象类型不能为空' }],
|
|
|
custId: [{ required: true, trigger: 'blur', message: '请选择关联客户' }],
|
|
|
custName: [{ required: true, trigger: 'blur', message: '客户名称不能为空' }],
|
|
|
contactsId: [{ required: true, trigger: 'blur', message: '请选择关联联系人' }],
|
|
|
contactsName: [{ required: true, trigger: 'blur', message: '联系人姓名不能为空' }],
|
|
|
+ supportName: [{ required: true, trigger: 'blur', message: '总部支持人员不能为空' }],
|
|
|
},
|
|
|
title: '',
|
|
|
dialogFormVisible: false,
|
|
|
+ fileList: [],
|
|
|
+ fileSettings: {
|
|
|
+ // 文件配置信息
|
|
|
+ fileSize: 52428800,
|
|
|
+ fileTypes: '.doc,.docx,.zip,.xls,.xlsx,.rar,.jpg,.jpeg,.gif,.png,.jfif,.txt',
|
|
|
+ pictureSize: 52428800,
|
|
|
+ pictureTypes: '.jpg,.jpeg,.gif,.png,.jfif,.txt',
|
|
|
+ types: '.doc,.docx,.zip,.xls,.xlsx,.rar,.jpg,.jpeg,.gif,.png,.jfif,.mp4,.txt',
|
|
|
+ videoSize: 104857600,
|
|
|
+ videoType: '.mp4',
|
|
|
+ },
|
|
|
+ queryContact: {},
|
|
|
+ customerInfo: {},
|
|
|
+ followTypeOptions: [],
|
|
|
+ followContentTypeOptions: [],
|
|
|
}
|
|
|
},
|
|
|
watch: {},
|
|
|
- created() {},
|
|
|
+ created() {
|
|
|
+ this.getOptions()
|
|
|
+ },
|
|
|
methods: {
|
|
|
- showEdit() {
|
|
|
+ getOptions() {
|
|
|
+ Promise.all([this.getDicts('plat_follow_type'), this.getDicts('plat_follow_content_type')]).then(
|
|
|
+ ([followType, followContentType]) => {
|
|
|
+ this.followTypeOptions = followType.data.values || []
|
|
|
+ this.followContentTypeOptions = followContentType.data.values || []
|
|
|
+ }
|
|
|
+ )
|
|
|
+ },
|
|
|
+ handleSelectContact() {
|
|
|
+ if (!this.queryContact.custId) {
|
|
|
+ this.$message.warning('请先选择客户')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$refs.selectContact.open()
|
|
|
+ },
|
|
|
+ selectContact(val) {
|
|
|
+ if (val && val.length > 0) {
|
|
|
+ this.form.contactsId = val[0].id
|
|
|
+ this.form.contactsName = val.map((item) => item.cuctName).join()
|
|
|
+ }
|
|
|
+ console.log(this.form)
|
|
|
+ },
|
|
|
+ showEdit(row) {
|
|
|
this.title = '添加跟进记录'
|
|
|
- this.form = { ...this.followup }
|
|
|
- console.log(this.followup)
|
|
|
+ this.form = Object.assign(this.form, row)
|
|
|
console.log(this.form)
|
|
|
+ this.queryContact.custId = this.form.custId
|
|
|
+ this.customerInfo = {
|
|
|
+ custId: this.form.custId,
|
|
|
+ custName: this.form.custName,
|
|
|
+ }
|
|
|
this.dialogFormVisible = true
|
|
|
},
|
|
|
close() {
|
|
|
this.$refs['form'].resetFields()
|
|
|
this.form = this.$options.data().form
|
|
|
+ this.fileList = []
|
|
|
this.dialogFormVisible = false
|
|
|
},
|
|
|
save() {
|
|
|
@@ -120,6 +217,60 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ // 上传图片
|
|
|
+ beforeAvatarUpload(file) {
|
|
|
+ let flag1 = file.size < this.fileSettings.fileSize
|
|
|
+ if (!flag1) {
|
|
|
+ this.$message.warning('文件过大,请重新选择!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let flag2 = this.fileSettings.fileTypes.split(',').includes('.' + file.name.split('.').pop())
|
|
|
+ if (!flag2) {
|
|
|
+ this.$message.warning('文件类型不符合,请重新选择!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ },
|
|
|
+ // 上传
|
|
|
+ uploadrequest(option) {
|
|
|
+ let _this = this
|
|
|
+ let url = process.env.VUE_APP_UPLOAD_WEED
|
|
|
+ axios
|
|
|
+ .post(url)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.data && res.data.fid && res.data.fid !== '') {
|
|
|
+ option.action = `${process.env.VUE_APP_PROTOCOL}${res.data.publicUrl}/${res.data.fid}`
|
|
|
+ let file_name = option.file.name
|
|
|
+ let index = file_name.lastIndexOf('.')
|
|
|
+ let file_extend = ''
|
|
|
+ if (index > 0) {
|
|
|
+ // 截取名称中的扩展名
|
|
|
+ file_extend = file_name.substr(index + 1)
|
|
|
+ }
|
|
|
+ let uploadform = {
|
|
|
+ fileName: file_name, // 资料名称
|
|
|
+ fileUrl: `${process.env.VUE_APP_PROTOCOL}${res.data.publicUrl}/${res.data.fid}`, // 资料存储url
|
|
|
+ size: option.file.size.toString(), // 资料大小
|
|
|
+ fileType: file_extend, // 资料文件类型
|
|
|
+ }
|
|
|
+ asyncUploadFile(option).then(() => {
|
|
|
+ _this.form.files.push(uploadform)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '未上传成功!请刷新界面重新上传!',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(function () {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '未上传成功!请重新上传!',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|