Commit 06a1f751 by zhangquan

更换接口

1 parent 0dfdb937
...@@ -65,11 +65,22 @@ const getGoodsDetail = params => { ...@@ -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 { export default {
getGoodsListApi, getGoodsListApi,
updateGoodsStatusApi, updateGoodsStatusApi,
delGoodsApi, delGoodsApi,
getCarlifeGoodsApi, getCarlifeGoodsApi,
addGoodsApi, addGoodsApi,
getGoodsDetail getGoodsDetail,
getMerchantListApi
} }
\ No newline at end of file \ No newline at end of file
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</GLFooter> </GLFooter>
<selectCarDialog v-if="carDialogVisible" :echoData="vehicleSeriesRequestList" @handleClose="handleCarSeriesClose" @handleConfirm="handleConfirm" :dialogVisible="carDialogVisible"></selectCarDialog> <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> <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> </div>
</template> </template>
<script> <script>
...@@ -297,6 +297,7 @@ export default { ...@@ -297,6 +297,7 @@ export default {
this.goodsVisible = false this.goodsVisible = false
}, },
handleGoodsConfirm(e){ handleGoodsConfirm(e){
if(this.formObj.smartcarlifeInfoId!=e?.id) this.merchantRequestList = []
let { id: smartcarlifeInfoId, goodsName, goodsImage, minSellPrice, retailPrice } = e || {} let { id: smartcarlifeInfoId, goodsName, goodsImage, minSellPrice, retailPrice } = 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
...@@ -327,13 +328,14 @@ export default { ...@@ -327,13 +328,14 @@ export default {
this.handleCarSeriesClose() this.handleCarSeriesClose()
}, },
confirmDialog(e){ confirmDialog(e){
console.log(e)
this.merchantRequestList = e || [] this.merchantRequestList = e || []
this.closeDialog() this.closeDialog()
}, },
closeDialog(){ closeDialog(){
if(!this.merchantDialogVisible && !this.formObj.smartcarlifeInfoId){
return this.$message.error('请先选择商品')
}
this.merchantDialogVisible = !this.merchantDialogVisible this.merchantDialogVisible = !this.merchantDialogVisible
console.log(this.merchantDialogVisible)
}, },
handleDel(row) { handleDel(row) {
const idx = this.merchantRequestList.findIndex(item => item.id == row.id) const idx = this.merchantRequestList.findIndex(item => item.id == row.id)
...@@ -354,13 +356,17 @@ export default { ...@@ -354,13 +356,17 @@ export default {
delete obj.coverList delete obj.coverList
let merchantRequestList = this.merchantRequestList.map(item => { let merchantRequestList = this.merchantRequestList.map(item => {
let { merchantNo, merchantId, merchantName, activityPrice } = item let { merchantId, merchantName, activityPrice } = item
merchantId = merchantNo || merchantId
let price = this.formObj.paymentType==1 ? 0 : this.formObj.depositPrice let price = this.formObj.paymentType==1 ? 0 : this.formObj.depositPrice
let retainagePrice = activityPrice - price let retainagePrice = activityPrice - price
activityPrice = activityPrice ? Number(Number(activityPrice*10*10).toFixed(0)) : 0 activityPrice = activityPrice ? Number(Number(activityPrice*10*10).toFixed(0)) : 0
retainagePrice = retainagePrice ? Number(Number(retainagePrice*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 = { const params = {
merchantRequestList, merchantRequestList,
...@@ -373,7 +379,6 @@ export default { ...@@ -373,7 +379,6 @@ export default {
handleSave(){ handleSave(){
this.$refs.baseInfoRef.$refs.formRef.validate(valid => { this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
if(valid){ if(valid){
console.log(this.getParams())
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) {
......
<template> <template>
<GLDialog bigTitle="选择商品优惠券" mode="big" :visible.sync="isVisible" :show-close="true" :before-close="handleClose" :close-on-click-modal="false" @onOk="onOk" @onCancel="handleClose"> <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"> <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"> <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"> <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> <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> </div>
...@@ -24,6 +24,10 @@ export default { ...@@ -24,6 +24,10 @@ export default {
selectedList: { selectedList: {
type: Array, type: Array,
default: ()=> [] default: ()=> []
},
goodsId:{
type: String,
default: ''
} }
}, },
data() { data() {
...@@ -51,10 +55,10 @@ export default { ...@@ -51,10 +55,10 @@ export default {
isClear: true isClear: true
} }
], ],
getListApi: this.$apis.common.getMerchantList, getListApi: this.$apis.goods.getMerchantListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableParams: { tableParams: {
listName: 'list', listName: 'merchantList',
mutiSelectName: 'goodsIndex', mutiSelectName: 'goodsIndex',
mutiSelectUniqueKey: 'id', mutiSelectUniqueKey: 'id',
tableOption: false, tableOption: false,
...@@ -65,7 +69,7 @@ export default { ...@@ -65,7 +69,7 @@ export default {
}, },
{ {
label: '商户id', label: '商户id',
prop: 'merchantNo' prop: 'merchantId'
}, },
] ]
} }
...@@ -86,6 +90,14 @@ export default { ...@@ -86,6 +90,14 @@ export default {
} }
this.handleOk() this.handleOk()
}, },
beforeSearchFn(){
return new Promise(resolve => {
this.dialogSearchForm = {
id: this.goodsId
}
resolve()
})
},
onOk() { onOk() {
let list = this.$refs.tableRef.mutiSelectArr[this.tableParams.mutiSelectName] || [] let list = this.$refs.tableRef.mutiSelectArr[this.tableParams.mutiSelectName] || []
// for (let i = 0; i < this.selectedList.length; i++) { // for (let i = 0; i < this.selectedList.length; i++) {
......
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
{ {
label: '商品分类', label: '商品分类',
name: 'channelName', name: 'channelName',
type: 'select' type: 'input'
}, },
], ],
getListApi: this.$apis.goods.getGoodsListApi, 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!