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
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
      <el-row :gutter="8">
        <el-col :span="6">
          <el-form-item label="姓名" prop="name">
            <el-input v-model="queryParams.name" placeholder="请输入姓名" clearable size="small"
              @keyup.enter.native="handleQuery" />
          </el-form-item>
        </el-col>
 
        <el-col :span="6">
          <el-form-item align="left" label="医疗机构" prop="treatmenthospitalno">
            <org-selecter ref="orgSelecter" :org-type="'3'" v-model="queryParams.treatmenthospitalno" />
          </el-form-item>
        </el-col>
 
        <el-col :span="6">
          <el-form-item label="捐献地市">
            <el-select v-model="queryParams.city" placeholder="请选择地市">
              <el-option v-for="item in provinceData" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
 
        <el-col :span="6">
          <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-col>
      </el-row>
      <el-row :gutter="8">
        <el-col :span="6">
          <el-form-item label="报告人">
            <el-select v-model="queryParams.reporterno" placeholder="请选择报告人">
              <el-option v-for="item in reportlist" :key="item.index" :label="item.reportername" :value="item.reporterno">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
 
        <el-col :span="12">
          <el-form-item label="报告日期">
            <el-date-picker style="width: 100%" v-model="selecttime" type="monthrange" range-separator="至"
              start-placeholder="开始月份" end-placeholder="结束月份" value-format="yyyy-MM-dd" @change="getTimeList">
            </el-date-picker>
          </el-form-item>
        </el-col>
 
        <el-col :span="6">
          <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-col>
      </el-row>
    </el-form>
 
    <el-table :default-sort="{ prop: 'createTime' }" v-loading="loading" :data="listnews" border>
      <el-table-column label="报告时间" align="center" prop="reporttime" width="140">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.reporttime, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
 
      <el-table-column label="姓名" align="center" prop="name" width="120" />
 
      <el-table-column label="年龄" align="center" prop="age" width="100" />
      <el-table-column label="性别" align="center" prop="sex" width="100">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_user_sex" :value="parseInt(scope.row.sex)" />
        </template>
      </el-table-column>
      <el-table-column label="年龄" align="center" prop="age" width="100" />
      <el-table-column label="医疗机构" align="center" prop="treatmenthospitalname" />
      <el-table-column label="审查结论" align="center" prop="flowconclusion" width="100">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_EthicalReview" :value="scope.row.flowconclusion" />
        </template>
      </el-table-column>
      <el-table-column label="审查时间" align="center" prop="createTime" width="160" />
      <!-- <el-table-column label="身份证号" prop="idcardno" width="200" /> -->
      <el-table-column label="报告人" align="center" prop="reportername" width="100" />
 
      <el-table-column label="捐献进度" align="center" prop="recordstate">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_DonationStatus" :value="scope.row.recordstate" />
        </template>
      </el-table-column>
 
      <el-table-column label="操作" align="center" width="150px" class-name="small-padding fixed-width" fixed="right">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-coordinate"
            @click="showDonationEvaluationDialog(scope.row)">伦理审查
          </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" :close-on-click-modal="false" width="1000px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="160px">
        <el-row>
          <el-col :span="12">
            <el-form-item align="left" label="捐献编号">
              <el-input v-model="curCase.donorno" placeholder="请输入捐献编号" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="姓名">
              <el-input v-model="curCase.name" placeholder="请输入姓名" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col> </el-col>
        </el-row>
 
        <el-form-item label="审查意见">
          <el-input v-model="form.flowcontent" type="textarea" placeholder="请输入内容" />
        </el-form-item>
 
        <el-row>
          <el-col :span="18">
            <el-form-item label="审查结论">
              <el-radio-group v-model="form.flowconclusion">
                <el-radio v-for="dict in dict.type.sys_EthicalReview" :key="dict.value" :label="parseInt(dict.value)">{{
                  dict.label }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
 
          <!-- createtime   审查日期 -->
          <el-col :span="6" :pull="5">
            <el-form-item label="审查日期">
              <el-date-picker clearable size="small" v-model="form.createTime" type="date"
                value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择结论时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- <el-form-item label="专家意见">
          <el-row style="margin-bottom: 10px">
            <el-button
              style="margin-left: 10px"
              type="primary"
              icon="el-icon-plus"
              size="mini"
              @click="showExpertAdviceDialog"
              >新增专家意见</el-button
            >
          </el-row>
          <el-row>
            <el-table v-loading="loading" :data="doctorAdviceTableData" border>
              <el-table-column
                label="专家姓名"
                width="100"
                align="center"
                prop="expertname"
              />
              <el-table-column
                label="专家意见"
                width="300"
                align="center"
                prop="expertopinion"
              />
              <el-table-column
                label="专家结论"
                width="100"
                align="center"
                prop="expertconclusion"
              >
                <template slot-scope="scope">
                  <dict-tag
                    :options="dict.type.sys_0_1"
                    :value="scope.row.expertconclusion"
                  />
                </template>
              </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="handleUpdateExpert(scope.row)"
                    v-hasPermi="['project:ethicalreviewopinions:edit']"
                    >修改</el-button
                  >
                  <el-button
                    size="mini"
                    type="text"
                    icon="el-icon-delete"
                    @click="handleDeleteExpert(scope.row)"
                    v-hasPermi="['project:ethicalreviewopinions:remove']"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
          </el-row>
        </el-form-item> -->
        <el-form-item label="捐献资料附件">
          <annex-upload ref="ethicalannex" :infoid="curCase.id" :donorno="curCase.donorno" :flowname="flowname"
            :annexno="annexno" />
        </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>
 
    <!-- 添加或修改伦理审查专家意见对话框 -->
    <el-dialog :title="title" :visible.sync="isShowExpertAdviceDialog" width="800px" append-to-body>
      <el-form ref="expertAdviceForm" :model="expertAdviceForm" :rules="expertAdviceRules" label-width="80px">
        <el-form-item label="专家名字" prop="expertname">
          <el-input v-model="expertAdviceForm.expertname" placeholder="请输入专家名字" />
        </el-form-item>
        <el-form-item label="专家意见" prop="expertopinion">
          <el-input v-model="expertAdviceForm.expertopinion" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="专家结论 ">
          <el-radio-group v-model="expertAdviceForm.expertconclusion">
            <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="saveExpertAdvice">确 定</el-button>
        <!-- <el-button @click="cancel">取 消</el-button> -->
      </div>
    </el-dialog>
  </div>
</template>
 
<script>
import {
  listDonatebaseinfo,
  getDonatebaseinfo,
  updateDonatebaseinfo,
} from "@/api/project/donatebaseinfo";
import {
  addDonateflowchart,
  listDonateflowchart,
  updateDonateflowchart,
} from "@/api/project/DonationEvaluation";
import {
  listEthicalreviewopinions,
  getEthicalreviewopinions,
  delEthicalreviewopinions,
  addEthicalreviewopinions,
  updateEthicalreviewopinions,
  listnewEthicalreviewopinions,
} from "@/api/project/ethicalreviewopinions";
import Li_area_select from "@/components/Address";
import OrgSelecter from "@/views/project/components/orgselect";
import AnnexUpload from "@/views/project/components/annexupload";
import { listUser } from "@/api/project/organization";
export default {
  components: {
    Li_area_select,
    OrgSelecter,
    AnnexUpload,
  },
  name: "EthicalReview",
  dicts: [
    "sys_EthicalReview",
    "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",
    "sys_OrganizationType",
    "sys_EthicalReview",
  ],
  data() {
    return {
      starttime: "",
      endtime: "",
 
      selecttime: "",
      reportervalue: "",
      reportlist: [],
      provinceData: [
        { label: "全部", value: "" },
        { label: "杭州市", value: "1" },
        { label: "宁波市", value: "2" },
        { label: "温州市", value: "3" },
        { label: "嘉兴市", value: "4" },
        { label: "湖州市", value: "5" },
        { label: "绍兴市", value: "6" },
        { label: "金华市", value: "7" },
        { label: "衢州市", value: "8" },
        { label: "舟山市", value: "9" },
        { label: "台州市", value: "A" },
        { label: "丽水市", value: "B" },
      ],
 
      //省市区
      //默认值设置,可为空
      defultAddress: {
        sheng: "浙江省",
        shi: "",
        qu: "",
      },
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 捐献基础表格数据
      donatebaseinfoList: [],
      listnews: [],
      //用户表
      users: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 获取组织名称时间范围
      daterangeReporttime: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        donorno: null,
        recordstate: "7",
        name: null,
        idcardno: null,
        residenceprovince: null,
        residencecity: null,
        residencetown: null,
        treatmenthospitalname: null,
        treatmenthospitalno: null,
        organizationname: null,
        organizationtype: null,
        reportername: null,
        reporttime: null,
        city: null,
      },
      //查询参数-专家意见
      expertAdviceQueryParam: {
        pageNum: 1,
        pageSize: 10,
        infoid: null,
        donorno: null,
        // expertopinion: null,
        // expertconclusion: null,
        // expertname: null,
        // conclusiontime: null,
        // conclusionannex: null,
        // conclusionorder: null
      },
      //省市区
      //默认值设置,可为空
      searchAddress: {
        sheng: "",
        shi: "",
        qu: "",
        organizationname: 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,
        conclusiontime: null,
      },
      // 表单校验
      rules: {},
      //当前选中捐献案例
      curCase: {},
      flowname: "伦理审查",
      annexno: "EthicsReviewAnnex",
      //专家意见列表
      doctorAdviceTableData: [],
      //是否显示专家意见输入弹窗
      isShowExpertAdviceDialog: false,
      //专家意见弹窗表单
      expertAdviceForm: {},
      // 表单校验
      expertAdviceRules: {
        expertopinion: [
          { required: true, message: "专家意见不能为空", trigger: "blur" },
        ],
        expertconclusion: [
          { required: true, message: "专家结论不能为空", trigger: "blur" },
        ],
        expertname: [
          { required: true, message: "专家名字不能为空", trigger: "blur" },
        ],
        conclusiontime: [
          { required: true, message: "结论时间不能为空", trigger: "blur" },
        ],
      },
    };
  },
  created() {
    this.getuserlist();
    this.getList();
  },
  activated() {
    this.selecttime = "";
    this.reportervalue = "";
    this.reportlist = [];
    this.queryParams.donorno = "";
    this.queryParams.recordstate = "";
    this.queryParams.name = "";
    this.queryParams.treatmenthospitalno = "";
 
    if (this.$route.params.starttime != null && this.$route.params.endtime) {
      this.selecttime = [
        this.$route.params.starttime,
        this.$route.params.endtime,
      ];
    }
    if (this.$route.params.reporterno != "") {
      this.reporterno = this.$route.params.reporterno;
    }
    if (this.$route.params.tempRecordState != "") {
      this.queryParams.recordstate = this.$route.params.tempRecordState;
    }
    if (this.$route.params.reporterno != "") {
      this.reportervalue = this.$route.params.reporterno;
    }
    if (!this.$route.params.shen != "") {
      this.searchAddress.sheng = this.$route.params.shen;
      if (!this.$route.params.shi != "") {
        this.searchAddress.shi = this.$route.params.shi;
      }
      if (!this.$route.params.qu) {
        this.searchAddress.qu = this.$route.params.qu;
      }
    }
    if (this.$route.params.city != "") {
      this.queryParams.city = this.$route.params.city;
    }
 
    this.getList();
  },
  mounted() {
    this.LoadReportList();
  },
  methods: {
    LoadReportList() {
      listDonatebaseinfo().then((res) => {
        console.log("潜在捐献表", res);
        let list = res.rows;
        let reportlist = [];
        list.forEach((element) => {
          reportlist.push({
            reporterno: element.reporterno,
            reportername: element.reportername,
          });
        });
        console.log("dwada", reportlist);
        if (reportlist != 0) {
          reportlist = this.resetArr(reportlist);
          this.reportlist = reportlist;
        }
      });
    },
    resetArr(Arr) {
      var hash = {};
      Arr = Arr.reduce(function (arr, current) {
        hash[current.reporterno]
          ? ""
          : (hash[current.reporterno] = true && arr.push(current));
        return arr;
      }, []);
      return Arr;
    },
    getTimeList(e) {
      if (this.selecttime != 0) {
        this.endtime = this.selecttime[1];
        this.starttime = this.selecttime[0];
        // if (this.endtime == this.starttime) {
        let num = Number(this.endtime.slice(5, 7));
        if (num < 9) {
          let mon = Number(this.endtime.slice(6, 7));
          this.endtime =
            this.endtime.slice(0, 5) +
            "0" +
            (mon + 1) +
            "-" +
            "01" +
            " " +
            "00" +
            ":" +
            "00" +
            ":" +
            "00";
        }
        // this.endtime=this.endtime.slice(0,5)年
        else if (num >= 10) {
          this.endtime =
            this.endtime.slice(0, 5) +
            (num + 1) +
            "-" +
            "01" +
            " " +
            "00" +
            ":" +
            "00" +
            ":" +
            "00";
        } else {
          this.endtime =
            this.endtime.slice(0, 5) +
            "10" +
            "-" +
            "01" +
            " " +
            "00" +
            ":" +
            "00" +
            ":" +
            "00";
          console.log("1212121", this.endtime);
        }
        this.starttime = this.starttime + " " + "00" + ":" + "00" + ":" + "00";
        //}
      } else {
        this.starttime = "1998-01-01 00:00:00";
        this.endtime = "2998-01-01 00:00:00";
      }
    },
    //用户列表
    getuserlist() {
      listUser().then((res) => {
        this.users = res.data;
      });
    },
    /** 查询捐献基础列表 */
    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];
      }
      if (this.starttime != "") {
        this.queryParams.starttime = this.starttime;
      }
      if (this.endtime != "") {
        this.queryParams.endtime = this.endtime;
      }
 
      this.$nextTick(() => {
        listnewEthicalreviewopinions(this.queryParams).then((response) => {
          console.log("000000000000", response);
          this.listnews = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.isShowExpertAdviceDialog = 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");
    },
    //重置专家意见表单
    resetExperAdviceForm() {
      this.expertAdviceForm = {
        id: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        infoid: null,
        donorno: null,
        expertopinion: null,
        expertconclusion: 0,
        expertname: null,
        conclusiontime: null,
        conclusionannex: null,
        conclusionorder: null,
      };
      this.resetForm("expertAdviceForm");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.daterangeReporttime = [];
 
      this.reportervalue = "";
 
      this.queryParams = {
        doname: null,
        pageNum: 1,
        pageSize: 10,
        name: null,
        idcardno: null,
        residenceprovince: null,
        residencecity: null,
        residencetown: null,
        // "2"
        recordstate: null,
        treatmenthospitalname: null,
        donorno: null,
        acquisitiontissueno: null,
        reportername: null,
        reporttime: null,
        city: null,
        treatmenthospitalno: null,
      };
      this.selecttime = [];
      this.getTimeList();
      this.searchAddress = {
        sheng: "",
        shi: "",
        qu: "",
        organizationname: null,
      };
      //this.$refs.areaSelect.clean();
 
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /** 伦理审查弹窗 */
    showDonationEvaluationDialog(dontateInfo) {
      console.log("伦理审查11", dontateInfo);
      //查找是否存在伦理审查记录
      //this.curCase = dontateInfo;
      this.curCase = {
        id: dontateInfo.id,
        recordstate: null,
        donorno: dontateInfo.donorno,
      };
      this.reset();
      this.form.donorno = dontateInfo.donorno;
      this.form.infoid = dontateInfo.id;
      this.expertAdviceQueryParam.infoid = dontateInfo.id;
      this.expertAdviceQueryParam.donorno = dontateInfo.donorno;
      // this.listnews.ConclusionTime = this.expertAdviceForm.conclusiontime;
      // this.getExpertList();
      this.form.flowname = "伦理审查";
      if (dontateInfo.fcid) {
        let queryParam = {
          id: dontateInfo.fcid,
          flowname: "伦理审查",
        };
        // flowname: "伦理审查",
        listDonateflowchart(queryParam).then((response) => {
          let evaluationList = response.rows;
          console.log("伦理审查", response.rows);
          if (evaluationList.length == 1) {
            this.form = evaluationList[0];
            this.open = true;
            this.$nextTick(function () {
              this.$refs.ethicalannex.getAnnexList();
            });
            this.title = "修改伦理审查";
          } else if (evaluationList.length == 0) {
            this.$modal.msgError("未找到本案例的伦理审查记录,请联系管理员!");
          } else {
            this.$modal.msgError("数据重复");
          }
        });
      } else {
        this.title = "新增伦理审查";
        this.open = true;
        this.$nextTick(function () {
          this.$refs.ethicalannex.getAnnexList();
        });
      }
    },
    /** 保存捐献评估 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          //判断审查意见录入
          if (this.form.flowconclusion == 2 || this.form.flowconclusion == 3) {
            var exp = this.form.flowcontent;
            if (typeof exp == "undefined" || exp == null || exp == "") {
              this.$modal.msgError("请输入审查意见!");
              return;
            }
          }
 
          //判断是否是新纪录
          if (this.form.id != null) {
            // updateEthicalreviewopinions没有权限
            updateDonateflowchart(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              //更新捐献状态
              if (this.form.flowconclusion == 1) {
                this.curCase.recordstate = 8;
              } else {
                this.curCase.recordstate = 9;
              }
              updateDonatebaseinfo(this.curCase).then((response) => {
                this.open = false;
                this.getList();
              });
            });
          } else {
            addDonateflowchart(this.form).then((response) => {
              //更新捐献状态
              if (this.form.flowconclusion == 1) {
                this.curCase.recordstate = 8;
              } else {
                this.curCase.recordstate = 9;
              }
              updateDonatebaseinfo(this.curCase).then((response) => {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
              });
            });
          }
        }
      });
    },
    /** 获取捐献评估 */
    getDonationEvaluation(dontateInfo) {
      //this.loading = true;
      this.curCase = dontateInfo;
      let queryParam = {
        donorno: dontateInfo.donorno,
        flowname: "伦理审查",
      };
 
      listDonateflowchart(queryParam).then((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 == 4) {
        return true;
      } else if (dontateInfo.recordstate == 5 || dontateInfo.recordstate == 6) {
        return false;
      } else {
        return "";
      }
    },
    handlePreview(file) {
      console.log(file);
    },
    //显示专家意见弹窗
    showExpertAdviceDialog() {
      this.resetExperAdviceForm();
      this.expertAdviceForm.infoid = this.curCase.id;
      this.expertAdviceForm.donorno = this.curCase.donorno;
      this.isShowExpertAdviceDialog = true;
    },
    //保存专家意见
    saveExpertAdvice() {
      this.$refs["expertAdviceForm"].validate((valid) => {
        if (valid) {
          if (this.expertAdviceForm.id != null) {
            updateEthicalreviewopinions(this.expertAdviceForm).then(
              (response) => {
                this.$modal.msgSuccess("修改成功");
                // this.getExpertList();
                this.isShowExpertAdviceDialog = false;
              }
            );
          } else {
            addEthicalreviewopinions(this.expertAdviceForm).then((response) => {
              this.$modal.msgSuccess("新增成功");
              // this.getExpertList();
              this.isShowExpertAdviceDialog = false;
            });
            // this.doctorAdviceTableData.push(this.expertAdviceForm);
            // this.isShowExpertAdviceDialog = false;
          }
        }
      });
    },
    //获取专家意见列表
    getExpertList() {
      this.loading = true;
      listEthicalreviewopinions(this.expertAdviceQueryParam).then(
        (response) => {
          this.doctorAdviceTableData = response.rows;
          this.total = response.total;
          this.loading = false;
        }
      );
    },
    /** 删除按钮操作 */
    handleDeleteExpert(row) {
      const ids = row.id;
      this.$modal
        .confirm('是否确认删除伦理审查专家意见编号为"' + ids + '"的数据项?')
        .then(function () {
          return delEthicalreviewopinions(ids);
        })
        .then(() => {
          // this.getExpertList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => { });
    },
    /** 修改按钮操作 */
    handleUpdateExpert(row) {
      this.reset();
      const id = row.id;
      getEthicalreviewopinions(id).then((response) => {
        this.expertAdviceForm = response.data;
        this.isShowExpertAdviceDialog = true;
        //this.title = "修改伦理审查专家意见";
      });
    },
  },
};
</script>