Commit 105bfbe6 by 李伟康

Merge branch 'V4.56.0' of http://192.168.3.233:8090/glsx/gl_tape into V4.56.0

2 parents efdbbb4f 5aacd85a

2.61 MB | W: | H:

2.61 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin

2.93 KB | W: | H:

7.13 KB | W: | H:

assets/spritesmith/coupon.png
assets/spritesmith/coupon.png
assets/spritesmith/coupon.png
assets/spritesmith/coupon.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
closePopup() { closePopup() {
this.$refs.publishPopup.close() this.$refs.publishPopup.close()
if (this.reject) { if (this.reject) {
this.reject() this.resolve('关闭')
} }
this.$emit('close') this.$emit('close')
}, },
......
...@@ -236,7 +236,7 @@ export default { ...@@ -236,7 +236,7 @@ export default {
? this.showSelectType({ ? this.showSelectType({
item item
}) })
: this.$emit('jump', name, { paramsData: this.orderCardDetail, type: name == 'CreateOrder' ? 'createWithPay' : '' }) : this.$emit('jump', name, { paramsData: this.orderCardDetail, type: 'createWithPay' })
} else { } else {
utils.showNoAccess() utils.showNoAccess()
} }
......
...@@ -50,25 +50,25 @@ ...@@ -50,25 +50,25 @@
</view> </view>
</view> </view>
<view class="good-list"> <view class="good-list">
<view class="good" 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"> <view class="flex justify-between align-center">
<text class="good-name">商品名称:{{ replaceItemText(item.upgradeGoodsName) || '' }}</text> <text class="good-name">商品名称:{{ replaceItemText(item.upgradeGoodsName) || '' }}</text>
<text class="good-price">¥{{ item.price }}</text> <text class="good-price">¥{{ item.price }}</text>
</view> </view>
<view class="flex justify-between align-center pt-6"> <view class="flex justify-between align-center pt-12">
<text class="good-alias">商品别名:{{ replaceItemText(item.upgradeGoodsAlias) || '' }}</text> <text class="good-alias">商品别名:{{ replaceItemText(item.upgradeGoodsAlias) || '' }}</text>
</view> </view>
<view class="flex align-center pt-12"> <view class="flex align-center pt-24">
<text class="good-sku">{{ item.positionStr || item.upgradeGoodsTypeName }}</text> <text class="good-sku">{{ item.positionStr || item.upgradeGoodsTypeName }}</text>
<text class="good-count">x{{ item.number }}</text> <text class="good-count">x{{ item.number }}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="flex align-center py-8" v-if="orderInfo"> <view class="flex align-center py-16 coupon" v-if="orderInfo">
<view class="sprite-icon icon-coupon fs-14"></view> <view class="sprite-icon icon-coupon"></view>
<text class="fs-14 coupon-name">{{ orderInfo.couponName || '' }}{{ orderInfo.customerCoupon.customerCouponCode || '' }}({{ orderInfo.customerCoupon.employeeName || '' }})</text> <text class="fs-28 coupon-name">{{ orderInfo.couponName || '' }}{{ orderInfo.customerCoupon.customerCouponCode || '' }}({{ orderInfo.customerCoupon.employeeName || '' }})</text>
</view> </view>
<view class="flex justify-end align-center" v-if="orderInfo"> <view class="flex justify-end align-center mt-24" v-if="orderInfo">
<text class="good-total-lable">商品总金额:</text> <text class="good-total-lable">商品总金额:</text>
<text class="good-total-value"> <text class="good-total-value">
<text class="unit">¥</text> <text class="unit">¥</text>
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<view class="box-shell"> <view class="box-shell">
<view class="box-shell-title">工单信息</view> <view class="box-shell-title">工单信息</view>
<view class="order-info pt-16"> <view class="order-info pt-16">
<view v-for="(item, index) in orderObj" :key="index" class="flex align-center pt-8"> <view v-for="(item, index) in orderObj" :key="index" class="flex align-center pt-16">
<view class="label">{{ item.label }}</view> <view class="label">{{ item.label }}</view>
<view v-if="item.key == 'status'"> <view v-if="item.key == 'status'">
<view class="value" :style="{ color: status[orderInfo.status].color || '' }"> <view class="value" :style="{ color: status[orderInfo.status].color || '' }">
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
<view class="box-shell"> <view class="box-shell">
<view class="box-shell-title">客户信息</view> <view class="box-shell-title">客户信息</view>
<view class="order-info pt-16"> <view class="order-info pt-16">
<view class="flex align-center pt-8" v-for="(item, index) in customerObj" :key="index"> <view class="flex align-center pt-16" v-for="(item, index) in customerObj" :key="index">
<view class="label">{{ item.label }}</view> <view class="label">{{ item.label }}</view>
<view class="value" :style="{ color: item.color || '#333' }"> <view class="value" :style="{ color: item.color || '#333' }">
<view v-if="item.arr"> <view v-if="item.arr">
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
</PublishPopup> </PublishPopup>
<PublishPopup ref="calendarPopup" popupClass="calendarPopup" :showClose="false" :showTitle="false" @confirm="confirmCalendar"> <PublishPopup ref="calendarPopup" popupClass="calendarPopup" :showClose="false" :showTitle="false" @confirm="confirmCalendar">
<template #content> <template #content>
<uni-calendar class="calendar" :showMonth="false" @change="calendarChange" /> <uni-calendar class="calendar" :showMonth="false" :endDate="endDate" @change="calendarChange" />
</template> </template>
</PublishPopup> </PublishPopup>
<order-popup ref="openDate" popupType="13" @onConfirm="confirmDate" /> <order-popup ref="openDate" popupType="13" @onConfirm="confirmDate" />
...@@ -228,11 +228,10 @@ export default { ...@@ -228,11 +228,10 @@ export default {
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
console.log('接收到的交易数据:', newVal) console.log('接收到的交易数据:', newVal)
console.log(this.transmissionOfData, 'this.transmissionOfData')
this.getPositionList() this.getPositionList()
// "this.transmissionOfData.orderCode" // "this.transmissionOfData.orderCode"
this.getDetail(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 HH:mm:00')
} }
}, },
immediate: true immediate: true
...@@ -248,7 +247,8 @@ export default { ...@@ -248,7 +247,8 @@ export default {
selectDate: null, selectDate: null,
time: null, time: null,
wxqrcode: '', wxqrcode: '',
posQrCode: '' posQrCode: '',
endDate: dayjs().format('YYYY-MM-DD')
} }
}, },
mounted() { mounted() {
...@@ -306,6 +306,7 @@ export default { ...@@ -306,6 +306,7 @@ export default {
}) })
total_price += item.totalPrice total_price += item.totalPrice
}) })
data = { data = {
...data.customer, ...data.customer,
...data.payOrder, ...data.payOrder,
...@@ -336,9 +337,9 @@ export default { ...@@ -336,9 +337,9 @@ export default {
} }
} }
// 是2:门店收款 5:嘀加收款 6:对公转账 7:其它收款并且不是错误订单 自动打开门店收款弹窗 // 是2:门店收款 5:嘀加收款 6:对公转账 7:其它收款并且不是错误订单 自动打开门店收款弹窗
if (!_this.isErrorOrder && [2, 5, 6, 7].includes(Number(data.selectPayType))) { // if (!_this.isErrorOrder && [2, 5, 6, 7].includes(Number(data.selectPayType))) {
_this.toshowDateModal() // _this.toshowDateModal()
} // }
// 获取园区店技师配置信息 // 获取园区店技师配置信息
uni.$api.boutiqueApi uni.$api.boutiqueApi
.getQYTechnicianList({ .getQYTechnicianList({
...@@ -365,38 +366,6 @@ export default { ...@@ -365,38 +366,6 @@ export default {
// } // }
}) })
}, },
async getPackageGoodsDetail(orderCode) {
try {
let params = {
orderCode
}
let { total_price } = this.data.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() { async getPositionList() {
const res = await uni.$api.boutiqueApi.getPositionList({}) const res = await uni.$api.boutiqueApi.getPositionList({})
this.positionTypeList = res this.positionTypeList = res
...@@ -408,11 +377,20 @@ export default { ...@@ -408,11 +377,20 @@ export default {
this.checkPayType() this.checkPayType()
}, },
edit() { edit() {
this.$emit('jump', 'CreateOrder', { paramsData: this.orderInfo, type: 'editWithPay' }) const data = { ...this.orderInfo }
// 处理subOrderList 商品为空的情况
console.log(this.orderInfo, '跳转')
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: data, type: 'createWithPay' })
}, },
confirmDate(date) { confirmDate(date) {
const { chooseContent } = date const { chooseContent } = date
this.successDate = dayjs(chooseContent).format('YYYY-MM-DD HH:mm:ss') this.successDate = dayjs(chooseContent).format('YYYY-MM-DD HH:mm:00')
console.log(this.successDate) console.log(this.successDate)
}, },
calendarChange(date) { calendarChange(date) {
...@@ -693,12 +671,18 @@ export default { ...@@ -693,12 +671,18 @@ export default {
.pt-12 { .pt-12 {
padding-top: toRpx(12); padding-top: toRpx(12);
} }
.pt-24 {
padding-top: toRpx(24);
}
.fs-14 { .fs-14 {
font-size: toRpx(14); font-size: toRpx(14);
} }
.fs-32 { .fs-32 {
font-size: toRpx(32); font-size: toRpx(32);
} }
.fs-28 {
font-size: toRpx(28);
}
.fs-26 { .fs-26 {
font-size: toRpx(26); font-size: toRpx(26);
} }
...@@ -711,8 +695,14 @@ export default { ...@@ -711,8 +695,14 @@ export default {
.ml-12 { .ml-12 {
margin-left: toRpx(12); margin-left: toRpx(12);
} }
.py-8 { .mt-16 {
padding: toRpx(8) 0; margin-top: toRpx(16);
}
.mt-24 {
margin-top: toRpx(24);
}
.py-16 {
padding: toRpx(16) 0;
} }
.date-box { .date-box {
display: flex; display: flex;
...@@ -850,6 +840,7 @@ export default { ...@@ -850,6 +840,7 @@ export default {
color: #999999; color: #999999;
font-size: toRpx(24); font-size: toRpx(24);
font-weight: 400; font-weight: 400;
margin-right: toRpx(24);
} }
.good-count { .good-count {
color: #999999; color: #999999;
...@@ -858,12 +849,16 @@ export default { ...@@ -858,12 +849,16 @@ export default {
} }
} }
} }
.coupon-name { .coupon {
color: #292d33; border-bottom: 1px solid #f7f7f6;
font-size: toRpx(24); .coupon-name {
font-weight: 400; color: #292d33;
margin-left: toRpx(8); font-size: toRpx(28);
font-weight: 400;
margin-left: toRpx(8);
}
} }
.good-total-lable { .good-total-lable {
color: #757980; color: #757980;
font-size: toRpx(28); font-size: toRpx(28);
...@@ -889,6 +884,8 @@ export default { ...@@ -889,6 +884,8 @@ export default {
color: #222222; color: #222222;
font-size: toRpx(26); font-size: toRpx(26);
font-weight: 400; font-weight: 400;
white-space: wrap;
flex: 1;
} }
} }
} }
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
<Product :key="slotName" v-if="orderObj[slotName] && orderObj[slotName].length" @changeTotalPrice="changeTotalPrice" :list="orderObj[slotName]" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product> <Product :key="slotName" v-if="orderObj[slotName] && orderObj[slotName].length" @changeTotalPrice="changeTotalPrice" :list="orderObj[slotName]" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product>
</template> </template>
<template slot="package"> <template slot="package">
<Package v-if="orderObj.package" :list="orderObj.package" :positionTypeList="positionTypeList"></Package> <Package v-if="orderObj.package" @changeTotalPrice="changeTotalPrice" :list="orderObj.package" :positionTypeList="positionTypeList"></Package>
</template> </template>
<template slot="skuGoods"> <template slot="skuGoods">
<SkuGoods v-if="orderObj.skuGoods" :list="orderObj.skuGoods" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></SkuGoods> <SkuGoods v-if="orderObj.skuGoods" :list="orderObj.skuGoods" @changeTotalPrice="changeTotalPrice" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></SkuGoods>
<view class="total" v-if="totalPrice > 0"> <view class="total" v-if="totalPrice > 0">
<view class="total-left">总价</view> <view class="total-left">总价</view>
<view class="total-right">¥{{ totalPrice }}</view> <view class="total-right">¥{{ totalPrice }}</view>
...@@ -68,8 +68,71 @@ export default { ...@@ -68,8 +68,71 @@ export default {
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
console.log('接收到的交易数据:', newVal) console.log('接收到的交易数据:', newVal)
// this.orderObj.customer = newVal.customer // 处理交易数据
this.$set(this.orderObj, 'customer', newVal.customer) const handleTransactionData = newVal => {
this.orderCreateType = newVal.type
// 新增订单处理
const {
paramsData: { customer, customerCoupon, ...rest }
} = newVal
// 基础字段映射
const baseFields = ['id', 'orderCode', 'userId', 'employeeName', 'deliveryEmployeeName', 'deliveryUserId', 'subShopMerchantName', 'subShopMerchantId', 'sellerName', 'sellerUserId', 'sellerMerchantName', 'sellerMerchantId', 'merchantId', 'merchantName', 'customerCouponId', 'selectPayType']
Object.assign(this.orderObj, Object.fromEntries(baseFields.map(field => [field, rest[field]])))
// 设置支付类型
this.orderObj.payeeType = rest.selectPayType === '2' ? '1' : '0'
// 客户信息映射
const customerFields = ['customerName', 'customerSex', 'customerPhone', 'salesType', 'standNo', 'plateNumber', 'experienceFlag']
Object.assign(this.orderObj, Object.fromEntries(customerFields.map(field => [field, customer[field]])))
// 优惠券信息
const { couponName, customerCouponCode } = customerCoupon
Object.assign(this.orderObj, {
couponName,
customerCouponCode,
couponInfo: couponName + customerCouponCode
})
// 车辆信息
this.orderObj.customer = {
carBrand: customer.carBrand,
carBrandId: customer.carBrandId,
carChildsBrandId: customer.carChildsBrandId,
carChildsBrandName: customer.carChildsBrandName,
carSeriesId: customer.carSeriesId,
carSeriesName: customer.carSeriesName,
customerPhone: customer.customerPhone,
standNo: customer.standNo,
plateNumber: customer.plateNumber,
customerSex: customer.customerSex,
experienceFlag: customer.experienceFlag,
salesType: customer.salesType,
customerName: customer.customerName
}
this.orderObj.carBrand = `${customer.carBrand}-${customer.carChildsBrandName}-${customer.carSeriesName}`
// 更新表单状态
const updateFormCell = (formIndex, fieldName, value) => {
const cell = this.formList[formIndex].find(item => item.value === fieldName)
if (cell) cell.current = value
}
const formUpdates = [
[1, 'salesType', customer.salesType],
[1, 'customerSex', customer.customerSex],
[1, 'experienceFlag', customer.experienceFlag],
[2, 'selectPayType', this.orderObj.selectPayType],
[2, 'payeeType', this.orderObj.payeeType]
]
formUpdates.forEach(([index, field, value]) => updateFormCell(index, field, value))
this.goodsList = rest.subOrderList
}
handleTransactionData(newVal)
} }
}, },
immediate: true immediate: true
...@@ -88,11 +151,13 @@ export default { ...@@ -88,11 +151,13 @@ export default {
experienceFlag: 'Y', experienceFlag: 'Y',
payeeType: 1, payeeType: 1,
salesType: '0', salesType: '0',
frontGear: null, frontGear: null, // 1 ,回显upgradeGoodsPosition == 1
frontWindow: null, frontWindow: null, // 2
rearWindow: null, rearWindow: null, // 3
rearGear: null, rearGear: null, // 4
sunRoof: null sunRoof: null, // 5, 6,7
package: null,
skuGoods: null // upgradeGoodsPosition 为空,则是其他精品单商品
}, // 弹窗传入的数据}, }, // 弹窗传入的数据},
popupType: 0, popupType: 0,
popupTypeEnum, popupTypeEnum,
...@@ -131,23 +196,26 @@ export default { ...@@ -131,23 +196,26 @@ export default {
this.userInfo = uni.$storage.get('userInfo') || {} this.userInfo = uni.$storage.get('userInfo') || {}
this.baseConfigData = uni.$storage.get('mock_data') || {} this.baseConfigData = uni.$storage.get('mock_data') || {}
const { userInfo } = this const { userInfo } = this
// 在原有的 orderObj 对象上新增这些属性
Object.assign(this.orderObj, {
sellerMerchantName: userInfo.merchantName,
sellerName: userInfo.name,
sellerMerchantId: userInfo.merchantId,
sellerUserId: userInfo.uuid,
merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName
})
this.initData() this.initData()
}, },
methods: { methods: {
initData() { initData() {
const { userInfo } = this const { userInfo } = this
if (!this.orderObj.id) {
// 在原有的 orderObj 对象上新增这些属性
Object.assign(this.orderObj, {
sellerMerchantName: userInfo.merchantName,
sellerName: userInfo.name,
sellerMerchantId: userInfo.merchantId,
sellerUserId: userInfo.uuid,
merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName
})
}
this.getShopMerchantPointConfig(userInfo.shopMerchantId) this.getShopMerchantPointConfig(userInfo.shopMerchantId)
this.getSubShopMerchantList(userInfo.shopMerchantId) this.getSubShopMerchantList(userInfo.shopMerchantId)
this.getSetting() this.getSetting()
this.getConfig() this.getConfig()
this.getConfigList() this.getConfigList()
// this.getEmployeeList() // this.getEmployeeList()
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
<view class="box-shell"> <view class="box-shell">
<view class="box-shell-title">工单信息</view> <view class="box-shell-title">工单信息</view>
<view class="order-info pt-16"> <view class="order-info pt-16">
<view v-for="(item, index) in orderObj" :key="index" class="flex align-center pt-8"> <view v-for="(item, index) in orderObj" :key="index" class="flex align-center pt-16">
<view class="label">{{ item.label }}</view> <view class="label">{{ item.label }}</view>
<view v-if="item.key == 'status'"> <view v-if="item.key == 'status'">
<view class="value" :style="{ color: status[orderInfo.status].color || '' }"> <view class="value" :style="{ color: status[orderInfo.status].color || '' }">
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
<view class="box-shell"> <view class="box-shell">
<view class="box-shell-title">客户信息</view> <view class="box-shell-title">客户信息</view>
<view class="order-info pt-16"> <view class="order-info pt-16">
<view class="flex align-center pt-8" v-for="(item, index) in customerObj" :key="index"> <view class="flex align-center pt-16" v-for="(item, index) in customerObj" :key="index">
<view class="label">{{ item.label }}</view> <view class="label">{{ item.label }}</view>
<view class="value" :style="{ color: item.color || '#333' }"> <view class="value" :style="{ color: item.color || '#333' }">
<view v-if="item.arr"> <view v-if="item.arr">
......
...@@ -69,6 +69,10 @@ ...@@ -69,6 +69,10 @@
<view class="sprite-icon icon-tag-checked checked" v-if="checkListObj[item.tradeNo]"></view> <view class="sprite-icon icon-tag-checked checked" v-if="checkListObj[item.tradeNo]"></view>
</view> </view>
</view> </view>
<view class="nothing flex" v-else>
<image class="icon" src="@/assets/images/home/nothing.webp" />
暂无数据
</view>
</scroll-view> </scroll-view>
<scroll-view class="order_no_box" scroll-y enable-back-to-top refresher-enabled="true" v-show="activeIndex === 1" @scrolltolower="pageonReachBottom"> <scroll-view class="order_no_box" scroll-y enable-back-to-top refresher-enabled="true" v-show="activeIndex === 1" @scrolltolower="pageonReachBottom">
...@@ -97,6 +101,10 @@ ...@@ -97,6 +101,10 @@
<view class="sprite-icon icon-tag-checked checked" v-if="checkListObj[item.tradeNo]"></view> <view class="sprite-icon icon-tag-checked checked" v-if="checkListObj[item.tradeNo]"></view>
</view> </view>
</view> </view>
<view class="nothing flex" v-else>
<image class="icon" src="../../../../assets/images/home/nothing.webp" />
暂无数据
</view>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
...@@ -268,7 +276,8 @@ export default { ...@@ -268,7 +276,8 @@ export default {
uni.$api.boutiqueApi uni.$api.boutiqueApi
.statByStatus({ .statByStatus({
...this.searchObj, ...this.searchObj,
keyword: this.keyword keyword: this.keyword,
sceneType: 1
}) })
.then(result => { .then(result => {
const labelList = ['totalCount', 'waitUpgradeCount', 'upgradedCount', 'notUpgradeCount'] const labelList = ['totalCount', 'waitUpgradeCount', 'upgradedCount', 'notUpgradeCount']
...@@ -709,6 +718,24 @@ export default { ...@@ -709,6 +718,24 @@ export default {
margin-left: toRpx(20); margin-left: toRpx(20);
} }
} }
.nothing {
width: 100%;
height: toRpx(228);
flex-direction: column;
margin-top: toRpx(76);
font-size: toRpx(24);
color: #999999;
box-sizing: border-box;
&.big-height {
height: toRpx(234);
}
.icon {
width: toRpx(288);
height: toRpx(144);
margin-bottom: toRpx(4);
}
}
} }
.footer-box { .footer-box {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<!-- <view class="alias-name">商品别名:阿尔法 T5极狐非三电整车延保(新车2年6万公里)</view> --> <!-- <view class="alias-name">商品别名:阿尔法 T5极狐非三电整车延保(新车2年6万公里)</view> -->
<view class="front-gear-box"> <view class="front-gear-box">
<view class="front-gear-input-box"> <view class="front-gear-input-box">
<view class="front-gear-label" v-if="goods.merchantGoodsPosition || goods.goodsInfo.goodsTypeName">{{goods.goodsInfo.goodsType===1?formatPosition(goods.merchantGoodsPosition, positionTypeList):goods.goodsInfo.goodsTypeName}}</view> <!-- <view class="front-gear-label" v-if="goods.merchantGoodsPosition || goods.goodsInfo.goodsTypeName">{{goods.goodsInfo.goodsType===1?formatPosition(goods.merchantGoodsPosition, positionTypeList):goods.goodsInfo.goodsTypeName}}</view> -->
<view class="front-gear-input"> <view class="front-gear-input">
<view class="unit">¥</view> <view class="unit">¥</view>
<input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="goods.sellPrice" @blur="validatePrice($event, goods, ind, index)" /> <input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="goods.sellPrice" @blur="validatePrice($event, goods, ind, index)" />
...@@ -48,6 +48,7 @@ export default { ...@@ -48,6 +48,7 @@ export default {
created() { created() {
// 初始化商品数量 // 初始化商品数量
this.initProductNumbers() this.initProductNumbers()
console.log(this.list, 'Package-list')
}, },
mounted() { mounted() {
// 确保每次使用组件时都检查并设置number属性 // 确保每次使用组件时都检查并设置number属性
...@@ -56,6 +57,7 @@ export default { ...@@ -56,6 +57,7 @@ export default {
updated() { updated() {
// 当组件数据更新时也检查number属性 // 当组件数据更新时也检查number属性
this.initProductNumbers() this.initProductNumbers()
console.log(this.list, 'Package-list')
}, },
methods: { methods: {
// 初始化商品数量方法 // 初始化商品数量方法
...@@ -65,14 +67,20 @@ export default { ...@@ -65,14 +67,20 @@ export default {
if (!item.packageGoods.number) { if (!item.packageGoods.number) {
this.$set(item.packageGoods, 'number', '1') this.$set(item.packageGoods, 'number', '1')
} }
// 存储旧值
item.packageGoods.goodsList.forEach(goods => {
if (!goods.price) {
goods.oldPrice = goods.sellPrice
}
})
}) })
} }
}, },
// 格式化位置信息 // // 格式化位置信息
formatPosition(item, positionTypeList) { // formatPosition(item, positionTypeList) {
const filterData = positionTypeList.filter(v => v.positionValue == item) // const filterData = positionTypeList.filter(v => v.positionValue == item)
return (filterData.length && filterData[0] && filterData[0].positionName) || '' // return (filterData.length && filterData[0] && filterData[0].positionName) || ''
}, // },
// 验证数量输入 // 验证数量输入
validateNumber(event, item) { validateNumber(event, item) {
let value = event.detail.value let value = event.detail.value
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!