Commit c39df163 by zhangquan

优化

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