|
@@ -1,443 +1,289 @@
|
|
|
<template>
|
|
|
- <div v-loading="dialogLoading" :element-loading-text="loadingText">
|
|
|
- <el-form :model="orderForm" :inline="true" ref="confirmPayForm">
|
|
|
- <el-card>
|
|
|
- <el-descriptions title="核对信息" border :column="3" :label-style="{ width: '120px' }">
|
|
|
- <el-descriptions-item label="总件数">{{ orderClothItemDTOS.length }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="总价格(元)">{{ calculateTotalPrice() + calculateDeliveryPrice() }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="卡余额(元)" v-if="appUserInfo">{{ Math.round((appUserInfo.rechargeBalance + appUserInfo.giveBalance) * 100) / 100 }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="卡余额(元)" v-else>0</el-descriptions-item>
|
|
|
- <el-descriptions-item label="衣服价格(元)">{{ calculateTotalPrice() }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="优惠金额(元)">{{ calculateTotalDiscountAmount() }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="现金余额(元)">{{ appUserInfo ? appUserInfo.rechargeBalance : '0' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="配送费(元)">
|
|
|
- {{ calculateDeliveryPrice() }}
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item label="还需支付(元)">{{ Math.round((calculateTotalPrice() + calculateDeliveryPrice() - calculateTotalDiscountAmount()) * 100) / 100 }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="赠送余额">{{ appUserInfo ? appUserInfo.giveBalance : '0' }}</el-descriptions-item>
|
|
|
- </el-descriptions>
|
|
|
- <div style="margin-top: 20px" v-if="orderForm.isAppointment === 'Y'">
|
|
|
- <el-button type="primary" @click="submitForm(3)" style="margin-right: 10px" >确认定价</el-button>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
+ <div class="cash-cloth-container">
|
|
|
+ <div v-loading="dialogLoading" :element-loading-text="loadingText">
|
|
|
+ <el-form
|
|
|
+ ref="payForm"
|
|
|
+ :model="orderForm"
|
|
|
+ :rules="rules"
|
|
|
+ label-width="100px"
|
|
|
+ >
|
|
|
+ <div class="cash-container">
|
|
|
+ <!-- 左侧核对信息区域 -->
|
|
|
+ <div class="info-section">
|
|
|
+ <el-card class="info-card">
|
|
|
+ <div class="card-header">
|
|
|
+ <span class="title">订单信息</span>
|
|
|
+ <el-tag v-if="orderForm.isAppointment === 'Y'" type="success">预约订单</el-tag>
|
|
|
+ </div>
|
|
|
|
|
|
- <el-card style="margin-top: 10px" v-if="orderForm.isAppointment === 'N'">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span>优惠信息</span>
|
|
|
- </div>
|
|
|
- <el-tabs v-model="confirmCouponTabIndex" type="card" @tab-click="onCouponTabChange">
|
|
|
- <el-tab-pane label="优惠券" name="0">
|
|
|
- <el-form-item label="优惠券" prop="fullCoupon">
|
|
|
- <el-input ref="couponRef" v-model="orderForm.fullCoupon" placeholder="请输入优惠券兑换码" clearable />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary">核销</el-button>
|
|
|
- <el-button type="primary" @click="onSelectCoupon">列表选券</el-button>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-tabs v-model="confirmDeductTabIndex" type="card" @tab-click="onCouponTabChange">
|
|
|
- <el-tab-pane label="优惠券使用明细" name="0">
|
|
|
- <el-table :data="selectCoupons">
|
|
|
- <el-table-column label="优惠券" align="center" prop="couponTypeTitle" />
|
|
|
- <el-table-column label="优惠券类型" align="center" prop="discountWay">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.discountWay == '0'">抵扣券</span>
|
|
|
- <span v-if="scope.row.discountWay == '1'">满减券</span>
|
|
|
- <span v-if="scope.row.discountWay == '2'">折扣券</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="优惠内容" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.discountWay == '0'">抵扣{{ scope.row.deductAmount }}元</span>
|
|
|
- <span v-if="scope.row.discountWay == '1'">满{{ parseInt(scope.row.minAmount) }}件减{{ scope.row.deductAmount }}件</span>
|
|
|
- <span v-if="scope.row.discountWay == '2'">优惠{{ getDiscountStr(scope.row.discountRate) }},最多折扣{{ scope.row.deductAmount }}元</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="是否单件" align="center" prop="isUnique">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.discountWay == '2'">
|
|
|
- <span v-if="scope.row.isUnique == 'Y'">单件</span>
|
|
|
- <span v-if="scope.row.isUnique == 'N'">非单件</span>
|
|
|
- </span>
|
|
|
- <span v-else>--</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="优惠衣服" align="center" prop="selectClothInfo" :width="350">
|
|
|
- <template slot-scope="scope">
|
|
|
- <template v-for="(item, index) in scope.row.orderCouponClothDTOS">
|
|
|
- <br v-if="index != 0" />
|
|
|
- <span>{{ '#' + (item.clothIndex + 1) + ' ' + item.clothName + ' 优惠' + item.deductAmount + '元' }}</span>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" @click="changeCouponDiscountCloth(scope.$index)" v-if="scope.$index == selectCoupons.length - 1 && scope.row.discountWay == '2' && scope.row.isUnique == 'Y'">修改优惠衣服</el-button>
|
|
|
- <el-button type="text" style="color: #ff4949" @click="removeSelectCoupon(scope.$index)" v-if="scope.$index == selectCoupons.length - 1">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="衣服抵扣明细" name="1">
|
|
|
- <el-table :data="orderClothItemDTOS">
|
|
|
- <el-table-column label="序号" type="index" align="center" fixed="left" width="80"> </el-table-column>
|
|
|
- <el-table-column label="衣物名称" align="center" prop="name" width="250">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ calculateClothName(scope.$index) }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="颜色" align="center" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>
|
|
|
- <template v-for="(color, index) in scope.row.orderClothColorDTOS">
|
|
|
- {{ index == 0 ? color.clothColorName : ',' + color.clothColorName }}
|
|
|
+ <!-- 订单基本信息 -->
|
|
|
+ <div class="order-info">
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">衣物件数:</span>
|
|
|
+ <span class="value highlight">{{ orderClothItemDTOS.length }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">衣物总价:</span>
|
|
|
+ <span class="value price">¥{{ calculateTotalPrice() }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">配送费用:</span>
|
|
|
+ <span class="value">¥{{ calculateDeliveryPrice() }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">优惠金额:</span>
|
|
|
+ <span class="value discount">-¥{{ calculateTotalDiscountAmount() }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item total">
|
|
|
+ <span class="label">应付金额:</span>
|
|
|
+ <span class="value price">¥{{ calculateTotalPrice() + calculateDeliveryPrice() - calculateTotalDiscountAmount() }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 客户信息 -->
|
|
|
+ <div class="customer-info" v-if="appUserInfo">
|
|
|
+ <div class="section-title">客户信息</div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">会员姓名:</span>
|
|
|
+ <span class="value">{{ appUserInfo.realName }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">可用余额:</span>
|
|
|
+ <span class="value balance">¥{{ appUserInfo.rechargeBalance + appUserInfo.giveBalance }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <!-- 支付方式选择 -->
|
|
|
+ <el-card class="payment-card" v-if="orderForm.isAppointment === 'N'">
|
|
|
+ <div class="card-header">
|
|
|
+ <span class="title">收款方式</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="payment-methods">
|
|
|
+ <el-radio-group v-model="orderForm.payType" size="large" @change="changePayType">
|
|
|
+ <el-radio-button label="3"> <i class="el-icon-wallet"></i> 余额 </el-radio-button>
|
|
|
+ <el-radio-button label="2"> <i class="el-icon-money"></i> 现金 </el-radio-button>
|
|
|
+ <el-radio-button label="0"> <i class="el-icon-mobile-phone"></i> 扫码 </el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 扫码支付输入框 -->
|
|
|
+ <div class="scan-input" v-if="orderForm.payType == '0'">
|
|
|
+ <el-input ref="autoFocus" v-model="orderForm.authCode" placeholder="请扫描客户付款码" prefix-icon="el-icon-camera" clearable autofocus> </el-input>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 支付按钮 -->
|
|
|
+ <div class="payment-actions">
|
|
|
+ <el-button type="primary" size="large" icon="el-icon-shopping-cart-2" style="width: 180px" @click="submitForm(0)"> 立即收款 </el-button>
|
|
|
+ <el-button type="warning" size="large" icon="el-icon-time" style="width: 180px" @click="submitForm(1)"> 取衣付款 </el-button>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 右侧优惠信息区域 -->
|
|
|
+ <div class="discount-section" v-if="orderForm.isAppointment === 'N'">
|
|
|
+ <el-card class="discount-card">
|
|
|
+ <el-tabs v-model="confirmCouponTabIndex" type="border-card">
|
|
|
+ <!-- 优惠券 tab -->
|
|
|
+ <el-tab-pane label="优惠券" name="0">
|
|
|
+ <div class="coupon-actions">
|
|
|
+ <el-button type="primary" plain @click="onSelectCoupon"> <i class="el-icon-ticket"></i> 选择优惠券 </el-button>
|
|
|
+ </div>
|
|
|
+ <!-- 已选优惠券列表 -->
|
|
|
+ <div class="selected-coupons">
|
|
|
+ <el-table :data="selectCoupons" size="small" border height="calc(100vh - 400px)" style="width: 100%">
|
|
|
+ <el-table-column label="优惠券" align="center" prop="couponTypeTitle" width="120" />
|
|
|
+ <el-table-column label="类型" align="center" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag size="mini" :type="getTagType(scope.row.discountWay)">
|
|
|
+ {{ getDiscountTypeLabel(scope.row.discountWay) }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="优惠内容" align="center" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="discount-content">
|
|
|
+ <template v-if="scope.row.discountWay == '0'">
|
|
|
+ <span class="amount">-¥{{ scope.row.deductAmount }}</span>
|
|
|
+ </template>
|
|
|
+ <template v-if="scope.row.discountWay == '1'">
|
|
|
+ <div>满{{ scope.row.minAmount }}件</div>
|
|
|
+ <div>减{{ scope.row.deductAmount }}件</div>
|
|
|
+ </template>
|
|
|
+ <template v-if="scope.row.discountWay == '2'">
|
|
|
+ <div>{{ getDiscountStr(scope.row.discountRate) }}</div>
|
|
|
+ <div>最多减{{ scope.row.deductAmount }}元</div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="衣服品牌" align="center" prop="name" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.clothBrandName }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="瑕疵" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>
|
|
|
- <template v-for="(color, index) in scope.row.orderClothFlawDTOS">
|
|
|
- {{ index == 0 ? color.clothFlawName : ',' + color.clothFlawName }}
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="优惠衣服" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-popover placement="top" width="200" trigger="hover">
|
|
|
+ <div class="cloth-list">
|
|
|
+ <div v-for="(item, index) in scope.row.orderCouponClothDTOS" :key="index" class="cloth-item">
|
|
|
+ <span class="index">#{{ item.clothIndex + 1 }}</span>
|
|
|
+ <span class="name">{{ item.clothName }}</span>
|
|
|
+ <span class="amount">-¥{{ item.deductAmount }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div slot="reference" class="cloth-summary">
|
|
|
+ 已选{{ scope.row.orderCouponClothDTOS.length }}件
|
|
|
+ <i class="el-icon-more"></i>
|
|
|
+ </div>
|
|
|
+ </el-popover>
|
|
|
</template>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="洗涤方式" align="center" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.clothWashModeName }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="价格(元)" align="center" prop="totalPrice" width="100" />
|
|
|
- <el-table-column label="优惠金额(元)" align="center" prop="deductAmount" width="130" />
|
|
|
- <el-table-column label="还需支付(元)" align="center" width="130">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ handelPrice(scope.row.totalPrice - scope.row.deductAmount) }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="平台折扣活动" name="1">
|
|
|
- <!-- <el-form-item label="折扣" prop="discountCouponId">
|
|
|
- <el-select v-model="orderForm.discountCouponId" placeholder="请选择" clearable @change="onDiscountCouponSelect">
|
|
|
- <template v-for="(item, i) in discountCouponVOS">
|
|
|
- <el-option :key="i" :label="item.couponTypeTitle + '(' + item.deductAmount * 10 + '折)'" :value="item.id"> </el-option>
|
|
|
- </template>
|
|
|
- </el-select>
|
|
|
- </el-form-item> -->
|
|
|
- <el-table :data="discountCouponVOS" style="width: 100%">
|
|
|
- <el-table-column label="序号" type="index" align="center" fixed="left" width="80"> </el-table-column>
|
|
|
- <el-table-column label="活动名称" align="center" prop="title"> </el-table-column>
|
|
|
- <el-table-column label="适用衣服" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.clothScope == 0">全部衣服 折扣{{ getDiscountStr(scope.row.discount * 100) }}</span>
|
|
|
- <div v-if="scope.row.clothScope == 1">
|
|
|
- <div v-for="(item, i) in scope.row.activityClothItemVOList" :key="i">#{{ i + 1 }} {{ item.clothItemName }} 折扣{{ getDiscountStr(item.discount * 100) }}</div>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" width="120" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="changeCouponDiscountCloth(scope.$index)" v-if="canModifyCoupon(scope.row, scope.$index)"> 修改 </el-button>
|
|
|
+ <el-button type="text" style="color: #ff4949" @click="removeSelectCoupon(scope.$index)" v-if="scope.$index == selectCoupons.length - 1"> 删除 </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="适用支付方式" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.payScope == 0">全部</span>
|
|
|
- <span v-if="scope.row.payScope == 1">现金</span>
|
|
|
- <span v-if="scope.row.payScope == 2">余额</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="可优惠金额(元)" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ calculateTotalDiscountByActivity(scope.row, scope.row.title) }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column label="衣服品牌" align="center" prop="name" width="120"> -->
|
|
|
- <!-- <template slot-scope="scope"> -->
|
|
|
- <!-- <span>{{ scope.row.clothBrandName }}</span> -->
|
|
|
- <!-- </template> -->
|
|
|
- <!-- </el-table-column> -->
|
|
|
- <!-- <el-table-column label="瑕疵" align="center"> -->
|
|
|
- <!-- <template slot-scope="scope"> -->
|
|
|
- <!-- <span> -->
|
|
|
- <!-- <template v-for="(color, index) in scope.row.orderClothFlawDTOS"> -->
|
|
|
- <!-- {{ index == 0 ? color.clothFlawName : ',' + color.clothFlawName }} -->
|
|
|
- <!-- </template> -->
|
|
|
- <!-- </span> -->
|
|
|
- <!-- </template> -->
|
|
|
- <!-- </el-table-column> -->
|
|
|
- <!-- <el-table-column label="洗涤方式" align="center" width="80"> -->
|
|
|
- <!-- <template slot-scope="scope"> -->
|
|
|
- <!-- <span>{{ scope.row.clothWashModeName }}</span> -->
|
|
|
- <!-- </template> -->
|
|
|
- <!-- </el-table-column> -->
|
|
|
- <!-- <el-table-column label="原价(元)" align="center" prop="totalPrice" width="100" /> -->
|
|
|
- <!-- <el-table-column label="抵扣金额(元)" align="center" prop="deductAmount" width="130" /> -->
|
|
|
- <!-- <el-table-column label="折扣金额(元)" align="center" width="130">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ parseInt((scope.row.totalPrice - scope.row.deductAmount) * 100 * parseInt(100 - orderForm.discountCoupon.deductAmount * 100)) / 10000 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
- <el-table-column label="操作" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" style="color: #67c23a" @click="onSelectActivityItem({})" v-if="activity.id === scope.row.id">不使用</el-button>
|
|
|
- <el-button type="text" @click="onSelectActivityItem(scope.row)" v-else>使用</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="现金券" name="2">
|
|
|
- <el-form-item label="现金券" prop="cashDeductAmount">
|
|
|
- <el-input-number
|
|
|
- style="text-align: left"
|
|
|
- v-model="orderForm.cashDeductAmount"
|
|
|
- placeholder="请输入现金券金额"
|
|
|
- :precision="2"
|
|
|
- clearable
|
|
|
- :controls="false"
|
|
|
- :max="(parseInt(calculateTotalPrice() * 100) + parseInt(calculateDeliveryPrice() * 100) - parseInt(calculateTotalDiscountAmountWithoutCashAmount() * 100)) / 100"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="是否特殊" prop="isSpecial">
|
|
|
- <el-checkbox v-model="orderForm.isSpecial"></el-checkbox>
|
|
|
- </el-form-item>
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
- </el-card>
|
|
|
-
|
|
|
- <el-card style="margin-top: 10px" v-if="orderForm.isAppointment === 'N'">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span>收款方式</span>
|
|
|
- <template v-if="calculateTotalDiscountAmountByCoupon()">
|
|
|
- <span style="margin-left: 10px">优惠券优惠</span>
|
|
|
- <span style="color: #ff4949">{{ calculateTotalDiscountAmountByCoupon() }}</span>
|
|
|
- <span>元</span>
|
|
|
- </template>
|
|
|
-
|
|
|
- <template v-if="calculateTotalDiscountByActivity(activity)">
|
|
|
- <span style="margin-left: 10px">平台折扣活动优惠</span>
|
|
|
- <span style="color: #ff4949">{{ calculateTotalDiscountByActivity(activity) }}</span>
|
|
|
- <span>元</span>
|
|
|
- </template>
|
|
|
-
|
|
|
- <template v-if="orderForm.cashDeductAmount">
|
|
|
- <span style="margin-left: 10px">现金券优惠</span>
|
|
|
- <span style="color: #ff4949">{{ orderForm.cashDeductAmount }}</span>
|
|
|
- <span>元</span>
|
|
|
- </template>
|
|
|
-
|
|
|
- <span style="margin-left: 10px">还需支付</span>
|
|
|
- <span style="color: #ff4949">{{ (parseInt(calculateTotalPrice() * 100) + parseInt(calculateDeliveryPrice() * 100) - parseInt(calculateTotalDiscountAmount() * 100)) / 100 }}</span>
|
|
|
- <span>元</span>
|
|
|
- </div>
|
|
|
- <el-form-item label="支付方式" prop="payType">
|
|
|
- <el-radio-group v-model="orderForm.payType" @change="changePayType">
|
|
|
- <el-radio-button label="3" name="3">余额</el-radio-button>
|
|
|
- <el-radio-button label="2" name="2">现金</el-radio-button>
|
|
|
- <el-radio-button label="0" name="0">微信/支付宝</el-radio-button>
|
|
|
- <!-- <el-radio-button label="1" name="1">支付宝</el-radio-button>-->
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- <br />
|
|
|
-
|
|
|
- <el-form-item label="付款码" prop="authCode" v-if="orderForm.payType == '0' || orderForm.payType == '1'">
|
|
|
- <el-input ref="autoFocus" v-model="orderForm.authCode" clearable placeholder="请选择付款码" />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-descriptions border :column="3" :labelStyle="{ width: '140px' }" v-if="orderForm.payType == '3'">
|
|
|
- <el-descriptions-item label="用户" v-if="appUserInfo">{{ appUserInfo.realName }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="当前余额(元)" v-if="appUserInfo">{{ appUserInfo.rechargeBalance + appUserInfo.giveBalance }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="支付后余额(元)" v-if="appUserInfo">{{ appUserInfo.rechargeBalance + appUserInfo.giveBalance - calculateTotalPrice() }}</el-descriptions-item>
|
|
|
- </el-descriptions>
|
|
|
-
|
|
|
- <div style="margin-top: 20px">
|
|
|
- <el-button type="primary" @click="submitForm(0)" style="margin-right: 10px">立即支付</el-button>
|
|
|
- <el-button type="primary" @click="submitForm(1)" style="margin-right: 5%">取衣支付</el-button>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </el-card>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <el-dialog title="选择优惠券" :visible.sync="setCouponOpen" append-to-body width="55%">
|
|
|
- <!-- :before-close="handleClose"-->
|
|
|
-
|
|
|
- <el-table :data="deductCouponVOS" style="width: 100%">
|
|
|
- <el-table-column label="优惠券" align="center" prop="couponTypeTitle" />
|
|
|
- <el-table-column label="优惠券类型" align="center" prop="discountType">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.discountWay == '0'">抵扣券</span>
|
|
|
- <span v-if="scope.row.discountWay == '1'">满减券</span>
|
|
|
- <span v-if="scope.row.discountWay == '2'">折扣券</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="优惠内容" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.discountWay == '0'">抵扣{{ scope.row.deductAmount }}元</span>
|
|
|
- <span v-if="scope.row.discountWay == '1'">满{{ parseInt(scope.row.minAmount) }}件减{{ scope.row.deductAmount }}件</span>
|
|
|
- <span v-if="scope.row.discountWay == '2'">优惠{{ getDiscountStr(scope.row.discountRate) }},最多折扣{{ scope.row.deductAmount }}元</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="是否单件" align="center" prop="isUnique">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.discountWay == '2'">
|
|
|
- <span v-if="scope.row.isUnique == 'Y'">单件</span>
|
|
|
- <span v-if="scope.row.isUnique == 'N'">非单件</span>
|
|
|
- </span>
|
|
|
- <span v-else>--</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="适用衣服" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <template v-for="(item, index) in scope.row.appCouponTypeApplyClothVOS" v-key="index">
|
|
|
- <span>{{ index > 0 ? '、' : '' }}{{ item.clothItemName }}</span>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 弹窗区域 -->
|
|
|
+ <div class="dialog-container">
|
|
|
+ <!-- 选择优惠券弹窗 -->
|
|
|
+ <el-dialog title="选择优惠券" :visible.sync="setCouponOpen" append-to-body width="55%" :close-on-click-modal="false">
|
|
|
+ <el-table :data="deductCouponVOS" style="width: 100%">
|
|
|
+ <el-table-column label="优惠券" align="center" prop="couponTypeTitle" />
|
|
|
+ <el-table-column label="优惠券类型" align="center" prop="discountType">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.discountWay == '0'">抵扣券</span>
|
|
|
+ <span v-if="scope.row.discountWay == '1'">满减券</span>
|
|
|
+ <span v-if="scope.row.discountWay == '2'">折扣券</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="优惠内容" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.discountWay == '0'">抵扣{{ scope.row.deductAmount }}元</span>
|
|
|
+ <span v-if="scope.row.discountWay == '1'">满{{ parseInt(scope.row.minAmount) }}件减{{ scope.row.deductAmount }}件</span>
|
|
|
+ <span v-if="scope.row.discountWay == '2'">优惠{{ getDiscountStr(scope.row.discountRate) }},最多折扣{{ scope.row.deductAmount }}元</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="是否单件" align="center" prop="isUnique">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.discountWay == '2'">
|
|
|
+ <span v-if="scope.row.isUnique == 'Y'">单件</span>
|
|
|
+ <span v-if="scope.row.isUnique == 'N'">非单件</span>
|
|
|
+ </span>
|
|
|
+ <span v-else>--</span>
|
|
|
</template>
|
|
|
- <span v-if="!scope.row.appCouponTypeApplyClothVOS">全部衣服</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" @click="onSelectCouponItem(scope.$index)">选择</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <el-dialog :title="changeDiscountCouponTitle" :visible.sync="changeDiscountCouponOpen" width="70%" append-to-body>
|
|
|
- <!-- <span v-if="changeDiscountCouponOpen"> 共可抵扣{{ selectCoupons[changeDiscountCouponIndex].deductAmount }}元,已抵扣{{ calculateCouponDiscountInfo() }}元,剩余可抵扣{{ selectCoupons[changeDiscountCouponIndex].deductAmount - calculateCouponDiscountInfo() }}元 </span>
|
|
|
- <br /> -->
|
|
|
- <span>可选择衣物</span>
|
|
|
- <br />
|
|
|
- <el-table :data="changeDiscountCouponCanSelectCloths">
|
|
|
- <el-table-column label="序号" align="center" fixed="left" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>#{{ scope.row.index + 1 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="衣物名称" align="center" prop="name" width="250">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ calculateClothNameByInfo(scope.row) }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="颜色" align="center" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>
|
|
|
- <template v-for="(color, index) in scope.row.orderClothColorDTOS">
|
|
|
- {{ index == 0 ? color.clothColorName : ',' + color.clothColorName }}
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="适用衣服" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <template v-for="(item, index) in scope.row.appCouponTypeApplyClothVOS" v-key="index">
|
|
|
+ <span>{{ index > 0 ? '、' : '' }}{{ item.clothItemName }}</span>
|
|
|
+ </template>
|
|
|
+ <span v-if="!scope.row.appCouponTypeApplyClothVOS">全部衣服</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="onSelectCouponItem(scope.$index)">选择</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 修改优惠券弹窗 -->
|
|
|
+ <el-dialog :title="changeDiscountCouponTitle" :visible.sync="changeDiscountCouponOpen" width="70%" append-to-body :close-on-click-modal="false">
|
|
|
+ <div class="discount-cloth-dialog">
|
|
|
+ <div class="dialog-header">可选择衣物</div>
|
|
|
+ <el-table :data="changeDiscountCouponCanSelectCloths">
|
|
|
+ <el-table-column label="序号" align="center" fixed="left" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>#{{ scope.row.index + 1 }}</span>
|
|
|
</template>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="衣服品牌" align="center" prop="name" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.clothBrandName }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="瑕疵" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>
|
|
|
- <template v-for="(color, index) in scope.row.orderClothFlawDTOS">
|
|
|
- {{ index == 0 ? color.clothFlawName : ',' + color.clothFlawName }}
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="衣物名称" align="center" prop="name" width="250">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ calculateClothNameByInfo(scope.row) }}</span>
|
|
|
</template>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="洗涤方式" align="center" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.clothWashModeName }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="价格(元)" align="center" prop="totalPrice" width="100" />
|
|
|
- <el-table-column label="待优惠金额(元)" align="center" prop="deductAmount" width="130" />
|
|
|
- <el-table-column label="还需支付(元)" align="center" width="130">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.totalPrice - scope.row.deductAmount }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="操作" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" style="color: #67c23a" v-if="scope.row.isSelected">已选择</el-button>
|
|
|
- <el-button type="text" style="color: #ff4949" @click="addCouponRelateCloth(scope.$index)" v-else>选择</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <br />
|
|
|
- <!-- <span>已选择衣物</span> -->
|
|
|
- <!-- <br /> -->
|
|
|
- <!-- <el-table :data="changeDiscountCouponSelectCloths" style="width: 100%">
|
|
|
- <el-table-column label="序号" align="center" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>#{{ scope.row.clothIndex + 1 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="衣服名称" align="center" prop="clothName" width="250" />
|
|
|
- <el-table-column label="颜色" align="center" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>
|
|
|
- <template v-for="(color, index) in scope.row.cloth.orderClothColorDTOS">
|
|
|
- {{ index == 0 ? color.clothColorName : ',' + color.clothColorName }}
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="颜色" align="center" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>
|
|
|
+ <template v-for="(color, index) in scope.row.orderClothColorDTOS">
|
|
|
+ {{ index == 0 ? color.clothColorName : ',' + color.clothColorName }}
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
</template>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="衣服品牌" align="center" prop="name" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.cloth.clothBrandName }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="瑕疵" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>
|
|
|
- <template v-for="(color, index) in scope.row.cloth.orderClothFlawDTOS">
|
|
|
- {{ index == 0 ? color.clothFlawName : ',' + color.clothFlawName }}
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="衣服品牌" align="center" prop="name" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.clothBrandName }}</span>
|
|
|
</template>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="洗涤方式" align="center" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.cloth.clothWashModeName }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="原价(元)" align="center" prop="totalPrice" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.cloth.totalPrice }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="已优惠金额(元)" align="center" prop="deductAmount" width="130">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.cloth.deductAmount }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="还需支付(元)" align="center" width="130">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.cloth.totalPrice - scope.row.cloth.deductAmount }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="本次优惠金额(元)" align="center" prop="deductAmount" width="180"> </el-table-column>
|
|
|
- <el-table-column label="操作" align="center" fixed="right">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" style="color: #ff4949" @click="removeCouponRelateCloth(scope.$index)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table> -->
|
|
|
-
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="changeDiscountCouponOpen = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitChangeCouponRelateCloth">确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="瑕疵" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>
|
|
|
+ <template v-for="(color, index) in scope.row.orderClothFlawDTOS">
|
|
|
+ {{ index == 0 ? color.clothFlawName : ',' + color.clothFlawName }}
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="洗涤方式" align="center" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.clothWashModeName }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="价格(元)" align="center" prop="totalPrice" width="100" />
|
|
|
+ <el-table-column label="待优惠金额(元)" align="center" prop="deductAmount" width="130" />
|
|
|
+ <el-table-column label="还需支付(元)" align="center" width="130">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.totalPrice - scope.row.deductAmount }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" style="color: #67c23a" v-if="scope.row.isSelected">已选择</el-button>
|
|
|
+ <el-button type="text" style="color: #ff4949" @click="addCouponRelateCloth(scope.$index)" v-else>选择</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="changeDiscountCouponOpen = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitChangeCouponRelateCloth">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 修改支付状态弹窗的位置和样式 -->
|
|
|
+ <div class="payment-status-container">
|
|
|
+ <pay-status-popup
|
|
|
+ ref="payStatusPopup"
|
|
|
+ :hide-pointer="false"
|
|
|
+ :hide-user="false"
|
|
|
+ @pay-success="handlePaySuccess"
|
|
|
+ @confirm="handleConfirm"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import PayStatusPopup from '@/components/payStatusPopup'
|
|
|
import { collectCloth } from '../../../../api/order/cloth'
|
|
|
|
|
|
export default {
|
|
|
name: 'cashCloth',
|
|
|
+ components: {
|
|
|
+ PayStatusPopup
|
|
|
+ },
|
|
|
props: {
|
|
|
appUserInfo: {
|
|
|
type: Object
|
|
@@ -477,7 +323,35 @@ export default {
|
|
|
changeDiscountCouponTitle: '',
|
|
|
changeDiscountCouponSelectCloths: [],
|
|
|
changeDiscountCouponCanSelectCloths: [],
|
|
|
- activity: {}
|
|
|
+ activity: {},
|
|
|
+ rules: {
|
|
|
+ payType: [
|
|
|
+ { required: true, message: '请选择支付方式', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ authCode: [
|
|
|
+ { required: true, message: '请输入付款码', trigger: 'blur',
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (this.orderForm.payType === '0' && !value) {
|
|
|
+ callback(new Error('请输入付款码'));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ cashDeductAmount: [
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (value && value > this.calculateTotalPrice()) {
|
|
|
+ callback(new Error('抵扣金额不能大于订单金额'));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -487,7 +361,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
getDiscountStr(e) {
|
|
|
- return Math.round(e / 10 * 100) / 100 + '折'
|
|
|
+ return Math.round((e / 10) * 100) / 100 + '折'
|
|
|
},
|
|
|
changePayType() {
|
|
|
if (this.orderForm.payType == 0) {
|
|
@@ -547,7 +421,7 @@ export default {
|
|
|
totalDiscountAmount = totalDiscountAmount + cloth.deductAmount
|
|
|
})
|
|
|
if (this.activity.id) {
|
|
|
- totalDiscountAmount = totalDiscountAmount + this.calculateTotalDiscountByActivity(this.activity)
|
|
|
+ totalDiscountAmount = totalDiscountAmount + this.calculateTotalDiscountByActivity(this.activity, 'A1')
|
|
|
}
|
|
|
return Math.round(totalDiscountAmount * 100) / 100
|
|
|
},
|
|
@@ -579,11 +453,11 @@ export default {
|
|
|
for (let i = 0; i < e.activityClothItemVOList.length; i++) {
|
|
|
let cloth = e.activityClothItemVOList[i]
|
|
|
for (let j = 0; j < this.orderClothItemDTOS.length; j++) {
|
|
|
- let goods = this.orderClothItemDTOS[j]
|
|
|
- console.log(goods.id, Number(cloth.clothId))
|
|
|
- if (goods.id === cloth.clothId) {
|
|
|
- activityAmount += goods.totalPrice * (1 - cloth.discount)
|
|
|
- }
|
|
|
+ let goods = this.orderClothItemDTOS[j]
|
|
|
+ console.log(goods.id, Number(cloth.clothId))
|
|
|
+ if (goods.id === cloth.clothId) {
|
|
|
+ activityAmount += goods.totalPrice * (1 - cloth.discount)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// let total = this.calculateTotalPrice() + this.calculateDeliveryPrice() - this.calculateTotalDiscountAmountByCoupon()
|
|
@@ -631,12 +505,6 @@ export default {
|
|
|
},
|
|
|
// 选择可优惠金额
|
|
|
changeCouponDiscountCloth(index) {
|
|
|
- // this.changeDiscountCouponSelectCloths = this.selectCoupons[index].orderCouponClothDTOS.concat()
|
|
|
- // for (let i = 0; i < this.changeDiscountCouponSelectCloths.length; i++) {
|
|
|
- // var item = this.changeDiscountCouponSelectCloths[i]
|
|
|
- // item.cloth = JSON.parse(JSON.stringify(this.orderClothItemDTOS[item.clothIndex]))
|
|
|
- // }
|
|
|
- // this.changeDiscountCouponIndex = index
|
|
|
this.changeDiscountCouponCanSelectCloths = this.selectCoupons[index].applyCloths.concat()
|
|
|
this.changeDiscountCouponCanSelectCloths.forEach((item) => {
|
|
|
let deductAmount1 = this.handelPrice(item.totalPrice * (1 - this.selectCoupons[index].discountRate / 100))
|
|
@@ -644,28 +512,6 @@ export default {
|
|
|
item.deductAmount = deductAmount
|
|
|
item.isSelected = item.id == this.selectCoupons[index].orderCouponClothDTOS[0].id
|
|
|
})
|
|
|
- // this.orderClothItemDTOS.forEach((item) => {
|
|
|
- // //如果这件衣服已经被被抵扣完成,则不需要选择
|
|
|
- // if (item.totalPrice - item.deductAmount <= 0) {
|
|
|
- // return
|
|
|
- // }
|
|
|
- // //添加优惠券支持的衣服
|
|
|
- // console.log('A4')
|
|
|
- // if (this.selectCoupons[index].appCouponTypeApplyClothVOS) {
|
|
|
- // if (!this.selectCoupons[index].appCouponTypeApplyClothVOS.find((i) => i.clothItemId == item.id)) {
|
|
|
- // return
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // //如果这个优惠券已经被选择过,则跳过
|
|
|
- // console.log('A5')
|
|
|
- // if (this.selectCoupons[index].orderCouponClothDTOS) {
|
|
|
- // if (this.selectCoupons[index].orderCouponClothDTOS.find((i) => i.clothIndex == item.index)) {
|
|
|
- // return
|
|
|
- // }
|
|
|
- // }
|
|
|
- // this.changeDiscountCouponCanSelectCloths.push(item)
|
|
|
- // })
|
|
|
this.changeDiscountCouponTitle = '修改『' + this.selectCoupons[index].couponTypeTitle + '』可抵扣衣物'
|
|
|
this.changeDiscountCouponOpen = true
|
|
|
},
|
|
@@ -795,39 +641,39 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if (coupon.discountWay == '0') {
|
|
|
- //抵扣
|
|
|
- if (coupon.isUnique == 'Y') {
|
|
|
- //单件,只减一件
|
|
|
- var cloth = applyCloths[0]
|
|
|
- //抵扣所有衣服里金额最大的
|
|
|
- if (cloth.totalPrice - cloth.deductAmount >= coupon.deductAmount) {
|
|
|
- coupon.orderCouponClothDTOS.push({ clothIndex: cloth.index, id: cloth.id, deductAmount: coupon.deductAmount, clothName: this.calculateClothNameByInfo(cloth) })
|
|
|
- cloth.deductAmount += coupon.deductAmount
|
|
|
- } else {
|
|
|
- coupon.orderCouponClothDTOS.push({ clothIndex: cloth.index, id: cloth.id, deductAmount: cloth.totalPrice - cloth.deductAmount, clothName: this.calculateClothNameByInfo(cloth) })
|
|
|
- cloth.deductAmount = cloth.totalPrice
|
|
|
- }
|
|
|
- } else {
|
|
|
- //非单件,可减多件
|
|
|
- var deductAmount = coupon.deductAmount
|
|
|
- for (let i = 0; i < coupon.applyCloths.length; i++) {
|
|
|
- //如果优惠券可抵扣金额用完
|
|
|
- if (deductAmount <= 0) {
|
|
|
- break
|
|
|
- }
|
|
|
- var cloth = coupon.applyCloths[i]
|
|
|
- if (cloth.totalPrice - cloth.deductAmount >= deductAmount) {
|
|
|
- coupon.orderCouponClothDTOS.push({ clothIndex: cloth.index, id: cloth.id, deductAmount: deductAmount, clothName: this.calculateClothNameByInfo(cloth) })
|
|
|
- cloth.deductAmount += deductAmount
|
|
|
- deductAmount = 0
|
|
|
+ //抵扣
|
|
|
+ if (coupon.isUnique == 'Y') {
|
|
|
+ //单件,只减一件
|
|
|
+ var cloth = applyCloths[0]
|
|
|
+ //抵扣所有衣服里金额最大的
|
|
|
+ if (cloth.totalPrice - cloth.deductAmount >= coupon.deductAmount) {
|
|
|
+ coupon.orderCouponClothDTOS.push({ clothIndex: cloth.index, id: cloth.id, deductAmount: coupon.deductAmount, clothName: this.calculateClothNameByInfo(cloth) })
|
|
|
+ cloth.deductAmount += coupon.deductAmount
|
|
|
} else {
|
|
|
coupon.orderCouponClothDTOS.push({ clothIndex: cloth.index, id: cloth.id, deductAmount: cloth.totalPrice - cloth.deductAmount, clothName: this.calculateClothNameByInfo(cloth) })
|
|
|
cloth.deductAmount = cloth.totalPrice
|
|
|
- deductAmount -= cloth.totalPrice - cloth.deductAmount
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //非单件,可减多件
|
|
|
+ var deductAmount = coupon.deductAmount
|
|
|
+ for (let i = 0; i < coupon.applyCloths.length; i++) {
|
|
|
+ //如果优惠券可抵扣金额用完
|
|
|
+ if (deductAmount <= 0) {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ var cloth = coupon.applyCloths[i]
|
|
|
+ if (cloth.totalPrice - cloth.deductAmount >= deductAmount) {
|
|
|
+ coupon.orderCouponClothDTOS.push({ clothIndex: cloth.index, id: cloth.id, deductAmount: deductAmount, clothName: this.calculateClothNameByInfo(cloth) })
|
|
|
+ cloth.deductAmount += deductAmount
|
|
|
+ deductAmount = 0
|
|
|
+ } else {
|
|
|
+ coupon.orderCouponClothDTOS.push({ clothIndex: cloth.index, id: cloth.id, deductAmount: cloth.totalPrice - cloth.deductAmount, clothName: this.calculateClothNameByInfo(cloth) })
|
|
|
+ cloth.deductAmount = cloth.totalPrice
|
|
|
+ deductAmount -= cloth.totalPrice - cloth.deductAmount
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
// else
|
|
|
if (coupon.discountWay == '1') {
|
|
|
//满减
|
|
@@ -881,55 +727,67 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
- async submitForm(payTimeType) {
|
|
|
- this.$refs['confirmPayForm'].validate((valid) => {
|
|
|
+ submitForm(payTimeType) {
|
|
|
+ if (!this.$refs.payForm) {
|
|
|
+ this.$message.error('表单实例不存在');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$refs.payForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
- var params = { ...this.orderForm }
|
|
|
- params.appUserId = this.appUserInfo.id
|
|
|
- params.orderClothItemDTOS = this.orderClothItemDTOS.concat()
|
|
|
- params.orderClothItemDTOS.forEach((item) => {
|
|
|
- item.clothItemName = item.name
|
|
|
- })
|
|
|
- var orderCouponDTOS = this.selectCoupons.concat()
|
|
|
- if (this.orderForm.discountCouponId) {
|
|
|
- var coupon = this.discountCouponVOS.find((item) => (item.id = this.orderForm.discountCouponId))
|
|
|
- var orderCouponClothDTOS = []
|
|
|
- this.getDiscountClothList().forEach((item) => {
|
|
|
- var orderCouponClothDTO = { id: item.id, clothIndex: item.index, deductAmount: parseInt((item.totalPrice - item.deductAmount) * 100 * parseInt(100 - coupon.deductAmount * 100)) / 10000 }
|
|
|
- orderCouponClothDTOS.push(orderCouponClothDTO)
|
|
|
- })
|
|
|
- orderCouponDTOS.push({ id: coupon.id, ...{ orderCouponClothDTOS: orderCouponClothDTOS } })
|
|
|
+ const params = { ...this.orderForm };
|
|
|
+ params.appUserId = this.appUserInfo?.id;
|
|
|
+ params.orderClothItemDTOS = this.orderClothItemDTOS.concat();
|
|
|
+ params.orderClothItemDTOS.forEach(item => {
|
|
|
+ item.clothItemName = item.name;
|
|
|
+ });
|
|
|
+
|
|
|
+ params.orderCouponDTOS = this.selectCoupons.concat();
|
|
|
+ params.isSpecial = params.isSpecial ? 'Y' : 'N';
|
|
|
+ params.payTimeType = payTimeType;
|
|
|
+
|
|
|
+ if (payTimeType === 1) {
|
|
|
+ params.payType = 0;
|
|
|
}
|
|
|
- params.orderCouponDTOS = orderCouponDTOS
|
|
|
- params.isSpecial = params.isSpecial ? 'Y' : 'N'
|
|
|
- params.payTimeType = payTimeType
|
|
|
- if (payTimeType == 1) {
|
|
|
- params.payType = 0
|
|
|
+
|
|
|
+ if (this.calculateTotalDiscountByActivity(this.activity, 'A3')) {
|
|
|
+ params.activityId = this.activity.id;
|
|
|
+ params.activityDiscountAmount = this.calculateTotalDiscountByActivity(this.activity, 'A4');
|
|
|
}
|
|
|
- if (this.calculateTotalDiscountByActivity(this.activity)) {
|
|
|
- params.activityId = this.activity.id
|
|
|
- params.activityDiscountAmount = this.calculateTotalDiscountByActivity(this.activity)
|
|
|
- }
|
|
|
- params.sendClothWay = this.orderForm.sendClothWay
|
|
|
- console.log(params)
|
|
|
+
|
|
|
+ params.sendClothWay = this.orderForm.sendClothWay;
|
|
|
+
|
|
|
+ // 修改 loading 配置,只覆盖表单区域
|
|
|
const loading = this.$loading({
|
|
|
+ target: '.cash-container', // 指定 loading 覆盖的目标元素
|
|
|
lock: true,
|
|
|
- text: 'Loading',
|
|
|
+ text: '正在处理支付...',
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
- })
|
|
|
+ });
|
|
|
+
|
|
|
collectCloth(params)
|
|
|
- .then((res) => {
|
|
|
- this.$message('提交成功')
|
|
|
- loading.close()
|
|
|
- this.$emit('onPaySuccess', { ...res.data, authCode: this.orderForm.authCode })
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- loading.close()
|
|
|
- this.$message.error(e.data.msg)
|
|
|
+ .then(res => {
|
|
|
+ loading.close();
|
|
|
+ // 直接打开支付状态弹窗,不需要延时
|
|
|
+ if (this.orderForm.payType === '0') {
|
|
|
+ this.$refs.payStatusPopup.open(3, res.data, this.appUserInfo);
|
|
|
+ } else if (this.orderForm.payType === '2') {
|
|
|
+ this.$refs.payStatusPopup.open(1, res.data);
|
|
|
+ } else if (this.orderForm.payType === '3') {
|
|
|
+ if (this.appUserInfo.rechargeBalance + this.appUserInfo.giveBalance >= params.payAmount) {
|
|
|
+ this.$refs.payStatusPopup.open(1, res.data);
|
|
|
+ } else {
|
|
|
+ this.$refs.payStatusPopup.open(4, { payMsg: '余额不足' });
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
+ .catch(e => {
|
|
|
+ loading.close();
|
|
|
+ this.$refs.payStatusPopup.open(4, { payMsg: e.data.msg || '支付失败' });
|
|
|
+ });
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
removeCouponRelateCloth(index) {
|
|
|
var cloth = this.changeDiscountCouponSelectCloths[index].cloth
|
|
@@ -1017,9 +875,266 @@ export default {
|
|
|
})
|
|
|
.then(() => {})
|
|
|
.catch(() => {})
|
|
|
+ },
|
|
|
+ getTagType(discountWay) {
|
|
|
+ switch (discountWay) {
|
|
|
+ case '0':
|
|
|
+ return 'success'
|
|
|
+ case '1':
|
|
|
+ return 'warning'
|
|
|
+ case '2':
|
|
|
+ return 'info'
|
|
|
+ default:
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getDiscountTypeLabel(discountWay) {
|
|
|
+ switch (discountWay) {
|
|
|
+ case '0':
|
|
|
+ return '抵扣券'
|
|
|
+ case '1':
|
|
|
+ return '满减券'
|
|
|
+ case '2':
|
|
|
+ return '折扣券'
|
|
|
+ default:
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ canModifyCoupon(coupon, index) {
|
|
|
+ return index === this.selectCoupons.length - 1 && coupon.discountWay === '2' && coupon.isUnique === 'Y'
|
|
|
+ },
|
|
|
+ // 处理支付成功
|
|
|
+ handlePaySuccess() {
|
|
|
+ // 通知父组件支付成功,但不关闭收银台
|
|
|
+ this.$emit('onPaySuccess', {
|
|
|
+ keepDialogOpen: true
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 处理确认
|
|
|
+ handleConfirm(orderInfo) {
|
|
|
+ // 处理确认事件
|
|
|
+ this.$emit('confirm', orderInfo);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style scoped></style>
|
|
|
+<style>
|
|
|
+
|
|
|
+
|
|
|
+</style>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.cash-cloth-container {
|
|
|
+ height: 100%;
|
|
|
+ .dialog-container {
|
|
|
+ .discount-cloth-dialog {
|
|
|
+ .dialog-header {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .cash-container {
|
|
|
+ display: flex;
|
|
|
+ gap: 20px;
|
|
|
+ height: 100%;
|
|
|
+ padding: 20px;
|
|
|
+
|
|
|
+ .info-section {
|
|
|
+ width: 320px; /* 减小左侧宽度 */
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .discount-section {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .card-header {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 20px;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .info-item {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 15px;
|
|
|
+
|
|
|
+ .label {
|
|
|
+ color: #606266;
|
|
|
+ }
|
|
|
+
|
|
|
+ .value {
|
|
|
+ font-weight: bold;
|
|
|
+
|
|
|
+ &.price {
|
|
|
+ color: #f56c6c;
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.discount {
|
|
|
+ color: #67c23a;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.balance {
|
|
|
+ color: #409eff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .total {
|
|
|
+ margin-top: 20px;
|
|
|
+ padding-top: 20px;
|
|
|
+ border-top: 1px dashed #dcdfe6;
|
|
|
+
|
|
|
+ .label {
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .payment-methods {
|
|
|
+ margin: 20px 0;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .payment-actions {
|
|
|
+ margin-top: 30px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ }
|
|
|
+
|
|
|
+ .scan-input {
|
|
|
+ margin: 20px 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .coupon-actions {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .selected-coupons {
|
|
|
+ .discount-content {
|
|
|
+ font-size: 13px;
|
|
|
+ .amount {
|
|
|
+ color: #f56c6c;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .cloth-list {
|
|
|
+ max-height: 300px;
|
|
|
+ overflow-y: auto;
|
|
|
+
|
|
|
+ .cloth-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 5px 0;
|
|
|
+ border-bottom: 1px solid #ebeef5;
|
|
|
+
|
|
|
+ .index {
|
|
|
+ width: 40px;
|
|
|
+ color: #909399;
|
|
|
+ }
|
|
|
+
|
|
|
+ .name {
|
|
|
+ flex: 1;
|
|
|
+ margin: 0 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .amount {
|
|
|
+ color: #f56c6c;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .cloth-summary {
|
|
|
+ cursor: pointer;
|
|
|
+ color: #409eff;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ opacity: 0.8;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .payment-status-container {
|
|
|
+ position: relative;
|
|
|
+ z-index: 3000;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+
|
|
|
+<style>
|
|
|
+.payStatusPopup {
|
|
|
+ .el-dialog__wrapper {
|
|
|
+ z-index: 3000 !important;
|
|
|
+ }
|
|
|
+ .el-dialog {
|
|
|
+ z-index: 3001 !important;
|
|
|
+ }
|
|
|
+ .v-modal {
|
|
|
+ z-index: 2999 !important;
|
|
|
+ background-color: rgba(0, 0, 0, 0.5) !important;
|
|
|
+ opacity: 1 !important;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+
|
|
|
+<style>
|
|
|
+/* 主题色定义 */
|
|
|
+:root {
|
|
|
+ --primary-color: #409EFF;
|
|
|
+ --success-color: #67C23A;
|
|
|
+ --warning-color: #E6A23C;
|
|
|
+ --danger-color: #F56C6C;
|
|
|
+ --info-color: #909399;
|
|
|
+}
|
|
|
+
|
|
|
+/* 表格视觉优化 */
|
|
|
+.el-table {
|
|
|
+ /* 表头样式 */
|
|
|
+ th {
|
|
|
+ background-color: #F5F7FA !important;
|
|
|
+ color: #606266;
|
|
|
+ font-weight: 600;
|
|
|
+ height: 48px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 斑马纹 */
|
|
|
+ .el-table__row--striped {
|
|
|
+ background-color: #FAFAFA;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 悬停效果 */
|
|
|
+ .el-table__row:hover {
|
|
|
+ background-color: #F5F7FA;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/* 按钮样式优化 */
|
|
|
+.el-button {
|
|
|
+ &--primary {
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+
|
|
|
+ &--text {
|
|
|
+ padding: 4px 8px;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ background: rgba(64,158,255,0.1);
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|