Commit 4602c8aa authored by dragondean@qq.com's avatar dragondean@qq.com
parents 4cebc320 e53b7e56
...@@ -21,7 +21,7 @@ export function updateChannel(data) { ...@@ -21,7 +21,7 @@ export function updateChannel(data) {
// 删除渠道管理 // 删除渠道管理
export function deleteChannel(id) { export function deleteChannel(id) {
return request({ return request({
url: '/ecw/channel/delete?id=' + id, url: '/ecw/channel/delete?channelId=' + id,
method: 'delete' method: 'delete'
}) })
} }
......
...@@ -3,7 +3,7 @@ import request from '@/utils/request' ...@@ -3,7 +3,7 @@ import request from '@/utils/request'
// 创建优惠券信息 // 创建优惠券信息
export function createCoupon(data) { export function createCoupon(data) {
return request({ return request({
url: '/ecw/coupon/createOrUpdate', url: '/product/coupon/createOrUpdate',
method: 'post', method: 'post',
data: data data: data
}) })
...@@ -12,7 +12,7 @@ export function createCoupon(data) { ...@@ -12,7 +12,7 @@ export function createCoupon(data) {
// 更新优惠券信息 // 更新优惠券信息
export function updateCoupon(data) { export function updateCoupon(data) {
return request({ return request({
url: '/ecw/coupon/update', url: '/product/coupon/update',
method: 'put', method: 'put',
data: data data: data
}) })
...@@ -21,7 +21,7 @@ export function updateCoupon(data) { ...@@ -21,7 +21,7 @@ export function updateCoupon(data) {
// 删除优惠券信息 // 删除优惠券信息
export function deleteCoupon(id) { export function deleteCoupon(id) {
return request({ return request({
url: '/ecw/coupon/delete?id=' + id, url: '/product/coupon/delete?id=' + id,
method: 'delete' method: 'delete'
}) })
} }
...@@ -29,7 +29,7 @@ export function deleteCoupon(id) { ...@@ -29,7 +29,7 @@ export function deleteCoupon(id) {
// 获得优惠券信息 // 获得优惠券信息
export function getCoupon(id) { export function getCoupon(id) {
return request({ return request({
url: '/ecw/coupon/get?couponId=' + id, url: '/product/coupon/get?couponId=' + id,
method: 'get' method: 'get'
}) })
} }
...@@ -37,7 +37,7 @@ export function getCoupon(id) { ...@@ -37,7 +37,7 @@ export function getCoupon(id) {
// 获得优惠券信息分页 // 获得优惠券信息分页
export function getCouponPage(query) { export function getCouponPage(query) {
return request({ return request({
url: '/ecw/coupon/page', url: '/product/coupon/page',
method: 'get', method: 'get',
params: query params: query
}) })
...@@ -46,7 +46,7 @@ export function getCouponPage(query) { ...@@ -46,7 +46,7 @@ export function getCouponPage(query) {
// 获得优惠券下拉 // 获得优惠券下拉
export function getCouponSelect(query) { export function getCouponSelect(query) {
return request({ return request({
url: '/ecw/coupon/select', url: '/product/coupon/select',
method: 'get', method: 'get',
params: query params: query
}) })
...@@ -55,7 +55,7 @@ export function getCouponSelect(query) { ...@@ -55,7 +55,7 @@ export function getCouponSelect(query) {
// 导出优惠券信息 Excel // 导出优惠券信息 Excel
export function exportCouponExcel(query) { export function exportCouponExcel(query) {
return request({ return request({
url: '/ecw/coupon/export-excel', url: '/product/coupon/export-excel',
method: 'get', method: 'get',
params: query, params: query,
responseType: 'blob' responseType: 'blob'
......
...@@ -71,7 +71,7 @@ export function exportCustomerExcel(query) { ...@@ -71,7 +71,7 @@ export function exportCustomerExcel(query) {
}) })
} }
// 待确认客户 // 待接收客户列表
export function getWaitForConfirmList(query) { export function getWaitForConfirmList(query) {
return request({ return request({
url: '/ecw/customer/get-wait-for-confirm', url: '/ecw/customer/get-wait-for-confirm',
...@@ -123,3 +123,22 @@ export function setFishing(query){ ...@@ -123,3 +123,22 @@ export function setFishing(query){
}) })
} }
//待分配 客户列表
export function getCustomerToBeAssigned(query){
return request(
{
url:'ecw/customer/get-wait-for-distribution',
method: 'get',
params: query
}
)
}
//我的客户列表
export function getMyCustomerService(query){
return request({
url:'/ecw/customer/get-mine',
method:'get',
params:query,
})
}
...@@ -18,6 +18,14 @@ export function updateZhongPao(data) { ...@@ -18,6 +18,14 @@ export function updateZhongPao(data) {
}) })
} }
// 删除重泡货配置
export function deleteZhongPao(id) {
return request({
url: '/ecw/zhong-pao/delete?id=' + id,
method: 'delete'
})
}
// 获得重泡货配置 // 获得重泡货配置
export function getZhongPao(id) { export function getZhongPao(id) {
return request({ return request({
......
import request from '@/utils/request'
// 创建帮助文档
export function createHelpDoc(data) {
return request({
url: '/system/help-doc/create',
method: 'post',
data: data
})
}
// 更新帮助文档
export function updateHelpDoc(data) {
return request({
url: '/system/help-doc/update',
method: 'put',
data: data
})
}
// 删除帮助文档
export function deleteHelpDoc(id) {
return request({
url: '/system/help-doc/delete?id=' + id,
method: 'delete'
})
}
// 获得帮助文档
export function getHelpDoc(id) {
return request({
url: '/system/help-doc/get?id=' + id,
method: 'get'
})
}
// 获得帮助文档分页
export function getHelpDocPage(query) {
return request({
url: '/system/help-doc/page',
method: 'get',
params: query
})
}
// 导出帮助文档 Excel
export function exportHelpDocExcel(query) {
return request({
url: '/system/help-doc/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
...@@ -134,7 +134,11 @@ export default { ...@@ -134,7 +134,11 @@ export default {
*/ */
name: "CustomerFollow", name: "CustomerFollow",
props: { props: {
customerId: Number /**
* 如果是客户投诉跟进,则id为客户投诉id;如果是客户跟进,则id为客户id
*/
id: Number,
customerId: Number,
}, },
data() { data() {
return { return {
...@@ -179,7 +183,7 @@ export default { ...@@ -179,7 +183,7 @@ export default {
resetCustomerFollowForm() { resetCustomerFollowForm() {
this.customerFollow.form = { this.customerFollow.form = {
"bizId": this.customerId, "bizId": this.id,
"contactName": undefined, "contactName": undefined,
"feedback": undefined, "feedback": undefined,
"followMethod": undefined, "followMethod": undefined,
...@@ -190,7 +194,7 @@ export default { ...@@ -190,7 +194,7 @@ export default {
} }
}, },
getCustomerFollowList() { getCustomerFollowList() {
getCustomerFollowPage({bizId: this.customerId}).then(r => { getCustomerFollowPage({bizId: this.id}).then(r => {
this.customerFollowList = r.data.list this.customerFollowList = r.data.list
}) })
} }
......
<template>
<div>
<el-dialog
append-to-body
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, index) in customerContactsList"
:key="index"
: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 {createCustomerFollow, getCustomerFollowPage} from "@/api/ecw/customerFollow"
import { DICT_TYPE, getDictDataLabel } from '@/utils/dict'
import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts'
import {listServiceUser} from "@/api/system/user"
import { parseTime } from '@/utils/ruoyi'
export default {
/**
* 客户跟进
* 客户投诉跟进
*/
name: "CustomerFollow",
props: {
/**
* 如果是客户投诉跟进,则id为客户投诉id;如果是客户跟进,则id为客户id
*/
id: Number,
customerId: Number,
},
data() {
return {
DICT_TYPE,
getDictDataLabel,
parseTime,
customerFollowList: [],
serviceUserList: [],
customerContactsList: [],
customerFollow: {
dialogVisible: false,
form: {}
},
}
},
created() {
if (!!this.customerId) getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => {
this.customerContactsList = r.data
})
listServiceUser().then(r => {
this.serviceUserList = r.data
})
},
methods: {
customerFollowSubmit() {
this.$refs["customerFollowForm"].validate(valid => {
if (!valid) {
return
}
createCustomerFollow(this.customerFollow.form).then(r => {
this.resetCustomerFollowForm()
this.customerFollow.dialogVisible = false
})
})
},
resetCustomerFollowForm() {
this.customerFollow.form = {
"bizId":undefined,
"contactName": undefined,
"feedback": undefined,
"followMethod": undefined,
"followTime": undefined,
"followType": undefined,
"followUserId": undefined,
"result": undefined
}
},
},
watch:{
customerId(val){
this.customerFollow.form.bizId = val;
if (!!this.customerId) getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => {
this.customerContactsList = r.data
})
}
}
}
</script>
<style scoped>
</style>
<template> <template>
<el-row class="" :gutter="10"> <el-row class="" :gutter="10">
<el-col :span="10"> <el-col :span="10">
<el-card> <el-card>
<div slot="header" class="header"> <div slot="header" class="header">
<el-select v-model="queryParams.typeId" placeholder="选择类型" style="width:120px" clearable> <el-select v-model="queryParams.typeId" placeholder="选择类型" style="width:120px" clearable>
<el-option v-for="item in typeList" :key="item.id" :label="item.titleZh" :value="item.id" /> <el-option v-for="item in typeList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select> </el-select>
<el-select v-model="queryParams.attrId" placeholder="选择属性" style="width:120px" clearable> <el-select v-model="queryParams.attrId" placeholder="选择属性" style="width:120px" clearable>
<el-option v-for="item in attrList" :key="item.id" :label="item.attrName" :value="item.id" /> <el-option v-for="item in attrList" :key="item.id" :label="item.attrName" :value="item.id" />
</el-select> </el-select>
<el-input v-model="queryParams.titleZh" placeholder="产品关键字" style="width:120px" clearable /> <el-input v-model="queryParams.titleZh" placeholder="产品关键字" style="width:120px" clearable />
<el-button type="primary" @click="reLoad">搜搜</el-button> <el-button type="primary" @click="reLoad">搜搜</el-button>
</div> </div>
<div class="list"> <div class="list">
<div class="item" v-for="item in list" :key="item.id"> <div class="item" v-for="item in list" :key="item.id">
<el-checkbox @change="toggleCheck(item, $event)" :value="ids.indexOf(item.id) > -1" /> {{item.titleZh}} <el-checkbox @change="toggleCheck(item, $event)" :value="ids.indexOf(item.id) > -1" /> {{item.titleZh}}
<div>{{item.titleEn}}</div> <div>{{item.titleEn}}</div>
</div> </div>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-card> <el-card>
<div slot="header" class="header"> <div slot="header" class="header">
已选产品 已选产品
</div> </div>
<div class="list"> <div class="list">
<div class="item" v-for="(choosed) in choosedList" :key="choosed.id" :data-data="JSON.stringify(choosed)"> <div class="item" v-for="(choosed) in choosedList" :key="choosed.id" :data-data="JSON.stringify(choosed)">
<el-link class="el-icon-delete" @click="remove(choosed)" /> {{choosed.titleZh}} <el-link class="el-icon-delete" @click="remove(choosed)" /> {{choosed.titleZh}}
<div>{{choosed.titleEn}}</div> <div>{{choosed.titleEn}}</div>
</div> </div>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
<script> <script>
import {getProductPage} from '@/api/ecw/product' import { getProductPage } from '@/api/ecw/product'
import {getProductTypeList} from '@/api/ecw/productType' import { getProductTypeList } from '@/api/ecw/productType'
import {getProductAttrList} from '@/api/ecw/productAttr' import { getProductAttrList } from '@/api/ecw/productAttr'
export default { export default {
data(){ props: {
return { defaultIds: {
list:[], type: Array,
page: 1, default: []
pages: 1, }
queryParams:{ },
page: 1, data() {
attrId: null, return {
titleZh: null, list: [],
typeId: null page: 1,
}, pages: 1,
choosedList:[], queryParams: {
typeList:[], page: 1,
attrList:[] attrId: null,
} titleZh: null,
typeId: null
},
choosedList: [],
typeList: [],
attrList: []
}
},
computed: {
ids: {
get() {
let arr = []
this.choosedList.forEach(item => {
arr.push(item.id)
})
return arr
},
set(v) {
}
}
},
watch: {
ids(val) {
this.$emit('input', val)
}
},
created() {
getProductTypeList().then(res => this.typeList = res.data)
getProductAttrList().then(res => this.attrList = res.data)
this.reLoad()
this.ids = this.defaultIds //数据回显
},
methods: {
reLoad() {
this.queryParams.page = 1
this.list = []
this.getList()
}, },
computed:{ loadNextPage() {
ids(){ if (this.page >= this.pages) {
let arr = [] return this.$message.error('已加载全部')
this.choosedList.forEach(item => { }
arr.push(item.id) this.queryParams.page++
this.getList()
},
getList() {
getProductPage(this.queryParams).then(res => {
this.list = res.data.list //.concat(res.data.list || [])
this.page = res.data.page
this.pages = res.data.pages
this.choosedList = [] //搜搜重置,数据回显
if (this.defaultIds.length > 0) {
this.defaultIds.map(item => {
this.list.map(items => {
if (items.id == item) {
this.choosedList.push(items)
}
}) })
return arr })
} }
})
}, },
watch:{ toggleCheck(item, checked) {
ids(val){ if (checked) {
this.$emit('input', val) this.choose(item)
} } else {
this.remove(item)
}
}, },
created(){ choose(item) {
getProductTypeList().then(res => this.typeList = res.data) this.choosedList.push(item)
getProductAttrList().then(res => this.attrList = res.data)
this.reLoad()
}, },
methods:{ remove(item) {
reLoad(){ this.choosedList.forEach((choosed, index) => {
this.queryParams.page = 1 if (choosed.id == item.id) this.choosedList.splice(index, 1)
this.list = [] })
this.getList()
},
loadNextPage(){
if(this.page >= this.pages){
return this.$message.error('已加载全部')
}
this.queryParams.page ++
this.getList()
},
getList(){
getProductPage(this.queryParams).then(res => {
this.list = res.data.list //.concat(res.data.list || [])
this.page = res.data.page
this.pages = res.data.pages
})
},
toggleCheck(item, checked){
if(checked){
this.choose(item)
}else{
this.remove(item)
}
},
choose(item){
this.choosedList.push(item)
},
remove(item){
this.choosedList.forEach((choosed,index) => {
if(choosed.id==item.id) this.choosedList.splice(index,1)
})
}
} }
}
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.header{ .header {
>div{ > div {
margin-right: 5px; margin-right: 5px;
} }
} }
.list{ .list {
height: 200px; height: 200px;
border: 1px solid #ccc; border: 1px solid #ccc;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
padding: 0 10px; padding: 0 10px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.item{ .item {
width: 50%; width: 50%;
line-height: 20px; line-height: 20px;
height: 50px; height: 50px;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
} }
</style> </style>
\ No newline at end of file
<template>
<div class="app-container">
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="客户名称" prop="customerId">
<el-select v-model="form.customerId" placeholder="请选择客户名称" :disabled="!!customerId">
<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 label="投诉类型" prop="type">
<el-select v-model="form.type" placeholder="请选择投诉类型">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_COMPLAINT_TYPE)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
<el-form-item label="订单号" prop="orderId">
<el-input v-model="form.orderId" placeholder="请输入订单号" />
</el-form-item>
<el-form-item label="提单号" prop="ladingbillId">
<el-input v-model="form.ladingbillId" placeholder="请输入提单号" />
</el-form-item>
<el-form-item label="投诉内容" prop="content">
<el-input v-model="form.content" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="处理状态" prop="status">
<el-select v-model="form.status" placeholder="请选择处理状态">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_COMPLAINT_STATUS)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</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>
<el-dialog
title="提示"
:visible.sync="handle.dialogVisible"
width="30%"
>
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="投诉类型">
<dict-selector :type="DICT_TYPE.CUSTOMER_COMPLAINT_STATUS" form-type="radio" v-model="form.status"
:filter="(e) => e.value == '2' || e.value == '3'" :formatter="Number"></dict-selector>
</el-form-item>
<el-form-item v-show="form.status == '2'" label="查明原因" required>
<el-input type="textarea" placeholder="请输入查明原因" v-model="form.ascertainReason"></el-input>
</el-form-item>
<el-form-item v-show="form.status == '2'" label="处理方案">
<el-input v-model="form.plan" placeholder="请输入处理方案"></el-input>
</el-form-item>
<el-form-item v-show="form.status == '3'" label="处理结果" required>
<el-input type="textarea" placeholder="请输入处理结果" v-model="form.result"></el-input>
</el-form-item>
<el-form-item v-show="form.status == '3'" label="赔付金额">
<el-input v-model="form.indemnity" placeholder="请输入赔付金额">
<dict-selector
defaultable
style="width: 110px"
placeholder="请选择货币单位"
slot="append"
v-model="form.currencyUnit"
:type="DICT_TYPE.COMMISSION_CURRENCY_TYPE"></dict-selector>
</el-input>
</el-form-item>
<el-form-item v-show="form.status == '3'" label="处理时间" required>
<el-date-picker type="datetime" v-model="form.handleAt"></el-date-picker>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handle.dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { createCustomerComplaint, updateCustomerComplaint, deleteCustomerComplaint, getCustomerComplaint, getCustomerComplaintPage, exportCustomerComplaintExcel } from "@/api/ecw/customerComplaint";
import {getCustomerSelect} from '@/api/ecw/customer'
import DictSelector from '@/components/DictSelector'
import { DICT_TYPE } from '@/utils/dict'
export default {
name: "customerComplaints",
/**
* 可以单独作为页面,也可以作为组件被被客户详情页调用。
* 作为组件时要传入 customerId,用于限制范围和隐藏搜索筛选
*/
props: {
customerId: Number
},
components: {
DictSelector
},
data() {
return {
DICT_TYPE,
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 客户投诉列表
list: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
dateRangeCreateTime: [],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
customerId: this.customerId,
type: null,
orderId: null,
ladingbillId: null,
status: null,
adminId: null,
code: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
customerId: [{ required: true, message: "客户名称不能为空", trigger: "change" }],
},
myFollowCustomerList: [],
customerSelect: [],
// 处理
handle: {
dialogVisible: false
}
};
},
created() {
getCustomerSelect().then(r => {
this.customerSelect = r.data
})
},
methods: {
/** 查询列表 */
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
customerId: this.customerId,
type: undefined,
orderId: undefined,
ladingbillId: undefined,
content: undefined,
status: undefined,
ascertainReason: undefined,
plan: undefined,
result: undefined,
indemnity: undefined,
currencyUnit: undefined,
handleAt: undefined,
cancelReason: undefined,
};
this.resetForm("form");
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加客户投诉";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
// 修改的提交
if (this.form.id != null) {
updateCustomerComplaint(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.handle.dialogVisible = false
this.getList();
});
return;
}
// 添加的提交
createCustomerComplaint(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
},
};
</script>
...@@ -29,6 +29,8 @@ export const DICT_TYPE = { ...@@ -29,6 +29,8 @@ export const DICT_TYPE = {
INTERNAL_MESSAGE_TYPE: 'internal_message_type', INTERNAL_MESSAGE_TYPE: 'internal_message_type',
INTERNAL_MESSAGE_READ_STATUS: 'internal_message_read_status', INTERNAL_MESSAGE_READ_STATUS: 'internal_message_read_status',
HELP_DOC_STATUS: 'help_doc_status',
// ========== INFRA 模块 ========== // ========== INFRA 模块 ==========
INFRA_BOOLEAN_STRING: 'infra_boolean_string', INFRA_BOOLEAN_STRING: 'infra_boolean_string',
INFRA_REDIS_TIMEOUT_TYPE: 'infra_redis_timeout_type', INFRA_REDIS_TIMEOUT_TYPE: 'infra_redis_timeout_type',
...@@ -98,6 +100,8 @@ export const DICT_TYPE = { ...@@ -98,6 +100,8 @@ export const DICT_TYPE = {
ECW_MESSAGE_LEAVE_TYPE: 'ecw_message_leave_type', ECW_MESSAGE_LEAVE_TYPE: 'ecw_message_leave_type',
ECW_MESSAGE_LEAVE_STATUS: 'ecw_message_leave_status', ECW_MESSAGE_LEAVE_STATUS: 'ecw_message_leave_status',
PWD_TYPE: 'pwd_type', PWD_TYPE: 'pwd_type',
ZHONG_PAO_TYPE: 'zhong_pao_type',
TRANSPORT_TYPE: 'transport_type',
BRAND_REG_TYPE: 'brand_registry_type', BRAND_REG_TYPE: 'brand_registry_type',
BRAND_AUTH_STATUS: 'brand_authorization_status', BRAND_AUTH_STATUS: 'brand_authorization_status',
BRAND_CUSTOMER_CHARGING_MODEL: 'customer_charging_model', BRAND_CUSTOMER_CHARGING_MODEL: 'customer_charging_model',
......
...@@ -73,11 +73,23 @@ ...@@ -73,11 +73,23 @@
<el-table-column label="名称" align="center" prop="nameZh" /> <el-table-column label="名称" align="center" prop="nameZh" />
<!-- <el-table-column label="名称-英文" align="center" prop="nameEn" /> --> <!-- <el-table-column label="名称-英文" align="center" prop="nameEn" /> -->
<el-table-column label="内部名称" align="center" prop="internalNameZh" /> <el-table-column label="内部名称" align="center" prop="internalNameZh" />
<!-- <el-table-column label="内部名称-英文" align="center" prop="internalNameEn" /> --> <!-- <el-table-column label="内部名称-英文" align="center" prop="internalNameEn" />
<el-table-column label="类型编码" align="center" prop="typeNumber" /> <el-table-column label="类型编码" align="center" prop="typeNumber" />
<el-table-column label="仓库ID字符串" align="center" prop="warehouseIds" /> <!-- <el-table-column label="仓库id字符串" align="center" prop="warehouseIds" /> -->
<el-table-column label="仓库名" align="center" prop="warehouseNameList" width="180">
<template slot-scope="scope">
<el-scrollbar style="margin-right: 6px;">
<div class="left">
<el-tag v-for="warehouseName in scope.row.warehouseNameList"
:key="warehouseName.index">
<span>{{warehouseName}}</span>
</el-tag>
</div>
</el-scrollbar>
</template>
</el-table-column>
<el-table-column label="排序" align="center" prop="sort" /> <el-table-column label="排序" align="center" prop="sort" />
<el-table-column label="快递ID" align="center" prop="expressId" /> <el-table-column label="快递公司" align="center" prop="companyName" />
<el-table-column label="预计时间(天)" align="center" prop="etaTime" /> <el-table-column label="预计时间(天)" align="center" prop="etaTime" />
<el-table-column label="渠道代理" align="center" prop="channelAgent" /> <el-table-column label="渠道代理" align="center" prop="channelAgent" />
<el-table-column label="备注" align="center" prop="remarksZh" /> <el-table-column label="备注" align="center" prop="remarksZh" />
...@@ -103,7 +115,7 @@ ...@@ -103,7 +115,7 @@
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -231,7 +243,7 @@ export default { ...@@ -231,7 +243,7 @@ export default {
this.title = "修改渠道管理"; this.title = "修改渠道管理";
}); });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const channelId = row.channelId; const channelId = row.channelId;
...@@ -262,3 +274,26 @@ export default { ...@@ -262,3 +274,26 @@ export default {
} }
}; };
</script> </script>
<style lang="scss">
.left {
.el-tag {
background-color: #e6f6fd;
border: 1px solid #ccecfb;
display: inline-block;
height:auto;
padding: 0 10px;
line-height: 30px;
font-size: 12px;
color: #02a1e9;
border-radius: 4px;
box-sizing: border-box;
white-space: nowrap;
}
}
</style>
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
100外币兑人民币(CNY)汇率表
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="" align="center" prop="id" /> <el-table-column label="" align="center" prop="id" />
......
...@@ -97,6 +97,8 @@ ...@@ -97,6 +97,8 @@
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)"
v-hasPermi="['ecw:customer:delete']">删除</el-button> v-hasPermi="['ecw:customer:delete']">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-collection" @click="followUp(scope.row)">跟进</el-button>
<el-button size="mini" type="text" icon="el-icon-user" @click="complaint(scope.row)">客诉</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -450,6 +452,8 @@ ...@@ -450,6 +452,8 @@
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<customer-follow-list :customer-id="customerId" :id="customerId" ref="CustomerFollowList"></customer-follow-list>
<customer-complaints :customer-id="customerId" ref="customerComplaints"></customer-complaints>
</div> </div>
</template> </template>
...@@ -462,11 +466,15 @@ import { uploadFile } from "@/api/infra/file"; ...@@ -462,11 +466,15 @@ import { uploadFile } from "@/api/infra/file";
import upload from '@/components/ImageUpload' import upload from '@/components/ImageUpload'
import {getNodeList} from "@/api/ecw/node" import {getNodeList} from "@/api/ecw/node"
import CustomerFollowList from "@/components/CustomerFollowList"
import customerComplaints from "@/components/customerComplaints"
export default { export default {
name: "Customer", name: "Customer",
components: { components: {
upload upload,
CustomerFollowList,
customerComplaints
}, },
data() { data() {
return { return {
...@@ -515,7 +523,8 @@ export default { ...@@ -515,7 +523,8 @@ export default {
}, },
// 网点 // 网点
nodeList: [], nodeList: [],
showLine: false showLine: false,
customerId:undefined,
}; };
}, },
created() { created() {
...@@ -665,6 +674,16 @@ export default { ...@@ -665,6 +674,16 @@ export default {
this.$download.excel(response, '${table.classComment}.xls'); this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {}); }).catch(() => {});
},
followUp(row){
this.customerId = row.id;
this.$refs.CustomerFollowList.customerFollow.dialogVisible = true;
},
complaint(row){
this.customerId = row.id;
this.$nextTick(()=>{
this.$refs.customerComplaints.handleAdd();
})
} }
} }
}; };
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="跟进"> <el-tab-pane label="跟进">
<customer-follow ref="customerFollow" :customer-id="id"></customer-follow> <customer-follow ref="customerFollow" :id="id" :customer-id="id"></customer-follow>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="客户投诉"> <el-tab-pane label="客户投诉">
<customer-complaint ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint> <customer-complaint ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint>
......
...@@ -7,11 +7,8 @@ ...@@ -7,11 +7,8 @@
<el-select <el-select
v-model="customerForm.name" v-model="customerForm.name"
filterable filterable
remote
reserve-keyword
placeholder="请输入关键词" placeholder="请输入关键词"
@change="changefn" @change="changefn">
:remote-method="remoteMethod">
<el-option <el-option
v-for="item in customeList" v-for="item in customeList"
:key="item.id" :key="item.id"
...@@ -341,6 +338,7 @@ export default { ...@@ -341,6 +338,7 @@ export default {
}, },
}, },
created() { created() {
this.getCustomeList();
if(this.$route.params.dictId != 0){ if(this.$route.params.dictId != 0){
commissionGetByCustomerId(this.$route.params.dictId).then(r => { commissionGetByCustomerId(this.$route.params.dictId).then(r => {
if(r.code === 0){ if(r.code === 0){
...@@ -402,8 +400,6 @@ export default { ...@@ -402,8 +400,6 @@ export default {
}, },
remoteMethod(val) { remoteMethod(val) {
this.customerForm.name = val; this.customerForm.name = val;
console.log(val,'customerId')
this.getCustomeList();
}, },
changefn(val){ changefn(val){
console.log(val,'val') console.log(val,'val')
......
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<customer-follow v-show="!!this.form.id" :customer-id="form.id"></customer-follow> <customer-follow v-if="!!this.form.id" :id="form.id" :customer-id="form.customerId"></customer-follow>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
......
...@@ -456,11 +456,12 @@ export default { ...@@ -456,11 +456,12 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id; const id = row.id;
getCustomer(id).then(response => { this.$router.push('/customer/edit/'+id);
this.form = response.data; // getCustomer(id).then(response => {
this.open = true; // this.form = response.data;
this.title = "完善客户"; // this.open = true;
}); // this.title = "完善客户";
// });
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleConfirmService(row) { handleConfirmService(row) {
......
<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="number">
<el-input v-model="queryParams.number" placeholder="请输入客户编号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="客户名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入客户名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="客户等级" prop="level">
<el-select v-model="queryParams.level" placeholder="请选择客户等级" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="客户来源" prop="source">
<el-select v-model="queryParams.source" placeholder="请选择客户来源" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="跟进客服" prop="customerService">
<el-select v-model="queryParams.customerService" placeholder="请选择跟进客服" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="客户状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择客户状态" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="部门" prop="department">
<el-input v-model="queryParams.department" placeholder="请输入部门" clearable @keyup.enter.native="handleQuery"/>
</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:customer: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:customer: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="number" />
<el-table-column label="客户名称" align="center" prop="name" />
<el-table-column label="客户等级" align="center" prop="level">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" />
</template>
</el-table-column>
<el-table-column label="国家" align="center" prop="country">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.COUNTRY" :value="scope.row.country" />
</template>
</el-table-column>
<el-table-column label="跟进客服" align="center" prop="customerService" :formatter="customerServiceFn">
</el-table-column>
<el-table-column label="客户状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="部门" align="center" prop="department" />
<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:customer:update']">编辑</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:customer:delete']">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="distribution(scope.row)"
v-hasPermi="['ecw:customer:delete']">分配客服</el-button>
</template>
</el-table-column>
</el-table>
<!-- 移交 -->
<el-dialog
center
title="客服"
:visible.sync="transferShow"
width="30%">
<div style="width: 100%;min-height: 100px">
<el-radio-group v-model="service">
<el-radio style="margin: 5px;" v-for="(item,index) in customerServiceList" :key="index" :label="item.id">{{item.nickname}}</el-radio>
</el-radio-group>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="transferShow = false">取 消</el-button>
<el-button type="primary" @click="transferFn">确 定</el-button>
</span>
</el-dialog>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
</div>
</template>
<script>
import { createCustomer, updateCustomer, deleteCustomer, getCustomer,handOverCustomer,
exportCustomerExcel,getCustomerToBeAssigned } from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import upload from '@/components/ImageUpload'
import {listServiceUser} from "@/api/system/user";
export default {
name: "customerToBeAssigned",
components: {
upload
},
data() {
return {
getDictDatas,
DICT_TYPE,
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 客户列表
list: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
dateRangeCreateTime: [],
customerServiceList:[],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
number: null,
name: null,
level: null,
source: null,
customerService: null,
status: null,
department: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
name: [{ required: true, message: "客户名称不能为空", trigger: "blur" }],
country: [{ required: true, message: "国家不能为空", trigger: "blur" }],
level: [{ required: true, message: "客户等级不能为空", trigger: "blur" }],
type: [{ required: true, message: "客户类别不能为空", trigger: "blur" }],
// createTime: [{ required: true, message: "创建时间不能为空", trigger: "blur" }],
source: [{ required: true, message: "客户来源不能为空", trigger: "blur" }],
customerService: [{ required: true, message: "跟进客服不能为空", trigger: "blur" }],
status: [{ required: true, message: "客户状态不能为空", trigger: "blur" }],
founder: [{ required: true, message: "创建人不能为空", trigger: "blur" }],
},
// 网点
nodeList: [],
showLine: false,
service:undefined,//客服
transferData:undefined,//移交数据
transferShow:false,
};
},
created() {
this.getList();
listServiceUser().then(r=>{
console.log(r,'客服');
this.customerServiceList = r.data;
})
// getNodeList().then(r => {
// this.nodeList = r.data
// })
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询
getCustomerToBeAssigned(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,
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,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push('/customer/edit/0')
// this.reset();
// this.open = true;
// this.title = "添加客户";
},
/** 查看按钮操作 */
handleView(row) {
this.$router.push('/customer/query/' + row.id)
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$router.push('/customer/edit/' + row.id)
// this.reset();
// const id = row.id;
// getCustomer(id).then(response => {
// this.form = { ...this.form, ...response.data };
// this.open = true;
// this.title = "修改客户";
// });
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
// return;
}
// 修改的提交
if (this.form.id != null) {
updateCustomer(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
// 添加的提交
createCustomer(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 deleteCustomer(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
//分配客服
distribution(row){
this.transferData = row;
this.transferShow =true;
},
transferFn(){
if(!this.service){
return this.$message.warning('请选择跟进客服!');
}
handOverCustomer({
customerServiceId:this.service,
customerId:this.transferData.id
}).then(r=>{
if(r.code === 0){
this.transferShow = false;
this.service = '';
this.getList();
this.$message.success('移交成功!');
}
})
},
/** 导出按钮操作 */
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 exportCustomerExcel(params);
}).then(response => {
this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false;
}).catch(() => {});
},
customerServiceFn(val){
if(this.customerServiceList.length > 0){
let index =this.customerServiceList.findIndex(item => item.id === val.customerService);
return index !== -1 ? this.customerServiceList[index]?.nickname :''
}else {
return ''
}
}
}
};
</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="number">
<el-input v-model="queryParams.number" placeholder="请输入客户编号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="客户名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入客户名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="客户等级" prop="level">
<el-select v-model="queryParams.level" placeholder="请选择客户等级" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="客户来源" prop="source">
<el-select v-model="queryParams.source" placeholder="请选择客户来源" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="客户状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择客户状态" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="部门" prop="department">
<el-input v-model="queryParams.department" placeholder="请输入部门" clearable @keyup.enter.native="handleQuery"/>
</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:customer: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:customer: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="number" />
<el-table-column label="客户名称" align="center" prop="name" />
<el-table-column label="客户等级" align="center" prop="level">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" />
</template>
</el-table-column>
<el-table-column label="国家" align="center" prop="country">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.COUNTRY" :value="scope.row.country" />
</template>
</el-table-column>
<el-table-column label="客户状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="部门" align="center" prop="department" />
<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-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)"
v-hasPermi="['ecw:customer:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-collection" @click="followUp(scope.row)">跟进</el-button>
<el-button size="mini" type="text" icon="el-icon-user"
v-hasPermi="['ecw:customer:update']" @click="complaint(scope.row)">客诉</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:customer: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"/>
<customer-follow-list ref="customerFollowList" :customer-id="customerId" :id="customerId"></customer-follow-list>
<customer-complaints ref="customerComplaint" :customer-id.sync="customerId"></customer-complaints>
</div>
</template>
<script>
import { createCustomer, updateCustomer, deleteCustomer, getCustomer, exportCustomerExcel,getMyCustomerService } from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import upload from '@/components/ImageUpload'
import customerFollowList from "@/components/CustomerFollowList";
import customerComplaints from "@/components/customerComplaints";
export default {
name: "myCustomerService",
components: {
upload,
customerFollowList,
customerComplaints
},
data() {
return {
getDictDatas,
DICT_TYPE,
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 客户列表
list: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
dateRangeCreateTime: [],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
number: null,
name: null,
level: null,
source: null,
customerService: null,
status: null,
department: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
name: [{ required: true, message: "客户名称不能为空", trigger: "blur" }],
country: [{ required: true, message: "国家不能为空", trigger: "blur" }],
level: [{ required: true, message: "客户等级不能为空", trigger: "blur" }],
type: [{ required: true, message: "客户类别不能为空", trigger: "blur" }],
// createTime: [{ required: true, message: "创建时间不能为空", trigger: "blur" }],
source: [{ required: true, message: "客户来源不能为空", trigger: "blur" }],
status: [{ required: true, message: "客户状态不能为空", trigger: "blur" }],
founder: [{ required: true, message: "创建人不能为空", trigger: "blur" }],
},
// 网点
nodeList: [],
showLine: false,
customerId:undefined,
};
},
created() {
this.getList();
// getNodeList().then(r => {
// this.nodeList = r.data
// })
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询
getMyCustomerService(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,
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,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push('/customer/edit/0')
// this.reset();
// this.open = true;
// this.title = "添加客户";
},
/** 查看按钮操作 */
handleView(row) {
this.$router.push('/customer/query/' + row.id)
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$router.push('/customer/edit/' + row.id)
// this.reset();
// const id = row.id;
// getCustomer(id).then(response => {
// this.form = { ...this.form, ...response.data };
// this.open = true;
// this.title = "修改客户";
// });
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
// return;
}
// 修改的提交
if (this.form.id != null) {
updateCustomer(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
// 添加的提交
createCustomer(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 deleteCustomer(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 exportCustomerExcel(params);
}).then(response => {
this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false;
}).catch(() => {});
},
followUp(row){
this.customerId = row.id
this.$refs['customerFollowList'].customerFollow.dialogVisible = true;
},
complaint(row){
this.customerId = row.id;
this.$nextTick(()=>{
this.$refs['customerComplaint'].handleAdd()
})
}
}
};
</script>
...@@ -4,41 +4,41 @@ ...@@ -4,41 +4,41 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="商品编码" prop="productCode"> <el-form-item label="商品编码" prop="productCode">
<el-input v-model="queryParams.productCode" placeholder="请输入商品编码" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.productCode" placeholder="请输入商品编码" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="海关编码" prop="customsCode"> <el-form-item label="海关编码" prop="customsCode">
<el-input v-model="queryParams.customsCode" placeholder="请输入海关编码" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.customsCode" placeholder="请输入海关编码" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="商品名称" prop="titleZh"> <el-form-item label="商品名称" prop="titleZh">
<el-input v-model="queryParams.titleZh" placeholder="请输入商品名称" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.titleZh" placeholder="请输入商品名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="商品类型" prop="typeId"> <el-form-item label="商品类型" prop="typeId">
<el-select v-model="queryParams.typeId" placeholder="选择商品类型" clearable> <el-select v-model="queryParams.typeId" placeholder="选择商品类型" clearable>
<el-option v-for="type in typeList" :key="type.id" :label="type.titleZh" :value="type.id"/> <el-option v-for="type in typeList" :key="type.id" :label="type.titleZh" :value="type.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="商品特性" prop="attrId"> <el-form-item label="商品特性" prop="attrId">
<el-select v-model="queryParams.attrId" placeholder="选择商品特性" clearable> <el-select v-model="queryParams.attrId" placeholder="选择商品特性" clearable>
<el-option v-for="attr in attrList" :key="attr.id" :label="attr.attrName" :value="attr.id"/> <el-option v-for="attr in attrList" :key="attr.id" :label="attr.attrName" :value="attr.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="审核状态" prop="auditStatus"> <el-form-item label="审核状态" prop="auditStatus">
<el-select v-model="queryParams.auditStatus" placeholder="选择审核状态" clearable> <el-select v-model="queryParams.auditStatus" placeholder="选择审核状态" clearable>
<el-option v-for="auditStatusItem in auditStatusDictDatas" :key="auditStatusItem.id" :label="auditStatusItem.label" :value="auditStatusItem.value"/> <el-option v-for="auditStatusItem in auditStatusDictDatas" :key="auditStatusItem.id" :label="auditStatusItem.label" :value="auditStatusItem.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="上架状态" prop="status"> <el-form-item label="上架状态" prop="status">
<el-select v-model="queryParams.status" placeholder="选择上架状态" clearable> <el-select v-model="queryParams.status" placeholder="选择上架状态" clearable>
<el-option v-for="statusItem in statusDictDatas" :key="statusItem.id" :label="statusItem.value == CommonStatusEnum.ENABLE ? '已上架' : '已下架'" :value="statusItem.value"/> <el-option v-for="statusItem in statusDictDatas" :key="statusItem.id" :label="statusItem.value == CommonStatusEnum.ENABLE ? '已上架' : '已下架'" :value="statusItem.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
...@@ -48,15 +48,19 @@ ...@@ -48,15 +48,19 @@
<!-- 操作工具栏 --> <!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ecw:product:create']">新增</el-button>
v-hasPermi="['ecw:product:create']">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-setting" size="mini" @click="handleEdit" :disabled="multiple" v-hasPermi="['ecw:product:attr']">批量设置商品属性</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center">
</el-table-column>
<el-table-column label="商品编号" align="center" prop="id" /> <el-table-column label="商品编号" align="center" prop="id" />
<el-table-column label="商品类型" align="center" prop="typeId"> <el-table-column label="商品类型" align="center" prop="typeId">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -74,44 +78,39 @@ ...@@ -74,44 +78,39 @@
<el-table-column prop="auditStatus" align="center" label="是否审核" width="120"> <el-table-column prop="auditStatus" align="center" label="是否审核" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.auditStatus" @change="handleStatusChange(scope.row, 'auditStatus')"> <el-select v-model="scope.row.auditStatus" @change="handleStatusChange(scope.row, 'auditStatus')">
<el-option v-for="auditStatusItem in auditStatusDictDatas" :key="auditStatusItem.id" :label="auditStatusItem.label" :value="parseInt(auditStatusItem.value)"/> <el-option v-for="auditStatusItem in auditStatusDictDatas" :key="auditStatusItem.id" :label="auditStatusItem.label" :value="parseInt(auditStatusItem.value)" />
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" align="center" label="状态" width="120"> <el-table-column prop="status" align="center" label="状态" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.status" @change="handleStatusChange(scope.row, 'status')"> <el-select v-model="scope.row.status" @change="handleStatusChange(scope.row, 'status')">
<el-option v-for="statusItem in statusDictDatas" :key="statusItem.id" :label="statusItem.value == CommonStatusEnum.ENABLE + '' ? '已上架' : '已下架'" :value="parseInt(statusItem.value)"/> <el-option v-for="statusItem in statusDictDatas" :key="statusItem.id" :label="statusItem.value == CommonStatusEnum.ENABLE + '' ? '已上架' : '已下架'" :value="parseInt(statusItem.value)" />
</el-select> </el-select>
</template> </template>
</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" @click="toPriceManager(scope.row)" <el-button size="mini" type="text" @click="toPriceManager(scope.row)" v-hasPermi="['ecw:product-price:query']">路线价格</el-button>
v-hasPermi="['ecw:product-price: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:product:update']">修改</el-button>
v-hasPermi="['ecw:product:update']">修改</el-button> <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['ecw:product:delete']">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:product:delete']">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" />
@pagination="getList"/>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="550px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="110px"> <el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form-item label="商品类型" prop="typeId"> <el-form-item label="商品类型" prop="typeId">
<el-select v-model="form.typeId" placeholder="选择商品类型" clearable> <el-select v-model="form.typeId" placeholder="选择商品类型" clearable>
<el-option v-for="type in typeList" :key="type.id" :label="type.titleZh" :value="type.id"/> <el-option v-for="type in typeList" :key="type.id" :label="type.titleZh" :value="type.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -125,10 +124,10 @@ ...@@ -125,10 +124,10 @@
<el-form-item label="商品图片" prop="img"> <el-form-item label="商品图片" prop="img">
<el-col :span="8"> <el-col :span="8">
<el-input v-model="form.imgs" placeholder="请上传图片" disabled/> <el-input v-model="form.imgs" placeholder="请上传图片" disabled />
</el-col> </el-col>
<el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload"> <el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
<el-button size="small"> <el-button size="small">
上传图片 上传图片
<i class="el-icon-upload el-icon--right"></i> <i class="el-icon-upload el-icon--right"></i>
...@@ -147,30 +146,29 @@ ...@@ -147,30 +146,29 @@
<el-form-item label="商品特性" prop="attrArray"> <el-form-item label="商品特性" prop="attrArray">
<el-select v-model="form.attrArray" placeholder="选择商品特性" clearable multiple> <el-select v-model="form.attrArray" placeholder="选择商品特性" clearable multiple>
<el-option v-for="attr in attrList" :key="attr.id" :label="attr.attrName" :value="attr.id"/> <el-option v-for="attr in attrList" :key="attr.id" :label="attr.attrName" :value="attr.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="商品材质" prop="materialType"> <el-form-item label="商品材质" prop="materialType">
<el-select v-model="form.materialType" placeholder="选择商品材质" clearable> <el-select v-model="form.materialType" placeholder="选择商品材质" clearable>
<el-option v-for="materialItem in materialList" :key="materialItem.value" :label="materialItem.label" :value="materialItem.value"/> <el-option v-for="materialItem in materialList" :key="materialItem.value" :label="materialItem.label" :value="materialItem.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="出运要求" prop="requirements"> <el-form-item label="出运要求" prop="requirements">
<el-checkbox v-model="form.requirements" :checked="form.requirements===1? true:false" <el-checkbox v-model="form.requirements" :checked="form.requirements===1? true:false" :true-label="1" :false-label="0">证书要求(支持多证书)</el-checkbox>
:true-label="1" :false-label="0">证书要求(支持多证书)</el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="包装要求" prop="packaging"> <el-form-item label="包装要求" prop="packaging">
<el-select v-model="form.packaging" placeholder="选择包装要求" clearable> <el-select v-model="form.packaging" placeholder="选择包装要求" clearable>
<el-option v-for="packageItem in packagingList" :key="packageItem.value" :label="packageItem.label" :value="packageItem.value"/> <el-option v-for="packageItem in packagingList" :key="packageItem.value" :label="packageItem.label" :value="packageItem.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="默认货柜位置" prop="containerLocation"> <el-form-item label="默认货柜位置" prop="containerLocation">
<el-select v-model="form.containerLocation" placeholder="选择货柜位置" clearable> <el-select v-model="form.containerLocation" placeholder="选择货柜位置" clearable>
<el-option v-for="locationItem in locationList" :key="locationItem.value" :label="locationItem.label" :value="locationItem.value"/> <el-option v-for="locationItem in locationList" :key="locationItem.value" :label="locationItem.label" :value="locationItem.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -190,7 +188,7 @@ ...@@ -190,7 +188,7 @@
<template slot="append">立方米</template> <template slot="append">立方米</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
...@@ -214,16 +212,22 @@ export default { ...@@ -214,16 +212,22 @@ export default {
}, },
data() { data() {
return { return {
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
//特性列表 //特性列表
attrList:[], attrList: [],
//类型列表 //类型列表
typeList:[], typeList: [],
//材质列表 //材质列表
materialList:[], materialList: [],
//包装列表 //包装列表
packagingList:[], packagingList: [],
//货柜位置 //货柜位置
locationList:[], locationList: [],
// 遮罩层 // 遮罩层
loading: true, loading: true,
...@@ -259,11 +263,11 @@ export default { ...@@ -259,11 +263,11 @@ export default {
attrArray: [{ required: true, message: "商品特性不能为空", trigger: "change" }], attrArray: [{ required: true, message: "商品特性不能为空", trigger: "change" }],
titleZh: [{ required: true, message: "中文标题不能为空", trigger: "blur" }], titleZh: [{ required: true, message: "中文标题不能为空", trigger: "blur" }],
titleEn: [{ required: true, message: "英文标题不能为空", trigger: "blur" }], titleEn: [{ required: true, message: "英文标题不能为空", trigger: "blur" }],
materialType:[{ required: true, message: "商品材质不能为空", trigger: "blur" }], materialType: [{ required: true, message: "商品材质不能为空", trigger: "blur" }],
packaging:[{ required: true, message: "包装要求不能为空", trigger: "blur" }], packaging: [{ required: true, message: "包装要求不能为空", trigger: "blur" }],
containerLocation:[{ required: true, message: "默认货柜位置不能为空", trigger: "blur" }], containerLocation: [{ required: true, message: "默认货柜位置不能为空", trigger: "blur" }],
square:[{ required: true, message: "默认方数不能为空", trigger: "blur" }], square: [{ required: true, message: "默认方数不能为空", trigger: "blur" }],
needBook:[{ required: true, message: "预约入仓不能为空", trigger: "blur" }], needBook: [{ required: true, message: "预约入仓不能为空", trigger: "blur" }],
}, },
CommonStatusEnum: CommonStatusEnum, CommonStatusEnum: CommonStatusEnum,
...@@ -279,9 +283,9 @@ export default { ...@@ -279,9 +283,9 @@ export default {
computed: { computed: {
getTypeName() { getTypeName() {
return typeId => { return typeId => {
for(let index in this.typeList) { for (let index in this.typeList) {
let typeItem = this.typeList[index]; let typeItem = this.typeList[index];
if(typeItem.id == typeId) { if (typeItem.id == typeId) {
return typeItem.titleZh; return typeItem.titleZh;
} }
} }
...@@ -292,11 +296,11 @@ export default { ...@@ -292,11 +296,11 @@ export default {
return attrIds => { return attrIds => {
let productAttrArray = []; let productAttrArray = [];
let attrArray = attrIds.split(','); let attrArray = attrIds.split(',');
for(let attrIndex in attrArray) { for (let attrIndex in attrArray) {
let attrId = attrArray[attrIndex]; let attrId = attrArray[attrIndex];
for(let index in this.attrList) { for (let index in this.attrList) {
let attrItem = this.attrList[index]; let attrItem = this.attrList[index];
if(attrItem.id == attrId) { if (attrItem.id == attrId) {
productAttrArray.push(attrItem.attrName); productAttrArray.push(attrItem.attrName);
} }
} }
...@@ -309,7 +313,7 @@ export default { ...@@ -309,7 +313,7 @@ export default {
created() { created() {
let typeId = this.$route.query.typeId; let typeId = this.$route.query.typeId;
if(typeId) { if (typeId) {
this.queryParams.typeId = parseInt(typeId); this.queryParams.typeId = parseInt(typeId);
} }
this.getAttrList(); this.getAttrList();
...@@ -320,7 +324,7 @@ export default { ...@@ -320,7 +324,7 @@ export default {
/** 获取产品属性列表 */ /** 获取产品属性列表 */
getAttrList() { getAttrList() {
getProductAttrList().then(response => { getProductAttrList().then(response => {
this.attrList = response.data; this.attrList = response.data;
}) })
}, },
...@@ -336,7 +340,7 @@ export default { ...@@ -336,7 +340,7 @@ export default {
/* localStorage.setItem('product', JSON.stringify(row)); /* localStorage.setItem('product', JSON.stringify(row));
localStorage.setItem('typeList', JSON.stringify(this.typeList)); */ localStorage.setItem('typeList', JSON.stringify(this.typeList)); */
this.$router.push({ this.$router.push({
name:'ProductPrice', name: 'ProductPrice',
query: { query: {
product_id: row.id, product_id: row.id,
product_type: row.typeId product_type: row.typeId
...@@ -347,13 +351,13 @@ export default { ...@@ -347,13 +351,13 @@ export default {
handleStatusChange(row, statusType) { handleStatusChange(row, statusType) {
updateProduct(row).then(() => { updateProduct(row).then(() => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
}).catch(function() { }).catch(function () {
if(statusType == 'status') { if (statusType == 'status') {
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE; row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE;
} else { } else {
row.auditStatus = row.auditStatus === AuditStatusEnum.PASS ? AuditStatusEnum.NOT_PASS : AuditStatusEnum.PASS; row.auditStatus = row.auditStatus === AuditStatusEnum.PASS ? AuditStatusEnum.NOT_PASS : AuditStatusEnum.PASS;
} }
}); });
}, },
...@@ -361,7 +365,7 @@ export default { ...@@ -361,7 +365,7 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
// 处理查询参数 // 处理查询参数
let params = {...this.queryParams}; let params = { ...this.queryParams };
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询 // 执行查询
getProductPage(params).then(response => { getProductPage(params).then(response => {
...@@ -386,7 +390,7 @@ export default { ...@@ -386,7 +390,7 @@ export default {
titleEn: undefined, titleEn: undefined,
auditStatus: undefined, auditStatus: undefined,
status: undefined, status: undefined,
requirements:0, requirements: 0,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -406,7 +410,7 @@ export default { ...@@ -406,7 +410,7 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加商品"; this.title = "添加商品";
if(this.queryParams.typeId) { if (this.queryParams.typeId) {
this.form.typeId = this.queryParams.typeId; this.form.typeId = this.queryParams.typeId;
} }
}, },
...@@ -417,7 +421,7 @@ export default { ...@@ -417,7 +421,7 @@ export default {
getProduct(id).then(response => { getProduct(id).then(response => {
this.form = response.data; this.form = response.data;
let attrArray = this.form.attrId.split(','); let attrArray = this.form.attrId.split(',');
for(let index in attrArray) { for (let index in attrArray) {
let value = attrArray[index]; let value = attrArray[index];
attrArray[index] = parseInt(value); attrArray[index] = parseInt(value);
} }
...@@ -457,28 +461,28 @@ export default { ...@@ -457,28 +461,28 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal.confirm('是否确认删除商品编号为"' + id + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除商品编号为"' + id + '"的数据项?').then(function () {
return deleteProduct(id); return deleteProduct(id);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => { });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// 处理查询参数 // 处理查询参数
let params = {...this.queryParams}; let params = { ...this.queryParams };
params.pageNo = undefined; params.pageNo = undefined;
params.pageSize = undefined; params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出 // 执行导出
this.$modal.confirm('是否确认导出所有商品数据项?').then(() => { this.$modal.confirm('是否确认导出所有商品数据项?').then(() => {
this.exportLoading = true; this.exportLoading = true;
return exportProductExcel(params); return exportProductExcel(params);
}).then(response => { }).then(response => {
this.$download.excel(response, '${table.classComment}.xls'); this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {}); }).catch(() => { });
}, },
// 覆盖默认的上传行为 // 覆盖默认的上传行为
...@@ -504,7 +508,7 @@ export default { ...@@ -504,7 +508,7 @@ export default {
var s = []; var s = [];
var hexDigits = "0123456789abcdef"; var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) { for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); 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[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[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
...@@ -513,6 +517,22 @@ export default { ...@@ -513,6 +517,22 @@ export default {
var uuid = s.join(""); var uuid = s.join("");
return uuid; return uuid;
}, },
// 表格多选
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
// 批量设置商品属性
handleEdit() {
this.$router.push({
path: "product-attr/edit",
query: {
ids: this.ids
}
});
}
} }
}; };
</script> </script>
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<div class="app-container"> <div class="app-container">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="适用商品" prop="idList" v-if="form.type != 1"> <el-form-item label="适用商品" prop="idList">
<products-selector v-model="form.idList" /> <products-selector :defaultIds="form.idList" v-model="form.idList" />
</el-form-item> </el-form-item>
<el-form-item label="货柜位置" prop="containerLocation"> <el-form-item label="货柜位置" prop="containerLocation">
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
<el-checkbox style="width: 100px" v-model="checked[6]">需要修改</el-checkbox> <el-checkbox style="width: 100px" v-model="checked[6]">需要修改</el-checkbox>
<dict-selector v-if="checked[6]" form-type="checkbox" :type="DICT_TYPE.ECW_ORDER_ATTR" v-model="form.attrId" multiple /> <dict-selector v-if="checked[6]" form-type="checkbox" :type="DICT_TYPE.ECW_ORDER_ATTR" v-model="form.attrId" multiple />
</el-form-item> </el-form-item>
<!-- <el-form-item label="商品材质" prop=""> <el-form-item label="商品材质" prop="materialType">
<el-checkbox style="width: 100px" v-model="checked[7]">需要修改</el-checkbox> <el-checkbox style="width: 100px" v-model="checked[7]">需要修改</el-checkbox>
<dict-selector v-if="checked[7]" form-type="checkbox" :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" v-model="form.status" multiple /> <dict-selector v-if="checked[7]" form-type="checkbox" :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" v-model="form.materialType" multiple />
</el-form-item> --> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
...@@ -75,11 +75,12 @@ export default { ...@@ -75,11 +75,12 @@ export default {
"needBook": undefined, "needBook": undefined,
"packaging": undefined, "packaging": undefined,
"requirements": undefined, "requirements": undefined,
"square": undefined "square": undefined,
"materialType": undefined
}, },
// 表单校验 // 表单校验
rules: {}, rules: {},
checked: [false, false, false, false, false, false, false] checked: [false, false, false, false, false, false, false, false]
}; };
}, },
computed: { computed: {
...@@ -88,7 +89,7 @@ export default { ...@@ -88,7 +89,7 @@ export default {
watch: { watch: {
'form.idList'(val) { 'form.idList'(val) {
if (val.length > 0) { if (val.length > 0) {
this.form.isAllProduct = undefined this.form.isAllProduct = 0
} else { } else {
this.form.isAllProduct = 1 this.form.isAllProduct = 1
} }
...@@ -96,6 +97,7 @@ export default { ...@@ -96,6 +97,7 @@ export default {
}, },
created() { created() {
this.reset() this.reset()
this.form.idList = this.$route.query && this.$route.query.ids ? [...this.$route.query.ids].map(item => { return Number(item) }) : []
}, },
methods: { methods: {
/** 表单重置 */ /** 表单重置 */
...@@ -109,7 +111,8 @@ export default { ...@@ -109,7 +111,8 @@ export default {
"needBook": undefined, "needBook": undefined,
"packaging": undefined, "packaging": undefined,
"requirements": undefined, "requirements": undefined,
"square": undefined "square": undefined,
"materialType": undefined
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -129,18 +132,4 @@ export default { ...@@ -129,18 +132,4 @@ export default {
}, },
}, },
}; };
</script> </script>
<style scoped lang="scss"> \ No newline at end of file
.fee-item {
padding: 5px 0;
> div {
margin-right: 5px;
}
}
.coupon-list {
max-height: 200px;
border: 1px solid #ccc;
padding: 10px;
overflow-y: auto;
}
</style>
\ No newline at end of file
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- (添加 / 修改) --> <!-- 搜索工作栏 -->
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="130px">
<el-form-item label="重泡货类型" prop="type">
<el-form-item label="泡货配置" prop="paoLinjie"> <el-select v-model="queryParams.type" placeholder="请选择重泡货类型" clearable size="small">
临界值:每CBM小于 <el-option v-for="dict in getDictDatas(DICT_TYPE.ZHONG_PAO_TYPE)"
<el-input v-model="form.paoLinjie" placeholder="请输入泡货临界值" style="width: 100px; "/> :key="dict.value" :label="dict.label" :value="dict.value"/>
Kg属于泡货 </el-select>
</el-form-item>
<el-form-item label="计算公式" prop="paoGs">
泡货重量(Kg)= 实际体积(CBM)X
<el-input v-model="form.paoGs" placeholder="请输入泡货公式" style="width: 100px; "/>
</el-form-item>
<el-form-item label="货运方式" prop="paoYsIds">
<el-checkbox-group v-model="form.paoYsIdList">
<el-checkbox v-for="dict in transportDatas" :label="dict.value" :key="dict.value" :value="dict.value"
name="paoYsIds"> {{dict.label}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="泡货是否开启" prop="paoIsOpen">
<el-radio-group v-model="form.paoIsOpen">
<el-radio v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :label="parseInt(dict.value)">{{dict.label}}
</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-divider></el-divider> <el-form-item label="始发地ID" prop="departureId">
<el-form-item label="重货配置" prop="zhongLinjie"> <el-input v-model="queryParams.departureId" placeholder="请输入始发地ID" clearable @keyup.enter.native="handleQuery"/>
临界值:每CBM大于
<el-input v-model="form.zhongLinjie" placeholder="请输入重货临界值" style="width: 100px; "/>
Kg属于重货
</el-form-item> </el-form-item>
<el-form-item label="计算公式" prop="zhongGs"> <el-form-item label="目的地ID列表" prop="objectiveIds">
重货体积(CBM) = 实际重量(Kg)X <el-input v-model="queryParams.objectiveIds" placeholder="请输入目的地ID列表" clearable @keyup.enter.native="handleQuery"/>
<el-input v-model="form.zhongGs" placeholder="请输入重货公式" style="width: 100px; "/>
</el-form-item> </el-form-item>
<el-form-item label="货运方式" prop="zhongYsIds"> <el-form-item label="创建时间">
<el-checkbox-group v-model="form.zhongYsIdList"> <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
<el-checkbox v-for="dict in transportDatas" :label="dict.value" :key="dict.value" :value="dict.value" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
name="zhongYsIds"> {{dict.label}}
</el-checkbox>
</el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item label="重货是否开启" prop="zhongIsOpen"> <el-form-item>
<el-radio-group v-model="form.zhongIsOpen"> <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-radio v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)" <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
:key="dict.value" :label="parseInt(dict.value)">{{dict.label}}
</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">保存配置</el-button> <!-- 操作工具栏 -->
<el-button @click="cancel">重 置</el-button> <el-row :gutter="10" class="mb8">
</div> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['ecw:zhong-pao: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:zhong-pao: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="type">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ZHONG_PAO_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="临介值" align="center" prop="edge" />
<el-table-column label="公式" align="center" prop="formulas" />
<el-table-column label="传输方式ids" align="center" prop="transportTypes">
<template slot-scope="scope">
<span v-for="item in scope.row.transportTypes.split(',')"><dict-tag :type="DICT_TYPE.TRANSPORT_TYPE" :value="item" />, </span>
</template>
</el-table-column>
<el-table-column label="始发地ID" align="center" prop="departureId" :formatter="departureFormatter"/>
<el-table-column label="目的地ID列表" align="center" prop="objectiveIds" :formatter="objectiveFormatter"/>
<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:zhong-pao:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:zhong-pao: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="540px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="重泡货类型" prop="type">
<el-select v-model="form.type" placeholder="请选择重泡货类型" @change="form.transportTypes = ''">
<el-option v-for="dict in getDictDatas(DICT_TYPE.ZHONG_PAO_TYPE)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
<el-form-item label="传输方式" prop="transportTypes">
<dict-selector :type="DICT_TYPE.TRANSPORT_TYPE" v-model="form.transportTypes" multiple form-type="checkbox" :filter="transportTypesFilter"></dict-selector>
</el-form-item>
<el-form-item label="始发地ID" prop="departureId">
<el-select v-model="form.departureId" placeholder="请选择始发地">
<el-option label="全部" :value="0"></el-option>
<el-option v-for="(item) in warehouseList" :label="item.titleZh" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="目的地ID列表" prop="objectiveIds">
<!-- <el-input v-model="form.objectiveIds" placeholder="请输入目的地ID列表" />-->
<el-select v-model="form.objectiveIds" placeholder="请选择目的地" multiple>
<el-option label="全部" value="0"></el-option>
<el-option v-for="(item) in importCityList" :label="item.titleZh" :value="item.id.toString()" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="`${form.type !== 1 ? '泡' : '重'}货临介值`" prop="edge">
<el-input v-model="form.edge" placeholder="请输入临介值">
<template slot="prepend">每CBM{{form.type !== 1 ? '' : ''}}</template>
<template slot="append">kg属于{{form.type !== 1 ? '' : ''}}</template>
</el-input>
</el-form-item>
<el-form-item label="公式" prop="formulas">
<el-input v-model="form.formulas" placeholder="请输入公式">
<template slot="prepend">{{form.type !== 1 ? '泡货重量(kg)=实际体积(CBM)*' : '重货体积(CBM)=实际重量(KG)*'}} </template>
</el-input>
</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> </div>
</template> </template>
<script> <script>
import { import { createZhongPao, updateZhongPao, deleteZhongPao, getZhongPao, getZhongPaoPage, exportZhongPaoExcel } from "@/api/ecw/zhongPao";
createZhongPao, import {DICT_TYPE, getDictDatas} from "@/utils/dict"
updateZhongPao, import {parseTime} from "@/utils/ruoyi"
deleteZhongPao, import DictSelector from "@/components/DictSelector"
getZhongPao, import {getTradeCityList} from "@/api/ecw/region"
getZhongPaoPage, import {getWarehouseList} from "@/api/ecw/warehouse"
exportZhongPaoExcel
} from "@/api/ecw/zhongPao";
import {getDictDatas, DICT_TYPE} from '@/utils/dict';
export default {
name: "ZhongPao",
components: {},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 重泡货配置列表
list: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
dateRangeCreateTime: [],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10
},
// 表单参数
form: {
paoYsIdList: [],
zhongYsIdList: [],
},
// 表单校验
rules: {
paoIsOpen: [{required: true, message: "泡货是否开启不能为空", trigger: "blur"}],
zhongIsOpen: [{required: true, message: "重货是否开启不能为空", trigger: "blur"}],
paoYsIdList: [
{type: 'array', required: true, message: '泡货请至少选择一个货运方式', trigger: 'change'}
],
zhongYsIdList: [
{type: 'array', required: true, message: '重货请至少选择一个货运方式', trigger: 'change'}
],
}, export default {
transportDatas: getDictDatas(DICT_TYPE.ECW_TRANSPORT_TYPE) name: "ZhongPao",
components: {
DictSelector
},
data() {
return {
DICT_TYPE,
getDictDatas,
parseTime,
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 重泡货配置列表
list: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
dateRangeCreateTime: [],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
type: null,
departureId: null,
objectiveIds: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
},
importCityList: [],
warehouseList: []
};
},
created() {
this.getList();
getTradeCityList({type: 1}).then(r => {
this.importCityList = r.data.filter(item => item.type === '1')
})
getWarehouseList().then(r => {
this.warehouseList = r.data
})
},
methods: {
departureFormatter(row, column, cellValue) {
if (cellValue === 0) return '全部'
return this.warehouseList.find(e => e.id === cellValue)?.titleZh
},
objectiveFormatter(row, column, cellValue) {
if (!cellValue || cellValue.length === 0) return ''
if (cellValue === '0') return '全部'
return cellValue.split(',').map(id => this.importCityList.find(e => e.id === parseInt(id))?.titleZh).join(', ')
},
transportTypesFilter({value}) {
return (this.form.type === 1 && (value === '1' || value === '2')) || (this.form.type === 2 && (value === '3' || value === '4'))
},
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询
getZhongPaoPage(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 = {
type: undefined,
edge: undefined,
formulas: undefined,
transportTypes: '',
departureId: undefined,
objectiveIds: undefined,
}; };
this.resetForm("form");
}, },
created() { /** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList(); this.getList();
}, },
methods: { /** 重置按钮操作 */
/** 查询列表 */ resetQuery() {
getList() { this.dateRangeCreateTime = [];
this.loading = true; this.resetForm("queryForm");
// 处理查询参数 this.handleQuery();
let params = {...this.queryParams}; },
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); /** 新增按钮操作 */
// 执行查询 handleAdd() {
getZhongPaoPage(params).then(response => { this.reset();
this.open = true;
let list = response.data.list; this.title = "添加重泡货配置";
},
if (list && list.length > 0) { /** 修改按钮操作 */
this.form = list[0]; handleUpdate(row) {
this.reset();
if (this.form.zhongYsIds) { const id = row.id;
let ckList = this.form.zhongYsIds.split(','); getZhongPao(id).then(response => {
this.$set(this.form, 'zhongYsIdList', ckList); const form = response.data;
}
if (this.form.paoYsIds) {
let ckList = this.form.paoYsIds.split(',');
this.$set(this.form, 'paoYsIdList', ckList);
}
} else {
this.form = {
id: undefined,
paoLinjie: undefined,
paoGs: undefined,
paoYsIds: undefined,
paoYsIdList: [],
paoIsOpen: undefined,
zhongLinjie: undefined,
zhongGs: undefined,
zhongYsIds: undefined,
zhongYsIdList: [],
zhongIsOpen: undefined
};
}
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.getList();
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
this.form.paoYsIds = this.form.paoYsIdList.join(",");
this.form.zhongYsIds = this.form.zhongYsIdList.join(",");
this.form.zhongYsIdList = [];
this.form.paoYsIdList = [];
// 修改的提交 form.objectiveIds = form.objectiveIds && form.objectiveIds.length > 0 ? form.objectiveIds.split(',') : []
if (this.form.id != null) {
updateZhongPao(this.form).then(response => {
this.$modal.msgSuccess("保存配置成功");
this.getList();
});
return;
}
// 添加的提交 this.form = form
createZhongPao(this.form).then(response => { this.open = true;
this.$modal.msgSuccess("保存配置成功"); this.title = "修改重泡货配置";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
let form = this.form
form.objectiveIds = form.objectiveIds?.join(',')
// 修改的提交
if (this.form.id != null) {
updateZhongPao(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList(); this.getList();
}); });
return;
}
// 添加的提交
createZhongPao(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 deleteZhongPao(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 exportZhongPaoExcel(params);
}).then(response => {
this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false;
}).catch(() => {});
} }
}; }
};
</script> </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="status">
<el-select v-model="queryParams.status" placeholder="请选择" clearable size="small">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.HELP_DOC_STATUS)"
:key="dict.value" :label="dict.label" :value="dict.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="['system:help-doc: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="['system:help-doc: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="titleEn" />
<el-table-column label="内容中文" align="center" prop="contentZh" />
<el-table-column label="内容英语" align="center" prop="contentEn" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.HELP_DOC_STATUS" :value="scope.row.status" />
</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="['system:help-doc:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:help-doc: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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<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="192"/>
</el-form-item>
<el-form-item label="内容英语" prop="contentEn">
<editor v-model="form.contentZh" :min-height="192"/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio v-for="dict in this.getDictDatas(DICT_TYPE.HELP_DOC_STATUS)"
:key="dict.value" :label="parseInt(dict.value)">{{dict.label}}</el-radio>
</el-radio-group>
</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 { createHelpDoc, updateHelpDoc, deleteHelpDoc, getHelpDoc, getHelpDocPage, exportHelpDocExcel } from "@/api/system/helpDoc";
import Editor from '@/components/Editor';
export default {
name: "HelpDoc",
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,
status: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询
getHelpDocPage(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,
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;
getHelpDoc(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) {
updateHelpDoc(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
// 添加的提交
createHelpDoc(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 deleteHelpDoc(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 exportHelpDocExcel(params);
}).then(response => {
this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment