dev
dengjia 2025-07-22 09:12:03 +08:00
parent 1725def75b
commit 7f163a0e67
11 changed files with 479 additions and 24 deletions

View File

@ -0,0 +1,33 @@
<template>
<el-descriptions :column="column" border>
<template v-for="item in options" :key="item.key">
<el-descriptions-item
v-if="!item.hidden"
:label="item.label"
:span="item.span || 1"
>
<slot :name="item.key">
<template v-if="item.value">
{{ item.value }}
</template>
<template v-if="!item.value">
{{ info[item.key] }}
</template>
</slot>
</el-descriptions-item>
</template>
</el-descriptions>
</template>
<script setup>
defineOptions({
name: "AppInfoBuilder",
});
defineProps({
info: { type: Object, required: true },
options: { type: Array, required: true },
column: { type: Number, default: 2 },
});
</script>
<style scoped lang="scss"></style>

View File

@ -15,7 +15,7 @@
v-model="form.area"
:options="dictionariesList"
:props="{
value: 'dictionaryId',
value: 'name',
label: 'name',
children: 'list',
}"
@ -73,18 +73,13 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="上级平台编码" prop="superPlatformId">
<el-form-item label="上级平台编码" prop="thirdPlatformCode">
<el-input v-model="item.thirdPlatformCode"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="重大危险源编码" prop="majorHazardCode">
<el-input v-model="item.majorHazardCode">
<!-- TODO 功能待定 -->
<template #append
><el-button type="primary">添加编码</el-button></template
></el-input
>
<el-input v-model="item.majorHazardCode"> </el-input>
</el-form-item>
</el-col>
<el-col :span="12">
@ -393,16 +388,17 @@ const fnSubmitMap = () => {
form.value.address = `${form.value.longitude}-${form.value.latitude}`;
};
const checkThirdListItem = () => {
thirdList.value.forEach((item) => {
for (let i = 0; i < thirdList.value.length; i++) {
const obj = thirdList.value[i];
if (
!item.thirdPlatformId ||
!item.thirdPlatformCode ||
!item.majorHazardCode
!obj.thirdPlatformId ||
!obj.thirdPlatformCode ||
!obj.majorHazardCode
) {
ElMessage.error("上级对接平台、企业编码、重大危险源编码不能为空");
return false;
}
});
}
return true;
};
const sectorIdRef = ref("");
@ -410,10 +406,9 @@ const sectorIdRef = ref("");
const fnSubmit = debounce(
1000,
async () => {
// setBusCompanyInfoAdd();
await validate();
const ischeck = checkThirdListItem();
if (ischeck) {
const check = await checkThirdListItem();
if (check) {
const sectorName = sectorIdRef.value.getCheckedNodes();
const [province = "", city = "", county = ""] = form.value.area;
const sectorId = form.value.sectorId.join(",");

View File

@ -26,7 +26,21 @@
</el-table-column>
<el-table-column label="操作" width="240">
<template #default="{ row }">
<el-button type="primary" text link> 查看 </el-button>
<el-button
type="primary"
text
link
@click="
router.push({
path: '/database/connect_enterprises_management/info',
query: {
id: row.id,
},
})
"
>
查看
</el-button>
<el-button type="primary" text link @click="fnAddorEdit('edit', row)">
编辑
</el-button>
@ -60,6 +74,8 @@ import editDialog from "./components/editDialog.vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { translationStatus } from "@/assets/js/utils.js";
import { STATUS_LIST } from "@/assets/js/constant.js";
import { useRouter } from "vue-router";
const router = useRouter();
const corpInfoId = ref(null);
const { data: serveOptions } = await getBusServicePlatformListAll();

View File

@ -0,0 +1,123 @@
<template>
<div>
<el-divider content-position="left">企业基础信息</el-divider>
<app-info-builder :options :info>
<template #servicePlatformId>
{{ target.serviceName }}
</template>
<template #companyStatus>
{{ translationStatus(info.companyStatus, STATUS_LIST) }}
</template>
</app-info-builder>
<el-divider content-position="left">企业属性信息</el-divider>
<app-info-builder :options="propsOptions" :info> </app-info-builder>
<el-divider content-position="left">对接上级平台信息</el-divider>
<div v-for="(item, index) in thirdList" :key="index">
<app-info-builder :options="thirdListOptions" :info="item">
<template #thirdPlatformId>
{{ fnPlatformName(target.thirdList, item.thirdPlatformId) }}
</template>
</app-info-builder>
</div>
</div>
</template>
<script setup>
import { useRoute } from "vue-router";
import AppInfoBuilder from "@/components/info_builder/index.vue";
import { ref, computed } from "vue";
import {
getBusCompanyInfo,
getBusServicePlatformListAll,
} from "@/request/database.js";
import { WHETHER_LIST, STATUS_LIST } from "@/assets/js/constant.js";
import { translationStatus } from "@/assets/js/utils.js";
const route = useRoute();
const { id } = route.query;
const info = ref({});
const thirdList = ref([]);
const target = ref({});
const options = [
{ key: "companyName", label: "企业名称" },
{ key: "code", label: "统一社会信用代码" },
{ key: "area", label: "属地" },
{ key: "sectorName", label: "所属行业" },
{ key: "address", label: "经营地址" },
{ key: "companyStatus", label: "企业状态" },
{ key: "companyAddress", label: "地理位置" },
{ key: "companyContacts", label: "主要负责人" },
{ key: "companyMobile", label: "负责人电话" },
{ key: "servicePlatformId", label: "服务平台" },
];
const propsOptions = computed(() => [
{
key: "isMajorHazard",
label: "是否重大危险源企业",
value: translationStatus(info.value.isMajorHazard, WHETHER_LIST),
},
{
key: "isOpenMajorHazard",
label: "是否开启重大危险源数据推送",
value: translationStatus(info.value.isOpenMajorHazard, WHETHER_LIST),
},
{
key: "isKeyProcess",
label: "是否重点工艺企业",
value: translationStatus(info.value.isKeyProcess, WHETHER_LIST),
},
{
key: "isOpenKeyProcess",
label: "是否开启重点工艺企业数据推送",
value: translationStatus(info.value.isOpenKeyProcess, WHETHER_LIST),
},
{
key: "isSpecialInspection",
label: "是否重点专项检查企业",
value: translationStatus(info.value.isSpecialInspection, WHETHER_LIST),
},
{
key: "isOpenSpecialInspection",
label: "是否开启专项检查数据推送",
value: translationStatus(info.value.isOpenSpecialInspection, WHETHER_LIST),
},
{
key: "isDustExplosion",
label: "是否粉尘涉爆企业",
value: translationStatus(info.value.isDustExplosion, WHETHER_LIST),
},
]);
const thirdListOptions = [
{ key: "thirdPlatformId", label: "上级对接平台" },
{ key: "thirdPlatformCode", label: "上级平台编码" },
{ key: "majorHazardCode", label: "重大危险源编码" },
{ key: "accessKey", label: "密钥" },
{ key: "rsaPublicKey", label: "公钥" },
{ key: "url", label: "对接URL" },
{ key: "iv", label: "对接IV" },
{ key: "code", label: "企业CODE" },
{ key: "appid", label: "企业APPID" },
{ key: "secret", label: "企业SECRET" },
];
const fnGetData = async () => {
const { data } = await getBusCompanyInfo({ id: id });
info.value = data;
info.value.area = `${info.value.province},${info.value.city}, ${info.value.county}`;
info.value.address = `${info.value.longitude}-${info.value.latitude}`;
thirdList.value = info.value.thirdList;
const { data: servicePlatformList } = await getBusServicePlatformListAll();
target.value = servicePlatformList.find(
(item) => item.id === info.value.servicePlatformId
);
};
fnGetData();
function fnPlatformName(params, id) {
if (!params) return;
const name = params.find((item) => item.id === id);
return name.platformName;
}
</script>
<style scoped lang="scss"></style>

View File

@ -26,7 +26,21 @@
</el-table-column>
<el-table-column label="操作" width="240">
<template #default="{ row }">
<el-button type="primary" text link> 查看 </el-button>
<el-button
type="primary"
text
link
@click="
router.push({
path: '/database/serve_platform_management/info',
query: {
id: row.id,
},
})
"
>
查看
</el-button>
<el-button type="primary" text link @click="fnAddorEdit('edit', row)">
编辑
</el-button>
@ -59,6 +73,8 @@ import editDialog from "./components/editDialog.vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { translationStatus } from "@/assets/js/utils.js";
import { STATUS_LIST } from "@/assets/js/constant.js";
import { useRouter } from "vue-router";
const router = useRouter();
const corpInfoId = ref(null);
const { list, pagination, searchForm, getData, resetPagination, tableRef } =
useListData(getBusServicePlatformList);

View File

@ -0,0 +1,52 @@
<template>
<div>
<app-info-builder :options :info>
<template #thirdIdList>
{{ thirdIdListName.join(",") }}
</template>
<template #platformStatus>
{{ translationStatus(info.platformStatus, STATUS_LIST) }}
</template>
</app-info-builder>
</div>
</template>
<script setup>
import { useRoute } from "vue-router";
import AppInfoBuilder from "@/components/info_builder/index.vue";
import { ref } from "vue";
import {
getBusServicePlatform,
getBusThirdPlatformListAll,
} from "@/request/database.js";
import { STATUS_LIST } from "@/assets/js/constant.js";
import { translationStatus } from "@/assets/js/utils.js";
const route = useRoute();
const { id } = route.query;
const info = ref({});
const options = [
{ key: "serviceCompany", label: "平台服务单位" },
{ key: "serviceName", label: "平台名称" },
{ key: "serviceCode", label: "服务平台编码" },
{ key: "thirdIdList", label: "涉及对接上级平台" },
{ key: "serviceUrl", label: "平台地址" },
{ key: "platformStatus", label: "状态" },
{ key: "platformContacts", label: "负责人" },
{ key: "platformMobile", label: "联系电话" },
];
const thirdIdListName = ref([]);
const fnGetData = async () => {
const { data } = await getBusServicePlatform({ id: id });
info.value = data;
info.value.area = `${info.value.province},${info.value.city}, ${info.value.county}`;
const { data: thirdPlatformList } = await getBusThirdPlatformListAll();
info.value.thirdIdList.forEach((element) => {
const target = thirdPlatformList.find((item) => item.id === element);
thirdIdListName.value.push(target.platformName);
});
};
fnGetData();
</script>
<style scoped lang="scss"></style>

View File

@ -78,7 +78,7 @@
</template>
<script setup>
import { ref, watch } from "vue";
import { ref, watch, onMounted } from "vue";
import { debounce } from "throttle-debounce";
import { ElMessage } from "element-plus";
import {
@ -94,15 +94,25 @@ const platformName = defineModel("platformName", {
});
const props = defineProps({
corpInfoId: { type: Number, required: false },
edit: { type: Number, required: true },
resourceId: { type: String, required: false },
menuId: { type: String, required: false },
});
const form = ref({
tableName: "",
resourceId: "",
menuId: "",
resourceId: props.resourceId || "",
menuId: props.menuId || "",
});
const { list: menuList } = await getBusDataItemsMenuList();
const childMenuList = ref([]);
onMounted(() => {
if (props.resourceId)
childMenuList.value = menuList.filter(
(item) => item.menuId === props.resourceId
)[0].children;
fnFindByMenuId();
});
watch(
() => form.value.resourceId,
(val) => {
@ -111,6 +121,7 @@ watch(
)[0].children;
}
);
const list = ref([]);
const fnFindByMenuId = async () => {
if (!form.value.menuId) {
@ -119,8 +130,8 @@ const fnFindByMenuId = async () => {
const { data } = await getFindByMenuId({
thirdPlatformId: props.corpInfoId,
menuId: form.value.menuId,
edit: props.edit,
});
console.log(data, "data");
list.value = data.list;
};
const validateForm = () => {
@ -132,6 +143,9 @@ const validateForm = () => {
const fnSubmit = debounce(
1000,
async () => {
if (list.value.length === 0) {
return ElMessage.warning("对接表为空");
}
await validateForm();
const params = {
...form.value,

View File

@ -11,7 +11,7 @@
<el-cascader
v-model="form.area"
:options="dictionariesList"
:props="{ value: 'dictionaryId', label: 'name', children: 'list' }"
:props="{ value: 'name', label: 'name', children: 'list' }"
></el-cascader>
</template>
</app-form-builder>

View File

@ -0,0 +1,117 @@
<template>
<el-dialog v-model="visible" title="查看" :before-close="fnClose">
<app-form-builder ref="formRef" v-model="form" :options label-width="160px">
<template #area>
<el-cascader
v-model="form.area"
:options="dictionariesList"
:props="{ value: 'name', label: 'name', children: 'list' }"
></el-cascader>
</template>
</app-form-builder>
<el-row v-if="form.menuList && form.menuList.length > 0">
<el-col :span="12" style="padding-left: 160px">
<template v-for="(item, index) in form.menuList" :key="index">
<template
v-for="(itemChild, indexChild) in item.children"
:key="indexChild"
>
<div
style="color: #409eff; cursor: pointer"
@click="toDataItemsDialog(item, itemChild)"
>
{{ `${item.menuName}-${itemChild.menuName}` }}
</div>
</template>
</template>
</el-col>
</el-row>
</el-dialog>
</template>
<script setup>
import useForm from "@/hooks/useForm.js";
import { ref } from "vue";
import AppFormBuilder from "@/components/form_builder/index.vue";
import { getBusThirdPlatform } from "@/request/database.js";
import { getAreaListTree } from "@/request/data_dictionary.js";
import { STATUS_LIST } from "@/assets/js/constant.js";
const visible = defineModel("visible", { type: Boolean, required: true });
const props = defineProps({
corpInfoId: { type: Number, required: true },
});
const { dictionariesList } = await getAreaListTree();
const { formRef } = useForm();
const form = ref({
platformName: "",
platformCode: "",
platformLevel: "",
area: [],
url: "",
platformStatus: 1,
frequency: "",
});
const platformLevelOptions = [
{ name: "国家", id: 1 },
{ name: "省平台", id: 2 },
{ name: "市平台", id: 3 },
{ name: "县平台", id: 4 },
{ name: "园区", id: 5 },
];
const frequencyOptions = [
{ name: "实时", id: 0 },
{ name: "每日", id: 1 },
{ name: "每周", id: 2 },
{ name: "每月", id: 3 },
];
const options = [
{ key: "platformName", label: "平台名称", disabled: true },
{ key: "platformCode", label: "平台编码", disabled: true },
{
key: "platformLevel",
label: "级别",
type: "select",
valueKey: "id",
options: platformLevelOptions,
disabled: true,
},
{
key: "area",
label: "归属属地",
disabled: true,
},
{ key: "url", label: "对接地址", disabled: true },
{
key: "platformStatus",
label: "状态",
type: "radio",
options: STATUS_LIST,
disabled: true,
},
{
key: "frequency",
label: "推送频率",
type: "select",
valueKey: "id",
options: frequencyOptions,
disabled: true,
},
];
const fnGetData = async () => {
if (!props.corpInfoId) return;
const { data } = await getBusThirdPlatform({ id: props.corpInfoId });
form.value = data;
form.value.area = [form.value.province, form.value.city, form.value.county];
};
fnGetData();
const fnClose = () => {
visible.value = false;
};
const emits = defineEmits("infoToDataItem");
const toDataItemsDialog = (item, itemChild) => {
emits("infoToDataItem", { item, itemChild });
};
</script>
<style scoped lang="scss"></style>

View File

@ -34,7 +34,9 @@
<el-button type="primary" text link @click="fnDataItems(row)">
对接项维护
</el-button>
<el-button type="primary" text link> 查看 </el-button>
<el-button type="primary" text link @click="fnViewInfo(row)">
查看
</el-button>
<el-button type="primary" text link @click="fnAddorEdit('edit', row)">
编辑
</el-button>
@ -56,7 +58,16 @@
v-model:visible="dataItemVisible.visible"
:corp-info-id="corpInfoId"
:platform-name="dataItemVisible.platformName"
:edit="dataItemVisible.edit"
:resource-id="dataItemVisible.resourceId"
:menu-id="dataItemVisible.menuId"
></data-items-dialog>
<view-info-dialog
v-if="infoDialog.visible"
v-model:visible="infoDialog.visible"
:corp-info-id="corpInfoId"
@info-to-data-item="toDataItemsDialog"
></view-info-dialog>
</div>
</template>
@ -74,6 +85,7 @@ import dataItemsDialog from "./components/dataItemsDialog.vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { translationStatus } from "@/assets/js/utils.js";
import { STATUS_LIST } from "@/assets/js/constant.js";
import viewInfoDialog from "./components/infoDialog.vue";
const platformLevelOptions = [
{ name: "国家", id: 1 },
{ name: "省平台", id: 2 },
@ -121,11 +133,31 @@ const fnAddorEdit = (type, row) => {
const dataItemVisible = ref({
visible: false,
platformName: "",
edit: null,
resourceId: "",
menuId: "",
});
const fnDataItems = (row) => {
corpInfoId.value = row.id;
dataItemVisible.value.visible = true;
dataItemVisible.value.platformName = row.platformName;
dataItemVisible.value.edit = 1;
};
const infoDialog = ref({
visible: false,
platformName: "",
});
const fnViewInfo = (row) => {
infoDialog.value.visible = true;
corpInfoId.value = row.id;
infoDialog.value.platformName = row.platformName;
};
const toDataItemsDialog = (data) => {
dataItemVisible.value.visible = true;
dataItemVisible.value.platformName = infoDialog.value.platformName;
dataItemVisible.value.edit = 0;
dataItemVisible.value.resourceId = data.item.menuId;
dataItemVisible.value.menuId = data.itemChild.menuId;
};
const fnDelete = async (id) => {
await ElMessageBox.confirm("确定要删除吗?", {

View File

@ -0,0 +1,57 @@
<template>
<div>
<app-info-builder :options :info>
<template #platformLevel>
{{ translationStatus(info.platformLevel, platformLevelOptions) }}
</template>
<template #platformStatus>
{{ translationStatus(info.platformStatus, STATUS_LIST) }}
</template>
<template #frequency>
{{ translationStatus(info.frequency, frequencyOptions) }}
</template>
</app-info-builder>
</div>
</template>
<script setup>
import { useRoute } from "vue-router";
import AppInfoBuilder from "@/components/info_builder/index.vue";
import { ref } from "vue";
import { getBusThirdPlatform } from "@/request/database.js";
import { STATUS_LIST } from "@/assets/js/constant.js";
import { translationStatus } from "@/assets/js/utils.js";
const route = useRoute();
const { id } = route.query;
const info = ref({});
const platformLevelOptions = [
{ name: "国家", id: 1 },
{ name: "省平台", id: 2 },
{ name: "市平台", id: 3 },
{ name: "县平台", id: 4 },
{ name: "园区", id: 5 },
];
const frequencyOptions = [
{ name: "实时", id: 0 },
{ name: "每日", id: 1 },
{ name: "每周", id: 2 },
{ name: "每月", id: 3 },
];
const options = [
{ key: "platformName", label: "平台名称" },
{ key: "platformCode", label: "平台编码" },
{ key: "platformLevel", label: "级别" },
{ key: "area", label: "归属属地" },
{ key: "url", label: "对接地址" },
{ key: "platformStatus", label: "状态" },
{ key: "frequency", label: "推送频率" },
];
const fnGetData = async () => {
const { data } = await getBusThirdPlatform({ id: id });
info.value = data;
info.value.area = `${info.value.province},${info.value.city}, ${info.value.county}`;
};
fnGetData();
</script>
<style scoped lang="scss"></style>