legalPersonList.vue 6.67 KB
<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="12">
            <a-form-item label="客户编号">
              <a-input placeholder="输入客户编号" v-model="queryParam.customerNo"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="12">
            <a-form-item label="企业客户名称">
              <a-input placeholder="输入企业客户名称" v-model="queryParam.enterpriseName"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="12">
            <a-form-item label="统一社会信用代码">
              <a-input placeholder="统一社会信用代码" v-model="queryParam.orgCode"></a-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :md="6" :sm="12">
              <a-form-item label="客户名称">
                <a-input placeholder="输入客户名称" v-model="queryParam.customerName"></a-input>
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="12">
              <a-form-item label="客户手机号">
                <a-input placeholder="输入客户手机号" v-model="queryParam.mobilePhone"></a-input>
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="8">
              <a-form-item label="客户状态">
                <a-select v-model="queryParam.status" placeholder="请选择">
                  <a-select-option v-for="(item, index) in userStatus" :key="index">
                    {{item.label}}
                  </a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
          </template>
          <a-col :md="6" :sm="8">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
              </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- table区域-begin -->
    <div>
      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" :scroll="{x:1800}" @change="handleTableChange">
        <!-- 字符串超长截取省略号显示-->
        <span slot="esContent" slot-scope="text">
          <j-ellipsis :value="text" :length="10" />
        </span>

        <span slot="action" slot-scope="text, record">
          <a href="javascript:;" @click="handleDetailBai(record,'客户信息详情')" v-has="'legalPersonList:look'">查看</a>
          <a-divider type="vertical" />
          <a @click="handleEditBai(record,'修改客户信息')" v-has="'legalPersonList:edit'">修改</a>
        </span>
      </a-table>
    </div>
    <!-- table区域-end -->
    <legal-person-list-modal ref="modalForm" @ok="modalFormOk"></legal-person-list-modal>
  </a-card>
</template>
<script>
import legalPersonListModal from './modules/legalPersonListModal'
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import { queryCusLegalPersonInfo } from '@/api/configApi'
import { userStatus } from '@/data/params'

export default {
  name: 'legalPersonList',
  mixins: [JeecgListMixin],
  components: {
    legalPersonListModal,
  },
  data () {
    return {
      queryParam: {},
      userStatus: userStatus,
      columns: [
        {
          title: '序号',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '客户编号',
          align: 'center',
          dataIndex: 'customerNo'
        },
        {
          title: '客户名称',
          align: 'center',
          dataIndex: 'customerName'
        },
        {
          title: '客户身份证号码',
          align: 'center',
          dataIndex: 'idCardNoView'
        },
        {
          title: '客户手机号',
          align: 'center',
          dataIndex: 'mobilePhoneView'
        },
        {
          title: '企业客户名称',
          align: 'center',
          dataIndex: 'enterpriseName'
        },
        {
          title: '统一社会信用代码',
          align: 'center',
          dataIndex: 'orgCode'
        },
        {
          title: '客户状态',
          align: 'center',
          dataIndex: 'status',
          customRender: function (t, r, index) {
            for (var i = 0; i < userStatus.length; i++) {
              if (t === userStatus[i].value) {
                return userStatus[i].label
              }
            }
          }
        },
        {
          title: '创建时间',
          align: 'center',
          dataIndex: 'createTime'
        },
        {
          title: '更新时间',
          align: 'center',
          dataIndex: 'updateTime'
        },
        {
          title: '操作',
          dataIndex: 'action',
          scopedSlots: { customRender: 'action' },
          align: 'center',
          width: 120,
          fixed: 'right'
        }
      ],
      url: {
        list: '/customer/admin/queryCusLegalPersonPage',
      }
    }
  },
  methods: {
    handleEditBai: function (record, title) {
      let _p = {
        "customerNo": record.customerNo,
      };
      queryCusLegalPersonInfo(_p).then(res => {
        if (res.status.statusCode == 0) {
          this.$refs.modalForm.edit(res.result, record.customerNo)
        } else {
          this.$message.warning(res.status.statusReason)
        }
      })
      this.$refs.modalForm.title = title
      this.$refs.modalForm.disableSubmit = false
      this.$refs.modalForm.onlyread = true
    },
    handleDetailBai: function (record, title) {
      let _p = {
        "customerNo": record.customerNo,
      };
      queryCusLegalPersonInfo(_p).then(res => {
        if (res.status.statusCode == 0) {
          this.$refs.modalForm.edit(res.result, record.customerNo)
        } else {
          this.$message.warning(res.status.statusReason)
        }
      })
      this.$refs.modalForm.title = title
      this.$refs.modalForm.disableSubmit = true
      this.$refs.modalForm.onlyread = true
    },
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>