yxh
2023-03-04 464c604829aee38a5acedcbd0b9d3d85eacc874d
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
 
 <div>
 <li_area_select v-model="defultAddress"></li_area_select>
  <div>{{defultAddress}}</div>
</div>
 
      <el-form-item label="姓名" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="证件号码" prop="idcardno">
        <el-input
          v-model="queryParams.idcardno"
          placeholder="请输入证件号码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="省(区/市)" prop="residenceprovince">
        <el-select
          v-model="queryParams.residenceprovince"
          placeholder="请选择省(区/市)"
          clearable
          size="small"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="记录状态" prop="recordstate">
        <el-select
          v-model="queryParams.recordstate"
          placeholder="请选择记录状态"
          clearable
          size="small"
        >
          <el-option
            v-for="dict in dict.type.sys_DonationStatus"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="所在医疗机构" prop="treatmenthospitalname">
        <el-input
          v-model="queryParams.treatmenthospitalname"
          placeholder="请输入所在医疗机构"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="捐献者编号" prop="donorno">
        <el-input
          v-model="queryParams.donorno"
          placeholder="请输入捐献者编号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="报告人姓名" prop="reportername">
        <el-input
          v-model="queryParams.reportername"
          placeholder="请输入报告人姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="报告时间">
        <el-date-picker
          v-model="daterangeReporttime"
          size="small"
          style="width: 240px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-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 icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
      </el-form-item>
    </el-form>
    <el-table
      v-loading="loading"
      :data="donatebaseinfoList"
    >
      <el-table-column label="报告时间" align="center" prop="id" />
      <el-table-column label="姓名" align="center" prop="name" />
      <el-table-column
        label="省(区/市)"
        align="center"
        prop="residenceprovince"
      />
      <el-table-column label="记录状态" align="center" prop="recordstate" />
      <el-table-column
        label="所在医疗机构"
        align="center"
        prop="treatmenthospitalname"
      />
      <el-table-column label="报告人" align="center" prop="reportername" />
      <el-table-column
        label="报告时间"
        align="center"
        prop="reporttime"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.reporttime, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
        width="220"
      >
        <template slot-scope="scope">
          <el-button v-if="scope.row.recordstate == 1"
            size="mini"
            type="text"
            icon="el-icon-coordinate"
            @click="showDonationEvaluationDialog(scope.row)"
            >捐献评估
            </el-button>
          <el-button v-else-if="scope.row.recordstate == 2 || scope.row.recordstate == 3"
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="getDonationEvaluation(scope.row)"
            >评估编辑
            </el-button>
            <el-button v-else
            size="mini"
            type="warning"
            >无法评估
            </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" :fullscreen="true" width="800px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="160px">
        <el-form-item label="捐献者编号" prop="donorno">
          <el-input v-model="form.donorno" placeholder="请输入捐献者编号" :disabled="true" />
        </el-form-item>
        <el-form-item label="流程名称" prop="flowname">
          <el-input v-model="form.flowname" placeholder="请输入流程名称" :disabled="true" />
        </el-form-item>
        <el-form-item label="流程附件">
          <fileUpload :on-preview="handlePreview" v-model="form.flowannex"/>
        </el-form-item>
        <el-form-item label="流程内容">
           <el-input v-model="form.flowcontent" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="是否符合捐献评估条件">
          <el-radio-group v-model="form.flowconclusion">
            <el-radio
              v-for="dict in dict.type.sys_0_1"
              :key="dict.value"
              :label="parseInt(dict.value)"
            >{{dict.label}}</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 {
  listDonatebaseinfo,
  getDonatebaseinfo,
  
} from "@/api/project/donatebaseinfo";
import { 
    addDonateflowchart,
    listDonateflowchart,
    updateDonateflowchart
  } from "@/api/project/DonationEvaluation";
import Li_area_select from '@/components/Address'
export default {
    components: {
    Li_area_select
  },
  name: "DonateEvaluation",
  dicts: [
    "sys_user_sex",
    "sys_IDType",
    "sys_AgeUnit",
    "sys_BloodType",
    "sys_0_1",
    "sys_patientstate",
    "sys_DonationCategory",
    "sys_Kinship",
    "sys_Infectious",
    "sys_InfoSources",
    "sys_OtherCases",
    "sys_DonationStatus",
    "sys_DiseaseType",
    "sys_SelfWill",
    "sys_FamilyRelation",
  ],
  data() {
    return {
      //省市区
      //默认值设置,可为空
      defultAddress:{
        sheng: '浙江省',
        shi: '',
        qu: '',
      },
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 捐献基础表格数据
      donatebaseinfoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 获取组织名称时间范围
      daterangeReporttime: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        name: null,
        idcardno: null,
        residenceprovince: null,
        recordstate: null,
        treatmenthospitalname: null,
        donorno: null,
        reportername: null,
        reporttime: null,
      },
      // 表单参数
      form: {
        id: null,
        infoid: null,
        donorno: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        flowname: null,
        flowannex: null,
        flowcontent: null,
        flowconclusion: 0
      },
      // 表单校验
      rules: {},
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询捐献基础列表 */
    getList() {
      this.loading = true;
      this.queryParams.params = {};
      if (null != this.daterangeReporttime && "" != this.daterangeReporttime) {
        this.queryParams.params["beginReporttime"] =
          this.daterangeReporttime[0];
        this.queryParams.params["endReporttime"] = this.daterangeReporttime[1];
      }
      listDonatebaseinfo(this.queryParams).then((response) => {
        this.donatebaseinfoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        infoid: null,
        donorno: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        flowname: null,
        flowannex: null,
        flowcontent: null,
        flowconclusion: 0
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.daterangeReporttime = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids;
      getDonatebaseinfo(id).then((response) => {
        this.form = response.data;
        this.form.diseasetype = this.form.diseasetype.split(",");
        this.form.infectious = this.form.infectious.split(",");
        this.form.othercases = this.form.othercases.split(",");
        this.form.kinship = this.form.kinship.split(",");
        this.form.infosources = this.form.infosources.split(",");
        this.form.patientstate = this.form.patientstate.split(",");
        this.open = true;
        this.title = "修改捐献基础";
      });
    },
    /** 医学捐献评估弹窗 */
    showDonationEvaluationDialog(dontateInfo){
        //console.log(dontateInfo);
        this.reset();
        this.open = true;
        this.form.donorno = dontateInfo.donorno;
        this.form.infoid = dontateInfo.id;
        this.form.flowname = "医学捐献评估";
        this.title = "医学捐献评估新增";
    },
    /** 保存捐献评估 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateDonateflowchart(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addDonateflowchart(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 获取捐献评估 */
    getDonationEvaluation(dontateInfo){
        //this.loading = true;
        let queryParam = {
            donorno:dontateInfo.id,
            flowname:"医学捐献评估"
        };
        console.log(queryParam);
        listDonateflowchart(queryParam).then(response => {
        console.log('获取医学评估',response);
        let evaluationList = response.rows;
        if(evaluationList.length == 1){
            this.form = evaluationList[0];
            this.open = true;
            this.title = "修改医学捐献评估";
        }
        else if(evaluationList.length == 0){
            this.$modal.msgError("数据不存在");
        }
        else{
            this.$modal.msgError("数据重复");
        }
      });
    },
    /** 判断新增或是编辑 */
    checkEditOrAdd(dontateInfo){
        if(dontateInfo.recordstate == 1){
            return true;
        }
        else{
            return false
        }
    },
    handlePreview(file) {
        console.log(file);
      }
  },
};
</script>