Commit 9b73fae7 by 李伟康

提交

1 parent d43df1b5
......@@ -181,7 +181,10 @@
></el-input>
</div>
</glsx-combi-form>
<div class="del flex-align" @click="delGoods(index)">
<div
class="del flex-align"
@click="delGoods(index)"
>
<img src="@/assets/icon-del.png" />
</div>
</div>
......@@ -263,6 +266,7 @@
<el-radio-group
v-model="editForm[scope.scope.name]"
@change="handleIsLimit"
:disabled="limitPurchaseDisabled"
>
<el-radio
v-for="(item, index) in scope.scope.optionList"
......@@ -1155,6 +1159,8 @@ export default {
relateStoreVisible: false, // 选择门店
limitPurchaseDisabled:false,//多商品禁用限购
selectedList: [],
selectedProInfo: [],
// selectedProInfo: {},
......@@ -1168,11 +1174,6 @@ export default {
activityImg: '',
promotion: '',
activityTime: [],
// activityPrice: '', 改-定金
activityPriceList: [],
// goodsStock: '', 改-库存
goodsStockList: [],
crowdFundingPriceList: [],
goodsList: [],
limitPurchaseFlag: 1,
limitPurchaseNumber: '',
......@@ -2149,12 +2150,6 @@ export default {
'editForm.liveBroadcastRoomId' (newValue, oldValue) {
this.editForm.liveFlag = newValue ? true : false
},
'editForm.goodsId' (newValue, oldValue) {
if (newValue) {
let idx = this.editFormData.findIndex(val => val.name == 'goodsCategory')
this.editFormData[idx].isHide = false
}
},
'editForm.targetStock' (newValue, oldValue) {
this.editForm.targetStock = limitPrice(newValue, oldValue, 99999, 0)
},
......@@ -2311,15 +2306,9 @@ export default {
this.editRule.limitPurchaseNumber[0].required = val != 1
},
handleRelateProChange (val) {
this.editRule.goodsId[0].required = val == 2
var idx = this.editFormData.findIndex(item => item.name == 'goodsId')
this.editFormData[idx].isHide = val != 2
},
handleRelateProClose (targetItem) {
handleRelateProClose () {
// 先选门店在选商品
if (!this.editForm.merchantId) return this.$message.error('请先选择门店!')
//多选 this.selectedProInfo = this.editForm.goodsId ? { id: this.editForm.goodsId } : {}
this.handleSingleSelectClose()
},
formatAppend (val, target, index, isInt) {
......@@ -2349,15 +2338,11 @@ export default {
} else list.map(e => {
arr.push({ goodsId: e.id })
})
// 多选 this.editForm.goodsId = selectedProInfo.id
// this.getGoodInfo(selectedProInfo.id)
this.selectedProInfo = list || []
this.editForm.goodsList = arr || []
this.setLimitPurchase()
},
handleSingleSelectClose (isCancel = false) {
// if (isCancel) {
// this.selectedProInfo.id && this.getGoodInfo(this.selectedProInfo.id)
// }
this.isSingleSelectVisible = !this.isSingleSelectVisible
},
......@@ -2738,7 +2723,7 @@ export default {
}
// 复制
if (this.routeInfo.addOrEdit == 'copy') {
let resetArr = [{ name: 'id' }, { name: 'activityTime', type: 'array' }, { name: 'liveBroadcastRoomId' }, { name: 'groupQrCode' }, { name: 'floatingMaskDiagram' }, { name: 'liveBroadcastRoomCover' }, { name: 'liveBroadcastRoomEndCover' }, { name: 'selectedProInfo', type: 'Object' }, { name: 'goodsId' }, { name: 'activityPrice' }, { name: 'crowdFundingPrice' }, { name: 'goodsStock' }]
let resetArr = [{ name: 'id' }, { name: 'activityTime', type: 'array' }, { name: 'liveBroadcastRoomId' }, { name: 'groupQrCode' }, { name: 'floatingMaskDiagram' }, { name: 'liveBroadcastRoomCover' }, { name: 'liveBroadcastRoomEndCover' }, { name: 'selectedProInfo', type: 'Object' }, { name: 'goodsList' }, { name: 'activityPrice' }, { name: 'crowdFundingPrice' }, { name: 'goodsStock' }]
this.copyReset(resetArr)
}
// 兼容以前众筹活动没有战报内容配置,展示页面
......@@ -2787,22 +2772,12 @@ export default {
})
},
validateRules () {
if (this.specificationDetailList.length) {
this.editRule.activityPrice[0].required = false
this.editRule.goodsStock[0].required = false
} else {
this.editRule.activityPrice[0].required = true
this.editRule.goodsStock[0].required = true
}
},
getCouponInfoParams () {
var _this = this
var param = this.$common.utils.deepClone(this.editForm)
param.marketingType = 3
//改
param.goodsList.map(e =>{
param.goodsList.map(e => {
e.activityPrice = (e.activityPrice * 100).toFixed(0) //存的分,需乘100
e.crowdFundingPrice = (e.crowdFundingPrice * 100).toFixed(0) //存的分,需乘100
})
......@@ -2814,7 +2789,6 @@ export default {
param.startTime = d[0]
param.endTime = d[1]
}
// param.goodsId = this.selectedProInfo.id
if (this.nameToValSpecsList.length > 0) {
delete param.activityPrice
delete param.goodsStock
......@@ -2930,9 +2904,9 @@ export default {
},
addOrUpdate () {
// this.loading = true
this.loading = true
var params = this.getCouponInfoParams()
console.table({...params})
console.table({ ...params })
this.$apis.seckillActivity
.addOrUpdateActivityApi(params)
.then(res => {
......@@ -2978,7 +2952,6 @@ export default {
this.editForm.activityServices = this.delListAllEmpty('activityServices', ['title', 'content'])
this.editForm.activityCommoditys = this.delListAllEmpty('activityCommoditys', ['question', 'answer'])
this.editForm.activityExperienceDTOs = this.delListAllEmpty('activityExperienceDTOs', ['experience', 'activityExperienceImgs'])
// this.validateRules()
var flag = true
if (this.nameToValSpecsList && this.nameToValSpecsList.length > 0) {
var list = this.nameToValSpecsList
......@@ -3134,10 +3107,19 @@ export default {
},
/**删除商品 */
delGoods(index){
this.editForm.goodsList.splice(index,1)
this.selectedProInfo.splice(index,1)
delGoods (index) {
this.editForm.goodsList.splice(index, 1)
this.selectedProInfo.splice(index, 1)
this.setLimitPurchase()
},
setLimitPurchase () {
const { goodsList } = this.editForm
if (goodsList.length > 1) this.editForm.limitPurchaseFlag = 1
this.limitPurchaseDisabled = goodsList.length > 1
}
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!