index.vue 15.6 KB
Newer Older
Z's avatar
Z committed
1
<template>
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
  <div class="ztask-coms">
    <div class="ztask-searchs">
      <div class="ztask-searchs-items">
        <el-button size="small" @click="searchsCreate">创建任务</el-button>
        <el-button type="primary" size="small" @click="searchsDels">批量删除</el-button>
      </div>
      <div class="ztask-searchs-items">
        <el-form class="ztask-searchs-forms" :inline="true" :model="data.search" label-width="auto">
          <el-form-item label="柜组">
            <el-select
              size="small"
              v-model="data.search.bar"
              placeholder="请选择柜组"
              style="width:160px;"
            >
              <el-option
                v-for="item in cache.list.bar"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
25
          <el-form-item label="任务类型">
26 27 28 29 30 31 32 33 34 35 36 37 38 39
            <el-select
              size="small"
              v-model="data.search.taskType"
              placeholder="请选择任务类型"
              style="width:160px;"
            >
              <el-option
                v-for="item in cache.list.taskType"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
40 41 42 43 44 45 46 47 48 49 50
          <el-form-item label="日期">
            <el-date-picker
              size="small"
              v-model="data.search.taskDate"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              style="width:200px;">
            </el-date-picker>
          </el-form-item>
51
          <!-- <el-form-item label="关键词">
52 53 54 55 56 57
            <el-input
              size="small"
              v-model="data.search.keys"
              style="width:160px"
              placeholder="请输入关键词"
            />
58
          </el-form-item> -->
59 60 61 62 63
        </el-form>


        <el-button type="primary" size="small" @click="searchsSearch">搜 索</el-button>
      </div>
64 65
    </div>
    <div class="ztask-charts">
Z's avatar
Z committed
66
      <ve-histogram class="ztask-chart" :data="list.chart" v-bind="setting.chart"></ve-histogram>
67 68 69 70 71 72 73 74 75 76 77
    </div>
    <div class="ztask-lists">
      <el-table
        stripe
        ref="multipleTable"
        :data="list.main"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="listsSelectChange"
      >
        <el-table-column type="selection" width="60"></el-table-column>
78 79 80 81
        <el-table-column prop="barName" label="门店" align="center" width="200"></el-table-column>
        <el-table-column prop="barType" label="门店类型" align="center"></el-table-column>
        <el-table-column prop="customNew" label="拉新" align="center"></el-table-column>
        <el-table-column prop="customRebuy" label="复购" align="center"></el-table-column>
82 83 84
      </el-table>

    </div>
85 86


87
    <div class="ztask-pages">
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
      <el-pagination
        class="ztask-page"
        @size-change="pagesSizeChange"
        @current-change="pagesNowPageChange"
        :current-page="data.page.nowPageNum"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="100"
        layout="prev, pager, next, sizes, jumper"
        :total="400"
      ></el-pagination>
    </div>
    <div class="ztask-dialogs">
      <el-dialog
        title="创建集团任务"
        :visible.sync="cache.status.createDialog"
        width="60%"
        :before-close="dialogCreateBeforeClose"
      >
        <div class="dialogMain">
          <el-form :model="data.create" :rules="rule.create" label-width="120px" ref="createForm">
            <el-row>
              <el-col :span="24">
                <el-form-item label="任务标题:" prop="taskName">
                  <el-input v-model="data.create.taskName" autocomplete="off" placeholder="请输入任务标题"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="作者:" prop="author">
                  <el-select
                    v-model="data.create.author"
                    placeholder="请选择作者"
                    @change="dialogCreateAuthorChange"
                    style="width:100%;"
                  >
                    <el-option
                      v-for="item in list.man"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="任务详情:" prop="taskDetail">
                  <el-input
                    type="textarea"
                    :rows="5"
                    placeholder="请输入任务详情"
                    v-model="data.create.taskDetail"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button size="small" @click="dialogCreateCancel">取 消</el-button>
          <el-button size="small" type="primary" @click="dialogCreateSubmitSend('createForm')">保存并发布</el-button>
        </span>
      </el-dialog>
      <el-dialog
        title="查看集团任务"
        :visible.sync="cache.status.seeDialog"
        width="60%"
        :before-close="dialogSeeBeforeClose"
      >
        <div class="dialogMain">
          <el-form :model="data.see" :rules="rule.see" label-width="120px" ref="seeForm">
            <el-row>
              <el-col :span="24">
                <el-form-item label="任务标题:" prop="taskName">
Z's avatar
Z committed
164 165
                  <el-input :disabled="true" v-model="data.see.taskName" autocomplete="off"
                            placeholder="任务标题为空"></el-input>
166 167 168 169 170 171
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="作者:" prop="author">
Z's avatar
Z committed
172 173
                  <el-input :disabled="true" v-model="data.see.authore" autocomplete="off"
                            placeholder="作者为空"></el-input>
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="任务详情:" prop="taskDetail">
                  <el-input
                    :disabled="true"
                    type="textarea"
                    :rows="5"
                    placeholder="任务详情为空"
                    v-model="data.see.taskDetail"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button size="small" @click="dialogSeeCancel">取 消</el-button>
          <el-button size="small" type="primary" @click="dialogSeeSubmitSend('createForm')">发 布</el-button>
        </span>
      </el-dialog>
197 198
    </div>
  </div>
Z's avatar
Z committed
199
</template>
Z's avatar
Z committed
200

201
<script>
Z's avatar
Z committed
202 203
  import list from '@/pages/task/count/list.js'

204
  export default {
Z's avatar
Z committed
205 206 207
    mixins: [
      list
    ],
208 209 210 211 212
    components: {},
    data() {
      return {
        cache: {
          status: {
213 214
            createDialog: false,
            seeDialog: false
215
          },
216
          list: {
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
            bar: [
              {
                id: "0",
                name: "全部"
              },
              {
                id: "1",
                name: "柜组1"
              }
            ],
            taskType: [
              {
                id: "0",
                name: "全部"
              },
              {
                id: "1",
                name: "测试"
              }
            ],
237 238 239 240 241 242 243 244 245 246
            status: [
              {
                id: "0",
                name: "全部"
              },
              {
                id: "1",
                name: "已发布"
              }
            ],
247 248 249
          }
        },
        list: {
Z's avatar
Z committed
250
          chart: {},
251
          main: [
252 253
            {
              id: '1001',
254 255 256 257
              barName: 'Asics 店',
              barType: '专柜',
              customNew: '10',
              customRebuy: '20'
258 259 260
            },
            {
              id: '1002',
261 262 263 264
              barName: 'Bape 店',
              barType: '专柜',
              customNew: '18',
              customRebuy: '10'
265 266 267
            },
            {
              id: '1003',
268 269 270 271
              barName: 'Champion 店',
              barType: '普通门店',
              customNew: '24',
              customRebuy: '40'
272 273 274
            },
            {
              id: '1004',
275 276 277 278
              barName: 'Dior 店',
              barType: '普通门店',
              customNew: '40',
              customRebuy: '15'
279 280 281
            },
            {
              id: '1005',
282 283 284 285
              barName: 'Edc 店',
              barType: '专柜',
              customNew: '22',
              customRebuy: '8'
286 287 288
            },
            {
              id: '1006',
289 290 291 292
              barName: 'FILA 店',
              barType: '专柜',
              customNew: '30',
              customRebuy: '14'
293 294 295
            },
            {
              id: '1007',
296 297 298 299
              barName: 'Gaucho 店',
              barType: '专柜',
              customNew: '20',
              customRebuy: '15'
300 301 302
            },
            {
              id: '1008',
303 304 305 306
              barName: 'Hermes 店',
              barType: '专柜',
              customNew: '8',
              customRebuy: '20'
307 308 309
            },
            {
              id: '1009',
310 311 312 313
              barName: 'Isolda 店',
              barType: '普通门店',
              customNew: '11',
              customRebuy: '23'
314 315 316
            },
            {
              id: '1010',
317 318 319 320
              barName: 'Jeanswest 店',
              barType: '普通门店',
              customNew: '40',
              customRebuy: '20'
321 322 323
            },
            {
              id: '1011',
324 325 326 327
              barName: 'Kevin 店',
              barType: '普通门店',
              customNew: '11',
              customRebuy: '14'
328 329 330
            },
            {
              id: '1012',
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352
              barName: 'Lux 店',
              barType: '专柜',
              customNew: '24',
              customRebuy: '14'
            },
          ],
          man: [
            {
              id: '1001',
              name: 'Alice'
            },
            {
              id: '1002',
              name: 'Bob'
            },
            {
              id: '1003',
              name: 'Clid'
            },
            {
              id: '1004',
              name: 'Dive'
353 354 355 356
            },
          ]
        },
        data: {
357
          search: {
358 359
            bar: '',
            taskType: '',
360
            taskDate: '',
361 362
            keys: '',
          },
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385
          page: {
            nowPageNum: 1,
          },
          create: {
            taskName: '',
            author: '',
            taskDetail: '',
          },
          createDefault: {
            taskName: '',
            author: '',
            taskDetail: '',
          },
          see: {
            taskName: '',
            author: '',
            taskDetail: '',
          },
          seeDefault: {
            taskName: '',
            author: '',
            taskDetail: '',
          },
386
        },
387 388 389 390 391 392
        rule: {
          create: {
            taskName: [{required: true, message: '任务名称不能为空', trigger: 'change'}],
            taskDetail: [{required: true, message: '任务详情不能为空', trigger: 'change'}],
          },
          see: {},
Z's avatar
Z committed
393 394 395 396 397 398
        },
        setting: {
          chart: {
            yAxisType: ['KMB'],
            yAxisName: ['数值']
          }
399 400 401 402 403 404
        }
      };
    },
    created() {
    },
    methods: {
405 406 407 408 409 410
      searchsCreate() {
        this.cache.status.createDialog = true
      },
      searchsDels() {
      },
      searchsSearch() {
Z's avatar
Z committed
411 412 413 414 415 416 417 418 419 420 421 422 423
        this.list.chart = {}

        this.list.chart = {
          columns: ['日期', '访问用户', '下单用户', '下单率'],
          rows: [
            {'日期': '1', '访问用户': 20, '下单用户': 10, '下单率': 50, '专柜类型': '普通店铺'},
            {'日期': '2', '访问用户': 30, '下单用户': 15, '下单率': 50, '专柜类型': '普通店铺'},
            {'日期': '3', '访问用户': 40, '下单用户': 20, '下单率': 50, '专柜类型': '普通店铺'},
            {'日期': '4', '访问用户': 50, '下单用户': 25, '下单率': 50, '专柜类型': '普通店铺'},
            {'日期': '5', '访问用户': 60, '下单用户': 30, '下单率': 50, '专柜类型': '普通店铺'},
            {'日期': '6', '访问用户': 70, '下单用户': 35, '下单率': 50, '专柜类型': '普通店铺'}
          ]
        }
424
      },
425

426 427 428 429 430 431 432 433 434 435 436 437 438 439
      listsSelectChange() {
      },
      listsUntopClick() {
      },
      listsTopClick() {
      },
      listsSeeClick(inData) {
        this.cache.status.seeDialog = true

        this.data.see = {
          taskName: 'Bob',
          author: 'author',
          taskDetail: 'taskDetail',
        }
440

441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488

      },
      listsEditClick(inData) {
        this.cache.status.createDialog = true

        this.data.create = {
          taskName: 'taskName',
          author: 'author',
          taskDetail: 'taskDetail',
        }

      },
      listsDelClick() {
      },

      pagesSizeChange() {
      },
      pagesNowPageChange() {
      },

      dialogCreateAuthorChange() {
      },
      dialogCreateBeforeClose() {
        this.cache.status.createDialog = false
      },
      dialogCreateCancel() {
        this.data.create = JSON.parse(JSON.stringify(this.data.createDefault))
        this.cache.status.createDialog = false
      },
      dialogCreateSubmitSend() {
        this.$refs[inForm].validate(valid => {
          if (valid) {

          } else {
            return false
          }
        })
      },

      dialogSeeBeforeClose() {
        this.cache.status.seeDialog = false
      },
      dialogSeeCancel() {
        this.data.see = JSON.parse(JSON.stringify(this.data.seeDefault))
        this.cache.status.seeDialog = false
      },
      dialogSeeSubmitSend() {
      },
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506
    }
  };
</script>
<style lang="scss" scoped>
  .ztask-coms {
    /*border: 2px solid cyan;*/

    height: calc((100vh - 220px) * 1.0);
  }

  .ztask-searchs {
    /*border: 2px solid #0ea4c5;*/
    height: 70px;

    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }
Z's avatar
Z committed
507

508
  .ztask-searchs-items {
509
    /*border: 2px solid #00c561;*/
510 511 512 513 514 515 516 517 518

    margin: 17px 0px 20px 0px;
    width: auto;

    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
  }
Z's avatar
Z committed
519

520
  .ztask-searchs-forms {
521 522 523 524 525
    /*border: 2px solid #f900ff;*/
    height: 30px;
    margin-bottom: 10px;
  }

526
  .ztask-charts {
Z's avatar
Z committed
527
    /*border: 2px solid green;*/
528 529 530
    background-color: rgba(220, 220, 220, 0.5);
    height: 262px;
  }
Z's avatar
Z committed
531 532 533 534 535 536 537 538

  .ztask-chart {
    /*border: 2px solid deeppink;*/
    /*height: 50%;*/
    height: 50px;
    width: 100%;
  }

539
  .ztask-lists {
Z's avatar
Z committed
540
    /*border: 2px solid red;*/
541
    height: calc((100vh - 600px) * 1.0);
542 543 544 545 546 547 548 549 550 551 552 553
    overflow: auto;
  }

  .ztask-pages {
    /*border: 2px solid red;*/
    /*height: 56px;*/
    height: 42px;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: flex-end;
  }
Z's avatar
Z committed
554

555
  .ztask-page {
556 557 558 559
    /*border: 2px solid red;*/
    position: relative;
    margin-right: 0;
  }
560 561 562 563

  .buttonTextNormal {
    color: #666666;
  }
Z's avatar
Z committed
564

565 566 567
  .buttonTextWarning {
    color: #D0021B;
  }
568
</style>