Commit 74184384 authored by 牛虎林's avatar 牛虎林

修复部分bug

parent 04d573d5
......@@ -18,11 +18,13 @@ enum Api {
audit = '/pro/settlement/byId-examine',
//删除列表接口
deleteList = '/pro/settlement/del',
//查询部门列表
getDepartmentList = '/pro/sys/sysDept',
}
export const getSettlementManageList = (params?: ProjectParams) =>
defHttp.post<ProjectParams>({ url: Api.GetList, data: params });
export const addItem = (params?: any) =>
export const addItems = (params?: any) =>
defHttp.post<ProjectModel>({
url: Api.Add,
data: params,
......@@ -75,3 +77,8 @@ export const deleteList = (params?: any) =>
url: Api.deleteList,
params,
});
export const getDepartmentList = () =>
defHttp.post<ProjectModel>({
url: Api.getDepartmentList,
});
......@@ -310,7 +310,7 @@ async function handleNew(info: any) {
}
data.management = management;
//新增接口
if(isUpdate.value){
if(routerId.value){
const res=updateItem(data)
createMessage.success('提交成功!');
router.go(-1)
......
......@@ -4,6 +4,8 @@ import { Switch } from 'ant-design-vue';
import { setRoleStatus } from '@/api/demo/system';
import { useMessage } from '@/hooks/web/useMessage';
type CheckedType = boolean | string | number;
import {getDepartmentList} from '@/api/project/settlementManage';
export const columns: BasicColumn[] = [
{
title: '填报周期',
......@@ -87,6 +89,7 @@ export const searchFormSchema: FormSchema[] = [
label: '',
component: 'Select',
componentProps: {
// options: getDepartment(),
options: [
{ label: '公司名称1', value: '1' },
{ label: '公司名称2', value: '0' },
......@@ -390,3 +393,8 @@ export const formSchema: FormSchema[] = [
colProps: { span: 7, offset: 1 },
},
];
async function getDepartment(){
const data= await getDepartmentList()
console.log("数据仓库")
return data;
}
<template>
<PageWrapper :title="getTitle" :contentBackground="false" headerSticky>
<template #extra>
<a-button type="primary" danger v-if="isUpdate"> 删除 </a-button>
<a-button type="primary" @click="handleSubmit" v-if="isUpdate">提交 </a-button>
<a-button type="default" @click="router.back()"> 返回 </a-button>
<a-button type="success" @click="examine" v-if="statusResult=='0'"> 审核 </a-button>
<!-- <a-button type="success" @click="examine" v-if="isUpdate==false && statusResult !='0'"> 审核 </a-button>-->
</template>
<PageCard v-for="(item, index) in tabsFormSchema" :key="index" :title="item.name">
<template #right>
<a-button
v-if="isUpdate==true"
type="text"
preIcon="ant-design:delete-outlined"
danger
......@@ -41,7 +41,7 @@ import { formSchema } from './data';
import { deepMerge } from '@/utils';
import { useMessage } from '@/hooks/web/useMessage';
import { useDrawer } from '@/components/Drawer';
import {addItem, getItem, updateItem, deleteOne, auditItem} from "@/api/project/settlementManage"
import {addItems, getItem, updateItem, deleteOne, auditItem} from "@/api/project/settlementManage"
import { EditModel } from '@/api/project/model/settlementManageModel';
import { nextTick } from 'vue';
const [registerDrawer, { openDrawer }] = useDrawer();
......@@ -192,7 +192,6 @@ async function handleSuccess(params: any) {
}
async function handleSubmit() {
loading.value = true;
try {
for (let i = 0; i < tabsFormSchema.length; i++) {
let item = tabsFormSchema[i];
const { validate, getFieldsValue } = item.Form[1];
......@@ -205,24 +204,19 @@ async function handleSubmit() {
let res;
if(isUpdate.value){
console.log(formData.value,"数据查看")
res= await updateItem(unref(formData))
}
if(routeId.value) {
res = await updateItem(unref(formData))
}
else {
res = await addItem(unref(formData));
res = await addItems(unref(formData));
}
loading.value = false;
// loading.value = false;
console.log(res);
createMessage.success('提交成功!');
//返回上一页
router.go(-1)
} catch (e) {
// 验证失败或出错,切换到对应标签页
console.log(e);
} finally {
loading.value = false;
}
}
//审核
async function examine(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment