Commit 36f59792 authored by dragondean@qq.com's avatar dragondean@qq.com
parents 122eb611 a1a34dec
...@@ -5,7 +5,7 @@ ENV = 'development' ...@@ -5,7 +5,7 @@ ENV = 'development'
VUE_APP_TITLE = 捷道管理系统 VUE_APP_TITLE = 捷道管理系统
# 捷道管理系统/开发环境 # 捷道管理系统/开发环境
VUE_APP_BASE_API = 'http://jd.apitest.jdshangmen.com' VUE_APP_BASE_API = 'http://localhost:48080'
# VUE_APP_BASE_API = '/api' # VUE_APP_BASE_API = '/api'
# 路由懒加载 # 路由懒加载
......
import request from '@/utils/request'
// 创建广告设置
export function createBanner(data) {
return request({
url: '/ecw/banner/create',
method: 'post',
data: data
})
}
// 更新广告设置
export function updateBanner(data) {
return request({
url: '/ecw/banner/update',
method: 'put',
data: data
})
}
// 删除广告设置
export function deleteBanner(id) {
return request({
url: '/ecw/banner/delete?id=' + id,
method: 'delete'
})
}
// 获得广告设置
export function getBanner(id) {
return request({
url: '/ecw/banner/get?id=' + id,
method: 'get'
})
}
// 获得广告设置分页
export function getBannerPage(query) {
return request({
url: '/ecw/banner/page',
method: 'get',
params: query
})
}
// 导出广告设置 Excel
export function exportBannerExcel(query) {
return request({
url: '/ecw/banner/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
import request from '@/utils/request'
// 创建广告弹窗
export function createBannerPop(data) {
return request({
url: '/ecw/banner-pop/create',
method: 'post',
data: data
})
}
// 更新广告弹窗
export function updateBannerPop(data) {
return request({
url: '/ecw/banner-pop/update',
method: 'put',
data: data
})
}
// 删除广告弹窗
export function deleteBannerPop(id) {
return request({
url: '/ecw/banner-pop/delete?id=' + id,
method: 'delete'
})
}
// 获得广告弹窗
export function getBannerPop(id) {
return request({
url: '/ecw/banner-pop/get?id=' + id,
method: 'get'
})
}
// 获得广告弹窗分页
export function getBannerPopPage(query) {
return request({
url: '/ecw/banner-pop/page',
method: 'get',
params: query
})
}
// 导出广告弹窗 Excel
export function exportBannerPopExcel(query) {
return request({
url: '/ecw/banner-pop/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
...@@ -68,3 +68,18 @@ export function customerDropDownList(query){ ...@@ -68,3 +68,18 @@ export function customerDropDownList(query){
query, query,
}) })
} }
//商品
export function commodityList(){
return request({
url:'/ecw/product/list',
method:'get',
})
}
export function createCommission(query){
return request({
url:'/ecw/customer-commission/create',
method:'post',
data:query
})
}
...@@ -34,6 +34,14 @@ export function getCustomerContacts(id) { ...@@ -34,6 +34,14 @@ export function getCustomerContacts(id) {
}) })
} }
// 获得客户联系人列表
export function getCustomerContactsList() {
return request({
url: '/ecw/customer-contacts/page',
method: 'get'
})
}
// 获得客户联系人分页 // 获得客户联系人分页
export function getCustomerContactsPage(query) { export function getCustomerContactsPage(query) {
return request({ return request({
......
import request from '@/utils/request'
// 创建跟进
export function createCustomerFollow(data) {
return request({
url: '/ecw/customer-follow/create',
method: 'post',
data: data
})
}
// 更新跟进
export function updateCustomerFollow(data) {
return request({
url: '/ecw/customer-follow/update',
method: 'put',
data: data
})
}
// 删除跟进
export function deleteCustomerFollow(id) {
return request({
url: '/ecw/customer-follow/delete?id=' + id,
method: 'delete'
})
}
// 获得跟进
export function getCustomerFollow(id) {
return request({
url: '/ecw/customer-follow/get?id=' + id,
method: 'get'
})
}
// 获得跟进分页
export function getCustomerFollowPage(query) {
return request({
url: '/ecw/customer-follow/page',
method: 'get',
params: query
})
}
// 导出跟进 Excel
export function exportCustomerFollowExcel(query) {
return request({
url: '/ecw/customer-follow/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
...@@ -34,6 +34,14 @@ export function getProduct(id) { ...@@ -34,6 +34,14 @@ export function getProduct(id) {
}) })
} }
// 获得产品列表
export function getProductList() {
return request({
url: '/ecw/product/list',
method: 'get'
})
}
// 获得产品分页 // 获得产品分页
export function getProductPage(query) { export function getProductPage(query) {
return request({ return request({
......
<template>
<el-table
border
:data="tableData"
style="">
<el-table-column
width="250px"
label="始发地">
<template v-slot="{ row, column, $index }">
<el-checkbox v-model="row.checked" @change="updateValue(true)">{{ warehouseList[$index].titleZh }}</el-checkbox>
</template>
</el-table-column>
<el-table-column
prop="objectiveId"
label="目的地">
<template v-slot="{ row, column, $index }">
<el-select v-model="tableData[$index].objectiveIds" multiple placeholder="请选择" style="width:100%" @change="updateValue(row.checked)">
<el-option
v-for="item in importCityList"
:key="item.id"
:label="item.titleZh"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
</el-table>
</template>
<script>
export default {
name: 'CustomerLineTable',
props: {
warehouseList: Array,
importCityList: Array,
value: Array,
zhongPaoType: {
type: Number,
default: 0
}
},
data() {
return {
tableData: []
}
},
mounted() {
this.freshTableData()
},
methods: {
/**
* 解析 value
*/
freshTableData(){
const foo = []
let index = 0
this.warehouseList.forEach(e => {
let bar = this.tableData.length > 0 ? this.tableData[index] : {
departureId: e.id,
objectiveIds: [],
checked: false
}
const valueIndex = this.value.findIndex(v => v.departureId === e.id)
if(valueIndex !== -1) {
bar = { ...this.value[valueIndex], checked: true }
if(bar.objectiveIds.length === 0) {
bar.objectiveIds = []
} else {
bar.objectiveIds = bar.objectiveIds.split(',').map(m => parseInt(m))
}
}
foo.push(bar)
index++
})
this.tableData = foo
},
/**
* 更新 value
*/
updateValue(really = true){
if (!really) return
const result = []
this.tableData.forEach(e => {
if(e.checked){
const { departureId } = e
let objectiveIds = e.objectiveIds.join(',')
result.push({ departureId, objectiveIds, zhongPaoType: this.zhongPaoType })
}
})
this.$emit('input', result)
}
},
watch: {
value() {
this.freshTableData()
},
warehouseList() {
this.freshTableData()
}
}
}
</script>
<style scoped>
</style>
...@@ -172,11 +172,11 @@ export default { ...@@ -172,11 +172,11 @@ export default {
// 获取富文本组件实例 // 获取富文本组件实例
let quill = this.Quill; let quill = this.Quill;
// 如果上传成功 // 如果上传成功
if (res.code == 200) { if (res.code == 0) {
// 获取光标所在位置 // 获取光标所在位置
let length = quill.getSelection().index; let length = quill.getSelection().index;
// 插入图片 res.url为服务器返回的图片地址 // 插入图片 res.url为服务器返回的图片地址
quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName); quill.insertEmbed(length, "image", res.data);
// 调整光标到最后 // 调整光标到最后
quill.setSelection(length + 1); quill.setSelection(length + 1);
} else { } else {
...@@ -186,6 +186,20 @@ export default { ...@@ -186,6 +186,20 @@ export default {
handleUploadError() { handleUploadError() {
this.$message.error("图片插入失败"); this.$message.error("图片插入失败");
}, },
uuid() {
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
s[8] = s[13] = s[18] = s[23] = "-";
var uuid = s.join("");
return uuid;
},
}, },
}; };
</script> </script>
......
...@@ -2,6 +2,7 @@ import Vue from 'vue' ...@@ -2,6 +2,7 @@ import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
/* Layout */ /* Layout */
import Layout from '@/layout' import Layout from '@/layout'
import query from '@/views/ecw/customer/query'
Vue.use(Router) Vue.use(Router)
...@@ -91,16 +92,6 @@ export const constantRoutes = [ ...@@ -91,16 +92,6 @@ export const constantRoutes = [
meta: {title: '字典数据', icon: '', activeMenu: '/system/dict'} meta: {title: '字典数据', icon: '', activeMenu: '/system/dict'}
} }
] ]
}, {
path: '/c',
component: Layout,
hidden: true,
children: [{
path: 'ecw/customer/edit/:customerId(\\d+)',
component: (resolve) => require(['@/views/ecw/customer/edit'], resolve),
name: 'Data',
meta: {title: '字典数据', icon: '', activeMenu: '/system/dict'}
}]
}, { }, {
path: '/job', path: '/job',
component: Layout, component: Layout,
...@@ -247,12 +238,28 @@ export const constantRoutes = [ ...@@ -247,12 +238,28 @@ export const constantRoutes = [
component: Layout, component: Layout,
hidden: true, hidden: true,
redirect: 'noredirect', redirect: 'noredirect',
children: [{ children: [
path: '/customerCommissionInfo/:dictId(\\d+)', {
component: (resolve) => require(['@/views/ecw/customerCommissionInfo/index'], resolve), path: '/customerCommissionInfo/:dictId(\\d+)',
name: 'customerCommissionInfo', component: (resolve) => require(['@/views/ecw/customerCommissionInfo/index'], resolve),
meta: {title: '佣金详情', icon: '', activeMenu: '/customer/customerCommissionInfo'} name: 'customerCommissionInfo',
}] meta: {title: '佣金详情', icon: '', activeMenu: '/customer/customerCommissionInfo'}
},
{
path: 'edit/:customerId(\\d+)',
component: (resolve) => import('@/views/ecw/customer/edit'),
props: true,
name: 'customerEdit',
meta: {title: '编辑客户', icon: '', activeMenu: '/customer/customer'}
},
{
path: 'query/:customerId(\\d+)',
component: (resolve) => import('@/views/ecw/customer/query'),
props: true,
name: 'customerQuery',
meta: {title: '客户详情', icon: '', activeMenu: '/customer/customer'}
}
]
}, },
] ]
......
...@@ -100,12 +100,15 @@ export const DICT_TYPE = { ...@@ -100,12 +100,15 @@ export const DICT_TYPE = {
AREA_CODE: 'area_code', // 区号 AREA_CODE: 'area_code', // 区号
SOCIAL: 'customer_social_tools', // 社交软件 SOCIAL: 'customer_social_tools', // 社交软件
IS_DEFAULT: 'is_default', // 默认联系人 IS_DEFAULT: 'is_default', // 默认联系人
CUSTOMER_FOLLOW_TYPE: 'customer_follow_type', // 跟进类型
CUSTOMER_FOLLOW_METHOD: 'customer_follow_method', // 跟进方式
COMMISSION_PRODUCT_APPROVAL:'commission_product_approval', //佣金备案 COMMISSION_PRODUCT_APPROVAL:'commission_product_approval', //佣金备案
SHIPPING_DECLARATION_TYPE:'shipping_declaration_type',//出货报关方式(与订单报关方式相同) SHIPPING_DECLARATION_TYPE:'shipping_declaration_type',//出货报关方式(与订单报关方式相同)
COMMISSION_TYPE:'commission_type',//佣金类型 COMMISSION_TYPE:'commission_type',//佣金类型
COMMISSION_DARK_TYPE :'commission_dark_type',//暗涌类型 COMMISSION_DARK_TYPE :'commission_dark_type',//暗涌类型
COMMISSION_CURRENCY_TYPE:'commission_currency_type',//佣金货币类型 COMMISSION_CURRENCY_TYPE:'commission_currency_type',//佣金货币类型
COMMISSION_UNIT:'commission_unit'//佣金货物单位 COMMISSION_UNIT:'commission_unit',//佣金货物单位
ECW_PORT_TYPE:'port_type', //港口类型
} }
......
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="中文标题" prop="titleZh">
<el-input v-model="queryParams.titleZh" placeholder="请输入中文标题" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="英文标题" prop="titleEn">
<el-input v-model="queryParams.titleEn" placeholder="请输入英文标题" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="中文内容" prop="contentZh">
<el-input v-model="queryParams.contentZh" placeholder="请输入中文内容" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="英文内容" prop="contentEn">
<el-input v-model="queryParams.contentEn" placeholder="请输入英文内容" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="图片地址WEB" prop="bannerUrlWeb">
<el-input v-model="queryParams.bannerUrlWeb" placeholder="请输入图片地址WEB" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="图片地址APP" prop="bannerUrlApp">
<el-input v-model="queryParams.bannerUrlApp" placeholder="请输入图片地址APP" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="0显示 1不显示" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择0显示 1不显示" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</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:banner:create']">新增</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:banner:export']">导出</el-button>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="" align="center" prop="id" />
<el-table-column label="标题" align="center" prop="titleZh" />
<el-table-column label="WEB端图片" align="center" prop="bannerUrlWeb">
<template slot-scope="scope">
<el-image :src="scope.row.bannerUrlWeb"></el-image>
</template>
</el-table-column>
<el-table-column label="APP端图片" align="center" prop="bannerUrlApp" >
<template slot-scope="scope">
<el-image :src="scope.row.bannerUrlApp"></el-image>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<span>{{ statusName(scope.row.status) }}</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:banner:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:banner:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="126px">
<el-form-item label="中文标题" prop="titleZh">
<el-input v-model="form.titleZh" placeholder="请输入中文标题" />
</el-form-item>
<el-form-item label="英文标题" prop="titleEn">
<el-input v-model="form.titleEn" placeholder="请输入英文标题" />
</el-form-item>
<el-form-item label="中文内容" prop="contentZh">
<editor v-model="form.contentZh" :min-height="150"/>
</el-form-item>
<el-form-item label="英文内容" prop="contentEn">
<editor v-model="form.contentEn" :min-height="150"/>
</el-form-item>
<el-form-item label="WEB端广告图片" prop="bannerUrlWeb">
<el-col :span="8">
<el-input v-model="form.bannerUrlWeb" placeholder="请上传WEB端广告图片" />
</el-col>
<el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUploadWeb">
<el-button size="small">
上传图片
<i class="el-icon-upload el-icon--right"></i>
</el-button>
</el-upload>
</el-form-item>
<el-form-item label="APP端广告图片" prop="bannerUrlApp">
<el-col :span="8">
<el-input v-model="form.bannerUrlApp" placeholder="请上传APP端广告图片" />
</el-col>
<el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUploadApp">
<el-button size="small">
上传图片
<i class="el-icon-upload el-icon--right"></i>
</el-button>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createBanner, updateBanner, deleteBanner, getBanner, getBannerPage, exportBannerExcel } from "@/api/ecw/banner";
import Editor from '@/components/Editor';
import { uploadFile } from "@/api/infra/file";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {CommonStatusEnum} from '@/utils/constants'
export default {
name: "Banner",
components: {
Editor,
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 广告设置列表
list: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
dateRangeCreateTime: [],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
titleZh: null,
titleEn: null,
contentZh: null,
contentEn: null,
bannerUrlWeb: null,
bannerUrlApp: null,
status: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
titleZh: [{ required: true, message: "中文标题不能为空", trigger: "blur" }],
titleEn: [{ required: true, message: "英文标题不能为空", trigger: "blur" }],
bannerUrlWeb: [{ required: true, message: "web端广告图片不能为空", trigger: "blur" }],
bannerUrlApp: [{ required: true, message: "app端广告图片不能为空", trigger: "blur" }]
},
CommonStatusEnum: CommonStatusEnum,
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS),
};
},
computed: {
statusName() {
return value => {
for(let index in this.statusDictDatas) {
let dictItem = this.statusDictDatas[index];
if(dictItem.value == value) {
return dictItem.value == CommonStatusEnum.ENABLE + '' ? '正常' : '禁用';
}
}
}
},
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询
getBannerPage(params).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
titleZh: undefined,
titleEn: undefined,
contentZh: undefined,
contentEn: undefined,
bannerUrlWeb: undefined,
bannerUrlApp: undefined,
status: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加广告设置";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getBanner(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改广告设置";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
// 修改的提交
if (this.form.id != null) {
updateBanner(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
// 添加的提交
createBanner(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除广告设置编号为"' + id + '"的数据项?').then(function() {
return deleteBanner(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm('是否确认导出所有广告设置数据项?').then(() => {
this.exportLoading = true;
return exportBannerExcel(params);
}).then(response => {
this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false;
}).catch(() => {});
},
// 覆盖默认的上传行为
requestUpload() {
},
// 上传预处理
beforeUploadWeb(file) {
if (file.type.indexOf("image/") == -1) {
this.$modal.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
} else {
//上传
let formData = new FormData();
formData.append("file", file);
formData.append("path", this.uuid());
uploadFile(formData).then(response => {
this.$set(this.form, 'bannerUrlWeb', response.data);
// this.form.img = response.data;
})
}
},
// 上传预处理
beforeUploadApp(file) {
if (file.type.indexOf("image/") == -1) {
this.$modal.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
} else {
//上传
let formData = new FormData();
formData.append("file", file);
formData.append("path", this.uuid());
uploadFile(formData).then(response => {
this.$set(this.form, 'bannerUrlApp', response.data);
// this.form.img = response.data;
})
}
},
uuid() {
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
s[8] = s[13] = s[18] = s[23] = "-";
var uuid = s.join("");
return uuid;
}
}
};
</script>
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="中文标题" prop="titleZh">
<el-input v-model="queryParams.titleZh" placeholder="请输入中文标题" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="英文标题" prop="titleEn">
<el-input v-model="queryParams.titleEn" placeholder="请输入英文标题" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="有效期开始时间" prop="validateStart">
<el-input v-model="queryParams.validateStart" placeholder="请输入有效期开始时间" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="有效期结束时间" prop="validateEnd">
<el-input v-model="queryParams.validateEnd" placeholder="请输入有效期结束时间" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="web网页中文" prop="htmlWebZh">
<el-input v-model="queryParams.htmlWebZh" placeholder="请输入web网页中文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="web网页英文" prop="htmlWebEn">
<el-input v-model="queryParams.htmlWebEn" placeholder="请输入web网页英文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="app网页中文" prop="htmlAppZh">
<el-input v-model="queryParams.htmlAppZh" placeholder="请输入app网页中文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="0显示 1不显示" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择0显示 1不显示" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</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:banner-pop:create']">新增</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:banner-pop:export']">导出</el-button>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="" align="center" prop="id" />
<el-table-column label="弹窗标题" align="center" prop="titleZh" />
<el-table-column label="弹窗时间" align="center" prop="validateDate" width="180">
<template slot-scope="scope">
<span>{{ formatTime(scope.row.validateStart) }}~{{ formatTime(scope.row.validateEnd) }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<span>{{ statusName(scope.row.status) }}</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:banner-pop:update']">修改</el-button> -->
<el-button size="mini" type="text" @click="handleStatus(scope.row)"
v-hasPermi="['ecw:banner-pop:update']">{{scope.row.status == CommonStatusEnum.ENABLE ? '禁用' : '启用'}}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:banner-pop:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="标题(中文)" prop="titleZh">
<el-input v-model="form.titleZh" placeholder="请输入中文标题" />
</el-form-item>
<el-form-item label="标题(英文)" prop="titleEn">
<el-input v-model="form.titleEn" placeholder="请输入英文标题" />
</el-form-item>
<el-form-item label="有效期" prop="validateStart">
<el-date-picker v-model="form.validateStart" @change="startChange"
type="date"
placeholder="选择日期">
</el-date-picker>
~
<el-date-picker v-model="form.validateEnd"
type="date"
placeholder="选择日期">
</el-date-picker>
<span style="color:red;font-size:14px;">注意:留空则表示永久有效</span>
</el-form-item>
<el-form-item label="网页中文" prop="htmlWebZh">
<editor v-model="form.htmlWebZh" :min-height="150"/>
</el-form-item>
<el-form-item label="网页英文" prop="htmlWebEn">
<editor v-model="form.htmlWebEn" :min-height="150"/>
</el-form-item>
<el-form-item label="APP中文" prop="htmlAppZh">
<editor v-model="form.htmlAppZh" :min-height="150"/>
</el-form-item>
<el-form-item label="APP英文" prop="htmlAppEn">
<editor v-model="form.htmlAppEn" :min-height="150"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createBannerPop, updateBannerPop, deleteBannerPop, getBannerPop, getBannerPopPage, exportBannerPopExcel } from "@/api/ecw/bannerPop";
import Editor from '@/components/Editor';
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {CommonStatusEnum} from '@/utils/constants'
export default {
name: "BannerPop",
components: {
Editor,
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 广告弹窗列表
list: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
dateRangeCreateTime: [],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
titleZh: null,
titleEn: null,
validateStart: null,
validateEnd: null,
htmlWebZh: null,
htmlWebEn: null,
htmlAppZh: null,
status: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
titleZh: [{ required: true, message: "中文标题不能为空", trigger: "blur" }],
titleEn: [{ required: true, message: "英文标题不能为空", trigger: "blur" }],
validateStart: [{ required: true, message: "有效期开始时间不能为空", trigger: "blur" }]
},
CommonStatusEnum: CommonStatusEnum,
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS),
};
},
watch: {
'form.validateStart'(newV, oldV) {
if(this.form.validateStart && this.form.validateEnd) {
let startDate = new Date(this.form.validateStart)
let endDate = new Date(this.form.validateEnd)
if(startDate.getTime() > endDate.getTime()){
this.$message.error('开始时间不能大于结束时间');
if(oldV) {
this.form.validateStart = oldV;
} else {
this.form.validateStart = ""
}
}
}
},
'form.validateEnd'(newV, oldV) {
if(this.form.validateStart && this.form.validateEnd) {
let startDate = new Date(this.form.validateStart)
let endDate = new Date(this.form.validateEnd)
if(startDate.getTime() > endDate.getTime()){
this.$message.error('结束时间不能小于开始时间');
if(oldV) {
this.form.validateEnd= oldV;
} else {
this.form.validateEnd = ""
}
}
}
},
},
computed: {
formatTime() {
return millisecond => {
if(millisecond) {
return new Date(millisecond).format('yyyy-MM-dd');
}
return '';
}
},
statusName() {
return value => {
for(let index in this.statusDictDatas) {
let dictItem = this.statusDictDatas[index];
if(dictItem.value == value) {
return dictItem.value == CommonStatusEnum.ENABLE + '' ? '正常' : '禁用';
}
}
}
},
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询
getBannerPopPage(params).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
titleZh: undefined,
titleEn: undefined,
validateStart: undefined,
validateEnd: undefined,
htmlWebZh: undefined,
htmlWebEn: undefined,
htmlAppZh: undefined,
status: undefined,
};
this.resetForm("form");
},
/**修改状态 */
handleStatus(row) {
row.status=row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE;
updateBannerPop(row).then(() => {
this.$modal.msgSuccess("修改成功");
}).catch(function() {
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE;
});
},
/**开始日期变了 */
startChange(val) {
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加广告弹窗";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getBannerPop(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改广告弹窗";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
// 修改的提交
if (this.form.id != null) {
updateBannerPop(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
// 添加的提交
createBannerPop(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除广告弹窗编号为"' + id + '"的数据项?').then(function() {
return deleteBannerPop(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm('是否确认导出所有广告弹窗数据项?').then(() => {
this.exportLoading = true;
return exportBannerPopExcel(params);
}).then(response => {
this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
...@@ -61,12 +61,12 @@ ...@@ -61,12 +61,12 @@
</el-table-column> </el-table-column>
<el-table-column label="汇率" align="center" prop="huilv" /> <el-table-column label="汇率" align="center" prop="huilv" />
<el-table-column label="排序" align="center" prop="aorder" /> <el-table-column label="排序" align="center" prop="aorder" />
<el-table-column label="" align="center" prop="createAt" width="180"> <!-- <el-table-column label="" align="center" prop="createAt" width="180">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span>{{ parseTime(scope.row.createAt) }}</span> <!-- <span>{{ parseTime(scope.row.createAt) }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="" align="center" prop="updateAt" width="180"> <el-table-column label="最后更新时间" align="center" prop="updateAt" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.updateAt) }}</span> <span>{{ parseTime(scope.row.updateAt) }}</span>
</template> </template>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="客户等级" prop="level"> <el-form-item label="客户等级" prop="level">
<el-select v-model="form.level" placeholder="请选择客户等级"> <el-select v-model="form.level" placeholder="请选择客户等级" disabled>
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" /> :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select> </el-select>
...@@ -33,20 +33,13 @@ ...@@ -33,20 +33,13 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="客户类别" prop="type"> <el-form-item label="客户类别" prop="type">
<el-select v-model="form.type" placeholder="请选择客户类别"> <dict-selector :type="DICT_TYPE.CUSTOMER_TYPE" form-type="select" multiple v-model="form.type"></dict-selector>
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_TYPE)" <!-- <el-select v-model="form.type" placeholder="请选择客户类别">-->
:key="dict.value" :label="dict.label" :value="dict.value" /> <!-- <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_TYPE)"-->
</el-select> <!-- :key="dict.value" :label="dict.label" :value="dict.value" />-->
<!-- </el-select>-->
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="所属代理" prop="agentId">-->
<!-- <el-select v-model="form.agentId" placeholder="请选择所属代理">-->
<!-- <el-option v-for="dict in getDictDatas(DICT_TYPE.COMMON_STATUS)"-->
<!-- :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="常用提货网点" prop="pickupPoint"> <el-form-item label="常用提货网点" prop="pickupPoint">
<el-select v-model="form.pickupPoint" placeholder="请输入常用提货网点"> <el-select v-model="form.pickupPoint" placeholder="请输入常用提货网点">
...@@ -55,6 +48,14 @@ ...@@ -55,6 +48,14 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="13" v-show="form.type && form.type.indexOf('3') !== -1">
<el-form-item label="所属代理" prop="agentId">
<el-select v-model="form.agentId" placeholder="请选择所属代理">
<el-option v-for="dict in getDictDatas(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="公司名称" prop="company"> <el-form-item label="公司名称" prop="company">
...@@ -74,16 +75,16 @@ ...@@ -74,16 +75,16 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="主营类别" prop="productType"> <el-form-item label="主营类别" prop="productType">
<el-cascader :options="productTypeList" :props="{label: 'titleZh', value: 'id', lazy: true, lazyLoad}"></el-cascader> <!-- <el-cascader :options="productTypeList" :props="{label: 'titleZh', value: 'id', lazy: true, lazyLoad}"></el-cascader>-->
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="11"> <el-col :span="11">
<el-select v-model="form.productType" placeholder="请选择产品类别"> <el-select v-model="form.productType" placeholder="请选择产品类别" @change="form.productId = ''">
<!-- <el-option label="请选择字典生成" value="" />--> <el-option :label="item.titleZh" :value="item.id" v-for="(item) in productTypeList" :key="item.id"/>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-select v-model="form.productType" placeholder="请选择主营类别"> <el-select v-model="form.productId" placeholder="请选择">
<!-- <el-option label="请选择字典生成" value="" />--> <el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="(item) in productListFilter" :key="item.id"/>
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
...@@ -129,16 +130,30 @@ ...@@ -129,16 +130,30 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="推介人" prop="promoter"> <el-form-item label="推介人" prop="promoter">
<el-input v-model="form.promoter" placeholder="请输入推介人" /> <el-select v-model="form.promoter" placeholder="请输入推介人" filterable>
<el-option
v-for="item in customerSelect"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="创建人" prop="founder"> <el-form-item label="创建人" prop="founder">
<el-input v-model="form.founder" placeholder="请输入创建人" /> <el-select v-model="form.founder" disabled>
<el-option
v-for="item in serviceUserList"
:key="item.id"
:label="item.nickname"
:value="item.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="创建时间" prop="founder"> <el-form-item label="创建时间" prop="createTime">
<el-date-picker <el-date-picker
v-model="form.createTime" v-model="form.createTime"
type="datetime" type="datetime"
...@@ -149,7 +164,7 @@ ...@@ -149,7 +164,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="备注" prop="remarks"> <el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" /> <el-input v-model="form.remarks" placeholder="请输入备注"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
...@@ -157,28 +172,32 @@ ...@@ -157,28 +172,32 @@
<el-switch v-model="form.arrivalConfirm" :active-value="0" :inactive-value="1" /> <el-switch v-model="form.arrivalConfirm" :active-value="0" :inactive-value="1" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="13">
<el-form-item label="重货标准(CBM)" prop="weightUnit"> <el-form-item label="重货标准" prop="weightUnit">
<el-input v-model="form.weightUnit" placeholder="请输入重货标准(CBM)" /> <el-switch v-model="showZhong"/>
<el-input v-model="form.weightUnit" placeholder="请输入重货标准" v-show="showZhong">
<template slot="append">kg/cbm</template>
</el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24" v-show="showZhong">
<el-form-item label="指定线路" prop="line"> <el-form-item label="指定线路" prop="line">
<el-switch v-model="showLine"></el-switch> <el-switch v-model="showZhong1"></el-switch>
<el-table <customer-line-table v-show="showZhong1" :warehouse-list="warehouseList" :import-city-list="importCityList" v-model="zhongLines" :zhong-pao-type="0"></customer-line-table>
v-show="showLine" </el-form-item>
border </el-col>
:data="form.customerLines" <el-col :span="13">
style="width: 500px"> <el-form-item label="泡货标准" prop="weightUnit">
<el-table-column <el-switch v-model="showPao"/>
prop="departureId" <el-input v-model="form.lightUnit" placeholder="请输入泡货标准" v-show="showPao">
label="始发地"> <template slot="append">kg/cbm</template>
</el-table-column> </el-input>
<el-table-column </el-form-item>
prop="objectiveId" </el-col>
label="目的地"> <el-col :span="24" v-show="showPao">
</el-table-column> <el-form-item label="指定线路" prop="line">
</el-table> <el-switch v-model="showPao1"></el-switch>
<customer-line-table v-show="showPao1" :warehouse-list="warehouseList" :import-city-list="importCityList" v-model="paoLines" :zhong-pao-type="1"></customer-line-table>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -186,7 +205,7 @@ ...@@ -186,7 +205,7 @@
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>联系人</span> <span>联系人</span>
<el-button style="float: right;" size="small" type="primary" @click="form.customerContacts.push({department: undefined})">+</el-button> <el-button style="float: right;" size="small" type="primary" @click="handleAddContact">+</el-button>
</div> </div>
<el-table <el-table
:data="form.customerContacts" :data="form.customerContacts"
...@@ -285,7 +304,7 @@ ...@@ -285,7 +304,7 @@
<template v-slot="{row}"> <template v-slot="{row}">
<el-select v-model="row.isDefault" placeholder="设为默认"> <el-select v-model="row.isDefault" placeholder="设为默认">
<el-option v-for="dict in getDictDatas(DICT_TYPE.IS_DEFAULT)" <el-option v-for="dict in getDictDatas(DICT_TYPE.IS_DEFAULT)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.isDefault)" /> :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
...@@ -359,29 +378,51 @@ import upload from '@/components/ImageUpload' ...@@ -359,29 +378,51 @@ import upload from '@/components/ImageUpload'
import {createCustomer, getCustomer, updateCustomer} from '@/api/ecw/customer' import {createCustomer, getCustomer, updateCustomer} from '@/api/ecw/customer'
import {getNodeList} from "@/api/ecw/node" import {getNodeList} from "@/api/ecw/node"
import { getProductTypeList } from '@/api/ecw/productType' 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 {listServiceUser} from "@/api/system/user"
export default { export default {
name: "edit", name: "edit",
props: {
customerId: String
},
components: { components: {
upload upload,
CustomerLineTable
}, },
created() { created() {
this.customerId = this.$route.params && this.$route.params.customerId; this.reset()
console.log(this.customerId) if(this.customerId !== '0')
if(!!this.customerId)
this.getCustomer(this.customerId) this.getCustomer(this.customerId)
getNodeList().then(r => { getNodeList().then(r => {
this.nodeList = r.data this.nodeList = r.data
}) })
getProductTypeList().then(r => { getProductTypeList().then(r => {
this.productTypeList = r.data this.productTypeList = r.data
}) })
getProductList().then(r => {
this.productList = r.data
})
getTradeCityList({type: 1}).then(r => {
this.importCityList = r.data.filter(item => item.type === '1')
})
getWarehouseList().then(r => {
this.warehouseList = r.data
})
getCustomerSelect().then(r => {
this.customerSelect = r.data
})
listServiceUser().then(r => {
this.serviceUserList = r.data
})
}, },
data(){ data(){
return { return {
customerId: undefined,
getDictDatas, getDictDatas,
DICT_TYPE, DICT_TYPE,
...@@ -393,7 +434,7 @@ export default { ...@@ -393,7 +434,7 @@ export default {
country: [{ required: true, message: "国家不能为空", trigger: "blur" }], country: [{ required: true, message: "国家不能为空", trigger: "blur" }],
level: [{ required: true, message: "客户等级不能为空", trigger: "blur" }], level: [{ required: true, message: "客户等级不能为空", trigger: "blur" }],
type: [{ required: true, message: "客户类别不能为空", trigger: "blur" }], type: [{ required: true, message: "客户类别不能为空", trigger: "blur" }],
// createTime: [{ required: true, message: "创建时间不能为空", trigger: "blur" }], createTime: [{ required: true, message: "创建时间不能为空", trigger: "blur" }],
source: [{ required: true, message: "客户来源不能为空", trigger: "blur" }], source: [{ required: true, message: "客户来源不能为空", trigger: "blur" }],
customerService: [{ required: true, message: "跟进客服不能为空", trigger: "blur" }], customerService: [{ required: true, message: "跟进客服不能为空", trigger: "blur" }],
status: [{ required: true, message: "客户状态不能为空", trigger: "blur" }], status: [{ required: true, message: "客户状态不能为空", trigger: "blur" }],
...@@ -402,13 +443,21 @@ export default { ...@@ -402,13 +443,21 @@ export default {
// 网点 // 网点
nodeList: [], nodeList: [],
productTypeList: [], productTypeList: [],
showLine: false productList: [],
showZhong: false,
showZhong1: false,
showPao: false,
showPao1: false,
warehouseList: [], // 仓库列表
importCityList: [], // 进口地址
customerSelect: [],
serviceUserList: [],
zhongLines: [], // 重货线路
paoLines: [], // 泡货线路
} }
}, },
methods: { methods: {
lazyLoad(node, resolve) {
},
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
this.open = false; this.open = false;
...@@ -418,7 +467,7 @@ export default { ...@@ -418,7 +467,7 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (!valid) { if (!valid) {
// return; return;
} }
// 修改的提交 // 修改的提交
if (this.form.id != null) { if (this.form.id != null) {
...@@ -443,7 +492,7 @@ export default { ...@@ -443,7 +492,7 @@ export default {
id: undefined, id: undefined,
number: undefined, number: undefined,
name: undefined, name: undefined,
level: undefined, level: 1,
country: undefined, country: undefined,
type: undefined, type: undefined,
agentId: undefined, agentId: undefined,
...@@ -460,9 +509,10 @@ export default { ...@@ -460,9 +509,10 @@ export default {
customerService: undefined, customerService: undefined,
customerContacts: [], customerContacts: [],
customerLines: [], customerLines: [],
lightUnit: undefined,
promoter: undefined, promoter: undefined,
status: undefined, status: undefined,
founder: undefined, founder: this.$store.getters.userId,
department: undefined, department: undefined,
invoiceTitle: undefined, invoiceTitle: undefined,
licenseNumber: undefined, licenseNumber: undefined,
...@@ -475,18 +525,58 @@ export default { ...@@ -475,18 +525,58 @@ export default {
remarks: undefined, remarks: undefined,
arrivalConfirm: undefined, arrivalConfirm: undefined,
weightUnit: undefined, weightUnit: undefined,
createTime: undefined
}; };
this.resetForm("form"); this.resetForm("form");
}, },
getCustomer(id) { getCustomer(id) {
this.reset();
getCustomer(id).then(response => { getCustomer(id).then(response => {
this.form = { ...this.form, ...response.data }; this.form = { ...this.form, ...response.data };
this.open = true; this.open = true;
this.title = "修改客户"; this.title = "修改客户";
}); });
}, },
updateCustomerLines() {
let zhongLines = [], paoLines = []
if (this.zhongLines.length > 0) {
zhongLines = this.zhongLines
}
if (this.paoLines.length > 0) {
paoLines = this.paoLines
}
this.form.customerLines = [...zhongLines, ...paoLines]
},
handleAddContact() {
this.form.customerContacts.push({
"areaCode": "",
// "customerId": 0,
"department": "",
"email": "",
"isDefault": undefined,
"name": "",
"phoneNew": "",
"position": "",
"social": undefined,
"socialNumber": "",
// "userid": 0,
// "username": ""
})
}
},
computed: {
productListFilter(){
return this.productList.filter((p) => p.typeId === this.form.productType)
}
},
watch: {
zhongLines() {
console.log('zhongLines')
this.updateCustomerLines()
},
paoLines() {
console.log('paoLines')
this.updateCustomerLines()
}
} }
} }
</script> </script>
......
...@@ -91,6 +91,8 @@ ...@@ -91,6 +91,8 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
v-hasPermi="['ecw:customer:query']">查看</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:customer:update']">修改</el-button> v-hasPermi="['ecw:customer:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
...@@ -600,6 +602,10 @@ export default { ...@@ -600,6 +602,10 @@ export default {
// this.open = true; // this.open = true;
// this.title = "添加客户"; // this.title = "添加客户";
}, },
/** 查看按钮操作 */
handleView(row) {
this.$router.push('/customer/query/' + row.id)
},
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.$router.push('/customer/edit/' + row.id) this.$router.push('/customer/edit/' + row.id)
......
<template>
<div>
<el-row type="flex" style="margin-top: 15px;margin-bottom: 15px" justify="center">
<el-col :xs="24" :sm="24" :md="24" :lg="20" :xl="16">
<div style="display: flex;justify-content: space-between;align-items: flex-end;">
<h2>查看</h2>
<div>
<el-button type="primary" size="small">添加优惠</el-button>
<el-button type="primary" size="small" @click="$router.push('/customer/edit/' + customerId)">编辑</el-button>
<el-button type="primary" size="small">报价</el-button>
<el-button type="primary" size="small" @click="customerFollow.dialogVisible = true">跟进</el-button>
<el-button type="primary" size="small">客诉</el-button>
<el-button type="danger" size="small">删除</el-button>
</div>
</div>
<el-card style="margin-top: 15px;">
<el-descriptions :column="4" border>
<el-descriptions-item label="客户编号">{{ customer.number }}</el-descriptions-item>
<el-descriptions-item label="客户名称">{{ customer.name }}</el-descriptions-item>
<el-descriptions-item label="结算方式">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_BALANCE, customer.balance) }}</el-descriptions-item>
<el-descriptions-item label="客户生日">{{ customer.birthday }}</el-descriptions-item>
<el-descriptions-item label="客户等级">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_LEVEL, customer.level) }}</el-descriptions-item>
<el-descriptions-item label="国家">{{ getDictDataLabel(DICT_TYPE.COUNTRY, customer.country) }}</el-descriptions-item>
<!-- <el-descriptions-item label="业务员">{{ customer }}</el-descriptions-item>-->
<el-descriptions-item label="客户来源">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_SOURCE, customer.source) }}</el-descriptions-item>
<el-descriptions-item label="客户类别">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_TYPE, customer.type) }}</el-descriptions-item>
<!-- <el-descriptions-item label="联系方式">{{ customer }}</el-descriptions-item>-->
<el-descriptions-item label="推介人">{{ customer.promoter }}</el-descriptions-item>
<el-descriptions-item label="跟进客服">{{ customer.customerService }}</el-descriptions-item>
<el-descriptions-item label="公司名称">{{ customer.company }}</el-descriptions-item>
<el-descriptions-item label="联系地址">{{ customer.address }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ customer.createTime }}</el-descriptions-item>
<el-descriptions-item label="状态">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_STATUS, customer.status) }}</el-descriptions-item>
<el-descriptions-item label="主营类别">{{ productType }}</el-descriptions-item>
<el-descriptions-item label="常提货网点">{{ pickupPoint }}</el-descriptions-item>
<el-descriptions-item label="图片">
<el-image :src="customer.picture" style="width: 100px;height: 100px"></el-image>
</el-descriptions-item>
<el-descriptions-item label="备注">{{ customer.remarks }}</el-descriptions-item>
<!-- <el-descriptions-item label="信用等级">{{ customer }}</el-descriptions-item>-->
</el-descriptions>
</el-card>
<el-card style="margin-top: 15px">
<h3>联系人</h3>
<el-table
:data="customer.customerContacts"
style="width: 100%"
border
>
<el-table-column
prop="department"
label="部门"
>
</el-table-column>
<el-table-column
prop="position"
label="职位"
>
</el-table-column>
<el-table-column
prop="name"
label="联系人"
>
</el-table-column>
<el-table-column
prop="phoneNew"
label="联系方式"
>
</el-table-column>
<el-table-column
prop="username"
label="关联账号"
>
</el-table-column>
<el-table-column
prop="social"
label="社交软件"
>
</el-table-column>
<el-table-column
prop="socialNumber"
label="社交软件号码"
>
</el-table-column>
<el-table-column
prop="email"
label="邮箱"
>
</el-table-column>
</el-table>
</el-card>
<el-tabs style="margin-top: 15px" type="border-card">
<el-tab-pane label="订单">
订单
</el-tab-pane>
<el-tab-pane label="报价">
<el-table
:data="[]"
style="width: 100%"
>
<el-table-column
prop=""
label="序号"
>
</el-table-column>
<el-table-column
prop=""
label="报价单号"
>
</el-table-column>
<el-table-column
prop=""
label="订单号"
>
</el-table-column>
<el-table-column
prop=""
label="客户名称"
>
</el-table-column>
<el-table-column
prop=""
label="目的地"
>
</el-table-column>
<el-table-column
prop=""
label="销售阶段"
>
</el-table-column>
<el-table-column
prop=""
label="预计结束时间"
>
</el-table-column>
<el-table-column
prop=""
label="负责人"
>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="跟进">
<el-table
:data="customerFollowList"
style="width: 100%"
>
<el-table-column
prop=""
label="#"
>
</el-table-column>
<el-table-column
prop="followType"
label="跟进类型"
>
</el-table-column>
<el-table-column
prop="contactName"
label="联系人"
>
</el-table-column>
<el-table-column
prop="followMethod"
label="跟进方式"
>
</el-table-column>
<el-table-column
prop="followTime"
label="跟进时间"
>
</el-table-column>
<el-table-column
prop="feedback"
label="客户反馈"
>
</el-table-column>
<el-table-column
prop="result"
label="处理结果"
>
</el-table-column>
<el-table-column
prop="followUserId"
label="跟进业务"
>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="客户投诉">
<el-table
:data="[]"
style="width: 100%"
>
<el-table-column
prop=""
label="序号"
>
</el-table-column>
<el-table-column
prop=""
label="投诉编号"
>
</el-table-column>
<el-table-column
prop=""
label="投诉类型"
>
</el-table-column>
<el-table-column
prop=""
label="投诉时间"
>
</el-table-column>
<el-table-column
prop=""
label="投诉内容"
>
</el-table-column>
<el-table-column
prop=""
label="登记客服"
>
</el-table-column>
<el-table-column
prop=""
label="提单号"
>
</el-table-column>
<el-table-column
prop=""
label="状态"
>
</el-table-column>
<el-table-column
prop=""
label="查明原因"
>
</el-table-column>
<el-table-column
prop=""
label="处理时间"
>
</el-table-column>
<el-table-column
prop=""
label="处理结果"
>
</el-table-column>
<el-table-column
prop=""
label="赔偿金额"
>
</el-table-column>
<el-table-column
prop=""
label="操作"
>
<template v-slot="{row}">
<el-button size="mini" type="text" icon="el-icon-view" @click=""
v-hasPermi="['ecw:customer:query']">编辑</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="账单">
</el-tab-pane>
<el-tab-pane label="数据">
</el-tab-pane>
<el-tab-pane label="品牌授权">
</el-tab-pane>
<el-tab-pane label="信用日志">
</el-tab-pane>
<el-tab-pane label="等级日志">
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
<el-dialog
title="客户跟进"
:visible.sync="customerFollow.dialogVisible"
:close-on-click-modal="false"
width="680px">
<el-form ref="customerFollowForm" :model="customerFollow.form" label-width="80px">
<el-row :gutter="10">
<el-col>
<el-form-item label="跟进类型" required>
<dict-selector form-type="radio" v-model="customerFollow.form.followType" :type="DICT_TYPE.CUSTOMER_FOLLOW_TYPE"></dict-selector>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="跟进时间" required>
<el-date-picker v-model="customerFollow.form.followTime" type="datetime" placeholder="选择跟进时间"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人" required>
<el-select v-model="customerFollow.form.contactName" placeholder="请选择">
<el-option
v-for="item in customerContactsList"
:key="item.name"
:label="item.name"
:value="item.name">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="跟进业务" required>
<el-select v-model="customerFollow.form.followUserId" placeholder="请选择">
<el-option
v-for="item in serviceUserList"
:key="item.id"
:label="item.nickname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="跟进方式" required>
<dict-selector v-model="customerFollow.form.followMethod" :type="DICT_TYPE.CUSTOMER_FOLLOW_METHOD"></dict-selector>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="客户反馈" required>
<el-input type="textarea" v-model="customerFollow.form.feedback"></el-input>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="处理结果" required>
<el-input type="textarea" v-model="customerFollow.form.result"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="customerFollow.dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="customerFollowSubmit">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getCustomer } from '@/api/ecw/customer'
import { DICT_TYPE, getDictDataLabel } from '@/utils/dict'
import { getProductTypeList } from '@/api/ecw/productType'
import { getNodeList } from '@/api/ecw/node'
import DictSelector from "@/components/DictSelector"
import {getCustomerContactsList} from "@/api/ecw/customerContacts"
import {listServiceUser} from "@/api/system/user"
import {createCustomerFollow, getCustomerFollowPage} from "@/api/ecw/customerFollow"
export default {
name: 'query',
props: {
customerId: String
},
components: {
DictSelector
},
created() {
getNodeList().then(r => {
this.nodeList = r.data
})
getCustomer(this.customerId).then(response => {
this.customer = { ...this.customer, ...response.data }
})
getProductTypeList().then(r => {
this.productTypeList = r.data
})
this.resetCustomerFollowForm()
getCustomerContactsList().then(r => {
// todo 接口不对,分页了
this.customerContactsList = r.data.list
})
listServiceUser().then(r => {
this.serviceUserList = r.data
})
this.getCustomerFollowList()
},
data() {
return {
DICT_TYPE,
getDictDataLabel,
nodeList: [],
productTypeList: [],
customerContactsList: [],
serviceUserList: [],
customerFollowList: [],
customer: {
id: undefined,
number: undefined,
name: undefined,
level: undefined,
country: undefined,
type: undefined,
agentId: undefined,
company: undefined,
address: undefined,
productType: undefined,
productId: undefined,
pickupPoint: undefined,
memberId: undefined,
birthday: undefined,
balance: undefined,
source: undefined,
picture: undefined,
customerService: undefined,
customerContacts: [],
customerLines: [],
promoter: undefined,
status: undefined,
founder: undefined,
department: undefined,
invoiceTitle: undefined,
licenseNumber: undefined,
bank: undefined,
bankNumber: undefined,
project: undefined,
billingAddress: undefined,
billingTell: undefined,
taxRate: undefined,
remarks: undefined,
arrivalConfirm: undefined,
weightUnit: undefined,
createTime: undefined
},
customerFollow: {
dialogVisible: true,
form: {}
},
}
},
methods: {
customerFollowSubmit() {
this.$refs["customerFollowForm"].validate(valid => {
if (!valid) {
return
}
createCustomerFollow(this.customerFollow.form).then(r => {
this.resetCustomerFollowForm()
this.getCustomerFollowList()
this.customerFollow.dialogVisible = false
})
})
},
resetCustomerFollowForm() {
this.customerFollow.form = {
"bizId": this.customerId,
"contactName": undefined,
"feedback": undefined,
"followMethod": undefined,
"followTime": undefined,
"followType": undefined,
"followUserId": undefined,
"result": undefined
}
},
getCustomerFollowList() {
getCustomerFollowPage({bizId: this.customerId}).then(r => {
this.customerFollowList = r.data.list
})
}
},
computed: {
productType(){
const productType = this.productTypeList.find(p => p.id === parseInt(this.customer.productType))
return productType ? productType.titleZh : ''
},
pickupPoint(){
const pickupPoint = this.nodeList.find(p => p.id === parseInt(this.customer.pickupPoint))
return pickupPoint ? pickupPoint.titleZh : ''
}
}
}
</script>
<style scoped>
</style>
<template>
<view>
<el-row type="flex" style="margin-top: 15px;margin-bottom: 15px" justify="center">
<el-col :xs="24" :sm="24" :md="24" :lg="20" :xl="16">
<h2></h2>
<el-row :gutter="10">
<el-col>
<h2>查看</h2>
</el-col>
<el-col>
<el-button type="primary">主要按钮</el-button>
<el-button type="primary">主要按钮</el-button>
<el-button type="primary">主要按钮</el-button>
<el-button type="primary">主要按钮</el-button>
<el-button type="primary">主要按钮</el-button>
<el-button type="danger">危险按钮</el-button>
</el-col>
</el-row>
</el-col>
</el-row>
</view>
</template>
<script>
export default {
name: 'view'
}
</script>
<style scoped>
</style>
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
type:Array, type:Array,
default:()=>[] default:()=>[]
}, },
value:String, value:[String , Number],
labelKey:{ labelKey:{
type:String, type:String,
default:'label' default:'label'
...@@ -32,9 +32,15 @@ export default { ...@@ -32,9 +32,15 @@ export default {
selectVal:'' selectVal:''
} }
}, },
mounted() {
this.selectVal = this.value;
},
watch:{ watch:{
selectVal(val){ selectVal(val){
this.$emit('input',val) this.$emit('input',val)
},
value(val){
this.selectVal = val;
} }
} }
} }
......
<template>
<el-form>
<el-form-item label="商品类型">
<div class="shanping-type">
<div class="tool">
<el-input placeholder="商品"></el-input>
</div>
<div class="box">
<div class="label">
商品类型
</div>
<div class="custom">
<custom-selectors-dictionary label-key="attrName" value-key="id" :options="commodityType"></custom-selectors-dictionary>
</div>
</div>
<div class="box">
<div class="label">
佣金
</div>
<div class="custom">
<el-input></el-input>
</div>
<div class="custom">
<custom-selectors-dictionary :options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
</div>
<div class="custom">
<custom-selectors-dictionary :options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
</div>
</div>
<div>
<el-button type="primary">添加</el-button>
</div>
</div>
</el-form-item>
</el-form>
</template>
<script>
//暗涌加产品
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import customSelectorsDictionary from "@/views/ecw/customerCommissionInfo/customSelectorsDictionary";
export default {
name: "darkServantAndProduct",
components:{
customSelectorsDictionary
},
props:{
commodityType:{
type:Array,
default:()=>[]
}
},
data(){
return{
DICT_TYPE,
getDictDatas,
}
},
mounted() {
console.log(this.commodityType,'commodityType')
},
watch:{
}
}
</script>
<style scoped lang="scss">
.shanping-type {
display: flex;
.tool {
width: 150px;
}
.box {
margin-left: 20px;
display: flex;
.label {
width: 80px;
vertical-align: middle;
font-size: 14px;
color: #606266;
font-weight: 700;
}
.custom {
width: 150px;
margin-right:10px;
}
}
}
</style>
<template>
<div>
<div class="column">
<div class="label">
佣金:
</div>
<div class="content">
<div class="item label"></div>
<div class="item"><el-input></el-input></div>
<div class="item"> <custom-selectors-dictionary :options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary></div>
<div class="item">
<custom-selectors-dictionary :options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
</div>
</div>
<div class="content">
<div class="item label"></div>
<div class="item"><el-input></el-input></div>
<div class="item"> <custom-selectors-dictionary :options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary></div>
<div class="item">
<custom-selectors-dictionary :options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
</div>
</div>
<el-button>添加</el-button>
</div>
</div>
</template>
<script>
//暗佣-达标返佣
import customSelectorsDictionary from "@/views/ecw/customerCommissionInfo/customSelectorsDictionary";
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
export default {
name: "darkServantAndRebate",
components:{
customSelectorsDictionary
},
data(){
return{
DICT_TYPE,
getDictDatas
}
}
}
</script>
<style scoped lang="scss">
.column{
display: flex;
align-items: center;
.label{
width: 50px;
white-space: nowrap;
vertical-align: middle;
font-size: 14px;
color: #606266;
font-weight: 700;
}
}
.content{
display: flex;
align-items: center;
margin-right: 10px;
.item{
text-align: right;
width: 150px;
margin: 0 5px;
}
.label{
width: 50px;
}
}
</style>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :inline="true"> <el-form :rules="rules" :model="form" ref="form" :inline="true" >
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="客户名称"> <el-form-item label="客户名称" prop="customerId">
<el-select <el-select
v-model="customerForm.name" v-model="customerForm.name"
filterable filterable
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
:value="item.id.toString()" :value="item.id.toString()"
:label="item.name" :label="item.name"
> >
{{item.number}}|{{item.name}}|{{item.defaultContactPhone}} {{ item.number }}|{{ item.name }}|{{ item.defaultContactPhone }}
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -25,38 +25,42 @@ ...@@ -25,38 +25,42 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="运输方式"> <el-form-item label="运输方式" prop="transportId">
<div style="width: 130px;"> <div style="width: 130px;">
<custom-selectors-dictionary :options="getDictDatas(DICT_TYPE.ECW_TRANSPORT_TYPE)"></custom-selectors-dictionary> <custom-selectors-dictionary v-model="form.transportId"
:options="getDictDatas(DICT_TYPE.ECW_TRANSPORT_TYPE)"></custom-selectors-dictionary>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="5">
<el-form-item label="始发地"> <el-form-item label="始发地" prop="departureId">
<div style="width: 130px;"> <div style="width: 130px;">
<custom-selectors-dictionary v-model="value" :options="getDictDatas(DICT_TYPE.COUNTRY)"></custom-selectors-dictionary> <custom-selectors-dictionary label-key="titleZh" value-key="id" v-model="form.departureId"
:options="exportCityList"></custom-selectors-dictionary>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="5">
<el-form-item label="目的地"> <el-form-item label="目的地" prop="objectiveId">
<div style="width: 130px;"> <div style="width: 130px;">
<custom-selectors-dictionary v-model="value" :options="getDictDatas(DICT_TYPE.COUNTRY)"></custom-selectors-dictionary> <custom-selectors-dictionary label-key="titleZh" value-key="id" v-model="form.objectiveId"
:options="importCityList"></custom-selectors-dictionary>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="报关方式"> <el-form-item label="报关方式" prop="customsType">
<div style="width: 130px;"> <div style="width: 130px;">
<custom-selectors-dictionary v-model="value" :options="getDictDatas(DICT_TYPE.SHIPPING_DECLARATION_TYPE)"></custom-selectors-dictionary> <custom-selectors-dictionary v-model="form.customsType"
:options="getDictDatas(DICT_TYPE.SHIPPING_DECLARATION_TYPE)"></custom-selectors-dictionary>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="备案"> <el-form-item label="备案" prop="approval">
<div style="width: 130px;"> <div style="width: 130px;">
<custom-selectors-dictionary v-model="value" :options="getDictDatas(DICT_TYPE.COMMISSION_PRODUCT_APPROVAL)"></custom-selectors-dictionary> <custom-selectors-dictionary v-model="form.approval"
:options="getDictDatas(DICT_TYPE.COMMISSION_PRODUCT_APPROVAL)"></custom-selectors-dictionary>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -65,33 +69,162 @@ ...@@ -65,33 +69,162 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="佣金类型(明佣、暗佣)"> <el-form-item label="佣金类型(明佣、暗佣)">
<el-radio-group v-model="form.type"> <el-radio-group v-model="form.type">
<el-radio v-for="(item,index) in getDictDatas(DICT_TYPE.COMMISSION_TYPE)" :label="item.value" :key="index">{{item.label}}</el-radio> <el-radio v-for="(item,index) in getDictDatas(DICT_TYPE.COMMISSION_TYPE)" :label="item.value"
:key="index">{{ item.label }}
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="返佣类型"> <el-form-item label="返佣类型" v-if="form.type == 2">
<el-radio-group v-model="form.darkReturnType"> <el-radio-group v-model="form.darkReturnType">
<el-radio v-for="(item,index) in getDictDatas(DICT_TYPE.COMMISSION_DARK_TYPE)" :label="item.value":key="index">{{item.label}}</el-radio> <el-radio v-for="(item,index) in getDictDatas(DICT_TYPE.COMMISSION_DARK_TYPE)" :label="item.value"
:key="index">{{ item.label }}
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<dark-servant-and-product :commodityType="commodityType"></dark-servant-and-product> <div class="ming-servant" v-if="form.type == 1">
<dark-servant-and-rebate></dark-servant-and-rebate> <div class="label">佣金</div>
<ming-servant-and-dark-servant></ming-servant-and-dark-servant> <div class="content">
<div>
<el-input v-model="mingServantFrom[0].refund"></el-input>
</div>
<div>
<custom-selectors-dictionary v-model="mingServantFrom[0].refundCurrency"
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
</div>
<div>
<custom-selectors-dictionary v-model="mingServantFrom[0].refundUnit"
:options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
</div>
</div>
</div>
<el-form v-if="form.type == 2 && form.darkReturnType == 1">
<el-form-item label="商品类型" v-for="(item,index) in darkServantAndProductForm" :key="index">
<div class="shanping-type">
<div class="tool">
<custom-selectors-dictionary v-model="item.productType" :options="commodity" label-key="titleZh"
value-key="id"></custom-selectors-dictionary>
</div>
<div class="box">
<div class="label">
商品特性
</div>
<div class="custom">
<custom-selectors-dictionary v-model="item.productAttr" label-key="attrName" value-key="id"
:options="commodityType"></custom-selectors-dictionary>
</div>
</div>
<div class="box">
<div class="label">
佣金
</div>
<div class="custom">
<el-input v-model="item.darkCommission"></el-input>
</div>
<div class="custom">
<custom-selectors-dictionary v-model="item.darkCurrency"
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
</div>
<div class="custom">
<custom-selectors-dictionary v-model="item.darkUnit"
:options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
</div>
</div>
<div>
<el-button type="primary" @click="addToFn(1)" v-if="darkServantAndProductForm.length - 1 === index">添加</el-button>
</div>
</div>
</el-form-item>
</el-form>
<div class="column" v-if="form.type == 2 && form.darkReturnType == 2">
<div style="margin-bottom: 10px" v-for="(item,index) in darkServantAndRebateForm" :key="index">
<div class="label">
佣金:
</div>
<div class="content">
<div class="item label"></div>
<div class="item">
<el-input v-model="item.amount"></el-input>
</div>
<div class="item">
<custom-selectors-dictionary v-model="item.amountCurrency"
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
</div>
<div class="item">
<custom-selectors-dictionary v-model="item.amountUnit"
:options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
</div>
</div>
<div class="content">
<div class="item label"></div>
<div class="item">
<el-input v-model="item.refund"></el-input>
</div>
<div class="item">
<custom-selectors-dictionary v-model="item.refundCurrency"
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
</div>
<div class="item">
<custom-selectors-dictionary v-model="item.refundUnit"
:options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
</div>
</div>
<el-button @click="addToFn(2)" v-show="darkServantAndRebateForm.length -1 === index">添加</el-button>
</div>
</div>
<div class="mingServantAndDarkServant" v-if="form.type == 3">
<div class="box">
<div class="label">暗佣佣金:</div>
<div class="content">
<div class="item">
<el-input v-model="mingServantAnddarkServant[0].refund"></el-input>
</div>
<div class="item">
<custom-selectors-dictionary v-model="mingServantAnddarkServant[0].refundCurrency"
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
</div>
<div class="item">
<custom-selectors-dictionary v-model="mingServantAnddarkServant[0].refundUnit"
:options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
</div>
</div>
</div>
<div class="title">
<span class="label">成本价:</span>原价-暗佣佣金
</div>
<div class="box">
<div class="label">销售价上调:</div>
<div class="content">
<div class="item">
<el-input v-model="mingServantAnddarkServant[0].darkAdjustCommission"></el-input>
</div>
<div class="item">
<custom-selectors-dictionary v-model="mingServantAnddarkServant[0].darkAdjustCurrency"
:options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
</div>
<div class="item">
<custom-selectors-dictionary v-model="mingServantAnddarkServant[0].darkAdjustUnit"
:options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
</div>
</div>
</div>
<div class="title">
<span class="label"> 实际佣金返点:</span>销售价-成本价
</div>
</div>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="50"> <el-row>
<el-col :span="12" style="text-align: right"> <el-col :span="12" style="margin-top: 20px">
<el-button type="primary">确定</el-button> <el-button style="width:200px;margin: 0 40px" type="primary" @click="submitForm">确定</el-button>
</el-col> <el-button style="width:200px">取消</el-button>
<el-col :span="12">
<el-button>取消</el-button>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
...@@ -101,69 +234,131 @@ ...@@ -101,69 +234,131 @@
<script> <script>
import { import {
itemTypeListApi, itemTypeListApi,
customerDropDownList customerDropDownList, commodityList,createCommission
} from "@/api/ecw/customerCommissionInfo"; } from "@/api/ecw/customerCommissionInfo";
import {DICT_TYPE, getDictDatas} from "@/utils/dict"; import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import customSelectorsDictionary from "./customSelectorsDictionary" import customSelectorsDictionary from "./customSelectorsDictionary"
import darkServantAndProduct from "./darkServantAndProduct" import {getTradeCityList} from "@/api/ecw/region";
import darkServantAndRebate from "@/views/ecw/customerCommissionInfo/darkServantAndRebate"; import RoutersSelector from "@/components/RoutersSelector"
import mingServantAndDarkServant from "@/views/ecw/customerCommissionInfo/mingServantAndDarkServant";
export default { export default {
name: "CustomerCommissionInfo", name: "CustomerCommissionInfo",
components: { components: {
customSelectorsDictionary, customSelectorsDictionary,
darkServantAndProduct, RoutersSelector
darkServantAndRebate,
mingServantAndDarkServant
}, },
data() { data() {
return { return {
value:'', value: '',
getDictDatas, getDictDatas,
DICT_TYPE, DICT_TYPE,
commodityType:[], commodityType: [],
tradeCityList: [],
// 表单参数 // 表单参数
form: { form: {
approval:"",// 产品备案 approval: undefined,// 产品备案
customerCommissionInfoBaseVOList:[],// 佣金详情 customerCommissionInfoBaseVOList: [],// 佣金详情
customerId:'',//客户id customerId: undefined,//客户id
customsType:'',//报关类别:我司全代:1,自单代报:2,混合报关:3 customsType: undefined,//报关类别:我司全代:1,自单代报:2,混合报关:3
darkReturnType:this.getDictDatas(this.DICT_TYPE.COMMISSION_DARK_TYPE),// 暗佣类型 1产品2达标 darkReturnType: this.getDictDatas(this.DICT_TYPE.COMMISSION_DARK_TYPE)[0].value,// 暗佣类型 1产品2达标
departureId:'',// 始发地id departureId: undefined,// 始发地id
objectiveId:"",// 运输方式 objectiveId: undefined,//目的地id
type:this.getDictDatas(this.DICT_TYPE.COMMISSION_TYPE)[0].value,// 佣金类型 transportId:undefined,//运输方式
type: this.getDictDatas(this.DICT_TYPE.COMMISSION_TYPE)[1].value,// 佣金类型
}, },
customerForm:{ //明佣
defaultContactName:undefined, mingServantFrom: [
defaultContactPhone:undefined, {
name:undefined, refund: 0,
number:undefined, refundCurrency:this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,
refundUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,
}
],
//暗佣金+产品
darkServantAndProductForm: [
{
productType:undefined,//商品类型
productAttr: undefined,//暗佣 产品属性
darkCommission: 0,//暗佣 佣金
darkCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,// 暗佣 货币
darkUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,// 暗佣 单位
}
],
//暗佣+达标返佣
darkServantAndRebateForm: [
{
amount: 0,// 暗佣-满减金额
amountCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,// 暗佣-满减金额对应货币
amountUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,// 暗佣-满减金额对应单位,
refund: 0,//暗佣-满之后返还金额
refundCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,//暗佣-满之后返还金额的货币
refundUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,//暗佣-满之后返还金额的单位
}
],
//暗佣+明金
mingServantAnddarkServant: [
{
refund: 0,// 暗佣+明佣 上调金额
refundCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,// 暗佣+明佣 上调对应的货币
refundUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,//暗佣+明佣 上调对应的单位
darkAdjustCommission: 0,//暗佣+明佣 上调金额
darkAdjustCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,//暗佣+明佣 上调对应的货币
darkAdjustUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,//暗佣+明佣 上调对应的单位
}
],
customerForm: {
defaultContactName: undefined,
defaultContactPhone: undefined,
name: undefined,
number: undefined,
}, },
customeList:[], customeList: [],
commodity: [],
// 表单校验 // 表单校验
rules: { rules: {
commissionId: [{required: true, message: "佣金表id不能为空", trigger: "blur"}], customerId: [{required: true, message: "客户名称不能为空", trigger: "blur"}],
departureId: [{required: true, message: "客户名称不能为空", trigger: "blur"}],
transportId: [{required: true, message: "运输方式不能为空", trigger: "blur"}],
objectiveId: [{required: true, message: "客户名称不能为空", trigger: "blur"}],
customsType: [{required: true, message: "客户名称不能为空", trigger: "blur"}],
approval: [{required: true, message: "客户名称不能为空", trigger: "blur"}],
}, },
customerShow:true customerShow: true
}; };
}, },
computed:{
importCityList(){
return this.tradeCityList.filter(item => item.type == 1)
},
exportCityList(){
return this.tradeCityList.filter(item => item.type == 2)
},
},
created() { created() {
this.getItemType(); this.getItemType();
commodityList().then(res => {
console.log(res, 'res');
this.commodity = res.data
this.darkServantAndProductForm.forEach(item=>{item.productType =this.commodity[0].id})
})
getTradeCityList().then(res => {
this.tradeCityList = res.data
})
}, },
methods: { methods: {
// /** 查询列表客户*/ // /** 查询列表客户*/
getCustomeList() { getCustomeList() {
customerDropDownList(this.customerForm).then(res=>{ customerDropDownList(this.customerForm).then(res => {
console.log(res); console.log(res);
if(res.code === 0){ if (res.code === 0) {
this.customeList = res.data this.customeList = res.data
} }
}) })
}, },
remoteMethod(val){ remoteMethod(val) {
this.customerForm.name = val; this.customerForm.name = val;
this.form.customerId = val;
this.getCustomeList(); this.getCustomeList();
}, },
/** 取消按钮 */ /** 取消按钮 */
...@@ -172,44 +367,65 @@ export default { ...@@ -172,44 +367,65 @@ export default {
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
this.form = { this.form = {
id: undefined, approval: undefined,
commissionId: undefined, customerCommissionInfoBaseVOList: [],
productType: undefined, customerId: undefined,//客户id
productAttr: undefined, customsType: undefined,//报关类别:我司全代:1,自单代报:2,混合报关:3
darkCommission: undefined, darkReturnType: this.getDictDatas(this.DICT_TYPE.COMMISSION_DARK_TYPE)[0].value,// 暗佣类型 1产品2达标
darkCurrency: undefined, departureId: undefined,// 始发地id
darkUnit: undefined, objectiveId: undefined,// 运输方式
darkAdjustCommission: undefined, type: this.getDictDatas(this.DICT_TYPE.COMMISSION_TYPE)[1].value,// 佣金类型
darkAdjustCurrency: undefined,
darkAdjustUnit: undefined,
amount: undefined,
amountCurrency: undefined,
amountUnit: undefined,
refundCurrency: undefined,
refund: undefined,
refundUnit: undefined,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ //添加多条
handleQuery() { addToFn(val){
}, if(val === 1){
/** 重置按钮操作 */ this.darkServantAndProductForm.push( {
resetQuery() { productType:this.commodity[0].id,//商品类型
}, productAttr: this.commodityType[0].id,//暗佣 产品属性
/** 新增按钮操作 */ darkCommission: 0,//暗佣 佣金
handleAdd() { darkCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,// 暗佣 货币
darkUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,// 暗佣 单位
})
}else {
this.darkServantAndRebateForm.push( {
amount: 0,// 暗佣-满减金额
amountCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,// 暗佣-满减金额对应货币
amountUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,// 暗佣-满减金额对应单位,
refund: 0,//暗佣-满之后返还金额
refundCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,//暗佣-满之后返还金额的货币
refundUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,//暗佣-满之后返还金额的单位
})
}
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs.form.validate ((valid)=>{
if(!valid)return
console.log(valid,'1234')
if (this.form.type == 1) {
this.form.customerCommissionInfoBaseVOList = this.mingServantFrom
} else if (this.form.type == 2) {
if (this.form.darkReturnType == 1) {
this.form.customerCommissionInfoBaseVOList = this.darkServantAndProductForm
} else {
this.form.customerCommissionInfoBaseVOList = this.darkServantAndRebateForm
}
} else if (this.form.type == 3) {
this.form.customerCommissionInfoBaseVOList = this.mingServantAnddarkServant
}
createCommission(this.form).then(r =>{
console.log(r)
})
})
}, },
// 商品类型
// 商品类型 getItemType() {
getItemType(){ itemTypeListApi().then(res => {
itemTypeListApi().then(res=>{ if (res.code === 0) {
if(res.code === 0){
this.commodityType = res.data; this.commodityType = res.data;
this.darkServantAndProductForm.forEach(item =>{item.productAttr = this.commodityType[0].id})
} }
}) })
}, },
...@@ -217,4 +433,120 @@ export default { ...@@ -217,4 +433,120 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mingServantAndDarkServant {
margin-top: 10px;
.box {
display: flex;
align-items: center;
.label {
vertical-align: middle;
font-size: 14px;
color: #606266;
font-weight: 700;
}
.content {
display: flex;
align-items: center;
.item {
margin-right: 20px;
}
}
}
.title {
margin: 15px 0;
.label {
vertical-align: middle;
font-size: 14px;
color: #606266;
font-weight: 700;
}
}
}
.ming-servant {
display: flex;
align-items: center;
.label {
width: 50px;
white-space: nowrap;
vertical-align: middle;
font-size: 14px;
color: #606266;
font-weight: 700;
}
.content {
display: flex;
div {
margin-right: 10px;
}
}
}
.shanping-type {
display: flex;
.tool {
width: 150px;
}
.box {
margin-left: 20px;
display: flex;
.label {
width: 80px;
vertical-align: middle;
font-size: 14px;
color: #606266;
font-weight: 700;
text-align: left;
}
.custom {
width: 150px;
margin-right: 10px;
}
}
}
.column {
div {
display: flex;
align-items: center;
.label {
width: 26px;
white-space: nowrap;
vertical-align: middle;
font-size: 14px;
color: #606266;
font-weight: 700;
width: 100px;
}
}
.content {
display: flex;
align-items: center;
margin-right: 10px;
.item {
text-align: right;
width: 150px;
margin: 0 5px;
}
.label {
width: 50px;
}
}
}
</style> </style>
<template>
<div>
<div class="mingServantAndDarkServant">
<div class="box">
<div class="label">暗佣佣金:</div>
<div class="content">
<div class="item">
<el-input></el-input>
</div>
<div class="item">
<custom-selectors-dictionary :options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
</div>
<div class="item">
<custom-selectors-dictionary :options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
</div>
</div>
</div>
<div class="title">
<span class="label">成本价:</span>原价-暗佣佣金
</div>
<div class="box">
<div class="label">销售价上调:</div>
<div class="content">
<div class="item">
<el-input></el-input>
</div>
<div class="item">
<custom-selectors-dictionary :options="getDictDatas(DICT_TYPE.COMMISSION_CURRENCY_TYPE)"></custom-selectors-dictionary>
</div>
<div class="item">
<custom-selectors-dictionary :options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
</div>
</div>
</div>
<div class="title">
<span class="label"> 实际佣金返点:</span>销售价-成本价
</div>
</div>
</div>
</template>
<script>
//暗佣+明佣
import customSelectorsDictionary from "@/views/ecw/customerCommissionInfo/customSelectorsDictionary";
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
export default {
name: "mingServantAndDarkServant",
components:{
customSelectorsDictionary
},
data(){
return{
getDictDatas,
DICT_TYPE
}
}
}
</script>
<style scoped lang="scss">
.mingServantAndDarkServant{
margin-top: 10px;
.box{
display: flex;
align-items: center;
.label{
vertical-align: middle;
font-size: 14px;
color: #606266;
font-weight: 700;
}
.content{
display: flex;
align-items: center;
.item{
margin-right: 20px;
}
}
}
.title{
margin: 15px 0;
.label{
vertical-align: middle;
font-size: 14px;
color: #606266;
font-weight: 700;
}
}
}
</style>
...@@ -20,6 +20,15 @@ ...@@ -20,6 +20,15 @@
<el-table-column label="中文名称" align="center" prop="titleZh" /> <el-table-column label="中文名称" align="center" prop="titleZh" />
<el-table-column label="英文名称" align="center" prop="titleEn" /> <el-table-column label="英文名称" align="center" prop="titleEn" />
<el-table-column prop="portType" label="港口类型" align="center">
<template slot-scope="scope">
<div>
{{ portTypeName(scope.row.portType) }}
</div>
</template>
</el-table-column>
<el-table-column label="国家" align="center" prop="countryZh" /> <el-table-column label="国家" align="center" prop="countryZh" />
<el-table-column label="省" align="center" prop="provinceZh" /> <el-table-column label="省" align="center" prop="provinceZh" />
<el-table-column label="城市" align="center" prop="cityZh" /> <el-table-column label="城市" align="center" prop="cityZh" />
...@@ -88,6 +97,11 @@ ...@@ -88,6 +97,11 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="港口类型" prop="portType">
<el-select v-model="form.portType" placeholder="请选择">
<el-option v-for="dict in portTypeDatas" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="码头编号" prop="number"> <el-form-item label="码头编号" prop="number">
<el-input v-model="form.number" placeholder="请输入码头编号" /> <el-input v-model="form.number" placeholder="请输入码头编号" />
...@@ -107,6 +121,7 @@ ...@@ -107,6 +121,7 @@
<script> <script>
import { createDock, updateDock, deleteDock, getDock, getDockPage, exportDockExcel } from "@/api/ecw/dock"; import { createDock, updateDock, deleteDock, getDock, getDockPage, exportDockExcel } from "@/api/ecw/dock";
import { getListTree } from "@/api/ecw/region"; import { getListTree } from "@/api/ecw/region";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
export default { export default {
name: "Dock", name: "Dock",
...@@ -163,10 +178,24 @@ export default { ...@@ -163,10 +178,24 @@ export default {
titleZh: [{ required: true, message: "中文名称不能为空", trigger: "blur" }], titleZh: [{ required: true, message: "中文名称不能为空", trigger: "blur" }],
titleEn: [{ required: true, message: "英文名称不能为空", trigger: "blur" }], titleEn: [{ required: true, message: "英文名称不能为空", trigger: "blur" }],
sort: [{ required: true, message: "排序不能为空", trigger: "blur" }] sort: [{ required: true, message: "排序不能为空", trigger: "blur" }]
} },
portTypeDatas: getDictDatas(DICT_TYPE.ECW_PORT_TYPE)
}; };
}, },
computed: {
portTypeName() {
return portType => {
for(let index in this.portTypeDatas) {
let portTypeItem = this.portTypeDatas[index];
if(portTypeItem.value == portType) {
return portTypeItem.label;
}
}
}
},
},
watch: { watch: {
'form.countryId'(newV, oldV) { 'form.countryId'(newV, oldV) {
if(oldV && oldV != newV) { if(oldV && oldV != newV) {
......
...@@ -121,9 +121,6 @@ ...@@ -121,9 +121,6 @@
</el-dialog> </el-dialog>
<!-- 留言详情--> <!-- 留言详情-->
<el-dialog title="留言详情" :visible.sync="leavingShow" width="500px" append-to-body> <el-dialog title="留言详情" :visible.sync="leavingShow" width="500px" append-to-body>
<el-row class="el-row-leaving" :gutter="10">
<el-col :span="4">客户编号:</el-col><el-col :span="12">{{}}</el-col>
</el-row>
<el-row class="el-row-leaving" :gutter="10"> <el-row class="el-row-leaving" :gutter="10">
<el-col :span="4">姓名:</el-col><el-col :span="12">{{messageVal.name ? messageVal.name : ''}}</el-col> <el-col :span="4">姓名:</el-col><el-col :span="12">{{messageVal.name ? messageVal.name : ''}}</el-col>
</el-row> </el-row>
......
...@@ -213,7 +213,7 @@ export default { ...@@ -213,7 +213,7 @@ export default {
let text = row.status === CommonStatusEnum.ENABLE ? "启用" : "停用"; let text = row.status === CommonStatusEnum.ENABLE ? "启用" : "停用";
this.$modal.confirm('确认要' + text + '"' + row.titleZh + '"吗?').then(function() { this.$modal.confirm('确认要' + text + '"' + row.titleZh + '"吗?').then(function() {
// return changeUserStatus(row.id, row.status); // return changeUserStatus(row.id, row.status);
return updateUnitStatus({id:row.id,status:!row.status?CommonStatusEnum.DISABLE:CommonStatusEnum.ENABLE}); return updateUnitStatus({id:row.id,status:row.status});
}).then(() => { }).then(() => {
this.$modal.msgSuccess(text + "成功"); this.$modal.msgSuccess(text + "成功");
......
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