-
zhangwei
2025-08-11 2293a1b58a3227a4870466e3699b6baf0af29303
src/views/system/aboutItem/utils/hook.tsx
@@ -1,36 +1,14 @@
import dayjs from "dayjs";
// import dayjs from "dayjs";
import editForm from "../form.vue";
import { handleTree } from "@/utils/tree";
import { message } from "@/utils/message";
import { zhaobiaoPageOrder } from "@/api/item/index";
import {
  getCaigoufangshiList,
  getHangyepingmuList,
  getOrderStatusList,
  getRegionList,
  getDaimaleixingList,
  caigourenAdd,
  caigourenUpdate,
  caigourenDelete,
  caigourenBatchDelete
} from "@/api/item/index";
import { usePublicHooks } from "../../hooks";
import { pageCollection } from "@/api/item/aboutitem";
import { addDialog } from "@/components/ReDialog";
import { type Ref, reactive, ref, onMounted, h, computed } from "vue";
import type { FormItemProps } from "./types";
import {
  cloneDeep,
  isAllEmpty,
  deviceDetection,
  getKeyList
} from "@pureadmin/utils";
import { useUserStoreHook } from "@/store/modules/user";
import { cloneDeep, deviceDetection, getKeyList } from "@pureadmin/utils";
import type { PaginationProps } from "@pureadmin/table";
const nowRole = computed(() => {
  return useUserStoreHook().nowRole;
});
const selectedNum = ref(0);
export function useDept(tableRef: Ref) {
@@ -70,39 +48,38 @@
    currentPage: 1,
    background: true
  });
  //获取采购方式
  const getCaigoufangshiListFun = async () => {
    const res = await getCaigoufangshiList();
    state.caigoufangshiList = res.result;
  };
  // //获取采购方式
  // const getCaigoufangshiListFun = async () => {
  //   const res = await getCaigoufangshiList();
  //   state.caigoufangshiList = res.result;
  // };
  //获取行业品目
  const getHangyepingmuListFun = async () => {
    const res = await getHangyepingmuList();
    state.hangyepingmuList = res.result;
  };
  // //获取行业品目
  // const getHangyepingmuListFun = async () => {
  //   const res = await getHangyepingmuList();
  //   state.hangyepingmuList = res.result;
  // };
  //获取项目进度
  const getOrderStatusListFun = async () => {
    const res = await getOrderStatusList();
    state.orderStatusList = res.result;
  };
  // //获取项目进度
  // const getOrderStatusListFun = async () => {
  //   const res = await getOrderStatusList();
  //   state.orderStatusList = res.result;
  // };
  // 获取区域
  const getRegionListFun = async () => {
    const res = await getRegionList();
    state.regionList = res.result;
  };
  // // 获取区域
  // const getRegionListFun = async () => {
  //   const res = await getRegionList();
  //   state.regionList = res.result;
  // };
  // 获取代码类型
  const getDaimaleixingListFun = async () => {
    const res = await getDaimaleixingList();
    state.daimaleixingList = res.result;
  };
  // // 获取代码类型
  // const getDaimaleixingListFun = async () => {
  //   const res = await getDaimaleixingList();
  //   state.daimaleixingList = res.result;
  // };
  const formRef = ref();
  const dataList = ref([]);
  const loading = ref(true);
  const { tagStyle } = usePublicHooks();
  const getOrderStatus = row => {
    const res = state.orderStatusList.find(item => {
      return row.orderStatus == item.status;
@@ -117,128 +94,36 @@
      reserveSelection: true // 数据刷新后保留选项
    },
    {
      label: "采购人",
      label: "报名截止时间",
      prop: "caigourenmingcheng",
      minWidth: 70
    },
    {
      label: "项目名称",
      label: "区域",
      prop: "projectName",
      width: 180,
      align: "left"
    },
    {
      label: "项目进度",
      prop: "orderStatus",
      label: "项目名称",
      prop: "projectName",
      minWidth: 70,
      cellRenderer: ({ row, props }) => getOrderStatus(row)
    },
    {
      label: "报名费",
      label: "项目编号",
      prop: "baomingfei",
      minWidth: 70
    },
    {
      label: "投标保证金",
      prop: "toubiaobaozhengjin",
      minWidth: 70
    },
    {
      label: "中标供应商",
      prop: "zhongbiaoName",
      minWidth: 180
    },
    {
      label: "评审专家",
      prop: "zhuanjiaName",
      minWidth: 70
    },
    {
      label: "质疑",
      prop: "zhiyi",
      minWidth: 100,
      cellRenderer: ({ row, props }) => (
        <span>{row.status === 1 ? "有" : "无"}</span>
      )
    },
    {
      label: "投诉",
      prop: "tousu",
      minWidth: 100,
      cellRenderer: ({ row, props }) => (
        // <el-tag size={props.size} style={tagStyle.value(row.status)}>
        <span>{row.status === 1 ? "有" : "无"}</span>
        // </el-tag>
      )
    },
    {
      label: "操作",
      fixed: "right",
      width: 80,
      slot: "operation"
    }
  ];
  const CGRcolumns: TableColumnList = [
    {
      label: "勾选列", // 如果需要表格多选,此处label必须设置
      type: "selection",
      fixed: "left",
      reserveSelection: true // 数据刷新后保留选项
    },
    {
      label: "代理机构",
      prop: "dailijigoumingcheng",
      minWidth: 70
    },
    {
      label: "项目名称",
      prop: "projectName",
      width: 180,
      align: "left"
    },
    {
      label: "项目进度",
      prop: "orderStatus",
      minWidth: 70,
      cellRenderer: ({ row, props }) => getOrderStatus(row)
    },
    {
      label: "报名费",
      prop: "baomingfei",
      minWidth: 70
    },
    {
      label: "投标保证金",
      prop: "toubiaobaozhengjin",
      minWidth: 70
    },
    {
      label: "中标供应商",
      label: "开标时间",
      prop: "zhongbiaoName",
      minWidth: 180
    },
    {
      label: "评审专家",
      prop: "zhuanjiaName",
      minWidth: 70
    },
    {
      label: "质疑",
      prop: "zhiyi",
      minWidth: 100,
      cellRenderer: ({ row, props }) => (
        <span>{row.status === 1 ? "有" : "无"}</span>
      )
    },
    {
      label: "投诉",
      prop: "tousu",
      minWidth: 100,
      cellRenderer: ({ row, props }) => (
        // <el-tag size={props.size} style={tagStyle.value(row.status)}>
        <span>{row.status === 1 ? "有" : "无"}</span>
        // </el-tag>
      )
    },
    {
      label: "操作",
@@ -306,11 +191,11 @@
  };
  async function onSearch() {
    const obj = cloneDeep(form);
    obj.tousu = obj.tousu.join("");
    obj.zhiyi = obj.zhiyi.join("");
    obj.xingzhengquyu = obj.xingzhengquyu ? obj.xingzhengquyu.join("") : "";
    // obj.tousu = obj.tousu.join("");
    // obj.zhiyi = obj.zhiyi.join("");
    // obj.xingzhengquyu = obj.xingzhengquyu ? obj.xingzhengquyu.join("") : "";
    loading.value = true;
    const { result } = await zhaobiaoPageOrder(obj); // 这里是返回一维数组结构,前端自行处理成树结构,返回格式要求:唯一id加父节点parentId,parentId取父节点id
    const { result } = await pageCollection(obj); // 这里是返回一维数组结构,前端自行处理成树结构,返回格式要求:唯一id加父节点parentId,parentId取父节点id
    const newData = result.items;
    loading.value = false;
    pagination.total = result.total;
@@ -467,7 +352,6 @@
    state,
    loading,
    columns,
    CGRcolumns,
    dataList,
    selectedNum,
    /** 搜索 */