mail.vue 10.6 KB
Newer Older
xd's avatar
xd committed
1 2 3 4 5 6 7 8 9 10
<template>
  <div class="ct">
    <div class="left">
      <div class="title">组织架构</div>
      <div class="bottom">
        <div class="ty">
          <div>
            <span>全部</span>
            <span class="number">(103)</span>
          </div>
xd's avatar
xd committed
11
          <!-- <div>
xd's avatar
xd committed
12
            <span><d2-icon-svg name="edit" class="icon"/></span>
xd's avatar
xd committed
13 14 15
            <span style="margin-left:8px;"
              ><d2-icon-svg name="delete" class="icon"
            /></span>
xd's avatar
xd committed
16
          </div> -->
xd's avatar
xd committed
17 18 19 20 21 22
        </div>
        <div class="ty" style="margin:15px 0;">
          <div>
            <span>未分组</span>
            <span class="number">(8)</span>
          </div>
xd's avatar
xd committed
23
          <!-- <div>
xd's avatar
xd committed
24
            <span><d2-icon-svg name="edit" class="icon"/></span>
xd's avatar
xd committed
25 26 27
            <span style="margin-left:8px;"
              ><d2-icon-svg name="delete" class="icon"
            /></span>
xd's avatar
xd committed
28
          </div> -->
xd's avatar
xd committed
29 30
        </div>
        <el-tree
xd's avatar
xd committed
31
          :data="data1"
xd's avatar
xd committed
32 33 34 35 36
          show-checkbox
          node-key="id"
          default-expand-all
          :expand-on-click-node="false"
        >
xd's avatar
xd committed
37
          <span class="custom-tree-node" slot-scope="{ node, data }">
xd's avatar
xd committed
38 39
            <span>{{ node.label }}</span>
            <span style="margin-left:20px;">
xd's avatar
xd committed
40 41 42 43 44 45
              <d2-icon-svg name="edit" class="icon" @click="() => edit(data)" />
              <d2-icon-svg
                name="delete"
                class="icon"
                @click="() => remove(node, data)"
              />
xd's avatar
xd committed
46 47 48 49
            </span>
          </span>
        </el-tree>
      </div>
xd's avatar
xd committed
50
      <div class="end">
xd's avatar
xd committed
51
        <span class="add-l" @click="addCounter">添加柜组</span>
xd's avatar
xd committed
52
        <span class="add-r" @click="addDept">添加部门</span>
xd's avatar
xd committed
53
      </div>
xd's avatar
xd committed
54 55
    </div>
    <div class="right">
xd's avatar
xd committed
56
      <div class="top">三号柜组(共18人)</div>
xd's avatar
xd committed
57 58 59 60
      <div class="searchs">
        <div class="buttons">
          <el-button class="button buttonlight" size="small" @click="synchronismMember"
            >同步成员</el-button
xd's avatar
xd committed
61
          >
xd's avatar
xd committed
62
          <el-button class="button buttondark" size="small" @click="handleMove">移动</el-button>
xd's avatar
xd committed
63
        </div>
xd's avatar
xd committed
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
        <!-- 搜索区 -->
        <el-form
          class="searchzone"
          :inline="true"
          :model="formData"
          label-width="auto"
        >
          <el-form-item label="关键词">
            <el-input
              size="small"
              v-model="formData.keys"
              style="width:160px"
              placeholder="请输入关键词"
            />
          </el-form-item>
          <el-button class="button buttondark" size="small">搜索</el-button>
        </el-form>
xd's avatar
xd committed
81
      </div>
xd's avatar
xd committed
82 83 84 85 86 87 88
      <el-table
        stripe
        class="list"
        ref="multipleTable"
        :data="list.main"
        tooltip-effect="dark"
        style="width: 100%"
xd's avatar
xd committed
89
        height="370px"
xd's avatar
xd committed
90 91 92 93 94 95 96
      >
        <el-table-column type="selection" width="60"></el-table-column>
        <el-table-column
          prop="taskName"
          label="姓名"
          align="center"
        ></el-table-column>
xd's avatar
xd committed
97 98 99 100 101 102
        <el-table-column
          prop="id"
          label="企业微信ID"
          align="center"
          width = "120"
        ></el-table-column>
xd's avatar
xd committed
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
        <el-table-column
          prop="taskType"
          label="部门"
          align="center"
          width="150"
        ></el-table-column>
        <el-table-column
          prop="taskType"
          label="角色"
          align="center"
          width="120"
        ></el-table-column>
        <el-table-column
          prop="bar"
          label="手机号"
          align="center"
          width="150"
        ></el-table-column>
        <el-table-column label="同步时间" width="180" align="center">
          <template slot-scope="scope">{{ scope.row.sendDate }}</template>
        </el-table-column>
        <el-table-column
          prop="bar"
          label="备注"
          align="center"
          width="120"
        ></el-table-column>
      </el-table>
      <el-pagination
        @current-change="handleCurrentChange"
        :current-page="page.currentPage"
        :page-size="page.size"
        layout="total, prev, pager, next, jumper"
        :total="page.total"
      >
      </el-pagination>
xd's avatar
xd committed
139
    </div>
xd's avatar
xd committed
140 141 142 143 144 145 146
    <move-dialog
      v-if="moveDialogShow"
      :moveDialog="moveDialogShow"
      @handleCancel="moveDialogShow = false"
      @handleFinish="removeFinish"
    ></move-dialog>
    <add-counter v-if="counterDialog" :moveDialog="counterDialog" @handleCancel="counterDialog = false" @handleFinish="addCounterFinish"></add-counter>
xd's avatar
xd committed
147
    <add-store v-if="storeDialog" :moveDialog="storeDialog" @handleCancel="storeDialog = false" @handleFinish="addStoreFinish"></add-store>
xd's avatar
xd committed
148 149 150 151
  </div>
</template>

<script>
xd's avatar
xd committed
152 153
import MoveDialog from "./components/move";
import AddCounter from "./components/addCounter";
xd's avatar
xd committed
154
import AddStore from './components/addStore'
xd's avatar
xd committed
155
export default {
xd's avatar
xd committed
156
  data() {
xd's avatar
xd committed
157
    const data1 = [
xd's avatar
xd committed
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
      {
        id: 1,
        label: "一级 1",
        children: [
          {
            id: 4,
            label: "二级 1-1",
            children: [
              {
                id: 9,
                label: "三级 1-1-1"
              },
              {
                id: 10,
                label: "三级 1-1-2"
              }
            ]
          }
        ]
      },
      {
        id: 2,
        label: "一级 2",
        children: [
          {
            id: 5,
            label: "二级 2-1"
          },
          {
            id: 6,
            label: "二级 2-2"
          }
        ]
      },
      {
        id: 3,
        label: "一级 3",
        children: [
          {
            id: 7,
            label: "二级 3-1"
          },
          {
            id: 8,
            label: "二级 3-2"
          }
        ]
      }
    ];
    return {
xd's avatar
xd committed
208
      data1: JSON.parse(JSON.stringify(data1)),
xd's avatar
xd committed
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
      list: {
        main: [
          {
            id: "1001",
            taskName: "2019年男装销售任务",
            taskType: "拉新",
            bar: "男装",
            taskContent: "任务内容任务内容任务内容...",
            sendDate: "2019/02/08"
          },
          {
            id: "1002",
            taskName: "2019年男装销售任务",
            taskType: "拉新",
            bar: "男装",
            taskContent: "任务内容任务内容任务内容...",
            sendDate: "2019/02/08"
          },
xd's avatar
xd committed
227 228 229 230 231 232 233 234
          {
            id: "1003",
            taskName: "2019年男装销售任务",
            taskType: "拉新",
            bar: "男装",
            taskContent: "任务内容任务内容任务内容...",
            sendDate: "2019/02/08"
          },
xd's avatar
xd committed
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
          {
            id: "1003",
            taskName: "2019年男装销售任务",
            taskType: "拉新",
            bar: "男装",
            taskContent: "任务内容任务内容任务内容...",
            sendDate: "2019/02/08"
          }
        ],
        search: {
          bar: [
            {
              id: "1",
              name: "全部"
            },
            {
              id: "2",
              name: "测试"
            }
          ],
          taskType: [
            {
              id: "1",
              name: "全部"
            },
            {
              id: "2",
              name: "测试"
            }
          ]
        }
      },
xd's avatar
xd committed
267
      isShow: false,
xd's avatar
xd committed
268 269 270 271 272 273 274 275 276
      formData: {
        status: "",
        keys: ""
      },
      statusList: [],
      page: {
        currentPage: 1,
        size: 20,
        total: 100
xd's avatar
xd committed
277 278
      },
      moveDialogShow: false,
xd's avatar
xd committed
279 280
      counterDialog: false,
      storeDialog: false
xd's avatar
xd committed
281 282
    };
  },
xd's avatar
xd committed
283
  components: {
xd's avatar
xd committed
284
    MoveDialog,
xd's avatar
xd committed
285 286
    AddCounter,
    AddStore
xd's avatar
xd committed
287
  },
xd's avatar
xd committed
288
  methods: {
xd's avatar
xd committed
289
    append(data) {
xd's avatar
xd committed
290 291 292 293 294 295
      const newChild = { id: id++, label: "testtest", children: [] };
      if (!data.children) {
        this.$set(data, "children", []);
      }
      data.children.push(newChild);
    },
xd's avatar
xd committed
296 297
    edit(data) {},
    remove(node, data) {
xd's avatar
xd committed
298 299 300 301
      const parent = node.parent;
      const children = parent.data.children || parent.data;
      const index = children.findIndex(d => d.id === data.id);
      children.splice(index, 1);
xd's avatar
xd committed
302 303 304 305 306
    },
    listPick() {},
    testButtonClick() {},
    pagesSizeChange() {},
    pagesNowPageChange() {},
xd's avatar
xd committed
307 308 309 310 311
    synchronismMember() {
      this.isShow = true;
      this.$emit("isShow", this.isShow);
    },
    handleMove() {
xd's avatar
xd committed
312
      this.moveDialogShow = true;
xd's avatar
xd committed
313 314 315
      console.log(111111);
    },
    removeFinish() {
xd's avatar
xd committed
316
      this.moveDialogShow = false;
xd's avatar
xd committed
317
    },
xd's avatar
xd committed
318 319 320 321 322 323
    currentPage() {},
    addCounter() {
      this.counterDialog = true
    },
    addCounterFinish() {
      this.counterDialog = false
xd's avatar
xd committed
324 325 326 327 328 329
    },
    addDept() {
      this.counterDialog = true
    },
    addStoreFinish() {
      this.storeDialog = false
xd's avatar
xd committed
330 331
    }
  }
xd's avatar
xd committed
332
};
xd's avatar
xd committed
333 334 335
</script>

<style scoped>
xd's avatar
xd committed
336 337
.top {
  padding-bottom: 10px;
338
  border-bottom: 1px solid #f8f8f8;
xd's avatar
xd committed
339
}
xd's avatar
xd committed
340 341 342 343 344 345 346
.end {
  position: absolute;
  display: flex;
  align-items: center;
  border: 1px solid rgba(78, 89, 199, 1);
  width: 100%;
  bottom: 0;
xd's avatar
xd committed
347
  box-sizing: border-box;
xd's avatar
xd committed
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365
}
.add-l,
.add-r {
  width: 50%;
  height: 32px;
  border: 1px solid rgba(78, 89, 199, 1);
  width: 100%;
  text-align: center;
  line-height: 32px;
}
.add-l {
  background-color: #e8e9fe;
  color: rgba(78, 89, 199, 1);
}
.add-r {
  background-color: #4e59c7;
  color: #fff;
}
xd's avatar
xd committed
366
.ty {
xd's avatar
xd committed
367 368 369
  height: 40px;
  background: rgba(248, 248, 248, 1);
  border-radius: 26px;
xd's avatar
xd committed
370 371 372 373
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 16px;
xd's avatar
xd committed
374
  color: rgba(51, 51, 51, 1);
xd's avatar
xd committed
375 376 377 378 379 380 381
  justify-content: space-between;
}
.bottom {
  padding: 12px;
}
.title {
  height: 48px;
xd's avatar
xd committed
382
  background: rgba(78, 89, 199, 1);
xd's avatar
xd committed
383 384 385 386 387 388 389 390
  line-height: 48px;
  text-align: center;
  color: #fff;
  font-size: 16px;
}
.ct {
  display: flex;
  flex-direction: row;
xd's avatar
xd committed
391
  background-color: #f8f8f8;
xd's avatar
xd committed
392 393 394
  min-height: 100%;
}
.left {
xd's avatar
xd committed
395
  position: relative;
xd's avatar
xd committed
396
  width: 20%;
397

xd's avatar
xd committed
398
}
xd's avatar
xd committed
399 400
.left,
.right {
xd's avatar
xd committed
401
  background-color: #fff;
xd's avatar
xd committed
402 403 404
  height: 518px;
  overflow: auto;
  box-sizing: border-box;
xd's avatar
xd committed
405 406
}
.right {
xd's avatar
xd committed
407
  position: relative;
xd's avatar
xd committed
408 409
  padding: 10px;
  margin-left: 10px;
xd's avatar
xd committed
410
  width: 80%;
xd's avatar
xd committed
411 412 413 414 415 416 417 418 419 420 421 422
}
.number {
  font-size: 14px;
  margin-top: 2px;
  margin-left: 8px;
}
.icon {
  /* display: inline-block; */
  width: 16px;
  height: 16px;
}

xd's avatar
xd committed
423
.main {
xd's avatar
xd committed
424 425 426 427 428 429 430 431 432 433
  /* // border: 2px solid orange; */
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.searchzone {
  height: 40px;
  width: auto;
  min-width: 654px;
xd's avatar
xd committed
434
  text-align: right;
xd's avatar
xd committed
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457
}
.lists {
  height: auto;
  min-height: 70%;
  width: 100%;
  margin-top: 20px;
}
.list {
  /* // border: 1px solid red; */
}
.listButtonRed {
  /* // border: 2px solid green; */
  color: red;
}
.pages {
  /* // border: 2px solid steelblue; */
  height: 40px;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
}
xd's avatar
xd committed
458
</style>