|
@@ -0,0 +1,252 @@
|
|
|
|
|
+<style lang="scss">
|
|
|
|
|
+.avatar-uploader .el-upload {
|
|
|
|
|
+ border: 1px dashed #d9d9d9;
|
|
|
|
|
+ border-radius: 6px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.avatar-uploader .el-upload:hover {
|
|
|
|
|
+ border-color: #409eff;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.avatar-uploader-icon {
|
|
|
|
|
+ font-size: 28px;
|
|
|
|
|
+ color: #8c939d;
|
|
|
|
|
+ width: 178px;
|
|
|
|
|
+ height: 178px;
|
|
|
|
|
+ line-height: 178px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.avatar {
|
|
|
|
|
+ width: 178px;
|
|
|
|
|
+ height: 178px;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|
|
|
|
|
+<template>
|
|
|
|
|
+ <section class="content">
|
|
|
|
|
+ <h4>用户协议列表</h4>
|
|
|
|
|
+ <el-divider></el-divider>
|
|
|
|
|
+ <!-- <el-form label-width="80px" class="filter-form">
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="4">
|
|
|
|
|
+ <el-form-item label="名称">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @clear="getData()"
|
|
|
|
|
+ v-model="queryParams.name"
|
|
|
|
|
+ placeholder="请输入名称"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="4">
|
|
|
|
|
+ <el-form-item label="手机号">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @clear="getData()"
|
|
|
|
|
+ v-model="queryParams.phone"
|
|
|
|
|
+ placeholder="请输入手机号"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="4">
|
|
|
|
|
+ <el-form-item label-width="10" style="margin-left: 10px">
|
|
|
|
|
+ <el-button type="primary" @click="getData" size="mini"
|
|
|
|
|
+ >筛选</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="handleAdd"
|
|
|
|
|
+ >新增医生</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form> -->
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ v-loading="loading"
|
|
|
|
|
+ :data="list"
|
|
|
|
|
+ style="width: 100%; margin-top: 10px"
|
|
|
|
|
+ height="50vh"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column align="center" prop="name" label="名称" />
|
|
|
|
|
+ <el-table-column align="center" prop="ctime" label="创建时间" />
|
|
|
|
|
+ <el-table-column align="center" prop="date" label="操作" width="320">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button @click="edit(scope.row.id)" size="mini" type="warning"
|
|
|
|
|
+ >编辑</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ <Page
|
|
|
|
|
+ ref="pageButton"
|
|
|
|
|
+ :current="form.page"
|
|
|
|
|
+ :page_size="form.page_size"
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ @pageChange="gopage"
|
|
|
|
|
+ />
|
|
|
|
|
+ <!-- 新增医生 -->
|
|
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
|
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
+ <el-form-item label="名称" prop="name">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ clearable
|
|
|
|
|
+ v-model="form.name"
|
|
|
|
|
+ placeholder="请输入名称"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="协议内容">
|
|
|
|
|
+ <vue-ueditor-wrap ref="editor" v-model="form.content" :config="myConfig"></vue-ueditor-wrap>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
+ <el-button @click="open = false">取 消</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ </section>
|
|
|
|
|
+</template>
|
|
|
|
|
+<script>
|
|
|
|
|
+import Page from "../../components/Page";
|
|
|
|
|
+import fuEditor from "@/components/fuEditor/index.vue";
|
|
|
|
|
+export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ Page,
|
|
|
|
|
+ fuEditor
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ queryParams: {
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ },
|
|
|
|
|
+ form: {},
|
|
|
|
|
+ form1: {},
|
|
|
|
|
+ form2: {},
|
|
|
|
|
+ list: [{}, {}],
|
|
|
|
|
+ total: 0,
|
|
|
|
|
+ title: "新增用户",
|
|
|
|
|
+ open: false,
|
|
|
|
|
+ doctorList: [],
|
|
|
|
|
+ rules: {},
|
|
|
|
|
+ myConfig: {
|
|
|
|
|
+ // 编辑器自动被内容撑高
|
|
|
|
|
+ autoHeightEnabled: true,
|
|
|
|
|
+ // 初始容器高度
|
|
|
|
|
+ initialFrameHeight: 500,
|
|
|
|
|
+ // 初始容器宽度
|
|
|
|
|
+ initialFrameWidth: '100%',
|
|
|
|
|
+ // 上传文件接口,实现上传图片功能必须的配置,这个地址会在后端配置的时候产生,此处先放上结果
|
|
|
|
|
+ serverUrl: '/api/admin/ueditor/upload',
|
|
|
|
|
+ },
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ del(id) {
|
|
|
|
|
+ this.$confirm("确认删除?", "提示", {
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ this.$api
|
|
|
|
|
+ .delDoctorInfo({
|
|
|
|
|
+ id: id,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (!res.data.code) {
|
|
|
|
|
+ this.$msgSuccess("删除成功");
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$msgError(res.data.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ gopage(size) {
|
|
|
|
|
+ if (size) {
|
|
|
|
|
+ this.queryParams.page_size = size;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.queryParams.page = this.$refs.pageButton.page;
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ },
|
|
|
|
|
+ getData() {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ this.$api.getUserAgreementList(this.queryParams).then((res) => {
|
|
|
|
|
+ this.list = res.data.data.list;
|
|
|
|
|
+ this.total = res.data.data.total;
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ handleAdd() {
|
|
|
|
|
+ this.open = true;
|
|
|
|
|
+ this.title = "新增医生";
|
|
|
|
|
+ this.form = {};
|
|
|
|
|
+ },
|
|
|
|
|
+ edit(id) {
|
|
|
|
|
+ this.title = "编辑用户协议";
|
|
|
|
|
+ this.$api
|
|
|
|
|
+ .getUserAgreementInfo({
|
|
|
|
|
+ id: id,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.form = res.data.data;
|
|
|
|
|
+ this.open = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 提交按钮 */
|
|
|
|
|
+ submitForm() {
|
|
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ if (this.form.id != null) {
|
|
|
|
|
+ this.$api.editUserAgreement(this.form).then((res) => {
|
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
|
+ this.msgSuccess("成功!");
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.msgError(res.data.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$api.addDoctorInfo(this.form).then((res) => {
|
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
|
+ this.msgSuccess("成功!");
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.msgError(res.data.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ remoteMethod(query) {
|
|
|
|
|
+ if (query !== "") {
|
|
|
|
|
+ // this.loading = true;
|
|
|
|
|
+ this.$api
|
|
|
|
|
+ .getDoctorsSearchList({
|
|
|
|
|
+ name: query,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.doctorList = res.data.data;
|
|
|
|
|
+ this.$set(this.doctorList, res.data.data);
|
|
|
|
|
+ // this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.doctorList = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|