|
@@ -28,14 +28,18 @@
|
|
|
</el-row>
|
|
|
<el-table :data="response.rows" border height="calc(100vh - 270px)">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="企业名称" align="left" prop="companyName" />
|
|
|
+ <el-table-column label="企业名称" align="left" prop="companyName" width="250"/>
|
|
|
<el-table-column label="企业方负责人" align="center" prop="director" width="110" />
|
|
|
<el-table-column label="手机号" align="center" prop="phone" width="130" />
|
|
|
- <el-table-column label="邮箱" align="center" prop="email" width="180"/>
|
|
|
+ <el-table-column label="邮箱" align="center" prop="email" width="180" />
|
|
|
+ <el-table-column label="税率(%)" align="center" prop="rate" width="90" />
|
|
|
<el-table-column label="账户余额(元)" align="center" prop="money" width="110" />
|
|
|
+ <el-table-column label="发放金额(元)" align="center" prop="giveMoney" width="110" />
|
|
|
+ <el-table-column label="服务费(元)" align="center" prop="serviceMoney" width="110" />
|
|
|
+ <el-table-column label="发放人次" align="center" prop="givePeoples" width="110" />
|
|
|
<el-table-column label="关联用户" align="center" prop="peoples" width="100" />
|
|
|
<el-table-column label="创建日期" align="center" prop="createTime" width="180" />
|
|
|
- <el-table-column label="账号状态" align="center" prop="state" width="100">
|
|
|
+ <el-table-column label="账号状态" align="center" prop="state" width="100" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
<div class="switch">
|
|
|
<el-switch v-model="scope.row.state" :active-value="0" :width="50" :inactive-value="1" @change="op('change', scope.row)"></el-switch>
|
|
@@ -44,7 +48,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" width="180">
|
|
|
+ <el-table-column label="操作" align="center" width="180" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)" v-hasPermi="['work:company:list']">详情</el-button>
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit', scope.row)" v-hasPermi="['work:company:edit']">修改</el-button>
|
|
@@ -60,89 +64,89 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import edit from './edit';
|
|
|
- export default {
|
|
|
- name: 'Company',
|
|
|
- data() {
|
|
|
- return {
|
|
|
- showSearch: true,
|
|
|
- response: {},
|
|
|
- dateRange: [],
|
|
|
- queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- companyName: null,
|
|
|
- director: null,
|
|
|
- phone: null,
|
|
|
- state: null,
|
|
|
- orderByColumn: 'id',
|
|
|
- isAsc: 'desc'
|
|
|
- }
|
|
|
- };
|
|
|
+import edit from './edit';
|
|
|
+export default {
|
|
|
+ name: 'Company',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ showSearch: true,
|
|
|
+ response: {},
|
|
|
+ dateRange: [],
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ companyName: null,
|
|
|
+ director: null,
|
|
|
+ phone: null,
|
|
|
+ state: null,
|
|
|
+ orderByColumn: 'id',
|
|
|
+ isAsc: 'desc'
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getList() {
|
|
|
+ if (this.dateRange) {
|
|
|
+ this.queryParams.dateBegin = this.dateRange[0];
|
|
|
+ this.queryParams.dateEnd = this.dateRange[1];
|
|
|
+ }
|
|
|
+ this.ajax({ url: '/work/company/list', data: this.queryParams }).then((response) => {
|
|
|
+ this.response = response;
|
|
|
+ });
|
|
|
},
|
|
|
- created() {
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
- methods: {
|
|
|
- getList() {
|
|
|
- if (this.dateRange) {
|
|
|
- this.queryParams.dateBegin = this.dateRange[0];
|
|
|
- this.queryParams.dateEnd = this.dateRange[1];
|
|
|
- }
|
|
|
- this.ajax({ url: '/work/company/list', data: this.queryParams }).then((response) => {
|
|
|
- this.response = response;
|
|
|
- });
|
|
|
- },
|
|
|
- handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- resetQuery() {
|
|
|
- this.resetForm('queryForm');
|
|
|
- this.dateRange = [];
|
|
|
- this.handleQuery();
|
|
|
- },
|
|
|
- op(tag, row) {
|
|
|
- if (tag == 'add') {
|
|
|
- this.iframe({ obj: edit, param: {}, title: '新增企业', width: '50%', height: '83%' });
|
|
|
- }
|
|
|
- const id = row.id;
|
|
|
- if (tag == 'detail') {
|
|
|
- this.iframe({ obj: edit, param: { id: id, detail: true }, title: '查看企业信息', width: '50%', height: '83%' });
|
|
|
- }
|
|
|
- if (tag == 'edit') {
|
|
|
- this.iframe({ obj: edit, param: { id: id }, title: '编辑企业', width: '50%', height: '70%' });
|
|
|
- }
|
|
|
- //账号状态
|
|
|
- if (tag == 'change') {
|
|
|
- let text = row.state === 0 ? '启用' : '停用';
|
|
|
- this.$confirm('确认要' + text + '该企业? 停用后该企业所有账号都停用', '警告', { type: 'warning' })
|
|
|
- .then(() => {
|
|
|
- this.post({ url: '/work/company/lock', data: { id: row.id, state: row.state } })
|
|
|
- .then((response) => {
|
|
|
- this.$modal.msgSuccess(text + '成功');
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- row.state = row.state === 0 ? 1 : 0;
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- row.state = row.state === 0 ? 1 : 0;
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- del(row) {
|
|
|
- this.$confirm('是否确认删除选中企业?删除后该企业下的所有账号都被删除', '警告', { type: 'warning' }).then(() => {
|
|
|
- this.get({ url: '/work/company/remove/' + row.id }).then((response) => {
|
|
|
- this.$modal.msgSuccess('删除成功');
|
|
|
- this.getList();
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm('queryForm');
|
|
|
+ this.dateRange = [];
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ op(tag, row) {
|
|
|
+ if (tag == 'add') {
|
|
|
+ this.iframe({ obj: edit, param: {}, title: '新增企业', width: '50%', height: '90%' });
|
|
|
+ }
|
|
|
+ const id = row.id;
|
|
|
+ if (tag == 'detail') {
|
|
|
+ this.iframe({ obj: edit, param: { id: id, detail: true }, title: '查看企业信息', width: '50%', height: '90%' });
|
|
|
+ }
|
|
|
+ if (tag == 'edit') {
|
|
|
+ this.iframe({ obj: edit, param: { id: id }, title: '编辑企业', width: '50%', height: '80%' });
|
|
|
+ }
|
|
|
+ //账号状态
|
|
|
+ if (tag == 'change') {
|
|
|
+ let text = row.state === 0 ? '启用' : '停用';
|
|
|
+ this.$confirm('确认要' + text + '该企业? 停用后该企业所有账号都停用', '警告', { type: 'warning' })
|
|
|
+ .then(() => {
|
|
|
+ this.post({ url: '/work/company/lock', data: { id: row.id, state: row.state } })
|
|
|
+ .then((response) => {
|
|
|
+ this.$modal.msgSuccess(text + '成功');
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ row.state = row.state === 0 ? 1 : 0;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ row.state = row.state === 0 ? 1 : 0;
|
|
|
});
|
|
|
- });
|
|
|
- },
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- this.download('/work/company/export', { ...this.queryParams }, '企业信息.xlsx');
|
|
|
}
|
|
|
+ },
|
|
|
+ del(row) {
|
|
|
+ this.$confirm('是否确认删除选中企业?删除后该企业下的所有账号都被删除', '警告', { type: 'warning' }).then(() => {
|
|
|
+ this.get({ url: '/work/company/remove/' + row.id }).then((response) => {
|
|
|
+ this.$modal.msgSuccess('删除成功');
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('/work/company/export', { ...this.queryParams }, '企业信息.xlsx');
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|