<template>
|
<div class="add-image-data-config" v-if="isAdd">
|
<div class="left">
|
<LeftMenus :menuItems="menuItems" @jump="jump" @backList="backList" />
|
</div>
|
<div class="right" @scroll="onScroll" ref="proFreePayment">
|
<div class="scroll_item" v-for="(item, index) in menuItems" :key="index">
|
<ModuleTitle :title="item.label" />
|
<div v-if="!!item.children && item.children.length > 0" style="background: #fff;">
|
<div class="item_set_class" v-for="(child, index) in item.children" :key="index">
|
<MenusTitle :title="child.label" />
|
<CreateForms
|
:edit="type === 'edit'"
|
v-if="child.type === 'FORMS'"
|
:screenWidth="screenWidth"
|
:ref="child.name"
|
:isShowBorder="false"
|
:isView="true"
|
:noHistory="true"
|
:formItems="child.formItems"
|
:defValues="child.defValues"
|
:formRules="child.formRules"
|
/>
|
<OtherShareHolder
|
v-if="child.name === 'otherShareholderInfo'"
|
:tableHeader="child.tableHeader"
|
:addorupdate="addorupdate"
|
:screenWidth="screenWidth"
|
/>
|
<FinanceInfo
|
v-if="child.name === 'financeInfo'"
|
:tableHeader="child.tableHeader"
|
:addorupdate="addorupdate"
|
:screenWidth="screenWidth"
|
/>
|
<HouseInfo
|
v-if="child.name === 'houseInfo'"
|
:tableHeader="child.tableHeader"
|
:addorupdate="addorupdate"
|
:screenWidth="screenWidth"
|
/>
|
<HistoryMaintainInfo
|
v-if="child.name === 'historyMaintainInfo'"
|
:tableHeader="child.tableHeader"
|
:addorupdate="addorupdate"
|
:screenWidth="screenWidth"
|
/>
|
<ContactsInfo
|
v-if="child.name === 'contactsInfo'"
|
:tableHeader="child.tableHeader"
|
:addorupdate="addorupdate"
|
:screenWidth="screenWidth"
|
/>
|
</div>
|
</div>
|
<!-- {{ item.children }}
|
<div v-if="item.children[0].type === 'TABLE'">
|
{{ item.children[0].type }}
|
</div>-->
|
<!-- <ImageDataList
|
v-if="item.name === 'IMAGEDATAFORM'"
|
ref="imgdatalistRef"
|
:edit="type === 'edit'"
|
:isView="true"
|
/>-->
|
</div>
|
<el-row class="right_opreat">
|
<el-button class="back-button" @click="backList" :disabled="subLoading">返回</el-button>
|
</el-row>
|
<el-dialog
|
custom-class="product_submit_dialog"
|
:visible.sync="commitDialogVisible"
|
width="400px"
|
center
|
>
|
<div class="messageCheck">
|
<i class="el-icon-success checkSuccess"></i>
|
<div class="tip">提交成功</div>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="enterMessages">确 定</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</div>
|
</template>
|
<script>
|
import { mapState, mapActions } from "vuex";
|
import { clientsConfigMenus } from "./config/menus.config";
|
import LeftMenus from "@/views/components/LeftMenus.vue";
|
import ModuleTitle from "@/views/components/ModuleTitle.vue";
|
import MenusTitle from "@/views/components/MenusTitle.vue";
|
import CreateForms from "@/views/components/CreateForms.vue";
|
|
import OtherShareHolder from "./tableComponent/OtherShareHolder.vue";
|
import FinanceInfo from "./tableComponent/FinanceInfo.vue";
|
import HouseInfo from "./tableComponent/HouseInfo.vue";
|
import HistoryMaintainInfo from "./tableComponent/HistoryMaintainInfo.vue";
|
import ContactsInfo from "./tableComponent/ContactsInfo.vue";
|
|
import {
|
saveDocumentCatalog,
|
qryBusinessImageConfigInfo,
|
selectFlowPhaseInfo,
|
qryEntInfoDetail,
|
qryIndInfoDetail
|
} from "@/http/api";
|
// import ImageDataList from "./components/ImageDataList.vue";
|
export default {
|
data() {
|
return {
|
screenWidth: document.documentElement.clientWidth || 1660, // 屏幕宽度
|
// menuItems: [...clientsConfigMenus(false)],
|
menuItems: [],
|
subLoading: false,
|
rowSerialno: this.$route.query.serialno || "",
|
dirno: this.$route.query.dirno || "",
|
from: this.$route.query.from || "",
|
isAdd: true,
|
optionsData: [],
|
optionsArr: ["IsInUse", "ProductCode", "ImageType", "flowModelList"],
|
addorupdate: this.$route.query.from,
|
type: this.$route.query.type || "",
|
commitDialogVisible: false,
|
customerTypeCode: ""
|
};
|
},
|
components: {
|
LeftMenus,
|
ModuleTitle,
|
MenusTitle,
|
CreateForms,
|
OtherShareHolder,
|
FinanceInfo,
|
HouseInfo,
|
HistoryMaintainInfo,
|
ContactsInfo
|
// ImageDataList
|
},
|
async created() {
|
this.init();
|
},
|
async mounted() {
|
window.addEventListener("scroll", this.onScroll);
|
window.addEventListener("resize", this.getScreenWidth);
|
this.getDetailData();
|
},
|
destroyed() {
|
window.removeEventListener("scroll", this.onScroll);
|
window.removeEventListener("resize", this.getScreenWidth);
|
},
|
deactivated() {
|
this.isAdd = false;
|
},
|
methods: {
|
// 返回列表
|
backList() {
|
const { customerTypeCode, query, tempMenuItems } = this;
|
const { operation } = query;
|
// this.menuItems[0].children[0].formItems[0].readonly = false
|
this.resetAllFrom();
|
|
this.$router.go(-1);
|
},
|
resetAllFrom() {
|
this.menuItems.forEach(child => {
|
if (child.hasOwnProperty("children")) {
|
if (Array.isArray(child.children)) {
|
if (child.children[0].type === "FORMS") {
|
child.children[0].formItems.forEach(formValues => {
|
if (formValues.type === "input") {
|
formValues.placeholder = "请输入";
|
} else {
|
formValues.placeholder = "请选择";
|
}
|
if (formValues.name === "customerId") {
|
formValues.readonly = true;
|
} else {
|
formValues.readonly = false;
|
}
|
});
|
for (let key in child.children[0].defValues) {
|
child.children[0].defValues[key] = "";
|
}
|
}
|
}
|
}
|
});
|
},
|
init() {
|
const { $route } = this;
|
const { query } = $route;
|
const { customerTypeCode, operation } = query;
|
this.customerTypeCode = customerTypeCode;
|
this.query = query;
|
this.menuItems = [
|
...clientsConfigMenus(customerTypeCode, false, operation)
|
];
|
},
|
|
async getDetailData() {
|
const { query, menuItems } = this;
|
const { customerId, operation, customerTypeCode } = query;
|
let res = null;
|
if (customerTypeCode === "01") {
|
res = await qryIndInfoDetail({ customerId });
|
} else {
|
res = await qryEntInfoDetail({ customerId });
|
}
|
const { result } = res;
|
this.menuItems.forEach(child => {
|
if (child.hasOwnProperty("children")) {
|
if (Array.isArray(child.children)) {
|
if (child.children[0].type === "FORMS") {
|
child.children[0].formItems.forEach(formValues => {
|
formValues.placeholder = "";
|
formValues.readonly = true;
|
});
|
for (let key in child.children[0].defValues) {
|
for (let keyResult in result) {
|
if (key === keyResult || keyResult.includes(key)) {
|
// console.log(keyResult, '---',result[keyResult])
|
|
child.children[0].defValues[key] = result[keyResult]
|
? result[keyResult]
|
: "--";
|
// 该字段特殊处理
|
if (key === "certType") {
|
child.children[0].defValues[key] = result["certTypeDesc"];
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
});
|
},
|
enterMessages() {},
|
// 获取信息
|
|
getScreenWidth() {
|
this.$set(this, "screenWidth", document.body.offsetWidth);
|
},
|
jump(index) {
|
const { menuItems } = this;
|
const items = document.querySelectorAll(".scroll_item");
|
items.forEach((item, i) => {
|
this.$set(this.menuItems, i, {
|
...menuItems[i],
|
isActive: index === i
|
});
|
if (index === i) {
|
items[i].scrollIntoView({
|
block: "start", // 默认跳转到顶部
|
behavior: "smooth" // 滚动的速度
|
});
|
}
|
});
|
},
|
onScroll(e) {
|
const scrollItems = document.querySelectorAll(".scroll_item");
|
const { menuItems } = this;
|
for (let i = scrollItems.length - 1; i >= 0; i--) {
|
// 判断滚动条滚动距离是否大于当前滚动项可滚动距离
|
const judge =
|
e.target.scrollingElement.scrollTop + 50 >=
|
scrollItems[i].offsetTop - scrollItems[0].offsetTop;
|
if (judge) {
|
scrollItems.forEach((item, index) => {
|
this.$set(this.menuItems, index, {
|
...menuItems[index],
|
isActive: index === i
|
});
|
});
|
break;
|
}
|
}
|
const scrollTop =
|
document.documentElement.scrollTop || document.body.scrollTop;
|
// 变量windowHeight是可视区的高度
|
const windowHeight =
|
document.documentElement.clientHeight || document.body.clientHeight;
|
// 变量scrollHeight是滚动条的总高度
|
const scrollHeight =
|
document.documentElement.scrollHeight || document.body.scrollHeight;
|
// 滚动条到底部的条件
|
if (scrollTop + windowHeight === scrollHeight) {
|
const newMenuItems = [...this.menuItems].map((item, i) => {
|
const newItem = { ...item };
|
newItem.isActive = i === this.menuItems.length - 1;
|
return newItem;
|
});
|
this.menuItems = newMenuItems;
|
}
|
}
|
}
|
};
|
</script>
|
<style lang="less">
|
.add-image-data-config {
|
.left {
|
width: 160px;
|
height: 100%;
|
position: fixed;
|
outline: 1px solid #eeeeee;
|
border-right: 1px solid #eee;
|
background: #fff;
|
z-index: 999;
|
}
|
.right {
|
position: absolute;
|
width: calc(100% - 220px);
|
padding: 20px 30px;
|
padding-bottom: 60px;
|
background: rgba(249, 249, 249, 1);
|
right: 0;
|
& .el-dialog__wrapper {
|
z-index: 2006;
|
& .product_submit_dialog {
|
& .el-dialog__footer {
|
& .dialog-footer {
|
& .el-button--default {
|
width: 120px;
|
height: 30px;
|
border-radius: 4px;
|
line-height: 2px;
|
border: 1px solid rgba(204, 204, 204, 1);
|
}
|
}
|
}
|
}
|
}
|
& .pricing_dialog {
|
width: 1000px;
|
& .el-dialog__footer {
|
& .dialog-footer {
|
& .el-button--default {
|
width: 120px;
|
height: 30px;
|
line-height: 7px;
|
border-radius: 4px;
|
border: 1px solid rgba(204, 204, 204, 1);
|
& span {
|
margin-left: -9px;
|
}
|
}
|
& .el-button--primary {
|
width: 120px;
|
height: 30px;
|
line-height: 7px;
|
background: #0081f0;
|
border-color: #0081f0;
|
border-radius: 4px;
|
margin-left: 40px;
|
}
|
}
|
}
|
}
|
& .back_dialog {
|
width: 450px;
|
& .el-dialog__body {
|
text-align: center;
|
}
|
}
|
}
|
.scroll_item {
|
min-height: 200px;
|
background: rgba(249, 249, 249, 1);
|
padding-bottom: 30px;
|
}
|
.item_set_class {
|
padding-left: 14px;
|
}
|
.right_opreat {
|
position: fixed;
|
width: 100%;
|
text-align: center;
|
line-height: 80px;
|
background: #fff;
|
z-index: 6;
|
bottom: 0;
|
& .el-button--default {
|
width: 120px;
|
height: 30px;
|
margin-left: -80px;
|
line-height: 7px;
|
border-radius: 4px;
|
border: 1px solid rgba(204, 204, 204, 1);
|
}
|
& .el-button--primary {
|
width: 120px;
|
height: 30px;
|
line-height: 7px;
|
background: #0081f0;
|
border-color: #0081f0;
|
border-radius: 4px;
|
margin-left: 40px;
|
}
|
// & .back-button {
|
// margin-right: 120px;
|
// }
|
}
|
.messageCheck {
|
display: flex;
|
flex-direction: column;
|
justify-content: center;
|
align-items: center;
|
}
|
.checkSuccess {
|
font-size: 80px;
|
color: rgb(82, 196, 26);
|
}
|
.tip {
|
margin-top: 10px;
|
font-size: 20px;
|
}
|
}
|
</style>
|