Commit 220362d3 by 前端

Merge branch 'SAAS+V4.41' into 'master'

上线合并

See merge request !2
2 parents a6235d8f 70bb3123
...@@ -82,6 +82,17 @@ const commodityAddSeviceMerchant = function(params) { ...@@ -82,6 +82,17 @@ const commodityAddSeviceMerchant = function(params) {
sign: true sign: true
}) })
} }
// 分页查找园区店
const pageServiceMerchantRef = function(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.servicemerchantref.pageRef`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取核销人 // 获取核销人
const getDistinctColum = function(params) { const getDistinctColum = function(params) {
...@@ -118,4 +129,4 @@ const exportCustomerCoupon = params => { ...@@ -118,4 +129,4 @@ const exportCustomerCoupon = params => {
returnAll: true returnAll: true
}) })
} }
export default { getListApi, getDetailListApi, getTypeList, addCouponApi, updateCouponApi, deleteCouponApi, commodityAddSeviceMerchant, getDistinctColum, exportCoupon, exportCustomerCoupon } export default { getListApi, getDetailListApi, getTypeList, addCouponApi, updateCouponApi, deleteCouponApi, commodityAddSeviceMerchant, getDistinctColum, exportCoupon, exportCustomerCoupon,pageServiceMerchantRef }
<!-- 关联门店弹窗 --> <!-- 关联门店弹窗 -->
<template> <template>
<GLDialog title="关联门店" <GLDialog title="关联门店" :visible.sync="relateStoreVisible" okText="关联" @onOk="handleRelateStoreConfirm" @onCancel="handleRelateStoreClose" class="relateStore">
:visible.sync="relateStoreVisible"
okText="关联"
@onOk="handleRelateStoreConfirm"
@onCancel="handleRelateStoreClose"
class="relateStore">
<slot /> <slot />
<el-row class="tableCon"> <el-row class="tableCon">
<!-- <el-col :span="12"> --> <!-- <el-col :span="12"> -->
<div class="tableBox"> <div class="tableBox">
<el-table ref="seletingTable" <el-table ref="seletingTable" :data="selectingData" height="464px" class="table" border @select="handleChange" @select-all="handleAll">
:data="selectingData" <el-table-column type="selection" width="55" align="center" :selectable="selectable" />
height="464px" <el-table-column v-if="sourcePage != 'serviceStore'" prop="yqMerchantName" label="园区店名称" align="center">
class="table"
border
@select="handleChange"
@select-all="handleAll">
<el-table-column type="selection"
width="55"
align="center"
:selectable="selectable" />
<el-table-column v-if="sourcePage != 'serviceStore'"
prop="yqMerchantName"
label="园区店名称"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span <span :class="{ red: !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage) }">{{ scope.row.yqMerchantName }}</span>
:class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.yqMerchantName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="merchantName" <el-table-column prop="merchantName" label="4S店名称" align="center">
label="4S店名称"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span <span :class="{ red: !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage) }">{{ scope.row.merchantName }}</span>
:class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.merchantName }}</span> <el-tooltip v-if="!scope.row.isSetUpgradeSettleRule" popper-class="tooltip-class" effect="dark" content="该门店无配置财务分润规则,无法关联!" placement="top">
<el-tooltip v-if="!scope.row.isSetUpgradeSettleRule" <span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)" class="tip-icon">?</span>
popper-class="tooltip-class"
effect="dark"
content="该门店无配置财务分润规则,无法关联!"
placement="top">
<span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)"
class="tip-icon">?</span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination small <el-pagination small background @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pageSize" layout="total, prev, pager, next" :total="total" />
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total" />
</div> </div>
<!-- </el-col> --> <!-- </el-col> -->
<!-- <el-col :span="12"> --> <!-- <el-col :span="12"> -->
<el-table :data="selectedData" <el-table :data="selectedData" class="table tableBox" border height="464px">
class="table tableBox" <el-table-column v-if="sourcePage != 'serviceStore'" prop="yqMerchantName" label="园区店名称" align="center" />
border <el-table-column prop="merchantName" label="4S店名称" align="center" />
height="464px"> <el-table-column label="删除" align="center" width="50px">
<el-table-column v-if="sourcePage != 'serviceStore'"
prop="yqMerchantName"
label="园区店名称"
align="center" />
<el-table-column prop="merchantName"
label="4S店名称"
align="center" />
<el-table-column label="删除"
align="center"
width="50px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button class="el-icon-delete" <el-button class="el-icon-delete" @click="handleDelete(scope.row)" type="text" />
@click="handleDelete(scope.row)"
type="text" />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -110,7 +66,7 @@ export default { ...@@ -110,7 +66,7 @@ export default {
}, },
storeApi: { storeApi: {
type: Function, type: Function,
default: () => { } default: () => {}
}, },
storeSelected: { storeSelected: {
type: Array, type: Array,
...@@ -118,7 +74,7 @@ export default { ...@@ -118,7 +74,7 @@ export default {
}, },
storeSearchForm: { storeSearchForm: {
type: Object, type: Object,
default: () => { } default: () => {}
} }
// 去掉表格中某些字段 // 去掉表格中某些字段
// noTableField: { // noTableField: {
...@@ -154,6 +110,16 @@ export default { ...@@ -154,6 +110,16 @@ export default {
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize pageSize: this.pageSize
}).then(res => { }).then(res => {
res.list = res.list.map(item => {
let yqMerchant = item?.sceneList[0]?.yqMerchant || {}
// console.log(yqMerchant)
item = {
yqMerchantName: yqMerchant?.merchantName,
yqMerchantId: yqMerchant?.merchantId,
...item
}
return item
})
this.selectingData = res.list this.selectingData = res.list
this.total = res.total this.total = res.total
this.$nextTick(() => { this.$nextTick(() => {
...@@ -163,17 +129,15 @@ export default { ...@@ -163,17 +129,15 @@ export default {
}, },
handleChange(selection, row) { handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.merchantId === row.merchantId) var addOrDelete = !!selection.find(item => item.merchantId === row.merchantId)
addOrDelete addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId))
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId))
}, },
handleAll(selection) { handleAll(selection) {
this.selectingData.forEach(item => { this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId) var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId)
var isServed = item.hasOwnProperty('beServed') ? item.beServed : false var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && (isExit === -1) && !isServed) { if (selection.length && isExit === -1 && !isServed) {
this.selectedData.push(item) this.selectedData.push(item)
} else if (!selection.length && (isExit !== -1)) { } else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1) this.selectedData.splice(isExit, 1)
} }
}) })
...@@ -194,7 +158,6 @@ export default { ...@@ -194,7 +158,6 @@ export default {
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.relateStore .table { .relateStore .table {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<GLDialog :bigTitle="!couponInfo ? '新增精品礼券' : '编辑精品礼券'" mode="big" :visible.sync="couponsVisible" :before-close="handleAdd" @onCancel="handleAdd" @onOk="handleAddConfirm"> <GLDialog :bigTitle="!couponInfo ? '新增精品礼券' : '编辑精品礼券'" mode="big" :visible.sync="couponsVisible" :before-close="handleAdd" @onCancel="handleAdd" @onOk="handleAddConfirm">
<el-form ref="couponAddForm" :model="couponsForm" :rules="formRules" label-width="140px"> <el-form ref="couponAddForm" :model="couponsForm" :rules="formRules" label-width="140px">
<el-form-item label="精品礼券名称:" prop="couponName"> <el-form-item label="精品礼券名称:" prop="couponName">
<el-input style="width: 216px;" v-model="couponsForm.couponName" placeholder="给礼券起个名字" maxlength="20" /> <el-input style="width: 216px" v-model="couponsForm.couponName" placeholder="给礼券起个名字" maxlength="20" />
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="couponType"> <el-form-item label="类型" prop="couponType">
<el-select :disabled="couponInfo" v-model="couponsForm.couponType"> <el-select :disabled="couponInfo" v-model="couponsForm.couponType">
...@@ -13,12 +13,8 @@ ...@@ -13,12 +13,8 @@
</el-form-item> </el-form-item>
<el-form-item label="是否收费"> <el-form-item label="是否收费">
<el-radio-group :disabled="couponInfo" v-model="couponsForm.chargeFlag"> <el-radio-group :disabled="couponInfo" v-model="couponsForm.chargeFlag">
<el-radio label="N"> <el-radio label="N">免费</el-radio>
免费 <el-radio label="Y" disabled>收费</el-radio>
</el-radio>
<el-radio label="Y" disabled>
收费
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="礼券说明:" prop="remark"> <el-form-item label="礼券说明:" prop="remark">
...@@ -28,21 +24,23 @@ ...@@ -28,21 +24,23 @@
<el-form-item label="门店名称:"> <el-form-item label="门店名称:">
<span>{{ couponInfo.merchantName }}</span> <span>{{ couponInfo.merchantName }}</span>
</el-form-item> </el-form-item>
<el-form-item label="券码数量:" prop="amount" :rules="[ <el-form-item
label="券码数量:"
prop="amount"
:rules="[
{ required: true, message: '请输入券码数量', trigger: 'blur' }, { required: true, message: '请输入券码数量', trigger: 'blur' },
{ validator: validateAccount, trigger: 'blur' } { validator: validateAccount, trigger: 'blur' }
]"> ]"
>
<el-input-number v-model="couponsForm.amount" :min="1" :max="99999" size="mini" /> <el-input-number v-model="couponsForm.amount" :min="1" :max="99999" size="mini" />
</el-form-item> </el-form-item>
</template> </template>
<el-form-item v-if="!couponInfo" label="批量发放门店:" prop="merchantCouponDTOList" :rules="[{ required: true, message: '请选择门店', trigger: 'change' }]"> <el-form-item v-if="!couponInfo" label="批量发放门店:" prop="merchantCouponDTOList" :rules="[{ required: true, message: '请选择门店', trigger: 'change' }]">
<el-button @click="handleAddStore"> <el-button @click="handleAddStore">添加</el-button>
添加
</el-button>
<selected-show-table :table-data="couponsForm.merchantCouponDTOList" @handleTableStoreDelete="handleTableStoreDelete"> <selected-show-table :table-data="couponsForm.merchantCouponDTOList" @handleTableStoreDelete="handleTableStoreDelete">
<span slot="num" slot-scope="scope"> <span slot="num" slot-scope="scope">
<el-input-number v-model="couponsNumList[scope.scope.index]" :min="1" :max="99999" size="mini" @change="handleNumChange(scope.scope.index)" /> <el-input-number v-model="couponsNumList[scope.scope.index]" :min="1" :max="99999" size="mini" @change="handleNumChange(scope.scope.index)" />
<span class="car-error-txt" style="display: inline-block; padding-top: 2px;" v-show="!couponsNumList[scope.scope.index]">请输入数量</span> <span class="car-error-txt" style="display: inline-block; padding-top: 2px" v-show="!couponsNumList[scope.scope.index]">请输入数量</span>
</span> </span>
</selected-show-table> </selected-show-table>
</el-form-item> </el-form-item>
...@@ -57,9 +55,7 @@ ...@@ -57,9 +55,7 @@
<el-form-item label="4S店:"> <el-form-item label="4S店:">
<el-input v-model.trim="storeSearchForm.merchantName" placeholder="4S店名称" @keydown.native="handleStoreInput" clearable /> <el-input v-model.trim="storeSearchForm.merchantName" placeholder="4S店名称" @keydown.native="handleStoreInput" clearable />
</el-form-item> </el-form-item>
<el-button type="primary" @click="handleSearchStore"> <el-button type="primary" @click="handleSearchStore">搜索</el-button>
搜索
</el-button>
</el-form> </el-form>
</el-row> </el-row>
</relate-store-dialog> </relate-store-dialog>
...@@ -100,11 +96,12 @@ export default { ...@@ -100,11 +96,12 @@ export default {
relateStoreVisible: false, relateStoreVisible: false,
sourcePage: 'coupons', sourcePage: 'coupons',
storeSelected: [], storeSelected: [],
storeApi: this.$apis.coupons.commodityAddSeviceMerchant, storeApi: this.$apis.coupons.pageServiceMerchantRef,
// storeApi: this.$apis.coupons.getSimpleMerchantList, // storeApi: this.$apis.coupons.getSimpleMerchantList,
storeSearchForm: { storeSearchForm: {
yqMerchantName: '', yqMerchantName: '',
merchantName: '' merchantName: '',
scene: 1
}, },
// 基本数据 // 基本数据
baseData: { baseData: {
...@@ -129,7 +126,7 @@ export default { ...@@ -129,7 +126,7 @@ export default {
// }, // },
couponInfo: { couponInfo: {
type: Object, type: Object,
default: () => { } default: () => {}
} }
}, },
...@@ -193,7 +190,7 @@ export default { ...@@ -193,7 +190,7 @@ export default {
this.relateCloseReset() this.relateCloseReset()
}, },
handleStoreInput(e) { handleStoreInput(e) {
(e.keyCode === 13) && this.handleSearchStore() e.keyCode === 13 && this.handleSearchStore()
}, },
handleSearchStore() { handleSearchStore() {
this.$refs.relateStore.handleCurrentChange(1) this.$refs.relateStore.handleCurrentChange(1)
...@@ -277,7 +274,6 @@ export default { ...@@ -277,7 +274,6 @@ export default {
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
</style> </style>
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
<el-table-column type="selection" width="55" align="center" :selectable="selectable" /> <el-table-column type="selection" width="55" align="center" :selectable="selectable" />
<el-table-column v-if="sourcePage != 'serviceStore'" prop="yqMerchantName" label="园区店名称" align="center"> <el-table-column v-if="sourcePage != 'serviceStore'" prop="yqMerchantName" label="园区店名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span :class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.yqMerchantName }}</span> <span :class="{ red: !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage) }">{{ scope.row.yqMerchantName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="merchantName" label="4S店名称" align="center"> <el-table-column prop="merchantName" label="4S店名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span :class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.merchantName }}</span> <span :class="{ red: !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage) }">{{ scope.row.merchantName }}</span>
<el-tooltip v-if="!scope.row.isSetUpgradeSettleRule" popper-class="tooltip-class" effect="dark" content="该门店无配置财务分润规则,无法关联!" placement="top"> <el-tooltip v-if="!scope.row.isSetUpgradeSettleRule" popper-class="tooltip-class" effect="dark" content="该门店无配置财务分润规则,无法关联!" placement="top">
<span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)" class="tip-icon">?</span> <span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)" class="tip-icon">?</span>
</el-tooltip> </el-tooltip>
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
}, },
storeApi: { storeApi: {
type: Function, type: Function,
default: () => { } default: () => {}
}, },
storeSelected: { storeSelected: {
type: Array, type: Array,
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
}, },
storeSearchForm: { storeSearchForm: {
type: Object, type: Object,
default: () => { } default: () => {}
} }
// 去掉表格中某些字段 // 去掉表格中某些字段
// noTableField: { // noTableField: {
...@@ -111,6 +111,16 @@ export default { ...@@ -111,6 +111,16 @@ export default {
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize pageSize: this.pageSize
}).then(res => { }).then(res => {
res.list = res.list.map(item => {
let yqMerchant = item?.sceneList[0]?.yqMerchant || {}
// console.log(yqMerchant)
item = {
yqMerchantName: yqMerchant?.merchantName,
yqMerchantId: yqMerchant?.merchantId,
...item
}
return item
})
this.selectingData = res.list this.selectingData = res.list
this.total = res.total this.total = res.total
this.$nextTick(() => { this.$nextTick(() => {
...@@ -126,9 +136,9 @@ export default { ...@@ -126,9 +136,9 @@ export default {
this.selectingData.forEach(item => { this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId) var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId)
var isServed = item.hasOwnProperty('beServed') ? item.beServed : false var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && (isExit === -1) && !isServed) { if (selection.length && isExit === -1 && !isServed) {
this.selectedData.push(item) this.selectedData.push(item)
} else if (!selection.length && (isExit !== -1)) { } else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1) this.selectedData.splice(isExit, 1)
} }
}) })
...@@ -149,7 +159,6 @@ export default { ...@@ -149,7 +159,6 @@ export default {
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.relateStore .table { .relateStore .table {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!