|
@@ -47,6 +47,13 @@
|
|
|
<Radio :label="1">是</Radio>
|
|
<Radio :label="1">是</Radio>
|
|
|
</RadioGroup>
|
|
</RadioGroup>
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
|
|
+ <!-- is_funds -->
|
|
|
|
|
+ <FormItem label="设置卡金">
|
|
|
|
|
+ <RadioGroup v-model="formData.is_funds">
|
|
|
|
|
+ <Radio :label="0">不设置</Radio>
|
|
|
|
|
+ <Radio :label="1">设置</Radio>
|
|
|
|
|
+ </RadioGroup>
|
|
|
|
|
+ </FormItem>
|
|
|
<FormItem v-show="!formData.is_forever" label="">
|
|
<FormItem v-show="!formData.is_forever" label="">
|
|
|
<InputNumber :min="1" v-model="formData.valid_date" :precision="0"></InputNumber>
|
|
<InputNumber :min="1" v-model="formData.valid_date" :precision="0"></InputNumber>
|
|
|
<div class="info">领取后多少天内有效</div>
|
|
<div class="info">领取后多少天内有效</div>
|
|
@@ -65,29 +72,22 @@
|
|
|
<div class="acea-row row-between-wrapper">
|
|
<div class="acea-row row-between-wrapper">
|
|
|
<div>
|
|
<div>
|
|
|
<Button type="primary" @click="addGoods">添加商品</Button>
|
|
<Button type="primary" @click="addGoods">添加商品</Button>
|
|
|
- <!-- <Button @click="batchSet" class="ml20" :disabled="!isAllChecked && !checkPidList.length">批量设置</Button>
|
|
|
|
|
- <Button @click="delAll" class="ml20" :disabled="!isAllChecked && !checkPidList.length">批量删除</Button> -->
|
|
|
|
|
</div>
|
|
</div>
|
|
|
- <!-- <div class="goodsWord">
|
|
|
|
|
- <FormItem label="商品搜索:">
|
|
|
|
|
- <Input class="w_input240" v-model="keyword" placeholder="请输入商品关键词" @on-change="searchWord"></Input>
|
|
|
|
|
- </FormItem>
|
|
|
|
|
- </div> -->
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</Col>
|
|
</Col>
|
|
|
<Col span="20">
|
|
<Col span="20">
|
|
|
<div class="vxeTable">
|
|
<div class="vxeTable">
|
|
|
<vxe-table border="inner" ref="xTree" :column-config="{resizable: true}" row-id="id"
|
|
<vxe-table border="inner" ref="xTree" :column-config="{resizable: true}" row-id="id"
|
|
|
- :tree-config="{children: 'attrValue',reserve:true}" @checkbox-all="checkboxAll"
|
|
|
|
|
|
|
+ @checkbox-all="checkboxAll"
|
|
|
@checkbox-change="checkboxItem"
|
|
@checkbox-change="checkboxItem"
|
|
|
:data="(searchTableData.length || keyword)?searchTableData:tableData">
|
|
:data="(searchTableData.length || keyword)?searchTableData:tableData">
|
|
|
- <vxe-column title="" width="90" tree-node></vxe-column>
|
|
|
|
|
|
|
+ <!-- <vxe-column title="" width="90" tree-node></vxe-column> -->
|
|
|
<vxe-column field="info" title="商品信息" min-width="300" >
|
|
<vxe-column field="info" title="商品信息" min-width="300" >
|
|
|
<template v-slot="{ row }">
|
|
<template v-slot="{ row }">
|
|
|
<div class="imgPic acea-row row-middle">
|
|
<div class="imgPic acea-row row-middle">
|
|
|
- <viewer>
|
|
|
|
|
|
|
+ <!-- <viewer>
|
|
|
<div class="pictrue"><img v-lazy="row.image" /></div>
|
|
<div class="pictrue"><img v-lazy="row.image" /></div>
|
|
|
- </viewer>
|
|
|
|
|
|
|
+ </viewer> -->
|
|
|
<div class="info">
|
|
<div class="info">
|
|
|
<Tooltip max-width="200" placement="bottom" transfer>
|
|
<Tooltip max-width="200" placement="bottom" transfer>
|
|
|
<span class="line2">{{ row.store_name }}{{row.suk}}</span>
|
|
<span class="line2">{{ row.store_name }}{{row.suk}}</span>
|
|
@@ -97,54 +97,38 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
- <!-- <vxe-column field="info" title="商品信息" min-width="300" v-if="$route.params.id == 0">
|
|
|
|
|
- <template v-slot="{ row }">
|
|
|
|
|
- <div class="imgPic acea-row row-middle">
|
|
|
|
|
- <div class="info">
|
|
|
|
|
- <Tooltip max-width="200" placement="bottom" transfer>
|
|
|
|
|
- <span class="line2">{{ row.store_name }}{{row.suk}}</span>
|
|
|
|
|
- <p slot="content">{{ row.store_name }}{{row.suk}}</p>
|
|
|
|
|
- </Tooltip>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </vxe-column> -->
|
|
|
|
|
<vxe-column field="price" title="价格" min-width="150">
|
|
<vxe-column field="price" title="价格" min-width="150">
|
|
|
<template v-slot="{ row }">
|
|
<template v-slot="{ row }">
|
|
|
- <div v-if="row.parent == 1">——</div>
|
|
|
|
|
- <vxe-input v-else v-model="row.price" min="0" placeholder="请输入价格" type="float"
|
|
|
|
|
|
|
+ <vxe-input v-model="row.price" min="0" placeholder="请输入价格" type="float"
|
|
|
digits="2" step="1"></vxe-input>
|
|
digits="2" step="1"></vxe-input>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
<vxe-column field="price" title="限购天数" min-width="150">
|
|
<vxe-column field="price" title="限购天数" min-width="150">
|
|
|
<template v-slot="{ row }">
|
|
<template v-slot="{ row }">
|
|
|
- <div v-if="row.parent == 1">——</div>
|
|
|
|
|
- <vxe-input v-else v-model="row.days" min="0" placeholder="请输入限购天数" type="float"
|
|
|
|
|
|
|
+ <vxe-input v-model="row.days" min="0" placeholder="请输入限购天数" type="float"
|
|
|
digits="2" step="1"></vxe-input>
|
|
digits="2" step="1"></vxe-input>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
<vxe-column field="price" title="限购次数" min-width="150">
|
|
<vxe-column field="price" title="限购次数" min-width="150">
|
|
|
<template v-slot="{ row }">
|
|
<template v-slot="{ row }">
|
|
|
- <div v-if="row.parent == 1">——</div>
|
|
|
|
|
- <vxe-input v-else v-model="row.number" min="0" placeholder="请输入限购次数" type="float"
|
|
|
|
|
|
|
+ <vxe-input v-model="row.number" min="0" placeholder="请输入限购次数" type="float"
|
|
|
digits="2" step="1"></vxe-input>
|
|
digits="2" step="1"></vxe-input>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
- <vxe-column field="cost" title="成本价" min-width="80"></vxe-column>
|
|
|
|
|
- <vxe-column field="ot_price" title="原价" min-width="80"></vxe-column>
|
|
|
|
|
|
|
+ <!-- <vxe-column field="cost" title="成本价" min-width="80"></vxe-column>
|
|
|
|
|
+ <vxe-column field="ot_price" title="原价" min-width="80"></vxe-column> -->
|
|
|
<vxe-column field="is_yue" title="不可用余额" min-width="100">
|
|
<vxe-column field="is_yue" title="不可用余额" min-width="100">
|
|
|
<template v-slot="{ row }">
|
|
<template v-slot="{ row }">
|
|
|
- <i-switch v-if="row.parent != 1" v-model="row.is_yue" :value="row.is_yue"
|
|
|
|
|
|
|
+ <i-switch v-model="row.is_yue" :value="row.is_yue"
|
|
|
@on-change="onchangeIsShow(row)" size="large">
|
|
@on-change="onchangeIsShow(row)" size="large">
|
|
|
<span slot="open">是</span>
|
|
<span slot="open">是</span>
|
|
|
<span slot="close">否</span>
|
|
<span slot="close">否</span>
|
|
|
</i-switch>
|
|
</i-switch>
|
|
|
- <div v-else>——</div>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
<vxe-column field="date" title="操作" min-width="100" fixed="right" align="center">
|
|
<vxe-column field="date" title="操作" min-width="100" fixed="right" align="center">
|
|
|
<template v-slot="{ row }">
|
|
<template v-slot="{ row }">
|
|
|
- <a @click="del(row)" v-if="row.parent == 1">删除</a>
|
|
|
|
|
|
|
+ <a @click="del(row)" >删除</a>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
</vxe-table>
|
|
</vxe-table>
|
|
@@ -239,6 +223,7 @@
|
|
|
mark: '',
|
|
mark: '',
|
|
|
product: [],
|
|
product: [],
|
|
|
id: 0,
|
|
id: 0,
|
|
|
|
|
+ is_funds: 0
|
|
|
},
|
|
},
|
|
|
categoryList: [],
|
|
categoryList: [],
|
|
|
brandList: [],
|
|
brandList: [],
|
|
@@ -282,16 +267,14 @@
|
|
|
},
|
|
},
|
|
|
getProductId(data) {
|
|
getProductId(data) {
|
|
|
this.modals = false;
|
|
this.modals = false;
|
|
|
|
|
+ // console.log(data)
|
|
|
|
|
+ // let uni =
|
|
|
let list = this.tableData.concat(data);
|
|
let list = this.tableData.concat(data);
|
|
|
let uni = this.unique(list);
|
|
let uni = this.unique(list);
|
|
|
uni.forEach((i) => {
|
|
uni.forEach((i) => {
|
|
|
- i.parent = 1;
|
|
|
|
|
- i.status = 1;
|
|
|
|
|
- i.attrValue.forEach(j => {
|
|
|
|
|
- j.cate_name = i.cate_name;
|
|
|
|
|
- j.store_label = i.store_label;
|
|
|
|
|
- j.is_yue = j.is_yue ? true : false;
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ i.is_yue = i.is_yue ? true : false;
|
|
|
|
|
+ i.number = i.number || 0;
|
|
|
|
|
+ i.days = i.days || 0;
|
|
|
})
|
|
})
|
|
|
this.tableData = uni;
|
|
this.tableData = uni;
|
|
|
console.log(uni,'uni')
|
|
console.log(uni,'uni')
|
|
@@ -424,38 +407,20 @@
|
|
|
this.formData.image = data.image;
|
|
this.formData.image = data.image;
|
|
|
this.formData.is_show = data.is_show;
|
|
this.formData.is_show = data.is_show;
|
|
|
this.formData.mark = data.mark;
|
|
this.formData.mark = data.mark;
|
|
|
|
|
+ this.formData.is_funds = data.is_funds;
|
|
|
let list = []
|
|
let list = []
|
|
|
data.product.forEach(item => {
|
|
data.product.forEach(item => {
|
|
|
let obj = {
|
|
let obj = {
|
|
|
- image: item.info[0].attrValue.image,
|
|
|
|
|
|
|
+ id: item.product_id,
|
|
|
store_name: item.product_name,
|
|
store_name: item.product_name,
|
|
|
- cost: item.info[0].attrValue.cost,
|
|
|
|
|
- ot_price: item.info[0].attrValue.ot_price,
|
|
|
|
|
- parent: 1,
|
|
|
|
|
- status: 1,
|
|
|
|
|
- id: item.product_id
|
|
|
|
|
- }
|
|
|
|
|
- let arr = []
|
|
|
|
|
- try{
|
|
|
|
|
- item.info.forEach(j => {
|
|
|
|
|
- arr.push({
|
|
|
|
|
- unique: j.unique,
|
|
|
|
|
- price: j.price,
|
|
|
|
|
- ot_price: j.attrValue.ot_price,
|
|
|
|
|
- cost: j.attrValue.cost,
|
|
|
|
|
- image: j.attrValue.image,
|
|
|
|
|
- suk: j.attrValue.suk,
|
|
|
|
|
- is_yue: j.is_yue? true:false,
|
|
|
|
|
- days: j.days || 0,
|
|
|
|
|
- number: j.number|| 0
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- }catch(e){
|
|
|
|
|
- console.log(e,'err')
|
|
|
|
|
- //TODO handle the exception
|
|
|
|
|
|
|
+ price: item.price,
|
|
|
|
|
+ is_yue: item.is_yue? true: false,
|
|
|
|
|
+ days: item.days,
|
|
|
|
|
+ number: item.number,
|
|
|
|
|
+ spu: item.spu,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- obj.attrValue = arr
|
|
|
|
|
|
|
+
|
|
|
list.push(obj)
|
|
list.push(obj)
|
|
|
})
|
|
})
|
|
|
this.tableData = list
|
|
this.tableData = list
|
|
@@ -511,21 +476,27 @@
|
|
|
let list = [];
|
|
let list = [];
|
|
|
that.tableData.forEach(item => {
|
|
that.tableData.forEach(item => {
|
|
|
let obj = {
|
|
let obj = {
|
|
|
- product_id: item.id
|
|
|
|
|
|
|
+ product_id: item.id,
|
|
|
|
|
+ spu: item.spu,
|
|
|
|
|
+ price: item.price,
|
|
|
|
|
+ is_yue: item.is_yue? 1 : 0,
|
|
|
|
|
+ days: item.days,
|
|
|
|
|
+ number: item.number
|
|
|
}
|
|
}
|
|
|
- let info = [];
|
|
|
|
|
- item.attrValue.forEach(i => {
|
|
|
|
|
- info.push({
|
|
|
|
|
- unique: i.unique,
|
|
|
|
|
- price: i.price,
|
|
|
|
|
- is_yue: i.is_yue ? 1 : 0,
|
|
|
|
|
- days: i.days,
|
|
|
|
|
- number: i.number
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- obj.info = info;
|
|
|
|
|
|
|
+ // let info = [];
|
|
|
|
|
+ // item.attrValue.forEach(i => {
|
|
|
|
|
+ // info.push({
|
|
|
|
|
+ // unique: i.unique,
|
|
|
|
|
+ // price: i.price,
|
|
|
|
|
+ // is_yue: i.is_yue ? 1 : 0,
|
|
|
|
|
+ // days: i.days,
|
|
|
|
|
+ // number: i.number,
|
|
|
|
|
+ // })
|
|
|
|
|
+ // })
|
|
|
|
|
+ // obj.info = info;
|
|
|
list.push(obj)
|
|
list.push(obj)
|
|
|
})
|
|
})
|
|
|
|
|
+ console.log(list,'list')
|
|
|
addSuper({
|
|
addSuper({
|
|
|
id: that.formData.id,
|
|
id: that.formData.id,
|
|
|
name: that.formData.name,
|
|
name: that.formData.name,
|
|
@@ -536,6 +507,7 @@
|
|
|
icon: that.formData.icon,
|
|
icon: that.formData.icon,
|
|
|
image: that.formData.image,
|
|
image: that.formData.image,
|
|
|
is_show: that.formData.is_show,
|
|
is_show: that.formData.is_show,
|
|
|
|
|
+ is_funds: that.formData.is_funds,
|
|
|
mark: that.formData.mark,
|
|
mark: that.formData.mark,
|
|
|
product: list,
|
|
product: list,
|
|
|
})
|
|
})
|