调整拼团秒杀后台页面
This commit is contained in:
@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<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-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-input v-model="form.title" style="width: 500px;" />
|
||||
</el-form-item>
|
||||
@ -10,7 +15,6 @@
|
||||
<el-form-item label="单位">
|
||||
<el-input v-model="form.unitName" style="width: 500px;" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="活动开始时间">
|
||||
<template>
|
||||
<el-date-picker
|
||||
@ -30,7 +34,7 @@
|
||||
</template>
|
||||
</el-form-item>
|
||||
<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 label="砍价产品轮播图">
|
||||
<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-input-number v-model="form.sort" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否包邮">
|
||||
<el-radio v-model="form.isPostage" :label="1">是</el-radio>
|
||||
<el-radio v-model="form.isPostage" :label="0" style="width: 110px;">否</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.isPostage ===0" label="邮费">
|
||||
<el-input-number v-model="form.postage" />
|
||||
</el-form-item>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="运费模板:" prop="temp_id">
|
||||
<div class="acea-row">
|
||||
<el-select v-model="form.temp_id" class="mr20" :disabled="true">
|
||||
<el-option v-for="(item,index) in templateList" :value="item.id" :key="index" :label="item.name">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item label="砍价规则">
|
||||
<editor v-model="form.rule" />
|
||||
</el-form-item>
|
||||
@ -91,11 +98,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import cgood from '@/views/components/good'
|
||||
import { add, edit } from '@/api/yxStoreBargain'
|
||||
import editor from '../../components/Editor'
|
||||
import MaterialList from '@/components/material'
|
||||
import singlePic from '@/components/singlematerial'
|
||||
import { getInfo } from '@/api/yxStoreProduct'
|
||||
export default {
|
||||
components: { editor, MaterialList },
|
||||
components: { editor, MaterialList,cgood,singlePic },
|
||||
props: {
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
@ -105,6 +115,11 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false, dialog: false,
|
||||
templateList: [],
|
||||
form1: {
|
||||
good:{
|
||||
}
|
||||
},
|
||||
form: {
|
||||
id: '',
|
||||
productId: '',
|
||||
@ -125,7 +140,7 @@ export default {
|
||||
bargainMaxPrice: '',
|
||||
bargainMinPrice: '',
|
||||
bargainNum: '',
|
||||
status: '',
|
||||
status: 1,
|
||||
description: '',
|
||||
giveIntegral: '',
|
||||
info: '',
|
||||
@ -140,7 +155,8 @@ export default {
|
||||
look: '',
|
||||
share: '',
|
||||
startTimeDate: '',
|
||||
endTimeDate: ''
|
||||
endTimeDate: '',
|
||||
temp_id: ''
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
@ -156,9 +172,43 @@ export default {
|
||||
if (val) {
|
||||
this.form.images = val.join(',')
|
||||
}
|
||||
}
|
||||
},
|
||||
'form1.good': {
|
||||
handler(val,oldVal){
|
||||
this.getInfoChooseGood (val.cform.id)
|
||||
},
|
||||
deep:true//对象内部的属性监听,也叫深度监听
|
||||
},
|
||||
},
|
||||
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() {
|
||||
this.resetForm()
|
||||
},
|
||||
@ -221,7 +271,7 @@ export default {
|
||||
bargainMaxPrice: '',
|
||||
bargainMinPrice: '',
|
||||
bargainNum: '',
|
||||
status: '',
|
||||
status: 1,
|
||||
description: '',
|
||||
giveIntegral: '',
|
||||
info: '',
|
||||
@ -234,7 +284,8 @@ export default {
|
||||
postage: '',
|
||||
rule: '',
|
||||
look: '',
|
||||
share: ''
|
||||
share: '',
|
||||
temp_id: '',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,15 @@
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container" >
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="add"
|
||||
>新增</el-button>
|
||||
</div>
|
||||
<el-button
|
||||
type="danger"
|
||||
class="filter-item"
|
||||
|
@ -4,6 +4,11 @@
|
||||
<el-form ref="formValidate" :rules="ruleValidate" :model="formValidate" label-width="130px" >
|
||||
<el-row :gutter="24">
|
||||
<!-- 商品信息-->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="选择商品:" prop="good">
|
||||
<cgood v-model="form1.good":disabled="true" ></cgood>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="拼团名称" prop="title">
|
||||
<el-input v-model="formValidate.title" style="width: 500px;" placeholder="请输入拼团名称"/>
|
||||
@ -62,21 +67,12 @@
|
||||
<el-input-number v-model="formValidate.effectiveTime" style="width: 500px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="拼团价" prop="price">
|
||||
<el-input-number v-model="formValidate.price" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="拼团人数" prop="people">
|
||||
<el-input-number v-model="formValidate.people" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="选择商品:" prop="good">
|
||||
<cgood v-model="form1.good":disabled="true" ></cgood>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="商品规格:" props="spec_type">
|
||||
<el-radio-group v-model="formValidate.spec_type" @change="changeSpec" :disabled="true">
|
||||
@ -464,7 +460,7 @@ export default {
|
||||
stock: '',
|
||||
addTime: '',
|
||||
isHost: '',
|
||||
isShow: '',
|
||||
isShow: 1,
|
||||
isDel: 0,
|
||||
merUse: '',
|
||||
isPostage: '',
|
||||
@ -720,6 +716,10 @@ export default {
|
||||
that.id = that.combinationId
|
||||
that.formValidate.productId = data.id
|
||||
that.formValidate.cate_id = cate_id;
|
||||
that.formValidate.title = data.store_name
|
||||
that.formValidate.info = data.store_info
|
||||
that.formValidate.unitName = data.unit_name
|
||||
that.formValidate.isShow = 1
|
||||
that.oneFormValidate = [data.attr];
|
||||
that.formValidate.header = [];
|
||||
that.generate(null);
|
||||
|
@ -3,68 +3,92 @@
|
||||
<el-card :bordered="false">
|
||||
<el-form ref="formValidate" :rules="ruleValidate" :model="formValidate" label-width="130px" >
|
||||
<el-row :gutter="24">
|
||||
<!-- 商品信息-->
|
||||
<el-form-item label="秒杀名称">
|
||||
<el-input v-model="formValidate.title" style="width: 500px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="秒杀简介">
|
||||
<el-input v-model="formValidate.info" style="width: 500px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单位">
|
||||
<el-input v-model="formValidate.unitName" style="width: 500px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="秒杀开始时间">
|
||||
<template>
|
||||
<el-date-picker
|
||||
v-model="formValidate.startTime"
|
||||
type="date"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="秒杀结束时间">
|
||||
<template>
|
||||
<el-date-picker
|
||||
v-model="formValidate.stopTime"
|
||||
type="date"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="storeId">
|
||||
<el-select v-model="formValidate.timeId" style="width: 178px" placeholder="请先选择开始时间">
|
||||
<el-option
|
||||
v-for="(item, index) in myTimes"
|
||||
:key="index"
|
||||
:label="item.map.time + '点开始,持续' + item.map.continued + '小时'"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品主图片">
|
||||
<MaterialList v-model="formValidate.imageArr" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品轮播图">
|
||||
<MaterialList v-model="formValidate.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
|
||||
</el-form-item>
|
||||
<el-form-item label="秒杀价">
|
||||
<el-input-number v-model="formValidate.price" />
|
||||
</el-form-item>
|
||||
<el-form-item label="返积分">
|
||||
<el-input-number v-model="formValidate.giveIntegral" />
|
||||
</el-form-item>
|
||||
<el-form-item label="活动状态">
|
||||
<el-radio v-model="formValidate.status" :label="1">开启</el-radio>
|
||||
<el-radio v-model="formValidate.status" :label="0" style="width: 200px;">关闭</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="限购">
|
||||
<el-input-number v-model="formValidate.num" />
|
||||
</el-form-item>
|
||||
<!-- 商品信息-->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="选择商品:" prop="image">
|
||||
<el-form-item label="选择商品:" prop="good">
|
||||
<cgood v-model="form1.good":disabled="true" ></cgood>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="秒杀名称">
|
||||
<el-input v-model="formValidate.title" style="width: 500px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="秒杀简介">
|
||||
<el-input v-model="formValidate.info" style="width: 500px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="单位">
|
||||
<el-input v-model="formValidate.unitName" style="width: 500px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="秒杀开始时间">
|
||||
<template>
|
||||
<el-date-picker
|
||||
v-model="formValidate.startTime"
|
||||
type="date"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="秒杀结束时间">
|
||||
<template>
|
||||
<el-date-picker
|
||||
v-model="formValidate.stopTime"
|
||||
type="date"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="开始时间" prop="storeId">
|
||||
<el-select v-model="formValidate.timeId" style="width: 178px" placeholder="请先选择开始时间">
|
||||
<el-option
|
||||
v-for="(item, index) in myTimes"
|
||||
:key="index"
|
||||
:label="item.map.time + '点开始,持续' + item.map.continued + '小时'"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="产品主图片">
|
||||
<single-pic v-model="formValidate.imageArr" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="产品轮播图">
|
||||
<MaterialList v-model="formValidate.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="秒杀价">
|
||||
<el-input-number v-model="formValidate.price" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="返积分">
|
||||
<el-input-number v-model="formValidate.giveIntegral" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="活动状态">
|
||||
<el-radio v-model="formValidate.status" :label="1">开启</el-radio>
|
||||
<el-radio v-model="formValidate.status" :label="0" style="width: 200px;">关闭</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="限购">
|
||||
<el-input-number v-model="formValidate.num" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="商品规格:" props="spec_type">
|
||||
<el-radio-group v-model="formValidate.spec_type" @change="changeSpec" :disabled="true">
|
||||
@ -413,34 +437,10 @@ export default {
|
||||
}
|
||||
},
|
||||
formValidate: {
|
||||
// id: '',
|
||||
// productId: '',
|
||||
// image: '',
|
||||
// images: '',
|
||||
// imageArr: [],
|
||||
// sliderImageArr: [],
|
||||
// title: '',
|
||||
// info: '',
|
||||
// price: '',
|
||||
// cost: '',
|
||||
otPrice: '',
|
||||
giveIntegral: '',
|
||||
// sort: '',
|
||||
// stock: '',
|
||||
// sales: '',
|
||||
// unitName: '',
|
||||
// postage: '',
|
||||
// description: '',
|
||||
// startTime: '',
|
||||
// stopTime: '',
|
||||
// addTime: '',
|
||||
status: '',
|
||||
// isPostage: '',
|
||||
// isHot: '',
|
||||
// isDel: '',
|
||||
num: '',
|
||||
// isShow: ''
|
||||
|
||||
id: 0,
|
||||
timeId: null,
|
||||
seckillId: 0,
|
||||
@ -709,10 +709,15 @@ export default {
|
||||
let cate_id = parseInt(data.cate_id) || 0;
|
||||
that.attrs = data.items || [];
|
||||
that.formValidate = data;
|
||||
that.id = that.combinationId
|
||||
that.formValidate.productId = data.id
|
||||
that.formValidate.cate_id = cate_id;
|
||||
that.oneFormValidate = [data.attr];
|
||||
that.formValidate.title = data.store_name
|
||||
that.formValidate.info = data.store_info
|
||||
that.formValidate.unitName = data.unit_name
|
||||
that.formValidate.imageArr = data.image
|
||||
that.formValidate.sliderImageArr = data.slider_image
|
||||
that.formValidate.status = 1
|
||||
that.formValidate.header = [];
|
||||
that.generate(null);
|
||||
that.manyFormValidate = data.attrs;
|
||||
|
Reference in New Issue
Block a user