| | |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleSyncTenantPackage(scope.row)" |
| | | v-hasPermi="['system:tenant:edit']" |
| | | >同步套餐</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:tenant:remove']" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { listTenant, getTenant, delTenant, addTenant, updateTenant, changeTenantStatus } from "@/api/system/tenant"; |
| | | import { listTenant, getTenant, delTenant, addTenant, updateTenant, changeTenantStatus, syncTenantPackage} from "@/api/system/tenant"; |
| | | import { listTenantPackage } from "@/api/system/tenantPackage"; |
| | | |
| | | export default { |
| | |
| | | handleStatusChange(row) { |
| | | let text = row.status === "0" ? "启用" : "停用"; |
| | | this.$modal.confirm('确认要"' + text + '""' + row.companyName + '"租户吗?').then(function() { |
| | | return changeTenantStatus(row.id, row.status); |
| | | return changeTenantStatus(row.id, row.tenantId, row.status); |
| | | }).then(() => { |
| | | this.$modal.msgSuccess(text + "成功"); |
| | | }).catch(function() { |
| | |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('是否确认删除租户编号为"' + ids + '"的数据项?').then(() => { |
| | | this.$modal.confirm('是否确认删除租户编号为"' + row.tenantId + '"的数据项?').then(() => { |
| | | this.loading = true; |
| | | return delTenant(ids); |
| | | }).then(() => { |
| | |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | /** 同步租户套餐按钮操作 */ |
| | | handleSyncTenantPackage(row) { |
| | | this.$modal.confirm('是否确认同步租户套餐租户编号为"' + row.tenantId + '"的数据项?').then(() => { |
| | | this.loading = true; |
| | | return syncTenantPackage(row.tenantId, row.packageId); |
| | | }).then(() => { |
| | | this.loading = false; |
| | | this.getList(); |
| | | this.$modal.msgSuccess("同步成功"); |
| | | }).catch(() => { |
| | | }).finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | /** 导出按钮操作 */ |
| | | handleExport() { |
| | | this.download('system/tenant/export', { |