Ver código fonte

新增用户协议管理

xjc 2 anos atrás
pai
commit
f3dda0b66e
4 arquivos alterados com 285 adições e 6 exclusões
  1. 10 0
      src/api.js
  2. 6 6
      src/main.js
  3. 17 0
      src/router.js
  4. 252 0
      src/views/doctor/agreementIndex.vue

+ 10 - 0
src/api.js

@@ -99,5 +99,15 @@ export default {
     },
     delPatientCaseInfo: params => {
         return axios.delete(`${baseURL}/api/admin/doctor/patient/case`, { params: params })
+    },
+    // 用户协议
+    getUserAgreementList: params => {
+        return axios.get(`${baseURL}/api/admin/doctor/useragreement/list`, { params: params })
+    },
+    editUserAgreement: params => {
+        return axios.put(`${baseURL}/api/admin/doctor/useragreement`, params)
+    },
+    getUserAgreementInfo: params => {
+        return axios.get(`${baseURL}/api/admin/doctor/useragreement`, { params: params })
     }
 }

+ 6 - 6
src/main.js

@@ -17,13 +17,13 @@ import constant from './constant'
 //   ak: '1hqg34NFaCw9jcv0xG82cI7uINFaXGGM'
 // })
 
-// import VueUeditorWrap from 'vue-ueditor-wrap' // ES6 Module
-// import '../public/static/UEditor/ueditor.config'
-// import '../public/static/UEditor/ueditor.all'
-// import '../public/static/UEditor/lang/zh-cn/zh-cn'
-// import '../public/static/UEditor/themes/default/css/ueditor.css';
+import VueUeditorWrap from 'vue-ueditor-wrap' // ES6 Module
+import '../public/static/UEditor/ueditor.config'
+import '../public/static/UEditor/ueditor.all'
+import '../public/static/UEditor/lang/zh-cn/zh-cn'
+import '../public/static/UEditor/themes/default/css/ueditor.css';
 
-// Vue.component('vue-ueditor-wrap', VueUeditorWrap)
+Vue.component('vue-ueditor-wrap', VueUeditorWrap)
 // Vue.use(FullCalendar)
 // Vue.prototype.$echarts = echarts
 

+ 17 - 0
src/router.js

@@ -43,6 +43,23 @@ export default new Router({
                     name: '病例列表'
                 }
             ]
+        },
+        {
+            path: '/agreement',
+            name: '系统管理',
+            icon: 'el-icon-tickets',
+            component: () =>
+                import ('./views/Home.vue'),
+            show: 1,
+            isLeaf: 0,
+            children: [
+                {
+                    path: '/agreement/list',
+                    component: () =>
+                        import ('./views/doctor/agreementIndex.vue'),
+                    name: '用户协议'
+                }
+            ]
         }
     ]
 })

+ 252 - 0
src/views/doctor/agreementIndex.vue

@@ -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>