123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- <template>
- <div class="app-container">
- <div class="title-container">
- <breadcrumb id="breadcrumb-container" class="breadcrumb-container"/>
- </div>
- <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="getList">
- <template slot="left">
- <PermissionButton
- menu-code="_views_market_customer_add"
- class-name="filter-item"
- type="primary"
- name
- size="mini"
- :page-jump="true"
- round
- style="float: left"
- />
- <el-input
- v-model="name"
- placeholder="客户名称"
- clearable
- style="margin-left: 20px;width: 320px;float: left;">
- </el-input>
- <el-select clearable style="margin-left: 20px;width: 200px;float: left;" v-model="listQuery.resignState" placeholder="客户等级">
- <el-option v-for="(item, index) in AllEnum['客户等级']" :key="index" :label="item" :value="item"/>
- </el-select>
- <el-button
- class="filter-item"
- style="margin-left: 10px;float: left;"
- type="primary"
- @click="searchList"
- round
- >搜索
- </el-button>
- <el-button
- class="filter-item"
- style="float: left;"
- round
- type="warning"
- @click="resetSearch()"
- >重置
- </el-button>
- </template>
- <parentTable
- v-loading="listLoading"
- :data="pageData.records"
- slot="table"
- style="width: 100%;"
- >
- <el-table-column label="客户名称" align="center">
- <template slot-scope="{row}">
- <span>{{ row.name }}</span>
- </template>
- </el-table-column>
- <el-table-column label="市" align="center" width="120">
- <template slot-scope="{row}">
- <span>{{ row.city }}</span>
- </template>
- </el-table-column>
- <el-table-column label="区/县" align="center" width="120">
- <template slot-scope="{row}">
- <span>{{ row.county }}</span>
- </template>
- </el-table-column>
- <el-table-column label="部门" align="center" width="120">
- <template slot-scope="{row}">
- <span>{{ row.department }}</span>
- </template>
- </el-table-column>
- <el-table-column label="职位" align="center" width="120">
- <template slot-scope="{row}">
- <span>{{ row.position }}</span>
- </template>
- </el-table-column>
- <el-table-column label="科室" align="center" width="120">
- <template slot-scope="{row}">
- <span>{{ row.section }}</span>
- </template>
- </el-table-column>
- <el-table-column label="联系电话" align="center" width="120">
- <template slot-scope="{row}">
- <span>{{ row.mobile }}</span>
- </template>
- </el-table-column>
- <el-table-column label="微信号" align="center" width="120">
- <template slot-scope="{row}">
- <span>{{ row.wechatNo }}</span>
- </template>
- </el-table-column>
- <el-table-column label="QQ号" align="center" width="120">
- <template slot-scope="{row}">
- <span>{{ row.qq }}</span>
- </template>
- </el-table-column>
- <el-table-column label="客户等级" align="center" width="120">
- <template slot-scope="{row}">
- <span>{{ row.level }}</span>
- </template>
- </el-table-column>
- <el-table-column label="客户地址" align="center" width="120">
- <template slot-scope="{row}">
- <span>{{ row.address }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="{row}">
- <PermissionButton
- menu-code="_views_market_customer_detail"
- class-name="filter-item"
- name=""
- type="primary"
- :page-jump="true"
- :page-query="{id: row.id}"
- round
- size="mini"
- />
- <PermissionButton
- menu-code="_views_market_customer_remove"
- class-name="filter-item"
- name=""
- type="danger"
- round
- size="mini"
- @click="deleteInfo(row.id)"
- />
- </template>
- </el-table-column>
- </parentTable>
- </y-page-list-layout>
- </div>
- </template>
- <script>
- import YPageListLayout from '@/components/YPageListLayout'
- import Breadcrumb from '@/components/Breadcrumb'
- import PermissionButton from '@/components/PermissionButton/PermissionButton'
- export default {
- name: 'ViewsStaffList',
- components: {
- Breadcrumb,
- YPageListLayout,
- PermissionButton,
- },
- filters: {
- statusFilter(status) {
- const statusMap = {
- published: 'success',
- draft: 'info',
- deleted: 'danger',
- }
- return statusMap[status]
- },
- },
- data() {
- return {
- isDisable:false,
- tableKey: 0,
- pageData: { records: [] },
- total: 20,
- listLoading: true,
- listQuery: {
- page: 1,
- size: 10,
- descs: 'id',
- },
- listQueryKey: 'keyword',
- importLoading: false,
- name:null,
- city:null,
- county:null
- }
- },
- created() {
- const that = this;
- that.getAllEnum();
- that.getList();
- },
- methods: {
- getAllEnum() {
- const that = this;
- that.$api.globalConfig.getAllEnum().then(data => {
- if (data.code === 200) {
- that.AllEnum = data.data
- } else {
- this.$message({
- type: 'error',
- message: data.msg
- })
- }
- })
- },
- resetSearch() {
- this.listQuery = {
- current: 1,
- size: 10,
- descs: 'id',
- }
- this.getList()
- },
- removeHandle(row) {
- // console.log(data)
- const that = this
- that
- .$confirm('确认删除当前记录吗?', '警告', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(async () => {
- this.$api.customer.delete(row.id).then((res) => {
- if (res.code === 200) {
- this.$message({
- type: 'success',
- message: '删除成功',
- })
- this.getList()
- }
- })
- })
- .catch((err) => {
- console.error(err)
- })
- },
- searchList() {
- // 重置分页
- this.listQuery.page = 1
- this.listQuery.size = 10
- this.getList()
- },
- getList() {
- const that = this
- this.listLoading = true
- // console.log(that.listQuery)
- const key = {}
- key[this.listQueryKey] = this.listQuery.description
- this.$api.customer
- .list(Object.assign({}, that.listQuery, key))
- .then((res) => {
- that.pageData = res.data
- setTimeout(() => {
- that.listLoading = false
- }, 200)
- })
- .catch(() => {
- that.listLoading = false
- })
- },
- deleteInfo(id) {
- const that = this
- that.$confirm('请确认是否删除该数据?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- center: true
- }).then(() => {
- that.$api.customer.delete(id).then(data => {
- that.loading = false
- if (data.code === 200) {
- that.getList()
- } else {
- this.$message({
- type: 'error',
- message: data.msg
- })
- }
- })
- }).catch(() => {
- })
- }
- },
- }
- </script>
- <style lang="scss" scoped>
- .right {
- flex: 1;
- .title {
- font-size: 16px;
- font-weight: 500;
- color: rgba(51, 51, 51, 1);
- line-height: 35px;
- margin-bottom: 8px;
- }
- .menu-2-box {
- display: flex;
- flex-wrap: wrap;
- width: 100%;
- }
- .menu-2-item {
- display: flex;
- align-items: center;
- color: #656565;
- font-size: 12px;
- width: 230px;
- height: 101px;
- background: rgb(255, 185, 129);
- border-radius: 3px;
- padding-left: 20px;
- margin-right: 10px;
- margin-bottom: 10px;
- cursor: pointer;
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
- .text {
- margin-left: 16px;
- }
- }
- }
- </style>
|