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

合并修改

parents 0966aef1 39c63e34
...@@ -6,7 +6,7 @@ VUE_APP_TITLE = 捷道管理系统-测试站 ...@@ -6,7 +6,7 @@ VUE_APP_TITLE = 捷道管理系统-测试站
# 捷道管理系统/开发环境 # 捷道管理系统/开发环境
VUE_APP_BASE_API = 'https://apitest.groupage.cn' VUE_APP_BASE_API = 'https://devapi.jd.qipx.top'
# VUE_APP_BASE_API = 'http://110.41.143.128:48080' # VUE_APP_BASE_API = 'http://110.41.143.128:48080'
# VUE_APP_BASE_API = 'http://127.0.0.1:48080' # VUE_APP_BASE_API = 'http://127.0.0.1:48080'
......
import request from '@/utils/request' import request from "@/utils/request"
// 创建跟进 // 创建跟进
export function createCustomerFollow(data) { export function createCustomerFollow(data) {
return request({ return request({
url: '/ecw/customer-follow/create', url: "/ecw/customer-follow/create",
method: 'post', method: "post",
data: data data: data
}) })
} }
...@@ -12,8 +12,8 @@ export function createCustomerFollow(data) { ...@@ -12,8 +12,8 @@ export function createCustomerFollow(data) {
// 更新跟进 // 更新跟进
export function updateCustomerFollow(data) { export function updateCustomerFollow(data) {
return request({ return request({
url: '/ecw/customer-follow/update', url: "/ecw/customer-follow/update",
method: 'put', method: "put",
data: data data: data
}) })
} }
...@@ -21,31 +21,31 @@ export function updateCustomerFollow(data) { ...@@ -21,31 +21,31 @@ export function updateCustomerFollow(data) {
// 删除跟进 // 删除跟进
export function deleteCustomerFollow(id) { export function deleteCustomerFollow(id) {
return request({ return request({
url: '/ecw/customer-follow/delete?id=' + id, url: "/ecw/customer-follow/delete?id=" + id,
method: 'delete' method: "delete"
}) })
} }
// 获得跟进 // 获得跟进
export function getCustomerFollow(id) { export function getCustomerFollow(id) {
return request({ return request({
url: '/ecw/customer-follow/get?id=' + id, url: "/ecw/customer-follow/get?id=" + id,
method: 'get' method: "get"
}) })
} }
// 获得跟进分页 // 获得跟进分页
export function getCustomerFollowPage(query) { export function getCustomerFollowPage(query) {
return request({ return request({
url: '/customer/detail/infoList/followPage', url: "/customer/detail/infoList/followPage",
method: 'get', method: "get",
params: query params: query
}) })
} }
export function getCustomerFollowPage2(query) { export function getCustomerFollowPage2(query) {
return request({ return request({
url: '/ecw/customer-follow/page', url: "/ecw/customer-follow/page",
method: 'get', method: "get",
params: query params: query
}) })
} }
...@@ -53,50 +53,56 @@ export function getCustomerFollowPage2(query) { ...@@ -53,50 +53,56 @@ export function getCustomerFollowPage2(query) {
// 导出跟进 Excel // 导出跟进 Excel
export function exportCustomerFollowExcel(query) { export function exportCustomerFollowExcel(query) {
return request({ return request({
url: '/ecw/customer-follow/export-excel', url: "/ecw/customer-follow/export-excel",
method: 'get', method: "get",
params: query, params: query,
responseType: 'blob' responseType: "blob"
}) })
} }
export function getCustomerFollowList(params) { export function getCustomerFollowList(params) {
return request({ return request({
url: '/customer/followup/page', url: "/customer/followup/page",
method: 'get', method: "get",
params params
}) })
} }
export function getCustomerFollowDetail(params) { export function getCustomerFollowDetail(params) {
return request({ return request({
url: '/customer/followup/get', url: "/customer/followup/get",
method: 'get', method: "get",
params params
}) })
} }
export function addCustomerFollow(data) { export function addCustomerFollow(data) {
return request({ return request({
url: '/customer/followup/create', url: "/customer/followup/create",
method: 'post', method: "post",
data data
}) })
} }
export function editCustomerFollow(data) { export function editCustomerFollow(data) {
return request({ return request({
url: '/customer/followup/update', url: "/customer/followup/update",
method: 'put', method: "put",
data data
}) })
} }
export function exportCustomerFollow(params) { export function exportCustomerFollow(params) {
return request({ return request({
url: '/customer/followup/export-excel', url: "/customer/followup/export-excel",
method: 'get', method: "get",
params params
}) })
} }
export function getFollowupNewNumber() {
return request({
url: "/customer/followup/getFollowupNewNumber",
method: "get"
})
}
<template> <template>
<div class="customer-follow"> <div class="customer-follow">
<el-dialog append-to-body :title="$t('客户跟进')" :visible.sync="customerFollow.dialogVisible" :before-close="customerFollowClose" width="900px"> <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-form ref="customerFollowForm" :model="form" label-width="120px">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('编号')" prop="number"> <el-form-item :label="$t('编号')" prop="number">
<el-input v-model="form.number" :placeholder="$t('请输入编号')" disabled /> <el-input v-model="form.number" :placeholder="$t('请输入编号')" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('跟进状态')"> <el-form-item :label="$t('跟进状态')">
<el-select v-model="form.status" :placeholder="$t('请选择')" disabled> <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-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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户编号')"> <el-form-item :label="$t('客户编号')">
<el-input v-model="customerNumber" :placeholder="$t('请输入客户编号')" disabled /> <el-input v-model="form.customerNumber" :placeholder="$t('请输入客户编号')" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('跟进类型')" required> <el-form-item :label="$t('跟进类型')" required>
<el-select v-model="form.followType" clearable :placeholder="$t('请选择')" @change="handleFollowType" :disabled="isView"> <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-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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="12">
<el-col :span="13"> <el-form-item :label="$t('跟进时间')" required>
<el-form-item :label="$t('报价单')"> <el-date-picker v-model="form.followTime" clearable type="datetime" :placeholder="$t('请选择')" :disabled="isView" />
<el-input v-model="form.offerId" :placeholder="$t('请输入报价单')" disabled /> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="12">
--> <el-form-item :label="$t('联系人')" required>
<el-col :span="12"> <el-select v-model="form.contactId" clearable :placeholder="$t('请选择')" :disabled="isView" @change="changeContactUser">
<el-form-item :label="$t('跟进时间')" required> <el-option v-for="(item, index) in customerContactsList" :key="index" :label="item.name" :value="item.id"> </el-option>
<el-date-picker v-model="form.followTime" clearable type="datetime" :placeholder="$t('请选择')" :disabled="isView" /> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('联系人')" required> <el-form-item :label="$t('客户经理')" required>
<el-select v-model="form.contactId" clearable :placeholder="$t('请选择')" :disabled="isView" @change="changeContactUser"> <el-select v-model="form.followUserId" clearable :placeholder="$t('请选择')" :disabled="isView">
<el-option v-for="(item, index) in customerContactsList" :key="index" :label="item.name" :value="item.id"> <el-option v-for="item in serviceUserList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
</el-option> </el-select>
</el-select> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="12">
<el-col :span="12"> <el-form-item :label="$t('跟进方式')" required>
<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-select v-model="form.followUserId" clearable :placeholder="$t('请选择')" :disabled="isView"> </el-form-item>
<el-option v-for="item in serviceUserList" :key="item.id" :label="item.nickname" :value="item.id"> </el-col>
</el-option> <el-col :span="12">
</el-select> <el-form-item :label="$t('上一级跟进单')" prop="parentNumber">
</el-form-item> <el-input v-model="form.parentNumber" :placeholder="$t('请输入上一级跟进单')" disabled />
</el-col> </el-form-item>
<el-col :span="12"> </el-col>
<el-form-item :label="$t('跟进方式')" required> <el-col :span="12">
<dict-selector ref="dictMethod" v-model="form.followMethod" clearable :disabled="isView" :type="DICT_TYPE.CUSTOMER_FOLLOWUP_METHOD"></dict-selector> <el-form-item :label="$t('跟进结果')" prop="followMethod">
</el-form-item> <el-select v-model="form.resultType" clearable :placeholder="$t('请选择')" :disabled="isView">
</el-col> <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-col :span="12"> </el-select>
<el-form-item :label="$t('上一级跟进单')" prop="parentNumber"> </el-form-item>
<el-input v-model="form.parentNumber" :placeholder="$t('请输入上一级跟进单')" disabled /> </el-col>
</el-form-item> <el-col :span="20">
</el-col> <el-form-item :label="$t('目的')" prop="purpose">
<el-col :span="12"> <el-input type="textarea" :rows="2" v-model="form.purpose" :placeholder="$t('请输入目的')" maxlength="200" show-word-limit :disabled="isView" />
<el-form-item :label="$t('跟进结果')" prop="followMethod"> </el-form-item>
<el-select v-model="form.resultType" clearable :placeholder="$t('请选择')" :disabled="isView"> </el-col>
<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-col :span="20">
</el-select> <el-form-item :label="$t('跟进情况')">
</el-form-item> <el-input rows="3" class="text_style" type="textarea" v-model="form.feedback" maxlength="500" show-word-limit :disabled="isView" />
</el-col> </el-form-item>
<el-col :span="20"> </el-col>
<el-form-item :label="$t('目的')" prop="purpose"> <el-col :span="20">
<el-input type="textarea" :rows="2" v-model="form.purpose" :placeholder="$t('请输入目的')" maxlength="200" show-word-limit :disabled="isView" /> <el-form-item
</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-col> </el-form-item>
<el-col :span="20"> </el-col>
<el-form-item :label="$t('跟进情况')"> <el-col :span="20">
<el-input rows="3" class="text_style" type="textarea" v-model="form.feedback" maxlength="500" show-word-limit :disabled="isView" /> <el-form-item :label="$t('附件')" prop="attatchment">
</el-form-item> <FileUpload :limit="5" :isShowTip="true" v-model="form.attatchment" :fileType="fileType" :disabled="isView" />
</el-col> </el-form-item>
<el-col :span="20"> </el-col>
<el-form-item :label="$t('附件')" prop="attatchment"> <el-col :span="13">
<FileUpload :limit="5" :isShowTip="true" v-model="form.attatchment" :fileType="fileType" :disabled="isView" /> <el-form-item :label="$t('下次跟进时间')">
</el-form-item> <el-date-picker v-model="form.nextTime" type="datetime" :placeholder="$t('请选择')" :disabled="isView" @change="changeNextTime"> </el-date-picker>
</el-col> </el-form-item>
<el-col :span="13"> </el-col>
<el-form-item :label="$t('下次跟进时间')"> <el-col :span="20">
<el-date-picker v-model="form.nextTime" type="datetime" :placeholder="$t('请选择')" :disabled="isView" @change="changeNextTime"> <el-form-item :label="$t('下一步计划')" prop="nextPlan">
</el-date-picker> <el-input type="textarea" :rows="3" v-model="form.nextPlan" :placeholder="$t('请输入下一步计划')" maxlength="500" show-word-limit :disabled="isView" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="20"> <el-col :span="12">
<el-form-item :label="$t('下一步计划')" prop="nextPlan"> <el-form-item :label="$t('创建人')" prop="founder">
<el-input type="textarea" :rows="3" v-model="form.nextPlan" :placeholder="$t('请输入下一步计划')" maxlength="500" show-word-limit :disabled="isView" /> <el-select v-model="form.creatorName" disabled :placeholder="$t('请选择')">
</el-form-item> <el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
</el-col> </el-select>
<el-col :span="12"> </el-form-item>
<el-form-item :label="$t('创建人')" prop="founder"> </el-col>
<el-select v-model="form.creatorName" disabled :placeholder="$t('请选择')"> <el-col :span="12">
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> <el-form-item :label="$t('创建时间')" prop="createTime">
</el-option> <el-date-picker v-model="form.createTime" type="datetime" disabled :placeholder="$t('请选择')"> </el-date-picker>
</el-select> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="12">
<el-col :span="12"> <el-form-item :label="$t('最后更新人')">
<el-form-item :label="$t('创建时间')" prop="createTime"> <el-select v-model="form.updaterName" disabled>
<el-date-picker v-model="form.createTime" type="datetime" disabled :placeholder="$t('请选择')"> <el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
</el-date-picker> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('最后更新人')"> <el-form-item :label="$t('最后更新时间')">
<el-select v-model="form.updaterName" disabled> <el-date-picker v-model="form.updateTime" type="datetime" disabled :placeholder="$t('请选择')"> </el-date-picker>
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-form-item>
</el-option> </el-col>
</el-select> </el-row>
</el-form-item> </el-form>
</el-col> <div slot="footer" class="dialog-footer" v-if="isView">
<el-col :span="12"> <el-button type="warning" @click="customerFollowClose">{{ $t("关 闭") }}</el-button>
<el-form-item :label="$t('最后更新时间')"> </div>
<el-date-picker v-model="form.updateTime" type="datetime" disabled :placeholder="$t('请选择')"> <div slot="footer" class="dialog-footer" v-else>
</el-date-picker> <el-button type="warning" @click="goBack">{{ $t("返 回") }}</el-button>
</el-form-item> <el-button type="primary" @click="customerFollowSubmit(0)">{{ $t("保 存") }}</el-button>
</el-col> <el-button type="success" @click="customerFollowSubmit(1)">{{ $t("提交结果") }}</el-button>
</el-row> </div>
</el-form> </el-dialog>
<div slot="footer" class="dialog-footer" v-if="isView"> </div>
<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>
</template> </template>
<script> <script>
import { import { createCustomerFollow, getCustomerFollowPage, getCustomerFollowPage2, addCustomerFollow, getCustomerFollowList, editCustomerFollow, getFollowupNewNumber } from "@/api/ecw/customerFollow"
createCustomerFollow,
getCustomerFollowPage,
getCustomerFollowPage2,
addCustomerFollow,
getCustomerFollowList,
editCustomerFollow
} from "@/api/ecw/customerFollow"
import { getOfferPage } from "@/api/ecw/offer" import { getOfferPage } from "@/api/ecw/offer"
import CustomerFollowSelectOffer from "./customerFollowSelectOffer"; import { DICT_TYPE, getDictDataLabel } from "@/utils/dict"
import { import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts"
DICT_TYPE, import { listAllSimpl, listServiceUser, listSimpleUsers } from "@/api/system/user"
getDictDataLabel import { parseTime } from "@/utils/ruoyi"
} from '@/utils/dict' import FileUpload from "@/components/FileUpload/fileUpload"
import { import { formatDate } from "@/utils/index"
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 { export default {
/** /**
* 客户跟进 * 客户跟进
...@@ -181,18 +150,12 @@ export default { ...@@ -181,18 +150,12 @@ export default {
/** /**
* 如果是客户投诉跟进,则id为客户投诉id;如果是客户跟进,则id为客户id * 如果是客户投诉跟进,则id为客户投诉id;如果是客户跟进,则id为客户id
*/ */
id: Number,
customerId: Number, customerId: Number,
customerQuery: {
type: Boolean,
default: false
},
customerNumber: String, customerNumber: String,
customerService: Number customerService: Number
}, },
components: { components: {
FileUpload, FileUpload
CustomerFollowSelectOffer
}, },
data() { data() {
return { return {
...@@ -207,7 +170,7 @@ export default { ...@@ -207,7 +170,7 @@ export default {
customerFollow: { customerFollow: {
dialogVisible: false, dialogVisible: false,
form: { form: {
followType: '3' followType: "3"
} }
}, },
offerDialogVisible: true, offerDialogVisible: true,
...@@ -219,9 +182,8 @@ export default { ...@@ -219,9 +182,8 @@ export default {
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() <= Date.now() return time.getTime() <= Date.now()
}, }
}, },
isEdit: true,
followTime: [], followTime: [],
nextTime: [], nextTime: [],
queryParams: { queryParams: {
...@@ -235,49 +197,41 @@ export default { ...@@ -235,49 +197,41 @@ export default {
}, },
computed: { computed: {
isChinese() { isChinese() {
return this.$i18n.locale === 'zh_CN' return this.$i18n.locale === "zh_CN"
} }
}, },
created() { created() {
this.init() this.init()
// this.resetCustomerFollowForm() listServiceUser().then((r) => {
listServiceUser().then(r => {
// console.log( r.data,'r.data跟进业务')
this.serviceUserList = r.data this.serviceUserList = r.data
}) })
listAllSimpl().then((r) => { listAllSimpl().then((r) => {
this.allSimplList = r.data; this.allSimplList = r.data
}); })
// this.getCustomerFollowList()
// this.reset()
}, },
methods: { methods: {
init() { init() {
if (!!this.customerId) getCustomerContactsListByCustomer({ if (!!this.customerId)
customerId: this.customerId getCustomerContactsListByCustomer({
}).then(r => { customerId: this.customerId
this.customerContactsList = r.data }).then((r) => {
// this.form.customerId = this.customerId this.customerContactsList = r.data
// this.form.bizId = this.id })
})
}, },
getOfferList() { getOfferList() {
getOfferPage(this.queryParams).then(response => { getOfferPage(this.queryParams).then((response) => {
this.offerList = response.data.list; this.offerList = response.data.list
this.offerTotal = response.data.total; this.offerTotal = response.data.total
}); })
}, },
handleFollowType(val) { handleFollowType(val) {
console.log(val) console.log(val)
if (val == '2') { if (val == "2") {
this.$refs['customerFollowSelectOffer'].offerDialogVisible = true this.$refs["customerFollowSelectOffer"].offerDialogVisible = true
} else { } else {
this.form.offerId = undefined this.form.offerId = undefined
} }
}, },
selectOffer(offerId) {
this.form.offerId = offerId
},
reset() { reset() {
this.form = { this.form = {
attatchment: undefined, attatchment: undefined,
...@@ -285,6 +239,7 @@ export default { ...@@ -285,6 +239,7 @@ export default {
contactName: undefined, contactName: undefined,
contactPhone: undefined, contactPhone: undefined,
customerId: this.customerId, customerId: this.customerId,
customerNumber: this.customerNumber,
feedback: undefined, feedback: undefined,
followMethod: undefined, followMethod: undefined,
followTime: new Date().getTime(), followTime: new Date().getTime(),
...@@ -303,7 +258,7 @@ export default { ...@@ -303,7 +258,7 @@ export default {
createTime: new Date().getTime(), createTime: new Date().getTime(),
updaterName: this.$store.getters.userId, updaterName: this.$store.getters.userId,
updateTime: new Date().getTime() updateTime: new Date().getTime()
}; }
}, },
changeNextTime(val) { changeNextTime(val) {
if (val) { if (val) {
...@@ -317,7 +272,7 @@ export default { ...@@ -317,7 +272,7 @@ export default {
}, },
changeContactUser(val) { changeContactUser(val) {
if (val) { if (val) {
for(const item of this.customerContactsList) { for (const item of this.customerContactsList) {
if (item.id == val) { if (item.id == val) {
this.form.contactName = item.name this.form.contactName = item.name
// this.form.contactPhone = `+${item.areaCode}${item.phoneNew}` // this.form.contactPhone = `+${item.areaCode}${item.phoneNew}`
...@@ -331,38 +286,38 @@ export default { ...@@ -331,38 +286,38 @@ export default {
}, },
customerFollowSubmit(status) { customerFollowSubmit(status) {
console.log(this.form) console.log(this.form)
this.$refs["customerFollowForm"].validate(valid => { this.$refs["customerFollowForm"].validate((valid) => {
if (!valid) { if (!valid) {
return return
} }
if (!this.form.followType) { if (!this.form.followType) {
this.$modal.msgError(this.$t("请选择跟进类型")); this.$modal.msgError(this.$t("请选择跟进类型"))
return return
} }
if (!this.form.followTime) { if (!this.form.followTime) {
this.$modal.msgError(this.$t('请选择跟进时间')); this.$modal.msgError(this.$t("请选择跟进时间"))
return return
} }
if (!this.form.contactName) { if (!this.form.contactName) {
this.$modal.msgError(this.$t('请选择联系人')); this.$modal.msgError(this.$t("请选择联系人"))
return return
} }
if (!this.form.followUserId) { if (!this.form.followUserId) {
this.$modal.msgError(this.$t('请选择客户经理')); this.$modal.msgError(this.$t("请选择客户经理"))
return return
} }
if (!this.form.followMethod) { if (!this.form.followMethod) {
this.$modal.msgError(this.$t('请选择跟进方式')); this.$modal.msgError(this.$t("请选择跟进方式"))
return return
} }
if (status === 0) { if (status === 0) {
this.saveSubmitData(status) this.saveSubmitData(status)
} else { } else {
this.$confirm(this.$t('提交后无法修改'), this.$t('提示'), { this.$confirm(this.$t("提交后无法修改"), this.$t("提示"), {
confirmButtonText: this.$t('确定'), confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t('取消'), cancelButtonText: this.$t("取消"),
type: 'warning' type: "warning"
}).then(() => { }).then(() => {
this.saveSubmitData(status) this.saveSubmitData(status)
}) })
...@@ -376,68 +331,24 @@ export default { ...@@ -376,68 +331,24 @@ export default {
followTime: this.form.followTime ? formatDate(this.form.followTime) : undefined, followTime: this.form.followTime ? formatDate(this.form.followTime) : undefined,
nextTime: this.form.nextTime ? formatDate(this.form.nextTime) : undefined, nextTime: this.form.nextTime ? formatDate(this.form.nextTime) : undefined,
status status
}).then(r => { }).then((r) => {
this.$message.success(this.$t("操作成功")) this.$message.success(this.$t("操作成功"))
this.$emit('refresh') this.$emit("refresh")
this.customerFollowClose() this.customerFollowClose()
}) })
}, },
goBack() { goBack() {
this.$confirm(this.$t('是否确认不保存信息'), this.$t('提示'), { this.$confirm(this.$t("是否确认不保存信息"), this.$t("提示"), {
confirmButtonText: this.$t('确定'), confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t('取消'), cancelButtonText: this.$t("取消"),
type: 'warning' type: "warning"
}).then(() => { }).then(() => {
this.customerFollowClose() this.customerFollowClose()
}) })
}, },
customerFollowClose() { customerFollowClose() {
// this.resetCustomerFollowForm()
this.customerFollow.dialogVisible = false 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) { handleView(row) {
this.isView = true this.isView = true
this.form = row this.form = row
...@@ -445,29 +356,34 @@ export default { ...@@ -445,29 +356,34 @@ export default {
}, },
handleAdd() { handleAdd() {
this.isView = false this.isView = false
this.isEdit = true
this.customerFollow.dialogVisible = true this.customerFollow.dialogVisible = true
this.reset() this.reset()
}, },
handleUpdate(row, flag) { async handleUpdate(row, flag) {
this.isView = false this.isView = false
this.isEdit = flag
this.customerFollow.dialogVisible = true this.customerFollow.dialogVisible = true
if (flag) { if (!flag) {
this.form = row this.form = row
} else { } else {
let r = await getFollowupNewNumber()
console.log(r)
this.form = { this.form = {
...row, ...row,
parentNumber: row.number parentNumber: row.number,
followTime: row.nextTime,
nextTime: "",
number: r.data,
nextPlan: ""
} }
} }
}, }
} }
} }
</script> </script>
<style scoped> <style scoped>
.text_style{ .text_style {
white-space: pre-wrap; white-space: pre-wrap;
} }
</style> </style>
<template xmlns=""> <template xmlns="">
<el-row <el-row type="flex" style="margin: 15px 0" justify="center">
type="flex"
style="margin: 15px 0"
justify="center"
>
<el-col :xs="24" :sm="24" :md="24" :lg="22" :xl="20"> <el-col :xs="24" :sm="24" :md="24" :lg="22" :xl="20">
<el-form ref="form" :model="form" :rules="rules" label-width="150px"> <el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="title-text">{{ $t('基本') }}</span> <span class="title-text">{{ $t("基本") }}</span>
<el-button <el-button style="float: right" size="small" type="primary" @click="showBaseFlag = !showBaseFlag">{{ showBaseFlag ? $t("隐藏") : $t("更多") }}</el-button>
style="float: right"
size="small"
type="primary"
@click="showBaseFlag = !showBaseFlag"
>{{showBaseFlag ? $t('隐藏') : $t('更多')}}</el-button
>
</div> </div>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户名称')" prop="name"> <el-form-item :label="$t('客户名称')" prop="name">
<el-input <el-input v-model="form.name" :placeholder="$t('请输入客户名称')" />
v-model="form.name"
:placeholder="$t('请输入客户名称')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户英文名称')"> <el-form-item :label="$t('客户英文名称')">
<el-input <el-input v-model="form.nameEn" :placeholder="$t('请输入客户英文名称')"></el-input>
v-model="form.nameEn"
:placeholder="$t('请输入客户英文名称')"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户来源')" prop="source"> <el-form-item :label="$t('客户来源')" prop="source">
<el-select <el-select v-model="form.source" :placeholder="$t('请选择客户来源')">
v-model="form.source" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
:placeholder="$t('请选择客户来源')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('国籍')" prop="country"> <el-form-item :label="$t('国籍')" prop="country">
<el-select <el-select filterable clearable v-model="form.country" :placeholder="$t('请选择国家')">
filterable <el-option v-for="dict in countryList" :key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
clearable
v-model="form.country"
:placeholder="$t('请选择国家')"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户经理')" prop="customerService"> <el-form-item :label="$t('客户经理')" prop="customerService">
<el-select <el-select v-model="form.customerService" :placeholder="$t('请选择客户经理')" :disabled="(customerId !== '0' && $route.name !== 'allocatedCustomerEdit') || isCustomerServiceConfirmed">
v-model="form.customerService" <el-option v-for="item in !((customerId !== '0' && $route.name !== 'allocatedCustomerEdit') || isCustomerServiceConfirmed) ? serviceUserList : allSimplList" :key="item.id" :label="item.nickname" :value="item.id" />
:placeholder="$t('请选择客户经理')"
:disabled="
(customerId !== '0' &&
$route.name !== 'allocatedCustomerEdit') ||
isCustomerServiceConfirmed
"
>
<el-option
v-for="item in !(
(customerId !== '0' &&
$route.name !== 'allocatedCustomerEdit') ||
isCustomerServiceConfirmed
)
? serviceUserList
: allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('推介人')" prop="promoter"> <el-form-item :label="$t('推介人')" prop="promoter">
<el-select <el-select clearable remote :remote-method="remoteMethod" v-model="form.promoter" :placeholder="$t('请输入推介人')" filterable>
clearable <el-option v-for="item in customerSelectFn" :key="item.id" :label="item.name" :value="item.id"> </el-option>
remote
:remote-method="remoteMethod"
v-model="form.promoter"
:placeholder="$t('请输入推介人')"
filterable
>
<el-option
v-for="item in customerSelectFn"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('备注')" prop="remarks"> <el-form-item :label="$t('备注')" prop="remarks">
<el-input <el-input v-model="form.remarks" :placeholder="$t('请输入备注')" />
v-model="form.remarks"
:placeholder="$t('请输入备注')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('询盘信息')"> <el-form-item :label="$t('询盘信息')">
<el-input <el-input show-word-limit v-model="form.inquiry" :rows="3" type="textarea" :maxlength="500"></el-input>
show-word-limit
v-model="form.inquiry"
:rows="3"
type="textarea"
:maxlength="500"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -141,33 +66,19 @@ ...@@ -141,33 +66,19 @@
<el-row :gutter="10" v-show="showBaseFlag"> <el-row :gutter="10" v-show="showBaseFlag">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('联系地址')" prop="address"> <el-form-item :label="$t('联系地址')" prop="address">
<el-input <el-input v-model="form.address" :placeholder="$t('请输入联系地址')" />
v-model="form.address"
:placeholder="$t('请输入联系地址')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户生日')" prop="birthday"> <el-form-item :label="$t('客户生日')" prop="birthday">
<el-date-picker <el-date-picker v-model="form.birthday" type="date" value-format="timestamp" :placeholder="$t('请输入客户生日')"> </el-date-picker>
v-model="form.birthday"
type="date"
value-format="timestamp"
:placeholder="$t('请输入客户生日')"
>
</el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('业绩类型')"> <el-form-item :label="$t('业绩类型')">
<el-switch <el-switch v-model="form.isNew" disabled active-text="新客户" inactive-text="老客户"> </el-switch>
v-model="form.isNew"
disabled
active-text="新客户"
inactive-text="老客户">
</el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -178,158 +89,76 @@ ...@@ -178,158 +89,76 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户等级')" prop="level"> <el-form-item :label="$t('客户等级')" prop="level">
<el-select <el-select v-model="form.level" :placeholder="$t('请选择客户等级')" disabled>
v-model="form.level" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
:placeholder="$t('请选择客户等级')"
disabled
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户状态')" prop="status"> <el-form-item :label="$t('客户状态')" prop="status">
<el-select <el-select v-model="form.status" :placeholder="$t('请选择客户状态')" disabled>
v-model="form.status" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
:placeholder="$t('请选择客户状态')"
disabled
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('首次成交时间')"> <el-form-item :label="$t('首次成交时间')">
<el-date-picker <el-date-picker v-model="form.firstDealTime" type="datetime" :placeholder="$t('请选择')" disabled />
v-model="form.firstDealTime"
type="datetime"
:placeholder="$t('请选择')"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('掉入公海时间')"> <el-form-item :label="$t('掉入公海时间')">
<el-date-picker <el-date-picker v-model="enterOpenSeaTime" type="datetime" :placeholder="$t('请选择')" disabled />
v-model="enterOpenSeaTime"
type="datetime"
:placeholder="$t('请选择')"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('获取方式')" prop="getMethod"> <el-form-item :label="$t('获取方式')" prop="getMethod">
<el-select <el-select v-model="form.getMethod" :placeholder="$t('请选择')" disabled>
v-model="form.getMethod" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_GET_METHOD)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
:placeholder="$t('请选择')"
disabled
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_GET_METHOD)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('创建入口')" prop="createFrom"> <el-form-item :label="$t('创建入口')" prop="createFrom">
<el-select <el-select v-model="form.createFrom" :placeholder="$t('请选择')" disabled>
v-model="form.createFrom" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FROM)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
:placeholder="$t('请选择')"
disabled
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FROM)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('捞取时间')"> <el-form-item :label="$t('捞取时间')">
<el-date-picker <el-date-picker v-model="form.catchTime" type="datetime" :placeholder="$t('请选择')" disabled />
v-model="form.catchTime"
type="datetime"
:placeholder="$t('请选择')"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('归属时间')"> <el-form-item :label="$t('归属时间')">
<el-date-picker <el-date-picker v-model="form.customerServiceConfirmedTime" type="datetime" disabled :placeholder="$t('请选择')"> </el-date-picker>
v-model="form.customerServiceConfirmedTime"
type="datetime"
disabled
:placeholder="$t('请选择')"
>
</el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('创建人')" prop="founder"> <el-form-item :label="$t('创建人')" prop="founder">
<el-select v-model="form.founder" disabled> <el-select v-model="form.founder" disabled>
<el-option <el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
v-for="item in allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('创建时间')" prop="createTime"> <el-form-item :label="$t('创建时间')" prop="createTime">
<el-date-picker <el-date-picker v-model="form.createTime" type="datetime" value-format="timestamp" disabled :placeholder="$t('选择创建时间')"> </el-date-picker>
v-model="form.createTime"
type="datetime"
value-format="timestamp"
disabled
:placeholder="$t('选择创建时间')"
>
</el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('最后更新人')"> <el-form-item :label="$t('最后更新人')">
<el-select v-model="form.updater" disabled> <el-select v-model="form.updater" disabled>
<el-option <el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
v-for="item in allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('最后更新时间')"> <el-form-item :label="$t('最后更新时间')">
<el-date-picker <el-date-picker v-model="form.updateTime" type="datetime" value-format="timestamp" disabled> </el-date-picker>
v-model="form.updateTime"
type="datetime"
value-format="timestamp"
disabled
>
</el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -337,54 +166,25 @@ ...@@ -337,54 +166,25 @@
<el-card style="margin-top: 15px"> <el-card style="margin-top: 15px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="title-text">{{ $t('发货信息') }}</span> <span class="title-text">{{ $t("发货信息") }}</span>
<el-button <el-button style="float: right" size="small" type="primary" @click="showShippingFlag = !showShippingFlag">{{ showShippingFlag ? $t("隐藏") : $t("更多") }}</el-button>
style="float: right"
size="small"
type="primary"
@click="showShippingFlag = !showShippingFlag"
>{{showShippingFlag ? $t('隐藏') : $t('更多')}}</el-button
>
</div> </div>
<el-row :gutter="10" v-show="showShippingFlag"> <el-row :gutter="10" v-show="showShippingFlag">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('客户类别')" prop="type"> <el-form-item :label="$t('客户类别')" prop="type">
<dict-selector <dict-selector :type="DICT_TYPE.CUSTOMER_TYPE" form-type="checkbox" multiple v-model="form.type"></dict-selector>
:type="DICT_TYPE.CUSTOMER_TYPE"
form-type="checkbox"
multiple
v-model="form.type"
></dict-selector>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('角色')"> <el-form-item :label="$t('角色')">
<dict-selector <dict-selector :type="DICT_TYPE.CUSTOMER_ROLE" form-type="checkbox" multiple v-model="form.roles"></dict-selector>
:type="DICT_TYPE.CUSTOMER_ROLE"
form-type="checkbox"
multiple
v-model="form.roles"
></dict-selector>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :span="13" v-show="form.roles && form.roles.indexOf('2') !== -1">
:span="13"
v-show="form.roles && form.roles.indexOf('2') !== -1"
>
<el-form-item :label="$t('所属代理')" prop="agentId"> <el-form-item :label="$t('所属代理')" prop="agentId">
<el-select <el-select filterable clearable v-model="form.agentId" :placeholder="$t('请选择所属代理')">
filterable <el-option v-for="item in serviceUserList" :key="item.id" :label="item.nickname" :value="item.id" />
clearable
v-model="form.agentId"
:placeholder="$t('请选择所属代理')"
>
<el-option
v-for="item in serviceUserList"
:key="item.id"
:label="item.nickname"
:value="item.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -393,79 +193,36 @@ ...@@ -393,79 +193,36 @@
<el-form-item :label="$t('出货渠道')" prop="transportType"> <el-form-item :label="$t('出货渠道')" prop="transportType">
<!-- <dict-selector :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" form-type="checkbox" multiple v-model="form.transportType"></dict-selector>--> <!-- <dict-selector :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" form-type="checkbox" multiple v-model="form.transportType"></dict-selector>-->
<el-checkbox-group v-model="form.transportType"> <el-checkbox-group v-model="form.transportType">
<el-checkbox <el-checkbox v-for="item in getDictDatas(DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE)" :key="item.value" :label="item.value" :disabled="[3].includes(+item.value)">{{ item.label }}</el-checkbox>
v-for="item in getDictDatas(
DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE
)"
:key="item.value"
:label="item.value"
:disabled="[3].includes(+item.value)"
>{{ item.label }}</el-checkbox
>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('常用提货网点')" prop="pickupPoints"> <el-form-item :label="$t('常用提货网点')" prop="pickupPoints">
<el-select multiple v-model="form.pickupPoints"> <el-select multiple v-model="form.pickupPoints">
<el-option <el-option v-for="item in getNodeLists" :key="item.id" :value="item.id" :label="isChinese ? item.titleZh : item.titleEn"></el-option>
v-for="item in getNodeLists"
:key="item.id"
:value="item.id"
:label="isChinese ? item.titleZh : item.titleEn"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('业务国家')" prop="busiCountryIds"> <el-form-item :label="$t('业务国家')" prop="busiCountryIds">
<el-select <el-select multiple clearable v-model="form.busiCountryIds" :placeholder="$t('请选择')">
multiple <el-option v-for="dict in countryList" :key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
clearable
v-model="form.busiCountryIds"
:placeholder="$t('请选择')"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('主营类别')" prop="productType"> <el-form-item :label="$t('主营类别')" prop="productTypes">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="11"> <el-col :span="11">
<el-select <el-select @change="change" v-model="form.productTypes" multiple :placeholder="$t('请选择产品类别')">
@change="change" <el-option :label="isChinese ? item.titleZh : item.titleEn" :value="item.id" v-for="item in productTypeList" :key="item.id" />
v-model="form.productType"
:placeholder="$t('请选择产品类别')"
>
<el-option
:label="isChinese ? item.titleZh : item.titleEn"
:value="item.id"
v-for="item in productTypeList"
:key="item.id"
/>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-select <el-select multiple filterable clearable v-model="form.productIds" :placeholder="$t('请选择')">
multiple <el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="item in productList" :key="item.id" />
filterable
clearable
v-model="form.productIds"
:placeholder="$t('请选择')"
>
<el-option
:label="item.titleZh"
:value="parseInt(item.id)"
v-for="item in productList"
:key="item.id"
/>
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
...@@ -479,22 +236,9 @@ ...@@ -479,22 +236,9 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('主要竞争对手')" prop="competitorIds"> <el-form-item :label="$t('主要竞争对手')" prop="competitorIds">
<el-select <el-select clearable v-model="form.competitorIds" :placeholder="$t('请选择')" @change="changeCompetitor">
clearable <el-option v-for="item in competitorList" :key="item.id" :label="item.name" :value="item.id" />
v-model="form.competitorIds" <el-option :label="$t('其他')" :value="0" />
:placeholder="$t('请选择')"
@change="changeCompetitor"
>
<el-option
v-for="item in competitorList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
<el-option
:label="$t('其他')"
:value="0"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -503,61 +247,36 @@ ...@@ -503,61 +247,36 @@
<el-input-number v-model="form.numYearly" :min="1" /> <el-input-number v-model="form.numYearly" :min="1" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-card> </el-card>
</el-form> </el-form>
<el-card class="box-card" style="margin-top: 15px;"> <el-card class="box-card" style="margin-top: 15px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="title-text">{{ $t("联系人") }}</span> <span class="title-text">{{ $t("联系人") }}</span>
<el-button <el-button style="float: right" size="small" type="primary" @click="handleAddContact">+</el-button>
style="float: right"
size="small"
type="primary"
@click="handleAddContact"
>+</el-button
>
</div> </div>
<el-form ref="contactForm" :rules="contactRules" :model="form"> <el-form ref="contactForm" :rules="contactRules" :model="form">
<el-table :data="form.customerContacts" style="width: 100%"> <el-table :data="form.customerContacts" style="width: 100%">
<el-table-column prop="department" :label="$t('部门')" width=""> <el-table-column prop="department" :label="$t('部门')" width="">
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-form-item label=""> <el-form-item label="">
<el-input <el-input v-model="row.department" :placeholder="$t('请输入部门')" size="mini" />
v-model="row.department"
:placeholder="$t('请输入部门')"
size="mini"
/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="position" :label="$t('职位')" width=""> <el-table-column prop="position" :label="$t('职位')" width="">
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-form-item label=""> <el-form-item label="">
<el-input <el-input v-model="row.position" :placeholder="$t('请输入职位')" size="mini" />
v-model="row.position"
:placeholder="$t('请输入职位')"
size="mini"
/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" :label="$t('联系人')"> <el-table-column prop="name" :label="$t('联系人')">
<template slot="header"> <template slot="header"> {{ $t("联系人") }} <span style="color: #ff0000">*</span> </template>
{{ $t("联系人") }} <span style="color: #ff0000">*</span>
</template>
<template v-slot="{ row, cellValue, $index }"> <template v-slot="{ row, cellValue, $index }">
<el-form-item <el-form-item :rules="contactRules.name" :prop="'customerContacts.' + $index + '.name'" label="">
:rules="contactRules.name" <el-input v-model="row.name" :placeholder="$t('请输入联系人')" size="mini" />
:prop="'customerContacts.' + $index + '.name'"
label=""
>
<el-input
v-model="row.name"
:placeholder="$t('请输入联系人')"
size="mini"
/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -567,62 +286,25 @@ ...@@ -567,62 +286,25 @@
</template> </template>
<template v-slot="{ row, cellValue, $index }"> <template v-slot="{ row, cellValue, $index }">
<el-form-item label=""> <el-form-item label="">
<el-input <el-input v-model="row.nameEn" :placeholder="$t('请输入联系人英文名称')" size="mini" />
v-model="row.nameEn"
:placeholder="$t('请输入联系人英文名称')"
size="mini"
/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="areaCode" :label="$t('区号')"> <el-table-column prop="areaCode" :label="$t('区号')">
<template slot="header"> <template slot="header"> {{ $t("区号") }} <span style="color: #ff0000">*</span> </template>
{{ $t("区号") }} <span style="color: #ff0000">*</span>
</template>
<template v-slot="{ row, cellValue, $index }"> <template v-slot="{ row, cellValue, $index }">
<el-form-item <el-form-item :rules="contactRules.areaCode" :prop="'customerContacts.' + $index + '.areaCode'" label="">
:rules="contactRules.areaCode" <el-select v-model="row.areaCode" :placeholder="$t('请选择区号')" filterable size="mini">
:prop="'customerContacts.' + $index + '.areaCode'" <el-option v-for="(item, index) in countryList" :key="index" :label="item.nameShort + (isChinese ? item.nameZh : item.nameEn) + '(' + item.tel + ')'" :value="item.tel" />
label=""
>
<el-select
v-model="row.areaCode"
:placeholder="$t('请选择区号')"
filterable
size="mini"
>
<el-option
v-for="(item, index) in countryList"
:key="index"
:label="
item.nameShort +
(isChinese ? item.nameZh : item.nameEn) +
'(' +
item.tel +
')'
"
:value="item.tel"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="phoneNew" :label="$t('联系方式')"> <el-table-column prop="phoneNew" :label="$t('联系方式')">
<template slot="header"> <template slot="header"> {{ $t("联系方式") }} <span style="color: #ff0000">*</span> </template>
{{ $t("联系方式") }} <span style="color: #ff0000">*</span>
</template>
<template v-slot="{ row, cellValue, $index }"> <template v-slot="{ row, cellValue, $index }">
<el-form-item <el-form-item :rules="contactRules.phoneNew" :prop="'customerContacts.' + $index + '.phoneNew'" label="">
:rules="contactRules.phoneNew" <el-input v-model.trim="row.phoneNew" :placeholder="$t('请输入联系方式')" size="mini" @input="row.phoneNew = row.phoneNew.replace(/\s+/g, '')" />
:prop="'customerContacts.' + $index + '.phoneNew'"
label=""
>
<el-input
v-model.trim="row.phoneNew"
:placeholder="$t('请输入联系方式')"
size="mini"
@input="row.phoneNew=row.phoneNew.replace(/\s+/g, '')"
/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -639,67 +321,26 @@ ...@@ -639,67 +321,26 @@
<el-table-column prop="social" :label="$t('社交软件')"> <el-table-column prop="social" :label="$t('社交软件')">
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-form-item label=""> <el-form-item label="">
<el-select <el-select v-model="row.social" :placeholder="$t('请选择社交软件')" size="mini">
v-model="row.social" <el-option v-for="dict in getDictDatas(DICT_TYPE.SOCIAL)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
:placeholder="$t('请选择社交软件')"
size="mini"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.SOCIAL)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="socialNumber" :label="$t('社交软件号码')">
prop="socialNumber"
:label="$t('社交软件号码')"
>
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-form-item label=""> <el-form-item label="">
<el-input <el-input v-model="row.socialNumber" :placeholder="$t('请输入社交软件号码')" size="mini" />
v-model="row.socialNumber"
:placeholder="$t('请输入社交软件号码')"
size="mini"
/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="260px" prop="email" :label="$t('邮箱')"> <el-table-column width="260px" prop="email" :label="$t('邮箱')">
<template v-slot="{ row }"> <template v-slot="{ row }">
<el-form-item <el-form-item v-for="(item, index) in row.email" :key="index" label="">
v-for="(item, index) in row.email"
:key="index"
label=""
>
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<el-input <el-input v-model="row.email[index]" :placeholder="$t('请输入邮箱')" size="mini" />
v-model="row.email[index]" <el-button @click="deleteEmail(row.email, index)" v-if="row.email.length !== 1" style="height: 25px; margin-left: 5px" type="danger" size="mini">删除</el-button>
:placeholder="$t('请输入邮箱')" <el-button @click="addEmail(row.email)" style="height: 25px; margin-left: 5px" v-if="index === row.email.length - 1 && row.email.length < 5" size="mini" type="primary">添加</el-button>
size="mini"
/>
<el-button
@click="deleteEmail(row.email, index)"
v-if="row.email.length !== 1"
style="height: 25px; margin-left: 5px"
type="danger"
size="mini"
>删除</el-button
>
<el-button
@click="addEmail(row.email)"
style="height: 25px; margin-left: 5px"
v-if="
index === row.email.length - 1 &&
row.email.length < 5
"
size="mini"
type="primary"
>添加</el-button
>
</div> </div>
</el-form-item> </el-form-item>
</template> </template>
...@@ -707,18 +348,8 @@ ...@@ -707,18 +348,8 @@
<el-table-column prop="isDefault" :label="$t('设为默认')"> <el-table-column prop="isDefault" :label="$t('设为默认')">
<template v-slot="{ row, column, $index }"> <template v-slot="{ row, column, $index }">
<el-form-item label=""> <el-form-item label="">
<el-select <el-select v-model="row.isDefault" :placeholder="$t('设为默认')" @change="handleDefaultChange($index)" size="mini">
v-model="row.isDefault" <el-option v-for="dict in getDictDatas(DICT_TYPE.IS_DEFAULT)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="Number(dict.value)" />
:placeholder="$t('设为默认')"
@change="handleDefaultChange($index)"
size="mini"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.IS_DEFAULT)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="Number(dict.value)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
...@@ -726,12 +357,7 @@ ...@@ -726,12 +357,7 @@
<el-table-column prop="name" :label="$t('操作')"> <el-table-column prop="name" :label="$t('操作')">
<template v-slot="{ row, column, $index }"> <template v-slot="{ row, column, $index }">
<el-form-item label=""> <el-form-item label="">
<el-button <el-button type="danger" @click="handleDeleteContact($index)" size="mini">{{ $t("删除") }}</el-button>
type="danger"
@click="handleDeleteContact($index)"
size="mini"
>{{ $t("删除") }}</el-button
>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -739,18 +365,12 @@ ...@@ -739,18 +365,12 @@
</el-form> </el-form>
</el-card> </el-card>
<el-card class="box-card" style="margin-top: 15px;"> <el-card class="box-card" style="margin-top: 15px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="title-text">{{ $t('设置') }}</span> <span class="title-text">{{ $t("设置") }}</span>
<el-button <el-button style="float: right" size="small" type="primary" @click="showSettingFlag = !showSettingFlag">{{ showSettingFlag ? $t("隐藏") : $t("更多") }}</el-button>
style="float: right"
size="small"
type="primary"
@click="showSettingFlag = !showSettingFlag"
>{{showSettingFlag ? $t('隐藏') : $t('更多')}}</el-button
>
</div> </div>
<el-form ref="setForm" label-width="150px" v-if="showSettingFlag"> <el-form ref="setForm" label-width="150px" v-if="showSettingFlag">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('是否显示提单价格')" prop="isShowTidanPrice"> <el-form-item :label="$t('是否显示提单价格')" prop="isShowTidanPrice">
...@@ -759,22 +379,14 @@ ...@@ -759,22 +379,14 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('到仓确认')" prop="arrivalConfirm"> <el-form-item :label="$t('到仓确认')" prop="arrivalConfirm">
<el-switch <el-switch v-model="form.arrivalConfirm" :active-value="1" :inactive-value="0" />
v-model="form.arrivalConfirm"
:active-value="1"
:inactive-value="0"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="13"> <el-col :span="13">
<el-form-item :label="$t('重货标准')" prop="weightUnit"> <el-form-item :label="$t('重货标准')" prop="weightUnit">
<el-switch v-model="showZhong" /> <el-switch v-model="showZhong" />
<el-input <el-input v-model="form.weightUnit" :placeholder="$t('请输入重货标准')" v-show="showZhong">
v-model="form.weightUnit"
:placeholder="$t('请输入重货标准')"
v-show="showZhong"
>
<template slot="append">kg/cbm</template> <template slot="append">kg/cbm</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
...@@ -782,24 +394,14 @@ ...@@ -782,24 +394,14 @@
<el-col :span="24" v-show="showZhong"> <el-col :span="24" v-show="showZhong">
<el-form-item :label="$t('指定线路')" prop="line"> <el-form-item :label="$t('指定线路')" prop="line">
<el-switch v-model="showZhong1"></el-switch> <el-switch v-model="showZhong1"></el-switch>
<customer-line-table <customer-line-table v-if="showZhong1" :warehouse-list="warehouseList" :import-city-list="importCityList" v-model="zhongLines" :zhong-pao-type="1"></customer-line-table>
v-if="showZhong1"
:warehouse-list="warehouseList"
:import-city-list="importCityList"
v-model="zhongLines"
:zhong-pao-type="1"
></customer-line-table>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="13"> <el-col :span="13">
<el-form-item :label="$t('泡货标准')" prop="lightUnit"> <el-form-item :label="$t('泡货标准')" prop="lightUnit">
<el-switch v-model="showPao" /> <el-switch v-model="showPao" />
<el-input <el-input v-model="form.lightUnit" :placeholder="$t('请输入泡货标准')" v-show="showPao">
v-model="form.lightUnit"
:placeholder="$t('请输入泡货标准')"
v-show="showPao"
>
<template slot="append">kg/cbm</template> <template slot="append">kg/cbm</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
...@@ -807,13 +409,7 @@ ...@@ -807,13 +409,7 @@
<el-col :span="24" v-show="showPao"> <el-col :span="24" v-show="showPao">
<el-form-item :label="$t('指定线路')" prop="line"> <el-form-item :label="$t('指定线路')" prop="line">
<el-switch v-model="showPao1"></el-switch> <el-switch v-model="showPao1"></el-switch>
<customer-line-table <customer-line-table v-if="showPao1" :warehouse-list="warehouseList" :import-city-list="importCityList" v-model="paoLines" :zhong-pao-type="2"></customer-line-table>
v-if="showPao1"
:warehouse-list="warehouseList"
:import-city-list="importCityList"
v-model="paoLines"
:zhong-pao-type="2"
></customer-line-table>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -832,146 +428,91 @@ ...@@ -832,146 +428,91 @@
<el-switch v-model="form.defaultBilling" disabled /> <el-switch v-model="form.defaultBilling" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</el-card> </el-card>
<el-card class="box-card" style="margin-top: 15px;"> <el-card class="box-card" style="margin-top: 15px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="title-text">{{ $t('财务') }}</span> <span class="title-text">{{ $t("财务") }}</span>
<el-button <el-button style="float: right" size="small" type="primary" @click="showFinanceFlag = !showFinanceFlag">{{ showFinanceFlag ? $t("隐藏") : $t("更多") }}</el-button>
style="float: right"
size="small"
type="primary"
@click="showFinanceFlag = !showFinanceFlag"
>{{showFinanceFlag ? $t('隐藏') : $t('更多')}}</el-button
>
</div> </div>
<el-form ref="financeForm" label-width="150px" v-if="showFinanceFlag"> <el-form ref="financeForm" label-width="150px" v-if="showFinanceFlag">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('公司名称')" prop="company"> <el-form-item :label="$t('公司名称')" prop="company">
<el-input <el-input v-model="form.company" :placeholder="$t('请输入公司名称')" />
v-model="form.company"
:placeholder="$t('请输入公司名称')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('公司英文名称')"> <el-form-item :label="$t('公司英文名称')">
<el-input <el-input v-model="form.companyEn" :placeholder="$t('请输入客户英文名称')"></el-input>
v-model="form.companyEn"
:placeholder="$t('请输入客户英文名称')"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item v-hasPermi="['ecw:customer:edit-card']" :label="$t('身份证号码')">
v-hasPermi="['ecw:customer:edit-card']"
:label="$t('身份证号码')"
>
<el-input v-model="form.carNo"></el-input> <el-input v-model="form.carNo"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item v-hasPermi="['ecw:customer:edit-card']" :label="$t('身份证姓名')">
v-hasPermi="['ecw:customer:edit-card']"
:label="$t('身份证姓名')"
>
<el-input v-model="form.carName"></el-input> <el-input v-model="form.carName"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('结算方式')" prop="balance"> <el-form-item :label="$t('结算方式')" prop="balance">
<el-select <el-select v-model="form.balance" :placeholder="$t('请选择结算方式')">
v-model="form.balance" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
:placeholder="$t('请选择结算方式')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('付款人姓名')"> <el-form-item :label="$t('付款人姓名')">
<el-input <el-input v-model="form.payerName" :placeholder="$t('请输入付款人姓名')"></el-input>
v-model="form.payerName"
:placeholder="$t('请输入付款人姓名')"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<h3 style="font-size: 15px;">{{$t('开票信息')}}</h3> <h3 style="font-size: 15px">{{ $t("开票信息") }}</h3>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('发票抬头')" prop="invoiceTitle"> <el-form-item :label="$t('发票抬头')" prop="invoiceTitle">
<el-input <el-input v-model="form.invoiceTitle" :placeholder="$t('请输入发票抬头')" />
v-model="form.invoiceTitle"
:placeholder="$t('请输入发票抬头')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('纳税人识别号')" prop="licenseNumber"> <el-form-item :label="$t('纳税人识别号')" prop="licenseNumber">
<el-input <el-input v-model="form.licenseNumber" :placeholder="$t('请输入纳税人识别号')" />
v-model="form.licenseNumber"
:placeholder="$t('请输入纳税人识别号')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('开户行')" prop="bank"> <el-form-item :label="$t('开户行')" prop="bank">
<el-input <el-input v-model="form.bank" :placeholder="$t('请输入开户行')" />
v-model="form.bank"
:placeholder="$t('请输入开户行')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('账户')" prop="bankNumber"> <el-form-item :label="$t('账户')" prop="bankNumber">
<el-input <el-input v-model="form.bankNumber" :placeholder="$t('请输入账户')" />
v-model="form.bankNumber"
:placeholder="$t('请输入账户')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('项目')" prop="project"> <el-form-item :label="$t('项目')" prop="project">
<el-input <el-input v-model="form.project" :placeholder="$t('请输入项目')" />
v-model="form.project"
:placeholder="$t('请输入项目')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('开票地址')" prop="billingAddress"> <el-form-item :label="$t('开票地址')" prop="billingAddress">
<el-input <el-input v-model="form.billingAddress" :placeholder="$t('请输入开票地址')" />
v-model="form.billingAddress"
:placeholder="$t('请输入开票地址')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('开票电话')" prop="billingTell"> <el-form-item :label="$t('开票电话')" prop="billingTell">
<el-input <el-input v-model="form.billingTell" :placeholder="$t('请输入开票电话')" maxlength="50" />
v-model="form.billingTell"
:placeholder="$t('请输入开票电话')"
maxlength="50"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('税率')" prop="taxRate"> <el-form-item :label="$t('税率')" prop="taxRate">
<el-input <el-input v-model="form.taxRate" :placeholder="$t('请输入税率')" />
v-model="form.taxRate"
:placeholder="$t('请输入税率')"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -979,74 +520,41 @@ ...@@ -979,74 +520,41 @@
<el-form ref="bankForm" :model="form" v-if="showFinanceFlag"> <el-form ref="bankForm" :model="form" v-if="showFinanceFlag">
<el-row type="flex" class="row-bg" justify="space-between"> <el-row type="flex" class="row-bg" justify="space-between">
<span style="font-size: 15px; line-height: 30px">{{$t('银行信息')}}</span> <span style="font-size: 15px; line-height: 30px">{{ $t("银行信息") }}</span>
<el-button <el-button size="small" type="primary" @click="addBankData">+</el-button>
size="small"
type="primary"
@click="addBankData"
>+</el-button
>
</el-row> </el-row>
<el-table border :data="form.customerBanks" style="margin-top: 10px"> <el-table border :data="form.customerBanks" style="margin-top: 10px">
<el-table-column <el-table-column :label="$t('序号')" type="index"></el-table-column>
:label="$t('序号')"
type="index"
></el-table-column>
<el-table-column> <el-table-column>
<div slot="header"> <div slot="header">{{ $t("账户名称") }} <span style="color: red">*</span></div>
{{ $t("账户名称") }} <span style="color: red">*</span>
</div>
<template v-slot="{ row, $index }"> <template v-slot="{ row, $index }">
<el-form-item <el-form-item :rules="{ required: true, message: $t('请输入账户名称') }" :prop="'customerBanks.' + $index + '.accountName'">
:rules="{ required: true, message: $t('请输入账户名称') }"
:prop="'customerBanks.' + $index + '.accountName'"
>
<el-input size="mini" v-model="row.accountName"></el-input> <el-input size="mini" v-model="row.accountName"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('币别')"> <el-table-column :label="$t('币别')">
<div slot="header"> <div slot="header">{{ $t("币别") }} <span style="color: red">*</span></div>
{{ $t("币别") }} <span style="color: red">*</span>
</div>
<template v-slot="{ row, $index }"> <template v-slot="{ row, $index }">
<el-form-item <el-form-item :prop="'customerBanks.' + $index + '.currency'" :rules="{ required: true, message: $t('请输入币别') }">
:prop="'customerBanks.' + $index + '.currency'"
:rules="{ required: true, message: $t('请输入币别') }"
>
<el-select v-model="row.currency"> <el-select v-model="row.currency">
<el-option <el-option v-for="item in currecyList" :label="$l(item, 'title')" :value="item.id.toString()" :key="item.id"></el-option>
v-for="item in currecyList"
:label="$l(item, 'title')"
:value="item.id.toString()"
:key="item.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('银行名称')"> <el-table-column :label="$t('银行名称')">
<div slot="header"> <div slot="header">{{ $t("银行名称") }} <span style="color: red">*</span></div>
{{ $t("银行名称") }} <span style="color: red">*</span>
</div>
<template v-slot="{ row, $index }"> <template v-slot="{ row, $index }">
<el-form-item <el-form-item :prop="'customerBanks.' + $index + '.bankName'" :rules="{ required: true, message: $t('银行名称') }">
:prop="'customerBanks.' + $index + '.bankName'"
:rules="{ required: true, message: $t('银行名称') }"
>
<el-input v-model="row.bankName" size="mini"></el-input> <el-input v-model="row.bankName" size="mini"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('银行账户')"> <el-table-column :label="$t('银行账户')">
<div slot="header"> <div slot="header">{{ $t("银行账户") }} <span style="color: red">*</span></div>
{{ $t("银行账户") }} <span style="color: red">*</span>
</div>
<template v-slot="{ row, $index }"> <template v-slot="{ row, $index }">
<el-form-item <el-form-item :prop="`customerBanks.${$index}.bankAccount`" :rules="{ required: true, message: $t('请输入银行账户') }">
:prop="`customerBanks.${$index}.bankAccount`"
:rules="{ required: true, message: $t('请输入银行账户') }"
>
<el-input v-model="row.bankAccount" size="mini"></el-input> <el-input v-model="row.bankAccount" size="mini"></el-input>
</el-form-item> </el-form-item>
</template> </template>
...@@ -1087,9 +595,7 @@ ...@@ -1087,9 +595,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')"> <el-table-column :label="$t('操作')">
<template v-slot="{ $index }"> <template v-slot="{ $index }">
<el-button @click="deleteBankData($index)">{{ <el-button @click="deleteBankData($index)">{{ $t("删除") }}</el-button>
$t("删除")
}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -1097,9 +603,7 @@ ...@@ -1097,9 +603,7 @@
</el-card> </el-card>
<div style="margin-top: 15px; text-align: center"> <div style="margin-top: 15px; text-align: center">
<el-button type="primary" @click="submitForm">{{ <el-button type="primary" @click="submitForm">{{ $t("确 定") }}</el-button>
$t("确 定")
}}</el-button>
<el-button @click="cancel">{{ $t("取 消") }}</el-button> <el-button @click="cancel">{{ $t("取 消") }}</el-button>
</div> </div>
</el-col> </el-col>
...@@ -1107,42 +611,25 @@ ...@@ -1107,42 +611,25 @@
</template> </template>
<script> <script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict"; import { getDictDatas, DICT_TYPE } from "@/utils/dict"
import upload from "@/components/ImageUpload"; import upload from "@/components/ImageUpload"
import { import { createCustomer, getCustomer, getCustomerList, getCustomerPage, memberUserList, updateCustomer, userMemberUserList, getCustomerLines, fillupCustomeInfo, getServiceNetwork, addCompetitor, competitorListAll } from "@/api/ecw/customer"
createCustomer, import { getNodeList } from "@/api/ecw/node"
getCustomer, import { getProductTypeList } from "@/api/ecw/productType"
getCustomerList, import { getProductList } from "@/api/ecw/product"
getCustomerPage, import { getTradeCityList } from "@/api/ecw/region"
memberUserList, import { getWarehouseList } from "@/api/ecw/warehouse"
updateCustomer, import CustomerLineTable from "@/components/CustomerLineTable"
userMemberUserList, import { getCustomerSelect } from "@/api/ecw/customer"
getCustomerLines, import { listAllSimpl, listServiceUser, listSimpleUsers } from "@/api/system/user"
fillupCustomeInfo, import { getZhongPaoBest, getZhongPaoPage } from "@/api/ecw/zhongPao"
getServiceNetwork, import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts"
addCompetitor, import { getCountryListAll } from "@/api/ecw/country"
competitorListAll import Template from "@/views/cms/template"
} from "@/api/ecw/customer"; import { validatorMobile } from "@/api/ecw/validate"
import { getNodeList } from "@/api/ecw/node";
import { getProductTypeList } from "@/api/ecw/productType";
import { getProductList } from "@/api/ecw/product";
import { getTradeCityList } from "@/api/ecw/region";
import { getWarehouseList } from "@/api/ecw/warehouse";
import CustomerLineTable from "@/components/CustomerLineTable";
import { getCustomerSelect } from "@/api/ecw/customer";
import {
listAllSimpl,
listServiceUser,
listSimpleUsers,
} from "@/api/system/user";
import { getZhongPaoBest, getZhongPaoPage } from "@/api/ecw/zhongPao";
import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts";
import { getCountryListAll } from "@/api/ecw/country";
import Template from "@/views/cms/template";
import { validatorMobile } from "@/api/ecw/validate";
// import {customerDropDownList} from "@/api/ecw/customerCommissionInfo"; // import {customerDropDownList} from "@/api/ecw/customerCommissionInfo";
import MemberSelector from "@/components/MemberSelector"; import MemberSelector from "@/components/MemberSelector"
import { getCurrencyList } from "@/api/ecw/currency"; import { getCurrencyList } from "@/api/ecw/currency"
export default { export default {
name: "EcwCustomerEdit", name: "EcwCustomerEdit",
...@@ -1151,46 +638,41 @@ export default { ...@@ -1151,46 +638,41 @@ export default {
Template, Template,
upload, upload,
CustomerLineTable, CustomerLineTable,
MemberSelector, MemberSelector
}, },
created() { created() {
getCurrencyList().then((response) => { getCurrencyList().then((response) => {
this.currecyList = response.data; this.currecyList = response.data
}); })
this.isCustomerServiceConfirmed = this.$route.query this.isCustomerServiceConfirmed = this.$route.query.isCustomerServiceConfirmed ? true : false
.isCustomerServiceConfirmed this.getCustomerSelect()
? true this.reset()
: false;
this.getCustomerSelect();
this.reset();
// this.getUserMemberUserFn() // this.getUserMemberUserFn()
if (this.customerId !== "0") { if (this.customerId !== "0") {
let customerId = this.customerId; let customerId = this.customerId
// 编辑客户 // 编辑客户
this.getCustomer(this.customerId).then(() => { this.getCustomer(this.customerId).then(() => {
getCustomerContactsListByCustomer({ customerId: customerId }).then( getCustomerContactsListByCustomer({ customerId: customerId }).then((r) => {
(r) => { this.form.customerContacts = r.data
this.form.customerContacts = r.data; this.form.customerContacts.forEach((item) => {
this.form.customerContacts.forEach((item) => { if (item.email) {
if (item.email) { item.email = item.email.split(",")
item.email = item.email.split(","); } else {
} else { item.email = [""]
item.email = [""]; }
} })
}); })
}
);
if (this.form.promoter) { if (this.form.promoter) {
getCustomerList({ ids: this.form.promoter }).then((r) => { getCustomerList({ ids: this.form.promoter }).then((r) => {
this.recommended = r.data; this.recommended = r.data
}); })
} }
// 打开重泡货开关 // 打开重泡货开关
if (this.form.weightUnit) { if (this.form.weightUnit) {
this.showZhong = true; this.showZhong = true
} }
if (this.form.lightUnit) { if (this.form.lightUnit) {
this.showPao = true; this.showPao = true
} }
// 掉入公海时间 // 掉入公海时间
this.enterOpenSeaTime = this.form.estimateEnterOpenSeaTime || this.form.enterOpenSeaTime || undefined this.enterOpenSeaTime = this.form.estimateEnterOpenSeaTime || this.form.enterOpenSeaTime || undefined
...@@ -1198,46 +680,46 @@ export default { ...@@ -1198,46 +680,46 @@ export default {
if (customerId) { if (customerId) {
// 获取重泡货路线 // 获取重泡货路线
getCustomerLines(customerId).then((res) => { getCustomerLines(customerId).then((res) => {
this.zhongLines = res.data.filter((item) => item.zhongPaoType == 1); this.zhongLines = res.data.filter((item) => item.zhongPaoType == 1)
this.paoLines = res.data.filter((item) => item.zhongPaoType == 2); this.paoLines = res.data.filter((item) => item.zhongPaoType == 2)
if (this.zhongLines.length) this.showZhong1 = true; if (this.zhongLines.length) this.showZhong1 = true
if (this.paoLines.length) this.showPao1 = true; if (this.paoLines.length) this.showPao1 = true
// /admin-api/customer-line/get-by-customer // /admin-api/customer-line/get-by-customer
// /admin-api/customer-line/get-by-customer?customerId=29564 // /admin-api/customer-line/get-by-customer?customerId=29564
}); })
} }
}); })
} else { } else {
this.getZhongPao(); this.getZhongPao()
// 新建客户 // 新建客户
this.handleAddContact(); this.handleAddContact()
if (this.isCustomerServiceConfirmed) { if (this.isCustomerServiceConfirmed) {
this.form.customerService = this.userId; this.form.customerService = this.userId
} }
} }
getNodeList().then((r) => { getNodeList().then((r) => {
this.getNodeLists = r.data; this.getNodeLists = r.data
}); })
getProductTypeList().then((r) => { getProductTypeList().then((r) => {
this.productTypeList = r.data; this.productTypeList = r.data
}); })
getTradeCityList({ type: 1 }).then((r) => { getTradeCityList({ type: 1 }).then((r) => {
this.importCityList = r.data.filter((item) => item.type === "1"); this.importCityList = r.data.filter((item) => item.type === "1")
}); })
getWarehouseList().then((r) => { getWarehouseList().then((r) => {
this.warehouseList = r.data; this.warehouseList = r.data
}); })
listServiceUser().then((r) => { listServiceUser().then((r) => {
this.serviceUserList = r.data; this.serviceUserList = r.data
}); })
listAllSimpl().then((r) => { listAllSimpl().then((r) => {
this.allSimplList = r.data; this.allSimplList = r.data
}); })
getCountryListAll().then((r) => { getCountryListAll().then((r) => {
this.countryList = r.data; this.countryList = r.data
}); })
this.getCompetitorList() this.getCompetitorList()
}, },
data() { data() {
...@@ -1255,89 +737,85 @@ export default { ...@@ -1255,89 +737,85 @@ export default {
{ {
required: true, required: true,
message: this.$t("客户名称不能为空"), message: this.$t("客户名称不能为空"),
trigger: "blur", trigger: "blur"
}, }
],
country: [
{ required: true, message: this.$t("国家不能为空"), trigger: "blur" },
], ],
country: [{ required: true, message: this.$t("国家不能为空"), trigger: "blur" }],
level: [ level: [
{ {
required: true, required: true,
message: this.$t("客户等级不能为空"), message: this.$t("客户等级不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
type: [ type: [
{ {
required: true, required: true,
message: this.$t("客户类别不能为空"), message: this.$t("客户类别不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
createTime: [ createTime: [
{ {
required: true, required: true,
message: this.$t("创建时间不能为空"), message: this.$t("创建时间不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
source: [ source: [
{ {
required: true, required: true,
message: this.$t("客户来源不能为空"), message: this.$t("客户来源不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
customerService: [ customerService: [
{ {
required: this.customerId === "0", required: this.customerId === "0",
message: this.$t("客户经理不能为空"), message: this.$t("客户经理不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
status: [ status: [
{ {
required: true, required: true,
message: this.$t("客户状态不能为空"), message: this.$t("客户状态不能为空"),
trigger: "blur", trigger: "blur"
}, }
], ],
busiCountryIds: [ busiCountryIds: [
{ {
required: true, required: true,
message: this.$t("请选择业务国家"), message: this.$t("请选择业务国家"),
trigger: "blur", trigger: "blur"
}, }
], ],
competitorIds: [ competitorIds: [
{ {
required: true, required: true,
message: this.$t("请选择主要竞争对手"), message: this.$t("请选择主要竞争对手"),
trigger: "change", trigger: "change"
}, }
], ],
pickupPoints: [ pickupPoints: [
{ {
required: true, required: true,
message: this.$t("请选择常用提货网点"), message: this.$t("请选择常用提货网点"),
trigger: "change", trigger: "change"
}, }
], ],
productType: [ productTypes: [
{ {
required: true, required: true,
message: this.$t("请选择产品类别"), message: this.$t("请选择产品类别"),
trigger: "change", trigger: "change"
}, }
], ]
}, },
contactRules: { contactRules: {
name: [ name: [{ required: true, message: this.$t("请输入联系人"), trigger: "blur" }],
{ required: true, message: this.$t("请输入联系人"), trigger: "blur" },
],
areaCode: [ areaCode: [
{ required: true, message: this.$t("请选择区号"), trigger: "change" }, { required: true, message: this.$t("请选择区号"), trigger: "change" }
/*{ /*{
required: true, required: true,
trigger: "change", trigger: "change",
...@@ -1348,9 +826,9 @@ export default { ...@@ -1348,9 +826,9 @@ export default {
{ {
required: true, required: true,
trigger: "blur", trigger: "blur",
validator: this.phoneValidator, validator: this.phoneValidator
}, }
], ]
}, },
// 网点 // 网点
nodeList: [], nodeList: [],
...@@ -1379,28 +857,28 @@ export default { ...@@ -1379,28 +857,28 @@ export default {
showShippingFlag: true, showShippingFlag: true,
showSettingFlag: true, showSettingFlag: true,
showFinanceFlag: true, showFinanceFlag: true,
competitorList: [], competitorList: []
}; }
}, },
methods: { methods: {
addEmail(row) { addEmail(row) {
row.push(""); row.push("")
}, },
deleteEmail(row, index) { deleteEmail(row, index) {
row.splice(index, 1); row.splice(index, 1)
}, },
change(val) { change(val) {
this.form.productIds = []; this.form.productIds = []
this.getProductListFn(val); this.getProductListFn(val)
}, },
getProductListFn(val) { getProductListFn(val) {
getProductList({ typeId: val }).then((r) => { getProductList({ typeIds: val }).then((r) => {
this.productList = r.data; this.productList = r.data
}); })
}, },
deleteBankData(index) { deleteBankData(index) {
this.form.customerBanks.splice(index, 1); this.form.customerBanks.splice(index, 1)
}, },
//添加银行卡 //添加银行卡
addBankData() { addBankData() {
...@@ -1412,10 +890,10 @@ export default { ...@@ -1412,10 +890,10 @@ export default {
accountType: null, accountType: null,
status: null, status: null,
currency: "", currency: "",
accountName: "", accountName: ""
}; }
this.form.customerBanks = [...this.form.customerBanks, p]; this.form.customerBanks = [...this.form.customerBanks, p]
}, },
/* getUserMemberUserFn(val){ /* getUserMemberUserFn(val){
userMemberUserList({pageNo:1,pageSize:100,searchKey:val}).then(r => { userMemberUserList({pageNo:1,pageSize:100,searchKey:val}).then(r => {
...@@ -1423,87 +901,80 @@ export default { ...@@ -1423,87 +901,80 @@ export default {
}) })
}, */ }, */
remoteMethod(val) { remoteMethod(val) {
this.getCustomerSelect(val); this.getCustomerSelect(val)
}, },
getCustomerSelect(val = "") { getCustomerSelect(val = "") {
getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then( getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then((res) => {
(res) => { this.customerSelect = res.data.list
this.customerSelect = res.data.list; })
}
);
}, },
phoneValidator(rule, value, callback) { phoneValidator(rule, value, callback) {
if (!value) { if (!value) {
return callback(new Error(this.$t("请输入联系方式"))); return callback(new Error(this.$t("请输入联系方式")))
} }
let areaCode = this.form.customerContacts.find( let areaCode = this.form.customerContacts.find((e) => e.phoneNew === value).areaCode
(e) => e.phoneNew === value
).areaCode;
if (areaCode) { if (areaCode) {
validatorMobile({ validatorMobile({
code: areaCode, code: areaCode,
mobile: value, mobile: value
}) })
.then((r) => { .then((r) => {
if (r.data) { if (r.data) {
callback(); callback()
} else { } else {
callback(new Error(r.msg || this.$t("手机号验证失败"))); callback(new Error(r.msg || this.$t("手机号验证失败")))
} }
}) })
.catch((e) => { .catch((e) => {
console.error(e); console.error(e)
callback(new Error(this.$t("手机号验证失败"))); callback(new Error(this.$t("手机号验证失败")))
}); })
} }
}, },
codeValidator(rule, value, callback) { codeValidator(rule, value, callback) {
let index = +rule.field.split(".")[1]; let index = +rule.field.split(".")[1]
let phone = this.form.customerContacts[index].phoneNew; let phone = this.form.customerContacts[index].phoneNew
if (phone) { if (phone) {
validatorMobile({ validatorMobile({
code: value, code: value,
mobile: phone, mobile: phone
}) })
.then((r) => { .then((r) => {
if (r.data) { if (r.data) {
callback(); callback()
} else { } else {
callback(); callback()
this.$message.error(r.msg || this.$t("手机号验证失败")); this.$message.error(r.msg || this.$t("手机号验证失败"))
} }
}) })
.catch((e) => { .catch((e) => {
console.error(e); console.error(e)
callback(); callback()
this.$message.error(this.$t("手机号验证失败")); this.$message.error(this.$t("手机号验证失败"))
}); })
} }
}, },
handleDefaultChange($index) { handleDefaultChange($index) {
// 只有一个联系人,设置成非默认 // 只有一个联系人,设置成非默认
if ( if (this.form.customerContacts.length === 1 && this.form.customerContacts[0].isDefault === 0) {
this.form.customerContacts.length === 1 && this.$modal.msgWarning(this.$t("至少拥有一个默认联系人"))
this.form.customerContacts[0].isDefault === 0 this.form.customerContacts[0].isDefault = 1
) { return
this.$modal.msgWarning(this.$t("至少拥有一个默认联系人"));
this.form.customerContacts[0].isDefault = 1;
return;
} }
// 设置默认联系人 // 设置默认联系人
if (this.form.customerContacts[$index].isDefault === 1) { if (this.form.customerContacts[$index].isDefault === 1) {
// 其他的置否 // 其他的置否
let i = 0; let i = 0
this.form.customerContacts.forEach((e) => { this.form.customerContacts.forEach((e) => {
if (i !== $index) { if (i !== $index) {
e.isDefault = 0; e.isDefault = 0
} }
i++; i++
}); })
} else { } else {
// 第一个置是 // 第一个置是
this.form.customerContacts[0].isDefault = 1; this.form.customerContacts[0].isDefault = 1
} }
}, },
/* selectBD(val){ /* selectBD(val){
...@@ -1518,49 +989,49 @@ export default { ...@@ -1518,49 +989,49 @@ export default {
}, */ }, */
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
this.$tab.closePage(); this.$tab.closePage()
this.open = false; this.open = false
this.reset(); this.reset()
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
if (this.form.customerContacts.length === 0) { if (this.form.customerContacts.length === 0) {
this.$modal.alert(this.$t("至少添加一位联系人")); this.$modal.alert(this.$t("至少添加一位联系人"))
return; return
} }
this.$refs["contactForm"].validate((valid1, err1) => { this.$refs["contactForm"].validate((valid1, err1) => {
this.$refs["form"].validate((valid2, err2) => { this.$refs["form"].validate((valid2, err2) => {
this.$refs.bankForm.validate((valid3, err3) => { this.$refs.bankForm.validate((valid3, err3) => {
console.log(valid3, "valid3"); console.log(valid3, "valid3")
if (!valid1 || !valid2 || !valid3) { if (!valid1 || !valid2 || !valid3) {
this.$showFormValidateErrors({ ...err1, ...err2, ...err3 }); this.$showFormValidateErrors({ ...err1, ...err2, ...err3 })
return; return
} }
if (this.form.customerContacts.length === 0) { if (this.form.customerContacts.length === 0) {
this.$modal.msgError(this.$t("至少填写一个联系人信息")); this.$modal.msgError(this.$t("至少填写一个联系人信息"))
return; return
} }
if (this.form.competitorIds == 0) { if (this.form.competitorIds == 0) {
this.$modal.msgError(this.$t("请重新选择主要竞争对手")); this.$modal.msgError(this.$t("请重新选择主要竞争对手"))
return; return
} }
// 重货标准和泡货标准,未打开就不传,提交前清空一下 // 重货标准和泡货标准,未打开就不传,提交前清空一下
if (!this.showZhong) { if (!this.showZhong) {
this.form.weightUnit = null; this.form.weightUnit = null
this.zhongLines = []; this.zhongLines = []
} }
if (!this.showZhong1) { if (!this.showZhong1) {
this.zhongLines = []; this.zhongLines = []
} }
if (!this.showPao) { if (!this.showPao) {
this.form.lightUnit = null; this.form.lightUnit = null
this.paoLines = []; this.paoLines = []
} }
if (!this.showPao1) { if (!this.showPao1) {
this.paoLines = []; this.paoLines = []
} }
this.updateCustomerLines(); this.updateCustomerLines()
const form = { const form = {
...this.form, ...this.form,
type: this.form.type?.join(","), type: this.form.type?.join(","),
...@@ -1569,68 +1040,67 @@ export default { ...@@ -1569,68 +1040,67 @@ export default {
roles: (this.form.roles || [])?.join(","), roles: (this.form.roles || [])?.join(","),
pickupPoints: (this.form.pickupPoints || [])?.join(","), pickupPoints: (this.form.pickupPoints || [])?.join(","),
productIds: (this.form.productIds || [])?.join(","), productIds: (this.form.productIds || [])?.join(","),
productTypes: (this.form.productTypes || [])?.join(","),
busiCountryIds: (this.form.busiCountryIds || [])?.join(","), busiCountryIds: (this.form.busiCountryIds || [])?.join(","),
noConsignee: undefined, noConsignee: undefined,
defaultPay: undefined, defaultPay: undefined,
defaultBilling: undefined, defaultBilling: undefined
}; }
form.customerContacts = JSON.parse( form.customerContacts = JSON.parse(JSON.stringify(this.form.customerContacts))
JSON.stringify(this.form.customerContacts)
);
form.customerContacts.forEach((e) => { form.customerContacts.forEach((e) => {
e.email = [...e.email].filter((i) => i !== "").join(","); e.email = [...e.email].filter((i) => i !== "").join(",")
}); })
// 检查路线是否启用了但是没选择目的仓 // 检查路线是否启用了但是没选择目的仓
let errors = 0; let errors = 0
form.customerLines.forEach((line) => { form.customerLines.forEach((line) => {
if (!line.objectiveIds || line.objectiveIds == "") { if (!line.objectiveIds || line.objectiveIds == "") {
errors++; errors++
} }
}); })
if (errors) { if (errors) {
return this.$message.error("有两条路线未选择目的地"); return this.$message.error("有两条路线未选择目的地")
} }
//我的客户页面跳转直接,完善客户 //我的客户页面跳转直接,完善客户
if (this.isCustomerServiceConfirmed) { if (this.isCustomerServiceConfirmed) {
form.isCustomerServiceConfirmed = this.isCustomerServiceConfirmed; form.isCustomerServiceConfirmed = this.isCustomerServiceConfirmed
} }
// 修改的提交 // 修改的提交
if (this.form.id != null) { if (this.form.id != null) {
this.form.customerContacts.forEach((e) => { this.form.customerContacts.forEach((e) => {
e.customerId = this.customerId; e.customerId = this.customerId
}); })
console.log(this.form) console.log(this.form)
if (this.$route.name === "perfect") { if (this.$route.name === "perfect") {
fillupCustomeInfo(form).then((r) => { fillupCustomeInfo(form).then((r) => {
this.$modal.msgSuccess(this.$t("修改成功")); this.$modal.msgSuccess(this.$t("修改成功"))
this.open = false; this.open = false
const obj = { path: "/customer/customer" }; const obj = { path: "/customer/customer" }
this.$tab.closeOpenPage(obj); this.$tab.closeOpenPage(obj)
}); })
} else { } else {
updateCustomer(form).then((response) => { updateCustomer(form).then((response) => {
this.$modal.msgSuccess(this.$t("修改成功")); this.$modal.msgSuccess(this.$t("修改成功"))
this.open = false; this.open = false
// this.getList(); // this.getList();
const obj = { path: "/customer/customer" }; const obj = { path: "/customer/customer" }
this.$tab.closeOpenPage(obj); this.$tab.closeOpenPage(obj)
}); })
} }
return; return
} }
// 添加的提交 // 添加的提交
createCustomer(form).then((response) => { createCustomer(form).then((response) => {
this.$modal.msgSuccess(this.$t("新增成功")); this.$modal.msgSuccess(this.$t("新增成功"))
this.open = false; this.open = false
// this.getList(); // this.getList();
const obj = { path: "/customer/customer" }; const obj = { path: "/customer/customer" }
this.$tab.closeOpenPage(obj); this.$tab.closeOpenPage(obj)
}); })
}); })
}); })
}); })
}, },
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
...@@ -1683,63 +1153,61 @@ export default { ...@@ -1683,63 +1153,61 @@ export default {
carName: undefined, carName: undefined,
carNo: undefined, carNo: undefined,
customerBanks: [], customerBanks: [],
isNew: true,// 业绩类型 isNew: true, // 业绩类型
firstDealTime: undefined,// 首次成交时间 firstDealTime: undefined, // 首次成交时间
// estimateEnterOpenSeaTime: undefined,// 掉入公海时间 // estimateEnterOpenSeaTime: undefined,// 掉入公海时间
getMethod: undefined,// 获取方式 getMethod: undefined, // 获取方式
createFrom: undefined,// 创建入口 createFrom: undefined, // 创建入口
catchTime: undefined,//捞取时间 catchTime: undefined, //捞取时间
customerServiceConfirmedTime: undefined,//归属时间 customerServiceConfirmedTime: undefined, //归属时间
updater: this.$store.getters.userId,// 更新人 updater: this.$store.getters.userId, // 更新人
updateTime: undefined,// 更新时间 updateTime: undefined, // 更新时间
roles: undefined,// 客户角色 roles: undefined, // 客户角色
busiCountryIds: undefined,// 业务国家 busiCountryIds: undefined, // 业务国家
competitorIds: undefined,// 主要竞争对手 competitorIds: undefined, // 主要竞争对手
weightYearly: undefined,// 年度发货量 weightYearly: undefined, // 年度发货量
numYearly: undefined,// 年度发货次数 numYearly: undefined, // 年度发货次数
noConsignee: false,// 控制无收货人 noConsignee: false, // 控制无收货人
defaultPay: false,// 默认付款 defaultPay: false, // 默认付款
defaultBilling: false,// 默认开票 defaultBilling: false // 默认开票
}; }
this.form.createTime = new Date().getTime(); this.form.createTime = new Date().getTime()
this.form.updateTime = new Date().getTime(); this.form.updateTime = new Date().getTime()
this.resetForm("form"); this.resetForm("form")
}, },
getCustomer(id) { getCustomer(id) {
return getCustomer(id).then((response) => { return getCustomer(id).then((response) => {
console.log(response, "response"); console.log(response, "response")
this.form = { this.form = {
...this.form, ...this.form,
...response.data, ...response.data,
id: this.customerId, id: this.customerId,
transportType: transportType: response.data.transportType && response.data.transportType !== "" ? response.data.transportType.split(",") : [],
response.data.transportType && response.data.transportType !== ""
? response.data.transportType.split(",")
: [],
customerBanks: response.data.customerBankBackVOList, customerBanks: response.data.customerBankBackVOList,
roles: response.data.roles? response.data.roles.split(",") : [], roles: response.data.roles ? response.data.roles.split(",") : [],
pickupPoints: this.stringArrToNumberArr(response.data.pickupPoints), pickupPoints: this.stringArrToNumberArr(response.data.pickupPoints),
productIds: this.stringArrToNumberArr(response.data.productIds), productIds: this.stringArrToNumberArr(response.data.productIds),
busiCountryIds: this.stringArrToNumberArr(response.data.busiCountryIds), 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) { if (this.form.productType) {
console.log("1231", this.form.productType); console.log("1231", this.form.productType)
this.getProductListFn(this.form.productType); this.getProductListFn(this.form.productType)
} }
console.log(this.form) console.log(this.form)
this.open = true; this.open = true
this.title = this.$t("修改客户"); this.title = this.$t("修改客户")
this.$forceUpdate() this.$forceUpdate()
this.getZhongPao(); this.getZhongPao()
}); })
}, },
stringArrToNumberArr(data) { stringArrToNumberArr(data) {
if (data) { if (data) {
const strArr = data.split(",") const strArr = data.split(",")
const numArr = strArr.map(item => Number(item)) const numArr = strArr.map((item) => Number(item))
return numArr return numArr
} else { } else {
return [] return []
...@@ -1747,14 +1215,14 @@ export default { ...@@ -1747,14 +1215,14 @@ export default {
}, },
updateCustomerLines() { updateCustomerLines() {
let zhongLines = [], let zhongLines = [],
paoLines = []; paoLines = []
if (this.zhongLines.length > 0) { if (this.zhongLines.length > 0) {
zhongLines = this.zhongLines; zhongLines = this.zhongLines
} }
if (this.paoLines.length > 0) { if (this.paoLines.length > 0) {
paoLines = this.paoLines; paoLines = this.paoLines
} }
this.form.customerLines = [...zhongLines, ...paoLines]; this.form.customerLines = [...zhongLines, ...paoLines]
}, },
handleAddContact() { handleAddContact() {
this.form.customerContacts.push({ this.form.customerContacts.push({
...@@ -1769,47 +1237,52 @@ export default { ...@@ -1769,47 +1237,52 @@ export default {
social: undefined, social: undefined,
socialNumber: "", socialNumber: "",
userid: undefined, userid: undefined,
nameEn: "", nameEn: ""
// "username": "" // "username": ""
}); })
}, },
handleDeleteContact($index) { handleDeleteContact($index) {
this.form.customerContacts.splice($index, 1); this.form.customerContacts.splice($index, 1)
if (this.form.customerContacts.length > 0) { if (this.form.customerContacts.length > 0) {
this.$refs["contactForm"].clearValidate(); this.$refs["contactForm"].clearValidate()
if (!this.form.customerContacts.find((e) => e.isDefault)) { if (!this.form.customerContacts.find((e) => e.isDefault)) {
this.form.customerContacts[0].isDefault = 1; this.form.customerContacts[0].isDefault = 1
} }
} }
}, },
getZhongPao() { getZhongPao() {
getZhongPaoBest({ getZhongPaoBest({
customerId: this.customerId, customerId: this.customerId
// departureId: this.departureId, // departureId: this.departureId,
// objectiveId: this.objectiveId // objectiveId: this.objectiveId
}).then((r) => { }).then((r) => {
if (!this.form.weightUnit) this.form.weightUnit = r.data.zhongEdge; if (!this.form.weightUnit) this.form.weightUnit = r.data.zhongEdge
if (!this.form.lightUnit) this.form.lightUnit = r.data.paoEdge; if (!this.form.lightUnit) this.form.lightUnit = r.data.paoEdge
}); })
}, },
getCompetitorList() { getCompetitorList(callback) {
competitorListAll().then((r) => { competitorListAll().then((r) => {
this.competitorList = r.data; this.competitorList = r.data
this.$nextTick(() => {
callback && callback()
})
}) })
}, },
changeCompetitor(val) { changeCompetitor(val) {
if (val == 0) { if (val == 0) {
this.$prompt("请输入主要竞争对手", "提示", { this.$prompt("请输入主要竞争对手", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消"
}).then((data) => { }).then((data) => {
console.log(data) console.log(data)
addCompetitor({ addCompetitor({
name: data.value name: data.value
}).then(_ => { }).then((r) => {
this.$message.success('添加成功!') this.$message.success("添加成功!")
this.getCompetitorList() this.getCompetitorList(() => {
this.form.competitorIds = r.data
})
}) })
}) })
} }
...@@ -1817,13 +1290,13 @@ export default { ...@@ -1817,13 +1290,13 @@ export default {
}, },
computed: { computed: {
isChinese() { isChinese() {
return this.$i18n.locale === "zh_CN"; return this.$i18n.locale === "zh_CN"
}, },
userId() { userId() {
return this.$store.state.user.id; return this.$store.state.user.id
}, },
customerId() { customerId() {
return this.$route.params.customerId; return this.$route.params.customerId
}, },
/* userMemberUser(){ /* userMemberUser(){
let list = this.memberList.filter(item => { let list = this.memberList.filter(item => {
...@@ -1832,33 +1305,31 @@ export default { ...@@ -1832,33 +1305,31 @@ export default {
return [...this.selectMemberList,...list] return [...this.selectMemberList,...list]
}, */ }, */
productListFilter() { productListFilter() {
return this.productList.filter((p) => p.typeId === this.form.productType); return this.productList.filter((p) => p.typeId === this.form.productType)
}, },
customerSelectFn() { customerSelectFn() {
if (this.recommended.length > 0) { if (this.recommended.length > 0) {
let i = this.customerSelect.find( let i = this.customerSelect.find((item) => item.id === this.recommended[0].id)
(item) => item.id === this.recommended[0].id
);
if (!i) { if (!i) {
this.customerSelect.push(this.recommended[0]); this.customerSelect.push(this.recommended[0])
} }
return this.customerSelect; return this.customerSelect
} else { } else {
return this.customerSelect; return this.customerSelect
} }
}, }
}, },
watch: { watch: {
zhongLines() { zhongLines() {
console.log("zhongLines", this.zhongLines); console.log("zhongLines", this.zhongLines)
this.updateCustomerLines(); this.updateCustomerLines()
}, },
paoLines() { paoLines() {
console.log("paoLines", this.paoLines); console.log("paoLines", this.paoLines)
this.updateCustomerLines(); this.updateCustomerLines()
}, }
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
...@@ -1877,7 +1348,7 @@ export default { ...@@ -1877,7 +1348,7 @@ export default {
} }
} }
.title-text { .title-text {
font-size: 18px; font-size: 18px;
color: #111; color: #111;
} }
</style> </style>
...@@ -334,106 +334,7 @@ ...@@ -334,106 +334,7 @@
</el-card> </el-card>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="follow" :label="$t('跟进')"> <el-tab-pane name="follow" :label="$t('跟进')">
<el-card class="box-card"> <logListCommon ref="logListCommon" v-if="activeName === 'follow'" :customerId="id" />
<div slot="header" class="clearfix">
<el-form size="small" :inline="true" label-width="100px">
<el-form-item :label="$t('跟进类型')">
<el-select clearable multiple v-model="followForm.followTypes" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_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 multiple v-model="followForm.followMethods" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_METHOD)" :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 multiple v-model="followForm.resultTypes" :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 multiple v-model="followForm.statuses" :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 :label="$t('跟进时间')">
<el-date-picker type="datetimerange" clearable v-model="followTime" style="width: 320px" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始跟进时间')" :end-placeholder="$t('结束跟进时间')" />
</el-form-item>
<el-form-item :label="$t('下次跟进时间')">
<el-date-picker type="datetimerange" clearable v-model="nextTime" style="width: 320px" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始下次跟进时间')" :end-placeholder="$t('结束下次跟进时间')" />
</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" @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>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="complain" :label="$t('客户投诉')"> <el-tab-pane name="complain" :label="$t('客户投诉')">
<customer-complaint v-if="activeName === 'complain'" ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint> <customer-complaint v-if="activeName === 'complain'" ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint>
...@@ -705,7 +606,7 @@ ...@@ -705,7 +606,7 @@
</div> </div>
</el-dialog> </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> </div>
</template> </template>
...@@ -731,7 +632,8 @@ import ImageDisplay from "@/views/ecw/order/components/imageDisplay.vue" ...@@ -731,7 +632,8 @@ import ImageDisplay from "@/views/ecw/order/components/imageDisplay.vue"
import { getListTree } from "@/api/ecw/region" import { getListTree } from "@/api/ecw/region"
import { getWarehouseList } from "@/api/ecw/warehouse" import { getWarehouseList } from "@/api/ecw/warehouse"
import { deleteOffer, cancel, recovery } from "@/api/ecw/offer" import { deleteOffer, cancel, recovery } from "@/api/ecw/offer"
import { getCustomerFollowList, exportCustomerFollow } from "@/api/ecw/customerFollow"
import logListCommon from "@/views/ecw/offer/logListCommon"
export default { export default {
name: "query", name: "query",
...@@ -740,7 +642,8 @@ export default { ...@@ -740,7 +642,8 @@ export default {
Template, Template,
CustomerFollow, CustomerFollow,
CustomerComplaint, CustomerComplaint,
customerLog customerLog,
logListCommon
}, },
created() { created() {
// 获取币种 // 获取币种
...@@ -811,7 +714,6 @@ export default { ...@@ -811,7 +714,6 @@ export default {
this.getInfoListOfferPage() //报价 this.getInfoListOfferPage() //报价
break break
case "follow": case "follow":
this.getCustomerFollowList()
case "bill": case "bill":
this.infoListReceiptFn() //账单 this.infoListReceiptFn() //账单
break break
...@@ -991,14 +893,7 @@ export default { ...@@ -991,14 +893,7 @@ export default {
objectiveId: null, objectiveId: null,
destWarehouseId: null, destWarehouseId: null,
customerFollowVisible: false, customerFollowVisible: false,
followForm: {
pageNo: 1,
pageSize: 10
},
followTime: [],
nextTime: [], nextTime: [],
customerFollowTotal: 0,
customerFollowList: [],
currencyList: [], currencyList: [],
userId: undefined userId: undefined
} }
...@@ -1080,18 +975,6 @@ export default { ...@@ -1080,18 +975,6 @@ export default {
this.$router.push({ path: "/offer/create", query: { customerId: row.id, customerType: row.type, type: 1 } }) 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, checkPermi,
userIdFormatter(row, column, cellValue) { userIdFormatter(row, column, cellValue) {
const member = this.memberList.find((e) => e.id === cellValue) const member = this.memberList.find((e) => e.id === cellValue)
...@@ -1192,27 +1075,6 @@ export default { ...@@ -1192,27 +1075,6 @@ export default {
this.infoListOfferFrom = { pageNo: 1, pageSize: 10 } this.infoListOfferFrom = { pageNo: 1, pageSize: 10 }
this.getInfoListOfferPage() 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() { getOrderStatistics() {
orderStatistics({ customerId: this.id }).then((r) => { orderStatistics({ customerId: this.id }).then((r) => {
...@@ -1340,6 +1202,9 @@ export default { ...@@ -1340,6 +1202,9 @@ export default {
this.$message.success("操作成功") this.$message.success("操作成功")
this.handleQuery() this.handleQuery()
}) })
},
logListCommonRefresh() {
this.$refs.logListCommon && this.$refs.logListCommon.handleQuery()
} }
} }
} }
......
...@@ -1100,6 +1100,9 @@ export default { ...@@ -1100,6 +1100,9 @@ export default {
if (this.form.offerId != this.$route.query.id) { if (this.form.offerId != this.$route.query.id) {
this.getOffer() this.getOffer()
} }
if (this.$route.query.copyId && this.form.copyId != this.$route.query.copyId) {
this.getOffer()
}
}, },
async created() { async created() {
await this.getChannelList() await this.getChannelList()
...@@ -1154,7 +1157,7 @@ export default { ...@@ -1154,7 +1157,7 @@ export default {
getOffer() { getOffer() {
//加了是否从全部客户列表中报价按钮进来的判断 //加了是否从全部客户列表中报价按钮进来的判断
if (this.$route.query !== 1) { if (this.$route.query !== 1) {
getOffer(this.$route.query.id).then((res) => { getOffer(this.$route.query.id || this.$route.query.copyId).then((res) => {
let formData = res.data let formData = res.data
formData.type = formData.type ? formData.type.split(",").filter((item) => item != "") : [] formData.type = formData.type ? formData.type.split(",").filter((item) => item != "") : []
formData.prodCreateReqVOList = [] formData.prodCreateReqVOList = []
...@@ -1187,6 +1190,14 @@ export default { ...@@ -1187,6 +1190,14 @@ export default {
}) })
}) })
} }
if (this.$route.query.copyId) {
formData.offerId = ""
formData.startTime = ""
formData.endTime = ""
formData.stopTime = ""
}
this.$set(this, "form", formData) this.$set(this, "form", formData)
// 接口只返回了发货人和收货人ID,还需要调用接口获取详细信息回显 // 接口只返回了发货人和收货人ID,还需要调用接口获取详细信息回显
getCustomerContactsSelect({ getCustomerContactsSelect({
......
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item :label="$t('编号')" prop="searchNumber"> <el-form-item :label="$t('编号')" prop="searchNumber">
<el-input v-model="queryParams.searchNumber" :placeholder="$t('请输入报价单号、订单号')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model.trim="queryParams.searchNumber" :placeholder="$t('请输入报价单号、订单号')" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户')" prop="searchCustomer"> <el-form-item :label="$t('客户')" prop="searchCustomer">
<el-input v-model="queryParams.searchCustomer" :placeholder="$t('请输入客户')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model.trim="queryParams.searchCustomer" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('联系方式')" prop="relationPhone">
<el-input v-model.trim="queryParams.relationPhone" clearable @keyup.enter.native="handleQuery" @input="queryParams.relationPhone = queryParams.relationPhone.replace(/\s+/g, '')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建时间')" prop="orderNo"> <el-form-item :label="$t('区号')" prop="relationAreaCode">
<el-date-picker type="datetime" v-model="queryParams.beginCreateTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>{{ $t('') }}<el-date-picker v-model="queryParams.endCreateTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker> <el-input v-model.trim="queryParams.relationAreaCode" :placeholder="$t('请输入客户')" clearable @keyup.enter.native="handleQuery" @input="queryParams.relationAreaCode = queryParams.relationAreaCode.replace(/\s+/g, '')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('始发地')" prop="departureId"> <el-form-item :label="$t('始发地')" prop="departureId">
...@@ -20,92 +23,149 @@ ...@@ -20,92 +23,149 @@
<el-option v-for="item in exportCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in exportCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的地')" prop="objectiveId">
<el-select v-model="queryParams.objectiveId" :placeholder="$t('请选择目的地')" clearable> <el-form-item :label="$t('目的国')" prop="destCountryId">
<el-option v-for="item in importCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option> <el-select v-model="destCountryId" multiple :label="destCountryId" :placeholder="$t('请选择目的国')" clearable @change="handleQuery">
<el-option v-for="item in AddressProvince" :key="item.guojia" :label="item.guojiaName" :value="item.guojia"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select v-model="objectiveId" multiple :placeholder="$t('请选择目的城市')" style="width: 200px" clearable @change="handleQuery">
<el-option v-for="item in AddressCity" :key="item.shi" :label="item.shiName" :value="item.shi"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select v-model="destWarehouseId" multiple :placeholder="$t('请选择目的仓')" style="width: 200px" clearable @change="handleQuery">
<el-option v-for="item in AddressTown" :key="item.id" :label="item.titleZh" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('运输方式')" prop="transportId"> <el-form-item :label="$t('客户经理')" prop="salesmanIds">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportId" formatter="number" clearable /> <user-selector v-model="queryParams.salesmanIds" multiple clearable @change="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('商品')" prop="prodTitle"> <el-form-item :label="$t('销售阶段')" prop="statusList">
<el-input v-model="queryParams.prodTitle" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery"/> <dict-selector :type="DICT_TYPE.ECW_OFFER_STATUS" multiple v-model="queryParams.statusList" clearable @change="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('控货')" prop="control"> <el-form-item :label="$t('重要程度')" prop="importances">
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" v-model="queryParams.control" clearable /> <el-select v-model="queryParams.importances" multiple :placeholder="$t('请选择')" clearable @change="handleQuery">
<el-option v-for="item in [1, 2, 3, 4, 5]" :label="item" :value="item" :key="item"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户经理')" prop="followUpSalesmanId">
<user-selector v-model="queryParams.followUpSalesmanId" clearable /> <el-form-item :label="$t('创建时间')">
<el-date-picker v-model="queryTmp.createTime" 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>
<el-form-item :label="$t('销售阶段')" prop="status">
<dict-selector :type="DICT_TYPE.ECW_OFFER_STATUS" v-model="queryParams.status" clearable /> <el-form-item :label="$t('运输方式')" prop="transportId" v-show="showSearch">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportId" multiple formatter="number" clearable @change="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('报关方式')" prop="customsType"> <el-form-item :label="$t('出货渠道')" prop="channelIds" v-show="showSearch">
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsType" clearable /> <selector :clearable="true" :options="channelList" :label-field="$l('name')" value-field="channelId" v-model="queryParams.channelIds" multiple @change="handleQuery"></selector>
</el-form-item>
<el-form-item :label="$t('商品')" prop="prodTitle" v-show="showSearch">
<el-input v-model.trim="queryParams.prodTitle" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('控货')" prop="control" v-show="showSearch">
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" v-model="queryParams.control" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('报关方式')" prop="customsType" v-show="showSearch">
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsType" clearable @change="handleQuery" />
</el-form-item> </el-form-item>
<div> <el-form-item :label="$t('增值服务')" prop="serviceType" v-show="showSearch">
<el-form-item :label="$t('预计结束时间')" prop="orderNo"> <el-select v-model="queryParams.serviceType" :placeholder="$t('请选择')" clearable @change="handleQuery">
<el-date-picker type="datetime" v-model="queryParams.beginStopTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>{{ $t('') }}<el-date-picker type="datetime" v-model="queryParams.endStopTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker> <el-option :label="$t('普通订单')" :value="0"></el-option>
</el-form-item> <el-option :label="$t('集运服务')" :value="1"></el-option>
<el-form-item> <el-option :label="$t('海外仓')" :value="2"></el-option>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button> </el-select>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button> </el-form-item>
</el-form-item> <el-form-item :label="$t('客户来源')" prop="sourceIds" v-show="showSearch">
</div> <dict-selector :type="DICT_TYPE.CUSTOMER_SOURCE" multiple v-model="queryParams.sourceIds" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('有效期开始')" v-show="showSearch">
<el-date-picker v-model="queryTmp.startTime" type="daterange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" value-format="yyyy-MM-dd" @change="handleQuery"> </el-date-picker>
</el-form-item>
<el-form-item :label="$t('有效期结束')" v-show="showSearch">
<el-date-picker v-model="queryTmp.endTime" type="daterange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" value-format="yyyy-MM-dd" @change="handleQuery"> </el-date-picker>
</el-form-item>
<el-form-item :label="$t('预计结束时间')" v-show="showSearch">
<el-date-picker v-model="queryTmp.stopTime" 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>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t("搜索") }}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
</el-form-item>
</el-form> </el-form>
<!-- 操作工具栏 --> <!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ecw:offer:create']">{{ $t("新增") }}</el-button>
v-hasPermi="['ecw:offer:create']">{{$t('新增')}}</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" v-hasPermi="['ecw:offer:export']">{{ $t("导出") }}</el-button>
v-hasPermi="['ecw:offer:export']">{{$t('导出')}}</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="list" border> <el-table v-loading="loading" :data="list" border>
<el-table-column :label="$t('报价单号')" align="left" prop="number" width="200px"> <el-table-column :label="$t('报价单号')" align="left" prop="number" width="150">
<template slot-scope="{row}"> <template slot-scope="{ row }">
<el-link type="primary" @click.native="$router.push('detail?offerId=' + row.offerId)">{{row.number}}</el-link> <el-link type="primary" @click.native="$router.push('detail?offerId=' + row.offerId)">{{ row.number }}</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('订单编号')" align="left" prop="orderNo" /> <el-table-column :label="$t('订单编号')" align="left" width="120">
<el-table-column :label="$t('客户名称')" align="left" prop="relationName" /> <template slot-scope="{ row }">
<a class="el-link el-link--primary is-underline" href="javascript:;" @click="$router.push(`/order/detail?orderId=${row.orderId}`)">{{ row.orderNo }}</a>
</template>
</el-table-column>
<el-table-column :label="$t('联系人')" align="left" prop="relationName" width="120" />
<el-table-column :label="$t('联系电话')" align="left" prop="relationPhone" width="150" />
<el-table-column :label="$t('重要程序')" align="center" prop="importance" />
<el-table-column :label="$t('始发地')" align="left" prop="departureName" />
<el-table-column :label="$t('目的地')" align="center" prop="objectiveName" /> <el-table-column :label="$t('目的地')" align="center" prop="objectiveName" />
<el-table-column :label="$t('销售阶段')" align="left" width="180"> <el-table-column :label="$t('运输方式')" align="center">
<template slot-scope="{row}"> <template slot-scope="{ row }">
{{ $l(transportTypes[row.transportType], "label") }}
</template>
</el-table-column>
<el-table-column :label="$t('销售阶段')" align="left" width="100">
<template slot-scope="{ row }">
<dict-tag :type="DICT_TYPE.ECW_OFFER_STATUS" :value="row.status" /> <dict-tag :type="DICT_TYPE.ECW_OFFER_STATUS" :value="row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('预计结束时间')" align="left"> <el-table-column :label="$t('预计结束时间')" align="left" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.stopTime, "{y}-{m}-{d}") }}</span> <span>{{ parseTime(scope.row.stopTime, "{y}-{m}-{d}") }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('运输方式')" align="left"> <el-table-column :label="$t('运输方式')" align="left">
<template slot-scope="scope" > <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="scope.row.transportId" /> <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="scope.row.transportId" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('预计销售额')" align="left" prop="estCost" width="160">
<el-table-column :label="$t('预计销售额')" align="left" prop="estCost"> <template slot-scope="{ row }">
<template slot-scope="{row}">
<div class="" v-for="(item, feeIndex) in row.estCostVO.feeDtoList" :key="feeIndex"> <div class="" v-for="(item, feeIndex) in row.estCostVO.feeDtoList" :key="feeIndex">
<dict-tag :type="DICT_TYPE.ECW_COST_FEE_TYPE" :value="item.feeType" /> <dict-tag :type="DICT_TYPE.ECW_COST_FEE_TYPE" :value="item.feeType" />
{{item.amount}} {{currencyMap[item.currencyId]}} {{ item.amount }} {{ currencyMap[item.currencyId] }}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户经理')" align="left" prop="creatorName"> <el-table-column :label="$t('客户经理')" align="left" prop="creatorName"> </el-table-column>
<el-table-column :label="$t('创建时间')" align="left" width="120">
<template slot-scope="{ row }">
<span>{{ parseTime(row.createTime, "{y}-{m}-{d} {h}:{i}:{s}") }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('有效期')" align="left" width="120">
<template slot-scope="{ row }">
<div>{{ parseTime(row.startTime, "{y}-{m}-{d}") }}</div>
{{ parseTime(row.endTime, "{y}-{m}-{d}") }}
</template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width"> <el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -122,34 +182,37 @@ ...@@ -122,34 +182,37 @@
<el-dropdown> <el-dropdown>
<el-button icon="el-icon-plus" circle type="primary"></el-button> <el-button icon="el-icon-plus" circle type="primary"></el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="$router.push('detail?offerId=' + scope.row.offerId)" v-hasPermi="['ecw:offer:show']">{{$t('详情')}}</el-dropdown-item> <el-dropdown-item @click.native="$router.push('detail?offerId=' + scope.row.offerId)" v-hasPermi="['ecw:offer:show']">{{ $t("详情") }}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push('edit?id=' + scope.row.offerId)" v-if="[1,2,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:update']">{{$t('编辑')}}</el-dropdown-item> <el-dropdown-item @click.native="$router.push('edit?id=' + scope.row.offerId)" v-if="[1, 2, 3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:update']">{{ $t("编辑") }}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push('logList?offerId=' + scope.row.offerId)" v-if="[1,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:loglist']">{{$t('跟进')}}</el-dropdown-item> <el-dropdown-item @click.native="$router.push('create?copyId=' + scope.row.offerId)" v-if="[1, 2, 3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:update']">{{ $t("复制") }}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push(`result?offerId=${scope.row.offerId}&number=${scope.row.number}`)" v-if="[3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:result']">{{$t('结果')}}</el-dropdown-item> <el-dropdown-item @click.native="$router.push('logList?offerId=' + scope.row.offerId)" v-if="[1, 3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:loglist']">{{ $t("跟进") }}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/special?offerId=' + scope.row.offerId)" v-if="[1,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:discount','ecw:offer:commission']">{{$t('特价')}}</el-dropdown-item> <el-dropdown-item @click.native="$router.push(`result?offerId=${scope.row.offerId}&number=${scope.row.number}`)" v-if="[3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:result']">{{ $t("结果") }}</el-dropdown-item>
<el-dropdown-item @click.native="cancel(scope.row.offerId)" v-if="[1,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:cancel']">{{$t('取消')}}</el-dropdown-item> <el-dropdown-item @click.native="$router.push('/offer/special?offerId=' + scope.row.offerId)" v-if="[1, 3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:discount', 'ecw:offer:commission']">{{ $t("特价") }}</el-dropdown-item>
<el-dropdown-item @click.native="recovery(scope.row.offerId)" v-if="[0].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:recovery']">{{$t('恢复')}}</el-dropdown-item> <el-dropdown-item @click.native="cancel(scope.row.offerId)" v-if="[1, 3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:cancel']">{{ $t("取消") }}</el-dropdown-item>
<el-dropdown-item @click.native="deleteOffer(scope.row.offerId)" v-if="[0,1,2,3,4,5,6,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:delete']">{{$t('删除')}}</el-dropdown-item> <el-dropdown-item @click.native="recovery(scope.row.offerId)" v-if="[0].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:recovery']">{{ $t("恢复") }}</el-dropdown-item>
<el-dropdown-item @click.native="deleteOffer(scope.row.offerId)" v-if="[0, 1, 2, 3, 4, 5, 6, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:delete']">{{ $t("删除") }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" />
@pagination="getList"/>
</div> </div>
</template> </template>
<script> <script>
import { deleteOffer, getOfferPage, exportOfferExcel,cancel, recovery, offerDeptPage, exportDeptOfferExcel } from "@/api/ecw/offer"; import { deleteOffer, getOfferPage, exportOfferExcel, cancel, recovery, offerDeptPage, exportDeptOfferExcel } from "@/api/ecw/offer"
import { getCurrencyList } from '@/api/ecw/currency'; import { getChannelList } from "@/api/ecw/channel"
import {getTradeCityList} from '@/api/ecw/region' import { getRegionList } from "@/api/ecw/order"
import UserSelector from '@/components/UserSelector' import { getCurrencyList } from "@/api/ecw/currency"
import { getTradeCityList } from "@/api/ecw/region"
import UserSelector from "@/components/UserSelector"
import Selector from "@/components/Selector"
export default { export default {
name: "EcwOfferIndex", name: "EcwOfferIndex",
components: { components: {
Selector,
UserSelector UserSelector
}, },
data() { data() {
...@@ -159,70 +222,321 @@ export default { ...@@ -159,70 +222,321 @@ export default {
// 导出遮罩层 // 导出遮罩层
exportLoading: false, exportLoading: false,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: false,
// 总条数 // 总条数
total: 0, total: 0,
// 报价单管理列表 // 报价单管理列表
list: [], list: [],
// 查询参数 // 查询参数
queryParams: { queryParams: {
salesmanIds: [],
statusList: [],
importances: [],
channelIds: [],
sourceIds: [],
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
}, },
queryTmp: {
createTime: ["", ""],
stopTime: ["", ""],
startTime: ["", ""],
endTime: ["", ""]
},
currencyList: [], currencyList: [],
tradeCityList:[], tradeCityList: [],
dept: false, // 是否部门订单 channelList: [],
}; AddressCity: [],
AddressProvince: [],
AddressTown: [],
destCountryId: null,
objectiveId: null,
destWarehouseId: null,
// 选中数组
ids: [],
//目的国
countryList: [],
//目的城市
cityList: [],
//目的仓
destWarehouseList: [],
dept: false // 是否部门订单
}
}, },
computed:{ computed: {
currencyMap(){ currencyMap() {
let map = {} let map = {}
this.currencyList.forEach(item => { this.currencyList.forEach((item) => {
map[item.id] = this.$l(item, 'title') map[item.id] = this.$l(item, "title")
}) })
return map return map
}, },
exportCityList() { exportCityList() {
return this.tradeCityList.filter(item => item.type == 2) return this.tradeCityList.filter((item) => item.type == 2)
}, },
importCityList() { importCityList() {
return this.tradeCityList.filter(item => item.type == 1) return this.tradeCityList.filter((item) => item.type == 1)
}, },
transportTypes() {
let obj = {}
this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE).forEach((item) => {
obj[item.value] = item
})
return obj
}
}, },
activated(){ activated() {
this.getList() this.getList()
}, },
created() { created() {
console.log(this.getDictDatas(this.DICT_TYPE.ECW_OFFER_STATUS))
console.log("offer index", this.$route) console.log("offer index", this.$route)
// 部门订单 // 部门订单
if(this.$route.fullPath.indexOf('dept') > -1){ if (this.$route.fullPath.indexOf("dept") > -1) {
this.dept = true this.dept = true
} }
getTradeCityList().then(res => this.tradeCityList = res.data) getTradeCityList().then((res) => (this.tradeCityList = res.data))
getCurrencyList().then(res => { getCurrencyList().then((res) => {
this.currencyList = res.data this.currencyList = res.data
}) })
this.getList(); this.getList()
getChannelList().then((res) => (this.channelList = res.data))
this.init()
},
watch: {
destCountryId: {
//监听当前地区值的变化,于与上方地区值进行了双向绑定
deep: true, //深度监听
handler() {
//每当值省份值改变时其下地区值进行清空
this.AddressCity = []
this.AddressTown = []
this.objectiveId = ""
this.destWarehouseId = ""
this.findByprovinceCode()
if (this.destCountryId == "") {
getRegionList(4, 4)
.then(({ data }) => {
this.AddressCity = data
})
.catch((error) => {
console.log(error)
})
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
} else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data
})
.catch((error) => {
console.log(error)
})
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
}
//重新加载目的城市
//目的城市
// getRegionList(4, 4).then(({data}) => {
// this.AddressCity = data;
// })
// .catch(error => {
// console.log(error);
// });
// getRegionList(5, 5).then(({data}) => {
// this.AddressTown = data;
// })
// .catch(error => {
// console.log(error);
// });
}
},
objectiveId: {
deep: true, //深度监听
handler() {
this.AddressTown = []
this.destWarehouseId = ""
this.findBycityCode()
if (this.objectiveId != "" && this.destCountryId != "" && this.destWarehouseId == "") {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
} else if (this.destCountryId == "" && this.objectiveId == "" && this.destWarehouseId == "") {
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
} else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data
})
.catch((error) => {
console.log(error)
})
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
}
}
},
destWarehouseId: {
deep: true, //深度监听
handler() {
if (this.objectiveId != "" && this.destCountryId != "" && this.destWarehouseId == "") {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
} else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
}
}
}
}, },
methods: { methods: {
init() {
//加载时发起请求获取所有省份值
getRegionList(1, 1)
.then(({ data }) => {
this.AddressProvince = data
console.log(this.AddressProvince)
})
.catch((error) => {
console.log(error)
})
//目的城市
getRegionList(4, 4)
.then(({ data }) => {
this.AddressCity = data
})
.catch((error) => {
console.log(error)
})
//目的仓
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
},
findByprovinceCode() {
//获取当前省份值id,获取该省份下城市 destCountryId provinceCode
getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data
})
.catch((error) => {
console.log(error)
})
},
findBycityCode() {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data
// 去重
// let uniqueDataList = data.filter((item, index, self) => {
// // 返回第一个匹配项的索引,用于判断当前项是否为第一个匹配项
// const firstIndex = self.findIndex((obj) => obj.guojia === item.guojia);
// // 如果当前项是第一个匹配项,则保留,否则过滤掉
// return index === firstIndex;
// });
// this.AddressProvince = uniqueDataList
})
.catch((error) => {
console.log(error)
})
},
formatQuery() {
let obj = {}
//目的国
if (this.destCountryId != null && this.destCountryId != "") {
obj.destCountryIds = this.destCountryId
}
//目的城市
if (this.objectiveId != null && this.objectiveId != "") {
obj.objectiveIds = this.objectiveId
}
//目的仓
if (this.destWarehouseId != null && this.destWarehouseId != "") {
obj.destWarehouseIds = this.destWarehouseId
}
obj.beginCreateTime = this.queryTmp.createTime[0]
obj.endCreateTime = this.queryTmp.createTime[1]
obj.beginStopTime = this.queryTmp.stopTime[0]
obj.endStopTime = this.queryTmp.stopTime[1]
obj.beginStartTime = this.queryTmp.startTime[0]
obj.endStartTime = this.queryTmp.startTime[1]
obj.beginEndTime = this.queryTmp.endTime[0]
obj.endEndTime = this.queryTmp.endTime[1]
return obj
},
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true
let func = this.dept ? offerDeptPage : getOfferPage let func = this.dept ? offerDeptPage : getOfferPage
// 执行查询 // 执行查询
func(this.queryParams).then(response => { func({
this.list = response.data.list; ...this.queryParams,
this.total = response.data.total; ...this.formatQuery()
this.loading = false; }).then((response) => {
}); this.list = response.data.list
this.total = response.data.total
this.loading = false
})
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1
this.getList(); this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
...@@ -230,62 +544,70 @@ export default { ...@@ -230,62 +544,70 @@ export default {
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
} }
this.handleQuery(); this.handleQuery()
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
return this.$router.push('create') return this.$router.push("create")
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
return this.$router.push('edit?id=' + row.offerId) return this.$router.push("edit?id=" + row.offerId)
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const offerId = row.offerId; const offerId = row.offerId
this.$modal.confirm(this.$t('是否确认删除报价单管理编号为{offerId}的数据项?', {offerId})).then(function() { this.$modal
return deleteOffer(offerId); .confirm(this.$t("是否确认删除报价单管理编号为{offerId}的数据项?", { offerId }))
}).then(() => { .then(function () {
this.getList(); return deleteOffer(offerId)
this.$modal.msgSuccess(this.$t("删除成功")); })
}).catch(() => {}); .then(() => {
this.getList()
this.$modal.msgSuccess(this.$t("删除成功"))
})
.catch(() => {})
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// 处理查询参数 // 处理查询参数
let params = {...this.queryParams}; let params = { ...this.queryParams, ...this.formatQuery() }
params.pageNo = undefined; params.pageNo = undefined
params.pageSize = undefined; params.pageSize = undefined
// 执行导出 // 执行导出
this.$confirm(this.$t('是否确认导出所有报价单管理数据项?')).then(() => { this.$confirm(this.$t("是否确认导出所有报价单管理数据项?"))
this.exportLoading = true; .then(() => {
if(this.dept){ this.exportLoading = true
if (this.dept) {
return exportDeptOfferExcel(params) return exportDeptOfferExcel(params)
}else return exportOfferExcel(params); } else return exportOfferExcel(params)
}).then(response => { })
this.$download.excel(response, '报价列表.xls'); .then((response) => {
this.exportLoading = false; this.$download.excel(response, "报价列表.xls")
}).catch(() => {}); this.exportLoading = false
})
.catch(() => {})
}, },
cancel(id){ cancel(id) {
this.doAction(this.$t('确定要取消此报价单么?'), cancel, id); this.doAction(this.$t("确定要取消此报价单么?"), cancel, id)
}, },
recovery(id){ recovery(id) {
this.doAction(this.$t('确定要恢复此报价单么?'), recovery, id); this.doAction(this.$t("确定要恢复此报价单么?"), recovery, id)
}, },
deleteOffer(id){ deleteOffer(id) {
this.doAction(this.$t('确定要删除此报价单么?'), deleteOffer, id); this.doAction(this.$t("确定要删除此报价单么?"), deleteOffer, id)
}, },
doAction(tips, action, id){ doAction(tips, action, id) {
this.$confirm(tips).then(res => { this.$confirm(tips)
return action(id) .then((res) => {
}) return action(id)
.then(() => { })
this.$message.success('操作成功') .then(() => {
this.handleQuery() this.$message.success("操作成功")
}) this.handleQuery()
})
} }
} }
}; }
</script> </script>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <logListCommon :offerId="offerId" />
<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>
</div> </div>
</template> </template>
<script> <script>
import {getOfferLogPage} from "@/api/ecw/offerLog"; import logListCommon from "@/views/ecw/offer/logListCommon"
import {DICT_TYPE} from '@/utils/dict'
import {getOffer} from '@/api/ecw/offer'
import { userList } from "@/api/system/user"
export default { export default {
name: "OfferLog", name: "offerLogList",
components: { components: { logListCommon },
},
data() { data() {
return { return {}
// 遮罩层
loading: true,
list: [],
total:0,
params:{
page:1,
rows:20,
offerId:0,
type:2
},
number:'',
relationId:0,
creatorName:'test',
creatorData:[]
};
}, },
created() { computed: {
if(this.$route.query.offerId){ offerId() {
this.params.offerId = this.$route.query.offerId return parseInt(this.$route.query.offerId || 0)
this.getList();
this.getRelationID()
} }
userList('customer service').then(res =>this.creatorData = res.data)
},
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
}
});
},
} }
}; }
</script> </script>
<style scoped> <style scoped>
.card-title{ .card-title {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
} }
.offer-header{ .offer-header {
padding-bottom: 16px; padding-bottom: 16px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
</style> </style>
<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>
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -317,7 +317,6 @@ export default { ...@@ -317,7 +317,6 @@ export default {
specialProducts: [], specialProducts: [],
// priceStepList: [{},{}], // 阶梯价格 // priceStepList: [{},{}], // 阶梯价格
// specialList:[], // 特殊需求,默认四个 // specialList:[], // 特殊需求,默认四个
rules() {},
product: null, product: null,
/* productType: null, */ /* productType: null, */
currencyList: [], currencyList: [],
......
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