Changes
This commit is contained in:
parent
d568699465
commit
f69c026794
|
@ -25,7 +25,9 @@
|
|||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
"source.fixAll.eslint": "explicit"
|
||||
},
|
||||
"iconify.excludes": ["el"]
|
||||
"iconify.excludes": [
|
||||
"el"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -31,10 +31,9 @@ import remainingRouter from "./modules/remaining";
|
|||
* 如何排除文件请看:https://cn.vitejs.dev/guide/features.html#negative-patterns
|
||||
*/
|
||||
const modules: Record<string, any> = import.meta.glob(
|
||||
["./modules/**/*.ts", "!./modules/**/remaining.ts",
|
||||
["./modules/**/*.ts", // "!./modules/**/remaining.ts",
|
||||
// "!./modules/test.ts",
|
||||
// "!./modules/rateApplyManage.ts",
|
||||
|
||||
"!./modules/rateApplyManage.ts",
|
||||
"!./modules/companyDataManage.ts",
|
||||
"!./modules/rateManage.ts",
|
||||
"!./modules/companyUserManage.ts",
|
||||
|
|
|
@ -23,7 +23,9 @@ export default {
|
|||
showParent: true,
|
||||
keepAlive: true,
|
||||
icon: "edit",
|
||||
rank:10,
|
||||
mata: {
|
||||
rank: 10
|
||||
}
|
||||
}
|
||||
// children: [
|
||||
// {
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
const Layout = () => import("@/layout/index.vue");
|
||||
|
||||
export default {
|
||||
path: "/rating",
|
||||
name: "RatingManage",
|
||||
component: Layout,
|
||||
redirect: "/rating/rating",
|
||||
meta: {
|
||||
icon: "avatar",
|
||||
title: "评级管理",
|
||||
roles:[2,4]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/rating/apply",
|
||||
name: "apply",
|
||||
component: () => import("@/views/rate/companyDataManage.vue"),
|
||||
meta: {
|
||||
keepAlive:true,
|
||||
title: "评级申请",
|
||||
roles:[2,4]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/rating/manage",
|
||||
name: "manage",
|
||||
component: () => import("@/views/smebiz/rateApplyManage.vue"),
|
||||
meta: {
|
||||
keepAlive:true,
|
||||
title: "评级审核",
|
||||
roles:[2,4]
|
||||
}
|
||||
}
|
||||
]
|
||||
} as RouteConfigsTable;
|
|
@ -19,18 +19,18 @@
|
|||
></el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider style="margin: 0.6rem"/>
|
||||
<el-divider style="margin: 0.6rem" />
|
||||
<el-table class="flex-1 data-edit-table" :data="data" style="width: 100%">
|
||||
<!-- <el-table-column prop="id" label="ID" align="center" width="50" /> -->
|
||||
<el-table-column prop="id" label="申请编号" align="center"/>
|
||||
<el-table-column prop="company_name" label="企业名称" align="center"/>
|
||||
<el-table-column prop="id" label="申请编号" align="center" />
|
||||
<el-table-column prop="company_name" label="企业名称" align="center" />
|
||||
<el-table-column align="center" prop="mgr_data_state" label="数据准备">
|
||||
<template #header>
|
||||
<el-select
|
||||
clearable
|
||||
v-model="query.mgr_data_state"
|
||||
@change="getData"
|
||||
@clear="()=>query.mgr_data_state=null"
|
||||
@clear="() => (query.mgr_data_state = null)"
|
||||
size="small"
|
||||
placeholder="数据准备"
|
||||
>
|
||||
|
@ -45,9 +45,9 @@
|
|||
<template #default="scope">
|
||||
<span
|
||||
:style="{
|
||||
color: scope.row.mgr_data_state === '已就绪' ? 'green' : 'red'
|
||||
color: scope.row.mgr_data_state === '已就绪' ? 'green' : 'red',
|
||||
}"
|
||||
>{{ scope.row.mgr_data_state }}</span
|
||||
>{{ scope.row.mgr_data_state }}</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -57,7 +57,7 @@
|
|||
clearable
|
||||
v-model="query.file_data_state"
|
||||
@change="getData"
|
||||
@clear="()=>query.file_data_state=null"
|
||||
@clear="() => (query.file_data_state = null)"
|
||||
size="small"
|
||||
placeholder="文件数据"
|
||||
>
|
||||
|
@ -72,15 +72,19 @@
|
|||
<template #default="scope">
|
||||
<span
|
||||
:style="{
|
||||
color: scope.row.file_data_state === '已就绪' ? 'green' : 'red'
|
||||
color: scope.row.file_data_state === '已就绪' ? 'green' : 'red',
|
||||
}"
|
||||
>{{ scope.row.file_data_state }}</span
|
||||
>{{ scope.row.file_data_state }}</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="create_time" label="填报时间">
|
||||
<template #default="scope">
|
||||
{{ scope.row.create_time ? dayjs(scope.row.create_time).format("YYYY/MM/DD HH:mm") : scope.row.create_time }}
|
||||
{{
|
||||
scope.row.create_time
|
||||
? dayjs(scope.row.create_time).format("YYYY/MM/DD HH:mm")
|
||||
: scope.row.create_time
|
||||
}}
|
||||
<!-- {{ scope.row.create_time ? scope.row.create_time.split("T")[0] : "" }}-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -91,10 +95,11 @@
|
|||
<el-button>操作</el-button>
|
||||
</template>
|
||||
<div class="flex-c flex flex-col">
|
||||
<el-button size="small" type="primary" @click="showAddRate">新建评级</el-button>
|
||||
<el-button size="small" type="primary" @click="showAddRate">
|
||||
新建评级
|
||||
</el-button>
|
||||
</div>
|
||||
</el-popover>
|
||||
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<div class="flex flex-c">
|
||||
|
@ -102,30 +107,26 @@
|
|||
type="primary"
|
||||
size="small"
|
||||
@click="showDetailEdit(scope.row)"
|
||||
>详情
|
||||
</el-button
|
||||
>
|
||||
>详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="loadApiData(scope.row)"
|
||||
>导入
|
||||
</el-button
|
||||
>
|
||||
>导入
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="uploadFile(scope.row)"
|
||||
>文件上传
|
||||
</el-button
|
||||
>
|
||||
>文件上传
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="showDeleteConfirm(scope.row)"
|
||||
>删除
|
||||
</el-button
|
||||
>
|
||||
>删除
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -135,7 +136,7 @@
|
|||
v-model:current-page="query.page"
|
||||
v-model:page-size="query.page_size"
|
||||
@size-change="getData"
|
||||
:page-sizes="[10, 20,30,40]"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:small="false"
|
||||
layout="total,sizes,prev, pager, next"
|
||||
:total="count"
|
||||
|
@ -224,13 +225,10 @@
|
|||
class="mx-2"
|
||||
style="color: green"
|
||||
>
|
||||
<Check
|
||||
/>
|
||||
<Check />
|
||||
</el-icon>
|
||||
<el-icon v-else class="mx-2" style="color: red"
|
||||
>
|
||||
<WarningFilled
|
||||
/>
|
||||
<el-icon v-else class="mx-2" style="color: red">
|
||||
<WarningFilled />
|
||||
</el-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -255,17 +253,24 @@
|
|||
|
||||
<el-table-column label="字段值" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="tableEditable && scope.row.addNeed===true"
|
||||
class="require-item-sign"></span>
|
||||
<span
|
||||
v-if="tableEditable && scope.row.addNeed === true"
|
||||
class="require-item-sign"
|
||||
></span>
|
||||
<EditFormItem
|
||||
:column-config="scope.row"
|
||||
v-if="tableEditable"
|
||||
class="max-w-[12rem]"
|
||||
:model-value="manDataEditTemp['经营问卷'][scope.row?.key]"
|
||||
:size="'small'"
|
||||
@update:model-value="(newVal)=>manDataEditTemp['经营问卷'][scope.row?.key] = newVal"
|
||||
@update:model-value="
|
||||
(newVal) =>
|
||||
(manDataEditTemp['经营问卷'][scope.row?.key] = newVal)
|
||||
"
|
||||
></EditFormItem>
|
||||
<div v-else>{{ manDataEditTemp['经营问卷'][scope.row?.key] }}</div>
|
||||
<div v-else>
|
||||
{{ manDataEditTemp["经营问卷"][scope.row?.key] }}
|
||||
</div>
|
||||
</template>
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- {{ manDataEditTemp["问卷数据"][scope.row?.key] }}-->
|
||||
|
@ -275,13 +280,12 @@
|
|||
|
||||
<div class="flex pt-2 items-center">
|
||||
<div class="ml-auto mr-2">
|
||||
<span class="mr-1">编辑
|
||||
</span>
|
||||
<el-switch
|
||||
v-model="tableEditable"
|
||||
/>
|
||||
<span class="mr-1">编辑 </span>
|
||||
<el-switch v-model="tableEditable" />
|
||||
</div>
|
||||
<el-button size="small" type="primary" @click="saveManDataEdit">保存</el-button>
|
||||
<el-button size="small" type="primary" @click="saveManDataEdit"
|
||||
>保存</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="detailEditTab == '企业填报数据-财报'">
|
||||
|
@ -290,7 +294,11 @@
|
|||
max-height="60vh"
|
||||
:span-method="arraySpanMethod"
|
||||
style="overflow-x: hidden"
|
||||
:data="bjDataConfig.企业填报数据.财报.columns.filter(item=>item.key!=='是否审计' && item.key!=='会计事务所')"
|
||||
:data="
|
||||
bjDataConfig.企业填报数据.财报.columns.filter(
|
||||
(item) => item.key !== '是否审计' && item.key !== '会计事务所'
|
||||
)
|
||||
"
|
||||
border
|
||||
>
|
||||
<el-table-column align="center" label="科目">
|
||||
|
@ -308,25 +316,37 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="item in ['2020年','2021年','2022年']"
|
||||
v-for="item in ['2020年', '2021年', '2022年']"
|
||||
:label="item"
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
<div v-if="tableEditable">
|
||||
<span
|
||||
v-if="(bjDataConfig.企业填报数据.财报.columns.find(col=>col.key==scope.row?.key).addNeed===true)&&item=='2022年'"
|
||||
class="require-item-sign"
|
||||
></span>
|
||||
<span
|
||||
v-if="
|
||||
bjDataConfig.企业填报数据.财报.columns.find(
|
||||
(col) => col.key == scope.row?.key
|
||||
).addNeed === true && item == '2022年'
|
||||
"
|
||||
class="require-item-sign"
|
||||
></span>
|
||||
<EditFormItem
|
||||
:size="'small'"
|
||||
:column-config="scope.row"
|
||||
class="max-w-[12rem]"
|
||||
:model-value='manDataEditTemp["财务问卷"][item][scope.row?.key]'
|
||||
@update:model-value='(newVal)=>manDataEditTemp["财务问卷"][ item ][scope.row?.key] = newVal'
|
||||
:model-value="
|
||||
manDataEditTemp['财务问卷'][item][scope.row?.key]
|
||||
"
|
||||
@update:model-value="
|
||||
(newVal) =>
|
||||
(manDataEditTemp['财务问卷'][item][scope.row?.key] =
|
||||
newVal)
|
||||
"
|
||||
></EditFormItem>
|
||||
</div>
|
||||
<div v-else>{{ manDataEditTemp["财务问卷"][item][scope.row?.key] }}</div>
|
||||
<div v-else>
|
||||
{{ manDataEditTemp["财务问卷"][item][scope.row?.key] }}
|
||||
</div>
|
||||
</template>
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- {{-->
|
||||
|
@ -338,33 +358,42 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="mt-4">
|
||||
<span class=" mx-2 " v-for="item in ['是否审计','会计事务所']">
|
||||
<span class="mx-2 ">{{ item }}:</span>
|
||||
<span class="mx-2" v-for="item in ['是否审计', '会计事务所']">
|
||||
<span class="mx-2">{{ item }}:</span>
|
||||
<span v-if="tableEditable">
|
||||
<span
|
||||
v-if="bjDataConfig.企业填报数据.财报.columns.find(col=>col.key==item).addNeed===true"
|
||||
class="require-item-sign"></span>
|
||||
<EditFormItem
|
||||
:size="'small'"
|
||||
:column-config="bjDataConfig.企业填报数据.财报.columns.find(col=>col.key==item)"
|
||||
class="max-w-[12rem]"
|
||||
:model-value='manDataEditTemp["财务问卷"][item]'
|
||||
@update:model-value='(newVal)=>manDataEditTemp["财务问卷"][ item] = newVal'
|
||||
></EditFormItem>
|
||||
<span
|
||||
v-if="
|
||||
bjDataConfig.企业填报数据.财报.columns.find(
|
||||
(col) => col.key == item
|
||||
).addNeed === true
|
||||
"
|
||||
class="require-item-sign"
|
||||
></span>
|
||||
<EditFormItem
|
||||
:size="'small'"
|
||||
:column-config="
|
||||
bjDataConfig.企业填报数据.财报.columns.find(
|
||||
(col) => col.key == item
|
||||
)
|
||||
"
|
||||
class="max-w-[12rem]"
|
||||
:model-value="manDataEditTemp['财务问卷'][item]"
|
||||
@update:model-value="
|
||||
(newVal) => (manDataEditTemp['财务问卷'][item] = newVal)
|
||||
"
|
||||
></EditFormItem>
|
||||
</span>
|
||||
<span v-else>{{ manDataEditTemp["财务问卷"][item] }}</span>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<div class="flex pt-2 items-center">
|
||||
<div class="ml-auto mr-2">
|
||||
<span class="mr-1">编辑
|
||||
</span>
|
||||
<el-switch
|
||||
v-model="tableEditable"
|
||||
/>
|
||||
<span class="mr-1">编辑 </span>
|
||||
<el-switch v-model="tableEditable" />
|
||||
</div>
|
||||
<el-button size="small" type="primary" @click="saveManDataEdit">保存</el-button>
|
||||
<el-button size="small" type="primary" @click="saveManDataEdit"
|
||||
>保存</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="detailEditTab == '三方接口数据-天眼查'">
|
||||
|
@ -388,8 +417,10 @@
|
|||
v-if="tableEditable"
|
||||
:column-config="scope.row"
|
||||
class="max-w-[12rem]"
|
||||
:model-value='apiDataTemp[scope.row?.key]'
|
||||
@update:model-value='(newVal)=>apiDataTemp[scope.row?.key] = newVal'
|
||||
:model-value="apiDataTemp[scope.row?.key]"
|
||||
@update:model-value="
|
||||
(newVal) => (apiDataTemp[scope.row?.key] = newVal)
|
||||
"
|
||||
></EditFormItem>
|
||||
<div v-else>{{ apiDataTemp[scope.row?.key] }}</div>
|
||||
</template>
|
||||
|
@ -397,52 +428,76 @@
|
|||
</el-table>
|
||||
<div class="flex pt-2 items-center">
|
||||
<div class="ml-auto mr-2">
|
||||
<span class="mr-1">编辑
|
||||
</span>
|
||||
<el-switch
|
||||
v-model="tableEditable"
|
||||
/>
|
||||
<span class="mr-1">编辑 </span>
|
||||
<el-switch v-model="tableEditable" />
|
||||
</div>
|
||||
<el-button size="small" type="primary" @click="getApiData">导入</el-button>
|
||||
<el-button size="small" type="primary" @click="saveManDataEdit">保存</el-button>
|
||||
<el-button size="small" type="primary" @click="getApiData"
|
||||
>导入</el-button
|
||||
>
|
||||
<el-button size="small" type="primary" @click="saveManDataEdit"
|
||||
>保存</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog title="新建评级" v-model="addRateVisible" style="width: fit-content">
|
||||
<el-dialog
|
||||
title="新建评级"
|
||||
v-model="addRateVisible"
|
||||
style="width: fit-content"
|
||||
>
|
||||
<el-form class="mx-20 my-4">
|
||||
<el-form-item label="公司名称">
|
||||
<el-input style="max-width: 14rem" v-model="addRateTemp.company_name" placeholder="请输入公司名称"></el-input>
|
||||
<el-input
|
||||
style="max-width: 14rem"
|
||||
v-model="addRateTemp.company_name"
|
||||
placeholder="请输入公司名称"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<div class="flex">
|
||||
<el-button class="ml-auto m-2" type="primary" size="small" @click="createRate">保存</el-button>
|
||||
<el-button
|
||||
class="ml-auto m-2"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="createRate"
|
||||
>保存</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<el-dialog title="问卷上传" v-model="fileUploadDialogVisible" style="width: 26rem">
|
||||
<FileUploadMd v-model="fileUploadInfo.file_md">
|
||||
</FileUploadMd>
|
||||
<el-dialog
|
||||
title="问卷上传"
|
||||
v-model="fileUploadDialogVisible"
|
||||
style="width: 26rem"
|
||||
>
|
||||
<FileUploadMd v-model="fileUploadInfo.file_md"> </FileUploadMd>
|
||||
<div class="flex">
|
||||
<el-button class="ml-auto m-2" type="primary" size="small" @click="fileUploadSave">保存</el-button>
|
||||
<el-button
|
||||
class="ml-auto m-2"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="fileUploadSave"
|
||||
>保存</el-button
|
||||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {api} from "@/api/api";
|
||||
import {FormConfig} from "@/components/EditForm/types";
|
||||
import {BjDataConfig, RateData} from "@/types/bj";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {computed, onActivated, onMounted, ref} from "vue";
|
||||
import {Check, Search, WarningFilled} from "@element-plus/icons-vue";
|
||||
import { api } from "@/api/api";
|
||||
import { FormConfig } from "@/components/EditForm/types";
|
||||
import { BjDataConfig, RateData } from "@/types/bj";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { computed, onActivated, onMounted, ref } from "vue";
|
||||
import { Check, Search, WarningFilled } from "@element-plus/icons-vue";
|
||||
import dayjs from "dayjs";
|
||||
import EditFormItem from "@/components/EditTablePlus/EditFormItem/EditFormItem.vue"
|
||||
import EditFormItem from "@/components/EditTablePlus/EditFormItem/EditFormItem.vue";
|
||||
import FileUpload from "@/components/EditTabel/fileUpload.vue";
|
||||
import FileUploadMd from "@/components/EditTabel/fileUploadMd.vue";
|
||||
defineOptions({
|
||||
name: "companyDataManage"
|
||||
})
|
||||
name: "companyDataManage",
|
||||
});
|
||||
function objectRemoveNull(obj: Object) {
|
||||
if (!obj) {
|
||||
return {};
|
||||
|
@ -455,31 +510,31 @@ function objectRemoveNull(obj: Object) {
|
|||
return newObject;
|
||||
}
|
||||
|
||||
const fileUploadInfo = ref({id: null, file_md: ""})
|
||||
const addRateVisible = ref(false)
|
||||
const addRateTemp = ref({})
|
||||
const fileUploadInfo = ref({ id: null, file_md: "" });
|
||||
const addRateVisible = ref(false);
|
||||
const addRateTemp = ref({});
|
||||
const data = ref<RateData[]>([]);
|
||||
const count = ref(0);
|
||||
const detailEditTab = ref("企业填报数据-问卷");
|
||||
const tableEditable = ref(false)
|
||||
const tableEditable = ref(false);
|
||||
const rowTemp = ref<RateData | null>(null);
|
||||
const manDataEditTemp = ref({
|
||||
"经营问卷": {},
|
||||
"财务问卷": {
|
||||
经营问卷: {},
|
||||
财务问卷: {
|
||||
"2020年": {},
|
||||
"2021年": {},
|
||||
"2022年": {},
|
||||
资产负债表: {},
|
||||
利润表: {},
|
||||
是否审计: null,
|
||||
会计事务所: null
|
||||
}
|
||||
会计事务所: null,
|
||||
},
|
||||
});
|
||||
|
||||
const apiDataTemp = ref(null);
|
||||
const wjDataTemp = ref(null);
|
||||
const detailEditVisible = ref(false);
|
||||
const fileUploadDialogVisible = ref(false)
|
||||
const fileUploadDialogVisible = ref(false);
|
||||
const query = ref({
|
||||
file_data_state: null,
|
||||
mgr_data_state: null,
|
||||
|
@ -488,7 +543,7 @@ const query = ref({
|
|||
rate_level: null,
|
||||
company_name: null,
|
||||
page: 1,
|
||||
page_size: 20
|
||||
page_size: 20,
|
||||
});
|
||||
|
||||
const manDataEditVisible = ref(false);
|
||||
|
@ -496,23 +551,26 @@ const bjDataConfig = ref<BjDataConfig>(null);
|
|||
const modelConfigDict = ref({});
|
||||
|
||||
function exincludeNull(obj: {}) {
|
||||
const newVal = {}
|
||||
Object.keys(obj).forEach(key => {
|
||||
const newVal = {};
|
||||
Object.keys(obj).forEach((key) => {
|
||||
if (["", null, undefined].indexOf(obj[key]) === -1) {
|
||||
newVal[key] = obj[key]
|
||||
newVal[key] = obj[key];
|
||||
}
|
||||
})
|
||||
return newVal
|
||||
});
|
||||
return newVal;
|
||||
}
|
||||
|
||||
const getData = () => {
|
||||
api
|
||||
.post("/wd-smebiz/smebiz_rate/company_rate/query", exincludeNull(query.value))
|
||||
.then(res => {
|
||||
.post(
|
||||
"/wd-smebiz/smebiz_rate/company_rate/query",
|
||||
exincludeNull(query.value)
|
||||
)
|
||||
.then((res) => {
|
||||
data.value = res.data.items;
|
||||
count.value = res.data.count;
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
ElMessage.warning(e.response?.data?.detail || "获取数据错误");
|
||||
});
|
||||
|
@ -522,30 +580,29 @@ function loadApiData(row: RateData) {
|
|||
ElMessage.success("开始导入,请等待");
|
||||
api
|
||||
.post("/wd-smebiz/smebiz_rate/company_rate/load_api_data_to_db", {
|
||||
id: row.id
|
||||
id: row.id,
|
||||
})
|
||||
.then(res => {
|
||||
.then((res) => {
|
||||
ElMessage.success("导入成功");
|
||||
getData();
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
ElMessage.warning(e.response?.data?.detail || "导入错误");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getApiData() {
|
||||
ElMessage.success("开始导入,请等待");
|
||||
api
|
||||
.post("/wd-smebiz/smebiz_rate/company_rate/load_api_data", {
|
||||
id: rowTemp.value.id
|
||||
id: rowTemp.value.id,
|
||||
})
|
||||
.then(res => {
|
||||
apiDataTemp.value = res.data
|
||||
.then((res) => {
|
||||
apiDataTemp.value = res.data;
|
||||
ElMessage.success("导入成功");
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
ElMessage.warning(e.response?.data?.detail || "导入错误");
|
||||
});
|
||||
|
@ -553,67 +610,66 @@ function getApiData() {
|
|||
|
||||
function showDetailEdit(row: RateData) {
|
||||
api
|
||||
.post("/wd-smebiz/smebiz_rate/company_rate/get", {id: row.id}).then(res => {
|
||||
rowTemp.value = res.data
|
||||
if (!rowTemp.value?.man_data) {
|
||||
manDataEditTemp.value = {
|
||||
"经营问卷": {},
|
||||
"财务问卷": {
|
||||
"2020年": {},
|
||||
"2021年": {},
|
||||
"2022年": {},
|
||||
资产负债表: {},
|
||||
利润表: {},
|
||||
是否审计: null,
|
||||
会计事务所: null
|
||||
}
|
||||
};
|
||||
} else {
|
||||
manDataEditTemp.value = JSON.parse(rowTemp.value.man_data);
|
||||
}
|
||||
|
||||
// if (!rowTemp.value?.file_data) {
|
||||
// fileDataTemp.value = {};
|
||||
// } else {
|
||||
// fileDataTemp.value = JSON.parse(rowTemp.value.file_data);
|
||||
// }
|
||||
if (!rowTemp.value?.wj_data) {
|
||||
wjDataTemp.value = {};
|
||||
} else {
|
||||
wjDataTemp.value = JSON.parse(rowTemp.value.wj_data);
|
||||
}
|
||||
if (!rowTemp.value?.api_data) {
|
||||
apiDataTemp.value = {};
|
||||
} else {
|
||||
apiDataTemp.value = JSON.parse(rowTemp.value.api_data);
|
||||
}
|
||||
// console.log(JSON.parse(row.mgr_data), "mgr_data");
|
||||
tableEditable.value = false
|
||||
detailEditVisible.value = true;
|
||||
})
|
||||
.post("/wd-smebiz/smebiz_rate/company_rate/get", { id: row.id })
|
||||
.then((res) => {
|
||||
rowTemp.value = res.data;
|
||||
if (!rowTemp.value?.man_data) {
|
||||
manDataEditTemp.value = {
|
||||
经营问卷: {},
|
||||
财务问卷: {
|
||||
"2020年": {},
|
||||
"2021年": {},
|
||||
"2022年": {},
|
||||
资产负债表: {},
|
||||
利润表: {},
|
||||
是否审计: null,
|
||||
会计事务所: null,
|
||||
},
|
||||
};
|
||||
} else {
|
||||
manDataEditTemp.value = JSON.parse(rowTemp.value.man_data);
|
||||
}
|
||||
|
||||
// if (!rowTemp.value?.file_data) {
|
||||
// fileDataTemp.value = {};
|
||||
// } else {
|
||||
// fileDataTemp.value = JSON.parse(rowTemp.value.file_data);
|
||||
// }
|
||||
if (!rowTemp.value?.wj_data) {
|
||||
wjDataTemp.value = {};
|
||||
} else {
|
||||
wjDataTemp.value = JSON.parse(rowTemp.value.wj_data);
|
||||
}
|
||||
if (!rowTemp.value?.api_data) {
|
||||
apiDataTemp.value = {};
|
||||
} else {
|
||||
apiDataTemp.value = JSON.parse(rowTemp.value.api_data);
|
||||
}
|
||||
// console.log(JSON.parse(row.mgr_data), "mgr_data");
|
||||
tableEditable.value = false;
|
||||
detailEditVisible.value = true;
|
||||
});
|
||||
}
|
||||
|
||||
const arraySpanMethod = ({row, column, rowIndex, columnIndex}) => {
|
||||
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
|
||||
if (row.type == "label") {
|
||||
return [1, 3 + 1];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function saveManDataEdit() {
|
||||
api
|
||||
.post("/wd-smebiz/smebiz_rate/company_rate/update", {
|
||||
id: rowTemp.value.id,
|
||||
man_data: JSON.stringify(manDataEditTemp.value),
|
||||
api_data: JSON.stringify(apiDataTemp.value)
|
||||
api_data: JSON.stringify(apiDataTemp.value),
|
||||
})
|
||||
.then(res => {
|
||||
.then((res) => {
|
||||
ElMessage.success("保存成功");
|
||||
manDataEditVisible.value = false;
|
||||
getData();
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
ElMessage.warning(e.response?.data?.detail || "保存错误");
|
||||
});
|
||||
|
@ -623,14 +679,14 @@ function saveApiData() {
|
|||
api
|
||||
.post("/wd-smebiz/smebiz_rate/company_rate/update", {
|
||||
id: rowTemp.value.id,
|
||||
api_data: JSON.stringify(apiDataTemp.value)
|
||||
api_data: JSON.stringify(apiDataTemp.value),
|
||||
})
|
||||
.then(res => {
|
||||
.then((res) => {
|
||||
ElMessage.success("保存成功");
|
||||
manDataEditVisible.value = false;
|
||||
getData();
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
ElMessage.warning(e.response?.data?.detail || "保存错误");
|
||||
});
|
||||
|
@ -640,40 +696,40 @@ function showDeleteConfirm(row: RateData) {
|
|||
ElMessageBox.confirm("确认删除?", "Warning", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
api
|
||||
.post("/wd-smebiz/smebiz_rate/company_rate/delete", {
|
||||
id: row.id
|
||||
id: row.id,
|
||||
})
|
||||
.then(_res => {
|
||||
.then((_res) => {
|
||||
ElMessage.success("删除成功");
|
||||
getData();
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
ElMessage.warning(e);
|
||||
throw e;
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
ElMessage.warning(e)
|
||||
.catch((e) => {
|
||||
ElMessage.warning(e);
|
||||
});
|
||||
}
|
||||
|
||||
function showAddRate() {
|
||||
addRateTemp.value = {
|
||||
company_name: ""
|
||||
}
|
||||
addRateVisible.value = true
|
||||
company_name: "",
|
||||
};
|
||||
addRateVisible.value = true;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
api.get("/wd-smebiz/static/model.json").then(res => {
|
||||
api.get("/wd-smebiz/static/model.json").then((res) => {
|
||||
const data = res.data;
|
||||
bjDataConfig.value = data;
|
||||
modelConfigDict.value = {};
|
||||
bjDataConfig.value["model"]["columns"].forEach(item => {
|
||||
bjDataConfig.value["model"]["columns"].forEach((item) => {
|
||||
modelConfigDict.value[item.key] = item;
|
||||
});
|
||||
});
|
||||
|
@ -682,46 +738,53 @@ onMounted(() => {
|
|||
|
||||
function createRate() {
|
||||
if (!addRateTemp.value.company_name) {
|
||||
ElMessage.warning("请输入公司名称")
|
||||
return
|
||||
ElMessage.warning("请输入公司名称");
|
||||
return;
|
||||
}
|
||||
api.post("/wd-smebiz/smebiz_rate/company_rate/create", {company_name: addRateTemp.value.company_name}).then(res => {
|
||||
ElMessage.success("添加成功")
|
||||
addRateVisible.value = false
|
||||
getData()
|
||||
}).catch(e => {
|
||||
ElMessage.warning(e)
|
||||
})
|
||||
api
|
||||
.post("/wd-smebiz/smebiz_rate/company_rate/create", {
|
||||
company_name: addRateTemp.value.company_name,
|
||||
})
|
||||
.then((res) => {
|
||||
ElMessage.success("添加成功");
|
||||
addRateVisible.value = false;
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
ElMessage.warning(e);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function uploadFile(row) {
|
||||
fileUploadInfo.value.id = row.id
|
||||
fileUploadDialogVisible.value = true
|
||||
|
||||
fileUploadInfo.value.id = row.id;
|
||||
fileUploadDialogVisible.value = true;
|
||||
}
|
||||
|
||||
function fileUploadSave() {
|
||||
if (!fileUploadInfo.value.file_md) {
|
||||
ElMessage.warning("请上传文件")
|
||||
return
|
||||
ElMessage.warning("请上传文件");
|
||||
return;
|
||||
}
|
||||
api.post("/wd-smebiz/smebiz_rate/company_rate/upload_file", fileUploadInfo.value).then(res => {
|
||||
ElMessage.success("保存成功")
|
||||
fileUploadDialogVisible.value = false
|
||||
getData()
|
||||
}).catch(e => {
|
||||
ElMessage.warning(e)
|
||||
})
|
||||
|
||||
api
|
||||
.post(
|
||||
"/wd-smebiz/smebiz_rate/company_rate/upload_file",
|
||||
fileUploadInfo.value
|
||||
)
|
||||
.then((res) => {
|
||||
ElMessage.success("保存成功");
|
||||
fileUploadDialogVisible.value = false;
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
ElMessage.warning(e);
|
||||
});
|
||||
}
|
||||
|
||||
onActivated(() => {
|
||||
getData();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
.data-edit-table {
|
||||
width: 100%;
|
||||
border: 1px solid #ffffff24;
|
||||
|
@ -764,9 +827,8 @@ onActivated(() => {
|
|||
|
||||
.require-item-sign {
|
||||
transform: translateX(-10px) translateY(4px);
|
||||
@apply after:content-['*'] after:ml-0.5 after:text-red-500 absolute
|
||||
@apply after:content-['*'] after:ml-0.5 after:text-red-500 absolute;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style>
|
||||
.detailEditCard .el-dialog__body {
|
||||
|
|
|
@ -7,25 +7,32 @@
|
|||
height="100%"
|
||||
>
|
||||
<template #empty>
|
||||
<el-empty description="无数据"/>
|
||||
<el-empty description="无数据" />
|
||||
</template>
|
||||
<el-table-column align="center" :label="column.name||column.key"
|
||||
v-for="column in props.tableModel.columns">
|
||||
<el-table-column
|
||||
align="center"
|
||||
:label="column.name || column.key"
|
||||
v-for="column in props.tableModel.columns"
|
||||
>
|
||||
<template #header v-if="column.query">
|
||||
<query-column
|
||||
@change="getTableData"
|
||||
:ctx="query"
|
||||
:column="column"
|
||||
:model-value="getQueryValue(column,query)"
|
||||
@update:model-value="(newValue)=>setQueryValue(column,query,newValue)"
|
||||
:model-value="getQueryValue(column, query)"
|
||||
@update:model-value="
|
||||
(newValue) => setQueryValue(column, query, newValue)
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
<cell-column
|
||||
class="overflow-auto"
|
||||
:column="column"
|
||||
:model-value="getValueFromPath(column.key,row)"
|
||||
@update:model-value="(newVal)=>setValueFromPath(column.key,newVal,row)"
|
||||
:model-value="getValueFromPath(column.key, row)"
|
||||
@update:model-value="
|
||||
(newVal) => setValueFromPath(column.key, newVal, row)
|
||||
"
|
||||
:ctx="row"
|
||||
/>
|
||||
</template>
|
||||
|
@ -42,7 +49,8 @@
|
|||
class="block m-1.5"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="item.func">
|
||||
@click="item.func"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
@ -54,7 +62,7 @@
|
|||
type="primary"
|
||||
size="small"
|
||||
@click="showServeWorkPage(scope.row)"
|
||||
>作业
|
||||
>作业
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -64,7 +72,7 @@
|
|||
v-model:current-page="query.page"
|
||||
v-model:page-size="query.page_size"
|
||||
@size-change="getTableData"
|
||||
:page-sizes="[10, 20,30,40]"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:small="false"
|
||||
layout="total,sizes,prev,pager,next"
|
||||
:total="count"
|
||||
|
@ -74,19 +82,24 @@
|
|||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type {ElTable} from "element-plus";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {computed, onMounted, ref, watch,onActivated} from "vue";
|
||||
import type {TablePlusProps} from "@/wcq-components/TablePlus/types";
|
||||
import type { ElTable } from "element-plus";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { computed, onMounted, ref, watch, onActivated } from "vue";
|
||||
import type { TablePlusProps } from "@/wcq-components/TablePlus/types";
|
||||
import CellColumn from "@/wcq-components/TablePlus/components/CellColumn/index.vue";
|
||||
import QueryColumn from "@/wcq-components/TablePlus/components/QueryColumn/index.vue";
|
||||
import {useColumns} from "@/wcq-components/TablePlus/setups"
|
||||
import {getQueryValue, getValueFromPath, setQueryValue, setValueFromPath} from "@/wcq-components/TablePlus/utils";
|
||||
import {Query} from "@/wcq-components/TablePlus/api";
|
||||
import {RateServe} from "@/views/smebiz/types";
|
||||
import {useMultiTagsStoreHook} from "@/store/modules/multiTags";
|
||||
import {useRouter} from "vue-router";
|
||||
import {isEmpty} from "lodash"
|
||||
import { useColumns } from "@/wcq-components/TablePlus/setups";
|
||||
import {
|
||||
getQueryValue,
|
||||
getValueFromPath,
|
||||
setQueryValue,
|
||||
setValueFromPath,
|
||||
} from "@/wcq-components/TablePlus/utils";
|
||||
import { Query } from "@/wcq-components/TablePlus/api";
|
||||
import { RateServe } from "@/views/smebiz/types";
|
||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||
import { useRouter } from "vue-router";
|
||||
import { isEmpty } from "lodash";
|
||||
const props = ref<TablePlusProps>({
|
||||
tableModel: {
|
||||
columns: [
|
||||
|
@ -95,16 +108,16 @@ const props = ref<TablePlusProps>({
|
|||
key: "serve_id",
|
||||
type: "string",
|
||||
query: {
|
||||
type: "like"
|
||||
}
|
||||
type: "like",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "受评主体",
|
||||
key: "company.name",
|
||||
type: "string",
|
||||
query: {
|
||||
type: "like"
|
||||
}
|
||||
type: "like",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "申请时间",
|
||||
|
@ -121,34 +134,43 @@ const props = ref<TablePlusProps>({
|
|||
key: "status",
|
||||
type: "enum",
|
||||
config: {
|
||||
options: [{name: "审核中", value: "examining"}, {name: "评级中", value: "rating"}, {
|
||||
name: '已完成',
|
||||
value: "finish"
|
||||
}, {name: '已取消', value: "cancel"},]
|
||||
options: [
|
||||
{ name: "审核中", value: "examining" },
|
||||
{ name: "评级中", value: "rating" },
|
||||
{
|
||||
name: "已完成",
|
||||
value: "finish",
|
||||
},
|
||||
{ name: "已取消", value: "cancel" },
|
||||
],
|
||||
},
|
||||
query: {
|
||||
type: "in"
|
||||
}
|
||||
}
|
||||
type: "in",
|
||||
},
|
||||
},
|
||||
],
|
||||
tableName: 'rate_serve',
|
||||
url: '/wd-smebiz/rate/rate_serve',
|
||||
name: '评级申请'
|
||||
tableName: "rate_serve",
|
||||
url: "/wd-smebiz/rate/rate_serve",
|
||||
name: "评级申请",
|
||||
},
|
||||
mainElTableProps: {},
|
||||
formLabelWidth: 100
|
||||
formLabelWidth: 100,
|
||||
});
|
||||
|
||||
const showColumnKeys = ref([])
|
||||
const showColumnKeys = ref([]);
|
||||
const tableData = ref([]);
|
||||
const count = ref(0);
|
||||
const query = ref<Query>({params: [{name:"status",type:'in',value:['examining','rating']}], page: 1, page_size: 20});
|
||||
const {idKey, crudApi} = useColumns(props.value)
|
||||
const table = ref(null)
|
||||
const query = ref<Query>({
|
||||
params: [{ name: "status", type: "in", value: ["examining", "rating"] }],
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
});
|
||||
const { idKey, crudApi } = useColumns(props.value);
|
||||
const table = ref(null);
|
||||
const tableButtonConfig = computed(() => [
|
||||
{name: "更新数据", func: getTableData},
|
||||
])
|
||||
const router = useRouter()
|
||||
{ name: "更新数据", func: getTableData },
|
||||
]);
|
||||
const router = useRouter();
|
||||
// watch(
|
||||
// () => props.value.tableModel,
|
||||
// newVal => {
|
||||
|
@ -157,8 +179,8 @@ const router = useRouter()
|
|||
// {deep: true, immediate: true}
|
||||
// );
|
||||
onMounted(() => {
|
||||
getTableData()
|
||||
})
|
||||
getTableData();
|
||||
});
|
||||
|
||||
async function getTableData() {
|
||||
//todo:在获取数据时,根据模型配置需求来指定需要的数据
|
||||
|
@ -166,7 +188,7 @@ async function getTableData() {
|
|||
try {
|
||||
const res = await crudApi.value.queryCommon({
|
||||
...query.value,
|
||||
params: [...query.value.params.filter(item => !isEmpty(item.value))]
|
||||
params: [...query.value.params.filter((item) => !isEmpty(item.value))],
|
||||
});
|
||||
count.value = res.data.count;
|
||||
tableData.value = res.data.items;
|
||||
|
@ -177,20 +199,20 @@ async function getTableData() {
|
|||
}
|
||||
|
||||
const showServeWorkPage = (row: RateServe) => {
|
||||
const query = {serve_id: row.serve_id + ''}
|
||||
const query = { serve_id: row.serve_id + "" };
|
||||
useMultiTagsStoreHook().handleTags("push", {
|
||||
path: `/manage/rate_work/serve_work_page`,
|
||||
meta: {
|
||||
"title": `评级作业${row.serve_id.slice(-5)}`,
|
||||
title: `评级作业${row.serve_id.slice(-5)}`,
|
||||
},
|
||||
name: "serveWorkPage",
|
||||
query,
|
||||
});
|
||||
router.push({path: "/manage/rate_work/serve_work_page", query});
|
||||
}
|
||||
router.push({ path: "/manage/rate_work/serve_work_page", query });
|
||||
};
|
||||
onActivated(() => {
|
||||
getTableData();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<style lang="css">
|
||||
.el-popper {
|
||||
|
@ -203,5 +225,4 @@ onActivated(() => {
|
|||
border-radius: 0.5rem;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue