Commit 61140f45 by cen

feat: 更新订单策略组件以支持新订单类型和价格计算

- 在 OrderPopup 中添加新的字段 `searchValue` 和 `noData`,以增强组件功能
- 修改 OrderStrategy 组件,支持折扣、买赠和组合付款策略的显示和计算
- 在 SkuGoods 组件中集成 OrderStrategy,确保价格计算逻辑与订单类型一致
- 更新样式以改善组件布局和用户体验
1 parent 0ed2a431
......@@ -386,7 +386,9 @@ const componentConfig = {
// 绑定 CreateOrder 中的字段名
idKey: 'djOrderType',
cacheData: [],
loadComplete: false
loadComplete: false,
searchValue: '',
noData: false
}
}
export default { componentConfig }
......@@ -347,7 +347,7 @@ export default {
align-items: center;
justify-content: space-between;
padding: toRpx(24) toRpx(24) 0 toRpx(24);
border-top: toRpx(2) solid #ebedf0;
border-top: toRpx(2) dashed #ebedf0;
box-sizing: border-box;
}
......
......@@ -17,7 +17,7 @@
<view class="goods-item" v-for="(goods, ind) in item.packageGoods.goodsList" :key="ind">
<view class="goods-name">{{ goods.goodsAlias || goods.upgradeGoodsName }}</view>
<!-- <view class="alias-name">商品别名:阿尔法 T5极狐非三电整车延保(新车2年6万公里)</view> -->
<view class="front-gear-box">
<view class="front-gear-box pb-24">
<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-input">
......
......@@ -2,56 +2,58 @@
<view>
<view class="shop-list">
<view class="shop-item" v-for="(item, index) in list" :key="index">
<view class="sprite-icon icon-blue-delete" @click="deleteGoods(index)"></view>
<view class="right">
<view class="shop-name">商品名称:{{ item.multipleSpecificationsGoods ? item.multipleSpecificationsGoods.baseGoodsName : item.goods.goodsAlias || item.goods.upgradeGoodsName || item.goods.goodsInfo.goodsName }}</view>
<view class="alias" v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.goodsAlias">商品别名:{{ item.multipleSpecificationsGoods.goods.goodsAlias }}</view>
<view class="front-gear-box">
<view class="front-gear-input-box">
<template v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.specificationStr">
<view class="front-gear-label">
{{ item.multipleSpecificationsGoods.goods.specificationStr }}
</view>
</template>
<template v-if="item.goods">
<template v-if="(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition) && (item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1 || item.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.goods.upgradeGoodsType == baseConfigData.selfBuildFilmType)">
<view class="flex flex-1 pb-24">
<view class="sprite-icon icon-blue-delete" @click="deleteGoods(index)"></view>
<view class="right">
<view class="shop-name">商品名称:{{ item.multipleSpecificationsGoods ? item.multipleSpecificationsGoods.baseGoodsName : item.goods.goodsAlias || item.goods.upgradeGoodsName || item.goods.goodsInfo.goodsName }}</view>
<view class="alias" v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.goodsAlias">商品别名:{{ item.multipleSpecificationsGoods.goods.goodsAlias }}</view>
<view class="front-gear-box">
<view class="front-gear-input-box">
<template v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.specificationStr">
<view class="front-gear-label">
{{ formatPosition(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition, positionTypeList) }}
{{ item.multipleSpecificationsGoods.goods.specificationStr }}
</view>
</template>
<template v-if="(item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1) && !item.goods.merchantGoodsPosition && !item.goods.upgradeGoodsPosition">无部位属性</template>
</template>
<view class="front-gear-input">
<view class="unit">¥</view>
<template v-if="item.multipleSpecificationsGoods">
<input class="uni-input" type="digit" maxlength="9" :disabled="isDisabled" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.multipleSpecificationsGoods.goods.sellPrice" @blur="validatePrice($event, item, index)" />
</template>
<template v-else>
<input class="uni-input" type="digit" :disabled="isDisabled" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.goods.sellPrice" @blur="validatePrice($event, item, index)" />
<template v-if="item.goods">
<template v-if="(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition) && (item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1 || item.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.goods.upgradeGoodsType == baseConfigData.selfBuildFilmType)">
<view class="front-gear-label">
{{ formatPosition(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition, positionTypeList) }}
</view>
</template>
<template v-if="(item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1) && !item.goods.merchantGoodsPosition && !item.goods.upgradeGoodsPosition">无部位属性</template>
</template>
<!-- <input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格"
<view class="front-gear-input">
<view class="unit">¥</view>
<template v-if="item.multipleSpecificationsGoods">
<input class="uni-input" type="digit" maxlength="9" :disabled="isDisabled" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.multipleSpecificationsGoods.goods.sellPrice" @blur="validatePrice($event, item, index)" />
</template>
<template v-else>
<input class="uni-input" type="digit" :disabled="isDisabled" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.goods.sellPrice" @blur="validatePrice($event, item, index)" />
</template>
<!-- <input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格"
placeholder-style="font-size: 14px"
:value="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods ? item.multipleSpecificationsGoods.goods.sellPrice : item.goods.sellPrice"
@blur="validatePrice($event, item, index)" /> -->
</view>
</view>
</view>
<view class="control">
<view class="minus" @click="decreaseNumber(item)">-</view>
<template v-if="item.multipleSpecificationsGoods">
<input class="uni-input control-input" type="number" maxlength="3" v-model="item.multipleSpecificationsGoods.number" @blur="validateNumber($event, item)" />
</template>
<template v-else>
<input class="uni-input control-input" type="number" maxlength="3" v-model="item.goods.number" @blur="validateNumber($event, item)" />
</template>
<!-- <input class="uni-input control-input" type="number" maxlength="3"
<view class="control">
<view class="minus" @click="decreaseNumber(item)">-</view>
<template v-if="item.multipleSpecificationsGoods">
<input class="uni-input control-input" type="number" maxlength="3" v-model="item.multipleSpecificationsGoods.number" @blur="validateNumber($event, item)" />
</template>
<template v-else>
<input class="uni-input control-input" type="number" maxlength="3" v-model="item.goods.number" @blur="validateNumber($event, item)" />
</template>
<!-- <input class="uni-input control-input" type="number" maxlength="3"
:value="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods ? item.multipleSpecificationsGoods.goods.number : item.goods.number"
@blur="validateNumber($event, item)" /> -->
<view class="add" @click="increaseNumber(item)">+</view>
<view class="add" @click="increaseNumber(item)">+</view>
</view>
</view>
</view>
<!-- 折扣 / 买赠 / 组合付款策略组件 -->
<OrderStrategy v-if="getStrategyType(item)" :strategyType="getStrategyType(item)" :value="getStrategyConfig(item)" :basePrice="getBasePrice(item)" :displayPrice="getDisplayPrice(item)" @input="onStrategyConfigChange(item, $event)" @priceChange="onPriceChange(item, $event)" />
</view>
<!-- 折扣 / 买赠 / 组合付款策略组件 -->
<OrderStrategy v-if="getStrategyType(item)" :strategyType="getStrategyType(item)" :value="getStrategyConfig(item)" :basePrice="getBasePrice(item)" :displayPrice="getDisplayPrice(item)" @input="onStrategyConfigChange(item, $event)" @priceChange="onPriceChange(item, $event)" />
</view>
</view>
</view>
......@@ -458,8 +460,6 @@ export default {
padding: toRpx(12) toRpx(32) toRpx(12) 0;
.shop-item {
display: flex;
align-items: center;
background-color: #f5f7fa;
border-radius: toRpx(16);
margin-bottom: toRpx(16);
......
......@@ -135,6 +135,13 @@ const FORM_LIST = [
],
[
{
label: '订单类型',
value: 'djOrderType',
type: 'select',
key: 'name',
required: true
},
{
label: '购买商品',
value: 'skuGoods',
type: 'select',
......@@ -395,6 +402,11 @@ const popupTypeEnum = {
key: 'defeatEmployeeName',
targetIdKey: 'referrerId',
targetNameKey: 'referrer'
},
28: {
// 订单类型弹窗(OrderTypePopup)
key: 'djOrderType',
list: ''
}
}
const titleList = [null, { addHtml: 'customer' }, { name: '车辆信息' }, { name: '增值车损险' }, { name: '其他信息' }]
......@@ -647,6 +659,11 @@ const EQUITY_POPUP_ENUM = {
},
25: {
key: 'carBrand'
},
28: {
// 订单类型弹窗(OrderTypePopup)
key: 'djOrderType',
list: ''
}
}
......@@ -731,7 +748,7 @@ const EQUITY_FORM_RULE = {
{ required: true, message: '联系电话不能为空' },
{
validator: (rule, value) => {
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
const phoneRex = /^[1]([3-9])[0-9]{9}$/
return !phoneRex.test(value) ? { message: '请输入正确的手机号' } : null
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!