1
wwl
2025-02-10 f16661eac2b18c83040321f0654abd8bb559f3e1
1
1个文件已修改
55 ■■■■■ 已修改文件
src/views/sampling/sampling/index.vue 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sampling/sampling/index.vue
@@ -14,7 +14,7 @@
          format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" type="daterange" range-separator="-"
          start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions"></el-date-picker>
      </el-form-item>
      <el-form-item label="单位名称" prop="tjCompName" style="margin-left: 20px; margin-right: 500px">
      <el-form-item label="单位名称" prop="compName" style="margin-left: 20px; margin-right: 500px">
        <el-select :remote-method="getRemoteData" v-model="queryParams.tjCompName" value-key="drugManufacturerId"
          style="width: 200px" remote filterable placeholder="请选择单位名称" clearable @change="searchSelect">
          <el-option v-for="dict in CompanyList" :key="dict.drugManufacturerId" :label="dict.cnName" :value="dict" />
@@ -95,7 +95,7 @@
            </template>
          </el-table-column>
          <el-table-column label="手机号" align="center" prop="cusPhone" width="120px" />
          <el-table-column label="单位名称" align="center" prop="firmName" width="120px" />
          <el-table-column label="单位名称" align="center" prop="compName" width="120px" />
          <el-table-column label="申请时间" align="center" prop="applicationTime" width="210">
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.applicationTime) }}</span>
@@ -378,7 +378,7 @@
    // 选框数据
    searchSelect(val) {
      this.CheckBox = val;
      this.queryParams.dw = this.CheckBox.cnName;
      this.queryParams.dw = this.CheckBox.drugManufacturerId;
      console.log(this.CheckBox, 9999);
    },
    getRemoteData(query) {
@@ -393,27 +393,40 @@
      }
    },
    async piliangPrint() {
      for (const item of this.piliangList) {
        try {
          // 获取数据,并等待数据更新完成
          const tableList = await this.fetchData(item.tjNumber);
      const loadingInstance = this.$loading({
        lock: true,
        text: '打印中...',
        spinner: 'el-icon-loading',
        background: 'rgba(255, 255, 255, 0.7)'
      });
          // 只保留最新两个元素
          if (tableList.length > 0) {
            this.selectList = tableList.slice(0, 2);
          } else {
            this.selectList = []; // 如果没有数据,清空selectList
      try {
        for (const item of this.piliangList) {
          try {
            // 获取数据,并等待数据更新完成
            const tableList = await this.fetchData(item.tjNumber);
            // 只保留最新两个元素
            if (tableList.length > 0) {
              this.selectList = tableList.slice(0, 2);
            } else {
              this.selectList = []; // 如果没有数据,清空selectList
            }
            // 使用更新后的tableList获取ids
            let ids = this.selectList.map(row => row.id);
            await this.Confirmreceipt1(ids);
            // 等待一段时间
            await new Promise(resolve => setTimeout(resolve, 5000));
          } catch (error) {
            console.error(`处理体检号 ${item.tjNumber} 时出错:`, error);
          }
          // 使用更新后的tableList获取ids
          let ids = this.selectList.map(row => row.id);
          await this.Confirmreceipt1(ids);
          // 等待一段时间
          await new Promise(resolve => setTimeout(resolve, 5000));
        } catch (error) {
          console.error(`处理体检号 ${item.tjNumber} 时出错:`, error);
        }
      } finally {
        this.ids = []; // 清空ids
        this.selectList = []; // 清空selectList
        loadingInstance.close();
      }
    },
    getTruncatedName(proName) {