Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 806ffe37
authored
May 13, 2026
by
岑成威
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix:战败
1 parent
3784aebe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
189 additions
and
107 deletions
packageEquity/pages/createDeafeatOrder/createDeafeatOrder.js
packageEquity/pages/createDeafeatOrder/createDeafeatOrder.wxml
tabWorkOrder/pages/defeatOrder/defeatOrder.js
packageEquity/pages/createDeafeatOrder/createDeafeatOrder.js
View file @
806ffe3
import
{
ImgUrl
}
from
'~/config'
import
{
ImgUrl
}
from
'~/config'
import
{
quotation
GoodsList
,
defeatOrderCreate
}
from
'../../api'
import
{
getSelectOrder
GoodsList
,
defeatOrderCreate
}
from
'../../api'
import
commonApi
from
'~/api/api'
import
commonApi
from
'~/api/api'
import
NP
from
'number-precision'
import
NP
from
'number-precision'
import
{
checkStudyTask
,
checkAbnormalOrder
}
from
'~/store/ModalToQueueControl'
import
{
checkStudyTask
,
checkAbnormalOrder
}
from
'~/store/ModalToQueueControl'
...
@@ -127,9 +127,9 @@ Page({
...
@@ -127,9 +127,9 @@ Page({
onLoad
:
async
function
(
res
)
{
onLoad
:
async
function
(
res
)
{
this
.
setTimeList
()
this
.
setTimeList
()
this
.
handlerUserInfo
()
this
.
handlerUserInfo
()
this
.
getGoodsProduct
()
await
this
.
prefillRecentScene
()
await
this
.
prefillRecentScene
()
this
.
getUserSceneList
()
this
.
getUserSceneList
()
this
.
getGoodsProduct
()
},
},
onRoute
(
options
)
{
onRoute
(
options
)
{
...
@@ -209,12 +209,22 @@ Page({
...
@@ -209,12 +209,22 @@ Page({
onConfirmSceneSelect
(
e
)
{
onConfirmSceneSelect
(
e
)
{
const
scene
=
e
.
detail
.
value
||
{}
const
scene
=
e
.
detail
.
value
||
{}
const
userInfo
=
this
.
data
.
userInfo
||
wx
.
$util
.
getUserInfo
()
||
{}
const
userInfo
=
this
.
data
.
userInfo
||
wx
.
$util
.
getUserInfo
()
||
{}
this
.
setData
({
const
prevCode
=
this
.
data
.
orderObj
?.
baseSceneCode
||
''
showSceneSelect
:
false
,
const
nextCode
=
scene
.
baseSceneCode
||
''
'orderObj.baseSceneCode'
:
scene
.
baseSceneCode
||
''
,
const
switched
=
prevCode
!==
nextCode
'orderObj.baseSceneName'
:
scene
.
name
||
scene
.
staffName
||
''
,
this
.
setData
(
'orderObj.sceneType'
:
scene
.
sceneType
{
})
showSceneSelect
:
false
,
'orderObj.baseSceneCode'
:
nextCode
,
'orderObj.baseSceneName'
:
scene
.
name
||
scene
.
staffName
||
''
,
'orderObj.sceneType'
:
scene
.
sceneType
},
()
=>
{
if
(
switched
)
{
this
.
getGoodsProduct
()
}
}
)
scene
.
baseSceneCode
&&
scene
.
baseSceneCode
&&
commonApi
commonApi
.
saveUserScene
({
.
saveUserScene
({
...
@@ -278,15 +288,34 @@ Page({
...
@@ -278,15 +288,34 @@ Page({
const
params
=
await
this
.
handlerParams
()
const
params
=
await
this
.
handlerParams
()
this
.
toPostData
(
params
,
0
)
this
.
toPostData
(
params
,
0
)
},
},
// 获取商品列表数据
// 获取商品列表数据
(与车损报价一致:按 sceneType=0 + baseSceneCode 拉可选商品)
getGoodsProduct
()
{
getGoodsProduct
()
{
let
{
default4SStoreInfo
}
=
wx
.
$util
.
getUserInfo
()
const
{
default4SStoreInfo
}
=
wx
.
$util
.
getUserInfo
()
||
{}
quotationGoodsList
({
const
baseSceneCode
=
this
.
data
.
orderObj
?.
baseSceneCode
||
''
if
(
!
default4SStoreInfo
?.
merchantId
||
!
baseSceneCode
)
{
this
.
setDefailtInfo
([])
return
}
wx
.
showLoading
({
title
:
'加载中...'
})
getSelectOrderGoodsList
({
merchantId
:
default4SStoreInfo
.
merchantId
,
merchantId
:
default4SStoreInfo
.
merchantId
,
suitCarPrice
:
''
suitCarPrice
:
''
,
seriesId
:
''
,
sceneType
:
0
,
baseSceneCode
})
})
.
then
(
result
=>
{
.
then
(
result
=>
{
let
{
data
}
=
result
wx
.
hideLoading
()
let
{
code
,
data
,
message
}
=
result
if
(
code
!=
0
)
{
wx
.
$util
.
showToast
(
message
||
'商品加载失败'
)
this
.
setDefailtInfo
([])
return
}
if
(
!
data
?.
length
)
{
this
.
setDefailtInfo
([])
return
}
data
=
data
.
map
(
ele
=>
{
data
=
data
.
map
(
ele
=>
{
if
(
ele
.
goods
)
{
if
(
ele
.
goods
)
{
...
@@ -332,7 +361,9 @@ Page({
...
@@ -332,7 +361,9 @@ Page({
this
.
setDefailtInfo
(
data
)
this
.
setDefailtInfo
(
data
)
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
wx
.
hideLoading
()
console
.
log
(
err
)
console
.
log
(
err
)
this
.
setDefailtInfo
([])
})
})
},
},
// 乘以100保留两位小数点
// 乘以100保留两位小数点
...
@@ -356,7 +387,7 @@ Page({
...
@@ -356,7 +387,7 @@ Page({
// 处理默认隐藏信息
// 处理默认隐藏信息
setDefailtInfo
(
data
)
{
setDefailtInfo
(
data
)
{
let
vdQuotationGoodsList
=
[]
let
vdQuotationGoodsList
=
[]
if
(
Array
.
isArray
(
data
))
{
if
(
Array
.
isArray
(
data
)
&&
data
.
length
&&
data
[
0
]
)
{
let
item
=
data
[
0
]
let
item
=
data
[
0
]
if
(
item
.
goods
)
{
if
(
item
.
goods
)
{
...
...
packageEquity/pages/createDeafeatOrder/createDeafeatOrder.wxml
View file @
806ffe3
...
@@ -9,20 +9,21 @@
...
@@ -9,20 +9,21 @@
</calendar>
</calendar>
</view>
</view>
<view class="wrapper">
<view class="wrapper">
<view class="cell">
<view class="cell">
<gl-cell border valueAlign="right" label="
推荐人员" requiredAfter labelWidth="var(--fontSize140)" required haveArrow bindclick="showPopup" data-show-name="selesBox
" placeholder="点击选择">
<gl-cell border valueAlign="right" label="
场景名称" requiredAfter labelWidth="var(--fontSize140)" required haveArrow bindclick="showPopup" data-show-name="showSceneSelect
" placeholder="点击选择">
<view class="between">
<view class="between">
<view class="start text-hide {{ orderObj.
employeeName?'':'placeholder-class' }}">{{orderObj.employe
eName || '请选择'}}</view>
<view class="start text-hide {{ orderObj.
baseSceneName?'':'placeholder-class' }}">{{orderObj.baseScen
eName || '请选择'}}</view>
</view>
</view>
</gl-cell>
</gl-cell>
</view>
</view>
<view class="cell">
<view class="cell">
<gl-cell border valueAlign="right" label="
场景名称" requiredAfter labelWidth="var(--fontSize140)" required haveArrow bindclick="showPopup" data-show-name="showSceneSelect
" placeholder="点击选择">
<gl-cell border valueAlign="right" label="
推荐人员" requiredAfter labelWidth="var(--fontSize140)" required haveArrow bindclick="showPopup" data-show-name="selesBox
" placeholder="点击选择">
<view class="between">
<view class="between">
<view class="start text-hide {{ orderObj.
baseSceneName?'':'placeholder-class' }}">{{orderObj.baseScen
eName || '请选择'}}</view>
<view class="start text-hide {{ orderObj.
employeeName?'':'placeholder-class' }}">{{orderObj.employe
eName || '请选择'}}</view>
</view>
</view>
</gl-cell>
</gl-cell>
</view>
</view>
<view class="cell two-cell">
<view class="cell two-cell">
<gl-cell border valueAlign="right" label="车主姓名" titleBtn="客户档案" bindtitleClick="showCustomPop" data-index="{{ ind }}" requiredAfter labelWidth="var(--fontSize390)" required>
<gl-cell border valueAlign="right" label="车主姓名" titleBtn="客户档案" bindtitleClick="showCustomPop" data-index="{{ ind }}" requiredAfter labelWidth="var(--fontSize390)" required>
<input placeholder="点击输入" class="input" placeholder-class="placeholder-class" maxlength="16" value="{{ customer.customerName }}" bindinput="input" data-index="{{ ind }}" data-name="customer.customerName" always-embed></input>
<input placeholder="点击输入" class="input" placeholder-class="placeholder-class" maxlength="16" value="{{ customer.customerName }}" bindinput="input" data-index="{{ ind }}" data-name="customer.customerName" always-embed></input>
...
...
tabWorkOrder/pages/defeatOrder/defeatOrder.js
View file @
806ffe3
...
@@ -434,7 +434,7 @@ Page({
...
@@ -434,7 +434,7 @@ Page({
//返回角度 /Math.atan()返回数字的反正切值
//返回角度 /Math.atan()返回数字的反正切值
return
(
360
*
Math
.
atan
(
_Y
/
_X
))
/
(
2
*
Math
.
PI
)
return
(
360
*
Math
.
atan
(
_Y
/
_X
))
/
(
2
*
Math
.
PI
)
},
},
showPopup
(
e
)
{
async
showPopup
(
e
)
{
let
{
copyGoodsData
,
baseConfigData
}
=
this
.
data
let
{
copyGoodsData
,
baseConfigData
}
=
this
.
data
let
payload
=
{
let
payload
=
{
...(
e
.
currentTarget
?.
dataset
||
{}),
...(
e
.
currentTarget
?.
dataset
||
{}),
...
@@ -451,8 +451,41 @@ Page({
...
@@ -451,8 +451,41 @@ Page({
}
}
let
arr
=
[]
let
arr
=
[]
if
(
showName
==
'goodsBox'
)
{
if
(
showName
==
'goodsBox'
)
{
const
{
orderObj
,
notUpgradeOrderList
}
=
this
.
data
const
row
=
notUpgradeOrderList
?.[
index
]
const
needRefetch
=
orderObj
?.
merchantId
&&
row
?.
baseSceneCode
&&
(
row
.
baseSceneCode
!==
(
orderObj
.
baseSceneCode
||
''
)
||
String
(
row
.
sceneType
??
''
)
!==
String
(
orderObj
.
sceneType
??
''
))
if
(
needRefetch
)
{
wx
.
$util
.
showLoading
(
'加载中...'
)
await
new
Promise
(
r
=>
this
.
setData
(
{
selectCustomIndex
:
index
,
'orderObj.baseSceneCode'
:
row
.
baseSceneCode
,
'orderObj.baseSceneName'
:
row
.
baseSceneName
||
''
,
'orderObj.sceneType'
:
row
.
sceneType
},
r
)
)
try
{
await
this
.
getOrderBaseGoodsList
(
orderObj
.
merchantId
,
row
.
sceneType
,
row
.
baseSceneCode
)
}
catch
(
err
)
{
console
.
log
(
err
)
}
wx
.
hideLoading
()
}
copyGoodsData
=
this
.
data
.
copyGoodsData
baseConfigData
=
this
.
data
.
baseConfigData
// type 产品类型 1前挡 2侧后挡 3天窗 根据类型过滤显示商品弹窗数据
// type 产品类型 1前挡 2侧后挡 3天窗 根据类型过滤显示商品弹窗数据
copyGoodsData
?.
forEach
(
(
val
,
index
)
=>
{
copyGoodsData
?.
forEach
(
val
=>
{
// 精品 4是其他商品 goodsType 是1 和自定义都是精品,剩下就是其他精品
// 精品 4是其他商品 goodsType 是1 和自定义都是精品,剩下就是其他精品
// val.goodsType == 1 || val.goodsType == baseConfigData?.selfBuildFilmType
// val.goodsType == 1 || val.goodsType == baseConfigData?.selfBuildFilmType
...
@@ -687,102 +720,119 @@ Page({
...
@@ -687,102 +720,119 @@ Page({
sceneType
=
this
.
data
.
orderObj
.
sceneType
,
sceneType
=
this
.
data
.
orderObj
.
sceneType
,
baseSceneCode
baseSceneCode
)
{
)
{
if
(
!
merchantId
)
return
Promise
.
resolve
()
const
positionTypeList
=
(
await
getPositionList
())
||
[]
const
positionTypeList
=
(
await
getPositionList
())
||
[]
// 获取配置服务数据
// 获取配置服务数据
let
baseConfigData
=
await
setConfigInfo
(
app
.
globalData
)
let
baseConfigData
=
await
setConfigInfo
(
app
.
globalData
)
let
{
const
orderObj
=
this
.
data
.
orderObj
||
{}
frontGearArr
,
// 前挡
// 与新建工单一致:请求始终带 baseSceneCode,由后端按场景过滤;切换场景时须用新编码而非历史缓存
sideBeforeRearGearArr
,
// 前侧窗玻璃
const
resolvedBaseSceneCode
=
sideRearGearArr
,
// 侧后挡
baseSceneCode
!==
undefined
&&
baseSceneCode
!==
null
sideAfterRearGearArr
,
// 后档
?
baseSceneCode
skylightArr
,
// 天窗
:
orderObj
.
baseSceneCode
||
''
otherGoodsArr
// 每次拉取重新分桶,避免在原有数组上 push 导致切换场景后商品脏数据
}
=
this
.
data
let
frontGearArr
=
[]
let
sideBeforeRearGearArr
=
[]
let
sideRearGearArr
=
[]
let
sideAfterRearGearArr
=
[]
let
skylightArr
=
[]
let
otherGoodsArr
=
[]
this
.
setData
({
this
.
setData
({
positionTypeList
,
positionTypeList
,
baseConfigData
baseConfigData
})
})
api
return
new
Promise
((
resolve
,
reject
)
=>
{
.
getOrderBaseGoodsList
({
api
merchantId
,
.
getOrderBaseGoodsList
({
sceneType
,
merchantId
,
...(
baseSceneCode
?
{
baseSceneCode
}
:
{}),
sceneType
,
upradeFlag
:
'N'
baseSceneCode
:
resolvedBaseSceneCode
,
})
upradeFlag
:
'N'
.
then
(
res
=>
{
})
let
{
code
,
data
,
message
}
=
res
.
then
(
res
=>
{
if
(
code
==
0
)
{
let
{
code
,
data
,
message
}
=
res
wx
.
hideLoading
()
if
(
code
==
0
)
{
// 筛选出太阳膜商品 goodsType 1太阳膜 自建商品-太阳膜 其他精品也带上
wx
.
hideLoading
()
let
arrData
=
[]
// 筛选出太阳膜商品 goodsType 1太阳膜 自建商品-太阳膜 其他精品也带上
data
?.
forEach
(
val
=>
{
let
arrData
=
[]
// [1, baseConfigData?.selfBuildFilmType].includes(val.goodsType)
data
?.
forEach
(
val
=>
{
arrData
.
push
(
val
)
// [1, baseConfigData?.selfBuildFilmType].includes(val.goodsType)
val
?.
upgradeGoodsList
?.
forEach
(
subVal
=>
{
arrData
.
push
(
val
)
subVal
.
merchantGoodsId
=
subVal
.
id
val
?.
upgradeGoodsList
?.
forEach
(
subVal
=>
{
if
([
1
].
includes
(
subVal
.
merchantGoodsPosition
))
{
subVal
.
merchantGoodsId
=
subVal
.
id
frontGearArr
.
push
(
subVal
)
if
([
1
].
includes
(
subVal
.
merchantGoodsPosition
))
{
}
frontGearArr
.
push
(
subVal
)
if
([
2
].
includes
(
subVal
.
merchantGoodsPosition
))
{
}
sideBeforeRearGearArr
.
push
(
subVal
)
if
([
2
].
includes
(
subVal
.
merchantGoodsPosition
))
{
}
sideBeforeRearGearArr
.
push
(
subVal
)
if
([
3
].
includes
(
subVal
.
merchantGoodsPosition
))
{
}
sideRearGearArr
.
push
(
subVal
)
if
([
3
].
includes
(
subVal
.
merchantGoodsPosition
))
{
}
sideRearGearArr
.
push
(
subVal
)
if
([
4
].
includes
(
subVal
.
merchantGoodsPosition
))
{
}
sideAfterRearGearArr
.
push
(
subVal
)
if
([
4
].
includes
(
subVal
.
merchantGoodsPosition
))
{
}
sideAfterRearGearArr
.
push
(
subVal
)
if
([
5
,
6
,
7
].
includes
(
subVal
.
merchantGoodsPosition
))
{
}
skylightArr
.
push
(
subVal
)
if
([
5
,
6
,
7
].
includes
(
subVal
.
merchantGoodsPosition
))
{
}
skylightArr
.
push
(
subVal
)
if
(
}
!
[
1
,
baseConfigData
?.
selfBuildFilmType
].
includes
(
val
.
goodsType
)
if
(
)
{
!
[
1
,
baseConfigData
?.
selfBuildFilmType
].
includes
(
val
.
goodsType
)
otherGoodsArr
.
push
(
subVal
)
)
{
}
otherGoodsArr
.
push
(
subVal
)
})
}
})
})
let
goodsData
=
arrData
const
filterList
=
goodsData
.
reduce
((
list
,
item
)
=>
{
item
.
upgradeGoodsList
.
forEach
(
val
=>
{
val
.
positionStr
=
positionTypeList
.
filter
(
v
=>
v
.
positionValue
==
val
.
merchantGoodsPosition
)[
0
]?.
positionName
})
})
item
.
upgradeGoodsList
&&
list
.
push
(...
item
.
upgradeGoodsList
)
let
goodsData
=
arrData
return
list
goodsData
.
reduce
((
list
,
item
)
=>
{
},
[])
item
.
upgradeGoodsList
.
forEach
(
val
=>
{
data
.
forEach
(
item
=>
{
val
.
positionStr
=
positionTypeList
.
filter
(
item
.
upgradeGoodsList
.
forEach
(
v
=>
{
v
=>
v
.
positionValue
==
val
.
merchantGoodsPosition
v
.
price
=
0
)[
0
]?.
positionName
v
.
shopMinPrice
=
0
})
v
.
upgradePrice
=
0
item
.
upgradeGoodsList
&&
list
.
push
(...
item
.
upgradeGoodsList
)
v
.
totalPrice
=
0
return
list
v
.
number
=
1
},
[])
data
.
forEach
(
item
=>
{
item
.
upgradeGoodsList
.
forEach
(
v
=>
{
v
.
price
=
0
v
.
shopMinPrice
=
0
v
.
upgradePrice
=
0
v
.
totalPrice
=
0
v
.
number
=
1
})
})
})
})
this
.
setData
(
this
.
setData
({
{
goodsData
,
goodsData
,
frontGearArr
,
frontGearArr
,
sideBeforeRearGearArr
,
sideBeforeRearGearArr
,
sideAfterRearGearArr
,
sideAfterRearGearArr
,
sideRearGearArr
,
sideRearGearArr
,
skylightArr
,
skylightArr
,
otherGoodsArr
,
otherGoodsArr
,
copyGoodsData
:
goodsData
copyGoodsData
:
goodsData
})
},
// 仅有一件商品 默认选中
()
=>
{
// console.log(goodsData.length == 1 && goodsData[0].upgradeGoodsList.length == 1, 'goodsData.length == 1 && goodsData[0].upgradeGoodsList.length == 1');
if
(
if
(
goodsData
.
length
==
1
&&
goodsData
.
length
==
1
&&
goodsData
[
0
].
upgradeGoodsList
.
length
==
1
goodsData
[
0
].
upgradeGoodsList
.
length
==
1
)
{
)
{
this
.
defaultChoose
(
0
)
this
.
defaultChoose
(
0
)
}
resolve
(
data
)
}
)
}
else
{
wx
.
hideLoading
()
wx
.
$util
.
showToast
(
message
)
reject
(
new
Error
(
message
||
'getOrderBaseGoodsList'
))
}
}
}
else
{
})
wx
.
$util
.
showToast
(
message
)
.
catch
(
err
=>
{
}
wx
.
hideLoading
()
})
reject
(
err
)
})
})
},
},
defaultChoose
(
index
)
{
defaultChoose
(
index
)
{
...
...
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