修复选择企业回显记忆性问题

xuhongjie
许宏杰 2 months ago
parent f7cc4264be
commit 46c4dc6c39

@ -1,21 +1,21 @@
import request from "@/utils/request" import request from "@/utils/request";
// 分页查询企业基础信息 // 分页查询企业基础信息
export function getEnterList(params) { export function getEnterList(params) {
return request({ return request({
url: "/system/enterpriseBasicInfo/list", url: "/system/enterpriseBasicInfo/list",
method: "get", method: "get",
params params,
}) });
} }
// 新增企业基础信息 // 新增企业基础信息
export function enterpriseBasicInfoNew(data) { export function enterpriseBasicInfoNew(data) {
return request({ return request({
url: "/system/enterpriseBasicInfo", url: "/system/enterpriseBasicInfo",
method: "post", method: "post",
data data,
}) });
} }
// 修改企业基础信息 // 修改企业基础信息
@ -23,8 +23,8 @@ export function enterpriseBasicInfoChange(data) {
return request({ return request({
url: "/system/enterpriseBasicInfo/edit", url: "/system/enterpriseBasicInfo/edit",
method: "post", method: "post",
data data,
}) });
} }
// 根据主键查询企业基础信息 // 根据主键查询企业基础信息
@ -32,7 +32,7 @@ export function enterpriseBasicInfoId(id) {
return request({ return request({
url: "/system/enterpriseBasicInfo/" + id, url: "/system/enterpriseBasicInfo/" + id,
method: "get", method: "get",
}) });
} }
// 删除企业基础信息 // 删除企业基础信息
@ -40,8 +40,8 @@ export function enterpriseBasicInfoDel(params) {
return request({ return request({
url: "/system/enterpriseBasicInfo" + id, url: "/system/enterpriseBasicInfo" + id,
method: "post", method: "post",
params params,
}) });
} }
// 分页查询联络人列表 // 分页查询联络人列表
@ -49,6 +49,13 @@ export function getjContacts(params) {
return request({ return request({
url: "/jjh/jContacts", url: "/jjh/jContacts",
method: "get", method: "get",
params params,
}) });
}
export function getenterpriseByName(data) {
return request({
url: "/system/templateRecord/searchEntCodeToInfo",
method: "post",
data,
});
} }

@ -216,7 +216,10 @@ section::-webkit-scrollbar {
// display: none; // display: none;
// } // }
// //
.honor-dialog,.collectDialog-dialog,.headquarterEnterprise-dialog,.serviceIndustry-dialog { .honor-dialog,
.collectDialog-dialog,
.headquarterEnterprise-dialog,
.serviceIndustry-dialog {
section { section {
div::-webkit-scrollbar { div::-webkit-scrollbar {
display: block; display: block;
@ -226,11 +229,11 @@ section::-webkit-scrollbar {
width: 6px; width: 6px;
height: 6px; height: 6px;
} }
.el-table::-webkit-scrollbar-track { .el-table::-webkit-scrollbar-track {
background-color: #f1f1f1; background-color: #f1f1f1;
} }
.el-table::-webkit-scrollbar-thumb { .el-table::-webkit-scrollbar-thumb {
background-color: #c0c0c0; background-color: #c0c0c0;
border-radius: 3px; border-radius: 3px;
@ -314,7 +317,7 @@ section::-webkit-scrollbar {
box-shadow: 0 0 10px #ccc; box-shadow: 0 0 10px #ccc;
z-index: 2; z-index: 2;
} }
.out_drop_style { .out_drop_style {
position: absolute; position: absolute;
width: 6px; width: 6px;
@ -387,7 +390,7 @@ section::-webkit-scrollbar {
right: 20px; right: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
.approval_img { .approval_img {
width: 85px; width: 85px;
height: 80px; height: 80px;
@ -402,3 +405,7 @@ section::-webkit-scrollbar {
} }
} }
} }
.tablecell .el-checkbox__label {
display: none !important;
}

@ -1,91 +1,111 @@
<template> <template>
<div class="L-public-main" id="L-size-main"> <el-dialog
<div class="L-main" style="padding: 0"> title="企业自选列表"
<header id="L-header"> :visible.sync="activeEnterpriseView"
<el-form width="1200px"
:inline="true" append-to-body
:model="formInline" destroy-on-close
size="small" :close-on-click-modal="false"
class="demo-form-inline" >
ref="queryFrom" <div class="L-public-main" id="L-size-main">
> <div class="L-main" style="padding: 0">
<el-col :span="20"> <header id="L-header">
<el-form-item label="企业名称:" prop="qymc"> <el-form
<el-input :inline="true"
v-model.trim="formInline.qymc" :model="formInline"
placeholder="请输入内容" size="small"
></el-input> class="demo-form-inline"
</el-form-item> ref="queryFrom"
<el-form-item label="企业规模:" prop="type"> >
<el-select <el-col :span="20">
class="ignoreElement" <el-form-item label="企业名称:" prop="qymc">
v-model="formInline.type" <el-input
placeholder="请选择" v-model.trim="formInline.qymc"
> placeholder="请输入内容"
<el-option label="全部" value=""> </el-option> ></el-input>
<el-option label="规上服务业" value="1"> </el-option> </el-form-item>
<el-option label="规上工业" value="3"> </el-option> <el-form-item label="企业规模:" prop="type">
<el-option label="总部企业" value="4"> </el-option> <el-select
<el-option label="生产性服务业" value="5"> </el-option> class="ignoreElement"
<el-option label="限上批零住餐" value="6"> </el-option> v-model="formInline.type"
<el-option label="生活性服务业" value="7"> </el-option> placeholder="请选择"
<el-option label="其他" value="2"> </el-option> >
</el-select> <el-option label="全部" value=""> </el-option>
</el-form-item> <el-option label="规上服务业" value="1"> </el-option>
<el-option label="规上工业" value="3"> </el-option>
<el-option label="总部企业" value="4"> </el-option>
<el-option label="生产性服务业" value="5"> </el-option>
<el-option label="限上批零住餐" value="6"> </el-option>
<el-option label="生活性服务业" value="7"> </el-option>
<el-option label="其他" value="2"> </el-option>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button size="mini" @click="resetQuery('queryFrom')" <el-button size="mini" @click="resetQuery('queryFrom')"
>重置</el-button >重置</el-button
> >
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
@click="handleQuery('queryFrom')" @click="handleQuery('queryFrom')"
>查询</el-button >查询</el-button
> >
</el-form-item> <el-button size="mini" type="primary" @click="ConfirmSelct()"
</el-col> >确定勾选</el-button
</el-form> >
</header> </el-form-item>
<section> </el-col>
<el-table </el-form>
ref="multipleTable" </header>
v-loading="loading" <section>
:data="tableData" <!-- @selection-change="handleSelectionChange"
:row-class-name="tableRowClassName" row-key="tyshxydm" -->
:height="tabHeader" <el-checkbox-group v-model="selectList" @change="CheckboxChange">
:max-height="tabHeader" <el-table
@selection-change="handleSelectionChange" ref="multipleTable"
> v-loading="loading"
<el-table-column type="selection" align="center" width="50" /> :data="tableData"
<el-table-column label="企业名称" prop="qymc" /> :row-class-name="tableRowClassName"
<el-table-column label="统一社会信用代码" prop="tyshxydm" /> :height="tabHeader"
<!-- <el-table-column label="法定代表人" prop="policyLevel" /> :max-height="tabHeader"
cell-class-name="tablecell"
>
<el-table-column width="45" center>
<template slot-scope="scope">
<el-checkbox :label="scope.row.tyshxydm"> </el-checkbox>
</template>
</el-table-column>
<el-table-column label="企业名称" prop="qymc" />
<el-table-column label="统一社会信用代码" prop="tyshxydm" />
<!-- <el-table-column label="法定代表人" prop="policyLevel" />
<el-table-column label="经营状态" prop="enterTime" /> <el-table-column label="经营状态" prop="enterTime" />
<el-table-column label="成立日期" prop="createBy" /> <el-table-column label="成立日期" prop="createBy" />
<el-table-column label="注册资本" prop="createTime" /> --> <el-table-column label="注册资本" prop="createTime" /> -->
<!-- <el-table-column label="经济类型" prop="jjlxmc" /> --> <!-- <el-table-column label="经济类型" prop="jjlxmc" /> -->
<!-- <el-table-column label="登记注册统计类别" prop="statisticalCategories" /> --> <!-- <el-table-column label="登记注册统计类别" prop="statisticalCategories" /> -->
<el-table-column label="企业类型" prop="qylxmc" /> <el-table-column label="企业类型" prop="qylxmc" />
<!-- <el-table-column label="行业名称" prop="hymc" /> --> <!-- <el-table-column label="行业名称" prop="hymc" /> -->
<el-table-column label="成立日期" prop="clrq" width="200"> <el-table-column label="成立日期" prop="clrq" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.clrq, "{y}-{m}-{d}") }}</span> <span>{{ parseTime(scope.row.clrq, "{y}-{m}-{d}") }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<my-pagination </el-checkbox-group>
id="L-pagination" <my-pagination
:total="total" id="L-pagination"
:page="pagination.current" :total="total"
:limit="pagination.size" :page="pagination.current"
@pagination="getPagination" :limit="pagination.size"
:current-page.sync="pagination.current" @pagination="getPagination"
></my-pagination> :current-page.sync="pagination.current"
</section> ></my-pagination>
</section>
</div>
</div> </div>
</div> </el-dialog>
</template> </template>
<script> <script>
import myPagination from "@/views/components/Pagination/index.vue"; import myPagination from "@/views/components/Pagination/index.vue";
@ -96,8 +116,10 @@ import {
enterpriseBasicInfoChange, enterpriseBasicInfoChange,
enterpriseBasicInfoId, enterpriseBasicInfoId,
enterpriseBasicInfoDel, enterpriseBasicInfoDel,
getenterpriseByName,
} from "@/api/jin_ji_hu/enterList"; } from "@/api/jin_ji_hu/enterList";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { Checkbox } from "element-ui";
export default { export default {
components: { myPagination }, components: { myPagination },
dicts: ["jjh_project_type"], dicts: ["jjh_project_type"],
@ -106,6 +128,7 @@ export default {
}, },
data() { data() {
return { return {
activeEnterpriseView: false,
rowList: [], rowList: [],
userType: this.$store.state.user.userType, userType: this.$store.state.user.userType,
roles: this.$store.state.user.roles, roles: this.$store.state.user.roles,
@ -167,14 +190,15 @@ export default {
uploadList: [], uploadList: [],
// //
exportLoading: false, exportLoading: false,
selectList: [],
}; };
}, },
watch: { watch: {
value: { value: {
handler(val) { handler(val) {
console.log("监听", val.length);
if (val) { if (val) {
this.rowList = val; this.selectList = val.map((it) => it.creditCode);
console.log("监听", this.selectList.length);
} }
}, },
deep: true, deep: true,
@ -188,57 +212,22 @@ export default {
this.formInline.qymc = this.$route.params.enterpriseName; this.formInline.qymc = this.$route.params.enterpriseName;
this.pagination = { ...this.pagination, ...this.formInline }; this.pagination = { ...this.pagination, ...this.formInline };
} }
this.getList();
}, },
destroyed() { destroyed() {
window.removeEventListener("resize", this.cancalDebounce); window.removeEventListener("resize", this.cancalDebounce);
}, },
methods: { methods: {
// // showDialog() {
toggleSelection() { this.getList();
if (this.rowList.length > 0) { this.activeEnterpriseView = true;
this.rowList.map((row) => {
const newItem = this.tableData.filter(
(item) => item.tyshxydm == row.creditCode
);
if (newItem.length > 0) {
this.$refs.multipleTable.toggleRowSelection(newItem[0]);
}
});
} else {
this.$refs.multipleTable.clearSelection();
}
}, },
// /** async ConfirmSelct() {
// * let res = await getenterpriseByName(this.selectList);
// */ this.$emit("input", res.data);
handleSelectionChange(val) { this.activeEnterpriseView = false;
const combinedArray = [ },
...val, CheckboxChange() {
...this.rowList.map((item) => ({ console.log(this.selectList);
qymc: item.enterpriseName,
tyshxydm: item.creditCode,
})),
];
const uniqueArray = Array.from(
combinedArray
.reduce((map, item) => {
if (!map.has(item.tyshxydm)) {
map.set(item.tyshxydm, item);
}
return map;
}, new Map())
.values()
);
const list = uniqueArray.map((item) => {
return {
enterpriseName: item.qymc,
creditCode: item.tyshxydm,
};
});
this.$emit("input", list);
}, },
// //
getList() { getList() {
@ -247,12 +236,9 @@ export default {
this.loading = false; this.loading = false;
this.total = res.data.total; this.total = res.data.total;
this.tableData = res.data.records; this.tableData = res.data.records;
this.$nextTick(() => {
this.toggleSelection();
});
}); });
}, },
// //
getPagination(pages) { getPagination(pages) {
this.pagination.current = pages.page; this.pagination.current = pages.page;
@ -375,7 +361,7 @@ export default {
// //
handleDelete(index) { handleDelete(index) {
this.fileList.splice(index, 1); this.fileList.splice(index, 1);
this.$emit("input", this.listToString(this.fileList)); // this.$emit("input", this.listToString(this.fileList));
}, },
// //
getFileName(name) { getFileName(name) {
@ -416,3 +402,5 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss" scoped></style>

@ -410,7 +410,7 @@
<el-col :span="24" v-if="form.isFrame == 2"> <el-col :span="24" v-if="form.isFrame == 2">
<el-form-item label="已选企业" prop="enterpriseDirectoryList"> <el-form-item label="已选企业" prop="enterpriseDirectoryList">
<div class="active-enterprise"> <div class="active-enterprise">
<div class="enterprise-name"> <div class="enterprise-name" @click="lookentErprise()">
<div <div
v-if=" v-if="
form.enterpriseDirectoryList && form.enterpriseDirectoryList &&
@ -498,6 +498,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="短信内容" prop="smsInfo"> <el-form-item label="短信内容" prop="smsInfo">
<el-input <el-input
:disabled="isReplace"
v-model="form.smsInfo" v-model="form.smsInfo"
type="textarea" type="textarea"
placeholder="请输入短信内容" placeholder="请输入短信内容"
@ -559,15 +560,10 @@
</el-dialog> </el-dialog>
<!-- 企业自选弹出层 --> <!-- 企业自选弹出层 -->
<el-dialog <activeEnterpriseList
title="企业自选列表" ref="activeEnterpriseList"
:visible.sync="activeEnterpriseView" v-model="form.enterpriseDirectoryList"
width="1200px" />
append-to-body
:close-on-click-modal="false"
>
<activeEnterpriseList v-model="form.enterpriseDirectoryList" />
</el-dialog>
</div> </div>
</template> </template>
@ -741,6 +737,12 @@ export default {
this.getTemplateList(); this.getTemplateList();
}, },
methods: { methods: {
//
lookentErprise() {
this.viewVisible = true;
this.businessList = this.form.enterpriseDirectoryList;
},
/** /**
* 企业名录维护方式变化 * 企业名录维护方式变化
*/ */
@ -752,7 +754,7 @@ export default {
* 打开企业自选列表 * 打开企业自选列表
*/ */
handlerEnterpriseOption() { handlerEnterpriseOption() {
this.activeEnterpriseView = true; this.$refs.activeEnterpriseList.showDialog();
}, },
getDataList() { getDataList() {

Loading…
Cancel
Save