Commit 06a1f751 by zhangquan

更换接口

1 parent 0dfdb937
......@@ -65,11 +65,22 @@ const getGoodsDetail = params => {
}
const getMerchantListApi = params => {
params.method = 'scrm.api.shopmall.goods.smartcarlife.detail'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
export default {
getGoodsListApi,
updateGoodsStatusApi,
delGoodsApi,
getCarlifeGoodsApi,
addGoodsApi,
getGoodsDetail
getGoodsDetail,
getMerchantListApi
}
\ No newline at end of file
......@@ -61,7 +61,7 @@
</GLFooter>
<selectCarDialog v-if="carDialogVisible" :echoData="vehicleSeriesRequestList" @handleClose="handleCarSeriesClose" @handleConfirm="handleConfirm" :dialogVisible="carDialogVisible"></selectCarDialog>
<selectGoods v-if="goodsVisible" :dialogVisible="goodsVisible" :goodsInfo="formObj" @handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></selectGoods>
<selectMerchantDialog @confirmDialog="confirmDialog" @closeDialog="closeDialog" :selectedList="merchantRequestList" v-if="merchantDialogVisible" :isVisible="merchantDialogVisible"></selectMerchantDialog>
<selectMerchantDialog @confirmDialog="confirmDialog" @closeDialog="closeDialog" :goodsId="formObj.smartcarlifeInfoId" :selectedList="merchantRequestList" v-if="merchantDialogVisible" :isVisible="merchantDialogVisible"></selectMerchantDialog>
</div>
</template>
<script>
......@@ -297,6 +297,7 @@ export default {
this.goodsVisible = false
},
handleGoodsConfirm(e){
if(this.formObj.smartcarlifeInfoId!=e?.id) this.merchantRequestList = []
let { id: smartcarlifeInfoId, goodsName, goodsImage, minSellPrice, retailPrice } = e || {}
minSellPrice = minSellPrice ? Number(Number(minSellPrice/100).toFixed(2)) : 0
retailPrice = retailPrice ? Number(Number(retailPrice/100).toFixed(2)) : 0
......@@ -327,13 +328,14 @@ export default {
this.handleCarSeriesClose()
},
confirmDialog(e){
console.log(e)
this.merchantRequestList = e || []
this.closeDialog()
},
closeDialog(){
if(!this.merchantDialogVisible && !this.formObj.smartcarlifeInfoId){
return this.$message.error('请先选择商品')
}
this.merchantDialogVisible = !this.merchantDialogVisible
console.log(this.merchantDialogVisible)
},
handleDel(row) {
const idx = this.merchantRequestList.findIndex(item => item.id == row.id)
......@@ -354,13 +356,17 @@ export default {
delete obj.coverList
let merchantRequestList = this.merchantRequestList.map(item => {
let { merchantNo, merchantId, merchantName, activityPrice } = item
merchantId = merchantNo || merchantId
let { merchantId, merchantName, activityPrice } = item
let price = this.formObj.paymentType==1 ? 0 : this.formObj.depositPrice
let retainagePrice = activityPrice - price
activityPrice = activityPrice ? Number(Number(activityPrice*10*10).toFixed(0)) : 0
retainagePrice = retainagePrice ? Number(Number(retainagePrice*10*10).toFixed(0)) : 0
return {merchantId , merchantName,activityPrice, retainagePrice}
if(obj.paymentType == 1) {
return {merchantId , merchantName,activityPrice }
}else{
return {merchantId , merchantName,activityPrice, retainagePrice }
}
})
const params = {
merchantRequestList,
......@@ -373,7 +379,6 @@ export default {
handleSave(){
this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
if(valid){
console.log(this.getParams())
const params = this.getParams()
this.$apis.goods.addGoodsApi(params).then(res =>{
if(res) {
......
<template>
<GLDialog bigTitle="选择商品优惠券" mode="big" :visible.sync="isVisible" :show-close="true" :before-close="handleClose" :close-on-click-modal="false" @onOk="onOk" @onCancel="handleClose">
<div class="dialog_body">
<GLCombiForm :rowNumber="1" class="dialog_search" ref="searchRef" :formObj="dialogSearchForm" :formData="dialogFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm>
<!-- <GLCombiForm :rowNumber="1" class="dialog_search" ref="searchRef" :formObj="dialogSearchForm" :formData="dialogFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm> -->
<div class="dialog_table">
<GLTable v-if="showTable" :pageSizes="pageSizes" ref="tableRef" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun" :searchForm="dialogSearchForm" :tableParams="tableParams" :getListApi="getListApi">
<GLTable v-if="showTable" :hasPage="false" :pageSizes="pageSizes" ref="tableRef" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun" :searchForm="dialogSearchForm" :tableParams="tableParams" :getListApi="getListApi">
<div slot="spreadPrice" slot-scope="scope">
<span :style="{ color: Number(scope.scope.lineationPrice - scope.scope.costPrice) <= 0 ? '#eb4e4e' : '#666666' }">{{ Number(Number(scope.scope.lineationPrice - scope.scope.costPrice).toFixed(1)) }}</span>
</div>
......@@ -24,6 +24,10 @@ export default {
selectedList: {
type: Array,
default: ()=> []
},
goodsId:{
type: String,
default: ''
}
},
data() {
......@@ -51,10 +55,10 @@ export default {
isClear: true
}
],
getListApi: this.$apis.common.getMerchantList,
getListApi: this.$apis.goods.getMerchantListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableParams: {
listName: 'list',
listName: 'merchantList',
mutiSelectName: 'goodsIndex',
mutiSelectUniqueKey: 'id',
tableOption: false,
......@@ -65,7 +69,7 @@ export default {
},
{
label: '商户id',
prop: 'merchantNo'
prop: 'merchantId'
},
]
}
......@@ -86,6 +90,14 @@ export default {
}
this.handleOk()
},
beforeSearchFn(){
return new Promise(resolve => {
this.dialogSearchForm = {
id: this.goodsId
}
resolve()
})
},
onOk() {
let list = this.$refs.tableRef.mutiSelectArr[this.tableParams.mutiSelectName] || []
// for (let i = 0; i < this.selectedList.length; i++) {
......
......@@ -153,7 +153,7 @@
{
label: '商品分类',
name: 'channelName',
type: 'select'
type: 'input'
},
],
getListApi: this.$apis.goods.getGoodsListApi,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!