11
WXL
2024-02-21 633f26d8e772b2441fb3fab72ecab0a047def74c
src/views/project/donateannex/index.vue
@@ -135,7 +135,7 @@
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
       <el-table-column
      <el-table-column
        label="捐献编号"
        align="center"
        prop="donorno"
@@ -148,36 +148,29 @@
        width="120"
      >
        <template slot-scope="scope">
          <dict-tag
            :options="dict.type.sys_DonationStatus"
            :value="scope.row.recordstate"
          />
          <div v-if="!scope.terminationCase">
            <dict-tag
              :options="dict.type.sys_DonationStatus"
              :value="scope.row.recordstate"
            />
          </div>
          <div v-else>任务中止</div>
        </template>
      </el-table-column>
       <el-table-column
        label="姓名"
        align="center"
        prop="name"
        width="120"
      />
       <el-table-column label="性别" align="center" prop="sex" width="120">
      <el-table-column label="姓名" align="center" prop="name" width="120" />
      <el-table-column label="性别" align="center" prop="sex" width="120">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex" />
        </template>
      </el-table-column>
      <el-table-column label="年龄" align="center" prop="age" width="120" />
      <el-table-column
        label="年龄"
        align="center"
        prop="age"
        width="120"
      />
     <el-table-column
        label="医疗机构"
        align="center"
        prop="treatmenthospitalname"
        width="180"
      />
      <el-table-column
        label="报告人"
        align="center"
@@ -267,11 +260,14 @@
          <el-input v-model="form.donorno" placeholder="请输入捐献者编号" />
        </el-form-item>
         <el-form-item label="姓名" prop="name">
              <el-input disabled v-model="form.name" placeholder="请输入捐献者姓名" />
            </el-form-item>
        <el-form-item label="姓名" prop="name">
          <el-input
            disabled
            v-model="form.name"
            placeholder="请输入捐献者姓名"
          />
        </el-form-item>
        <el-table
          :data="attachmentTableData"
          style="width: 100%; margin-bottom: 20px"
@@ -334,7 +330,7 @@
  delDonateannex,
  addDonateannex,
  updateDonateannex,
  exportDonateannex,
  exportDonateannex
} from "@/api/project/donateannex";
import Li_area_select from "@/components/Address";
import OrgSelecter from "@/views/project/components/orgselect";
@@ -350,7 +346,7 @@
  // exportProvincemessage,
} from "@/api/project/donatebaseinfo";
export default {
   components: {
  components: {
    Li_area_select,
    OrgSelecter,
    AnnexUpload
@@ -377,7 +373,7 @@
    "sys_SelfWill",
    "sys_FamilyRelation",
    "sys_Organ",
    "sys_organstate",
    "sys_organstate"
  ],
  data() {
    return {
@@ -401,14 +397,14 @@
      title: "",
      // 是否显示弹出层
      open: false,
      donorno:"",
      donorno: "",
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        donorno: null,
        annexname: null,
        annexno: null,
        annexno: null
      },
      // 表单参数
      form: {},
@@ -426,45 +422,45 @@
              annexname: "捐献者身份证明",
              annexno: "0001",
              annexurl: "",
              fileList: [],
              fileList: []
            },
            {
              annexname: "捐献者亲属身份证明",
              annexno: "0002",
              annexurl: "",
              fileList: [],
            },
          ],
              fileList: []
            }
          ]
        },
        {
          annexname: "捐献者及亲属关系证明",
          annexno: "002",
          annexurl: "",
          fileList: [],
          fileList: []
        },
        {
          annexname: "捐献者病情简介",
          annexno: "003",
          annexurl: "",
          fileList: [],
          fileList: []
        },
        {
          annexname: "捐献确认登记表",
          annexno: "004",
          annexurl: "",
          fileList: [],
          fileList: []
        },
        {
          annexname: "人体器官捐献人员评估资质(可选)",
          annexno: "005",
          annexurl: "",
          fileList: [],
          fileList: []
        },
        {
          annexname: "公民逝世后人体器官捐献告知书",
          annexno: "006",
          annexurl: "",
          fileList: [],
          fileList: []
        },
        {
          annexname: "DBD/DCD可行性评估报告",
@@ -482,7 +478,7 @@
                  annexname: "人体器官捐献病情评估表(DBD)",
                  annexno: "00711",
                  annexurl: "",
                  fileList: [],
                  fileList: []
                },
                {
                  annexname: "脑死亡判定符合报告:符合其中两项即可",
@@ -494,29 +490,29 @@
                      annexname: "脑电图报告",
                      annexno: "007121",
                      annexurl: "",
                      fileList: [],
                      fileList: []
                    },
                    {
                      annexname: "短潜伏期体感诱发电位",
                      annexno: "007122",
                      annexurl: "",
                      fileList: [],
                      fileList: []
                    },
                    {
                      annexname: "经颅多普勒超声报告",
                      annexno: "007123",
                      annexurl: "",
                      fileList: [],
                    },
                  ],
                      fileList: []
                    }
                  ]
                },
                {
                  annexname: "人体器官捐献病情评估意见(DBD)",
                  annexno: "00713",
                  annexurl: "",
                  fileList: [],
                },
              ],
                  fileList: []
                }
              ]
            },
            {
              annexname: "(二)DCD可行性评估报告",
@@ -528,29 +524,29 @@
                  annexname: "人体器官捐献病情评估表(DCD)",
                  annexno: "00721",
                  annexurl: "",
                  fileList: [],
                  fileList: []
                },
                {
                  annexname: "撤除心肺支持60分钟内死亡风险评估单",
                  annexno: "00722",
                  annexurl: "",
                  fileList: [],
                  fileList: []
                },
                {
                  annexname: "人体器官捐献病情评估意见(DCD)",
                  annexno: "00723",
                  annexurl: "",
                  fileList: [],
                },
              ],
            },
          ],
        },
                  fileList: []
                }
              ]
            }
          ]
        }
      ],
      // 上传的图片服务器地址
      uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload",
      headers: {
        Authorization: "Bearer " + getToken(),
        Authorization: "Bearer " + getToken()
      },
      //各份附件所在attachmentTableData数组中的位置
      attachJsonPosition: [
@@ -560,7 +556,7 @@
          annexno: "001",
          annexurl: "",
          level: 2,
          position: [0, 0],
          position: [0, 0]
        },
        {
          id: null,
@@ -568,7 +564,7 @@
          annexno: "002",
          annexurl: "",
          level: 2,
          position: [0, 1],
          position: [0, 1]
        },
        {
          id: null,
@@ -576,7 +572,7 @@
          annexno: "001",
          annexurl: "",
          level: 1,
          position: [1],
          position: [1]
        },
        {
          id: null,
@@ -584,7 +580,7 @@
          annexno: "001",
          annexurl: "",
          level: 1,
          position: [2],
          position: [2]
        },
        {
          id: null,
@@ -592,7 +588,7 @@
          annexno: "001",
          annexurl: "",
          level: 1,
          position: [3],
          position: [3]
        },
        {
          id: null,
@@ -600,7 +596,7 @@
          annexno: "001",
          annexurl: "",
          level: 1,
          position: [4],
          position: [4]
        },
        {
          id: null,
@@ -608,7 +604,7 @@
          annexno: "001",
          annexurl: "",
          level: 1,
          position: [5],
          position: [5]
        },
        {
          id: null,
@@ -616,7 +612,7 @@
          annexno: "001",
          annexurl: "",
          level: 3,
          position: [6, 0, 0],
          position: [6, 0, 0]
        },
        {
          id: null,
@@ -624,7 +620,7 @@
          annexno: "001",
          annexurl: "",
          level: 4,
          position: [6, 0, 1, 0],
          position: [6, 0, 1, 0]
        },
        {
          id: null,
@@ -632,7 +628,7 @@
          annexno: "001",
          annexurl: "",
          level: 4,
          position: [6, 0, 1, 1],
          position: [6, 0, 1, 1]
        },
        {
          id: null,
@@ -640,7 +636,7 @@
          annexno: "001",
          annexurl: "",
          level: 4,
          position: [6, 0, 1, 2],
          position: [6, 0, 1, 2]
        },
        {
          id: null,
@@ -648,7 +644,7 @@
          annexno: "001",
          annexurl: "",
          level: 3,
          position: [6, 0, 2],
          position: [6, 0, 2]
        },
        {
          id: null,
@@ -656,7 +652,7 @@
          annexno: "001",
          annexurl: "",
          level: 3,
          position: [6, 1, 0],
          position: [6, 1, 0]
        },
        {
          id: null,
@@ -664,7 +660,7 @@
          annexno: "001",
          annexurl: "",
          level: 3,
          position: [6, 1, 1],
          position: [6, 1, 1]
        },
        {
          id: null,
@@ -672,13 +668,13 @@
          annexno: "001",
          annexurl: "",
          level: 3,
          position: [6, 1, 2],
        },
          position: [6, 1, 2]
        }
      ],
      //捐赠编号
      donorno: "0001",
      infoid: "8",
      openType: "edit",
      openType: "edit"
    };
  },
  created() {
@@ -688,8 +684,8 @@
    /** 查询捐献附件列表 */
    getList() {
      this.loading = true;
      listnewDonateannex(this.queryParams).then((response) => {
        console.log("新数据",response);
      listnewDonateannex(this.queryParams).then(response => {
        console.log("新数据", response);
        this.donateannexList = response.rows;
        console.log(this.donateannexList.donorNo);
        this.total = response.total;
@@ -700,12 +696,13 @@
    cancel() {
      this.open = false;
      this.reset();
    }, curCase: {
        donorno: "",
        name: "",
        registerAddresss:"",
        infoid: "",
      },
    },
    curCase: {
      donorno: "",
      name: "",
      registerAddresss: "",
      infoid: ""
    },
    // 表单重置
    reset() {
      this.form = {
@@ -785,7 +782,7 @@
        majorrelatives: null,
        familyrelations: null,
        acquisitiontissueno: null,
        acquisitiontissuename: null,
        acquisitiontissuename: null
      };
      this.resetForm("form");
    },
@@ -801,7 +798,7 @@
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.ids = selection.map(item => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
@@ -815,10 +812,10 @@
        let searchParam = {
          donorno: this.donorno,
          infoid: this.infoid,
          isdel: 0,
          isdel: 0
        };
        this.loading = true;
        listDonateannex(searchParam).then((response) => {
        listDonateannex(searchParam).then(response => {
          //this.donateannexList = response.rows;
          this.loading = false;
          let dataList = response.rows;
@@ -837,7 +834,7 @@
                  const list = Array.isArray(tempUrl)
                    ? tempUrl
                    : tempUrl.split(",");
                  tempfileList = list.map((item) => {
                  tempfileList = list.map(item => {
                    if (typeof item === "string") {
                      item = { name: item, url: item };
                    }
@@ -849,10 +846,12 @@
                let tempPositionArr = this.attachJsonPosition[k].position;
                let tempData;
                if (this.attachJsonPosition[k].level == 1) {
                  this.attachmentTableData[tempPositionArr[0]].fileList =
                    tempfileList;
                  this.attachmentTableData[tempPositionArr[0]].annexurl =
                    tempUrl;
                  this.attachmentTableData[
                    tempPositionArr[0]
                  ].fileList = tempfileList;
                  this.attachmentTableData[
                    tempPositionArr[0]
                  ].annexurl = tempUrl;
                  tempData = this.attachmentTableData[tempPositionArr[0]];
                } else if (this.attachJsonPosition[k].level == 2) {
                  this.attachmentTableData[tempPositionArr[0]].children[
@@ -861,10 +860,8 @@
                  this.attachmentTableData[tempPositionArr[0]].children[
                    tempPositionArr[1]
                  ].annexurl = tempUrl;
                  tempData =
                    this.attachmentTableData[tempPositionArr[0]].children[
                      tempPositionArr[1]
                    ];
                  tempData = this.attachmentTableData[tempPositionArr[0]]
                    .children[tempPositionArr[1]];
                } else if (this.attachJsonPosition[k].level == 3) {
                  this.attachmentTableData[tempPositionArr[0]].children[
                    tempPositionArr[1]
@@ -872,10 +869,8 @@
                  this.attachmentTableData[tempPositionArr[0]].children[
                    tempPositionArr[1]
                  ].children[tempPositionArr[2]].annexurl = tempUrl;
                  tempData =
                    this.attachmentTableData[tempPositionArr[0]].children[
                      tempPositionArr[1]
                    ].children[tempPositionArr[2]];
                  tempData = this.attachmentTableData[tempPositionArr[0]]
                    .children[tempPositionArr[1]].children[tempPositionArr[2]];
                } else if (this.attachJsonPosition[k].level == 4) {
                  this.attachmentTableData[tempPositionArr[0]].children[
                    tempPositionArr[1]
@@ -887,10 +882,9 @@
                  ].children[tempPositionArr[2]].children[
                    tempPositionArr[3]
                  ].annexurl = tempUrl;
                  tempData =
                    this.attachmentTableData[tempPositionArr[0]].children[
                      tempPositionArr[1]
                    ].children[tempPositionArr[2]].children[tempPositionArr[3]];
                  tempData = this.attachmentTableData[tempPositionArr[0]]
                    .children[tempPositionArr[1]].children[tempPositionArr[2]]
                    .children[tempPositionArr[3]];
                }
              }
            }
@@ -905,9 +899,9 @@
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids;
      getDonatebaseinfo(id).then((response) => {
      getDonatebaseinfo(id).then(response => {
        this.form = response.data;
        console.log("form:",this.form);
        console.log("form:", this.form);
        // this.form.diseasetype = this.form.diseasetype.split(",");
        // this.form.infectious = this.form.infectious.split(",");
        // this.form.selfwill = this.form.selfwill.split(",");
@@ -924,16 +918,16 @@
      if (this.openType == "edit") {
        //循环数组,单个上传,后续改为批量上传
        for (let i = 0; i < this.attachJsonPosition.length; i++) {
         let updateParam = {
          let updateParam = {
            id: this.attachJsonPosition[i].id,
            infoid: this.infoid,
            donorno: this.donorno,
            delFlag: 0,
            annexname: this.attachJsonPosition[i].annexname,
            annexno: this.attachJsonPosition[i].annexno,
            annexurl: this.attachJsonPosition[i].annexurl,
            annexurl: this.attachJsonPosition[i].annexurl
          };
          updateDonateannex(updateParam).then((response) => {
          updateDonateannex(updateParam).then(response => {
            this.$modal.msgSuccess("修改成功");
          });
        }
@@ -946,9 +940,9 @@
            delFlag: 0,
            annexname: this.attachJsonPosition[i].annexname,
            annexno: this.attachJsonPosition[i].annexno,
            annexurl: this.attachJsonPosition[i].annexurl,
            annexurl: this.attachJsonPosition[i].annexurl
          };
          addDonateannex(addParam).then((response) => {
          addDonateannex(addParam).then(response => {
            this.$modal.msgSuccess("新增成功");
            //this.open = false;
          });
@@ -961,7 +955,7 @@
      const ids = row.id || this.ids;
      this.$modal
        .confirm('是否确认删除捐献基础编号为"' + ids + '"的数据项?')
        .then(function () {
        .then(function() {
          return delDonatebaseinfo(ids);
        })
        .then(() => {
@@ -979,7 +973,7 @@
          this.exportLoading = true;
          return exportDonatebaseinfo(queryParams);
        })
        .then((response) => {
        .then(response => {
          this.$download.name(response.msg);
          this.exportLoading = false;
        })
@@ -1044,7 +1038,7 @@
          }
        }
      } else {
        console.log(response.msg);;
        console.log(response.msg);
      }
    },
@@ -1080,8 +1074,9 @@
          this.attachJsonPosition[positionIndex].annexurl =
            attachmentFileInfo.annexurl;
        } else if (position.level == 2) {
          this.attachmentTableData[positionArr[0]].children[positionArr[1]] =
            attachmentFileInfo;
          this.attachmentTableData[positionArr[0]].children[
            positionArr[1]
          ] = attachmentFileInfo;
          this.attachJsonPosition[positionIndex].annexurl =
            attachmentFileInfo.annexurl;
        } else if (position.level == 3) {
@@ -1108,7 +1103,7 @@
        strs += list[i].url + separator;
      }
      return strs != "" ? strs.substr(0, strs.length - 1) : "";
    },
  },
    }
  }
};
</script>