Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5deabcf6
authored
Feb 10, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
ERP:增加 ERP 销售订单的实现 60%(详情)
parent
ab63660b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
8 deletions
+53
-8
src/views/erp/sale/order/SaleOrderForm.vue
+52
-1
src/views/erp/sale/order/components/SaleOrderItemForm.vue
+1
-7
No files found.
src/views/erp/sale/order/SaleOrderForm.vue
View file @
5deabcf6
...
...
@@ -58,7 +58,6 @@
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 子表的表单 -->
<ContentWrap>
<el-tabs
v-model=
"subTabsName"
class=
"-mt-15px -mb-10px"
>
...
...
@@ -67,6 +66,35 @@
</el-tab-pane>
</el-tabs>
</ContentWrap>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"优惠率(%)"
prop=
"discountPercent"
>
<el-input-number
v-model=
"formData.discountPercent"
controls-position=
"right"
:min=
"0"
:precision=
"2"
placeholder=
"请输入优惠率"
class=
"!w-1/1"
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"收款优惠"
prop=
"discountPrice"
>
<el-input
disabled
v-model=
"formData.discountPrice"
:formatter=
"erpPriceInputFormatter"
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"优惠后金额"
>
<el-input
disabled
v-model=
"formData.totalPrice"
:formatter=
"erpPriceInputFormatter"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template
#
footer
>
<el-button
@
click=
"submitForm"
type=
"primary"
:disabled=
"formLoading"
v-if=
"!disabled"
>
确 定
...
...
@@ -79,6 +107,7 @@
import
{
SaleOrderApi
,
SaleOrderVO
}
from
'@/api/erp/sale/order'
import
SaleOrderItemForm
from
'./components/SaleOrderItemForm.vue'
import
{
CustomerApi
,
CustomerVO
}
from
'@/api/erp/sale/customer'
import
{
erpPriceInputFormatter
,
erpPriceMultiply
,
getSumValue
}
from
'@/utils'
/** ERP 销售订单表单 */
defineOptions
({
name
:
'SaleOrderForm'
})
...
...
@@ -96,6 +125,9 @@ const formData = ref({
orderTime
:
undefined
,
remark
:
undefined
,
fileUrl
:
''
,
discountPercent
:
0
,
discountPrice
:
0
,
totalPrice
:
0
,
items
:
[],
no
:
undefined
// 订单单号,后端返回
})
...
...
@@ -110,6 +142,22 @@ const customerList = ref<CustomerVO[]>([]) // 客户列表
const
subTabsName
=
ref
(
'item'
)
const
itemFormRef
=
ref
()
/** 计算 discountPrice、totalPrice 价格 */
watch
(
()
=>
formData
.
value
,
(
val
)
=>
{
if
(
!
val
)
{
return
}
const
totalPrice
=
val
.
items
.
reduce
((
prev
,
curr
)
=>
prev
+
curr
.
totalPrice
,
0
)
const
discountPrice
=
val
.
discountPercent
!=
null
?
erpPriceMultiply
(
totalPrice
,
val
.
discountPercent
/
100.0
)
:
0
formData
.
value
.
discountPrice
=
discountPrice
formData
.
value
.
totalPrice
=
totalPrice
-
discountPrice
},
{
deep
:
true
}
)
/** 打开弹窗 */
const
open
=
async
(
type
:
string
,
id
?:
number
)
=>
{
dialogVisible
.
value
=
true
...
...
@@ -163,6 +211,9 @@ const resetForm = () => {
orderTime
:
undefined
,
remark
:
undefined
,
fileUrl
:
undefined
,
discountPercent
:
0
,
discountPrice
:
0
,
totalPrice
:
0
,
items
:
[]
}
formRef
.
value
?.
resetFields
()
...
...
src/views/erp/sale/order/components/SaleOrderItemForm.vue
View file @
5deabcf6
...
...
@@ -104,13 +104,7 @@
<
template
#
default=
"{ row, $index }"
>
<el-form-item
:prop=
"`$
{$index}.taxPrice`" class="mb-0px!">
<el-form-item
:prop=
"`$
{$index}.taxPrice`" class="mb-0px!">
<el-input-number
v-model=
"row.taxPrice"
controls-position=
"right"
:min=
"0.01"
:precision=
"2"
class=
"!w-100%"
/>
<el-input
disabled
v-model=
"row.taxPrice"
:formatter=
"erpPriceInputFormatter"
/>
</el-form-item>
</el-form-item>
</
template
>
...
...
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