qx
qx
6 天以前 a4d79237c73a1db49649a8d3108eec95a8e67c37
src/views/advice/advice/index.vue
@@ -1,265 +1,112 @@
<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
      @submit.native.prevent
    >
    <el-form-item label="标题" prop="bt">
        <el-input
          v-model="queryParams.bt"
          placeholder="请输入标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目名称" prop="proName">
        <el-input
          v-model="queryParams.proName"
          placeholder="请输入项目名称"
          clearable
          @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="20">
      <el-col :span="4" :xs="24"> </el-col>
      <el-col :span="20" :xs="24">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"
          @submit.native.prevent>
          <el-form-item label="标题" prop="bt">
            <el-input v-model="queryParams.bt" placeholder="请输入标题" clearable @keyup.enter.native="handleQuery" />
          </el-form-item>
          <el-form-item label="项目名称" prop="proName">
            <el-input v-model="queryParams.proName" placeholder="请输入项目名称" clearable @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-col>
    </el-row>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['advice:advice:add']"
          >新增</el-button
        >
        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['advice:advice:add']">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['advice:advice:edit']"
          >修改</el-button
        >
        <el-button type="primary" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
          v-hasPermi="['advice:advice:edit']">修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['advice:advice:remove']"
          >删除</el-button
        >
        <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          v-hasPermi="['advice:advice:remove']">删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['advice:advice:export']"
          >导出</el-button
        >
        <el-button type="primary" icon="el-icon-download" size="mini" @click="handleExport"
          v-hasPermi="['advice:advice:export']">导出</el-button>
      </el-col>
    </el-row>
    <el-row :gutter="20">
      <el-col :span="4" :xs="24">
        <div class="head-container">
          <div class="content">
            <el-tree
              :data="deptOptions"
              :props="defaultProps"
              :expand-on-click-node="false"
              :filter-node-method="filterNode"
              ref="tree"
              node-key="id"
              default-expand-all
              :default-expanded-keys="treeId"
              highlight-current
              @node-click="handleNodeClick"
            />
            <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false"
              :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all
              :default-expanded-keys="treeId" highlight-current @node-click="handleNodeClick" />
          </div>
        </div>
      </el-col>
      <el-col :span="20" :xs="24">
        <el-table
          v-loading="loading"
          :data="adviceList"
          @selection-change="handleSelectionChange"
          border
        >
        <el-table v-loading="loading" :data="adviceList" @selection-change="handleSelectionChange" border>
          <el-table-column type="selection" width="55" align="center" fixed />
          <el-table-column
            label="序号"
            align="center"
            prop="newID"
            width="55px"
          />
          <el-table-column
            label="所属科室"
            align="center"
            prop="deptName"
            width="120px"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="体检项目"
            align="center"
            prop="proName"
            width="120px"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="标题"
            align="center"
            prop="title"
            width="120px"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="建议"
            align="center"
            prop="advice"
            width="1249px"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="操作"
            align="center"
            fixed="right"
            class-name="small-padding fixed-width"
            width="80px"
          >
          <el-table-column label="序号" align="center" prop="newID" width="55px" />
          <el-table-column label="所属科室" align="center" prop="deptName" width="120px" :show-overflow-tooltip="true" />
          <el-table-column label="体检项目" align="center" prop="proName" width="120px" :show-overflow-tooltip="true" />
          <el-table-column label="标题" align="center" prop="title" width="120px" :show-overflow-tooltip="true" />
          <el-table-column label="建议" align="center" prop="advice" width="1249px" :show-overflow-tooltip="true" />
          <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" width="80px">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleUpdate(scope.row)"
                v-hasPermi="['advice:advice:edit']"
                title="修改"
              ></el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPermi="['advice:advice:remove']"
                title="删除"
              ></el-button>
              <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
                v-hasPermi="['advice:advice:edit']" title="修改"></el-button>
              <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
                v-hasPermi="['advice:advice:remove']" title="删除"></el-button>
            </template>
          </el-table-column>
        </el-table>
        <div class="pag">
      <div class="pag1">
        <pagination
          v-show="total > 0"
          :total="total"
          :page.sync="queryParams.page"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />
      </div>
    </div>
          <div class="pag1">
            <pagination v-show="total > 0" :total="total" :page.sync="queryParams.page"
              :limit.sync="queryParams.pageSize" @pagination="getList" />
          </div>
        </div>
      </el-col>
    </el-row>
    <!-- 添加或修改advice对话框 -->
    <el-dialog
      :title="title"
      :visible.sync="open"
      width="1000px"
      append-to-body
    >
    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="归属科室" prop="deptId">
            <!-- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属科室"
          <!-- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属科室"
              style="width: 200px" /> -->
            <el-select
            v-if="DepartmentList.length > 0"
              v-model="form.deptId"
              placeholder="请选择归属科室"
              clearable
              style="width: 200px"
              filterable
            >
              <el-option
                v-for="dict in DepartmentList"
                :key="dict.deptId"
                :label="dict.deptName || ''"
                :value="dict.deptId"
              />
            </el-select>
          </el-form-item>
        <el-form-item label="检查项目" prop="proName">
          <el-select
            v-model="form.proId"
            placeholder="请输入项目名称"
            filterable
            style="width: 240px"
            clearable
          >
            <el-option
              v-for="(dict, index) in projectList"
              :key="index"
              :label="dict.proName"
              :value="dict.proId"
            />
          <el-select v-if="DepartmentList.length > 0" v-model="form.deptId" placeholder="请选择归属科室" clearable
            style="width: 200px" filterable>
            <el-option v-for="dict in DepartmentList" :key="dict.deptId" :label="dict.deptName || ''"
              :value="dict.deptId" />
          </el-select>
        </el-form-item>
        <el-form-item label="检查项目" prop="proName">
          <el-select v-model="form.proId" placeholder="请输入项目名称" filterable style="width: 240px" clearable>
            <el-option v-for="(dict, index) in projectList" :key="index" :label="dict.proName" :value="dict.proId" />
          </el-select>
        </el-form-item>
        <el-form-item label="建议标题" prop="title">
          <el-input v-model="form.title" placeholder="请输入名称标题" />
        </el-form-item>
        <el-form-item label="快捷标签" prop="kjbq">
          <span
            slot="label"
            style="display: inline-block; border-bottom: 2px solid blue"
            @click="handlekjbq"
          >
          <span slot="label" style="display: inline-block; border-bottom: 2px solid blue" @click="handlekjbq">
            快捷标签
          </span>
          <el-checkbox-group v-model="kjbq" @change="handleCheckedCitiesChange">
            <el-checkbox
              v-for="(item, index) in dataList"
              :key="index"
              :label="item.id"
              >{{ item.kjbq }}</el-checkbox
            >
            <el-checkbox v-for="(item, index) in dataList" :key="index" :label="item.id">{{ item.kjbq }}</el-checkbox>
          </el-checkbox-group>
        </el-form-item>
        <el-form-item label="建议内容" prop="advice">
          <el-input
            type="textarea"
            v-model="form.advice"
            :autosize="{ minRows: 9, maxRows: 10 }"
            placeholder="请输入建议"
          />
          <el-input type="textarea" v-model="form.advice" :autosize="{ minRows: 9, maxRows: 10 }" placeholder="请输入建议" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
@@ -267,12 +114,7 @@
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog
      title="添加快捷标签"
      :visible.sync="kjbqopen"
      width="500px"
      append-to-body
    >
    <el-dialog title="添加快捷标签" :visible.sync="kjbqopen" width="500px" append-to-body>
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="名称" prop="kjbq">
          <el-input v-model="formss.kjbq" placeholder="请输入名称" />
@@ -287,7 +129,7 @@
</template>
<script>
import { deptTreeSelect ,getDeptListByDictHospId} from "@/api/system/user";
import { deptTreeSelect, getDeptListByDictHospId } from "@/api/system/user";
import {
  listAdvice,
  getAdvice,
@@ -383,7 +225,7 @@
  },
  methods: {
    sendhospName() {
      getDeptListByDictHospId({
        id: 2000
      }).then((res) => {
@@ -524,7 +366,7 @@
        }
      });
    },
    handleCheckedCitiesChange(val) {},
    handleCheckedCitiesChange(val) { },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
@@ -563,7 +405,7 @@
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
        .catch(() => { });
    },
    /** 导出按钮操作 */
    handleExport() {
@@ -584,6 +426,7 @@
  display: flex;
  justify-content: center;
}
.pag1 {
  width: 30%;
}
@@ -593,6 +436,7 @@
  width: 1000px;
  height: 1000px;
}
.head-container {
  width: 200px;
  height: 629px;