wjj пре 1 недеља
родитељ
комит
222fe68a03
3 измењених фајлова са 362 додато и 2 уклоњено
  1. 62 0
      src/api/his/projectCate.js
  2. 23 2
      src/views/his/project/index.vue
  3. 277 0
      src/views/his/projectCate/index.vue

+ 62 - 0
src/api/his/projectCate.js

@@ -0,0 +1,62 @@
+import request from '@/utils/request'
+
+// 查询理疗分类列表
+export function listProjectCate(query) {
+  return request({
+    url: '/his/projectCate/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询理疗分类详细
+export function getProjectCate(id) {
+  return request({
+    url: '/his/projectCate/' + id,
+    method: 'get'
+  })
+}
+
+// 新增理疗分类
+export function addProjectCate(data) {
+  return request({
+    url: '/his/projectCate',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改理疗分类
+export function updateProjectCate(data) {
+  return request({
+    url: '/his/projectCate',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除理疗分类
+export function delProjectCate(id) {
+  return request({
+    url: '/his/projectCate/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出理疗分类
+export function exportProjectCate(query) {
+  return request({
+    url: '/his/projectCate/export',
+    method: 'get',
+    params: query
+  })
+}
+
+
+
+export function projectCateOptions(id) {
+  return request({
+    url: '/his/projectCate/options',
+    method: 'get'
+  })
+}

+ 23 - 2
src/views/his/project/index.vue

@@ -99,9 +99,18 @@
     <!-- 添加或修改理疗配置对话框 -->
     <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="cateId">
+          <el-select v-model="form.cateId" placeholder="请选择理疗分类">
+            <el-option v-for="dict in projectCateList" :key="dict.id" :label="dict.cateName"
+              :value="parseInt(dict.id)"></el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item label="方案名称" prop="projectName">
           <el-input v-model="form.projectName" placeholder="请输入方案名称" />
         </el-form-item>
+        <el-form-item label="副标题" prop="subTitle">
+          <el-input v-model="form.subTitle" placeholder="请输入副标题" />
+        </el-form-item>
         <el-form-item label="天数名称" prop="dayName">
           <el-input v-model="form.dayName" placeholder="请输入天数名称" />
         </el-form-item>
@@ -246,7 +255,8 @@ import { uploadObject } from "@/utils/cos.js";
 import { uploadToOBS } from "@/utils/obs.js";
 import Pagination from "@/components/Pagination";
 import { listVideoResource } from '@/api/course/videoResource';
-import { getCateListByPid, getCatePidList } from '@/api/course/userCourseCategory'
+import { getCateListByPid, getCatePidList } from '@/api/course/userCourseCategory';
+import { projectCateOptions } from "@/api/his/projectCate";
 export default {
   name: "Project",
    components: { Editor, Pagination },
@@ -305,9 +315,15 @@ export default {
       form: {},
       // 表单校验
       rules: {
+        cateId: [
+          { required: true, message: "请选择理疗分类", trigger: "change" }
+        ],
         projectName: [
           { required: true, message: "方案名称不能为空", trigger: "blur" }
         ],
+        subTitle: [
+          { required: true, message: "副标题不能为空", trigger: "blur" }
+        ],
         dayName: [
           { required: true, message: "天数名称不能为空", trigger: "blur" }
         ],
@@ -344,11 +360,16 @@ export default {
         // fourthContent: [
         //   { required: true, message: "第四内容不能为空", trigger: "blur" }
         // ],
-      }
+      },
+
+      projectCateList: [],
     };
   },
   created() {
     this.getList();
+    projectCateOptions().then(response => {
+      this.projectCateList = response.data
+    });
   },
   methods: {
 

+ 277 - 0
src/views/his/projectCate/index.vue

@@ -0,0 +1,277 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="分类名称" prop="cateName">
+        <el-input
+          v-model="queryParams.cateName"
+          placeholder="请输入分类名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </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="['his:projectCate: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="['his:projectCate: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="['his:projectCate: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="['his:projectCate:export']"
+        >导出</el-button>
+      </el-col> -->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="projectCateList" @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="cateName" />
+      <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="['his:projectCate:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['his:projectCate: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="cateName">
+          <el-input v-model="form.cateName" placeholder="请输入分类名称" />
+        </el-form-item>
+        <el-form-item label="状态" prop="status">
+          <el-radio-group v-model="form.status">
+            <el-radio :label="0">禁用</el-radio>
+            <el-radio :label="1">正常</el-radio>
+          </el-radio-group>
+        </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 { listProjectCate, getProjectCate, delProjectCate, addProjectCate, updateProjectCate, exportProjectCate } from "@/api/his/projectCate";
+import { status } from "nprogress";
+
+export default {
+  name: "ProjectCate",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 理疗分类表格数据
+      projectCateList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        cateName: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        cateName: [
+          { required: true, message: "分类名称不能为空", trigger: "blur" }
+        ],
+        status: [
+          { required: true, message: "状态不能为空", trigger: "change" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询理疗分类列表 */
+    getList() {
+      this.loading = true;
+      listProjectCate(this.queryParams).then(response => {
+        this.projectCateList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        cateName: null,
+        createTime: null,
+        updateTime: 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.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加理疗分类";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getProjectCate(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改理疗分类";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateProjectCate(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addProjectCate(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除理疗分类编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delProjectCate(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有理疗分类数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportProjectCate(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>