Commit f193d03e by xinlaa

企业微信新增启用功能等‘

git commit -m 企业微信新增启用功能等
git commit -m 企业微信新增启用功能等‘
1 parent 473022bf
...@@ -59,3 +59,14 @@ export function update(data) { ...@@ -59,3 +59,14 @@ export function update(data) {
data data
}) })
} }
/**
* 启用有效企业微信账号
* @param {*} corpId
*/
export function start(corpId) {
return request({
url: service + '/startVailWeCorpAccount/' + corpId,
method: 'put',
})
}
\ No newline at end of file \ No newline at end of file
...@@ -30,10 +30,14 @@ ...@@ -30,10 +30,14 @@
<el-table-column label="企业ID" align="center" prop="corpId" :show-overflow-tooltip="true" /> <el-table-column label="企业ID" align="center" prop="corpId" :show-overflow-tooltip="true" />
<el-table-column label="应用秘钥" align="center" prop="corpSecret" :show-overflow-tooltip="true" /> <el-table-column label="应用秘钥" align="center" prop="corpSecret" :show-overflow-tooltip="true" />
<el-table-column label="绑定时间" align="center" prop="createTime" width="160"></el-table-column> <el-table-column label="绑定时间" align="center" prop="createTime" width="160"></el-table-column>
<el-table-column label="状态" align="center" prop="status" width="160">
<template slot-scope="scope">{{status[scope.row.status]}}</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="edit(scope.row, 0)">查看</el-button> <el-button size="mini" type="text" icon="el-icon-view" @click="edit(scope.row, 0)">查看</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="edit(scope.row, 1)">编辑</el-button> <el-button size="mini" type="text" icon="el-icon-edit" @click="edit(scope.row, 1)">编辑</el-button>
<el-button size="mini" type="text" icon="el-icon-key" @click="start(scope.row.corpId)">启用</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -47,7 +51,14 @@ ...@@ -47,7 +51,14 @@
/> />
<el-dialog title="查看企业微信号" :visible.sync="dialogVisible"> <el-dialog title="查看企业微信号" :visible.sync="dialogVisible">
<el-form label-position="right" :model="form" label-width="150px" :disabled="disabled"> <el-form
ref="form"
label-position="right"
:model="form"
rules="rules"
label-width="150px"
:disabled="disabled"
>
<el-form-item label="企业名称"> <el-form-item label="企业名称">
<el-input v-model="form.companyName" :disabled="form.id"></el-input> <el-input v-model="form.companyName" :disabled="form.id"></el-input>
</el-form-item> </el-form-item>
...@@ -118,6 +129,13 @@ export default { ...@@ -118,6 +129,13 @@ export default {
dialogVisible: false, dialogVisible: false,
disabled: false, disabled: false,
loading: false, loading: false,
rules: Object.freeze({
companyName: [{ required: true, message: "必填项", trigger: "blur" }],
corpId: [{ required: true, message: "必填项", trigger: "blur" }],
corpSecret: [{ required: true, message: "必填项", trigger: "blur" }],
contactSecret: [{ required: true, message: "必填项", trigger: "blur" }],
}),
status: ["正常", "停用"],
}; };
}, },
watch: {}, watch: {},
...@@ -136,7 +154,7 @@ export default { ...@@ -136,7 +154,7 @@ export default {
.getList(this.query) .getList(this.query)
.then(({ rows, total }) => { .then(({ rows, total }) => {
this.list = rows; this.list = rows;
this.total = total; this.total = +total;
this.loading = false; this.loading = false;
}) })
.catch(() => { .catch(() => {
...@@ -149,6 +167,8 @@ export default { ...@@ -149,6 +167,8 @@ export default {
type || !data ? (this.disabled = false) : (this.disabled = true); type || !data ? (this.disabled = false) : (this.disabled = true);
}, },
submit() { submit() {
this.$refs["form"].validate((valid) => {
if (valid) {
api[this.form.id ? "update" : "add"](this.form) api[this.form.id ? "update" : "add"](this.form)
.then(() => { .then(() => {
this.msgSuccess("操作成功"); this.msgSuccess("操作成功");
...@@ -158,6 +178,14 @@ export default { ...@@ -158,6 +178,14 @@ export default {
.catch(() => { .catch(() => {
this.dialogVisible = false; this.dialogVisible = false;
}); });
}
});
},
start(corpId) {
api.start(corpId).then(({ rows, total }) => {
this.msgSuccess("操作成功");
this.getList();
});
}, },
}, },
}; };
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!