Commit 9b1e8b5e by zhangquan

联调基本完成

1 parent 72b7be88
...@@ -42,6 +42,16 @@ const getCarlifeGoodsApi = params => { ...@@ -42,6 +42,16 @@ const getCarlifeGoodsApi = params => {
}) })
} }
const getSelfSupportGoodsApi = params => {
params.method = 'scrm.api.shopmall.goods.discover.page'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const addGoodsApi = params => { const addGoodsApi = params => {
params.method = 'scrm.api.shopmall.goods.configuration.upgrade.add.or.update' params.method = 'scrm.api.shopmall.goods.configuration.upgrade.add.or.update'
...@@ -130,12 +140,23 @@ const exportGoodsApi = params => { ...@@ -130,12 +140,23 @@ const exportGoodsApi = params => {
sign: true sign: true
}) })
} }
const getSelfGoodsDetailApi = params => {
params.method = 'scrm.api.shopmall.goods.getById'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
export default { export default {
getGoodsListApi, getGoodsListApi,
updateGoodsStatusApi, updateGoodsStatusApi,
delGoodsApi, delGoodsApi,
getCarlifeGoodsApi, getCarlifeGoodsApi,
getSelfSupportGoodsApi,
addGoodsApi, addGoodsApi,
getGoodsDetail, getGoodsDetail,
getMerchantListApi, getMerchantListApi,
...@@ -143,5 +164,6 @@ export default { ...@@ -143,5 +164,6 @@ export default {
getVisitorListApi, getVisitorListApi,
getSharedListApi, getSharedListApi,
exportBrowseApi, exportBrowseApi,
exportGoodsApi exportGoodsApi,
getSelfGoodsDetailApi
} }
\ No newline at end of file \ No newline at end of file
...@@ -13,12 +13,18 @@ ...@@ -13,12 +13,18 @@
<glsx-combi-form :isInline="false" ref="goodsInfoRef" labelWidth="154px" defaultWidth="432px" <glsx-combi-form :isInline="false" ref="goodsInfoRef" labelWidth="154px" defaultWidth="432px"
:formObj.sync="formObj" :formData="goodsFormData" :formRules="goodsRule"> :formObj.sync="formObj" :formData="goodsFormData" :formRules="goodsRule">
<div slot="uploadSlot" class="upload-calss"> <div slot="uploadSlot" class="upload-calss">
<glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.coverList" <glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.coverList"></glsx-preview>
@change="changeChannelImg"></glsx-preview>
<span class="tip">建议尺寸750*750,图片格式为jpg,jpeg,png,大小2M以内</span> <span class="tip">建议尺寸750*750,图片格式为jpg,jpeg,png,大小2M以内</span>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div slot="propagateCoverSlot" class="propagate-cover-class">
<div class="upload-wrap">
<glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.styleBImgList"></glsx-preview>
<span class="preview" @click="showPreviewDialog=true">预览</span>
</div>
<span class="tip">分类布局选择种草样式B时商品宣传大图,建议720*540,大小2M以内</span>
</div>
<div slot="paymentSlot"> <div slot="paymentSlot">
<el-radio-group :disabled="disabled" v-model="formObj.paymentType"> <el-radio-group :disabled="disabled" v-model="formObj.paymentType">
<el-radio :label="1">全款</el-radio> <el-radio :label="1">全款</el-radio>
...@@ -95,10 +101,6 @@ ...@@ -95,10 +101,6 @@
</div> </div>
</div> </div>
</div> </div>
<div slot="categorySlot">
<brandCascader :curInfo="curCategoryInfo" :disabled="disabled" @clickItem="selectCategory"
class="category-class"></brandCascader>
</div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<GLFooter style="margin-top: 16px;"> <GLFooter style="margin-top: 16px;">
...@@ -107,7 +109,7 @@ ...@@ -107,7 +109,7 @@
</GLFooter> </GLFooter>
<selectCarDialog v-if="carDialogVisible" :echoData="vehicleSeriesRequestList" @handleClose="handleCarSeriesClose" <selectCarDialog v-if="carDialogVisible" :echoData="vehicleSeriesRequestList" @handleClose="handleCarSeriesClose"
@handleConfirm="handleConfirm" :dialogVisible="carDialogVisible"></selectCarDialog> @handleConfirm="handleConfirm" :dialogVisible="carDialogVisible"></selectCarDialog>
<selectGoods v-if="goodsVisible" :routeInfo="routeInfo" :dialogVisible="goodsVisible" <selectGoods v-if="goodsVisible" :routeInfo="routeInfo" :dialogVisible="goodsVisible" :goodsInfo="{}"
@handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></selectGoods> @handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></selectGoods>
<selectMerchantDialog @confirmDialog="confirmDialog" @closeDialog="closeDialog" <selectMerchantDialog @confirmDialog="confirmDialog" @closeDialog="closeDialog"
:goodsId="formObj.smartcarlifeInfoId" :selectedList="saleMerchantList" :goodsId="formObj.smartcarlifeInfoId" :selectedList="saleMerchantList"
...@@ -116,6 +118,9 @@ ...@@ -116,6 +118,9 @@
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" /> <img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<video width="100%" autoplay controls :src="dialogSrc" v-else></video> <video width="100%" autoplay controls :src="dialogSrc" v-else></video>
</el-dialog> </el-dialog>
<div v-if="showPreviewDialog" class="preview-dialog" @click="showPreviewDialog = false">
<img class="preview-img" src="@/assets/preview.png" alt=""/>
</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -156,7 +161,6 @@ const notPriceColumns = [ ...@@ -156,7 +161,6 @@ const notPriceColumns = [
} }
] ]
import glsxCombiForm from '@/components/glsx-combi-form' import glsxCombiForm from '@/components/glsx-combi-form'
import brandCascader from './components/brandCascader'
import selectGoods from './components/selectGoods' import selectGoods from './components/selectGoods'
import selectCarDialog from '@/views/store/components/selectCarDialog' import selectCarDialog from '@/views/store/components/selectCarDialog'
import selectMerchantDialog from './components/selectMerchantDialog' import selectMerchantDialog from './components/selectMerchantDialog'
...@@ -165,7 +169,6 @@ export default { ...@@ -165,7 +169,6 @@ export default {
name: 'add', name: 'add',
components: { components: {
glsxCombiForm, glsxCombiForm,
brandCascader,
selectGoods, selectGoods,
selectCarDialog, selectCarDialog,
selectMerchantDialog selectMerchantDialog
...@@ -184,19 +187,18 @@ export default { ...@@ -184,19 +187,18 @@ export default {
}, },
data() { data() {
return { return {
showPreviewDialog: false,
dialogVisibleImg:false, dialogVisibleImg:false,
goodsVisible: false, goodsVisible: false,
carDialogVisible: false, carDialogVisible: false,
merchantDialogVisible: false, merchantDialogVisible: false,
disabled: false, disabled: false,
dialogSrc:'', dialogSrc:'',
goodsInfo: {},
routeInfo: {}, routeInfo: {},
defaultProps: { defaultProps: {
children: 'categoryName', children: 'categoryName',
label: 'childs' label: 'childs'
}, },
curCategoryInfo: {},
posterOptions: { posterOptions: {
width: '104px', width: '104px',
height: '104px', height: '104px',
...@@ -236,12 +238,13 @@ export default { ...@@ -236,12 +238,13 @@ export default {
minSellPrice: '', minSellPrice: '',
retailPrice: '', retailPrice: '',
coverList: [], coverList: [],
styleBImgList: [],
styleBImg: '',
paymentType: 1, paymentType: 1,
depositPrice: '', depositPrice: '',
vehicleSeriesType: 1, vehicleSeriesType: 1,
goodsVideo: '', goodsVideo: '',
associationClassifyFirstId: '', associationClassifyFirstId: ''
associationClassifySecondId: ''
}, },
saleMerchantList: [], saleMerchantList: [],
vehicleSeriesRequestList: [], vehicleSeriesRequestList: [],
...@@ -324,17 +327,7 @@ export default { ...@@ -324,17 +327,7 @@ export default {
}, },
trigger: 'change' trigger: 'change'
}], }],
categoryName: [{ associationClassifyFirstId: [{required: true, message: '请选择关联商品分类', trigger: 'change'}],
required: true,
validator: (rule, value, callback) => {
if (!this.formObj.associationClassifyFirstId || !this.formObj.associationClassifySecondId) {
callback(new Error('请选择关联商品分类'))
} else {
callback()
}
},
trigger: 'change'
}],
}, },
formData: [ formData: [
{ {
...@@ -352,6 +345,11 @@ export default { ...@@ -352,6 +345,11 @@ export default {
isDisabled: false isDisabled: false
}, },
{ {
label: '种草样式B宣传图',
name: 'propagateCover',
addHtml: 'propagateCoverSlot'
},
{
label: '收款方式', label: '收款方式',
name: 'paymentType', name: 'paymentType',
addHtml: 'paymentSlot' addHtml: 'paymentSlot'
...@@ -402,11 +400,20 @@ export default { ...@@ -402,11 +400,20 @@ export default {
name: 'carSeriesName', name: 'carSeriesName',
addHtml: 'carSeriesSlot', addHtml: 'carSeriesSlot',
}, },
// {
// label: '关联商品分类',
// name: 'categoryName',
// addHtml: 'categorySlot'
// },
{ {
label: '关联商品分类', label: '关联商品分类',
name: 'categoryName', name: 'associationClassifyFirstId',
addHtml: 'categorySlot' type: 'select',
} optionList: [],
optionId: 'id',
optionLabel: 'categoryName',
isDisabled: false
},
], ],
selectedtableParams: { selectedtableParams: {
listName: 'list', listName: 'list',
...@@ -418,7 +425,7 @@ export default { ...@@ -418,7 +425,7 @@ export default {
} }
}, },
created() { created() {
// this.getCategory() this.getCategory()
const urlParam = this.$route.params const urlParam = this.$route.params
this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id)) this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id))
const {id, type} = this.routeInfo const {id, type} = this.routeInfo
...@@ -427,6 +434,8 @@ export default { ...@@ -427,6 +434,8 @@ export default {
this.posterOptions.isClose = false this.posterOptions.isClose = false
const _target = this.goodsFormData.find(item => item.name == 'goodsName') const _target = this.goodsFormData.find(item => item.name == 'goodsName')
_target.isDisabled = true _target.isDisabled = true
const _classifyTarget = this.formData.find(item => item.name == 'associationClassifyFirstId')
_classifyTarget.isDisabled = true
this.selectedtableParams.tableOption = null this.selectedtableParams.tableOption = null
} }
if (id) { if (id) {
...@@ -434,6 +443,19 @@ export default { ...@@ -434,6 +443,19 @@ export default {
} }
}, },
methods: { methods: {
getCategory() {
const params = {
pageSize: 10000,
pageNum: 1,
categoryType: 1
}
this.$apis.category.getCategoryListApi(params).then(res => {
if (res?.list?.length) {
const _target = this.formData.find(item => item.name == 'associationClassifyFirstId')
_target.optionList = res.list
}
})
},
// 上传视频 // 上传视频
handleVideoChange(e) { handleVideoChange(e) {
let file = e.srcElement.files[0] let file = e.srcElement.files[0]
...@@ -590,11 +612,13 @@ export default { ...@@ -590,11 +612,13 @@ export default {
getParams() { getParams() {
let obj = JSON.parse(JSON.stringify(this.formObj)) let obj = JSON.parse(JSON.stringify(this.formObj))
obj.goodsImage = obj.coverList[0] obj.goodsImage = obj.coverList[0]
obj.styleBImg = obj.styleBImgList[0]
obj.depositPrice = obj.depositPrice ? Number(Number(obj.depositPrice * 10 * 10).toFixed(0)) : 0 obj.depositPrice = obj.depositPrice ? Number(Number(obj.depositPrice * 10 * 10).toFixed(0)) : 0
if (obj.paymentType == 1) delete obj.depositPrice if (obj.paymentType == 1) delete obj.depositPrice
delete obj.minSellPrice delete obj.minSellPrice
delete obj.retailPrice delete obj.retailPrice
delete obj.coverList delete obj.coverList
delete obj.styleBImgList
let saleMerchantList = this.saleMerchantList.map(item => { let saleMerchantList = this.saleMerchantList.map(item => {
let {merchantId, merchantName, activityPrice, originalPrice} = item let {merchantId, merchantName, activityPrice, originalPrice} = item
...@@ -650,12 +674,9 @@ export default { ...@@ -650,12 +674,9 @@ export default {
this.formObj[key] = res[key] this.formObj[key] = res[key]
} }
} }
this.curCategoryInfo = {
categoryName: res.associationClassifySecondName,
id: res.associationClassifySecondId
}
this.formObj.goodsType = '1' this.formObj.goodsType = '1'
this.formObj.coverList = [res.goodsImage] this.formObj.coverList = [res.goodsImage]
this.formObj.styleBImgList = res.styleBImg ? [res.styleBImg] : []
this.saleMerchantList = res.saleMerchantList?.map(item => { this.saleMerchantList = res.saleMerchantList?.map(item => {
let activityPrice = item.activityPrice ? Number(Number(item.activityPrice / 100).toFixed(2)) : 0 let activityPrice = item.activityPrice ? Number(Number(item.activityPrice / 100).toFixed(2)) : 0
let originalPrice = item.originalPrice ? Number(Number(item.originalPrice / 100).toFixed(2)) : 0 let originalPrice = item.originalPrice ? Number(Number(item.originalPrice / 100).toFixed(2)) : 0
...@@ -688,6 +709,30 @@ export default { ...@@ -688,6 +709,30 @@ export default {
color: #666666; color: #666666;
} }
.propagate-cover-class{
.preview{
color: #5850ff;
font-weight: 400;
font-size: 14px;
line-height: 20px;
align-self: self-end;
margin-left: 10px;
cursor: pointer;
}
.upload-wrap{
display: flex;
}
.tip{
height: 20px;
line-height: 20px;
align-self: flex-end;
font-weight: 400;
font-size: 14px;
color: #999999;
}
}
.goods-wrap { .goods-wrap {
padding: 20px 20px 1px; padding: 20px 20px 1px;
width: 1000px; width: 1000px;
...@@ -848,4 +893,22 @@ export default { ...@@ -848,4 +893,22 @@ export default {
color: #999999; color: #999999;
margin-bottom: -35px; margin-bottom: -35px;
} }
.preview-dialog{
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 99;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
.preview-img{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 390px;
height: 720px;
}
}
</style> </style>
...@@ -84,8 +84,21 @@ ...@@ -84,8 +84,21 @@
<glsx-combi-form :isInline="false" ref="expressInfoRef" labelWidth="154px" defaultWidth="432px" <glsx-combi-form :isInline="false" ref="expressInfoRef" labelWidth="154px" defaultWidth="432px"
:formObj.sync="formObj" :formData="expressInfoFormData" :formRules="myRule"> :formObj.sync="formObj" :formData="expressInfoFormData" :formRules="myRule">
<div slot="expressFeeSlot"> <div slot="expressFeeSlot">
<format-input class="expressFee-class" :disabled="disabled" :intDigit="4" :precise="2" <format-input class="expressFee-class" :disabled="disabled" :intDigit="4" :precise="2" v-model="formObj.expressFee"></format-input>
v-model="formObj.expressFee"></format-input> </div>
<div slot="selfSlot">
<div>
<span style="color: #666666;">配送方式:</span>
<span>{{ formObj.deliveryType==1 ? '到店核销' : '快递发货' }}</span>
</div>
<div>
<span style="color: #666666;">运费/元:</span>
<span>{{ formObj.deliveryType==1 ? '--' : (formObj.expressFee || 0) }}</span>
</div>
<div>
<span style="color: #666666;">服务说明:</span>
<span>{{ formObj.introduction }}</span>
</div>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
...@@ -130,6 +143,45 @@ const MerchantColumns = [ ...@@ -130,6 +143,45 @@ const MerchantColumns = [
addHtml: 'giveIntegralSlot' addHtml: 'giveIntegralSlot'
} }
] ]
const defaultExpreeCol = [
{
label: '配送方式',
name: 'deliveryType',
type: 'radio',
optionList: [{
confId: 2,
confName: '快递发货'
},{
confId: 1,
confName: '到店核销'
}],
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false
},
{
label: '运费/元',
name: 'expressFee',
addHtml: 'expressFeeSlot',
isDisabled: false
},
{
label: '服务说明',
name: 'introduction',
type: 'input',
inputType: 'textarea',
isDisabled: false,
showLimit: true,
maxlength: 200
},
]
const selfGoodsExpreeCol = [
{
label: '',
addHtml: 'selfSlot',
}
]
import glsxCombiForm from '@/components/glsx-combi-form' import glsxCombiForm from '@/components/glsx-combi-form'
import selectGoods from './components/selectGoods' import selectGoods from './components/selectGoods'
import selectMerchantDialog from './components/selectMerchantDialog' import selectMerchantDialog from './components/selectMerchantDialog'
...@@ -386,6 +438,12 @@ export default { ...@@ -386,6 +438,12 @@ export default {
if(!nVal) this.formObj.commerceDescribe = '' if(!nVal) this.formObj.commerceDescribe = ''
}, },
deep: true deep: true
},
'formObj.goodsSource':{
handler(nVal, oVal) {
this.expressInfoFormData = nVal==2 ? selfGoodsExpreeCol : defaultExpreeCol
},
deep: true
} }
}, },
created() { created() {
...@@ -502,7 +560,7 @@ export default { ...@@ -502,7 +560,7 @@ export default {
}, },
handleGoodsConfirm(e) { handleGoodsConfirm(e) {
if (this.formObj.smartcarlifeInfoId != e?.id) this.saleMerchantList = [] if (this.formObj.smartcarlifeInfoId != e?.id) this.saleMerchantList = []
let {id: smartcarlifeInfoId, goodsName, goodsImage, minSellPrice, retailPrice, goodsVideo} = e || {} let {id, goodsName, goodsImage, minSellPrice, retailPrice, goodsVideo, goodsId} = e || {}
minSellPrice = minSellPrice ? Number(Number(minSellPrice / 100).toFixed(2)) : 0 minSellPrice = minSellPrice ? Number(Number(minSellPrice / 100).toFixed(2)) : 0
retailPrice = retailPrice ? Number(Number(retailPrice / 100).toFixed(2)) : 0 retailPrice = retailPrice ? Number(Number(retailPrice / 100).toFixed(2)) : 0
...@@ -510,7 +568,7 @@ export default { ...@@ -510,7 +568,7 @@ export default {
if (goodsVideo) this.formObj.goodsVideo = goodsVideo if (goodsVideo) this.formObj.goodsVideo = goodsVideo
this.formObj = { this.formObj = {
...this.formObj, ...this.formObj,
smartcarlifeInfoId, smartcarlifeInfoId : this.formObj.goodsSource==2 ? goodsId : id, //自营和智享的id字段不一致
goodsName, goodsName,
goodsImage, goodsImage,
coverList: [goodsImage], coverList: [goodsImage],
...@@ -518,8 +576,18 @@ export default { ...@@ -518,8 +576,18 @@ export default {
retailPrice retailPrice
} }
this.handleGoodsClose() this.handleGoodsClose()
if(this.formObj.goodsSource==2){
this.setSelfGoodsInfo(e)
}
this.validateField(['selectBtnSlot', 'goodsInfoSlot']) this.validateField(['selectBtnSlot', 'goodsInfoSlot'])
}, },
setSelfGoodsInfo(row){
let {deliveryType, expressFee, goodsVideo, merchantId, merchantName,retailPrice, originalPrice, serviceDesc: introduction} = row || {}
this.formObj = {...this.formObj, deliveryType, expressFee, goodsVideo, introduction}
retailPrice = retailPrice ? Number(Number(retailPrice / 100).toFixed(2)) : 0
originalPrice = originalPrice ? Number(Number(originalPrice / 100).toFixed(2)) : 0
this.saleMerchantList = [{merchantId, merchantName, activityPrice: retailPrice, originalPrice, giveIntegral: ''}]
},
confirmDialog(e) { confirmDialog(e) {
this.saleMerchantList = e || [] this.saleMerchantList = e || []
this.saleMerchantList.map(item => this.$set(item, 'giveIntegral', '')) this.saleMerchantList.map(item => this.$set(item, 'giveIntegral', ''))
...@@ -560,16 +628,17 @@ export default { ...@@ -560,16 +628,17 @@ export default {
}, },
handleSave() { handleSave() {
this.$refs.baseInfoRef.$refs.formRef.validate(valid => { this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
// this.$refs.expressInfoRef this.$refs.expressInfoRef.$refs.formRef.validate(validate => {
if (valid) { if (valid && validate) {
const params = this.getParams() const params = this.getParams()
this.$apis.goods.addGoodsApi(params).then(res => { this.$apis.goods.addGoodsApi(params).then(res => {
if (res) { if (res) {
this.$message.success('操作成功') this.$message.success('操作成功')
this.handleCancel() this.handleCancel()
} }
}) })
} }
})
}) })
}, },
handleCancel() { handleCancel() {
......
...@@ -21,9 +21,11 @@ ...@@ -21,9 +21,11 @@
:noDataImg="url" :noDataImg="url"
:searchForm="searchForm" :searchForm="searchForm"
:tableParams="tableParams" :tableParams="tableParams"
:beforeSearchFn="beforeSearchFn"
:pageConf="pageConf" :pageConf="pageConf"
@refreshTable="getList" @refreshTable="getList"
:getListApi="getListApi" :getListApi="getListApi"
:pageSizes="pageSizes"
:hasNum="false" :hasNum="false"
:setTableFinishFun="setTableFinishFun"> :setTableFinishFun="setTableFinishFun">
<div slot="radioHtml" <div slot="radioHtml"
...@@ -33,12 +35,22 @@ ...@@ -33,12 +35,22 @@
:label="scope.scope.id" :label="scope.scope.id"
@click.native="handleClick(scope.scope)"></el-radio> @click.native="handleClick(scope.scope)"></el-radio>
</div> </div>
<div slot="selfRadioHtml"
class="store-table"
slot-scope="scope">
<el-radio v-model="curInfo.goodsId"
:label="scope.scope.goodsId"
@click.native="handleClick(scope.scope)"></el-radio>
</div>
<div slot="imageSlot" slot-scope="scope"> <div slot="imageSlot" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block"> <el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.goodsImage" /> <img class="table-popover-img" :src="scope.scope.goodsImage" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.goodsImage" /> <img class="img-36 pointer" slot="reference" :src="scope.scope.goodsImage" />
</el-popover> </el-popover>
</div> </div>
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImage" alt="">{{ scope.scope.goodsName }}
</div>
</GLTable> </GLTable>
</GLDialog> </GLDialog>
</div> </div>
...@@ -46,6 +58,65 @@ ...@@ -46,6 +58,65 @@
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
const MERCHANT_SEARCH_ITEM = {
label: '门店名称',
name: 'merchantName',
type: 'input',
width: '200px',
labelWidth: '10px',
isClear: true
}
const defaultTableCol = [
{
label: '',
prop: '',
width: 80,
addHtml: 'radioHtml'
},
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '缩略图',
addHtml: 'imageSlot'
},
{
label: '价格(元)',
formatter: cellValue => {
return cellValue.retailPrice ? Number(Number(cellValue.retailPrice/100).toFixed(2)) : '--'
}
}
]
const merchantGoodsTableCol = [
{
label: '',
prop: '',
width: 80,
addHtml: 'selfRadioHtml'
},
{
label: '商品信息',
addHtml: 'goodsNameSlot'
},
{
label: '门店名称',
prop: 'merchantName'
},
{
label: '零售价(元)',
formatter: cellValue => {
return cellValue.retailPrice ? Number(Number(cellValue.retailPrice/100).toFixed(2)) : '--'
}
},
{
label: '划线价(元)',
formatter: cellValue => {
return cellValue.originalPrice ? Number(Number(cellValue.originalPrice/100).toFixed(2)) : '--'
}
}
]
export default { export default {
name: 'selectStore', name: 'selectStore',
data() { data() {
...@@ -67,7 +138,7 @@ export default { ...@@ -67,7 +138,7 @@ export default {
name: 'goodsName', name: 'goodsName',
type: 'input', type: 'input',
placeholder: '请输入商品名称', placeholder: '请输入商品名称',
width: '300px', width: '200px',
labelWidth: '10px', labelWidth: '10px',
isClear: true isClear: true
} }
...@@ -79,30 +150,10 @@ export default { ...@@ -79,30 +150,10 @@ export default {
getListApi: this.$apis.goods.getCarlifeGoodsApi, getListApi: this.$apis.goods.getCarlifeGoodsApi,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableColumns: [ tableColumns:defaultTableCol
{
label: '',
prop: '',
width: 80,
addHtml: 'radioHtml'
},
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '缩略图',
addHtml: 'imageSlot'
},
{
label: '价格(元)',
formatter: cellValue => {
return cellValue.retailPrice ? Number(Number(cellValue.retailPrice/100).toFixed(2)) : '--'
}
}
]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
pageSizes: [5, 10, 20, 30, 40],
baseData: {} baseData: {}
} }
}, },
...@@ -133,8 +184,13 @@ export default { ...@@ -133,8 +184,13 @@ export default {
// minSellPrice: minSellPrice ? Number(Number(minSellPrice*10*10).toFixed(0)) : 0, // minSellPrice: minSellPrice ? Number(Number(minSellPrice*10*10).toFixed(0)) : 0,
// retailPrice: retailPrice ? Number(Number(retailPrice*10*10).toFixed(0)) : 0, // retailPrice: retailPrice ? Number(Number(retailPrice*10*10).toFixed(0)) : 0,
// } // }
this.searchForm.discoverGoodsId = this.routeInfo.type == 2 ? this.routeInfo.id : '' this.searchForm.discoverGoodsId = this.routeInfo.type == 2 ? this.routeInfo.id : '' //1查看,2编辑,空是新增,编辑进来要传id
this.searchForm.goodsType = this.routeInfo.goodsType this.searchForm.goodsType = this.routeInfo.goodsType // 1是配置 2是车主
if(this.goodsInfo.goodsSource==2){ //来源是门店自营的搜素和列表字段都要改
this.searchFormData.push(MERCHANT_SEARCH_ITEM)
this.tableParams.tableColumns = merchantGoodsTableCol
this.getListApi = this.$apis.goods.getSelfSupportGoodsApi
}
}, },
mounted() { mounted() {
...@@ -146,6 +202,14 @@ export default { ...@@ -146,6 +202,14 @@ export default {
resetTable() { resetTable() {
this.$refs.goodsRef.refreshTable() this.$refs.goodsRef.refreshTable()
}, },
beforeSearchFn() {
return new Promise(resolve => {
if(this.goodsInfo.goodsSource==2){
delete this.searchForm.goodsType
}
resolve()
})
},
setTableFinishFun() { setTableFinishFun() {
this.$refs.goodsRef.tableHeightValues = '460px' this.$refs.goodsRef.tableHeightValues = '460px'
}, },
...@@ -174,6 +238,14 @@ export default { ...@@ -174,6 +238,14 @@ export default {
margin-top: 1px; margin-top: 1px;
} }
} }
.goodsNameSlot{
img{
width: 36px;
height: 36px;
vertical-align: middle;
margin-right: 8px;
}
}
.select-store { .select-store {
.storeDailog { .storeDailog {
width: 500px; width: 500px;
...@@ -223,7 +295,7 @@ export default { ...@@ -223,7 +295,7 @@ export default {
.p-16 { .p-16 {
padding: 16px; padding: 16px;
} }
.store-table .el-radio__label { /deep/ .store-table .el-radio__label {
display: none; display: none;
} }
} }
......
...@@ -4,9 +4,7 @@ ...@@ -4,9 +4,7 @@
<preferList v-if="activeName == '2'"></preferList> <preferList v-if="activeName == '2'"></preferList>
<div v-else class="table-wrap"> <div v-else class="table-wrap">
<GLCombiForm ref="showSearch" class="search-wrap" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"> <GLCombiForm ref="showSearch" class="search-wrap" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset">
<div slot="categorySlot">
<brandCascader ref="cascaderRef" @clickItem="selectCategory" class="category-slot-class"></brandCascader>
</div>
</GLCombiForm> </GLCombiForm>
<div class="operate-wrap"> <div class="operate-wrap">
<span class="table-title">发现商品列表</span> <span class="table-title">发现商品列表</span>
...@@ -69,13 +67,11 @@ ...@@ -69,13 +67,11 @@
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import brandCascader from './components/brandCascader'
import preferList from './preferList' import preferList from './preferList'
import { exportFn } from '@/common/constant' import { exportFn } from '@/common/constant'
export default { export default {
name: 'App', name: 'App',
components: { components: {
brandCascader,
preferList preferList
}, },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
...@@ -84,6 +80,9 @@ ...@@ -84,6 +80,9 @@
if(from.path.indexOf('/goods/addPrefer')==0 || (from.path.indexOf('/goods/browseList')==0 && from.query.activeName== 2)) {vm.activeName='2'} if(from.path.indexOf('/goods/addPrefer')==0 || (from.path.indexOf('/goods/browseList')==0 && from.query.activeName== 2)) {vm.activeName='2'}
}) })
}, },
created() {
this.getCategory()
},
data() { data() {
return { return {
tableSearchForm: { tableSearchForm: {
...@@ -190,9 +189,12 @@ ...@@ -190,9 +189,12 @@
type: 'input' type: 'input'
}, },
{ {
label: '商品分类', label: '分类名称',
name: 'goodsCategory', name: 'associationClassifyFirstId',
addHtml: 'categorySlot' type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'categoryName',
}, },
], ],
getListApi: this.$apis.goods.getGoodsListApi, getListApi: this.$apis.goods.getGoodsListApi,
...@@ -281,7 +283,6 @@ ...@@ -281,7 +283,6 @@
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' } pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
} }
}, },
created() {},
mounted() {}, mounted() {},
methods: { methods: {
// 明细 // 明细
...@@ -312,6 +313,20 @@ ...@@ -312,6 +313,20 @@
} }
}) })
}, },
getCategory() {
const params = {
pageSize: 10000,
pageNum: 1,
categoryType: 1
}
this.$apis.category.getCategoryListApi(params).then(res => {
if (res?.list?.length) {
const _target = this.searchFormData.find(item => item.name == 'associationClassifyFirstId')
_target && (_target.optionList = res.list)
console.log(this.searchFormData)
}
})
},
handleExport () { handleExport () {
var params = this.$common.utils.deepClone(this.searchForm) var params = this.$common.utils.deepClone(this.searchForm)
params.goodsType = 1 params.goodsType = 1
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!