attributeList.vue 4.52 KB
<template>
  <div>
    <div class="scrm-sub-client-container">
      <div class="pageContent">
        <GLCombiForm ref="combiForm" :formObj="searchForm" :formData="clientManageFormList" @handleOk="searchTable" @handleRest="resetTable"></GLCombiForm>
      </div>
    </div>
  </div>
</template>

<script>
import { getDictionaryFun } from '@/api/modules/clientManage'
export default {
  name: 'attributeList',
  data() {
    return {
      searchForm: {
        addWay: ''
      },
      clientManageFormList: [
        {
          type: 'input',
          inputType: 'text',
          name: 'customerName',
          label: '客户名称',
          placeholder: '请输入客户名称'
        },
        {
          type: 'select',
          name: 'addWay',
          label: '添加来源',
          optionLabel: 'label',
          optionId: 'value',
          placeholder: '请选择当前来源',
          optionList: [] //this.$Constants.SOURCE_OPTION
        },
        {
          type: 'datePicker',
          name: 'purchaseCar',
          label: '购车时间',
          valueFormat: 'yyyy-MM-dd',
          pickerOptions: {
            disabledDate(time) {
              return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
            }
          }
        }
      ],

      sourceList: []
    }
  },
  created() {
    this.getDictionaryFun()
  },
  methods: {
    getDictionaryFun() {
      getDictionaryFun({ dictType: 'add_way' }).then(res => {
        if (!res) {
          return
        }
        // addWaySource
        const id = this.clientManageFormList.findIndex(item => {
          return item.name == 'addWay'
        })
        let data = res.map(item => {
          return {
            // ...item,
            label: item.dictLabel,
            value: item.dictValue
          }
        })
        data.unshift({ label: '全部', value: '' })
        this.sourceList = data || []
        if (data && data.length > 0) {
          window.localStorage.setItem('sourceList', JSON.stringify(data))
        }
        this.$set(this.clientManageFormList[id], 'optionList', data)
      })
    },


    //搜索表格
    searchTable() {
      this.$refs.clientManage.refreshTable()
    },
    //重置表格
    resetTable() {
      this.searchForm = {}
      this.$refs.clientManage.refreshTable()
      // 点击之后强制页面刷新
      // this.reload()
      // this.$forceUpdate()  // 没用
      // this.$router.go(0)//没有预期效果,会出现一段空白页,用户体验不好
      // location.reload()   //没有预期效果,会出现一段空白页,用户体验不好
    },

  },
  mounted() {}
}
</script>

<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
// /deep/.el-table .el-table__header tr th{
//   line-height: 30px;
// }
.expandImg {
  display: flex;
  // justify-content: center;
  .smallFontSize {
    margin-left: 2px;
    height: 20px;
    font-size: 12px;
    letter-spacing: 0;
    line-height: 20px;
    font-weight: 400;
  }
  .imgEll {
    margin-left: 6.5px;
    cursor: pointer;
    // margin-bottom:3px;
  }
}
.pure-green-text {
  color: #61cc43;
}
.pure-yello-text {
  color: #fb8f28;
}
.scrm-sub-client-container {
  .pageTitle {
    margin-bottom: 20px;
    position: relative;
    height: 20px;
    font-size: 20px;
    font-weight: 700;
    color: #333333;
    line-height: 20px;
    letter-spacing: 1px;
  }
  .pageContent {
    .leadList {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      div {
        text-align: center;
        span:nth-child(1) {
          font-weight: 600;
          font-size: 16px;
        }
      }
      /deep/ .el-button {
        color: #5850ff;
        border: 1px solid #5850ff;
      }
    }
    padding: 20px 20px 30px;
    background-color: #fff;
    .el-button + .el-button {
      margin-left: 10px;
    }
    .searchTop {
      // margin-bottom: 20px;
    }
    .glsx-table {
      // /deep/ .el-table__fixed {
      //   height: 100% !important; //设置高优先,以覆盖内联样式
      // }
      /deep/ .el-table__fixed,
      /deep/ .el-table__fixed-right {
        height: 100% !important; //设置高优先,以覆盖内联样式
      }
    }

    .entmicro {
      display: flex;
      i {
        color: #75acff;
        margin-right: 3px;
        font-size: 14px;
      }
      // }
    }

    .el-tag {
      // margin-right: 10px;
      max-width: 110px;
      cursor: pointer;
      background-color: #fff !important;
    }
  }
}
</style>