1 Commits

Author SHA1 Message Date
超凡
d311d50f8b fix:一号通/一号通配置 2025-02-14 17:44:16 +08:00
10 changed files with 320 additions and 2045 deletions

View File

@@ -8,51 +8,51 @@
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import request from '@/utils/request'
import request from "@/utils/request";
export function configCheckUnique(pram) {
const data = {
name: pram.name
}
};
return request({
url: '/admin/system/config/check',
method: 'GET',
url: "/admin/system/config/check",
method: "GET",
params: data
})
});
}
export function configDelete(pram) {
const data = {
id: pram.id
}
};
return request({
url: '/admin/system/config/delete',
method: 'GET',
url: "/admin/system/config/delete",
method: "GET",
params: data
})
});
}
export function configInfo(pram) {
const data = {
formId: pram.id
}
};
return request({
url: '/admin/system/config/info',
method: 'GET',
url: "/admin/system/config/info",
method: "GET",
params: data
})
});
}
export function configList(pram) {
const data = {
page: pram.page,
limit: pram.limit
}
};
return request({
url: '/admin/system/config/list',
method: 'GET',
url: "/admin/system/config/list",
method: "GET",
params: data
})
});
}
export function configSave(pram) {
@@ -67,55 +67,73 @@ export function configSave(pram) {
type: pram.type,
value: pram.value // value 存储表单配置数据,其他的参数来自于父级数据 justForAPI
}
}
};
return request({
url: '/admin/system/config/save',
method: 'POST',
url: "/admin/system/config/save",
method: "POST",
params: data
})
});
}
export function configSaveForm(pram) {
return request({
url: '/admin/system/config/save/form',
method: 'POST',
url: "/admin/system/config/save/form",
method: "POST",
data: pram
})
});
}
export function configUpdate(pram) {
const data = {
id: pram.id,
systemConfigRequest: pram.systemConfigRequest
}
};
return request({
url: '/admin/system/config/update',
method: 'POST',
url: "/admin/system/config/update",
method: "POST",
params: data
})
});
}
export function configSaveUniq(pram) {
const data = {
key: pram.key,
value: pram.value
}
};
return request({
url: '/admin/system/config/saveuniq',
method: 'POST',
url: "/admin/system/config/saveuniq",
method: "POST",
params: data
})
});
}
export function configGetUniq(pram) {
const data = {
key: pram.key
}
};
return request({
url: '/admin/system/config/getuniq',
method: 'GET',
url: "/admin/system/config/getuniq",
method: "GET",
params: data
})
});
}
/**
* @description 一号通 应用保存
*/
export function passAppSaveApi(data) {
return request({
url: "/admin/pass/appsave",
method: "post",
data
});
}
/**
* @description 一号通 应用详情获取
*/
export function passAppInfoApi() {
return request({
url: "/admin/pass/appget",
method: "get"
});
}

View File

@@ -8,157 +8,182 @@
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import Layout from '@/layout'
import Layout from "@/layout";
const operationRouter = {
path: '/operation',
path: "/operation",
component: Layout,
redirect: '/operation/setting',
name: 'Operation',
redirect: "/operation/setting",
name: "Operation",
meta: {
title: '设置',
icon: 'clipboard',
roles: ['admin']
title: "设置",
icon: "clipboard",
roles: ["admin"]
},
children: [
{
path: 'setting',
name: 'setting',
component: () => import('@/views/systemSetting/setting'),
path: "setting",
name: "setting",
component: () => import("@/views/systemSetting/setting"),
meta: {
title: '系统设置',
icon: 'clipboard'
title: "系统设置",
icon: "clipboard"
}
},
{
path:'notification',
name:'notification',
component: () => import('@/views/systemSetting/notification'),
meta:{
title:'消息通知',
icon:'clipboard'
path: "notification",
name: "notification",
component: () => import("@/views/systemSetting/notification"),
meta: {
title: "消息通知",
icon: "clipboard"
}
},
{
path: 'onePass',
name: 'onePass',
component: () => import('@/views/sms/smsConfig'),
path: "onePass",
name: "onePass",
component: () => import("@/views/sms/smsConfig"),
meta: {
title: '一号通',
icon: 'clipboard'
title: "一号通",
icon: "clipboard"
}
},
{
path: 'roleManager',
name: 'RoleManager',
component: () => import('@/views/systemSetting/administratorAuthority'),
path: "onePassConfig",
name: "onePassConfig",
component: () => import("@/views/sms/smsConfig/config"),
meta: {
title: '管理权限',
icon: 'clipboard',
roles: ['admin']
title: "一号通配置",
icon: "clipboard"
}
},
{
path: "roleManager",
name: "RoleManager",
component: () => import("@/views/systemSetting/administratorAuthority"),
meta: {
title: "管理权限",
icon: "clipboard",
roles: ["admin"]
},
children: [
{
path: 'identityManager',
component: () => import('@/views/systemSetting/administratorAuthority/identityManager'),
name: 'identityManager',
meta: { title: '角色管理', icon: '' }
path: "identityManager",
component: () =>
import("@/views/systemSetting/administratorAuthority/identityManager"),
name: "identityManager",
meta: { title: "角色管理", icon: "" }
},
{
path: 'adminList',
component: () => import('@/views/systemSetting/administratorAuthority/adminList'),
name: 'adminList',
meta: { title: '管理员列表', icon: '' }
path: "adminList",
component: () =>
import("@/views/systemSetting/administratorAuthority/adminList"),
name: "adminList",
meta: { title: "管理员列表", icon: "" }
},
{
path: 'promiseRules',
component: () => import('@/views/systemSetting/administratorAuthority/permissionRules'),
name: 'promiseRules',
meta: { title: '权限规则', icon: '' }
path: "promiseRules",
component: () =>
import("@/views/systemSetting/administratorAuthority/permissionRules"),
name: "promiseRules",
meta: { title: "权限规则", icon: "" }
}
]
},
{
path: 'systemSms',
component: () => import('@/views/sms'),
name: 'systemSms',
path: "systemSms",
component: () => import("@/views/sms"),
name: "systemSms",
meta: {
title: '短信设置',
icon: 'clipboard',
roles: ['admin']
title: "短信设置",
icon: "clipboard",
roles: ["admin"]
},
children: [
{
path: 'config',
component: () => import('@/views/sms/smsConfig'),
name: 'SmsConfig',
meta: { title: '短信账户', noCache: true }
path: "config",
component: () => import("@/views/sms/smsConfig"),
name: "SmsConfig",
meta: { title: "短信账户", noCache: true }
},
{
path: 'template',
component: () => import('@/views/sms/smsTemplate'),
name: 'SmsTemplate',
meta: { title: '短信模板', noCache: true, activeMenu: `/operation/onePass` }
path: "template",
component: () => import("@/views/sms/smsTemplate"),
name: "SmsTemplate",
meta: {
title: "短信模板",
noCache: true,
activeMenu: `/operation/onePass`
}
},
{
path: 'pay',
component: () => import('@/views/sms/smsPay'),
name: 'SmsPay',
meta: { title: '短信购买', noCache: true, activeMenu: `/operation/onePass` }
path: "pay",
component: () => import("@/views/sms/smsPay"),
name: "SmsPay",
meta: {
title: "短信购买",
noCache: true,
activeMenu: `/operation/onePass`
}
},
{
path: 'message',
component: () => import('@/views/sms/smsMessage'),
name: 'SmsMessage',
meta: { title: '短信开关', noCache: true }
path: "message",
component: () => import("@/views/sms/smsMessage"),
name: "SmsMessage",
meta: { title: "短信开关", noCache: true }
}
]
},
{
path: 'deliverGoods',
name: 'deliverGoods',
path: "deliverGoods",
name: "deliverGoods",
alwaysShow: true,
component: () => import('@/views/systemSetting/deliverGoods'),
component: () => import("@/views/systemSetting/deliverGoods"),
meta: {
title: '发货设置',
roles: ['admin']
title: "发货设置",
roles: ["admin"]
},
children: [
{
path: 'takeGoods',
component: () => import('@/views/systemSetting/deliverGoods/takeGoods'),
name: 'takeGoods',
meta: { title: '提货设置', noCache: true,roles: ['admin'] },
path: "takeGoods",
component: () =>
import("@/views/systemSetting/deliverGoods/takeGoods"),
name: "takeGoods",
meta: { title: "提货设置", noCache: true, roles: ["admin"] },
children: [
{
path: 'deliveryAddress',
component: () => import('@/views/systemSetting/deliverGoods/takeGoods/deliveryAddress'),
name: 'deliveryAddress',
meta: { title: '提货点', icon: '' }
path: "deliveryAddress",
component: () =>
import("@/views/systemSetting/deliverGoods/takeGoods/deliveryAddress"),
name: "deliveryAddress",
meta: { title: "提货点", icon: "" }
},
{
path: 'collateOrder',
component: () => import('@/views/systemSetting/deliverGoods/takeGoods/collateOrder'),
name: 'collateOrder',
meta: { title: '核销订单', icon: '' }
path: "collateOrder",
component: () =>
import("@/views/systemSetting/deliverGoods/takeGoods/collateOrder"),
name: "collateOrder",
meta: { title: "核销订单", icon: "" }
},
{
path: 'collateUser',
component: () => import('@/views/systemSetting/deliverGoods/takeGoods/collateUser'),
name: 'collateUser',
meta: { title: '核销员', icon: '' }
},
path: "collateUser",
component: () =>
import("@/views/systemSetting/deliverGoods/takeGoods/collateUser"),
name: "collateUser",
meta: { title: "核销员", icon: "" }
}
]
},
{
path: 'freightSet',
component: () => import('@/views/systemSetting/deliverGoods/freightSet'),
name: 'freightSet',
meta: { title: '运费模板', noCache: true }
},
path: "freightSet",
component: () =>
import("@/views/systemSetting/deliverGoods/freightSet"),
name: "freightSet",
meta: { title: "运费模板", noCache: true }
}
]
},
}
]
}
};
export default operationRouter //collate
export default operationRouter; //collate

View File

@@ -8,7 +8,7 @@
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import store from '@/store'
import store from "@/store";
/**
* 根据需求过滤掉treeData中的child.length === 0的数据
@@ -16,38 +16,51 @@ import store from '@/store'
* @returns {Uint8Array | BigInt64Array | any[] | Float64Array | Int8Array | Float32Array | Int32Array | Uint32Array | Uint8ClampedArray | BigUint64Array | Int16Array | Uint16Array}
*/
export function clearTreeData(treeData) {
return treeData.map((item) => {
return treeData.map(item => {
if (item.child.length === 0) {
delete item.child
delete item.child;
} else {
clearTreeData(item.child)
clearTreeData(item.child);
}
return item
})
return item;
});
}
export function addTreeListLabel(treeData) { // 因树形控件在slot-scope模式下显示字段只能为label为此自定义添加label字段和child=children
return treeData.map((item) => {
if ((item.name === '设置' || item.name === '管理员列表' ||
item.name === '身份管理' || item.name === '管理权限' ||
item.name === '管理员列表' || item.name === '权限规则') && store.getters.name !== 'admin') {
item.disabled = true
export function addTreeListLabel(treeData) {
// 因树形控件在slot-scope模式下显示字段只能为label为此自定义添加label字段和child=children
return treeData.map(item => {
if (
(item.name === "设置" ||
item.name === "管理员列表" ||
item.name === "身份管理" ||
item.name === "管理权限" ||
item.name === "管理员列表" ||
item.name === "权限规则") &&
store.getters.name !== "admin"
) {
item.disabled = true;
}
item.label = item.name
return item
})
item.label = item.name;
return item;
});
}
export function addTreeListLabelForCasCard(treeData, child) {
treeData.map((item) => {
if ((item.name === '设置' || item.name === '管理员列表' ||
item.name === '身份管理' || item.name === '管理权限' ||
item.name === '管理员列表' || item.name === '权限规则') && store.getters.name !== 'admin') {
item.disabled = true
treeData.map(item => {
if (
(item.name === "设置" ||
item.name === "管理员列表" ||
item.name === "身份管理" ||
item.name === "管理权限" ||
item.name === "管理员列表" ||
item.name === "权限规则") &&
store.getters.name !== "admin"
) {
item.disabled = true;
}
item.label = item.name
return item
})
item.label = item.name;
return item;
});
}
//加法函数,用来得到精确的加法结果
@@ -58,14 +71,14 @@ export function Add(arg1, arg2) {
arg2 = parseFloat(arg2);
var r1, r2, m;
try {
r1 = arg1.toString().split(".")[1].length
r1 = arg1.toString().split(".")[1].length;
} catch (e) {
r1 = 0
r1 = 0;
}
try {
r2 = arg2.toString().split(".")[1].length
r2 = arg2.toString().split(".")[1].length;
} catch (e) {
r2 = 0
r2 = 0;
}
m = Math.pow(100, Math.max(r1, r2));
return (this.Mul(arg1, m) + this.Mul(arg2, m)) / m;
@@ -82,30 +95,46 @@ export function Mul(arg1, arg2) {
s1 = arg1.toString(),
s2 = arg2.toString();
try {
m += s1.split(".")[1].length
m += s1.split(".")[1].length;
} catch (e) {}
try {
m += s2.split(".")[1].length
m += s2.split(".")[1].length;
} catch (e) {}
return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
return (
(Number(s1.replace(".", "")) * Number(s2.replace(".", ""))) /
Math.pow(10, m)
);
}
//替换安全域名
export function setDomain(url) {
url = url ? url.toString() : '';
url = url ? url.toString() : "";
// 正则替换存在的转义符
url = url.replace(/\\/g,'');
url = window.location.protocol==='https:'? url.replace('http://','https://') : url;
if(url.startsWith('src="')){
url = url.replaceAll('src="','');
url = url.replace(/\\/g, "");
url =
window.location.protocol === "https:"
? url.replace("http://", "https://")
: url;
if (url.startsWith('src="')) {
url = url.replaceAll('src="', "");
}
if(url.startsWith('//img') && window.location.protocol==='https:'){
url = url.replace('//img','https://img');
if (url.startsWith("//img") && window.location.protocol === "https:") {
url = url.replace("//img", "https://img");
}
return url;
}
// 过滤富文本中的 img 相对路径访问
export function replaceImgSrcHttps(content) {
return content.replaceAll('src="//','src="https://');
return content.replaceAll('src="//', 'src="https://');
}
/**
*计算table固定高度
*/
export function getTableHeight(height) {
let windowHeight =
document.documentElement.clientHeight || document.body.clientHeight;
let herderHeight = 100;
let footerHeight = 20;
return windowHeight - herderHeight - footerHeight - height;
}

View File

@@ -1,238 +0,0 @@
<template>
<div class="login-container">
<el-steps :active="current" align-center>
<el-step title="验证账号信息"></el-step>
<el-step title="修改账户密码"></el-step>
<el-step title="登录"></el-step>
</el-steps>
<el-form ref="formInline" :model="formInline" size="medium" :rules="ruleInline" class="login-form" autocomplete="on" label-position="left">
<template v-if="current === 0">
<el-form-item prop="phone">
<el-input type="text" v-model="formInline.phone" prefix="ios-contact-outline"
placeholder="请输入手机号" size="large" :readonly="infoData.phone?true:false"/>
</el-form-item>
<el-form-item prop="code" class="captcha">
<div class="acea-row" style="flex-wrap: nowrap;">
<el-input
ref="username"
v-model="formInline.code"
placeholder="验证码"
name="username"
type="text"
tabindex="1"
autocomplete="off"
prefix-icon="el-icon-message"
style="width: 90%"
/>
<el-button size="mini" :disabled=!this.canClick @click="cutDown" v-hasPermi="['admin:pass:send:code']">{{cutNUm}}</el-button>
</div>
</el-form-item>
</template>
<template v-if="current === 1">
<el-form-item prop="password" class="maxInpt">
<el-input type="password" v-model="formInline.password" prefix="ios-lock-outline"
placeholder="请输入新密码" size="large"/>
</el-form-item>
<el-form-item prop="checkPass" class="maxInpt">
<el-input type="password" v-model="formInline.checkPass" prefix="ios-lock-outline"
placeholder="请验证新密码" size="large"/>
</el-form-item>
</template>
<template v-if="current === 2">
<el-form-item prop="phone" class="maxInpt">
<el-input type="text" v-model="formInline.phone" prefix="ios-contact-outline"
placeholder="请输入手机号"/>
</el-form-item>
<el-form-item prop="password" class="maxInpt">
<el-input type="password" v-model="formInline.password" prefix="ios-lock-outline"
placeholder="请输入密码"/>
</el-form-item>
</template>
<el-form-item class="maxInpt">
<el-button v-if="current === 0" type="primary" @click="handleSubmit1('formInline',current)" class="mb20 width100">下一步</el-button>
<el-button v-if="current === 1" type="primary" @click="handleSubmit2('formInline',current)" class="mb20 width100">提交</el-button>
<el-button v-if="current === 2" type="primary" @click="handleSubmit('formInline',current)" class="mb20 width100">登录</el-button>
<el-button @click="returns('formInline')" class="width100" style="margin-left: 0px;">返回</el-button>
</el-form-item>
<!--<el-button v-if="current === 0" size="mini" :loading="loading" type="primary" style="width:100%;margin-bottom:20px;" @click="handleSubmit('formInline')">注册</el-button>-->
<!--<el-button size="mini" type="primary" style="width:100%;margin-bottom:20px;" @click="changelogo">立即登录</el-button>-->
</el-form>
</div>
</template>
<script>
import { updatePasswordApi, captchaApi, configApi } from '@/api/sms';
export default {
name: 'forgetPassword',
data () {
const validatePhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('请填写手机号'));
} else if (!/^1[3456789]\d{9}$/.test(value)) {
callback(new Error('手机号格式不正确!'));
} else {
callback();
}
};
var validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'));
}else {
if(this.current === 1){
if (this.formInline.checkPass !== '') {
this.$refs.formInline.validateField('checkPass');
}
callback();
}else{
if(value !== this.formInline.checkPass){
callback(new Error('请输入正确密码!'));
}
callback();
}
}
};
var validatePass2 = (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'));
} else if (value !== this.formInline.password) {
callback(new Error('两次输入密码不一致!'));
} else {
callback();
}
};
return {
isReadonly: false,
cutNUm: '获取验证码',
canClick: true,
current: 0,
formInline: {
account: '',
phone: '',
code: '',
password: '',
checkPass: '',
},
ruleInline: {
phone: [
{ required: true, validator: validatePhone, trigger: 'blur' }
],
code: [
{ required: true, message: '请输入验证码', trigger: 'blur' }
],
password: [
{ validator: validatePass, trigger: 'blur' }
],
checkPass: [
{ validator: validatePass2, trigger: 'blur' }
],
}
}
},
props:{
infoData: {
type: Object,
default: null
}
},
mounted(){
this.infoData ? this.formInline.phone = this.infoData.phone : this.formInline.phone = '';
},
methods: {
// 短信验证码
cutDown () {
if (this.formInline.phone) {
if (!this.canClick) return;
this.canClick = false;
this.cutNUm = 60;
let data = {
phone: this.formInline.phone,
types: 1
};
captchaApi(data).then(async res => {
this.$message.success(res.msg);
})
let time = setInterval(() => {
this.cutNUm--;
if (this.cutNUm === 0) {
this.cutNUm = '获取验证码';
this.canClick = true;
clearInterval(time)
}
}, 1000)
} else {
this.$message.warning('请填写手机号!');
}
},
handleSubmit1 (name, current) {
this.$refs[name].validate((valid) => {
if (valid) {
this.current = 1;
} else {
return false;
}
})
},
handleSubmit2(name) {
this.formInline.account = this.formInline.phone
this.$refs[name].validate((valid) => {
if (valid) {
updatePasswordApi(this.formInline).then(async res => {
this.$message.success('修改成功');
this.current = 2;
})
} else {
return false;
}
})
},
//登录
handleSubmit (name) {
this.$refs[name].validate((valid) => {
if (valid) {
configApi({
account: this.formInline.account,
password: this.formInline.password
}).then(async res => {
this.$message.success('登录成功!');
this.$emit('on-Login');
})
} else {
return false;
}
})
},
returns () {
this.current === 0 ? this.$emit('goback'): this.current = 0
}
}
}
</script>
<style scoped lang="scss">
.login-form {
flex: 1;
padding: 32px 0;
text-align: center;
width: 384px;
margin: 0 auto;
overflow: hidden;
}
.width100{
width: 100%;
}
.maxInpt{
max-width:400px;
margin-left:auto;
margin-right:auto;
}
.code {
display: flex;
align-items: center;
justify-content: center;
}
.ivu-steps-item:last-child{
width: unset!important;
}
</style>

View File

@@ -1,220 +0,0 @@
<template>
<div class="login-container">
<el-steps :active="current" align-center>
<el-step title="验证账号信息"></el-step>
<el-step title="修改手机号码"></el-step>
<el-step title="登录"></el-step>
</el-steps>
<el-form ref="formInline" :model="formInline" size="medium" :rules="ruleInline" class="login-form" autocomplete="on" label-position="left">
<template v-if="current === 0">
<el-form-item prop="account">
<el-input type="text" v-model="formInline.account" prefix="ios-contact-outline"
placeholder="请输入当前账号" size="large"/>
</el-form-item>
<el-form-item prop="password">
<el-input type="password" v-model="formInline.password" prefix="ios-contact-outline"
placeholder="请输入密码" size="large"/>
</el-form-item>
</template>
<template v-if="current === 1">
<el-form-item prop="phone" class="maxInpt">
<el-input type="text" v-model="formInline.phone" prefix="ios-lock-outline"
placeholder="请输入新手机号" size="large"/>
</el-form-item>
<el-form-item prop="code" class="captcha">
<div class="acea-row" style="flex-wrap: nowrap;">
<el-input
ref="username"
v-model="formInline.code"
placeholder="验证码"
name="username"
type="text"
tabindex="1"
autocomplete="off"
prefix-icon="el-icon-message"
style="width: 90%"
/>
<el-button size="mini" :disabled=!this.canClick @click="cutDown">{{cutNUm}}</el-button>
</div>
</el-form-item>
</template>
<template v-if="current === 2">
<el-form-item prop="phone" class="maxInpt">
<el-input type="text" v-model="formInline.phone" prefix="ios-contact-outline"
placeholder="请输入手机号"/>
</el-form-item>
<el-form-item prop="password" class="maxInpt">
<el-input type="password" v-model="formInline.password" prefix="ios-lock-outline"
placeholder="请输入密码"/>
</el-form-item>
</template>
<el-form-item class="maxInpt">
<el-button v-if="current === 0" type="primary" @click="handleSubmit1('formInline',current)" class="mb20 width100">下一步</el-button>
<el-button v-if="current === 1" type="primary" @click="handleSubmit2('formInline',current)" class="mb20 width100" v-hasPermi="['admin:pass:update:phone']">提交</el-button>
<el-button v-if="current === 2" type="primary" @click="handleSubmit('formInline',current)" class="mb20 width100">登录</el-button>
<el-button @click="returns('formInline')" class="width100" style="margin-left: 0px;">返回</el-button>
</el-form-item>
<!--<el-button v-if="current === 0" size="mini" :loading="loading" type="primary" style="width:100%;margin-bottom:20px;" @click="handleSubmit('formInline')">注册</el-button>-->
<!--<el-button size="mini" type="primary" style="width:100%;margin-bottom:20px;" @click="changelogo">立即登录</el-button>-->
</el-form>
</div>
</template>
<script>
import { captchaApi, configApi, updateHoneApi, phoneValidatorApi } from '@/api/sms';
export default {
name: 'forgetPhone',
props: {
isIndex: {
type: Boolean,
default: false
}
},
data () {
const validatePhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('请填写手机号'));
} else if (!/^1[3456789]\d{9}$/.test(value)) {
callback(new Error('手机号格式不正确!'));
} else {
callback();
}
};
var validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'));
} else {
if (this.formInline.checkPass !== '') {
this.$refs.formInline.validateField('checkPass');
}
callback();
}
};
return {
cutNUm: '获取验证码',
canClick: true,
current: 0,
formInline: {
account: '',
phone: '',
code: '',
password: '',
},
ruleInline: {
phone: [
{ required: true, validator: validatePhone, trigger: 'blur' }
],
code: [
{ required: true, message: '请输入验证码', trigger: 'blur' }
],
password: [
{ required: true, message: '请输入密码', trigger: 'blur' }
],
account: [
{ required: true, message: '请输入当前账号', trigger: 'blur' }
]
}
}
},
methods: {
// 短信验证码
cutDown () {
if (this.formInline.phone) {
if (!this.canClick) return;
this.canClick = false;
this.cutNUm = 60;
let data = {
phone: this.formInline.phone,
types: 1
};
captchaApi(data).then(async res => {
this.$message.success(res.msg);
})
let time = setInterval(() => {
this.cutNUm--;
if (this.cutNUm === 0) {
this.cutNUm = '获取验证码';
this.canClick = true;
clearInterval(time)
}
}, 1000)
} else {
this.$message.warning('请填写手机号!');
}
},
handleSubmit1 (name) {
this.$refs[name].validate((valid) => {
if (valid) {
phoneValidatorApi(this.formInline).then(async res => {
this.$message.success('操作成功')
this.current = 1;
})
} else {
return false;
}
})
},
handleSubmit2(name) {
this.$refs[name].validate((valid) => {
if (valid) {
updateHoneApi(this.formInline).then(async res => {
this.$message.success('操作成功')
this.current = 2;
})
} else {
return false;
}
})
},
//登录
handleSubmit (name,num) {
this.$refs[name].validate((valid) => {
if (valid) {
configApi({
account: this.formInline.account,
password: this.formInline.password
}).then(async res => {
num===1?this.$message.success("原手机号密码正确"):this.$message.success("登录成功");
num===1?this.current = 1:this.$emit('on-Login');
})
} else {
return false;
}
})
},
returns () {
this.current === 0 ? this.$emit('gobackPhone'): this.current = 0
}
}
}
</script>
<style scoped lang="scss">
.login-form {
flex: 1;
padding: 32px 0;
text-align: center;
width: 384px;
margin: 0 auto;
overflow: hidden;
}
.width100{
width: 100%;
}
.maxInpt{
max-width:400px;
margin-left:auto;
margin-right:auto;
}
.code {
display: flex;
align-items: center;
justify-content: center;
}
.ivu-steps-item:last-child{
width: unset!important;
}
</style>

View File

@@ -1,188 +0,0 @@
<template>
<div class="login-container">
<el-row type="flex">
<el-col :span="24">
<el-form ref="formInline" size="small" :model="formInline" :rules="ruleInline" class="login-form"
autocomplete="on" label-position="left">
<div class="title-container">
<h3 class="title mb15">短信账户登录</h3>
</div>
<el-form-item prop="account">
<el-input
ref="account"
v-model="formInline.account"
placeholder="用户名"
prefix-icon="el-icon-user"
name="username"
type="text"
tabindex="1"
autocomplete="off"
/>
</el-form-item>
<el-form-item prop="password">
<el-input
:key="passwordType"
ref="password"
v-model="formInline.password"
:type="passwordType"
placeholder="密码"
name="password"
tabindex="2"
auto-complete="off"
prefix-icon="el-icon-lock"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"/>
</span>
</el-form-item>
<el-button size="mini" :loading="loading" type="primary" style="width:100%;margin-bottom:20px;"
@click="handleSubmit('formInline')">登录
</el-button>
<div class="acea-row row-center-wrapper mb20">
<el-button size="mini" type="text" style="margin-left: 0" @click="changePassword">忘记密码</el-button>
<el-divider direction="vertical"></el-divider>
<el-button size="mini" type="text" style="margin-left: 0" @click="changeReg">注册账户</el-button>
</div>
<el-tooltip class="item" effect="dark" content="
一号通为我司一个第三方平台
专门提供短信 物流查询,商品复制,电子面单等个性化服务
省去了自己单独接入功能的麻烦
初次运行代码默认是没有账号的,需要自行注册,
登录成功后根据提示购买自己需要用到的服务即可" placement="bottom">
<span style="margin-left: 0">平台说明</span>
</el-tooltip>
</el-form>
</el-col>
</el-row>
</div>
</template>
<script>
import { configApi } from '@/api/sms'
export default {
name: 'Login',
data() {
return {
formInline: {
account: '',
password: ''
},
ruleInline: {
account: [
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
password: [
{ required: true, message: '请输入密码', trigger: 'blur' }
]
},
passwordType: 'password',
loading: false
}
},
created() {
var _this = this
document.onkeydown = function(e) {
const key = window.event.keyCode
if (key === 13) {
_this.handleSubmit('formInline')
}
}
},
methods: {
showPwd() {
if (this.passwordType === 'password') {
this.passwordType = ''
} else {
this.passwordType = 'password'
}
this.$nextTick(() => {
this.$refs.password.focus()
})
},
handleSubmit(name) {
this.$refs[name].validate((valid) => {
if (valid) {
this.loading = true;
configApi(this.formInline).then(async res => {
this.$message.success('登录成功!')
this.$store.dispatch('user/isLogin')
this.$emit('on-Login')
this.loading = false;
}).catch(()=>{
this.loading = false;
})
} else {
return false
}
})
},
// 修改密码
changePassword() {
this.$emit('on-change')
},
changeReg() {
this.$emit('on-changes')
}
}
}
</script>
<style lang="scss" scoped>
.title{
text-align: center;
}
.captcha{
display: flex;
align-items: flex-start;
}
$bg: #2d3a4b;
$dark_gray: #889aa4;
$light_gray: #eee;
.imgs{
img{
height: 36px;
}
}
.login-form {
flex: 1;
padding: 32px 0;
text-align: center;
width: 384px;
margin: 0 auto;
overflow: hidden;
}
.tips {
font-size: 14px;
color: #fff;
margin-bottom: 10px;
span {
&:first-of-type {
margin-right: 16px;
}
}
}
.svg-container {
padding: 6px 5px 6px 15px;
color: $dark_gray;
vertical-align: middle;
width: 30px;
display: inline-block;
}
.show-pwd {
position: absolute;
right: 10px;
top: 7px;
font-size: 16px;
color: $dark_gray;
cursor: pointer;
user-select: none;
::v-deep.svg-icon {
vertical-align: 0.3em;
}
}
.thirdparty-button {
position: absolute;
right: 0;
bottom: 6px;
}
</style>

View File

@@ -1,225 +0,0 @@
<template>
<div class="login-container">
<el-form ref="formInline" size="small" :model="formInline" :rules="ruleInline" class="login-form" autocomplete="on" label-position="left">
<div class="title-container">
<h3 class="title mb15">一号通账户注册</h3>
</div>
<el-form-item prop="phone">
<el-input
v-model="formInline.phone"
placeholder="请输入您的手机号"
prefix-icon="el-icon-phone-outline"
/>
</el-form-item>
<el-form-item prop="password">
<el-input
:key="passwordType"
v-model="formInline.password"
:type="passwordType"
placeholder="密码"
tabindex="2"
auto-complete="off"
prefix-icon="el-icon-lock"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
</span>
</el-form-item>
<el-form-item prop="domain">
<el-input
v-model="formInline.domain"
placeholder="请输入网址域名"
prefix-icon="el-icon-position"
/>
</el-form-item>
<el-form-item prop="code" class="captcha">
<div class="acea-row" style="flex-wrap: nowrap;">
<el-input
v-model="formInline.code"
placeholder="验证码"
type="text"
tabindex="1"
autocomplete="off"
prefix-icon="el-icon-message"
style="width: 90%"
/>
<el-button size="mini" :disabled=!this.canClick @click="cutDown" v-hasPermi="['admin:pass:send:code']">{{cutNUm}}</el-button>
</div>
</el-form-item>
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:20px;" @click="handleSubmit('formInline')" v-hasPermi="['admin:pass:register']">注册</el-button>
<el-button type="primary" style="width:100%;margin-bottom:20px;" @click="changelogo" v-hasPermi="['admin:pass:login']">立即登录</el-button>
</el-form>
</div>
</template>
<script>
import { captchaApi, registerApi } from '@/api/sms'
export default {
name: 'Register',
data() {
const validatePhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('请填写手机号'))
} else if (!/^1[3456789]\d{9}$/.test(value)) {
callback(new Error('手机号格式不正确!'))
} else {
callback()
}
}
return {
loading: false,
passwordType: 'password',
captchatImg: '',
cutNUm: '获取验证码',
canClick: true,
formInline: {
account: '',
code: '',
domain: '',
phone: '',
password: ''
},
ruleInline: {
password: [
{ required: true, message: '请输入短信平台密码/token', trigger: 'blur' }
],
domain: [
{ required: true, message: '请输入网址域名', trigger: 'blur' }
],
phone: [
{ required: true, validator: validatePhone, trigger: 'blur' }
],
code: [
{ required: true, message: '请输入验证码', trigger: 'blur' }
]
}
}
},
methods: {
showPwd() {
if (this.passwordType === 'password') {
this.passwordType = ''
} else {
this.passwordType = 'password'
}
this.$nextTick(() => {
this.$refs.password.focus()
})
},
// 短信验证码
cutDown() {
if (this.formInline.phone) {
if (!this.canClick) return
this.canClick = false
this.cutNUm = 60
captchaApi({
phone: this.formInline.phone,
types: 0
}).then(async res => {
this.$message.success('发送成功')
})
const time = setInterval(() => {
this.cutNUm--
if (this.cutNUm === 0) {
this.cutNUm = '获取验证码'
this.canClick = true
clearInterval(time)
}
}, 1000)
} else {
this.$message.warning('请填写手机号!')
}
},
// 注册
handleSubmit(name) {
this.formInline.account = this.formInline.phone
this.$refs[name].validate((valid) => {
if (valid) {
this.loading = true;
registerApi(this.formInline).then(async res => {
this.$message.success('注册成功')
setTimeout(() => {
this.changelogo()
}, 1000)
this.loading = false;
}).catch(()=>{
this.loading = false;
})
} else {
return false
}
})
},
// 立即登录
changelogo() {
this.$emit('on-change')
}
}
}
</script>
<style lang="scss" scoped>
.el-button+.el-button{
margin-left: 0px !important;
}
.title{
text-align: center;
}
.captcha{
display: flex;
align-items: flex-start;
::v-deep.el-form-item__content{
width: 100%;
}
}
$bg: #2d3a4b;
$dark_gray: #889aa4;
$light_gray: #eee;
.imgs{
img{
height: 36px;
}
}
.login-form {
flex: 1;
padding: 32px 0;
text-align: center;
width: 384px;
margin: 0 auto;
overflow: hidden;
}
.tips {
font-size: 14px;
color: #fff;
margin-bottom: 10px;
span {
&:first-of-type {
margin-right: 16px;
}
}
}
.svg-container {
padding: 6px 5px 6px 15px;
color: $dark_gray;
vertical-align: middle;
width: 30px;
display: inline-block;
}
.show-pwd {
position: absolute;
right: 10px;
top: 7px;
font-size: 16px;
color: $dark_gray;
cursor: pointer;
user-select: none;
::v-deep.svg-icon {
vertical-align: 0.3em;
}
}
.thirdparty-button {
position: absolute;
right: 0;
bottom: 6px;
}
</style>

View File

@@ -1,693 +0,0 @@
<template>
<div>
<el-tabs v-model="tableFrom.type" @tab-click="onChangeType">
<el-tab-pane label="短信" name="sms"></el-tab-pane>
<el-tab-pane label="商品采集" name="copy"></el-tab-pane>
<el-tab-pane label="物流查询" name="expr_query"></el-tab-pane>
<el-tab-pane label="电子面单打印" name="expr_dump"></el-tab-pane>
</el-tabs>
<!--短信列表-->
<div class="note" v-if="(tableFrom.type==='sms' && sms.open === 1) || (tableFrom.type==='expr_query' && query.open === 1) || (tableFrom.type==='copy' && copy.open === 1) || (tableFrom.type==='expr_dump' && dump.open === 1)">
<div class="filter-container flex-between mb20" v-if="tableFrom.type === 'sms'">
<div class="demo-input-suffix">
<span class="seachTiele">短信状态</span>
<el-radio-group v-model="tableFrom.status" size="small" @change="getList" class="mr20">
<el-radio-button label="3">全部</el-radio-button>
<el-radio-button label="1">成功</el-radio-button>
<el-radio-button label="2">失败</el-radio-button>
<el-radio-button label="0">发送中</el-radio-button>
</el-radio-group>
</div>
<div>
<router-link :to="{path: '/operation/systemSms/template'}">
<el-button type="primary" class="mr20" v-hasPermi="['admin:sms:temps']">短信模板</el-button>
</router-link>
<el-button @click="editSign" v-hasPermi="['admin:sms:modify:sign']">修改签名</el-button>
</div>
</div>
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
highlight-current-row
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
v-for="(item, index) in columns2" :key="index"
:prop="item.key"
:label="item.title"
:min-width="item.minWidth">
<template slot-scope="scope">
<div v-if="['content'].indexOf(item.key) > -1 && tableFrom.type==='expr_query'" class="demo-image__preview">
<span>{{scope.row[item.key].num}}</span>
</div>
<span v-else>{{ scope.row[item.key] }}</span>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:page-sizes="[20, 40, 60, 80]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</div>
<!--无开通-->
<div v-else>
<!--开通按钮-->
<div v-if="(tableFrom.type==='sms' && !isSms) || (tableFrom.type==='expr_dump' && !isDump) || ((tableFrom.type==='copy' || tableFrom.type==='expr_query') && !isCopy)" class="wuBox acea-row row-column-around row-middle">
<div class="wuTu"><img src="../../../../assets/imgs/wutu.png"></div>
<div class="mb15">
<span class="wuSp1">{{tableFrom.type | onePassTypeFilter}}未开通哦</span>
<span class="wuSp2">点击立即开通按钮即可使用{{tableFrom.type | onePassTypeFilter}}服务哦</span>
</div>
<el-button size="medium" type="primary" @click="onOpenIndex(tableFrom.type)">立即开通</el-button>
</div>
<!--短信立即开通/开通电子面单服务-->
<div class="smsBox" v-if="(isDump && tableFrom.type==='expr_dump') || (isSms && tableFrom.type==='sms')">
<div class="index_from page-account-container">
<div class="page-account-top">
<span class="page-account-top-tit">开通{{tableFrom.type | onePassTypeFilter}}服务</span>
</div>
<el-form ref="formInlineDump" :model="formInlineDump" :rules="ruleInline" @submit.native.prevent @keyup.enter="handleSubmitDump('formInlineDump')">
<el-form-item prop="sign" class="maxInpt" v-if="isSms && tableFrom.type==='sms'" key="1">
<el-input type="text" v-model="formInlineDump.sign" prefix="ios-contact-outline" placeholder="请输入短信签名"/>
</el-form-item>
<template v-if="isDump && tableFrom.type==='expr_dump'">
<el-form-item prop="com" class="maxInpt">
<el-select v-model="formInlineDump.com" filterable placeholder="请选择快递公司" @change="onChangeExport" style="text-align: left;" class="width10">
<el-option v-for="(item,index) in exportList" :value="item.code" :key="index" :label="item.name"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="temp_id" class="tempId maxInpt">
<div class="acea-row">
<el-select v-model="formInlineDump.tempId" placeholder="请选择电子面单模板" style="text-align: left;" :class="[formInlineDump.tempId?'width9':'width10']" @change="onChangeImg">
<el-option v-for="(item, index) in exportTempList" :value="item.temp_id" :key="index" :label="item.title"></el-option>
</el-select>
<div v-if="formInlineDump.tempId" style="position: relative;">
<!--<span class="tempImg" @click="">预览</span>-->
<div class="tempImgList ml10">
<div class="demo-image__preview">
<el-image
style="width: 36px; height: 36px"
:src="tempImg"
:preview-src-list="[tempImg]"
/>
</div>
</div>
</div>
</div>
</el-form-item>
<el-form-item prop="toName" class="maxInpt">
<el-input type="text" v-model="formInlineDump.toName" prefix="ios-contact-outline"
placeholder="请填写寄件人姓名"/>
</el-form-item>
<el-form-item prop="toTel" class="maxInpt">
<el-input type="text" v-model="formInlineDump.toTel" prefix="ios-contact-outline"
placeholder="请填写寄件人电话"/>
</el-form-item>
<el-form-item prop="toAddress" class="maxInpt">
<el-input type="text" v-model="formInlineDump.toAddress" prefix="ios-contact-outline"
placeholder="请填写寄件人详细地址"/>
</el-form-item>
<el-form-item prop="siid" class="maxInpt">
<el-input type="text" v-model="formInlineDump.siid" prefix="ios-contact-outline"
placeholder="请填写云打印编号"/>
</el-form-item>
</template>
<el-form-item class="maxInpt">
<el-button type="primary" size="medium" :loading="loading" @click="handleSubmitDump('formInlineDump')" class="btn width10">立即开通</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
<!--修改签名-->
<el-dialog
title="短信账户签名修改"
:visible.sync="dialogVisible"
width="500px"
:before-close="handleClose">
<el-form ref="formInline" size="small" :model="formInline" :rules="ruleInlineSign" class="login-form" autocomplete="on" label-position="left">
<el-form-item>
<el-input v-model="formInline.account" :disabled="true" prefix-icon="el-icon-user">
</el-input>
</el-form-item>
<el-form-item prop="sign">
<el-input
v-model="formInline.sign"
placeholder="请输入短信签名例如CRMEB"
prefix-icon="el-icon-document"
>
</el-input>
</el-form-item>
<el-form-item prop="phone">
<el-input
v-model="formInline.phone"
placeholder="请输入您的手机号"
:disabled="true"
prefix-icon="el-icon-phone-outline"
>
</el-input>
</el-form-item>
<el-form-item prop="code" class="captcha">
<div class="acea-row" style="flex-wrap: nowrap;">
<el-input
ref="username"
v-model="formInline.code"
placeholder="验证码"
name="username"
type="text"
tabindex="1"
autocomplete="off"
prefix-icon="el-icon-message"
style="width: 90%"
/>
<el-button size="mini" :disabled=!this.canClick @click="cutDown" v-hasPermi="['admin:pass:send:code']">{{cutNUm}}</el-button>
</div>
</el-form-item>
<el-form-item>
<el-alert title="短信签名提交后需要审核才会生效,请耐心等待或者联系客服" type="success"></el-alert>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSubmit('formInline')"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { smsLstApi, serviceOpenApi, exportTempApi, expressAllApi, captchaApi, smsSignApi } from '@/api/sms'
import * as commFilter from '@/filters/commFilter';
import Template from "../../../appSetting/wxAccount/wxTemplate/index";
import { checkPermi } from "@/utils/permission"; // 权限判断函数
import {Debounce} from '@/utils/validate'
export default {
name: 'TableList',
props: {
copy: {
type: Object,
default: null
},
dump: {
type: Object,
default: null
},
query: {
type: Object,
default: null
},
sms: {
type: Object,
default: null
},
accountInfo: {
type: Object,
default: null
}
},
components: {Template},
data() {
const validatePhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('请填写手机号'));
} else if (!/^1[3456789]\d{9}$/.test(value)) {
callback(new Error('手机号格式不正确!'));
} else {
callback();
}
};
return {
dialogVisible: false,
listLoading: false,
tableData: {
data: [],
total: 0
},
tableFrom: {
page: 1,
limit: 20,
status: '3',
type: 'sms'
},
columns2: [],
isSms: false, // 是否开通短信
isDump: false, // 是否开通电子面单,是否开通物流查询
isCopy: false, // 是否开通商品采集
modals: false,
loading: false,
formInlineDump: {
tempId: '',
sign: '',
com: '',
toName: '',
toTel: '',
siid: '',
toAddress: '',
type: ''
},
ruleInline: {
sign: [
{ required: true, message: '请输入短信签名', trigger: 'blur' }
],
phone: [
{ required: true, validator: validatePhone, trigger: 'blur' }
],
code: [
{ required: true, message: '请输入验证码', trigger: 'blur' }
],
com: [
{ required: true, message: '请选择快递公司', trigger: 'change' }
],
tempId: [
{ required: true, message: '请选择打印模板', trigger: 'change' }
],
toName: [
{ required: true, message: '请输寄件人姓名', trigger: 'blur' }
],
toTel: [
{ required: true, validator: validatePhone, trigger: 'blur' }
],
siid: [
{ required: true, message: '请输入云打印机编号', trigger: 'blur' }
],
toAddress: [
{ required: true, message: '请输寄件人地址', trigger: 'blur' }
]
},
tempImg: '', // 图片
exportTempList: [], // 电子面单模板
exportList: [], // 快递公司列表
formInline: {
phone: '',
code: '',
sign: ''
},
ruleInlineSign: {
sign: [
{ required: true, message: '请输入短信签名', trigger: 'blur' }
],
phone: [
{ required: true, validator: validatePhone, trigger: 'blur' }
],
code: [
{ required: true, message: '请输入验证码', trigger: 'blur' }
]
},
cutNUm: '获取验证码',
canClick: true,
}
},
watch: {
sms (n) {
if (n.open === 1) this.getList();
}
},
mounted() {
if (this.sms.open === 1) this.getList();
// if (this.isChecked === '1' && this.sms.open === 1) this.getList();
},
methods: {
editSign(){
this.formInline.account = this.accountInfo.account;
this.formInline.sign = this.accountInfo.sms.sign;
this.formInline.phone = this.accountInfo.phone;
this.dialogVisible = true;
},
//修改签名
handleSubmit:Debounce(function(name) {
this.$refs[name].validate((valid) => {
if (valid) {
smsSignApi(this.formInline).then(async res => {
this.$message.success('修改签名之后一号通需要审核过后通过!');
this.dialogVisible = false;
this.$refs[formName].resetFields();
})
} else {
return false;
}
})
}),
// 短信验证码
cutDown () {
if (this.formInline.phone) {
if (!this.canClick) return;
this.canClick = false;
this.cutNUm = 60;
let data = {
phone: this.formInline.phone,
types: 1
};
captchaApi(data).then(async res => {
this.$message.success(res.msg);
})
let time = setInterval(() => {
this.cutNUm--;
if (this.cutNUm === 0) {
this.cutNUm = '获取验证码';
this.canClick = true;
clearInterval(time)
}
}, 1000)
} else {
this.$message.warning('请填写手机号!');
}
},
handleClose(){
this.dialogVisible = false
this.$refs['formInline'].resetFields();
},
// 首页去开通
onOpenIndex (val) {
this.tableFrom.type = val;
switch (val) {
case 'sms':
this.isSms = true;
break;
case 'expr_dump':
this.openDump();
break;
default:
this.openOther();
break;
}
},
// 开通其他
openOther () {
this.$confirm(`确定开通${commFilter.onePassTypeFilter(this.tableFrom.type)}吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// this.handleSubmitDump('formInlineDump');
serviceOpenApi({type: this.tableFrom.type}).then(async res => {
this.$message.success('开通成功!');
this.getList();
this.$emit('openService')
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
})
},
// 开通电子面单
openDump () {
this.exportTempAllList();
this.isDump = true;
},
// 物流公司
exportTempAllList () {
expressAllApi({type:'elec'}).then(async res => {
this.exportList = res;
})
},
// 快递公司选择
onChangeExport (val) {
this.formInlineDump.tempId = '';
this.exportTemp(val);
},
// 电子面单模板
exportTemp (val) {
exportTempApi({ com: val }).then(async res => {
this.exportTempList = res.data.data || [];
})
},
onChangeImg (item) {
this.exportTempList.map(i => {
if (i.temp_id === item) this.tempImg = i.pic
})
},
handleSubmitDump (name) {
this.formInlineDump.type = this.tableFrom.type;
this.$refs[name].validate((valid) => {
if (valid) {
this.loading = true;
serviceOpenApi(this.formInlineDump).then(async res => {
this.$emit('openService');
this.$message.success('开通成功!');
this.getList();
this.loading = false;
}).catch(()=>{
this.loading = false;
})
} else {
return false;
}
})
},
onChangeType () {
this.tableFrom.page = 1
this.getList()
},
// 列表
getList() {
this.listLoading = true
smsLstApi(this.tableFrom).then(res => {
this.tableData.data = res.data;
if(this.tableFrom.type == 'sms'){
let obj = new Object();
let newArr = new Array();
res.data.forEach(item=>{
obj = item;
switch(item.status) {
case 0:
obj.status = '发送中'
break;
case 1:
obj.status = '成功'
break;
case 2:
obj.status = '失败'
break;
case 3:
obj.status = '全部'
break;
}
newArr.push(obj);
this.tableData.data = newArr;
})
}
this.tableData.total = res.count
switch (this.tableFrom.type) {
case 'sms':
this.columns2 = [
{
title: '手机号',
key: 'phone',
minWidth: 100
},
{
title: '模板内容',
key: 'content',
minWidth: 590
},
{
title: '发送时间',
key: 'add_time',
minWidth: 150
},
// {
// title: '状态',
// key: 'status',
// minWidth: 100
// }
]
break;
case 'expr_dump':
this.columns2 = [
// {
// title: '订单号',
// key: 'order_id',
// minWidth: 150
// },
{
title: '发货人',
key: 'from_name',
minWidth: 120
},
{
title: '收货人',
key: 'to_name',
minWidth: 120
},
{
title: '快递单号',
key: 'num',
minWidth: 120
},
{
title: '快递公司编码',
key: 'code',
minWidth: 120
},
{
title: '状态',
key: '_resultcode',
minWidth: 100
},
{
title: '打印时间',
key: 'add_time',
minWidth: 150
}
]
break;
case 'expr_query':
this.columns2 = [
{
title: '快递单号',
key: 'content',
minWidth: 120
},
{
title: '快递公司编码',
key: 'code',
minWidth: 120
},
{
title: '状态',
key: '_resultcode',
minWidth: 120
},
{
title: '添加时间',
key: 'add_time',
minWidth: 150
}
]
break;
default:
this.columns2 = [
{
title: '复制URL',
key: 'url',
minWidth: 400
},
{
title: '请求状态',
key: '_resultcode',
minWidth: 120
},
{
title: '添加时间',
key: 'add_time',
minWidth: 150
}
]
break;
}
this.listLoading = false
}).catch(res => {
this.listLoading = false
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList()
},
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
/*@aaa: ~'>>>';*/
.order_box ::v-deep.ivu-form-item-content{
margin-left: 50px!important;
}
.maxInpt{
max-width:400px;
margin-left:auto;
margin-right:auto;
}
.smsBox .page-account-top{
text-align: center;
margin: 70px 0 30px 0;
}
.note{
margin-top: 15px;
}
.tempImg{
cursor: pointer;
margin-left: 11px;
color: #1890FF;
}
.tempImgList{
// opacity: 1;
width: 38px !important;
height: 30px !important;
// margin-top: -30px;
cursor: pointer;
position: absolute;
z-index: 11;
img{
width: 38px !important;
height: 30px !important;
}
}
.width9{
width: 90%;
}
.width10{
width: 100%;
}
.wuBox{
width: 100%;
}
.wuSp1{
display: block;
text-align: center;
color: #000000;
font-size: 21px;
font-weight: 500;
line-height: 32px;
margin-top: 23px;
margin-bottom: 5px;
}
.wuSp2{
opacity: 45%;
font-weight: 400;
color: #000000;
line-height: 22px;
margin-bottom: 30px;
}
.page-account-top-tit{
font-size: 21px;
color: #1890FF;
}
.wuTu{
width: 295px;
height: 164px;
margin-top: 54px;
img{
width: 100%;
height: 100%;
}
+ span {
margin-bottom: 20px;
}
}
.tempId{
.ivu-form-item-content{
text-align: left !important;
}
}
.flex-between{
display: flex;
justify-content: space-between;
}
</style>

View File

@@ -0,0 +1,61 @@
<template>
<div class="divBox">
<el-card class="box-card">
<zb-parser
:form-id="formId"
:is-create="isCreate"
:edit-data="editData"
@submit="handlerSubmit"
@resetForm="resetForm"
v-if="isShow && checkPermi(['admin:pass:appget'])"
/>
</el-card>
</div>
</template>
<script>
import zbParser from '@/components/FormGenerator/components/parser/ZBParser';
import { passAppSaveApi, configInfo, passAppInfoApi } from '@/api/systemConfig.js';
import { checkPermi } from '@/utils/permission'; // 权限判断函数
export default {
name: 'onePassConfig',
components: { zbParser },
data() {
return {
isShow: true,
isCreate: 0,
editData: {},
formId: 144, //一号通配置
};
},
mounted() {
if (checkPermi(['admin:pass:appget'])) this.getPassAppInfo();
},
methods: {
checkPermi,
resetForm(formValue) {
this.isShow = false;
},
handlerSubmit(data) {
passAppSaveApi(data).then((res) => {
this.getPassAppInfo();
this.$message.success('操作成功');
});
},
//获取配置详情
getPassAppInfo() {
passAppInfoApi().then((res) => {
this.isShow = false;
this.editData = res;
this.isCreate = 1;
setTimeout(() => {
// 让表单重复渲染待编辑数据
this.isShow = true;
}, 80);
});
},
},
};
</script>
<style scoped></style>

View File

@@ -1,329 +1,35 @@
<template>
<div class="divBox">
<el-card v-if="isShowList" v-loading="fullscreenLoading" class="box-card mb20">
<div class="content acea-row row-middle">
<div class="demo-basic--circle acea-row row-middle">
<div class="circleUrl mr20"><img :src="circleUrl"></div>
<!--<el-avatar :size="50" :src="circleUrl" class="mr20" />-->
<div class="dashboard-workplace-header-tip">
<div class="dashboard-workplace-header-tip-title">{{ smsAccount }}祝您每一天开心</div>
<div class="dashboard-workplace-header-tip-desc">
<span class="mr10" @click="onChangePassswordIndex" v-if="checkPermi(['admin:pass:update:password'])">修改密码</span>
<span class="mr10" @click="onChangePhone" v-if="checkPermi(['admin:pass:update:phone'])">修改手机号</span>
<span @click="signOut" class="mr10" v-if="checkPermi(['admin:pass:logout'])">退出登录</span>
<!-- <el-tooltip class="item" effect="dark" content="
一号通为我司一个第三方平台
专门提供短信 物流查询,商品复制,电子面单等个性化服务
省去了自己单独接入功能的麻烦
初次运行代码默认是没有账号的,需要自行注册,
登录成功后根据提示购买自己需要用到的服务即可" placement="right">
<span class="mr10">平台说明</span>
</el-tooltip> -->
<template>
<el-popover trigger="hover" placement="right" >
<span class="mr10" slot="reference">平台说明</span>
<div class="pup_card">
一号通为我司一个第三方平台专门提供短信 物流查询商品复制电子面单等个性化服务省去了自己单独接入功能的麻烦初次运行代码默认是没有账号的需要自行注册
登录成功后根据提示购买自己需要用到的服务即可
</div>
</el-popover>
</template>
</div>
</div>
</div>
<div class="dashboard">
<div class="dashboard-workplace-header-extra">
<div class="acea-row">
<div class="header-extra">
<p class="mb5"><span>短信条数</span></p>
<p class="mb5">{{sms.num || 0}}</p>
<el-button size="mini" type="primary" @click="sms.open ===0?onOpen('sms'):mealPay('sms')" v-text="sms.open ===0?'开通服务':'套餐购买'" v-hasPermi="['admin:pass:meal:code', 'admin:pass:service:open']"></el-button>
</div>
<div class="header-extra">
<p class="mb5"><span>采集次数</span></p>
<p class="mb5">{{copy.num || 0}}</p>
<el-button size="mini" type="primary" @click="copy.open ===0?onOpen('copy'):mealPay('copy')" v-text="copy.open ===0?'开通服务':'套餐购买'" v-hasPermi="['admin:pass:meal:code', 'admin:pass:service:open']"></el-button>
</div>
<div class="header-extra">
<p class="mb5"><span>物流查询次数</span></p>
<p class="mb5">{{query.num || 0}}</p>
<el-button size="mini" type="primary" @click="query.open ===0?onOpen('expr_query'):mealPay('expr_query')" v-text="query.open ===0?'开通服务':'套餐购买'" v-hasPermi="['admin:pass:meal:code', 'admin:pass:service:open']"></el-button>
</div>
<div class="header-extra" style="border: none;">
<p class="mb5"><span>面单打印次数</span> </p>
<p class="mb5">{{dump.num || 0}}</p>
<el-button size="mini" type="primary" @click="dump.open ===0?onOpen('expr_dump'):mealPay('expr_dump')" v-text="dump.open ===0?'开通服务':'套餐购买'" v-hasPermi="['admin:pass:meal:code', 'admin:pass:service:open']"></el-button>
</div>
</div>
</div>
</div>
</div>
</el-card>
<el-card class="box-card" v-loading="loading">
<table-list v-if="isShowList" ref="tableLists" :sms="sms" :copy="copy" :dump="dump" :query="query" :accountInfo="accountInfo" @openService="openService"/>
<login-from v-if="isShowLogn" @on-change="onChangePasssword" @on-changes="onChangeReg" @on-Login="onLogin" />
<forget-password :infoData="infoData" v-if="isShow" @goback="goback" @on-Login="onLogin" :isIndex="isIndex"></forget-password>
<forget-phone v-if="isForgetPhone" @gobackPhone="gobackPhone" @on-Login="onLogin"></forget-phone>
<register-from v-if="isShowReg" @on-change="logoup" />
</el-card>
<div>
<iframe
ref="iframes"
src="https://api.crmeb.com/"
width="100%"
:height="iframeHeight"
style="border: none"
></iframe>
</div>
</template>
<script>
import tableList from './components/tableList'
import loginFrom from './components/loginFrom'
import registerFrom from './components/register'
import forgetPassword from './components/forgetPassword';
import forgetPhone from './components/forgetPhone';
import { logoutApi, smsNumberApi, smsInfoApi } from '@/api/sms'
import { mapGetters } from 'vuex'
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
name: 'SmsConfig',
components: { tableList, loginFrom, registerFrom, forgetPassword, forgetPhone },
name: "SmsConfig",
data() {
return {
fullscreenLoading: false,
loading: false,
smsAccount: '',
circleUrl: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
accountInfo:{},
spinShow: false,
isForgetPhone: false, // 修改手机号
isIndex: false, // 判断忘记密码返回的路径
isShowLogn: false, // 登录
isShow: false, // 修改密码
isShowReg: false, // 注册
isShowList: false, // 登录之后列表
sms: { open: 0 }, // 短信信息
query: { open: 0 }, // 物流查询
dump: { open: 0 }, // 电子面单打印
copy: { open: 0 }, // 商品采集,
infoData: {},
}
iframeHeight: 0
};
},
computed: {
...mapGetters([
'isLogin'
])
created() {
window.addEventListener("resize", this.handleResize);
},
mounted() {
this.onIsLogin()
// if (!this.isLogin) {
// this.onIsLogin()
// } else {
// this.isShowList = true
// }
this.$nextTick(() => {
this.iframeHeight = this.$selfUtil.getTableHeight(0);
});
},
methods: {
checkPermi,
// 开通服务
openService (val) {
this.getNumber();
},
onOpen (val) {
this.$refs.tableLists.onOpenIndex(val);
},
// 手机号返回
gobackPhone () {
this.isShowList = true;
this.isForgetPhone = false;
},
onChangePhone () {
this.isForgetPhone = true
this.isShowLogn = false;
this.isShowList = false;
},
// 密码返回
goback () {
if (this.isIndex) {
this.isShowList = true;
this.isShow = false;
} else {
this.isShowLogn = true;
this.isShow = false;
}
},
// 修改密码
onChangePassswordIndex () {
this.isIndex = true;
this.passsword();
},
// 忘记密码
onChangePasssword () {
this.isIndex = false;
this.passsword();
// this.isShowLogn = false;
// this.isShow = true;
// this.isShowList = false;
},
passsword () {
this.isShowLogn = false;
this.isShow = true;
this.isShowList = false;
},
mealPay (val) {
this.$router.push({ path:'/operation/systemSms/pay',query:{type:val}});
},
// 剩余条数
getNumber() {
this.loading = true;
smsInfoApi().then(async res => {
let data = res;
this.infoData = res;
this.sms = {
num: data.sms.num,
open: data.sms.open,
surp: data.sms.open
};
this.query = {
num: data.query.num,
open: data.query.open,
surp: data.query.open
};
this.dump = {
num: data.dump.num,
open: data.dump.open,
surp: data.dump.open
};
this.copy = {
num: data.copy.num,
open: data.copy.open,
surp: data.copy.open
};
this.loading = false;
this.smsAccount = data.account;
this.accountInfo = data;
}).catch(res => {
this.isShowLogn = true;
this.isShowList = false;
this.loading = false;
})
},
// 登录跳转
onLogin() {
const url = this.$route.query.url
if (url) {
this.$router.replace(url)
} else {
this.getNumber()
this.isShowLogn = false
this.isShow = false
this.isShowReg = false
this.isShowList = true
}
},
// 查看是否登录
onIsLogin() {
this.fullscreenLoading = true
this.$store.dispatch('user/isLogin').then(async res => {
const data = res
this.isShowLogn = !data.status
this.isShowList = data.status
if (data.status) {
this.smsAccount = data.info
this.getNumber()
}
this.fullscreenLoading = false
}).catch(res => {
this.fullscreenLoading = false
this.isShowLogn = true
})
},
// 退出登录
signOut() {
logoutApi().then(async res => {
this.isShowLogn = true
this.isShowList = false
this.infoData.phone = '';
this.$store.dispatch('user/isLogin')
})
},
// 立即注册
onChangeReg() {
this.isShowLogn = false
this.isShow = false
this.isShowReg = true
},
// 立即登录
logoup() {
this.isShowLogn = true
this.isShow = false
this.isShowReg = false
handleResize(event) {
this.iframeHeight = this.$selfUtil.getTableHeight(0);
}
}
}
};
</script>
<style scoped lang="scss">
.dashboard{
width: auto !important;
min-width: 300px;
}
.header-extra{
/*width: 25%;*/
border-right: 1px solid #E9E9E9;
text-align: center;
padding: 0 18px;
}
$cursor: #1890ff;
.content{
justify-content: space-between;
}
.circleUrl{
width: 50px;
height: 50px;
}
.circleUrl img{
width: 100%;
height: 100%;
border-radius: 50%;
overflow: hidden;
}
.rR{
text-align: center;
font-size: 22px;
display: block;
}
.dashboard-workplace-header-tip {
display: inline-block;
vertical-align: middle;
}
.dashboard-workplace-header-tip-title {
font-size: 20px;
font-weight: 700;
margin-bottom: 12px;
}
.dashboard-workplace-header-tip-desc{
/*line-height: 0 !important;*/
display: block;
span{
font-size: 12px;
color: $cursor;
cursor: pointer;
display: inline-block;
}
}
.dashboard-workplace-header-extra{
width: auto!important;
min-width: 400px;
}
.pfont{
font-size: 12px;
color: #808695;
}
.text_overflow{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.pup_card{
width: 240px;
border-radius: 5px;
padding: 5px;
box-sizing: border-box;
font-size: 12px;
line-height: 16px;
}
</style>