2767c4c422c39bb26ee92d5c841b094ce12df4c6..375f79172e357300895dbae7ab7fb19bf6e4b4e1
2025-06-20 wwl
1
375f79 对比 | 目录
2025-06-20 lkk
1
208396 对比 | 目录
2025-06-20 qx
qx
6871a1 对比 | 目录
2025-06-20 wwl
通知
e35207 对比 | 目录
8个文件已修改
1473 ■■■■ 已修改文件
src/api/system/notice.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/user.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doctor/checkAll/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hosp/project/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/index.vue 478 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/contract/index.vue 427 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/notice/index.vue 535 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/notice.js
@@ -8,7 +8,12 @@
    params: query
  })
}
export function noticeToday() {
  return request({
    url: '/system/notice/noticeToday',
    method: 'get',
  })
}
// 查询公告详细
export function getNotice(noticeId) {
  return request({
src/api/system/user.js
@@ -11,7 +11,14 @@
    params: query
  })
}
// 查询用户列表
export function listUser1(query) {
  return request({
    url: '/system/user/userListByDeptId',
    method: 'get',
    params: query
  })
}
export function getlistUser() {
  return request({
    url: '/system/user/getList',
src/views/doctor/checkAll/index.vue
@@ -145,10 +145,8 @@
            <tr style="border: 1px solid #dfe6ec; border-collapse: collapse; height: 36px;">
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">姓名:</td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">{{ tableAll.cusName }}</td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">性别:</td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">
                {{ tableAll.cusSex == 0 ? "男" : tableAll.cusSex == 1 ? "女" : "未知" }}
              </td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">性别: {{ tableAll.cusSex == 0 ? "男" : tableAll.cusSex == 1 ? "女" : "未知" }}</td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">年龄:{{ tableAll.age }}</td>
            </tr>
            <tr style="border: 1px solid #dfe6ec; border-collapse: collapse; height: 36px;">
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">体检单号:</td>
src/views/hosp/project/index.vue
@@ -469,10 +469,10 @@
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="标本类型" prop="specimenType">
        <el-form-item label="样本类型" prop="specimenType">
          <el-select
            v-model="form.specimenType"
            placeholder="请选择标本类型"
            placeholder="请选择样本类型"
            style="width: 200px"
            filterable
            clearable
src/views/index.vue
@@ -1,6 +1,30 @@
<template>
  <div class="centre">
    <div style="display:flex;justify-content: center;align-items: center;">
    <!-- 今日通知 -->
    <div style="display: flex; justify-content: center; align-items: center;">
      <h4>今日通知</h4>
    </div>
    <div class="notice-area">
      <el-carousel :interval="2000" direction="vertical" :autoplay="true" :loop="true" height="120px"
        v-if="groupedNoticeList.length > 0" class="carousel">
        <el-carousel-item v-for="(group, index) in groupedNoticeList" :key="index">
          <div class="notice-group">
            <div class="notice-item" v-for="notice in group" :key="notice.noticeId"
              @click="goToNotice(notice.noticeId)">
              <el-tag size="small" :type="notice.noticeType === '1' ? 'info' : 'warning'">
                {{ notice.noticeType === '1' ? '通知' : '公告' }}
              </el-tag>
              <span class="notice-title">{{ notice.noticeTitle || '无标题' }}</span>
              <span class="notice-time">{{ parseTime(notice.createTime, '{y}-{m}-{d}') || '无时间' }}</span>
            </div>
          </div>
        </el-carousel-item>
      </el-carousel>
      <div v-else class="no-notice">暂无通知</div>
    </div>
    <!-- 今日统计 -->
    <div style="display: flex; justify-content: center; align-items: center;">
      <h4>今日统计</h4>
    </div>
    <div class="top">
@@ -37,11 +61,13 @@
        </div>
      </div>
    </div>
     <div style="display:flex;justify-content: center;align-items: center;">
    <!-- 近一月统计 -->
    <div style="display: flex; justify-content: center; align-items: center;">
      <h4>近一月统计</h4>
    </div>
    <div class="data-view">
      <div id="main" style="width:95%;height:330px"></div>
      <div id="main" style="width: 95%; height: 330px"></div>
    </div>
    <div class="view">
      <div id="main2"></div>
@@ -52,11 +78,13 @@
<script>
import { getCustomer, getOrder, getReportToday, getTobeToday, getPieChart, getChart } from "@/api/home";
import { noticeToday } from "@/api/system/notice";
const echarts = require('echarts/lib/echarts');
require('echarts/lib/component/title');
require('echarts/lib/component/tooltip');
require('echarts/lib/component/legend');
require('echarts/lib/chart/pie');
require('echarts/lib/chart/line');
export default {
  data() {
@@ -73,305 +101,304 @@
      teamYYNum: [],
      PieChart: [],
      PieChart2: [],
    }
      noticeList: [],
      groupedNoticeList: [], // 分组后的通知列表
      loading: false
    };
  },
  created() {
    this.getList();
  },
  watch: {
        $route(to, from) {
            window.location.reload(); //监测到路由发生跳转时刷新一次页面
            // this.$router.go(0);
        },
    $route(to, from) {
      window.location.reload();
    },
    noticeList: {
      handler(newList) {
        // 将通知按每组三条分组
        this.groupedNoticeList = this.chunkArray(newList, 3);
        console.log('groupedNoticeList:', this.groupedNoticeList); // 调试
      },
      deep: true
    }
  },
  methods: {
    goToNotice(noticeId) {
      this.$router.push({
        path: '/notice',
        query: { noticeId }
      });
    },
    getList() {
      this.loading = true;
      // 查询所有公告
      noticeToday().then(response => {
        console.log('Notice API response:', response);
        this.noticeList = response.rows || response.data || [];
        console.log('noticeList:', this.noticeList);
        this.loading = false;
        this.$nextTick(() => {
          console.log('Carousel updated');
        });
      }).catch(error => {
        console.error('Notice API error:', error);
        this.$message.error("获取通知失败:" + error.message);
        this.loading = false;
      });
      // 查询今日登记
      getCustomer().then((response) => {
        this.Customer = response
      getCustomer().then(response => {
        this.Customer = response.data || response;
        this.loading = false;
      });
      // 查询今日已检
      getOrder().then((response) => {
        this.Order = response
      getOrder().then(response => {
        this.Order = response.data || response;
        this.loading = false;
      });
      // 查询今日报告
      getReportToday().then((response) => {
        this.ReportToday = response
      getReportToday().then(response => {
        this.ReportToday = response.data || response;
        this.loading = false;
      });
      // 查询今日待检
      getTobeToday().then((response) => {
        this.TobeToday = response
      getTobeToday().then(response => {
        this.TobeToday = response.data || response;
        this.loading = false;
      });
      // 折线图
      getChart().then((response) => {
      getChart().then(response => {
        response.data.forEach(item => {
          this.LineChart.push(item.date)
          this.LineChart.push(item.date);
          this.reportNum.push(item.tdcoun);
          this.personYYNum.push(item.grcoun);
          this.teamYYNum.push(item.bgcoun);
        });
        let myChart = this.$echarts.init(document.getElementById('main'));
        let myChart = this.$echarts.init(document.getElementById('main'));
        myChart.setOption({
          tooltip: {
            trigger: 'axis'
          },
          legend: {
            data: ['每日体检登记数', '每日团体登记数', '每日发布报告数']
          },
          grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
          },
          toolbox: {
            feature: {
              saveAsImage: {}
            }
          },
          tooltip: { trigger: 'axis' },
          legend: { data: ['每日体检登记数', '每日团体登记数', '每日发布报告数'] },
          grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
          toolbox: { feature: { saveAsImage: {} } },
          xAxis: {
            type: 'category',
            boundaryGap: false,
            axisLine: {
              show: true,
              lineStyle: {
                color: "blue",
                size: 12,
                width: 0,
                tyle: "solid"
              }
              lineStyle: { width: 0, color: 'blue', type: 'solid' }
            },
            data: this.LineChart
          },
          yAxis: {
            type: 'value',
            min: 0,
            max: 400,
            interval: 20
          },
          yAxis: { type: 'value', min: 0, max: 400, interval: 20 },
          series: [
            {
              name: '每日体检登记数',
              type: 'line',
              stack: 'Total',
              data: this.personYYNum
            },
            {
              name: '每日团体登记数',
              type: 'line',
              stack: 'Total',
              data: this.reportNum
            },
            {
              name: '每日发布报告数',
              type: 'line',
              stack: 'Total',
              data: this.teamYYNum
            },
            { name: '每日体检登记数', type: 'line', stack: 'Total', data: this.personYYNum },
            { name: '每日团体登记数', type: 'line', stack: 'Total', data: this.reportNum },
            { name: '每日发布报告数', type: 'line', stack: 'Total', data: this.teamYYNum }
          ]
        });
        })
        let sizeFun =  ()=> {
          myChart.resize()
        }
        window.addEventListener("resize", sizeFun)
        const sizeFun = () => myChart.resize();
        window.addEventListener('resize', sizeFun);
        this.loading = false;
      });
      // 饼状图
      getPieChart().then((response) => {
      getPieChart().then(response => {
        if (response.data) {
          if(response.data.tjdj == 0){
            this.PieChart = []
            this.PieChart = [
              {
                "name": "体检登记人数分布",
                "count": 1,
                "value": 10
              },
            ]
          }else if (response.data.tjdj.length === 0) {
            this.PieChart = []
            this.PieChart = [
              {
                "name": "体检登记人数分布",
                "count": 1,
                "value": 10
              },
            ]
          if (response.data.tjdj == 0 || !response.data.tjdj?.length) {
            this.PieChart = [{ name: '体检登记人数分布', count: 1, value: 10 }];
          } else {
            this.PieChart = response.data.tjdj
            this.PieChart.forEach(item => {
              item.value = item.count
            })
            this.PieChart.reverse()
            this.PieChart.push(this.PieChart[0])
            this.PieChart.splice(0, 1)
            this.PieChart = response.data.tjdj;
            this.PieChart.forEach(item => { item.value = item.count; });
            this.PieChart.reverse();
            this.PieChart.push(this.PieChart[0]);
            this.PieChart.splice(0, 1);
          }
          let myChart2 = this.$echarts.init(document.getElementById('main2'));
          myChart2.setOption({
            title: {
              text: '体检登记人数分布',
              top: '5'
            title: { text: '体检登记人数分布', top: '5' },
            tooltip: { trigger: 'item' },
            legend: { top: '80%', left: 'center' },
            series: [{
              type: 'pie',
              radius: ['16%', '54%'],
              center: ['50%', '43%'],
              avoidLabelOverlap: false,
              startAngle: 180,
              minAngle: 10,
              data: this.PieChart,
              emphasis: {
                itemStyle: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' }
              }
            }]
          });
            },
            tooltip: {
              trigger: 'item'
            },
            legend: {
              top: '80%',
              left: 'center'
            },
            series: [
              {
                // name: 'Access From',
                type: 'pie',
                radius: ['16%', '54%'],
                center: ["50%", "43%"],
                avoidLabelOveralap:false,
                startAngle:180,
                minAngle:10,
                data: this.PieChart,
                emphasis: {
                  itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                  }
                }
              }]
          })
          if(response.data.tjyc == 0){
            this.PieChart2 = []
            this.PieChart2 = [
              {
                "name": "体检结果异常人数分布",
                "count": 1,
                "value": 0
              },
            ]
          }else if (response.data.tjyc.length === 0) {
            this.PieChart2 = []
            this.PieChart2 = [
              {
                "name": "体检结果异常人数分布",
                "count": 1,
                "value": 0
              },
            ]
          if (response.data.tjyc == 0 || !response.data.tjyc?.length) {
            this.PieChart2 = [{ name: '体检结果异常人数分布', count: 1, value: 0 }];
          } else {
            this.PieChart2 = response.data.tjyc
            this.PieChart2.reverse()
            this.PieChart2.push(this.PieChart2[0])
            this.PieChart2.splice(0, 1)
            this.PieChart2.forEach(item => {
              item.value = item.count
            })
            // this.TobeToday = response
            this.PieChart2 = response.data.tjyc;
            this.PieChart2.reverse();
            this.PieChart2.push(this.PieChart2[0]);
            this.PieChart2.splice(0, 1);
            this.PieChart2.forEach(item => { item.value = item.count; });
          }
          let myChart3 = this.$echarts.init(document.getElementById('main3'));
          myChart3.setOption({
            title: {
              text: '体检结果异常人数分布',
              top: '5'
            title: { text: '体检结果异常人数分布', top: '5' },
            tooltip: { trigger: 'item' },
            legend: { top: '80%', left: 'center' },
            series: [{
              type: 'pie',
              radius: ['16%', '54%'],
              center: ['50%', '43%'],
              avoidLabelOverlap: false,
              startAngle: 180,
              minAngle: 10,
              data: this.PieChart2,
              emphasis: {
                itemStyle: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' }
              }
            }]
          });
            },
            tooltip: {
              trigger: 'item'
            },
            legend: {
              top: '80%',
              left: 'center'
            },
            series: [
              {
                // name: 'Access From',
                type: 'pie',
                radius: ['16%', '54%'],
                center: ["50%", "43%"],
                avoidLabelOveralap:false,
                startAngle:180,
                minAngle:10,
                data: this.PieChart2,
                emphasis: {
                  itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                  }
                }
              }]
          })
          window.onresize =  () =>{
          myChart2.resize()
          myChart3.resize()
          window.onresize = () => {
            myChart2.resize();
            myChart3.resize();
          };
        }
        }
        this.loading = false;
      });
    },
    // 数组分组方法
    chunkArray(array, size) {
      if (!array || array.length === 0) return [];
      const result = [];
      for (let i = 0; i < array.length; i += size) {
        result.push(array.slice(i, i + size));
      }
      // 确保循环滚动平滑,若不足 size 条,补齐
      if (array.length % size !== 0 && array.length > size) {
        const lastGroup = result[result.length - 1];
        while (lastGroup.length < size) {
          lastGroup.push(array[lastGroup.length % array.length]);
        }
      }
      return result;
    },
    parseTime(time, cFormat) {
      if (!time) return '';
      try {
        const date = new Date(time);
        if (isNaN(date.getTime())) return '';
        const formatObj = {
          y: date.getFullYear(),
          m: String(date.getMonth() + 1).padStart(2, '0'),
          d: String(date.getDate()).padStart(2, '0'),
          h: String(date.getHours()).padStart(2, '0'),
          i: String(date.getMinutes()).padStart(2, '0'),
          s: String(date.getSeconds()).padStart(2, '0')
        };
        return cFormat.replace(/{([ymdhis]+)}/g, (result, key) => formatObj[key] || '');
      } catch (error) {
        console.error('parseTime error:', error, 'time:', time);
        return '';
      }
    }
  },
  mounted() {
  }
}
};
</script>
<style>
.centre {
  min-height: 820px;
  margin: 15px 15px;
  margin: 15px;
  background-color: #f3f3f3;
  padding: 10px 10px 10px 10px;
  padding: 10px;
}
.notice-area {
  width: 100%;
  min-height: 120px;
  /* 调整为三条通知高度 */
  background-color: #fff;
  margin: 10px 0;
  padding: 0 20px;
}
.carousel {
  width: 100% !important;
}
.notice-group {
  display: flex;
  flex-direction: column;
  height: 120px;
  /* 确保包含三条通知 */
}
.notice-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  line-height: 40px;
  font-size: 14px;
  cursor: pointer;
}
.notice-title {
  margin-left: 10px;
  font-size: 14px;
  color: #333;
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notice-time {
  font-size: 12px;
  color: #999;
  margin-left: 20px;
}
.no-notice {
  width: 100%;
  height: 120px;
  /* 与轮播高度一致 */
  line-height: 120px;
  text-align: center;
  color: #999;
  font-size: 14px;
}
.top {
  width: 100%;
  display: flex;
  height: 120px;
}
.add {
  width: 380px;
  width: 320px;
  height: 75px;
  margin-top: 30px;
  margin-top: 20px;
  margin-left: 20px;
  margin-right: 20px;
  background-color: #fff;
  display: flex
  display: flex;
}
.img {
@@ -385,7 +412,6 @@
.image {
  width: 60px;
  height: 60px;
}
.txt {
@@ -401,7 +427,7 @@
.data-view {
  margin: 0 15px;
  height: 323px !important
  height: 323px !important;
}
#main {
@@ -409,19 +435,13 @@
}
.view {
  margin: 0px 15px;
  margin: 0 15px;
  padding-top: 15px;
  min-height: 350px;
  display: flex;
}
#main2 {
  width: 820px;
  height: 350px;
  background-color: #fff;
  margin-right: 20px;
}
#main2,
#main3 {
  width: 820px;
  height: 350px;
src/views/system/contract/index.vue
@@ -1,326 +1,147 @@
<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
      <el-form-item label="单位名称" v-show="showSearch"  prop="company">
        <el-select
          :remote-method="getRemoteData"
          v-model="queryParams.company"
          remote
          default-first-option
          allow-create
          filterable
          style="width: 200px"
          placeholder="请选择单位名称"
          clearable
          @change="idFn1"
        >
          <el-option
            v-for="dict in CompanyList"
            :key="dict.cnName"
            :label="dict.cnName"
            :value="dict.drugManufacturerId"
          />
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="单位名称" v-show="showSearch" prop="company">
        <el-select :remote-method="getRemoteData" v-model="queryParams.company" remote default-first-option allow-create
          filterable style="width: 200px" placeholder="请选择单位名称" clearable @change="idFn1">
          <el-option v-for="dict in CompanyList" :key="dict.cnName" :label="dict.cnName"
            :value="dict.drugManufacturerId" />
        </el-select>
        <i class="el-icon-circle-plus-outline" @click="handleAdd1"></i>
      </el-form-item>
      <el-form-item label="合同类型" prop="htlx">
        <el-select
          v-model="queryParams.htlx"
          placeholder="请选择合同类型"
          clearable
          style="width: 100%"
        >
          <el-option
            v-for="dict in dict.type.sys_type_contract"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        <el-select v-model="queryParams.htlx" placeholder="请选择合同类型" clearable style="width: 100%">
          <el-option v-for="dict in dict.type.sys_type_contract" :key="dict.value" :label="dict.label"
            :value="dict.value" />
        </el-select>
      </el-form-item>
      <el-form-item label="日期起始" prop="htrqqz">
        <el-date-picker
          v-model="queryParams.htrqqz"
          type="date"
          placeholder="选择起始日期"
        >
        <el-date-picker v-model="queryParams.htrqqz" type="date" placeholder="选择起始日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="日期终止" prop="htrqzz">
        <el-date-picker
          v-model="queryParams.htrqzz"
          type="date"
          placeholder="选择终止日期"
        >
        <el-date-picker v-model="queryParams.htrqzz" type="date" placeholder="选择终止日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <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-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"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:package:add']"
          >新增</el-button
        >
        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['system:package:add']">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUp"
          v-hasPermi="['system:package:edit']"
          >修改</el-button
        >
        <el-button type="primary" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUp"
          v-hasPermi="['system:package: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="['system:package:remove']"
          >删除</el-button
        >
        <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          v-hasPermi="['system:package:remove']">删除</el-button>
      </el-col>
    </el-row>
    <el-table
      border
      v-loading="loading"
      :data="dataList"
      @selection-change="handleSelectionChange"
    >
    <el-table border v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="序号" align="center" prop="newID" width="55" />
      <el-table-column label="合同类型" align="center" prop="htlx" width="90">
        <template slot-scope="scope">
          <dict-tag
            :options="dict.type.sys_type_contract"
            :value="scope.row.htlx"
          />
          <dict-tag :options="dict.type.sys_type_contract" :value="scope.row.htlx" />
        </template>
      </el-table-column>
      <el-table-column label="企业名称" align="center" prop="qymc" width="140">
      </el-table-column>
      <el-table-column label="合同金额" align="center" prop="htje" width="80" />
      <el-table-column
        label="负责人员"
        align="center"
        prop="htfzr"
        width="100"
        :show-overflow-tooltip="true"
      />
      <el-table-column label="负责人员" align="center" prop="htfzr" width="100" :show-overflow-tooltip="true" />
      <el-table-column
        label="日期起始"
        align="center"
        prop="htrqqz"
        width="100"
      >
      <el-table-column label="日期起始" align="center" prop="htrqqz" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.htrqqz, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="日期终止"
        align="center"
        prop="htrqzz"
        width="100"
      >
      <el-table-column label="日期终止" align="center" prop="htrqzz" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.htrqzz, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="客户姓名"
        align="center"
        prop="lxrxm"
        width="80"
      />
      <el-table-column label="联系电话" align="center" prop="lxrdh" width="120" />
      <el-table-column label="客户电话" align="center" prop="lxrdh" width="120">
      <el-table-column label="续签合同标志" align="center" prop="xqbz" width="140">
      </el-table-column>
      <el-table-column label="合同金额" align="center" prop="htje" width="80" />
      <el-table-column
        label="续签合同标志"
        align="center"
        prop="xqbz"
        width="140"
      >
      </el-table-column>
      <el-table-column
        label="原合同序号"
        align="center"
        prop="yhtxh"
        width="140"
      >
      </el-table-column>
      <el-table-column label="企业名称" align="center" prop="qymc" width="140">
      <el-table-column label="原合同序号" align="center" prop="yhtxh" width="140">
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="操作" align="center" width="140">
        <template slot-scope="scope">
          <el-button size="mini" type="text" @click="handleEdit(scope.row)"
            >编辑</el-button
          >
          <el-button size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
          <el-button size="mini" type="text" @click="handleDelete(scope.row)"
            >删除</el-button
          >
          <el-button size="mini" type="text" @click="handleDelete(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div class="pag">
      <div class="pag1">
        <pagination
          v-show="total > 0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />
        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize" @pagination="getList" />
      </div>
    </div>
    <!-- 添加或修改问题列表对话框 -->
    <el-dialog
      :title="title"
      :visible.sync="open"
      width="1000px"
      append-to-body
    >
      <el-form
        :model="form"
        ref="form"
        :rules="rules"
        label-width="80px"
        :inline="true"
      >
        <el-form-item label="单位名称" prop="cnName">
          <!-- <el-input v-model="form.cnName" placeholder="请输入中文名称" /> -->
          <el-select
            :remote-method="getRemoteData"
            v-model="form.cnName"
            remote
            default-first-option
            allow-create
            filterable
            style="width: 200px"
            placeholder="请选择单位名称"
            clearable
            @change="idFn1"
          >
            <el-option
              v-for="dict in CompanyList"
              :key="dict.cnName"
              :label="dict.cnName"
              :value="dict.drugManufacturerId"
            />
    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
      <el-form :model="form" ref="form" :rules="rules" label-width="80px" :inline="true">
        <!-- <el-form-item label="单位名称" prop="cnName">
          <el-select :remote-method="getRemoteData" v-model="form.cnName" remote default-first-option allow-create
            filterable style="width: 200px" placeholder="请选择单位名称" clearable @change="idFn1">
            <el-option v-for="dict in CompanyList" :key="dict.cnName" :label="dict.cnName"
              :value="dict.drugManufacturerId" />
          </el-select>
        </el-form-item>
        </el-form-item> -->
        <el-form-item label="合同类型" prop="htlx">
          <el-select
            v-model="form.htlx"
            filterable
            placeholder="请选择合同类型"
            style="width: 100%"
            clearable
          >
            <el-option
              v-for="dict in dict.type.sys_type_contract"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          <el-select v-model="form.htlx" filterable placeholder="请选择合同类型" style="width: 100%" clearable>
            <el-option v-for="dict in dict.type.sys_type_contract" :key="dict.value" :label="dict.label"
              :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item label="企业名称" prop="qymc">
          <el-input
            placeholder="请输入企业名称"
            v-model="form.qymc"
            clearable
          ></el-input>
          <el-input placeholder="请输入企业名称" v-model="form.qymc" clearable></el-input>
        </el-form-item>
        <el-form-item label="合同金额" prop="htje">
          <el-input
            placeholder="请输入合同金额"
            v-model="form.htje"
            clearable
          ></el-input>
          <el-input placeholder="请输入合同金额" v-model="form.htje" clearable></el-input>
        </el-form-item>
        <el-form-item label="负责人员" prop="htfzr">
          <el-input
            v-model="form.htfzr"
            placeholder="请输入负责人员"
            clearable
          />
          <el-input v-model="form.htfzr" placeholder="请输入负责人员" clearable />
        </el-form-item>
        <el-form-item label="起始日期" prop="htrqqz">
          <el-date-picker
            clearable
            v-model="form.htrqqz"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择合同起始日期"
          >
          <el-date-picker clearable v-model="form.htrqqz" type="date" value-format="yyyy-MM-dd" placeholder="请选择合同起始日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="终止日期" prop="htrqzz">
          <el-date-picker
            clearable
            v-model="form.htrqzz"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择合同终止日期"
          >
          <el-date-picker clearable v-model="form.htrqzz" type="date" value-format="yyyy-MM-dd" placeholder="请选择合同终止日期">
          </el-date-picker>
        </el-form-item>
@@ -333,35 +154,19 @@
        </el-form-item> -->
        <el-form-item label="联系电话" prop="lxrdh">
          <el-input
            placeholder="请输入联系电话"
            v-model="form.lxrdh"
            clearable
          ></el-input>
          <el-input placeholder="请输入联系电话" v-model="form.lxrdh" clearable></el-input>
        </el-form-item>
        <el-form-item label="公司座机" prop="gszj">
          <el-input
            placeholder="请输入公司座机"
            v-model="form.gszj"
            clearable
          ></el-input>
          <el-input placeholder="请输入公司座机" v-model="form.gszj" clearable></el-input>
        </el-form-item>
        <el-form-item label="签约人数" prop="qyrs">
          <el-input
            placeholder="请输入签约人数"
            v-model="form.qyrs"
            clearable
          ></el-input>
          <el-input placeholder="请输入签约人数" v-model="form.qyrs" clearable></el-input>
        </el-form-item>
        <el-form-item label="续签标志" prop="xqbz">
          <el-input
            placeholder="请输入续签合同标志"
            v-model="form.xqbz"
            clearable
          ></el-input>
          <el-input placeholder="请输入续签合同标志" v-model="form.xqbz" clearable></el-input>
          <!-- <el-select v-model="form.xqbz" placeholder="请选择续签合同标志" clearable style="width: 100%;">
@@ -373,36 +178,19 @@
        </el-form-item>
        <el-form-item label="原合同号" prop="yhtxh">
          <el-input
            placeholder="请输入原合同序号"
            v-model="form.yhtxh"
            clearable
          ></el-input>
          <el-input placeholder="请输入原合同序号" v-model="form.yhtxh" clearable></el-input>
        </el-form-item>
        <el-form-item label="开票名称" prop="kpmc">
          <el-input
            placeholder="请输入开票名称"
            v-model="form.kpmc"
            clearable
          ></el-input>
          <el-input placeholder="请输入开票名称" v-model="form.kpmc" clearable></el-input>
        </el-form-item>
        <el-form-item label="开票税号" prop="kpsh">
          <el-input
            placeholder="请输入开票税号"
            v-model="form.kpsh"
            clearable
          ></el-input>
          <el-input placeholder="请输入开票税号" v-model="form.kpsh" clearable></el-input>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input
            type="textarea"
            placeholder="请输入备注"
            v-model="form.remark"
            style="width: 220px"
          ></el-input>
          <el-input type="textarea" placeholder="请输入备注" v-model="form.remark" style="width: 220px"></el-input>
        </el-form-item>
      </el-form>
@@ -414,33 +202,13 @@
    </el-dialog>
    <!-- 添加单位对话框 -->
    <el-dialog
      :title="title"
      :visible.sync="open1"
      width="1000px"
      append-to-body
    >
      <el-form
        ref="form"
        :model="form"
        :rules="rules"
        label-width="98px"
        :inline="true"
        @submit.native.prevent
      >
    <el-dialog :title="title" :visible.sync="open1" width="1000px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="98px" :inline="true" @submit.native.prevent>
        <el-form-item label="单位名称" prop="cnName">
          <el-input
            v-model="form.cnName"
            placeholder="请输入中文名称"
            style="width: 510px"
          />
          <el-input v-model="form.cnName" placeholder="请输入中文名称" style="width: 510px" />
        </el-form-item>
        <el-form-item label="统一信用代码" prop="taxNumber">
          <el-input
            v-model="form.taxNumber"
            placeholder="请输入统一信用代码"
            style="width: 510px"
          />
          <el-input v-model="form.taxNumber" placeholder="请输入统一信用代码" style="width: 510px" />
        </el-form-item>
        <el-form-item label="法人代表" prop="legalPerson">
          <el-input v-model="form.legalPerson" placeholder="请输入法人" />
@@ -456,34 +224,18 @@
        </el-form-item>
        <el-form-item label="注册地址" prop="registerAddress">
          <el-input
            v-model="form.registerAddress"
            placeholder="请输入注册地址"
            style="width: 830px"
          />
          <el-input v-model="form.registerAddress" placeholder="请输入注册地址" style="width: 830px" />
        </el-form-item>
        <el-form-item label="通讯地址" prop="mailingAddress">
          <el-input
            v-model="form.mailingAddress"
            placeholder="请输入通讯地址"
            style="width: 830px"
          />
          <el-input v-model="form.mailingAddress" placeholder="请输入通讯地址" style="width: 830px" />
        </el-form-item>
        <br />
        <el-form-item label="开户银行" prop="bankAccount">
          <el-input
            v-model="form.bankAccount"
            placeholder="请输入开户银行"
            style="width: 510px"
          />
          <el-input v-model="form.bankAccount" placeholder="请输入开户银行" style="width: 510px" />
        </el-form-item>
        <el-form-item label="银行账户" prop="countNum">
          <el-input
            v-model="form.countNum"
            placeholder="请输入银行账户"
            style="width: 510px"
          />
          <el-input v-model="form.countNum" placeholder="请输入银行账户" style="width: 510px" />
        </el-form-item>
        <el-form-item label="联系邮箱" prop="email">
          <el-input v-model="form.email" placeholder="请输入邮箱" />
@@ -496,32 +248,14 @@
        </el-form-item>
        <el-form-item label="行政区划名称" prop="areaName">
          <el-select
            filterable
            v-model="form.areaName"
            placeholder="请选择行政区划名称"
            clearable
            style="width: 198px"
          >
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          <el-select filterable v-model="form.areaName" placeholder="请选择行政区划名称" clearable style="width: 198px">
            <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input
            v-model="form.remark"
            type="textarea"
            placeholder="请输入内容"
            :rows="2"
            label-width="400px"
            style="width: 830px"
            resize="none"
          ></el-input>
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" :rows="2" label-width="400px"
            style="width: 830px" resize="none"></el-input>
        </el-form-item>
      </el-form>
@@ -534,9 +268,9 @@
  </div>
</template>
  <script>
<script>
import { getList, addhtxxb, edithtxxb, delhtxxb } from "@/api/account/contract";
import {
  getZybCompList,
@@ -614,7 +348,7 @@
        reservationTime: "",
        yxts: "",
      },
      compName: "",
      // 查询参数
      queryParams: {
@@ -651,7 +385,7 @@
        contactPhone: [
          { required: true, validator: checkPhoneNum, trigger: "blur" },
        ],
      },
    };
  },
@@ -708,13 +442,13 @@
      }
    },
    idFn1(value) {
      if (value) {
        this.form.dictCompId = value;
        this.CompanyList.forEach((item) => {
          if (item.drugManufacturerId == this.form.dictCompId) {
            this.form.compName = item.cnName;
            this.compName = item.cnName;
            this.queryParams.company = item.cnName;
          }
        });
@@ -735,7 +469,7 @@
      this.reset();
      //   this.getList();
    },
    cancel1(){
    cancel1() {
      this.open1 = false;
    },
@@ -875,6 +609,7 @@
      this.open = true;
      this.title = "添加合同信息详情";
      this.form.qymc = this.compName
    },
    handleUp() {
@@ -947,7 +682,7 @@
};
</script>
  <style scoped>
<style scoped>
.pag {
  width: 100%;
@@ -959,6 +694,4 @@
.pag1 {
  width: 19%;
}
</style>
</style>
src/views/system/notice/index.vue
@@ -2,29 +2,15 @@
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="公告标题" prop="noticeTitle">
        <el-input
          v-model="queryParams.noticeTitle"
          placeholder="请输入公告标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
        <el-input v-model="queryParams.noticeTitle" placeholder="请输入公告标题" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="操作人员" prop="createBy">
        <el-input
          v-model="queryParams.createBy"
          placeholder="请输入操作人员"
          clearable
          @keyup.enter.native="handleQuery"
        />
        <el-input v-model="queryParams.createBy" placeholder="请输入操作人员" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="类型" prop="noticeType">
        <el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable>
          <el-option
            v-for="dict in dict.type.sys_notice_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
          <el-option v-for="dict in dict.type.sys_notice_type" :key="dict.value" :label="dict.label"
            :value="dict.value" />
        </el-select>
      </el-form-item>
      <el-form-item>
@@ -35,51 +21,48 @@
    <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="['system:notice:add']"
        >新增</el-button>
        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['system:notice: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="['system:notice:edit']"
        >修改</el-button>
        <el-button type="primary" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
          v-hasPermi="['system:notice: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="['system:notice:remove']"
        >删除</el-button>
        <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          v-hasPermi="['system:notice:remove']">删除</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
    <el-table
      v-loading="loading"
      :data="noticeList"
      @selection-change="handleSelectionChange"
      :row-class-name="tableRowClassName"
      ref="table"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="序号" align="center" prop="noticeId" width="100" />
      <el-table-column
        label="公告标题"
        align="center"
        prop="noticeTitle"
        :show-overflow-tooltip="true"
      />
      <el-table-column label="公告标题" align="center" prop="noticeTitle" :show-overflow-tooltip="true" />
      <el-table-column label="公告类型" align="center" prop="noticeType" width="100">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/>
          <dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType" />
        </template>
      </el-table-column>
      <el-table-column label="状态" align="center" prop="status" width="100">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_notice_status" :value="scope.row.status"/>
          <dict-tag :options="dict.type.sys_notice_status" :value="scope.row.status" />
        </template>
      </el-table-column>
      <el-table-column label="接收科室" align="center" prop="deptId" width="150">
        <template slot-scope="scope">
          <span>{{ getDeptNames(scope.row.deptId) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="接收用户" align="center" prop="userIds" width="200" :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <span>{{ getUserNames(scope.row.userIds) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="创建者" align="center" prop="createBy" width="100" />
@@ -90,37 +73,20 @@
      </el-table-column>
      <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="['system:notice:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:notice:remove']"
          >删除</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-share"
            @click="handledetails(scope.row)"
            v-hasPermi="['system:notice:remove']"
          >详情</el-button>
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
            v-hasPermi="['system:notice:edit']">修改</el-button>
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
            v-hasPermi="['system:notice:remove']">删除</el-button>
          <el-button size="mini" type="text" icon="el-icon-share" @click="handledetails(scope.row)"
            v-hasPermi="['system:notice:query']">详情</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div class="pag">
        <div class="pag1">
        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize" @pagination="getList"  />
        </div>
      </div>
    <div class="pagination-container">
      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize" @pagination="getList" />
    </div>
    <!-- 添加或修改公告对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="780px" append-to-body>
@@ -134,34 +100,37 @@
          <el-col :span="12">
            <el-form-item label="公告类型" prop="noticeType">
              <el-select v-model="form.noticeType" placeholder="请选择公告类型">
                <el-option
                  v-for="dict in dict.type.sys_notice_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
                <el-option v-for="dict in dict.type.sys_notice_type" :key="dict.value" :label="dict.label"
                  :value="dict.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="form.noticeType == 1">
            <el-form-item label="通知人员" prop="noticeType">
              <el-input v-model="form.noticeTitle" placeholder="请输入通知人员" />
          <el-col :span="12">
            <el-form-item label="接收科室" prop="deptId">
              <el-select v-model="form.deptId" filterable placeholder="请选择接收科室" @change="handleDeptChange">
                <el-option v-for="dept in deptList" :key="dept.id" :label="dept.label" :value="dept.id"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="接收用户" prop="userIds">
              <el-select v-model="form.userIds" multiple filterable placeholder="请选择接收用户">
                <el-option v-for="user in editUserList" :key="user.userId" :label="user.nickName || user.userName"
                  :value="user.userId"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="状态">
              <el-radio-group v-model="form.status">
                <el-radio
                  v-for="dict in dict.type.sys_notice_status"
                  :key="dict.value"
                  :label="dict.value"
                >{{dict.label}}</el-radio>
                <el-radio v-for="dict in dict.type.sys_notice_status" :key="dict.value"
                  :label="dict.value">{{ dict.label }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="内容">
              <editor v-model="form.noticeContent" :min-height="192"/>
              <editor v-model="form.noticeContent" :min-height="192" />
            </el-form-item>
          </el-col>
        </el-row>
@@ -172,46 +141,44 @@
      </div>
    </el-dialog>
     <!--通知公告详情 -->
    <!-- 通知公告详情 -->
    <el-dialog :title="formIn.noticeTitle" :visible.sync="openDetail" width="800px" append-to-body>
      <div style="margin-top:-20px;margin-bottom:10px;">
        <el-tag size="mini" effect="dark" type="warning" v-if="form.noticeType==2">公告</el-tag>
      <div class="detail-header">
        <el-tag size="mini" effect="dark" type="warning" v-if="formIn.noticeType === '2'">公告</el-tag>
        <el-tag size="mini" effect="dark" v-else>通知</el-tag>
        <span style="margin-left:20px;">{{formIn.createTime}}</span>
        <span class="time">{{ parseTime(formIn.createTime, '{y}-{m}-{d} {h}:{i}:{s}') || '无' }}</span>
      </div>
      <div class="content">
        <div v-html="formIn.noticeContent" style="margin-left:0px;margin-right:76px" class="ql-editor"></div>
      <div class="detail-item">
        <span class="label">接收科室:</span>
        <span>{{ getDeptNames(formIn.deptId) }}</span>
      </div>
      <div class="detail-item">
        <span class="label">接收用户:</span>
        <span>{{ getUserNames(formIn.userIds) }}</span>
      </div>
      <div class="detail-content">
        <div v-html="formIn.noticeContent" class="ql-editor"></div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="cancel"> 关 闭 </el-button>
        <el-button type="primary" @click="cancel">关闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
import { deptTreeSelect } from "@/api/system/dept";
import { listUser1 } from "@/api/system/user";
export default {
  name: "Notice",
  dicts: ['sys_notice_status', 'sys_notice_type'],
  dicts: ["sys_notice_status", "sys_notice_type"],
  data() {
    let checkPhoneNum = (rule, value, callback) => {
         console.log( value)
      let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/);
      if (value == "" && value == undefined && !value) {
        return callback('');
      }  else if(value != undefined && value != ""){
        return callback();
      }else if (!patter.test(value)) {
        return callback('');
      }
    };
    return {
      // 遮罩层
      loading: true,
      openDetail:false,
      openDetail: false,
      // 选中数组
      ids: [],
      // 非单个禁用
@@ -224,49 +191,190 @@
      total: 0,
      // 公告表格数据
      noticeList: [],
      // 科室列表
      deptList: [],
      // 用户列表(全局,用于表格和详情)
      userList: [],
      // 用户列表(用于编辑对话框)
      editUserList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 是否为初次加载
      isInitialLoad: true,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        noticeTitle: undefined,
        createBy: undefined,
        status: undefined
        noticeType: undefined,
      },
      formIn:{},
      formIn: {},
      // 表单参数
      form: {},
      form: {
        noticeId: undefined,
        noticeTitle: undefined,
        noticeType: undefined,
        noticeContent: undefined,
        status: "0",
        deptId: undefined,
        userIds: [],
      },
      // 表单校验
      rules: {
        noticeTitle: [
          { required: true, validator: checkPhoneNum,  trigger: "blur" }
        noticeTitle: [{ required: true, message: "公告标题不能为空", trigger: "blur" }],
        noticeType: [{ required: true, message: "公告类型不能为空", trigger: "change" }],
        deptId: [
          {
            required: false,
            message: "请选择接收科室",
            trigger: "change",
            validator: (rule, value, callback) => {
              callback(); // 非必填
            },
          },
        ],
        noticeType: [
          { required: true, validator: checkPhoneNum,  trigger: "change" }
        ]
      }
        userIds: [
          {
            required: false,
            message: "请选择接收用户",
            trigger: "change",
            validator: (rule, value, callback) => {
              callback(); // 非必填
            },
          },
        ],
      },
    };
  },
  created() {
    this.getList();
    // 获取科室列表
    deptTreeSelect()
      .then((response) => {
        this.deptList = response.data || [];
        this.deptList = this.flattenDeptList(this.deptList);
        console.log("Flattened deptList:", this.deptList);
      })
      .catch((error) => {
        this.$modal.msgError("获取科室列表失败:" + error.message);
      });
    // 预加载所有用户列表(用于表格和详情)
    listUser1({})
      .then((response) => {
        this.userList = (response.rows || response.data || []).map(user => ({
          ...user,
          userId: String(user.userId),
        }));
        this.editUserList = [...this.userList]; // 初始化编辑用户列表
        console.log("Preloaded userList:", this.userList);
      })
      .catch((error) => {
        this.$modal.msgError("获取用户列表失败:" + error.message);
      });
    // 处理跳转参数
    this.handleRouteParams();
  },
  methods: {
    /** 查询公告列表 */
    getList() {
      this.loading = true;
      listNotice(this.queryParams).then(response => {
      listNotice(this.queryParams).then((response) => {
        this.noticeList = response.rows;
        this.total = response.total;
        this.loading = false;
        // 高亮或打开详情(仅初次加载时触发详情)
        this.$nextTick(() => {
          this.highlightNotice(this.isInitialLoad);
          this.isInitialLoad = false; // 标记为非初次加载
        });
      }).catch((error) => {
        console.error("listNotice error:", error);
        this.$modal.msgError("获取公告列表失败:" + error.message);
        this.loading = false;
      });
    },
    /** 处理路由参数 */
    handleRouteParams() {
      const { noticeId } = this.$route.query;
      if (noticeId) {
        this.queryParams.noticeId = noticeId;
        this.getList();
      }
    },
    /** 高亮或打开公告详情 */
    highlightNotice(isInitialLoad) {
      const { noticeId } = this.$route.query;
      if (noticeId) {
        const notice = this.noticeList.find(item => item.noticeId === noticeId);
        if (notice) {
          this.$refs.table.setCurrentRow(notice);
          if (isInitialLoad) {
            this.handledetails(notice); // 仅初次加载时打开详情
          }
        }
      }
    },
    /** 表格行类名 */
    tableRowClassName({ row }) {
      const { noticeId } = this.$route.query;
      return noticeId && row.noticeId === noticeId ? 'highlight-row' : '';
    },
    /** 将科室ID转换为科室名称 */
    getDeptNames(deptId) {
      if (!deptId) return "无";
      const dept = this.deptList.find((dept) => dept.id === deptId);
      return dept ? dept.label : "未知科室";
    },
    /** 将用户ID转换为用户名 */
    getUserNames(userIds) {
      if (!userIds) return "无";
      const ids = typeof userIds === "string" ? userIds.split(",") : userIds;
      const names = this.userList
        .filter((user) => ids.includes(user.userId))
        .map((user) => user.nickName || user.userName)
        .join(", ");
      return names || ids.join(", ");
    },
    /** 展平部门树形结构 */
    flattenDeptList(depts, result = []) {
      depts.forEach((dept) => {
        result.push({ id: String(dept.id), label: dept.label });
        if (dept.children && dept.children.length) {
          this.flattenDeptList(dept.children, result);
        }
      });
      return result;
    },
    /** 科室选择变化时调用 */
    handleDeptChange(deptId) {
      if (deptId) {
        this.editUserList = [];
        return listUser1({ deptId })
          .then((response) => {
            this.editUserList = (response.rows || response.data || []).map(user => ({
              ...user,
              userId: String(user.userId),
            }));
            console.log("Fetched editUserList for deptId", deptId, ":", this.editUserList);
          })
          .catch((error) => {
            this.$modal.msgError("获取用户列表失败:" + error.message);
            this.editUserList = [...this.userList]; // 回退到全局用户列表
          });
      } else {
        console.log("No deptId, retained form.userIds:", this.form.userIds);
        this.editUserList = [...this.userList]; // 恢复为全局用户列表
        return Promise.resolve();
      }
    },
    // 取消按钮
    cancel() {
      console.log("Cancel triggered, resetting form and closing dialogs");
      this.open = false;
      this.openDetail = false,
      this.openDetail = false;
      this.reset();
    },
    // 表单重置
@@ -276,8 +384,11 @@
        noticeTitle: undefined,
        noticeType: undefined,
        noticeContent: undefined,
        status: "0"
        status: "0",
        deptId: undefined,
        userIds: [],
      };
      this.editUserList = [...this.userList]; // 重置为全局用户列表
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
@@ -292,46 +403,90 @@
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.noticeId)
      this.single = selection.length!=1
      this.multiple = !selection.length
      this.ids = selection.map((item) => item.noticeId);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      console.log("handleAdd triggered");
      this.reset();
      this.open = true;
      this.title = "添加公告";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      console.log("handleUpdate triggered for noticeId:", row.noticeId);
      this.reset();
      const noticeId = row.noticeId || this.ids
      getNotice(noticeId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改公告";
      });
      const noticeId = row.noticeId || this.ids;
      getNotice(noticeId)
        .then((response) => {
          console.log("getNotice response:", response.data);
          const data = response.data;
          this.form = {
            noticeId: data.noticeId,
            noticeTitle: data.noticeTitle,
            noticeType: data.noticeType,
            noticeContent: data.noticeContent,
            status: data.status,
            deptId: data.deptId ? String(data.deptId) : undefined,
            userIds: data.userIds ? (typeof data.userIds === 'string' ? data.userIds.split(',') : data.userIds) : [],
          };
          if (this.form.deptId) {
            return this.handleDeptChange(this.form.deptId).then(() => {
              this.open = true;
              this.title = "修改公告";
              console.log("Modification dialog opened, form:", this.form, "editUserList:", this.editUserList);
            });
          } else {
            this.editUserList = [...this.userList];
            console.log("No deptId, retained form.userIds:", this.form.userIds, "editUserList:", this.editUserList);
            this.open = true;
            this.title = "修改公告";
            console.log("Modification dialog opened, form:", this.form);
            return Promise.resolve();
          }
        })
        .catch((error) => {
          console.error("getNotice error:", error);
          this.$modal.msgError("获取公告详情失败:" + error.message);
        });
    },
    handledetails(row){
    /** 详情按钮操作 */
    handledetails(row) {
      console.log("handledetails triggered for noticeId:", row.noticeId);
      this.formIn = row;
      this.openDetail = true;
      console.log("Detail dialog opened, formIn:", this.formIn);
    },
    /** 提交按钮 */
    submitForm: function() {
      this.$refs["form"].validate(valid => {
    submitForm() {
      console.log("submitForm triggered, form:", this.form);
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.noticeId != undefined) {
            updateNotice(this.form).then(response => {
          const formData = {
            ...this.form,
            deptId: this.form.deptId ? String(this.form.deptId) : "",
            userIds: this.form.userIds || [],
          };
          console.log("Submitting formData:", formData);
          if (formData.noticeId != undefined) {
            updateNotice(formData).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            }).catch((error) => {
              console.error("updateNotice error:", error);
              this.$modal.msgError("修改失败:" + error.message);
            });
          } else {
            addNotice(this.form).then(response => {
            addNotice(formData).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            }).catch((error) => {
              console.error("addNotice error:", error);
              this.$modal.msgError("新增失败:" + error.message);
            });
          }
        }
@@ -339,24 +494,102 @@
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const noticeIds = row.noticeId || this.ids
      this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function() {
        return delNotice(noticeIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
      console.log("handleDelete triggered for noticeId:", row.noticeId);
      const noticeIds = row.noticeId || this.ids;
      this.$modal
        .confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?')
        .then(() => delNotice(noticeIds))
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** 时间格式化 */
    parseTime(time, cFormat = '{y}-{m}-{d} {h}:{i}:{s}') {
      if (!time) return '';
      try {
        const date = new Date(time);
        if (isNaN(date.getTime())) return '';
        const formatObj = {
          y: date.getFullYear(),
          m: String(date.getMonth() + 1).padStart(2, '0'),
          d: String(date.getDate()).padStart(2, '0'),
          h: String(date.getHours()).padStart(2, '0'),
          i: String(date.getMinutes()).padStart(2, '0'),
          s: String(date.getSeconds()).padStart(2, '0')
        };
        return cFormat.replace(/{([ymdhis]+)}/g, (result, key) => formatObj[key] || '');
      } catch (error) {
        console.error('parseTime error:', error, 'time:', time);
        return '';
      }
    }
  }
  },
};
</script>
<style scoped>
.pag {
  width: 100%;
/* 容器样式,确保内容有适当内边距 */
.app-container {
  padding: 20px;
}
/* 分页容器,替换原 .pag 和 .pag1,居中显示 */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
.pag1{
  width: 30%;
/* 高亮行样式,突出显示路由指定的公告 */
.highlight-row {
  background-color: #e6f7ff;
}
</style>
/* 对话框底部按钮居中 */
.dialog-footer {
  text-align: center;
  padding: 10px 0;
}
/* 详情对话框头部(类型标签和时间) */
.detail-header {
  margin: -20px 0 10px;
  display: flex;
  align-items: center;
}
.detail-header .time {
  margin-left: 20px;
  color: #606266;
}
/* 详情对话框信息项(接收科室、接收用户) */
.detail-item {
  margin-bottom: 10px;
}
.detail-item .label {
  font-weight: bold;
  color: #303133;
}
/* 详情对话框内容区域,限制富文本高度 */
.detail-content .ql-editor {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  color: #303133;
}
/* 表格操作列,优化按钮间距 */
.small-padding {
  padding: 0 10px;
}
/* 搜索表单顶部间距 */
.mb8 {
  margin-bottom: 8px;
}
</style>
vue.config.js
@@ -54,14 +54,13 @@
      [process.env.VUE_APP_BASE_API]: {
        // target: `https://ltpeis.xaltjdkj.cn:5801/`,
        // target: `http://192.168.1.99:5012`,
<<<<<<< HEAD
=======
        // target: `http://192.168.1.2:5011`,
>>>>>>> 37c5fa644553d6e24c729b62408e631a8c50e379
        target: `http://192.168.1.113:5011`,
        // // target: `http://192.168.0.99:8080/ltkj-admin`,
        // target: `https://ltpeis.xaltjdkj.cn:5011/ltkj-admin`,
        // target: `http://10.168.0.9:5011`,
        // target: `http://10.168.0.9:5011`,  `
        changeOrigin: true,
        pathRewrite: {
          ["^" + process.env.VUE_APP_BASE_API]: "",