zsk 2 years ago
commit 6c3c60a884

@ -0,0 +1,60 @@
import request from "../../utils/request";
import qs from "qs";
let setqs = function (data) {
return qs.stringify(data);
};
// 获取企业信息
export function getProjectInfoApi (data) {
console.log(data);
return request({
url: `/admin/company/info`,
method: "get",
});
}
// 更新企业信息
export function updateProjectInfoApi (data) {
return request({
url: `/admin/company/update`,
method: "PUT",
data,
});
}
// 导入股权结构文件
export function importStockModelApi (data) {
return request({
url: `/admin/stock/structure/import`,
method: "post",
headers: {
"Content-Type": 'multipart/form-data',
},
data: setqs(data)
});
}
// 获取股权结构列表
export function getStockInfoListApi (data) {
return request({
url: `/admin/stock/structure/list`,
method: "get",
});
}
// 获取股权结构列表
export function getStockMoreListApi (data) {
return request({
url: `/admin/stock/change/list`,
method: "get",
});
}
// 删除用户
export function delUserApi (data) {
return request({
url: `/admin/user/remove/${data}`,
method: "DELETE",
});
}

@ -11,10 +11,11 @@ const router = useRouter()
const baseURL = "http://a.matripe.com.cn/api_stock"; // 正式环境线上
const baseURL2 = "https://a.matripe.com.cn/api_stock"; // 正式环境线上
let protocol = location.protocol
let trueUrl = protocol == 'http:' ? baseURL : baseURL2
console.log(protocol);
axios.defaults.withCredentials = true; //添加这行代码
const service = axios.create({
baseURL: protocol == 'http:' ? baseURL : baseURL2, // baseURL: "/api", // url = base url + request url 正式
baseURL: trueUrl, // baseURL: "/api", // url = base url + request url 正式
withCredentials: true, // send cookies when cross-domain requests
timeout: 60000, // request timeout
crossDomain: true,
@ -102,4 +103,5 @@ service.interceptors.response.use(
console.log(error);
}
);
service.userCustom = trueUrl
export default service;

@ -4,60 +4,83 @@
<div class="g_pt_18 g_pl_24 g_pb_12 g_pr_24 g_fw_600 g_flex_row_between">
<div class="g_fw_600">基本信息</div>
<div>
<a-button type="primary" @click="editStatus = !editStatus">编辑</a-button>
<a-button type="primary" @click="editStatus = true">编辑</a-button>
</div>
</div>
<a-divider class="g_mt_0 g_mb_24" />
<div class="g_flex_row_between g_pl_24 g_pr_24">
<div>
<a-form :model="baseInfo" name="basic" autocomplete="off" @finish="submitBaseInfo" @validate="validateForm" ref="storeInfoRef" style="width: 630px">
<div class="g_flex_row_between flex_nr">
<a-form-item name="agencyName" class="g_flex_1" :rules="[{ required: false, message: '请输入企业简称' }]">
<template #label>
<div class="g_c_6">主体</div>
</template>
<div v-if="!editStatus">{{ baseInfo.agencyName || "" }}</div>
<a-input placeholder="请输入主体" v-else v-model:value="baseInfo.agencyName" class="" />
</a-form-item>
<a-form-item name="agencyName" class="g_flex_1 g_ml_32" :rules="[{ required: false, message: '请输入企业简称' }]">
<template #label>
<div class="g_c_6">当前估值</div>
</template>
<div v-if="!editStatus">{{ baseInfo.agencyName || "5000" }}</div>
<a-input placeholder="请输入当前估值" v-else v-model:value="baseInfo.agencyName" class="" />
</a-form-item>
</div>
<div class="g_flex_row_between flex_nr">
<a-form-item name="agencyName" class="g_flex_1" :rules="[{ required: false, message: '请输入企业简称' }]">
<template #label>
<div class="g_c_6">当前总股本</div>
</template>
<div v-if="!editStatus">{{ baseInfo.agencyName || "39,771.50" }}</div>
<a-input placeholder="请输入当前总股本" v-else v-model:value="baseInfo.agencyName" class="" />
</a-form-item>
<a-form-item name="agencyName" class="g_flex_1 g_ml_32" :rules="[{ required: false, message: '请输入企业简称' }]">
<template #label>
<div class="g_c_6">每股价格</div>
</template>
<div v-if="!editStatus">{{ baseInfo.agencyName || "32.21" }}</div>
<a-input placeholder="请输入每股价格" v-else v-model:value="baseInfo.agencyName" class="" />
</a-form-item>
</div>
</a-form>
<div class="g_pl_24 g_pr_24 g_fs_14 g_pb_32" style="width: 630px">
<div class="g_flex_row_start flex_nr g_mb_20 g_w_all">
<div class="g_w_400">
<span class="g_c_6">主体</span>
<span>{{ showBaseInfo.name || "-" }}</span>
</div>
<div>
<span class="g_c_6">当前估值</span>
<span>{{ showBaseInfo.appraisement || "-" }}</span>
</div>
</div>
<div class="g_flex_row_start flex_nr g_w_all">
<div class="g_w_400">
<span class="g_c_6">当前总股本</span>
<span>{{ showBaseInfo.capitalStock || "-" }}</span>
</div>
<div>
<span class="g_c_6">每股价格</span>
<span>{{ showBaseInfo.unitPrice || "-" }}</span>
</div>
</div>
</div>
</div>
<a-modal v-model:open="editStatus" title="编辑信息" width="640px" centered :destroyOnClose="true" :forceRender="true">
<div class="g_pt_30 g_pb_10">
<a-form :model="baseInfo" ref="baseInfoForm" name="basic" autocomplete="off" @finish="submitBaseInfo" @change="showInfo" @validate="validateForm" :label-col="{ style: { width: '150px' } }" lab :wrapper-col="{ span: 15 }">
<a-form-item name="name" class="" :rules="[{ required: true, message: '请输入主体' }]">
<template #label>
<div class="g_c_6">主体</div>
</template>
<a-input placeholder="请输入主体" v-model:value="baseInfo.name" class="" />
</a-form-item>
<a-form-item name="appraisement" class=" " :rules="[{ required: true, message: '请输入当前估值' }]">
<template #label>
<div class="g_c_6">当前估值</div>
</template>
<a-input placeholder="请输入当前估值" v-model:value="baseInfo.appraisement" class="" />
</a-form-item>
<a-form-item name="capitalStock" class="" :rules="[{ required: true, message: '请输入当前总股本' }]">
<template #label>
<div class="g_c_6">当前总股本</div>
</template>
<a-input placeholder="请输入当前总股本" v-model:value="baseInfo.capitalStock" class="" />
</a-form-item>
<a-form-item name="unitPrice" class=" " :rules="[{ required: true, message: '请输入每股价格' }]">
<template #label>
<div class="g_c_6">每股价格</div>
</template>
<a-input placeholder="请输入每股价格" v-model:value="baseInfo.unitPrice" class="" />
</a-form-item>
</a-form>
</div>
<template #footer>
<a-button @click="noEdit"></a-button>
<a-button @click="singleSubmit" type="primary">确定</a-button>
</template>
</a-modal>
<div class="g_bg_f g_br_4 g_mt_16">
<div class="g_pt_18 g_pl_24 g_pr_24 g_pb_12 g_flex_row_between">
<div class="g_fw_600">股权结构</div>
<div>
<a-button @click="editStatus = !editStatus"><DownloadOutlined />导出模版</a-button>
<a-button type="primary" class="g_ml_10"><PlusOutlined />导入文件</a-button>
<a href="http://a.matripe.com.cn/api_stock/admin/stock/structure/download">
<a-button> <DownloadOutlined class="" />导出模版</a-button>
</a>
<a-upload :action="baseUrl + '/admin/stock/structure/import'" accept=".xlsx, .xls, .xlsm, .xltx, .xltm" @change="getFileInfo">
<a-button type="primary" class="g_ml_10"><PlusOutlined />导入文件</a-button>
</a-upload>
</div>
</div>
<a-divider class="g_mt_0 g_mb_20" />
<div class="g_flex_row_between g_pl_24 g_pr_24 g_pb_20">
<a-table :columns="columns" :data-source="gpjgList" size="middle" @change="tableChange" :pagination="false" class="g_clear_scroll" :scroll="{ x: '500px' }">
<a-table :columns="columns" :data-source="stockInfoList" size="middle" :pagination="false" class="g_clear_scroll" :scroll="{ x: '' }">
<template #headerCell="{ column }">
<template v-if="column.key === 'name'">
<div class="g_fw_600">姓名</div>
@ -70,13 +93,17 @@
<div class="g_pt_18 g_pl_24 g_pr_24 g_pb_12 g_flex_row_between">
<div class="g_fw_600">增资扩股变化</div>
<div>
<a-button @click="editStatus = !editStatus"><DownloadOutlined />导出模版</a-button>
<a-button type="primary" class="g_ml_10"><PlusOutlined />导入文件</a-button>
<a href="http://a.matripe.com.cn/api_stock/admin/stock/change/download">
<a-button> <DownloadOutlined class="" />导出模版</a-button>
</a>
<a-upload :action="baseUrl + '/admin/stock/change/import'" accept=".xlsx, .xls, .xlsm, .xltx, .xltm" @change="getMoreInfo">
<a-button type="primary" class="g_ml_10"><PlusOutlined />导入文件</a-button>
</a-upload>
</div>
</div>
<a-divider class="g_mt_0 g_mb_20" />
<div class="g_flex_row_between g_pl_24 g_pr_24 g_pb_20">
<a-table :columns="columns1" :data-source="zzkgList" size="middle" @change="tableChange" :pagination="false" class="g_clear_scroll" :scroll="{ x: '500px' }">
<a-table :columns="columns1" :data-source="stockMoreList" size="middle" :pagination="false" class="g_clear_scroll" :scroll="{ x: '' }">
<template #headerCell="{ column }">
<template v-if="column.key === 'name'">
<div class="g_fw_600">姓名</div>
@ -90,70 +117,47 @@
</a-table>
</div>
</div>
</div>
</template>
<script setup>
import request from "../../utils/request"; //
import { DownloadOutlined, PlusOutlined } from "@ant-design/icons-vue";
import { ref, onMounted, getCurrentInstance, watch, onBeforeUnmount } from "vue";
import { message } from "ant-design-vue";
import { getProjectInfoApi, updateProjectInfoApi, importStockModelApi, getStockInfoListApi, getStockMoreListApi } from "../../api/userList/porjectInfo";
const commonJS = getCurrentInstance().appContext.app.config.globalProperties.G;
import { useRouter, useRoute } from "vue-router";
const router = useRouter(); //
const route = useRoute();
import { useStore } from "@/stores/counter";
const storeJS = useStore();
onMounted(() => {});
onMounted(() => {
getProjectInfo();
getStockInfoList();
getStockMoreList();
});
const baseInfo = ref({});
const showBaseInfo = ref({});
const baseInfoForm = ref(null);
const editStatus = ref(false);
const gpjgList = ref([
{
rank: 1,
name: "王涵光",
number: 1120448,
precent: "32.43%",
},
{
rank: 2,
name: "王涵光",
number: 1120448,
precent: "32.43%",
},
{
rank: 3,
name: "王涵光",
number: 1120448,
precent: "32.43%",
},
]);
const zzkgList = ref([
{
rank: 1,
name: "初始团队",
number: 1120448,
cost: "100万",
stockCost: "100万",
moreMoney: "200万",
},
{
rank: 2,
name: "初始团队",
number: 1120448,
cost: "100万",
stockCost: "100万",
moreMoney: "200万",
},
{
rank: 3,
name: "初始团队",
number: 1120448,
cost: "100万",
stockCost: "100万",
moreMoney: "200万",
},
]);
const submitBaseInfo = () => {};
const validateForm = () => {};
const stockInfoList = ref([]);
const stockMoreList = ref([]);
const submitBaseInfo = (e) => {
console.log(e);
};
const validateForm = (e) => {
console.log(e);
console.log(showBaseInfo.value);
};
const noEdit = (e) => {
editStatus.value = false;
baseInfo.value = JSON.parse(JSON.stringify(showBaseInfo.value));
};
let columns = ref([
{
title: "序号",
@ -174,21 +178,22 @@ let columns = ref([
{
title: "股数",
key: "number",
dataIndex: "number",
key: "num",
dataIndex: "num",
width: "300px",
// minWidth: 100,
ellipsis: true,
},
{
title: "百分比",
key: "precent",
dataIndex: "precent",
key: "percent",
dataIndex: "percent",
width: "300px",
// minWidth: 100,
ellipsis: true,
},
]);
let columns1 = ref([
{
title: "序号",
@ -204,50 +209,152 @@ let columns1 = ref([
dataIndex: "name",
// width: "220px",
ellipsis: true,
customRender: (record) => {
return record.record.name || "-";
},
fixed: "left",
},
{
title: "股本数",
key: "number",
dataIndex: "number",
key: "capitalStock",
dataIndex: "capitalStock",
width: "100px",
customRender: (record) => {
return record.record.capitalStock || "-";
},
// minWidth: 100,
ellipsis: true,
},
{
title: "估值",
key: "cost",
dataIndex: "cost",
key: "appraisement",
dataIndex: "appraisement",
width: "100px",
customRender: (record) => {
return record.record.appraisement || "-";
},
// minWidth: 100,
ellipsis: true,
},
{
title: "股价",
key: "stockCost",
dataIndex: "stockCost",
key: "price",
dataIndex: "price",
width: "100px",
// minWidth: 100,
customRender: (record) => {
return record.record.price || "-";
},
ellipsis: true,
},
{
title: "增资金额",
key: "moreMoney",
dataIndex: "moreMoney",
key: "additionalShare",
dataIndex: "additionalShare",
width: "100px",
customRender: (record) => {
return record.record.additionalShare || "-";
},
// minWidth: 100,
ellipsis: true,
},
{
title: "操作",
key: "state",
dataIndex: "state",
width: "60px",
// minWidth: 100,
ellipsis: true,
},
// {
// title: "",
// key: "state",
// dataIndex: "state",
// width: "60px",
// // minWidth: 100,
// ellipsis: true,
// },
]);
/**
* 获取股权结构列表
*/
const getStockInfoList = () => {
getStockInfoListApi().then((res) => {
console.log(res);
stockInfoList.value = res.data;
stockInfoList.value.forEach((item, index) => {
item.rank = index + 1;
});
});
};
/**
* 获取增资扩股列表
*/
const getStockMoreList = () => {
getStockMoreListApi().then((res) => {
console.log(res);
stockMoreList.value = res.data;
stockMoreList.value.forEach((item, index) => {
item.rank = index + 1;
});
});
};
const getProjectInfo = () => {
getProjectInfoApi().then((res) => {
console.log(res);
showBaseInfo.value = JSON.parse(JSON.stringify(res.data));
baseInfo.value = res.data;
});
};
const showInfo = (e) => {
console.log(e);
};
/**
* 表单提交事件
*/
const singleSubmit = () => {
baseInfoForm.value
.validate()
.then((value) => {
// console.log(value);
value.id = showBaseInfo.value.id;
updateProjectInfoApi(value).then((res) => {
// console.log(res);
message.success("修改成功");
editStatus.value = false;
getProjectInfo();
});
})
.catch((err) => {
console.log(err);
});
};
// excel
let stockList = ref([]);
let baseUrl = ref(request.userCustom);
/**
* 上传股权结构文件
*/
const getFileInfo = (info) => {
console.log(info);
if (info.file.response) {
if (info.file.response.code == 200) {
getStockInfoList();
message.success("导入成功");
}
}
};
/**
* 上传增资扩股文件
*/
const getMoreInfo = (info) => {
console.log(info);
if (info.file.response) {
if (info.file.response.code == 200) {
getStockMoreList();
message.success("导入成功");
}
}
};
</script>
<style lang="less" scoped></style>
<style lang="less" scoped>
/deep/ .ant-upload-list-text {
display: none !important;
}
</style>

Loading…
Cancel
Save