Commit 6ad06615 by zhangquan

定向礼包增加集团礼包

1 parent 6f62a239
......@@ -140,4 +140,13 @@ const getQrcode = params => {
})
}
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi, templateModal, getghDirectionalGiftListApi, toVoidGift, getQrcode }
const getGroupGift = params => {
params.method = 'scrm.api.coupon.group.directional.gift.list'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi, templateModal, getghDirectionalGiftListApi, toVoidGift, getQrcode, getGroupGift }
......@@ -28,7 +28,10 @@
</div>
</div>
<div slot="name" slot-scope="scope">
<p class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.name }}</p>
<div class="gift-name">
<div class="group-label" v-if="scope.scope.merchantType==2">集团</div>
<div class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.name }}</div>
</div>
</div>
<!-- <div style="display: flex;align-items: center;" slot="approveStatus" slot-scope="scope">
<div class="approve-status" :style="{ 'background-color': approvalStatusColor[scope.scope.approveStatus - 1] }"></div>
......@@ -82,7 +85,10 @@ export default {
},
attrs: {
type: 'text',
fn: '编辑'
fn: '编辑',
disabled:row=>{
return row.scope.merchantType==2 && row.scope.receivedStock
}
},
listeners: {
click: row => this.handleEdit('edit', row.scope)
......@@ -544,6 +550,26 @@ export default {
}
}
}
.gift-name{
display: flex;
align-items: center;
.group-label{
width: 42px;
height: 20px;
line-height: 20px;
text-align: center;
background: rgba(255,101,61,0.15);
border-radius: 4px;
margin-right: 4px;
font-size: 12px;
color: #FF653D;
}
.cursor-pointer{
height: 20px;
line-height: 20px;
}
}
.gift-detail {
padding:0 200px 0 10px;
......
......@@ -22,15 +22,18 @@
<!-- 表格区域 开始 -->
<GLTable ref="receivedGiftListRef" :getListApi="getListApi" :hasNum="false" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<span slot="directionalGiftName" slot-scope="scope">
<el-tooltip effect="dark" :content="scope.scope.directionalGiftName" placement="top-start">
<p class="gift-name" @click="handleDetail(scope.scope)">
{{ scope.scope.directionalGiftName }}
</p>
</el-tooltip>
<span v-if="scope.scope.receiveStatus == 2" class="void-label">已作废</span>
<el-tooltip effect="dark" :content="scope.scope.cancelReason" placement="top-start">
<p class="void-reason" v-if="scope.scope.receiveStatus == 2">作废原因:{{ scope.scope.cancelReason || '--' }}</p>
</el-tooltip>
<div class="gift-name-slot">
<div class="group-label" v-if="scope.scope.merchantType==2">集团</div>
<el-tooltip effect="dark" :content="scope.scope.directionalGiftName" placement="top-start">
<p class="gift-name" @click="handleDetail(scope.scope)">
{{ scope.scope.directionalGiftName }}
</p>
</el-tooltip>
<span v-if="scope.scope.receiveStatus == 2" class="void-label">已作废</span>
<el-tooltip effect="dark" :content="scope.scope.cancelReason" placement="top-start">
<p class="void-reason" v-if="scope.scope.receiveStatus == 2">作废原因:{{ scope.scope.cancelReason || '--' }}</p>
</el-tooltip>
</div>
</span>
<div slot="giftInfo" slot-scope="scope">
<GLTable class="secondTable" ref="giftListRef" :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="giftParams" :tableData="scope.scope | filterTable" @setTableFinishFun="setGiftTableFinishFun"></GLTable>
......@@ -279,7 +282,7 @@ export default {
{
label: '礼包名称',
width: 200,
width: 300,
addHtml: 'directionalGiftName'
},
{
......@@ -523,6 +526,22 @@ export default {
.secondTable {
padding-left: 10px;
}
.group-label{
width: 42px;
height: 20px;
line-height: 20px;
text-align: center;
background: rgba(255,101,61,0.15);
border-radius: 4px;
margin-right: 4px;
font-size: 12px;
color: #FF653D;
flex-shrink: 0;
}
.gift-name-slot{
display: flex;
align-items: center;
}
.gift-name {
color: #5850ff;
margin: 0;
......@@ -542,7 +561,7 @@ export default {
text-align: center;
line-height: 18px;
background: #eeeded;
margin-top: 2px;
flex-shrink: 0;
}
.void-reason {
font-size: 10px;
......@@ -551,7 +570,6 @@ export default {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin: 4px 0 0;
}
.void-dialog {
/deep/ .el-dialog__body {
......
......@@ -25,7 +25,7 @@
</div>
</div>
</div>
<div slot="merchantSlot">
<div class="merchant-radio" slot="merchantSlot">
<el-checkbox-group v-model="editForm.merchantList">
<el-checkbox v-for="item in merchantList" :label="item.merchantNo" :key="item.merchantNo">{{item.merchantName}}</el-checkbox>
</el-checkbox-group>
......@@ -289,17 +289,17 @@ export default {
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
let couponCreateRequests = [],storeCreateRequestList = [];
let couponCreateRequestList = [],storeCreateRequestList = [];
this.editForm.couponList.forEach(item => {
const {id:couponId, couponAmount, couponAnticipatedCost} = item
couponCreateRequests.push({couponId, couponAmount, couponAnticipatedCost})
couponCreateRequestList.push({couponId, couponAmount, couponAnticipatedCost})
})
this.editForm.merchantList.forEach(item=>{
let target = this.merchantList.find(ele => ele.merchantNo == item)
target && storeCreateRequestList.push({merchantId: target.merchantNo, merchantName:target.merchantName})
})
let params = {
couponCreateRequests,
couponCreateRequestList,
name: this.editForm.name,
storeCreateRequestList
}
......@@ -362,7 +362,10 @@ export default {
.marketing.edit-gift .select-merchant {
width: 98%;
}
.edit-container{
height: calc(100vh - 156px);
min-height: 700px;
}
.marketing.edit-gift {
// 礼包
.gift-block {
......@@ -416,6 +419,15 @@ export default {
}
}
}
.merchant-radio{
width: 878px;
max-height: 98px;
overflow: auto;
border: 1px solid #E5E5E5;
box-sizing: border-box;
border-radius: 4px;
padding: 10px 20px;
}
// 发放员工
.sale-select {
display: flex;
......
......@@ -24,8 +24,13 @@
</div>
</div>
</div>
<div class="merchant-radio" slot="merchantSlot">
<el-checkbox-group v-model="editForm.merchantList">
<el-checkbox v-for="item in merchantList" :label="item.merchantNo" :key="item.merchantNo">{{item.merchantName}}</el-checkbox>
</el-checkbox-group>
</div>
</glsx-combi-form>
<div class="approval_note_container">
<!-- <div class="approval_note_container">
<div class="line"></div>
<div class="note_container">
<div class="left">
......@@ -37,7 +42,7 @@
<span class="">修改人:{{ editForm.updatedBy }}</span>
</div>
</div>
</div>
</div> -->
</div>
<GLFooter>
<el-button @click="handleCancel" size="medium">取消</el-button>
......@@ -66,8 +71,10 @@ export default {
name: '',
// 优惠券类型(discountType) 1:满减券,2:折扣券,3:代金券,4:兑换券,5:购车代金券,6:商品折扣券,7:会员服务
// 优惠券状态(status):1:未生效,2:生效中,3:已失效
couponList: []
couponList: [],
merchantList:[]
},
merchantList:[],
totalEstimatedCost: '',
orderShow: ['service', 'cash', 'discount', 'exchange'],
numToCoupon: {
......@@ -105,6 +112,7 @@ export default {
editRule: {
name: [{ required: true, message: '请输入礼包名称', trigger: 'change' }],
couponList: [{ required: true, message: '请选择礼包', trigger: 'change' }],
merchantList: [{ required: true, message: '请选择门店', trigger: 'change' }],
},
isEdit: true,
editFormData: [
......@@ -118,6 +126,11 @@ export default {
name: 'couponList',
addHtml: 'couponListBlock'
},
{
label: '下发门店',
name: 'merchantList',
addHtml: 'merchantSlot'
}
],
}
},
......@@ -126,15 +139,29 @@ export default {
this.routeInfo = this.$route.query
this.loading = true
this.getInfo()
this.getMerchant()
},
methods: {
getMerchant(){
const { session } = this.$globalState || {}
const param = {
supMerchantNo: session.merchantId,
merchantAccountLevel: 4
}
this.$apis.groupGiftBag.getMerchantListApi(param).then(res => {
this.merchantList = res || []
this.editForm.merchantList = res.map(item => item.merchantNo)
})
},
getInfo() {
this.$apis.giftBag
this.$apis.groupGiftBag
.getGiftInfoApi({ id: this.routeInfo.id })
.then(res => {
res.data.createdDate = dayjs(res.data.createdDate).format('YYYY-MM-DD HH:mm:ss')
res.data.updatedDate = dayjs(res.data.updatedDate).format('YYYY-MM-DD HH:mm:ss')
res.data.couponList = res.data.couponDTOList
res.data.merchantList = res?.data?.storeList.map(item => item.merchantId)
this.editForm = res.data
this.recoveryCoupon()
this.recoveryTotalPrice()
......@@ -169,7 +196,7 @@ export default {
handleCancel() {
this.$router.push({
path: '/giftBag/index',
path: '/groupGiftBag/index',
query: { type: this.routeInfo.type }
})
}
......
......@@ -132,10 +132,6 @@ export default {
addHtml: 'name'
},
{
label: '礼包明细',
prop: 'name',
},
{
label: '预估成本/元',
prop: 'anticipatedCost',
formatter: cellValue => {
......@@ -157,7 +153,7 @@ export default {
label: '已领取',
prop: 'stock',
formatter: cellValue => {
return cellValue.receivedStock || '0'
return cellValue.receivedAmount || '0'
}
}
]
......
<!-- 选择员工弹窗 -->
<template>
<GLDialog class="muti-pro" :close-on-click-modal="false" bigTitle="选择员工" mode="big" :before-close="handleMutiSelectClose" :visible.sync="isMutiSelectVisible" @onOk="handleMutiSelectConfirm" @onCancel="handleMutiSelectClose" v-loading="loading">
<!-- <div class="noproDiv" v-show="!staffList.length && fnCallBack">
<img src="@/assets/noPro.png" />
<p class="noproP">系统暂无已创建的员工</p>
</div> -->
<div>
<slot name="search"></slot>
<GLTable v-loading="loading" ref="mutiProRef" :tableData="staffList" :pageConf="pageConf" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList"></GLTable>
</div>
</GLDialog>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'selectStaffDialog',
data() {
return {
// 表格组件
userInfo: {},
staffList: [],
selectList: [],
fnCallBack: false,
url: url,
loading: true,
tableSearchForm: {
staffName: ''
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'userOneId',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '部门',
prop: 'departmentName'
},
{
label: '跟进员工类型',
prop: 'followerTypeName'
}
]
}
}
},
props: {
isMutiSelectVisible: {
type: Boolean,
default: false
},
searchForm: {
type: Object,
default: () => {}
},
selectedStaffList: {
type: Array,
default: () => []
}
},
mounted() {
this.userInfo = this.$globalState.session
this.selectList = JSON.parse(JSON.stringify(this.selectedStaffList))
this.selectList.map(item => (item.userOneId = item.staffUUID))
this.getList({}, true)
},
methods: {
getList(page, isResetPage = false) {
var params = {
...this.searchForm,
pageNum: isResetPage ? 1 : this.$refs.mutiProRef.page.pageNum,
pageSize: isResetPage ? 10 : this.$refs.mutiProRef.page.pageSize
}
this.loading = true
this.$apis.giftBag.getFollowerStaffListApi(params).then(res => {
// 重置分页组件
if (this.$refs.mutiProRef && isResetPage) {
this.$refs.mutiProRef.page.pageNum = 1
this.$refs.mutiProRef.page.pageSize = 10
}
this.staffList = res.data
this.loading = false
this.fnCallBack = true
this.$refs.mutiProRef.tableTotal = res.count
this.$nextTick(() => {
this.recoverySelected()
})
this.$refs.mutiProRef.tableHeightValues = '50vh'
})
},
recoverySelected() {
if (this.selectedStaffList && this.selectedStaffList.length) {
this.selectedStaffList.forEach(row => {
row.userOneId = row.staffUUID
this.$nextTick(() => {
let idx = this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.userOneId == row.staffUUID)
if (idx > -1) {
try {
this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data[idx], true)
let id = this.selectList.findIndex(item => item.staffUUID == row.staffUUID)
if (id > -1) this.selectList.splice(id, 1)
} catch (err) {
console.log(err)
}
}
})
})
}
},
handleMutiSelectConfirm() {
var selectedData = [...this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName], ...this.selectList]
this.$emit('handleMutiSelectConfirm', selectedData)
},
handleMutiSelectClose() {
this.$emit('handleMutiSelectClose')
}
}
}
</script>
<style>
.muti-pro .m-t-10 {
margin-top: 10px;
}
.muti-pro .noproP {
width: 100%;
height: 20px;
font-family: PingFangSC-Medium;
font-size: 16px;
color: #666666;
line-height: 20px;
font-weight: 500;
text-align: center;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!