123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <template>
- <div class="hui-flex hui-content">
- <div class="hui-content-title">
- <div class="hui-title-item active">企业列表</div>
- </div>
- <div class="hui-flex-box hui-flex hui-table">
- <div class="hui-content-insert">
- <el-button type="primary" size="medium" @click="insertProject">新增企业</el-button>
- </div>
- <div class="hui-flex-box">
- <el-table :data="tableData" row-key="id" border height="100%">
- <el-table-column label="序号" width="50">
- <template slot-scope="scope">
- <div style="text-align: center;">{{scope.$index + 1}}</div>
- </template>
- </el-table-column>
- <el-table-column label="企业名称" prop="name"></el-table-column>
- <el-table-column label="企业类型">
- <template slot-scope="scope">
- <span>{{$field.findTypeName('industryType',scope.row.industryType)}}</span>
- </template>
- </el-table-column>
- <el-table-column label="企业法人" prop="legalPerson"></el-table-column>
- <el-table-column label="成立时间" prop="establishDate"></el-table-column>
- <el-table-column label="营业期限" prop="businessTerm"></el-table-column>
- <el-table-column label="操作" width="150">
- <template slot-scope="scope">
- <div class="hui-table-operation">
- <span class="table-operation" @click="lookProject(scope.row)">详情</span>
- <span class="table-operation" @click="updateProject(scope.row)">编辑</span>
- <span class="table-operation" @click="deleteProject(scope.row)">删除</span>
- </div>
- </template>
- </el-table-column>
- <template slot="empty">
- <empty description="暂无数据"></empty>
- </template>
- </el-table>
- </div>
- <div class="hui-content-pagination">
- <el-pagination :page-size="pageSize" :pager-count="9" layout="prev, pager, next" :total="totalCount"
- @current-change="currentChange">
- </el-pagination>
- </div>
- </div>
- <el-dialog :title="isUpdate?'编辑':'新增'" :visible.sync="visible" width="900px" :append-to-body="true">
- <edit v-if="visible" @callback="callback" :isUpdate="isUpdate" :detailId="detailId"></edit>
- </el-dialog>
- <el-drawer title="项目详情" :visible.sync="drawer" :size="400" :append-to-body="true">
- <detail v-if="drawer" :detailId="detailId"></detail>
- </el-drawer>
- </div>
- </template>
- <script>
- import {
- getOrganizationListByPage,
- deleteOrganizationById
- } from '@/httpApi/business'
- import edit from '@/components/work/business/organization/edit'
- import detail from '@/components/work/business/organization/detail'
- export default {
- data() {
- return {
- tableData: [],
- currPage: 1,
- pageSize: 10,
- totalCount: 0,
- visible: false,
- detailId: '',
- isUpdate: false,
- drawer: false
- }
- },
- created() {
- this.init();
- },
- methods: {
- init() {
- getOrganizationListByPage({
- currPage: this.currPage,
- pageSize: this.pageSize,
- organizationId: this.$store.getters.organization.id
- }).then(res => {
- if (res.state) {
- this.tableData = res.data.dataList;
- this.totalCount = res.data.totalCount;
- }
- })
- },
- currentChange(currPage) {
- this.currPage = currPage;
- this.init();
- },
- insertProject() {
- this.isUpdate = false;
- this.visible = true;
- },
- updateProject(val) {
- this.detailId = val.id;
- this.isUpdate = true;
- this.visible = true;
- },
- lookProject(val) {
- this.detailId = val.id;
- this.drawer = true;
- },
- deleteProject(val) {
- this.$confirm('确定要删除该企业?', () => {
- deleteOrganizationById(val.id).then(res => {
- if (res.state) {
- this.init();
- this.$message.success('操作成功');
- }
- })
- });
- },
- callback(type) {
- if (type === 'init') this.init();
- this.visible = false;
- }
- },
- components: {
- edit,
- detail
- },
- }
- </script>
- <style lang="scss"></style>
|