| | |
| | | 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 { zhaobiaoPageOrder, findWechatOpenId } from "@/api/item/index"; |
| | | |
| | | import { |
| | | getCaigoufangshiList, |
| | |
| | | getOrderStatusList, |
| | | getRegionList, |
| | | getDaimaleixingList, |
| | | addgetcontact, |
| | | caigourenAdd, |
| | | caigourenUpdate, |
| | | caigourenDelete, |
| | | caigourenBatchDelete |
| | | } from "@/api/item/index"; |
| | | import { usePublicHooks } from "../../hooks"; |
| | | // import { usePublicHooks } from "../../hooks"; |
| | | import { addDialog } from "@/components/ReDialog"; |
| | | import { type Ref, reactive, ref, onMounted, h, computed } from "vue"; |
| | | import type { FormItemProps } from "../utils/types"; |
| | | import { |
| | | cloneDeep, |
| | | isAllEmpty, |
| | | deviceDetection, |
| | | getKeyList |
| | | } from "@pureadmin/utils"; |
| | | import { useUserStoreHook } from "@/store/modules/user"; |
| | | import type { FormItemProps } from "./types"; |
| | | import { cloneDeep, deviceDetection, getKeyList } from "@pureadmin/utils"; |
| | | // import { useUserStoreHook } from "@/store/modules/user"; |
| | | import type { PaginationProps } from "@pureadmin/table"; |
| | | import { useUserStoreHook } from "@/store/modules/user"; |
| | | |
| | | const nowRole = computed(() => { |
| | | return useUserStoreHook().nowRole; |
| | | }); |
| | | import pdfPreview from "../../component/pdfPreview.vue"; |
| | | // const nowRole = computed(() => { |
| | | // return useUserStoreHook().nowRole; |
| | | // }); |
| | | const selectedNum = ref(0); |
| | | |
| | | export function useDept(tableRef: Ref) { |
| | | const nowRole = computed(() => { |
| | | return useUserStoreHook().nowRole; |
| | | }); |
| | | const form = reactive({ |
| | | // 新增日期范围,可为 null,类型为数组 |
| | | createDateRange: null, |
| | |
| | | const formRef = ref(); |
| | | const dataList = ref([]); |
| | | const loading = ref(true); |
| | | const { tagStyle } = usePublicHooks(); |
| | | // const { tagStyle } = usePublicHooks(); |
| | | const getOrderStatus = row => { |
| | | const res = state.orderStatusList.find(item => { |
| | | return row.orderStatus == item.status; |
| | | return row.orderStatus == item.value; |
| | | }); |
| | | return res?.label; |
| | | }; |
| | |
| | | label: "项目进度", |
| | | prop: "orderStatus", |
| | | minWidth: 70, |
| | | cellRenderer: ({ row, props }) => getOrderStatus(row) |
| | | cellRenderer: ({ row }) => getOrderStatus(row) |
| | | }, |
| | | { |
| | | label: "报名费", |
| | |
| | | label: "质疑", |
| | | prop: "zhiyi", |
| | | minWidth: 100, |
| | | cellRenderer: ({ row, props }) => ( |
| | | <span>{row.status === 1 ? "有" : "无"}</span> |
| | | ) |
| | | cellRenderer: ({ row }) => <span>{row.status === 1 ? "有" : "无"}</span> |
| | | }, |
| | | { |
| | | label: "投诉", |
| | | prop: "tousu", |
| | | minWidth: 100, |
| | | cellRenderer: ({ row, props }) => ( |
| | | cellRenderer: ({ row }) => ( |
| | | // <el-tag size={props.size} style={tagStyle.value(row.status)}> |
| | | <span>{row.status === 1 ? "有" : "无"}</span> |
| | | // </el-tag> |
| | |
| | | label: "项目进度", |
| | | prop: "orderStatus", |
| | | minWidth: 70, |
| | | cellRenderer: ({ row, props }) => getOrderStatus(row) |
| | | cellRenderer: ({ row }) => getOrderStatus(row) |
| | | }, |
| | | { |
| | | label: "报名费", |
| | |
| | | label: "质疑", |
| | | prop: "zhiyi", |
| | | minWidth: 100, |
| | | cellRenderer: ({ row, props }) => ( |
| | | <span>{row.status === 1 ? "有" : "无"}</span> |
| | | ) |
| | | cellRenderer: ({ row }) => <span>{row.status === 1 ? "有" : "无"}</span> |
| | | }, |
| | | { |
| | | label: "投诉", |
| | | prop: "tousu", |
| | | minWidth: 100, |
| | | cellRenderer: ({ row, props }) => ( |
| | | cellRenderer: ({ row }) => ( |
| | | // <el-tag size={props.size} style={tagStyle.value(row.status)}> |
| | | <span>{row.status === 1 ? "有" : "无"}</span> |
| | | // </el-tag> |
| | |
| | | console.log(`current page: ${val}`); |
| | | } |
| | | |
| | | function resetForm(formEl) { |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | onSearch(); |
| | | function resetForm() { |
| | | // if (!formEl) return; |
| | | // formEl.resetFields(); |
| | | // onSearch(); |
| | | |
| | | addDialog({ |
| | | title: `预览pdf`, |
| | | props: {}, |
| | | width: "60%", |
| | | draggable: true, |
| | | fullscreen: deviceDetection(), |
| | | fullscreenIcon: true, |
| | | sureBtnLoading: true, |
| | | closeOnClickModal: false, |
| | | contentRenderer: () => h(pdfPreview, { ref: formRef, formInline: null }) |
| | | // jsx 语法 (注意在.vue文件启用jsx语法,需要在script开启lang="tsx") |
| | | }); |
| | | } |
| | | const checkboxAsRadio = data => { |
| | | if (data.length > 1) { |
| | |
| | | } |
| | | }; |
| | | async function onSearch() { |
| | | findWechatOpenId(); |
| | | const obj = cloneDeep(form); |
| | | obj.tousu = obj.tousu.join(""); |
| | | obj.zhiyi = obj.zhiyi.join(""); |
| | |
| | | pagination.pageSize = result.pageSize; |
| | | pagination.currentPage = result.page; |
| | | // if (!isAllEmpty(form.name)) { |
| | | // // 前端搜索部门名称 |
| | | // // 前端搜索项目名称 |
| | | // newData = newData.filter(item => item.name.includes(form.name)); |
| | | // } |
| | | // if (!isAllEmpty(form.status)) { |
| | |
| | | } |
| | | |
| | | function formatHigherDeptOptions(treeList) { |
| | | // 根据返回数据的status字段值判断追加是否禁用disabled字段,返回处理后的树结构,用于上级部门级联选择器的展示(实际开发中也是如此,不可能前端需要的每个字段后端都会返回,这时需要前端自行根据后端返回的某些字段做逻辑处理) |
| | | // 根据返回数据的status字段值判断追加是否禁用disabled字段,返回处理后的树结构,用于上级项目级联选择器的展示(实际开发中也是如此,不可能前端需要的每个字段后端都会返回,这时需要前端自行根据后端返回的某些字段做逻辑处理) |
| | | if (!treeList || !treeList.length) return; |
| | | const newTreeList = []; |
| | | for (let i = 0; i < treeList.length; i++) { |
| | |
| | | return newTreeList; |
| | | } |
| | | |
| | | function openDialog(title = "新增", row?: FormItemProps) { |
| | | console.log(row, "-"); |
| | | async function openDialog(title = "新增", row?: FormItemProps) { |
| | | const { result } = title == "新增" ? await addgetcontact() : ""; |
| | | |
| | | addDialog({ |
| | | title: `${title}项目`, |
| | |
| | | baomingfei: row?.baomingfei ?? null, // 报名费(可选) |
| | | toubiaobaozhengjin: row?.toubiaobaozhengjin ?? null, // 投标保证金(可选) |
| | | lianhetitoubiao: row?.lianhetitoubiao ?? null, // 联合体投标(可选) |
| | | kaibiaofangshi: row?.kaibiaofangshi ?? null, // 开标方式(可选) |
| | | kaibiaofangshi: row?.kaibiaofangshi ?? "纸质标", // 开标方式(可选) |
| | | shifoufenbao: row?.shifoufenbao ?? "false", // 是否分包(可选) |
| | | shifoutuisongxuanchuan: row?.shifoutuisongxuanchuan ?? "true", // 是否推送宣传(可选) |
| | | caigourenmingcheng: row?.caigourenmingcheng ?? null, // 采购人名称(可选) |
| | | caigourenmingcheng: |
| | | row?.caigourenmingcheng ?? result?.caigourenmingcheng, // 采购人名称(可选) |
| | | xingzhengquyu: row?.xingzhengquyu.split(",") ?? [], // 行政区域(可选) |
| | | xingzhengquyuName: row?.xingzhengquyuName ?? null, // 行政区域名称(可选) |
| | | jigoudaima: row?.jigoudaima ?? null, // 机构代码(可选) |
| | | jigoudaima: row?.jigoudaima ?? result?.jigoudaima, // 机构代码(可选) |
| | | daimaleixing: row?.daimaleixing ?? null, // 代码类型(可选) |
| | | lianxiren: row?.lianxiren ?? null, // 联系人(可选) |
| | | lianxidianhua: row?.lianxidianhua ?? null, // 联系电话(可选) |
| | | tongxindizhi: row?.tongxindizhi ?? null, // 通信地址(可选) |
| | | dianziyoujian: row?.dianziyoujian ?? null, // 电子邮件(可选) |
| | | xiangmujingbanren: row?.xiangmujingbanren ?? null, // 项目经办人(可选) |
| | | lianxiren: row?.lianxiren ?? result?.lianxiren, // 联系人(可选) |
| | | lianxidianhua: row?.lianxidianhua ?? result?.lianxidianhua, // 联系电话(可选) |
| | | tongxindizhi: row?.tongxindizhi ?? result?.tongxindizhi, // 通信地址(可选) |
| | | dianziyoujian: row?.dianziyoujian ?? result?.dianziyoujian, // 电子邮件(可选) |
| | | xiangmujingbanren: |
| | | row?.xiangmujingbanren ?? result?.xiangmujingbanren, // 项目经办人(可选) |
| | | zhiwu: row?.zhiwu ?? null, // 职务(可选) |
| | | jingbanrendianhua: row?.jingbanrendianhua ?? null, // 经办人电话(可选) |
| | | dailijigoumingcheng: row?.dailijigoumingcheng ?? null, // 代理机构名称(可选) |
| | | dailiLianxiren: row?.dailiLianxiren ?? null, // 代理机构联系人(可选) |
| | | dailiLianxidianhua: row?.dailiLianxidianhua ?? null, // 代理机构联系电话(可选) |
| | | dailiDianziyoujian: row?.dailiDianziyoujian ?? null, // 代理机构电子邮件(可选) |
| | | dailiTongxindizhi: row?.dailiTongxindizhi ?? null, // 代理机构通信地址(可选) |
| | | dailiXiangmujingli: row?.dailiXiangmujingli ?? null, // 代理机构项目经理(可选 |
| | | dailijingliLianxidianhua: row?.dailijingliLianxidianhua ?? null // 代理机构项目经理联系电话(可选) |
| | | dailijigoumingcheng: |
| | | row?.dailijigoumingcheng ?? result?.dailijigoumingcheng, // 代理机构名称(可选) |
| | | dailiLianxiren: row?.dailiLianxiren ?? result?.dailiLianxiren, // 代理机构联系人(可选) |
| | | dailiLianxidianhua: |
| | | row?.dailiLianxidianhua ?? result?.dailiLianxidianhua, // 代理机构联系电话(可选) |
| | | dailiDianziyoujian: |
| | | row?.dailiDianziyoujian ?? result?.dailiDianziyoujian, // 代理机构电子邮件(可选) |
| | | dailiTongxindizhi: |
| | | row?.dailiTongxindizhi ?? result?.dailiTongxindizhi, // 代理机构通信地址(可选) |
| | | dailiXiangmujingli: |
| | | row?.dailiXiangmujingli ?? result?.dailiXiangmujingli, // 代理机构项目经理(可选 |
| | | dailijingliLianxidianhua: |
| | | row?.dailijingliLianxidianhua ?? result?.dailijingliLianxidianhua // 代理机构项目经理联系电话(可选) |
| | | } |
| | | }, |
| | | width: "80%", |
| | |
| | | const FormRef = formRef.value.getRef(); |
| | | const curData = cloneDeep(options.props.formInline as FormItemProps); |
| | | async function chores() { |
| | | message(`您${title}了项目名称为${curData.projectName}的这条数据`, { |
| | | type: "success" |
| | | }); |
| | | // curData.dingbiaoguize = curData.dingbiaoguize.join(""); |
| | | curData.xingzhengquyu = curData.xingzhengquyu.join(","); |
| | | let res; |
| | |
| | | if (res.code == "200") { |
| | | done(); // 关闭弹框 |
| | | onSearch(); // 刷新表格数据 |
| | | message(`您${title}了项目名称为${curData.projectName}的这条数据`, { |
| | | type: "success" |
| | | }); |
| | | } else { |
| | | closeLoading(); |
| | | message(res.message, { |
| | |
| | | onSearch, |
| | | /** 重置 */ |
| | | resetForm, |
| | | /** 新增、修改部门 */ |
| | | /** 新增、修改项目 */ |
| | | openDialog, |
| | | /** 删除部门 */ |
| | | /** 删除项目 */ |
| | | handleDelete, |
| | | handleSelectionChange, |
| | | handleSizeChange, |
| | |
| | | pagination, |
| | | checkboxAsRadio, |
| | | onSelectionCancel, |
| | | onbatchDel |
| | | onbatchDel, |
| | | nowRole |
| | | }; |
| | | } |