Commit 86091edf by cen

fix: 修改工单确认参数

1 parent 3f99d20b
......@@ -50,7 +50,7 @@
</view>
</view>
<view class="good-list">
<view class="good pt-16" v-for="(item, index) in orderInfo.subOrderList">
<view class="good mt-16" v-for="(item, index) in orderInfo.subOrderList">
<view class="flex justify-between align-center">
<text class="good-name">商品名称:{{ replaceItemText(item.upgradeGoodsName) || '' }}</text>
<text class="good-price">¥{{ item.price }}</text>
......@@ -231,7 +231,7 @@ export default {
this.getPositionList()
// "this.transmissionOfData.orderCode"
this.getDetail(this.transmissionOfData.orderCode)
this.successDate = dayjs().format('YYYY-MM-DD HH:mm:ss')
this.successDate = dayjs().format('YYYY-MM-DD 00:00:00')
}
},
immediate: true
......@@ -306,11 +306,6 @@ export default {
total_price += item.totalPrice
})
// 处理subOrderList 商品为空的情况
data.subOrderList = data.subOrderList.filter(item => item.merchantGoodsId)
if (data.packageGoodsList && data.packageGoodsList.length) {
data.subOrderList = data.subOrderList.concat(data.packageGoodsList)
}
data = {
...data.customer,
...data.payOrder,
......@@ -370,38 +365,6 @@ export default {
// }
})
},
async getPackageGoodsDetail(orderCode) {
try {
let params = {
orderCode
}
let { total_price } = this.orderInfo
uni.$api.boutiqueApi.getPackageGoodsDetail(params).then(res => {
res.data?.packageGoodsList.forEach(item => {
item.packageGoodsOrderList.forEach(g => {
g.price = g.totalPrice ? Number(g.totalPrice) / Number(g.number) : g.upgradePrice
})
item.goodsList = item.packageGoodsOrderList
item.price = item.goodsList.reduce((prev, cur) => {
return prev + Number(cur.totalPrice) / Number(cur.number)
}, 0)
item.count = item.goodsList.length ? item.goodsList[0].number : 1
let total = item.price * item.count
item.totalPrice = utils.decimal(total, 2)
item.packageGoodsOrderList.forEach(g => {
g.positionStr = this.positionTypeList.filter(v => v.positionValue == g.upgradeGoodsPosition)[0]?.positionName || ''
})
total_price = Number(total_price) + Number(item.totalPrice)
})
if (res.code == 0) {
this.packageGoodsList = res.data.packageGoodsList
this.orderInfo.total_price = Number(utils.decimal(total_price, 2)).toFixed(2)
}
})
} catch (err) {}
},
async getPositionList() {
const res = await uni.$api.boutiqueApi.getPositionList({})
this.positionTypeList = res
......@@ -413,6 +376,14 @@ export default {
this.checkPayType()
},
edit() {
const data = { ...this.orderInfo }
// 处理subOrderList 商品为空的情况
data.subOrderList = data.subOrderList.filter(item => item.merchantGoodsId)
if (data.packageGoodsList && data.packageGoodsList.length) {
data.subOrderList = data.subOrderList.concat(data.packageGoodsList)
}
// 商品是否包含太阳膜
data.isFilmOrder = data.subOrderList?.findIndex(subE => subE?.upgradeGoodsType == 1) > -1
this.$emit('jump', 'CreateOrder', { paramsData: this.orderInfo, type: 'editWithPay' })
},
confirmDate(date) {
......@@ -716,6 +687,9 @@ export default {
.ml-12 {
margin-left: toRpx(12);
}
.mt-16 {
margin-top: toRpx(16);
}
.py-8 {
padding: toRpx(8) 0;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!