Files
dispacth_zhongpin/src/views/driver/user/SysCustomerInfoInfo.vue
2023-04-18 17:02:02 +08:00

951 lines
29 KiB
Vue

<template>
<div>
<section style="padding: 20px">
<el-card shadow="never" class="box-card no-wrap">
<div slot="header">
<span class="card-header-icon"
><svg-icon style="color: #118dde" icon-class="iconjichuziliao"
/></span>
<span class="card-header-text">司机基础信息</span>
</div>
<div class="my-cell">
<div class="cell-item">
<span class="color-999 test-tst">id</span>
<br />
<span class="inner-data">{{ sysCustomerInfo.id }}</span>
</div>
<div class="cell-item">
<span class="color-999 test-tst">用户编码</span>
<br />
<span class="color-999 inner-data">{{
sysCustomerInfo.userCode
}}</span>
</div>
<div class="cell-item">
<span class="color-999 test-tst">手机号</span>
<br />
<span class="inner-data">{{ sysCustomerInfo.phone }}</span>
</div>
<div class="cell-item">
<span class="color-999 test-tst">头像</span>
<br />
<span v-if="!sysCustomerInfo.headPhoto">暂无</span>
<el-image
v-else
style="width: 100px; height: 100px"
:src="sysCustomerInfo.headPhoto"
:preview-src-list="[sysCustomerInfo.headPhoto]"
/>
</div>
</div>
<div class="my-cell">
<div class="cell-item">
<span class="color-999 test-tst">用户昵称</span>
<br />
<span class="inner-data">{{ sysCustomerInfo.nickName }}</span>
</div>
<div class="cell-item">
<span class="color-999 test-tst">生日</span>
<br />
<span class="inner-data">{{ sysCustomerInfo.birthday }}</span>
</div>
<div class="cell-item">
<span class="color-999 test-tst">全局禁用启用</span>
<br />
<span v-if="sysCustomerInfo.globalEnable === 0" class="inner-data"
>禁用</span
>
<span v-if="sysCustomerInfo.globalEnable === 1" class="inner-data"
>启用</span
>
</div>
<div class="cell-item">
<span class="color-999 test-tst">注册日期</span>
<br />
<span class="inner-data">{{ sysCustomerInfo.registerTime }}</span>
</div>
</div>
<div class="my-cell">
<div class="cell-item">
<span class="color-999 test-tst">用户注册方式</span>
<br />
<span v-if="sysCustomerInfo.registerMode === '1'" class="inner-data"
>主动注册</span
>
<span v-if="sysCustomerInfo.registerMode === '2'" class="inner-data"
>广告宣传</span
>
<span v-if="sysCustomerInfo.registerMode === '3'" class="inner-data"
>二维码推广</span
>
<span v-if="sysCustomerInfo.registerMode === '4'" class="inner-data"
>司机推广</span
>
<span v-if="sysCustomerInfo.registerMode === '5'" class="inner-data"
>推客推广</span
>
<span v-if="sysCustomerInfo.registerMode === '6'" class="inner-data"
>系统同步</span
>
<span v-if="sysCustomerInfo.registerMode === '7'" class="inner-data"
>其他</span
>
</div>
<div class="cell-item">
<span class="color-999 test-tst">用户系统来源</span>
<br />
<span
v-if="sysCustomerInfo.userSource === 'XOIL_OMS_WEB'"
class="inner-data"
>星油运营管理系统</span
>
<span
v-if="sysCustomerInfo.userSource === 'XO_APP_AND'"
class="inner-data"
>星油androidAPP</span
>
<span
v-if="sysCustomerInfo.userSource === 'XO_APP_IOS'"
class="inner-data"
>星油IOSAPP</span
>
<span
v-if="sysCustomerInfo.userSource === 'XO_APPLET_WC'"
class="inner-data"
>星油微信小程序</span
>
<span
v-if="sysCustomerInfo.userSource === 'XK_OMS'"
class="inner-data"
>星卡互联运营管理系统</span
>
<span
v-if="sysCustomerInfo.userSource === 'XK_APP_AND'"
class="inner-data"
>星卡互联androidAPP</span
>
<span
v-if="sysCustomerInfo.userSource === 'XK_APP_IOS'"
class="inner-data"
>星卡互联IOSAPP</span
>
<span
v-if="sysCustomerInfo.userSource === 'XK_APPLET_WC'"
class="inner-data"
>星卡互联微信小程序</span
>
</div>
<div class="cell-item">
<span class="color-999 test-tst">创建人 </span>
<br />
<span class="inner-data">{{ sysCustomerInfo.createUser }}</span>
</div>
<div class="cell-item">
<span class="color-999 test-tst">创建时间</span>
<br />
<span class="inner-data">{{ sysCustomerInfo.createTime }}</span>
</div>
</div>
<div class="my-cell">
<div class="cell-item">
<span class="color-999 test-tst">修改人</span>
<br />
<span class="inner-data">{{ sysCustomerInfo.updateUser }}</span>
</div>
<div class="cell-item">
<span class="color-999 test-tst">修改时间</span>
<br />
<span class="inner-data">{{ sysCustomerInfo.updateTime }}</span>
</div>
<div class="cell-item">
<span class="color-999 test-tst">修改系统</span>
<br />
<span
v-if="sysCustomerInfo.updateSource === 'XOIL_OMS_WEB'"
class="inner-data"
>星油运营管理系统</span
>
<span
v-if="sysCustomerInfo.updateSource === 'XO_APP_AND'"
class="inner-data"
>星油androidAPP</span
>
<span
v-if="sysCustomerInfo.updateSource === 'XO_APP_IOS'"
class="inner-data"
>星油IOSAPP</span
>
<span
v-if="sysCustomerInfo.updateSource === 'XO_APPLET_WC'"
class="inner-data"
>星油微信小程序</span
>
<span
v-if="sysCustomerInfo.updateSource === 'XK_OMS'"
class="inner-data"
>星卡互联运营管理系统</span
>
<span
v-if="sysCustomerInfo.updateSource === 'XK_APP_AND'"
class="inner-data"
>星卡互联androidAPP</span
>
<span
v-if="sysCustomerInfo.updateSource === 'XK_APP_IOS'"
class="inner-data"
>星卡互联IOSAPP</span
>
<span
v-if="sysCustomerInfo.updateSource === 'XK_APPLET_WC'"
class="inner-data"
>星卡互联微信小程序</span
>
</div>
<div class="cell-item" />
</div>
</el-card>
<!-- <el-card style="margin-top: 20px">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="个人账户" name="personAccount">
<span v-if="!oilCustomerAccount">暂无</span>
<el-card v-if="oilCustomerAccount" class="box-card no-wrap">
<div class="my-cell">
<div class="cell-item">
<span class="color-999 test-tst">个人卡号</span>
<br />
<span class="color-999 test-tst">{{
oilCustomerAccount.accountCardCode
}}</span>
</div>
<div class="cell-item">
<span class="color-999 test-tst">账户状态</span>
<br />
<span
v-if="oilCustomerAccount.accountState === 1"
class="color-999 test-tst"
>启用</span
>
<span
v-if="oilCustomerAccount.accountState === 0"
class="color-999 test-tst"
>禁用</span
>
</div>
<div class="cell-item">
<span class="color-999 test-tst">账户总余额</span>
<br />
<span class="color-999 test-tst">{{
oilCustomerAccount.balance
}}</span>
</div>
<div class="cell-item">
<span class="color-999 test-tst">冻结金额</span>
<br />
<span class="color-999 test-tst">{{
oilCustomerAccount.frozenBalance
}}</span>
</div>
</div>
<div class="my-cell">
<div class="cell-item">
<span class="color-999 test-tst">账户充值余额</span>
<br />
<span class="color-999 test-tst">{{
oilCustomerAccount.rechargeBalance
}}</span>
</div>
<div class="cell-item">
<span class="color-999 test-tst">账户充值返利余额</span>
<br />
<span class="color-999 test-tst">{{
oilCustomerAccount.rechargeRebateBalance
}}</span>
</div>
<div class="cell-item">
<span class="color-999 test-tst">账户累计充值金额</span>
<br />
<span class="color-999 test-tst">{{
oilCustomerAccount.totalRechargeAmount
}}</span>
</div>
<div class="cell-item">
<span class="color-999 test-tst">账户累计充值返利金额</span>
<br />
<span class="color-999 test-tst">{{
oilCustomerAccount.totalRechargeRebateAmount
}}</span>
</div>
</div>
</el-card>
<el-divider content-position="left">交易明细</el-divider>
<el-table
:data="customerAccountDataPage.list"
fit
:max-height="tableHeight"
style="width: 100%"
:size="$store.getters.size"
>
<template v-for="(item, index) in customerAccountTableColumns">
<el-table-column
v-if="item.show"
:key="index"
:fixed="item.fixed"
:align="item.align"
:show-overflow-tooltip="true"
:min-width="item.minWidth"
:width="item.width"
:prop="item.prop"
:sortable="item.sortable"
:label="item.label"
:formatter="item.render"
/>
</template>
</el-table>
<div class="page-div">
<el-pagination
:current-page="customerAccountPage.currentPage"
:page-sizes="[10, 15, 20, 30]"
:page-size="customerAccountPage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="customerAccountPage.totalCount"
@size-change="customerAccountHandleSizeChange"
@current-change="customerAccountHandleCurrentChange"
/>
</div>
</el-tab-pane>
<el-tab-pane label="系统角色" name="systemRole">
<div style="text-align: right; padding-bottom: 10px">
<el-button @click="addJoin"> 添加关联 </el-button>
</div>
<el-table
:max-height="tableHeight"
:data="roleList"
fit
stripe
style="width: 100%"
:size="$store.getters.size"
>
<template v-for="(item, index) in roleTableColumns">
<el-table-column
v-if="item.show"
:key="index"
:fixed="item.fixed"
:align="item.align"
:show-overflow-tooltip="true"
:min-width="item.minWidth"
:width="item.width"
:prop="item.prop"
:sortable="item.sortable"
:label="item.label"
:formatter="item.render"
/>
</template>
<el-table-column fixed="right" label="操作" width="100px">
<template slot-scope="scope">
<el-button
:size="$store.getters.size"
type="text"
@click.native="toDeleteUserRole(scope.row.id)"
><svg-icon icon-class="iconlajitong" /> 删除</el-button
>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</el-card> -->
</section>
<el-dialog
v-el-drag-dialog
title="添加系统角色"
:visible.sync="userJoinRoleDialog"
width="55%"
:modal="false"
>
<SysCustomerJoinRole
v-if="userJoinRoleDialog"
:sys-customer-info="sysCustomerInfo"
@getRoleList="getRoleList"
@closeDialog="closeDialog"
/>
</el-dialog>
<!-- 添加基础信息 -->
<el-dialog
v-el-drag-dialog
destroy-on-close
title="添加"
:visible.sync="addInfoDialog"
width="55%"
:modal="false"
>
<OilCustomerInfoAdd
v-if="addInfoDialog"
:sys-customer-info="sysCustomerInfo"
@getBaseInfo="getBaseInfo"
@closeDialog="closeDialog"
/>
</el-dialog>
<!-- 修改基础信息 -->
<el-dialog
v-el-drag-dialog
destroy-on-close
title="修改"
:visible.sync="updateInfoDialog"
width="55%"
:modal="false"
>
<OilCustomerInfoUpdate
v-if="updateInfoDialog"
:oil-customer-info="oilCustomerInfo"
@getBaseInfo="getBaseInfo"
@closeDialog="closeDialog"
/>
</el-dialog>
<!-- 添加实名信息 -->
<el-dialog
v-el-drag-dialog
destroy-on-close
title="添加"
:visible.sync="addCustomerRealauthDialog"
width="55%"
:modal="false"
>
<SysCustomerRealauthAdd
v-if="addCustomerRealauthDialog"
:sys-customer-info="sysCustomerInfo"
@getCustomerRealauth="getCustomerRealauth"
@closeDialog="closeDialog"
/>
</el-dialog>
<!-- 修改实名信息 -->
<el-dialog
v-el-drag-dialog
destroy-on-close
title="修改"
:visible.sync="updateCustomerRealauthDialog"
width="55%"
:modal="false"
>
<SysCustomerRealauthUpdate
v-if="updateCustomerRealauthDialog"
:sys-customer-realauth="sysCustomerRealauth"
@getCustomerRealauth="getCustomerRealauth"
@closeDialog="closeDialog"
/>
</el-dialog>
</div>
</template>
<script>
import oilOmsRoleApi from "@/api/auth/oilOmsRole";
import SysCustomerJoinRole from "./SysCustomerJoinRole";
import sysUserRoleApi from "@/api/auth/sysUserRole";
import oilCustomerInfoApi from "@/api/user/oilCustomerInfo";
import OilCustomerInfoAdd from "../info/OilCustomerInfoAdd";
import OilCustomerInfoUpdate from "../info/OilCustomerInfoUpdate";
import oilCustomerAccountApi from "@/api/finance/oilCustomerAccount";
import oilCustomerAccountRecordApi from "@/api/finance/oilCustomerAccountRecord";
import SysCustomerRealauthAdd from "../sysCustomerRealauth/SysCustomerRealauthAdd";
import sysCustomerRealauthApi from "@/api/user/sysCustomerRealauth";
import SysCustomerRealauthUpdate from "../sysCustomerRealauth/SysCustomerRealauthUpdate";
import { mapGetters } from "vuex";
export default {
components: {
SysCustomerRealauthUpdate,
SysCustomerRealauthAdd,
SysCustomerJoinRole,
OilCustomerInfoAdd,
OilCustomerInfoUpdate,
},
props: {
sysCustomerInfo: {
type: Object,
default() {},
},
},
data() {
return {
updateCustomerRealauthDialog: false, // 修改实名认证弹窗
addCustomerRealauthDialog: false, // 添加实名认证信息弹窗
tableHeight: document.documentElement.clientHeight - 300 - 60,
customerAccountDataPage: [],
customerAccountPage: {
pageSize: 20, // 每页显示条数
currentPage: 1, // 默认页
params: {
customerId: this.sysCustomerInfo.id,
receiptResult: 1,
}, // 查询参数
sorted: {
createTime: "desc",
},
columns: [],
},
customerAccountTableColumns: [
{
prop: "businessOrderId",
minWidth: 120,
label: "业务订单号",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "nickName",
width: 80,
label: "交易人",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "createTime",
label: "创建时间",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "billType",
minWidth: 100,
sortable: "custom",
label: "交易类型",
show: true,
render: (row, column, cell) => {
if (cell === "RECHARGE") {
return "充值";
} else if (cell === "SEPARATION_OIL") {
return "分油";
} else if (cell === "TURN") {
return "圈回";
} else if (cell === "REFUND") {
return "退款";
} else if (cell === "RECHARGE_REFUND") {
return "充值退款";
} else if (cell === "REFUELLING") {
return "加油";
} else if (cell === "REFUELLING_REFUND") {
return "加油退款";
} else if (cell === "SUPPLEMENT") {
return "补单";
} else if (cell === "REVOKE") {
return "销账";
} else if (cell === "CHARGE_SALES") {
return "赊销";
} else if (cell === "CONSUME_REBATE") {
return "消费返利";
} else if (cell === "RECHARGE_REBETE") {
return "充值返利";
} else if (cell === "RECHARGE_REBETE__REFUND") {
return "充值返利退款";
}
return cell;
},
},
{
prop: "occurAmount",
label: "交易金额",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "currentBalance",
label: "当前账户余额",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "createTime",
sortable: "custom",
label: "入账时间",
show: true,
render: (row, column, cell) => {
return cell;
},
},
],
companyAccountTableColumns: [
{
prop: "name",
label: "企业名称",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "businessOrderId",
label: "业务订单号",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "billType",
label: "账单类型",
show: true,
render: (row, column, cell) => {
if (cell === "RECHARGE") {
return "充值";
} else if (cell === "SEPARATION_OIL") {
return "分油";
} else if (cell === "TURN") {
return "圈回";
} else if (cell === "REFUND") {
return "退款";
} else if (cell === "RECHARGE_REFUND") {
return "充值退款";
} else if (cell === "REFUELLING") {
return "加油";
} else if (cell === "REFUELLING_REFUND") {
return "加油退款";
} else if (cell === "SUPPLEMENT") {
return "补单";
} else if (cell === "REVOKE") {
return "销账";
} else if (cell === "CHARGE_SALES") {
return "赊销";
} else if (cell === "CONSUME_REBATE") {
return "消费返利";
} else if (cell === "RECHARGE_REBETE") {
return "充值返利";
} else if (cell === "RECHARGE_REBETE__REFUND") {
return "充值返利退款";
} else if (cell === "OIL_DONATION") {
return "赠卡";
}
return cell;
},
},
{
prop: "occurAmount",
label: "发生金额",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "currentBalance",
label: "当前账户余额",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "currentRechargeBalance",
label: "当前充值余额",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "currentChargeRechargeBalance",
label: "当前赊销余额",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "currentTotalRebateBalance",
label: "当前充值返利",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "currentConsumeRebateAmount",
label: "当前消费返利",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "currentFrozenBalance",
label: "当前冻结金额",
show: true,
render: (row, column, cell) => {
return cell;
},
},
],
oilCustomerAccount: {}, // 个人账户
oilCustomerCompanyRelation: {},
addInfoDialog: false, // 添加基础信息
updateInfoDialog: false, // 修改基础信息
oilCustomerInfo: {},
sysCustomerRealauth: {}, // 用户实名信息
activeName: "personAccount",
roleList: [],
userJoinRoleDialog: false, // 用户管理角色弹窗
gridNum: {
header: 6,
body: 18,
},
roleTableColumns: [
{
prop: "id",
sortable: "custom",
label: "ID",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "roleName",
sortable: "custom",
label: "角色名称 ",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "roleType",
sortable: "custom",
label: "角色类型",
show: true,
render: (row, column, cell) => {
return this.markData.SYS_GROUP[cell];
},
},
{
prop: "roleComment",
sortable: "custom",
label: "角色描述",
show: true,
render: (row, column, cell) => {
return cell;
},
},
{
prop: "roleRank",
sortable: "custom",
label: "角色级别",
show: true,
render: (row, column, cell) => {
if (cell === 1) {
return "管理员";
}
if (cell === 0) {
return "普通";
}
return cell;
},
},
],
};
},
computed: {
...mapGetters(["sysUserList", "markData"]),
},
created() {
this.getRoleList();
this.getBaseInfo();
// this.getOilCustomerAccount();
// this.customerAccountGetByPage();
},
methods: {
auth(auth) {
// 审核实名信息
this.sysCustomerRealauth.oilRealAuth = auth;
sysCustomerRealauthApi
.auth({
id: this.sysCustomerRealauth.id,
oilRealAuth: this.sysCustomerRealauth.oilRealAuth,
})
.then((res) => {
if (res.code === 20000) {
this.$message.success(res.msg);
this.getCustomerRealauth();
}
});
},
updateCustomerRealauth() {
// 修改实名认证信息
sysCustomerRealauthApi
.getByCustomerId(this.sysCustomerInfo.id)
.then((res) => {
this.sysCustomerRealauth = res.data;
this.updateCustomerRealauthDialog = true;
});
},
addCustomerRealauth() {
// 添加实名认证信息
this.addCustomerRealauthDialog = true;
},
getCustomerRealauth() {
// 获取实名认证信息
sysCustomerRealauthApi
.getByCustomerId(this.sysCustomerInfo.id)
.then((res) => {
this.sysCustomerRealauth = res.data;
});
},
customerAccountHandleSizeChange(val) {
this.customerAccountPage.pageSize = val;
this.customerAccountGetByPage();
},
customerAccountHandleCurrentChange(val) {
this.customerAccountPage.currentPage = val;
this.customerAccountGetByPage();
},
customerAccountGetByPage() {
// 获取个人账户充值列表
oilCustomerAccountRecordApi
.getByPage(this.customerAccountPage)
.then((res) => {
this.customerAccountDataPage = res.data;
this.customerAccountPage.totalCount =
this.customerAccountDataPage.totalCount;
this.customerAccountPage.totalPage =
this.customerAccountDataPage.totalPage;
});
},
getOilCustomerAccount() {
// 获取个人账户信息
oilCustomerAccountApi
.getByCustomerId(this.sysCustomerInfo.id)
.then((res) => {
this.oilCustomerAccount = res.data;
});
},
getBaseInfo() {
// 获取司机基础信息
console.log("getBaseInfo");
oilCustomerInfoApi
.getByCustomerId(this.sysCustomerInfo.id)
.then((res) => {
this.oilCustomerInfo = res.data;
console.log(this.oilCustomerInfo);
});
},
addBaseInfo() {
// 添加基础信息
this.addInfoDialog = true;
},
updateBaseInfo() {
// 修改基础信息
this.updateInfoDialog = true;
},
toDeleteUserRole(roleId) {
// 删除关联角色
this.$confirm("确定删除关联角色?", "提示", { type: "error" }).then(() => {
sysUserRoleApi
.deleteByUserIdAndRoleId(this.sysCustomerInfo.id, roleId)
.then((res) => {
this.$message.success(res.msg);
this.getRoleList();
});
});
},
handleClick() {
if (this.activeName === "systemRole") {
// 关联角色
this.getRoleList();
}
if (this.activeName === "personAccount") {
// 个人账户
// 查询关联列表
this.customerAccountGetByPage();
}
},
addJoin() {
this.userJoinRoleDialog = true;
},
close() {
this.$emit("closeDialog");
},
closeDialog() {
this.userJoinRoleDialog = false;
this.addInfoDialog = false;
this.updateInfoDialog = false;
this.updateJoinCompanyDialog = false;
this.addCustomerRealauthDialog = false;
this.updateCustomerRealauthDialog = false;
this.$emit("closedialogs");
},
getRoleList() {
oilOmsRoleApi.getByUserId(this.sysCustomerInfo.id).then((res) => {
this.roleList = res.data;
});
},
},
};
</script>
<style scoped>
.my-cell {
color: #666;
margin-bottom: 20px;
display: flex;
flex-direction: row;
}
.cell-item {
width: 50%;
}
/* guo' */
.color-999 {
color: #999;
font-size: 0.8rem;
padding-right: 2rem;
display: inline-block;
min-width: 5rem;
}
.test-tst {
margin-bottom: 0.4rem;
}
.table-detail-drawer >>> .el-drawer__header {
color: #222 !important;
font-size: 18px;
}
.photo-list-container {
display: flex;
flex-direction: row;
}
.photo-list-container p {
margin-right: 20px;
text-align: center;
}
.inner-data {
color: #66668c;
padding-top: 5px;
font-size: 14px;
}
</style>