更新代码

This commit is contained in:
guaishoudemao
2021-02-06 16:42:26 +08:00
parent fdbd2ef1f1
commit c9b86697c3
80 changed files with 3056 additions and 2156 deletions

View File

@@ -104,7 +104,7 @@
</el-col>
<el-col :span="24">
<el-form-item label="砍价人数:" prop="peopleNum">
<el-input-number v-model="formValidate.peopleNum" :min="2" :step="1" step-strictly step-strictly placeholder="请输入砍价人数" class="selWidthd mr20"/>
<el-input-number v-model="formValidate.peopleNum" :min="2" :step="1" step-strictly placeholder="请输入砍价人数" class="selWidthd mr20"/>
<span>需邀请多少人砍价成功</span>
</el-form-item>
</el-col>
@@ -493,7 +493,7 @@
});
}
if(tit==='1'&& num === 'duo' ){
_this.specType ? _this.ManyAttrValue[i].image = img[0].sattDir : _this.ManyAttrValue[0].image = img[0].sattDir
_this.ManyAttrValue[i].image = img[0].sattDir
}
},tit, 'content')
},
@@ -558,7 +558,7 @@
this.fullscreenLoading = true
productDetailApi(id).then(async res => {
this.formValidate = {
image: res.image,
image: this.$selfUtil.setDomain(res.image),
imagess: JSON.parse(res.sliderImage),
title: res.storeName,
info: res.storeInfo,
@@ -585,12 +585,14 @@
if(res.specType){
res.attrValues.forEach((row) => {
row.quota = row.stock;
row.image = this.$selfUtil.setDomain(row.image)
});
this.ManyAttrValue = res.attrValues
this.multipleSelection = res.attrValues
}else{
res.attrValue.forEach((row) => {
row.quota = row.stock;
row.image = this.$selfUtil.setDomain(row.image)
});
this.ManyAttrValue = res.attrValue
this.radio = res.attrValue[0]
@@ -605,8 +607,8 @@
this.fullscreenLoading = true
bargainInfoApi({id:id}).then(async res => {
this.formValidate = {
image: res.image,
imagess: res.sliderImage?JSON.parse(res.sliderImage):[],
image: this.$selfUtil.setDomain(res.image),
imagess: JSON.parse(res.sliderImage),
title: res.title,
proName: res.title,
info: res.info,
@@ -633,6 +635,7 @@
this.ManyAttrValue = res.attrValues;
this.$nextTick(() => {
this.ManyAttrValue.forEach((item, index) => {
item.image = this.$selfUtil.setDomain(item.image)
if (item.checked) {
this.radio = item
}
@@ -640,6 +643,9 @@
});
}else{
this.ManyAttrValue = res.attrValue;
this.ManyAttrValue.forEach((item, index) => {
item.image = this.$selfUtil.setDomain(item.image)
})
this.formValidate.attr = [];
this.radio = res.attrValue[0];
}

View File

@@ -57,7 +57,6 @@
v-model="termTime"
type="datetimerange"
range-separator=""
format="yyyy - MM - dd - HH : mm : ss"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
:picker-options="pickerOptions"
@@ -76,11 +75,11 @@
v-model="isForeverTime"
type="datetimerange"
range-separator=""
format="yyyy - MM - dd - HH : mm : ss"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions"
start-placeholder="开始日期"
end-placeholder="结束日期">
end-placeholder="结束日期"
@blur="handleTimestamp">
</el-date-picker>
</el-form-item>
<el-form-item label="领取方式" prop="resource">
@@ -133,7 +132,6 @@
loading: false,
threshold: false,
termTime: [],
isForeverTime: [],
props2: {
children: 'child',
label: 'name',
@@ -164,21 +162,31 @@
status: false,
checked: []
},
isForeverTime: [],
rules: {
name: [
{ required: true, message: '请输入优惠券名称', trigger: 'blur' },
{ required: true, message: '请输入优惠券名称', trigger: 'blur' }
],
day: [
{ required: true, message: '请输入使用有效期限(天)', trigger: 'blur' },
{ required: true, message: '请输入使用有效期限(天)', trigger: 'blur' }
],
money: [
{ required: true, message: '请输入优惠券面值', trigger: 'blur' },
{ required: true, message: '请输入优惠券面值', trigger: 'blur' }
],
primaryKey: [
{ required: true, message: '请选择品类', trigger: 'change' },
{ required: true, message: '请选择品类', trigger: 'change' }
],
checked: [
{ required: true, message: '请至少选择一个商品', trigger: 'change', type: 'array' },
{ required: true, message: '请至少选择一个商品', trigger: 'change', type: 'array' }
],
isForeverTime: [
{ required: true, message: '请选择领取时间', trigger: 'change', type: 'array' }
],
total: [
{ required: true, message: '请输入发布数量', trigger: 'blur' }
],
minPrice: [
{ required: true, message: '请输入最低消费', trigger: 'blur' }
]
}
}
@@ -188,6 +196,9 @@
if( this.$route.params.id ) this.getInfo()
},
methods: {
handleTimestamp(){
},
// 商品分类;
getCategorySelect() {
categoryApi({ status: -1, type: 1 }).then(res => {
@@ -219,7 +230,7 @@
}
info.minPrice == 0 ? this.threshold = false : this.threshold = true
info.isForever ? this.isForeverTime = [info.receiveStartTime, info.receiveEndTime] : this.isForeverTime = []
info.isFixedTime ? this.termTime = [info.useStartTime, info.useEndTime] : this.termTime = []
info.isFixedTime && info.useStartTime && info.useEndTime ? this.termTime = [info.useStartTime, info.useEndTime] : this.termTime = []
this.loading = false
}).catch(res => {
this.loading = false
@@ -236,6 +247,8 @@
},'many',_this.ruleForm.checked)
},
submitForm(formName) {
if( (this.ruleForm.isFixedTime && !this.termTime) || this.ruleForm.isFixedTime && !this.termTime.length) return this.$message.warning("请选择使用有效期限")
if( (this.ruleForm.isForever && !this.isForeverTime) || (this.ruleForm.isForever && !this.isForeverTime.length)) return this.$message.warning("请选择请选择领取时间")
if( this.ruleForm.useType === 2 ) this.ruleForm.primaryKey = this.ruleForm.checked.map(item => {return item.id}).join(',')
if( this.ruleForm.useType === 1 ) this.ruleForm.primaryKey = ''
if( !this.threshold ) this.ruleForm.minPrice = 0
@@ -246,7 +259,7 @@
this.ruleForm.isForever && this.isForeverTime.length ? this.ruleForm.receiveEndTime = this.isForeverTime[1] : this.ruleForm.receiveEndTime = ''
this.$refs[formName].validate((valid) => {
if (valid) {
this.loading = true
this.loading = true
couponSaveApi(this.ruleForm).then(() => {
this.$message.success("新增成功")
this.loading = false

View File

@@ -112,7 +112,7 @@
<template slot-scope="scope">
<el-button type="text" class="mr10" size="small" @click="receive(scope.row)">领取记录</el-button>
<router-link :to=" { path: '/marketing/coupon/list/save/' + scope.row.id } ">
<el-button type="text" size="small">复制</el-button>
<el-button v-if="scope.row.status" type="text" size="small">复制</el-button>
</router-link>
</template>
</el-table-column>

View File

@@ -17,7 +17,7 @@
label-width="180px"
@submit.native.prevent
>
<!-- 砍价商品-->
<!-- 拼团商品-->
<div v-show="currentTab === 0">
<el-form-item label="选择商品:" prop="image">
<div class="upLoadPicBox" @click="changeGood">
@@ -99,13 +99,13 @@
</el-col>
<el-col :span="24">
<el-form-item label="拼团时效(单位 小时)" prop="effectiveTime">
<el-input-number v-model="formValidate.effectiveTime" :min="1" :step="1" step-strictly step-strictly placeholder="请输入拼团人数" class="selWidthd mr20"/>
<el-input-number v-model="formValidate.effectiveTime" :min="1" :step="1" step-strictly placeholder="请输入拼团人数" class="selWidthd mr20"/>
<span>用户发起拼团后开始计时需在设置时间内邀请到规定好友人数参团超过时效时间则系统判定拼团失败自动发起退款</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="拼团人数:" prop="people">
<el-input-number v-model="formValidate.people" :min="2" :step="1" step-strictly step-strictly placeholder="请输入拼团人数" class="selWidthd mr20"/>
<el-input-number v-model="formValidate.people" :min="2" :step="1" step-strictly placeholder="请输入拼团人数" class="selWidthd mr20"/>
<span>单次拼团需要参与的用户数</span>
</el-form-item>
</el-col>
@@ -117,13 +117,13 @@
</el-col>
<el-col :span="24">
<el-form-item label="单次购买数量限制:" prop="onceNum">
<el-input-number v-model="formValidate.onceNum" :min="1" :step="1" step-strictly placeholder="请输入购买数量限制" class="selWidthd mr20"/>
<el-input-number v-model="formValidate.onceNum" :min="1" :max="formValidate.num" :step="1" step-strictly placeholder="请输入购买数量限制" class="selWidthd mr20"/>
<span>用户参与拼团时一次购买最大数量限制例如设置为2表示参与拼团时用户一次购买数量最大可选择2个</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="补齐人数:" prop="peopleNum">
<el-input-number v-model="formValidate.peopleNum" :min="0" :max="formValidate.people - 1" :step="1" step-strictly placeholder="请输入补齐人数" class="selWidthd mr20"/>
<el-form-item label="补齐人数:" prop="virtualRation">
<el-input-number v-model="formValidate.virtualRation" :min="0" :max="formValidate.people - 1" :step="1" step-strictly placeholder="请输入补齐人数" class="selWidthd mr20"/>
<span>当用户参与拼团后成团时效内未成团情况下设置补齐人数可虚拟成团例如成团人数为10人补齐人数为4人真实用户需要参与6人成团才可以在最后未成团时自动补齐虚拟人员</span>
</el-form-item>
</el-col>
@@ -147,14 +147,14 @@
</div>
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="热门推荐:" required>
<el-radio-group v-model="formValidate.isHost">
<el-radio :label="false" class="radio">关闭</el-radio>
<el-radio :label="true">开启</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!--<el-col v-bind="grid2">-->
<!--<el-form-item label="热门推荐:" required>-->
<!--<el-radio-group v-model="formValidate.isHost">-->
<!--<el-radio :label="false" class="radio">关闭</el-radio>-->
<!--<el-radio :label="true">开启</el-radio>-->
<!--</el-radio-group>-->
<!--</el-form-item>-->
<!--</el-col>-->
<el-col v-bind="grid2">
<el-form-item label="活动状态:" required>
<el-radio-group v-model="formValidate.isShow">
@@ -214,7 +214,6 @@
:max="scope.row.stock"
:step="1" step-strictly
class="priceBox"
@change="inpChange(scope.row[iii], scope.row.id)"
/>
<span v-else v-text="scope.row[iii]" class="priceBox" />
</template>
@@ -308,7 +307,7 @@
timeVal: [],
effectiveTime: 0,
people: 2,
peopleNum: 0
virtualRation: 0
}
const objTitle = {
price: {
@@ -402,7 +401,7 @@
timeVal:[
{ required: true, message: '请选择活动日期', trigger: 'change', type: 'array'}
],
peopleNum:[
virtualRation:[
{ required: true, message: '请输入补齐人数', trigger: 'blur'}
],
onceNum: [
@@ -456,18 +455,6 @@
})
this.multipleSelection = val;
},
inpChange(currentValue, id){
// this.ManyAttrValue.map(item => {
// if(!currentValue && item.id ===id){
// item.quota = 1
// this.$set(item, 'quota', 1)
// this.ManyAttrValue = Object.assign([], this.ManyAttrValue)
// }
// })
console.log(this.ManyAttrValue)
// if(!currentValue) item.quota = 1
},
watCh(val) {
const tmp = {}
const tmpTab = {}
@@ -499,7 +486,7 @@
});
}
if(tit==='1'&& num === 'duo' ){
_this.specType ? _this.ManyAttrValue[i].image = img[0].sattDir : _this.ManyAttrValue[0].image = img[0].sattDir
_this.ManyAttrValue[i].image = img[0].sattDir
}
},tit, 'content')
@@ -520,8 +507,7 @@
},
handleSubmitNest1() {
if (!this.formValidate.image) {
this.$message.warning("请选择商品!");
return;
return this.$message.warning("请选择商品!");
} else {
this.currentTab++;
if (!this.$route.params.id) this.getProdect(this.productId);
@@ -564,9 +550,9 @@
getProdect(id) {
this.fullscreenLoading = true
productDetailApi(id).then(async res => {
this.formValidate = res;
//this.formValidate = res;
this.formValidate = {
image: res.image,
image: this.$selfUtil.setDomain(res.image),
imagelist: JSON.parse(res.sliderImage),
title: res.storeName,
info: res.storeInfo,
@@ -600,6 +586,7 @@
});
this.$nextTick(() => {
res.attrValues.forEach((row) => {
row.image = this.$selfUtil.setDomain(row.image)
this.$refs.multipleTable.toggleRowSelection(row, true);
this.$set(row, 'checked', true)
});
@@ -621,9 +608,9 @@
getSekllProdect(id) {
this.fullscreenLoading = true
combinationInfoApi({id:id}).then(async res => {
this.formValidate = res;
//this.formValidate = res;
this.formValidate = {
image: res.image,
image: this.$selfUtil.setDomain(res.image),
imagelist: JSON.parse(res.sliderImage),
title: res.title,
info: res.info,
@@ -648,13 +635,13 @@
effectiveTime : res.effectiveTime,
isPostage: false,
startTime: res.startTimeStr || '',
stopTime: res.stopTimeStr || '',
peopleNum : Math.floor(res.people-res.virtualRation/100*res.people)
stopTime: res.stopTimeStr || ''
}
if(res.specType){
this.ManyAttrValue = res.attrValues;
this.$nextTick(() => {
this.ManyAttrValue.forEach((item, index) => {
item.image = this.$selfUtil.setDomain(item.image)
if (item.checked) {
this.$set(item, 'price', item.price)
this.$set(item, 'quota', item.quota)
@@ -709,7 +696,7 @@
this.formValidate.attrValue = this.multipleSelection
}
this.formValidate.images = JSON.stringify(this.formValidate.imagelist);
this.formValidate.virtualRation = Math.floor((this.formValidate.people - this.formValidate.peopleNum) / this.formValidate.people * 100)
// this.formValidate.virtualRation = Math.floor((this.formValidate.people - this.formValidate.peopleNum) / this.formValidate.people * 100)
this.$refs[name].validate((valid) => {
if (valid) {
this.fullscreenLoading = true;

View File

@@ -192,7 +192,6 @@
:max="scope.row.stock"
:step="1" step-strictly
class="priceBox"
@change="inpChange(scope.row[iii], scope.row.id)"
/>
<span v-else v-text="scope.row[iii]" class="priceBox" />
<!--<el-input v-model="scope.row[iii]" :type="formThead[iii].title==='商品编号'?'text':'number'" class="priceBox" />-->
@@ -419,18 +418,6 @@
this.getCategorySelect()
},
methods: {
inpChange(currentValue, id){
// this.ManyAttrValue.map(item => {
// if(!currentValue && item.id ===id){
// item.quota = 1
// this.$set(item, 'quota', 1)
// this.ManyAttrValue = Object.assign([], this.ManyAttrValue)
// }
// })
console.log(this.ManyAttrValue)
// if(!currentValue) item.quota = 1
},
watCh(val) {
const tmp = {}
const tmpTab = {}
@@ -464,7 +451,7 @@
});
}
if(tit==='1'&& num === 'duo' ){
_this.specType ? _this.ManyAttrValue[i].image = img[0].sattDir : _this.ManyAttrValue[0].image = img[0].sattDir
_this.ManyAttrValue[i].image = img[0].sattDir
}
},tit, 'content')
},
@@ -484,8 +471,7 @@
},
handleSubmitNest1() {
if (!this.formValidate.image) {
this.$message.warning("请选择商品!");
return;
return this.$message.warning("请选择商品!");
} else {
this.currentTab++;
if (!this.$route.params.id) this.getProdect(this.productId);
@@ -530,7 +516,7 @@
productDetailApi(id).then(async res => {
let info = res
this.formValidate = {
image: info.image,
image: this.$selfUtil.setDomain(info.image),
imagess: JSON.parse(info.sliderImage),
title: info.storeName,
info: info.storeInfo,
@@ -559,6 +545,7 @@
});
this.$nextTick(() => {
info.attrValues.forEach((row) => {
row.image = this.$selfUtil.setDomain(row.image)
this.$refs.multipleTable.toggleRowSelection(row, true);
this.$set(row, 'checked', true)
});
@@ -582,8 +569,8 @@
seckillStoreInfoApi({id:id}).then(async res => {
let info = res
this.formValidate = {
image: info.image,
imagess: JSON.parse(info.sliderImage) || [],
image: this.$selfUtil.setDomain(info.image),
imagess: JSON.parse(info.sliderImage),
title: info.title,
info: info.info,
quota: info.quota,
@@ -609,6 +596,7 @@
this.ManyAttrValue = info.attrValues;
this.$nextTick(() => {
this.ManyAttrValue.forEach((item, index) => {
item.image = this.$selfUtil.setDomain(item.image)
if (item.checked) {
this.$set(item, 'price', item.price)
this.$set(item, 'quota', item.quota)