suzhouyingjiPC/src/views/components/dialog/index.vue

690 lines
19 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<el-dialog
:visible.sync="dialogVisible"
:show-close="false"
:destroy-on-close="true"
:close-on-click-modal="false"
append-to-body
custom-class="dialog-boxed"
width="70%"
>
<div class="dialog-slot">
<div class="closeClick">
<div class="newplan">
<div class="line"></div>
<div class="span">新增计划</div>
</div>
<img src="@/assets/images/close.png" alt="" @click="Close" />
</div>
<div class="content">
<div class="module">
<div class="select" :class="nextStep ? '' : 'nextStepSelect'">
<span class="span-one"></span>
<span>选择企业</span>
</div>
<div class="issue" :class="nextStep ? 'nextStepIssue' : ''">
<span class="span-one"></span>
<span>发布计划</span>
</div>
</div>
<div v-if="!nextStep">
<div class="filtrate">
<div class="select-input">
<div class="select-span">行政区划:</div>
<el-cascader
v-model="form.compartment"
:options="compartment"
:show-all-levels="false"
:props="{
value: 'subdistrict', //匹配响应数据中的id
label: 'institutionName', //匹配响应数据中的name
children: 'children',
}"
></el-cascader>
</div>
<div class="select-input">
<div class="select-span">企业类型:</div>
<el-select v-model="form.frimType" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<div class="select-input">
<div class="select-span">经济类型:</div>
<el-cascader
v-model="form.economicsType"
:options="zhEconomicType"
:show-all-levels="false"
></el-cascader>
</div>
<div class="select-input">
<div class="select-span">行业类型:</div>
<el-select v-model="form.industryType" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<div class="select-input">
<div class="select-span">重大危险源等级:</div>
<el-select v-model="form.riskGrade" placeholder="请选择">
<el-option
v-for="item in otherDict.major_hazard_level"
:key="item.dictLabel"
:label="item.dictLabel"
:value="item.dictValue"
>
</el-option>
</el-select>
</div>
<div class="select-input">
<div class="select-span">企业分色:</div>
<el-select v-model="form.frimColor" placeholder="请选择">
<el-option
v-for="item in otherDict.entpr_color"
:key="item.dictLabel"
:label="item.dictLabel"
:value="item.dictValue"
>
</el-option>
</el-select>
</div>
<div class="input-input">
<el-input
v-model="form.frimName"
placeholder="请输入企业名称/统一信用代码"
></el-input>
</div>
<div class="select-btn">搜索</div>
<div class="select-btn select-btn1">导入</div>
</div>
<div class="tables">
<el-table
:data="tableData"
style="width: 100%"
:border="false"
@selection-change="handleSelectionChange"
:row-class-name="tableRowClassName"
>
<el-table-column
type="selection"
width="55"
header-align="center"
>
</el-table-column>
<el-table-column
prop="entprName"
label="企业名称"
header-align="center"
>
</el-table-column>
<el-table-column
prop="name"
label="行政区划"
width="180"
header-align="center"
>
</el-table-column>
<el-table-column
prop="address"
label="企业类型"
header-align="center"
>
</el-table-column>
<el-table-column
prop="address"
label="统一社会信用代码"
header-align="center"
>
</el-table-column>
<el-table-column prop="is" label="是否重点" header-align="center">
<template slot-scope="scope">
<div
style="font-family: 'Alibaba PuHuiTi'"
@click="checkBox(scope.row)"
:class="scope.row.is == 1 ? 'isStyle' : ''"
>
<span v-if="scope.row.is == 1">是</span>
<span v-if="scope.row.is == 2">否</span>
</div>
</template>
</el-table-column>
<el-table-column prop="is" label="选择" header-align="center">
<template slot-scope="scope">
<div class="look" @click="chec(scope.row)">
<el-checkbox v-model="scope.row.is"></el-checkbox>
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination">
<my-pagination
:total="28"
@pagesChange="pagesChange"
></my-pagination>
</div>
</div>
<div v-else class="release-planning">
<div class="inputs centered">
<div class="inputs-span">计划年份:</div>
<el-select v-model="form2.year" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<div class="inputs centered">
<div class="inputs-span">计划标题:</div>
<div class="input">
<el-input
v-model="form2.title"
:maxlength="50"
placeholder="请输入计划标题"
></el-input>
</div>
</div>
<div class="inputs">
<div class="inputs-span">计划内容:</div>
<div class="input">
<el-input
v-model="form2.content"
type="textarea"
resize="none"
placeholder="请输入计划内容"
></el-input>
</div>
</div>
<div class="inputs">
<div class="inputs-span">备注:</div>
<div class="input">
<el-input
v-model="form2.remark"
type="textarea"
resize="none"
placeholder="请输入备注"
></el-input>
</div>
</div>
</div>
<div class="next">
<div class="selected">
<span>{{ selected }}</span
>家企业
</div>
<div
class="btn"
:class="nextStep ? 'selectBtn' : ''"
@click="next"
ref="next"
>
{{ nextText }}
</div>
</div>
</div>
</div>
</el-dialog>
</template>
<script>
import myPagination from "@/views/components/myPagination/index.vue";
//====
import { xzTree, listDist } from "@/api/yingji/home.js";
import { listMsgEnterprise } from "@/api/yingji/planManage.js";
export default {
components: { myPagination },
data() {
return {
dialogVisible: false,
tableData: [],
options: [],
multipleSelection: [],
selected: 0,
nextStep: false,
nextText: "下一步",
form: {
compartment: "",
frimType: "",
economicsType: "",
industryType: "",
riskGrade: "",
frimColor: "",
frimName: "",
},
form2: {
uscCode: "",
current: 1,
size: 10,
},
//查询企业基本信息的参数
basicMsg: {
//经济类型
economicSubcategory: "",
//企业分色
entprColor: "",
//是否重点
isPoint: "",
//重大危险源等级
majorHazardLevel: "",
//所在街道
subdistrict: "",
//统一社会信用代理
uscCode: "",
},
searchBefore: {
pageNum: 1,
pageSize: 10,
},
//获取行政区划字典信息
compartment: [],
//整合经济类型
zhEconomicType: [
{
value: "dalei",
label: "经济大类",
children: [],
},
{
value: "xiaolei",
label: "经济小类",
children: [],
},
],
//其他的字典
otherDict: {},
};
},
created() {
this.getxzqhList();
},
methods: {
getxzqhList() {
//获取行政区划字典信息
xzTree().then((res) => {
this.compartment = res.data;
});
//获取其余字典信息
listDist({
list: "major_hazard_level,entpr_color,economic_categories,economic_subcategory",
}).then((res) => {
this.otherDict = res.data;
res.data.economic_categories.forEach((value, index) => {
this.zhEconomicType[0].children.push({
value: value.dictValue,
label: value.dictLabel,
});
});
res.data.economic_subcategory.forEach((value, index) => {
this.zhEconomicType[1].children.push({
value: value.dictValue,
label: value.dictLabel,
});
});
});
//获取企业基本信息列表
listMsgEnterprise(this.searchBefore).then((res) => {
console.log(res);
this.tableData = res.data
});
},
checkBox(e) {},
open() {
this.dialogVisible = true;
},
Close() {
this.dialogVisible = false;
this.nextStep = false;
this.nextText = "下一步";
},
// 页码,当前页切换事件
pagesChange(pages) {
console.log(pages);
},
// 选中的数据
handleSelectionChange(val) {
this.multipleSelection = val;
this.selected = this.multipleSelection.length;
},
// 下一步
next() {
if (this.$refs.next.innerText == "下一步") {
this.nextStep = true;
this.nextText = "发布计划";
} else {
console.log(form2);
// console.log('该发布计划了')
}
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
return "success-row";
}
return "";
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-cascader {
background-color: transparent;
width: 190px;
.el-input__inner {
height: 33px;
}
// border-radius: 2px;
.el-input
.el-input__suffix
.el-input__suffix-inner
.el-icon-arrow-up::before {
content: "";
background: url(../../../assets/images/down2.png) center center no-repeat;
background-size: cover;
position: absolute;
width: 10px;
height: 7px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
.isStyle {
color: #f71052;
}
.dialog-slot {
.closeClick {
position: absolute;
top: 0;
right: 0;
padding: 10px 20px;
width: 100%;
z-index: 1000;
display: flex;
justify-content: space-between;
align-items: center;
text-align: center;
background: #f8f9fa;
box-shadow: 0px 1px 0px 0px #dbe0e8;
background-color: #e0eaf8;
img {
width: 18px;
height: 18px;
cursor: pointer;
}
.newplan {
display: flex;
align-items: center;
.line {
margin-right: 10px;
width: 5px;
height: 16px;
background-color: #1e70de;
}
.span {
font-size: 16px;
font-family: "Alibaba PuHuiTi";
font-weight: bold;
color: #1e70de;
}
}
}
.content {
// padding: 15px 10px;
.module {
padding-bottom: 15px;
display: flex;
border-bottom: 1px solid #e8ecf0;
.select,
.issue {
width: 150px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: #525966;
span {
font-size: 15px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
}
.span-one {
margin-right: 10px;
}
}
.select {
background-image: url("../../../assets/images/select2.png");
background-size: 100% 100%;
margin-right: 10px;
}
.issue {
background-image: url("../../../assets/images/issue2.png");
background-size: 100% 100%;
}
.nextStepSelect {
background-image: url("../../../assets/images/select1.png");
span {
color: #2378ec;
}
}
.nextStepIssue {
background-image: url("../../../assets/images/issue1.png");
span {
color: #2378ec;
}
}
}
.filtrate {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
padding-bottom: 10px;
.select-input {
// margin-right: 10px;
margin-top: 20px;
display: flex;
align-items: center;
.select-span {
font-size: 13px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
color: #525966;
line-height: 40px;
margin-right: 10px;
}
::v-deep .el-select {
background-color: transparent;
width: 180px;
.el-input__inner {
height: 33px;
}
// border-radius: 2px;
.el-input
.el-input__suffix
.el-input__suffix-inner
.el-icon-arrow-up::before {
content: "";
background: url(../../../assets/images/down2.png) center center
no-repeat;
background-size: cover;
position: absolute;
width: 10px;
height: 7px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
}
.input-input {
margin: 20px 40px 0 0;
width: 250px;
::v-deep .el-input {
.el-input__inner {
height: 33px;
}
}
}
.select-btn {
margin: 20px 0 0 0;
width: 80px;
height: 33px;
background: #2378ec;
border-radius: 2px;
display: flex;
align-items: center;
justify-content: center;
font-size: 15px;
font-family: Alibaba PuHuiTi;
font-weight: 500;
color: #ffffff;
cursor: pointer;
}
.select-btn1 {
background: #28b384;
}
}
.tables {
background-color: #eaf2fd;
::v-deep .el-table {
.success-row {
background-color: rgba(234, 242, 253, 0.25);
}
td {
height: 30px;
text-align: center;
font-size: 15px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
color: #525966;
}
th {
height: 30px;
background-color: #eaf2fd;
font-size: 16px;
font-family: "Alibaba PuHuiTi";
font-weight: bold;
color: #525966;
.el-checkbox {
display: none;
}
}
.el-table__body-wrapper {
height: 448px !important;
overflow-y: auto;
}
}
::v-deep .el-table::before {
height: 0;
}
}
.pagination {
margin-top: 10px;
}
.release-planning {
padding: 0 10px 0 0;
.inputs {
display: flex;
margin-top: 20px;
.inputs-span {
width: 80px;
text-align: right;
margin-right: 10px;
font-size: 15px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
color: #525966;
}
::v-deep .el-select {
background-color: transparent;
width: 190px;
.el-input__inner {
height: 33px;
}
// border-radius: 2px;
.el-input
.el-input__suffix
.el-input__suffix-inner
.el-icon-arrow-up::before {
content: "";
background: url(../../../assets/images/down2.png) center center
no-repeat;
background-size: cover;
position: absolute;
width: 10px;
height: 7px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
.input {
flex: 1;
::v-deep .el-textarea {
height: 180px;
.el-textarea__inner {
height: 100%;
}
}
}
}
.centered {
align-items: center;
}
}
.next {
display: flex;
justify-content: center;
align-items: center;
margin-top: 10px;
.selected {
display: flex;
align-items: center;
font-size: 15px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
color: #525966;
margin-right: 15px;
span {
color: #2378ec;
}
}
.btn {
width: 150px;
height: 30px;
border: 1px solid #2378ec;
border-radius: 2px;
background-color: #eff6ff;
display: flex;
align-items: center;
justify-content: center;
font-size: 15px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
color: #2378ec;
cursor: pointer;
}
.selectBtn {
background-color: #2378ec;
color: #ffffff;
}
}
}
}
::v-deep .el-dialog__body {
padding: 30px 15px;
}
</style>