Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
紫光云
web-project
Commits
156e0307
Commit
156e0307
authored
Oct 25, 2024
by
ccc2wdd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
变更签证,页面重写
parent
7699296d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
265 additions
and
394 deletions
+265
-394
addChangeSignature.vue
src/views/changeSignature/addChangeSignature.vue
+248
-379
changeSignatrue.data.ts
src/views/changeSignature/changeSignatrue.data.ts
+8
-7
index.vue
src/views/changeSignature/index.vue
+9
-8
No files found.
src/views/changeSignature/addChangeSignature.vue
View file @
156e0307
<
template
>
<PageWrapper
:title=
"getTitle"
:contentBackground=
"false"
headerSticky
>
<PageWrapper
:title=
"getTitle"
:loadingRef=
"loadingRef"
loading-tip=
"加载中..."
:contentBackground=
"false"
headerSticky
>
<!-- page页的右上角操作(提交和返回)按钮 -->
<template
#
extra
>
<a-button
type=
"primary"
@
click=
"handleSubmit('0')"
v-if=
"showSubmit"
>
暂存
</a-button>
<a-button
type=
"primary"
@
click=
"handleSubmit('1')"
v-if=
"showSubmit"
>
提交
</a-button>
<a-button
type=
"primary"
v-if=
"!disabled"
:disabled=
"loadingRef"
@
click=
"handleSubmit('0')"
>
暂存
</a-button>
<a-button
type=
"primary"
v-if=
"!disabled"
:disabled=
"loadingRef"
@
click=
"handleSubmit('1')"
>
提交
</a-button>
<a-button
type=
"primary"
@
click=
"history"
v-if=
"historyData"
>
历史记录
</a-button>
<a-button
type=
"default"
@
click=
"router.back()"
>
返回
</a-button>
<!--
<a-button
type=
"success"
@
click=
"examine"
v-if=
"isUpdate == false && routerId >0"
>
审核
</a-button>
-->
<a-button
type=
"default"
@
click=
"router.back()"
>
返回
</a-button>
</
template
>
<!-- page页 -->
<CollapseContainer
v-for=
"(item, index) in tabsFormSchema"
:key=
"index"
>
<CollapseContainer
v-for=
"(item, index) in tabsFormSchema"
:key=
"index"
v-show=
"item.show"
>
<
template
#
title
>
<span
class=
"projectName"
>
{{
item
.
name
}}
</span>
</
template
>
<
template
#
action
>
<a-popconfirm
title=
"是否确认删除"
ok-text=
"确定"
cancel-text=
"取消"
placement=
"left"
<a-button
v-if=
"!disabled"
type=
"text"
preIcon=
"ant-design:delete-outlined"
danger
@
confirm=
"deleteItemPro(index, item)"
><a-button
preIcon=
"ant-design:delete-outlined"
danger
v-if=
"!disabled"
type=
"text"
style=
"color: rgb(239, 124, 124); cursor: pointer"
@
click=
"deleteItemPro(index)"
>
删除项目
</a-button
></a-popconfirm
>
</
template
>
<BasicForm
:loading=
"loading"
@
register=
"item.Form[0]"
/>
<!-- 左上角为项目名 -->
<CollapseContainer
v-for=
"(content,
contentIndex) in item.ContentFormL
ist"
:key=
"
contentIndex
"
v-for=
"(content,
key) in item.l
ist"
:key=
"
key
"
class=
"subCard"
:title=
"'合同:' + contractName[index].contractNameList[contentIndex]"
:title=
"content.name"
v-show=
"content.show"
>
<
template
#
title
>
<span
class=
"contractName"
>
{{
'合同:'
+
contractName
[
index
].
contractNameList
[
contentIndex
]
}}
</span>
<span
class=
"contractName"
>
{{
content
.
name
}}
</span>
</
template
>
<!-- 右上角的删除按钮 -->
<
template
#
action
>
<a-popconfirm
title=
"是否确认删除"
ok-text=
"确定"
cancel-text=
"取消"
placement=
"left"
v-if=
"!disabled"
@
confirm=
"() => deleteItemCon(index, contentIndex)"
>
<a-button
preIcon=
"ant-design:delete-outlined"
danger
v-if=
"!disabled"
type=
"text"
style=
"color: rgb(239, 124, 124); cursor: pointer"
preIcon=
"ant-design:delete-outlined"
danger
@
click=
"deleteItemCon(index, key)"
>
删除合同
</a-button
>
</a-popconfirm>
</
template
>
<BasicForm
:loading=
"loading"
@
register=
"content.
ContentFormList
"
/>
<BasicForm
:loading=
"loading"
@
register=
"content.
form
"
/>
</CollapseContainer>
</CollapseContainer>
<a-button
type=
"dashed"
@
click=
"add"
preIcon=
"ei:plus"
v-if=
"buttonShow"
>
从合同中导入
</a-button
>
<a-button
type=
"dashed"
@
click=
"handleAdd"
class=
"ml-2"
preIcon=
"ei:plus"
v-if=
"buttonShow"
>
新建合同
</a-button
>
<!--导入或新增按钮-->
<a-button
type=
"dashed"
@
click=
"add"
preIcon=
"ei:plus"
v-if=
"!disabled"
>
从合同中导入
</a-button>
<a-button
type=
"dashed"
@
click=
"handleAdd"
class=
"ml-2"
preIcon=
"ei:plus"
v-if=
"!disabled"
>
新建合同
</a-button>
<!-- 新建合同的抽屉-->
<contractDrawer
@
register=
"registerDrawer"
@
success=
"handleSuccess"
/>
<!-- 选择合同导入的弹窗-->
<projectlibraryModel
@
register=
"register"
@
close=
"handleNewData"
/>
<Operations
@
register=
"registerDrawerOperations"
/>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
addItemApi
,
addItemData
,
operateType
}
from
'@/api/operations/operations'
;
//历史记录相关
import
{
operateType
,
addItemApi
,
addItemData
}
from
'@/api/operations/operations'
;
//历史记录
import
Operations
from
'@/components/Operations/Operations.vue'
;
import
{
nextTick
,
onMounted
,
reactive
,
ref
}
from
'vue'
;
import
{
router
}
from
'@/router'
;
import
contractDrawer
from
'@/views/contract/contractDrawer.vue'
;
import
{
unref
,
onMounted
,
ref
,
reactive
,
nextTick
}
from
'vue'
;
import
projectlibraryModel
from
'@/components/ContractModel/Contract.vue'
;
import
{
use
Route
}
from
'vue-rout
er'
;
import
{
use
Drawer
}
from
'@/components/Draw
er'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
BasicForm
,
FormProps
,
useForm
,
UseFormReturnType
}
from
'@/components/Form'
;
import
{
Content
,
formSchema
}
from
'./changeSignatrue.data'
;
import
contractDrawer
from
'@/views/contract/contractDrawer.vue'
;
import
{
BasicForm
,
useForm
,
FormProps
,
UseFormReturnType
}
from
'@/components/Form'
;
// import { formSchema, subFormSchema } from './tableData';
import
{
formSchema
,
subFormSchema
}
from
'./changeSignatrue.data'
;
import
{
deepMerge
}
from
'@/utils'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useDrawer
}
from
'@/components/Drawer'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
{
EditModel
}
from
'@/api/project/model/changeSignatureModel'
;
// import { addItem, updateItem, getItem } from '@/api/project/monthlyPlan';
import
{
addItem
,
getItem
,
updateItem
}
from
'@/api/changeSignatrue/changeSignatrue'
;
import
{
editModel
}
from
'@/api/project/model/changeSignatureModel'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
{
router
}
from
'@/router'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
monthListByMonthYear
}
from
'@/api/project/detail/Amonth'
;
import
{
forEach
}
from
'@/utils/helper/treeHelper'
;
import
CollapseContainer
from
'@/components/Container/src/collapse/CollapseContainer.vue'
;
import
{
Popconfirm
}
from
'ant-design-vue'
;
import
{
subFormSchema
}
from
'@/views/monthlyPlan/monthlyPlanEdit/tableData'
;
import
{
template
}
from
'xe-utils'
;
//历史记录是否可查
const
historyData
=
ref
(
true
);
const
getTitle
=
ref
(
''
);
const
APopconfirm
=
Popconfirm
;
//页面传递过来了的id
const
routeId
=
ref
(
null
);
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
const
[
registerDrawerOperations
,
{
openDrawer
:
openDrawer2
}]
=
useDrawer
();
const
loadingRef
=
ref
(
false
);
const
[
register
,
{
openModal
:
openModal
}]
=
useModal
();
const
{
createMessage
}
=
useMessage
();
const
formData
=
ref
<
EditModel
>
({
management
:
[],
proClosingQuarter
:
undefined
});
const
loadingRef
=
ref
(
false
);
//删除id集合
const
idList
=
ref
([]);
const
contractIdList
=
ref
([]);
//列表对象
const
tabsFormSchema
=
reactive
<
TabsFormType
[]
>
([]);
//获取id
//合同名称
const
contractName
=
ref
([]);
const
contractId
=
ref
([]);
const
isUpdate
=
ref
(
false
);
const
routerId
=
ref
(
null
);
//提交按钮的显示
const
showSubmit
=
ref
(
false
);
// batton 显示
const
buttonShow
=
ref
(
true
);
//表单禁用
const
disabled
=
ref
(
false
);
const
loading
=
ref
(
false
);
const
formData
=
ref
<
editModel
>
({});
const
tenderId
=
ref
<
any
>
(
''
);
const
disabled
=
ref
(
false
);
const
getTitle
=
ref
(
''
);
// 年份 & 季度
const
quarter
=
ref
(
''
);
const
givenYear
=
ref
(
''
);
onMounted
(
async
()
=>
{
loadingRef
.
value
=
true
;
const
route
=
useRoute
();
var
id
=
route
.
query
.
id
;
if
(
id
)
{
routerId
.
value
=
id
;
const
resData
=
await
getItem
({
id
:
id
});
if
(
route
.
query
.
isUpdate
===
'true'
)
{
getTitle
.
value
=
'编辑变更签证'
;
showSubmit
.
value
=
true
;
isUpdate
.
value
=
true
;
const
id
=
route
.
query
.
id
;
// 获取名为id的参数
console
.
log
(
'route'
,
route
);
routeId
.
value
=
id
;
if
(
!
id
)
{
historyData
.
value
=
false
;
formData
.
value
.
quarter
=
route
.
query
.
quarter
;
formData
.
value
.
givenYear
=
route
.
query
.
year
;
quarter
.
value
=
formData
.
value
.
quarter
;
givenYear
.
value
=
formData
.
value
.
givenYear
;
formData
.
value
.
engineerConList
=
[];
isUpdate
.
value
=
false
;
getTitle
.
value
=
'创建变更签证'
;
}
else
{
isUpdate
.
value
=
true
;
tenderId
.
value
=
id
;
disabled
.
value
=
route
.
query
.
disabled
!=
'0'
;
formData
.
value
.
quarter
=
route
.
query
.
quarter
;
formData
.
value
.
givenYear
=
route
.
query
.
givenYear
;
if
(
disabled
.
value
)
{
getTitle
.
value
=
'查看变更签证'
;
buttonShow
.
value
=
false
;
isUpdate
.
value
=
false
;
disabled
.
value
=
true
;
}
else
{
getTitle
.
value
=
'编辑变更签证'
;
}
//定义数据
formData
.
value
.
management
=
[];
for
(
let
i
=
0
;
i
<
resData
.
length
;
i
++
)
{
//构建id集合
const
source
=
resData
[
i
];
let
Name
=
{
//项目id
projectId
:
source
.
projectId
,
//合同名称
contractNameList
:
[],
};
let
res
=
await
getItem
({
fundId
:
id
});
formData
.
value
.
engineerConList
=
[];
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
const
source
=
res
[
i
];
const
item
=
{
name
:
'项目:'
+
source
.
projectName
,
projectId
:
source
.
projectId
,
...
...
@@ -164,76 +157,54 @@
Form
:
useForm
(
Object
.
assign
({
schemas
:
formSchema
,
disabled
},
baseFormConfig
)
as
FormProps
,
),
ContentFormList
:
[],
list
:
[],
show
:
true
,
};
tabsFormSchema
.
push
(
item
);
contentAdd
(
item
.
Form
[
1
],
source
,
source
.
contractList
[
0
].
amountInvested
);
//合同名称集合
let
contractList
=
[];
for
(
let
j
=
0
;
j
<
source
.
contractList
.
length
;
j
++
)
{
const
sourceItem
=
source
.
contractList
[
j
];
console
.
log
(
sourceItem
,
'数据查看'
);
const
contentItem
=
{
ContentFormList
:
useForm
(
Object
.
assign
({
schemas
:
Content
,
disabled
},
baseFormConfig
)
as
FormProps
,
),
};
item
.
ContentFormList
.
push
(
contentItem
);
Name
.
contractNameList
.
push
(
sourceItem
.
contrcatName
);
contentAdd
(
contentItem
.
ContentFormList
[
1
],
sourceItem
,
null
);
const
contract
=
{
contractId
:
sourceItem
.
contractId
,
comtractName
:
sourceItem
.
contrcatName
,
id
:
sourceItem
.
id
,
proChngeVisaQuarterId
:
sourceItem
.
proChngeVisaQuarterId
,
};
contractList
.
push
(
contract
);
contractId
.
value
.
push
(
sourceItem
.
contractId
);
setFormData
(
contentItem
.
ContentFormList
[
1
],
{
contractName
:
sourceItem
.
contrcatName
,
setFormData
(
item
.
Form
[
1
],
source
);
for
(
let
t
=
0
;
t
<
source
.
engineerConList
.
length
;
t
++
)
{
const
content
=
source
.
engineerConList
[
t
];
let
from
=
useForm
(
Object
.
assign
({
schemas
:
subFormSchema
,
disabled
},
baseFormConfig
)
as
FormProps
,
);
item
.
list
.
push
({
contractId
:
content
.
contractId
,
show
:
true
,
name
:
'合同:'
+
content
.
contrcatName
,
form
:
from
,
});
setFormData
(
from
[
1
],
content
);
console
.
log
(
'content'
,
content
);
}
formData
.
value
.
management
.
push
({
projectId
:
source
.
projectId
,
projectName
:
source
.
projectName
,
fundingSource
:
source
.
fundingSource
,
contract
:
contractList
,
});
contractName
.
value
.
push
(
Name
);
console
.
log
(
'tabsFormSchema'
,
tabsFormSchema
);
console
.
log
(
'formData'
,
formData
);
}
}
else
{
historyData
.
value
=
false
;
isUpdate
.
value
=
true
;
showSubmit
.
value
=
true
;
formData
.
value
.
proClosingQuarter
=
{};
formData
.
value
.
proClosingQuarter
.
companyName
=
'sdfh'
;
formData
.
value
.
proClosingQuarter
.
status
=
'0'
;
formData
.
value
.
proClosingQuarter
.
quarter
=
route
.
query
.
quarter
;
formData
.
value
.
proClosingQuarter
.
givenYear
=
route
.
query
.
year
;
formData
.
value
.
proClosingQuarter
.
yearQuarter
=
route
.
query
.
year
+
'年'
+
route
.
query
.
quarter
;
getTitle
.
value
=
'新建变更签证'
;
}
loadingRef
.
value
=
false
;
});
type
TabsFormType
=
{
name
:
string
;
forceRender
?:
boolean
;
projectId
:
string
|
number
;
Form
:
UseFormReturnType
;
ContentFormList
:
Array
<
UseFormReturnType
>
;
list
:
UseFormReturnType
[];
show
?:
boolean
;
projectId
:
string
;
};
//配置
const
baseFormConfig
:
Partial
<
FormProps
>
=
{
showActionButtonGroup
:
false
,
labelWidth
:
10
0
,
labelWidth
:
26
0
,
layout
:
'vertical'
,
};
function
setFormData
(
form
:
any
,
record
:
any
)
{
const
{
setFieldsValue
}
=
form
;
nextTick
(()
=>
{
setFieldsValue
(
record
);
}
);
const
tabsFormSchema
=
reactive
<
TabsFormType
[]
>
([])
;
async
function
add
()
{
openModal
(
);
}
//导入合同的确认
async
function
handleSuccess
(
params
:
any
)
{
handleNew
(
params
);
}
async
function
handleNewData
(
info
:
any
)
{
if
(
info
)
{
info
.
map
((
i
)
=>
{
...
...
@@ -241,127 +212,104 @@
});
}
}
// 构建表单
/* 往表单page页里带入新建合同的数据*/
async
function
handleNew
(
info
:
any
)
{
//判断项目id是否相同
if
(
formData
.
value
.
management
.
some
((
obj
)
=>
obj
.
projectId
===
info
.
projectId
))
{
const
item
=
{
ContentFormList
:
useForm
(
Object
.
assign
({
schemas
:
Content
,
disabled
},
baseFormConfig
)
as
FormProps
,
),
};
console
.
log
(
'item1111111111111111111111'
,
item
);
const
index
=
tabsFormSchema
.
findIndex
((
obj
)
=>
obj
.
projectId
===
info
.
projectId
);
const
contractList
=
formData
.
value
.
management
[
index
].
contract
;
if
(
contractList
.
some
((
obj
)
=>
obj
.
contractId
===
info
.
id
))
{
console
.
log
(
'id相同'
,
contractList
[
index
]);
}
else
{
for
(
let
i
=
0
;
i
<
contractList
.
length
;
i
++
)
{
if
(
contractList
[
i
].
contractId
!==
info
.
id
)
{
console
.
log
(
'id不相同'
,
contractList
[
i
]);
contractName
.
value
[
index
].
contractNameList
.
push
(
info
.
contrcatName
);
tabsFormSchema
[
index
].
ContentFormList
.
push
(
item
);
if
(
isUpdate
.
value
)
{
formData
.
value
.
management
[
index
].
contract
.
push
({
contractId
:
info
.
id
,
proChngeVisaQuarterId
:
routerId
.
value
,
});
}
else
{
formData
.
value
.
management
[
index
].
contract
.
push
({
let
item
=
{};
let
res
=
tabsFormSchema
.
filter
((
item
)
=>
item
.
projectId
==
info
.
projectId
);
if
(
res
.
length
)
{
item
=
res
[
0
];
let
from
=
useForm
(
Object
.
assign
({
schemas
:
subFormSchema
},
baseFormConfig
)
as
FormProps
);
item
.
list
.
push
({
show
:
true
,
contractId
:
info
.
id
,
name
:
'合同:'
+
info
.
contrcatName
,
form
:
from
,
});
}
break
;
}
}
}
setFormData
(
item
.
ContentFormList
[
1
],
{
let
index
=
tabsFormSchema
.
findIndex
((
item
)
=>
item
.
projectId
==
info
.
projectId
);
setFormData
(
from
[
1
],
{
contractName
:
info
.
contrcatName
,
// collectingUnit: info.collectingUnit,
contractAmount
:
info
.
contractAmount
,
// investmentAmount: info.investmentAmount,
});
}
else
{
const
contentItem
=
{
ContentFormList
:
useForm
(
Object
.
assign
({
schemas
:
Content
,
disabled
},
baseFormConfig
)
as
FormProps
,
),
};
//合同名称集合
const
contractNameList
=
[];
console
.
log
(
'合同名称'
,
info
);
contractNameList
.
push
(
info
.
contrcatName
);
//构建合同名称
let
Name
=
{
//项目id
projectId
:
info
.
projectId
,
//合同名称
contractNameList
:
contractNameList
,
};
contractName
.
value
.
push
(
Name
);
const
list
=
[];
list
.
push
(
contentItem
);
const
item
=
{
item
=
{
name
:
'项目:'
+
info
.
projectName
,
projectId
:
info
.
projectId
,
forceRender
:
true
,
Form
:
useForm
(
Object
.
assign
({
schemas
:
formSchema
,
disabled
},
baseFormConfig
)
as
FormProps
,
),
ContentFormList
:
list
,
Form
:
useForm
(
Object
.
assign
({
schemas
:
formSchema
},
baseFormConfig
)
as
FormProps
),
list
:
[],
show
:
true
,
};
const
{
setFieldsValue
}
=
item
.
Form
[
1
];
tabsFormSchema
.
push
(
item
);
const
contractList
=
[];
const
contract
=
{
item
.
list
.
push
({
show
:
true
,
name
:
'合同:'
+
info
.
contrcatName
,
form
:
useForm
(
Object
.
assign
({
schemas
:
subFormSchema
},
baseFormConfig
)
as
FormProps
),
contractId
:
info
.
id
,
//合同名称
proChngeVisaQuarterId
:
null
,
};
if
(
isUpdate
.
value
)
{
//proChngeVisaQuarterId
contract
.
proChngeVisaQuarterId
=
parseInt
(
routerId
.
value
);
}
contractList
.
push
(
contract
);
formData
.
value
.
management
.
push
({
});
tabsFormSchema
.
push
(
item
);
setFormData
(
item
.
Form
[
1
],
{
projectId
:
info
.
projectId
,
projectName
:
info
.
projectName
,
fundingSource
:
info
.
fundingSource
,
contract
:
contractList
,
});
nextTick
(()
=>
{
setFieldsValue
({
projectName
:
info
.
projec
tName
,
fundingSource
:
info
.
fundingSource
,
setFormData
(
item
.
list
[
0
].
form
[
1
],
{
contractId
:
info
.
id
,
contractName
:
info
.
contrca
tName
,
contractAmount
:
info
.
contractAmount
,
});
}
}
function
setFormData
(
form
:
any
,
record
:
any
)
{
const
{
setFieldsValue
}
=
form
;
nextTick
(()
=>
{
setFieldsValue
(
record
);
});
setFormData
(
contentItem
.
ContentFormList
[
1
],
{
contractName
:
info
.
contrcatName
,
}
/*新建合同*/
async
function
handleAdd
()
{
openDrawer
(
true
,
{
isUpdate
:
false
,
});
}
/*删除合同表单*/
async
function
deleteItemCon
(
index
:
any
,
key
:
any
)
{
// delete formData.value.engineerConList[index].conList[key];
tabsFormSchema
[
index
].
list
[
key
].
show
=
false
;
loadingRef
.
value
=
false
;
}
/*删除项目表单*/
async
function
deleteItemPro
(
index
:
any
)
{
// delete formData.value.engineerConList[index];
tabsFormSchema
[
index
].
show
=
false
;
loadingRef
.
value
=
false
;
// }
}
/*获取表单数据(用于提交表单用)*/
async
function
getFormData
(
form
:
any
)
{
const
{
validate
,
getFieldsValue
}
=
form
;
await
validate
();
let
res
=
getFieldsValue
();
return
res
;
}
/
/提交
/
*提交表单*/
async
function
handleSubmit
(
isSubmit
)
{
for
(
let
i
=
0
;
i
<
tabsFormSchema
.
length
;
i
++
)
{
let
formProjectSchema
=
tabsFormSchema
[
i
].
Form
[
1
];
const
{
updateSchema
}
=
formProjectSchema
;
if
(
isSubmit
==
=
'0'
)
{
if
(
isSubmit
==
'0'
||
tabsFormSchema
[
i
].
show
==
false
)
{
updateSchema
([
{
field
:
'projectName'
,
required
:
false
},
{
field
:
'fundingSource'
,
required
:
false
},
{
field
:
'amountInvested'
,
required
:
false
},
]);
}
else
{
updateSchema
([
{
field
:
'projectName'
,
required
:
true
},
{
field
:
'fundingSource'
,
required
:
true
},
{
field
:
'amountInvested'
,
required
:
true
},
]);
}
for
(
let
j
=
0
;
j
<
tabsFormSchema
[
i
].
ContentFormList
.
length
;
j
++
)
{
let
formSchema
=
tabsFormSchema
[
i
].
ContentFormList
[
j
].
ContentFormList
[
1
];
for
(
let
j
=
0
;
j
<
tabsFormSchema
[
i
].
list
.
length
;
j
++
)
{
let
formSchema
=
tabsFormSchema
[
i
].
list
[
j
].
form
[
1
];
const
{
updateSchema
}
=
formSchema
;
nextTick
(()
=>
{
if
(
isSubmit
==
=
'0'
)
{
if
(
isSubmit
==
'0'
||
tabsFormSchema
[
i
].
show
==
false
)
{
updateSchema
([
{
field
:
'contractName'
,
required
:
false
},
{
field
:
'biddingMethod'
,
required
:
false
},
...
...
@@ -384,12 +332,7 @@
{
field
:
'visaAmount'
,
required
:
false
},
{
field
:
'estimatedAmountRatio'
,
required
:
false
},
{
field
:
'meetingMinutes'
,
required
:
false
},
{
field
:
'remark'
,
dynamicRules
:
({
values
})
=>
{
return
[{
required
:
false
}];
},
},
{
field
:
'remark'
,
required
:
false
},
]);
}
else
{
updateSchema
([
...
...
@@ -417,139 +360,65 @@
});
}
}
//构建数据
const
data
=
{
management
:
[],
id
:
routerId
.
value
,
idList
:
idList
.
value
,
contractIdList
:
contractIdList
.
value
,
proClosingQuarter
:
formData
.
value
.
proClosingQuarter
,
isSubmit
:
isSubmit
,
};
const
management
=
[];
loadingRef
.
value
=
true
;
console
.
log
(
'表单'
,
tabsFormSchema
);
formData
.
value
.
engineerConList
=
[];
try
{
let
engineerConListIndex
=
0
;
for
(
let
i
=
0
;
i
<
tabsFormSchema
.
length
;
i
++
)
{
//数据构建
const
contrantData
=
{
projectId
:
''
,
contractList
:
[],
};
let
item
=
tabsFormSchema
[
i
];
const
{
validate
}
=
item
.
Form
[
1
];
await
validate
();
await
handleNewContent
(
item
.
Form
[
1
]);
const
{
getFieldsValue
}
=
item
.
Form
[
1
];
contrantData
.
projectId
=
tabsFormSchema
[
i
].
projectId
;
var
projectInvoice
=
getFieldsValue
().
amountInvested
;
for
(
let
j
=
0
;
j
<
item
.
ContentFormList
.
length
;
j
++
)
{
let
content
=
item
.
ContentFormList
[
j
];
const
{
getFieldsValue
}
=
content
.
ContentFormList
[
1
];
await
handleNewContent
(
content
.
ContentFormList
[
1
]);
let
res
=
getFieldsValue
();
if
(
!
isUpdate
.
value
)
{
let
itemConetnt
=
Object
.
assign
(
res
,
{
amountInvested
:
projectInvoice
,
contractId
:
formData
.
value
.
management
[
i
].
contract
[
j
].
contractId
,
});
contrantData
.
contractList
.
push
(
itemConetnt
);
}
else
{
let
itemConetnt
=
Object
.
assign
(
res
,
{
id
:
formData
.
value
.
management
[
i
].
contract
[
j
].
id
,
amountInvested
:
projectInvoice
,
contractId
:
formData
.
value
.
management
[
i
].
contract
[
j
].
contractId
,
proChngeVisaQuarterId
:
formData
.
value
.
management
[
i
].
contract
[
j
].
proChngeVisaQuarterId
,
});
contrantData
.
contractList
.
push
(
itemConetnt
);
if
(
item
.
show
)
{
let
res
=
await
getFormData
(
item
.
Form
[
1
]);
let
obj
=
{
projectId
:
item
.
projectId
,
conList
:
[],
};
obj
=
deepMerge
(
obj
,
res
);
formData
.
value
.
engineerConList
.
push
(
obj
);
console
.
log
(
'项目'
,
formData
.
value
.
engineerConList
);
for
(
let
t
=
0
;
t
<
item
.
list
.
length
;
t
++
)
{
let
content
=
tabsFormSchema
[
i
].
list
[
t
];
if
(
content
.
show
)
{
let
objCon
=
{
contractId
:
content
.
contractId
,
};
let
contentRes
=
await
getFormData
(
content
.
form
[
1
]);
objCon
=
deepMerge
(
objCon
,
contentRes
);
console
.
log
(
'表格'
,
formData
.
value
.
engineerConList
);
console
.
log
(
'索引'
,
engineerConListIndex
);
formData
.
value
.
engineerConList
[
engineerConListIndex
].
conList
.
push
(
objCon
);
}
}
management
.
push
(
contrantData
)
;
engineerConListIndex
=
engineerConListIndex
+
1
;
}
data
.
management
=
management
;
if
(
routerId
.
value
)
{
const
res
=
updateItem
(
data
);
addItemData
.
operateType
=
operateType
.
update
;
addItemData
.
businessId
=
routerId
.
value
;
addItemData
.
businessType
=
'变更签证管理'
;
const
showDatem
=
await
addItemApi
(
addItemData
);
if
(
isSubmit
===
'0'
){
createMessage
.
success
(
'暂存成功!'
);
}
else
{
createMessage
.
success
(
'提交成功!'
);
}
// router.go(-1);
}
else
{
const
res
=
await
addItem
(
data
);
console
.
log
(
'res'
,
res
)
addItemData
.
operateType
=
operateType
.
add
;
addItemData
.
businessId
=
res
;
formData
.
value
.
proNumber
=
formData
.
value
.
engineerConList
.
length
;
formData
.
value
.
fundId
=
tenderId
.
value
;
formData
.
value
.
isSubmit
=
isSubmit
;
console
.
log
(
'最后的结果'
,
formData
.
value
);
isUpdate
.
value
?
await
updateItem
(
unref
(
formData
))
:
await
addItem
(
unref
(
formData
));
addItemData
.
operateType
=
operateType
.
update
;
addItemData
.
businessId
=
routeId
.
value
;
addItemData
.
businessType
=
'变更签证管理'
;
const
showDatem
=
await
addItemApi
(
addItemData
);
if
(
isSubmit
===
'0'
){
createMessage
.
success
(
'暂存成功!'
);
}
else
{
createMessage
.
success
(
'提交成功!'
);
}
// router.go(-1);
}
}
async
function
add
()
{
openModal
(
true
,
{
isContent
:
true
,
});
}
function
contentAdd
(
contentItem
,
sourceItem
,
amountInvested
)
{
console
.
log
(
'contentItem'
,
contentItem
,
'sourceItem'
,
sourceItem
);
const
{
setFieldsValue
}
=
contentItem
;
if
(
amountInvested
)
{
sourceItem
=
Object
.
assign
(
sourceItem
,
{
amountInvested
:
amountInvested
});
}
nextTick
(()
=>
{
setFieldsValue
({
...
sourceItem
,
});
});
}
await
addItemApi
(
addItemData
);
loadingRef
.
value
=
true
;
/*删除合同表单*/
async
function
deleteItemCon
(
index
:
any
,
key
:
any
)
{
contractName
.
value
[
index
].
contractNameList
.
splice
(
key
,
1
);
contractIdList
.
value
.
push
(
contractId
.
value
[
key
]);
contractId
.
value
.
splice
(
key
,
1
);
formData
.
value
.
management
[
index
].
contract
.
splice
(
key
,
1
);
tabsFormSchema
[
index
].
ContentFormList
.
splice
(
key
,
1
);
loadingRef
.
value
=
false
;
// }
createMessage
.
success
(
'提交成功!'
);
}
catch
(
e
)
{
if
(
e
.
values
.
projectName
)
{
createMessage
.
error
(
'请将项目'
+
e
.
values
.
projectName
+
'信息填写完整!'
);
}
else
{
createMessage
.
error
(
'请将合同'
+
e
.
values
.
contrcatName
+
'信息填写完整!'
);
}
/*删除项目表单*/
async
function
deleteItemPro
(
index
:
any
,
item
)
{
idList
.
value
.
push
(
item
.
projectId
);
formData
.
value
.
management
.
splice
(
index
,
1
);
tabsFormSchema
.
splice
(
index
,
1
);
contractName
.
value
.
splice
(
index
,
1
);
}
finally
{
loadingRef
.
value
=
false
;
// }
}
async
function
handleAdd
()
{
openDrawer
(
true
,
{
isUpdate
:
false
,
});
}
// 校验方法
function
handleNewContent
(
params
)
{
const
{
validate
}
=
params
;
return
validate
();
}
async
function
handleSuccess
(
params
:
any
)
{
handleNew
(
params
);
}
function
history
()
{
openDrawer2
(
true
,
{
businessId
:
route
r
Id
.
value
,
businessId
:
routeId
.
value
,
businessType
:
'变更签证管理'
,
});
console
.
log
(
'历史记录'
);
...
...
src/views/changeSignature/changeSignatrue.data.ts
View file @
156e0307
...
...
@@ -52,7 +52,7 @@ export const searchFormSchema: FormSchema[] = [
label
:
''
,
component
:
'DatePicker'
,
componentProps
:
{
placeholder
:
'
选择填报周期
'
,
placeholder
:
'
年份
'
,
picker
:
'year'
,
style
:
{
width
:
'100%'
},
valueFormat
:
'YYYY'
,
...
...
@@ -97,7 +97,7 @@ export const searchFormSchema: FormSchema[] = [
colProps
:
{
span
:
4
},
},
];
// 前半部分
export
const
formSchema
:
FormSchema
[]
=
[
{
field
:
'projectName'
,
...
...
@@ -134,7 +134,8 @@ export const formSchema: FormSchema[] = [
colProps
:
{
span
:
7
,
offset
:
1
},
},
];
export
const
Content
:
FormSchema
[]
=
[
// 后半部分
export
const
subFormSchema
:
FormSchema
[]
=
[
{
field
:
'contractName'
,
label
:
' 合同名称'
,
...
...
@@ -213,7 +214,7 @@ export const Content: FormSchema[] = [
required
:
true
,
component
:
'InputNumber'
,
componentProps
:
({
formModel
,
formActionType
})
=>
({
addonAfter
:
'元'
,
addonAfter
:
'
万
元'
,
onChange
:
(
value
)
=>
{
formModel
.
contractAmount
=
value
;
updateAmountRatio
(
formModel
,
formActionType
);
...
...
@@ -230,7 +231,7 @@ export const Content: FormSchema[] = [
required
:
true
,
component
:
'InputNumber'
,
componentProps
:
({
formModel
,
formActionType
})
=>
({
addonAfter
:
'元'
,
addonAfter
:
'
万
元'
,
onChange
:
(
value
)
=>
{
formModel
.
changeAmount
=
value
;
updateAmountRatio
(
formModel
,
formActionType
);
...
...
@@ -293,7 +294,7 @@ export const Content: FormSchema[] = [
required
:
true
,
component
:
'InputNumber'
,
componentProps
:
({
formModel
,
formActionType
})
=>
({
addonAfter
:
'元'
,
addonAfter
:
'
万
元'
,
onChange
:
(
value
)
=>
{
formModel
.
updateAmount
=
value
;
updateContractValueRatio
(
formModel
,
formActionType
);
...
...
@@ -341,7 +342,7 @@ export const Content: FormSchema[] = [
required
:
true
,
component
:
'InputNumber'
,
componentProps
:
({
formModel
,
formActionType
})
=>
({
addonAfter
:
'元'
,
addonAfter
:
'
万
元'
,
onChange
:
(
value
)
=>
{
formModel
.
visaAmount
=
value
;
updateEstimatedAmountRatio
(
formModel
,
formActionType
);
...
...
src/views/changeSignature/index.vue
View file @
156e0307
...
...
@@ -19,7 +19,7 @@
:actions=
"[
{
label: '修改',
onClick: handleEdit.bind(null, record,
true
),
onClick: handleEdit.bind(null, record,
0
),
},
{
label: '审核',
...
...
@@ -49,11 +49,11 @@
:actions=
"[
{
label: '修改',
onClick: handleEdit.bind(null, record,
true
),
onClick: handleEdit.bind(null, record,
0
),
},
{
label: '详情',
onClick: handleEdit.bind(null, record,
false
),
onClick: handleEdit.bind(null, record,
1
),
},
{
label: '删除',
...
...
@@ -89,7 +89,7 @@
import
{
getDepartmentList
}
from
'@/api/project/settlementManage'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
yearModal
from
'@/components/yearModal/yearModal.vue'
;
import
{
useUserStore
}
from
"@/store/modules/user"
;
import
{
useUserStore
}
from
'@/store/modules/user'
;
const
{
createMessage
}
=
useMessage
();
const
{
push
}
=
useRouter
();
...
...
@@ -125,7 +125,7 @@
}
});
const
data
=
await
getDepartmentList
();
console
.
log
(
'data'
,
data
)
console
.
log
(
'data'
,
data
);
searchFormSchema
[
2
].
componentProps
.
options
=
data
;
});
...
...
@@ -143,13 +143,14 @@
};
//修改
function
handleEdit
(
record
:
Recordable
,
isUpdate
:
boolean
)
{
function
handleEdit
(
record
:
Recordable
,
disabled
:
number
)
{
push
({
path
:
'/changeSignature/edit'
,
query
:
{
id
:
record
.
id
,
statusResult
:
record
.
statusResult
,
isUpdate
:
isUpdate
,
givenYear
:
record
.
givenYear
,
quarter
:
record
.
quarter
,
disabled
:
String
(
disabled
),
},
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment