WXL
2024-10-22 b10795e18a07b9beb72f25406f26f42491828be5
src/views/patient/propaganda/Missioncreation.vue
@@ -383,6 +383,17 @@
                        >删除</el-button
                      >
                    </el-col>
                    <el-col :span="1.5">
                      <el-button
                        type="info"
                        plain
                        icon="el-icon-upload2"
                        size="medium"
                        @click="handleImport"
                        >导入</el-button
                      >
                    </el-col>
                    <!-- <el-col :span="1.5"> </el-col> -->
                  </el-row>
@@ -437,30 +448,24 @@
              v-show="showSearch"
              label-width="98px"
            >
              <el-form-item label="患者名称:">
                <el-input v-model="patientqueryParams.name"></el-input>
              <el-form-item label="患者:">
                <el-input
                  v-model="patientqueryParams.name"
                  @keyup.enter.native="handleQuery"
                ></el-input>
              </el-form-item>
              <!-- <el-form-item label="就诊科室" prop="status">
                <el-select
                  v-model="patientqueryParams.topic"
                  placeholder="请选择"
              <el-select
                v-model="patientqueryParams.searchscope"
                placeholder="请选择患者范围"
              >
                <el-option
                  v-for="item in source"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                  <el-option-group
                    v-for="group in topicoptions[0].children"
                    :key="group.deptName"
                    :label="group.deptName"
                  >
                    <el-option
                      v-for="item in group.children"
                      :key="item.deptId"
                      :label="item.deptName"
                      :value="item.deptId"
                    >
                    </el-option>
                  </el-option-group>
                </el-select>
              </el-form-item> -->
                </el-option>
              </el-select>
              <el-form-item>
                <el-button
@@ -506,6 +511,7 @@
        >
      </span>
    </el-dialog>
    <!-- 模板预览 -->
    <el-dialog title="模板预览" :visible.sync="previewtf" width="60%">
      <div class="preview-left">
        <!-- 单选 -->
@@ -515,6 +521,98 @@
        <!-- <el-button @click="previewGo">前往模板详情修改</el-button> -->
        <el-button type="primary" @click="previewFn">确认使用</el-button>
      </span>
    </el-dialog>
    <!-- 用户导入对话框 -->
    <el-dialog
      :title="upload.title"
      :visible.sync="upload.open"
      width="70%"
      append-to-body
    >
      <el-steps :active="dractive" simple>
        <el-step title="上传导入文件" icon="el-icon-upload"></el-step>
        <el-step title="导入检查" icon="el-icon-picture"></el-step>
      </el-steps>
      <!-- 上传导入文件 -->
      <div class="download" v-if="dractive == 1">
        <el-upload
          class="upload-demo"
          ref="upload"
          :limit="1"
          accept=".xlsx, .xls"
          :headers="upload.headers"
          :action="upload.url"
          :disabled="upload.isUploading"
          :on-progress="handleFileUploadProgress"
          :on-success="handleFileSuccess"
          drag
        >
          <i class="el-icon-upload"></i>
          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
          <div class="el-upload__tip text-center" slot="tip">
            <!-- <div class="el-upload__tip" slot="tip">
              <el-checkbox v-model="upload.updateSupport" />
              是否更新已经存在的用户数据
            </div> -->
            <span>仅允许导入xls、xlsx格式文件。</span>
            <el-link
              type="primary"
              :underline="false"
              style="font-size: 24px; vertical-align: baseline"
              @click="importTemplate"
              >下载模板
            </el-link>
            <!-- <el-link
              type="success"
              :underline="false"
              style="font-size: 24px; vertical-align: baseline"
              href="http://m.qpic.cn/psc?/V50ZTolo1AIhq00dqrJP2169QM2VHGTU/ruAMsa53pVQWN7FLK88i5qfmCJclyMduqqL6kjE4h7TXDAjimVtmLmTyGVfF4qlkyOISsYQ4Mxx705X2tkXEIUPrfCS4L4yK.f11SmO8Tq0!/b&bo=twb0AgAAAAADB2U!&rf=viewer_4"
              target="_blank"
            >
              查看模板</el-link
            > -->
          </div>
        </el-upload>
      </div>
      <!-- 完成 -->
      <div class="drexamine" v-else-if="dractive == 2">
        <div style="display: flex">
          <img src="@/assets/images/导入.png" />
          <p>导入患者成功!</p>
          <p>
            本次成功导入<span style="color: #72d3a9; font-size: 20px">{{
              uploadingData.length
            }}</span
            >位患者
          </p>
        </div>
        <el-table :data="uploadingData" style="width: 100%">
          <el-table-column prop="serial" label="患者id"> </el-table-column>
          <el-table-column prop="name" label="姓名"> </el-table-column>
          <el-table-column prop="sex" label="性别"> </el-table-column>
          <el-table-column prop="idcardno" width="300" label="证件号码"> </el-table-column>
          <el-table-column prop="goday" label="出生日期"> </el-table-column>
          <el-table-column prop="telcode" width="200" label="联系方式"> </el-table-column>
          <el-table-column prop="createTime"  width="200" label="创建日期">
          </el-table-column>
        </el-table>
        <!-- <pagination
          v-show="total > 0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="geterryList"
        /> -->
      </div>
      <div slot="footer">
        <el-button type="primary" @click="submitFileForm">{{
          dractive == 1 ? "下一步" : "加入任务"
        }}</el-button>
        <el-button @click="submitclose">取 消</el-button>
      </div>
    </el-dialog>
    <el-drawer
      title="宣教内容列表"
@@ -643,7 +741,7 @@
  getheLibraryAssort,
} from "@/api/AiCentre/index";
import { listDept } from "@/api/system/dept";
import { getToken } from "@/utils/auth";
import SFtable from "@/components/SFtable"; //表格组件
export default {
@@ -671,6 +769,7 @@
      belongWards: [],
      tableLabel: [],
      questionList: [],
      uploadingData: [],
      htmlRichText: "<p>Hello, <strong>world</strong>!</p>",
      // 患者表单
      tableLabelhz: [
@@ -720,6 +819,22 @@
        { label: "钉钉", value: 6 },
        { label: "智能机器人", value: 7 },
      ],
      upload: {
        // 是否显示弹出层(用户导入)
        open: false,
        // 弹出层标题(用户导入)
        title: "",
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的用户数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: { Authorization: "Bearer " + getToken() },
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/smartor/import/importPatInfo",
      },
      //导入进度
      dractive: 1,
      // 时间处理
      daytime: [], //日期
      applydaytime: [], //计算日期
@@ -815,12 +930,30 @@
          label: "出院病人",
        },
        {
          value: "4",
          label: "在院病人",
        },
        {
          value: "2",
          label: "门诊病人",
        },
        {
          value: "3",
          label: "体检病人",
        },
      ],
      source: [
        {
          value: 0,
          label: "所属患者",
        },
        {
          value: 1,
          label: "科室患者",
        },
        {
          value: 2,
          label: "病区患者",
        },
      ],
      quote: false,
@@ -971,6 +1104,7 @@
        this.form.isoperation = 2;
      } else {
        this.form.isoperation = 1;
        this.form.sendState=1;
      }
      if (!this.form.type) {
        this.form.type = this.$route.query.type;
@@ -1048,35 +1182,7 @@
        '<img$1style="width:100%;height:auto;"$3>'
      );
    },
    // 处理问题层变量
    // Variablehandling(arr, type) {
    //   let Variablist = [];
    //   if (type == 1) {
    //     console.log(arr);
    //     // 循环问题
    //     arr.forEach((res) => {
    //       console.log(JSON.parse(res.otherdata), "ss");
    //       // 循环选项
    //       JSON.parse(res.otherdata).forEach((item) => {
    //         if (item.default != 1) {
    //           Variablist.push({
    //             value: item.variate,
    //             fill: "",
    //             name: item.variatename,
    //           });
    //         }
    //       });
    //     });
    //     console.log(Variablist, "Variablist");
    //     const Aarr = Variablist.filter(
    //       (obj, index, self) =>
    //         index ===
    //         self.findIndex((t) => t.name === obj.name && t.value === obj.value)
    //     );
    //     this.variableList = this.transitionList.concat(Aarr);
    //     // this.form.textParam = this.convertFormat2ToFormat1(this.variableList);
    //   }
    // },
    // 子任务二级弹框
    handleAddpatient(row) {
      this.allpids = [];
@@ -1109,9 +1215,31 @@
      }
      if (this.allpids[0]) {
        this.patientqueryParams.pids = this.allpids;
        console.log(this.patientqueryParams.pids);
      } else {
        this.patientqueryParams.pids = null;
      }
      // 类型判断
      if (this.patientqueryParams.allhosp == 1) {
        this.patientqueryParams.cry = 1;
      } else if (this.patientqueryParams.allhosp == 4) {
        this.patientqueryParams.cry = 0;
        this.patientqueryParams.allhosp = "1";
      }
      if (this.patientqueryParams.searchscope == 1) {
        this.patientqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
        );
        this.patientqueryParams.leavehospitaldistrictcodes = [];
      } else if (this.patientqueryParams.searchscope == 2) {
        this.patientqueryParams.leavehospitaldistrictcodes =
          store.getters.belongWards.map((obj) => obj.districtCode);
        this.patientqueryParams.leaveldeptcodes = [];
      } else {
        this.patientqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
        );
        this.patientqueryParams.leavehospitaldistrictcodes =
          store.getters.belongWards.map((obj) => obj.districtCode);
      }
      getTaskpatient(this.patientqueryParams).then((response) => {
@@ -1128,7 +1256,7 @@
    handleExport() {},
    // 选择患者表数据
    handleSelectionChange(selection) {
    handleSelectionChange(selection,type) {
      console.log("多选患者");
      this.SelectPatientslist = selection;
      this.multiple = !selection.length;
@@ -1139,7 +1267,14 @@
        if (!isExist) {
          item.isoperation = 1;
          item.patid = item.id;
          item.hospType = this.patientqueryParams.allhosp;
          if (item.idcardno) {
            item.sfzh = item.idcardno;
          }
          if (type) {
            item.hospType=type
          }else{
            item.hospType = this.patientqueryParams.allhosp;
          }
          this.overallCase.push(item);
          this.form.patTaskRelevances.push(item);
        }
@@ -1232,7 +1367,7 @@
            this.overallCase = this.form.patTaskRelevances.concat();
            this.checkList = this.form.preachform.split(",");
            console.log(this.form.showDate, "this.form");
            if (this.form.daytime)this.daytime = this.form.showDate.split(",");
            if (this.form.daytime) this.daytime = this.form.showDate.split(",");
            console.log(this.newadd, "依照");
            if (this.form.showTimeMorn) {
@@ -1426,6 +1561,47 @@
        this.checkList = list;
      }
    },
    /** 导入按钮操作 */
    handleImport() {
      this.upload.title = "用户导入";
      this.upload.open = true;
    },
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.isUploading = false;
      this.uploadingData = response.rows;
      console.log(response, "文件");
      this.$refs.upload.clearFiles();
    },
    // 提交上传文件
    submitFileForm() {
      // 上传
      if (this.dractive == 1) {
        this.$refs.upload.submit();
        this.dractive++;
      } else if (this.dractive == 2) {
        this.handleSelectionChange(this.uploadingData,4);
        this.upload.open = false;
        this.dractive = 1
      }
    },
    /** 下载模板操作 */
    importTemplate() {
      this.download(
        "smartor/import/getImportPatTemplate",
        {},
        `user_template_${new Date().getTime()}.xlsx`
      );
    },
    submitclose() {
      this.upload.open = false;
      this.dractive = 1;
    },
  },
};
</script>
@@ -1561,6 +1737,41 @@
    }
  }
}
.download {
  text-align: center;
  .el-upload__tip {
    font-size: 23px;
  }
  .el-upload__text {
    font-size: 23px;
  }
}
.uploading {
  margin-top: 20px;
  margin: 20px;
  padding: 30px;
  background: #ffffff;
  border: 1px solid #dcdfe6;
  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
    0 0 6px 0 rgba(0, 0, 0, 0.04);
}
.drexamine {
  // display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #daeaf5;
  img {
    width: 50px;
    height: 50px;
  }
}
.button-textsc {
  color: #28cfe6;
}
.button-textxg {
  color: #de7897;
}
::v-deep .addtopic-input {
  input {
    background: #02a7f0;