|
|
@ -1,6 +1,11 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '开启砍价'" width="900px"> |
|
|
|
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '开启砍价'" width="900px"> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px"> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px"> |
|
|
|
|
|
|
|
<el-col :span="24"> |
|
|
|
|
|
|
|
<el-form-item label="选择商品:" prop="good"> |
|
|
|
|
|
|
|
<cgood v-model="form1.good":disabled="true" ></cgood> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
<el-form-item label="砍价名称"> |
|
|
|
<el-form-item label="砍价名称"> |
|
|
|
<el-input v-model="form.title" style="width: 500px;" /> |
|
|
|
<el-input v-model="form.title" style="width: 500px;" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
@ -10,7 +15,6 @@ |
|
|
|
<el-form-item label="单位"> |
|
|
|
<el-form-item label="单位"> |
|
|
|
<el-input v-model="form.unitName" style="width: 500px;" /> |
|
|
|
<el-input v-model="form.unitName" style="width: 500px;" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="活动开始时间"> |
|
|
|
<el-form-item label="活动开始时间"> |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<el-date-picker |
|
|
|
<el-date-picker |
|
|
@ -30,7 +34,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="砍价产品主图片"> |
|
|
|
<el-form-item label="砍价产品主图片"> |
|
|
|
<MaterialList v-model="form.imageArr" style="width: 500px" type="image" :num="1" :width="150" :height="150" /> |
|
|
|
<single-pic v-model="form.imageArr" style="width: 500px" type="image" :num="1" :width="150" :height="150" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="砍价产品轮播图"> |
|
|
|
<el-form-item label="砍价产品轮播图"> |
|
|
|
<MaterialList v-model="form.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" /> |
|
|
|
<MaterialList v-model="form.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" /> |
|
|
@ -69,13 +73,16 @@ |
|
|
|
<el-form-item label="排序"> |
|
|
|
<el-form-item label="排序"> |
|
|
|
<el-input-number v-model="form.sort" /> |
|
|
|
<el-input-number v-model="form.sort" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="是否包邮"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-radio v-model="form.isPostage" :label="1">是</el-radio> |
|
|
|
<el-form-item label="运费模板:" prop="temp_id"> |
|
|
|
<el-radio v-model="form.isPostage" :label="0" style="width: 110px;">否</el-radio> |
|
|
|
<div class="acea-row"> |
|
|
|
</el-form-item> |
|
|
|
<el-select v-model="form.temp_id" class="mr20" :disabled="true"> |
|
|
|
<el-form-item v-if="form.isPostage ===0" label="邮费"> |
|
|
|
<el-option v-for="(item,index) in templateList" :value="item.id" :key="index" :label="item.name"> |
|
|
|
<el-input-number v-model="form.postage" /> |
|
|
|
</el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
<el-form-item label="砍价规则"> |
|
|
|
<el-form-item label="砍价规则"> |
|
|
|
<editor v-model="form.rule" /> |
|
|
|
<editor v-model="form.rule" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
@ -91,11 +98,14 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
|
|
|
|
import cgood from '@/views/components/good' |
|
|
|
import { add, edit } from '@/api/yxStoreBargain' |
|
|
|
import { add, edit } from '@/api/yxStoreBargain' |
|
|
|
import editor from '../../components/Editor' |
|
|
|
import editor from '../../components/Editor' |
|
|
|
import MaterialList from '@/components/material' |
|
|
|
import MaterialList from '@/components/material' |
|
|
|
|
|
|
|
import singlePic from '@/components/singlematerial' |
|
|
|
|
|
|
|
import { getInfo } from '@/api/yxStoreProduct' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
components: { editor, MaterialList }, |
|
|
|
components: { editor, MaterialList,cgood,singlePic }, |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
isAdd: { |
|
|
|
isAdd: { |
|
|
|
type: Boolean, |
|
|
|
type: Boolean, |
|
|
@ -105,6 +115,11 @@ export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
loading: false, dialog: false, |
|
|
|
loading: false, dialog: false, |
|
|
|
|
|
|
|
templateList: [], |
|
|
|
|
|
|
|
form1: { |
|
|
|
|
|
|
|
good:{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
id: '', |
|
|
|
id: '', |
|
|
|
productId: '', |
|
|
|
productId: '', |
|
|
@ -125,7 +140,7 @@ export default { |
|
|
|
bargainMaxPrice: '', |
|
|
|
bargainMaxPrice: '', |
|
|
|
bargainMinPrice: '', |
|
|
|
bargainMinPrice: '', |
|
|
|
bargainNum: '', |
|
|
|
bargainNum: '', |
|
|
|
status: '', |
|
|
|
status: 1, |
|
|
|
description: '', |
|
|
|
description: '', |
|
|
|
giveIntegral: '', |
|
|
|
giveIntegral: '', |
|
|
|
info: '', |
|
|
|
info: '', |
|
|
@ -140,7 +155,8 @@ export default { |
|
|
|
look: '', |
|
|
|
look: '', |
|
|
|
share: '', |
|
|
|
share: '', |
|
|
|
startTimeDate: '', |
|
|
|
startTimeDate: '', |
|
|
|
endTimeDate: '' |
|
|
|
endTimeDate: '', |
|
|
|
|
|
|
|
temp_id: '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
rules: { |
|
|
|
} |
|
|
|
} |
|
|
@ -156,9 +172,43 @@ export default { |
|
|
|
if (val) { |
|
|
|
if (val) { |
|
|
|
this.form.images = val.join(',') |
|
|
|
this.form.images = val.join(',') |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
'form1.good': { |
|
|
|
|
|
|
|
handler(val,oldVal){ |
|
|
|
|
|
|
|
this.getInfoChooseGood (val.cform.id) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
deep:true//对象内部的属性监听,也叫深度监听 |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
// 详情选择商品生成规格用 |
|
|
|
|
|
|
|
getInfoChooseGood (id) { |
|
|
|
|
|
|
|
let that = this; |
|
|
|
|
|
|
|
getInfo(id).then(async res => { |
|
|
|
|
|
|
|
let data = res.productInfo; |
|
|
|
|
|
|
|
console.log('data:'+data) |
|
|
|
|
|
|
|
if(data){ |
|
|
|
|
|
|
|
let cate_id = parseInt(data.cate_id) || 0; |
|
|
|
|
|
|
|
that.form = data; |
|
|
|
|
|
|
|
that.form.productId = data.id |
|
|
|
|
|
|
|
that.form.cate_id = cate_id; |
|
|
|
|
|
|
|
that.form.title = data.store_name |
|
|
|
|
|
|
|
that.form.info = data.store_info |
|
|
|
|
|
|
|
that.form.unitName = data.unit_name |
|
|
|
|
|
|
|
that.form.imageArr = data.image |
|
|
|
|
|
|
|
that.form.sliderImageArr = data.slider_image |
|
|
|
|
|
|
|
that.form.status = 1 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
that.templateList = res.tempList; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
console.log('err:'+res) |
|
|
|
|
|
|
|
return this.$message({ |
|
|
|
|
|
|
|
message:res.msg, |
|
|
|
|
|
|
|
type: 'error' |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
cancel() { |
|
|
|
cancel() { |
|
|
|
this.resetForm() |
|
|
|
this.resetForm() |
|
|
|
}, |
|
|
|
}, |
|
|
@ -221,7 +271,7 @@ export default { |
|
|
|
bargainMaxPrice: '', |
|
|
|
bargainMaxPrice: '', |
|
|
|
bargainMinPrice: '', |
|
|
|
bargainMinPrice: '', |
|
|
|
bargainNum: '', |
|
|
|
bargainNum: '', |
|
|
|
status: '', |
|
|
|
status: 1, |
|
|
|
description: '', |
|
|
|
description: '', |
|
|
|
giveIntegral: '', |
|
|
|
giveIntegral: '', |
|
|
|
info: '', |
|
|
|
info: '', |
|
|
@ -234,7 +284,8 @@ export default { |
|
|
|
postage: '', |
|
|
|
postage: '', |
|
|
|
rule: '', |
|
|
|
rule: '', |
|
|
|
look: '', |
|
|
|
look: '', |
|
|
|
share: '' |
|
|
|
share: '', |
|
|
|
|
|
|
|
temp_id: '', |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|