添加个人信息

pull/2/head
jwg 3 months ago
parent e57a20cca6
commit 742b29f6c2

@ -0,0 +1,34 @@
import request from '@/plugin/axios'
// 创建银行账户信息
export function createBankInfo(data) {
return request({
url: "/system/bank-info/create",
method: "post",
data: data,
});
}
// 更新银行账户信息
export function updateBankInfo(data) {
return request({
url: "/system/bank-info/update",
method: "put",
data: data,
});
}
// 删除银行账户信息
export function deleteBankAccountInfo(id) {
return request({
url: "/system/bank-info/delete?id=" + id,
method: "delete",
});
}
// 获取银行账户信息详情
export function getDetail(id) {
return request({
url: "/system/bank-info/get?id=" + id,
method: "get",
});
}

@ -36,14 +36,21 @@ export function addUser(data) {
}
// 修改用户
export function updateUser(data) {
// export function updateUser(data) {
// return request({
// url: '/system/user/update',
// method: 'put',
// data: data
// })
// }
// 修改用户个人信息
export function updateUserProfile(data) {
return request({
url: '/system/user/update',
url: '/system/user/profile/update',
method: 'put',
data: data
})
}
// 删除用户
export function delUser(userId) {
return request({
@ -96,14 +103,14 @@ export function getUserProfile() {
})
}
// 修改用户个人信息
export function updateUserProfile(data) {
return request({
url: '/system/user/profile/update',
method: 'put',
data: data
})
}
// // 修改用户个人信息
// export function updateUserProfile(data) {
// return request({
// url: '/system/user/profile/update',
// method: 'put',
// data: data
// })
// }
// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
@ -135,3 +142,4 @@ export function importTemplate() {
responseType: 'blob'
})
}

@ -10,5 +10,6 @@ export default {
component: layoutHome,
children: (pre => [
{ path: '/myReportForms', name: `${pre}myReportForms`, component: () => import('@/views/reportForms/myReportForms'), meta: { cache: true, title: '我的报表' } },
{ path: '/userInfo', name: `${pre}UserInfo`, component: () => import('@/views/reportForms/userInfo'), meta: { cache: true, title: '个人信息' } },
])('reportForms-')
}

@ -55,78 +55,76 @@
</template>
<script>
import { checkPermission } from "@/utils";
import { getMyNotifyMessagePage } from "@/api/bs/waitToDo";
import { Dialog } from "vant";
import { checkPermission } from '@/utils'
import { getMyNotifyMessagePage } from '@/api/bs/waitToDo'
import { Dialog } from 'vant'
export default {
name: "home-index",
name: 'home-index',
components: {
// withdraw: () => import('./components/withdraw.vue')
},
props: {
applyShow: {
type: Boolean,
default: false,
},
default: false
}
},
computed: {
permission_btns() {
return this.$store.getters.permission_btns;
return this.$store.getters.permission_btns
},
userInfo() {
return JSON.parse(
window.localStorage.getItem("userInfo") || { dept: {} }
);
},
return JSON.parse(window.localStorage.getItem('userInfo') || { dept: {} })
}
},
created() {
console.log(this.$route.query, "this.$router.query");
console.log(this.$route.query, 'this.$router.query')
},
mounted() {
this.$forceCloseLoading();
this.handleFilterList();
this.handleInitList();
this.$forceCloseLoading()
this.handleFilterList()
this.handleInitList()
},
data() {
return {
roterList: [],
isDot: false,
};
isDot: false
}
},
methods: {
loginOut() {
Dialog.confirm({
title: "提示",
message: "您确定要退出吗?",
title: '提示',
message: '您确定要退出吗?'
}).then(() => {
this.$store.dispatch("common/user/out");
});
this.$store.dispatch('common/user/out')
})
},
handleInitList() {
let filterArr = ["QUOTATION_SHEET"];
let filterArr = ['QUOTATION_SHEET']
getMyNotifyMessagePage({
pageNo: 1,
pageSize: 999,
pageSize: 999
}).then((res) => {
let resList = (res.data && res.data.list) || [];
let resList = (res.data && res.data.list) || []
let newArr = resList.filter(
(item) => !filterArr.includes(item.billType)
);
)
if (newArr.length) {
this.isDot = true;
this.isDot = true
} else {
this.isDot = false;
this.isDot = false
}
});
})
},
handleToWait() {
this.$router.push({
path: "/waitToDo",
});
path: '/waitToDo'
})
},
handleFilterList() {
this.roterList = [];
this.roterList = []
let arr = [
{
row: [
@ -137,10 +135,10 @@ export default {
// show: this.permission_btns.includes('bs:expense-apply:create'),
// },
{
route: "/myNewTrips",
title: "我的申请",
icon: "manager-o",
show: checkPermission("bs/myExpenseApply/index"),
route: '/myNewTrips',
title: '我的申请',
icon: 'manager-o',
show: checkPermission('bs/myExpenseApply/index')
},
/* {
route: '/myTrips',
@ -155,10 +153,10 @@ export default {
// show: this.permission_btns.includes('bs:expense-claim:create'),
// },
{
route: "/myNewClaim",
title: "我的报销",
icon: "bookmark-o",
show: checkPermission("bs/myExpenseClaim/index"),
route: '/myNewClaim',
title: '我的报销',
icon: 'bookmark-o',
show: checkPermission('bs/myExpenseClaim/index')
},
/* {
route: '/myClaim',
@ -167,42 +165,42 @@ export default {
show: checkPermission('bs/expenseClaim/index'),
}, */
{
route: "/myInvoice",
title: "我的发票",
icon: "label-o",
show: checkPermission("bs/invoice/index"),
},
route: '/myInvoice',
title: '我的发票',
icon: 'label-o',
show: checkPermission('bs/invoice/index')
}
],
title: "报销",
title: '报销'
},
{
row: [
{
route: "/myTrips",
title: "申请单",
icon: "exchange",
show: checkPermission("bs/expenseApply/index"),
route: '/myTrips',
title: '申请单',
icon: 'exchange',
show: checkPermission('bs/expenseApply/index')
},
{
route: "/myClaim",
title: "报销单",
icon: "qr-invalid",
show: checkPermission("bs/expenseClaim/index"),
route: '/myClaim',
title: '报销单',
icon: 'qr-invalid',
show: checkPermission('bs/expenseClaim/index')
},
{
route: "/corporateReceiptsApproval", //
title: "对公收款审批",
icon: "friends-o",
show: this.permission_btns.includes("bs:vendor-receipt:query"),
route: '/corporateReceiptsApproval', //
title: '对公收款审批',
icon: 'friends-o',
show: this.permission_btns.includes('bs:vendor-receipt:query')
},
{
route: "/corporatePaymentApproval",
title: "对公付款审批",
icon: "friends-o",
show: this.permission_btns.includes("bs:vendor-payment:query"),
},
route: '/corporatePaymentApproval',
title: '对公付款审批',
icon: 'friends-o',
show: this.permission_btns.includes('bs:vendor-payment:query')
}
],
title: "审批",
title: '审批'
},
{
row: [
@ -233,64 +231,75 @@ export default {
show: this.permission_btns.includes('procurement:payApply:list')
}, */
{
route: "/corporateReceipts",
title: "对公收款",
icon: "friends-o",
show: this.permission_btns.includes("bs:vendor-receipt:query"),
route: '/corporateReceipts',
title: '对公收款',
icon: 'friends-o',
show: this.permission_btns.includes('bs:vendor-receipt:query')
},
{
route: "/corporatePayment",
title: "对公付款",
icon: "friends-o",
show: this.permission_btns.includes("bs:vendor-payment:query"),
},
route: '/corporatePayment',
title: '对公付款',
icon: 'friends-o',
show: this.permission_btns.includes('bs:vendor-payment:query')
}
],
title: "对公",
title: '对公'
},
{
row: [
{
route: "/myReportForms",
title: "我的报表",
icon: "friends-o",
show: true,
},
route: '/myReportForms',
title: '我的报表',
icon: 'friends-o',
show: true
}
],
title: "报表",
title: '报表'
},
];
{
row: [
{
route: '/userInfo',
title: '个人信息',
icon: 'user-o',
show: true
}
],
title: '个人信息'
}
]
this.roterList = arr.map((item) => {
return {
...item,
row: item.row.filter((n) => n.show),
};
});
row: item.row.filter((n) => n.show)
}
})
},
checkPermission,
handelTo(route) {
if (route) {
if (
["/trips", "/claim", "/supplier", "/custom", "/pay"].includes(route)
['/trips', '/claim', '/supplier', '/custom', '/pay'].includes(route)
) {
this.$router.push({
path: route,
query: {
type: "add",
},
});
type: 'add'
}
})
} else {
this.$router.push({
path: route,
});
path: route
})
}
} else {
this.$fm("模块正在中...");
this.$fm('模块正在中...')
}
}
}
}
},
},
};
</script>
<style lang="scss" scoped>
@import "./index.scss";
@import './index.scss';
</style>

@ -90,12 +90,12 @@ export default {
loginForm: {
loginType: '',
username: '', // admin
password: '', // admin123
password: '', // Abc123456.
captchaVerification: '',
mobile: '',
mobileCode: '',
rememberMe: false,
tenantName: '', //
tenantName: '链友融科技' //
},
systemInfo: {},
checked: false,
@ -103,20 +103,19 @@ export default {
captchaEnable: false,
isRemeber: false,
code: '',
state: '',
state: ''
}
},
components: {
// Verify
},
computed: {
...mapGetters(['devSystemList', 'devUserList']),
...mapGetters(['devSystemList', 'devUserList'])
},
created() {
//
isProhibited().then((res) => {
if (res.data) {
console.log(res.data, 'isProhibited')
if (/wxwork/i.test(navigator.userAgent)) {
//
} else {
@ -159,7 +158,7 @@ export default {
'common/user/setAuthorization',
res.data.accessToken,
{
root: true,
root: true
}
)
await setAccessToken(res.data.accessToken).then(async () => {
@ -180,7 +179,7 @@ export default {
Toast({
duration: 3000, // toast
forbidClick: false,
message: '请输入账号密码首次绑定',
message: '请输入账号密码首次绑定'
})
this.$nextTick(() => {
return
@ -197,7 +196,7 @@ export default {
// scope: 'snsapi_privateinfo',
// agentid: '1000002',
// type: 30,
redirectUri: process.env.VUE_APP_BASE_API + '/#/login',
redirectUri: process.env.VUE_APP_BASE_API + '/#/login'
}).then((res) => {
// URL
window.location.href = res.data
@ -212,7 +211,7 @@ export default {
this.loginForm = {
tenantName,
username,
password,
password
}
} else {
window.localStorage.removeItem('loginInfo')
@ -270,7 +269,7 @@ export default {
this.developLogin({
vm: this,
username: this.loginForm.username,
password: this.loginForm.password,
password: this.loginForm.password
})
.then(() => {
//
@ -278,7 +277,7 @@ export default {
let obj = {
tenantName: this.loginForm.tenantName,
username: this.loginForm.username,
password: this.loginForm.password,
password: this.loginForm.password
}
window.localStorage.setItem('loginInfo', JSON.stringify(obj))
}
@ -308,8 +307,8 @@ export default {
},
handleDevUser(val) {
this.loginForm.devUserTitle = val.title
},
},
}
}
}
</script>

@ -0,0 +1,210 @@
<template>
<div class="main">
<van-button type="info" hairline @click="handleAdd" icon="plus"
>新增</van-button
>
<van-list>
<div v-for="(item, index) in list" :key="item.id" class="card">
<p>银行卡{{ index + 1 }}</p>
<p>银行名称{{ item.bankName }}</p>
<p>开户支行{{ item.bankOfDeposit }}</p>
<p>银行账户名: {{ item.bankNumber }}</p>
<p>备注 {{ item.remark }}</p>
<div style="text-align: center">
<van-button
plain
@click="handleUpdate(item)"
type="info"
size="small"
style="margin-right: 20px"
>修改</van-button
>
<van-button
plain
type="danger"
size="small"
@click="handleDelete(item)"
>删除</van-button
>
</div>
</div>
</van-list>
<!-- 对话框(添加 / 修改) -->
<van-popup v-model="open" position="bottom" :overlay="true">
<div
style="
margin: 15px;
text-align: center;
font-size: 18px;
font-weight: 600;
"
>
{{ title }}
</div>
<van-field
v-model="form.bankName"
clearable
label="银行名称"
placeholder="请输入"
/>
<van-field
v-model="form.bankOfDeposit"
required
clearable
label="开户支行"
placeholder="请输入"
/>
<van-field
v-model="form.bankNumber"
required
clearable
label="银行账户号"
placeholder="请输入"
/>
<van-field
v-model="form.remark"
clearable
label="备注"
placeholder="请输入"
/>
<div class="btn-box">
<van-button
type="primary"
size="small"
@click="saveBankInfo"
style="margin-right: 40px"
>保存</van-button
>
<van-button type="info" size="small" @click="open = false"
>取消</van-button
>
</div>
</van-popup>
</div>
</template>
<script>
import {
createBankInfo,
updateBankInfo,
deleteBankAccountInfo,
getDetail
} from '@/api/system/bankInfo'
import { Dialog } from 'vant'
export default {
components: { Dialog },
props: {
user: {
type: Object
}
},
data() {
return {
open: false,
form: {},
title: ''
}
},
computed: {
//
list() {
return this.user.bankInfoList || []
}
},
methods: {
/** 表单重置 */
reset() {
this.form = {
id: undefined,
bankName: undefined,
bankOfDeposit: undefined,
bankNumber: undefined,
accountType: undefined,
remark: undefined,
files: undefined
}
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加银行账户信息'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
getDetail(row.id).then((response) => {
this.form = response.data
this.open = true
this.title = '修改银行账户信息'
})
},
//
saveBankInfo() {
if (!this.form.bankName) {
this.$fm('不可为空!')
return
}
if (!this.form.bankOfDeposit) {
this.$fm('不可为空!')
return
}
if (!this.form.bankNumber) {
this.$fm('不可为空!')
return
}
//
if (this.form.id != null) {
updateBankInfo(this.form).then((response) => {
this.$sm('修改成功')
this.open = false
this.$emit('update')
})
return
}
//
createBankInfo(this.form).then((response) => {
this.$sm('新增成功')
this.open = false
this.$emit('update')
})
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id
Dialog.confirm({
title: `是否确认删除银行账户号为
${row.bankNumber}
的数据项?`
})
.then(() => {
return deleteBankAccountInfo(id)
.then(() => {
// this.getList()
this.$emit('update')
this.$sm('删除成功')
})
.catch(() => {})
})
.catch(() => {})
}
}
}
</script>
<style scoped lang="scss">
.main {
padding: 10px;
background-color: #f2f2f2;
}
.card {
margin: 15px 0;
padding: 10px;
background-color: #fff;
border-radius: 5px;
}
.btn-box {
margin: 10px;
text-align: center;
}
</style>

@ -0,0 +1,196 @@
<template>
<div class="common-list-contain">
<van-tabs v-model="active" @click="onChange" class="tabs">
<van-tab title="基本资料">
<van-field
v-model="user.nickname"
clearable
label="用户昵称"
placeholder="请输入用户昵称"
/>
<van-field
v-model="user.mobile"
required
clearable
label="手机号码"
placeholder="请输入手机号码"
/>
<van-field
v-model="user.email"
required
clearable
label="邮箱"
placeholder="请输入邮箱"
/>
<div class="van-cell van-field">
<div class="van-cell__title van-field__label">
<span>性别</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="radio" name="sex" v-model="user.sex" :value="1" />
<span style="display: inline-block; width: 20px"></span>
<input type="radio" name="sex" v-model="user.sex" :value="2" />
</div>
</div>
</div>
<div class="btn-box">
<van-button
type="info"
size="small"
style="width: 30%"
@click="saveUser"
>保存</van-button
>
</div>
</van-tab>
<van-tab title="修改密码">
<van-field
v-model="password.oldPassword"
clearable
type="password"
label="旧密码"
placeholder="请输入"
/>
<van-field
v-model="password.newPassword"
required
clearable
type="password"
label="新密码"
placeholder="请输入"
/>
<van-field
v-model="password.confirmPassword"
required
clearable
type="password"
label="确认密码"
placeholder="请输入"
/>
<div class="btn-box">
<van-button
type="info"
size="small"
style="width: 30%"
@click="savePassword"
>保存</van-button
>
</div>
</van-tab>
<van-tab title="银行">
<BankInfo :user="user" @update="getUser"></BankInfo>
</van-tab>
</van-tabs>
<div class="common-bottom-btns" style="bottom: 6rem">
<div class="common-bottom-btn" @click="handleBack">
<img src="@/assets/images/icons/home.png" alt="" />
<span>返回首页</span>
</div>
</div>
</div>
</template>
<script>
import {
updateUserProfile,
getUserProfile,
updateUserPwd
} from '@/api/system/user'
import BankInfo from './bankInfo'
export default {
components: { BankInfo },
data() {
return {
active: 0,
user: {
nickname: '',
mobile: '',
email: '',
sex: null
},
password: {
oldPassword: '',
newPassword: '',
confirmPassword: ''
}
}
},
created() {
this.getUser()
},
methods: {
onChange(index, title) {
this.active = index
},
//
getUser() {
getUserProfile().then((response) => {
this.user = response.data
})
},
saveUser() {
if (!this.user.mobile) {
this.$fm('手机号不可为空!')
return
}
if (!this.user.email) {
this.$fm('邮箱不可为空!')
return
}
updateUserProfile(this.user).then((res) => {
if (res.data) this.$fm('保存成功!')
})
},
savePassword() {
if (!this.password.oldPassword) {
this.$fm('不可为空!')
return
}
if (!this.password.newPassword) {
this.$fm('不可为空!')
return
}
if (this.password.confirmPassword !== this.password.newPassword) {
this.$fm('两次输入的密码不一致')
return
}
const regex = new RegExp(
/^(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*\.])[A-Za-z\d!@#$%^&*\.]{8,16}$/
)
if (!regex.test(this.password.newPassword)) {
this.$fm('密码必须包含大写字母、数字、特殊字符, 且8-16位')
return
}
updateUserPwd(this.password.oldPassword, this.password.newPassword).then(
(response) => {
this.$fm('修改成功')
}
)
},
handleBack() {
history.back()
}
}
}
</script>
<style scoped lang="scss">
@import '~@/assets/style/common/form.scss';
.tabs {
::v-deep .van-tabs__content {
margin-top: 15px;
}
}
.my-radio {
.van-radio__icon {
display: inline;
}
}
.btn-box {
margin-top: 40px;
text-align: center;
}
</style>
Loading…
Cancel
Save