Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0af7941a
authored
Aug 20, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
7ded54f9
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
197 additions
and
1 deletions
src/views/orderManage/carDamage.vue
src/views/orderManage/components/approvalDialog.spec.js
src/views/orderManage/components/approvalDialog.vue
src/views/orderManage/order.vue
src/views/orderManage/utils/orderListRowDisplay.js
src/views/orderManage/utils/orderListRowDisplay.spec.js
src/views/orderManage/carDamage.vue
View file @
0af7941
...
@@ -173,6 +173,11 @@
...
@@ -173,6 +173,11 @@
prop=
"thirdOrderCode"
prop=
"thirdOrderCode"
width=
"150"
/>
width=
"150"
/>
<el-table-column
align=
"center"
<el-table-column
align=
"center"
label=
"商品名称"
prop=
"goodsNamesDisplay"
width=
"180"
show-overflow-tooltip
/>
<el-table-column
align=
"center"
label=
"展业场景"
label=
"展业场景"
prop=
"rightsSceneDisplayLabel"
prop=
"rightsSceneDisplayLabel"
width=
"140"
width=
"140"
...
...
src/views/orderManage/components/approvalDialog.spec.js
0 → 100644
View file @
0af7941
import
{
createLocalVue
,
mount
}
from
"@vue/test-utils"
;
import
ElementUI
from
"element-ui"
;
const
mockGetAuditOrderDetail
=
jest
.
fn
();
const
mockAuditGoodsOrderApplyRecord
=
jest
.
fn
();
jest
.
mock
(
"@api/order"
,
()
=>
({
auditGoodsOrderApplyRecord
:
mockAuditGoodsOrderApplyRecord
,
getAuditOrderDetail
:
mockGetAuditOrderDetail
,
}));
const
ApprovalDialog
=
require
(
"./approvalDialog.vue"
).
default
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
ElementUI
);
const
BaseDialogStub
=
{
name
:
"BaseDialog"
,
template
:
`
<div>
<slot></slot>
<button class="approval-confirm" @click="$emit('handleClick')">确定</button>
</div>
`
,
};
const
ElTableColumnStub
=
{
data
()
{
return
{
row
:
{},
};
},
template
:
"<div><slot :row=\"row\"></slot></div>"
,
};
function
flushPromises
()
{
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
0
));
}
function
createWrapper
()
{
return
mount
(
ApprovalDialog
,
{
localVue
,
propsData
:
{
approvalVisible
:
true
,
info
:
{
approvalType
:
2
,
orderCode
:
"ORDER-1"
,
},
},
stubs
:
{
"baseDialog"
:
BaseDialogStub
,
"el-table"
:
{
template
:
"<div><slot></slot></div>"
,
},
"el-table-column"
:
ElTableColumnStub
,
"ellipsisText"
:
{
template
:
"<span><slot></slot></span>"
,
},
},
mocks
:
{
$
$
:
jest
.
fn
(),
notice
:
{
okTips
:
jest
.
fn
(),
},
},
});
}
describe
(
"approvalDialog 审批备注长度校验"
,
()
=>
{
let
consoleWarnSpy
;
let
wrapper
;
beforeEach
(()
=>
{
jest
.
clearAllMocks
();
consoleWarnSpy
=
jest
.
spyOn
(
console
,
"warn"
).
mockImplementation
(()
=>
{});
mockGetAuditOrderDetail
.
mockResolvedValue
({
applyLogList
:
[],
goodsOrderDTO
:
{
packageGoodsList
:
[],
subOrderList
:
[],
},
oldGoodsOrderDTO
:
null
,
orderCode
:
"ORDER-1"
,
});
mockAuditGoodsOrderApplyRecord
.
mockResolvedValue
(
true
);
wrapper
=
createWrapper
();
});
afterEach
(()
=>
{
wrapper
.
destroy
();
consoleWarnSpy
.
mockRestore
();
jest
.
clearAllMocks
();
});
it
(
"驳回备注超过200个字符时阻止提交"
,
async
()
=>
{
await
flushPromises
();
await
wrapper
.
setData
({
formObj
:
{
remark
:
"驳"
.
repeat
(
201
),
},
});
await
wrapper
.
find
(
".approval-confirm"
).
trigger
(
"click"
);
await
flushPromises
();
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
text
()).
toContain
(
"审批备注不能超过200个字符"
);
expect
(
mockAuditGoodsOrderApplyRecord
).
not
.
toHaveBeenCalled
();
});
it
(
"驳回备注等于200个字符时允许提交"
,
async
()
=>
{
const
remark
=
"驳"
.
repeat
(
200
);
await
flushPromises
();
await
wrapper
.
setData
({
formObj
:
{
remark
}
});
await
wrapper
.
find
(
".approval-confirm"
).
trigger
(
"click"
);
await
flushPromises
();
expect
(
mockAuditGoodsOrderApplyRecord
).
toHaveBeenCalledWith
({
auditResult
:
2
,
orderCode
:
"ORDER-1"
,
remark
,
});
});
});
src/views/orderManage/components/approvalDialog.vue
View file @
0af7941
...
@@ -159,7 +159,9 @@
...
@@ -159,7 +159,9 @@
<
div
class
=
"sub-title"
>
审批备注
<
/div
>
<
div
class
=
"sub-title"
>
审批备注
<
/div
>
<
div
class
=
"form_div"
>
<
div
class
=
"form_div"
>
<
el
-
form
class
=
"edit-sub-block"
ref
=
"remarkForm"
:
model
=
"formObj"
label
-
width
=
"150px"
:
inline
=
"true"
>
<
el
-
form
class
=
"edit-sub-block"
ref
=
"remarkForm"
:
model
=
"formObj"
label
-
width
=
"150px"
:
inline
=
"true"
>
<
el
-
form
-
item
:
label
=
"info.approvalType == 1 ? '通过备注:' : '驳回备注:'"
prop
=
"remark"
:
rules
=
"
[{
required
:
info
.
approvalType
==
2
,
message
:
'请输入驳回备注'
,
trigger
:
'blur'
}
]
">
<
el
-
form
-
item
prop
=
"remark"
:
label
=
"Number(info.approvalType) === 1 ? '通过备注:' : '驳回备注:'"
:
rules
=
"remarkRules"
>
<
el
-
input
<
el
-
input
type
=
"textarea"
type
=
"textarea"
placeholder
=
"请输入"
placeholder
=
"请输入"
...
@@ -239,6 +241,20 @@ export default {
...
@@ -239,6 +241,20 @@ export default {
this
.
$emit
(
'dialogClose'
,
{
flag
:
newVal
}
)
this
.
$emit
(
'dialogClose'
,
{
flag
:
newVal
}
)
}
}
}
,
}
,
remarkRules
()
{
return
[
{
required
:
Number
(
this
.
info
.
approvalType
)
===
2
,
message
:
"请输入驳回备注"
,
trigger
:
"blur"
,
}
,
{
max
:
200
,
message
:
"审批备注不能超过200个字符"
,
trigger
:
[
"blur"
,
"change"
],
}
,
];
}
,
billerFullText
()
{
billerFullText
()
{
const
{
sellerName
,
merchantName
}
=
this
.
detailInfo
const
{
sellerName
,
merchantName
}
=
this
.
detailInfo
if
(
sellerName
&&
merchantName
)
return
`${sellerName
}
| ${merchantName
}
`
if
(
sellerName
&&
merchantName
)
return
`${sellerName
}
| ${merchantName
}
`
...
...
src/views/orderManage/order.vue
View file @
0af7941
...
@@ -116,6 +116,11 @@
...
@@ -116,6 +116,11 @@
<el-table-column
align=
"center"
label=
"订单类型"
prop=
"djOrderTypeLabel"
width=
"100"
/>
<el-table-column
align=
"center"
label=
"订单类型"
prop=
"djOrderTypeLabel"
width=
"100"
/>
<el-table-column
align=
"center"
label=
"审批状态"
prop=
"goodsOrderApplyStatusLabel"
width=
"120"
/>
<el-table-column
align=
"center"
label=
"审批状态"
prop=
"goodsOrderApplyStatusLabel"
width=
"120"
/>
<el-table-column
align=
"center"
label=
"原错误订单编号"
prop=
"incorrectOrderCodeDisplay"
width=
"160"
/>
<el-table-column
align=
"center"
label=
"原错误订单编号"
prop=
"incorrectOrderCodeDisplay"
width=
"160"
/>
<el-table-column
align=
"center"
label=
"商品名称"
prop=
"goodsNamesDisplay"
width=
"180"
show-overflow-tooltip
/>
<el-table-column
align=
"center"
label=
"订单时间"
prop=
"orderTimeStr"
width=
"160"
/>
<el-table-column
align=
"center"
label=
"订单时间"
prop=
"orderTimeStr"
width=
"160"
/>
<el-table-column
align=
"center"
label=
"支付时间"
prop=
"paySuccessDate"
width=
"160"
/>
<el-table-column
align=
"center"
label=
"支付时间"
prop=
"paySuccessDate"
width=
"160"
/>
<el-table-column
align=
"center"
label=
"客户姓名"
prop=
"customerName"
/>
<el-table-column
align=
"center"
label=
"客户姓名"
prop=
"customerName"
/>
...
...
src/views/orderManage/utils/orderListRowDisplay.js
View file @
0af7941
...
@@ -136,6 +136,17 @@ export function mapSubOrderDisplayItem(item, positionTypeList) {
...
@@ -136,6 +136,17 @@ export function mapSubOrderDisplayItem(item, positionTypeList) {
}
}
/**
/**
* @param {Array<{ goodsNameFull: string }>} subOrderDisplayList
* @returns {string} 商品名称汇总
*/
function
getGoodsNamesDisplay
(
subOrderDisplayList
)
{
return
subOrderDisplayList
.
map
(
item
=>
item
.
goodsNameFull
)
.
filter
(
name
=>
name
&&
name
!==
"-"
)
.
join
(
"、"
)
||
"-"
;
}
/**
* @param {object} row
* @param {object} row
* @param {object} ctx
* @param {object} ctx
* @param {object} ctx.maps
* @param {object} ctx.maps
...
@@ -186,6 +197,7 @@ export function mapOrderListRow(row, ctx) {
...
@@ -186,6 +197,7 @@ export function mapOrderListRow(row, ctx) {
customerTagsDisplay
:
formatCustomerTags
(
row
.
customerTags
),
customerTagsDisplay
:
formatCustomerTags
(
row
.
customerTags
),
actualDeliveryDateDisplay
:
formatActualDeliveryDate
(
row
.
actualDeliveryDate
),
actualDeliveryDateDisplay
:
formatActualDeliveryDate
(
row
.
actualDeliveryDate
),
subOrderDisplayList
,
subOrderDisplayList
,
goodsNamesDisplay
:
getGoodsNamesDisplay
(
subOrderDisplayList
),
packageNamesDisplay
:
packageNamesDisplay
||
"-"
,
packageNamesDisplay
:
packageNamesDisplay
||
"-"
,
djOrderTypeLabel
:
row
.
djOrderType
?
(
djOrderTypeMap
[
row
.
djOrderType
]
||
"-"
)
:
"-"
,
djOrderTypeLabel
:
row
.
djOrderType
?
(
djOrderTypeMap
[
row
.
djOrderType
]
||
"-"
)
:
"-"
,
goodsOrderApplyStatusLabel
:
row
.
goodsOrderApplyStatus
goodsOrderApplyStatusLabel
:
row
.
goodsOrderApplyStatus
...
@@ -329,6 +341,7 @@ export function mapCarDamageListRow(row, ctx) {
...
@@ -329,6 +341,7 @@ export function mapCarDamageListRow(row, ctx) {
customerTagsDisplay
:
formatCustomerTags
(
row
.
customerTags
),
customerTagsDisplay
:
formatCustomerTags
(
row
.
customerTags
),
actualDeliveryDateDisplay
:
formatActualDeliveryDate
(
row
.
actualDeliveryDate
),
actualDeliveryDateDisplay
:
formatActualDeliveryDate
(
row
.
actualDeliveryDate
),
subOrderDisplayList
,
subOrderDisplayList
,
goodsNamesDisplay
:
getGoodsNamesDisplay
(
subOrderDisplayList
),
djOrderTypeLabel
:
row
.
djOrderType
?
(
djOrderTypeMap
[
row
.
djOrderType
]
||
"-"
)
:
"-"
,
djOrderTypeLabel
:
row
.
djOrderType
?
(
djOrderTypeMap
[
row
.
djOrderType
]
||
"-"
)
:
"-"
,
goodsOrderApplyStatusLabel
:
row
.
goodsOrderApplyStatus
goodsOrderApplyStatusLabel
:
row
.
goodsOrderApplyStatus
?
(
auditStatusMap
[
row
.
goodsOrderApplyStatus
]
||
"-"
)
?
(
auditStatusMap
[
row
.
goodsOrderApplyStatus
]
||
"-"
)
...
...
src/views/orderManage/utils/orderListRowDisplay.spec.js
View file @
0af7941
...
@@ -40,4 +40,36 @@ describe("订单列表日报字段显示", () => {
...
@@ -40,4 +40,36 @@ describe("订单列表日报字段显示", () => {
customerTagsDisplay
:
"已触客,已交付引荐"
,
customerTagsDisplay
:
"已触客,已交付引荐"
,
});
});
});
});
it
(
"精品订单聚合所有子订单商品名称"
,
()
=>
{
const
row
=
mapOrderListRow
({
subOrderList
:
[
{
upgradeGoodsId
:
1
,
upgradeGoodsName
:
"升级商品A"
,
},
{
baseGoodsName
:
"基础商品B"
,
},
],
},
{
maps
:
{}
});
expect
(
row
.
goodsNamesDisplay
).
toBe
(
"升级商品A、基础商品B"
);
});
it
(
"权益订单聚合所有子订单商品名称"
,
()
=>
{
const
row
=
mapCarDamageListRow
({
subOrderList
:
[
{
upgradeGoodsId
:
1
,
upgradeGoodsName
:
"权益商品A"
,
},
{
baseGoodsName
:
"权益商品B"
,
},
],
},
{
maps
:
{}
});
expect
(
row
.
goodsNamesDisplay
).
toBe
(
"权益商品A、权益商品B"
);
});
});
});
Write
Preview
Markdown
is supported
Attach a file
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 post a comment