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>
<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-option 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>
<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-option
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>
<script>
const FORMATTERS = {
"string": String,
"bool": function(val){
return [false, 'false', 0, "0"].indexOf(val) < 0
},
'number': Number,
'array': function(val){
return typeof val == 'string' ? val.split(',').filter(item => item && item !== '') : val
}
}
string: String,
bool: function (val) {
return [false, "false", 0, "0"].indexOf(val) < 0;
},
number: Number,
array: function (val) {
return typeof val == "string"
? val.split(",").filter((item) => item && item !== "")
: val;
},
};
export default {
props:{
placeholder: {
type: String,
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
props: {
placeholder: {
type: String,
default: null,
},
data(){
return {
valueSync: this.multiple ? [] : null
}
type: String,
value: [String, Number, Array, Boolean],
multiple: Boolean,
formType: {
type: String,
default: "select",
},
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
}
formatter: {
type: [Function, String],
default: String,
},
watch:{
valueSync(val){
this.$emit('input', val)
},
value(val){
if(val != this.valueSync)this.setValueSync()
},
dictList(){
this.setDefault()
}
defaultable: Boolean, // 是否默认选择第一个
disabled: Boolean,
/**
* 过滤字典项,用于只使用部分字典项的场景
*/
filter: {
type: Function,
default: () => true,
},
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()
this.setDefault()
},
watch: {
valueSync(val) {
this.$emit("input", val);
},
methods:{
format(val){
if(val === null || val == undefined || val == '') return val
let formatter = typeof this.formatter == 'function' ? this.formatter : FORMATTERS[this.formatter]
if(!formatter){
console.warn('格式器无效', this.formatter)
return val
}
return formatter(val)
},
changeValue(val){
this.valueSync = val
},
setValueSync(){
if(this.value === null || 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
}
value(val) {
if (val != this.valueSync) this.setValueSync();
},
dictList() {
this.setDefault();
},
},
created() {
this.setValueSync();
this.setDefault();
},
methods: {
format(val) {
if (val === null || val == undefined || val == "") return val;
let formatter =
typeof this.formatter == "function"
? this.formatter
: FORMATTERS[this.formatter];
if (!formatter) {
console.warn("格式器无效", this.formatter);
return val;
}
return formatter(val);
},
changeValue(val) {
this.valueSync = val;
},
setValueSync() {
if (
this.value === null ||
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>
<style scoped>
.dict-selector{
display: inline-block;
.dict-selector {
display: inline-block;
}
</style>
......@@ -6,6 +6,7 @@
:before-upload="handleBeforeUpload"
:file-list="fileList"
:limit="limit"
:disabled="disabled"
:on-error="handleUploadError"
:on-exceed="handleExceed"
:on-success="handleUploadSuccess"
......@@ -15,24 +16,40 @@
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">
请上传
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
<template v-if="fileSize">
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
</template>
的文件
</div>
</el-upload>
<!-- 文件列表 -->
<transition-group 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">
<transition-group
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">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link>
<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>
</li>
</transition-group>
......@@ -62,18 +79,23 @@ export default {
type: Array,
default: () => ["doc", "xls", "ppt", "txt", "pdf"],
},
disabled: {
type: Boolean,
default: false,
},
// 是否显示提示
isShowTip: {
type: Boolean,
default: true
}
default: true,
},
},
data() {
return {
number: 0,
uploadList: [],
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: {
Authorization: "Bearer " + getToken(),
},
......@@ -86,9 +108,9 @@ export default {
if (val) {
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") {
item = { name: item, url: item };
}
......@@ -101,8 +123,8 @@ export default {
}
},
deep: true,
immediate: true
}
immediate: true,
},
},
computed: {
// 是否显示提示
......@@ -117,7 +139,9 @@ export default {
if (this.fileType) {
let fileExtension = "";
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) => {
if (file.type.indexOf(type) > -1) return true;
......@@ -125,7 +149,9 @@ export default {
return false;
});
if (!isTypeOk) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
this.$modal.msgError(
`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
);
return false;
}
}
......@@ -148,7 +174,7 @@ export default {
// 上传失败
handleUploadError(err) {
this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading()
this.$modal.closeLoading();
},
// 上传成功回调
handleUploadSuccess(res) {
......@@ -182,9 +208,9 @@ export default {
for (let i in list) {
strs += list[i].url + separator;
}
return strs != '' ? strs.substr(0, strs.length - 1) : '';
}
}
return strs != "" ? strs.substr(0, strs.length - 1) : "";
},
},
};
</script>
......
......@@ -16,7 +16,7 @@
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(item)">
<i class="el-icon-zoom-in"></i>
</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>
</span>
</span>
......@@ -24,6 +24,7 @@
</ul>
<el-upload
v-if ="isShowEditButton"
multiple
:action="uploadImgUrl"
list-type="picture-card"
......@@ -94,6 +95,11 @@ export default {
isShowTip: {
type: Boolean,
default: true
},
//是否显示编辑按钮
isShowEditButton:{
type: Boolean,
default: true
}
},
data() {
......
This diff is collapsed.
This diff is collapsed.
import axios from 'axios'
import { Notification, MessageBox, Message } from 'element-ui'
import store from '@/store'
import { getToken } from '@/utils/auth'
import errorCode from '@/utils/errorCode'
import axios from "axios";
import { Notification, MessageBox, Message } from "element-ui";
import store from "@/store";
import { getToken } from "@/utils/auth";
import errorCode from "@/utils/errorCode";
import Cookies from "js-cookie";
import {getTenantEnable} from "@/utils/ruoyi";
import { getLocale } from '@/utils/db';
import { getTenantEnable } from "@/utils/ruoyi";
import { getLocale } from "@/utils/db";
import i18n from "@/i18n";
// 是否显示重新登录
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实例
const service = axios.create({
// 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/') {
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');
if (
process.env.NODE_ENV === "development" &&
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拦截器
service.interceptors.request.use(config => {
config.headers['locale'] = getLocale()
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
// 设置租户
if (getTenantEnable()) {
const tenantId = Cookies.get('tenantId');
if (tenantId) {
config.headers['tenant-id'] = tenantId;
service.interceptors.request.use(
(config) => {
config.headers["locale"] = getLocale();
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false;
if (getToken() && !isToken) {
config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
}
}
// get请求映射params参数
if (config.method === 'get' && config.params) {
let url = config.url + '?';
for (const propName of Object.keys(config.params)) {
const value = config.params[propName];
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]) + "&";
// 设置租户
if (getTenantEnable()) {
const tenantId = Cookies.get("tenantId");
if (tenantId) {
config.headers["tenant-id"] = tenantId;
}
}
// get请求映射params参数
if (config.method === "get" && config.params) {
let url = config.url + "?";
for (const propName of Object.keys(config.params)) {
const value = config.params[propName];
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);
config.params = {};
config.url = url;
return config;
},
(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 msg = errorCode[code] || res.data.msg || errorCode['default']
const msg = errorCode[code] || res.data.msg || errorCode["default"];
if (code === 401) {
if (!isRelogin.show) {
isRelogin.show = true;
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
MessageBox.confirm(
"登录状态已过期,您可以继续留在该页面,或者重新登录",
"系统提示",
{
confirmButtonText: "重新登录",
cancelButtonText: "取消",
type: "warning",
}
).then(() => {
isRelogin.show = false;
store.dispatch('LogOut').then(() => {
location.href = '/';
)
.then(() => {
isRelogin.show = false;
store.dispatch("LogOut").then(() => {
location.href = "/";
});
})
}).catch(() => {
isRelogin.show = false;
});
.catch(() => {
isRelogin.show = false;
});
}
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
return Promise.reject("无效的会话,或者会话已过期,请重新登录。");
} else if (code === 500) {
Message({
dangerouslyUseHTMLString: true,
message: msg,
type: 'error'
})
return Promise.reject(new Error(msg))
type: "error",
});
return Promise.reject(new Error(msg));
} else if (code === 901) {
Message({
type: 'error',
type: "error",
duration: 0,
dangerouslyUseHTMLString: true,
message: '<div>演示模式,无法进行写操作</div>'
+ '<div> &nbsp; </div>'
+ '<div>参考 https://doc.iocoder.cn/ 教程</div>'
+ '<div> &nbsp; </div>'
+ '<div>5 分钟搭建本地环境</div>',
})
return Promise.reject(new Error(msg))
message:
"<div>演示模式,无法进行写操作</div>" +
"<div> &nbsp; </div>" +
"<div>参考 https://doc.iocoder.cn/ 教程</div>" +
"<div> &nbsp; </div>" +
"<div>5 分钟搭建本地环境</div>",
});
return Promise.reject(new Error(msg));
} else if (code === 555) {
// 额外情况
return Promise.reject(res.data)
return Promise.reject(res.data);
} else if (code === 566) {
// 额外情况
return Promise.reject(res.data)
return Promise.reject(res.data);
} else if (code === 666) {
// 额外情况
return Promise.reject(res.data)
return Promise.reject(res.data);
} else if (code !== 200) {
// 如果内容很长则用alert提示,不然可能显示不全,自动隐藏也会导致看不完整就消失了
if(msg.length > 300){
MessageBox.alert(msg, i18n.t('错误提示'), i18n.t('确定'))
}else{
if (msg.length > 300) {
MessageBox.alert(msg, i18n.t("错误提示"), i18n.t("确定"));
} else {
Notification.error({
title: msg
})
title: msg,
});
}
return Promise.reject(msg || 'error')
return Promise.reject(msg || "error");
} else {
return res.data
return res.data;
}
},
error => {
console.log('err' + error)
(error) => {
console.log("err" + error);
let { message } = error;
if (message === "Network Error") {
message = "后端接口连接异常";
}
else if (message.includes("timeout")) {
} else if (message.includes("timeout")) {
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: message,
type: 'error',
duration: 5 * 1000
})
return Promise.reject(error)
type: "error",
duration: 5 * 1000,
});
return Promise.reject(error);
}
)
);
export function getBaseHeader() {
return {
'Authorization': "Bearer " + getToken(),
'tenant-id': Cookies.get('tenantId'),
}
Authorization: "Bearer " + getToken(),
"tenant-id": Cookies.get("tenantId"),
};
}
export default service
export default service;
......@@ -601,7 +601,7 @@ export default {
regError,
editForm,
updateError,
//lanbm 2024-05-23 异常登记对话框
//异常登记对话框
unloadingError,
},
created() {
......@@ -615,7 +615,7 @@ export default {
const { data } = res;
this.allUsers = data.list ?? [];
});
//lanbm 2024-05-16 add
//add
/* 不用此方式
getCurrencyList().then((res) => {
this.currencyList = res.data ?? [];
......
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form
:model="queryParams"
ref="queryForm"
......@@ -15,7 +14,8 @@
:placeholder="$t('请输入客户编号')"
clearable
@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 :label="$t('客户名称')" prop="name">
<el-input
......@@ -28,7 +28,7 @@
</el-form-item>
<el-form-item :label="$t('客户等级')" prop="level">
<el-select
multiple
multiple
v-model="queryParams.level"
:placeholder="$t('请选择客户等级')"
clearable
......@@ -52,7 +52,7 @@
</el-form-item>
<el-form-item :label="$t('客户类别')" prop="level">
<dict-selector
multiple
multiple
clearable
:type="DICT_TYPE.CUSTOMER_TYPE"
v-model="queryParams.type"
......@@ -95,7 +95,7 @@
</el-form-item>
<el-form-item :label="$t('国家')" prop="source">
<el-select
multiple
multiple
clearable
v-model="queryParams.country"
:placeholder="$t('请选择国家')"
......@@ -111,7 +111,7 @@
</el-form-item>
<el-form-item :label="$t('客户状态')" prop="status">
<el-select
multiple
multiple
clearable
v-model="queryParams.status"
:placeholder="$t('请选择客户状态')"
......@@ -136,13 +136,11 @@
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('信用等级')" prop="department">
<el-select multiple clearable v-model="queryParams.creditLevel">
<el-option
v-for="(item, index) in creditList"
:label="isChinese ? item.nameZh : item.nameEn"
:key="index"
......@@ -160,6 +158,36 @@
formatter="number"
@change="handleQuery"
></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-button type="primary" icon="el-icon-search" @click="handleQuery">{{
......@@ -268,6 +296,18 @@
>{{ $t("新增潜在客户") }}</el-button
>
</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
:showSearch.sync="showSearch"
@queryTable="getList"
......@@ -1035,6 +1075,8 @@ import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue";
import { getUserProfile } from "@/api/system/user";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
export default {
name: "EcwCustomerIndex",
components: {
......@@ -1045,6 +1087,7 @@ export default {
CustomerFollowList,
customerComplaints,
transferCustomer,
AreaCodeSelector
},
data() {
return {
......@@ -1056,7 +1099,7 @@ export default {
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
showSearch: false,
// 总条数
total: 0,
// 客户列表
......@@ -1080,6 +1123,10 @@ export default {
creditLevel: null,
country: null,
resourceType: null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
},
// 表单参数
form: {},
......@@ -1220,6 +1267,9 @@ export default {
this.getList();
},
methods: {
handleMergeCus() {
//合并客户
},
recovery(row) {
this.$confirm(this.$t("是否要回收当前{name}", row), "提示", {
confirmButtonText: "确定",
......@@ -1470,6 +1520,10 @@ export default {
department: null,
creditLevel: null,
country: null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
};
this.handleQuery();
},
......
......@@ -28,6 +28,36 @@
<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>
</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-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
......@@ -35,6 +65,13 @@
</el-form-item>
</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-column
......@@ -43,7 +80,6 @@
</el-table-column>
<el-table-column :label="$t('客户名称')" align="center" prop="name" >
<template v-slot="scope">
<span>{{ $l(scope.row,'name') }}</span>
</template>
</el-table-column>
......@@ -99,9 +135,13 @@ import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {listServiceUser} from "@/api/system/user";
import {exportCustomerComplaintExcel} from "@/api/ecw/customerComplaint";
import {indirectCustomerExportExcel} from "@/api/ecw/customer";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
export default {
name: "EcwCustomerIndirectcustomer",
components: {
AreaCodeSelector
},
activated() {
this.getList()
},
......@@ -114,7 +154,7 @@ export default {
loading: true,
// 导出遮罩层
// 显示搜索条件
showSearch: true,
showSearch: false,
// 总条数
total: 0,
// 客户列表
......@@ -131,7 +171,11 @@ export default {
name: null,
source: null,
customerService: null,
marketType:null
marketType:null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
},
// 网点
nodeList: [],
......@@ -203,6 +247,10 @@ export default {
name: null,
source: null,
customerService: null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
}
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 @@
<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>
</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-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
......@@ -373,7 +403,7 @@ import {getCountryListAll} from "@/api/ecw/country";
import {getCreditPage} from "@/api/customer/credit";
import transferCustomer from "@/views/ecw/customer/transferCustomer.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
export default {
......@@ -391,7 +421,8 @@ export default {
},
components: {
Contacts,
transferCustomer
transferCustomer,
AreaCodeSelector
},
data() {
return {
......@@ -400,7 +431,7 @@ export default {
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
showSearch: false,
// 总条数
total: 0,
// 客户列表
......@@ -425,6 +456,10 @@ export default {
creditLevel:null,
country:null,
marketType:null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
},
// 表单参数
form: {},
......@@ -563,6 +598,10 @@ export default {
department: null,
creditLevel:null,
country:null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
}
this.handleQuery();
},
......
......@@ -58,6 +58,36 @@
<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>
</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-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
......@@ -180,6 +210,7 @@ import {getCreditPage} from "@/api/customer/credit";
import transferCustomer from "@/views/ecw/customer/transferCustomer";
import Template from "@/views/cms/template/index.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
export default {
name: "EcwCustomertobeassignedIndex",
activated() {
......@@ -189,7 +220,8 @@ export default {
Contacts,
Template,
upload,
transferCustomer
transferCustomer,
AreaCodeSelector
},
data() {
return {
......@@ -201,7 +233,7 @@ export default {
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
showSearch: false,
// 总条数
total: 0,
// 客户列表
......@@ -226,6 +258,10 @@ export default {
creditLevel:null,
country:null,
marketType:null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
},
// 表单参数
form: {},
......@@ -357,6 +393,10 @@ export default {
department: null,
creditLevel:null,
country:null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
}
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 {
$route(to) {
//lanbm 2024-05-06 解决重新进入参数不刷新的问题
//this.$route.name == "客户分析" 用name做逻辑判断,有时候菜单名称会变化
//"/report/customer_analysis" lanbm 2024-05-07 调整为根据path做逻辑判断
//"/report/customer_analysis" 调整为根据path做逻辑判断
if (this.$route.path == "/report/customer_analysis") {
this.doLoadData();
}
......
......@@ -92,7 +92,7 @@
/>-->
</div>
</template>
<script>
import UserSelector from "@/components/UserSelector";
import Treeselect from "@riophae/vue-treeselect";
......@@ -389,4 +389,3 @@ export default {
},
};
</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