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) {
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) {
......@@ -118,4 +129,4 @@ const exportCustomerCoupon = params => {
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>
<GLDialog title="关联门店"
:visible.sync="relateStoreVisible"
okText="关联"
@onOk="handleRelateStoreConfirm"
@onCancel="handleRelateStoreClose"
class="relateStore">
<GLDialog title="关联门店" :visible.sync="relateStoreVisible" okText="关联" @onOk="handleRelateStoreConfirm" @onCancel="handleRelateStoreClose" class="relateStore">
<slot />
<el-row class="tableCon">
<!-- <el-col :span="12"> -->
<div class="tableBox">
<el-table ref="seletingTable"
:data="selectingData"
height="464px"
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">
<el-table ref="seletingTable" :data="selectingData" height="464px" 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">
<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>
</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">
<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">
<span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)"
class="tip-icon">?</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">
<span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)" class="tip-icon">?</span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<el-pagination small
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total" />
<el-pagination small background @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pageSize" layout="total, prev, pager, next" :total="total" />
</div>
<!-- </el-col> -->
<!-- <el-col :span="12"> -->
<el-table :data="selectedData"
class="table tableBox"
border
height="464px">
<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">
<el-table :data="selectedData" class="table tableBox" border height="464px">
<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">
<el-button class="el-icon-delete"
@click="handleDelete(scope.row)"
type="text" />
<el-button class="el-icon-delete" @click="handleDelete(scope.row)" type="text" />
</template>
</el-table-column>
</el-table>
......@@ -110,7 +66,7 @@ export default {
},
storeApi: {
type: Function,
default: () => { }
default: () => {}
},
storeSelected: {
type: Array,
......@@ -118,7 +74,7 @@ export default {
},
storeSearchForm: {
type: Object,
default: () => { }
default: () => {}
}
// 去掉表格中某些字段
// noTableField: {
......@@ -154,6 +110,16 @@ export default {
currentPage: this.currentPage,
pageSize: this.pageSize
}).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.total = res.total
this.$nextTick(() => {
......@@ -163,17 +129,15 @@ export default {
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.merchantId === row.merchantId)
addOrDelete
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId))
addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId))
},
handleAll(selection) {
this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId)
var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && (isExit === -1) && !isServed) {
if (selection.length && isExit === -1 && !isServed) {
this.selectedData.push(item)
} else if (!selection.length && (isExit !== -1)) {
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
......@@ -194,7 +158,6 @@ export default {
}
}
}
</script>
<style lang="scss">
.relateStore .table {
......
......@@ -4,7 +4,7 @@
<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-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 label="类型" prop="couponType">
<el-select :disabled="couponInfo" v-model="couponsForm.couponType">
......@@ -13,12 +13,8 @@
</el-form-item>
<el-form-item label="是否收费">
<el-radio-group :disabled="couponInfo" v-model="couponsForm.chargeFlag">
<el-radio label="N">
免费
</el-radio>
<el-radio label="Y" disabled>
收费
</el-radio>
<el-radio label="N">免费</el-radio>
<el-radio label="Y" disabled>收费</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="礼券说明:" prop="remark">
......@@ -28,21 +24,23 @@
<el-form-item label="门店名称:">
<span>{{ couponInfo.merchantName }}</span>
</el-form-item>
<el-form-item label="券码数量:" prop="amount" :rules="[
<el-form-item
label="券码数量:"
prop="amount"
:rules="[
{ required: true, message: '请输入券码数量', trigger: 'blur' },
{ validator: validateAccount, trigger: 'blur' }
]">
]"
>
<el-input-number v-model="couponsForm.amount" :min="1" :max="99999" size="mini" />
</el-form-item>
</template>
<el-form-item v-if="!couponInfo" label="批量发放门店:" prop="merchantCouponDTOList" :rules="[{ required: true, message: '请选择门店', trigger: 'change' }]">
<el-button @click="handleAddStore">
添加
</el-button>
<el-button @click="handleAddStore">添加</el-button>
<selected-show-table :table-data="couponsForm.merchantCouponDTOList" @handleTableStoreDelete="handleTableStoreDelete">
<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)" />
<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>
</selected-show-table>
</el-form-item>
......@@ -57,9 +55,7 @@
<el-form-item label="4S店:">
<el-input v-model.trim="storeSearchForm.merchantName" placeholder="4S店名称" @keydown.native="handleStoreInput" clearable />
</el-form-item>
<el-button type="primary" @click="handleSearchStore">
搜索
</el-button>
<el-button type="primary" @click="handleSearchStore">搜索</el-button>
</el-form>
</el-row>
</relate-store-dialog>
......@@ -100,11 +96,12 @@ export default {
relateStoreVisible: false,
sourcePage: 'coupons',
storeSelected: [],
storeApi: this.$apis.coupons.commodityAddSeviceMerchant,
storeApi: this.$apis.coupons.pageServiceMerchantRef,
// storeApi: this.$apis.coupons.getSimpleMerchantList,
storeSearchForm: {
yqMerchantName: '',
merchantName: ''
merchantName: '',
scene: 1
},
// 基本数据
baseData: {
......@@ -129,7 +126,7 @@ export default {
// },
couponInfo: {
type: Object,
default: () => { }
default: () => {}
}
},
......@@ -193,7 +190,7 @@ export default {
this.relateCloseReset()
},
handleStoreInput(e) {
(e.keyCode === 13) && this.handleSearchStore()
e.keyCode === 13 && this.handleSearchStore()
},
handleSearchStore() {
this.$refs.relateStore.handleCurrentChange(1)
......@@ -277,7 +274,6 @@ export default {
}
}
}
</script>
<style scoped>
</style>
......@@ -9,12 +9,12 @@
<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">
<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>
</el-table-column>
<el-table-column prop="merchantName" label="4S店名称" align="center">
<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">
<span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)" class="tip-icon">?</span>
</el-tooltip>
......@@ -66,7 +66,7 @@ export default {
},
storeApi: {
type: Function,
default: () => { }
default: () => {}
},
storeSelected: {
type: Array,
......@@ -74,7 +74,7 @@ export default {
},
storeSearchForm: {
type: Object,
default: () => { }
default: () => {}
}
// 去掉表格中某些字段
// noTableField: {
......@@ -111,6 +111,16 @@ export default {
currentPage: this.currentPage,
pageSize: this.pageSize
}).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.total = res.total
this.$nextTick(() => {
......@@ -126,9 +136,9 @@ export default {
this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId)
var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && (isExit === -1) && !isServed) {
if (selection.length && isExit === -1 && !isServed) {
this.selectedData.push(item)
} else if (!selection.length && (isExit !== -1)) {
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
......@@ -149,7 +159,6 @@ export default {
}
}
}
</script>
<style lang="scss">
.relateStore .table {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!