Commit 1ccd9c22 authored by 332784038@qq.com's avatar 332784038@qq.com

Merge branch 'dev' into test

# Conflicts:
#	src/views/ecw/order/index.vue
parents 0b11ea75 39da2846
......@@ -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://127.0.0.1:48080'
......
import request from '@/utils/request'
import request from "@/utils/request"
// 创建跟进
export function createCustomerFollow(data) {
return request({
url: '/ecw/customer-follow/create',
method: 'post',
url: "/ecw/customer-follow/create",
method: "post",
data: data
})
}
......@@ -12,8 +12,8 @@ export function createCustomerFollow(data) {
// 更新跟进
export function updateCustomerFollow(data) {
return request({
url: '/ecw/customer-follow/update',
method: 'put',
url: "/ecw/customer-follow/update",
method: "put",
data: data
})
}
......@@ -21,31 +21,31 @@ export function updateCustomerFollow(data) {
// 删除跟进
export function deleteCustomerFollow(id) {
return request({
url: '/ecw/customer-follow/delete?id=' + id,
method: 'delete'
url: "/ecw/customer-follow/delete?id=" + id,
method: "delete"
})
}
// 获得跟进
export function getCustomerFollow(id) {
return request({
url: '/ecw/customer-follow/get?id=' + id,
method: 'get'
url: "/ecw/customer-follow/get?id=" + id,
method: "get"
})
}
// 获得跟进分页
export function getCustomerFollowPage(query) {
return request({
url: '/customer/detail/infoList/followPage',
method: 'get',
url: "/customer/detail/infoList/followPage",
method: "get",
params: query
})
}
export function getCustomerFollowPage2(query) {
return request({
url: '/ecw/customer-follow/page',
method: 'get',
url: "/ecw/customer-follow/page",
method: "get",
params: query
})
}
......@@ -53,50 +53,56 @@ export function getCustomerFollowPage2(query) {
// 导出跟进 Excel
export function exportCustomerFollowExcel(query) {
return request({
url: '/ecw/customer-follow/export-excel',
method: 'get',
url: "/ecw/customer-follow/export-excel",
method: "get",
params: query,
responseType: 'blob'
responseType: "blob"
})
}
export function getCustomerFollowList(params) {
return request({
url: '/customer/followup/page',
method: 'get',
url: "/customer/followup/page",
method: "get",
params
})
}
export function getCustomerFollowDetail(params) {
return request({
url: '/customer/followup/get',
method: 'get',
url: "/customer/followup/get",
method: "get",
params
})
}
export function addCustomerFollow(data) {
return request({
url: '/customer/followup/create',
method: 'post',
url: "/customer/followup/create",
method: "post",
data
})
}
export function editCustomerFollow(data) {
return request({
url: '/customer/followup/update',
method: 'put',
url: "/customer/followup/update",
method: "put",
data
})
}
export function exportCustomerFollow(params) {
return request({
url: '/customer/followup/export-excel',
method: 'get',
url: "/customer/followup/export-excel",
method: "get",
params
})
}
export function getFollowupNewNumber() {
return request({
url: "/customer/followup/getFollowupNewNumber",
method: "get"
})
}
<template>
<div class="customer-follow">
<div class="customer-follow">
<el-dialog append-to-body :title="$t('客户跟进')" :visible.sync="customerFollow.dialogVisible" :before-close="customerFollowClose" width="900px">
<el-form ref="customerFollowForm" :model="form" label-width="120px">
<el-row :gutter="10">
......@@ -17,7 +17,7 @@
</el-col>
<el-col :span="12">
<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-col>
<el-col :span="12">
......@@ -27,13 +27,6 @@
</el-select>
</el-form-item>
</el-col>
<!--
<el-col :span="13">
<el-form-item :label="$t('报价单')">
<el-input v-model="form.offerId" :placeholder="$t('请输入报价单')" disabled />
</el-form-item>
</el-col>
-->
<el-col :span="12">
<el-form-item :label="$t('跟进时间')" required>
<el-date-picker v-model="form.followTime" clearable type="datetime" :placeholder="$t('请选择')" :disabled="isView" />
......@@ -42,16 +35,14 @@
<el-col :span="12">
<el-form-item :label="$t('联系人')" required>
<el-select v-model="form.contactId" clearable :placeholder="$t('请选择')" :disabled="isView" @change="changeContactUser">
<el-option v-for="(item, index) in customerContactsList" :key="index" :label="item.name" :value="item.id">
</el-option>
<el-option v-for="(item, index) in customerContactsList" :key="index" :label="item.name" :value="item.id"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户经理')" required>
<el-select v-model="form.followUserId" clearable :placeholder="$t('请选择')" :disabled="isView">
<el-option v-for="item in serviceUserList" :key="item.id" :label="item.nickname" :value="item.id">
</el-option>
<el-option v-for="item in serviceUserList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
</el-select>
</el-form-item>
</el-col>
......@@ -82,6 +73,11 @@
<el-input rows="3" class="text_style" type="textarea" v-model="form.feedback" maxlength="500" show-word-limit :disabled="isView" />
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item
><el-button size="mini" v-if="isView" type="text" icon="el-icon-collection" @click="$emit(handleCustomerFollowAdd, form)" v-has-permi="['ecw:customer:follow-add-plan']">{{ $t("增加计划") }} </el-button>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item :label="$t('附件')" prop="attatchment">
<FileUpload :limit="5" :isShowTip="true" v-model="form.attatchment" :fileType="fileType" :disabled="isView" />
......@@ -89,8 +85,7 @@
</el-col>
<el-col :span="13">
<el-form-item :label="$t('下次跟进时间')">
<el-date-picker v-model="form.nextTime" type="datetime" :placeholder="$t('请选择')" :disabled="isView" @change="changeNextTime">
</el-date-picker>
<el-date-picker v-model="form.nextTime" type="datetime" :placeholder="$t('请选择')" :disabled="isView" @change="changeNextTime"> </el-date-picker>
</el-form-item>
</el-col>
<el-col :span="20">
......@@ -101,76 +96,50 @@
<el-col :span="12">
<el-form-item :label="$t('创建人')" prop="founder">
<el-select v-model="form.creatorName" disabled :placeholder="$t('请选择')">
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id">
</el-option>
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('创建时间')" prop="createTime">
<el-date-picker v-model="form.createTime" type="datetime" disabled :placeholder="$t('请选择')">
</el-date-picker>
<el-date-picker v-model="form.createTime" type="datetime" disabled :placeholder="$t('请选择')"> </el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('最后更新人')">
<el-select v-model="form.updaterName" disabled>
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id">
</el-option>
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('最后更新时间')">
<el-date-picker v-model="form.updateTime" type="datetime" disabled :placeholder="$t('请选择')">
</el-date-picker>
<el-date-picker v-model="form.updateTime" type="datetime" disabled :placeholder="$t('请选择')"> </el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer" v-if="isView">
<el-button type="warning" @click="customerFollowClose">{{$t('关 闭')}}</el-button>
<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>
<el-button type="warning" @click="goBack">{{ $t("返 回") }}</el-button>
<el-button type="primary" @click="customerFollowSubmit(0)">{{ $t("保 存") }}</el-button>
<el-button type="success" @click="customerFollowSubmit(1)">{{ $t("提交结果") }}</el-button>
</div>
</el-dialog>
<customer-follow-select-offer :customer-id="customerId" ref="customerFollowSelectOffer" @select="selectOffer" />
</div>
</div>
</template>
<script>
import {
createCustomerFollow,
getCustomerFollowPage,
getCustomerFollowPage2,
addCustomerFollow,
getCustomerFollowList,
editCustomerFollow
} from "@/api/ecw/customerFollow"
import { createCustomerFollow, getCustomerFollowPage, getCustomerFollowPage2, addCustomerFollow, getCustomerFollowList, editCustomerFollow, getFollowupNewNumber } from "@/api/ecw/customerFollow"
import { getOfferPage } from "@/api/ecw/offer"
import CustomerFollowSelectOffer from "./customerFollowSelectOffer";
import {
DICT_TYPE,
getDictDataLabel
} from '@/utils/dict'
import {
getCustomerContactsListByCustomer
} from '@/api/ecw/customerContacts'
import {
listAllSimpl,
listServiceUser,
listSimpleUsers,
} from "@/api/system/user";
import {
parseTime
} from '@/utils/ruoyi'
import FileUpload from "@/components/FileUpload/fileUpload";
import {formatDate} from "@/utils/index";
import { DICT_TYPE, getDictDataLabel } from "@/utils/dict"
import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts"
import { listAllSimpl, listServiceUser, listSimpleUsers } from "@/api/system/user"
import { parseTime } from "@/utils/ruoyi"
import FileUpload from "@/components/FileUpload/fileUpload"
import { formatDate } from "@/utils/index"
export default {
/**
* 客户跟进
......@@ -181,18 +150,12 @@ export default {
/**
* 如果是客户投诉跟进,则id为客户投诉id;如果是客户跟进,则id为客户id
*/
id: Number,
customerId: Number,
customerQuery: {
type: Boolean,
default: false
},
customerNumber: String,
customerService: Number
},
components: {
FileUpload,
CustomerFollowSelectOffer
FileUpload
},
data() {
return {
......@@ -207,7 +170,7 @@ export default {
customerFollow: {
dialogVisible: false,
form: {
followType: '3'
followType: "3"
}
},
offerDialogVisible: true,
......@@ -219,9 +182,8 @@ export default {
pickerOptions: {
disabledDate(time) {
return time.getTime() <= Date.now()
}
},
},
isEdit: true,
followTime: [],
nextTime: [],
queryParams: {
......@@ -235,49 +197,41 @@ export default {
},
computed: {
isChinese() {
return this.$i18n.locale === 'zh_CN'
return this.$i18n.locale === "zh_CN"
}
},
created() {
this.init()
// this.resetCustomerFollowForm()
listServiceUser().then(r => {
// console.log( r.data,'r.data跟进业务')
listServiceUser().then((r) => {
this.serviceUserList = r.data
})
listAllSimpl().then((r) => {
this.allSimplList = r.data;
});
// this.getCustomerFollowList()
// this.reset()
this.allSimplList = r.data
})
},
methods: {
init() {
if (!!this.customerId) getCustomerContactsListByCustomer({
if (!!this.customerId)
getCustomerContactsListByCustomer({
customerId: this.customerId
}).then(r => {
}).then((r) => {
this.customerContactsList = r.data
// this.form.customerId = this.customerId
// this.form.bizId = this.id
})
},
getOfferList() {
getOfferPage(this.queryParams).then(response => {
this.offerList = response.data.list;
this.offerTotal = response.data.total;
});
getOfferPage(this.queryParams).then((response) => {
this.offerList = response.data.list
this.offerTotal = response.data.total
})
},
handleFollowType(val) {
console.log(val)
if (val == '2') {
this.$refs['customerFollowSelectOffer'].offerDialogVisible = true
if (val == "2") {
this.$refs["customerFollowSelectOffer"].offerDialogVisible = true
} else {
this.form.offerId = undefined
}
},
selectOffer(offerId) {
this.form.offerId = offerId
},
reset() {
this.form = {
attatchment: undefined,
......@@ -285,6 +239,7 @@ export default {
contactName: undefined,
contactPhone: undefined,
customerId: this.customerId,
customerNumber: this.customerNumber,
feedback: undefined,
followMethod: undefined,
followTime: new Date().getTime(),
......@@ -303,7 +258,7 @@ export default {
createTime: new Date().getTime(),
updaterName: this.$store.getters.userId,
updateTime: new Date().getTime()
};
}
},
changeNextTime(val) {
if (val) {
......@@ -317,7 +272,7 @@ export default {
},
changeContactUser(val) {
if (val) {
for(const item of this.customerContactsList) {
for (const item of this.customerContactsList) {
if (item.id == val) {
this.form.contactName = item.name
// this.form.contactPhone = `+${item.areaCode}${item.phoneNew}`
......@@ -331,38 +286,38 @@ export default {
},
customerFollowSubmit(status) {
console.log(this.form)
this.$refs["customerFollowForm"].validate(valid => {
this.$refs["customerFollowForm"].validate((valid) => {
if (!valid) {
return
}
if (!this.form.followType) {
this.$modal.msgError(this.$t("请选择跟进类型"));
this.$modal.msgError(this.$t("请选择跟进类型"))
return
}
if (!this.form.followTime) {
this.$modal.msgError(this.$t('请选择跟进时间'));
this.$modal.msgError(this.$t("请选择跟进时间"))
return
}
if (!this.form.contactName) {
this.$modal.msgError(this.$t('请选择联系人'));
this.$modal.msgError(this.$t("请选择联系人"))
return
}
if (!this.form.followUserId) {
this.$modal.msgError(this.$t('请选择客户经理'));
this.$modal.msgError(this.$t("请选择客户经理"))
return
}
if (!this.form.followMethod) {
this.$modal.msgError(this.$t('请选择跟进方式'));
this.$modal.msgError(this.$t("请选择跟进方式"))
return
}
if (status === 0) {
this.saveSubmitData(status)
} else {
this.$confirm(this.$t('提交后无法修改'), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
this.$confirm(this.$t("提交后无法修改"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning"
}).then(() => {
this.saveSubmitData(status)
})
......@@ -376,68 +331,24 @@ export default {
followTime: this.form.followTime ? formatDate(this.form.followTime) : undefined,
nextTime: this.form.nextTime ? formatDate(this.form.nextTime) : undefined,
status
}).then(r => {
}).then((r) => {
this.$message.success(this.$t("操作成功"))
this.$emit('refresh')
this.$emit("refresh")
this.customerFollowClose()
})
},
goBack() {
this.$confirm(this.$t('是否确认不保存信息'), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
this.$confirm(this.$t("是否确认不保存信息"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning"
}).then(() => {
this.customerFollowClose()
})
},
customerFollowClose() {
// this.resetCustomerFollowForm()
this.customerFollow.dialogVisible = false
},
resetCustomerFollowForm() {
this.reset()
// this.$refs.dictType.changeValue(this.customerFollow.form.followType);
this.$refs.dictMethod.changeValue(this.customerFollow.form.followMethod);
},
handleQuery() {
this.pageNo = 1
this.queryParams.pageNo = 1
this.followTime = []
this.getCustomerFollowList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams = {
followType: null,
followMethod: null,
resultType: null,
status: null
};
this.handleQuery();
},
getCustomerFollowList() {
if (this.customerQuery) {
getCustomerFollowList({
customerId: this.customerId,
pageNo: this.pageNo,
pageSize: this.pageSize
}).then(r => {
this.$message.info(this.$t("操作成功"))
this.$emit('refresh')
})
} else {
getCustomerFollowPage2({
bizId: this.id,
followType: 3,
pageNo: this.pageNo,
pageSize: this.pageSize
}).then(r => {
this.$emit('refresh')
})
}
},
handleView(row) {
this.isView = true
this.form = row
......@@ -445,29 +356,34 @@ export default {
},
handleAdd() {
this.isView = false
this.isEdit = true
this.customerFollow.dialogVisible = true
this.reset()
},
handleUpdate(row, flag) {
async handleUpdate(row, flag) {
this.isView = false
this.isEdit = flag
this.customerFollow.dialogVisible = true
if (flag) {
if (!flag) {
this.form = row
} else {
let r = await getFollowupNewNumber()
console.log(r)
this.form = {
...row,
parentNumber: row.number
parentNumber: row.number,
followTime: row.nextTime,
nextTime: "",
number: r.data,
nextPlan: ""
}
}
}
},
}
}
</script>
<style scoped>
.text_style{
.text_style {
white-space: pre-wrap;
}
</style>
<template xmlns="">
<el-row
type="flex"
style="margin: 15px 0"
justify="center"
>
<el-row type="flex" style="margin: 15px 0" justify="center">
<el-col :xs="24" :sm="24" :md="24" :lg="22" :xl="20">
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span class="title-text">{{ $t('基本') }}</span>
<el-button
style="float: right"
size="small"
type="primary"
@click="showBaseFlag = !showBaseFlag"
>{{showBaseFlag ? $t('隐藏') : $t('更多')}}</el-button
>
<span class="title-text">{{ $t("基本") }}</span>
<el-button style="float: right" size="small" type="primary" @click="showBaseFlag = !showBaseFlag">{{ showBaseFlag ? $t("隐藏") : $t("更多") }}</el-button>
</div>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item :label="$t('客户名称')" prop="name">
<el-input
v-model="form.name"
:placeholder="$t('请输入客户名称')"
/>
<el-input v-model="form.name" :placeholder="$t('请输入客户名称')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户英文名称')">
<el-input
v-model="form.nameEn"
:placeholder="$t('请输入客户英文名称')"
></el-input>
<el-input v-model="form.nameEn" :placeholder="$t('请输入客户英文名称')"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户来源')" prop="source">
<el-select
v-model="form.source"
: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 v-model="form.source" :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-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('国籍')" prop="country">
<el-select
filterable
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 filterable 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-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select
v-model="form.customerService"
: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 v-model="form.customerService" :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-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('推介人')" prop="promoter">
<el-select
clearable
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 clearable 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-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('备注')" prop="remarks">
<el-input
v-model="form.remarks"
:placeholder="$t('请输入备注')"
/>
<el-input v-model="form.remarks" :placeholder="$t('请输入备注')" />
</el-form-item>
<el-form-item :label="$t('询盘信息')">
<el-input
show-word-limit
v-model="form.inquiry"
:rows="3"
type="textarea"
:maxlength="500"
></el-input>
<el-input show-word-limit v-model="form.inquiry" :rows="3" type="textarea" :maxlength="500"></el-input>
</el-form-item>
</el-col>
......@@ -141,33 +66,19 @@
<el-row :gutter="10" v-show="showBaseFlag">
<el-col :span="12">
<el-form-item :label="$t('联系地址')" prop="address">
<el-input
v-model="form.address"
:placeholder="$t('请输入联系地址')"
/>
<el-input v-model="form.address" :placeholder="$t('请输入联系地址')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户生日')" prop="birthday">
<el-date-picker
v-model="form.birthday"
type="date"
value-format="timestamp"
:placeholder="$t('请输入客户生日')"
>
</el-date-picker>
<el-date-picker v-model="form.birthday" type="date" value-format="timestamp" :placeholder="$t('请输入客户生日')"> </el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('业绩类型')">
<el-switch
v-model="form.isNew"
disabled
active-text="新客户"
inactive-text="老客户">
</el-switch>
<el-switch v-model="form.isNew" disabled active-text="新客户" inactive-text="老客户"> </el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -178,158 +89,76 @@
<el-col :span="12">
<el-form-item :label="$t('客户等级')" prop="level">
<el-select
v-model="form.level"
: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 v-model="form.level" :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-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户状态')" prop="status">
<el-select
v-model="form.status"
: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 v-model="form.status" :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-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('首次成交时间')">
<el-date-picker
v-model="form.firstDealTime"
type="datetime"
:placeholder="$t('请选择')"
disabled
/>
<el-date-picker v-model="form.firstDealTime" type="datetime" :placeholder="$t('请选择')" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('掉入公海时间')">
<el-date-picker
v-model="enterOpenSeaTime"
type="datetime"
:placeholder="$t('请选择')"
disabled
/>
<el-date-picker v-model="enterOpenSeaTime" type="datetime" :placeholder="$t('请选择')" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('获取方式')" prop="getMethod">
<el-select
v-model="form.getMethod"
: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 v-model="form.getMethod" :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-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('创建入口')" prop="createFrom">
<el-select
v-model="form.createFrom"
: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 v-model="form.createFrom" :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-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('捞取时间')">
<el-date-picker
v-model="form.catchTime"
type="datetime"
:placeholder="$t('请选择')"
disabled
/>
<el-date-picker v-model="form.catchTime" type="datetime" :placeholder="$t('请选择')" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('归属时间')">
<el-date-picker
v-model="form.customerServiceConfirmedTime"
type="datetime"
disabled
:placeholder="$t('请选择')"
>
</el-date-picker>
<el-date-picker v-model="form.customerServiceConfirmedTime" type="datetime" disabled :placeholder="$t('请选择')"> </el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('创建人')" prop="founder">
<el-select v-model="form.founder" disabled>
<el-option
v-for="item in allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
>
</el-option>
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('创建时间')" prop="createTime">
<el-date-picker
v-model="form.createTime"
type="datetime"
value-format="timestamp"
disabled
:placeholder="$t('选择创建时间')"
>
</el-date-picker>
<el-date-picker v-model="form.createTime" type="datetime" value-format="timestamp" disabled :placeholder="$t('选择创建时间')"> </el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('最后更新人')">
<el-select v-model="form.updater" disabled>
<el-option
v-for="item in allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
>
</el-option>
<el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('最后更新时间')">
<el-date-picker
v-model="form.updateTime"
type="datetime"
value-format="timestamp"
disabled
>
</el-date-picker>
<el-date-picker v-model="form.updateTime" type="datetime" value-format="timestamp" disabled> </el-date-picker>
</el-form-item>
</el-col>
</el-row>
......@@ -337,54 +166,25 @@
<el-card style="margin-top: 15px">
<div slot="header" class="clearfix">
<span class="title-text">{{ $t('发货信息') }}</span>
<el-button
style="float: right"
size="small"
type="primary"
@click="showShippingFlag = !showShippingFlag"
>{{showShippingFlag ? $t('隐藏') : $t('更多')}}</el-button
>
<span class="title-text">{{ $t("发货信息") }}</span>
<el-button style="float: right" size="small" type="primary" @click="showShippingFlag = !showShippingFlag">{{ showShippingFlag ? $t("隐藏") : $t("更多") }}</el-button>
</div>
<el-row :gutter="10" v-show="showShippingFlag">
<el-col :span="12">
<el-form-item :label="$t('客户类别')" prop="type">
<dict-selector
:type="DICT_TYPE.CUSTOMER_TYPE"
form-type="checkbox"
multiple
v-model="form.type"
></dict-selector>
<dict-selector :type="DICT_TYPE.CUSTOMER_TYPE" form-type="checkbox" multiple v-model="form.type"></dict-selector>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('角色')">
<dict-selector
:type="DICT_TYPE.CUSTOMER_ROLE"
form-type="checkbox"
multiple
v-model="form.roles"
></dict-selector>
<dict-selector :type="DICT_TYPE.CUSTOMER_ROLE" form-type="checkbox" multiple v-model="form.roles"></dict-selector>
</el-form-item>
</el-col>
<el-col
:span="13"
v-show="form.roles && form.roles.indexOf('2') !== -1"
>
<el-col :span="13" v-show="form.roles && form.roles.indexOf('2') !== -1">
<el-form-item :label="$t('所属代理')" prop="agentId">
<el-select
filterable
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 filterable 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-form-item>
</el-col>
......@@ -393,79 +193,36 @@
<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>-->
<el-checkbox-group v-model="form.transportType">
<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 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-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('常用提货网点')" prop="pickupPoints">
<el-select multiple v-model="form.pickupPoints">
<el-option
v-for="item in getNodeLists"
:key="item.id"
:value="item.id"
:label="isChinese ? item.titleZh : item.titleEn"
></el-option>
<el-option v-for="item in getNodeLists" :key="item.id" :value="item.id" :label="isChinese ? item.titleZh : item.titleEn"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('业务国家')" prop="busiCountryIds">
<el-select
multiple
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 multiple 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-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('主营类别')" prop="productType">
<el-form-item :label="$t('主营类别')" prop="productTypes">
<el-row :gutter="10">
<el-col :span="11">
<el-select
@change="change"
v-model="form.productType"
:placeholder="$t('请选择产品类别')"
>
<el-option
:label="isChinese ? item.titleZh : item.titleEn"
:value="item.id"
v-for="item in productTypeList"
:key="item.id"
/>
<el-select @change="change" v-model="form.productTypes" multiple :placeholder="$t('请选择产品类别')">
<el-option :label="isChinese ? item.titleZh : item.titleEn" :value="item.id" v-for="item in productTypeList" :key="item.id" />
</el-select>
</el-col>
<el-col :span="11">
<el-select
multiple
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 multiple 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-col>
</el-row>
......@@ -479,22 +236,9 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('主要竞争对手')" prop="competitorIds">
<el-select
clearable
v-model="form.competitorIds"
: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 clearable v-model="form.competitorIds" :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-form-item>
</el-col>
......@@ -503,61 +247,36 @@
<el-input-number v-model="form.numYearly" :min="1" />
</el-form-item>
</el-col>
</el-row>
</el-card>
</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">
<span class="title-text">{{ $t("联系人") }}</span>
<el-button
style="float: right"
size="small"
type="primary"
@click="handleAddContact"
>+</el-button
>
<el-button style="float: right" size="small" type="primary" @click="handleAddContact">+</el-button>
</div>
<el-form ref="contactForm" :rules="contactRules" :model="form">
<el-table :data="form.customerContacts" style="width: 100%">
<el-table-column prop="department" :label="$t('部门')" width="">
<template v-slot="{ row }">
<el-form-item label="">
<el-input
v-model="row.department"
:placeholder="$t('请输入部门')"
size="mini"
/>
<el-input v-model="row.department" :placeholder="$t('请输入部门')" size="mini" />
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="position" :label="$t('职位')" width="">
<template v-slot="{ row }">
<el-form-item label="">
<el-input
v-model="row.position"
:placeholder="$t('请输入职位')"
size="mini"
/>
<el-input v-model="row.position" :placeholder="$t('请输入职位')" size="mini" />
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="name" :label="$t('联系人')">
<template slot="header">
{{ $t("联系人") }} <span style="color: #ff0000">*</span>
</template>
<template slot="header"> {{ $t("联系人") }} <span style="color: #ff0000">*</span> </template>
<template v-slot="{ row, cellValue, $index }">
<el-form-item
:rules="contactRules.name"
:prop="'customerContacts.' + $index + '.name'"
label=""
>
<el-input
v-model="row.name"
:placeholder="$t('请输入联系人')"
size="mini"
/>
<el-form-item :rules="contactRules.name" :prop="'customerContacts.' + $index + '.name'" label="">
<el-input v-model="row.name" :placeholder="$t('请输入联系人')" size="mini" />
</el-form-item>
</template>
</el-table-column>
......@@ -567,62 +286,25 @@
</template>
<template v-slot="{ row, cellValue, $index }">
<el-form-item label="">
<el-input
v-model="row.nameEn"
:placeholder="$t('请输入联系人英文名称')"
size="mini"
/>
<el-input v-model="row.nameEn" :placeholder="$t('请输入联系人英文名称')" size="mini" />
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="areaCode" :label="$t('区号')">
<template slot="header">
{{ $t("区号") }} <span style="color: #ff0000">*</span>
</template>
<template slot="header"> {{ $t("区号") }} <span style="color: #ff0000">*</span> </template>
<template v-slot="{ row, cellValue, $index }">
<el-form-item
:rules="contactRules.areaCode"
:prop="'customerContacts.' + $index + '.areaCode'"
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-form-item :rules="contactRules.areaCode" :prop="'customerContacts.' + $index + '.areaCode'" 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-form-item>
</template>
</el-table-column>
<el-table-column prop="phoneNew" :label="$t('联系方式')">
<template slot="header">
{{ $t("联系方式") }} <span style="color: #ff0000">*</span>
</template>
<template slot="header"> {{ $t("联系方式") }} <span style="color: #ff0000">*</span> </template>
<template v-slot="{ row, cellValue, $index }">
<el-form-item
:rules="contactRules.phoneNew"
: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 :rules="contactRules.phoneNew" :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>
</template>
</el-table-column>
......@@ -639,67 +321,26 @@
<el-table-column prop="social" :label="$t('社交软件')">
<template v-slot="{ row }">
<el-form-item label="">
<el-select
v-model="row.social"
: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 v-model="row.social" :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-form-item>
</template>
</el-table-column>
<el-table-column
prop="socialNumber"
:label="$t('社交软件号码')"
>
<el-table-column prop="socialNumber" :label="$t('社交软件号码')">
<template v-slot="{ row }">
<el-form-item label="">
<el-input
v-model="row.socialNumber"
:placeholder="$t('请输入社交软件号码')"
size="mini"
/>
<el-input v-model="row.socialNumber" :placeholder="$t('请输入社交软件号码')" size="mini" />
</el-form-item>
</template>
</el-table-column>
<el-table-column width="260px" prop="email" :label="$t('邮箱')">
<template v-slot="{ row }">
<el-form-item
v-for="(item, index) in row.email"
:key="index"
label=""
>
<el-form-item v-for="(item, index) in row.email" :key="index" label="">
<div style="display: flex; align-items: center">
<el-input
v-model="row.email[index]"
:placeholder="$t('请输入邮箱')"
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
>
<el-input v-model="row.email[index]" :placeholder="$t('请输入邮箱')" 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>
</el-form-item>
</template>
......@@ -707,18 +348,8 @@
<el-table-column prop="isDefault" :label="$t('设为默认')">
<template v-slot="{ row, column, $index }">
<el-form-item label="">
<el-select
v-model="row.isDefault"
: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 v-model="row.isDefault" :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-form-item>
</template>
......@@ -726,12 +357,7 @@
<el-table-column prop="name" :label="$t('操作')">
<template v-slot="{ row, column, $index }">
<el-form-item label="">
<el-button
type="danger"
@click="handleDeleteContact($index)"
size="mini"
>{{ $t("删除") }}</el-button
>
<el-button type="danger" @click="handleDeleteContact($index)" size="mini">{{ $t("删除") }}</el-button>
</el-form-item>
</template>
</el-table-column>
......@@ -739,16 +365,10 @@
</el-form>
</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">
<span class="title-text">{{ $t('设置') }}</span>
<el-button
style="float: right"
size="small"
type="primary"
@click="showSettingFlag = !showSettingFlag"
>{{showSettingFlag ? $t('隐藏') : $t('更多')}}</el-button
>
<span class="title-text">{{ $t("设置") }}</span>
<el-button style="float: right" size="small" type="primary" @click="showSettingFlag = !showSettingFlag">{{ showSettingFlag ? $t("隐藏") : $t("更多") }}</el-button>
</div>
<el-form ref="setForm" label-width="150px" v-if="showSettingFlag">
<el-row :gutter="10">
......@@ -759,22 +379,14 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('到仓确认')" prop="arrivalConfirm">
<el-switch
v-model="form.arrivalConfirm"
:active-value="1"
:inactive-value="0"
/>
<el-switch v-model="form.arrivalConfirm" :active-value="1" :inactive-value="0" />
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item :label="$t('重货标准')" prop="weightUnit">
<el-switch v-model="showZhong" />
<el-input
v-model="form.weightUnit"
:placeholder="$t('请输入重货标准')"
v-show="showZhong"
>
<el-input v-model="form.weightUnit" :placeholder="$t('请输入重货标准')" v-show="showZhong">
<template slot="append">kg/cbm</template>
</el-input>
</el-form-item>
......@@ -782,24 +394,14 @@
<el-col :span="24" v-show="showZhong">
<el-form-item :label="$t('指定线路')" prop="line">
<el-switch v-model="showZhong1"></el-switch>
<customer-line-table
v-if="showZhong1"
:warehouse-list="warehouseList"
:import-city-list="importCityList"
v-model="zhongLines"
:zhong-pao-type="1"
></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>
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item :label="$t('泡货标准')" prop="lightUnit">
<el-switch v-model="showPao" />
<el-input
v-model="form.lightUnit"
:placeholder="$t('请输入泡货标准')"
v-show="showPao"
>
<el-input v-model="form.lightUnit" :placeholder="$t('请输入泡货标准')" v-show="showPao">
<template slot="append">kg/cbm</template>
</el-input>
</el-form-item>
......@@ -807,13 +409,7 @@
<el-col :span="24" v-show="showPao">
<el-form-item :label="$t('指定线路')" prop="line">
<el-switch v-model="showPao1"></el-switch>
<customer-line-table
v-if="showPao1"
:warehouse-list="warehouseList"
:import-city-list="importCityList"
v-model="paoLines"
:zhong-pao-type="2"
></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>
</el-form-item>
</el-col>
......@@ -832,146 +428,91 @@
<el-switch v-model="form.defaultBilling" disabled />
</el-form-item>
</el-col>
</el-row>
</el-form>
</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">
<span class="title-text">{{ $t('财务') }}</span>
<el-button
style="float: right"
size="small"
type="primary"
@click="showFinanceFlag = !showFinanceFlag"
>{{showFinanceFlag ? $t('隐藏') : $t('更多')}}</el-button
>
<span class="title-text">{{ $t("财务") }}</span>
<el-button style="float: right" size="small" type="primary" @click="showFinanceFlag = !showFinanceFlag">{{ showFinanceFlag ? $t("隐藏") : $t("更多") }}</el-button>
</div>
<el-form ref="financeForm" label-width="150px" v-if="showFinanceFlag">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item :label="$t('公司名称')" prop="company">
<el-input
v-model="form.company"
:placeholder="$t('请输入公司名称')"
/>
<el-input v-model="form.company" :placeholder="$t('请输入公司名称')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('公司英文名称')">
<el-input
v-model="form.companyEn"
:placeholder="$t('请输入客户英文名称')"
></el-input>
<el-input v-model="form.companyEn" :placeholder="$t('请输入客户英文名称')"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
v-hasPermi="['ecw:customer:edit-card']"
:label="$t('身份证号码')"
>
<el-form-item v-hasPermi="['ecw:customer:edit-card']" :label="$t('身份证号码')">
<el-input v-model="form.carNo"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
v-hasPermi="['ecw:customer:edit-card']"
:label="$t('身份证姓名')"
>
<el-form-item v-hasPermi="['ecw:customer:edit-card']" :label="$t('身份证姓名')">
<el-input v-model="form.carName"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('结算方式')" prop="balance">
<el-select
v-model="form.balance"
: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 v-model="form.balance" :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-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('付款人姓名')">
<el-input
v-model="form.payerName"
:placeholder="$t('请输入付款人姓名')"
></el-input>
<el-input v-model="form.payerName" :placeholder="$t('请输入付款人姓名')"></el-input>
</el-form-item>
</el-col>
<h3 style="font-size: 15px;">{{$t('开票信息')}}</h3>
<h3 style="font-size: 15px">{{ $t("开票信息") }}</h3>
<el-col :span="12">
<el-form-item :label="$t('发票抬头')" prop="invoiceTitle">
<el-input
v-model="form.invoiceTitle"
:placeholder="$t('请输入发票抬头')"
/>
<el-input v-model="form.invoiceTitle" :placeholder="$t('请输入发票抬头')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('纳税人识别号')" prop="licenseNumber">
<el-input
v-model="form.licenseNumber"
:placeholder="$t('请输入纳税人识别号')"
/>
<el-input v-model="form.licenseNumber" :placeholder="$t('请输入纳税人识别号')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('开户行')" prop="bank">
<el-input
v-model="form.bank"
:placeholder="$t('请输入开户行')"
/>
<el-input v-model="form.bank" :placeholder="$t('请输入开户行')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('账户')" prop="bankNumber">
<el-input
v-model="form.bankNumber"
:placeholder="$t('请输入账户')"
/>
<el-input v-model="form.bankNumber" :placeholder="$t('请输入账户')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('项目')" prop="project">
<el-input
v-model="form.project"
:placeholder="$t('请输入项目')"
/>
<el-input v-model="form.project" :placeholder="$t('请输入项目')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('开票地址')" prop="billingAddress">
<el-input
v-model="form.billingAddress"
:placeholder="$t('请输入开票地址')"
/>
<el-input v-model="form.billingAddress" :placeholder="$t('请输入开票地址')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('开票电话')" prop="billingTell">
<el-input
v-model="form.billingTell"
:placeholder="$t('请输入开票电话')"
maxlength="50"
/>
<el-input v-model="form.billingTell" :placeholder="$t('请输入开票电话')" maxlength="50" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('税率')" prop="taxRate">
<el-input
v-model="form.taxRate"
:placeholder="$t('请输入税率')"
/>
<el-input v-model="form.taxRate" :placeholder="$t('请输入税率')" />
</el-form-item>
</el-col>
</el-row>
......@@ -979,74 +520,41 @@
<el-form ref="bankForm" :model="form" v-if="showFinanceFlag">
<el-row type="flex" class="row-bg" justify="space-between">
<span style="font-size: 15px; line-height: 30px">{{$t('银行信息')}}</span>
<el-button
size="small"
type="primary"
@click="addBankData"
>+</el-button
>
<span style="font-size: 15px; line-height: 30px">{{ $t("银行信息") }}</span>
<el-button size="small" type="primary" @click="addBankData">+</el-button>
</el-row>
<el-table border :data="form.customerBanks" style="margin-top: 10px">
<el-table-column
:label="$t('序号')"
type="index"
></el-table-column>
<el-table-column :label="$t('序号')" type="index"></el-table-column>
<el-table-column>
<div slot="header">
{{ $t("账户名称") }} <span style="color: red">*</span>
</div>
<div slot="header">{{ $t("账户名称") }} <span style="color: red">*</span></div>
<template v-slot="{ row, $index }">
<el-form-item
:rules="{ required: true, message: $t('请输入账户名称') }"
:prop="'customerBanks.' + $index + '.accountName'"
>
<el-form-item :rules="{ required: true, message: $t('请输入账户名称') }" :prop="'customerBanks.' + $index + '.accountName'">
<el-input size="mini" v-model="row.accountName"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('币别')">
<div slot="header">
{{ $t("币别") }} <span style="color: red">*</span>
</div>
<div slot="header">{{ $t("币别") }} <span style="color: red">*</span></div>
<template v-slot="{ row, $index }">
<el-form-item
:prop="'customerBanks.' + $index + '.currency'"
:rules="{ required: true, message: $t('请输入币别') }"
>
<el-form-item :prop="'customerBanks.' + $index + '.currency'" :rules="{ required: true, message: $t('请输入币别') }">
<el-select v-model="row.currency">
<el-option
v-for="item in currecyList"
:label="$l(item, 'title')"
:value="item.id.toString()"
:key="item.id"
></el-option>
<el-option v-for="item in currecyList" :label="$l(item, 'title')" :value="item.id.toString()" :key="item.id"></el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('银行名称')">
<div slot="header">
{{ $t("银行名称") }} <span style="color: red">*</span>
</div>
<div slot="header">{{ $t("银行名称") }} <span style="color: red">*</span></div>
<template v-slot="{ row, $index }">
<el-form-item
:prop="'customerBanks.' + $index + '.bankName'"
:rules="{ required: true, message: $t('银行名称') }"
>
<el-form-item :prop="'customerBanks.' + $index + '.bankName'" :rules="{ required: true, message: $t('银行名称') }">
<el-input v-model="row.bankName" size="mini"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('银行账户')">
<div slot="header">
{{ $t("银行账户") }} <span style="color: red">*</span>
</div>
<div slot="header">{{ $t("银行账户") }} <span style="color: red">*</span></div>
<template v-slot="{ row, $index }">
<el-form-item
:prop="`customerBanks.${$index}.bankAccount`"
:rules="{ required: true, message: $t('请输入银行账户') }"
>
<el-form-item :prop="`customerBanks.${$index}.bankAccount`" :rules="{ required: true, message: $t('请输入银行账户') }">
<el-input v-model="row.bankAccount" size="mini"></el-input>
</el-form-item>
</template>
......@@ -1087,9 +595,7 @@
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot="{ $index }">
<el-button @click="deleteBankData($index)">{{
$t("删除")
}}</el-button>
<el-button @click="deleteBankData($index)">{{ $t("删除") }}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -1097,9 +603,7 @@
</el-card>
<div style="margin-top: 15px; text-align: center">
<el-button type="primary" @click="submitForm">{{
$t("确 定")
}}</el-button>
<el-button type="primary" @click="submitForm">{{ $t("确 定") }}</el-button>
<el-button @click="cancel">{{ $t("取 消") }}</el-button>
</div>
</el-col>
......@@ -1107,42 +611,25 @@
</template>
<script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import upload from "@/components/ImageUpload";
import {
createCustomer,
getCustomer,
getCustomerList,
getCustomerPage,
memberUserList,
updateCustomer,
userMemberUserList,
getCustomerLines,
fillupCustomeInfo,
getServiceNetwork,
addCompetitor,
competitorListAll
} from "@/api/ecw/customer";
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 { getDictDatas, DICT_TYPE } from "@/utils/dict"
import upload from "@/components/ImageUpload"
import { createCustomer, getCustomer, getCustomerList, getCustomerPage, memberUserList, updateCustomer, userMemberUserList, getCustomerLines, fillupCustomeInfo, getServiceNetwork, addCompetitor, competitorListAll } from "@/api/ecw/customer"
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 MemberSelector from "@/components/MemberSelector";
import { getCurrencyList } from "@/api/ecw/currency";
import MemberSelector from "@/components/MemberSelector"
import { getCurrencyList } from "@/api/ecw/currency"
export default {
name: "EcwCustomerEdit",
......@@ -1151,46 +638,41 @@ export default {
Template,
upload,
CustomerLineTable,
MemberSelector,
MemberSelector
},
created() {
getCurrencyList().then((response) => {
this.currecyList = response.data;
});
this.isCustomerServiceConfirmed = this.$route.query
.isCustomerServiceConfirmed
? true
: false;
this.getCustomerSelect();
this.reset();
this.currecyList = response.data
})
this.isCustomerServiceConfirmed = this.$route.query.isCustomerServiceConfirmed ? true : false
this.getCustomerSelect()
this.reset()
// this.getUserMemberUserFn()
if (this.customerId !== "0") {
let customerId = this.customerId;
let customerId = this.customerId
// 编辑客户
this.getCustomer(this.customerId).then(() => {
getCustomerContactsListByCustomer({ customerId: customerId }).then(
(r) => {
this.form.customerContacts = r.data;
getCustomerContactsListByCustomer({ customerId: customerId }).then((r) => {
this.form.customerContacts = r.data
this.form.customerContacts.forEach((item) => {
if (item.email) {
item.email = item.email.split(",");
item.email = item.email.split(",")
} else {
item.email = [""];
}
});
item.email = [""]
}
);
})
})
if (this.form.promoter) {
getCustomerList({ ids: this.form.promoter }).then((r) => {
this.recommended = r.data;
});
this.recommended = r.data
})
}
// 打开重泡货开关
if (this.form.weightUnit) {
this.showZhong = true;
this.showZhong = true
}
if (this.form.lightUnit) {
this.showPao = true;
this.showPao = true
}
// 掉入公海时间
this.enterOpenSeaTime = this.form.estimateEnterOpenSeaTime || this.form.enterOpenSeaTime || undefined
......@@ -1198,46 +680,46 @@ export default {
if (customerId) {
// 获取重泡货路线
getCustomerLines(customerId).then((res) => {
this.zhongLines = res.data.filter((item) => item.zhongPaoType == 1);
this.paoLines = res.data.filter((item) => item.zhongPaoType == 2);
if (this.zhongLines.length) this.showZhong1 = true;
if (this.paoLines.length) this.showPao1 = true;
this.zhongLines = res.data.filter((item) => item.zhongPaoType == 1)
this.paoLines = res.data.filter((item) => item.zhongPaoType == 2)
if (this.zhongLines.length) this.showZhong1 = true
if (this.paoLines.length) this.showPao1 = true
// /admin-api/customer-line/get-by-customer
// /admin-api/customer-line/get-by-customer?customerId=29564
});
})
}
});
})
} else {
this.getZhongPao();
this.getZhongPao()
// 新建客户
this.handleAddContact();
this.handleAddContact()
if (this.isCustomerServiceConfirmed) {
this.form.customerService = this.userId;
this.form.customerService = this.userId
}
}
getNodeList().then((r) => {
this.getNodeLists = r.data;
});
this.getNodeLists = r.data
})
getProductTypeList().then((r) => {
this.productTypeList = r.data;
});
this.productTypeList = r.data
})
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) => {
this.warehouseList = r.data;
});
this.warehouseList = r.data
})
listServiceUser().then((r) => {
this.serviceUserList = r.data;
});
this.serviceUserList = r.data
})
listAllSimpl().then((r) => {
this.allSimplList = r.data;
});
this.allSimplList = r.data
})
getCountryListAll().then((r) => {
this.countryList = r.data;
});
this.countryList = r.data
})
this.getCompetitorList()
},
data() {
......@@ -1255,89 +737,85 @@ export default {
{
required: true,
message: this.$t("客户名称不能为空"),
trigger: "blur",
},
],
country: [
{ required: true, message: this.$t("国家不能为空"), trigger: "blur" },
trigger: "blur"
}
],
country: [{ required: true, message: this.$t("国家不能为空"), trigger: "blur" }],
level: [
{
required: true,
message: this.$t("客户等级不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
type: [
{
required: true,
message: this.$t("客户类别不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
createTime: [
{
required: true,
message: this.$t("创建时间不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
source: [
{
required: true,
message: this.$t("客户来源不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
customerService: [
{
required: this.customerId === "0",
message: this.$t("客户经理不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
status: [
{
required: true,
message: this.$t("客户状态不能为空"),
trigger: "blur",
},
trigger: "blur"
}
],
busiCountryIds: [
{
required: true,
message: this.$t("请选择业务国家"),
trigger: "blur",
},
trigger: "blur"
}
],
competitorIds: [
{
required: true,
message: this.$t("请选择主要竞争对手"),
trigger: "change",
},
trigger: "change"
}
],
pickupPoints: [
{
required: true,
message: this.$t("请选择常用提货网点"),
trigger: "change",
},
trigger: "change"
}
],
productType: [
productTypes: [
{
required: true,
message: this.$t("请选择产品类别"),
trigger: "change",
},
],
trigger: "change"
}
]
},
contactRules: {
name: [
{ required: true, message: this.$t("请输入联系人"), trigger: "blur" },
],
name: [{ required: true, message: this.$t("请输入联系人"), trigger: "blur" }],
areaCode: [
{ required: true, message: this.$t("请选择区号"), trigger: "change" },
{ required: true, message: this.$t("请选择区号"), trigger: "change" }
/*{
required: true,
trigger: "change",
......@@ -1348,9 +826,9 @@ export default {
{
required: true,
trigger: "blur",
validator: this.phoneValidator,
},
],
validator: this.phoneValidator
}
]
},
// 网点
nodeList: [],
......@@ -1379,28 +857,28 @@ export default {
showShippingFlag: true,
showSettingFlag: true,
showFinanceFlag: true,
competitorList: [],
};
competitorList: []
}
},
methods: {
addEmail(row) {
row.push("");
row.push("")
},
deleteEmail(row, index) {
row.splice(index, 1);
row.splice(index, 1)
},
change(val) {
this.form.productIds = [];
this.getProductListFn(val);
this.form.productIds = []
this.getProductListFn(val)
},
getProductListFn(val) {
getProductList({ typeId: val }).then((r) => {
this.productList = r.data;
});
getProductList({ typeIds: val }).then((r) => {
this.productList = r.data
})
},
deleteBankData(index) {
this.form.customerBanks.splice(index, 1);
this.form.customerBanks.splice(index, 1)
},
//添加银行卡
addBankData() {
......@@ -1412,10 +890,10 @@ export default {
accountType: null,
status: null,
currency: "",
accountName: "",
};
accountName: ""
}
this.form.customerBanks = [...this.form.customerBanks, p];
this.form.customerBanks = [...this.form.customerBanks, p]
},
/* getUserMemberUserFn(val){
userMemberUserList({pageNo:1,pageSize:100,searchKey:val}).then(r => {
......@@ -1423,87 +901,80 @@ export default {
})
}, */
remoteMethod(val) {
this.getCustomerSelect(val);
this.getCustomerSelect(val)
},
getCustomerSelect(val = "") {
getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then(
(res) => {
this.customerSelect = res.data.list;
}
);
getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then((res) => {
this.customerSelect = res.data.list
})
},
phoneValidator(rule, value, callback) {
if (!value) {
return callback(new Error(this.$t("请输入联系方式")));
return callback(new Error(this.$t("请输入联系方式")))
}
let areaCode = this.form.customerContacts.find(
(e) => e.phoneNew === value
).areaCode;
let areaCode = this.form.customerContacts.find((e) => e.phoneNew === value).areaCode
if (areaCode) {
validatorMobile({
code: areaCode,
mobile: value,
mobile: value
})
.then((r) => {
if (r.data) {
callback();
callback()
} else {
callback(new Error(r.msg || this.$t("手机号验证失败")));
callback(new Error(r.msg || this.$t("手机号验证失败")))
}
})
.catch((e) => {
console.error(e);
callback(new Error(this.$t("手机号验证失败")));
});
console.error(e)
callback(new Error(this.$t("手机号验证失败")))
})
}
},
codeValidator(rule, value, callback) {
let index = +rule.field.split(".")[1];
let phone = this.form.customerContacts[index].phoneNew;
let index = +rule.field.split(".")[1]
let phone = this.form.customerContacts[index].phoneNew
if (phone) {
validatorMobile({
code: value,
mobile: phone,
mobile: phone
})
.then((r) => {
if (r.data) {
callback();
callback()
} else {
callback();
this.$message.error(r.msg || this.$t("手机号验证失败"));
callback()
this.$message.error(r.msg || this.$t("手机号验证失败"))
}
})
.catch((e) => {
console.error(e);
callback();
this.$message.error(this.$t("手机号验证失败"));
});
console.error(e)
callback()
this.$message.error(this.$t("手机号验证失败"))
})
}
},
handleDefaultChange($index) {
// 只有一个联系人,设置成非默认
if (
this.form.customerContacts.length === 1 &&
this.form.customerContacts[0].isDefault === 0
) {
this.$modal.msgWarning(this.$t("至少拥有一个默认联系人"));
this.form.customerContacts[0].isDefault = 1;
return;
if (this.form.customerContacts.length === 1 && this.form.customerContacts[0].isDefault === 0) {
this.$modal.msgWarning(this.$t("至少拥有一个默认联系人"))
this.form.customerContacts[0].isDefault = 1
return
}
// 设置默认联系人
if (this.form.customerContacts[$index].isDefault === 1) {
// 其他的置否
let i = 0;
let i = 0
this.form.customerContacts.forEach((e) => {
if (i !== $index) {
e.isDefault = 0;
e.isDefault = 0
}
i++;
});
i++
})
} else {
// 第一个置是
this.form.customerContacts[0].isDefault = 1;
this.form.customerContacts[0].isDefault = 1
}
},
/* selectBD(val){
......@@ -1518,49 +989,49 @@ export default {
}, */
/** 取消按钮 */
cancel() {
this.$tab.closePage();
this.open = false;
this.reset();
this.$tab.closePage()
this.open = false
this.reset()
},
/** 提交按钮 */
submitForm() {
if (this.form.customerContacts.length === 0) {
this.$modal.alert(this.$t("至少添加一位联系人"));
return;
this.$modal.alert(this.$t("至少添加一位联系人"))
return
}
this.$refs["contactForm"].validate((valid1, err1) => {
this.$refs["form"].validate((valid2, err2) => {
this.$refs.bankForm.validate((valid3, err3) => {
console.log(valid3, "valid3");
console.log(valid3, "valid3")
if (!valid1 || !valid2 || !valid3) {
this.$showFormValidateErrors({ ...err1, ...err2, ...err3 });
return;
this.$showFormValidateErrors({ ...err1, ...err2, ...err3 })
return
}
if (this.form.customerContacts.length === 0) {
this.$modal.msgError(this.$t("至少填写一个联系人信息"));
return;
this.$modal.msgError(this.$t("至少填写一个联系人信息"))
return
}
if (this.form.competitorIds == 0) {
this.$modal.msgError(this.$t("请重新选择主要竞争对手"));
return;
this.$modal.msgError(this.$t("请重新选择主要竞争对手"))
return
}
// 重货标准和泡货标准,未打开就不传,提交前清空一下
if (!this.showZhong) {
this.form.weightUnit = null;
this.zhongLines = [];
this.form.weightUnit = null
this.zhongLines = []
}
if (!this.showZhong1) {
this.zhongLines = [];
this.zhongLines = []
}
if (!this.showPao) {
this.form.lightUnit = null;
this.paoLines = [];
this.form.lightUnit = null
this.paoLines = []
}
if (!this.showPao1) {
this.paoLines = [];
this.paoLines = []
}
this.updateCustomerLines();
this.updateCustomerLines()
const form = {
...this.form,
type: this.form.type?.join(","),
......@@ -1569,68 +1040,67 @@ export default {
roles: (this.form.roles || [])?.join(","),
pickupPoints: (this.form.pickupPoints || [])?.join(","),
productIds: (this.form.productIds || [])?.join(","),
productTypes: (this.form.productTypes || [])?.join(","),
busiCountryIds: (this.form.busiCountryIds || [])?.join(","),
noConsignee: undefined,
defaultPay: undefined,
defaultBilling: undefined,
};
form.customerContacts = JSON.parse(
JSON.stringify(this.form.customerContacts)
);
defaultBilling: undefined
}
form.customerContacts = JSON.parse(JSON.stringify(this.form.customerContacts))
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) => {
if (!line.objectiveIds || line.objectiveIds == "") {
errors++;
errors++
}
});
})
if (errors) {
return this.$message.error("有两条路线未选择目的地");
return this.$message.error("有两条路线未选择目的地")
}
//我的客户页面跳转直接,完善客户
if (this.isCustomerServiceConfirmed) {
form.isCustomerServiceConfirmed = this.isCustomerServiceConfirmed;
form.isCustomerServiceConfirmed = this.isCustomerServiceConfirmed
}
// 修改的提交
if (this.form.id != null) {
this.form.customerContacts.forEach((e) => {
e.customerId = this.customerId;
});
e.customerId = this.customerId
})
console.log(this.form)
if (this.$route.name === "perfect") {
fillupCustomeInfo(form).then((r) => {
this.$modal.msgSuccess(this.$t("修改成功"));
this.open = false;
const obj = { path: "/customer/customer" };
this.$tab.closeOpenPage(obj);
});
this.$modal.msgSuccess(this.$t("修改成功"))
this.open = false
const obj = { path: "/customer/customer" }
this.$tab.closeOpenPage(obj)
})
} else {
updateCustomer(form).then((response) => {
this.$modal.msgSuccess(this.$t("修改成功"));
this.open = false;
this.$modal.msgSuccess(this.$t("修改成功"))
this.open = false
// this.getList();
const obj = { path: "/customer/customer" };
this.$tab.closeOpenPage(obj);
});
const obj = { path: "/customer/customer" }
this.$tab.closeOpenPage(obj)
})
}
return;
return
}
// 添加的提交
createCustomer(form).then((response) => {
this.$modal.msgSuccess(this.$t("新增成功"));
this.open = false;
this.$modal.msgSuccess(this.$t("新增成功"))
this.open = false
// this.getList();
const obj = { path: "/customer/customer" };
this.$tab.closeOpenPage(obj);
});
});
});
});
const obj = { path: "/customer/customer" }
this.$tab.closeOpenPage(obj)
})
})
})
})
},
/** 表单重置 */
reset() {
......@@ -1683,63 +1153,61 @@ export default {
carName: undefined,
carNo: undefined,
customerBanks: [],
isNew: true,// 业绩类型
firstDealTime: undefined,// 首次成交时间
isNew: true, // 业绩类型
firstDealTime: undefined, // 首次成交时间
// estimateEnterOpenSeaTime: undefined,// 掉入公海时间
getMethod: undefined,// 获取方式
createFrom: undefined,// 创建入口
catchTime: undefined,//捞取时间
customerServiceConfirmedTime: undefined,//归属时间
updater: this.$store.getters.userId,// 更新人
updateTime: undefined,// 更新时间
roles: undefined,// 客户角色
busiCountryIds: undefined,// 业务国家
competitorIds: undefined,// 主要竞争对手
weightYearly: undefined,// 年度发货量
numYearly: undefined,// 年度发货次数
noConsignee: false,// 控制无收货人
defaultPay: false,// 默认付款
defaultBilling: false,// 默认开票
};
this.form.createTime = new Date().getTime();
this.form.updateTime = new Date().getTime();
this.resetForm("form");
getMethod: undefined, // 获取方式
createFrom: undefined, // 创建入口
catchTime: undefined, //捞取时间
customerServiceConfirmedTime: undefined, //归属时间
updater: this.$store.getters.userId, // 更新人
updateTime: undefined, // 更新时间
roles: undefined, // 客户角色
busiCountryIds: undefined, // 业务国家
competitorIds: undefined, // 主要竞争对手
weightYearly: undefined, // 年度发货量
numYearly: undefined, // 年度发货次数
noConsignee: false, // 控制无收货人
defaultPay: false, // 默认付款
defaultBilling: false // 默认开票
}
this.form.createTime = new Date().getTime()
this.form.updateTime = new Date().getTime()
this.resetForm("form")
},
getCustomer(id) {
return getCustomer(id).then((response) => {
console.log(response, "response");
console.log(response, "response")
this.form = {
...this.form,
...response.data,
id: this.customerId,
transportType:
response.data.transportType && response.data.transportType !== ""
? response.data.transportType.split(",")
: [],
transportType: response.data.transportType && response.data.transportType !== "" ? response.data.transportType.split(",") : [],
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),
productIds: this.stringArrToNumberArr(response.data.productIds),
busiCountryIds: this.stringArrToNumberArr(response.data.busiCountryIds),
competitorIds: Number(response.data.competitorIds)
};
competitorIds: Number(response.data.competitorIds),
productTypes: response.data.productTypes ? response.data.productTypes.split(",") : []
}
if (this.form.productType) {
console.log("1231", this.form.productType);
this.getProductListFn(this.form.productType);
console.log("1231", this.form.productType)
this.getProductListFn(this.form.productType)
}
console.log(this.form)
this.open = true;
this.title = this.$t("修改客户");
this.open = true
this.title = this.$t("修改客户")
this.$forceUpdate()
this.getZhongPao();
});
this.getZhongPao()
})
},
stringArrToNumberArr(data) {
if (data) {
const strArr = data.split(",")
const numArr = strArr.map(item => Number(item))
const numArr = strArr.map((item) => Number(item))
return numArr
} else {
return []
......@@ -1747,14 +1215,14 @@ export default {
},
updateCustomerLines() {
let zhongLines = [],
paoLines = [];
paoLines = []
if (this.zhongLines.length > 0) {
zhongLines = this.zhongLines;
zhongLines = this.zhongLines
}
if (this.paoLines.length > 0) {
paoLines = this.paoLines;
paoLines = this.paoLines
}
this.form.customerLines = [...zhongLines, ...paoLines];
this.form.customerLines = [...zhongLines, ...paoLines]
},
handleAddContact() {
this.form.customerContacts.push({
......@@ -1769,47 +1237,52 @@ export default {
social: undefined,
socialNumber: "",
userid: undefined,
nameEn: "",
nameEn: ""
// "username": ""
});
})
},
handleDeleteContact($index) {
this.form.customerContacts.splice($index, 1);
this.form.customerContacts.splice($index, 1)
if (this.form.customerContacts.length > 0) {
this.$refs["contactForm"].clearValidate();
this.$refs["contactForm"].clearValidate()
if (!this.form.customerContacts.find((e) => e.isDefault)) {
this.form.customerContacts[0].isDefault = 1;
this.form.customerContacts[0].isDefault = 1
}
}
},
getZhongPao() {
getZhongPaoBest({
customerId: this.customerId,
customerId: this.customerId
// departureId: this.departureId,
// objectiveId: this.objectiveId
}).then((r) => {
if (!this.form.weightUnit) this.form.weightUnit = r.data.zhongEdge;
if (!this.form.lightUnit) this.form.lightUnit = r.data.paoEdge;
});
if (!this.form.weightUnit) this.form.weightUnit = r.data.zhongEdge
if (!this.form.lightUnit) this.form.lightUnit = r.data.paoEdge
})
},
getCompetitorList() {
getCompetitorList(callback) {
competitorListAll().then((r) => {
this.competitorList = r.data;
this.competitorList = r.data
this.$nextTick(() => {
callback && callback()
})
})
},
changeCompetitor(val) {
if (val == 0) {
this.$prompt("请输入主要竞争对手", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
cancelButtonText: "取消"
}).then((data) => {
console.log(data)
addCompetitor({
name: data.value
}).then(_ => {
this.$message.success('添加成功!')
this.getCompetitorList()
}).then((r) => {
this.$message.success("添加成功!")
this.getCompetitorList(() => {
this.form.competitorIds = r.data
})
})
})
}
......@@ -1817,13 +1290,13 @@ export default {
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
return this.$i18n.locale === "zh_CN"
},
userId() {
return this.$store.state.user.id;
return this.$store.state.user.id
},
customerId() {
return this.$route.params.customerId;
return this.$route.params.customerId
},
/* userMemberUser(){
let list = this.memberList.filter(item => {
......@@ -1832,33 +1305,31 @@ export default {
return [...this.selectMemberList,...list]
}, */
productListFilter() {
return this.productList.filter((p) => p.typeId === this.form.productType);
return this.productList.filter((p) => p.typeId === this.form.productType)
},
customerSelectFn() {
if (this.recommended.length > 0) {
let i = this.customerSelect.find(
(item) => item.id === this.recommended[0].id
);
let i = this.customerSelect.find((item) => item.id === this.recommended[0].id)
if (!i) {
this.customerSelect.push(this.recommended[0]);
this.customerSelect.push(this.recommended[0])
}
return this.customerSelect;
return this.customerSelect
} else {
return this.customerSelect;
return this.customerSelect
}
}
},
},
watch: {
zhongLines() {
console.log("zhongLines", this.zhongLines);
this.updateCustomerLines();
console.log("zhongLines", this.zhongLines)
this.updateCustomerLines()
},
paoLines() {
console.log("paoLines", this.paoLines);
this.updateCustomerLines();
},
},
};
console.log("paoLines", this.paoLines)
this.updateCustomerLines()
}
}
}
</script>
<style scoped lang="scss">
......
......@@ -324,8 +324,17 @@
<!-- />-->
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName"></el-table-column>
<el-table-column :label="$t('国籍')" align="center" prop="country" :formatter="countryFormatter"></el-table-column>
<el-table-column
:label="$t('客户经理')"
align="center"
prop="customerServiceName"
></el-table-column>
<el-table-column
:label="$t('国籍')"
align="center"
prop="country"
:formatter="countryFormatter"
></el-table-column>
<el-table-column :label="$t('出货渠道')" align="center">
<template slot-scope="{ row }">
{{ channel(row.transportType) }}
......@@ -414,7 +423,12 @@
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
</el-table-column>
<el-table-column width="200px" :label="$t('操作')" align="center" fixed="right">
<el-table-column
width="200px"
:label="$t('操作')"
align="center"
fixed="right"
>
<template slot-scope="scope">
<!-- <el-button size="mini" type="text" v-show="'development' === env && scope.row.isInOpenSea" @click="seasPond(scope.row)"-->
<!-- v-hasPermi="['ecw:customer:query']">{{$t('掉入公海池')}}</el-button>-->
......@@ -965,22 +979,22 @@ export default {
}
},
combinedQueryParams() {
let queryParams = {}
let queryParams = {};
if (this.enterOpenSeaTime && this.enterOpenSeaTime.length == 2) {
queryParams.beginEnterOpenSeaTime = this.enterOpenSeaTime[0]
queryParams.endEnterOpenSeaTime = this.enterOpenSeaTime[1]
queryParams.beginEnterOpenSeaTime = this.enterOpenSeaTime[0];
queryParams.endEnterOpenSeaTime = this.enterOpenSeaTime[1];
}
if (this.customerServiceConfirmedTime && this.customerServiceConfirmedTime.length == 2) {
queryParams.beginCustomerServiceConfirmedTime = this.customerServiceConfirmedTime[0]
queryParams.endCustomerServiceConfirmedTime = this.customerServiceConfirmedTime[1]
}
if (this.dateRangeCreateTime && this.dateRangeCreateTime.length == 2) {
queryParams.beginCreateTime = this.dateRangeCreateTime[0]
queryParams.endCreateTime = this.dateRangeCreateTime[1]
queryParams.beginCreateTime = this.dateRangeCreateTime[0];
queryParams.endCreateTime = this.dateRangeCreateTime[1];
}
if (this.firstDealTime && this.firstDealTime.length == 2) {
queryParams.beginFirstDealTime = this.firstDealTime[0]
queryParams.endFirstDealTime = this.firstDealTime[1]
queryParams.beginFirstDealTime = this.firstDealTime[0];
queryParams.endFirstDealTime = this.firstDealTime[1];
}
if (this.weightYearly.value) {
let key = "eqWeightYearly"
......@@ -1420,12 +1434,12 @@ export default {
const strArr = []
this.countryList.forEach((item) => {
if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.nameZh : item.nameEn)
strArr.push(this.isChinese ? item.nameZh : item.nameEn);
}
})
return strArr.length > 0 ? strArr.join(",") : null
} else {
return null
return null;
}
},
getPickupPointNames(ids) {
......@@ -1434,7 +1448,7 @@ export default {
const strArr = []
this.getNodeLists.forEach((item) => {
if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.titleZh : item.titleEn)
strArr.push(this.isChinese ? item.titleZh : item.titleEn);
}
})
return strArr.length > 0 ? strArr.join(",") : null
......@@ -1453,7 +1467,7 @@ export default {
})
return strArr.length > 0 ? strArr.join(",") : null
} else {
return null
return null;
}
},
getProductTypeNames(ids) {
......@@ -1462,12 +1476,12 @@ export default {
const strArr = []
this.productTypeList.forEach((item) => {
if (idsArr.includes(item.id.toString())) {
strArr.push(this.isChinese ? item.titleZh : item.titleEn)
strArr.push(this.isChinese ? item.titleZh : item.titleEn);
}
})
return strArr.length > 0 ? strArr.join(",") : null
} else {
return null
return null;
}
},
getPromoterName(id) {
......@@ -1475,13 +1489,13 @@ export default {
let strName = ""
for (const item of this.customerSelectFn) {
if (item.id == id) {
strName = item.name
break
strName = item.name;
break;
}
}
return strName
return strName;
} else {
return null
return null;
}
}
}
......
......@@ -334,106 +334,7 @@
</el-card>
</el-tab-pane>
<el-tab-pane name="follow" :label="$t('跟进')">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-form size="small" :inline="true" label-width="100px">
<el-form-item :label="$t('跟进类型')">
<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>
<logListCommon ref="logListCommon" v-if="activeName === 'follow'" :customerId="id" />
</el-tab-pane>
<el-tab-pane name="complain" :label="$t('客户投诉')">
<customer-complaint v-if="activeName === 'complain'" ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint>
......@@ -705,7 +606,7 @@
</div>
</el-dialog>
<customer-follow ref="customerFollow" v-if="customerFollowVisible" :id="id" :customer-id="id" :customer-service="customer.customerService" :customer-number="customer.number" @refresh="getCustomerFollowList" />
<customer-follow ref="customerFollow" v-if="customerFollowVisible" :customer-id="id" :customer-service="customer.customerService" :customer-number="customer.number" @refresh="logListCommonRefresh" />
</div>
</template>
......@@ -731,7 +632,8 @@ import ImageDisplay from "@/views/ecw/order/components/imageDisplay.vue"
import { getListTree } from "@/api/ecw/region"
import { getWarehouseList } from "@/api/ecw/warehouse"
import { deleteOffer, cancel, recovery } from "@/api/ecw/offer"
import { getCustomerFollowList, exportCustomerFollow } from "@/api/ecw/customerFollow"
import logListCommon from "@/views/ecw/offer/logListCommon"
export default {
name: "query",
......@@ -740,7 +642,8 @@ export default {
Template,
CustomerFollow,
CustomerComplaint,
customerLog
customerLog,
logListCommon
},
created() {
// 获取币种
......@@ -811,7 +714,6 @@ export default {
this.getInfoListOfferPage() //报价
break
case "follow":
this.getCustomerFollowList()
case "bill":
this.infoListReceiptFn() //账单
break
......@@ -991,14 +893,7 @@ export default {
objectiveId: null,
destWarehouseId: null,
customerFollowVisible: false,
followForm: {
pageNo: 1,
pageSize: 10
},
followTime: [],
nextTime: [],
customerFollowTotal: 0,
customerFollowList: [],
currencyList: [],
userId: undefined
}
......@@ -1080,18 +975,6 @@ export default {
this.$router.push({ path: "/offer/create", query: { customerId: row.id, customerType: row.type, type: 1 } })
},
handleCustomerFollow(row, flag) {
this.customerFollowVisible = true
this.$nextTick((_) => {
this.$refs["customerFollow"].handleUpdate(row, flag)
})
},
handleCustomerFollowLink(row) {
this.customerFollowVisible = true
this.$nextTick((_) => {
this.$refs["customerFollow"].handleView(row)
})
},
checkPermi,
userIdFormatter(row, column, cellValue) {
const member = this.memberList.find((e) => e.id === cellValue)
......@@ -1192,27 +1075,6 @@ export default {
this.infoListOfferFrom = { pageNo: 1, pageSize: 10 }
this.getInfoListOfferPage()
},
getCustomerFollowList() {
getCustomerFollowList({
...this.followForm,
customerId: this.customerId
}).then((r) => {
this.customerFollowList = r.data.list
this.customerFollowTotal = r.data.total
})
},
/** 跟进记录导出按钮操作 */
handleExport() {
// 执行导出
this.$modal.confirm(this.$t("是否确认导出客户跟进记录数据项?")).then(() => {
exportCustomerFollow({
...this.followForm,
customerId: this.customerId
}).then((r) => {
this.$message.success(this.$t("已加入导出队列,请稍后在下载日志中下载"))
})
})
},
// 数据
getOrderStatistics() {
orderStatistics({ customerId: this.id }).then((r) => {
......@@ -1340,6 +1202,9 @@ export default {
this.$message.success("操作成功")
this.handleQuery()
})
},
logListCommonRefresh() {
this.$refs.logListCommon && this.$refs.logListCommon.handleQuery()
}
}
}
......
......@@ -25,14 +25,15 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" v-for="(item, index) in queryParams.nodeIds">
<el-row :gutter="10" v-for="(item, index) in queryParams.nodeIds" :key="item.id">
<el-col :span="6">
<el-form-item v-if="title == 3" :label="$t('提货点')" :prop="`nodeIds[${index}].wareHouses`" :rules="rules.nodeIds.wareHouses">
<el-select v-model="item.wareHouses" :placeholder="$t('请选择提货点')" :disabled="isDisable" clearable multiple filterable remote reserve-keyword :remote-method="handleWarehouseList" @visible-change="changeWarehouseList" :loading="loading" size="small">
<el-option v-for="nodeItem in warehouseList" :key="nodeItem.id" :label="isChinese ? nodeItem.titleZh : nodeItem.titleEn" :value="nodeItem.id" />
</el-select>
</el-form-item>
<el-form-item v-else :label="$t('提货点')" :prop="`nodeIds[${index}].wareHouses`" :rules="rules.nodeIds.wareHouses">
<!-- 编辑对应单个提货点 逻辑显示-->
<el-form-item v-else :label="$t('提货点')" :prop="`nodeId`">
<el-select v-model="queryParams.nodeId" :placeholder="$t('请选择提货点')" :disabled="isDisable" clearable filterable remote reserve-keyword :remote-method="handleWarehouseList" @visible-change="changeWarehouseList" :loading="loading" size="small">
<el-option v-for="nodeItem in warehouseList" :key="nodeItem.id" :label="isChinese ? nodeItem.titleZh : nodeItem.titleEn" :value="nodeItem.id" />
</el-select>
......@@ -175,9 +176,16 @@ export default {
this.queryParams = deepClone(newVal)
this.$set(this.queryParams, "dateRangeCreateTime", [parseTime(newVal.startTime), parseTime(newVal.endTime)])
this.queryParams.pickMethod = newVal.pickMethod.split(",")
this.$nextTick(() => {
this.$refs["queryForm"].clearValidate()
})
} else {
this.resetFormQuery()
this.$nextTick(() => {
this.$refs["queryForm"].resetFields()
this.$refs["queryForm"].clearValidate()
})
console.log("Prop is empty")
}
}
......@@ -190,11 +198,10 @@ export default {
endTime: null,
imgEn: null,
imgZh: null,
nodeIds: [{ wareHouses: "", points: "", quantityRemain: null }],
nodeIds: [{ wareHouses: [], points: "", quantityRemain: null, id: 0 }],
nodeId: null,
pickMethod: null,
pickMethod: [],
pointsRequire: null,
remarkEn: null,
remarkFr: null,
remarkZh: null,
......@@ -233,6 +240,13 @@ export default {
trigger: "blur"
}
],
nodeId: [
{
required: true,
message: this.$t("请选择提货点"),
trigger: "change"
}
],
nodeIds: {
wareHouses: [
{
......@@ -303,9 +317,7 @@ export default {
this.handleWarehouseList()
},
methods: {
dataTimeFunc(e) {
console.log("5555", e)
},
dataTimeFunc(e) {},
changeWarehouseList(e) {
if (e) {
this.handleWarehouseList()
......@@ -319,7 +331,7 @@ export default {
},
handleOrderVRule(item, index) {
if (index == "0") {
this.queryParams.nodeIds.push({ nodeId: "", points: "" })
this.queryParams.nodeIds.push({ wareHouses: [], quantityRemain: null, points: "", id: index + 1 })
} else {
this.queryParams.nodeIds.splice(index, 1)
}
......@@ -329,7 +341,9 @@ export default {
params.startTime = this.queryParams?.dateRangeCreateTime?.[0]
params.endTime = this.queryParams?.dateRangeCreateTime?.[1]
params.pickMethod = this.queryParams.pickMethod.toString()
if (this.title != 3) {
params.nodeIds[0].wareHouses[0] = params.nodeId
}
this.$refs["queryForm"].validate((valid) => {
if (valid) {
if (this.title == "2") {
......@@ -360,11 +374,11 @@ export default {
this.queryParams = {
allowCount: null,
endTime: null,
nodeIds: [{ wareHouses: "", points: "", quantityRemain: null }],
nodeIds: [{ wareHouses: [], points: "", quantityRemain: null, id: 0 }],
imgEn: null,
imgZh: null,
nodeId: null,
pickMethod: null,
pickMethod: [],
pointsRequire: null,
remarkEn: null,
remarkFr: null,
......
......@@ -1100,6 +1100,9 @@ export default {
if (this.form.offerId != this.$route.query.id) {
this.getOffer()
}
if (this.$route.query.copyId && this.form.copyId != this.$route.query.copyId) {
this.getOffer()
}
},
async created() {
await this.getChannelList()
......@@ -1154,7 +1157,7 @@ export default {
getOffer() {
//加了是否从全部客户列表中报价按钮进来的判断
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
formData.type = formData.type ? formData.type.split(",").filter((item) => item != "") : []
formData.prodCreateReqVOList = []
......@@ -1187,6 +1190,14 @@ export default {
})
})
}
if (this.$route.query.copyId) {
formData.offerId = ""
formData.startTime = ""
formData.endTime = ""
formData.stopTime = ""
}
this.$set(this, "form", formData)
// 接口只返回了发货人和收货人ID,还需要调用接口获取详细信息回显
getCustomerContactsSelect({
......
<template>
<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-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 :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 :label="$t('创建时间')" prop="orderNo">
<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-form-item :label="$t('区号')" prop="relationAreaCode">
<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 :label="$t('始发地')" prop="departureId">
......@@ -20,92 +23,149 @@
<el-option v-for="item in exportCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的地')" prop="objectiveId">
<el-select v-model="queryParams.objectiveId" :placeholder="$t('请选择目的地')" clearable>
<el-option v-for="item in importCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
<el-form-item :label="$t('目的国')" prop="destCountryId">
<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-form-item>
<el-form-item :label="$t('客户经理')" prop="salesmanIds">
<user-selector v-model="queryParams.salesmanIds" multiple clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('销售阶段')" prop="statusList">
<dict-selector :type="DICT_TYPE.ECW_OFFER_STATUS" multiple v-model="queryParams.statusList" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('重要程度')" prop="importances">
<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 :label="$t('运输方式')" prop="transportId">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportId" formatter="number" 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 :label="$t('商品')" prop="prodTitle">
<el-input v-model="queryParams.prodTitle" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery"/>
<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 :label="$t('控货')" prop="control">
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" v-model="queryParams.control" clearable />
<el-form-item :label="$t('出货渠道')" prop="channelIds" v-show="showSearch">
<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="followUpSalesmanId">
<user-selector v-model="queryParams.followUpSalesmanId" clearable />
<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="status">
<dict-selector :type="DICT_TYPE.ECW_OFFER_STATUS" v-model="queryParams.status" clearable />
<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">
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsType" clearable />
<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>
<div>
<el-form-item :label="$t('预计结束时间')" prop="orderNo">
<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-form-item :label="$t('增值服务')" prop="serviceType" v-show="showSearch">
<el-select v-model="queryParams.serviceType" :placeholder="$t('请选择')" clearable @change="handleQuery">
<el-option :label="$t('普通订单')" :value="0"></el-option>
<el-option :label="$t('集运服务')" :value="1"></el-option>
<el-option :label="$t('海外仓')" :value="2"></el-option>
</el-select>
</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 :label="$t('客户来源')" prop="sourceIds" v-show="showSearch">
<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>
</div>
<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-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['ecw:offer:create']">{{$t('新增')}}</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ecw:offer:create']">{{ $t("新增") }}</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['ecw:offer:export']">{{$t('导出')}}</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" v-hasPermi="['ecw:offer:export']">{{ $t("导出") }}</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list" border>
<el-table-column :label="$t('报价单号')" align="left" prop="number" width="200px">
<template slot-scope="{row}">
<el-link type="primary" @click.native="$router.push('detail?offerId=' + row.offerId)">{{row.number}}</el-link>
<el-table-column :label="$t('报价单号')" align="left" prop="number" width="150">
<template slot-scope="{ row }">
<el-link type="primary" @click.native="$router.push('detail?offerId=' + row.offerId)">{{ row.number }}</el-link>
</template>
</el-table-column>
<el-table-column :label="$t('订单编号')" align="left" width="120">
<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="orderNo" />
<el-table-column :label="$t('客户名称')" align="left" prop="relationName" />
<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="left" width="180">
<template slot-scope="{row}">
<el-table-column :label="$t('运输方式')" align="center">
<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" />
</template>
</el-table-column>
<el-table-column :label="$t('预计结束时间')" align="left">
<el-table-column :label="$t('预计结束时间')" align="left" width="100">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.stopTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<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" />
</template>
</el-table-column>
<el-table-column :label="$t('预计销售额')" align="left" prop="estCost">
<template slot-scope="{row}">
<el-table-column :label="$t('预计销售额')" align="left" prop="estCost" width="160">
<template slot-scope="{ row }">
<div class="" v-for="(item, feeIndex) in row.estCostVO.feeDtoList" :key="feeIndex">
<dict-tag :type="DICT_TYPE.ECW_COST_FEE_TYPE" :value="item.feeType" />
{{item.amount}} {{currencyMap[item.currencyId]}}
{{ item.amount }} {{ currencyMap[item.currencyId] }}
</div>
</template>
</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 :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
......@@ -122,34 +182,37 @@
<el-dropdown>
<el-button icon="el-icon-plus" circle type="primary"></el-button>
<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('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(`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('/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="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="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-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('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('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(`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('/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="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="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>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" />
</div>
</template>
<script>
import { deleteOffer, getOfferPage, exportOfferExcel,cancel, recovery, offerDeptPage, exportDeptOfferExcel } from "@/api/ecw/offer";
import { getCurrencyList } from '@/api/ecw/currency';
import {getTradeCityList} from '@/api/ecw/region'
import UserSelector from '@/components/UserSelector'
import { deleteOffer, getOfferPage, exportOfferExcel, cancel, recovery, offerDeptPage, exportDeptOfferExcel } from "@/api/ecw/offer"
import { getChannelList } from "@/api/ecw/channel"
import { getRegionList } from "@/api/ecw/order"
import { getCurrencyList } from "@/api/ecw/currency"
import { getTradeCityList } from "@/api/ecw/region"
import UserSelector from "@/components/UserSelector"
import Selector from "@/components/Selector"
export default {
name: "EcwOfferIndex",
components: {
Selector,
UserSelector
},
data() {
......@@ -159,70 +222,321 @@ export default {
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
showSearch: false,
// 总条数
total: 0,
// 报价单管理列表
list: [],
// 查询参数
queryParams: {
salesmanIds: [],
statusList: [],
importances: [],
channelIds: [],
sourceIds: [],
pageNo: 1,
pageSize: 10
},
queryTmp: {
createTime: ["", ""],
stopTime: ["", ""],
startTime: ["", ""],
endTime: ["", ""]
},
currencyList: [],
tradeCityList:[],
dept: false, // 是否部门订单
};
tradeCityList: [],
channelList: [],
AddressCity: [],
AddressProvince: [],
AddressTown: [],
destCountryId: null,
objectiveId: null,
destWarehouseId: null,
// 选中数组
ids: [],
//目的国
countryList: [],
//目的城市
cityList: [],
//目的仓
destWarehouseList: [],
dept: false // 是否部门订单
}
},
computed:{
currencyMap(){
computed: {
currencyMap() {
let map = {}
this.currencyList.forEach(item => {
map[item.id] = this.$l(item, 'title')
this.currencyList.forEach((item) => {
map[item.id] = this.$l(item, "title")
})
return map
},
exportCityList() {
return this.tradeCityList.filter(item => item.type == 2)
return this.tradeCityList.filter((item) => item.type == 2)
},
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()
},
created() {
console.log(this.getDictDatas(this.DICT_TYPE.ECW_OFFER_STATUS))
console.log("offer index", this.$route)
// 部门订单
if(this.$route.fullPath.indexOf('dept') > -1){
if (this.$route.fullPath.indexOf("dept") > -1) {
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.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: {
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() {
this.loading = true;
this.loading = true
let func = this.dept ? offerDeptPage : getOfferPage
// 执行查询
func(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
func({
...this.queryParams,
...this.formatQuery()
}).then((response) => {
this.list = response.data.list
this.total = response.data.total
this.loading = false
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
this.queryParams.pageNo = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
......@@ -230,62 +544,70 @@ export default {
pageNo: 1,
pageSize: 10
}
this.handleQuery();
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
return this.$router.push('create')
return this.$router.push("create")
},
/** 修改按钮操作 */
handleUpdate(row) {
return this.$router.push('edit?id=' + row.offerId)
return this.$router.push("edit?id=" + row.offerId)
},
/** 删除按钮操作 */
handleDelete(row) {
const offerId = row.offerId;
this.$modal.confirm(this.$t('是否确认删除报价单管理编号为{offerId}的数据项?', {offerId})).then(function() {
return deleteOffer(offerId);
}).then(() => {
this.getList();
this.$modal.msgSuccess(this.$t("删除成功"));
}).catch(() => {});
const offerId = row.offerId
this.$modal
.confirm(this.$t("是否确认删除报价单管理编号为{offerId}的数据项?", { offerId }))
.then(function () {
return deleteOffer(offerId)
})
.then(() => {
this.getList()
this.$modal.msgSuccess(this.$t("删除成功"))
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
let params = { ...this.queryParams, ...this.formatQuery() }
params.pageNo = undefined
params.pageSize = undefined
// 执行导出
this.$confirm(this.$t('是否确认导出所有报价单管理数据项?')).then(() => {
this.exportLoading = true;
if(this.dept){
this.$confirm(this.$t("是否确认导出所有报价单管理数据项?"))
.then(() => {
this.exportLoading = true
if (this.dept) {
return exportDeptOfferExcel(params)
}else return exportOfferExcel(params);
}).then(response => {
this.$download.excel(response, '报价列表.xls');
this.exportLoading = false;
}).catch(() => {});
} else return exportOfferExcel(params)
})
.then((response) => {
this.$download.excel(response, "报价列表.xls")
this.exportLoading = false
})
.catch(() => {})
},
cancel(id){
this.doAction(this.$t('确定要取消此报价单么?'), cancel, id);
cancel(id) {
this.doAction(this.$t("确定要取消此报价单么?"), cancel, id)
},
recovery(id){
this.doAction(this.$t('确定要恢复此报价单么?'), recovery, id);
recovery(id) {
this.doAction(this.$t("确定要恢复此报价单么?"), recovery, id)
},
deleteOffer(id){
this.doAction(this.$t('确定要删除此报价单么?'), deleteOffer, id);
deleteOffer(id) {
this.doAction(this.$t("确定要删除此报价单么?"), deleteOffer, id)
},
doAction(tips, action, id){
this.$confirm(tips).then(res => {
doAction(tips, action, id) {
this.$confirm(tips)
.then((res) => {
return action(id)
})
.then(() => {
this.$message.success('操作成功')
this.$message.success("操作成功")
this.handleQuery()
})
}
}
};
}
</script>
<template>
<div class="app-container">
<el-card>
<div slot="header" class="card-title">{{$t('跟进记录列表')}}</div>
<!-- 列表 -->
<div class="offer-header">
<span style="font-size: 15px;">{{$t('报价单号')}}{{number}}</span>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
>{{$t('新增')}}</el-button>
</div>
<el-table v-loading="loading" :data="list">
<el-table-column :label="$t('序号')" align="center" prop="id" type="index">
<template slot-scope="scope">
<span>{{scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column :label="$t('跟进类型')" align="center" prop="type" >
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_OFFER_TYPE" :value="scope.row.type"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('联系人')" align="center" prop="contactName" />
<el-table-column :label="$t('跟进方式')" align="center" prop="followUpMethod">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_FOLLOW_METHOD" :value="scope.row.followUpMethod"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('跟进时间')" align="center" prop="followUpTime" width="180">
<template slot-scope="scope">
<span>{{ scope.row.followUpTime}}</span>
</template>
</el-table-column>
<el-table-column :label="$t('客户反馈')" align="center" prop="customerFeedback" />
<el-table-column :label="$t('处理结果')" align="center" prop="processingResults" />
<el-table-column :label="$t('客户经理')" align="center" prop="followUpSalesmanName">
<template slot-scope="scope">
<span>{{getCustomerService(scope.row.followUpSalesmanId)}}</span>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="params.page" :limit.sync="params.rows"
@pagination="getList"/>
</el-card>
<logListCommon :offerId="offerId" />
</div>
</template>
<script>
import {getOfferLogPage} from "@/api/ecw/offerLog";
import {DICT_TYPE} from '@/utils/dict'
import {getOffer} from '@/api/ecw/offer'
import { userList } from "@/api/system/user"
import logListCommon from "@/views/ecw/offer/logListCommon"
export default {
name: "OfferLog",
components: {
},
name: "offerLogList",
components: { logListCommon },
data() {
return {
// 遮罩层
loading: true,
list: [],
total:0,
params:{
page:1,
rows:20,
offerId:0,
type:2
},
number:'',
relationId:0,
creatorName:'test',
creatorData:[]
};
return {}
},
created() {
if(this.$route.query.offerId){
this.params.offerId = this.$route.query.offerId
this.getList();
this.getRelationID()
computed: {
offerId() {
return parseInt(this.$route.query.offerId || 0)
}
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>
<style scoped>
.card-title{
.card-title {
font-size: 18px;
font-weight: bold;
}
.offer-header{
}
.offer-header {
padding-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
}
}
</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>
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
<el-form-item :label="$t('编号')" prop="orderNo">
<el-input
v-model.trim="noParam.value"
:placeholder="$t('请输入订单号、唛头、提单号')"
clearable
@input="replaceSpace(noParam, 'value')"
@keyup.enter.native="handleQuery"
>
<el-input v-model.trim="noParam.value" :placeholder="$t('请输入订单号、唛头、提单号')" clearable @input="replaceSpace(noParam, 'value')" @keyup.enter.native="handleQuery">
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.ORDER_QUERY_NO_FIELD"
defaultable
v-model="noParam.key"
class="w-50"
/>
<dict-selector :type="DICT_TYPE.ORDER_QUERY_NO_FIELD" defaultable v-model="noParam.key" class="w-50" />
</template>
</el-input>
</el-form-item>
......@@ -29,130 +13,46 @@
</el-form-item> -->
<el-form-item :label="$t('发货人')" prop="consignorKey">
<el-input
v-model.trim="queryParams.consignorKey"
:placeholder="$t('发货人')"
clearable
@keyup.enter.native="handleQuery"
@input="replaceSpace(queryParams, 'consignorKey')"
/>
<el-input v-model.trim="queryParams.consignorKey" :placeholder="$t('发货人')" clearable @keyup.enter.native="handleQuery" @input="replaceSpace(queryParams, 'consignorKey')" />
</el-form-item>
<el-form-item :label="$t('收货人')" prop="consigneeKey">
<el-input
v-model.trim="queryParams.consigneeKey"
:placeholder="$t('收货人')"
clearable
@keyup.enter.native="handleQuery"
@input="replaceSpace(queryParams, 'consigneeKey')"
/>
<el-input v-model.trim="queryParams.consigneeKey" :placeholder="$t('收货人')" clearable @keyup.enter.native="handleQuery" @input="replaceSpace(queryParams, 'consigneeKey')" />
</el-form-item>
<el-form-item label="">
<dict-selector
:type="DICT_TYPE.ECW_BEGINTIME_TYPE_ENDTIME"
:filter="(item) => item.value != 'PickTime'"
v-model="dateFilterType"
defaultable
style="width: 150px; margin-right: 5px"
/>
<el-date-picker
v-model="dateFilter"
type="datetimerange"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
value-format="yyyy-MM-dd HH:mm:ss"
@change="handleQuery"
>
</el-date-picker>
<dict-selector :type="DICT_TYPE.ECW_BEGINTIME_TYPE_ENDTIME" :filter="(item) => item.value != 'PickTime'" v-model="dateFilterType" defaultable style="width: 150px; margin-right: 5px" />
<el-date-picker v-model="dateFilter" 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>
<div>
<el-form-item :label="$t('始发仓')" prop="startWarehouseIds">
<el-select
v-model="queryParams.startWarehouseIds"
multiple
:placeholder="$t('请选择始发仓')"
clearable
@change="handleQuery"
>
<el-option
v-for="item in exportWarehouseList"
:label="$l(item, 'title')"
:value="item.id"
:key="item.id"
></el-option>
<el-select v-model="queryParams.startWarehouseIds" multiple :placeholder="$t('请选择始发仓')" clearable @change="handleQuery">
<el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的国')" prop="destCountryId">
<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 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 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 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-form-item>
</div>
<el-form-item
:label="$t('运输方式')"
prop="transportId"
v-if="!transportId"
>
<dict-selector
:type="DICT_TYPE.ECW_TRANSPORT_TYPE"
v-model.number="queryParams.transportId"
clearable
@change="handleQuery"
/>
<el-form-item :label="$t('运输方式')" prop="transportId" v-if="!transportId">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model.number="queryParams.transportId" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('商品类型')" prop="goodsTypes" v-show="showSearch">
<selector v-model="queryParams.goodsTypes" multiple :options="productAttrList" label-field="attrName" value-field="id">
</selector>
<selector v-model="queryParams.goodsTypes" multiple :options="productAttrList" label-field="attrName" value-field="id"> </selector>
</el-form-item>
<!--
<el-form-item :label="$t('品名')" prop="prodId">
......@@ -164,93 +64,38 @@
</el-form-item> -->
<el-form-item :label="$t('商品')" prop="tidanNo" v-show="showSearch">
<el-input
v-model.trim="prodParam.value"
:placeholder="$t('请输入商品类型、品名或品牌')"
clearable
@keyup.enter.native="handleQuery"
@input="replaceSpace(prodParam, 'value')"
>
<el-input v-model.trim="prodParam.value" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery" @input="replaceSpace(prodParam, 'value')">
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.ORDER_QUERY_PROD_FIELD"
defaultable
v-model="prodParam.key"
class="w-50"
/>
<dict-selector :type="DICT_TYPE.ORDER_QUERY_PROD_FIELD" defaultable v-model="prodParam.key" class="w-50" />
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('控货')" prop="isCargoControl" v-show="showSearch">
<dict-selector
v-model="queryParams.isCargoControl"
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
fomatter="bool"
clearable
@change="handleQuery"
/>
<dict-selector v-model="queryParams.isCargoControl" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('入仓类型')" prop="warehouseType" v-show="showSearch">
<dict-selector
:type="DICT_TYPE.ECW_WAREHOUSING_TYPE"
v-model="queryParams.warehouseTypes"
multiple
clearable
@change="handleQuery"
/>
<dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="queryParams.warehouseTypes" multiple clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('客户经理')">
<user-selector
manage
v-model="queryParams.salesmanIds"
multiple
clearable
@change="handleQuery"
:prepend="{ id: 0, nickname: $t('未分配客户经理') }"
/>
<user-selector manage v-model="queryParams.salesmanIds" multiple clearable @change="handleQuery" :prepend="{ id: 0, nickname: $t('未分配客户经理') }" />
</el-form-item>
<el-form-item :label="$t('动态')" prop="statusList">
<dict-selector
:type="DICT_TYPE.ORDER_STATUS"
multiple
v-model="queryParams.statusList"
@keyup.enter.native="handleQuery"
:filter="statusDictFilter"
clearable
@change="handleQuery"
/>
<dict-selector :type="DICT_TYPE.ORDER_STATUS" multiple v-model="queryParams.statusList" @keyup.enter.native="handleQuery" :filter="statusDictFilter" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('收货人')" v-show="showSearch">
<el-select
v-model="queryParams.hasConsignee"
:placeholder="$t('请选择')"
clearable
@change="handleQuery"
>
<el-select v-model="queryParams.hasConsignee" :placeholder="$t('请选择')" clearable @change="handleQuery">
<el-option :label="$t('有')" :value="true"></el-option>
<el-option :label="$t('无')" :value="false"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('报关方式')" prop="customsTypes" v-show="showSearch">
<dict-selector
:type="DICT_TYPE.ECW_CUSTOMS_TYPE"
multiple
v-model="queryParams.customsTypes"
clearable
@change="handleQuery"
/>
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" multiple v-model="queryParams.customsTypes" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('是否齐货')" v-show="showSearch">
<!--//字段存疑-->
<dict-selector
v-model="queryParams.isNeat"
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
fomatter="bool"
clearable
@change="handleQuery"
/>
<dict-selector v-model="queryParams.isNeat" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" clearable @change="handleQuery" />
</el-form-item>
<!-- <el-form-item :label="$t('重货比')" prop="weightRatio">
<el-input style="width: 100px;" v-model="molecule" placeholder="" clearable @change="moleculeChange"
......@@ -260,314 +105,133 @@
@keyup.enter.native="handleQuery" />
</el-form-item> -->
<el-form-item :label="$t('备案属性')" prop="productRecords" v-show="showSearch">
<dict-selector
:type="DICT_TYPE.PRODUCT_RECORD_ATTRIBUTE"
multiple
v-model="queryParams.productRecords"
clearable
@change="handleQuery"
/>
<dict-selector :type="DICT_TYPE.PRODUCT_RECORD_ATTRIBUTE" multiple v-model="queryParams.productRecords" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('快递单号')" prop="number" v-show="showSearch">
<el-input
v-model="queryParams.number"
:placeholder="$t('快递单号')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/\s+/g, '')"
/>
<el-input v-model="queryParams.number" :placeholder="$t('快递单号')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/\s+/g, '')" />
</el-form-item>
<el-form-item :label="$t('外部仓')" prop="isExternalWarehouse" v-show="showSearch">
<el-select
v-model="queryParams.isExternalWarehouse"
:placeholder="$t('请选择')"
clearable
@change="handleQuery"
>
<el-select v-model="queryParams.isExternalWarehouse" :placeholder="$t('请选择')" clearable @change="handleQuery">
<el-option :label="$t('外部仓')" value="true"></el-option>
<el-option :label="$t('自有仓')" value="false"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('异常状态')" prop="abnormalStateList" v-show="showSearch">
<dict-selector
:type="DICT_TYPE.ORDER_ABNORMAL_STATE"
multiple
v-model="queryParams.abnormalStateList"
@keyup.enter.native="handleQuery"
clearable
@change="handleQuery"
/>
<dict-selector :type="DICT_TYPE.ORDER_ABNORMAL_STATE" multiple v-model="queryParams.abnormalStateList" @keyup.enter.native="handleQuery" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('审核状态')" prop="auditTypeList" v-show="showSearch">
<dict-selector
:type="DICT_TYPE.ECW_ORDER_APPROVAL_TYPE"
multiple
v-model="queryParams.auditTypeList"
@keyup.enter.native="handleQuery"
clearable
@change="handleQuery"
/>
<dict-selector :type="DICT_TYPE.ECW_ORDER_APPROVAL_TYPE" multiple v-model="queryParams.auditTypeList" @keyup.enter.native="handleQuery" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('增值服务')" prop="types" v-show="showSearch">
<el-select
v-model="queryParams.types"
multiple
:placeholder="$t('请选择')"
clearable
@change="handleQuery"
>
<el-select v-model="queryParams.types" multiple :placeholder="$t('请选择')" clearable @change="handleQuery">
<el-option :label="$t('普通订单')" :value="0"></el-option>
<el-option :label="$t('集运服务')" :value="1"></el-option>
<el-option :label="$t('海外仓')" :value="2"></el-option>
</el-select>
</el-form-item>
<!--空运多一个出货渠道筛选-->
<el-form-item
:label="$t('出货渠道')"
prop="channelIds"
v-if="channelList.length"
>
<selector
:clearable="true"
:options="channelList"
:label-field="$l('name')"
value-field="channelId"
v-model="queryParams.channelIds"
multiple
></selector>
<el-form-item :label="$t('出货渠道')" prop="channelIds" v-if="channelList.length">
<selector :clearable="true" :options="channelList" :label-field="$l('name')" value-field="channelId" v-model="queryParams.channelIds" multiple></selector>
</el-form-item>
<el-form-item :label="$t('特需')" prop="packageType" v-show="showSearch">
<el-select
v-model="queryParams.packageTypeArr"
multiple
:placeholder="$t('请选择')"
clearable
>
<el-select v-model="queryParams.packageTypeArr" multiple :placeholder="$t('请选择')" clearable>
<template v-for="item in getDictDatas(DICT_TYPE.ORDER_SPECIAL_NEEDS)">
<el-option
:label="$l(item, 'label')"
:value="item.value"
></el-option>
<el-option :label="$l(item, 'label')" :value="item.value"></el-option>
</template>
</el-select>
</el-form-item>
<el-form-item :label="$t('提货状态')" v-show="showSearch">
<dict-selector
:type="DICT_TYPE.PICK_STATE"
multiple
v-model="queryParams.pickStateList"
clearable
@change="handleQuery"
/>
<dict-selector :type="DICT_TYPE.PICK_STATE" multiple v-model="queryParams.pickStateList" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('提货率')" v-show="showSearch">
<el-input
type="number"
v-model.trim="pickRatio.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
>
<el-input type="number" v-model.trim="pickRatio.value" :placeholder="$t('请输入数字')" clearable @keyup.enter.native="handleQuery">
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.PICK_RATIO_FIELD"
defaultable
v-model="pickRatio.key"
class="w-50"
/>
<dict-selector :type="DICT_TYPE.PICK_RATIO_FIELD" defaultable v-model="pickRatio.key" class="w-50" />
</template>
</el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
:loading="loading"
>{{ $t("搜索") }}</el-button
>
<el-button icon="el-icon-refresh" @click="resetQuery">{{
$t("重置")
}}</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleQuery" :loading="loading">{{ $t("搜索") }}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5" v-if="transportId">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['ecw:order:create']"
>{{ $t("新增") }}</el-button
>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ecw:order:create']">{{ $t("新增") }}</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-button type="primary" plain icon="el-icon-setting" size="mini" @click="handleEdit" :disabled="!batchWarehouseAdjustment">{{$t('批量调仓')}}-->
<!-- </el-button>-->
<el-button
type="primary"
v-hasPermi="['ecw:order:batch_release']"
plain
icon="el-icon-setting"
size="mini"
@click="showBatchPickup = true"
>{{ $t("批量提货") }}</el-button
>
<el-button type="primary" v-hasPermi="['ecw:order:batch_release']" plain icon="el-icon-setting" size="mini" @click="showBatchPickup = true">{{ $t("批量提货") }}</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
:loading="exportLoading" v-hasPermi="['ecw:order:export']">{{$t('导出')}}</el-button> -->
<el-dropdown
v-hasPermi="
isAll
? ['ecw:order:export', 'ecw:order:export:other']
: [exportPermiString]
"
>
<el-button type="primary" :loading="exportLoading" size="mini">
{{ $t("导出") }} <i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown v-hasPermi="isAll ? ['ecw:order:export', 'ecw:order:export:other'] : [exportPermiString]">
<el-button type="primary" :loading="exportLoading" size="mini"> {{ $t("导出") }} <i class="el-icon-arrow-down el-icon--right"></i> </el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-hasPermi="[exportPermiString]"
@click.native="exportChecked"
>{{ $t("导出勾选") }}</el-dropdown-item
>
<el-dropdown-item
v-hasPermi="[exportPermiString]"
@click.native="exportSearch"
>{{ $t("导出搜索") }}</el-dropdown-item
>
<el-dropdown-item v-hasPermi="[exportPermiString]" @click.native="exportChecked">{{ $t("导出勾选") }}</el-dropdown-item>
<el-dropdown-item v-hasPermi="[exportPermiString]" @click.native="exportSearch">{{ $t("导出搜索") }}</el-dropdown-item>
<template v-if="isAll">
<el-dropdown-item
hasPermi="[exportPermiString]"
@click.native="exportAbnormal"
>{{ $t("异常单统计") }}</el-dropdown-item
>
<el-dropdown-item
hasPermi="[exportPermiString]"
@click.native="exportHeavyOrder"
>{{ $t("重货单统计") }}</el-dropdown-item
>
<el-dropdown-item
hasPermi="[exportPermiString]"
@click.native="exportReturnOrder"
>{{ $t("退仓单统计") }}</el-dropdown-item
>
<el-dropdown-item
hasPermi="[exportPermiString]"
@click.native="exportSaleRepay"
>{{ $t("售后赔偿金额统计") }}</el-dropdown-item
>
<el-dropdown-item
hasPermi="[exportPermiString]"
@click.native="exportCustomsDatas"
>{{ $t("报关数据统计") }}</el-dropdown-item
>
<el-dropdown-item
hasPermi="[exportPermiString]"
@click.native="exportShippingDatas"
>{{ $t("客户出货量统计") }}</el-dropdown-item
>
<el-dropdown-item
hasPermi="[exportPermiString]"
@click.native="exportShipFee"
>{{ $t("预付运费统计") }}</el-dropdown-item
>
<el-dropdown-item hasPermi="[exportPermiString]" @click.native="exportAbnormal">{{ $t("异常单统计") }}</el-dropdown-item>
<el-dropdown-item hasPermi="[exportPermiString]" @click.native="exportHeavyOrder">{{ $t("重货单统计") }}</el-dropdown-item>
<el-dropdown-item hasPermi="[exportPermiString]" @click.native="exportReturnOrder">{{ $t("退仓单统计") }}</el-dropdown-item>
<el-dropdown-item hasPermi="[exportPermiString]" @click.native="exportSaleRepay">{{ $t("售后赔偿金额统计") }}</el-dropdown-item>
<el-dropdown-item hasPermi="[exportPermiString]" @click.native="exportCustomsDatas">{{ $t("报关数据统计") }}</el-dropdown-item>
<el-dropdown-item hasPermi="[exportPermiString]" @click.native="exportShippingDatas">{{ $t("客户出货量统计") }}</el-dropdown-item>
<el-dropdown-item hasPermi="[exportPermiString]" @click.native="exportShipFee">{{ $t("预付运费统计") }}</el-dropdown-item>
</template>
</el-dropdown-menu>
</el-dropdown>
</el-col>
<el-col :span="15" v-if="statistics">
<!-- 订单列表显示搜索条件对应箱数、仓库实测、收款方数、重量 -->
{{
$t(
"合计:{totalNum}箱,{totalVolume}m³(测) {totalChargeVolume}m³(重) {totalWeight}KG(测), {totalChargeWeight}kg(收费)",
statistics
)
}}
{{ $t("合计:{totalNum}箱,{totalVolume}m³(测) {totalChargeVolume}m³(重) {totalWeight}KG(测), {totalChargeWeight}kg(收费)", statistics) }}
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange"
>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column
:label="$t('订单编号')"
width="120px"
align="center"
prop="orderNo"
>
<el-table-column :label="$t('订单编号')" width="120px" align="center" prop="orderNo">
<template slot-scope="scope">
<router-link
:to="{
path: '/order/detail',
query: { orderId: scope.row.orderId },
query: { orderId: scope.row.orderId }
}"
class="link-type"
>
<span>{{ scope.row.orderNo }}</span>
</router-link>
<div
style="display: flex; flex-wrap: wrap"
v-if="scope.row.advanceType"
>
<el-button
@click="deleteSpecial(item.value, scope.row.orderId)"
size="mini"
style="margin-left: 20px"
type="danger"
circle
v-for="(item, index) in specialRendering(scope.row.advanceType)"
:key="index"
>{{ item.symbol }}</el-button
>
<div style="display: flex; flex-wrap: wrap" v-if="scope.row.advanceType">
<el-button @click="deleteSpecial(item.value, scope.row.orderId)" size="mini" style="margin-left: 20px" type="danger" circle v-for="(item, index) in specialRendering(scope.row.advanceType)" :key="index">{{ item.symbol }}</el-button>
</div>
</template>
</el-table-column>
<el-table-column :label="$t('发货人编号')" align="center">
<template slot-scope="{ row }">
<router-link :to="`/customer/query/${row.consignorCustomerId}`" class="link-type">
{{row.consignorCustomerNumber}}
{{ row.consignorCustomerNumber }}
</router-link>
</template>
</el-table-column>
<el-table-column :label="$t('收货人编号')" align="center" prop="consigneeCustomerNumber">
<template slot-scope="{ row }">
<router-link :to="`/customer/query/${row.consigneeCustomerId}`" class="link-type">
{{row.consigneeCustomerNumber}}
{{ row.consigneeCustomerNumber }}
</router-link>
</template>
</el-table-column>
<el-table-column
:label="$t('总箱数/入仓箱数')"
align="center"
prop="sumNum"
>
<el-table-column :label="$t('总箱数/入仓箱数')" align="center" prop="sumNum">
<template slot-scope="{ row }">
<div :style="{ color: row.customsType != 1 ? 'red' : null }">
{{ row.totalNum }}{{ $t("") }}/{{ row.sumNum }}{{ $t("") }}
</div>
<dict-tag
v-if="row.customsType != 1"
style="color: red"
:type="DICT_TYPE.ECW_CUSTOMS_TYPE"
:value="row.customsType"
></dict-tag>
<div :style="{ color: row.customsType != 1 ? 'red' : null }">{{ row.totalNum }}{{ $t("") }}/{{ row.sumNum }}{{ $t("") }}</div>
<dict-tag v-if="row.customsType != 1" style="color: red" :type="DICT_TYPE.ECW_CUSTOMS_TYPE" :value="row.customsType"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('体积/重量')" align="center" prop="sumWeight">
......@@ -577,14 +241,10 @@
:is="row.orderType > 1 ? 'el-tooltip' : 'div'"
class="item"
:style="{
color: row.orderType > 1 ? 'red' : null,
color: row.orderType > 1 ? 'red' : null
}"
effect="dark"
:content="
row.orderType === 2
? (row.wvolume || 0) + 'm³'
: (row.vweight || 0) + 'kg'
"
:content="row.orderType === 2 ? (row.wvolume || 0) + 'm³' : (row.vweight || 0) + 'kg'"
placement="bottom"
>
<!-- <div v-if="row.sumNum > 0">{{row.sumVolume}}m³ /{{row.sumWeight}}Kg</div>
......@@ -594,47 +254,28 @@
</template>
</el-table-column>
<el-table-column
:label="$t('始发仓')"
align="center"
prop="startWarehouseName"
>
<el-table-column :label="$t('始发仓')" align="center" prop="startWarehouseName">
<template slot-scope="{ row }">
{{ row.startWarehouseName }}
<span style="color: red" v-if="row.isExternalWarehouse"
>({{ $t("外部仓") }})</span
>
<span style="color: red" v-if="row.isExternalWarehouse">({{ $t("外部仓") }})</span>
</template>
</el-table-column>
<el-table-column
:label="$t('运输方式-渠道/目的地')"
align="center"
prop="transportId"
>
<el-table-column :label="$t('运输方式-渠道/目的地')" align="center" prop="transportId">
<template slot-scope="{ row }">
<dict-tag
:type="DICT_TYPE.ECW_TRANSPORT_TYPE"
:value="row.transportId"
/>
<template v-if="row.channelName">
- {{row.channelName}}
</template>
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportId" />
<template v-if="row.channelName"> - {{ row.channelName }} </template>
/ {{ row.dstWarehouseName }}
</template>
</el-table-column>
<el-table-column :label="$t('控货')" align="center" prop="transportId">
<template slot-scope="{ row }">
<dict-tag
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
:value="row.isCargoControl"
/>
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="row.isCargoControl" />
</template>
</el-table-column>
<el-table-column :label="$t('增值服务')" align="center" prop="status">
<template slot-scope="{row}">
{{ getTypeText(row.type)}}
<template slot-scope="{ row }">
{{ getTypeText(row.type) }}
</template>
</el-table-column>
<el-table-column :label="$t('状态')" align="center" prop="status">
......@@ -648,27 +289,15 @@
<el-table-column :label="$t('发货人客服')" align="center" prop="consignorFollowCustomerService" />
<el-table-column :label="$t('收货人客服')" align="center" prop="consigneeFollowCustomerService" />
<el-table-column :label="$t('到仓箱数/方数重量')" align="center" prop="status">
<template slot-scope="scope">
暂无数据
</template>
<template slot-scope="scope"> 暂无数据 </template>
</el-table-column>
<el-table-column :label="$t('提货率')" align="center" prop="pickRatio" />
<el-table-column :label="$t('动态')" align="center" prop="statusMsg" />
<el-table-column
:label="$t('操作')"
align="center"
class-name="small-padding fixed-width actions"
width="180px"
>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width actions" width="180px">
<template slot-scope="scope">
<!-- 已删除的订单只需要删除和查看 https://zentao.jdshangmen.com/bug-view-684.html -->
<template v-if="scope.row.status == 88">
<el-button
type="text"
@click.native="oprateOrder(scope.row.orderId, 'deleteOrder')"
v-hasPermi="['ecw:order:delete']"
>{{ $t("删除") }}</el-button
>
<el-button type="text" @click.native="oprateOrder(scope.row.orderId, 'deleteOrder')" v-hasPermi="['ecw:order:delete']">{{ $t("删除") }}</el-button>
</template>
<template v-else>
<!--操作相关的-->
......@@ -693,7 +322,7 @@
'ecw:order:commission',
'ecw:order:heavy',
'ecw:order:bulky',
'ecw:order:setCanNotShipment',
'ecw:order:setCanNotShipment'
]"
>
<el-button type="text">{{ $t("操作") }}</el-button>
......@@ -728,39 +357,21 @@
<!-- 删除 -->
<template v-if="include(scope.row.status, [0, 2, 88])">
<el-dropdown-item
@click.native="
oprateOrder(scope.row.orderId, 'deleteOrder')
"
v-hasPermi="['ecw:order:delete']"
>{{ $t("删除") }}</el-dropdown-item
>
<el-dropdown-item @click.native="oprateOrder(scope.row.orderId, 'deleteOrder')" v-hasPermi="['ecw:order:delete']">{{ $t("删除") }}</el-dropdown-item>
</template>
<!-- 取消 -->
<template v-if="include(scope.row.status, [2])">
<el-dropdown-item
@click.native="
oprateOrder(scope.row.orderId, 'cancelOrder')
"
v-hasPermi="['ecw:order:cancel']"
>{{ $t("取消订单") }}</el-dropdown-item
>
<el-dropdown-item @click.native="oprateOrder(scope.row.orderId, 'cancelOrder')" v-hasPermi="['ecw:order:cancel']">{{ $t("取消订单") }}</el-dropdown-item>
</template>
<!-- <el-dropdown-item @click.native="oprateOrder(scope.row.orderId, 'recoveryOrder')" >{{$t('恢复订单')}}</el-dropdown-item>-->
<!-- 费用申请 -->
<template
v-if="
exclude(scope.row.status, [0, 88]) &&
exclude(scope.row.inWarehouseState, [204, 205, 206]) &&
exclude(scope.row.abnormalState, [1])
"
>
<template v-if="exclude(scope.row.status, [0, 88]) && exclude(scope.row.inWarehouseState, [204, 205, 206]) && exclude(scope.row.abnormalState, [1])">
<el-dropdown-item
@click.native="
feeApplicationBol = true;
orderId = scope.row.orderId;
feeApplicationBol = true
orderId = scope.row.orderId
"
v-hasPermi="['ecw:order:fee_apply']"
>{{ $t("费用申请") }}</el-dropdown-item
......@@ -768,305 +379,98 @@
</template>
<!-- 特需,互斥,关联 -->
<template
v-if="
include(scope.row.status, [2, 3, 5, 8, 9, 10]) &&
exclude(
scope.row.abnormalState,
[1, 99, 2, 3, 4, 9, 10, 11, 12, 14]
) &&
exclude(scope.row.inWarehouseState, [204])
"
>
<template v-if="include(scope.row.status, [2, 3, 5, 8, 9, 10]) && exclude(scope.row.abnormalState, [1, 99, 2, 3, 4, 9, 10, 11, 12, 14]) && exclude(scope.row.inWarehouseState, [204])">
<el-dropdown-item
@click.native="
orderId = scope.row.orderId;
orderNo = scope.row.orderNo;
isShow = true;
orderId = scope.row.orderId
orderNo = scope.row.orderNo
isShow = true
"
v-hasPermi="['ecw:order:special']"
>{{ $t("特需") }}</el-dropdown-item
>
<el-dropdown-item
@click.native="
$router.push(
`/order/associated-order/${scope.row.orderId}`
)
"
v-hasPermi="['ecw:order:associate']"
>{{ $t("关联") }}</el-dropdown-item
>
<el-dropdown-item
@click.native="
$router.push(`/order/mutex-order/${scope.row.orderId}`)
"
v-hasPermi="['ecw:order:mutex']"
>{{ $t("互斥") }}</el-dropdown-item
>
<el-dropdown-item @click.native="$router.push(`/order/associated-order/${scope.row.orderId}`)" v-hasPermi="['ecw:order:associate']">{{ $t("关联") }}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push(`/order/mutex-order/${scope.row.orderId}`)" v-hasPermi="['ecw:order:mutex']">{{ $t("互斥") }}</el-dropdown-item>
</template>
<!-- 特价 -->
<template
v-if="
exclude(scope.row.status, [0]) &&
exclude(scope.row.abnormalState, [1]) &&
exclude(scope.row.inWarehouseState, [204, 205, 206])
"
>
<template v-if="exclude(scope.row.status, [0]) && exclude(scope.row.abnormalState, [1]) && exclude(scope.row.inWarehouseState, [204, 205, 206])">
<!-- 特价里有多个操作,只要有其一权限就显示此菜单 -->
<el-dropdown-item
@click.native="
$router.push('/order/special/' + scope.row.orderId)
"
v-hasPermi="[
'ecw:order:discount',
'ecw:order:reduce',
'ecw:order:commission',
'ecw:order:heavy',
'ecw:order:bulky',
]"
>{{ $t("特价") }}</el-dropdown-item
>
<el-dropdown-item @click.native="$router.push('/order/special/' + scope.row.orderId)" v-hasPermi="['ecw:order:discount', 'ecw:order:reduce', 'ecw:order:commission', 'ecw:order:heavy', 'ecw:order:bulky']">{{ $t("特价") }}</el-dropdown-item>
</template>
<!-- 确认提货 -->
<template
v-if="
scope.row.status >= 5 &&
exclude(
scope.row.inWarehouseState,
[1, 99, 2, 3, 4, 9, 10, 11, 12, 14]
) &&
exclude(scope.row.inWarehouseState, [204, 205, 206]) &&
exclude(scope.row.abnormalState, [1])
"
>
<el-dropdown-item
@click.native="
$router.push(
`/order/release?orderId=${scope.row.orderId}`
)
"
v-hasPermi="['ecw:order:release']"
>{{ $t("确认提货") }}</el-dropdown-item
>
<template v-if="scope.row.status >= 5 && exclude(scope.row.inWarehouseState, [1, 99, 2, 3, 4, 9, 10, 11, 12, 14]) && exclude(scope.row.inWarehouseState, [204, 205, 206]) && exclude(scope.row.abnormalState, [1])">
<el-dropdown-item @click.native="$router.push(`/order/release?orderId=${scope.row.orderId}`)" v-hasPermi="['ecw:order:release']">{{ $t("确认提货") }}</el-dropdown-item>
</template>
<!-- 合单,拆单 -->
<!--可出后不显示拆单(经确认合单也不显示) https://zentao.test.jdshangmen.com/bug-view-5322.html-->
<template
v-if="
([3, 4].indexOf(scope.row.transportId) < 0 ||
scope.row.airShipment < 2) &&
(scope.row.status < 12 ||
(scope.row.status == 12 &&
scope.row.shipmentState == 314)) &&
!scope.row.abnormalState &&
scope.row.status > 3 &&
exclude(
scope.row.inWarehouseState,
[204, 205, 206, 212, 213]
)
"
>
<el-dropdown-item
@click.native="
$router.push(
`/order/singleApply?orderNo=${scope.row.orderNo}`
)
"
v-hasPermi="['ecw:order:merge']"
>{{ $t("合单申请") }}</el-dropdown-item
>
<template v-if="([3, 4].indexOf(scope.row.transportId) < 0 || scope.row.airShipment < 2) && (scope.row.status < 12 || (scope.row.status == 12 && scope.row.shipmentState == 314)) && !scope.row.abnormalState && scope.row.status > 3 && exclude(scope.row.inWarehouseState, [204, 205, 206, 212, 213])">
<el-dropdown-item @click.native="$router.push(`/order/singleApply?orderNo=${scope.row.orderNo}`)" v-hasPermi="['ecw:order:merge']">{{ $t("合单申请") }}</el-dropdown-item>
<el-dropdown-item
@click.native="
$router.push(
`/order/splitApply?orderId=${scope.row.orderId}`
)
"
v-hasPermi="['ecw:order:split']"
>{{ $t("拆单申请") }}</el-dropdown-item
>
<el-dropdown-item @click.native="$router.push(`/order/splitApply?orderId=${scope.row.orderId}`)" v-hasPermi="['ecw:order:split']">{{ $t("拆单申请") }}</el-dropdown-item>
</template>
<!--撤销拆单,拆单的子订单,预装前显示,预装后变灰不可点击-->
<template
v-if="scope.row.parentOrderId && scope.row.status < 11"
>
<el-dropdown-item
@click.native="splitRevoke(scope.row)"
v-hasPermi="['ecw:order:split_revoke']"
>{{ $t("撤销拆单") }}</el-dropdown-item
>
<template v-if="scope.row.parentOrderId && scope.row.status < 11">
<el-dropdown-item @click.native="splitRevoke(scope.row)" v-hasPermi="['ecw:order:split_revoke']">{{ $t("撤销拆单") }}</el-dropdown-item>
</template>
<template v-if="scope.row.parentOrderId">
<el-dropdown-item
@click.native="showParentOrder(scope.row)"
>{{ $t("查看母订单") }}</el-dropdown-item
>
<el-dropdown-item @click.native="showParentOrder(scope.row)">{{ $t("查看母订单") }}</el-dropdown-item>
</template>
<!-- 合单日志,提货日志 -->
<template v-if="scope.row.status > 2">
<el-dropdown-item
@click.native="showMergedLogOrderNo = scope.row.orderNo"
v-hasPermi="['ecw:order:merge_log']"
>{{ $t("合单日志") }}</el-dropdown-item
>
<el-dropdown-item
@click.native="showPickupLogOrderNo = scope.row.orderNo"
v-hasPermi="['ecw:order:split_log']"
>{{ $t("提货日志") }}</el-dropdown-item
>
<el-dropdown-item @click.native="showMergedLogOrderNo = scope.row.orderNo" v-hasPermi="['ecw:order:merge_log']">{{ $t("合单日志") }}</el-dropdown-item>
<el-dropdown-item @click.native="showPickupLogOrderNo = scope.row.orderNo" v-hasPermi="['ecw:order:split_log']">{{ $t("提货日志") }}</el-dropdown-item>
</template>
<!--变更出货渠道-->
<template v-if="scope.row.transportId == 3">
<el-dropdown-item
@click.native="handleUpdate(scope.row, true)"
v-hasPermi="['ecw:order:update_channel']"
>{{ $t("变更出货渠道") }}</el-dropdown-item
>
<el-dropdown-item @click.native="handleUpdate(scope.row, true)" v-hasPermi="['ecw:order:update_channel']">{{ $t("变更出货渠道") }}</el-dropdown-item>
</template>
<!--不可出-->
<template
v-if="
include(scope.row.airShipment, [2, 3, 4]) &&
scope.row.status < 11
"
>
<el-dropdown-item
@click.native="setCanNotShipment(scope.row)"
v-hasPermi="['ecw:order:setCanNotShipment']"
>{{ $t("不可出") }}</el-dropdown-item
>
<template v-if="include(scope.row.airShipment, [2, 3, 4]) && scope.row.status < 11">
<el-dropdown-item @click.native="setCanNotShipment(scope.row)" v-hasPermi="['ecw:order:setCanNotShipment']">{{ $t("不可出") }}</el-dropdown-item>
</template>
<!--转异-->
<el-dropdown-item
@click.native="handleException(scope.row)"
v-hasPermi="['ecw:order:turnException']"
>{{ $t("转异") }}</el-dropdown-item
>
<el-dropdown-item @click.native="handleException(scope.row)" v-hasPermi="['ecw:order:turnException']">{{ $t("转异") }}</el-dropdown-item>
<template
v-if="scope.row.abnormalState != 0"
>
<el-dropdown-item
@click.native="openException(scope.row)"
>{{ $t("查看异常") }}</el-dropdown-item
>
<el-dropdown-item
@click.native="openException(scope.row)"
>{{ $t("处理异常") }}</el-dropdown-item
>
<template v-if="scope.row.abnormalState != 0">
<el-dropdown-item @click.native="openException(scope.row)">{{ $t("查看异常") }}</el-dropdown-item>
<el-dropdown-item @click.native="openException(scope.row)">{{ $t("处理异常") }}</el-dropdown-item>
</template>
</el-dropdown-menu>
</el-dropdown>
<template
v-if="
exclude(
scope.row.status,
[0, 11, 12, 13, 14, 15, 17, 18, 32]
) && exclude(scope.row.inWarehouseState, [204, 205, 206])
"
>
<template v-if="exclude(scope.row.status, [0, 11, 12, 13, 14, 15, 17, 18, 32]) && exclude(scope.row.inWarehouseState, [204, 205, 206])">
<!-- <el-divider direction="vertical"></el-divider> -->
<!--仓库相关的-->
<el-dropdown
v-hasPermi="[
'ecw:order:warehouse_add',
'ecw:order:warehouse_update',
'ecw:order:warehouse_exit',
'ecw:order:warehouse_adjustment',
'ecw:order:warehouse_transfer',
'ecw:order:warehouse_arrive',
'ecw:order:stocking',
]"
>
<el-dropdown v-hasPermi="['ecw:order:warehouse_add', 'ecw:order:warehouse_update', 'ecw:order:warehouse_exit', 'ecw:order:warehouse_adjustment', 'ecw:order:warehouse_transfer', 'ecw:order:warehouse_arrive', 'ecw:order:stocking']">
<el-button type="text">{{ $t("仓库") }}</el-button>
<el-dropdown-menu slot="dropdown">
<!-- 入仓操作 -->
<template
v-if="
include(scope.row.status, [0, 2]) ||
scope.row.inWarehouseState == 208
"
>
<el-dropdown-item
@click.native="
$router.push(
'/order/warehousing?id=' + scope.row.orderId
)
"
v-hasPermi="['ecw:order:warehouse_add']"
>{{ $t("入仓操作") }}</el-dropdown-item
>
<template v-if="include(scope.row.status, [0, 2]) || scope.row.inWarehouseState == 208">
<el-dropdown-item @click.native="$router.push('/order/warehousing?id=' + scope.row.orderId)" v-hasPermi="['ecw:order:warehouse_add']">{{ $t("入仓操作") }}</el-dropdown-item>
</template>
<!-- 入仓补充 -->
<template
v-if="
include(
scope.row.inWarehouseState,
[201, 202, 202, 210, 202, 211, 202, 214, 215, 216]
) && include(scope.row.status, [2, 3, 5, 10, 9, 8])
"
>
<el-dropdown-item
@click.native="
$router.push(
'/order/warehousing-add?id=' + scope.row.orderId
)
"
v-hasPermi="['ecw:order:warehouse_replenish']"
>{{ $t("入仓补充") }}</el-dropdown-item
>
<template v-if="include(scope.row.inWarehouseState, [201, 202, 202, 210, 202, 211, 202, 214, 215, 216]) && include(scope.row.status, [2, 3, 5, 10, 9, 8])">
<el-dropdown-item @click.native="$router.push('/order/warehousing-add?id=' + scope.row.orderId)" v-hasPermi="['ecw:order:warehouse_replenish']">{{ $t("入仓补充") }}</el-dropdown-item>
</template>
<!-- 入仓修改 -->
<template
v-if="
include(
scope.row.inWarehouseState,
[
201, 202, 207, 202, 209, 210, 202, 211, 202, 214, 215,
216, 204, 205,
]
) &&
scope.row.status != 11 &&
exclude(scope.row.shipmentState, [314, 315, 317, 318])
"
>
<el-dropdown-item
@click.native="
$router.push(
'/order/warehousing-update?id=' + scope.row.orderId
)
"
v-hasPermi="['ecw:order:warehouse_update']"
:disabled2="scope.row.parentOrderId"
>{{ $t("入仓修改") }}</el-dropdown-item
>
<template v-if="include(scope.row.inWarehouseState, [201, 202, 207, 202, 209, 210, 202, 211, 202, 214, 215, 216, 204, 205]) && scope.row.status != 11 && exclude(scope.row.shipmentState, [314, 315, 317, 318])">
<el-dropdown-item @click.native="$router.push('/order/warehousing-update?id=' + scope.row.orderId)" v-hasPermi="['ecw:order:warehouse_update']" :disabled2="scope.row.parentOrderId">{{ $t("入仓修改") }}</el-dropdown-item>
</template>
<!-- 退仓 -->
<template
v-if="
(include(
scope.row.inWarehouseState,
[202, 210, 211, 214, 215, 216]
) &&
exclude(scope.row.abnormalState, [1])) ||
include(scope.row.status, [16])
"
>
<template v-if="(include(scope.row.inWarehouseState, [202, 210, 211, 214, 215, 216]) && exclude(scope.row.abnormalState, [1])) || include(scope.row.status, [16])">
<el-dropdown-item
@click.native="
show = true;
orderId = scope.row.orderId;
show = true
orderId = scope.row.orderId
"
v-hasPermi="['ecw:order:warehouse_exit']"
>{{ $t("退仓") }}</el-dropdown-item
......@@ -1074,24 +478,11 @@
</template>
<!-- 调仓 -->
<template
v-if="
(include(
scope.row.inWarehouseState,
[202, 207, 209, 210, 202, 211, 212, 215, 216, 218]
) ||
(include(scope.row.status, [16]) &&
exclude(scope.row.inWarehouseState, [213, 214]))) &&
exclude(
scope.row.abnormalState,
[1, 99, 2, 3, 4, 9, 10, 11, 12, 14]
)
"
>
<template v-if="(include(scope.row.inWarehouseState, [202, 207, 209, 210, 202, 211, 212, 215, 216, 218]) || (include(scope.row.status, [16]) && exclude(scope.row.inWarehouseState, [213, 214]))) && exclude(scope.row.abnormalState, [1, 99, 2, 3, 4, 9, 10, 11, 12, 14])">
<el-dropdown-item
@click.native="
orderId = scope.row.orderId;
warehouseBol = true;
orderId = scope.row.orderId
warehouseBol = true
"
v-hasPermi="['ecw:order:warehouse_adjustment']"
>{{ $t("调仓") }}</el-dropdown-item
......@@ -1110,11 +501,7 @@
<el-dropdown-item
@click.native="
$router.push({
path:
'/order/transfer-warehousing/' +
scope.row.orderId +
'/' +
1,
path: '/order/transfer-warehousing/' + scope.row.orderId + '/' + 1
})
"
v-hasPermi="['ecw:order:warehouse_transfer']"
......@@ -1127,11 +514,7 @@
<el-dropdown-item
@click.native="
$router.push({
path:
'/order/transfer-to-warehouse/' +
scope.row.orderId +
'/' +
2,
path: '/order/transfer-to-warehouse/' + scope.row.orderId + '/' + 2
})
"
v-hasPermi="['ecw:order:warehouse_arrive']"
......@@ -1141,16 +524,11 @@
<!--开始备货-->
<!--需要异常处理后才能备货 https://zentao.test.jdshangmen.com/bug-view-4736.html-->
<template
v-if="
include(scope.row.airShipment, [2]) &&
scope.row.abnormalState === 0
"
>
<template v-if="include(scope.row.airShipment, [2]) && scope.row.abnormalState === 0">
<el-dropdown-item
@click.native="
$router.push({
path: '/order/stocking?id=' + scope.row.orderId,
path: '/order/stocking?id=' + scope.row.orderId
})
"
v-hasPermi="['ecw:order:stocking']"
......@@ -1158,19 +536,11 @@
>
</template>
<!--修改备货-->
<template
v-if="
include(scope.row.airShipment, [3, 4, 10]) &&
scope.row.abnormalState === 0 &&
scope.row.status <= 5
"
>
<template v-if="include(scope.row.airShipment, [3, 4, 10]) && scope.row.abnormalState === 0 && scope.row.status <= 5">
<el-dropdown-item
@click.native="
$router.push({
path:
'/order/stocking?action=update&id=' +
scope.row.orderId,
path: '/order/stocking?action=update&id=' + scope.row.orderId
})
"
v-hasPermi="['ecw:order:stocking_update']"
......@@ -1183,202 +553,81 @@
<!-- <el-divider direction="vertical" v-if="scope.row.status != 0"></el-divider> -->
<!--打印相关的-->
<el-dropdown
v-if="scope.row.status != 0"
v-hasPermi="[
'ecw:order:print_tag',
'ecw:order:warehouse_receipt',
'ecw:order:landing_bill',
]"
>
<el-dropdown v-if="scope.row.status != 0" v-hasPermi="['ecw:order:print_tag', 'ecw:order:warehouse_receipt', 'ecw:order:landing_bill']">
<el-button type="text">{{ $t("打印") }}</el-button>
<el-dropdown-menu slot="dropdown">
<!-- 打印标签 -->
<template
v-if="
exclude(scope.row.status, [0]) &&
exclude(scope.row.abnormalState, [5, 6, 7, 8])
"
>
<el-dropdown-item
@click.native="printTag(scope.row)"
v-hasPermi="['ecw:order:print_tag']"
>{{ $t("打印标签") }}</el-dropdown-item
>
<template v-if="exclude(scope.row.status, [0]) && exclude(scope.row.abnormalState, [5, 6, 7, 8])">
<el-dropdown-item @click.native="printTag(scope.row)" v-hasPermi="['ecw:order:print_tag']">{{ $t("打印标签") }}</el-dropdown-item>
</template>
<!-- 打印入仓单 -->
<template
v-if="
exclude(scope.row.status, [0, 2]) &&
exclude(scope.row.abnormalState, [5, 6, 7, 8])
"
>
<el-dropdown-item
@click.native="
printWarehouseReceiptOrderId = scope.row.orderId
"
v-hasPermi="['ecw:order:warehouse_receipt']"
>{{ $t("打印入仓单") }}</el-dropdown-item
>
<template v-if="exclude(scope.row.status, [0, 2]) && exclude(scope.row.abnormalState, [5, 6, 7, 8])">
<el-dropdown-item @click.native="printWarehouseReceiptOrderId = scope.row.orderId" v-hasPermi="['ecw:order:warehouse_receipt']">{{ $t("打印入仓单") }}</el-dropdown-item>
</template>
<!-- 打印提单 -->
<el-dropdown-item
@click.native="printLadingBillOrderId = scope.row.orderId"
:disabled="!scope.row.tidanNo"
v-hasPermi="['ecw:order:landing_bill']"
>{{ $t("打印提单") }}</el-dropdown-item
>
<el-dropdown-item @click.native="printLadingBillOrderId = scope.row.orderId" :disabled="!scope.row.tidanNo" v-hasPermi="['ecw:order:landing_bill']">{{ $t("打印提单") }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="text" @click="handleCopyOrder(scope.row.orderId)">{{$t('复制')}}</el-button>
<el-button type="text" @click="handleCopyOrder(scope.row.orderId)">{{ $t("复制") }}</el-button>
</template>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
<special-needs
:orderNo="orderNo"
:show.sync="isShow"
:currency="JSON.stringify(currencyList)"
:order-id="orderId"
@determine="getList"
></special-needs>
<print-tag
v-if="printTagOrderId !== null"
:order-id="printTagOrderId"
@close="printTagOrderId = null"
:warehouse-in-num="printTagWarehouseInNum"
/>
<print-warehouse-receipt
v-if="printWarehouseReceiptOrderId !== null"
:order-id="printWarehouseReceiptOrderId"
@close="printWarehouseReceiptOrderId = null"
/>
<print-lading-bill
v-if="printLadingBillOrderId !== null"
:order-id="printLadingBillOrderId"
@close="printLadingBillOrderId = null"
/>
<batch-pickup
v-if="showBatchPickup"
@close="onBatchClose"
@success="onBatchClose"
/>
<withdrawal
v-if="show"
:dialog-visible="show"
:orderId="orderId"
></withdrawal>
<batch-single-application
@getList="getList"
:order-list="orderId"
:dialog-visible.sync="warehouseBol"
></batch-single-application>
<fee-application
v-if="feeApplicationBol"
:order-id="orderId"
:currencys="JSON.stringify(currencyList)"
:dialog-visible.sync="feeApplicationBol"
></fee-application>
<merge-log
:order-no="showMergedLogOrderNo"
v-if="showMergedLogOrderNo !== null"
@close="showMergedLogOrderNo = null"
/>
<pickup-log
v-if="showPickupLogOrderNo"
:order-no="showPickupLogOrderNo"
@close="showPickupLogOrderNo = null"
@delete="getList"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getList" />
<special-needs :orderNo="orderNo" :show.sync="isShow" :currency="JSON.stringify(currencyList)" :order-id="orderId" @determine="getList"></special-needs>
<print-tag v-if="printTagOrderId !== null" :order-id="printTagOrderId" @close="printTagOrderId = null" :warehouse-in-num="printTagWarehouseInNum" />
<print-warehouse-receipt v-if="printWarehouseReceiptOrderId !== null" :order-id="printWarehouseReceiptOrderId" @close="printWarehouseReceiptOrderId = null" />
<print-lading-bill v-if="printLadingBillOrderId !== null" :order-id="printLadingBillOrderId" @close="printLadingBillOrderId = null" />
<batch-pickup v-if="showBatchPickup" @close="onBatchClose" @success="onBatchClose" />
<withdrawal v-if="show" :dialog-visible="show" :orderId="orderId"></withdrawal>
<batch-single-application @getList="getList" :order-list="orderId" :dialog-visible.sync="warehouseBol"></batch-single-application>
<fee-application v-if="feeApplicationBol" :order-id="orderId" :currencys="JSON.stringify(currencyList)" :dialog-visible.sync="feeApplicationBol"></fee-application>
<merge-log :order-no="showMergedLogOrderNo" v-if="showMergedLogOrderNo !== null" @close="showMergedLogOrderNo = null" />
<pickup-log v-if="showPickupLogOrderNo" :order-no="showPickupLogOrderNo" @close="showPickupLogOrderNo = null" @delete="getList" />
<SplitRevoke
v-if="splitRevokeOrderId"
:order-id="splitRevokeOrderId"
@close="
splitRevokeOrderId = null;
getList();
splitRevokeOrderId = null
getList()
"
></SplitRevoke>
<turn-exception
v-if="!!tureExceptionOrder"
ref="turnException"
:order-no="tureExceptionOrder.orderNo"
:order-id="tureExceptionOrder.orderId"
@done="handleTurnExceptionDone"
@cancel="handleExceptionClose"></turn-exception>
<turn-exception v-if="!!tureExceptionOrder" ref="turnException" :order-no="tureExceptionOrder.orderNo" :order-id="tureExceptionOrder.orderId" @done="handleTurnExceptionDone" @cancel="handleExceptionClose"></turn-exception>
</div>
</template>
<script>
//图片上传组件 lanbm 2024-06-19 add
import imageUpload from "@/components/ImageUpload";
import Selector from "@/components/Selector";
import ProductSelector from "@/components/ProductSelector";
import { getProductAttrList } from "@/api/ecw/productAttr";
import CustomerSelector from "@/components/CustomerSelector";
import specialNeeds from "@/views/ecw/order/components/specialNeeds";
import {
createOrder,
updateOrder,
deleteOrder,
getOrder,
getOrderPage,
exportOrderExcel,
orderSpecialNeed,
cancelOrder,
recoveryOrder,
getMyOrderPage,
deptOrderPage,
orderStatistics,
orderMyStatistics,
orderDeptStatistics,
orderExportSearch,
orderExportMySearch,
orderExportDeptSearch,
exportAbnormal,
exportHeavyOrder,
exportReturnOrder,
exportSaleRepay,
exportCustomsDatas,
exportShippingDatas,
exportShipFee,
exportUnload,
splitCancelApply,
orderSplitRevoke,
setCanShipment,
setCanNotShipment,
getParentOrder,
getRegionList, copyOrder
} from '@/api/ecw/order'
import imageUpload from "@/components/ImageUpload"
import Selector from "@/components/Selector"
import ProductSelector from "@/components/ProductSelector"
import { getProductAttrList } from "@/api/ecw/productAttr"
import CustomerSelector from "@/components/CustomerSelector"
import specialNeeds from "@/views/ecw/order/components/specialNeeds"
import { createOrder, updateOrder, deleteOrder, getOrder, getOrderPage, exportOrderExcel, orderSpecialNeed, cancelOrder, recoveryOrder, getMyOrderPage, deptOrderPage, orderStatistics, orderMyStatistics, orderDeptStatistics, orderExportSearch, orderExportMySearch, orderExportDeptSearch, exportAbnormal, exportHeavyOrder, exportReturnOrder, exportSaleRepay, exportCustomsDatas, exportShippingDatas, exportShipFee, exportUnload, splitCancelApply, orderSplitRevoke, setCanShipment, setCanNotShipment, getParentOrder, getRegionList, copyOrder } from "@/api/ecw/order"
/* import { getDictDatas, DICT_TYPE } from '@/utils/dict'; */
import PrintTag from "./components/PrintTag";
import PrintWarehouseReceipt from "./components/PrintWarehouseReceipt";
import PrintLadingBill from "./components/PrintLadingBill";
import BatchPickup from "./components/BatchPickup";
import withdrawal from "@/views/ecw/order/withdrawal";
import UserSelector from "@/components/UserSelector";
import BatchSingleApplication from "@/views/ecw/order/batchSingleApplication";
import FeeApplication from "@/views/ecw/order/feeApplication";
import MergeLog from "@/views/ecw/order/components/MergeLog";
import PickupLog from "./components/PickupLog";
import { getWarehouseList } from "@/api/ecw/warehouse";
import { getCurrencyPage } from "@/api/ecw/currency";
import SplitRevoke from "@/views/ecw/order/components/SplitRevoke";
import { getChannelList } from "@/api/ecw/channel";
import Template from "@/views/cms/template/index.vue";
import { getDictDatas } from "@/utils/dict";
import TurnException from '@/views/ecw/order/components/TurnException.vue'
import PrintTag from "./components/PrintTag"
import PrintWarehouseReceipt from "./components/PrintWarehouseReceipt"
import PrintLadingBill from "./components/PrintLadingBill"
import BatchPickup from "./components/BatchPickup"
import withdrawal from "@/views/ecw/order/withdrawal"
import UserSelector from "@/components/UserSelector"
import BatchSingleApplication from "@/views/ecw/order/batchSingleApplication"
import FeeApplication from "@/views/ecw/order/feeApplication"
import MergeLog from "@/views/ecw/order/components/MergeLog"
import PickupLog from "./components/PickupLog"
import { getWarehouseList } from "@/api/ecw/warehouse"
import { getCurrencyPage } from "@/api/ecw/currency"
import SplitRevoke from "@/views/ecw/order/components/SplitRevoke"
import { getChannelList } from "@/api/ecw/channel"
import Template from "@/views/cms/template/index.vue"
import { getDictDatas } from "@/utils/dict"
import TurnException from "@/views/ecw/order/components/TurnException.vue"
export default {
name: "EcwOrderIndex",
components: {
......@@ -1399,11 +648,11 @@ export default {
PrintLadingBill,
BatchPickup,
withdrawal,
imageUpload, //图片上传组件
imageUpload //图片上传组件
},
props: {
mine: Boolean, // 标识我的订单列表
dept: Boolean, // 标识部门订单列表
dept: Boolean // 标识部门订单列表
},
data() {
return {
......@@ -1445,7 +694,7 @@ export default {
rows: 10,
packageTypeArr: [],
channelIds: [],
goodsTypes:[]
goodsTypes: []
},
warehouseList: [],
//tradeCityList: [],
......@@ -1475,7 +724,7 @@ export default {
orderNo: "",
params: {
page: 1,
rows: 20,
rows: 20
},
currencyList: [],
statistics: null, // 统计数据
......@@ -1486,24 +735,24 @@ export default {
// 编号搜索条件
noParam: {
key: "numberKey",
value: "",
value: ""
},
// 商品搜索条件
prodParam: {
key: "prodKey",
value: "",
value: ""
},
// 当前操作转异的订单
tureExceptionOrder: null,
pickRatio: {
key: "eqPickRatio",
value: "",
value: ""
}
}
};
},
watch: {
isChinese() {
this.getList();
this.getList()
},
// provinceCode destCountryId
......@@ -1512,46 +761,42 @@ export default {
deep: true, //深度监听
handler() {
//每当值省份值改变时其下地区值进行清空
this.AddressCity = [];
this.AddressTown = [];
this.objectiveId = "";
this.destWarehouseId = "";
this.findByprovinceCode();
this.AddressCity = []
this.AddressTown = []
this.objectiveId = ""
this.destWarehouseId = ""
this.findByprovinceCode()
if (this.destCountryId == "") {
getRegionList(4, 4)
.then(({ data }) => {
this.AddressCity = data;
this.AddressCity = data
})
.catch((error) => {
console.log(error);
});
console.log(error)
})
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
this.AddressTown = data
})
.catch((error) => {
console.log(error);
});
} else if (
this.destCountryId != "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
console.log(error)
})
} else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data;
this.AddressCity = data
})
.catch((error) => {
console.log(error);
});
console.log(error)
})
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
this.AddressTown = data
})
.catch((error) => {
console.log(error);
});
console.log(error)
})
}
//重新加载目的城市
//目的城市
......@@ -1569,59 +814,47 @@ export default {
// .catch(error => {
// console.log(error);
// });
},
}
},
objectiveId: {
deep: true, //深度监听
handler() {
this.AddressTown = [];
this.destWarehouseId = "";
this.findBycityCode();
if (
this.objectiveId != "" &&
this.destCountryId != "" &&
this.destWarehouseId == ""
) {
this.AddressTown = []
this.destWarehouseId = ""
this.findBycityCode()
if (this.objectiveId != "" && this.destCountryId != "" && this.destWarehouseId == "") {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data;
this.AddressTown = data
})
.catch((error) => {
console.log(error);
});
} else if (
this.destCountryId == "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
console.log(error)
})
} else if (this.destCountryId == "" && this.objectiveId == "" && this.destWarehouseId == "") {
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
this.AddressTown = data
})
.catch((error) => {
console.log(error);
});
} else if (
this.destCountryId != "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
console.log(error)
})
} else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data;
this.AddressCity = data
})
.catch((error) => {
console.log(error);
});
console.log(error)
})
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
this.AddressTown = data
})
.catch((error) => {
console.log(error);
});
console.log(error)
})
}
// else if(this.objectiveId!="" && this.objectiveId=="" ){
// getRegionList(5, 5).then(({data}) => {
......@@ -1631,36 +864,28 @@ export default {
// console.log(error);
// });
// }
},
}
},
destWarehouseId: {
deep: true, //深度监听
handler() {
if (
this.objectiveId != "" &&
this.destCountryId != "" &&
this.destWarehouseId == ""
) {
if (this.objectiveId != "" && this.destCountryId != "" && this.destWarehouseId == "") {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data;
this.AddressTown = data
})
.catch((error) => {
console.log(error);
});
} else if (
this.destCountryId != "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
console.log(error)
})
} else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
this.AddressTown = data
})
.catch((error) => {
console.log(error);
});
console.log(error)
})
}
// else if(this.objectiveId=="" && this.destWarehouseId==""){
// getRegionList(5, 5).then(({data}) => {
......@@ -1670,43 +895,41 @@ export default {
// console.log(error);
// });
// }
},
},
}
}
},
computed: {
// 导出的权限字符串
exportPermiString() {
let arr = ["ecw:order:export"];
if (this.mine) arr.push("my");
if (this.dept) arr.push("dept");
if (this.transportId) arr.push(this.transportId);
return arr.join(":");
let arr = ["ecw:order:export"]
if (this.mine) arr.push("my")
if (this.dept) arr.push("dept")
if (this.transportId) arr.push(this.transportId)
return arr.join(":")
},
// 是否全部订单
isAll() {
return !(this.mine || this.dept || this.transportId);
return !(this.mine || this.dept || this.transportId)
},
isChinese() {
return this.$i18n.locale === "zh_CN";
return this.$i18n.locale === "zh_CN"
},
exportWarehouseList() {
/* tradeType 1 进口,2出口,3进出口 */
return this.warehouseList.filter(
(item) => item.tradeType == 2 || item.tradeType == 3
);
return this.warehouseList.filter((item) => item.tradeType == 2 || item.tradeType == 3)
},
// importWarehouseList(){
// return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3)
// },
importCountryList() {
return this.countryList.filter((item) => item.id !== null);
return this.countryList.filter((item) => item.id !== null)
},
importCityList() {
return this.cityList.filter((item) => item.id !== null);
return this.cityList.filter((item) => item.id !== null)
},
importWarehouseList() {
return this.destWarehouseList.filter((item) => item.id !== null);
return this.destWarehouseList.filter((item) => item.id !== null)
},
/* exportCityList() {
return this.tradeCityList.filter(item => item.type == 2)
......@@ -1715,91 +938,89 @@ export default {
return this.tradeCityList.filter(item => item.type == 1)
}, */
combinedQueryParams() {
let timeParams = {};
let timeParams = {}
if (this.dateFilterType && this.dateFilter) {
timeParams["begin" + this.dateFilterType] = this.dateFilter[0];
timeParams["end" + this.dateFilterType] = this.dateFilter[1];
timeParams["begin" + this.dateFilterType] = this.dateFilter[0]
timeParams["end" + this.dateFilterType] = this.dateFilter[1]
}
let queryParams = Object.assign({}, this.queryParams, timeParams);
let queryParams = Object.assign({}, this.queryParams, timeParams)
if (this.transportId) {
queryParams.transportId = this.transportId;
queryParams.transportId = this.transportId
}
if (this.noParam.value) {
queryParams[this.noParam.key] = this.noParam.value;
queryParams[this.noParam.key] = this.noParam.value
}
if (this.prodParam.value) {
queryParams[this.prodParam.key] = this.prodParam.value;
queryParams[this.prodParam.key] = this.prodParam.value
}
//目的国
if (this.destCountryId != null && this.destCountryId != "") {
queryParams.destCountryIds = this.destCountryId;
queryParams.destCountryIds = this.destCountryId
}
//目的城市
if (this.objectiveId != null && this.objectiveId != "") {
queryParams.objectiveIds = this.objectiveId;
queryParams.objectiveIds = this.objectiveId
}
//目的仓
if (this.destWarehouseId != null && this.destWarehouseId != "") {
queryParams.destWarehouseIds = this.destWarehouseId;
queryParams.destWarehouseIds = this.destWarehouseId
}
// 提货率
if (this.pickRatio.value) {
queryParams[this.pickRatio.key] = this.pickRatio.value
}
if(queryParams.statusList?.length){
if (queryParams.statusList?.length) {
queryParams.statusString = queryParams.statusList.join(",")
}
delete queryParams.statusList
return queryParams;
return queryParams
},
/*batchWarehouseAdjustment(){
return this.multipleSelection.length > 0 && this.multipleSelection.every(e => e.status === 5)
},*/
include() {
return (state, arr) => {
return arr.indexOf(state) > -1;
};
return arr.indexOf(state) > -1
}
},
exclude() {
return (state, arr) => {
return arr.indexOf(state) == -1;
};
return arr.indexOf(state) == -1
}
},
// 增值服务文本
getTypeText(){
return type => {
if(!type) return ""
getTypeText() {
return (type) => {
if (!type) return ""
const arr = []
if(type.indexOf('1') > -1){
arr.push(this.$t('集运'))
if (type.indexOf("1") > -1) {
arr.push(this.$t("集运"))
}
if(type.indexOf('2') > -1){
arr.push(this.$t('海外仓'))
if (type.indexOf("2") > -1) {
arr.push(this.$t("海外仓"))
}
}
}
},
activated() {
this.getList();
this.getList()
},
created() {
this.init(); //
this.getTransportFromRoute();
this.getList();
getProductAttrList().then((res) => (this.productAttrList = res.data));
this.init() //
this.getTransportFromRoute()
this.getList()
getProductAttrList().then((res) => (this.productAttrList = res.data))
//getTradeCityList().then(res => this.tradeCityList = res.data)
getWarehouseList().then((res) => {
this.tradeCityList = res.data;
this.warehouseList = res.data;
});
this.tradeCityList = res.data
this.warehouseList = res.data
})
getCurrencyPage(this.params).then(
(res) => (this.currencyList = res.data.list)
);
getCurrencyPage(this.params).then((res) => (this.currencyList = res.data.list))
// 如果是空运(专线空运和海空联运)则获取渠道
//if (this.transportId == 3 || this.transportId == 4) {
getChannelList().then((res) => (this.channelList = res.data));
getChannelList().then((res) => (this.channelList = res.data))
//}
},
methods: {
......@@ -1807,45 +1028,45 @@ export default {
//加载时发起请求获取所有省份值
getRegionList(1, 1)
.then(({ data }) => {
this.AddressProvince = data;
console.log(this.AddressProvince);
this.AddressProvince = data
console.log(this.AddressProvince)
})
.catch((error) => {
console.log(error);
});
console.log(error)
})
//目的城市
getRegionList(4, 4)
.then(({ data }) => {
this.AddressCity = data;
this.AddressCity = data
})
.catch((error) => {
console.log(error);
});
console.log(error)
})
//目的仓
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
this.AddressTown = data
})
.catch((error) => {
console.log(error);
});
console.log(error)
})
},
findByprovinceCode() {
//获取当前省份值id,获取该省份下城市 destCountryId provinceCode
getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data;
this.AddressCity = data
})
.catch((error) => {
console.log(error);
});
console.log(error)
})
},
findBycityCode() {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data;
this.AddressTown = data
// 去重
// let uniqueDataList = data.filter((item, index, self) => {
......@@ -1859,216 +1080,173 @@ export default {
// this.AddressProvince = uniqueDataList
})
.catch((error) => {
console.log(error);
});
console.log(error)
})
},
getDictDatas,
// 取消拆单申请
splitRevoke(row) {
this.splitRevokeOrderId = row.orderId;
this.splitRevokeOrderId = row.orderId
},
// 获得导出函数
getExportFunc() {
let func = orderExportSearch;
if (this.mine) func = orderExportMySearch;
if (this.dept) func = orderExportDeptSearch;
return func;
let func = orderExportSearch
if (this.mine) func = orderExportMySearch
if (this.dept) func = orderExportDeptSearch
return func
},
// 导出勾选
exportChecked() {
if (!this.ids.length) {
return this.$message.error(this.$t("请勾选需要导出的订单"));
return this.$message.error(this.$t("请勾选需要导出的订单"))
}
return this.exportExcel(
this.getExportFunc(),
{ orderIdList: this.ids },
this.$t("导出勾选")
);
return this.exportExcel(this.getExportFunc(), { orderIdList: this.ids }, this.$t("导出勾选"))
},
// 导出搜索
exportSearch() {
return this.exportExcel(
this.getExportFunc(),
this.combinedQueryParams,
this.$t("导出搜索")
);
return this.exportExcel(this.getExportFunc(), this.combinedQueryParams, this.$t("导出搜索"))
},
// 导出异常单
exportAbnormal() {
return this.exportExcel(
exportAbnormal,
this.combinedQueryParams,
this.$t("异常单统计")
);
return this.exportExcel(exportAbnormal, this.combinedQueryParams, this.$t("异常单统计"))
},
// 重货单统计
exportHeavyOrder() {
return this.exportExcel(
exportHeavyOrder,
this.combinedQueryParams,
this.$t("重货单统计")
);
return this.exportExcel(exportHeavyOrder, this.combinedQueryParams, this.$t("重货单统计"))
},
// 退仓单统计
exportReturnOrder() {
return this.exportExcel(
exportReturnOrder,
this.combinedQueryParams,
this.$t("退仓单统计")
);
return this.exportExcel(exportReturnOrder, this.combinedQueryParams, this.$t("退仓单统计"))
},
// 售后赔偿金额统计
exportSaleRepay() {
return this.exportExcel(
exportSaleRepay,
this.combinedQueryParams,
this.$t("售后赔偿金额统计")
);
return this.exportExcel(exportSaleRepay, this.combinedQueryParams, this.$t("售后赔偿金额统计"))
},
// 报关数据统计
exportCustomsDatas() {
return this.exportExcel(
exportCustomsDatas,
this.combinedQueryParams,
this.$t("报关数据统计")
);
return this.exportExcel(exportCustomsDatas, this.combinedQueryParams, this.$t("报关数据统计"))
},
// 客户出货量统计
exportShippingDatas() {
return this.exportExcel(
exportShippingDatas,
this.combinedQueryParams,
this.$t("客户出货量统计")
);
return this.exportExcel(exportShippingDatas, this.combinedQueryParams, this.$t("客户出货量统计"))
},
// 预付运费统计
exportShipFee() {
return this.exportExcel(
exportShipFee,
this.combinedQueryParams,
this.$t("预付运费统计")
);
return this.exportExcel(exportShipFee, this.combinedQueryParams, this.$t("预付运费统计"))
},
// 卸货费统计
exportUnload() {
return this.exportExcel(
exportUnload,
this.combinedQueryParams,
this.$t("卸货费统计")
);
return this.exportExcel(exportUnload, this.combinedQueryParams, this.$t("卸货费统计"))
},
// 通用导出函数
exportExcel(func, params, fileName = null) {
this.exportLoading = true;
this.exportLoading = true
func(params)
.then((res) => {
if (!fileName) {
fileName = this.$t("订单");
fileName = this.$t("订单")
}
this.$message.success(
this.$t("已加入导出队列,请稍后在下载日志中下载")
);
this.$message.success(this.$t("已加入导出队列,请稍后在下载日志中下载"))
// this.$download.excel(res, fileName + '.xls');
})
.finally(() => {
this.exportLoading = false;
});
this.exportLoading = false
})
},
// 提取路径中的运输方式
getTransportFromRoute() {
let match = this.$route.path.match(/transport_(\d)/);
if (!match) return;
this.transportId = match[1];
let match = this.$route.path.match(/transport_(\d)/)
if (!match) return
this.transportId = match[1]
},
oprateOrder(orderId, type) {
let actions = {
cancelOrder: {
callable: cancelOrder,
confirm: this.$t("确定要取消此订单么?"),
confirm: this.$t("确定要取消此订单么?")
},
recoveryOrder: {
callable: recoveryOrder,
confirm: this.$t("确定要恢复此订单么?"),
confirm: this.$t("确定要恢复此订单么?")
},
deleteOrder: {
callable: deleteOrder,
confirm: this.$t("确定要删除此订单么?"),
},
};
let action = actions[type];
confirm: this.$t("确定要删除此订单么?")
}
}
let action = actions[type]
if (!action) {
return this.$alert("不支持此操作");
return this.$alert("不支持此操作")
}
this.$confirm(action.confirm)
.then(() => {
return action.callable(orderId);
return action.callable(orderId)
})
.then(() => {
this.getList();
});
this.getList()
})
},
/** 查询列表 */
getList() {
this.loading = true;
this.loading = true
const query = { ...this.combinedQueryParams };
const query = { ...this.combinedQueryParams }
if (query.packageTypeArr && query.packageTypeArr.length) {
query.packageType = query.packageTypeArr.join(",");
query.packageType = query.packageTypeArr.join(",")
}
let func = getOrderPage;
let func = getOrderPage
if (this.mine) {
func = getMyOrderPage;
func = getMyOrderPage
/* return getMyOrderPage(this.combinedQueryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
}); */
} else if (this.dept) {
func = deptOrderPage;
func = deptOrderPage
}
// 执行查询
func(query).then((response) => {
// 部分情况下,订单后面的操作下拉菜单会显示按钮,但是下来没有选项,在elTable组件更新的时候会导致渲染错误,所以要在更新渲染前清空一次list让table彻底重新渲染,避免部分更新导致异常
this.list = [];
this.list = []
this.$nextTick(() => {
this.list = response.data.list;
});
this.total = response.data.total;
this.loading = false;
});
this.list = response.data.list
})
this.total = response.data.total
this.loading = false
})
this.getStatistics();
this.getStatistics()
},
// 获得统计数据
getStatistics() {
let func = orderStatistics;
let func = orderStatistics
if (this.mine) {
func = orderMyStatistics;
func = orderMyStatistics
} else if (this.dept) {
func = orderDeptStatistics;
func = orderDeptStatistics
}
const query = { ...this.combinedQueryParams };
const query = { ...this.combinedQueryParams }
if (query.packageTypeArr && query.packageTypeArr.length) {
query.packageType = query.packageTypeArr.join(",");
delete query.packageTypeArr;
query.packageType = query.packageTypeArr.join(",")
delete query.packageTypeArr
}
func(query).then((res) => {
this.statistics = res.data;
});
this.statistics = res.data
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.page = 1;
this.queryParams.page = 1
this.$nextTick(this.getList);
this.$nextTick(this.getList)
},
/** 重置按钮操作 */
resetQuery() {
......@@ -2076,30 +1254,30 @@ export default {
page: 1,
rows: 10,
packageTypeArr: [],
channelId: '',
channelId: "",
goodsTypes: [],
channelIds: []
};
}
this.destCountryId = null
this.destWarehouseId = null
this.objectiveId = null
this.pickRatio.value = ''
this.noParam.value = "";
this.prodParam.value = "";
this.dateFilter = [];
this.handleQuery();
this.pickRatio.value = ""
this.noParam.value = ""
this.prodParam.value = ""
this.dateFilter = []
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push("create?transportType=" + this.transportId);
this.$router.push("create?transportType=" + this.transportId)
},
/** 修改按钮操作, updateChannel表示变更出货渠道 */
handleUpdate(row, updateChannel = false) {
let url = "edit?id=" + row.orderId;
let url = "edit?id=" + row.orderId
if (updateChannel) {
url += "&updateChannel=1";
url += "&updateChannel=1"
}
this.$router.push(url);
this.$router.push(url)
},
/** 导出按钮操作 */
......@@ -2109,132 +1287,123 @@ export default {
this.$modal
.confirm(this.$t("是否确认导出所有订单数据项?"))
.then(() => {
this.exportLoading = true;
return exportOrderExcel(this.combinedQueryParams);
this.exportLoading = true
return exportOrderExcel(this.combinedQueryParams)
})
.then((response) => {
this.$download.excel(response, "${table.classComment}.xls");
this.exportLoading = false;
this.$download.excel(response, "${table.classComment}.xls")
this.exportLoading = false
})
.catch(() => {});
.catch(() => {})
},
// 表格多选
handleSelectionChange(selection) {
this.multipleSelection = selection;
this.ids = selection.map((item) => item.orderId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
this.multipleSelection = selection
this.ids = selection.map((item) => item.orderId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
handleEdit() {
this.warehouseBol = true;
this.orderId = this.ids.join(",");
this.warehouseBol = true
this.orderId = this.ids.join(",")
},
moleculeChange() {},
denominatorChange() {},
specialRendering(val) {
console.log("val", val);
console.log("val", val)
if (val !== undefined) {
let i = val.split(",");
let i = val.split(",")
return this.getDictDatas(this.DICT_TYPE.ORDER_SPECIAL_NEEDS)
.filter((e) => {
return i.indexOf(e.value) > -1;
return i.indexOf(e.value) > -1
})
.map((item) => {
// 打字开头的用最后一个字,否则取第一个字
item.symbol =
item.label[0] == ""
? item.label[item.label.length - 1]
: item.label[0];
return item;
});
item.symbol = item.label[0] == "" ? item.label[item.label.length - 1] : item.label[0]
return item
})
}
},
deleteSpecial(id, orderId) {
this.$confirm(this.$t("确定删除此特需么?"))
.then(() => {
return orderSpecialNeed({ orderId: orderId, advanceType: id });
return orderSpecialNeed({ orderId: orderId, advanceType: id })
})
.then(() => {
this.getList();
});
this.getList()
})
},
onBatchClose() {
this.showBatchPickup = false;
this.handleQuery();
this.showBatchPickup = false
this.handleQuery()
},
// 打印标签
printTag(order) {
this.printTagOrderId = order.orderId;
this.printTagWarehouseInNum = order.sumNum;
this.printTagOrderId = order.orderId
this.printTagWarehouseInNum = order.sumNum
},
// 过滤订单状态筛选字典内容
statusDictFilter(item) {
if (this.transportId == 3 && item.cssClass && item.cssClass != "air") {
return false;
return false
}
if (this.transportId == 1 && item.cssClass && item.cssClass != "sea") {
return false;
return false
}
if (
this.transportId == 4 &&
item.cssClass &&
item.cssClass != "sea-air"
) {
return false;
if (this.transportId == 4 && item.cssClass && item.cssClass != "sea-air") {
return false
}
return true;
return true
},
// 设置空运订单不可出
async setCanNotShipment(order) {
await this.$confirm(
this.$t("确定设置订单{orderNo}不可出么?", { orderNo: order.orderNo })
);
await this.$confirm(this.$t("确定设置订单{orderNo}不可出么?", { orderNo: order.orderNo }))
setCanNotShipment(order.orderId).then((res) => {
this.$message(this.$t("操作成功"));
this.getList();
});
this.$message(this.$t("操作成功"))
this.getList()
})
},
// 查看母订单
showParentOrder(row) {
getParentOrder(row.orderId).then((res) => {
this.$router.push("./detail?orderId=" + res.data.orderId);
});
this.$router.push("./detail?orderId=" + res.data.orderId)
})
},
oprateOrder2(row, type) {
//lanbm 2024-06-19 添加的转异功能
this.order.orderNo = row.orderNo;
this.errorShow = true;
this.order.orderNo = row.orderNo
this.errorShow = true
},
async handleException(order) {
this.tureExceptionOrder = order
await this.$nextTick()
this.$refs.turnException?.show()
},
handleTurnExceptionDone(){
handleTurnExceptionDone() {
this.tureExceptionOrder = null
this.getList()
},
handleExceptionClose() {
this.tureExceptionOrder = null;
this.tureExceptionOrder = null
},
// 复制订单
handleCopyOrder(orderId){
copyOrder(orderId).then(res => {
this.$router.push({ path: '/order/edit', query: { id: res.data } });
});
handleCopyOrder(orderId) {
copyOrder(orderId).then((res) => {
this.$router.push({ path: "/order/edit", query: { id: res.data } })
})
},
// 查看异常
openException(order){
openException(order) {
this.$router.push({
path: "./pending?id=" + order.orderId,
});
path: "./pending?id=" + order.orderId
})
},
// 自动去除空格
replaceSpace(obj, field){
obj[field] = obj[field].replace(/\s+/g, '');
replaceSpace(obj, field) {
obj[field] = obj[field].replace(/\s+/g, "")
}
},
};
}
}
</script>
<style lang="scss" scoped>
::v-deep .actions {
......
......@@ -317,7 +317,6 @@ export default {
specialProducts: [],
// priceStepList: [{},{}], // 阶梯价格
// specialList:[], // 特殊需求,默认四个
rules() {},
product: null,
/* productType: null, */
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