|
@@ -13,15 +13,17 @@
|
|
|
<el-table-column prop="quota_used" label="累计已用" width="160" />
|
|
|
<el-table-column prop="quota_status" label="状态" width="160">
|
|
|
<template slot-scope="{ row }">
|
|
|
- <span :style="{ color: row.quota_status ? '#CA0000' : '#019319' }">
|
|
|
- {{ row.quota_status ? '已停用' : '使用中' }}
|
|
|
+ <span :style="{ color: row.quota_status ? '#019319' : '#CA0000' }">
|
|
|
+ {{ row.quota_status ? '使用中' : '已停用' }}
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" fixed="right">
|
|
|
<template slot-scope="{ row }">
|
|
|
<span class="set-quota operation" @click="setQuota(row.org_id)">设置配额</span>
|
|
|
- <span class="operation" @click="setStatus(row.org_id)">{{ row.quota_status ? '停用' : '启用' }}</span>
|
|
|
+ <span class="operation" @click="setStatus(row.org_id, !row.quota_status)">
|
|
|
+ {{ row.quota_status ? '停用' : '启用' }}
|
|
|
+ </span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -40,12 +42,13 @@
|
|
|
@size-change="changePageSize"
|
|
|
/>
|
|
|
|
|
|
- <set-quota :visible.sync="visible" :org-id="curOrgId" />
|
|
|
+ <set-quota :org-id="curOrgId" :visible="visible" @close="closeSetQuota" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { PageQueryOrgQuotaList } from '@/api/list';
|
|
|
+import { EnableOrgQuota } from '@/api/org';
|
|
|
import SetQuota from './SetQuota.vue';
|
|
|
|
|
|
export default {
|
|
@@ -89,8 +92,19 @@ export default {
|
|
|
this.curOrgId = org_id;
|
|
|
},
|
|
|
|
|
|
- setStatus(org_id) {
|
|
|
- console.log(org_id);
|
|
|
+ setStatus(org_id, is_enabled) {
|
|
|
+ EnableOrgQuota({
|
|
|
+ org_id,
|
|
|
+ is_enabled
|
|
|
+ }).then(() => {
|
|
|
+ this.$message.success(`${is_enabled ? '启用' : '停用'}机构配额成功`);
|
|
|
+ this.pageQueryOrgQuotaList();
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ closeSetQuota() {
|
|
|
+ this.visible = false;
|
|
|
+ this.curOrgId = '';
|
|
|
}
|
|
|
}
|
|
|
};
|