Commit c39df163 by zhangquan

优化

1 parent 6fbf5227
......@@ -19,7 +19,7 @@
</glsx-combi-form>
</div>
<div slot="saleStoreSlot">
<el-button v-if="!disabled" class="el-icon-plus" size="small" @click="closeDialog">选择门店</el-button>
<el-button v-if="!disabled && formObj.goodsSource!=2" class="el-icon-plus" size="small" @click="closeDialog">选择门店</el-button>
<template v-if="saleMerchantList && saleMerchantList.length">
<GLTable class="selected-table" :hasPage="false" ref="selectedRef" :tableParams="selectedtableParams"
:tableData="saleMerchantList">
......@@ -123,7 +123,7 @@
</div>
</template>
<script>
const MerchantColumns = [
const defalutMerchantColumns = [
{
label: '门店名称',
prop: 'merchantName'
......@@ -143,6 +143,27 @@ const MerchantColumns = [
addHtml: 'giveIntegralSlot'
}
]
const MerchantColumns = [
{
label: '门店名称',
prop: 'merchantName'
},
{
label: '划线价(元)',
prop: 'originalPrice'
},
{
label: '零售价(元)',
width: 220,
addHtml: 'activityPriceSlot'
},
{
label: '赠送积分',
width: 220,
addHtml: 'giveIntegralSlot'
}
]
const defaultExpreeCol = [
{
label: '配送方式',
......@@ -213,7 +234,8 @@ export default {
{
label: '商品图',
addHtml: 'uploadSlot',
isDisabled: false
isDisabled: false,
isHide: false
},
{
label: '商品名称',
......@@ -221,17 +243,20 @@ export default {
maxlength: 20,
showLimit: true,
type: 'input',
isDisabled: false
isDisabled: false,
isHide: false
},
{
label: '售价(元)',
name: 'retailPrice',
type: 'showTxt'
type: 'showTxt',
isHide: false
},
{
label: '最低售价(元)',
name: 'minSellPrice',
type: 'showTxt'
type: 'showTxt',
isHide: false
},
],
expressInfoFormData: [
......@@ -327,8 +352,8 @@ export default {
if (!this.saleMerchantList.length) {
callback(new Error('请选择门店'))
} else if (_target) {
callback(new Error('门店活动价和原价不能为空'))
} else if (hasTarget) {
callback(new Error(`门店${this.formObj.goodsSource==2 ? '零售价' : '活动价和原价'}不能为空`))
} else if (this.formObj.goodsSource!=2 && hasTarget) {
callback(new Error('原价不能小于最低售价和活动价'))
} else if (_integralTarget) {
callback(new Error('请输入赠送积分'))
......@@ -371,8 +396,7 @@ export default {
optionLabel: 'confName',
isDisabled: false,
handleRadioChange: (e)=>{
this.expressInfoFormData = e==2 ? selfGoodsExpreeCol : defaultExpreeCol
this.clearDataFn()
this.changeSource(e, true)
}
},
{
......@@ -429,7 +453,7 @@ export default {
tableOption: {
width: 100
},
tableColumns: MerchantColumns
tableColumns: defalutMerchantColumns
}
}
},
......@@ -466,6 +490,14 @@ export default {
}
},
methods: {
changeSource(e, isClear){
this.expressInfoFormData = e==2 ? selfGoodsExpreeCol : defaultExpreeCol
this.goodsFormData.forEach(item => {
item.isHide = (item.name == 'retailPrice' || item.name == 'minSellPrice') && e==2
})
this.selectedtableParams.tableColumns = e==2 ? MerchantColumns : defalutMerchantColumns
if(isClear) this.clearDataFn()
},
clearDataFn(){
this.formObj = {
...this.formObj,
......@@ -677,7 +709,7 @@ export default {
categoryName: res.associationClassifySecondName,
id: res.associationClassifySecondId
}
this.expressInfoFormData = res.goodsSource==2 ? selfGoodsExpreeCol : defaultExpreeCol
this.changeSource()
this.formObj.goodsType = '2' //1配置升级, 2车主优选
this.formObj.coverList =res.goodsImage ? [res.goodsImage] : []
this.formObj.styleBImgList = res.styleBImg ? [res.styleBImg] : []
......
......@@ -204,12 +204,12 @@ export default {
id: '',
name: '全部'
},
// {
// id: '1',
// name: '云中鹤'
// },
{
id: '2',
id: 2,
name: '门店自营'
},
{
id: 1,
name: '嘀加智享'
},
],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!