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
3ad68c32
authored
Feb 04, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CRM:合同的 code review
parent
fffc9aed
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
11 deletions
+17
-11
src/views/crm/contract/ContractForm.vue
+1
-1
src/views/crm/contract/components/ProductList.vue
+9
-7
src/views/crm/contract/detail/ContractProductList.vue
+6
-3
src/views/crm/contract/detail/index.vue
+1
-0
No files found.
src/views/crm/contract/ContractForm.vue
View file @
3ad68c32
...
@@ -192,7 +192,7 @@ const formRules = reactive({
...
@@ -192,7 +192,7 @@ const formRules = reactive({
const
formRef
=
ref
()
// 表单 Ref
const
formRef
=
ref
()
// 表单 Ref
const
BPMLModelRef
=
ref
<
InstanceType
<
typeof
BPMLModel
>>
()
// TODO @puhui999:这个变量不太对;另外,可以不做 bpm model 窗口,而是可以点击跳转到工作流详情里;
const
BPMLModelRef
=
ref
<
InstanceType
<
typeof
BPMLModel
>>
()
// TODO @puhui999:这个变量不太对;另外,可以不做 bpm model 窗口,而是可以点击跳转到工作流详情里;
// 监听合同
商品变化,计算合同商
品总价
// 监听合同
产品变化,计算合同产
品总价
watch
(
watch
(
()
=>
formData
.
value
.
productItems
,
()
=>
formData
.
value
.
productItems
,
(
val
)
=>
{
(
val
)
=>
{
...
...
src/views/crm/contract/components/ProductList.vue
View file @
3ad68c32
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
</el-table>
</el-table>
<!-- table 选择表单 -->
<!-- table 选择表单 -->
<TableSelectForm
ref=
"tableSelectFormRef"
v-model=
"multipleSelection"
title=
"选择
商
品"
>
<TableSelectForm
ref=
"tableSelectFormRef"
v-model=
"multipleSelection"
title=
"选择
产
品"
>
<el-table-column
align=
"center"
label=
"产品名称"
prop=
"name"
width=
"160"
/>
<el-table-column
align=
"center"
label=
"产品名称"
prop=
"name"
width=
"160"
/>
<el-table-column
align=
"center"
label=
"产品类型"
prop=
"categoryName"
width=
"160"
/>
<el-table-column
align=
"center"
label=
"产品类型"
prop=
"categoryName"
width=
"160"
/>
<el-table-column
align=
"center"
label=
"产品单位"
prop=
"unit"
>
<el-table-column
align=
"center"
label=
"产品单位"
prop=
"unit"
>
...
@@ -76,7 +76,7 @@ const emits = defineEmits<{
...
@@ -76,7 +76,7 @@ const emits = defineEmits<{
(
e
:
'update:modelValue'
,
v
:
any
[]):
void
(
e
:
'update:modelValue'
,
v
:
any
[]):
void
}
>
()
}
>
()
const
list
=
ref
<
ProductApi
.
ProductExpandVO
[]
>
([])
//
列表数量
const
list
=
ref
<
ProductApi
.
ProductExpandVO
[]
>
([])
//
已添加的产品列表
const
multipleSelection
=
ref
<
ProductApi
.
ProductExpandVO
[]
>
([])
// 多选
const
multipleSelection
=
ref
<
ProductApi
.
ProductExpandVO
[]
>
([])
// 多选
/** 处理删除 */
/** 处理删除 */
...
@@ -100,8 +100,9 @@ const getTotalPrice = computed(() => (row: ProductApi.ProductExpandVO) => {
...
@@ -100,8 +100,9 @@ const getTotalPrice = computed(() => (row: ProductApi.ProductExpandVO) => {
row
.
totalPrice
=
isNaN
(
totalPrice
)
?
0
:
yuanToFen
(
totalPrice
)
row
.
totalPrice
=
isNaN
(
totalPrice
)
?
0
:
yuanToFen
(
totalPrice
)
return
isNaN
(
totalPrice
)
?
0
:
totalPrice
.
toFixed
(
2
)
return
isNaN
(
totalPrice
)
?
0
:
totalPrice
.
toFixed
(
2
)
})
})
const
isSetListValue
=
ref
(
false
)
// 判断是否已经给 list 赋值过,用于编辑表单商品回显
// 编辑时合同商品回显
/** 编辑时合同产品回显 */
const
isSetListValue
=
ref
(
false
)
// 判断是否已经给 list 赋值过,用于编辑表单产品回显
watch
(
watch
(
()
=>
props
.
modelValue
,
()
=>
props
.
modelValue
,
(
val
)
=>
{
(
val
)
=>
{
...
@@ -118,7 +119,8 @@ watch(
...
@@ -118,7 +119,8 @@ watch(
},
},
{
immediate
:
true
,
deep
:
true
}
{
immediate
:
true
,
deep
:
true
}
)
)
// 监听列表变化,动态更新合同商品列表
/** 监听列表变化,动态更新合同产品列表 */
watch
(
watch
(
list
,
list
,
(
val
)
=>
{
(
val
)
=>
{
...
@@ -130,14 +132,14 @@ watch(
...
@@ -130,14 +132,14 @@ watch(
{
deep
:
true
}
{
deep
:
true
}
)
)
// 监听
商品选择结果动态添加商品到列表中,如果商
品存在则不放入列表中
// 监听
产品选择结果动态添加产品到列表中,如果产
品存在则不放入列表中
watch
(
watch
(
multipleSelection
,
multipleSelection
,
(
val
)
=>
{
(
val
)
=>
{
if
(
!
val
||
val
.
length
===
0
)
{
if
(
!
val
||
val
.
length
===
0
)
{
return
return
}
}
// 过滤出不在列表中的
商
品
// 过滤出不在列表中的
产
品
const
ids
=
list
.
value
.
map
((
item
)
=>
item
.
id
)
const
ids
=
list
.
value
.
map
((
item
)
=>
item
.
id
)
const
productList
=
multipleSelection
.
value
.
filter
((
item
)
=>
ids
.
indexOf
(
item
.
id
)
===
-
1
)
const
productList
=
multipleSelection
.
value
.
filter
((
item
)
=>
ids
.
indexOf
(
item
.
id
)
===
-
1
)
if
(
!
productList
||
productList
.
length
===
0
)
{
if
(
!
productList
||
productList
.
length
===
0
)
{
...
...
src/views/crm/contract/detail/ContractProductList.vue
View file @
3ad68c32
<!-- 合同详情:产品列表 -->
<
template
>
<
template
>
<el-table
:data=
"list"
:show-overflow-tooltip=
"true"
:stripe=
"true"
>
<el-table
:data=
"list"
:show-overflow-tooltip=
"true"
:stripe=
"true"
>
<el-table-column
align=
"center"
label=
"产品名称"
prop=
"name"
width=
"160"
/>
<el-table-column
align=
"center"
label=
"产品名称"
prop=
"name"
width=
"160"
/>
...
@@ -35,7 +36,8 @@ defineOptions({ name: 'ContractProductList' })
...
@@ -35,7 +36,8 @@ defineOptions({ name: 'ContractProductList' })
const
props
=
withDefaults
(
defineProps
<
{
modelValue
:
ProductApi
.
ProductExpandVO
[]
}
>
(),
{
const
props
=
withDefaults
(
defineProps
<
{
modelValue
:
ProductApi
.
ProductExpandVO
[]
}
>
(),
{
modelValue
:
()
=>
[]
modelValue
:
()
=>
[]
})
})
const
list
=
ref
<
ProductApi
.
ProductExpandVO
[]
>
([])
// 列表数量
const
list
=
ref
<
ProductApi
.
ProductExpandVO
[]
>
([])
// 产品列表
/** 计算 totalPrice */
/** 计算 totalPrice */
const
getTotalPrice
=
computed
(()
=>
(
row
:
ProductApi
.
ProductExpandVO
)
=>
{
const
getTotalPrice
=
computed
(()
=>
(
row
:
ProductApi
.
ProductExpandVO
)
=>
{
const
totalPrice
=
const
totalPrice
=
...
@@ -43,8 +45,9 @@ const getTotalPrice = computed(() => (row: ProductApi.ProductExpandVO) => {
...
@@ -43,8 +45,9 @@ const getTotalPrice = computed(() => (row: ProductApi.ProductExpandVO) => {
row
.
totalPrice
=
isNaN
(
totalPrice
)
?
0
:
yuanToFen
(
totalPrice
)
row
.
totalPrice
=
isNaN
(
totalPrice
)
?
0
:
yuanToFen
(
totalPrice
)
return
isNaN
(
totalPrice
)
?
0
:
totalPrice
.
toFixed
(
2
)
return
isNaN
(
totalPrice
)
?
0
:
totalPrice
.
toFixed
(
2
)
})
})
const
isSetListValue
=
ref
(
false
)
// 判断是否已经给 list 赋值过,用于编辑表单商品回显
// 编辑时合同商品回显
/** 编辑时合同产品回显 */
const
isSetListValue
=
ref
(
false
)
// 判断是否已经给 list 赋值过,用于编辑表单产品回显
watch
(
watch
(
()
=>
props
.
modelValue
,
()
=>
props
.
modelValue
,
(
val
)
=>
{
(
val
)
=>
{
...
...
src/views/crm/contract/detail/index.vue
View file @
3ad68c32
...
@@ -87,6 +87,7 @@ const getOperateLog = async (contractId: number) => {
...
@@ -87,6 +87,7 @@ const getOperateLog = async (contractId: number) => {
}
}
/** 转移 */
/** 转移 */
// TODO @puhui999:这个组件,要不传递业务类型,然后组件里判断 title 和 api 能调用哪个;整体治理掉;
const
transferFormRef
=
ref
<
InstanceType
<
typeof
CrmTransferForm
>>
()
// 合同转移表单 ref
const
transferFormRef
=
ref
<
InstanceType
<
typeof
CrmTransferForm
>>
()
// 合同转移表单 ref
const
transferContract
=
()
=>
{
const
transferContract
=
()
=>
{
transferFormRef
.
value
?.
open
(
'合同转移'
,
contract
.
value
.
id
,
ContractApi
.
transferContract
)
transferFormRef
.
value
?.
open
(
'合同转移'
,
contract
.
value
.
id
,
ContractApi
.
transferContract
)
...
...
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