companyInformationList.vue 7.05 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="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.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 @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="'enterpriseInfoCustomerList:look'"
            icon="search"
            style="font-size: 12px"
            >查看</a-button
          >
          <a-divider type="vertical" />
          <a-button
            type="link"
            size="small"
            @click="handleEditBai(record, '修改企业信息')"
            v-has="'enterpriseInfoCustomerList:edit'"
            icon="edit"
            style="font-size: 12px"
            >修改</a-button
          >
        </span>
      </a-table>
    </div>
    <!-- table区域-end -->
    <company-information-list-modal ref="modalForm" @ok="modalFormOk"></company-information-list-modal>
  </a-card>
</template>
<script>
import CompanyInformationListModal from './modules/CompanyInformationListModal'
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import { queryCusEnterpriseInfo } from '@/api/configApi'
import { userStatus } from '@/data/params'

export default {
  name: 'companyInformationList',
  mixins: [JeecgListMixin],
  components: {
    CompanyInformationListModal,
  },
  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: 300,
        },
        {
          title: '统一社会信用代码',
          align: 'center',
          dataIndex: 'orgCode',
          width: 200,
        },
        {
          title: '企业联系电话',
          align: 'center',
          dataIndex: 'mobilePhoneView',
          width: 180,
        },
        {
          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/queryCusEnterprisePage',
      },
    }
  },
  methods: {
    handleEditBai: function (record, title) {
      console.log(record)
      let _p = {
        customerNo: record.customerNo,
        isDecrypt: false,
      }
      queryCusEnterpriseInfo(_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,
      }
      queryCusEnterpriseInfo(_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>