个人数据

main
zsk 2 years ago
parent 6c3c60a884
commit 4fc486faf7

@ -54,6 +54,14 @@ export function updateUserApi (data) {
data
});
}
// 更新用户数据
export function updateUserStockApi (data) {
return request({
url: `/admin/user/stock/update`,
method: "put",
data
});
}
// 删除用户
export function delUserApi (data) {
return request({
@ -61,3 +69,11 @@ export function delUserApi (data) {
method: "DELETE",
});
}
// 获取股权结构列表
export function getUserMoreListApi (data) {
return request({
url: `/admin/user/stock/record/${data.userId}/${data.page}/${data.limit}`,
method: "get",
});
}

@ -9,7 +9,7 @@
</div>
<div>
<a-button type="primary" @click="openAdd" :icon="h(PlusOutlined)">新增用户</a-button>
<!-- <a-button type="primary" @click="openAdd" :icon="h(PlusOutlined)">新增用户</a-button> -->
<!-- <a-button type="" class="g_border_d g_ml_16" @click="handleToForm('add', { id: 0 })" :icon="h(DownloadOutlined)">导出模版</a-button> -->
<!--
<a-dropdown :trigger="['click']">
@ -115,30 +115,20 @@
<a-button @click="submitForm" type="primary">确定</a-button>
</template>
</a-modal> -->
<a-modal
ref="modalRef"
v-model:open="tableDetail.isShow"
title="持股详情"
width="1200px"
:bodyStyle="{
'border-radius': '4px',
}"
>
<a-modal destroyOnClose ref="modalRef" v-model:open="tableDetail.isShow" title="持股详情" width="1200px" :bodyStyle="{ 'border-radius': '4px'}">
<div class="g_pt_8 g_pb_16" style=" overflow-y: auto">
<div class="g_float_right">
<a href="http://a.matripe.com.cn/api_stock/admin/user/stock/record/download">
<a-button class="g_mr_12">
<template #icon>
<DownloadOutlined />
</template>
导出模板
</a-button>
<a-button type="primary">
<template #icon>
<PlusOutlined />
</template>
导入文件
</a-button>
</a>
<a-upload :action="baseUrl + '/admin/user/stock/record/import'" :data="{userId}" accept=".xlsx, .xls, .xlsm, .xltx, .xltm" @change="getMoreInfo">
<a-button type="primary"><PlusOutlined />导入文件</a-button>
</a-upload>
</div>
<div class="g_float_none"></div>
@ -152,7 +142,7 @@
</a-table>
</div>
<div class="g_mt_20">
<a-pagination v-model:current="tableDetail.page" v-model:page-size="tableDetail.size" :total="tableDetail.count" :pageSize="tableDetail.size" :show-total="(total) => `${total}`" @change="handleModalPage" @showSizeChange="handleModalSize" :show-quick-jumper="tableData.count < tableData.size ? false : true" :showSizeChanger="tableData.count < tableData.size ? false : true" :hideOnSinglePage="false" />
<a-pagination v-model:current="tableDetail.page" v-model:page-size="tableDetail.size" :total="tableDetail.count" :pageSize="tableDetail.size" :show-total="(total) => `${total}`" @change="handleModalDetailPage" @showSizeChange="handleModalDetailSize" :show-quick-jumper="tableDetail.count < tableDetail.size ? false : true" :showSizeChanger="tableDetail.count < tableDetail.size ? false : true" :hideOnSinglePage="false" />
</div>
</div>
<template #footer>
@ -173,10 +163,11 @@
class="g_ml_51"
>
<a-form-item label="姓名" name="name" required>
<span class="ant-form-text">{{modalInfo.form.name}}</span>
<!-- <a-input style="width: 100%" placeholder="请输入姓名" v-model:value="modalInfo.form.name" /> -->
<a-select ref="select" v-model:value="modalInfo.form.name" placeholder="请选择用户" @focus="focus" @change="handleChange">
<!-- <a-select ref="select" v-model:value="modalInfo.form.name" placeholder="请选择用户" @focus="focus" @change="handleChange">
<a-select-option v-for="item in userList" :value="item.id" :title="item.id">{{ item.name }}</a-select-option>
</a-select>
</a-select> -->
</a-form-item>
<a-form-item label="持股数" name="num" required>
<a-input style="width: 100%" placeholder="请输入持股数" v-model:value="modalInfo.form.num" />
@ -202,11 +193,12 @@
</template>
<script setup>
import request from "../../utils/request"; //
import { ref, onMounted, getCurrentInstance, h, watch } from "vue";
import { PlusOutlined, EllipsisOutlined, UploadOutlined, DownOutlined } from "@ant-design/icons-vue";
import { Modal, message } from "ant-design-vue";
import { useRouter, useRoute } from "vue-router";
import { getUserListApi, updateUserStatusApi, addUserApi, delUserApi,updateUserApi,getStockUserListApi,addStockUserApi} from "../../api/userList/userList";
import { getUserListApi, updateUserStatusApi, addUserApi, delUserApi,updateUserStockApi,getStockUserListApi,addStockUserApi, getUserMoreListApi} from "../../api/userList/userList";
import { DownloadOutlined } from "@ant-design/icons-vue";
import idCardPanel from "../components/upload/image.vue";
@ -218,7 +210,7 @@ const speed = ref(0);
const showAdd = ref(0);
const userList = ref([]);
const userId = ref(0);
let baseUrl = ref(request.userCustom);
const handleChange = value => {
console.log(`selected ${value}`);
@ -247,7 +239,8 @@ const handleViewDetail = (item) => {
//
tableDetail.value = {
page: 1,
size: 50,
size: 20,
limit: 20,
count: 0,
list: [],
speed: -1,
@ -256,6 +249,7 @@ const handleViewDetail = (item) => {
columns: [],
pagination: {},
};
userId.value = item.userId
// itemData.value = {
// userId: item.id,
@ -276,26 +270,28 @@ const getModalDetail = () => {
},
{
title: "取得方式",
key: "userName",
dataIndex: "userName",
key: "sourceFrom",
dataIndex: "sourceFrom",
ellipsis: true,
minWidth: "100px",
},
{
title: "持股主体",
key: "storeJobName",
dataIndex: "storeJobName",
key: "name",
dataIndex: "name",
width: "240px",
ellipsis: true,
},
{
title: "持股数量",
key: "time",
dataIndex: "time",
key: "num",
dataIndex: "num",
width: "200px",
ellipsis: true,
},
];
getUserMoreList();
};
@ -333,21 +329,22 @@ const submitForm = ()=>{
console.log(userList.value);
console.log(modalInfo.value.form.userId);
let obj = userList.value.find(item => item.id === modalInfo.value.form.userId)
// let obj = userList.value.find(item => item.id === modalInfo.value.form.userId)
console.log(obj);
// console.log(obj);
params = {
name:obj.name,
name:modalInfo.value.form.name,
num:modalInfo.value.form.num,
percent:modalInfo.value.form.percent,
amount:modalInfo.value.form.amount,
userId:modalInfo.value.form.userId,
id:modalInfo.value.id
}
if(modalInfo.value.id){
delete params.password;
updateUserApi(params).then((res)=>{
updateUserStockApi(params).then((res)=>{
showAdd.value = false;
message.success("修改成功");
getTable();
@ -371,9 +368,10 @@ const handleToForm = ($type, $data) => {
title:'修改个人数据',
form:{
name:$data.name,
username:$data.username,
idcard:$data.idcard,
description:$data.description,
num:$data.num,
percent:$data.percent,
amount:$data.amount,
userId:$data.userId
},
id:$data.id
}
@ -481,6 +479,9 @@ const columns = ref([
dataIndex: "percent",
width: "240px",
ellipsis: true,
customRender: (record) => {
return record.record.percent+"%";
},
},
{
@ -579,6 +580,56 @@ const handleModalSize = ($page, $size) => {
tableData.value.size = $size;
getTable();
};
/* #################### 分页器事件 #################### */
const handleModalDetailPage = ($page, $size) => {
//
console.log($page);
console.log($size);
tableDetail.value.page = $page;
getUserMoreList();
};
const handleModalDetailSize = ($page, $size) => {
// size
tableDetail.value.page = 1;
tableDetail.value.size = $size;
getUserMoreList();
};
/**
* 获取持股列表
*/
const getUserMoreList = () => {
getUserMoreListApi({ limit: tableDetail.value.limit, page: tableDetail.value.page, userId: userId.value }).then((res) => {
console.log(res);
// tableDetail.value = { ...res.data, keyword: tableData.value.keyword, page: res.data.current, limit: res.data.size };
tableDetail.value.list = res.data.records
tableDetail.value.count = res.data.total
tableDetail.value.list.forEach((item, index) => {
item.rank = index + 1;
});
// stockMoreList.value = res.data;
// stockMoreList.value.forEach((item, index) => {
// item.rank = index + 1;
// });
});
};
/**
* 上传持股文件
*/
const getMoreInfo = (info) => {
console.log(info);
if (info.file.response) {
if (info.file.response.code == 200) {
getUserMoreList();
message.success("操作成功");
}
}
};
</script>
<style lang="less">

Loading…
Cancel
Save