qx
2025-04-03 57318307b301d2b0d63f8a91fe6a03fa4982a972
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
<template>
  <div>
    <el-dialog
      :title="title"
      :visible.sync="open"
      width="1200px"
      append-to-body
    >
      <!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
                <el-form-item label="名称" prop="pacName">
                    <el-input v-model="queryParams.pacName" placeholder="请输入名称" clearable
                        @keyup.enter.native="handleQuery" style="width: 130px;" />
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
                </el-form-item>
            </el-form> -->
 
      <el-form inline @submit.native.prevent="search">
        <el-form-item>
          <el-radio-group v-model="tjproposal" @input="radiotjproposalChange">
            <el-radio-button label="0">快捷建议</el-radio-button>
            <el-radio-button label="1">常用建议</el-radio-button>
          </el-radio-group>
        </el-form-item>
        <el-form-item v-show="tjproposal == 0">
          <el-input
            v-model="searchAdv"
            style="width: 180px"
            placeholder="请输入搜索内容"
            clearable
            @clear="search"
          ></el-input>
        </el-form-item>
        <el-button type="primary" @click="search" v-show="tjproposal == 0"
          >搜索</el-button
        >
      </el-form>
 
      <el-table
        v-if="tjproposal == '0'"
        :data="advicerulesList"
        ref="elTable"
        v-loading="loading"
        @selection-change="handleSelectionChange"
        border
        height="500px"
      >
        <el-table-column type="selection" width="40" align="center" />
        <el-table-column label="科室" width="70" align="center" prop="ks" />
        <el-table-column
          label="建议名称"
          width="120"
          align="center"
          prop="jymc"
        />
        <el-table-column label="建议内容" align="left" prop="jynr" />
      </el-table>
      <div class="pag" v-if="tjproposal == '0'">
        <div class="pag1">
          <pagination
            v-show="total > 0"
            :total="total1"
            :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize"
            @pagination="radiotjproposalChange"
          />
        </div>
      </div>
 
      <el-table
        v-if="tjproposal == '1'"
        :data="dataList"
        ref="elTable"
        v-loading="loading"
        @selection-change="handleSelectionChange"
        border
        height="500px"
      >
        <el-table-column type="selection" width="40" align="center" />
        <el-table-column label="编码" width="70" align="center" prop="id" />
        <el-table-column label="标题" width="120" align="center" prop="title" />
        <el-table-column label="建议内容" align="left" prop="advice" />
        <!-- <el-table-column
          label="创建人"
          align="center"
          prop="createBy"
          width="110px"
        />
        <el-table-column
          label="创建时间"
          width="160px"
          align="center"
          prop="createTime"
        /> -->
      </el-table>
      <div class="pag"  v-if="tjproposal == '1'">
        <div class="pag1">
          <pagination
            v-show="total > 0"
            :total="total"
            :page.sync="queryParams.page"
            :limit.sync="queryParams.pageSize"
            @pagination="radiotjproposalChange"
          />
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="open = false">取 消</el-button>
        <el-button type="primary" @click="handleOk">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
  
<script>
import {
  getKjTjAdviceKjbqBySex,
  getCyTjAdviceKjbqBySex,
} from "@/api/hosp/project";
import { listAdvicerules } from "@/api/hosp/advicerules";
import { getInfo } from "@/api/login";
export default {
  name: "Packagese",
  props: {
    cusobj: Object,
  },
  data() {
    return {
      tjproposal: "0",
      open: false,
      openone: false,
      // 弹出层标题
      title: "",
      total: 0,
      total1:0,
      dataList: [],
      advicerulesList: [],
 
      // 遮罩层
      loading: false,
      searchAdv: "",
      queryParams: {
        sex: "",
        isZj: "",
        userId: "",
        page: 1,
        pageSize: 10,
        jynr: "",
        jybt: "",
      },
      queryParams1: {
        pageNum: 1,
        pageSize: 10,
      },
      list: [],
      fList: {},
    };
  },
  watch: {
    cusobj(val, newVla) {
      console.log(val, newVla, 1111);
      this.fList = val;
      this.queryParams.sex = val.sex;
      this.queryParams.isZj = val.isZj;
      this.tjproposal = "0";
      this.getList();
    },
  },
  mounted() {
    // this.getList()
  },
 
  created() {
    // if( this.queryParams){
    //     this.getList()
    // }
  },
  methods: {
    getAllList() {
      this.loading = true;
      this.openone = true;
      getTjHyBgList(this.queryParams).then((res) => {
        this.dataList = res.data.records;
        this.loading = false;
      });
    },
    getList() {
      this.loading = true;
      /* getKjTjAdviceKjbqBySex(this.queryParams).then((res) => {
        this.dataList = res.data.records;
        this.total = res.data.total;
        this.loading = false;
      }); */
      listAdvicerules(this.queryParams1)
        .then((response) => {
          this.advicerulesList = response.rows;
          this.total1 = response.total;
          this.loading = false;
        })
        .catch((error) => {
          console.error("筛选快捷建议失败:", error);
          this.$message.error("筛选快捷建议失败");
        });
    },
    handleQuery() {
      this.getAllList();
    },
    handleSelectionChange(selection) {
      //   if (selection.length > 1) {
      //     this.$refs.elTable.clearSelection(); // 清空所有选择
      //     this.$refs.elTable.toggleRowSelection(selection.pop()); // 设置选择项
      //   }
      this.list = selection;
      console.log(this.list);
    },
    search() {
      this.queryParams.jybt = this.searchAdv;
      this.queryParams.page = 1;
      this.loading = true;
      getKjTjAdviceKjbqBySex(this.queryParams).then((res) => {
        this.dataList = res.data.records;
        this.total = res.data.total;
        this.loading = false;
      });
    },
    radiotjproposalChange() {
      if (this.tjproposal == "0") {
        this.searchAdv = "";
        this.queryParams.isZj = this.fList.isZj;
        this.queryParams.userId = null;
        this.getList();
      } else {
        this.loading = true;
        getInfo().then((res) => {
          this.queryParams.userId = res.user.userId;
          this.queryParams.isZj = null;
          getCyTjAdviceKjbqBySex(this.queryParams).then((res) => {
            if (res.data) {
              this.dataList = res.data.records;
              this.total = res.data.total;
            } else {
              this.dataList = [];
              this.total = 0;
              this.$modal.msgError(res.msg);
            }
            this.loading = false;
          });
        });
      }
    },
    handleOk() {
      this.open = false;
      if (this.list.length != 0) {
        this.$emit("event1", this.list);
      }
    },
  },
};
</script>
  
<style scoped>
.pag {
  width: 100%;
  display: flex;
  justify-content: center;
}
 
.pag1 {
  width: 30%;
}
::v-deep .el-dialog__body {
  padding: 7px 20px;
}
</style>