master
chentaisen 2024-08-26 19:55:22 +08:00
parent 5242765b19
commit 27f3b9fe1d
2 changed files with 89 additions and 31 deletions

View File

@ -44,4 +44,19 @@ export function getEditionList(id) {
// }) // })
// } // }
//通过id启用客户
export function enable(id) {
return request({
url: `/rule/ruleEdition/enable/${id}`,
})
}
//通过id禁用客户
export function disable(id) {
return request({
url: `/rule/ruleEdition/disable/${id}`,
})
}

View File

@ -32,17 +32,17 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="primary" <!-- type="primary"-->
plain <!-- plain-->
icon="el-icon-plus" <!-- icon="el-icon-plus"-->
size="mini" <!-- size="mini"-->
@click="handleAdd" <!-- @click="handleAdd"-->
v-hasPermi="['rule:rule:add']" <!-- v-hasPermi="['rule:rule:add']"-->
>新增 <!-- >新增-->
</el-button> <!-- </el-button>-->
</el-col> <!-- </el-col>-->
<!-- <el-col :span="1.5">--> <!-- <el-col :span="1.5">-->
<!-- <el-button--> <!-- <el-button-->
<!-- type="success"--> <!-- type="success"-->
@ -119,7 +119,26 @@
<el-descriptions class="margin-top" title="规则版本" :column="3" border> <el-descriptions class="margin-top" title="规则版本" :column="3" border>
<template slot="extra"> <template slot="extra">
<el-button type="primary" size="small">操作</el-button> <el-dropdown split-button type="primary">
更多操作
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['rule:rule:add']"
>新增
</el-button>
</el-dropdown-item>
<el-dropdown-item>开启引擎</el-dropdown-item>
<el-dropdown-item>关闭引擎</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template> </template>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
@ -147,7 +166,9 @@
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
是否激活 是否激活
</template> </template>
{{ rule.isActivate }} <el-tag> {{ rule.isActivate }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
@ -179,9 +200,10 @@
<el-col :span="12" v-for="customer in ruleAndEditionList"> <el-col :span="12" v-for="customer in ruleAndEditionList">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix">
<div slot="header" class="clearfix">
<div> <div>
<el-descriptions class="margin-top" title="带边框列表" :column="3" :size="size" border> <el-descriptions class="margin-top" title="带边框列表" :column="3" :size="size" border>
<template slot="extra"> <template slot="extra">
@ -191,11 +213,23 @@
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item> <el-dropdown-item>
<el-button type="primary" size="small">激活按钮</el-button>
规格详情
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item>激活按钮</el-dropdown-item>
<el-dropdown-item disabled>双皮奶</el-dropdown-item> <el-dropdown-item disabled>双皮奶</el-dropdown-item>
<el-dropdown-item divided>蚵仔煎</el-dropdown-item> <el-dropdown-item>
<el-switch
style="float: right; margin: 4px 5px 0;"
v-model="customer.status"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="Y"
inactive-value="N"
@change="handleStatusChange(customer)"
>
</el-switch>
</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<!-- </el-button>--> <!-- </el-button>-->
@ -233,14 +267,18 @@
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
是否激活 是否激活
</template> </template>
{{ customer.ruleActivate }}
<el-tag>{{ customer.ruleActivate }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
状态 状态
</template> </template>
{{ customer.status }}
<el-tag> {{ customer.status }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
@ -253,16 +291,7 @@
</el-descriptions> </el-descriptions>
</div> </div>
<!-- <el-switch-->
<!-- style="float: right; margin: 4px 5px 0;"-->
<!-- v-model="customer.status"-->
<!-- active-color="#13ce66"-->
<!-- inactive-color="#ff4949"-->
<!-- active-value="Y"-->
<!-- inactive-value="N"-->
<!-- @change="handleStatusChange(customer)"-->
<!-- >-->
<!-- </el-switch>-->
<!-- <el-popconfirm--> <!-- <el-popconfirm-->
<!-- confirm-button-text='好的'--> <!-- confirm-button-text='好的'-->
<!-- cancel-button-text='不用了'--> <!-- cancel-button-text='不用了'-->
@ -283,7 +312,7 @@
</el-row> </el-row>
<!-- 添加或修改规则对话框 --> <!-- 添加或修改规则对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="规则名称" prop="name"> <el-form-item label="规则名称" prop="name">
<el-input v-model="form.name" placeholder="请输入规则名称"/> <el-input v-model="form.name" placeholder="请输入规则名称"/>
@ -387,7 +416,21 @@ export default {
console.log(this.rule) console.log(this.rule)
}) })
}, },
/** 客户状态更改触发 */
handleStatusChange(row) {
console.log(row)
if (row.status === "Y") {
enable(row.id).then((res) => {
this.$modal.msgSuccess("启用成功")
this.findList()
})
} else {
disable(row.id).then((res) => {
this.$modal.msgSuccess("禁用成功")
this.findList()
})
}
},
// /** */ // /** */
// getList() { // getList() {
// this.loading = true; // this.loading = true;