Commit fea1ca41 by 张立顺

fix bug

1 parent 5c6e5616
......@@ -451,7 +451,7 @@ Page({
let { subOrderList } = e.detail
for (var i = 0; i < subOrderList.length; i++) {
if ((subOrderList[i]?.materialsUsed ?? '') === '') {
return wx.$util.showToast('产品实际用料不能为空')
return wx.$util.showToast('退料入库数量不能为空')
}
}
const arr = subOrderList?.map(val => {
......@@ -594,9 +594,9 @@ Page({
mediaType: ['image'],
success(res) {
wx.showLoading({
title: '上传中...',
title: '上传中...'
})
const uploadImages = async (tempFiles) => {
const uploadImages = async tempFiles => {
try {
for (const item of tempFiles) {
const val = item.path
......@@ -624,7 +624,7 @@ Page({
}
}
} catch (error) {
wx.$util.showToast("上传失败,请重试")
wx.$util.showToast('上传失败,请重试')
} finally {
wx.hideLoading()
}
......
......@@ -28,39 +28,54 @@ Component({
selectTap() {
let { orderInfo } = this.data
let allOptions = []
if (orderInfo.selectPayType == 2) { // 门店收款订单查询退款可展示按钮
if (orderInfo.selectPayType == 2) {
// 门店收款订单查询退款可展示按钮
allOptions = ['标记退款', '退款详情']
// 查询订单可展示按钮
api.getMoreBtnAPI({orderCode: orderInfo.orderCode}).then(res => {
api.getMoreBtnAPI({ orderCode: orderInfo.orderCode }).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
moreSelectData: this.filterMoreSelectData(data.refundApplyButton, data.refundApplyDetailButton, allOptions, 1),
showSelect: !this.data.showSelect,
moreSelectData: this.filterMoreSelectData(
data.refundApplyButton,
data.refundApplyDetailButton,
allOptions,
1
),
showSelect: !this.data.showSelect
})
}
})
} else {
allOptions = ['申请退款', '退款详情']
// 查询订单可展示按钮
api.getMoreBtnAPI({orderCode: orderInfo.orderCode}).then(res => {
api.getMoreBtnAPI({ orderCode: orderInfo.orderCode }).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
moreSelectData: this.filterMoreSelectData(data.refundApplyButton, data.refundApplyDetailButton, allOptions, 2),
showSelect: !this.data.showSelect,
moreSelectData: this.filterMoreSelectData(
data.refundApplyButton,
data.refundApplyDetailButton,
allOptions,
2
),
showSelect: !this.data.showSelect
})
}
})
}
},
filterMoreSelectData(refundApplyButton, refundApplyDetailButton, allOptions, num) {
filterMoreSelectData(
refundApplyButton,
refundApplyDetailButton,
allOptions,
num
) {
const buttonType = num === 2 ? '申请退款' : '标记退款'
const conditions = {
[buttonType]: refundApplyButton === 'Y',
'退款详情': refundApplyDetailButton === 'Y'
退款详情: refundApplyDetailButton === 'Y'
}
return allOptions.filter(option => conditions[option])
},
......@@ -84,7 +99,8 @@ Component({
let userInfo = wx.$util.getUserInfo()
if (item == '申请退款' || item == '标记退款') {
// 申请退款点击埋点
if (item == '申请退款') wx.$track.setTrackData(0, 'apply_refund_page', {}, '', 1)
if (item == '申请退款')
wx.$track.setTrackData(0, 'apply_refund_page', {}, '', 1)
// 退款申请时区域运营查询
api
.areaSupervisionExistsAPI({
......@@ -101,7 +117,11 @@ Component({
})
} else {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?orderCode=${orderInfo.orderCode}&shopMerchantName=${orderInfo.merchantName}&shopMerchantId=${orderInfo.merchantId}&refundPayType=${orderInfo.selectPayType == 2 ? 2 : 1}`
url: `/tabWorkOrder/pages/refundApply/refundApply?orderCode=${
orderInfo.orderCode
}&shopMerchantName=${orderInfo.merchantName}&shopMerchantId=${
orderInfo.merchantId
}&refundPayType=${orderInfo.selectPayType == 2 ? 2 : 1}`
})
this.closeSelect()
}
......@@ -111,23 +131,28 @@ Component({
})
} else {
// 退款详情点击埋点
if (orderInfo?.selectPayType != 2) wx.$track.setTrackData(0, 'refund_detail_page', {}, '', 1)
if (orderInfo?.selectPayType != 2)
wx.$track.setTrackData(0, 'refund_detail_page', {}, '', 1)
// 点击退款详情,判断是否存在多条退款申请记录,存在跳转列表页,不存在直接跳转详情页
api.getRefundDetailListAPI({orderCode: orderInfo.orderCode}).then(res => {
let { code, data } = res
if (code == 0) {
if (data?.length > 1) {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundDetailList/refundDetailList?orderCode=${orderInfo.orderCode}`,
})
} else if (data.length == 1) {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${data[0].applyCode}&refundPayType=${orderInfo.selectPayType == 2 ? 2 : 1}`,
})
api
.getRefundDetailListAPI({ orderCode: orderInfo.orderCode })
.then(res => {
let { code, data } = res
if (code == 0) {
if (data?.length > 1) {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundDetailList/refundDetailList?orderCode=${orderInfo.orderCode}`
})
} else if (data.length == 1) {
wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${
data[0].applyCode
}&refundPayType=${orderInfo.selectPayType == 2 ? 2 : 1}`
})
}
this.closeSelect()
}
this.closeSelect()
}
})
})
}
this.setData({
......
......@@ -53,28 +53,28 @@ Page({
this.setData(
{
sublistVisible: false
},
() => {
wx.setPageStyle({
style: {
overflow: 'unset'
}
})
}
// () => {
// wx.setPageStyle({
// style: {
// overflow: 'unset'
// }
// })
// }
)
},
constructionCancel() {
this.setData(
{
constructionVisible: false
},
() => {
wx.setPageStyle({
style: {
overflow: 'unset'
}
})
}
// () => {
// wx.setPageStyle({
// style: {
// overflow: 'unset'
// }
// })
// }
)
// this.setData({
// constructionVisible: false
......@@ -89,14 +89,14 @@ Page({
this.setData(
{
[btnname]: true
},
() => {
wx.setPageStyle({
style: {
overflow: 'hidden'
}
})
}
// () => {
// wx.setPageStyle({
// style: {
// overflow: 'hidden'
// }
// })
// }
)
},
navOrderSignature() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!