@ -1,274 +0,0 @@ | |||
<template> | |||
<div class="app-container"> | |||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form"> | |||
<el-form-item label="标题" prop="title"> | |||
<el-input | |||
v-model="queryParams.title" | |||
placeholder="请输入标题" | |||
clearable | |||
size="small" | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item class="flex_one tr"> | |||
<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="['model:AppletTrain: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="['model:AppletTrain: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="['model:AppletTrain:remove']" | |||
>删除</el-button> | |||
</el-col> | |||
<el-col :span="1.5"> | |||
<el-button | |||
type="warning" | |||
plain | |||
icon="el-icon-download" | |||
size="mini" | |||
:loading="exportLoading" | |||
@click="handleExport" | |||
v-hasPermi="['model:AppletTrain:export']" | |||
>导出</el-button> | |||
</el-col> | |||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> | |||
</el-row> | |||
<el-table v-loading="loading" :data="AppletTrainList" @selection-change="handleSelectionChange"> | |||
<el-table-column type="selection" width="55" align="center" /> | |||
<el-table-column label="标题" align="center" prop="title" v-if="columns[0].visible"/> | |||
<el-table-column label="培训内容" align="center" prop="content" v-if="columns[1].visible"/> | |||
<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="['model:AppletTrain:edit']" | |||
>修改</el-button> | |||
<el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-delete" | |||
@click="handleDelete(scope.row)" | |||
v-hasPermi="['model:AppletTrain: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="50%" append-to-body> | |||
<el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-two"> | |||
<el-form-item label="标题" prop="title"> | |||
<el-input v-model="form.title" placeholder="请输入标题" /> | |||
</el-form-item> | |||
<el-form-item label="培训内容"> | |||
<editor v-model="form.content" :min-height="192"/> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button type="primary" @click="submitForm">确 定</el-button> | |||
<el-button @click="cancel">取 消</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
<script> | |||
import { listAppletTrain, getAppletTrain, delAppletTrain, addAppletTrain, updateAppletTrain, exportAppletTrain } from "@/api/model/AppletTrain"; | |||
export default { | |||
name: "AppletTrain", | |||
data() { | |||
return { | |||
// 遮罩层 | |||
loading: true, | |||
// 导出遮罩层 | |||
exportLoading: false, | |||
// 选中数组 | |||
ids: [], | |||
// 非单个禁用 | |||
single: true, | |||
// 非多个禁用 | |||
multiple: true, | |||
// 显示搜索条件 | |||
showSearch: true, | |||
// 总条数 | |||
total: 0, | |||
// 服务培训表格数据 | |||
AppletTrainList: [], | |||
// 弹出层标题 | |||
title: "", | |||
// 是否显示弹出层 | |||
open: false, | |||
// 查询参数 | |||
queryParams: { | |||
pageNum: 1, | |||
pageSize: 10, | |||
title: null, | |||
content: null, | |||
}, | |||
// 表单参数 | |||
form: {}, | |||
// 表单校验 | |||
rules: { | |||
title: [ | |||
{ required: true, message: "标题不能为空", trigger: "blur" } | |||
], | |||
content: [ | |||
{ required: true, message: "培训内容不能为空", trigger: "blur" } | |||
], | |||
}, | |||
columns: [ | |||
{ key: 0, label: "标题", visible: true }, | |||
{ key: 1, label: "培训内容", visible: true }, | |||
], | |||
}; | |||
}, | |||
created() { | |||
this.getList(); | |||
}, | |||
methods: { | |||
/** 查询服务培训列表 */ | |||
getList() { | |||
this.loading = true; | |||
listAppletTrain(this.queryParams).then(response => { | |||
this.AppletTrainList = response.rows; | |||
this.total = response.total; | |||
this.loading = false; | |||
}); | |||
}, | |||
// 取消按钮 | |||
cancel() { | |||
this.open = false; | |||
this.reset(); | |||
}, | |||
// 表单重置 | |||
reset() { | |||
this.form = { | |||
title: null, | |||
content: null, | |||
}; | |||
this.resetForm("form"); | |||
}, | |||
/** 搜索按钮操作 */ | |||
handleQuery() { | |||
this.queryParams.pageNum = 1; | |||
this.getList(); | |||
}, | |||
/** 重置按钮操作 */ | |||
resetQuery() { | |||
this.resetForm("queryForm"); | |||
this.handleQuery(); | |||
}, | |||
// 多选框选中数据 | |||
handleSelectionChange(selection) { | |||
this.ids = selection.map(item => item.title) | |||
this.single = selection.length!==1 | |||
this.multiple = !selection.length | |||
}, | |||
/** 新增按钮操作 */ | |||
handleAdd() { | |||
this.reset(); | |||
this.open = true; | |||
this.title = "添加服务培训"; | |||
}, | |||
/** 修改按钮操作 */ | |||
handleUpdate(row) { | |||
this.reset(); | |||
const title = row.title || this.ids | |||
getAppletTrain(title).then(response => { | |||
this.form = response.data; | |||
this.open = true; | |||
this.title = "修改服务培训"; | |||
}); | |||
}, | |||
/** 提交按钮 */ | |||
submitForm() { | |||
this.$refs["form"].validate(valid => { | |||
if (valid) { | |||
if (this.form.title != null) { | |||
updateAppletTrain(this.form).then(response => { | |||
this.$modal.msgSuccess("修改成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} else { | |||
addAppletTrain(this.form).then(response => { | |||
this.$modal.msgSuccess("新增成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} | |||
} | |||
}); | |||
}, | |||
/** 删除按钮操作 */ | |||
handleDelete(row) { | |||
const titles = row.title || this.ids; | |||
this.$modal.confirm('是否确认删除服务培训编号为"' + titles + '"的数据项?').then(function() { | |||
return delAppletTrain(titles); | |||
}).then(() => { | |||
this.getList(); | |||
this.$modal.msgSuccess("删除成功"); | |||
}).catch(() => {}); | |||
}, | |||
/** 导出按钮操作 */ | |||
handleExport() { | |||
const queryParams = this.queryParams; | |||
this.$modal.confirm('是否确认导出所有服务培训数据项?').then(() => { | |||
this.exportLoading = true; | |||
return exportAppletTrain(queryParams); | |||
}).then(response => { | |||
this.download(response.msg); | |||
this.exportLoading = false; | |||
}).catch(() => {}); | |||
} | |||
} | |||
}; | |||
</script> |
@ -1,360 +0,0 @@ | |||
<template> | |||
<div class="app-container"> | |||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form"> | |||
<el-form-item label="昵称" prop="nickName"> | |||
<el-input | |||
v-model="queryParams.nickName" | |||
placeholder="请输入昵称" | |||
clearable | |||
size="small" | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="手机号" prop="phone"> | |||
<el-input | |||
v-model="queryParams.phone" | |||
placeholder="请输入手机号" | |||
clearable | |||
size="small" | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="性别" prop="sex"> | |||
<el-select v-model="queryParams.sex" placeholder="请选择性别" clearable size="small"> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="服务宠物类型" prop="petTypeId"> | |||
<el-input | |||
v-model="queryParams.petTypeId" | |||
placeholder="请输入服务宠物类型" | |||
clearable | |||
size="small" | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item class="flex_one tr"> | |||
<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="['model:AppletUser2: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="['model:AppletUser2: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="['model:AppletUser2:remove']" | |||
>删除</el-button> | |||
</el-col> | |||
<el-col :span="1.5"> | |||
<el-button | |||
type="warning" | |||
plain | |||
icon="el-icon-download" | |||
size="mini" | |||
:loading="exportLoading" | |||
@click="handleExport" | |||
v-hasPermi="['model:AppletUser2:export']" | |||
>导出</el-button> | |||
</el-col> | |||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> | |||
</el-row> | |||
<el-table v-loading="loading" :data="AppletUser2List" @selection-change="handleSelectionChange"> | |||
<el-table-column type="selection" width="55" align="center" /> | |||
<el-table-column label="头像" align="center" prop="headImage" v-if="columns[0].visible"/> | |||
<el-table-column label="昵称" align="center" prop="nickName" v-if="columns[1].visible"/> | |||
<el-table-column label="手机号" align="center" prop="phone" v-if="columns[2].visible"/> | |||
<el-table-column label="性别" align="center" prop="sex" v-if="columns[3].visible"/> | |||
<el-table-column label="个人简介" align="center" prop="brief" v-if="columns[4].visible"/> | |||
<el-table-column label="养宠经验" align="center" prop="experience" v-if="columns[5].visible"/> | |||
<el-table-column label="服务宠物类型" align="center" prop="petTypeId" v-if="columns[6].visible"/> | |||
<el-table-column label="基础服务" align="center" prop="serviceBase" v-if="columns[7].visible"/> | |||
<el-table-column label="增值服务" align="center" prop="serviceIncrease" v-if="columns[8].visible"/> | |||
<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="['model:AppletUser2:edit']" | |||
>修改</el-button> | |||
<el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-delete" | |||
@click="handleDelete(scope.row)" | |||
v-hasPermi="['model:AppletUser2: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="50%" append-to-body> | |||
<el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-two"> | |||
<el-form-item label="头像"> | |||
<imageUpload v-model="form.headImage"/> | |||
</el-form-item> | |||
<el-form-item label="昵称" prop="nickName"> | |||
<el-input v-model="form.nickName" placeholder="请输入昵称" /> | |||
</el-form-item> | |||
<el-form-item label="手机号" prop="phone"> | |||
<el-input v-model="form.phone" placeholder="请输入手机号" /> | |||
</el-form-item> | |||
<el-form-item label="个人简介" prop="brief"> | |||
<el-input v-model="form.brief" type="textarea" placeholder="请输入内容" /> | |||
</el-form-item> | |||
<el-form-item label="养宠经验" prop="experience"> | |||
<el-input v-model="form.experience" type="textarea" placeholder="请输入内容" /> | |||
</el-form-item> | |||
<el-form-item label="服务宠物类型" prop="petTypeId"> | |||
<el-input v-model="form.petTypeId" placeholder="请输入服务宠物类型" /> | |||
</el-form-item> | |||
<el-form-item label="基础服务" prop="serviceBase"> | |||
<el-input v-model="form.serviceBase" type="textarea" placeholder="请输入内容" /> | |||
</el-form-item> | |||
<el-form-item label="增值服务" prop="serviceIncrease"> | |||
<el-input v-model="form.serviceIncrease" type="textarea" placeholder="请输入内容" /> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button type="primary" @click="submitForm">确 定</el-button> | |||
<el-button @click="cancel">取 消</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
<script> | |||
import { listAppletUser2, getAppletUser2, delAppletUser2, addAppletUser2, updateAppletUser2, exportAppletUser2 } from "@/api/model/AppletUser2"; | |||
export default { | |||
name: "AppletUser2", | |||
data() { | |||
return { | |||
// 遮罩层 | |||
loading: true, | |||
// 导出遮罩层 | |||
exportLoading: false, | |||
// 选中数组 | |||
ids: [], | |||
// 非单个禁用 | |||
single: true, | |||
// 非多个禁用 | |||
multiple: true, | |||
// 显示搜索条件 | |||
showSearch: true, | |||
// 总条数 | |||
total: 0, | |||
// 用户服务信息表格数据 | |||
AppletUser2List: [], | |||
// 弹出层标题 | |||
title: "", | |||
// 是否显示弹出层 | |||
open: false, | |||
// 查询参数 | |||
queryParams: { | |||
pageNum: 1, | |||
pageSize: 10, | |||
headImage: null, | |||
nickName: null, | |||
phone: null, | |||
sex: null, | |||
brief: null, | |||
experience: null, | |||
petTypeId: null, | |||
serviceBase: null, | |||
serviceIncrease: null, | |||
}, | |||
// 表单参数 | |||
form: {}, | |||
// 表单校验 | |||
rules: { | |||
nickName: [ | |||
{ required: true, message: "昵称不能为空", trigger: "blur" } | |||
], | |||
phone: [ | |||
{ required: true, message: "手机号不能为空", trigger: "blur" } | |||
], | |||
sex: [ | |||
{ required: true, message: "性别不能为空", trigger: "change" } | |||
], | |||
}, | |||
columns: [ | |||
{ key: 0, label: "头像", visible: false }, | |||
{ key: 1, label: "昵称", visible: true }, | |||
{ key: 2, label: "手机号", visible: true }, | |||
{ key: 3, label: "性别", visible: true }, | |||
{ key: 4, label: "个人简介", visible: true }, | |||
{ key: 5, label: "养宠经验", visible: true }, | |||
{ key: 6, label: "服务宠物类型", visible: true }, | |||
{ key: 7, label: "基础服务", visible: true }, | |||
{ key: 8, label: "增值服务", visible: true }, | |||
], | |||
}; | |||
}, | |||
created() { | |||
this.getList(); | |||
}, | |||
methods: { | |||
/** 查询用户服务信息列表 */ | |||
getList() { | |||
this.loading = true; | |||
listAppletUser2(this.queryParams).then(response => { | |||
this.AppletUser2List = response.rows; | |||
this.total = response.total; | |||
this.loading = false; | |||
}); | |||
}, | |||
// 取消按钮 | |||
cancel() { | |||
this.open = false; | |||
this.reset(); | |||
}, | |||
// 表单重置 | |||
reset() { | |||
this.form = { | |||
headImage: null, | |||
nickName: null, | |||
phone: null, | |||
sex: null, | |||
brief: null, | |||
experience: null, | |||
petTypeId: null, | |||
serviceBase: null, | |||
serviceIncrease: null, | |||
}; | |||
this.resetForm("form"); | |||
}, | |||
/** 搜索按钮操作 */ | |||
handleQuery() { | |||
this.queryParams.pageNum = 1; | |||
this.getList(); | |||
}, | |||
/** 重置按钮操作 */ | |||
resetQuery() { | |||
this.resetForm("queryForm"); | |||
this.handleQuery(); | |||
}, | |||
// 多选框选中数据 | |||
handleSelectionChange(selection) { | |||
this.ids = selection.map(item => item.headImage) | |||
this.single = selection.length!==1 | |||
this.multiple = !selection.length | |||
}, | |||
/** 新增按钮操作 */ | |||
handleAdd() { | |||
this.reset(); | |||
this.open = true; | |||
this.title = "添加用户服务信息"; | |||
}, | |||
/** 修改按钮操作 */ | |||
handleUpdate(row) { | |||
this.reset(); | |||
const headImage = row.headImage || this.ids | |||
getAppletUser2(headImage).then(response => { | |||
this.form = response.data; | |||
this.open = true; | |||
this.title = "修改用户服务信息"; | |||
}); | |||
}, | |||
/** 提交按钮 */ | |||
submitForm() { | |||
this.$refs["form"].validate(valid => { | |||
if (valid) { | |||
if (this.form.headImage != null) { | |||
updateAppletUser2(this.form).then(response => { | |||
this.$modal.msgSuccess("修改成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} else { | |||
addAppletUser2(this.form).then(response => { | |||
this.$modal.msgSuccess("新增成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} | |||
} | |||
}); | |||
}, | |||
/** 删除按钮操作 */ | |||
handleDelete(row) { | |||
const headImages = row.headImage || this.ids; | |||
this.$modal.confirm('是否确认删除用户服务信息编号为"' + headImages + '"的数据项?').then(function() { | |||
return delAppletUser2(headImages); | |||
}).then(() => { | |||
this.getList(); | |||
this.$modal.msgSuccess("删除成功"); | |||
}).catch(() => {}); | |||
}, | |||
/** 导出按钮操作 */ | |||
handleExport() { | |||
const queryParams = this.queryParams; | |||
this.$modal.confirm('是否确认导出所有用户服务信息数据项?').then(() => { | |||
this.exportLoading = true; | |||
return exportAppletUser2(queryParams); | |||
}).then(response => { | |||
this.download(response.msg); | |||
this.exportLoading = false; | |||
}).catch(() => {}); | |||
} | |||
} | |||
}; | |||
</script> |