Commit cedd450d by cwq0219

商品管理

1 parent 6401a60d
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
</span> </span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<div v-else-if="item.type === 'input'"> <div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)"></el-input> <el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input>
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
</div> </div>
<!-- 选择-输入框 --> <!-- 选择-输入框 -->
......
...@@ -12,7 +12,10 @@ import glsxCombiForm from '@/components/glsx-combi-form/index.vue' ...@@ -12,7 +12,10 @@ import glsxCombiForm from '@/components/glsx-combi-form/index.vue'
import glsxDialog from '@/components/glsx-dialog/index.vue' import glsxDialog from '@/components/glsx-dialog/index.vue'
import selectMutiProDialog from '@/components/selectMutiProDialog/index.vue' import selectMutiProDialog from '@/components/selectMutiProDialog/index.vue'
import selectSingleProDialog from '@/components/selectSingleProDialog/index.vue' import selectSingleProDialog from '@/components/selectSingleProDialog/index.vue'
import relateStoreDialog from '@/components/relate-store-dialog'
Vue.component('glsx-combi-form', glsxCombiForm) Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('glsx-dialog', glsxDialog) Vue.component('glsx-dialog', glsxDialog)
Vue.component('select-muti-pro-dialog', selectMutiProDialog) Vue.component('select-muti-pro-dialog', selectMutiProDialog)
Vue.component('select-single-pro-dialog', selectSingleProDialog) Vue.component('select-single-pro-dialog', selectSingleProDialog)
Vue.component('relate-store-dialog', relateStoreDialog)
\ No newline at end of file \ No newline at end of file
...@@ -133,7 +133,7 @@ export default { ...@@ -133,7 +133,7 @@ export default {
}, },
{ {
label: '', label: '',
name:'bannerList', name: 'bannerList',
addHtml: 'bannerList' addHtml: 'bannerList'
} }
] ]
......
...@@ -116,13 +116,16 @@ export default { ...@@ -116,13 +116,16 @@ export default {
type: 'radio', type: 'radio',
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
optionList: [{ optionList: [
{
confId: 1, confId: 1,
confName: '不关联' confName: '不关联'
}, { },
{
confId: 2, confId: 2,
confName: '关联' confName: '关联'
}], }
],
handleRadioChange: val => { handleRadioChange: val => {
this.handleRelateProChange(val) this.handleRelateProChange(val)
} }
......
...@@ -100,20 +100,26 @@ export default { ...@@ -100,20 +100,26 @@ export default {
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
baseData: { baseData: {
sourceList: [{ sourceList: [
{
confId: '1', confId: '1',
confName: '广联' confName: '广联'
}, { },
{
confId: '2', confId: '2',
confName: '园区店' confName: '园区店'
}], }
statusList: [{ ],
statusList: [
{
confId: '0', confId: '0',
confName: '未发布' confName: '未发布'
}, { },
{
confId: '1', confId: '1',
confName: '已发布' confName: '已发布'
}] }
]
} }
} }
}, },
......
...@@ -109,6 +109,25 @@ ...@@ -109,6 +109,25 @@
</div> --> </div> -->
</div> </div>
</div> </div>
<template slot="retailPrice">
<p>作为商品商城售卖的价格</p>
</template>
<template slot="originalPrice">
<p>作为商品划线展示的价格</p>
</template>
<template slot="supplyPrice">
<p>作为货源供给门店的价格</p>
</template>
<div slot="selectMerchant" slot-scope="scope" class="select-merchant">
<el-button type="primary" @click="handleRelateStoreClose(scope)">{{ editForm.supplyMerchantList.length ? '更换' : '请选择' }}</el-button>
</div>
<div slot="merchantTable" class="select-merchant">
<GLTable v-show="editForm.supplyMerchantList.length" :hasPage="false" :tableParams="tableParams" :tableData="editForm.supplyMerchantList">
<span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleMerchantDelete(scope)">删除</el-button>
</span>
</GLTable>
</div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
</div> </div>
...@@ -121,6 +140,21 @@ ...@@ -121,6 +140,21 @@
<el-dialog :visible.sync="isImgVisible"> <el-dialog :visible.sync="isImgVisible">
<img class="dialog-img" width="100%" :src="dialogImageUrl" alt="" /> <img class="dialog-img" width="100%" :src="dialogImageUrl" alt="" />
</el-dialog> </el-dialog>
<relate-store-dialog v-if="relateStoreVisible" ref="relateStore" :relateStoreVisible="relateStoreVisible" :storeApi="storeApi" :storeSearchForm="storeSearchForm" :storeSelected="selectedList" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose">
<el-row slot>
<el-form :model="storeSearchForm" ref="relate" :inline="true" label-width="90px">
<el-form-item label="商户ID:" prop="merchantId">
<el-input :size="size" v-model.trim="storeSearchForm.merchantId" placeholder="请输入商户ID" clearable></el-input>
</el-form-item>
<el-form-item label="门店名称:" prop="merchantName">
<el-input :size="size" v-model.trim="storeSearchForm.merchantName" placeholder="请输入门店名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleSearchStore">搜索</el-button>
</el-form-item>
</el-form>
</el-row>
</relate-store-dialog>
</div> </div>
</template> </template>
...@@ -145,6 +179,25 @@ export default { ...@@ -145,6 +179,25 @@ export default {
groupOrStore: '', groupOrStore: '',
id: '' id: ''
}, },
// 选择门店
relateStoreVisible: false,
storeApi: this.$apis.common.getMerchantList,
storeSearchForm: {
merchantId: '',
merchantName: ''
},
selectedList: [],
// 门店表格
tableParams: {
tableOption: true,
tableColumns: [
{
label: '门店名称',
prop: 'merchantName'
}
]
},
// 表单
editForm: { editForm: {
goodsName: '', goodsName: '',
goodsImage: '', goodsImage: '',
...@@ -152,13 +205,20 @@ export default { ...@@ -152,13 +205,20 @@ export default {
goodsVideo: '', goodsVideo: '',
classifyIdList: [], classifyIdList: [],
zoneId: '', zoneId: '',
descImgList: [] descImgList: [],
retailPrice: '',
originalPrice: '',
supplyPrice: '',
goodsStock: '',
deliveryType: 2,
expressFee: '',
supplyMerchantList: []
}, },
labelWidth: '110px', labelWidth: '110px',
externalFormList: [ externalFormList: [
{ {
title: '基本信息', title: '基本信息',
editChildRef: 'editProRef1', editChildRef: 'editProRef0',
editRule: { editRule: {
goodsName: [{ required: true, message: '请输入商品名称', trigger: 'change' }], goodsName: [{ required: true, message: '请输入商品名称', trigger: 'change' }],
goodsImage: [{ required: true, message: '请选择商品缩略图', trigger: 'change' }], goodsImage: [{ required: true, message: '请选择商品缩略图', trigger: 'change' }],
...@@ -270,43 +330,100 @@ export default { ...@@ -270,43 +330,100 @@ export default {
} }
] ]
}, },
// {
// title: 'Banner管理',
// editFormData: [
// {
// label: 'banner图片',
// addHtml: 'bannerBtn'
// },
// {
// label: '',
// name: 'bannerList',
// addHtml: 'bannerList'
// }
// ]
// },
{ {
title: '公告管理', title: '价格库存',
editChildRef: 'editProRef1',
editRule: {
retailPrice: [{ required: true, message: '请输入零售价', trigger: 'change' }],
originalPrice: [{ required: true, message: '请输入划线价', trigger: 'change' }],
supplyPrice: [{ required: true, message: '请输入供货价', trigger: 'change' }],
goodsStock: [{ required: true, message: '请输入库存', trigger: 'change' }]
},
editFormData: [ editFormData: [
{ {
label: '门店公告', label: '零售价',
name: 'noticeContent', name: 'retailPrice',
type: 'input', type: 'input',
inputType: 'textarea', append: '元',
width: '320px', width: '320px',
maxlength: '50' suffixSlot: 'retailPrice'
} },
{
label: '划线价',
name: 'originalPrice',
type: 'input',
append: '元',
width: '320px',
suffixSlot: 'originalPrice'
},
{
label: '供货价',
name: 'supplyPrice',
type: 'input',
append: '元',
width: '320px',
suffixSlot: 'supplyPrice'
},
{
label: '库存',
name: 'goodsStock',
type: 'input',
append: '件',
width: '320px',
suffixSlot: 'goodsStock'
},
] ]
}, },
{ {
title: '新车优惠政策', title: '物流信息',
editChildRef: 'editProRef2',
editRule: {
deliveryType: [{ required: true, message: '请选择配送发货', trigger: 'change' }],
expressFee: [{ required: false, message: '请输入运费', trigger: 'change' }]
},
editFormData: [ editFormData: [
{ {
label: '优惠政策', label: '配送发货',
name: 'police', name: 'deliveryType',
type: 'radio',
optionId: 'confId',
optionLabel: 'confName',
optionList: [
{
confId: 1,
confName: '到店核销'
},
{
confId: 2,
confName: '快递发货'
}
],
handleRadioChange: val => {
this.handleTypeChange(val)
}
},
{
label: '运费',
name: 'expressFee',
type: 'input', type: 'input',
inputType: 'textarea', append: '元',
width: '320px', width: '320px',
maxlength: '300' isHide: false
}
]
},
{
title: '分配门店',
editFormData: [
{
label: '发送门店',
name: 'supplyMerchantList',
addHtml: 'selectMerchant'
},
{
// label: '门店',
name: '',
addHtml: 'merchantTable'
} }
] ]
} }
...@@ -350,12 +467,43 @@ export default { ...@@ -350,12 +467,43 @@ export default {
}) })
}) })
}, },
handleTypeChange(val) {
this.externalFormList[2].editRule.expressFee[0].required = val == 2
var idx = this.externalFormList[2].editFormData.findIndex(item => item.name == 'expressFee')
this.externalFormList[2].editFormData[idx].isHide = val != 2
},
// 选择门店
handleRelateStoreClose() {
this.selectedList = this.$common.utils.deepClone(this.editForm.supplyMerchantList)
this.relateStoreVisible = !this.relateStoreVisible
},
handleRelateStoreConfirm(selectedData) {
this.editForm.supplyMerchantList = selectedData
this.selectedList = selectedData
this.handleRelateStoreClose()
},
handleSearchStore() {
this.$refs.relateStore.handleCurrentChange(1)
},
handleMerchantDelete(obj) {
this.$messageBox.confirm('是否删除该门店?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
var idx = this.editForm.supplyMerchantList.findIndex(item => item.merchantNo == obj.scope.merchantNo)
this.editForm.supplyMerchantList.splice(idx, 1)
}
}
})
},
getInfo() { getInfo() {
// this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => { // this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => {
// this.editForm.zoneName = res.zoneName // this.editForm.zoneName = res.zoneName
// this.editForm.zoneImg = res.zoneImg // this.editForm.zoneImg = res.zoneImg
// this.editForm.merchantList = res.merchantRefList // this.editForm.supplyMerchantList = res.merchantRefList
// this.editForm.merchantList.forEach(item => { // this.editForm.supplyMerchantList.forEach(item => {
// item.merchantNo = item.merchantId // item.merchantNo = item.merchantId
// }) // })
// }) // })
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
</template> </template>
<script> <script>
import relateStoreDialog from '@/components/relate-store-dialog'
export default { export default {
name: 'editZone', name: 'editZone',
data() { data() {
...@@ -123,12 +122,8 @@ export default { ...@@ -123,12 +122,8 @@ export default {
prop: 'merchantName' prop: 'merchantName'
} }
] ]
},
} }
}, }
components: {
relateStoreDialog
}, },
mounted() { mounted() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!