|
|
@@ -0,0 +1,299 @@
|
|
|
+<template>
|
|
|
+ <div v-if="modalFlag">
|
|
|
+ <div class="group_member_modal">
|
|
|
+ <div class="modal_content">
|
|
|
+ <div class="addByArea">
|
|
|
+ <span>按区域添加</span>
|
|
|
+ <div v-for="(item, index) in areaList" :key="index">
|
|
|
+ <input
|
|
|
+ type="checkbox"
|
|
|
+ :value="item.sign"
|
|
|
+ v-model="checkedBoxList"
|
|
|
+ /><span>{{ item.area }}</span>
|
|
|
+ </div>
|
|
|
+ <button @click.prevent="addByArea">添加</button>
|
|
|
+ </div>
|
|
|
+ <div class="addByCustomize">
|
|
|
+ <span>自定义添加</span>
|
|
|
+ <input
|
|
|
+ id="drl"
|
|
|
+ list="drls"
|
|
|
+ class="inputStyle focusStyle"
|
|
|
+ v-model="addByCustomize"
|
|
|
+ />
|
|
|
+ <datalist id="drls" value="12">
|
|
|
+ <option value="BMW" />
|
|
|
+ <option value="Ford" />
|
|
|
+ <option value="Volvo" />
|
|
|
+ </datalist>
|
|
|
+ <button @click.prevent="addBySelf">添加</button>
|
|
|
+ </div>
|
|
|
+ <div class="count">
|
|
|
+ <Count :sum="sum" />
|
|
|
+ </div>
|
|
|
+ <div class="table">
|
|
|
+ <Table
|
|
|
+ :trStyle="trStyle"
|
|
|
+ :tableHeader="tableHeader"
|
|
|
+ :tableData="tableData"
|
|
|
+ :tableHeadStyle="tableHeadStyle"
|
|
|
+ :discolor="discolor"
|
|
|
+ @change_icon="changeIcon"
|
|
|
+ :operationStyle="operationStyle"
|
|
|
+ :imgFlag="imgFlag"
|
|
|
+ >
|
|
|
+ </Table>
|
|
|
+ </div>
|
|
|
+ <div class="page">
|
|
|
+ <Tablepage
|
|
|
+ :totalPage="totalPage"
|
|
|
+ :currentPage="currentPage"
|
|
|
+ @change_page="changePage"
|
|
|
+ @jump_page="jumpPage"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="btn">
|
|
|
+ <div class="current_button" style="width: 120px;margin: 0" @click="submit">保存</div>
|
|
|
+ <div class="current_button" style="width: 120px;margin: 0" @click="hideModal">取消</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Count from "../../../../components/Count";
|
|
|
+import Tablepage from "../../../../components/TablePage";
|
|
|
+import Table from "./ModalTable";
|
|
|
+export default {
|
|
|
+ props: {
|
|
|
+ modalFlag: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ Table,
|
|
|
+ Count,
|
|
|
+ Tablepage,
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 表格总页数
|
|
|
+ totalPage() {
|
|
|
+ return Math.ceil(this.sum / this.pageSize);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ sum: 120,
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ areaList: [
|
|
|
+ {
|
|
|
+ sign: "all",
|
|
|
+ area: "全区",
|
|
|
+ checked: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ sign: "n",
|
|
|
+ area: "北区",
|
|
|
+ checked: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ sign: "s",
|
|
|
+ area: "南区",
|
|
|
+ checked: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ sign: "e",
|
|
|
+ area: "东区",
|
|
|
+ checked: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ sign: "self",
|
|
|
+ area: "自定义分组",
|
|
|
+ checked: false,
|
|
|
+ },
|
|
|
+ ], // 按区域添加
|
|
|
+ checkedBoxList: [],
|
|
|
+ addByCustomize: [],
|
|
|
+ trStyle: {
|
|
|
+ background: "#ffffff",
|
|
|
+ height: "36px",
|
|
|
+ width: "20%",
|
|
|
+ },
|
|
|
+ tableHeader: ["序号", "经销商名称", "DLR Code", "所属区域", "筛选"],
|
|
|
+ tableData: [
|
|
|
+ { name: "北京博瑞", code: "L020", area: "东区" },
|
|
|
+ { name: "a", code: "a", area: "N" },
|
|
|
+ { name: "a", code: "a", area: "N" },
|
|
|
+ { name: "a", code: "a", area: "N" },
|
|
|
+ { name: "a", code: "a", area: "N" },
|
|
|
+ { name: "a", code: "a", area: "N" },
|
|
|
+ { name: "a", code: "a", area: "N" },
|
|
|
+ { name: "a", code: "a", area: "N" },
|
|
|
+ { name: "a", code: "a", area: "N" },
|
|
|
+ { name: "a", code: "a", area: "N" },
|
|
|
+ { name: "a", code: "a", area: "N" }
|
|
|
+ ],
|
|
|
+ tableHeadStyle: {
|
|
|
+ background: "#8D9092",
|
|
|
+ height: "36px",
|
|
|
+ color: "#fff",
|
|
|
+ },
|
|
|
+ discolor: false, // 是否隔行变色,
|
|
|
+ imgFlag: new Array(20).fill(true), // 筛选栏用添加图片还是删除图片
|
|
|
+ operationStyle: {
|
|
|
+ width: "20px",
|
|
|
+ height: "20px",
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ submit: function () {
|
|
|
+ this.$emit("submit",this.checkedBoxList, this.addByCustomize);
|
|
|
+ },
|
|
|
+ hideModal: function () {
|
|
|
+ this.$emit("hide_modal");
|
|
|
+ },
|
|
|
+ // 点击按区域添加button
|
|
|
+ addByArea: function () {
|
|
|
+ console.log(this.checkedBoxList);
|
|
|
+ },
|
|
|
+ // 自定义添加
|
|
|
+ addBySelf: function () {
|
|
|
+ console.log(this.addByCustomize);
|
|
|
+ },
|
|
|
+ // 筛选
|
|
|
+ changeIcon: function (i) {
|
|
|
+ this.imgFlag.splice(i, 1, !this.imgFlag[i]);
|
|
|
+ console.log(i);
|
|
|
+ },
|
|
|
+ // 获取某一页面的数据,展示在表格
|
|
|
+ changePage: function (page) {
|
|
|
+ this.currentPage = page;
|
|
|
+ console.log(page);
|
|
|
+ },
|
|
|
+ // 点击上一页,下一页,首页,尾页
|
|
|
+ jumpPage: function (item) {
|
|
|
+ switch (item) {
|
|
|
+ case 1:
|
|
|
+ this.currentPage = 1;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ this.currentPage = this.currentPage - 1;
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ this.currentPage = this.currentPage + 1;
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ this.currentPage = this.totalPage;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ console.log(this.currentPage);
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="less">
|
|
|
+.group_member_modal {
|
|
|
+ position: fixed;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ height: 100vh;
|
|
|
+ width: 100vw;
|
|
|
+ background-color: rgba(127, 127, 127, 0.7);
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ .modal_content {
|
|
|
+ width: 800px;
|
|
|
+ height: 650px;
|
|
|
+ background-color: #fff;
|
|
|
+ transform: translateY(-50px);
|
|
|
+ padding: 20px 30px;
|
|
|
+ .addByArea {
|
|
|
+ display: flex;
|
|
|
+ height: 28px;
|
|
|
+ align-items: center;
|
|
|
+ span {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ div {
|
|
|
+ margin-right: 18px;
|
|
|
+ height: 18px;
|
|
|
+ input {
|
|
|
+ width: 12px;
|
|
|
+ height: 12px;
|
|
|
+ vertical-align: middle;
|
|
|
+ margin-top: -2px;
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ }
|
|
|
+ span {
|
|
|
+ margin-left: 2px;
|
|
|
+ height: 18px;
|
|
|
+ line-height: 18px;
|
|
|
+ }
|
|
|
+ button {
|
|
|
+ height: 28px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .addByCustomize {
|
|
|
+ margin: 20px 0 0 30px;
|
|
|
+ button {
|
|
|
+ height: 28px;
|
|
|
+ }
|
|
|
+ input {
|
|
|
+ // background: url('../../img/search.svg') no-repeat center left;
|
|
|
+ // background-size: 21px 25px;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .count {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
+ .table{
|
|
|
+ max-height: 450px;
|
|
|
+ overflow: auto;
|
|
|
+ }
|
|
|
+ .btn{
|
|
|
+ padding: 0 180px;
|
|
|
+ margin-top: 20px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.inputStyle {
|
|
|
+ margin-left: 17px;
|
|
|
+ width: 130px;
|
|
|
+ height: 18px;
|
|
|
+ line-height: 18px;
|
|
|
+ padding: 4px 6px;
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ color: #555555;
|
|
|
+ font-size: 12px;
|
|
|
+}
|
|
|
+.focusStyle {
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ line-height: 20px;
|
|
|
+ color: #555555;
|
|
|
+ outline: none;
|
|
|
+}
|
|
|
+.focusStyle:focus {
|
|
|
+ animation: shadowAni 200ms linear forwards;
|
|
|
+}
|
|
|
+@keyframes shadowAni {
|
|
|
+ 0% {
|
|
|
+ border-color: #cccccc;
|
|
|
+ box-shadow: inset 0px 0px 0 #ccc;
|
|
|
+ }
|
|
|
+ 100% {
|
|
|
+ border-color: #75b9f0;
|
|
|
+ box-shadow: 0px 0px 10px #75b9f0;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|