Commit 39c63e34 authored by 1483922988@qq.com's avatar 1483922988@qq.com

客户编辑产品类型多选,主要竞争对手其他回显,客户跟进记录,报价单相关

parent d625d224
import request from '@/utils/request'
import request from "@/utils/request"
// 创建跟进
export function createCustomerFollow(data) {
return request({
url: '/ecw/customer-follow/create',
method: 'post',
url: "/ecw/customer-follow/create",
method: "post",
data: data
})
}
......@@ -12,8 +12,8 @@ export function createCustomerFollow(data) {
// 更新跟进
export function updateCustomerFollow(data) {
return request({
url: '/ecw/customer-follow/update',
method: 'put',
url: "/ecw/customer-follow/update",
method: "put",
data: data
})
}
......@@ -21,31 +21,31 @@ export function updateCustomerFollow(data) {
// 删除跟进
export function deleteCustomerFollow(id) {
return request({
url: '/ecw/customer-follow/delete?id=' + id,
method: 'delete'
url: "/ecw/customer-follow/delete?id=" + id,
method: "delete"
})
}
// 获得跟进
export function getCustomerFollow(id) {
return request({
url: '/ecw/customer-follow/get?id=' + id,
method: 'get'
url: "/ecw/customer-follow/get?id=" + id,
method: "get"
})
}
// 获得跟进分页
export function getCustomerFollowPage(query) {
return request({
url: '/customer/detail/infoList/followPage',
method: 'get',
url: "/customer/detail/infoList/followPage",
method: "get",
params: query
})
}
export function getCustomerFollowPage2(query) {
return request({
url: '/ecw/customer-follow/page',
method: 'get',
url: "/ecw/customer-follow/page",
method: "get",
params: query
})
}
......@@ -53,50 +53,56 @@ export function getCustomerFollowPage2(query) {
// 导出跟进 Excel
export function exportCustomerFollowExcel(query) {
return request({
url: '/ecw/customer-follow/export-excel',
method: 'get',
url: "/ecw/customer-follow/export-excel",
method: "get",
params: query,
responseType: 'blob'
responseType: "blob"
})
}
export function getCustomerFollowList(params) {
return request({
url: '/customer/followup/page',
method: 'get',
url: "/customer/followup/page",
method: "get",
params
})
}
export function getCustomerFollowDetail(params) {
return request({
url: '/customer/followup/get',
method: 'get',
url: "/customer/followup/get",
method: "get",
params
})
}
export function addCustomerFollow(data) {
return request({
url: '/customer/followup/create',
method: 'post',
url: "/customer/followup/create",
method: "post",
data
})
}
export function editCustomerFollow(data) {
return request({
url: '/customer/followup/update',
method: 'put',
url: "/customer/followup/update",
method: "put",
data
})
}
export function exportCustomerFollow(params) {
return request({
url: '/customer/followup/export-excel',
method: 'get',
url: "/customer/followup/export-excel",
method: "get",
params
})
}
export function getFollowupNewNumber() {
return request({
url: "/customer/followup/getFollowupNewNumber",
method: "get"
})
}
<template>
<div class="customer-follow">
<el-dialog append-to-body :title="$t('客户跟进')" :visible.sync="customerFollow.dialogVisible" :before-close="customerFollowClose" width="900px">
<el-form ref="customerFollowForm" :model="form" label-width="120px">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item :label="$t('编号')" prop="number">
<el-input v-model="form.number" :placeholder="$t('请输入编号')" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('跟进状态')">
<el-select v-model="form.status" :placeholder="$t('请选择')" disabled>
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户编号')">
<el-input v-model="customerNumber" :placeholder="$t('请输入客户编号')" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('跟进类型')" required>
<el-select v-model="form.followType" clearable :placeholder="$t('请选择')" @change="handleFollowType" :disabled="isView">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_TYPE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<!--
<el-col :span="13">
<el-form-item :label="$t('报价单')">
<el-input v-model="form.offerId" :placeholder="$t('请输入报价单')" disabled />
</el-form-item>
</el-col>
-->
<el-col :span="12">
<el-form-item :label="$t('跟进时间')" required>
<el-date-picker v-model="form.followTime" clearable type="datetime" :placeholder="$t('请选择')" :disabled="isView" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('联系人')" required>
<el-select v-model="form.contactId" clearable :placeholder="$t('请选择')" :disabled="isView" @change="changeContactUser">
<el-option v-for="(item, index) in customerContactsList" :key="index" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户经理')" required>
<el-select v-model="form.followUserId" clearable :placeholder="$t('请选择')" :disabled="isView">
<el-option v-for="item in serviceUserList" :key="item.id" :label="item.nickname" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('跟进方式')" required>
<dict-selector ref="dictMethod" v-model="form.followMethod" clearable :disabled="isView" :type="DICT_TYPE.CUSTOMER_FOLLOWUP_METHOD"></dict-selector>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('上一级跟进单')" prop="parentNumber">
<el-input v-model="form.parentNumber" :placeholder="$t('请输入上一级跟进单')" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('跟进结果')" prop="followMethod">
<el-select v-model="form.resultType" clearable :placeholder="$t('请选择')" :disabled="isView">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_RESULT_TYPE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item :label="$t('目的')" prop="purpose">
<el-input type="textarea" :rows="2" v-model="form.purpose" :placeholder="$t('请输入目的')" maxlength="200" show-word-limit :disabled="isView" />
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item :label="$t('跟进情况')">
<el-input rows="3" class="text_style" type="textarea" v-model="form.feedback" maxlength="500" show-word-limit :disabled="isView" />
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item :label="$t('附件')" prop="attatchment">
<FileUpload :limit="5" :isShowTip="true" v-model="form.attatchment" :fileType="fileType" :disabled="isView" />
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item :label="$t('下次跟进时间')">
<el-date-picker v-model="form.nextTime" type="datetime" :placeholder="$t('请选择')" :disabled="isView" @change="changeNextTime">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item :label="$t('下一步计划')" prop="nextPlan">
<el-input type="textarea" :rows="3" v-model="form.nextPlan" :placeholder="$t('请输入下一步计划')" maxlength="500" show-word-limit :disabled="isView" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('创建人')" prop="founder">
<el-select v-model="form.creatorName" disabled :placeholder="$t('请选择')">
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('创建时间')" prop="createTime">
<el-date-picker v-model="form.createTime" type="datetime" disabled :placeholder="$t('请选择')">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('最后更新人')">
<el-select v-model="form.updaterName" disabled>
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('最后更新时间')">
<el-date-picker v-model="form.updateTime" type="datetime" disabled :placeholder="$t('请选择')">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer" v-if="isView">
<el-button type="warning" @click="customerFollowClose">{{$t('关 闭')}}</el-button>
</div>
<div slot="footer" class="dialog-footer" v-else>
<el-button type="warning" @click="goBack">{{$t('返 回')}}</el-button>
<el-button type="primary" @click="customerFollowSubmit(0)">{{$t('保 存')}}</el-button>
<el-button type="success" @click="customerFollowSubmit(1)" v-if="isEdit">{{$t('提交结果')}}</el-button>
</div>
</el-dialog>
<customer-follow-select-offer :customer-id="customerId" ref="customerFollowSelectOffer" @select="selectOffer" />
</div>
<div class="customer-follow">
<el-dialog append-to-body :title="$t('客户跟进')" :visible.sync="customerFollow.dialogVisible" :before-close="customerFollowClose" width="900px">
<el-form ref="customerFollowForm" :model="form" label-width="120px">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item :label="$t('编号')" prop="number">
<el-input v-model="form.number" :placeholder="$t('请输入编号')" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('跟进状态')">
<el-select v-model="form.status" :placeholder="$t('请选择')" disabled>
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户编号')">
<el-input v-model="form.customerNumber" :placeholder="$t('请输入客户编号')" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('跟进类型')" required>
<el-select v-model="form.followType" clearable :placeholder="$t('请选择')" @change="handleFollowType" :disabled="isView">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_TYPE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('跟进时间')" required>
<el-date-picker v-model="form.followTime" clearable type="datetime" :placeholder="$t('请选择')" :disabled="isView" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('联系人')" required>
<el-select v-model="form.contactId" clearable :placeholder="$t('请选择')" :disabled="isView" @change="changeContactUser">
<el-option v-for="(item, index) in customerContactsList" :key="index" :label="item.name" :value="item.id"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户经理')" required>
<el-select v-model="form.followUserId" clearable :placeholder="$t('请选择')" :disabled="isView">
<el-option v-for="item in serviceUserList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('跟进方式')" required>
<dict-selector ref="dictMethod" v-model="form.followMethod" clearable :disabled="isView" :type="DICT_TYPE.CUSTOMER_FOLLOWUP_METHOD"></dict-selector>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('上一级跟进单')" prop="parentNumber">
<el-input v-model="form.parentNumber" :placeholder="$t('请输入上一级跟进单')" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('跟进结果')" prop="followMethod">
<el-select v-model="form.resultType" clearable :placeholder="$t('请选择')" :disabled="isView">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_RESULT_TYPE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item :label="$t('目的')" prop="purpose">
<el-input type="textarea" :rows="2" v-model="form.purpose" :placeholder="$t('请输入目的')" maxlength="200" show-word-limit :disabled="isView" />
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item :label="$t('跟进情况')">
<el-input rows="3" class="text_style" type="textarea" v-model="form.feedback" maxlength="500" show-word-limit :disabled="isView" />
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item
><el-button size="mini" v-if="isView" type="text" icon="el-icon-collection" @click="$emit(handleCustomerFollowAdd, form)" v-has-permi="['ecw:customer:follow-add-plan']">{{ $t("增加计划") }} </el-button>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item :label="$t('附件')" prop="attatchment">
<FileUpload :limit="5" :isShowTip="true" v-model="form.attatchment" :fileType="fileType" :disabled="isView" />
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item :label="$t('下次跟进时间')">
<el-date-picker v-model="form.nextTime" type="datetime" :placeholder="$t('请选择')" :disabled="isView" @change="changeNextTime"> </el-date-picker>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item :label="$t('下一步计划')" prop="nextPlan">
<el-input type="textarea" :rows="3" v-model="form.nextPlan" :placeholder="$t('请输入下一步计划')" maxlength="500" show-word-limit :disabled="isView" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('创建人')" prop="founder">
<el-select v-model="form.creatorName" disabled :placeholder="$t('请选择')">
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('创建时间')" prop="createTime">
<el-date-picker v-model="form.createTime" type="datetime" disabled :placeholder="$t('请选择')"> </el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('最后更新人')">
<el-select v-model="form.updaterName" disabled>
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('最后更新时间')">
<el-date-picker v-model="form.updateTime" type="datetime" disabled :placeholder="$t('请选择')"> </el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer" v-if="isView">
<el-button type="warning" @click="customerFollowClose">{{ $t("关 闭") }}</el-button>
</div>
<div slot="footer" class="dialog-footer" v-else>
<el-button type="warning" @click="goBack">{{ $t("返 回") }}</el-button>
<el-button type="primary" @click="customerFollowSubmit(0)">{{ $t("保 存") }}</el-button>
<el-button type="success" @click="customerFollowSubmit(1)">{{ $t("提交结果") }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
createCustomerFollow,
getCustomerFollowPage,
getCustomerFollowPage2,
addCustomerFollow,
getCustomerFollowList,
editCustomerFollow
} from "@/api/ecw/customerFollow"
import { createCustomerFollow, getCustomerFollowPage, getCustomerFollowPage2, addCustomerFollow, getCustomerFollowList, editCustomerFollow, getFollowupNewNumber } from "@/api/ecw/customerFollow"
import { getOfferPage } from "@/api/ecw/offer"
import CustomerFollowSelectOffer from "./customerFollowSelectOffer";
import {
DICT_TYPE,
getDictDataLabel
} from '@/utils/dict'
import {
getCustomerContactsListByCustomer
} from '@/api/ecw/customerContacts'
import {
listAllSimpl,
listServiceUser,
listSimpleUsers,
} from "@/api/system/user";
import {
parseTime
} from '@/utils/ruoyi'
import FileUpload from "@/components/FileUpload/fileUpload";
import {formatDate} from "@/utils/index";
import { DICT_TYPE, getDictDataLabel } from "@/utils/dict"
import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts"
import { listAllSimpl, listServiceUser, listSimpleUsers } from "@/api/system/user"
import { parseTime } from "@/utils/ruoyi"
import FileUpload from "@/components/FileUpload/fileUpload"
import { formatDate } from "@/utils/index"
export default {
/**
* 客户跟进
......@@ -181,18 +150,12 @@ export default {
/**
* 如果是客户投诉跟进,则id为客户投诉id;如果是客户跟进,则id为客户id
*/
id: Number,
customerId: Number,
customerQuery: {
type: Boolean,
default: false
},
customerNumber: String,
customerService: Number
},
components: {
FileUpload,
CustomerFollowSelectOffer
FileUpload
},
data() {
return {
......@@ -207,7 +170,7 @@ export default {
customerFollow: {
dialogVisible: false,
form: {
followType: '3'
followType: "3"
}
},
offerDialogVisible: true,
......@@ -219,9 +182,8 @@ export default {
pickerOptions: {
disabledDate(time) {
return time.getTime() <= Date.now()
},
}
},
isEdit: true,
followTime: [],
nextTime: [],
queryParams: {
......@@ -235,49 +197,41 @@ export default {
},
computed: {
isChinese() {
return this.$i18n.locale === 'zh_CN'
return this.$i18n.locale === "zh_CN"
}
},
created() {
this.init()
// this.resetCustomerFollowForm()
listServiceUser().then(r => {
// console.log( r.data,'r.data跟进业务')
listServiceUser().then((r) => {
this.serviceUserList = r.data
})
listAllSimpl().then((r) => {
this.allSimplList = r.data;
});
// this.getCustomerFollowList()
// this.reset()
this.allSimplList = r.data
})
},
methods: {
init() {
if (!!this.customerId) getCustomerContactsListByCustomer({
customerId: this.customerId
}).then(r => {
this.customerContactsList = r.data
// this.form.customerId = this.customerId
// this.form.bizId = this.id
})
if (!!this.customerId)
getCustomerContactsListByCustomer({
customerId: this.customerId
}).then((r) => {
this.customerContactsList = r.data
})
},
getOfferList() {
getOfferPage(this.queryParams).then(response => {
this.offerList = response.data.list;
this.offerTotal = response.data.total;
});
getOfferPage(this.queryParams).then((response) => {
this.offerList = response.data.list
this.offerTotal = response.data.total
})
},
handleFollowType(val) {
console.log(val)
if (val == '2') {
this.$refs['customerFollowSelectOffer'].offerDialogVisible = true
if (val == "2") {
this.$refs["customerFollowSelectOffer"].offerDialogVisible = true
} else {
this.form.offerId = undefined
}
},
selectOffer(offerId) {
this.form.offerId = offerId
},
reset() {
this.form = {
attatchment: undefined,
......@@ -285,6 +239,7 @@ export default {
contactName: undefined,
contactPhone: undefined,
customerId: this.customerId,
customerNumber: this.customerNumber,
feedback: undefined,
followMethod: undefined,
followTime: new Date().getTime(),
......@@ -303,7 +258,7 @@ export default {
createTime: new Date().getTime(),
updaterName: this.$store.getters.userId,
updateTime: new Date().getTime()
};
}
},
changeNextTime(val) {
if (val) {
......@@ -317,7 +272,7 @@ export default {
},
changeContactUser(val) {
if (val) {
for(const item of this.customerContactsList) {
for (const item of this.customerContactsList) {
if (item.id == val) {
this.form.contactName = item.name
// this.form.contactPhone = `+${item.areaCode}${item.phoneNew}`
......@@ -331,38 +286,38 @@ export default {
},
customerFollowSubmit(status) {
console.log(this.form)
this.$refs["customerFollowForm"].validate(valid => {
this.$refs["customerFollowForm"].validate((valid) => {
if (!valid) {
return
}
if (!this.form.followType) {
this.$modal.msgError(this.$t("请选择跟进类型"));
this.$modal.msgError(this.$t("请选择跟进类型"))
return
}
if (!this.form.followTime) {
this.$modal.msgError(this.$t('请选择跟进时间'));
this.$modal.msgError(this.$t("请选择跟进时间"))
return
}
if (!this.form.contactName) {
this.$modal.msgError(this.$t('请选择联系人'));
this.$modal.msgError(this.$t("请选择联系人"))
return
}
if (!this.form.followUserId) {
this.$modal.msgError(this.$t('请选择客户经理'));
this.$modal.msgError(this.$t("请选择客户经理"))
return
}
if (!this.form.followMethod) {
this.$modal.msgError(this.$t('请选择跟进方式'));
this.$modal.msgError(this.$t("请选择跟进方式"))
return
}
if (status === 0) {
this.saveSubmitData(status)
} else {
this.$confirm(this.$t('提交后无法修改'), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
this.$confirm(this.$t("提交后无法修改"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning"
}).then(() => {
this.saveSubmitData(status)
})
......@@ -376,68 +331,24 @@ export default {
followTime: this.form.followTime ? formatDate(this.form.followTime) : undefined,
nextTime: this.form.nextTime ? formatDate(this.form.nextTime) : undefined,
status
}).then(r => {
}).then((r) => {
this.$message.success(this.$t("操作成功"))
this.$emit('refresh')
this.$emit("refresh")
this.customerFollowClose()
})
},
goBack() {
this.$confirm(this.$t('是否确认不保存信息'), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
this.$confirm(this.$t("是否确认不保存信息"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning"
}).then(() => {
this.customerFollowClose()
})
},
customerFollowClose() {
// this.resetCustomerFollowForm()
this.customerFollow.dialogVisible = false
},
resetCustomerFollowForm() {
this.reset()
// this.$refs.dictType.changeValue(this.customerFollow.form.followType);
this.$refs.dictMethod.changeValue(this.customerFollow.form.followMethod);
},
handleQuery() {
this.pageNo = 1
this.queryParams.pageNo = 1
this.followTime = []
this.getCustomerFollowList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams = {
followType: null,
followMethod: null,
resultType: null,
status: null
};
this.handleQuery();
},
getCustomerFollowList() {
if (this.customerQuery) {
getCustomerFollowList({
customerId: this.customerId,
pageNo: this.pageNo,
pageSize: this.pageSize
}).then(r => {
this.$message.info(this.$t("操作成功"))
this.$emit('refresh')
})
} else {
getCustomerFollowPage2({
bizId: this.id,
followType: 3,
pageNo: this.pageNo,
pageSize: this.pageSize
}).then(r => {
this.$emit('refresh')
})
}
},
handleView(row) {
this.isView = true
this.form = row
......@@ -445,29 +356,34 @@ export default {
},
handleAdd() {
this.isView = false
this.isEdit = true
this.customerFollow.dialogVisible = true
this.reset()
},
handleUpdate(row, flag) {
async handleUpdate(row, flag) {
this.isView = false
this.isEdit = flag
this.customerFollow.dialogVisible = true
if (flag) {
if (!flag) {
this.form = row
} else {
let r = await getFollowupNewNumber()
console.log(r)
this.form = {
...row,
parentNumber: row.number
parentNumber: row.number,
followTime: row.nextTime,
nextTime: "",
number: r.data,
nextPlan: ""
}
}
},
}
}
}
</script>
<style scoped>
.text_style{
.text_style {
white-space: pre-wrap;
}
</style>
......@@ -213,10 +213,10 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('主营类别')" prop="productType">
<el-form-item :label="$t('主营类别')" prop="productTypes">
<el-row :gutter="10">
<el-col :span="11">
<el-select @change="change" v-model="form.productType" :placeholder="$t('请选择产品类别')">
<el-select @change="change" v-model="form.productTypes" multiple :placeholder="$t('请选择产品类别')">
<el-option :label="isChinese ? item.titleZh : item.titleEn" :value="item.id" v-for="item in productTypeList" :key="item.id" />
</el-select>
</el-col>
......@@ -804,7 +804,7 @@ export default {
trigger: "change"
}
],
productType: [
productTypes: [
{
required: true,
message: this.$t("请选择产品类别"),
......@@ -873,7 +873,7 @@ export default {
this.getProductListFn(val)
},
getProductListFn(val) {
getProductList({ typeId: val }).then((r) => {
getProductList({ typeIds: val }).then((r) => {
this.productList = r.data
})
},
......@@ -1040,6 +1040,7 @@ export default {
roles: (this.form.roles || [])?.join(","),
pickupPoints: (this.form.pickupPoints || [])?.join(","),
productIds: (this.form.productIds || [])?.join(","),
productTypes: (this.form.productTypes || [])?.join(","),
busiCountryIds: (this.form.busiCountryIds || [])?.join(","),
noConsignee: undefined,
defaultPay: undefined,
......@@ -1187,7 +1188,8 @@ export default {
pickupPoints: this.stringArrToNumberArr(response.data.pickupPoints),
productIds: this.stringArrToNumberArr(response.data.productIds),
busiCountryIds: this.stringArrToNumberArr(response.data.busiCountryIds),
competitorIds: Number(response.data.competitorIds)
competitorIds: Number(response.data.competitorIds),
productTypes: response.data.productTypes ? response.data.productTypes.split(",") : []
}
if (this.form.productType) {
console.log("1231", this.form.productType)
......@@ -1259,9 +1261,12 @@ export default {
if (!this.form.lightUnit) this.form.lightUnit = r.data.paoEdge
})
},
getCompetitorList() {
getCompetitorList(callback) {
competitorListAll().then((r) => {
this.competitorList = r.data
this.$nextTick(() => {
callback && callback()
})
})
},
changeCompetitor(val) {
......@@ -1273,9 +1278,11 @@ export default {
console.log(data)
addCompetitor({
name: data.value
}).then((_) => {
}).then((r) => {
this.$message.success("添加成功!")
this.getCompetitorList()
this.getCompetitorList(() => {
this.form.competitorIds = r.data
})
})
})
}
......
......@@ -334,116 +334,7 @@
</el-card>
</el-tab-pane>
<el-tab-pane name="follow" :label="$t('跟进')">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-form size="small" :inline="true" label-width="100px">
<el-form-item :label="$t('编号')" prop="number">
<el-input v-model.trim="followForm.number" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('报价单号')" prop="offerNumber">
<el-input v-model.trim="followForm.offerNumber" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('联系人')" prop="contactName">
<el-input v-model.trim="followForm.contactName" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('联系方式')" prop="contactPhone">
<el-input v-model.trim="followForm.contactPhone" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('客户经理')" prop="salesmanIds">
<user-selector v-model="followForm.salesmanIds" multiple clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('下次跟进时间')">
<el-date-picker v-model="followFormTmp.nextTime" type="datetimerange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" value-format="yyyy-MM-dd HH:mm:ss" @change="handleQuery"> </el-date-picker>
</el-form-item>
<el-form-item :label="$t('关联跟进记录')" prop="parentNumber">
<el-input v-model.trim="followForm.parentNumber" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('跟进类型')">
<dict-selector clearable :type="DICT_TYPE.CUSTOMER_FOLLOWUP_TYPE" v-model="followForm.followType" @change="handleQuery"></dict-selector>
</el-form-item>
<el-form-item :label="$t('跟进方式')">
<dict-selector clearable :type="DICT_TYPE.CUSTOMER_FOLLOWUP_METHOD" v-model="followForm.followMethod" @change="handleQuery"></dict-selector>
</el-form-item>
<el-form-item :label="$t('跟进结果')">
<el-select clearable v-model="followForm.resultType" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_RESULT_TYPE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('跟进状态')">
<el-select clearable v-model="followForm.status" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getCustomerFollowList">{{ $t("搜索") }} </el-button>
<el-button
type="primary"
@click="
() => {
followForm = { pageNo: 1, pageSize: 10 }
getCustomerFollowList()
}
"
>{{ $t("重置") }}
</el-button>
<el-button type="success" @click="customerFollowFn('follow')" v-hasPermi="['ecw:customer:follow-create']">{{ $t("新增") }} </el-button>
<el-button type="warning" @click="handleExport" v-hasPermi="['ecw:customer:follow-export']">
{{ $t("导出") }}
</el-button>
</el-form-item>
</el-form>
</div>
<el-table :data="customerFollowList" style="width: 100%">
<el-table-column prop="number" :label="$t('编号')" width="120">
<template slot-scope="scope">
<a href="javascript:void(0)" @click="handleCustomerFollowLink(scope.row)" class="link-type">{{ scope.row.number }}</a>
</template>
</el-table-column>
<el-table-column prop="followType" :label="$t('跟进类型')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_TYPE, cellValue)"></el-table-column>
<el-table-column prop="offerNumber" :label="$t('报价单号')"></el-table-column>
<el-table-column prop="followTime" :label="$t('跟进时间')" :formatter="(row, column, cellValue) => parseTime(cellValue)"></el-table-column>
<el-table-column prop="customerNumber" :label="$t('客户编号')"></el-table-column>
<el-table-column prop="contactName" :label="$t('联系人')"></el-table-column>
<el-table-column prop="contactPhone" :label="$t('联系方式')"></el-table-column>
<el-table-column prop="followUserName" :label="$t('客户经理')"></el-table-column>
<el-table-column prop="followMethod" :label="$t('跟进方式')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_METHOD, cellValue)"></el-table-column>
<el-table-column prop="purpose" :label="$t('目的')"></el-table-column>
<el-table-column prop="feedback" :label="$t('跟进情况')"></el-table-column>
<el-table-column prop="resultType" :label="$t('跟进结果')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_RESULT_TYPE, cellValue)"></el-table-column>
<el-table-column :label="$t('下次跟进时间')" align="center">
<template slot-scope="scope">
{{ parseTime(scope.row.nextTime) }}
</template>
</el-table-column>
<el-table-column :label="$t('关联跟进记录')" align="center" prop="parentNumber"></el-table-column>
<el-table-column prop="nextPlan" :label="$t('下次计划')" align="center"></el-table-column>
<el-table-column :label="$t('跟进状态')" align="center">
<template slot-scope="scope">
{{ getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_STATUS, scope.row.status) }}
</template>
</el-table-column>
<el-table-column prop="creatorName" :label="$t('创建人')" align="center"></el-table-column>
<el-table-column :label="$t('创建时间')" align="center">
<template slot-scope="scope">
{{ parseTime(scope.row.createTime) }}
</template>
</el-table-column>
<el-table-column prop="updaterName" :label="$t('最后更新人')" align="center"></el-table-column>
<el-table-column :label="$t('最后更新时间')" align="center">
<template slot-scope="scope">
{{ parseTime(scope.row.updateTime) }}
</template>
</el-table-column>
<el-table-column width="150px" :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" v-if="!scope.row.status" @click="handleCustomerFollow(scope.row, scope.row.status === 0)" v-hasPermi="['ecw:customer:follow-update']">{{ $t("编辑") }} </el-button>
<el-button size="mini" type="text" icon="el-icon-collection" @click="handleCustomerFollow(scope.row, true)" v-has-permi="['ecw:customer:follow-add-plan']">{{ $t("增加计划") }} </el-button>
</template>
</el-table-column>
</el-table>
<pagination :total="customerFollowTotal" :page.sync="followForm.pageNo" :limit.sync="followForm.pageSize" @pagination="getCustomerFollowList" />
</el-card>
<logListCommon ref="logListCommon" v-if="activeName === 'follow'" :customerId="id" />
</el-tab-pane>
<el-tab-pane name="complain" :label="$t('客户投诉')">
<customer-complaint v-if="activeName === 'complain'" ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint>
......@@ -715,7 +606,7 @@
</div>
</el-dialog>
<customer-follow ref="customerFollow" v-if="customerFollowVisible" :id="id" :customer-id="id" :customer-service="customer.customerService" :customer-number="customer.number" @refresh="getCustomerFollowList" />
<customer-follow ref="customerFollow" v-if="customerFollowVisible" :customer-id="id" :customer-service="customer.customerService" :customer-number="customer.number" @refresh="logListCommonRefresh" />
</div>
</template>
......@@ -741,7 +632,8 @@ import ImageDisplay from "@/views/ecw/order/components/imageDisplay.vue"
import { getListTree } from "@/api/ecw/region"
import { getWarehouseList } from "@/api/ecw/warehouse"
import { deleteOffer, cancel, recovery } from "@/api/ecw/offer"
import { getCustomerFollowList, exportCustomerFollow } from "@/api/ecw/customerFollow"
import logListCommon from "@/views/ecw/offer/logListCommon"
export default {
name: "query",
......@@ -750,7 +642,8 @@ export default {
Template,
CustomerFollow,
CustomerComplaint,
customerLog
customerLog,
logListCommon
},
created() {
// 获取币种
......@@ -821,7 +714,6 @@ export default {
this.getInfoListOfferPage() //报价
break
case "follow":
this.getCustomerFollowList()
case "bill":
this.infoListReceiptFn() //账单
break
......@@ -1001,15 +893,7 @@ export default {
objectiveId: null,
destWarehouseId: null,
customerFollowVisible: false,
followForm: {
pageNo: 1,
pageSize: 10
},
followFormTmp: {},
followTime: [],
nextTime: [],
customerFollowTotal: 0,
customerFollowList: [],
currencyList: [],
userId: undefined
}
......@@ -1091,18 +975,6 @@ export default {
this.$router.push({ path: "/offer/create", query: { customerId: row.id, customerType: row.type, type: 1 } })
},
handleCustomerFollow(row, flag) {
this.customerFollowVisible = true
this.$nextTick((_) => {
this.$refs["customerFollow"].handleUpdate(row, flag)
})
},
handleCustomerFollowLink(row) {
this.customerFollowVisible = true
this.$nextTick((_) => {
this.$refs["customerFollow"].handleView(row)
})
},
checkPermi,
userIdFormatter(row, column, cellValue) {
const member = this.memberList.find((e) => e.id === cellValue)
......@@ -1203,27 +1075,6 @@ export default {
this.infoListOfferFrom = { pageNo: 1, pageSize: 10 }
this.getInfoListOfferPage()
},
getCustomerFollowList() {
getCustomerFollowList({
...this.followForm,
customerId: this.customerId
}).then((r) => {
this.customerFollowList = r.data.list
this.customerFollowTotal = r.data.total
})
},
/** 跟进记录导出按钮操作 */
handleExport() {
// 执行导出
this.$modal.confirm(this.$t("是否确认导出客户跟进记录数据项?")).then(() => {
exportCustomerFollow({
...this.followForm,
customerId: this.customerId
}).then((r) => {
this.$message.success(this.$t("已加入导出队列,请稍后在下载日志中下载"))
})
})
},
// 数据
getOrderStatistics() {
orderStatistics({ customerId: this.id }).then((r) => {
......@@ -1348,6 +1199,9 @@ export default {
this.$message.success("操作成功")
this.handleQuery()
})
},
logListCommonRefresh() {
this.$refs.logListCommon && this.$refs.logListCommon.handleQuery()
}
}
}
......
<template>
<div class="app-container">
<el-card>
<div slot="header" class="card-title">{{ $t("跟进记录列表") }}</div>
<!-- 列表 -->
<div class="offer-header">
<span style="font-size: 15px">{{ $t("报价单号") }}{{ number }}</span>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">{{ $t("新增") }}</el-button>
</div>
<el-table v-loading="loading" :data="list">
<el-table-column :label="$t('序号')" align="center" prop="id" type="index">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('跟进类型')" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_OFFER_TYPE" :value="scope.row.type"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('联系人')" align="center" prop="contactName" />
<el-table-column :label="$t('跟进方式')" align="center" prop="followUpMethod">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_FOLLOW_METHOD" :value="scope.row.followUpMethod"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('跟进时间')" align="center" prop="followUpTime" width="180">
<template slot-scope="scope">
<span>{{ scope.row.followUpTime }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('客户反馈')" align="center" prop="customerFeedback" />
<el-table-column :label="$t('处理结果')" align="center" prop="processingResults" />
<el-table-column :label="$t('客户经理')" align="center" prop="followUpSalesmanName">
<template slot-scope="scope">
<span>{{ getCustomerService(scope.row.followUpSalesmanId) }}</span>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="params.page" :limit.sync="params.rows" @pagination="getList" />
</el-card>
<logListCommon :offerId="offerId" />
</div>
</template>
<script>
import { getOfferLogPage } from "@/api/ecw/offerLog"
import { DICT_TYPE } from "@/utils/dict"
import { getOffer } from "@/api/ecw/offer"
import { userList } from "@/api/system/user"
import logListCommon from "@/views/ecw/offer/logListCommon"
export default {
name: "OfferLog",
components: {},
name: "offerLogList",
components: { logListCommon },
data() {
return {
// 遮罩层
loading: true,
list: [],
total: 0,
params: {
page: 1,
rows: 20,
offerId: 0,
type: 2
},
number: "",
relationId: 0,
creatorName: "test",
creatorData: []
}
},
created() {
if (this.$route.query.offerId) {
this.params.offerId = this.$route.query.offerId
this.getList()
this.getRelationID()
}
userList("customer service").then((res) => (this.creatorData = res.data))
return {}
},
methods: {
/** 查询列表 */
getList() {
this.loading = true
let params = { ...this.params }
// 执行查询
getOfferLogPage(params).then((response) => {
this.list = response.data.list
this.total = response.data.total
this.loading = false
})
},
getCustomerService(id) {
var user = this.creatorData.find((item) => item.id == id)
if (user) return user.nickname
return ""
},
getRelationID() {
getOffer(this.params.offerId).then((response) => {
this.relationId = response.data.consignorId
this.number = response.data.number
})
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push({
path: "/offer/createLog",
query: {
offerId: this.params.offerId,
number: this.number
}
})
computed: {
offerId() {
return parseInt(this.$route.query.offerId || 0)
}
}
}
......
<template>
<div>
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-form size="small" :inline="true" label-width="100px">
<el-form-item :label="$t('编号')" prop="number">
<el-input v-model.trim="followForm.number" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('报价单号')" prop="offerNumber">
<el-input v-model.trim="followForm.offerNumber" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('联系人')" prop="contactName">
<el-input v-model.trim="followForm.contactName" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('联系方式')" prop="contactPhone">
<el-input v-model.trim="followForm.contactPhone" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('客户经理')" prop="salesmanIds">
<user-selector v-model="followForm.salesmanIds" multiple clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('下次跟进时间')">
<el-date-picker v-model="followFormTmp.nextTime" type="datetimerange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" value-format="yyyy-MM-dd HH:mm:ss" @change="handleQuery"> </el-date-picker>
</el-form-item>
<el-form-item :label="$t('关联跟进记录')" prop="parentNumber">
<el-input v-model.trim="followForm.parentNumber" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('跟进类型')">
<dict-selector clearable :type="DICT_TYPE.CUSTOMER_FOLLOWUP_TYPE" v-model="followForm.followType" @change="handleQuery"></dict-selector>
</el-form-item>
<el-form-item :label="$t('跟进方式')">
<dict-selector clearable :type="DICT_TYPE.CUSTOMER_FOLLOWUP_METHOD" v-model="followForm.followMethod" @change="handleQuery"></dict-selector>
</el-form-item>
<el-form-item :label="$t('跟进结果')">
<el-select clearable v-model="followForm.resultType" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_RESULT_TYPE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('跟进状态')">
<el-select clearable v-model="followForm.status" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getCustomerFollowList">{{ $t("搜索") }} </el-button>
<el-button
type="primary"
@click="
() => {
followForm = { pageNo: 1, pageSize: 10 }
getCustomerFollowList()
}
"
>{{ $t("重置") }}
</el-button>
<el-button type="success" @click="customerFollowFn('follow')" v-hasPermi="['ecw:customer:follow-create']">{{ $t("新增") }} </el-button>
<el-button type="warning" @click="handleExport" v-hasPermi="['ecw:customer:follow-export']">
{{ $t("导出") }}
</el-button>
</el-form-item>
</el-form>
</div>
<el-table :data="customerFollowList" style="width: 100%">
<el-table-column prop="number" :label="$t('编号')" width="120">
<template slot-scope="scope">
<a href="javascript:void(0)" @click="handleCustomerFollowLink(scope.row)" class="link-type">{{ scope.row.number }}</a>
</template>
</el-table-column>
<el-table-column prop="followType" :label="$t('跟进类型')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_TYPE, cellValue)"></el-table-column>
<el-table-column prop="offerNumber" :label="$t('报价单号')"> </el-table-column>
<el-table-column prop="followTime" :label="$t('跟进时间')" :formatter="(row, column, cellValue) => parseTime(cellValue)"></el-table-column>
<el-table-column prop="customerNumber" :label="$t('客户编号')"></el-table-column>
<el-table-column prop="contactName" :label="$t('联系人')"></el-table-column>
<el-table-column prop="contactPhone" :label="$t('联系方式')"></el-table-column>
<el-table-column prop="followUserName" :label="$t('客户经理')"></el-table-column>
<el-table-column prop="followMethod" :label="$t('跟进方式')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_METHOD, cellValue)"></el-table-column>
<el-table-column prop="purpose" :label="$t('目的')"></el-table-column>
<el-table-column prop="feedback" :label="$t('跟进情况')"></el-table-column>
<el-table-column prop="resultType" :label="$t('跟进结果')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_RESULT_TYPE, cellValue)"></el-table-column>
<el-table-column :label="$t('下次跟进时间')" align="center">
<template slot-scope="scope">
{{ parseTime(scope.row.nextTime) }}
</template>
</el-table-column>
<el-table-column :label="$t('关联跟进记录')" align="center" prop="parentNumber"></el-table-column>
<el-table-column prop="nextPlan" :label="$t('下次计划')" align="center"></el-table-column>
<el-table-column :label="$t('跟进状态')" align="center">
<template slot-scope="scope">
{{ getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_STATUS, scope.row.status) }}
</template>
</el-table-column>
<el-table-column prop="creatorName" :label="$t('创建人')" align="center"></el-table-column>
<el-table-column :label="$t('创建时间')" align="center">
<template slot-scope="scope">
{{ parseTime(scope.row.createTime) }}
</template>
</el-table-column>
<el-table-column prop="updaterName" :label="$t('最后更新人')" align="center"></el-table-column>
<el-table-column :label="$t('最后更新时间')" align="center">
<template slot-scope="scope">
{{ parseTime(scope.row.updateTime) }}
</template>
</el-table-column>
<el-table-column width="150px" :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" v-if="!scope.row.status" @click="handleCustomerFollow(scope.row)" v-hasPermi="['ecw:customer:follow-update']">{{ $t("编辑") }} </el-button>
<el-button size="mini" type="text" icon="el-icon-collection" @click="handleCustomerFollow(scope.row, true)" v-has-permi="['ecw:customer:follow-add-plan']">{{ $t("增加计划") }} </el-button>
</template>
</el-table-column>
</el-table>
<pagination :total="customerFollowTotal" :page.sync="followForm.pageNo" :limit.sync="followForm.pageSize" @pagination="getCustomerFollowList" />
</el-card>
<customer-follow ref="customerFollow" @handleCustomerFollowAdd="handleCustomerFollowAdd" @refresh="handleQuery" v-if="customerFollowVisible" :customer-id="customerId" :offerId="offerId" />
</div>
</template>
<script>
import { getCustomerFollowList, exportCustomerFollow } from "@/api/ecw/customerFollow"
import CustomerFollow from "@/views/ecw/customer/components/customerFollow"
import UserSelector from "@/components/UserSelector"
export default {
name: "logListCommon",
components: { UserSelector, CustomerFollow },
props: ["customerId", "offerId"],
data() {
return {
customerFollowVisible: false,
customerFollowTotal: 0,
customerFollowList: [],
followForm: {
pageNo: 1,
pageSize: 10
},
followFormTmp: {
nextTime: ["", ""]
}
}
},
created() {
this.handleQuery()
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN"
},
customerId_offerId() {
return `${this.customerId}_${this.offerId}`
}
},
watch: {
customerId_offerId() {
this.handleQuery()
}
},
methods: {
handleCustomerFollowAdd(row) {
this.customerFollowVisible = false
setTimeout(() => {
this.customerFollowVisible = true
this.$nextTick((_) => {
this.$refs["customerFollow"].handleUpdate(row)
})
}, 100)
},
handleCustomerFollow(row, flag) {
this.customerFollowVisible = true
this.$nextTick((_) => {
this.$refs["customerFollow"].handleUpdate(row, flag)
})
},
handleCustomerFollowLink(row) {
this.customerFollowVisible = true
this.$nextTick((_) => {
this.$refs["customerFollow"].handleView(row)
})
},
formatQuery() {
let obj = {}
obj.customerId = this.customerId || null
obj.offerId = this.offerId || null
obj.beginNextTime = this.followFormTmp.nextTime[0]
obj.endNextTime = this.followFormTmp.nextTime[1]
return obj
},
handleQuery() {
this.followForm.pageNo = 1
this.customerFollowTotal = 0
this.customerFollowList = []
this.getCustomerFollowList()
},
/** 跟进记录导出按钮操作 */
handleExport() {
// 执行导出
this.$modal.confirm(this.$t("是否确认导出客户跟进记录数据项?")).then(() => {
exportCustomerFollow({
...this.followForm,
...this.formatQuery(),
pageNo: 1,
pageSize: 10000000
}).then((r) => {
this.$message.success(this.$t("已加入导出队列,请稍后在下载日志中下载"))
})
})
},
getCustomerFollowList() {
getCustomerFollowList({
...this.followForm,
...this.formatQuery()
}).then((r) => {
this.customerFollowList = r.data.list
this.customerFollowTotal = r.data.total
})
}
}
}
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment