su
su1124
2023-12-29 d10c7c728234b5a9098b7bd5bb7a914a14e33c20
src/views/sampling/sampling/index.vue
@@ -1,18 +1,45 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
      <el-form-item label="体检号" prop="tjNum">
        <el-input v-model="queryParams.tjNum" placeholder="请输入体检号" clearable @keyup.enter.native="handleQuery"
          style="width: 170px" />
        <el-input
        ref="inputName"
          v-model="queryParams.tjNum"
          placeholder="请输入体检号"
          clearable
          @keyup.enter.native="handleQuery"
          @blur="handleQuery"
          style="width: 170px"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="name">
        <el-input v-model="queryParams.name" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery"
          style="width: 110px" />
        <el-input
          v-model="queryParams.name"
          placeholder="请输入姓名"
          clearable
          @keyup.enter.native="handleQuery"
          style="width: 110px"
        />
      </el-form-item>
      <el-form-item label="申请时间" prop="applicationTime">
        <el-date-picker clearable v-model="createTimeList" @change="dateChangebirthday1" style="width: 240px"
          value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
          :picker-options="pickerOptions"></el-date-picker>
        <el-date-picker
          v-model="createTimeList"
          @change="dateChangebirthday1"
          style="width: 240px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :picker-options="pickerOptions"
        ></el-date-picker>
      </el-form-item>
      <!-- <el-form-item label="是否采样" prop="isSignFor">
                    <el-select style="width:100px" v-model="queryParams.isSignFor" placeholder="是否采样">
@@ -32,33 +59,96 @@
                <el-input v-model="queryParams.proName" placeholder="请输入项目名称" clearable @keyup.enter.native="handleQuery" style="width: 140px;"/>
            </el-form-item> -->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
        <el-button type="primary" icon="el-icon-thumb" size="mini" @click="Confirmreceipt">确认采样</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >查询</el-button
        >
        <el-button
          type="primary"
          icon="el-icon-thumb"
          size="mini"
          @click="Confirmreceipt"
          >确认采样</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
      </el-form-item>
    </el-form>
    <el-radio-group v-model="tjStatus" @input="radioChange" style="margin: 10px 15px">
    <el-row :gutter="10" class="mb8" >
      <el-col :span="10">
        <el-radio-group
      v-model="tjStatus"
      @input="radioChange"
      style="margin: 10px 15px"
    >
      <el-radio-button label="1">未采样</el-radio-button>
      <el-radio-button label="0">已采样</el-radio-button>
    </el-radio-group>
      </el-col >
            <el-col :span="12" v-if="tableList.length > 1 && tjStatus==0">
                <el-button type="primary" plain
                    v-hasPermi="['hosp:detail:add']">合并样本</el-button>
            </el-col>
        </el-row>
    <div style="width: 100%; margin-left: 10px; display: flex">
      <div style="width: 40%; margin-right: 20px">
        <el-table id="ta" v-loading="loading" ref="tb" :data="samplingList" @selection-change="handleSelectionChange"
          border height="520px" :row-class-name="tableRowClassName">
        <el-table
          id="ta"
          v-loading="loading"
          ref="tb"
          :data="samplingList"
          @selection-change="handleSelectionChange"
          border
          height="520px"
          :row-class-name="tableRowClassName"
        >
          <el-table-column type="selection" width="40" align="center" />
          <el-table-column label="体检号" align="center" prop="customer.tjNumber" width="160px" />
          <el-table-column label="姓名" align="center" prop="customer.cusName" width="80px" />
          <el-table-column label="性别" align="center" prop="customer.cusSex" width="60px">
            <template slot-scope="scope">
              <!-- {{scope.row.customer.cusSex}} -->
          <el-table-column
            label="体检号"
            align="center"
            prop="customer.tjNumber"
            width="160px"
          />
          <el-table-column
            label="姓名"
            align="center"
            prop="customer.cusName"
            width="80px"
          />
          <el-table-column
            label="性别"
            align="center"
            prop="customer.cusSex"
            width="60px"
          >
            <!-- <template slot-scope="scope">
              {{ scope.row.customer.cusSex === 0 ? "男" : "女" }}
              <!-- <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.cusSex " /> -->
            </template> -->
              <template slot-scope="scope">
              <span v-if="scope.row.cusSex == '0'">男</span>
              <span v-if="scope.row.cusSex == '1'">女</span>
              <span v-if="scope.row.cusSex == '2'">未知</span>
            </template>
          </el-table-column>
          <el-table-column label="手机号" align="center" prop="customer.cusPhone" width="120px" />
          <el-table-column label="申请时间" align="center" prop="customer.applicationTime" width="210">
          <el-table-column
            label="手机号"
            align="center"
            prop="customer.cusPhone"
            width="120px"
          />
          <el-table-column
            label="申请时间"
            align="center"
            prop="customer.applicationTime"
            width="210"
          >
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.customer.applicationTime) }}</span>
            </template>
@@ -66,8 +156,17 @@
        </el-table>
      </div>
      <div style="width: 50%">
        <el-table v-loading="loading" :data="tableList" :span-method="objectSpanMethod" @selection-change="handleChange"
          border height="520px" ref="tab1" :row-class-name="tableRowClassName">
        <el-table
          v-loading="loading"
          :data="tableList"
          :span-method="objectSpanMethod"
          @selection-change="handleChange"
          border
          height="520px"
          ref="tab1"
          :row-class-name="tableRowClassName"
        >
          <el-table-column type="selection" width="40" align="center" />
          <!--  :selectable="selectEnable" -->
          <!-- <el-table-column label="是否签收" align="center" prop="isSignFor" /> -->
@@ -76,18 +175,29 @@
                    <span>{{ parseTime(scope.row.tjTime, '{y}-{m}-{d}') }}</span>
                </template>
            </el-table-column> -->
          <el-table-column label="标本类型" align="center" prop="specimenType">
          <el-table-column label="标本类型" align="center" prop="specimenType" width="120">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.sys_dict_specimen" :value="scope.row.specimenType" />
              <dict-tag
                :options="dict.type.sys_dict_specimen"
                :value="scope.row.specimenType"
              />
            </template>
          </el-table-column>
          <el-table-column label="项目名称" align="center" prop="proName" />
          <el-table-column label="性别" align="center" prop="proSex" />
          <el-table-column label="空腹" align="center" prop="isEat" />
          <el-table-column label="采样编号" align="center" prop="samplingNumber" />
          <el-table-column label="采样状态" align="center" prop="isSignFor">
          <el-table-column label="性别" align="center" prop="proSex" width="90" />
          <el-table-column label="空腹" align="center" prop="proCheckMethod" width="90" />
          <el-table-column
            label="采样编号"
            align="center"
            prop="samplingNumber"
            :show-overflow-tooltip="true" width="120"
          />
          <el-table-column label="采样状态" align="center" prop="isSignFor" width="90">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.sampling_type" :value="scope.row.isSignFor" />
              <dict-tag
                :options="dict.type.sampling_type"
                :value="scope.row.isSignFor"
              />
            </template>
          </el-table-column>
          <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -113,8 +223,13 @@
      <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :pager-count="5" :current-page.sync="currentPage1" :current-page="page"
                :page-sizes="pageSize" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="total">
            </el-pagination> -->
      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
        @pagination="getList" />
      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
    </div>
    <!-- 添加或修改体检采样管理对话框 -->
@@ -245,6 +360,11 @@
    this.getNowTime();
    this.getList();
  },
  mounted() {
    this.$nextTick(() => {
      this.$refs.inputName.focus();
    });
  },
  methods: {
    handleSizeChange(val) {
      this.size = val;
@@ -285,23 +405,28 @@
      this.queryParams.endTime = this.createTimeList[1];
      getList(this.queryParams).then((response) => {
        if (response.data) {
          this.samplingList = response.data.list;
          if (this.samplingList.length != 0) {
            this.$nextTick(() => {
              this.$refs.tb.toggleRowSelection(this.samplingList[0], true);
            });
           if (response.data.list == null) {
            this.samplingList = [];
            this.tableList = [];
            this.loading = false;
          } else {
            this.$refs.tb.clearSelection();
            this.samplingList = response.data.list;
            this.loading = false;
            if (this.samplingList.length != 0) {
              this.$nextTick(() => {
                this.$refs.tb.toggleRowSelection(this.samplingList[0], true);
              });
            } else {
              this.$refs.tb.clearSelection();
            }
          }
          this.total = response.data.total;
          this.loading = false;
        } else {
          this.samplingList = []
          this.tableList = []
          this.samplingList = [];
          this.tableList = [];
          this.loading = false;
        }
      });
    },
@@ -384,7 +509,7 @@
    // },
    // 确定按钮
    submitForm() { },
    submitForm() {},
    // 确认采样
    Confirmreceipt() {
@@ -400,16 +525,30 @@
      this.loading = true;
      this.queryParams.isSignFor = value;
      getList(this.queryParams).then((response) => {
        this.samplingList = response.data.list;
        if (this.samplingList.length != 0) {
          this.$nextTick(() => {
            this.$refs.tb.toggleRowSelection(this.samplingList[0], true);
          });
        } else {
          this.$refs.tb.clearSelection();
        if (response.data) {
          if (response.data.list == null) {
            this.samplingList = [];
            this.tableList = [];
            this.loading = false;
          } else {
            this.samplingList = response.data.list;
            this.loading = false;
            if (this.samplingList.length != 0) {
              this.$nextTick(() => {
                this.$refs.tb.toggleRowSelection(this.samplingList[0], true);
              });
            } else {
              this.$refs.tb.clearSelection();
            }
          }
          this.total = response.data.total;
          this.loading = false;
        }else{
           this.samplingList= [];
           this.tableList = [];
           this.loading = false;
        }
        this.total = response.data.total;
        this.loading = false;
      });
    },
@@ -435,7 +574,7 @@
    },
    // 导出
    handleExport() { },
    handleExport() {},
  },
};
</script>