Commit 7e0c1c55 authored by yujinyao's avatar yujinyao

en_US.json和dict.js文件冲突

parents a378af4f 0f782c13
import request from "@/utils/request";
//获取网点列表
export function getNodeList(query) {
return request({
url: "/ecw/node/list-all-simple",
method: "get",
params: query,
});
}
//获取积分列表
export function getGiftList(data) {
return request({
url: "/ecw/reward/page",
method: "post",
params: {
page: data.page,
rows: data.rows,
},
data: data,
});
}
//新增礼品
export function addRewards(data) {
return request({
url: "/ecw/reward/create",
method: "post",
data: data,
});
}
//删除礼品
export function deleteRewards(data) {
return request({
url: "/ecw/reward/delete?id=" + data.id,
method: "delete",
});
}
//礼品延期
export function delayRewards(data) {
return request({
url: "/ecw/reward/delay",
method: "post",
data: data,
});
}
//编辑礼品
export function editRewards(data) {
return request({
url: "/ecw/reward/update",
method: "post",
data: data,
});
}
//礼品状态变更
export function changeRewardsStatus(data) {
return request({
url: "/ecw/reward/status",
method: "post",
data: data,
});
}
//复制礼品
export function copyRewardsAPI(id) {
return request({
url: "/ecw/reward/copy/" + id,
method: "post",
});
}
//获取单个礼品详情
export function getRewardsDetails(data) {
return request({
url: "/ecw/reward/get",
method: "get",
params: data,
});
}
//获取国家列表
export function getTradeCountryList() {
return request({
url: "/ecw/region/getTradeCountryList",
method: "get",
});
}
//获取城市列表
export function getCityList(query) {
return request({
url: "/ecw/region/getCityListByParent",
method: "get",
params: query,
});
}
//获取会员积分列表
export function getMemberList(data) {
return request({
url: "/member/user-score/page",
method: "post",
data,
});
}
//批量兑换礼品
export function bulkConversion(data) {
return request({
url: "/reward/redeem/batch",
method: "post",
data,
});
}
import request from "@/utils/request";
//操作积分
export function operateMemberScore(data) {
return request({
url: "/member/user-score/operate",
method: "post",
data: data,
});
}
//积分记录分页
export function queryMemberScoreRecord(data) {
return request({
url: "/member/user-score-log/page",
method: "post",
data: data,
});
}
//兑换记录分页
export function queryMemberExchangeRecord(data) {
return request({
url: "/reward/redeem/record/page",
method: "post",
data: data,
});
}
//批量核销按钮
export function batchVerifyAPI(data) {
return request({
url: "/reward/redeem/record/batch/verify",
method: "post",
data: data,
});
}
//兑换记录导出
export function batchRecordExport(data) {
return request({
url: "/reward/redeem/record/export",
method: "post",
data: data,
});
}
//兑换记录导入
export function batchRecordImport(data) {
return request({
url: "/reward/redeem/record/import",
method: "post",
data: data,
});
}
//兑换记录导入模板下载
export function batchRecordImportTemplate() {
return request({
url: "/reward/redeem/record/import/template",
method: "post",
responseType: "blob",
});
}
//撤销 操作
export function rewardCancelQuery(data) {
return request({
url: "/reward/redeem/record/cancel",
method: "post",
data: data,
});
}
//获取记录详情
export function getRewardDetailQuery(data) {
return request({
url: "/reward/redeem/record/detail",
method: "post",
data: data,
});
}
//更新兑换记录
export function updatedRewardsDetails(data) {
return request({
url: "/reward/redeem/record/update",
method: "post",
data: data,
});
}
//核销回退
export function verifyRollback(data) {
return request({
url: "/reward/redeem/record/verify-back",
method: "post",
data: data,
});
}
//核销 操作
export function verifyRedeem(data) {
return request({
url: "/reward/redeem/record/verify",
method: "post",
data: data,
});
}
//获取积分规则记录
export function getScoreRecordList(data) {
return request({
url: "/member/score-rule/page",
method: "post",
params: {
page: data.page,
rows: data.rows,
},
data,
});
}
//会员积分等级列表
export function getMemberLevelList(data) {
return request({
url: "/member/user-level/page",
method: "post",
data,
});
}
//新增会员等级设置
export function addNewMemberLevel(data) {
return request({
url: "/member/user-level/add",
method: "post",
data,
});
}
//删除会员等级
export function delMemberLevel(data) {
return request({
url: "/member/user-level/delete",
method: "post",
data,
});
}
//edit member level
export function editMemberLevel(data) {
return request({
url: "/member/user-level/update",
method: "post",
data,
});
}
//获得目的国、目的城市、目的仓列表
export function getRegionTreeList() {
return request({
url: "/member/score-rule/warehouse-tree-region-list",
method: "get",
});
}
//获取渠道列表
export function getChannelList() {
return request({
url: "/ecw/channel/list-all-simple",
method: "get",
});
}
//积分规则创建
export function createIntegralRule(data) {
return request({
url: "/member/score-rule/create",
method: "post",
data,
});
}
//启用关闭 积分规则
export function integralRuleStatus(data) {
return request({
url: "/member/score-rule/status",
method: "post",
data,
});
}
//复制积分规则
export function integralRuleCopy(data) {
return request({
url: "/member/score-rule/copy",
method: "post",
data,
});
}
//延期积分规则
export function integralRuleDelay(data) {
return request({
url: "/member/score-rule/delay",
method: "post",
data,
});
}
//删除积分规则
export function integralRuleDelete(data) {
return request({
url: "/member/score-rule/delete",
method: "post",
data,
});
}
//获取积分规则详情
export function integralRuleDetails(data) {
return request({
url: "/member/score-rule/get",
method: "post",
data,
});
}
//编辑积分规则
export function integralRuleUpdated(data) {
return request({
url: "/member/score-rule/update",
method: "post",
data,
});
}
<template> <template>
<div class="dict-selector"> <div class="dict-selector">
<el-select v-if="formType == 'select'" v-model="valueSync" :placeholder="placeholder || $t('请选择')" :clearable="clearable" :multiple="multiple" :disabled="disabled" @change="val => $emit('change', val)"> <el-select
<el-option v-for="dict in formattedList" v-if="formType == 'select'"
:key="dict.value" :label="$l(dict, 'label')" :value="dict.value"/> v-model="valueSync"
</el-select> :placeholder="placeholder || $t('请选择')"
<el-radio-group v-if="formType == 'radio'" v-model="valueSync" :disabled="disabled"> :clearable="clearable"
<el-radio v-for="dict in formattedList" :label="dict.value" :checked="valueSync === dict.value" :key="dict.value">{{$l(dict, 'label')}}</el-radio> :multiple="multiple"
</el-radio-group> :disabled="disabled"
<el-checkbox-group v-if="formType == 'checkbox'" v-model="valueSync" :disabled="disabled"> @change="(val) => $emit('change', val)"
<el-checkbox v-for="dict in formattedList" :label="dict.value" :key="dict.value">{{$l(dict, 'label')}}</el-checkbox> >
</el-checkbox-group> <el-option
</div> v-for="dict in formattedList"
:key="dict.value"
:label="$l(dict, 'label')"
:value="dict.value"
/>
</el-select>
<el-radio-group
v-if="formType == 'radio'"
v-model="valueSync"
:disabled="disabled"
>
<el-radio
v-for="dict in formattedList"
:label="dict.value"
:checked="valueSync === dict.value"
:key="dict.value"
>{{ $l(dict, "label") }}</el-radio
>
</el-radio-group>
<el-checkbox-group
v-if="formType == 'checkbox'"
v-model="valueSync"
:disabled="disabled"
>
<el-checkbox
v-for="dict in formattedList"
:label="dict.value"
:key="dict.value"
>{{ $l(dict, "label") }}</el-checkbox
>
</el-checkbox-group>
</div>
</template> </template>
<script> <script>
const FORMATTERS = { const FORMATTERS = {
"string": String, string: String,
"bool": function(val){ bool: function (val) {
return [false, 'false', 0, "0"].indexOf(val) < 0 return [false, "false", 0, "0"].indexOf(val) < 0;
}, },
'number': Number, number: Number,
'array': function(val){ array: function (val) {
return typeof val == 'string' ? val.split(',').filter(item => item && item !== '') : val return typeof val == "string"
} ? val.split(",").filter((item) => item && item !== "")
} : val;
},
};
export default { export default {
props:{ props: {
placeholder: { placeholder: {
type: String, type: String,
default: null default: null,
},
type: String,
value: [String, Number, Array, Boolean],
multiple: Boolean,
formType:{
type: String,
default: 'select'
},
formatter: {
type: [Function, String],
default: String
},
defaultable: Boolean, // 是否默认选择第一个
disabled: Boolean,
/**
* 过滤字典项,用于只使用部分字典项的场景
*/
filter: {
type: Function,
default: () => true
},
clearable: Boolean
}, },
data(){ type: String,
return { value: [String, Number, Array, Boolean],
valueSync: this.multiple ? [] : null multiple: Boolean,
} formType: {
type: String,
default: "select",
}, },
computed:{ formatter: {
dicts(){ type: [Function, String],
return this.getList(this.type) default: String,
},
dictList(){
return this.dicts.filter(this.filter)
},
formattedList(){
let arr = []
this.dictList.forEach(item => {
arr.push({
label: item.label,
labelEn: item.labelEn,
value: this.format(item.value),
cssClass: item.cssClass,
colorType: item.colorType
})
})
return arr
}
}, },
watch:{ defaultable: Boolean, // 是否默认选择第一个
valueSync(val){ disabled: Boolean,
this.$emit('input', val) /**
}, * 过滤字典项,用于只使用部分字典项的场景
value(val){ */
if(val != this.valueSync)this.setValueSync() filter: {
}, type: Function,
dictList(){ default: () => true,
this.setDefault() },
} clearable: Boolean,
},
data() {
return {
valueSync: this.multiple ? [] : null,
};
},
computed: {
dicts() {
return this.getList(this.type);
},
dictList() {
return this.dicts.filter(this.filter);
},
formattedList() {
let arr = [];
this.dictList.forEach((item) => {
arr.push({
label: item.label,
labelEn: item.labelEn,
value: this.format(item.value),
cssClass: item.cssClass,
colorType: item.colorType,
});
});
return arr;
}, },
created(){ },
this.setValueSync() watch: {
this.setDefault() valueSync(val) {
this.$emit("input", val);
}, },
methods:{ value(val) {
format(val){ if (val != this.valueSync) this.setValueSync();
if(val === null || val == undefined || val == '') return val },
let formatter = typeof this.formatter == 'function' ? this.formatter : FORMATTERS[this.formatter] dictList() {
if(!formatter){ this.setDefault();
console.warn('格式器无效', this.formatter) },
return val },
} created() {
return formatter(val) this.setValueSync();
}, this.setDefault();
changeValue(val){ },
this.valueSync = val methods: {
}, format(val) {
setValueSync(){ if (val === null || val == undefined || val == "") return val;
if(this.value === null || this.value === undefined || this.value === ''){
return this.valueSync = this.multiple ? [] : this.value let formatter =
} typeof this.formatter == "function"
if(this.multiple){ ? this.formatter
let value = this.value || [] : FORMATTERS[this.formatter];
if(typeof this.value == 'string'){
value = this.value.split(',').filter(item => item && item != '') if (!formatter) {
} console.warn("格式器无效", this.formatter);
this.valueSync = value.map(item => this.format(item)) return val;
}else{ }
this.valueSync = this.format(this.value)
} return formatter(val);
}, },
getList(){ changeValue(val) {
return this.getDictDatas(this.type) this.valueSync = val;
}, },
setDefault(){ setValueSync() {
if(!this.defaultable) return if (
if(this.dictList.length && (this.valueSync === null || this.valueSync == undefined || this.valueSync == '')){ this.value === null ||
this.valueSync = this.multiple ? [] : this.formattedList[0].value this.value === undefined ||
} this.value === ""
) {
return (this.valueSync = this.multiple ? [] : this.value);
}
if (this.multiple) {
let value = this.value || [];
if (typeof this.value == "string") {
value = this.value.split(",").filter((item) => item && item != "");
} }
} this.valueSync = value.map((item) => this.format(item));
} } else {
this.valueSync = this.format(this.value);
}
},
getList() {
return this.getDictDatas(this.type);
},
setDefault() {
if (!this.defaultable) return;
if (
this.dictList.length &&
(this.valueSync === null ||
this.valueSync == undefined ||
this.valueSync == "")
) {
this.valueSync = this.multiple ? [] : this.formattedList[0].value;
}
},
},
};
</script> </script>
<style scoped> <style scoped>
.dict-selector{ .dict-selector {
display: inline-block; display: inline-block;
} }
</style> </style>
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
:before-upload="handleBeforeUpload" :before-upload="handleBeforeUpload"
:file-list="fileList" :file-list="fileList"
:limit="limit" :limit="limit"
:disabled="disabled"
:on-error="handleUploadError" :on-error="handleUploadError"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:on-success="handleUploadSuccess" :on-success="handleUploadSuccess"
...@@ -15,24 +16,40 @@ ...@@ -15,24 +16,40 @@
ref="upload" ref="upload"
> >
<!-- 上传按钮 --> <!-- 上传按钮 -->
<el-button size="mini" type="primary">{{$t('选取文件')}}</el-button> <el-button size="mini" type="primary" :disabled="disabled">{{
$t("选取文件")
}}</el-button>
<!-- 上传提示 --> <!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip"> <div class="el-upload__tip" slot="tip" v-if="showTip">
请上传 请上传
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template> <template v-if="fileSize">
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
</template>
的文件 的文件
</div> </div>
</el-upload> </el-upload>
<!-- 文件列表 --> <!-- 文件列表 -->
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul"> <transition-group
<li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList"> class="upload-file-list el-upload-list el-upload-list--text"
name="el-fade-in-linear"
tag="ul"
>
<li
:key="file.url"
class="el-upload-list__item ele-upload-list__item-content"
v-for="(file, index) in fileList"
>
<el-link :href="`${file.url}`" :underline="false" target="_blank"> <el-link :href="`${file.url}`" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span> <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link> </el-link>
<div class="ele-upload-list__item-content-action"> <div class="ele-upload-list__item-content-action">
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link> <el-link :underline="false" @click="handleDelete(index)" type="danger"
>删除</el-link
>
</div> </div>
</li> </li>
</transition-group> </transition-group>
...@@ -62,18 +79,23 @@ export default { ...@@ -62,18 +79,23 @@ export default {
type: Array, type: Array,
default: () => ["doc", "xls", "ppt", "txt", "pdf"], default: () => ["doc", "xls", "ppt", "txt", "pdf"],
}, },
disabled: {
type: Boolean,
default: false,
},
// 是否显示提示 // 是否显示提示
isShowTip: { isShowTip: {
type: Boolean, type: Boolean,
default: true default: true,
} },
}, },
data() { data() {
return { return {
number: 0, number: 0,
uploadList: [], uploadList: [],
baseUrl: process.env.VUE_APP_BASE_API, baseUrl: process.env.VUE_APP_BASE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/org-name/up", // 上传的文件服务器地址 uploadFileUrl:
process.env.VUE_APP_BASE_API + "/admin-api/infra/file/org-name/up", // 上传的文件服务器地址
headers: { headers: {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
}, },
...@@ -86,9 +108,9 @@ export default { ...@@ -86,9 +108,9 @@ export default {
if (val) { if (val) {
let temp = 1; let temp = 1;
// 首先将值转为数组 // 首先将值转为数组
const list = Array.isArray(val) ? val : this.value.split(','); const list = Array.isArray(val) ? val : this.value.split(",");
// 然后将数组转为对象数组 // 然后将数组转为对象数组
this.fileList = list.map(item => { this.fileList = list.map((item) => {
if (typeof item === "string") { if (typeof item === "string") {
item = { name: item, url: item }; item = { name: item, url: item };
} }
...@@ -101,8 +123,8 @@ export default { ...@@ -101,8 +123,8 @@ export default {
} }
}, },
deep: true, deep: true,
immediate: true immediate: true,
} },
}, },
computed: { computed: {
// 是否显示提示 // 是否显示提示
...@@ -117,7 +139,9 @@ export default { ...@@ -117,7 +139,9 @@ export default {
if (this.fileType) { if (this.fileType) {
let fileExtension = ""; let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) { if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1).toLowerCase(); fileExtension = file.name
.slice(file.name.lastIndexOf(".") + 1)
.toLowerCase();
} }
const isTypeOk = this.fileType.some((type) => { const isTypeOk = this.fileType.some((type) => {
if (file.type.indexOf(type) > -1) return true; if (file.type.indexOf(type) > -1) return true;
...@@ -125,7 +149,9 @@ export default { ...@@ -125,7 +149,9 @@ export default {
return false; return false;
}); });
if (!isTypeOk) { if (!isTypeOk) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`); this.$modal.msgError(
`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
);
return false; return false;
} }
} }
...@@ -148,7 +174,7 @@ export default { ...@@ -148,7 +174,7 @@ export default {
// 上传失败 // 上传失败
handleUploadError(err) { handleUploadError(err) {
this.$modal.msgError("上传图片失败,请重试"); this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading() this.$modal.closeLoading();
}, },
// 上传成功回调 // 上传成功回调
handleUploadSuccess(res) { handleUploadSuccess(res) {
...@@ -182,9 +208,9 @@ export default { ...@@ -182,9 +208,9 @@ export default {
for (let i in list) { for (let i in list) {
strs += list[i].url + separator; strs += list[i].url + separator;
} }
return strs != '' ? strs.substr(0, strs.length - 1) : ''; return strs != "" ? strs.substr(0, strs.length - 1) : "";
} },
} },
}; };
</script> </script>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(item)"> <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(item)">
<i class="el-icon-zoom-in"></i> <i class="el-icon-zoom-in"></i>
</span> </span>
<span class="el-upload-list__item-delete" @click="handleRemove(item)"> <span class="el-upload-list__item-delete" @click="handleRemove(item)" v-if ="isShowEditButton">
<i class="el-icon-delete"></i> <i class="el-icon-delete"></i>
</span> </span>
</span> </span>
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
</ul> </ul>
<el-upload <el-upload
v-if ="isShowEditButton"
multiple multiple
:action="uploadImgUrl" :action="uploadImgUrl"
list-type="picture-card" list-type="picture-card"
...@@ -94,6 +95,11 @@ export default { ...@@ -94,6 +95,11 @@ export default {
isShowTip: { isShowTip: {
type: Boolean, type: Boolean,
default: true default: true
},
//是否显示编辑按钮
isShowEditButton:{
type: Boolean,
default: true
} }
}, },
data() { data() {
......
This diff is collapsed.
This diff is collapsed.
import axios from 'axios' import axios from "axios";
import { Notification, MessageBox, Message } from 'element-ui' import { Notification, MessageBox, Message } from "element-ui";
import store from '@/store' import store from "@/store";
import { getToken } from '@/utils/auth' import { getToken } from "@/utils/auth";
import errorCode from '@/utils/errorCode' import errorCode from "@/utils/errorCode";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import {getTenantEnable} from "@/utils/ruoyi"; import { getTenantEnable } from "@/utils/ruoyi";
import { getLocale } from '@/utils/db'; import { getLocale } from "@/utils/db";
import i18n from "@/i18n"; import i18n from "@/i18n";
// 是否显示重新登录 // 是否显示重新登录
export let isRelogin = { show: false }; export let isRelogin = { show: false };
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分 // axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: (localStorage.VUE_APP_BASE_API || process.env.VUE_APP_BASE_API) + '/admin-api/', // 此处的 /admin-api/ 地址,原因是后端的基础路径为 /admin-api/ baseURL:
(localStorage.VUE_APP_BASE_API || process.env.VUE_APP_BASE_API) +
"/admin-api/", // 此处的 /admin-api/ 地址,原因是后端的基础路径为 /admin-api/
// 超时 // 超时
timeout: 1000 * 30 timeout: 1000 * 30,
}) });
// 如果是生产环境则打印提示 // 如果是生产环境则打印提示
if (process.env.NODE_ENV === 'development' && service.defaults.baseURL === 'https://api2.groupage.cn/admin-api/') { if (
console.log('%c请注意,当前为生产环境请谨慎操作!!', 'background-color: red; font-size: 3em; color:yellow'); process.env.NODE_ENV === "development" &&
console.log('%c接口地址:' + service.defaults.baseURL, 'background-color: black; font-size: 1.5em; color:yellow !important'); service.defaults.baseURL === "https://api2.groupage.cn/admin-api/"
) {
console.log(
"%c请注意,当前为生产环境请谨慎操作!!",
"background-color: red; font-size: 3em; color:yellow"
);
console.log(
"%c接口地址:" + service.defaults.baseURL,
"background-color: black; font-size: 1.5em; color:yellow !important"
);
} }
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(
config.headers['locale'] = getLocale() (config) => {
// 是否需要设置 token config.headers["locale"] = getLocale();
const isToken = (config.headers || {}).isToken === false // 是否需要设置 token
if (getToken() && !isToken) { const isToken = (config.headers || {}).isToken === false;
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 if (getToken() && !isToken) {
} config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
// 设置租户
if (getTenantEnable()) {
const tenantId = Cookies.get('tenantId');
if (tenantId) {
config.headers['tenant-id'] = tenantId;
} }
} // 设置租户
// get请求映射params参数 if (getTenantEnable()) {
if (config.method === 'get' && config.params) { const tenantId = Cookies.get("tenantId");
let url = config.url + '?'; if (tenantId) {
for (const propName of Object.keys(config.params)) { config.headers["tenant-id"] = tenantId;
const value = config.params[propName]; }
var part = encodeURIComponent(propName) + "="; }
if (value !== null && typeof(value) !== "undefined") { // get请求映射params参数
if (typeof value === 'object') { if (config.method === "get" && config.params) {
for (const key of Object.keys(value)) { let url = config.url + "?";
let params = propName + '[' + key + ']'; for (const propName of Object.keys(config.params)) {
var subPart = encodeURIComponent(params) + "="; const value = config.params[propName];
url += subPart + encodeURIComponent(value[key]) + "&"; var part = encodeURIComponent(propName) + "=";
if (value !== null && typeof value !== "undefined") {
if (typeof value === "object") {
for (const key of Object.keys(value)) {
let params = propName + "[" + key + "]";
var subPart = encodeURIComponent(params) + "=";
url += subPart + encodeURIComponent(value[key]) + "&";
}
} else {
url += part + encodeURIComponent(value) + "&";
} }
} else {
url += part + encodeURIComponent(value) + "&";
} }
} }
url = url.slice(0, -1);
config.params = {};
config.url = url;
} }
url = url.slice(0, -1); return config;
config.params = {}; },
config.url = url; (error) => {
console.log(error);
Promise.reject(error);
} }
return config );
}, error => {
console.log(error)
Promise.reject(error)
})
// 响应拦截器 // 响应拦截器
service.interceptors.response.use(res => { service.interceptors.response.use(
(res) => {
// 未设置状态码则默认成功状态 // 未设置状态码则默认成功状态
const code = res.data.code || 200; const code = res.data.code || 200;
// 获取错误信息 // 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default'] const msg = errorCode[code] || res.data.msg || errorCode["default"];
if (code === 401) { if (code === 401) {
if (!isRelogin.show) { if (!isRelogin.show) {
isRelogin.show = true; isRelogin.show = true;
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { MessageBox.confirm(
confirmButtonText: '重新登录', "登录状态已过期,您可以继续留在该页面,或者重新登录",
cancelButtonText: '取消', "系统提示",
type: 'warning' {
confirmButtonText: "重新登录",
cancelButtonText: "取消",
type: "warning",
} }
).then(() => { )
isRelogin.show = false; .then(() => {
store.dispatch('LogOut').then(() => { isRelogin.show = false;
location.href = '/'; store.dispatch("LogOut").then(() => {
location.href = "/";
});
}) })
}).catch(() => { .catch(() => {
isRelogin.show = false; isRelogin.show = false;
}); });
} }
return Promise.reject('无效的会话,或者会话已过期,请重新登录。') return Promise.reject("无效的会话,或者会话已过期,请重新登录。");
} else if (code === 500) { } else if (code === 500) {
Message({ Message({
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
message: msg, message: msg,
type: 'error' type: "error",
}) });
return Promise.reject(new Error(msg)) return Promise.reject(new Error(msg));
} else if (code === 901) { } else if (code === 901) {
Message({ Message({
type: 'error', type: "error",
duration: 0, duration: 0,
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
message: '<div>演示模式,无法进行写操作</div>' message:
+ '<div> &nbsp; </div>' "<div>演示模式,无法进行写操作</div>" +
+ '<div>参考 https://doc.iocoder.cn/ 教程</div>' "<div> &nbsp; </div>" +
+ '<div> &nbsp; </div>' "<div>参考 https://doc.iocoder.cn/ 教程</div>" +
+ '<div>5 分钟搭建本地环境</div>', "<div> &nbsp; </div>" +
}) "<div>5 分钟搭建本地环境</div>",
return Promise.reject(new Error(msg)) });
return Promise.reject(new Error(msg));
} else if (code === 555) { } else if (code === 555) {
// 额外情况 // 额外情况
return Promise.reject(res.data) return Promise.reject(res.data);
} else if (code === 566) { } else if (code === 566) {
// 额外情况 // 额外情况
return Promise.reject(res.data) return Promise.reject(res.data);
} else if (code === 666) { } else if (code === 666) {
// 额外情况 // 额外情况
return Promise.reject(res.data) return Promise.reject(res.data);
} else if (code !== 200) { } else if (code !== 200) {
// 如果内容很长则用alert提示,不然可能显示不全,自动隐藏也会导致看不完整就消失了 // 如果内容很长则用alert提示,不然可能显示不全,自动隐藏也会导致看不完整就消失了
if(msg.length > 300){ if (msg.length > 300) {
MessageBox.alert(msg, i18n.t('错误提示'), i18n.t('确定')) MessageBox.alert(msg, i18n.t("错误提示"), i18n.t("确定"));
}else{ } else {
Notification.error({ Notification.error({
title: msg title: msg,
}) });
} }
return Promise.reject(msg || 'error') return Promise.reject(msg || "error");
} else { } else {
return res.data return res.data;
} }
}, },
error => { (error) => {
console.log('err' + error) console.log("err" + error);
let { message } = error; let { message } = error;
if (message === "Network Error") { if (message === "Network Error") {
message = "后端接口连接异常"; message = "后端接口连接异常";
} } else if (message.includes("timeout")) {
else if (message.includes("timeout")) {
message = "系统接口请求超时"; message = "系统接口请求超时";
} } else if (message.includes("Request failed with status code")) {
else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常"; message = "系统接口" + message.substr(message.length - 3) + "异常";
} }
Message({ Message({
message: message, message: message,
type: 'error', type: "error",
duration: 5 * 1000 duration: 5 * 1000,
}) });
return Promise.reject(error) return Promise.reject(error);
} }
) );
export function getBaseHeader() { export function getBaseHeader() {
return { return {
'Authorization': "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
'tenant-id': Cookies.get('tenantId'), "tenant-id": Cookies.get("tenantId"),
} };
} }
export default service export default service;
...@@ -601,7 +601,7 @@ export default { ...@@ -601,7 +601,7 @@ export default {
regError, regError,
editForm, editForm,
updateError, updateError,
//lanbm 2024-05-23 异常登记对话框 //异常登记对话框
unloadingError, unloadingError,
}, },
created() { created() {
...@@ -615,7 +615,7 @@ export default { ...@@ -615,7 +615,7 @@ export default {
const { data } = res; const { data } = res;
this.allUsers = data.list ?? []; this.allUsers = data.list ?? [];
}); });
//lanbm 2024-05-16 add //add
/* 不用此方式 /* 不用此方式
getCurrencyList().then((res) => { getCurrencyList().then((res) => {
this.currencyList = res.data ?? []; this.currencyList = res.data ?? [];
......
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 -->
<el-form <el-form
:model="queryParams" :model="queryParams"
ref="queryForm" ref="queryForm"
...@@ -15,7 +14,8 @@ ...@@ -15,7 +14,8 @@
:placeholder="$t('请输入客户编号')" :placeholder="$t('请输入客户编号')"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"/> onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户名称')" prop="name"> <el-form-item :label="$t('客户名称')" prop="name">
<el-input <el-input
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户等级')" prop="level"> <el-form-item :label="$t('客户等级')" prop="level">
<el-select <el-select
multiple multiple
v-model="queryParams.level" v-model="queryParams.level"
:placeholder="$t('请选择客户等级')" :placeholder="$t('请选择客户等级')"
clearable clearable
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户类别')" prop="level"> <el-form-item :label="$t('客户类别')" prop="level">
<dict-selector <dict-selector
multiple multiple
clearable clearable
:type="DICT_TYPE.CUSTOMER_TYPE" :type="DICT_TYPE.CUSTOMER_TYPE"
v-model="queryParams.type" v-model="queryParams.type"
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('国家')" prop="source"> <el-form-item :label="$t('国家')" prop="source">
<el-select <el-select
multiple multiple
clearable clearable
v-model="queryParams.country" v-model="queryParams.country"
:placeholder="$t('请选择国家')" :placeholder="$t('请选择国家')"
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户状态')" prop="status"> <el-form-item :label="$t('客户状态')" prop="status">
<el-select <el-select
multiple multiple
clearable clearable
v-model="queryParams.status" v-model="queryParams.status"
:placeholder="$t('请选择客户状态')" :placeholder="$t('请选择客户状态')"
...@@ -136,13 +136,11 @@ ...@@ -136,13 +136,11 @@
range-separator="-" range-separator="-"
:start-placeholder="$t('开始日期')" :start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')" :end-placeholder="$t('结束日期')"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('信用等级')" prop="department"> <el-form-item :label="$t('信用等级')" prop="department">
<el-select multiple clearable v-model="queryParams.creditLevel"> <el-select multiple clearable v-model="queryParams.creditLevel">
<el-option <el-option
v-for="(item, index) in creditList" v-for="(item, index) in creditList"
:label="isChinese ? item.nameZh : item.nameEn" :label="isChinese ? item.nameZh : item.nameEn"
:key="index" :key="index"
...@@ -160,6 +158,36 @@ ...@@ -160,6 +158,36 @@
formatter="number" formatter="number"
@change="handleQuery" @change="handleQuery"
></dict-selector> ></dict-selector>
</el-form-item>
<el-form-item :label="$t('会员电话')" prop="department">
<el-col :span="11">
<area-code-selector style="width: 100%;" v-model="queryParams.memberAreaCode" />
</el-col>
<el-col class="line" :span="2"></el-col>
<el-col :span="11">
<el-input maxlength="11"
width="100%"
class="ml-10 w-200"
clearable
v-model.number="queryParams.memberMobile"
:placeholder="$t('请输入会员电话')"/>
</el-col>
</el-form-item>
<el-form-item :label="$t('会员编号')" prop="number">
<el-input
v-model.trim="queryParams.memberCode"
:placeholder="$t('请输入会员编号')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('会员名称')" prop="name">
<el-input
v-model.trim="queryParams.memberName"
:placeholder="$t('请输入会员名称')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{
...@@ -268,6 +296,18 @@ ...@@ -268,6 +296,18 @@
>{{ $t("新增潜在客户") }}</el-button >{{ $t("新增潜在客户") }}</el-button
> >
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleMergeCus"
>{{ $t("合并客户") }}</el-button
>
</el-col>
<right-toolbar <right-toolbar
:showSearch.sync="showSearch" :showSearch.sync="showSearch"
@queryTable="getList" @queryTable="getList"
...@@ -1035,6 +1075,8 @@ import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue"; ...@@ -1035,6 +1075,8 @@ import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue"; import Contacts from "@/views/ecw/customer/components/contacts.vue";
import { getUserProfile } from "@/api/system/user"; import { getUserProfile } from "@/api/system/user";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
export default { export default {
name: "EcwCustomerIndex", name: "EcwCustomerIndex",
components: { components: {
...@@ -1045,6 +1087,7 @@ export default { ...@@ -1045,6 +1087,7 @@ export default {
CustomerFollowList, CustomerFollowList,
customerComplaints, customerComplaints,
transferCustomer, transferCustomer,
AreaCodeSelector
}, },
data() { data() {
return { return {
...@@ -1056,7 +1099,7 @@ export default { ...@@ -1056,7 +1099,7 @@ export default {
// 导出遮罩层 // 导出遮罩层
exportLoading: false, exportLoading: false,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: false,
// 总条数 // 总条数
total: 0, total: 0,
// 客户列表 // 客户列表
...@@ -1080,6 +1123,10 @@ export default { ...@@ -1080,6 +1123,10 @@ export default {
creditLevel: null, creditLevel: null,
country: null, country: null,
resourceType: null, resourceType: null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -1220,6 +1267,9 @@ export default { ...@@ -1220,6 +1267,9 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
handleMergeCus() {
//合并客户
},
recovery(row) { recovery(row) {
this.$confirm(this.$t("是否要回收当前{name}", row), "提示", { this.$confirm(this.$t("是否要回收当前{name}", row), "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
...@@ -1470,6 +1520,10 @@ export default { ...@@ -1470,6 +1520,10 @@ export default {
department: null, department: null,
creditLevel: null, creditLevel: null,
country: null, country: null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
}; };
this.handleQuery(); this.handleQuery();
}, },
......
...@@ -28,6 +28,36 @@ ...@@ -28,6 +28,36 @@
<el-form-item :label="$t('市场获客')" prop="department"> <el-form-item :label="$t('市场获客')" prop="department">
<dict-selector clearable :type="DICT_TYPE.ECW_CUSTOMER_RESOURCE_TYPE" v-model="queryParams.marketType" formatter="number" @change="handleQuery"></dict-selector> <dict-selector clearable :type="DICT_TYPE.ECW_CUSTOMER_RESOURCE_TYPE" v-model="queryParams.marketType" formatter="number" @change="handleQuery"></dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('会员电话')" prop="department">
<el-col :span="11">
<area-code-selector style="width: 100%;" v-model="queryParams.memberAreaCode" />
</el-col>
<el-col class="line" :span="2"></el-col>
<el-col :span="11">
<el-input maxlength="11"
width="100%"
class="ml-10 w-200"
clearable
v-model.number="queryParams.memberMobile"
:placeholder="$t('请输入会员电话')"/>
</el-col>
</el-form-item>
<el-form-item :label="$t('会员编号')" prop="number">
<el-input
v-model.trim="queryParams.memberCode"
:placeholder="$t('请输入会员编号')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('会员名称')" prop="name">
<el-input
v-model.trim="queryParams.memberName"
:placeholder="$t('请输入会员名称')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
...@@ -35,6 +65,13 @@ ...@@ -35,6 +65,13 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<!-- 列表 --> <!-- 列表 -->
<el-table ref="multipleTable" v-loading="loading" :data="list" @selection-change="handleSelectionChange"> <el-table ref="multipleTable" v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column <el-table-column
...@@ -43,7 +80,6 @@ ...@@ -43,7 +80,6 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户名称')" align="center" prop="name" > <el-table-column :label="$t('客户名称')" align="center" prop="name" >
<template v-slot="scope"> <template v-slot="scope">
<span>{{ $l(scope.row,'name') }}</span> <span>{{ $l(scope.row,'name') }}</span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -99,9 +135,13 @@ import { getDictDatas, DICT_TYPE } from '@/utils/dict'; ...@@ -99,9 +135,13 @@ import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {listServiceUser} from "@/api/system/user"; import {listServiceUser} from "@/api/system/user";
import {exportCustomerComplaintExcel} from "@/api/ecw/customerComplaint"; import {exportCustomerComplaintExcel} from "@/api/ecw/customerComplaint";
import {indirectCustomerExportExcel} from "@/api/ecw/customer"; import {indirectCustomerExportExcel} from "@/api/ecw/customer";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
export default { export default {
name: "EcwCustomerIndirectcustomer", name: "EcwCustomerIndirectcustomer",
components: {
AreaCodeSelector
},
activated() { activated() {
this.getList() this.getList()
}, },
...@@ -114,7 +154,7 @@ export default { ...@@ -114,7 +154,7 @@ export default {
loading: true, loading: true,
// 导出遮罩层 // 导出遮罩层
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: false,
// 总条数 // 总条数
total: 0, total: 0,
// 客户列表 // 客户列表
...@@ -131,7 +171,11 @@ export default { ...@@ -131,7 +171,11 @@ export default {
name: null, name: null,
source: null, source: null,
customerService: null, customerService: null,
marketType:null marketType:null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
}, },
// 网点 // 网点
nodeList: [], nodeList: [],
...@@ -203,6 +247,10 @@ export default { ...@@ -203,6 +247,10 @@ export default {
name: null, name: null,
source: null, source: null,
customerService: null, customerService: null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
} }
this.handleQuery(); this.handleQuery();
}, },
......
<template>
<div class="app-container">
<el-card style="margin-bottom: 10px"> </el-card>
<el-card style="margin-bottom: 10px"> </el-card>
</div>
</template>
\ No newline at end of file
...@@ -57,6 +57,36 @@ ...@@ -57,6 +57,36 @@
<el-form-item :label="$t('市场获客')" prop="department"> <el-form-item :label="$t('市场获客')" prop="department">
<dict-selector multiple clearable :type="DICT_TYPE.ECW_CUSTOMER_RESOURCE_TYPE" v-model="queryParams.marketType" formatter="number" @change="handleQuery"></dict-selector> <dict-selector multiple clearable :type="DICT_TYPE.ECW_CUSTOMER_RESOURCE_TYPE" v-model="queryParams.marketType" formatter="number" @change="handleQuery"></dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('会员电话')" prop="department">
<el-col :span="11">
<area-code-selector style="width: 100%;" v-model="queryParams.memberAreaCode" />
</el-col>
<el-col class="line" :span="2"></el-col>
<el-col :span="11">
<el-input maxlength="11"
width="100%"
class="ml-10 w-200"
clearable
v-model.number="queryParams.memberMobile"
:placeholder="$t('请输入会员电话')"/>
</el-col>
</el-form-item>
<el-form-item :label="$t('会员编号')" prop="number">
<el-input
v-model.trim="queryParams.memberCode"
:placeholder="$t('请输入会员编号')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('会员名称')" prop="name">
<el-input
v-model.trim="queryParams.memberName"
:placeholder="$t('请输入会员名称')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
...@@ -373,7 +403,7 @@ import {getCountryListAll} from "@/api/ecw/country"; ...@@ -373,7 +403,7 @@ import {getCountryListAll} from "@/api/ecw/country";
import {getCreditPage} from "@/api/customer/credit"; import {getCreditPage} from "@/api/customer/credit";
import transferCustomer from "@/views/ecw/customer/transferCustomer.vue"; import transferCustomer from "@/views/ecw/customer/transferCustomer.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue"; import Contacts from "@/views/ecw/customer/components/contacts.vue";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
export default { export default {
...@@ -391,7 +421,8 @@ export default { ...@@ -391,7 +421,8 @@ export default {
}, },
components: { components: {
Contacts, Contacts,
transferCustomer transferCustomer,
AreaCodeSelector
}, },
data() { data() {
return { return {
...@@ -400,7 +431,7 @@ export default { ...@@ -400,7 +431,7 @@ export default {
// 导出遮罩层 // 导出遮罩层
exportLoading: false, exportLoading: false,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: false,
// 总条数 // 总条数
total: 0, total: 0,
// 客户列表 // 客户列表
...@@ -425,6 +456,10 @@ export default { ...@@ -425,6 +456,10 @@ export default {
creditLevel:null, creditLevel:null,
country:null, country:null,
marketType:null, marketType:null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -563,6 +598,10 @@ export default { ...@@ -563,6 +598,10 @@ export default {
department: null, department: null,
creditLevel:null, creditLevel:null,
country:null, country:null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
} }
this.handleQuery(); this.handleQuery();
}, },
......
...@@ -58,6 +58,36 @@ ...@@ -58,6 +58,36 @@
<el-form-item :label="$t('市场获客')" prop="department"> <el-form-item :label="$t('市场获客')" prop="department">
<dict-selector clearable :type="DICT_TYPE.ECW_CUSTOMER_RESOURCE_TYPE" v-model="queryParams.marketType" formatter="number"></dict-selector> <dict-selector clearable :type="DICT_TYPE.ECW_CUSTOMER_RESOURCE_TYPE" v-model="queryParams.marketType" formatter="number"></dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('会员电话')" prop="department">
<el-col :span="11">
<area-code-selector style="width: 100%;" v-model="queryParams.memberAreaCode" />
</el-col>
<el-col class="line" :span="2"></el-col>
<el-col :span="11">
<el-input maxlength="11"
width="100%"
class="ml-10 w-200"
clearable
v-model.number="queryParams.memberMobile"
:placeholder="$t('请输入会员电话')"/>
</el-col>
</el-form-item>
<el-form-item :label="$t('会员编号')" prop="number">
<el-input
v-model.trim="queryParams.memberCode"
:placeholder="$t('请输入会员编号')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('会员名称')" prop="name">
<el-input
v-model.trim="queryParams.memberName"
:placeholder="$t('请输入会员名称')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
...@@ -180,6 +210,7 @@ import {getCreditPage} from "@/api/customer/credit"; ...@@ -180,6 +210,7 @@ import {getCreditPage} from "@/api/customer/credit";
import transferCustomer from "@/views/ecw/customer/transferCustomer"; import transferCustomer from "@/views/ecw/customer/transferCustomer";
import Template from "@/views/cms/template/index.vue"; import Template from "@/views/cms/template/index.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue"; import Contacts from "@/views/ecw/customer/components/contacts.vue";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
export default { export default {
name: "EcwCustomertobeassignedIndex", name: "EcwCustomertobeassignedIndex",
activated() { activated() {
...@@ -189,7 +220,8 @@ export default { ...@@ -189,7 +220,8 @@ export default {
Contacts, Contacts,
Template, Template,
upload, upload,
transferCustomer transferCustomer,
AreaCodeSelector
}, },
data() { data() {
return { return {
...@@ -201,7 +233,7 @@ export default { ...@@ -201,7 +233,7 @@ export default {
// 导出遮罩层 // 导出遮罩层
exportLoading: false, exportLoading: false,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: false,
// 总条数 // 总条数
total: 0, total: 0,
// 客户列表 // 客户列表
...@@ -226,6 +258,10 @@ export default { ...@@ -226,6 +258,10 @@ export default {
creditLevel:null, creditLevel:null,
country:null, country:null,
marketType:null, marketType:null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -357,6 +393,10 @@ export default { ...@@ -357,6 +393,10 @@ export default {
department: null, department: null,
creditLevel:null, creditLevel:null,
country:null, country:null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
} }
this.handleQuery(); this.handleQuery();
}, },
......
<template>
<el-dialog
:title="$t('选择会员')"
:visible.sync="dialogVisible"
width="80%"
:before-close="dialogBeforeClose"
>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
v-show="showSearch"
:inline="true"
label-width="120px"
>
<el-form-item :label="$t('当前积分')">
<el-row :gutter="10">
<el-col :span="8">
<dict-selector
clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.holdScoreOperate"
@change="handleQuery"
>
</dict-selector>
</el-col>
<el-col :span="16">
<el-input
v-model.trim="queryParams.holdScore"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('关键词')">
<el-input
style="width: 300px"
v-model.trim="queryParams.key"
:placeholder="$t('请输入会员名称/会员编号/手机号')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('国家')">
<el-select
v-model="queryParams.country"
:placeholder="$t('请选择国家')"
clearable
@change="handleGetCityList($event)"
size="small"
>
<el-option
v-for="nodeItem in countryList"
:key="nodeItem.id"
:label="isChinese ? nodeItem.titleZh : nodeItem.titleEn"
:value="nodeItem.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('城市')">
<el-select
v-model="queryParams.city"
:placeholder="$t('请选择城市')"
clearable
size="small"
>
<el-option
v-for="nodeItem in cityList"
:key="nodeItem.id"
:label="isChinese ? nodeItem.titleZh : nodeItem.titleEn"
:value="nodeItem.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
>{{ $t("搜索") }}</el-button
>
<el-button icon="el-icon-refresh" @click="resetQuery">{{
$t("重置")
}}</el-button>
</el-form-item>
</el-form>
<el-row class="mb8">
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="handleQueryPagination"
></right-toolbar>
</el-row>
<el-table
ref="multipleTable"
v-loading="loading"
@selection-change="handleSelectionChange"
:data="memberList"
>
<el-table-column type="selection" width="55" :selectable="selectable">
</el-table-column>
<el-table-column
:label="$t('会员名称')"
align="center"
:prop="isChinese ? 'memberNameZh' : 'memberNameEn'"
></el-table-column>
<el-table-column
width="140"
:label="$t('会员编号')"
align="center"
prop="id"
></el-table-column>
<el-table-column
width="140"
:label="$t('手机号')"
align="center"
prop="mobile"
></el-table-column>
<el-table-column
width="140"
align="center"
:label="$t('国家')"
:prop="isChinese ? 'countryNameZh' : 'countryNameEn'"
></el-table-column>
<el-table-column
:label="$t('城市')"
align="center"
:prop="isChinese ? 'cityNameZh' : 'cityNameEn'"
></el-table-column>
<el-table-column
:label="$t('当前积分')"
align="center"
prop="holdScore"
></el-table-column>
</el-table>
<!-- //分页列表 -->
<span v-show="selectedMember.memberList.length > 0"
>{{ $t("已选择:") }} {{ selectedMember.memberName }} {{ $t("") }}
<span style="color: red"> {{ selectedMember.memberList.length }} </span>
{{ $t("") }}</span
>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="handleQueryPagination"
/>
</div>
<div slot="footer">
<el-button @click="dialogBeforeClose">取 消</el-button>
<el-button type="primary" @click="transferSelectMember">确 定</el-button>
</div>
</el-dialog>
</template>
<script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import {
getCityList,
getTradeCountryList,
getMemberList,
} from "@/api/ecw/giftManagement";
import { color } from "echarts/lib/export";
export default {
name: "chooseMember",
props: {
dialogVisible: {
type: Boolean,
default: false,
},
memberSelectList: {
type: Array,
default: () => [],
},
},
watch: {
dialogVisible(val) {
if (val == true) {
this.handleQuery();
}
},
memberSelectList(val) {
this.selectedMember.memberList = val;
},
},
data() {
return {
selectedMember: { memberList: [], memberName: "" },
countryList: [],
cityList: [],
total: 0,
loading: true,
memberList: [],
// 显示搜索条件
showSearch: true,
queryParams: {
country: null,
city: null,
endTime: "",
holdScore: null,
holdScoreOperate: null,
key: "",
pageNo: 1,
pageSize: 10,
startTime: "",
usedScore: null,
usedScoreOperate: null,
},
};
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
},
created() {
this.handleQuery();
this.getCountryList();
},
activated() {
this.handleQuery();
},
methods: {
selectable(row, index) {
if (this.memberSelectList.length > 0) {
return this.memberSelectList.some((item) => {
return item.id != row.id;
});
} else {
return true;
}
},
handleSelectionChange(val) {
this.selectedMember.memberList = val;
let arraryMemberName = [];
if (val) {
this.selectedMember.memberList.forEach((element) => {
if (this.isChinese) {
arraryMemberName.push(element.memberNameZh);
} else {
arraryMemberName.push(element.memberNameEn);
}
});
}
this.selectedMember.memberName = arraryMemberName.join("");
},
transferSelectMember() {
this.dialogBeforeClose();
this.$emit("transferSelectMemberInfo", this.selectedMember.memberList);
},
dialogBeforeClose() {
this.loading = true;
this.queryParams = {
country: null,
city: null,
endTime: null,
holdScore: null,
holdScoreOperate: null,
key: null,
pageNo: 1,
pageSize: 10,
startTime: null,
usedScore: null,
usedScoreOperate: null,
};
// this.dialogVisible = false;
this.$emit("update:dialogVisible", false);
},
getCountryList() {
getTradeCountryList().then((res) => {
this.countryList = res.data;
});
},
handleGetCityList(id) {
if (id) {
let params = {
id: id,
};
getCityList(params).then((res) => {
this.cityList = res.data;
});
} else {
this.cityList = [];
}
},
handleQuery() {
this.queryParams.pageNo = 1;
let params = { ...this.queryParams };
getMemberList(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
this.total = res.data.total;
});
},
handleQueryPagination() {
let params = { ...this.queryParams };
getMemberList(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
this.total = res.data.total;
});
},
resetQuery() {
this.loading = true;
this.queryParams = {
country: null,
city: null,
endTime: null,
holdScore: null,
holdScoreOperate: null,
key: null,
pageNo: 1,
pageSize: 10,
startTime: null,
usedScore: null,
usedScoreOperate: null,
};
this.handleQuery();
},
},
};
</script>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -574,7 +574,7 @@ export default { ...@@ -574,7 +574,7 @@ export default {
$route(to) { $route(to) {
//lanbm 2024-05-06 解决重新进入参数不刷新的问题 //lanbm 2024-05-06 解决重新进入参数不刷新的问题
//this.$route.name == "客户分析" 用name做逻辑判断,有时候菜单名称会变化 //this.$route.name == "客户分析" 用name做逻辑判断,有时候菜单名称会变化
//"/report/customer_analysis" lanbm 2024-05-07 调整为根据path做逻辑判断 //"/report/customer_analysis" 调整为根据path做逻辑判断
if (this.$route.path == "/report/customer_analysis") { if (this.$route.path == "/report/customer_analysis") {
this.doLoadData(); this.doLoadData();
} }
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
/>--> />-->
</div> </div>
</template> </template>
<script> <script>
import UserSelector from "@/components/UserSelector"; import UserSelector from "@/components/UserSelector";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
...@@ -389,4 +389,3 @@ export default { ...@@ -389,4 +389,3 @@ export default {
}, },
}; };
</script> </script>
\ No newline at end of file
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