抖音直播线索

dev-qsh
zcx 1 year ago
parent f727796d1f
commit 85a36e7fd9
  1. 2
      src/views/zs/clue/ClueForm/index.vue
  2. 24
      src/views/zs/clue/columns.js
  3. 257
      src/views/zs/clue/components/DYClueFormDialog.vue
  4. 22
      src/views/zs/clue/components/UploadDialog.vue
  5. 27
      src/views/zs/clue/index.vue

@ -75,7 +75,7 @@
<el-col :span="24">
<el-form-item label="意向状态" prop="intentionState">
<el-select style="width: 100%;" v-model="clueForm.intentionState" placeholder="请选择" clearable>
<el-option v-for="dict in intentionOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue">
<el-option v-for="dict in intentionOptions.filter(item => item.remark == undefined || item.remark == '正常')" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue">
<i class="el-icon-star-on" :style="dict.cssClass" />
<span style="float: right; color: #8492a6; font-size: 13px">
{{ dict.dictValue }}

@ -108,5 +108,29 @@ export const defaultColumns = [{
width: 140,
visible: true,
overflow: true
},
{
key: 14,
prop: 'goodName',
label: '商品名称',
width: 140,
visible: true,
overflow: true
},
{
key: 15,
prop: 'amountReceived',
label: '订单实收',
width: 140,
visible: true,
overflow: true
},
{
key: 16,
prop: 'writeOffTime',
label: '核销时间',
width: 140,
visible: true,
overflow: true
}
];

@ -0,0 +1,257 @@
<template>
<div style="margin-bottom: 50px">
<el-dialog title="抖音线索" :close-on-click-modal="false" append-to-body :visible.sync="visible" width="700px" @close="visible = false">
<el-form ref="clueForm" :model="clueForm" :rules="rules" label-width="110px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="创建时间" prop="createTime">
<el-date-picker style="width: 100%;" v-model="clueForm.createTime" value-format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm" type="datetime" :disabled="admin!='true'" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="线索来源" prop="source">
<el-select style="width: 100%;" v-model="clueForm.source" placeholder="请选择" clearable>
<el-option v-for="dict in sourceOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="姓名" prop="name">
<el-input v-model="clueForm.name" placeholder="请输入姓名" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系方式" prop="phone">
<el-input v-model="clueForm.phone" placeholder="请输入联系方式" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="商品名称" prop="goodName">
<el-input v-model="clueForm.goodName" placeholder="请输入微信号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="订单实收" prop="amountReceived">
<el-input v-model="clueForm.amountReceived" placeholder="请输入微信号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="跟进人员" prop="followUser">
<el-select style="width: 100%;" v-model="clueForm.followUser" multiple clearable :disabled="admin != 'true' && clueForm.clueId != undefined">
<el-option v-for="dict in userOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="意向状态" prop="intentionState">
<el-select style="width: 100%;" v-model="clueForm.intentionState" placeholder="请选择" clearable>
<el-option v-for="dict in intentionOptions.filter(item => item.remark == undefined || item.remark == '抖音')" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue">
<i class="el-icon-star-on" :style="dict.cssClass" />
<span style="float: right; color: #8492a6; font-size: 13px">
{{ dict.dictValue }}
</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="核销时间" prop="writeOffTime">
<el-date-picker style="width: 100%;" v-model="clueForm.writeOffTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="下次跟进时间" prop="followTime">
<el-date-picker style="width: 100%;" v-model="clueForm.followTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="clueMemo">
<el-input v-model="clueForm.clueMemo" type="textarea" :rows="5" maxlength="10009" />
</el-form-item>
</el-col>
<!-- 跟进记录 -->
<el-col :span="24" style="margin-top: 20px;">
<el-form-item label="跟进记录" prop="clueMemo" label-position="top">
<FollowRecord v-if="clueId" :clueId="clueId" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button plain @click="(visible = false)">取消</el-button>
<el-button v-jclick type="primary" :disabled="!canSubmit" @click="clueSubmit()">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<!-- eslint-disable no-undef -->
<script>
import { getConsultRecord, addClue, updateClue, } from '@/api/zs/clue'
import empApi from '@/api/system/employee'
import FollowRecord from '../ClueForm/components/FollowRecord.vue';
// import AMap from 'AMap';
export default {
name: 'ClueForm',
components: {
FollowRecord
},
data() {
return {
admin: localStorage.getItem('admin'),
userId: localStorage.getItem('userId'),
clueId: undefined,
clueForm: {
followTime: undefined
},
rules: {
name: { required: true, message: '姓名不为空', trigger: 'blur' },
phone: [{ required: true, message: '联系方式不为空', trigger: 'blur' },
{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur' }],
createTime: { required: true, message: '创建时间不为空', trigger: 'blur,change' },
consultTime: { required: true, message: '咨询时间不为空', trigger: 'blur,change' },
source: { required: true, message: '线索来源不为空', trigger: 'blur,change' },
address: { required: true, message: '位置不为空', trigger: 'blur' },
intentionState: { required: true, message: '意向状态不为空', trigger: 'blur,change' },
goodName: { required: true, message: '商品名称不为空', trigger: 'blur,change' },
amountReceived: { required: true, message: '订单实收不为空', trigger: 'blur,change' }
},
userOptions: [],//
sourceOptions: [],//线
intentionOptions: [],//
placeList: [],//
mapDialogVisible: false,
consultRecord: [],
canSubmit: true,
saveNextShow: true,
saveNext: false,
visible: false
};
},
created() {
this.getEmployee();
// 线
this.getDicts('dm_source').then((response) => {
this.sourceOptions = response.data;
});
//
this.getDicts('dm_intention_state').then((response) => {
this.intentionOptions = response.data.filter(item => item.remark == undefined || item.remark == '抖音');
});
},
methods: {
init(info){
this.canSubmit = true;
this.$nextTick(() => {
this.resetDialogForm();
// this.$refs['dialogForm'].resetFields();
if (info) {
this.clueForm = this.deepClone(info);
if(this.clueForm.clueId){
this.clueId = this.clueForm.clueId
this.getConsultRecord(this.clueForm.phone);
}
}
this.visible = true;
});
},
resetDialogForm() {
this.clueForm = {
clueId: undefined,
createTime: this.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'),
consultTime: undefined,
source: "抖音直播",
name: undefined,
phone: undefined,
address: undefined,
intentionState: undefined,
followInfo: undefined,
followTime: undefined,
followUser: [],
signupInfo: undefined,
requirement: undefined,
licenseType: undefined,
lng: undefined,
lat: undefined,
goodName: undefined,
amountReceived: undefined,
writeOffTime: undefined
}
if (this.admin == 'false') {
this.clueForm.followUser.push(Number(this.userId))
}
},
//
getConsultRecord(phone) {
getConsultRecord({ phone }).then((resp) => {
if (resp && resp.code === 200 && resp.data) {
this.consultRecord = resp.data
if (this.consultRecord && this.consultRecord.length > 0) {
this.clueForm.consultCount = this.consultRecord.length
}
}
})
},
// 线
getEmployee() {
empApi.getEmployee().then((resp) => {
if (resp.code === 200) {
this.userOptions = resp.data;
// this.userOptions = this.userOptions.filter((item) => {
// return item.accept;
// });
}
});
},
//
clueSubmit() {
this.$refs.clueForm.validate(async (valid) => {
if (valid) {
this.canSubmit = false
let resp
if (this.clueForm.clueId) {
resp = await updateClue(this.clueForm)
this.canSubmit = true
if (resp.code === 200) {
this.$message.success('修改成功')
this.$emit('refreshDataList');
this.visible = false
}
} else {
resp = await addClue(this.clueForm)
this.canSubmit = false
if (resp.code === 200) {
if (resp.data && resp.data == 1) {
this.$message({
message: resp.msg,
type: 'warning'
});
} else {
this.$message.success('新增成功')
}
this.$emit('refreshDataList');
this.visible = false
}
}
}
})
},
}
};
</script>

@ -1,6 +1,6 @@
<template>
<el-dialog :title="title" :close-on-click-modal="false" append-to-body :visible.sync="visible" width="400px">
<el-upload ref="upload" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?ydtData=' + ydtData" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<el-upload ref="upload" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?ydtData=' + ydtData+ '&dYData=' + dYData" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload" />
<div class="el-upload__text">
将文件拖到此处
@ -28,6 +28,7 @@ export default {
canSubmit: true,
isUploading: true,
ydtData: false,
dYData: false,
title: '学员信息导入',
upload: {
//
@ -40,19 +41,30 @@ export default {
};
},
methods: {
init(info = false) {
init(info = {}) {
this.visible = true;
this.ydtData = false;
this.ydtData = false;
this.canSubmit = true;
this.$nextTick(() => {
if (info) {
this.ydtData = info;
this.title = '一点通-' + this.title;
this.ydtData = info.ydtData;
this.dYData = info.dYData;
if(this.ydtData){
this.title = "一点通" + this.title;
}
if(this.dYData){
this.title = "抖音" + this.title;
}
}
});
},
/** 下载模板操作 */
importTemplate() {
this.download('zs/clue/importTemplate?ydtData=' + this.ydtData, {}, `clue_template_${new Date().getTime()}.xlsx`);
debugger
this.download('zs/clue/importTemplate?ydtData=' + this.ydtData + '&dYData=' + this.dYData, {}, `clue_template_${new Date().getTime()}.xlsx`);
},
//
handleFileUploadProgress(event, file, fileList) {

@ -4,8 +4,12 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button v-hasPermi="['zs:clue:add']" icon="el-icon-plus" type="primary" @click="handleAddandUpdate(undefined)">新增</el-button>
<el-button v-hasPermi="['zs:clue:import']" icon="el-icon-upload" type="warning" @click="handleImport(false)">导入</el-button>
<el-button v-hasPermi="['zs:clue:import']" icon="el-icon-upload" type="warning" @click="handleImport(true)">一点通导入</el-button>
<el-button v-hasPermi="['zs:clue:add']" icon="el-icon-plus" type="primary" @click="handleDYAddandUpdate(undefined)">抖音新增</el-button>
<el-button v-hasPermi="['zs:clue:import']" icon="el-icon-upload" type="warning" @click="handleImport(false,false)">导入</el-button>
<el-button v-hasPermi="['zs:clue:import']" icon="el-icon-upload" type="warning" @click="handleImport(true, false)">一点通导入</el-button>
<el-button v-hasPermi="['zs:clue:import']" icon="el-icon-upload" type="warning" @click="handleImport(false, true)">抖音导入</el-button>
<el-button v-hasPermi="['zs:clue:export']" icon="el-icon-download" type="warning" @click="handleExport">导出</el-button>
<el-button v-hasPermi="['zs:clue:edit']" icon="el-icon-edit" type="primary" :disabled="multiple" @click="handleBatChUpdate()">批量修改</el-button>
<el-button type="primary" @click="handlePublicClue">公海</el-button>
@ -25,7 +29,8 @@
</el-table-column>
<el-table-column label="操作" fixed="right" align="left" min-width="200">
<template slot-scope="scope">
<el-button v-if="(admin == 'true' || scope.row.followUser2.indexOf(userId) != -1 )" v-hasPermi="['zs:clue:edit']" type="text" style="color: red;" @click.native.stop="handleAddandUpdate(scope.row)">编辑</el-button>
<el-button v-if="(admin == 'true' || scope.row.followUser2.indexOf(userId) != -1 ) && scope.row.source == '抖音直播'" v-hasPermi="['zs:clue:edit']" type="text" style="color: red;" @click.native.stop="handleDYAddandUpdate(scope.row)">编辑</el-button>
<el-button v-if="(admin == 'true' || scope.row.followUser2.indexOf(userId) != -1 ) && scope.row.source != '抖音直播'" v-hasPermi="['zs:clue:edit']" type="text" style="color: red;" @click.native.stop="handleAddandUpdate(scope.row)">编辑</el-button>
<el-button v-if="(admin == 'true' || scope.row.followUser2.indexOf(userId) != -1 )" v-hasPermi="['zs:clue:distribute']" type="text" @click.native.stop="handleDistribute(scope.row)">分发</el-button>
<el-button v-if="(admin == 'true' || scope.row.followUser2.indexOf(userId) != -1 ) && scope.row.state" v-hasPermi="['zs:clue:sign']" type="text" style="color: #26a69a" @click.native.stop="handleSign(scope.row)">已登记</el-button>
<el-button v-if="(admin == 'true' || scope.row.followUser2.indexOf(userId) != -1 ) && !scope.row.state" v-hasPermi="['zs:clue:sign']" type="text" @click.native.stop="handleSign(scope.row)">未登记</el-button>
@ -51,6 +56,8 @@
<ZhuangDanDialog ref="zhuangDanDialog" />
<!-- 备注编辑 -->
<MemoFormDialog ref="memoDialog" @refreshDataList="_getTableList" />
<!-- 抖音直播弹框 -->
<DYClueFormDialog ref="DYClueFormDialog" @refreshDataList="_getTableList"/>
</div>
</template>
@ -64,6 +71,7 @@ import DistributeFormDialog from './components/DistributeFormDialog.vue';
import SignFormDialog from '../sign/components/SignFormDialog.vue';
import ZhuangDanDialog from './components/ZhuangDanDialog.vue';
import MemoFormDialog from './components/MemoFormDialog.vue';
import DYClueFormDialog from './components/DYClueFormDialog.vue';
import { defaultColumns } from './columns.js';
import { getClueList, deleteClue, getClueCountBadge, discardClue, getSign, getConsultRecord } from '@/api/zs/clue';
@ -80,7 +88,8 @@ export default {
}
},
components: {
SearchForm, BatchUpdateDialog, PublicDialog, UploadDialog, SignFormDialog, DistributeFormDialog, ZhuangDanDialog, MemoFormDialog
SearchForm, BatchUpdateDialog, PublicDialog, UploadDialog, SignFormDialog, DistributeFormDialog, ZhuangDanDialog, MemoFormDialog,
DYClueFormDialog
},
data() {
return {
@ -156,6 +165,12 @@ export default {
handleAddandUpdate(info) {
this.$router.push('/zs/clue-form/index/' + (info ? info.clueId : 0));
},
//
handleDYAddandUpdate(info){
this.$nextTick(() => {
this.$refs.DYClueFormDialog.init(info);
});
},
//
handleSelectionChange(selection) {
console.log(selection);
@ -198,9 +213,9 @@ export default {
.catch(function () { });
},
//
handleImport(ydtData) {
handleImport(ydtData, dYData) {
this.$nextTick(() => {
this.$refs.uploadDialogForm.init(ydtData);
this.$refs.uploadDialogForm.init({ydtData: ydtData, dYData: dYData});
});
},
/** 导出按钮操作 */

Loading…
Cancel
Save