detail.vue 17 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 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 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 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 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 267 268 269 270 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 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 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 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575
<template>
  <div class="merchantDetail wrapper detail">
    <div>
      <ul class="titles">
        <li class="itemTitle" :class="{ active: curIndex == index }" v-for="(item, index) in titles" :key="index" @click="tabClick(index)">{{ item }}</li>
      </ul>
    </div>
    <div class="pageOne" v-if="curIndex == 0">
      <div class="MsgWrap hasDownLine">
        <div class="grayLine"></div>
        <span class="content-title">账户信息</span>
        <div class="detail-content">
          <el-row :gutter="10">
            <el-col :span="12">
              <span class="itemName">登录账户名:</span>
              <span class="itemValue">{{ firstPageObj.merchantLoginAccount }}</span>
            </el-col>
            <el-col :span="12">
              <span class="itemName">账户等级:</span>
              <span class="itemValue">{{ firstPageObj.accountLevelName }}</span>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="12">
              <span class="itemName">开通模式:</span>
              <span class="itemValue">{{ firstPageObj.merchantModelName }}</span>
            </el-col>
            <el-col :span="12">
              <span class="itemName">账户状态:</span>
              <span class="itemValue">
                {{ firstPageObj.statusName }}
              </span>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="12">
              <span class="itemName">关联企业微信名:</span>
              <span class="itemValue">{{ firstPageObj.entmicroName }}</span>
            </el-col>
            <el-col :span="12">
              <span class="itemName">账户有效期:</span>
              <span class="itemValue">{{ firstPageObj.effectiveTimeName }}</span>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="24">
              <span class="itemName">账户类型:</span>
              <span class="account-type-span" v-for="(item, index) in firstPageObj.accountTypes" :key="index">{{ item.accounttypeName || 'null' }}</span>
            </el-col>
          </el-row>
        </div>
      </div>

      <div class="MsgWrap powerlimt">
        <span class="content-title">功能权限</span>
        <div class="powerTreeWrap"></div>
      </div>
      <div class="MsgWrap companyMsg">
        <div class="grayLine"></div>
        <span class="content-title">企业信息</span>
        <div class="detail-content">
          <el-row :gutter="10">
            <el-col :span="12">
              <span class="itemName">商户名称:</span>
              <span class="itemValue">{{ firstPageObj.merchantName }}</span>
            </el-col>
            <el-col :span="12">
              <span class="itemName">简称:</span>
              <span class="itemValue">
                {{ firstPageObj.merchantAbbreviation }}
              </span>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="12">
              <span class="itemName">商户类型:</span>
              <span class="itemValue">{{ firstPageObj.merchantTypeName }}</span>
            </el-col>
            <el-col :span="12">
              <span class="itemName">身份证:</span>
              <span class="itemValue">{{ firstPageObj.merchantOrgcode }}</span>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="12">
              <span class="itemName">地址:</span>
              <span class="itemValue">
                {{ firstPageObj.merchantAddress }}
              </span>
            </el-col>
            <el-col :span="12">
              <span class="itemName">联系人:</span>
              <span class="itemValue">{{ firstPageObj.merchantLegalPerson }}</span>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="12">
              <span class="itemName">联系电话:</span>
              <span class="itemValue">{{ firstPageObj.merchantLegalPersonPhone }}</span>
            </el-col>
            <el-col :span="12">
              <span class="itemName">营业范围:</span>
              <span class="itemValue">{{ firstPageObj.businessScopName }}</span>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="24">
              <span class="itemName">主营品牌:</span>
              <span class="itemValue">{{ firstPageObj.merchantBrandName }}</span>
            </el-col>
          </el-row>
        </div>
      </div>
    </div>
    <div class="pageTwo" v-show="curIndex == 1">
      <div class="wrapper-merchant">
        <div class="merchant-left">
          <div class="merchant-headerMsg">
            <div class="merchantImg"><img src="@/assets/merchant/merchantImg.png" alt="" /></div>
            <div class="merchant-content">
              <el-tooltip effect="dark" :content="secondPageObj.merchantName" placement="top">
                <div id="secondmerchantName">{{ secondPageObj.merchantName }}</div>
              </el-tooltip>

              <div>
                商户号:
                <span id="secondmerchantId">{{ secondPageObj.merchantNo }}</span>
              </div>
              <div>
                您共有
                <span id="numberOfSubMerchants">{{ secondPageObj.numberOfSubMerchants }}</span>
                个子商户,共有
                <span id="numberOfStores">{{ secondPageObj.numberOfStores }}</span>
                家门店
              </div>
            </div>
          </div>
          <div class="searchTreeInputWrap">
            <el-input v-model="treeInputName" placeholder="请输入" size="small"></el-input>
            <el-button type="primary" size="small">查询</el-button>
          </div>
          <!-- <form class="layui-form" action="">
                    <div class="layui-inline">
                      <div class="layui-input-inline" style="width: 232px">
                        <input class="layui-input" id="treeInput" placeholder="请输入" name="nameVal" />
                      </div>
                      <button type="button" id="merchantBtn" class="layui-btn">查询</button>
                    </div>
                  </form>
                  <ul id="merchantTree" class="ztree wrapper-tree"></ul> -->
        </div>
        <div class="merchant-right">
          <div>
            <div>
              <el-tooltip effect="dark" :content="secondPageObj.merchantName" placement="top">
                <span id="companyName" class="companyName">{{ secondPageObj.merchantName }}</span>
              </el-tooltip>

              <span class="emloyeeListText">员工列表</span>
            </div>
            <div>
              <el-input v-model="secondInputName" placeholder="请输入员工姓名/手机号" size="small"></el-input>
              <el-button type="primary" id="tableSearch" size="small" @click="getSecondTable">查询</el-button>
            </div>
          </div>
          <GLTable ref="subMerchantTable" :tableTotal="subMerchantTableTotal" :hasPage="false" :tableData="subMerchantTableList" :hasNum="true" :pageConf="pageConf" :tableParams="secondtableParams" @refreshTable="getSecondTable"></GLTable>
          <!-- <table id="subMerchantTable" lay-filter="subMerchantTool"></table> -->
        </div>
      </div>
    </div>
    <div class="pageThree" v-show="curIndex == 2">
      <div class="pageContent">
        <!-- :tableTotal="tableTotal" :tableData="updateRecordList" -->
        <GLTable ref="updateRecord" :tableTotal="tableTotal" :tableData="updateRecordList" :hasNum="true" :pageConf="pageConf" :tableParams="thirdtableParams" @refreshTable="getThirdTable"></GLTable>
      </div>
    </div>
  </div>
</template>

<script>
import { getThirdTable } from '@/api/modules/merchant'
export default {
  name: 'detailAccount',
  data() {
    return {
      //第一页数据
      titles: ['商户信息', '上级/下级商户', '修改记录'],
      curIndex: 0,
      firstPageObj: {},
      //第二页表
      secondPageObj: {},
      treeInputName: '',
      secondInputName: '',
      subMerchantTableList: [], //第二页的后台给表数据
      secondtableParams: {
        listName: 'data',
        tableColumns: [
          {
            label: '员工姓名',
            prop: 'staffName'
          },
          {
            label: '角色',
            prop: 'roleName'
          },
          {
            label: '登录账户',
            prop: 'staffPhone'
          },
          {
            label: '企微号',
            prop: 'entmicroName'
          },
          {
            label: '创建时间',
            prop: 'createdTime',
            width: 180
          }
        ]
      },

      subMerchantTableTotal: 0,
      //第三页表
      searchTableForm: {},
      updateRecordList: [],
      thirdtableParams: {
        listName: 'data',
        tableColumns: [
          {
            label: '登录账户',
            prop: 'operator'
          },
          {
            label: '登录产品',
            prop: 'productName'
          },
          {
            label: '登录IP',
            prop: 'ip'
          },
          {
            label: '修改内容',
            prop: 'modifyContent'
          },
          {
            label: '操作人',
            prop: 'userName',
            width: 180
          },
          {
            label: '操作时间',
            prop: 'createdTime',
            width: 180
          }
        ]
      },
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
      //   layout: 'sizes, prev, pager, next, jumper, ->, total',
      tableTotal: 0,
      merchantId: this.$route.query.id //需要从外面传进来
    }
  },
  created() {
    //请求商户信息, 上下级商户  修改纪录
    this.searchTableForm = {
      bussinessId: this.merchantId,
      moduleName: '商户模块'
    }
    this.getFirstInfo()
    //  this.findMenuFunTreeByMerId()
    this.getSecondInfo()
    //  this.getSecondTree()
  },
  mounted() {
    this.getThirdTable()

    this.getSecondTable()
  },
  methods: {
    tabClick(index) {
      this.curIndex = index
      switch (index) {
        case 0:
          //   this.currentType = "pop";
          break
        case 1:
          //   this.currentType = "new";

          break
        case 2:
          // this.getThirdTable()

          break
      }
    },
    getFirstInfo() {
      this.$apis.merchant.getFirstInfo({ id: this.merchantId }).then(res => {
        if (res) {
          this.firstPageObj = res
        }
      })
    },
    getSecondInfo() {
      this.$apis.merchant.getSecondInfo({ id: this.merchantId }).then(res => {
        if (res) {
          console.log('二页', res)
          this.secondPageObj = res
        }
      })
    },
    getSecondTable() {
      var param = {}
      param.keyword = this.secondInputName
      param.merchantId = this.merchantId
      // param.pageSize = 1000
      // param.pageNum = 1
      // param.pageSize=this.$refs.subMerchantTable.page.pageSize
      // param.pageNum=this.$refs.subMerchantTable.page.pageNum
      this.$apis.merchant.getSecondTable(param).then(res => {
        if (res) {
          console.log('2', res)
          this.subMerchantTableList = res
          this.subMerchantTableTotal = res.length
        }
        if (res && res.length == 0) {
          this.$refs.subMerchantTable.setTableHeightFun()
        }
      })
    },
    getThirdTable() {
      var params = {
        bussinessId: this.merchantId,
        moduleName: '商户模块',
        pageSize: this.$refs.updateRecord.page.pageSize,
        pageNum: this.$refs.updateRecord.page.pageNum
      }

      //  this.$apis.merchant.getThirdTable
      getThirdTable(params).then(res => {
        if (res) {
          this.updateRecordList = res.data
          this.tableTotal = res.count
        }
        if (res.data && res.data.length == 0) {
          this.$refs.updateRecord.setTableHeightFun()
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.merchantDetail {
  .titles {
    display: flex;

    .itemTitle {
      margin-right: 20px;
      list-style-type: none;
      height: 20px;
      font-size: 16px;

      font-weight: 400;
      color: #666666;
      line-height: 20px;
      padding-bottom: 10px;
    }
    .active {
      color: #5850ff;
      border-bottom: 2px solid #5850ff;
    }
  }
  .pageOne {
    .MsgWrap {
      position: relative;
      background-color: #fff;
      margin-bottom: 20px;
      /* min-height: 300px; */
      .grayLine {
        position: absolute;
        left: 0;
        top: 48px;
        background-color: #d8d8d8;
        width: 100%;
        height: 1px;
      }
      .content-title {
        display: inline-block;
        position: relative;
        height: 48px;
        background-color: #fff;
        font-size: 16px;
        font-weight: 600;
        color: #333333;
        line-height: 48px;
        /* margin-top: 8px; */
        /* margin:8px 20px 15px 20px;  */
        padding-left: 20px;
      }
      .content-title h3 {
        margin-left: 20px;
      }
      .detail-content {
        padding: 10px 0 30px;
        // padding-bottom: 30px;
        .el-row {
          margin-top: 20px;
          .itemName {
            display: inline-block;
            margin-right: 20px;
            width: 200px;
            text-align: right;
            height: 20px;
            font-size: 14px;

            font-weight: 400;
            color: #333333;
            line-height: 20px;
          }
          .itemValue {
            height: 20px;
            font-size: 14px;

            font-weight: 400;
            color: #666666;
            line-height: 20px;
          }
          .account-type-span {
            display: inline-block;
            padding: 9px 15px;
            background-color: #f3f2ff;
            border-radius: 4px;
            color: #5850ff !important;
            line-height: 14px;
            margin-right: 10px;
            margin-bottom: 10px;
          }
        }
      }
    }
  }
  .pageTwo {
    .wrapper-merchant {
      background-color: #f4f5fa;
      display: flex;
      .merchant-left {
        padding-top: 15px;
        padding-left: 20px;
        min-height: calc(100vh - 200px);
        background-color: #fff;
        width: 340px;
        margin-right: 20px;
        box-sizing: border-box;
        overflow: auto;
        .merchant-headerMsg {
          display: flex;

          .merchantImg {
            width: 64px;
            height: 64px;
            img {
              display: inline-block;
              width: 100%;
              height: 100%;
            }
          }
          .merchant-content {
            #secondmerchantName {
              margin-left: 15px;
              // width: 240px;
              max-width: 220px;
              height: 24px;
              font-size: 16px;
              font-weight: 500;
              color: #333333;
              line-height: 24px;
              overflow: hidden;
              text-overflow: ellipsis;
              white-space: nowrap;
              word-break: break-all;
            }
            > div:not(:first-child) {
              margin-left: 15px;
              height: 20px;
              font-size: 12px;
              font-weight: 400;
              color: #999999;
              line-height: 20px;
            }
          }
        }

        .searchTreeInputWrap {
          display: flex;
          margin-top: 20px;
          padding-right: 20px;
          .el-button {
            margin-left: 10px;
          }
        }
      }
      // .ztree .wrapper-tree {
      //   overflow-y: auto;
      // }
      // .wrapper-tree::-webkit-scrollbar {
      //   display: none;
      // }
      // .wrapper-tree .node_name {
      //   display: inline-block;
      //   max-width: 235px;
      //   overflow: hidden;
      //   text-overflow: ellipsis;
      //   white-space: nowrap;
      //   word-break: break-all;
      // }
      // .detail .wrapper-tree {
      //   margin-left: 0;
      // }

      .merchant-right {
        padding-top: 15px;
        padding-bottom: 20px;
        width: calc(100vw - 340px - 20px);
        overflow-x: auto;

        background-color: #fff;
        padding-left: 20px;
        padding-right: 20px;
        box-sizing: border-box;
        > div:first-child {
          display: flex;
          align-items: flex-start;
          justify-content: space-between;
          margin-bottom: 20px;
          div {
            display: flex;
          }
        }
        .companyName {
          display: inline-block;
          max-width: 300px;
          height: 36px;
          font-size: 16px;

          font-weight: 500;
          color: #333333;

          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          word-break: break-all;
        }
        .emloyeeListText {
          display: inline-block;
          height: 36px;
          font-size: 16px;
          font-weight: 500;
          color: #333333;
        }
        .el-button {
          margin-left: 20px;
        }
      }
    }
  }

  .pageThree {
    .pageContent {
      background-color: #fff;
      padding: 20px;
    }
  }
}
</style>