personalInformationList.vue 6.61 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.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>
          <template v-if="toggleSearchStatus">
            <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 @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:1600}" @change="handleTableChange">
        <!-- 字符串超长截取省略号显示-->
        <span slot="esContent" slot-scope="text">
          <j-ellipsis :value="text" :length="10" />
        </span>

        <span slot="action" slot-scope="text, record">
          <a-button
            type="link"
            size="small"
            @click="handleDetailBai(record,'客户信息详情')" v-has="'personalInfoCustomerList:look'"
            icon="search"
            style="font-size: 12px"
            >查看</a-button
          >
          <a-divider type="vertical" />
          <a-button
            type="link"
            size="small"
            @click="handleEditBai(record,'修改客户信息')" v-has="'personalInfoCustomerList:edit'"
            icon="edit"
            style="font-size: 12px"
            >修改</a-button
          >
        </span>
      </a-table>
    </div>
    <!-- table区域-end -->
    <personal-information-list-modal ref="modalForm" @ok="modalFormOk"></personal-information-list-modal>
  </a-card>
</template>
<script>
import PersonalInformationListModal from './modules/PersonalInformationListModal'
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import { queryCusPersonalInfo } from '@/api/configApi'
import { userStatus } from '@/data/params'

export default {
  name: 'personalInformationList',
  mixins: [JeecgListMixin],
  components: {
    PersonalInformationListModal,
  },
  data () {
    return {
      queryParam: {},
      userStatus: userStatus,
      columns: [
        {
          title: '序号',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          width:55,
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '客户编号',
          align: 'center',
          dataIndex: 'customerNo',
          width:280
        },
        {
          title: '客户名称',
          align: 'center',
          dataIndex: 'customerName',
          width:120
        },
        {
          title: '身份证号码',
          align: 'center',
          dataIndex: 'idCardNoView',
          width:180
        },
        {
          title: '手机号码',
          align: 'center',
          dataIndex: 'mobilePhoneView',
          width:120
        },
        {
          title: '客户状态',
          align: 'center',
          dataIndex: 'status',
          width:120,
          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: 'businessDepartmentNm',
          width:180,
        },
        {
          title: '创建时间',
          align: 'center',
          dataIndex: 'createTime',
          width:180,
        },
        {
          title: '更新时间',
          align: 'center',
          dataIndex: 'updateTime',
          width:180,
        },
        {
          title: '操作',
          dataIndex: 'action',
          scopedSlots: { customRender: 'action' },
          align: 'center',
          width: 180,
          fixed: 'right'
        }
      ],
      url: {
        list: '/customer/admin/queryCusPersonalPage',
      }
    }
  },
  computed: {},
  methods: {
    handleEditBai: function (record, title) {
      let _p = {
        customerNo: record.customerNo,
        isDecrypt:false
      };
      queryCusPersonalInfo(_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,
        isDecrypt:false
      };
      queryCusPersonalInfo(_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>