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
a3548d31
Commit
a3548d31
authored
Jun 05, 2024
by
jiaxu.yan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat : 完善添加计划页面
parent
d280a31d
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
212 additions
and
74 deletions
+212
-74
biddingPlan.ts
src/api/project/biddingPlan.ts
+25
-11
biddingPlanModel.ts
src/api/project/model/biddingPlanModel.ts
+34
-26
PageCard.vue
src/components/Page/src/PageCard.vue
+9
-3
projectlibraryModel.vue
src/components/projectlibraryModel/projectlibraryModel.vue
+7
-3
yearModal.vue
src/components/yearModal.vue
+1
-1
biddingPlan.data.ts
src/views/biddingPlan/biddingPlan.data.ts
+29
-16
biddingPlanEdit.vue
src/views/biddingPlan/biddingPlanEdit.vue
+103
-11
TabsForm.vue
src/views/demo/form/TabsForm.vue
+2
-2
index.vue
src/views/project/index.vue
+1
-0
projectDrawer.vue
src/views/project/projectDrawer.vue
+1
-1
No files found.
src/api/project/biddingPlan.ts
View file @
a3548d31
import
{
ProjectPageParams
,
ProjectListGetResultModel
,
ProjectModel
,
}
from
'./model/biddingPlanModel'
;
import
{
ProjectPageParams
,
ListGetResultModel
,
ProjectModel
}
from
'./model/biddingPlanModel'
;
import
{
defHttp
}
from
'@/utils/http/axios'
;
enum
Api
{
GetList
=
'/mgapi/project/project/list/page'
,
AddProject
=
'/mgapi/project/projectManage/add'
,
UpdateProject
=
'/mgapi/project/projectManage/update'
,
GetList
=
'/pro/tendePlan/list/page'
,
AddProject
=
'/pro/tendePlan/add'
,
UpdateProject
=
'/pro/tendePlan/update'
,
DeleteProject
=
'/pro/tenderPlan/del'
,
ProjectDetail
=
'/pro/tendePlan/details'
,
}
export
const
getListByPage
=
(
params
?:
ProjectPageParams
)
=>
defHttp
.
post
<
Project
ListGetResultModel
>
({
url
:
Api
.
GetList
,
data
:
params
});
defHttp
.
post
<
ListGetResultModel
>
({
url
:
Api
.
GetList
,
data
:
params
});
export
const
addItem
=
(
params
?:
any
)
=>
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
AddProject
,
data
:
params
});
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
AddProject
,
data
:
params
,
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
,
'X-Requested-With'
:
'XMLHttpRequest'
,
withCredentials
:
true
,
},
});
export
const
updateItem
=
(
params
?:
any
)
=>
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
UpdateProject
,
data
:
params
});
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
UpdateProject
,
data
:
params
,
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
,
'X-Requested-With'
:
'XMLHttpRequest'
,
withCredentials
:
true
,
},
});
src/api/project/model/biddingPlanModel.ts
View file @
a3548d31
import
{
BasicPageParams
}
from
'@/api/model/baseModel'
;
import
{
BasicPageParams
,
BasicFetchResult
}
from
'@/api/model/baseModel'
;
export
type
ProjectParams
=
{
projectName
?:
string
;
};
export
type
ProjectPageParams
=
BasicPageParams
&
ProjectParams
;
export
interface
ProjectListItem
{
id
:
string
;
projectName
:
string
;
isReserveProject
:
string
;
constructionSite
:
string
;
constructionMode
:
string
;
projectType
:
string
;
projectOverview
:
string
;
constructionPurpose
:
string
;
delFlag
:
string
;
constructionScale
:
string
;
fundingSource
:
string
;
implementingEntity
:
string
;
logo
:
string
;
createTime
:
null
;
createBy
:
string
;
updateTime
:
null
;
updateBy
:
string
;
export
interface
ListItem
{
id
?:
string
|
number
;
proNumber
?:
string
|
number
;
biddingQuarter
?:
string
|
number
;
tendeYear
?:
string
|
number
;
revieweUser
?:
string
|
number
;
reviewTime
?:
string
|
number
;
reviewStatus
?:
string
|
number
;
createTime
?:
string
|
number
;
createBy
?:
string
|
number
;
updatetTime
?:
string
|
number
;
updateBy
?:
string
|
number
;
companyName
?:
string
|
number
;
delFlag
?:
string
|
number
;
}
export
interface
ProjectModel
{
id
?:
string
|
number
;
constructionMode
:
string
;
isReserveProject
:
string
;
projectType
:
string
;
projectOverview
:
string
;
constructionPurpose
:
string
;
proNumber
?:
string
|
number
;
biddingQuarter
?:
any
;
tenderYear
?:
any
;
tenderPlanPro
?:
any
;
}
export
type
ProjectListGetResultModel
=
ProjectListItem
[];
export
interface
planModel
{
id
?:
string
|
number
;
projectInitiator
:
string
|
number
;
proId
:
string
|
number
;
investmentAmount
:
string
|
number
;
biddinType
:
string
|
number
;
controlPrice
:
string
|
number
;
plannedPeriod
:
string
|
number
;
biddingPeriod
:
string
|
number
;
biddingMethod
:
string
|
number
;
tendercontent
:
string
|
number
;
remark
:
string
|
number
;
}
export
type
ListGetResultModel
=
BasicFetchResult
<
ListItem
>
;
export
type
editModel
=
ProjectModel
<
planModel
>
;
src/components/Page/src/PageCard.vue
View file @
a3548d31
<
template
>
<div
class=
"page-card"
>
<div
class=
"page-card-title"
v-if=
"title"
>
{{
title
}}
</div>
<div
class=
"page-card-title"
v-if=
"title"
>
<div
class=
"title-main"
>
{{
title
}}
</div>
<div><slot
name=
"right"
></slot></div
></div>
<div
class=
"page-card-body"
>
<slot></slot>
</div>
...
...
@@ -24,8 +26,12 @@
border-bottom: 1px solid #f0f0f0;
display: flex;
align-items: center;
justify-content: flex-start;
&::before {
justify-content: space-between;
.title-main {
display: flex;
align-items: center;
}
.title-main::before {
content: ' ';
display: block;
width: 4px;
...
...
src/components/projectlibraryModel/projectlibraryModel.vue
View file @
a3548d31
...
...
@@ -17,11 +17,11 @@
<span
v-else
>
{{
text
}}
</span>
</
template
>
</BasicTable>
<!-- <button @click="getSelectRowList">获取数据</button>-->
<!-- <button @click="getSelectRowList">获取数据</button>-->
</BasicModal>
</template>
<
script
lang=
"ts"
setup
>
import
{
BasicModal
}
from
'@/components/Modal'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
getListByPage
}
from
'@/api/project/project'
;
import
{
columns
,
searchFormSchema
}
from
'@/components/projectlibraryModel/data'
;
...
...
@@ -61,8 +61,12 @@
const
emit
=
defineEmits
([
'close'
]);
function
handleVisibleChange
(
v
)
{}
const
[
register
,
{
closeModal
}]
=
useModalInner
((
data
)
=>
{
data
;
});
function
handleSubmit
()
{
getSelectRowList
()
getSelectRowList
();
closeModal
();
}
</
script
>
src/components/yearModal.vue
View file @
a3548d31
...
...
@@ -120,7 +120,7 @@
console
.
log
(
value
);
console
.
log
(
'submit'
);
emit
(
'close'
,
value
);
//
closeModal();
closeModal
();
});
}
</
script
>
src/views/biddingPlan/biddingPlan.data.ts
View file @
a3548d31
...
...
@@ -44,17 +44,22 @@ export const columns: BasicColumn[] = [
export
const
searchFormSchema
:
FormSchema
[]
=
[
{
field
:
'
projectName
'
,
field
:
'
tenderYear
'
,
label
:
''
,
component
:
'DatePicker'
,
componentProps
:
{
placeholder
:
'年份'
,
picker
:
'year'
,
valueFormat
:
'YYYY'
,
format
:
'YYYY'
,
style
:
{
width
:
'100%'
,
},
},
colProps
:
{
span
:
4
},
},
{
field
:
'
projectName
'
,
field
:
'
biddingQuarter
'
,
label
:
''
,
component
:
'Select'
,
componentProps
:
{
...
...
@@ -81,7 +86,7 @@ export const searchFormSchema: FormSchema[] = [
colProps
:
{
span
:
4
},
},
{
field
:
'
project
Name'
,
field
:
'
company
Name'
,
label
:
''
,
component
:
'Select'
,
componentProps
:
{
...
...
@@ -117,29 +122,29 @@ export const formSchema: FormSchema[] = [
required
:
true
,
component
:
'Input'
,
componentProps
:
{
disabled
:
true
,
readonly
:
true
,
},
colProps
:
{
span
:
7
,
offset
:
1
},
},
{
field
:
'project
Name
'
,
field
:
'project
Initiator
'
,
label
:
'立项主体'
,
required
:
true
,
component
:
'Input'
,
colProps
:
{
span
:
7
,
offset
:
1
},
},
{
field
:
'
projectNam
e'
,
field
:
'
fundingSourc
e'
,
label
:
'资金来源'
,
required
:
true
,
component
:
'Input'
,
componentProps
:
{
disabled
:
true
,
readonly
:
true
,
},
colProps
:
{
span
:
7
,
offset
:
1
},
},
{
field
:
'
projectName
'
,
field
:
'
investmentAmount
'
,
label
:
'立即投资额'
,
required
:
true
,
component
:
'Input'
,
...
...
@@ -149,8 +154,8 @@ export const formSchema: FormSchema[] = [
colProps
:
{
span
:
7
,
offset
:
1
},
},
{
field
:
'
projectNam
e'
,
label
:
'
投资
类型'
,
field
:
'
biddingTyp
e'
,
label
:
'
招标
类型'
,
required
:
true
,
component
:
'Select'
,
componentProps
:
{
...
...
@@ -176,28 +181,36 @@ export const formSchema: FormSchema[] = [
colProps
:
{
span
:
7
,
offset
:
1
},
},
{
field
:
'
projectNam
e'
,
field
:
'
controlPric
e'
,
label
:
'预计控制价'
,
required
:
true
,
component
:
'Input'
,
colProps
:
{
span
:
7
,
offset
:
1
},
},
{
field
:
'p
rojectName
'
,
field
:
'p
lannedPeriod
'
,
label
:
'计划工期'
,
required
:
true
,
component
:
'RangePicker'
,
colProps
:
{
span
:
7
,
offset
:
1
},
componentProps
:
{
valueFormat
:
'YYYY-MM-DD'
,
format
:
'YYYY-MM-DD'
,
},
},
{
field
:
'
projectName
'
,
field
:
'
biddingPeriod
'
,
label
:
'计划招标周期'
,
required
:
true
,
component
:
'RangePicker'
,
colProps
:
{
span
:
7
,
offset
:
1
},
componentProps
:
{
valueFormat
:
'YYYY-MM-DD'
,
format
:
'YYYY-MM-DD'
,
},
},
{
field
:
'
projectName
'
,
field
:
'
biddingMethod
'
,
label
:
'招标方式'
,
required
:
true
,
component
:
'Select'
,
...
...
@@ -229,7 +242,7 @@ export const formSchema: FormSchema[] = [
},
{
label
:
'招标内容'
,
field
:
'
constructionPurpose
'
,
field
:
'
tenderContent
'
,
required
:
true
,
component
:
'InputTextArea'
,
componentProps
:
{
...
...
@@ -240,7 +253,7 @@ export const formSchema: FormSchema[] = [
},
{
label
:
'备注'
,
field
:
'
constructionPurpose
'
,
field
:
'
remark
'
,
required
:
true
,
component
:
'InputTextArea'
,
componentProps
:
{
...
...
src/views/biddingPlan/biddingPlanEdit.vue
View file @
a3548d31
...
...
@@ -2,29 +2,63 @@
<PageWrapper
:title=
"getTitle"
:contentBackground=
"false"
headerSticky
>
<template
#
extra
>
<a-button
type=
"primary"
danger
>
删除
</a-button>
<a-button
type=
"primary"
@
click=
"handleSubmit"
>
提交
</a-button>
</
template
>
<PageCard
v-for=
"(item, index) in tabsFormSchema"
:key=
"index"
:title=
"item.name"
>
<BasicForm
@
register=
"item.Form[0]"
/>
<
template
#
right
>
<a-button
type=
"text"
preIcon=
"ant-design:delete-outlined"
danger
@
click=
"deleteItem(index)"
>
</a-button>
</
template
>
<BasicForm
:loading=
"loading"
@
register=
"item.Form[0]"
/>
</PageCard>
<a-button
type=
"primary"
@
click=
"addItem"
>
添加
</a-button>
<a-button
type=
"dashed"
@
click=
"add"
preIcon=
"ei:plus"
>
从项目库导入
</a-button>
<a-button
type=
"dashed"
@
click=
"handleAdd"
class=
"ml-2"
preIcon=
"ei:plus"
>
新建项目
</a-button>
<projectDrawer
@
register=
"registerDrawer"
@
success=
"handleSuccess"
/>
<projectlibraryModel
@
register=
"register"
@
close=
"handleNewData"
/>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
unref
,
computed
,
onMounted
,
ref
,
reactive
}
from
'vue'
;
import
projectlibraryModel
from
'@/components/projectlibraryModel/projectlibraryModel.vue'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
PageCard
from
'@/components/Page/src/PageCard.vue'
;
import
projectDrawer
from
'@/views/project/projectDrawer.vue'
;
import
{
BasicForm
,
useForm
,
FormProps
,
UseFormReturnType
}
from
'@/components/Form'
;
import
{
formSchema
}
from
'./biddingPlan.data'
;
import
{
deepMerge
}
from
'@/utils'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useDrawer
}
from
'@/components/Drawer'
;
import
{
addItem
,
updateItem
}
from
'@/api/project/biddingPlan'
;
import
{
editModel
}
from
'@/api/project/model/biddingPlanModel'
;
import
{
nextTick
}
from
'vue'
;
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
import
{
useModal
}
from
'@/components/Modal'
;
const
[
register
,
{
openModal
:
openModal
}]
=
useModal
();
const
{
createMessage
}
=
useMessage
();
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新增招标计划'
:
'编辑招标计划'
));
const
isUpdate
=
ref
(
false
);
const
loading
=
ref
(
false
);
const
formData
=
ref
<
editModel
>
({});
onMounted
(()
=>
{
const
route
=
useRoute
();
const
id
=
route
.
query
.
id
;
// 获取名为id的参数
console
.
log
(
route
.
query
);
if
(
!
id
)
{
formData
.
value
.
biddingQuarter
=
route
.
query
.
quarter
;
formData
.
value
.
tenderYear
=
route
.
query
.
year
;
formData
.
value
.
tenderPlanPro
=
[];
isUpdate
.
value
=
false
;
console
.
log
(
formData
);
}
else
{
isUpdate
.
value
=
true
;
}
});
type
TabsFormType
=
{
name
:
string
;
...
...
@@ -39,16 +73,74 @@
const
tabsFormSchema
=
reactive
<
TabsFormType
[]
>
([]);
async
function
addItem
()
{
tabsFormSchema
.
push
({
async
function
add
()
{
openModal
();
}
async
function
handleNewData
(
info
:
any
)
{
if
(
info
)
{
info
.
map
((
i
)
=>
{
handleNew
(
i
);
});
}
}
/***
*
*/
async
function
handleNew
(
info
:
any
)
{
const
item
=
{
name
:
'序号'
+
(
tabsFormSchema
.
length
+
1
),
forceRender
:
true
,
Form
:
useForm
(
Object
.
assign
({
schemas
:
formSchema
},
baseFormConfig
)
as
FormProps
),
};
const
{
setFieldsValue
}
=
item
.
Form
[
1
];
tabsFormSchema
.
push
(
item
);
formData
.
value
.
tenderPlanPro
.
push
({
proId
:
info
.
id
,
});
nextTick
(()
=>
{
setFieldsValue
({
projectName
:
info
.
projectName
,
fundingSource
:
info
.
fundingSource
,
});
});
}
async
function
deleteItem
(
index
:
any
)
{
tabsFormSchema
.
splice
(
index
,
1
);
formData
.
value
.
tenderPlanPro
.
splice
(
index
,
1
);
}
async
function
handleAdd
()
{
openDrawer
(
true
,
{
isUpdate
:
false
,
});
}
async
function
handleSuccess
(
params
:
any
)
{
console
.
log
(
params
);
}
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
];
await
validate
();
let
res
=
getFieldsValue
();
res
.
biddingPeriod
=
res
.
biddingPeriod
.
join
(
','
);
res
.
plannedPeriod
=
res
.
plannedPeriod
.
join
(
','
);
formData
.
value
.
tenderPlanPro
[
i
]
=
deepMerge
(
formData
.
value
.
tenderPlanPro
[
i
],
res
);
console
.
log
(
formData
.
value
.
tenderPlanPro
);
}
formData
.
value
.
proNumber
=
formData
.
value
.
tenderPlanPro
.
Length
;
let
res
=
isUpdate
.
value
?
await
updateItem
(
unref
(
formData
))
:
await
addItem
(
unref
(
formData
));
loading
.
value
=
false
;
console
.
log
(
res
);
createMessage
.
success
(
'提交成功!'
);
}
catch
(
e
)
{
// 验证失败或出错,切换到对应标签页
console
.
log
(
e
);
}
finally
{
loading
.
value
=
false
;
}
}
</
script
>
<
style
lang=
"less"
scoped
>
// .vben-page-wrapper-content-bg {
// background-color: transparent;
// }
</
style
>
src/views/demo/form/TabsForm.vue
View file @
a3548d31
...
...
@@ -24,7 +24,7 @@
import
{
Tabs
}
from
'ant-design-vue'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
CollapseContainer
}
from
'@/components/Container'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
omit
}
from
'lodash-es'
;
import
{
deepMerge
}
from
'@/utils'
;
import
{
BasicForm
,
FormSchema
,
useForm
,
FormProps
,
UseFormReturnType
}
from
'@/components/Form'
;
...
...
@@ -38,7 +38,7 @@
forceRender
?:
boolean
;
Form
:
UseFormReturnType
;
};
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
const
{
createMessage
}
=
useMessage
();
const
activeKey
=
ref
(
'tabs2'
);
const
loading
=
ref
(
false
);
...
...
src/views/project/index.vue
View file @
a3548d31
...
...
@@ -81,6 +81,7 @@
import
{
getListByPage
,
deleteItem
,
getItem
}
from
'@/api/project/project'
;
import
{
columns
,
searchFormSchema
}
from
'./project.data'
;
import
{
Row
,
Col
}
from
'ant-design-vue'
;
import
projectDrawer
from
'./projectDrawer.vue'
;
import
{
useDrawer
}
from
'@/components/Drawer'
;
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
...
...
src/views/project/projectDrawer.vue
View file @
a3548d31
...
...
@@ -69,7 +69,7 @@
console
.
log
(
res
);
closeDrawer
();
emit
(
'success'
);
emit
(
'success'
,
res
);
}
finally
{
setDrawerProps
({
confirmLoading
:
false
});
}
...
...
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