counter.vue 7.55 KB
Newer Older
xd's avatar
xd committed
1
<template>
xd's avatar
xd committed
2 3 4 5
  <div class="main">
    <div class="title">全部柜组( 共5个 )</div>
    <div class="searchs">
      <div class="buttons">
xd's avatar
xd committed
6
        <el-button class="button buttonlight" size="small" @click="addCounter">添加柜组</el-button>
xd's avatar
xd committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
        <el-button class="button buttondark" size="small">批量删除</el-button>
      </div>

      <!-- 搜索区 -->
      <el-form
        class="searchzone"
        :inline="true"
        :model="data.search"
        label-width="auto"
      >
        <el-form-item label="关键词">
          <el-input
            size="small"
            v-model="data.search.keys"
            style="width:160px"
            placeholder="请输入关键词"
          />
        </el-form-item>
        <el-button class="button buttondark" size="small" style="margin-top:4px;">搜索</el-button>
      </el-form>
    </div>
    <div class="lists">
      <el-table
xd's avatar
xd committed
30
        stripe  
xd's avatar
xd committed
31 32 33
        ref="multipleTable"
        :data="list.main"
        tooltip-effect="dark"
xd's avatar
xd committed
34 35
        style="width: 100%;"
        height="calc(100vh - 360px)"
xd's avatar
xd committed
36 37 38 39 40
        @selection-change="listPick"
      >
        <el-table-column type="selection" width="60"></el-table-column>
        <el-table-column
          prop="taskName"
xd's avatar
xd committed
41
          label="柜组"
xd's avatar
xd committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
          align="center"
        ></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="120"
        ></el-table-column>
        <el-table-column
          prop="bar"
xd's avatar
xd committed
58
          label="所在区域"
xd's avatar
xd committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
          align="center"
          width="120"
        ></el-table-column>
         <el-table-column
          prop="bar"
          label="门店数量"
          align="center"
          width="120"
        ></el-table-column>
        <el-table-column label="创建时间" width="120" align="center">
          <template slot-scope="scope">{{ scope.row.sendDate }}</template>
        </el-table-column>

        <el-table-column label="操作" align="center" fixed="right" width="200">
          <template slot-scope="scope">
xd's avatar
xd committed
74
            <el-button type="text" class="btn" @click="handleDetail(scope.row)"
xd's avatar
xd committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
              >详情</el-button
            >
            <el-button type="text" class="btn" @click="testButtonClick(scope.row)"
              >编辑</el-button
            >
            <el-button
              type="text"
              @click="testButtonClick(scope.row)"
              class="listButtonRed"
              >删除</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="pages">
      <el-pagination
xd's avatar
xd committed
92 93 94 95 96 97
      @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
98
    </div>
xd's avatar
xd committed
99 100
    <add-counter ref="addCounter"></add-counter>
    <counter-detail ref="counterDetail" ></counter-detail>
xd's avatar
xd committed
101 102 103
  </div>
</template>
<script>
xd's avatar
xd committed
104
import CounterDetail from "./components/counterDetail"
xd's avatar
xd committed
105
import AddCounter from "./components/addCounter"
xd's avatar
xd committed
106
export default {
xd's avatar
xd committed
107
  components: {
xd's avatar
xd committed
108 109
    CounterDetail,
    AddCounter
xd's avatar
xd committed
110
  },
xd's avatar
xd committed
111 112 113 114
  data() {
    return {
      list: {
        main: [
xd's avatar
xd committed
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
          {
            id: "1001",
            taskName: "2019年男装销售任务",
            taskType: "拉新",
            bar: "男装",
            taskContent: "任务内容任务内容任务内容...",
            sendDate: "2019/02/08"
          },
          {
            id: "1002",
            taskName: "2019年男装销售任务",
            taskType: "拉新",
            bar: "男装",
            taskContent: "任务内容任务内容任务内容...",
            sendDate: "2019/02/08"
          },
          {
            id: "1003",
            taskName: "2019年男装销售任务",
            taskType: "拉新",
            bar: "男装",
            taskContent: "任务内容任务内容任务内容...",
            sendDate: "2019/02/08"
          },
xd's avatar
xd committed
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 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
          {
            id: "1001",
            taskName: "2019年男装销售任务",
            taskType: "拉新",
            bar: "男装",
            taskContent: "任务内容任务内容任务内容...",
            sendDate: "2019/02/08"
          },
          {
            id: "1002",
            taskName: "2019年男装销售任务",
            taskType: "拉新",
            bar: "男装",
            taskContent: "任务内容任务内容任务内容...",
            sendDate: "2019/02/08"
          },
          {
            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: "测试"
            }
          ]
        }
      },
      data: {
        search: {
          bar: "",
          taskType: "",
          date: "",
          keys: ""
        },
        page: {
          nowPageNum: 4
        }
xd's avatar
xd committed
197
      },
xd's avatar
xd committed
198 199
      detailDialog: false,
      counterDialog: false,
xd's avatar
xd committed
200
      tableHeight: window.innerHeight * 0.5 ,
xd's avatar
xd committed
201 202 203 204 205
      page:{
          currentPage:1,
          size:20,
          total:100
        }
xd's avatar
xd committed
206 207 208 209 210 211 212 213
    };
  },
  created() {},
  methods: {
    listPick() {},
    testButtonClick() {},
    pagesSizeChange() {},
    pagesNowPageChange() {},
xd's avatar
xd committed
214
    handleDetail() {
xd's avatar
xd committed
215
      this.$refs.counterDetail.detailDialog = true
xd's avatar
xd committed
216 217
    },
    addCounter() {
xd's avatar
xd committed
218
      this.$refs.addCounter.counterDialog= true
xd's avatar
xd committed
219
    },
xd's avatar
xd committed
220 221
    addCounterFinish() {
      this.counterDialog = false
xd's avatar
xd committed
222 223 224 225
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
xd's avatar
xd committed
226 227 228 229 230 231 232
  },
 /*  mounted() {
     this.$nextTick(() => {
         this.tableHeight = window.innerHeight - 120;
     })        
  } */
}
xd's avatar
xd committed
233
</script>
xd's avatar
xd committed
234 235
<style lang="scss" scoped>
.main {
xd's avatar
xd committed
236 237 238 239
  position: relative;
  background-color: #fff;
  box-sizing: border-box;
  height: 100%;
xd's avatar
xd committed
240 241 242 243
  padding: 0px 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
xd's avatar
xd committed
244
  width: 100%;
xd's avatar
xd committed
245
  box-shadow: 0px 2px 4px 0px #ddd;
xd's avatar
xd committed
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
}
.searchs {
  height: 40px;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}
.buttons {
  width: 266px;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
}
.buttonlight {
  background-color: #e8e9fe;
  color: #4e59c7;
  border: 1px solid #4e59c7;
  box-sizing: border-box;
}
xd's avatar
xd committed
267

xd's avatar
xd committed
268 269
.btn {
  font-size:14px;
xd's avatar
xd committed
270
  // font-weight:bold;
xd's avatar
xd committed
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
  color:rgba(102,102,102,1);
}
.buttondark {
  width: 88px;
  height: 32px;
  background-color: #4e59c7;
  color: #ffffff;
  border: 1px solid #4e59c7;
  box-sizing: border-box;
}
.buttondark:hover {
}
.searchzone {
  height: 40px;
  width: auto;
  min-width: 654px;
  text-align: right;
}
.lists {
  height: auto;
  min-height: 70%;
  width: 100%;
  margin-top: 20px;
}
.listButtonRed {
xd's avatar
xd committed
296 297
  color: #D0021B;
  // font-weight: bold;
xd's avatar
xd committed
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
}
.pages {
  height: 40px;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
}
.title {
  height: 48px;
  line-height: 48px;
  color:rgba(56,56,56,1);
  border-bottom: 1px solid #f8f8f8;
  margin-bottom: 16px;
}
</style>