lkk
2025-04-21 088e45c9ee4633e543247ecf8675215e2119ac7d
src/views/hosp/order/index.vue
@@ -161,12 +161,23 @@
    </div>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
      <!-- <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
           :disabled="singles"
          v-hasPermi="['hosp:order:export']"
          >导出</el-button
        >
      </el-col> -->
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-download"
          size="mini"
          @click="exportDialogVisible = true"
          v-hasPermi="['hosp:order:export']"
          >导出</el-button
        >
@@ -178,7 +189,7 @@
          size="mini"
          @click="handleRevoke"
          :loading="isLoading"
          :disabled="single"
          :disabled="singles"
          >撤销签到</el-button
        >
      </el-col>
@@ -1536,6 +1547,21 @@
        <!-- <el-button @click="cancel">取 消</el-button> -->
      </div>
    </el-dialog>
    <el-dialog
      title="请选择导出范围"
      :visible.sync="exportDialogVisible"
      width="30%"
    >
      <el-radio-group v-model="exportType">
        <el-radio :label="'0'">当前页数据</el-radio>
        <el-radio :label="'1'">全部数据</el-radio>
      </el-radio-group>
      <span slot="footer" class="dialog-footer">
        <el-button @click="exportDialogVisible = false">取消</el-button>
        <el-button type="primary" @click="confirmExport">确定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
@@ -1666,6 +1692,7 @@
      dataObj: {},
      // 非单个禁用
      single: true,
      singles: false,
      activeNames: "first",
      // 非多个禁用
      multiple: true,
@@ -1686,6 +1713,8 @@
      // 日期范围
      datetimerange: [],
      marryalls: 0,
      exportDialogVisible: false, // 控制弹框
      exportType: "0", // dqyorqbsj 的值,默认当前页
      // 查询参数
      queryParams: {
        pageNum: 1,
@@ -2257,6 +2286,7 @@
      this.ids = selection.map((item) => item.orderId);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
      this.singles = selection.length !== 1;
      if (tjNUms.length > 0) {
        shijianzhou(tjNUms).then((res) => {
          this.shijianlist = res.data;
@@ -3114,16 +3144,49 @@
          this.Projectssopen = false;
        });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.$confirm("请选择导出范围", "导出数据", {
        distinguishCancelAndClose: true,
        confirmButtonText: "导出全部",
        cancelButtonText: "仅导出当前页",
        type: "warning",
      })
        .then(() => {
          // 用户点击了“导出全部”
          this.exportData(true);
        })
        .catch((action) => {
          if (action === "cancel") {
            // 用户点击了“仅导出当前页”
            this.exportData(false);
          }
        });
    },
    /** 导出按钮操作 */
    /*  handleExport() {
      console.log(this.queryParams);
      this.download(
        "hosp/order/export",
        "/hosp/order/exportOrderList",
        {
          ...this.queryParams,
        },
        `order_${new Date().getTime()}.xlsx`
      );
    }, */
    confirmExport() {
      this.exportDialogVisible = false;
      const exportParams = {
        ...this.queryParams,
        dqyorqbsj: this.exportType, // 添加这个字段
      };
      this.download(
        "/hosp/order/exportOrderList",
        exportParams,
        `order_${new Date().getTime()}.xlsx`
      );
    },
  },
};