123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <template>
- <div style="height:100%">
- <p class="info">公司总览</p>
- <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" :header-cell-style="{ textAlign: 'center' }"
- :cell-style="{ textAlign: 'center' }" height="400" style="width: 98%" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="50">
- </el-table-column>
- <el-table-column prop="company_name" label="公司名称">
- </el-table-column>
- <el-table-column prop="code" label="社会信用代码">
- </el-table-column>
- <el-table-column prop="legal_person_name" label="公司法人">
- </el-table-column>
- <el-table-column prop="contact_person" label="联系人">
- </el-table-column>
- <el-table-column prop="contact_phone" label="联系电话">
- </el-table-column>
- <el-table-column prop="operation" label="操作">
- <template slot-scope="scope">
- <el-button size="mini" type="text" style="color: #2ea8e6" @click="infoDetail(scope.row)">查看</el-button>
- <el-button size="mini" type="text" style="color: #2ea8e6" @click="infoEdit(scope.row)">编辑</el-button>
- <el-button size="mini" type="text" style="color: #2ea8e6" @click="deleteInfo(scope.row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div class="bottom">
- <page class="page" :paginationData="paginationData"></page>
- </div>
- </div>
- </template>
- <script>
- import checkbox from '@/components/Checkbox/index';
- import page from '@/components/pagination/index';
- import {delCompanyInfo, getAllCompanyList, getCompanyList} from "@/api/company/company";
- export default {
- components: { checkbox, page },
- emits: ['nodeClick'],
- data() {
- return {
- filterText: '',
- tableData: [{
- corporation_name: '中讯邮电咨询设计院有限公司',
- Sccode: '4032',
- legal_person: '张三',
- contact_person: '张三',
- contact_phone: '12345678901',
- }, {
- corporation_name: '北京电信规划院有限公司',
- Sccode: '9416',
- legal_person: '李四',
- contact_person: '李四',
- contact_phone: '12345678901',
- }, {
- corporation_name: '北京电信规划院有限公司',
- Sccode: '9416',
- legal_person: '李四',
- contact_person: '李四',
- contact_phone: '12345678901',
- }],
- multipleSelection: [],
- currentPageSize: 10,
- currentPage: 1,
- paginationData: {
- pageSize: 10,
- pagerCount: 5,
- currentPage: 1,
- pageSizes: [5, 10, 20, 30],
- total: 30,
- currentChange: (val) => {
- this.getTableData(val);
- },
- handleSizeChange: (val) => {
- this.handleSizeChange(val);
- },
- },
- }
- },
- watch: {
- filterText(val) {
- //
- }
- },
- mounted() {
- this.initData();
- },
- methods: {
- handleClick() {
- //
- },
- handleSelectionChange(val) {
- this.multipleSelection = val;
- },
- initData() {
- this.getTableData(1);
- },
- getTableData(page) {
- getAllCompanyList('', this.paginationData.currentPage, this.paginationData.pageSize).then(res=>{
- let data = res.data;
- if (data.code == '0') {
- this.paginationData.total = data.total
- this.tableData = data.data
- } else {
- this.$message.error(data.message);
- }
- })
- },
- infoDetail(data) {
- data.type='company'
- this.$emit('nodeClick', data)
- },
- infoEdit(data) {
- data.type='company'
- this.$emit('nodeClick', data)
- },
- deleteInfo(data) {
- this.$confirm('确定要删除吗?', '提示', {
- type: 'warning'
- }).then(()=>{
- delCompanyInfo(data.id).then(res=>{
- let data = res.data;
- if (data.code == 0) {
- this.getTableData(1)
- this.$message.success('删除成功');
- } else {
- this.$message.error(data.message);
- }
- })
- })
- },
- batchDelete() {
- },
- addCompany(){
- this.$refs.corporationAdd.dialogVisible = true;
- setTimeout(() => {
- this.$refs.corporationAdd.resetForm();
- }, 100)
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .info {
- padding: 20px 20px 20px 40px;
- font-size: 16px;
- text-align: left;
- }
- .delete {
- padding: 3px;
- width: 80px;
- height: 30px;
- float: left;
- left: 90px;
- position: relative;
- color: #fff;
- border-radius: 4px;
- right: 10px;
- background-color: #b3b3b3;
- }
- .el-table {
- position: relative;
- top: 10px;
- margin-left: 1%;
- height: 400px;
- border: 1px solid #f0f2f2;
- font-size: 14px;
- font-family: PingFang SC,serif;
- font-weight: 500;
- color: #b2b2b2;
- background: rgba(255, 255, 255, 0.8);
- /deep/th {
- background: #f7fbff;
- }
- /deep/.el-checkbox {
- color: #b2b2b2;
- .el-checkbox__input.is-checked+.el-checkbox__label {
- color: #2ea8e6;
- }
- .el-checkbox__input.is-checked .el-checkbox__inner::after {
- width: 70%;
- height: 70%;
- background: #2ea8e6;
- border-radius: 0;
- transform: rotate(0deg) scaleY(1);
- position: static;
- // border: 1px solid #8DD9FF;
- }
- .el-checkbox__inner {
- border: 1px solid #8dd9ff;
- background: rgba(0, 170, 255, 0);
- display: flex;
- align-items: center;
- justify-content: center;
- position: static;
- &::after {
- transition: 0ms;
- }
- }
- .el-checkbox__label {
- padding-left: 0;
- font-size: 15px;
- position: absolute;
- top: 1px;
- left: 25px;
- }
- }
- }
- .addCompany {
- position: absolute;
- left: 40px;
- bottom: 15px;
- width: 250px;
- text-align: center;
- font-size: 14px;
- height: 30px;
- padding: 8px 12px;
- }
- .bottom {
- position: absolute;
- right: 16px;
- bottom: 20px;
- height: 50px;
- line-height: 20px;
- background-color: #ffffff;
- text-align: center;
- }
- </style>
|