| | |
| | | } |
| | | }; |
| | | async function onSearch() { |
| | | loading.value = true; |
| | | const obj = cloneDeep(form); |
| | | obj.tousu = obj.tousu.join(""); |
| | | obj.zhiyi = obj.zhiyi.join(""); |
| | | obj.xingzhengquyu = obj.xingzhengquyu.join(""); |
| | | obj.xingzhengquyu = obj.xingzhengquyu ? obj.xingzhengquyu.join("") : ""; |
| | | loading.value = true; |
| | | const { result } = await zhaobiaoPageOrder(obj); // 这里是返回一维数组结构,前端自行处理成树结构,返回格式要求:唯一id加父节点parentId,parentId取父节点id |
| | | const newData = result.items; |
| | | loading.value = false; |
| | |
| | | } |
| | | |
| | | function openDialog(title = "新增", row?: FormItemProps) { |
| | | console.log(row,'-'); |
| | | |
| | | addDialog({ |
| | | title: `${title}项目`, |
| | | props: { |
| | |
| | | toubiaobaozhengjin: row?.toubiaobaozhengjin ?? null, // 投标保证金(可选) |
| | | lianhetitoubiao: row?.lianhetitoubiao ?? null, // 联合体投标(可选) |
| | | kaibiaofangshi: row?.kaibiaofangshi ?? null, // 开标方式(可选) |
| | | shifoufenbao: row?.shifoufenbao ?? false, // 是否分包(可选) |
| | | shifoutuisongxuanchuan: row?.shifoutuisongxuanchuan ?? true, // 是否推送宣传(可选) |
| | | shifoufenbao: row?.shifoufenbao ?? "false", // 是否分包(可选) |
| | | shifoutuisongxuanchuan: row?.shifoutuisongxuanchuan ?? "true", // 是否推送宣传(可选) |
| | | caigourenmingcheng: row?.caigourenmingcheng ?? null, // 采购人名称(可选) |
| | | xingzhengquyu: row?.xingzhengquyu.split(",") ?? [], // 行政区域(可选) |
| | | xingzhengquyuName: row?.xingzhengquyuName ?? null, // 行政区域名称(可选) |
| | |
| | | draggable: true, |
| | | fullscreen: deviceDetection(), |
| | | fullscreenIcon: true, |
| | | sureBtnLoading: true, |
| | | closeOnClickModal: false, |
| | | contentRenderer: () => h(editForm, { ref: formRef, formInline: null }), |
| | | beforeSure: (done, { options }) => { |
| | | beforeSure: (done, { options, closeLoading }) => { |
| | | const FormRef = formRef.value.getRef(); |
| | | const curData = cloneDeep(options.props.formInline as FormItemProps); |
| | | async function chores() { |
| | |
| | | done(); // 关闭弹框 |
| | | onSearch(); // 刷新表格数据 |
| | | } else { |
| | | closeLoading(); |
| | | message(res.message, { |
| | | type: "error" |
| | | }); |
| | | } |
| | | } |
| | | FormRef.validate(valid => { |
| | | FormRef.validate((valid, obj) => { |
| | | if (valid) { |
| | | console.log("curData", curData); |
| | | // 表单规则校验通过 |
| | | if (title === "新增") { |
| | | // 实际开发先调用新增接口,再进行下面操作 |
| | |
| | | // 实际开发先调用修改接口,再进行下面操作 |
| | | chores(); |
| | | } |
| | | } else { |
| | | closeLoading(); |
| | | const fail = []; |
| | | console.log(obj); |
| | | |
| | | for (const key in obj) { |
| | | fail.push(obj[key][0].message); |
| | | } |
| | | message(fail[0], { |
| | | type: "warning" |
| | | }); |
| | | return false; |
| | | } |
| | | }); |
| | | } |