zhangwei
2025-08-27 dade6a8b4772abc113383246d05ab59162630e7c
'上传变更公告获取详情与删除'
8个文件已修改
200 ■■■■■ 已修改文件
pnpm-lock.yaml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/item/index.ts 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/types.ts 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/ReDialog/index.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/dept/detail.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/dept/uploadform.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/dept/utils/detail.tsx 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/dept/utils/types.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pnpm-lock.yaml
@@ -123,6 +123,9 @@
      '@types/sortablejs':
        specifier: ^1.15.8
        version: 1.15.8
      '@vitejs/plugin-basic-ssl':
        specifier: ^2.1.0
        version: 2.1.0(vite@6.3.3(@types/node@20.17.30)(jiti@2.4.2)(lightningcss@1.29.2)(sass@1.87.0)(yaml@2.7.1))
      '@vitejs/plugin-vue':
        specifier: ^5.2.3
        version: 5.2.3(vite@6.3.3(@types/node@20.17.30)(jiti@2.4.2)(lightningcss@1.29.2)(sass@1.87.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.3))
@@ -1325,6 +1328,12 @@
  '@typescript-eslint/visitor-keys@8.31.0':
    resolution: {integrity: sha512-QcGHmlRHWOl93o64ZUMNewCdwKGU6WItOU52H0djgNmn1EOrhVudrDzXz4OycCRSCPwFCDrE2iIt5vmuUdHxuQ==}
    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
  '@vitejs/plugin-basic-ssl@2.1.0':
    resolution: {integrity: sha512-dOxxrhgyDIEUADhb/8OlV9JIqYLgos03YorAueTIeOUskLJSEsfwCByjbu98ctXitUN3znXKp0bYD/WHSudCeA==}
    engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
    peerDependencies:
      vite: ^6.0.0 || ^7.0.0
  '@vitejs/plugin-vue-jsx@4.1.2':
    resolution: {integrity: sha512-4Rk0GdE0QCdsIkuMmWeg11gmM4x8UmTnZR/LWPm7QJ7+BsK4tq08udrN0isrrWqz5heFy9HLV/7bOLgFS8hUjA==}
@@ -4755,6 +4764,10 @@
      '@typescript-eslint/types': 8.31.0
      eslint-visitor-keys: 4.2.0
  '@vitejs/plugin-basic-ssl@2.1.0(vite@6.3.3(@types/node@20.17.30)(jiti@2.4.2)(lightningcss@1.29.2)(sass@1.87.0)(yaml@2.7.1))':
    dependencies:
      vite: 6.3.3(@types/node@20.17.30)(jiti@2.4.2)(lightningcss@1.29.2)(sass@1.87.0)(yaml@2.7.1)
  '@vitejs/plugin-vue-jsx@4.1.2(vite@6.3.3(@types/node@20.17.30)(jiti@2.4.2)(lightningcss@1.29.2)(sass@1.87.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.3))':
    dependencies:
      '@babel/core': 7.26.10
src/api/item/index.ts
@@ -6,7 +6,7 @@
import { http } from "@/utils/http";
import { baseUrlApi } from "../util";
import type { Result, PageResult } from "../types";
import type { Result, PageResult, ChangeDetail } from "../types";
// 获取行政区域列表
export const getRegionList = () => {
@@ -203,7 +203,7 @@
  );
};
// 采购代理人发布招标
// 采购代理人发布变更公告
export const changezhaobiao = (data?: object) => {
  return http.request<Result>(
    "post",
@@ -213,3 +213,58 @@
    }
  );
};
// 获取变更公告详情
export const changeDetail = params => {
  return http.request<ChangeDetail>(
    "get",
    baseUrlApi("/api/tenderOrder/changeDetail"),
    {
      params
    }
  );
};
// 采购代理人删除变更公告
export const cHangeDelete = (data?: object) => {
  return http.request<Result>(
    "post",
    baseUrlApi("/api/tenderOrder/cHangeDelete"),
    {
      data
    }
  );
};
// 采购代理人确认供应商已支付报名费
export const querenBaomingfei = (data?: object) => {
  return http.request<Result>(
    "post",
    baseUrlApi("/api/tenderOrder/querenBaomingfei"),
    {
      data
    }
  );
};
// 代理商发布中标文件
export const addZhongbiao = (data?: object) => {
  return http.request<Result>(
    "post",
    baseUrlApi("/api/tenderOrder/addZhongbiao"),
    {
      data
    }
  );
};
// 采购代理人确认供应商已支付代理费
export const querenDailifei = (data?: object) => {
  return http.request<Result>(
    "post",
    baseUrlApi("/api/tenderOrder/querenDailifei"),
    {
      data
    }
  );
};
src/api/types.ts
@@ -1,3 +1,5 @@
import type { TenderInfo } from "@/views/system/dept/utils/types";
export type Result = {
  success: boolean;
  result: Array<any>;
@@ -117,3 +119,10 @@
  code: string | number;
  result: RoleItem[];
};
export type ChangeDetail = {
  message: string;
  success: boolean;
  code: string | number;
  result: TenderInfo;
};
src/components/ReDialog/index.vue
@@ -17,11 +17,56 @@
const sureBtnMap = ref({});
const fullscreen = ref(false);
const isPush = (footerButtons, options) => {
  let arr = [
    {
      label: "取消",
      text: true,
      bg: true,
      btnClick: ({ dialog: { options, index } }) => {
        const done = () => closeDialog(options, index, { command: "cancel" });
        if (options?.beforeCancel && isFunction(options?.beforeCancel)) {
          options.beforeCancel(done, { options, index });
        } else {
          done();
        }
      }
    },
    {
      label: "确定",
      type: "primary",
      text: true,
      bg: true,
      popconfirm: options?.popconfirm,
      btnClick: ({ dialog: { options, index } }) => {
        if (options?.sureBtnLoading) {
          sureBtnMap.value[index] = Object.assign({}, sureBtnMap.value[index], {
            loading: true
          });
        }
        const closeLoading = () => {
          if (options?.sureBtnLoading) {
            sureBtnMap.value[index].loading = false;
          }
        };
        const done = () => {
          closeLoading();
          closeDialog(options, index, { command: "sure" });
        };
        if (options?.beforeSure && isFunction(options?.beforeSure)) {
          options.beforeSure(done, { options, index, closeLoading });
        } else {
          done();
        }
      }
    }
  ];
  return [...footerButtons, ...arr];
};
const footerButtons = computed(() => {
  return (options: DialogOptions) => {
    return options?.footerButtons?.length > 0
      ? options.footerButtons
      ? isPush(options.footerButtons, options)
      : ([
          {
            label: "取消",
src/views/system/dept/detail.vue
@@ -193,7 +193,6 @@
                    </el-button>
                    <el-button
                      v-if="state.nowInfo.zhaobiaowenjian"
                      :disabled="!!state.nowInfo.changeOrder"
                      type="primary"
                      plain
                      size="small"
src/views/system/dept/uploadform.vue
@@ -19,6 +19,8 @@
const props = withDefaults(defineProps<TenderProps>(), {
  formInline: () => ({
    id: "", // 主键Id(必填)
    tenderId: "",
    higherDeptOptions: [],
    projectName: "",
    toubiaoStartDate: "", // 投标报名开始时间(必填,格式:yyyy-MM-dd HH:mm:ss)
    toubiaoEndDate: "", // 投标报名结束时间(必填,格式:yyyy-MM-dd HH:mm:ss)
@@ -26,6 +28,7 @@
    zhaobiaowenjian: "", // 招标文件(必填,长度1-512字符)
    zhaobiaowenjianName: "",
    biangengwenjian: "",
    biangengwenjianName: "",
    fujian: "", // 附件(可选,最大长度512字符,可为空)
    fujianName: "", // 附件(可选,最大长度512字符,可为空)
    kaibiaodidian: "" // 开标地点(必填,长度1-250字符)
@@ -265,7 +268,16 @@
  upload.value!.handleStart(file);
};
defineExpose({ getRef });
onMounted(async () => {});
onMounted(async () => {
  if (props.formInline.biangengwenjianName) {
    validateForm.fileList = [
      {
        name: props.formInline.biangengwenjianName,
        url: props.formInline.biangengwenjian
      }
    ];
  }
});
</script>
<template>
@@ -288,7 +300,7 @@
    </el-row>
    <el-row v-else :gutter="30">
      <div v-if="props.isChange" style="width: 100%">
        <!-- <re-col :value="24" :xs="24" :sm="24">
        <re-col :value="24" :xs="24" :sm="24">
          <el-form-item label="标题" prop="projectName">
            <el-input
              v-model="newFormInline.projectName"
@@ -296,7 +308,7 @@
              placeholder="请输入标题"
            />
          </el-form-item>
        </re-col> -->
        </re-col>
        <re-col :value="24" :xs="24" :sm="24">
          <el-form-item label="变更文件" prop="biangengwenjian">
            <el-upload
src/views/system/dept/utils/detail.tsx
@@ -1,6 +1,6 @@
import tenderForm from "../uploadform.vue";
import { ref, h, reactive } from "vue";
import { addDialog } from "@/components/ReDialog";
import { addDialog, closeDialog } from "@/components/ReDialog";
import type { TenderInfo } from "./types";
import { message } from "@/utils/message";
import { cloneDeep, deviceDetection } from "@pureadmin/utils";
@@ -10,27 +10,35 @@
  fabuzhaobiao,
  changezhaobiao,
  getTenderOrderDetail,
  updateTittle
  updateTittle,
  changeDetail,
  cHangeDelete
} from "@/api/item/index";
const formRef = ref();
export function useDetail() {
  function openUploadDialog(title = "上传", row?: TenderInfo) {
  async function openUploadDialog(title = "上传", row?: TenderInfo) {
    const detail = await changeDetail({ id: row.id });
    if (detail.result) {
      row = detail.result;
    }
    addDialog({
      title: `${title}公告`,
      props: {
        formInline: {
          tenderId: title == "上传变更" ? row?.id : "",
          id: title == "上传" ? row?.id : "",
          id: row?.id ?? "",
          projectName: row?.projectName ?? "",
          toubiaoStartDate: row?.toubiaoStartDate ?? "", //投标报名开始时间
          toubiaoEndDate: row?.toubiaoEndDate ?? "", //投标报名结束时间
          kaibiaoDate: row?.kaibiaoDate ?? "", //开标时间
          biangengwenjian: "", //招标文件
          fujian: row?.fujian ?? "", //附件
          fujianName: row?.fujianName ?? "", //附件
          kaibiaodidian: row?.kaibiaodidian ?? "" //开标地点
          kaibiaodidian: row?.kaibiaodidian ?? "", //开标地点
          biangengwenjian: row?.biangengwenjian ?? "",
          // 变更文件
          biangengwenjianName: row?.biangengwenjianName ?? ""
        }
      },
      width: "30%",
@@ -45,6 +53,33 @@
          formInline: null,
          isChange: title == "上传" ? false : true
        }),
      footerButtons: detail.result
        ? [
            {
              label: "删除",
              type: "danger",
              text: true,
              bg: true,
              popconfirm: { title: "是否确认删除当前变更公告" },
              btnClick: ({ dialog: { options, index }, button }) => {
                console.log(options, index, button);
                cHangeDelete({ id: row?.id }).then(res => {
                  if (res.code == "200") {
                    getTenderOrderDetail({ id: row?.tenderId }).then(res => {
                      state.nowInfo = res.result;
                    });
                    closeDialog(options, index); // 关闭弹框
                  } else {
                    // closeLoading();
                    message(res.message, {
                      type: "error"
                    });
                  }
                });
              }
            }
          ]
        : [],
      beforeSure: (done, { options, closeLoading }) => {
        const FormRef = formRef.value.getRef();
        const curData = cloneDeep(options.props.formInline as TenderInfo);
@@ -210,7 +245,8 @@
    );
    // 拼接时间戳和随机数
    return (
      `${dirPath}${timestamp}_${randomNumber}` + filename.match(/\.[^.]+$/)
      `${dirPath}${filename}${timestamp}_${randomNumber}` +
      filename.match(/\.[^.]+$/)
    );
  }
  return {
src/views/system/dept/utils/types.ts
@@ -39,6 +39,7 @@
interface TenderInfo {
  // 主键Id
  id: string;
  tenderId: string;
  // 投标报名开始时间,格式为yyyy-MM-dd HH:mm:ss
  projectName: string;
  toubiaoStartDate: string;