|
@@ -100,8 +100,9 @@
|
|
|
<script>
|
|
|
import Upload from '@/components/ImageUpload'
|
|
|
import SelectTicket from './components/selectTicket'
|
|
|
-import { publicFileGetUrl } from "@/api/common"
|
|
|
+import { publicFileGetUrl } from '@/api/common'
|
|
|
import { getCouponDetail, addCoupon } from '@/api/business/coupon'
|
|
|
+import { accDiv, accMul } from '@/utils/util'
|
|
|
export default {
|
|
|
name: 'CouponAdd',
|
|
|
components: {
|
|
@@ -153,7 +154,9 @@ export default {
|
|
|
this.addData = {
|
|
|
type: JSON.parse(res.data.type).value,
|
|
|
useArea: JSON.parse(res.data.useArea).value,
|
|
|
- couponId, title, quantity, discount, channelSharedRate, minOrderAmt, dueDays, description, ticketBoxList
|
|
|
+ discount: accDiv(discount, 100),
|
|
|
+ minOrderAmt: accDiv(minOrderAmt, 100),
|
|
|
+ couponId, title, quantity, channelSharedRate, dueDays, description, ticketBoxList
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -166,7 +169,8 @@ export default {
|
|
|
if(this.addData.useArea === 1) {
|
|
|
this.addData.boxIds = this.addData.ticketBoxList.map(item => { return item.boxId }).toString()
|
|
|
}
|
|
|
- addCoupon(this.addData).then(res => {
|
|
|
+ const { discount, minOrderAmt, ...rest } = this.addData
|
|
|
+ addCoupon({...rest, ...{ discount: accMul(discount, 100), minOrderAmt: accMul(minOrderAmt, 100),}}).then(res => {
|
|
|
this.addIng = false
|
|
|
if (res.code === 0) {
|
|
|
this.$message({
|