Commit 2014bb03 by honghong

修改对接字段

parent 76b61129
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form
<el-form-item label="城市" prop="cityId"> :model="queryParams"
<el-input ref="queryForm"
v-model="queryParams.cityId" size="small"
placeholder="请输入城市" :inline="true"
clearable v-show="showSearch"
@keyup.enter.native="handleQuery" label-width="68px"
/> >
</el-form-item> <el-form-item label="位置" prop="site">
<el-select v-model="queryParams.site" placeholder="请选择">
<el-option
v-for="item in placeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-refresh"
size="mini"
@click="handleQuery"
>刷新</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['accompany:carousel:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['accompany:carousel:remove']"
>删除</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="carouselList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="描述" align="center" prop="descr" />
<el-table-column label="位置" align="center" prop="site" />
<el-table-column label="城市" align="center" prop="cityId" />
<el-table-column label="图片" align="center" prop="imgUrl">
<template slot-scope="{ row }">
<el-image
style="width: 30px; height: 30px"
:src="row.imgUrl"
:preview-src-list="[row.imgUrl]"
>
</el-image>
</template>
</el-table-column>
<el-table-column label="链接" align="center" prop="linkUrl" />
<!-- 状态;0-禁用,1-启用 -->
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
:active-value="1"
:inactive-value="0"
>
</el-switch>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['accompany:carousel:edit']"
>编辑</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['accompany:carousel:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改轮播图对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="位置" prop="site"> <el-form-item label="位置" prop="site">
<el-input <!-- <el-input v-model="form.site" placeholder="请输入位置" /> -->
v-model="queryParams.site" <el-select v-model="form.site" placeholder="请选择">
placeholder="请输入位置" <el-option
clearable v-for="item in placeOptions"
@keyup.enter.native="handleQuery" :key="item.value"
/> :label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="城市" prop="cityId">
<el-select v-model="form.cityId" placeholder="请选择">
<el-option
v-for="item in cityList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<!-- <el-input v-model="form.cityId" placeholder="请输入城市" /> -->
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="descr"> <el-form-item label="描述" prop="descr">
<el-input <el-input
v-model="queryParams.descr" type="textarea"
autosize
v-model="form.descr"
placeholder="请输入描述" placeholder="请输入描述"
clearable
@keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="图片" prop="imgUrl"> <el-form-item label="图片" prop="imgUrl">
<el-input <!-- <el-input
v-model="queryParams.imgUrl" v-model="form.imgUrl"
placeholder="请输入图片" type="textarea"
clearable placeholder="请输入内容"
@keyup.enter.native="handleQuery" /> -->
/> <imageUpload v-model="form.imgUrl" :limit="1"></imageUpload>
</el-form-item> </el-form-item>
<el-form-item label="链接" prop="linkUrl"> <el-form-item label="链接" prop="linkUrl">
<el-input <el-input placeholder="请输入内容" v-model="form.linkUrl">
v-model="queryParams.linkUrl" <!-- <template slot="prepend">Http://</template> -->
placeholder="请输入链接" <template slot="prepend">
clearable <i class="el-icon-link"></i>
@keyup.enter.native="handleQuery" </template>
/> </el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item label="状态" prop="status">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-radio v-model="form.status" label="0">禁用</el-radio>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-radio v-model="form.status" label="1">启用</el-radio>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer">
<el-row :gutter="10" class="mb8"> <el-button :loading="buttonLoading" type="primary" @click="submitForm"
<el-col :span="1.5"> >提 交</el-button
<el-button >
type="primary" <el-button @click="cancel">取 消</el-button>
plain </div>
icon="el-icon-plus" </el-dialog>
size="mini" </div>
@click="handleAdd" </template>
v-hasPermi="['accompany:carousel:add']"
>新增</el-button> <script>
</el-col> import {
<el-col :span="1.5"> listCarousel,
<el-button getCarousel,
type="success" delCarousel,
plain addCarousel,
icon="el-icon-edit" updateCarousel,
size="mini" } from "@/api/operation/carousel";
:disabled="single"
@click="handleUpdate" export default {
v-hasPermi="['accompany:carousel:edit']" name: "Carousel",
>修改</el-button> data() {
</el-col> return {
<el-col :span="1.5"> // 按钮loading
<el-button buttonLoading: false,
type="danger" // 遮罩层
plain loading: true,
icon="el-icon-delete" // 选中数组
size="mini" ids: [],
:disabled="multiple" // 非单个禁用
@click="handleDelete" single: true,
v-hasPermi="['accompany:carousel:remove']" // 非多个禁用
>删除</el-button> multiple: true,
</el-col> // 显示搜索条件
<el-col :span="1.5"> showSearch: true,
<el-button // 总条数
type="warning" total: 0,
plain // 轮播图表格数据
icon="el-icon-download" carouselList: [],
size="mini" // 弹出层标题
@click="handleExport" title: "",
v-hasPermi="['accompany:carousel:export']" // 是否显示弹出层
>导出</el-button> open: false,
</el-col> // 查询参数
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> queryParams: {
</el-row> pageNum: 1,
pageSize: 10,
<el-table v-loading="loading" :data="carouselList" @selection-change="handleSelectionChange"> cityId: undefined,
<el-table-column type="selection" width="55" align="center" /> site: undefined,
<el-table-column label="" align="center" prop="id" v-if="true"/> descr: undefined,
<el-table-column label="城市" align="center" prop="cityId" /> imgUrl: undefined,
<el-table-column label="位置" align="center" prop="site" /> linkUrl: undefined,
<el-table-column label="描述" align="center" prop="descr" /> status: undefined,
<el-table-column label="图片" align="center" prop="imgUrl" /> },
<el-table-column label="链接" align="center" prop="linkUrl" /> // 表单参数
<el-table-column label="状态;0-禁用,1-启用" align="center" prop="status" /> form: {},
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> // 表单校验
<template slot-scope="scope"> rules: {},
<el-button placeOptions: [
size="mini" {
type="text" value: "首页",
icon="el-icon-edit" label: "首页",
@click="handleUpdate(scope.row)"
v-hasPermi="['accompany:carousel:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['accompany:carousel:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改轮播图对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="城市" prop="cityId">
<el-input v-model="form.cityId" placeholder="请输入城市" />
</el-form-item>
<el-form-item label="位置" prop="site">
<el-input v-model="form.site" placeholder="请输入位置" />
</el-form-item>
<el-form-item label="描述" prop="descr">
<el-input v-model="form.descr" placeholder="请输入描述" />
</el-form-item>
<el-form-item label="图片" prop="imgUrl">
<el-input v-model="form.imgUrl" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="链接" prop="linkUrl">
<el-input v-model="form.linkUrl" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listCarousel, getCarousel, delCarousel, addCarousel, updateCarousel } from "@/api/operation/carousel";
export default {
name: "Carousel",
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 轮播图表格数据
carouselList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
cityId: undefined,
site: undefined,
descr: undefined,
imgUrl: undefined,
linkUrl: undefined,
status: undefined,
}, },
// 表单参数 {
form: {}, value: "商城首页",
// 表单校验 label: "商城首页",
rules: { },
} ],
cityList: [
{
value: "1",
label: "北京",
},
{
value: "2",
label: "上海",
},
],
};
},
created() {
this.getList();
},
methods: {
/** 查询轮播图列表 */
getList() {
this.loading = true;
listCarousel(this.queryParams).then((response) => {
this.carouselList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: undefined,
cityId: undefined,
site: undefined,
descr: undefined,
imgUrl: undefined,
linkUrl: undefined,
status: undefined,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
delFlag: undefined,
status: "1",
}; };
this.resetForm("form");
}, },
created() { /** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
methods: { /** 重置按钮操作 */
/** 查询轮播图列表 */ resetQuery() {
getList() { this.resetForm("queryForm");
this.loading = true; this.handleQuery();
listCarousel(this.queryParams).then(response => { },
this.carouselList = response.rows; // 多选框选中数据
this.total = response.total; handleSelectionChange(selection) {
this.loading = false; this.ids = selection.map((item) => item.id);
}); this.single = selection.length !== 1;
}, this.multiple = !selection.length;
// 取消按钮 },
cancel() { /** 新增按钮操作 */
this.open = false; handleAdd() {
this.reset(); this.reset();
}, this.open = true;
// 表单重置 this.title = "添加轮播图";
reset() { },
this.form = { /** 修改按钮操作 */
id: undefined, handleUpdate(row) {
cityId: undefined, this.loading = true;
site: undefined, this.reset();
descr: undefined, const id = row.id || this.ids;
imgUrl: undefined, getCarousel(id).then((response) => {
linkUrl: undefined, this.loading = false;
status: undefined, this.form = response.data;
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
delFlag: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true; this.open = true;
this.title = "添加轮播图"; this.title = "修改轮播图";
}, });
/** 修改按钮操作 */ },
handleUpdate(row) { /** 提交按钮 */
this.loading = true; submitForm() {
this.reset(); this.$refs["form"].validate((valid) => {
const id = row.id || this.ids if (valid) {
getCarousel(id).then(response => { this.buttonLoading = true;
this.loading = false; if (this.form.id != null) {
this.form = response.data; updateCarousel(this.form)
this.open = true; .then((response) => {
this.title = "修改轮播图";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateCarousel(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}).finally(() => { })
.finally(() => {
this.buttonLoading = false; this.buttonLoading = false;
}); });
} else { } else {
addCarousel(this.form).then(response => { addCarousel(this.form)
.then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}).finally(() => { })
.finally(() => {
this.buttonLoading = false; this.buttonLoading = false;
}); });
}
} }
}); }
}, });
/** 删除按钮操作 */ },
handleDelete(row) { /** 删除按钮操作 */
const ids = row.id || this.ids; handleDelete(row) {
this.$modal.confirm('是否确认删除轮播图编号为"' + ids + '"的数据项?').then(() => { const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除轮播图编号为"' + ids + '"的数据项?')
.then(() => {
this.loading = true; this.loading = true;
return delCarousel(ids); return delCarousel(ids);
}).then(() => { })
.then(() => {
this.loading = false; this.loading = false;
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => { })
}).finally(() => { .catch(() => {})
.finally(() => {
this.loading = false; this.loading = false;
}); });
}, },
/** 导出按钮操作 */ },
handleExport() { };
this.download('accompany/carousel/export', { </script>
...this.queryParams
}, `carousel_${new Date().getTime()}.xlsx`)
}
}
};
</script>
\ No newline at end of file
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form
<el-form-item label="提供医院" prop="hospitals"> :model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<!-- <el-form-item label="提供医院" prop="hospitals">
<el-input <el-input
v-model="queryParams.hospitals" v-model="queryParams.hospitals"
placeholder="请输入提供医院" placeholder="请输入提供医院"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item> -->
<el-form-item label="业务名称" prop="name"> <el-form-item label="业务名称" prop="name">
<el-input <el-input
v-model="queryParams.name" v-model="queryParams.name"
placeholder="请输入业务名称" placeholder="请输入业务名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> type="primary"
</el-form-item> icon="el-icon-search"
</el-form> size="mini"
@click="handleQuery"
<el-row :gutter="10" class="mb8"> >搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
...@@ -67,213 +82,287 @@ ...@@ -67,213 +82,287 @@
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row> -->
<el-table v-loading="loading" :data="businessList" @selection-change="handleSelectionChange"> <el-table
<el-table-column type="selection" width="55" align="center" /> v-loading="loading"
<el-table-column label="" align="center" prop="id" v-if="true"/> :data="businessList"
<el-table-column label="提供医院" align="center" prop="hospitals" /> @selection-change="handleSelectionChange"
<el-table-column label="业务名称" align="center" prop="name" /> >
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column type="selection" width="55" align="center" />
<template slot-scope="scope"> <el-table-column label="ID" align="center" prop="id" />
<el-button <el-table-column label="提供医院" align="center" prop="hospitals" />
size="mini" <el-table-column label="业务名称" align="center" prop="name" />
type="text" <el-table-column label="服务" align="center" prop="name">
icon="el-icon-edit" <template slot-scope="{ row }">
@click="handleUpdate(scope.row)" <el-button type="text" @click="toogleExpand(row)">查看服务</el-button>
v-hasPermi="['system:business:edit']" </template>
>修改</el-button> </el-table-column>
<el-button <el-table-column type="expand" width="1">
size="mini" <template slot-scope="props">
type="text" <el-form label-position="left" inline class="demo-table-expand">
icon="el-icon-delete" <el-form-item label="商品名称">
@click="handleDelete(scope.row)" <span>{{ props.row.name }}</span>
v-hasPermi="['system:business:remove']" </el-form-item>
>删除</el-button> <el-form-item label="所属店铺">
</template> <span>{{ props.row.shop }}</span>
</el-table-column> </el-form-item>
</el-table> <el-form-item label="商品 ID">
<span>{{ props.row.id }}</span>
<pagination </el-form-item>
v-show="total>0" <el-form-item label="店铺 ID">
:total="total" <span>{{ props.row.shopId }}</span>
:page.sync="queryParams.pageNum" </el-form-item>
:limit.sync="queryParams.pageSize" <el-form-item label="商品分类">
@pagination="getList" <span>{{ props.row.category }}</span>
/> </el-form-item>
<el-form-item label="店铺地址">
<!-- 添加或修改业务对话框 --> <span>{{ props.row.address }}</span>
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> </el-form-item>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form-item label="商品描述">
<el-form-item label="提供医院" prop="hospitals"> <span>{{ props.row.desc }}</span>
<el-input v-model="form.hospitals" type="textarea" placeholder="请输入内容" /> </el-form-item>
</el-form-item> </el-form>
<el-form-item label="业务名称" prop="name"> </template>
<el-input v-model="form.name" placeholder="请输入业务名称" /> </el-table-column>
</el-form-item> <el-table-column label="更新时间" align="center" prop="name" />
</el-form> <el-table-column
<div slot="footer" class="dialog-footer"> label="操作"
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> align="center"
<el-button @click="cancel">取 消</el-button> class-name="small-padding fixed-width"
</div> >
</el-dialog> <template slot-scope="scope">
</div> <el-button
</template> size="mini"
type="text"
<script> icon="el-icon-edit"
import { listBusiness, getBusiness, delBusiness, addBusiness, updateBusiness } from "@/api/operation/business"; @click="handleUpdate(scope.row)"
v-hasPermi="['system:business:edit']"
export default { >修改</el-button
name: "Business", >
data() { <el-button
return { size="mini"
// 按钮loading type="text"
buttonLoading: false, icon="el-icon-delete"
// 遮罩层 @click="handleDelete(scope.row)"
loading: true, v-hasPermi="['system:business:remove']"
// 选中数组 >删除</el-button
ids: [], >
// 非单个禁用 </template>
single: true, </el-table-column>
// 非多个禁用 </el-table>
multiple: true,
// 显示搜索条件 <pagination
showSearch: true, v-show="total > 0"
// 总条数 :total="total"
total: 0, :page.sync="queryParams.pageNum"
// 业务表格数据 :limit.sync="queryParams.pageSize"
businessList: [], @pagination="getList"
// 弹出层标题 />
title: "",
// 是否显示弹出层 <!-- 添加或修改业务对话框 -->
open: false, <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
// 查询参数 <el-form ref="form" :model="form" :rules="rules" label-width="80px">
queryParams: { <el-form-item label="提供医院" prop="hospitals">
pageNum: 1, <el-input
pageSize: 10, v-model="form.hospitals"
hospitals: undefined, type="textarea"
name: undefined, placeholder="请输入内容"
}, />
// 表单参数 </el-form-item>
form: {}, <el-form-item label="业务名称" prop="name">
// 表单校验 <el-input v-model="form.name" placeholder="请输入业务名称" />
rules: { </el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"
>确 定</el-button
>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listBusiness,
getBusiness,
delBusiness,
addBusiness,
updateBusiness,
} from "@/api/operation/business";
export default {
name: "Business",
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 业务表格数据
businessList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
hospitals: undefined,
name: undefined,
},
// 表单参数
form: {},
// 表单校验
rules: {},
};
},
created() {
this.getList();
},
methods: {
/** 查询业务列表 */
getList() {
this.loading = true;
listBusiness(this.queryParams).then((response) => {
this.businessList = response.rows;
this.total = response.total;
this.loading = false;
});
},
toogleExpand(row) {
let $table = this.$refs.table;
this.tableData.map((item) => {
if (row.id != item.id) {
$table.toggleRowExpansion(item, false);
} }
});
$table.toggleRowExpansion(row);
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: undefined,
hospitals: undefined,
name: undefined,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
delFlag: undefined,
}; };
this.resetForm("form");
}, },
created() { /** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
methods: { /** 重置按钮操作 */
/** 查询业务列表 */ resetQuery() {
getList() { this.resetForm("queryForm");
this.loading = true; this.handleQuery();
listBusiness(this.queryParams).then(response => { },
this.businessList = response.rows; // 多选框选中数据
this.total = response.total; handleSelectionChange(selection) {
this.loading = false; this.ids = selection.map((item) => item.id);
}); this.single = selection.length !== 1;
}, this.multiple = !selection.length;
// 取消按钮 },
cancel() { /** 新增按钮操作 */
this.open = false; handleAdd() {
this.reset(); this.reset();
}, this.open = true;
// 表单重置 this.title = "添加业务";
reset() { },
this.form = { /** 修改按钮操作 */
id: undefined, handleUpdate(row) {
hospitals: undefined, this.loading = true;
name: undefined, this.reset();
createBy: undefined, const id = row.id || this.ids;
createTime: undefined, getBusiness(id).then((response) => {
updateBy: undefined, this.loading = false;
updateTime: undefined, this.form = response.data;
delFlag: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true; this.open = true;
this.title = "添加业务"; this.title = "修改业务";
}, });
/** 修改按钮操作 */ },
handleUpdate(row) { /** 提交按钮 */
this.loading = true; submitForm() {
this.reset(); this.$refs["form"].validate((valid) => {
const id = row.id || this.ids if (valid) {
getBusiness(id).then(response => { this.buttonLoading = true;
this.loading = false; if (this.form.id != null) {
this.form = response.data; updateBusiness(this.form)
this.open = true; .then((response) => {
this.title = "修改业务";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateBusiness(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}).finally(() => { })
.finally(() => {
this.buttonLoading = false; this.buttonLoading = false;
}); });
} else { } else {
addBusiness(this.form).then(response => { addBusiness(this.form)
.then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}).finally(() => { })
.finally(() => {
this.buttonLoading = false; this.buttonLoading = false;
}); });
}
} }
}); }
}, });
/** 删除按钮操作 */ },
handleDelete(row) { /** 删除按钮操作 */
const ids = row.id || this.ids; handleDelete(row) {
this.$modal.confirm('是否确认删除业务编号为"' + ids + '"的数据项?').then(() => { const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除业务编号为"' + ids + '"的数据项?')
.then(() => {
this.loading = true; this.loading = true;
return delBusiness(ids); return delBusiness(ids);
}).then(() => { })
.then(() => {
this.loading = false; this.loading = false;
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => { })
}).finally(() => { .catch(() => {})
.finally(() => {
this.loading = false; this.loading = false;
}); });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('system/business/export', { this.download(
...this.queryParams "system/business/export",
}, `business_${new Date().getTime()}.xlsx`) {
} ...this.queryParams,
} },
}; `business_${new Date().getTime()}.xlsx`
</script> );
},
\ No newline at end of file },
};
</script>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form
<el-form-item label="城市" prop="cityId"> :model="queryParams"
<el-input ref="queryForm"
v-model="queryParams.cityId" size="small"
placeholder="请输入城市" :inline="true"
clearable v-show="showSearch"
@keyup.enter.native="handleQuery" label-width="68px"
/> >
</el-form-item> <el-form-item label="位置" prop="site">
<el-select v-model="queryParams.site" placeholder="请选择">
<el-option
v-for="item in placeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:notice:add']"
>新增</el-button
>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:notice:edit']"
>修改</el-button
>
</el-col> -->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:notice:remove']"
>删除</el-button
>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:notice:export']"
>导出</el-button
>
</el-col> -->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="noticeList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="城市" align="center" prop="cityId" />
<el-table-column label="内容" align="center" prop="info" />
<el-table-column label="位置" align="center" prop="site" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:notice:edit']"
>编辑</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:notice:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改公告对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="内容" prop="info"> <el-form-item label="内容" prop="info">
<el-input <el-input
v-model="queryParams.info" autosize
v-model="form.info"
type="textarea"
placeholder="请输入内容" placeholder="请输入内容"
clearable
@keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="位置" prop="site"> <el-form-item label="城市" prop="cityId">
<el-input <el-select v-model="form.cityId" placeholder="请输入城市">
v-model="queryParams.site" <el-option
placeholder="请输入位置" v-for="item in placeOptions"
clearable :key="item.value"
@keyup.enter.native="handleQuery" :label="item.label"
/> :value="item.value"
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item label="位置" prop="site">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-select v-model="form.site" placeholder="请输入位置">
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-option
v-for="item in placeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer">
<el-row :gutter="10" class="mb8"> <el-button :loading="buttonLoading" type="primary" @click="submitForm"
<el-col :span="1.5"> >提 交</el-button
<el-button >
type="primary" <el-button @click="cancel">取 消</el-button>
plain </div>
icon="el-icon-plus" </el-dialog>
size="mini" </div>
@click="handleAdd" </template>
v-hasPermi="['system:notice:add']"
>新增</el-button> <script>
</el-col> import {
<el-col :span="1.5"> listNotice,
<el-button getNotice,
type="success" delNotice,
plain addNotice,
icon="el-icon-edit" updateNotice,
size="mini" } from "@/api/operation/notice";
:disabled="single"
@click="handleUpdate" export default {
v-hasPermi="['system:notice:edit']" name: "Notice",
>修改</el-button> data() {
</el-col> return {
<el-col :span="1.5"> // 按钮loading
<el-button buttonLoading: false,
type="danger" // 遮罩层
plain loading: true,
icon="el-icon-delete" // 选中数组
size="mini" ids: [],
:disabled="multiple" // 非单个禁用
@click="handleDelete" single: true,
v-hasPermi="['system:notice:remove']" // 非多个禁用
>删除</el-button> multiple: true,
</el-col> // 显示搜索条件
<el-col :span="1.5"> showSearch: true,
<el-button // 总条数
type="warning" total: 0,
plain // 公告表格数据
icon="el-icon-download" noticeList: [],
size="mini" // 弹出层标题
@click="handleExport" title: "",
v-hasPermi="['system:notice:export']" // 是否显示弹出层
>导出</el-button> open: false,
</el-col> // 查询参数
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> queryParams: {
</el-row> pageNum: 1,
pageSize: 10,
<el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange"> cityId: undefined,
<el-table-column type="selection" width="55" align="center" /> info: undefined,
<el-table-column label="" align="center" prop="id" v-if="true"/> site: undefined,
<el-table-column label="城市" align="center" prop="cityId" /> },
<el-table-column label="内容" align="center" prop="info" /> // 表单参数
<el-table-column label="位置" align="center" prop="site" /> form: {},
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> // 表单校验
<template slot-scope="scope"> rules: {},
<el-button placeOptions: [
size="mini" {
type="text" value: "首页公告",
icon="el-icon-edit" label: "首页公告",
@click="handleUpdate(scope.row)"
v-hasPermi="['system:notice:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:notice:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改公告对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="城市" prop="cityId">
<el-input v-model="form.cityId" placeholder="请输入城市" />
</el-form-item>
<el-form-item label="内容" prop="info">
<el-input v-model="form.info" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="位置" prop="site">
<el-input v-model="form.site" placeholder="请输入位置" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/operation/notice";
export default {
name: "Notice",
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 公告表格数据
noticeList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
cityId: undefined,
info: undefined,
site: undefined,
}, },
// 表单参数 {
form: {}, value: "代办挂号公告",
// 表单校验 label: "代办挂号公告",
rules: { },
} ],
cityList: [
{
value: "1",
label: "北京",
},
{
value: "2",
label: "上海",
},
],
};
},
created() {
this.getList();
},
methods: {
/** 查询公告列表 */
getList() {
this.loading = true;
listNotice(this.queryParams).then((response) => {
this.noticeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: undefined,
cityId: undefined,
info: undefined,
site: undefined,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
}; };
this.resetForm("form");
}, },
created() { /** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
methods: { /** 重置按钮操作 */
/** 查询公告列表 */ resetQuery() {
getList() { this.resetForm("queryForm");
this.loading = true; this.handleQuery();
listNotice(this.queryParams).then(response => { },
this.noticeList = response.rows; // 多选框选中数据
this.total = response.total; handleSelectionChange(selection) {
this.loading = false; this.ids = selection.map((item) => item.id);
}); this.single = selection.length !== 1;
}, this.multiple = !selection.length;
// 取消按钮 },
cancel() { /** 新增按钮操作 */
this.open = false; handleAdd() {
this.reset(); this.reset();
}, this.open = true;
// 表单重置 this.title = "添加公告";
reset() { },
this.form = { /** 修改按钮操作 */
id: undefined, handleUpdate(row) {
cityId: undefined, this.loading = true;
info: undefined, this.reset();
site: undefined, const id = row.id || this.ids;
createBy: undefined, getNotice(id).then((response) => {
createTime: undefined, this.loading = false;
updateBy: undefined, this.form = response.data;
updateTime: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true; this.open = true;
this.title = "添加公告"; this.title = "修改公告";
}, });
/** 修改按钮操作 */ },
handleUpdate(row) { /** 提交按钮 */
this.loading = true; submitForm() {
this.reset(); this.$refs["form"].validate((valid) => {
const id = row.id || this.ids if (valid) {
getNotice(id).then(response => { this.buttonLoading = true;
this.loading = false; if (this.form.id != null) {
this.form = response.data; updateNotice(this.form)
this.open = true; .then((response) => {
this.title = "修改公告";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateNotice(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}).finally(() => { })
.finally(() => {
this.buttonLoading = false; this.buttonLoading = false;
}); });
} else { } else {
addNotice(this.form).then(response => { addNotice(this.form)
.then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}).finally(() => { })
.finally(() => {
this.buttonLoading = false; this.buttonLoading = false;
}); });
}
} }
}); }
}, });
/** 删除按钮操作 */ },
handleDelete(row) { /** 删除按钮操作 */
const ids = row.id || this.ids; handleDelete(row) {
this.$modal.confirm('是否确认删除公告编号为"' + ids + '"的数据项?').then(() => { const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除公告编号为"' + ids + '"的数据项?')
.then(() => {
this.loading = true; this.loading = true;
return delNotice(ids); return delNotice(ids);
}).then(() => { })
.then(() => {
this.loading = false; this.loading = false;
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => { })
}).finally(() => { .catch(() => {})
.finally(() => {
this.loading = false; this.loading = false;
}); });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('system/notice/export', { this.download(
...this.queryParams "system/notice/export",
}, `notice_${new Date().getTime()}.xlsx`) {
} ...this.queryParams,
} },
}; `notice_${new Date().getTime()}.xlsx`
</script> );
},
\ No newline at end of file },
};
</script>
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