heimawl
2023-06-13 d9cbb5e4cf6f0423b84b739c52d55f98f3af148a
src/views/patient/patient/index.vue
@@ -172,14 +172,12 @@
            align="center"
            key="userId"
            prop="userId"
            v-if="columns[0].visible"
          />
          <el-table-column
            label="姓名"
            align="center"
            key="userName"
            prop="userName"
            v-if="columns[1].visible"
            :show-overflow-tooltip="true"
          />
          <el-table-column
@@ -187,7 +185,6 @@
            align="center"
            key="nickName"
            prop="nickName"
            v-if="columns[2].visible"
            :show-overflow-tooltip="true"
          />
          <el-table-column
@@ -195,7 +192,6 @@
            align="center"
            key="deptName"
            prop="dept.deptName"
            v-if="columns[3].visible"
            :show-overflow-tooltip="true"
          />
          <el-table-column
@@ -203,14 +199,12 @@
            align="center"
            key="phonenumber"
            prop="phonenumber"
            v-if="columns[4].visible"
            width="120"
          /><el-table-column
            label="证件号码"
            align="center"
            key="phonenumber"
            prop="phonenumber"
            v-if="columns[4].visible"
            width="120"
          />
          <el-table-column
@@ -221,21 +215,6 @@
            v-if="columns[4].visible"
            width="120"
          />
          <!-- <el-table-column
            label="状态"
            align="center"
            key="status"
            v-if="columns[5].visible"
          >
            <template slot-scope="scope">
              <el-switch
                v-model="scope.row.status"
                active-value="0"
                inactive-value="1"
                @change="handleStatusChange(scope.row)"
              ></el-switch>
            </template>
          </el-table-column> -->
          <el-table-column
            label="联系方式"
@@ -447,41 +426,88 @@
    <el-dialog
      :title="upload.title"
      :visible.sync="upload.open"
      width="400px"
      width="70%"
      append-to-body
    >
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url + '?updateSupport=' + upload.updateSupport"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        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" />
            是否更新已经存在的用户数据
      <el-steps :active="dractive" simple>
        <el-step title="上传导入文件" icon="el-icon-upload"></el-step>
        <el-step title="导入检查" icon="el-icon-picture"></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 + '?updateSupport=' + upload.updateSupport"
          :disabled="upload.isUploading"
          :on-progress="handleFileUploadProgress"
          :on-success="handleFileSuccess"
          :auto-upload="false"
          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
            >
          </div>
          <span>仅允许导入xls、xlsx格式文件。</span>
          <el-link
            type="primary"
            :underline="false"
            style="font-size: 12px; vertical-align: baseline"
            @click="importTemplate"
            >下载模板</el-link
          >
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
        </el-upload>
      </div>
      <!-- 导入检查 -->
      <div class="uploading" v-else-if="dractive == 2">
        <el-table :data="uploadingData" style="width: 100%">
          <el-table-column prop="serial" label="序号"> </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="certificate" label="证件类型">
          </el-table-column>
          <el-table-column prop="certificatenum" label="证件号码">
          </el-table-column>
          <el-table-column prop="goday" label="出生日期"> </el-table-column>
          <el-table-column prop="menum" label="本人联系方式"> </el-table-column>
          <el-table-column prop="younum" label="亲属联系方式">
          </el-table-column>
          <el-table-column prop="tag" label="患者标签"> </el-table-column>
          <el-table-column prop="erry" 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 class="drexamine" v-else-if="dractive == 3">
        <img
          src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
        />
        <p>导入患者成功!</p>
        <p>本次共计导入{{ ImportQuantity }}位患者</p>
      </div>
      <div slot="footer" class="dialog-footer" v-if="dractive == 3">
        <!-- <el-button type="primary" @click="submitFileForm">下一步</el-button> -->
        <el-button @click="submitclose">完成</el-button>
      </div>
      <div slot="footer" v-else>
        <el-button type="primary" @click="submitFileForm">下一步</el-button>
        <el-button @click="submitclose">取 消</el-button>
      </div>
    </el-dialog>
  </div>
@@ -498,6 +524,7 @@
  changeUserStatus,
  deptTreeSelect,
} from "@/api/system/user";
import { listpatient } from "@/api/patient/homepage";
import { getToken } from "@/utils/auth";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -540,6 +567,20 @@
      roleOptions: [],
      // 表单参数
      form: {},
      //导入进度
      dractive: 1,
      // 导入展示表单
      uploadingData: {},
      total: 0, // 总条数
      ImportQuantity: 999, //导入患者数量
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        jobName: undefined,
        jobGroup: undefined,
        status: undefined,
      },
      propss: { multiple: true },
      optionss: [
        {
@@ -660,16 +701,24 @@
    });
  },
  methods: {
    /** 查询用户列表 */
    /** 查询患者列表 */
    getList() {
      this.loading = true;
      listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
        (response) => {
          this.userList = response.rows;
          this.total = response.total;
          this.loading = false;
        }
      );
      listUser(this.queryParams).then((response) => {
        console.log(response);
        this.userList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 查询导入展示列表
    geterryList() {
      this.loading = true;
      listJob(this.queryParams).then((response) => {
        this.jobList = 1;
        this.total = 1;
        this.loading = false;
      });
    },
    /** 查询部门下拉树结构 */
    getDeptTree() {
@@ -881,7 +930,17 @@
    },
    // 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit();
      // 上传
      if (this.dractive == 1) {
        this.$refs.upload.submit();
        this.dractive++;
      } else {
        this.dractive++;
      }
    },
    submitclose() {
      this.upload.open = false;
      this.dractive = 1;
    },
  },
};
@@ -901,4 +960,33 @@
  display: flex;
  justify-content: flex-end;
}
.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: 30px;
  background: #daeaf5;
  img {
    width: 100px;
    height: 100px;
  }
}
</style>