Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-front
Overview
Overview
Details
Activity
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
platform
hg-front
Commits
a8ea6fea
Commit
a8ea6fea
authored
Aug 02, 2024
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
功能优化
parent
ed9fb6a1
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
634 additions
and
54 deletions
+634
-54
debit-note.js
api/debit-note.js
+6
-0
payment-order.js
api/payment-order.js
+35
-0
settlement-doc.js
api/settlement-doc.js
+18
-1
add.vue
pages/debit-note/add.vue
+2
-2
edit.vue
pages/debit-note/edit.vue
+21
-1
index.vue
pages/debit-note/index.vue
+1
-1
add.vue
pages/payment-order/add.vue
+6
-1
edit.vue
pages/payment-order/edit.vue
+95
-12
index.vue
pages/payment-order/index.vue
+2
-4
list.vue
pages/product-order/list.vue
+4
-4
add.vue
pages/settlement-doc/add.vue
+4
-14
edit.vue
pages/settlement-doc/edit.vue
+431
-14
HGAPP71.png
static/HGAPP71.png
+0
-0
tools.js
utils/tools.js
+9
-0
No files found.
api/debit-note.js
View file @
a8ea6fea
...
...
@@ -113,3 +113,9 @@ export const getProList = (params,pageData) => {
}
export
const
del
=
(
data
)
=>
{
let
url
=
`/service/S_XS_KK_04`
let
d
=
setResultData
(
data
);
return
http
.
post
(
url
,
d
)
}
api/payment-order.js
View file @
a8ea6fea
...
...
@@ -88,6 +88,34 @@ const setResultData = (data={}) => {
return
paramsData
}
const
setResultDataForList
=
(
list
=
[])
=>
{
let
paramsData
=
{
"__version__"
:
"2.0"
,
"__sys__"
:
{},
"__blocks__"
:
{
"result"
:
{
"attr"
:
{},
"meta"
:
{
"columns"
:
[]
},
"rows"
:
[]
}
}
}
let
keyList
=
Object
.
keys
(
list
[
0
]);
keyList
.
forEach
((
item
,
index
)
=>
{
paramsData
.
__blocks__
.
result
.
meta
.
columns
.
push
({
pos
:
index
,
name
:
item
})
})
list
.
forEach
(
item
=>
{
paramsData
.
__blocks__
.
result
.
rows
.
push
(
Object
.
values
(
item
));
})
return
paramsData
}
const
setResultDataAndDetail
=
(
data
=
{},
detail
=
{})
=>
{
let
obj
=
{}
for
(
let
i
in
data
)
{
...
...
@@ -220,6 +248,13 @@ export const save = (data) => {
}
export
const
updateList
=
(
data
)
=>
{
let
url
=
`/service/S_CW_FK_06`
let
d
=
setResultDataForList
(
data
);
return
http
.
post
(
url
,
d
)
}
// 审核
export
const
updateSubmitStatus
=
(
data
)
=>
{
let
url
=
`/service/S_CW_FK_02`
...
...
api/settlement-doc.js
View file @
a8ea6fea
...
...
@@ -21,7 +21,7 @@ const setParamsData = (data = {},pageData) => {
"result"
:
{
"attr"
:
{
count
:
0
,
limit
:
pageData
&&
pageData
.
limit
?
pageData
.
limit
:
10
,
limit
:
pageData
&&
pageData
.
limit
?
pageData
.
limit
:
10
0
,
offset
:
pageData
&&
pageData
.
offset
?
pageData
.
offset
*
pageData
.
limit
:
0
,
orderBy
:
""
,
showCount
:
pageData
&&
pageData
.
showCount
?
pageData
.
showCount
:
"true"
...
...
@@ -146,6 +146,17 @@ export const getList = (params,pageData) => {
return
http
.
post
(
url
,
d
)
}
export
const
getSubList
=
(
data
)
=>
{
let
url
=
`/service/S_XS_JS_03`
return
http
.
post
(
url
,
data
)
}
export
const
saveSubList
=
(
data
)
=>
{
let
url
=
`/service/S_XS_JS_04`
let
d
=
setResultDataAndDetail
({},
data
)
return
http
.
post
(
url
,
d
)
}
export
const
save
=
(
data
,
Detail
)
=>
{
let
url
=
`/service/S_XS_JS_02`
let
d
=
setResultDataAndDetail
(
data
,
Detail
);
...
...
@@ -164,6 +175,12 @@ export const getProList = (params,pageData) => {
return
http
.
post
(
url
,
d
)
}
export
const
getProList2
=
(
params
,
pageData
)
=>
{
let
url
=
`/service/S_CW_HT_02`
let
d
=
setParamsData
(
params
,
pageData
)
return
http
.
post
(
url
,
d
)
}
export
const
getList1
=
(
params
,
pageData
)
=>
{
let
url
=
`/service/S_CW_QZ_01`
let
d
=
setParamsData
(
params
,
pageData
)
...
...
pages/debit-note/add.vue
View file @
a8ea6fea
...
...
@@ -95,7 +95,7 @@
</view>
<view
class=
"text-blue"
>
<u-input
v-model=
"orderInfo.totalContractPriceIncluding"
color=
"#0081ff"
inputAlign=
"right"
type=
"
text
"
:border=
"border"
placeholder=
"请输入扣款金额"
/>
type=
"
number
"
:border=
"border"
placeholder=
"请输入扣款金额"
/>
</view>
</view>
<view
class=
"cu-form-group"
>
...
...
@@ -142,7 +142,7 @@
content
:
"请确认是否进行新增扣款单?"
,
statusBarHeight
:
uni
.
getStorageSync
(
"statusHeight"
)
||
0
,
orderInfo
:
{
reviewStatus
:
'
3
'
,
reviewStatus
:
'
0
'
,
signingDate
:
moment
().
format
(
"YYYY-MM-DD"
)
},
};
...
...
pages/debit-note/edit.vue
View file @
a8ea6fea
...
...
@@ -120,6 +120,7 @@
<view
v-if=
"orderInfo.reviewStatus && orderInfo.reviewStatus!=3"
class=
"footer-box"
>
<button
class=
"cu-btn block bg-blue"
@
tap=
"onSubmit(1)"
>
提交
</button>
<button
class=
"cu-btn block bg-red"
@
tap=
"onSubmit(2)"
>
删除
</button>
</view>
<u-calendar
:show=
"show2"
mode=
"single"
:defaultDate=
"orderInfo.signingDate"
:minDate=
"minDate"
:monthNum=
'4'
@
confirm=
"onConfirm"
@
close=
"onCancel"
></u-calendar>
...
...
@@ -138,7 +139,8 @@
}
from
"@/api/product-warehousing.js"
;
import
{
getList
,
updateSubmitStatus
updateSubmitStatus
,
del
}
from
"@/api/debit-note.js"
;
export
default
{
...
...
@@ -171,6 +173,8 @@
},
methods
:
{
onSubmit
(
t
)
{
this
.
submitType
=
t
;
this
.
content
=
t
==
1
?
'请确认是否进行审核操作?'
:
'请确认是否进行删除操作?'
this
.
show
=
true
},
onOpenCalendar
()
{
...
...
@@ -189,6 +193,7 @@
uni
.
showLoading
({
title
:
"加载中..."
})
if
(
this
.
submitType
==
1
){
updateSubmitStatus
({
...
this
.
orderInfo
,
reviewStatus
:
3
...
...
@@ -200,10 +205,25 @@
title
:
"提交成功"
})
setTimeout
(()
=>
{
this
.
onGetList
();
},
1500
)
}
})
}
else
{
del
(
this
.
orderInfo
).
then
(
res
=>
{
uni
.
hideLoading
();
if
(
res
.
data
.
__sys__
.
status
===
0
)
{
uni
.
showToast
({
icon
:
"success"
,
title
:
"提交成功"
})
setTimeout
(()
=>
{
this
.
onBack
();
},
1500
)
}
})
}
},
onBack
()
{
uni
.
redirectTo
({
...
...
pages/debit-note/index.vue
View file @
a8ea6fea
...
...
@@ -10,7 +10,7 @@
<text
class=
"text-white"
>
选择项目
</text>
</block>
<block
slot=
"right"
>
<text
class=
"text-
green
text-bold text-lg margin-right"
@
tap=
"onCheck"
>
确 定
</text>
<text
class=
"text-
white
text-bold text-lg margin-right"
@
tap=
"onCheck"
>
确 定
</text>
</block>
</cu-custom>
<view
v-if=
"statusBarHeight>0"
class=
"content-black"
:style=
"
{height:statusBarHeight+45+'px'}">
...
...
pages/payment-order/add.vue
View file @
a8ea6fea
...
...
@@ -323,7 +323,12 @@
url
:
`/pages/payment-order/index?checkedId=
${
checkedId
}
`
,
events
:
{
acceptDataFromOpenedPage
:
(
data
)
=>
{
this
.
selectList
=
data
.
data
;
this
.
selectList
=
data
.
data
.
map
(
item
=>
{
return
{
...
item
,
thisAmount
:
Number
(
item
.
remainingAmount
)
}
});
this
.
$forceUpdate
();
}
}
...
...
pages/payment-order/edit.vue
View file @
a8ea6fea
...
...
@@ -7,10 +7,10 @@
</view>
</block>
<block
slot=
"content"
>
<text
class=
"text-white"
>
结算
单详情
</text>
<text
class=
"text-white"
>
付款
单详情
</text>
</block>
<block
slot=
"right"
>
<view
v-if=
"subList && subList.length"
class=
"right-btn"
@
tap=
"onEditOrSave"
>
<view
v-if=
"
orderInfo.reviewStatus == '0' &&
subList && subList.length"
class=
"right-btn"
@
tap=
"onEditOrSave"
>
<text
class=
"text-white"
>
{{
isEdit
?
'保存'
:
'编辑'
}}
</text>
</view>
</block>
...
...
@@ -92,7 +92,7 @@
<view
class=
"flex-col content-part-1 content-part-2"
>
<view
class=
"flex-row header"
>
<text
class=
"text-lg text-bold text-black"
>
清单明细
</text>
<text
class=
"text-lg text-bold text-black"
>
付款清单
</text>
</view>
<view
class=
"form-content-box margin-bottom"
>
<view
v-for=
"(item,i) in subList"
:key=
"i"
class=
"sub-item-box"
>
...
...
@@ -121,9 +121,19 @@
<text>
{{
item
.
contractNumber
}}
</text>
</view>
</view>
<view
v-if=
"item.remainingAmount"
class=
"cu-form-group"
>
<view
class=
"title"
>
<text>
剩余金额:
</text>
</view>
<view
class=
""
>
<text>
{{
Number
(
item
.
remainingAmount
)
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text>
收款
总
额:
</text>
<text>
收款
金
额:
</text>
</view>
<view
v-if=
"isEdit && item.isEdit"
class=
""
>
<u-input
v-model=
"item.totalContractPriceIncluding"
...
...
@@ -134,6 +144,15 @@
<text>
{{
item
.
totalContractPriceIncluding
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text>
创建时间:
</text>
</view>
<view
class=
""
>
<text>
{{
item
.
createdDate
}}
</text>
</view>
</view>
</form>
...
...
@@ -163,13 +182,14 @@
<
script
>
import
{
getDict
}
from
'@/api/index.js'
;
import
{
toJsonData
toJsonData
,
formatForLen14
}
from
"@/utils/tools.js"
;
import
moment
from
"@/common/moment.js"
;
import
{
getParamsData
}
from
"@/api/product-warehousing.js"
;
import
{
getList
,
getSubList
,
updateSubmitStatus
,
updateWriteoffStatus
}
from
"@/api/payment-order.js"
;
import
{
getList
,
getSubList
,
updateSubmitStatus
,
updateWriteoffStatus
,
updateList
,
saveBySelect
}
from
"@/api/payment-order.js"
;
export
default
{
data
()
{
...
...
@@ -200,7 +220,6 @@
},
methods
:
{
onEditOrSave
(){
if
(
this
.
isEdit
){
this
.
submitType
=
3
;
this
.
content
=
'请确认是否进行数据保存操作?'
...
...
@@ -216,21 +235,45 @@
}
},
onNavToSelect
()
{
if
(
this
.
isEdit
){
uni
.
showToast
({
icon
:
"none"
,
title
:
"请将数据保存后操作"
})
return
}
let
checkedId
=
''
;
if
(
this
.
s
elect
List
.
length
){
checkedId
=
this
.
s
electList
.
map
(
item
=>
item
.
id
).
join
();
if
(
this
.
s
ub
List
.
length
){
checkedId
=
this
.
s
ubList
.
filter
(
item
=>
item
.
isEdit
)?
.
map
(
item
=>
item
.
id
).
join
();
}
this
.
mainId
=
this
.
id
;
uni
.
navigateTo
({
url
:
`/pages/payment-order/index?checkedId=
${
checkedId
}
`
,
url
:
`/pages/payment-order/index?
mainId=
${
this
.
id
}
&
checkedId=
${
checkedId
}
`
,
events
:
{
acceptDataFromOpenedPage
:
(
data
)
=>
{
this
.
selectList
=
data
.
data
;
this
.
isEdit
=
true
;
let
list
=
data
.
data
.
map
(
item
=>
{
return
{
...
item
,
totalContractPriceIncluding
:
Number
(
item
.
remainingAmount
),
isEdit
:
true
}
});
this
.
subList
=
[...
list
,...
this
.
subList
];
console
.
log
(
this
.
subList
,
99999
)
this
.
$forceUpdate
();
}
}
})
},
onSubmit
(
t
)
{
if
(
this
.
isEdit
){
uni
.
showToast
({
icon
:
"none"
,
title
:
"请将数据保存后提交"
})
return
}
this
.
submitType
=
t
;
this
.
content
=
this
.
submitType
==
1
?
'请确认是否进行审核通过操作?'
:
"请确认是否进行核销通过操作?"
this
.
show
=
true
...
...
@@ -279,6 +322,44 @@
})
}
else
if
(
this
.
submitType
==
3
){
this
.
isEdit
=
false
;
if
(
this
.
mainId
){
let
list
=
this
.
subList
.
filter
(
item
=>
item
.
isEdit
).
map
(
item
=>
{
return
{
...
item
,
thisAmount
:
item
.
totalContractPriceIncluding
}
})
saveBySelect
(
list
,{
hiddenConditions
:
'1'
,
billState
:
'1'
,
mainId
:
this
.
mainId
}).
then
(
res
=>
{
uni
.
hideLoading
();
if
(
res
.
data
.
__sys__
.
status
===
0
)
{
uni
.
showToast
({
icon
:
"success"
,
title
:
"新增成功"
})
this
.
mainId
=
""
setTimeout
(()
=>
{
this
.
onGetList
();
},
1500
)
}
})
}
else
{
updateList
(
this
.
subList
).
then
(
res
=>
{
uni
.
hideLoading
();
if
(
res
.
data
.
__sys__
.
status
===
0
)
{
uni
.
showToast
({
icon
:
"success"
,
title
:
"操作成功"
})
}
setTimeout
(()
=>
{
this
.
onGetList
();
},
1500
)
})
}
}
},
onBack
()
{
...
...
@@ -344,9 +425,11 @@
.
columns
);
if
(
list
&&
list
.
length
)
{
this
.
subList
=
list
.
map
(
item
=>
{
return
{
...
item
,
totalContractPriceIncluding
:
Number
(
item
.
totalContractPriceIncluding
)
totalContractPriceIncluding
:
Number
(
item
.
totalContractPriceIncluding
),
createdDate
:
formatForLen14
(
item
.
createdTime
)
}
})
}
...
...
pages/payment-order/index.vue
View file @
a8ea6fea
...
...
@@ -149,15 +149,13 @@
return
{
...
this
.
projectDataList
[
val
],
billId
:
this
.
projectDataList
[
val
].
id
,
mainId
:
this
.
mainId
mainId
:
this
.
mainId
,
contractNumber
:
this
.
projectDataList
[
val
].
billNumber
}
})
this
.
eventChannel
.
emit
(
'acceptDataFromOpenedPage'
,
{
data
:
list
});
}
this
.
onBack
();
},
onSelect
(
k
){
...
...
pages/product-order/list.vue
View file @
a8ea6fea
...
...
@@ -109,11 +109,11 @@
<text
class=
"text-gray part-2"
>
:
</text>
<text
class=
"text-title"
>
{{
item
.
finishQuantity
}}
</text>
</view>
<view
class=
"flex-row"
>
<
!--
<
view
class=
"flex-row"
>
<text
class=
"text-gray part-1"
>
完成状态
</text>
<text
class=
"text-gray part-2"
>
:
</text>
<text
class=
"text-title"
>
{{
Number
(
item
.
finishQuantity
)
>=
Number
(
item
.
quantity
)?
'已完工'
:
'未完工'
}}
</text>
</view>
</view>
-->
</view>
...
...
@@ -184,11 +184,11 @@
},
{
name
:
'未完工'
,
value
:
0
value
:
'0'
},
{
name
:
'已完工'
,
value
:
1
value
:
'1'
}
],
value
:
0
,
...
...
pages/settlement-doc/add.vue
View file @
a8ea6fea
...
...
@@ -250,15 +250,14 @@
placeholder=
"请输入工程量"
/>
</view>
</view>
<!--
<view
class=
"cu-form-group"
>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text>
累计结算工程量:
</text>
</view>
<view
class=
""
>
<
u-input
v-model=
"item.cumulativeEngineeringQuantity"
:disabled=
"true"
color=
"#0081ff"
inputAlign=
"right"
type=
"number"
:border=
"border"
placeholder=
"请输入工程量"
/
>
<
text>
{{
item
.
cumulativeEngineeringQuantity
}}
</text>
</view
>
</view>
</view>
-->
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text>
单位:
</text>
...
...
@@ -285,7 +284,7 @@
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text
class=
"text-xl text-red"
>
*
</text>
<text>
合
价
:
</text>
<text>
合
计
:
</text>
</view>
<view
class=
"text-blue"
>
<text>
{{
item
.
totalPrice
||
0
}}
</text>
...
...
@@ -346,15 +345,6 @@
contractDate
:
moment
().
format
(
"YYYY-MM-DD"
)
},
formList
:
[],
settlementCategoryList
:
[{
value
:
1
,
label
:
'过程结算'
},
{
value
:
1
,
label
:
'最终结算'
}
],
settlementCategoryIndex
:
-
1
,
priceTaxSeparationList
:[],
priceTaxSeparationIndex
:
-
1
,
...
...
pages/settlement-doc/edit.vue
View file @
a8ea6fea
...
...
@@ -9,6 +9,11 @@
<block
slot=
"content"
>
<text
class=
"text-white"
>
结算单详情
</text>
</block>
<block
slot=
"right"
>
<view
v-if=
"orderInfo.reviewStatus == '2' && subList && subList.length"
class=
"right-btn"
@
tap=
"onEditOrSave"
>
<text
class=
"text-white"
>
{{
isEdit
?
'保存'
:
'编辑'
}}
</text>
</view>
</block>
</cu-custom>
<view
v-if=
"statusBarHeight>0"
class=
"content-black"
:style=
"
{height:statusBarHeight+45+'px'}">
...
...
@@ -72,15 +77,66 @@
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text
v-if=
"isEdit"
class=
"text-xl text-red"
>
*
</text>
<text>
结算类别:
</text>
</view>
<view
class=
""
>
<view
v-if=
"isEdit"
class=
"text-blue"
>
<picker
@
change=
"onTypeChange"
:value=
"settlementTypeIndex"
:range=
"settlementTypeList"
range-key=
"label"
>
<view
class=
"uni-input"
>
<text
class=
"text-blue"
>
{{
settlementTypeIndex
>=
0
?
settlementTypeList
[
settlementTypeIndex
].
label
:
'请选择'
}}
</text>
<text
class=
"cuIcon-right"
></text>
</view>
</picker>
</view>
<view
v-else
class=
""
>
<text>
{{
settlementTypeEnum
[
orderInfo
.
settlementType
]
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text
v-if=
"isEdit"
class=
"text-xl text-red"
>
*
</text>
<text>
税点:
</text>
</view>
<view
v-if=
"isEdit"
class=
"text-blue"
>
<picker
@
change=
"onTaxChange"
:value=
"taxPointsIndex"
:range=
"taxPointsList"
range-key=
"label"
>
<view
class=
"uni-input"
>
<text
class=
"text-blue"
>
{{
taxPointsIndex
>=
0
?
taxPointsList
[
taxPointsIndex
].
label
:
'请选择'
}}
</text>
<text
class=
"cuIcon-right"
></text>
</view>
</picker>
</view>
<view
v-else
class=
""
>
<text>
{{
orderInfo
.
taxPoints
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text
v-if=
"isEdit"
class=
"text-xl text-red"
>
*
</text>
<text>
价税分离:
</text>
</view>
<view
v-if=
"isEdit"
class=
"text-blue"
>
<picker
@
change=
"onPriceTaxChange"
:value=
"priceTaxSeparationIndex"
:range=
"priceTaxSeparationList"
range-key=
"label"
>
<view
class=
"uni-input"
>
<text
class=
"text-blue"
>
{{
priceTaxSeparationIndex
>=
0
?
priceTaxSeparationList
[
priceTaxSeparationIndex
].
label
:
'请选择'
}}
</text>
<text
class=
"cuIcon-right"
></text>
</view>
</picker>
</view>
<view
v-else
class=
""
>
<text>
{{
priceTaxSeparationEnum
[
orderInfo
.
priceTaxSeparation
]
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text>
结算金额:
</text>
</view>
<view
class=
""
>
...
...
@@ -109,17 +165,16 @@
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text
v-if=
"
orderInfo.reviewStatus !=3
"
class=
"text-xl text-red"
>
*
</text>
<text
v-if=
"
isEdit
"
class=
"text-xl text-red"
>
*
</text>
<text>
结算日期:
</text>
</view>
<view
v-if=
"orderInfo.reviewStatus ==3"
class=
""
>
<text>
{{
orderInfo
.
contractDate
}}
</text>
</view>
<view
v-else
class=
"text-blue"
@
tap=
"onOpenCalendar"
>
<view
v-if=
"isEdit"
class=
"text-blue"
@
tap=
"onOpenCalendar"
>
<text>
{{
orderInfo
.
contractDate
||
"请选择日期"
}}
</text>
<text
class=
"cuIcon-right"
></text>
</view>
<view
v-else
class=
""
>
<text>
{{
orderInfo
.
contractDate
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
...
...
@@ -134,8 +189,149 @@
</view>
</view>
<view
class=
"flex-col content-part-1 content-part-2"
>
<view
class=
"flex-row header"
>
<text
class=
"text-lg text-bold text-black"
>
结算清单
</text>
</view>
<view
class=
"form-content-box margin-bottom"
>
<view
v-for=
"(item,k) in subList"
:key=
"k"
class=
"sub-item-box"
>
<form
class=
"item-form"
>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text
v-if=
"item.isEdit"
class=
"text-xl text-red"
>
*
</text>
<text>
结算依据:
</text>
</view>
<view
v-if=
"item.isEdit"
class=
""
>
<u-input
v-model=
"item.settlementBasis"
color=
"#0081ff"
inputAlign=
"right"
type=
"text"
:border=
"border"
placeholder=
"请输入结算依据"
/>
</view>
<view
v-else
class=
""
>
<text>
{{
item
.
settlementBasis
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text
v-if=
"item.isEdit"
class=
"text-xl text-red"
>
*
</text>
<text>
任务名称:
</text>
</view>
<view
v-if=
"item.isEdit"
class=
""
>
<u-input
v-model=
"item.taskName"
color=
"#0081ff"
inputAlign=
"right"
type=
"text"
:border=
"border"
placeholder=
"请输入任务名称"
/>
</view>
<view
v-else
class=
""
>
<text>
{{
item
.
taskName
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text
v-if=
"item.isEdit"
class=
"text-xl text-red"
>
*
</text>
<text>
工程内容:
</text>
</view>
<view
v-if=
"item.isEdit"
class=
""
>
<u-input
v-model=
"item.engineeringContent"
color=
"#0081ff"
inputAlign=
"right"
type=
"text"
:border=
"border"
placeholder=
"请输入工程内容"
/>
</view>
<view
v-else
class=
""
>
<text>
{{
item
.
engineeringContent
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text
v-if=
"item.isEdit"
class=
"text-xl text-red"
>
*
</text>
<text>
结算工程量:
</text>
</view>
<view
v-if=
"item.isEdit"
class=
""
>
<u-input
v-model=
"item.thisEngineeringQuantity"
@
change=
"onPriceChange($event,k)"
color=
"#0081ff"
inputAlign=
"right"
type=
"number"
:border=
"border"
placeholder=
"请输入工程量"
/>
</view>
<view
v-else
class=
""
>
<text>
{{
item
.
thisEngineeringQuantity
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text>
累计结算工程量:
</text>
</view>
<view
class=
""
>
<text>
{{
item
.
cumulativeEngineeringQuantity
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text>
单位:
</text>
</view>
<view
v-if=
"item.isEdit"
class=
""
>
<u-input
v-model=
"item.unit"
color=
"#0081ff"
inputAlign=
"right"
type=
"text"
:border=
"border"
placeholder=
"请输入单位"
/>
</view>
<view
v-else
class=
""
>
<text>
{{
item
.
unit
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text
v-if=
"item.isEdit"
class=
"text-xl text-red"
>
*
</text>
<text>
单价:
</text>
</view>
<view
v-if=
"item.isEdit"
class=
"text-blue"
>
<u-input
v-model=
"item.unitPrice"
color=
"#0081ff"
inputAlign=
"right"
@
change=
"onPriceChange2($event,k)"
type=
"number"
:border=
"border"
placeholder=
"请输入单价"
/>
</view>
<view
v-else
class=
""
>
<text>
{{
item
.
unitPrice
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text>
合计:
</text>
</view>
<view
class=
""
>
<text>
{{
item
.
totalPrice
||
0
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text>
备注:
</text>
</view>
<view
v-if=
"item.isEdit"
class=
"text-blue"
>
<u-input
v-model=
"item.remarks"
color=
"#0081ff"
inputAlign=
"right"
type=
"text"
:border=
"border"
placeholder=
"请输入备注"
/>
</view>
<view
v-else
class=
""
>
<text>
{{
item
.
remarks
}}
</text>
</view>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
<text>
创建时间:
</text>
</view>
<view
class=
""
>
<text>
{{
item
.
createdDate
}}
</text>
</view>
</view>
</form>
</view>
</view>
<view
v-if=
"subList.length
<
=
0
"
class=
"empty-box"
>
<u-empty
text=
"暂无数据"
textColor=
'#C1C1C1'
width=
"120"
>
</u-empty>
</view>
</view>
<view
v-if=
"orderInfo.reviewStatus && orderInfo.reviewStatus!=3"
class=
"footer-box"
>
<button
class=
"cu-btn block bg-blue"
@
tap=
"onSubmit(1)"
>
提交
</button>
<button
class=
"cu-btn block bg-blue"
@
tap=
"onOpenCheck"
>
选择
</button>
</view>
<u-calendar
:show=
"show2"
mode=
"single"
:defaultDate=
"orderInfo.signingDate"
:minDate=
"minDate"
:monthNum=
'4'
@
confirm=
"onConfirm"
@
close=
"onCancel"
></u-calendar>
...
...
@@ -146,13 +342,15 @@
<
script
>
import
{
toJsonData
toJsonData
,
formatForLen14
}
from
"@/utils/tools.js"
;
import
moment
from
"@/common/moment.js"
;
import
{
getDict
}
from
"@/api/index.js"
import
{
getParamsData
}
from
"@/api/product-warehousing.js"
;
import
{
getList
}
from
"@/api/settlement-doc.js"
;
import
{
getList
,
getSubList
,
saveSubList
,
save
,
getProList2
}
from
"@/api/settlement-doc.js"
;
export
default
{
data
()
{
...
...
@@ -172,10 +370,16 @@
1
:
'已提交'
,
0
:
"待审核"
},
settlementTypeEnum
:{
1
:
'部分结算'
,
2
:
'最终结算'
}
settlementTypeEnum
:{},
priceTaxSeparationEnum
:{},
subList
:[],
isEdit
:
false
,
priceTaxSeparationList
:[],
priceTaxSeparationIndex
:
-
1
,
taxPointsList
:[],
taxPointsIndex
:
-
1
,
settlementTypeList
:[],
settlementTypeIndex
:
-
1
};
},
onLoad
(
option
)
{
...
...
@@ -188,7 +392,92 @@
},
methods
:
{
onTypeChange
(
e
)
{
let
index
=
Number
(
e
.
target
.
value
);
if
(
this
.
settlementTypeIndex
===
index
)
return
this
.
settlementTypeIndex
=
index
;
this
.
orderInfo
.
settlementType
=
this
.
settlementTypeList
[
this
.
settlementTypeIndex
].
value
;
},
onTaxChange
(
e
)
{
let
index
=
Number
(
e
.
target
.
value
);
if
(
this
.
taxPointsIndex
===
index
)
return
this
.
taxPointsIndex
=
index
;
this
.
orderInfo
.
taxPoints
=
this
.
taxPointsList
[
this
.
taxPointsIndex
].
value
;
this
.
onCalculatePrice
()
},
onPriceTaxChange
(
e
)
{
let
index
=
Number
(
e
.
target
.
value
);
if
(
this
.
priceTaxSeparationIndex
===
index
)
return
this
.
priceTaxSeparationIndex
=
index
;
},
onPriceChange
(
e
,
i
)
{
this
.
subList
[
i
].
totalPrice
=
Number
(
this
.
subList
[
i
].
unitPrice
)
*
e
;
this
.
$forceUpdate
();
this
.
onCalculatePrice
()
},
onPriceChange2
(
e
,
i
)
{
this
.
subList
[
i
].
totalPrice
=
Number
(
this
.
subList
[
i
].
thisEngineeringQuantity
)
*
e
;
this
.
$forceUpdate
();
this
.
onCalculatePrice
()
},
onCalculatePrice
(){
let
num
=
0
console
.
log
(
this
.
subList
,
"this.formList"
)
if
(
this
.
subList
&&
this
.
subList
.
length
){
this
.
subList
.
forEach
(
item
=>
{
if
(
item
.
totalPrice
){
num
+=
item
.
totalPrice
}
})
this
.
orderInfo
.
thisSettlementAmount
=
num
;
//结算金额
this
.
orderInfo
.
cumulativeSettlementAmount
=
num
;
//累计结算金额
if
(
Number
(
this
.
orderInfo
.
taxPoints
)
>
0
){
this
.
orderInfo
.
thisPriceTax
=
(
num
*
(
1
+
Number
(
this
.
orderInfo
.
taxPoints
)
/
100
)).
toFixed
(
2
);
//含税金额
this
.
orderInfo
.
cumulativePriceTax
=
this
.
orderInfo
.
thisPriceTax
;
// 累计含税金额
this
.
orderInfo
.
thisSettlementTax
=
this
.
orderInfo
.
thisPriceTax
-
num
;
// 税额
this
.
orderInfo
.
cumulativeSettlementTax
=
this
.
orderInfo
.
thisSettlementTax
;
// 累计税额
}
console
.
log
(
this
.
orderInfo
.
thisSettlementAmount
)
this
.
$forceUpdate
();
}
},
onEditOrSave
(){
if
(
this
.
isEdit
){
this
.
submitType
=
3
;
this
.
content
=
'请确认是否进行数据保存操作?'
this
.
show
=
true
}
else
{
this
.
isEdit
=
true
;
if
(
this
.
orderInfo
.
taxPoints
){
this
.
taxPointsIndex
=
this
.
taxPointsList
.
findIndex
(
item
=>
item
.
value
==
this
.
orderInfo
.
taxPoints
)
}
if
(
this
.
orderInfo
.
settlementType
){
this
.
settlementTypeIndex
=
this
.
settlementTypeList
.
findIndex
(
item
=>
item
.
value
==
this
.
orderInfo
.
settlementType
)
}
if
(
this
.
orderInfo
.
priceTaxSeparation
){
this
.
priceTaxSeparationIndex
=
this
.
priceTaxSeparationList
.
findIndex
(
item
=>
item
.
value
==
this
.
orderInfo
.
priceTaxSeparation
)
}
this
.
subList
=
this
.
subList
.
map
(
item
=>
{
return
{
...
item
,
isEdit
:
true
}
})
}
},
onSubmit
(
t
)
{
if
(
this
.
isEdit
){
uni
.
showToast
({
icon
:
"none"
,
title
:
"请将数据保存后提交"
})
return
}
this
.
show
=
true
},
onOpenCalendar
()
{
...
...
@@ -207,6 +496,24 @@
uni
.
showLoading
({
title
:
"加载中..."
})
if
(
this
.
submitType
==
3
){
saveSubList
(
this
.
subList
).
then
(
res
=>
{
uni
.
hideLoading
();
if
(
res
.
data
.
__sys__
.
status
===
0
)
{
save
(
this
.
orderInfo
,
this
.
subList
).
then
(
res2
=>
{
if
(
res2
.
data
.
__sys__
.
status
===
0
){
uni
.
showToast
({
icon
:
"success"
,
title
:
"提交成功"
})
setTimeout
(()
=>
{
this
.
onGetList
();
},
1500
)
}
})
}
})
}
else
{
updateSubmitStatus
({
...
this
.
orderInfo
,
reviewStatus
:
3
,
...
...
@@ -223,6 +530,8 @@
},
1500
)
}
})
}
},
onBack
()
{
uni
.
redirectTo
({
...
...
@@ -230,6 +539,36 @@
})
},
onLoading
()
{
getDict
({
codeset
:
'hggp.cw.priceTaxSeparation'
}).
then
(
res
=>
{
if
(
res
.
data
.
list
&&
res
.
data
.
list
.
length
)
{
this
.
priceTaxSeparationList
=
res
.
data
.
list
this
.
priceTaxSeparationList
.
forEach
(
item
=>
{
this
.
priceTaxSeparationEnum
[
item
.
value
]
=
item
.
label
})
}
})
getDict
({
codeset
:
'hggp.cw.taxPoints'
}).
then
(
res
=>
{
if
(
res
.
data
.
list
&&
res
.
data
.
list
.
length
)
{
this
.
taxPointsList
=
res
.
data
.
list
}
})
getDict
({
codeset
:
'hggp.cw.settlementType'
}).
then
(
res
=>
{
if
(
res
.
data
.
list
&&
res
.
data
.
list
.
length
)
{
this
.
settlementTypeList
=
res
.
data
.
list
this
.
settlementTypeList
.
forEach
(
item
=>
{
this
.
settlementTypeEnum
[
item
.
value
]
=
item
.
label
})
}
})
this
.
onGetList
();
},
onGetList
()
{
...
...
@@ -245,11 +584,78 @@
if
(
list
&&
list
.
length
)
{
this
.
orderInfo
=
{
...
list
[
0
],
contractDate
:
moment
(
list
[
0
].
contractDate
).
format
(
"YYYY-MM-DD"
),
signingDate
:
moment
(
list
[
0
].
signingDate
).
format
(
"YYYY-MM-DD"
)
}
this
.
onGetSubList
()
}
})
},
onGetSubList
(){
uni
.
showLoading
({
title
:
"加载中"
})
getSubList
({
id
:
this
.
id
}).
then
(
res
=>
{
uni
.
hideLoading
()
let
list
=
toJsonData
(
res
.
data
.
__blocks__
.
detail1
.
rows
,
res
.
data
.
__blocks__
.
detail1
.
meta
.
columns
);
if
(
list
&&
list
.
length
){
this
.
subList
=
list
.
map
(
item
=>
{
return
{
...
item
,
thisEngineeringQuantity
:
Number
(
item
.
thisEngineeringQuantity
),
unitPrice
:
Number
(
item
.
unitPrice
),
cumulativeEngineeringQuantity
:
Number
(
item
.
cumulativeEngineeringQuantity
),
totalPrice
:
Number
(
item
.
totalPrice
),
createdDate
:
formatForLen14
(
item
.
createdTime
)
}
});
}
})
},
onOpenCheck
()
{
if
(
this
.
isEdit
){
uni
.
showToast
({
icon
:
"none"
,
title
:
"请将数据保存后操作"
})
return
}
getProList2
({
contractNumber
:
this
.
orderInfo
.
contractNumber
}).
then
(
res
=>
{
console
.
log
(
res
,
99999
)
})
},
onNavToSelect
()
{
let
checkedId
=
''
;
if
(
this
.
subList
.
length
){
checkedId
=
this
.
subList
.
filter
(
item
=>
item
.
isEdit
)?.
map
(
item
=>
item
.
id
).
join
();
}
this
.
mainId
=
this
.
id
;
uni
.
navigateTo
({
url
:
`/pages/payment-order/index?mainId=
${
this
.
id
}
&checkedId=
${
checkedId
}
`
,
events
:
{
acceptDataFromOpenedPage
:
(
data
)
=>
{
this
.
isEdit
=
true
;
let
list
=
data
.
data
.
map
(
item
=>
{
return
{
...
item
,
totalContractPriceIncluding
:
Number
(
item
.
totalContractPriceIncluding
),
isEdit
:
true
}
});
this
.
subList
=
[...
list
,...
this
.
subList
];
console
.
log
(
this
.
subList
,
99999
)
this
.
$forceUpdate
();
}
}
})
}
}
}
...
...
@@ -580,7 +986,11 @@
display
:
flex
;
background-color
:
transparent
;
justify-content
:
center
;
.cu-form-group{
.title{
width
:
280
upx
;
}
}
}
}
...
...
@@ -606,4 +1016,10 @@
.cu-form-group
uni-picker
::after
{
color
:
transparent
;
}
.right-btn
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
padding
:
0
24
upx
;
}
</
style
>
\ No newline at end of file
static/HGAPP71.png
0 → 100644
View file @
a8ea6fea
7.71 KB
utils/tools.js
View file @
a8ea6fea
...
...
@@ -173,3 +173,12 @@ export function getDictItem(dicts, dictType) {
}
return
obj
}
// 将14位数的时间字符串转化为时间格式
export
function
formatForLen14
(
dateStr
)
{
if
(
dateStr
&&
dateStr
.
length
===
14
){
let
strList
=
dateStr
.
split
(
''
);
dateStr
=
`
${
strList
[
0
]}${
strList
[
1
]}${
strList
[
2
]}${
strList
[
3
]}
/
${
strList
[
4
]}${
strList
[
5
]}
/
${
strList
[
6
]}${
strList
[
7
]}
${
strList
[
8
]}${
strList
[
9
]}
:
${
strList
[
10
]}${
strList
[
11
]}
:
${
strList
[
12
]}${
strList
[
13
]}
`
}
return
dateStr
}
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