| | |
| | | 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"; |
| | |
| | | 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%", |
| | |
| | | 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); |
| | |
| | | ); |
| | | // 拼接时间戳和随机数 |
| | | return ( |
| | | `${dirPath}${timestamp}_${randomNumber}` + filename.match(/\.[^.]+$/) |
| | | `${dirPath}${filename}${timestamp}_${randomNumber}` + |
| | | filename.match(/\.[^.]+$/) |
| | | ); |
| | | } |
| | | return { |