新增批发价

This commit is contained in:
weipengfei 2024-03-19 14:25:17 +08:00
parent b3477f03fe
commit 70d5e103d5

View File

@ -224,7 +224,7 @@
/> --> /> -->
<el-select v-model="formValidate.unit_name" placeholder="请选择" class="perW50 mr10" clearable filterable=""> <el-select v-model="formValidate.unit_name" placeholder="请选择" class="perW50 mr10" clearable filterable="">
<el-option v-for="item in unitList" :key="item.label" :label="item.label" :value="item.label" /> <el-option v-for="item in unitList" :key="item.label" :label="item.label" :value="item.label" />
</el-select> </el-select>
<el-button <el-button
type="primary" type="primary"
size="small" size="small"
@ -233,7 +233,7 @@
添加单位 添加单位
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="商品关键字:"> <el-form-item label="商品关键字:">
@ -445,7 +445,7 @@
:span="24" :span="24"
class="noForm" class="noForm"
> >
<el-form-item :label="'批量设置:'" class="labeltop"> <el-form-item :label="'批量设置:'" class="labeltop">
<el-table <el-table
:data="oneFormBatch" :data="oneFormBatch"
@ -504,7 +504,7 @@
<el-input <el-input
v-if=" v-if="
formThead[iii].title !== '付费会员价' && formThead[iii].title !== '付费会员价' &&
formThead[iii].title !== '商品编号' && formThead[iii].title !== '商品编号' &&
formThead[iii].title !== '库存' formThead[iii].title !== '库存'
" "
v-model="scope.row[iii]" v-model="scope.row[iii]"
@ -556,7 +556,7 @@
class="priceBox" class="priceBox"
controls-position="right" controls-position="right"
/> />
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<template v-if="formValidate.type == 2"> <template v-if="formValidate.type == 2">
@ -573,7 +573,7 @@
>添加卡密</el-button> >添加卡密</el-button>
<span v-else class="seeCatMy" @click="seeVirtual(oneFormBatch[0], 'oneFormBatch', 0)">已设置</span> <span v-else class="seeCatMy" @click="seeVirtual(oneFormBatch[0], 'oneFormBatch', 0)">已设置</span>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<template v-if="formValidate.extension_type === 1"> <template v-if="formValidate.extension_type === 1">
<el-table-column <el-table-column
@ -680,7 +680,7 @@
@blur="memberPrice(formThead[iii], scope.row)" @blur="memberPrice(formThead[iii], scope.row)"
class="priceBox" class="priceBox"
controls-position="right" controls-position="right"
/> />
<el-input <el-input
v-if="formThead[iii].title === '库存' && formValidate.type == 2" v-if="formThead[iii].title === '库存' && formValidate.type == 2"
v-model="scope.row[iii]" v-model="scope.row[iii]"
@ -697,7 +697,7 @@
class="priceBox" class="priceBox"
/> />
</div> </div>
<div v-else> <div v-else>
<el-input <el-input
v-if="formThead[iii].title === '商品编号'" v-if="formThead[iii].title === '商品编号'"
@ -816,7 +816,7 @@
:key="iii" :key="iii"
:label="formThead[iii].title" :label="formThead[iii].title"
align="center" align="center"
min-width="120" min-width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="formValidate.svip_price_type != 0 && formThead[iii]"> <div v-if="formValidate.svip_price_type != 0 && formThead[iii]">
@ -838,7 +838,7 @@
/> />
<el-input-number <el-input-number
v-if="formThead[iii].title !== '付费会员价' && v-if="formThead[iii].title !== '付费会员价' &&
formThead[iii].title !== '商品编号' && formThead[iii].title !== '商品编号' &&
formThead[iii].title !== '库存'" formThead[iii].title !== '库存'"
v-model="scope.row[iii]" v-model="scope.row[iii]"
:min="0" :min="0"
@ -1075,7 +1075,7 @@
active-text="开启" active-text="开启"
inactive-text="关闭" inactive-text="关闭"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-if="deliveryList.length > 0" :span="24"> <el-col v-if="deliveryList.length > 0" :span="24">
<el-form-item label="送货方式:" prop="delivery_way"> <el-form-item label="送货方式:" prop="delivery_way">
@ -1293,7 +1293,7 @@
v-for="item in merSpecsSelect" v-for="item in merSpecsSelect"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
<el-button <el-button
@ -1555,6 +1555,7 @@ const defaultObj = {
{ {
image: '', image: '',
price: null, price: null,
wholesale_price: null,
cost: null, cost: null,
ot_price: null, ot_price: null,
svip_price: null, svip_price: null,
@ -1582,11 +1583,8 @@ const objTitle = {
price: { price: {
title: '售价' title: '售价'
}, },
cost: { wholesale_price: {
title: '成本价' title: '批发价'
},
ot_price: {
title: '市场价'
}, },
svip_price: { svip_price: {
title: '付费会员价' title: '付费会员价'
@ -1602,7 +1600,13 @@ const objTitle = {
}, },
volume: { volume: {
title: '体积(m³)' title: '体积(m³)'
} },
cost: {
title: '成本价'
},
ot_price: {
title: '市场价'
},
} }
const proOptions = [{ name: '店铺推荐', value: 'is_good' }] const proOptions = [{ name: '店铺推荐', value: 'is_good' }]
export default { export default {
@ -1811,6 +1815,7 @@ export default {
modals: false, modals: false,
attrVal: { attrVal: {
price: null, price: null,
wholesale_price: null,
cost: null, cost: null,
ot_price: null, ot_price: null,
stock: null, stock: null,
@ -1842,6 +1847,7 @@ export default {
attr:"全部", attr:"全部",
image: "", image: "",
price: "", price: "",
wholesale_price: "",
cost: "", cost: "",
ot_price: "", ot_price: "",
svip_price: "", svip_price: "",
@ -1878,7 +1884,7 @@ export default {
// } // }
}, },
watch: { watch: {
'formValidate.attr': { 'formValidate.attr': {
handler: function(val) { handler: function(val) {
this.createCount+=1 this.createCount+=1
if (this.formValidate.spec_type === 1) this.watCh(val) if (this.formValidate.spec_type === 1) this.watCh(val)
@ -1905,7 +1911,7 @@ export default {
this.getCategoryList() this.getCategoryList()
this.getBrandListApi() this.getBrandListApi()
this.getShippingList() this.getShippingList()
this.getGuaranteeList() this.getGuaranteeList()
this.productGetRule() this.productGetRule()
this.getLabelLst() this.getLabelLst()
this.getFormList() this.getFormList()
@ -1950,7 +1956,7 @@ export default {
this.elChangeExForArray(evt.oldIndex, evt.newIndex, this.formValidate.params) this.elChangeExForArray(evt.oldIndex, evt.newIndex, this.formValidate.params)
} }
}) })
}, },
elChangeExForArray(index1, index2, array) { elChangeExForArray(index1, index2, array) {
const temp = array[index1] const temp = array[index1]
array[index1] = array[index2] array[index1] = array[index2]
@ -2065,7 +2071,7 @@ export default {
.catch(res => { .catch(res => {
this.$message.error(res.message) this.$message.error(res.message)
}) })
}, },
// //
productCon() { productCon() {
productConfigApi() productConfigApi()
@ -2088,7 +2094,7 @@ export default {
{ value: '1', name: '到店自提' }, { value: '1', name: '到店自提' },
{ value: '2', name: name } { value: '2', name: name }
] ]
} }
} else { } else {
if (this.deliveryType.length == 1 && this.deliveryType[0] == '1' && this.formValidate.type != 2) { if (this.deliveryType.length == 1 && this.deliveryType[0] == '1' && this.formValidate.type != 2) {
this.deliveryList = [{ value: '1', name: '到店自提' }] this.deliveryList = [{ value: '1', name: '到店自提' }]
@ -2137,7 +2143,7 @@ export default {
// .catch((res) => { // .catch((res) => {
// this.$message.error(res.message) // this.$message.error(res.message)
// }) // })
} }
}, },
// //
openRecommend(){ openRecommend(){
@ -2205,7 +2211,7 @@ export default {
}, },
// //
addVirtual(index, name) { addVirtual(index, name) {
this.$refs.addCarMy.carMyShow = true; this.$refs.addCarMy.carMyShow = true;
this.tabIndex = index; this.tabIndex = index;
this.tabName = name; this.tabName = name;
this.virtualListClear(); this.virtualListClear();
@ -2227,10 +2233,10 @@ export default {
this[this.tabName][this.tabIndex]['cdkey'].key = ''; this[this.tabName][this.tabIndex]['cdkey'].key = '';
} }
this.$set(this[this.tabName][this.tabIndex]['cdkey'],"is_type",e.is_type); this.$set(this[this.tabName][this.tabIndex]['cdkey'],"is_type",e.is_type);
this.$refs.addCarMy.carMyShow = false; this.$refs.addCarMy.carMyShow = false;
}, },
closeCarMy(){ closeCarMy(){
this.$refs.addCarMy.carMyShow = false; this.$refs.addCarMy.carMyShow = false;
}, },
// //
virtualListClear(){ virtualListClear(){
@ -2250,7 +2256,7 @@ export default {
is_type: 0, is_type: 0,
key:'', key:'',
stock:0 stock:0
} }
if (data.cdkey && data.cdkey.list && data.cdkey.list.length && data.cdkey.is_type == 1) { if (data.cdkey && data.cdkey.list && data.cdkey.list.length && data.cdkey.is_type == 1) {
this.$refs.addCarMy.fixedCar.is_type = 1; this.$refs.addCarMy.fixedCar.is_type = 1;
this.virtualList = data.cdkey.list; this.virtualList = data.cdkey.list;
@ -2314,6 +2320,7 @@ export default {
const rep4 = { const rep4 = {
image: '', image: '',
price: 0, price: 0,
wholesale_price: 0,
cost: 0, cost: 0,
ot_price: 0, ot_price: 0,
select: true, select: true,
@ -2351,6 +2358,7 @@ export default {
res[kk] = { res[kk] = {
image: '', image: '',
price: 0, price: 0,
wholesale_price: 0,
cost: 0, cost: 0,
ot_price: 0, ot_price: 0,
select: true, select: true,
@ -2369,12 +2377,13 @@ export default {
}) })
}) })
}) })
data.push(dataArr.join('$&')) data.push(dataArr.join('$&'))
} }
if(that.generateArr.length>0){ if(that.generateArr.length>0){
that.generateArr.forEach((v, i) => { that.generateArr.forEach((v, i) => {
res[i]['image'] = v.pic res[i]['image'] = v.pic
res[i]['price'] = v.price res[i]['price'] = v.price
res[i]['wholesale_price'] = v.wholesale_price
res[i]['cost'] = v.cost res[i]['cost'] = v.cost
res[i]['ot_price'] = v.ot_price res[i]['ot_price'] = v.ot_price
res[i]['sku'] = v.sku res[i]['sku'] = v.sku
@ -2468,7 +2477,7 @@ export default {
confirm() { confirm() {
if (!this.selectRule) { if (!this.selectRule) {
return this.$message.warning('请选择属性') return this.$message.warning('请选择属性')
} }
this.ruleList.forEach(item => { this.ruleList.forEach(item => {
if (item.attr_template_id === this.selectRule) { if (item.attr_template_id === this.selectRule) {
this.formValidate.attr = item.template_value this.formValidate.attr = item.template_value
@ -2617,6 +2626,7 @@ export default {
this.formThead.svip_price = { title: "付费会员价" } this.formThead.svip_price = { title: "付费会员价" }
this.attrVal = { this.attrVal = {
price: null, price: null,
wholesale_price: null,
cost: null, cost: null,
ot_price: null, ot_price: null,
svip_price: null, svip_price: null,
@ -2638,6 +2648,7 @@ export default {
delete this.formThead.svip_price delete this.formThead.svip_price
this.attrVal = { this.attrVal = {
price: null, price: null,
wholesale_price: null,
cost: null, cost: null,
ot_price: null, ot_price: null,
stock: null, stock: null,
@ -2679,6 +2690,7 @@ export default {
if(this.oneFormBatch[0].attr!= '')this.$set(val, 'attr', this.oneFormBatch[0].attr) if(this.oneFormBatch[0].attr!= '')this.$set(val, 'attr', this.oneFormBatch[0].attr)
if(this.oneFormBatch[0].image!= '')this.$set(val, 'image', this.oneFormBatch[0].image) if(this.oneFormBatch[0].image!= '')this.$set(val, 'image', this.oneFormBatch[0].image)
if(this.oneFormBatch[0].price!= null && this.oneFormBatch[0].price!= '')this.$set(val, 'price', this.oneFormBatch[0].price) if(this.oneFormBatch[0].price!= null && this.oneFormBatch[0].price!= '')this.$set(val, 'price', this.oneFormBatch[0].price)
if(this.oneFormBatch[0].wholesale_price!= null && this.oneFormBatch[0].wholesale_price!= '')this.$set(val, 'wholesale_price', this.oneFormBatch[0].wholesale_price)
if(this.oneFormBatch[0].cost!= null && this.oneFormBatch[0].cost!= '')this.$set(val, 'cost', this.oneFormBatch[0].cost) if(this.oneFormBatch[0].cost!= null && this.oneFormBatch[0].cost!= '')this.$set(val, 'cost', this.oneFormBatch[0].cost)
if(this.oneFormBatch[0].ot_price!= null && this.oneFormBatch[0].ot_price!= '')this.$set(val, 'ot_price', this.oneFormBatch[0].ot_price) if(this.oneFormBatch[0].ot_price!= null && this.oneFormBatch[0].ot_price!= '')this.$set(val, 'ot_price', this.oneFormBatch[0].ot_price)
if(this.oneFormBatch[0].svip_price!= null && this.oneFormBatch[0].svip_price!= '')this.$set(val, 'svip_price', this.oneFormBatch[0].svip_price) if(this.oneFormBatch[0].svip_price!= null && this.oneFormBatch[0].svip_price!= '')this.$set(val, 'svip_price', this.oneFormBatch[0].svip_price)
@ -2698,7 +2710,7 @@ export default {
}else if(this.oneFormBatch[0]['cdkey'].key){ }else if(this.oneFormBatch[0]['cdkey'].key){
this.$set(val.cdkey, "key", this.oneFormBatch[0]['cdkey'].key); this.$set(val.cdkey, "key", this.oneFormBatch[0]['cdkey'].key);
} }
this.$set(val.cdkey, "is_type",this.oneFormBatch[0]['cdkey'].is_type); this.$set(val.cdkey, "is_type",this.oneFormBatch[0]['cdkey'].is_type);
} }
} }
} }
@ -2784,7 +2796,7 @@ export default {
if (this.$route.params.id !== "0") { if (this.$route.params.id !== "0") {
this.addmanyData(info.value); this.addmanyData(info.value);
} }
if (!this.$route.params.id && this.formValidate.spec_type === 1) { if (!this.$route.params.id && this.formValidate.spec_type === 1) {
this.ManyAttrValue.map((item) => { this.ManyAttrValue.map((item) => {
item.image = this.formValidate.is_copy!=1 ? this.formValidate.slider_image[0] : item.pic; item.image = this.formValidate.is_copy!=1 ? this.formValidate.slider_image[0] : item.pic;
// this.$set(item, 'select', true) // this.$set(item, 'select', true)
@ -2882,6 +2894,7 @@ export default {
if (info.svip_price_type != 0 && info.mer_svip_status) if (info.svip_price_type != 0 && info.mer_svip_status)
this.attrVal = { this.attrVal = {
price: null, price: null,
wholesale_price: null,
cost: null, cost: null,
ot_price: null, ot_price: null,
svip_price: null, svip_price: null,
@ -2896,7 +2909,7 @@ export default {
} }
if (this.formValidate.spec_type === 0) { if (this.formValidate.spec_type === 0) {
info.attrValue[0].list = [], info.attrValue[0].list = [],
this.OneattrValue = info.attrValue; this.OneattrValue = info.attrValue;
} else { } else {
this.ManyAttrValue = info.attrValue; this.ManyAttrValue = info.attrValue;
if(info.is_copy){ if(info.is_copy){
@ -3224,10 +3237,10 @@ export default {
.seeCatMy { .seeCatMy {
color: var(--prev-color-primary); color: var(--prev-color-primary);
cursor: pointer; cursor: pointer;
} }
.selectOn{ .selectOn{
color: var(--prev-color-primary); color: var(--prev-color-primary);
} }
.virtual_boder { .virtual_boder {
border: 1px solid var(--prev-color-primary); border: 1px solid var(--prev-color-primary);
} }