diff --git a/.env.development b/.env.development index 060384e..438e7e0 100644 --- a/.env.development +++ b/.env.development @@ -8,7 +8,7 @@ VUE_APP_BASE_API = '/api' # VUE_APP_URL = "http://jianguan.yyundong.com/shgfapi" -VUE_APP_URL = "http://192.168.2.106:7201" +VUE_APP_URL = "http://192.168.2.111:7201" VUE_APP_REPORT_URL = "http://192.168.2.106:7202" ##VUE_APP_REPORT_URL = "https://lpk.yyundong.com" ##VUE_APP_REPORT_URL = "https://supervise.yxtsoft.com/lpk" diff --git a/src/api/marketingCard/marketingCard.js b/src/api/marketingCard/marketingCard.js index 04e6af3..937a522 100644 --- a/src/api/marketingCard/marketingCard.js +++ b/src/api/marketingCard/marketingCard.js @@ -162,7 +162,7 @@ export default { // 初始化礼包 AppletGiftBagInit: function(data) { return request({ - url: '/lpkgiftbag/giftBagInit/'+data, + url: '/appletgiftbag/giftBagInit/'+data, method: 'get' }); }, diff --git a/src/views/marketingCard/appletAdd.vue b/src/views/marketingCard/appletAdd.vue index ae0d8e8..b592494 100644 --- a/src/views/marketingCard/appletAdd.vue +++ b/src/views/marketingCard/appletAdd.vue @@ -38,7 +38,7 @@ - + @@ -64,11 +64,11 @@ - + - + @@ -142,9 +142,11 @@ - - - + + + + + @@ -175,17 +177,31 @@ - 单价 + 价格(元/斤) + oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"> 商品单位 - {{GiftBagGood.unitName}} + {{GiftBagGood.specificationUnit}} + + + + + 规格(斤份) + + {{GiftBagGood.weight}} + + + + + 小计 + + {{GiftBagGood.subtotal}} @@ -233,6 +249,9 @@ name: "", unitName: "", price: "", + specificationUnit: "", + weight: "", + subtotal: "0.00" }, goods: [], @@ -254,6 +273,8 @@ const index = this.formobj.goods.findIndex((item) => item.goodsSid === sid) console.log("index》》》》", index) this.formobj.goods.splice(index, 1) + + this.countPrice() }) }, save() { @@ -289,11 +310,14 @@ name: "", unitName: "", price: "", + specificationUnit: "", + weight: "", + subtotal: "0.00" } this.editDialog = false this.countPrice() - + } else { this.$message({ showClose: true, @@ -305,39 +329,46 @@ }, - - countPrice(){ - + + countPrice() { + let num = 0 - + for (var i = 0; i < this.formobj.goods.length; i++) { var item = this.formobj.goods[i] - - num+=item.goodsNumber*item.price - + + num += Number(item.subtotal) + } - - console.log("num",num); - - this.formobj.price = num.toFixed(2) - this.formobj.preferentialPrice = num.toFixed(2) - + + console.log("num", num); + + this.formobj.price = Number(num).toFixed(2) + this.formobj.preferentialPrice = Number(num).toFixed(2) + }, - - handleCancle(){ + + handleCancle() { this.GiftBagGood = { goodsSid: "", goodsNumber: "", name: "", unitName: "", price: "", - + specificationUnit: "", + weight: "", + subtotal: "0.00" + } this.editDialog = false }, input(val) { console.log("input》》》》", val) this.GiftBagGood.goodsNumber = val + + this.GiftBagGood.subtotal = this.GiftBagGood.goodsNumber * this.GiftBagGood.price * this.GiftBagGood.weight + + }, add() { this.editDialog = true @@ -358,6 +389,8 @@ this.GiftBagGood.name = choose[0].name this.GiftBagGood.unitName = choose[0].unitName this.GiftBagGood.price = choose[0].price + this.GiftBagGood.specificationUnit = choose[0].specificationUnit + this.GiftBagGood.weight = choose[0].weight }, diff --git a/src/views/marketingCard/appletInfo.vue b/src/views/marketingCard/appletInfo.vue index 0fca57d..41bcdb1 100644 --- a/src/views/marketingCard/appletInfo.vue +++ b/src/views/marketingCard/appletInfo.vue @@ -32,60 +32,61 @@ - 边界金额 + - {{formobj.boundaryPrice}} + - 起始日期 + 礼包总价格 - {{formobj.dateStart}} + {{formobj.price}} - 终止日期 + 优惠后价格 - {{formobj.dateEnd}} + {{formobj.preferentialPrice}} + - 发放条件 + 起始日期 - {{formobj.boundary}} + {{formobj.dateStart}} - + 终止日期 - + {{formobj.dateEnd}} - + @@ -126,9 +127,11 @@ --> - - - + + + + + @@ -186,7 +189,7 @@ }, showAdd(row) { console.log("showAdd》》》》", row) - req.giftBagInit(row.sid) + req.AppletGiftBagInit(row.sid) .then(resp => { if (resp.success) { this.formobj = resp.data