MrShi
2024-11-15 30cfb2b836a8a3d609518cc295753b58b17a9bc7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<template>
    <GlobalWindow
        :title="title"
        width="100%"
        :withFooter="false"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
    >
        <el-form ref="form" :model="form" label-width="100px" inline>
            <el-form-item label="企业名称" prop="name">
                <el-input v-model="form.model.name" placeholder="请输入" @keypress.enter.native="getList"></el-input>
            </el-form-item>
            <el-form-item>
                <div style="display: flex; align-items: center;">
                    <el-button type="primary" @click="getList">搜索</el-button>
                    <el-button @click="reset">重置</el-button>
                </div>
            </el-form-item>
        </el-form>
        <el-table
            :data="tableData"
            border
            style="width: 100%">
            <el-table-column
                prop="name"
                label="企业名称">
            </el-table-column>
            <el-table-column
                width="170"
                prop="code"
                label="统一信用代码">
            </el-table-column>
            <el-table-column
                prop="createDate"
                label="创建时间">
            </el-table-column>
            <el-table-column
                prop="phone"
                label="绑定手机">
            </el-table-column>
            <el-table-column
                width="90"
                label="启用状态">
                <template slot-scope="{row}">
                    <span v-if="row.status === 0">启用</span>
                    <span v-if="row.status === 1">禁用</span>
                </template>
            </el-table-column>
            <el-table-column
                label="电子签认证状态">
                <template slot-scope="{row}">
                    <template v-if="row.signStatus === 0">待认证</template>
                    <template v-if="row.signStatus === 1">认证中</template>
                    <template v-if="row.signStatus === 2">认证失败</template>
                    <template v-if="row.signStatus === 3">认证通过</template>
                </template>
            </el-table-column>
            <el-table-column
                label="操作">
                <template slot-scope="{row}">
                    <el-button type="text" @click="selectItem(row)">选择</el-button>
                </template>
            </el-table-column>
        </el-table>
        <div style="width: 100%; height: 15px;"></div>
        <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="form.page"
            :page-sizes="[10, 30, 50, 100]"
            :page-size="form.size"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total">
        </el-pagination>
    </GlobalWindow>
</template>
 
<script>
  import BaseOpera from '@/components/base/BaseOpera'
  import GlobalWindow from '@/components/common/GlobalWindow'
  import { fetchList } from '@/api/business/company'
  export default {
    name: 'chooseCompany',
    extends: BaseOpera,
    components: { GlobalWindow },
    data () {
      return {
        model: {},
        tableData: [],
        form: {
          page: 1,
          capacity: 10,
          model: {
            type: 0,
            name: '',
            status: 0,
            isdeleted: 1
          }
        },
        total: 0
      }
    },
    methods: {
      selectItem(row) {
        this.$emit('submit', { companyId: row.id, companyName: row.name })
        this.visible = false
      },
      handleSizeChange(e) {
        this.form.capacity = e
        this.getList()
      },
      handleCurrentChange(e) {
        this.form.page = e
        this.getList()
      },
      open (title, id) {
        this.title = title
        this.form.name = ''
        this.visible = true
        this.form.page = 1
        this.form.capacity = 10
        this.getList()
      },
      reset() {
        this.form.page = 1
        this.form.capacity = 10
        this.form.model.name = ''
        this.getList()
      },
      getList() {
        fetchList(this.form)
          .then(res => {
            this.total = res.total
            this.tableData = res.records
          })
      }
    }
  }
</script>
 
<style lang="scss" scoped>
 
</style>