Commit f8e5ada0 authored by “yiyousong”'s avatar “yiyousong”

feat: 修改站点业务

parent a2735c0a
...@@ -52,6 +52,13 @@ ...@@ -52,6 +52,13 @@
}} }}
</span> </span>
</template> </template>
<!-- 是否展示数据 -->
<template slot="datashow" slot-scope="{ record }">
<y-switch
v-model="record.datashow"
@change="changeDatashow(record)"
></y-switch>
</template>
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<a-space size="middle"> <a-space size="middle">
...@@ -146,6 +153,7 @@ import addprofession from "../group/addprofession.vue"; ...@@ -146,6 +153,7 @@ import addprofession from "../group/addprofession.vue";
import local from "@/utils/local"; import local from "@/utils/local";
import { uniqueObjArray } from "@/utils"; import { uniqueObjArray } from "@/utils";
import YTable from "@/components/YTable.vue"; import YTable from "@/components/YTable.vue";
import YSwitch from "@/components/yswitch/YSwitch.vue";
import { import {
businessList, businessList,
delSiteBusiness, delSiteBusiness,
...@@ -155,12 +163,14 @@ import { ...@@ -155,12 +163,14 @@ import {
businessInfo, businessInfo,
businessMatterList, businessMatterList,
delBusinessMatter, delBusinessMatter,
saveBusiness,
} from "@/services/business"; } from "@/services/business";
export default { export default {
components: { components: {
addprofession, addprofession,
YTable, YTable,
YSwitch,
}, },
data() { data() {
return { return {
...@@ -180,6 +190,14 @@ export default { ...@@ -180,6 +190,14 @@ export default {
align: "left", align: "left",
dataIndex: "businessName", dataIndex: "businessName",
}, },
{
title: "是否数据展示",
dataIndex: "datashow",
width: "120px",
scopedSlots: {
customRender: "datashow",
},
},
{ {
title: "操作", title: "操作",
width: "110px", width: "110px",
...@@ -342,6 +360,20 @@ export default { ...@@ -342,6 +360,20 @@ export default {
this.$refs.addprofession.onAdd(); this.$refs.addprofession.onAdd();
this.visible = true; this.visible = true;
}, },
async changeDatashow(row) {
let res = await businessInfo({ id: row.businessId });
if (res.data.code === 1) {
let { data } = res.data;
let result = await saveBusiness({
...data,
datashow: row.datashow,
});
if (result.data.code === 1) {
this.$message.success("修改成功");
}
this.getSiteBusinessData();
}
},
// 站点业务选中 // 站点业务选中
onSelectSiteBusiness(key, rows) { onSelectSiteBusiness(key, rows) {
this.selectedLeftRowKeys = key; this.selectedLeftRowKeys = key;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment