Commit f55383b9 by chenwq

定向礼包-详情;联调

1 parent c9a7acde
...@@ -10,4 +10,48 @@ const getFollowerStaffListApi = params => { ...@@ -10,4 +10,48 @@ const getFollowerStaffListApi = params => {
}) })
} }
export default { getFollowerStaffListApi } const getListApi = params => {
params.method = 'scrm.api.coupon.saas.directional.gift.list'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
const giftExportApi = params => {
params.method = 'scrm.api.coupon.saas.directional.gift.list.export'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
//删除
const deleteGiftApi = params => {
params.method = 'scrm.api.coupon.directional.gift.delete'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取详情
const getGiftInfoApi = params => {
params.method = 'scrm.api.coupon.directional.gift.detail'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi }
...@@ -5,7 +5,7 @@ html { ...@@ -5,7 +5,7 @@ html {
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
background-color: #F4F5FA; background-color: #f4f5fa;
} }
.el-range-editor.is-active, .el-range-editor.is-active,
...@@ -25,15 +25,15 @@ html { ...@@ -25,15 +25,15 @@ html {
} }
.live-room .container { .live-room .container {
background: #FFFFFF; background: #ffffff;
margin: 20px 0px; margin: 20px 0px;
padding: 15px 20px; padding: 15px 20px;
box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10); box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.1);
} }
.fr-mr0 { .fr-mr0 {
float: right; float: right;
margin-right: 0!important; margin-right: 0 !important;
} }
//输入框后置文字(如 “元”) //输入框后置文字(如 “元”)
...@@ -66,7 +66,7 @@ html { ...@@ -66,7 +66,7 @@ html {
} }
.ellipsis-2-text:after { .ellipsis-2-text:after {
content: "..."; content: '...';
position: absolute; position: absolute;
bottom: 0; bottom: 0;
right: 15px; right: 15px;
...@@ -84,8 +84,8 @@ html { ...@@ -84,8 +84,8 @@ html {
padding: 10px 16px; padding: 10px 16px;
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
background-color: #E6E9FF; background-color: #e6e9ff;
border: 1px solid #5850FF; border: 1px solid #5850ff;
margin-bottom: 20px; margin-bottom: 20px;
border-radius: 4px; border-radius: 4px;
} }
...@@ -96,7 +96,7 @@ html { ...@@ -96,7 +96,7 @@ html {
} }
.marketing .list-tips .red-txt { .marketing .list-tips .red-txt {
color: #EB4E4E; color: #eb4e4e;
} }
.marketing .wechat-container { .marketing .wechat-container {
...@@ -143,7 +143,7 @@ html { ...@@ -143,7 +143,7 @@ html {
.marketing .table-btns .el-button { .marketing .table-btns .el-button {
padding: 0 0 0 5px; padding: 0 0 0 5px;
margin-left: 5px; margin-left: 5px;
border-left: 1px solid #DCDFE6; border-left: 1px solid #dcdfe6;
border-radius: 0; border-radius: 0;
} }
...@@ -168,7 +168,7 @@ html { ...@@ -168,7 +168,7 @@ html {
} }
.marketing .m-t-8 { .marketing .m-t-8 {
margin-top: 8px; margin-top: 8px;
} }
.marketing .m-t-10 { .marketing .m-t-10 {
...@@ -208,6 +208,23 @@ html { ...@@ -208,6 +208,23 @@ html {
padding-left: 40px; padding-left: 40px;
} }
.marketing .circle {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 6px;
margin-bottom: 3px;
background-color: #5850ff;
}
.marketing .grey {
background-color: #999999;
}
.marketing .txt-grey {
color: #999999;
}
.marketing .txt-center { .marketing .txt-center {
text-align: center; text-align: center;
} }
...@@ -248,7 +265,7 @@ html { ...@@ -248,7 +265,7 @@ html {
font-weight: 600; font-weight: 600;
height: 58px; height: 58px;
line-height: 58px; line-height: 58px;
border-bottom: 1px solid #E7EAEC; border-bottom: 1px solid #e7eaec;
margin: 0 0; margin: 0 0;
padding: 0 0 0 20px; padding: 0 0 0 20px;
} }
...@@ -308,8 +325,8 @@ html { ...@@ -308,8 +325,8 @@ html {
} }
.el-tag { .el-tag {
color: #666!important; color: #666 !important;
font-size: 14px!important; font-size: 14px !important;
} }
.el-tag.el-tag--info { .el-tag.el-tag--info {
...@@ -323,7 +340,6 @@ html { ...@@ -323,7 +340,6 @@ html {
background: transparent !important; background: transparent !important;
} }
/* tab */ /* tab */
.marketing .el-tabs__nav-wrap:after { .marketing .el-tabs__nav-wrap:after {
...@@ -342,10 +358,10 @@ html { ...@@ -342,10 +358,10 @@ html {
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
border: 0 !important; border: 0 !important;
background: #FFFFFF; background: #ffffff;
color: #999999; color: #999999;
border-radius: 0px 4px 0px 0px; border-radius: 0px 4px 0px 0px;
border: 1px solid #F4F6FC; border: 1px solid #f4f6fc;
padding: 0; padding: 0;
} }
...@@ -359,9 +375,9 @@ html { ...@@ -359,9 +375,9 @@ html {
.marketing .el-tabs__item.is-active { .marketing .el-tabs__item.is-active {
color: #5850ff; color: #5850ff;
background: #F4F6FC !important; background: #f4f6fc !important;
border-radius: 4px 0px 0px 0px; border-radius: 4px 0px 0px 0px;
border: 1px solid #F4F6FC !important; border: 1px solid #f4f6fc !important;
} }
.el-message--info { .el-message--info {
...@@ -377,4 +393,4 @@ html { ...@@ -377,4 +393,4 @@ html {
font-size: 16px; font-size: 16px;
} }
/* tab */
\ No newline at end of file \ No newline at end of file
/* tab */
...@@ -68,14 +68,14 @@ function exportFn(url) { ...@@ -68,14 +68,14 @@ function exportFn(url) {
document.body.appendChild(iframe) document.body.appendChild(iframe)
} }
// function aToExport(url) { function aToExport(url) {
// var a = document.createElement('a') var a = document.createElement('a')
// a.setAttribute('id', 'exportToExport') a.setAttribute('id', 'exportToExport')
// a.setAttribute('href', url) a.setAttribute('href', url)
// a.setAttribute('target', '_blank') a.setAttribute('target', '_blank')
// document.body.appendChild(a) document.body.appendChild(a)
// a.click() a.click()
// } }
const orderManageStatusList = [ const orderManageStatusList = [
{ confId: '1', confName: '待付款' }, { confId: '1', confName: '待付款' },
...@@ -204,7 +204,7 @@ export { ...@@ -204,7 +204,7 @@ export {
limitPrice, limitPrice,
getExplorer, getExplorer,
exportFn, exportFn,
// aToExport, aToExport,
orderManageStatusList, orderManageStatusList,
afterSaleStatusList, afterSaleStatusList,
orderSourceList, orderSourceList,
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<span class="combi-form-label" :style="{ width: item.labelWidth ? item.labelWidth + labelPaddingRight + 'px' : '', 'padding-right': isEdit ? '12px' : labelPaddingRight + 'px' }">{{ item.label }}</span> <span class="combi-form-label" :style="{ width: item.labelWidth ? item.labelWidth + labelPaddingRight + 'px' : '', 'padding-right': isEdit ? '12px' : labelPaddingRight + 'px' }">{{ item.label }}</span>
</span> </span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<span v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span>
<div v-else-if="item.type === 'input'"> <div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)"> <el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span> <span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
...@@ -160,7 +161,7 @@ export default { ...@@ -160,7 +161,7 @@ export default {
}, },
formObj: { formObj: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
hasTitle: { hasTitle: {
type: Boolean, type: Boolean,
...@@ -168,16 +169,16 @@ export default { ...@@ -168,16 +169,16 @@ export default {
}, },
formRules: { formRules: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
// 搜索+输入框/搜索组合组件,搜索栏绑值 // 搜索+输入框/搜索组合组件,搜索栏绑值
searchSelectObj: { searchSelectObj: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
mounted() {}, mounted() { },
methods: { methods: {
// 选择框-添加其他属性 // 选择框-添加其他属性
......
...@@ -19,6 +19,7 @@ module.exports = { ...@@ -19,6 +19,7 @@ module.exports = {
}, },
request: { request: {
// baseURL: 'http://scrm.test.glsx.com.cn/', // baseURL: 'http://scrm.test.glsx.com.cn/',
// baseURL: 'http://192.168.2.42:8064/',
baseURL: 'http://scrm.dev.glsx.com.cn/', baseURL: 'http://scrm.dev.glsx.com.cn/',
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
......
...@@ -18,7 +18,7 @@ export const fetchConfig = function(isEnv = true) { ...@@ -18,7 +18,7 @@ export const fetchConfig = function(isEnv = true) {
Object.assign(request, { timeout }) Object.assign(request, { timeout })
return Promise.resolve(cfg) return Promise.resolve(cfg)
} }
// return window.fetch('https://', {}).then(res => res.json()) //return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' }) // request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
return new Http().get('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config') return new Http().get('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config')
} }
......
<!-- 编辑专区 --> <!-- 编辑礼包 -->
<template> <template>
<div class="edit-gift marketing p-t-20 edit-box"> <div class="edit-gift marketing p-t-20 edit-box">
<div class="container edit-container"> <div class="container edit-container">
<p class="edit-title">{{ title }}</p> <p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="remarkName" class="edit-tips m-t-8">可根据备注名称进行查找,仅作内部查看,不展示给客户</div> <div slot="remarkName" class="edit-tips m-t-8">可根据备注名称进行查找,仅作内部查看,不展示给客户</div>
<el-button slot="selectGiftBtn">选择礼包内容</el-button> <el-button slot="selectGiftBtn" @click="handleGiftAdd">选择礼包内容</el-button>
<div slot="couponListBlock" class="gift-block" :style="{ 'margin-left': labelWidth }" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-title">
预估成本:
<span class="price">{{ totalEstimatedCost }}</span>
元
</div>
<div v-for="(item, index) in orderShow" :key="index">
<div class="gift-box" v-show="couponObj[item].list.length">
<div class="gift-label">{{ couponObj[item].label }}:</div>
<div class="gift-content">
<div class="gift-item" v-for="(subItem, subIndex) in couponObj[item].list" :key="subIndex">
<span :class="['circle', subItem.status == '3' ? ' grey' : '']"></span>
<p :class="['gift-info', subItem.status == '3' ? ' txt-grey' : '']">{{ subItem.couponName }} × {{ subItem.couponAmount }}</p>
<p v-show="subItem.status == '3'" class="gift-tips">已失效</p>
<i class="el-icon-delete" @click="handleGiftDelete(item, subIndex)"></i>
</div>
</div>
</div>
</div>
</div>
<div slot="receiveDetails" class="edit-tips m-t-8">客户需要输入该{{ editForm.receiveWay == '0' ? '手机号' : '车架号后6位' }}才能成功领取</div> <div slot="receiveDetails" class="edit-tips m-t-8">客户需要输入该{{ editForm.receiveWay == '0' ? '手机号' : '车架号后6位' }}才能成功领取</div>
<el-button slot="selectStaffBtn" class="el-icon-plus" @click="handleSelectStaff">选择员工</el-button> <el-button slot="selectStaffBtn" class="el-icon-plus" @click="handleSelectStaff">选择员工</el-button>
<div slot="staffListBlock" class="sale-select" :style="{ 'margin-left': labelWidth }" v-show="editForm.staffList && editForm.staffList.length != 0"> <div slot="staffListBlock" class="sale-select" :style="{ 'margin-left': labelWidth }" v-show="editForm.staffList && editForm.staffList.length != 0">
...@@ -19,15 +39,17 @@ ...@@ -19,15 +39,17 @@
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button> <el-button type="default" @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
</div> </div>
<select-gift-dialog></select-gift-dialog>
<select-staff-dialog v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :searchForm="searchStaffForm" :selectedStaffList="selectedStaffList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose"></select-staff-dialog> <select-staff-dialog v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :searchForm="searchStaffForm" :selectedStaffList="selectedStaffList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose"></select-staff-dialog>
</div> </div>
</template> </template>
<script> <script>
import selectStaffDialog from './selectStaffDialog.vue' import selectStaffDialog from './selectStaffDialog.vue'
import selectGiftDialog from './selectStaffDialog.vue'
export default { export default {
name: 'editGift', name: 'editGift',
data() { data() {
...@@ -58,7 +80,61 @@ export default { ...@@ -58,7 +80,61 @@ export default {
receiveWay: '0', receiveWay: '0',
receiveDetails: '', receiveDetails: '',
staffList: [], staffList: [],
couponList: [] // 优惠券类型(discountType) 1:满减券,2:折扣券,3:代金券,4:兑换券,5:购车代金券,6:商品折扣券,7:会员服务
// 优惠券状态(status):1:未生效,2:生效中,3:已失效
couponList: [{
discountType: 3,
couponName: '测试有效期查询券2',
couponAmount: '1',
couponAnticipatedCost: '10',
status: '2'
}, {
discountType: 3,
couponName: '7折代金券',
couponAmount: '1',
couponAnticipatedCost: '20',
status: '3'
}, {
discountType: 3,
couponName: '9.9折代金券',
couponAmount: '5',
couponAnticipatedCost: '15',
status: '2'
}]
},
totalEstimatedCost: '',
orderShow: ['service', 'cash', 'discount', 'exchange'],
numToCoupon: {
2: 'discount',
3: 'cash',
4: 'exchange',
7: 'service'
},
couponObj: {
// 折扣券
discount: {
label: '折扣券',
discountType: 2,
list: []
},
// 代金券
cash: {
label: '代金券',
discountType: 3,
list: []
},
// 兑换券
exchange: {
label: '兑换券',
discountType: 4,
list: []
},
// 会员服务
service: {
label: '会员服务',
discountType: 7,
list: []
}
}, },
editRule: { editRule: {
name: [{ required: true, message: '请输入礼包名称', trigger: 'change' }], name: [{ required: true, message: '请输入礼包名称', trigger: 'change' }],
...@@ -82,7 +158,7 @@ export default { ...@@ -82,7 +158,7 @@ export default {
}, },
trigger: 'change' trigger: 'change'
}] }]
// zoneImg: [{ required: true, message: '请选择专区图片', trigger: 'change' }] // zoneImg: [{ required: true, message: '请选择礼包图片', trigger: 'change' }]
}, },
isEdit: true, isEdit: true,
editFormData: [ editFormData: [
...@@ -102,10 +178,15 @@ export default { ...@@ -102,10 +178,15 @@ export default {
}, },
{ {
label: '礼包设置', label: '礼包设置',
name: '', name: 'couponList',
addHtml: 'selectGiftBtn' addHtml: 'selectGiftBtn'
}, },
{ {
label: '',
name: '',
addHtml: 'couponListBlock'
},
{
label: '领取条件', label: '领取条件',
name: 'receiveWay', name: 'receiveWay',
type: 'radio', type: 'radio',
...@@ -156,7 +237,7 @@ export default { ...@@ -156,7 +237,7 @@ export default {
width: '567px' width: '567px'
} }
// { // {
// label: '专区图片', // label: '礼包图片',
// name: 'zoneImg', // name: 'zoneImg',
// type: 'upload', // type: 'upload',
// limitSize: 10, // limitSize: 10,
...@@ -192,22 +273,31 @@ export default { ...@@ -192,22 +273,31 @@ export default {
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
this.title = this.titleObj[this.routeInfo.addOrEdit] this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : '' this.routeInfo.addOrEdit == 'add' ? '' : this.getInfo()
}, },
methods: { methods: {
getInfo() { getInfo() {
// this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => { this.$apis.giftBag.getGiftInfoApi({ id: this.routeInfo.id }).then(res => {
// this.editForm.name = res.name this.editForm = res.data
// this.editForm.zoneImg = res.zoneImg this.editForm.receiveWay = this.editForm.receiveWay + ''
// this.editForm.merchantList = res.merchantRefList this.recoveryCoupon()
// this.editForm.merchantList.forEach(item => { this.recoveryTotalPrice()
// item.merchantNo = item.merchantId this.$nextTick(() => {
// }) this.editStatus = false
// this.$nextTick(() => { this.loading = false
// this.editStatus = false })
// }) })
// }) },
recoveryCoupon() {
this.orderShow.forEach(item => {
this.couponObj[item].list = []
})
this.editForm.couponList.forEach(item => {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
})
// console.log(this.couponObj)
}, },
receiveWayChange(val) { receiveWayChange(val) {
...@@ -216,6 +306,26 @@ export default { ...@@ -216,6 +306,26 @@ export default {
this.editFormData[receiveDetailsIdx].maxlength = val == '0' ? 11 : 6 this.editFormData[receiveDetailsIdx].maxlength = val == '0' ? 11 : 6
}, },
// 计算预估成本
recoveryTotalPrice() {
this.totalEstimatedCost = 0
this.orderShow.forEach(itme => {
this.couponObj[itme].list.forEach(subItem => {
// 失效券不加入预估成本
if (subItem.status != '3') {
this.totalEstimatedCost = this.totalEstimatedCost + subItem.couponAnticipatedCost * subItem.couponAmount
}
})
})
},
handleGiftAdd() { },
handleGiftDelete(attr, idx) {
this.couponObj[attr].list.splice(idx, 1)
this.recoveryTotalPrice()
},
handleStaffRemove(val, idx) { handleStaffRemove(val, idx) {
this.editForm.staffList.splice(idx, 1) this.editForm.staffList.splice(idx, 1)
this.hasStaffBlock() this.hasStaffBlock()
...@@ -313,6 +423,53 @@ export default { ...@@ -313,6 +423,53 @@ export default {
border: 1px solid #e5e5e5; border: 1px solid #e5e5e5;
} }
.marketing.edit-gift { .marketing.edit-gift {
// 礼包
.gift-block {
width: 567px;
border-radius: 4px;
border: 1px solid #e5e5e5;
.gift-title {
padding: 10px;
border-bottom: 1px solid #e5e5e5;
.price {
font-size: 18px;
}
}
.gift-box {
display: flex;
padding: 10px 0 10px 10px;
.gift-label {
width: 70px;
color: #999999;
text-align: right;
}
.gift-content {
width: calc(100% - 70px);
border-bottom: 1px solid #e5e5e5;
.gift-item {
display: inline-block;
width: 50%;
.gift-info {
display: inline-block;
margin: 0 5px 0 7px;
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
}
}
}
.gift-content:last-child {
border-bottom: 0px;
}
}
}
// 发放员工
.sale-select { .sale-select {
display: flex; display: flex;
align-items: center; align-items: center;
......
<!-- 礼包详情 -->
<template> <template>
<div> <div class="edit-gift marketing p-t-20 edit-box">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form v-loading="loading" class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="couponListBlock" class="gift-block" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-title">
预估成本:
<span class="price">{{ totalEstimatedCost }}</span>
元
</div>
<div v-for="(item, index) in orderShow" :key="index">
<div class="gift-box" v-show="couponObj[item].list.length">
<div class="gift-label">{{ couponObj[item].label }}:</div>
<div class="gift-content">
<div class="gift-item" v-for="(subItem, subIndex) in couponObj[item].list" :key="subIndex">
<span :class="['circle', subItem.status == '3' ? ' grey' : '']"></span>
<p :class="['gift-info', subItem.status == '3' ? ' txt-grey' : '']">{{ subItem.couponName }} × {{ subItem.couponAmount }}</p>
<p v-show="subItem.status == '3'" class="gift-tips">已失效</p>
</div>
</div>
</div>
</div>
</div>
<div slot="receiveDetails">{{ editForm.receiveWay == '0' ? '指定手机号' : '指定车架号后6位' }}:{{ editForm.receiveDetails }}</div>
<div slot="staffListBlock" class="sale-select" v-show="editForm.staffList && editForm.staffList.length != 0">
<div :key="key" class="el-input-tag input-tag-wrapper-detail">
<el-tag effect="plain" type="info" v-for="(tag, idx) in editForm.staffList" :key="idx" :disable-transitions="false" @close="handleStaffRemove(tag, idx)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</glsx-combi-form>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleCancel">返回</el-button>
<el-button type="primary" @click="handleEdit">编辑</el-button>
</div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'giftDetail', name: 'giftDetail',
data() { data() {
return { return {
size: 'small',
title: '礼包详情',
footerLeft: '0',
footerWidth: '0',
loading: false,
editChildRef: 'editChildRef',
routeInfo: {
// add-新增;edit-编辑;detail-详情
addOrEdit: 'add',
id: ''
},
labelWidth: '144px',
editForm: {
name: '',
remarkName: '',
receiveWay: '0',
receiveDetails: '',
staffList: [],
// 优惠券类型(discountType) 1:满减券,2:折扣券,3:代金券,4:兑换券,5:购车代金券,6:商品折扣券,7:会员服务
// 优惠券状态(status):1:未生效,2:生效中,3:已失效
couponList: []
},
totalEstimatedCost: '',
orderShow: ['service', 'cash', 'discount', 'exchange'],
numToCoupon: {
2: 'discount',
3: 'cash',
4: 'exchange',
7: 'service'
},
couponObj: {
// 折扣券
discount: {
label: '折扣券',
discountType: 2,
list: []
},
// 代金券
cash: {
label: '代金券',
discountType: 3,
list: []
},
// 兑换券
exchange: {
label: '兑换券',
discountType: 4,
list: []
},
// 会员服务
service: {
label: '会员服务',
discountType: 7,
list: []
}
},
editRule: {
name: [{ required: true, message: '请输入礼包名称', trigger: 'change' }],
remarkName: [{ required: true, message: '请输入备注名称', trigger: 'change' }],
couponList: [{ required: true, message: '请选择礼包', trigger: 'change' }],
receiveWay: [{ required: true, message: '请选择领取条件', trigger: 'change' }],
staffList: [{ required: true, message: '请选择发放员工', trigger: 'change' }]
},
isEdit: true,
editFormData: [
{
label: '礼包名称',
name: 'name',
type: 'showTxt'
},
{
label: '备注名称',
name: 'remarkName',
type: 'showTxt'
},
{
label: '礼包设置',
name: 'couponList',
addHtml: 'couponListBlock'
},
{
label: '领取条件',
name: 'receiveWay',
addHtml: 'receiveDetails'
},
{
label: '发放员工',
name: 'staffList',
addHtml: 'staffListBlock'
},
{
label: '赠送原因',
name: 'giveReason',
type: 'showTxt'
}
]
} }
}, },
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.query
this.loading = true
this.getInfo()
}, },
methods: { methods: {
getInfo() {
this.$apis.giftBag.getGiftInfoApi({ id: this.routeInfo.id }).then(res => {
this.editForm = res.data
this.recoveryCoupon()
this.recoveryTotalPrice()
this.$nextTick(() => {
this.loading = false
})
})
},
}, recoveryCoupon() {
}; this.orderShow.forEach(item => {
</script> this.couponObj[item].list = []
})
this.editForm.couponList.forEach(item => {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
})
},
receiveWayChange(val) {
var receiveDetailsIdx = this.editFormData.findIndex(item => item.name == 'receiveDetails')
this.editFormData[receiveDetailsIdx].placeholder = val == '0' ? '请输入领取手机号' : '请输入领取车架号后6位'
this.editFormData[receiveDetailsIdx].maxlength = val == '0' ? 11 : 6
},
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
// 计算预估成本
recoveryTotalPrice() {
this.totalEstimatedCost = 0
this.orderShow.forEach(itme => {
this.couponObj[itme].list.forEach(subItem => {
// 失效券不加入预估成本
if (subItem.status != '3') {
this.totalEstimatedCost = this.totalEstimatedCost + subItem.couponAnticipatedCost * subItem.couponAmount
}
})
})
this.totalEstimatedCost = (this.totalEstimatedCost / 100).toFixed(2)
},
handleEdit() {
var params = {
addOrEdit: 'edit',
$title: encodeURI('编辑信息')
}
params.id = this.routeInfo.id
this.$router.push({
path: '/giftBag/editGift',
query: params
})
},
handleCancel() {
this.$router.push({
path: '/giftBag/index'
})
}
}
}
</script>
<style lang="scss">
.marketing.edit-gift .select-merchant {
/* width: calc(98% - 140px); */
width: 98%;
}
.marketing.edit-gift .staff-block {
width: 567px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e5e5e5;
}
.marketing.edit-gift {
// 礼包
.gift-block {
width: 567px;
border-radius: 4px;
border: 1px solid #e5e5e5;
.gift-title {
padding: 10px;
border-bottom: 1px solid #e5e5e5;
.price {
font-size: 18px;
}
}
.gift-box {
display: flex;
padding: 10px 0 10px 10px;
.gift-label {
width: 70px;
color: #999999;
text-align: right;
}
.gift-content {
width: calc(100% - 70px);
border-bottom: 1px solid #e5e5e5;
.gift-item {
display: inline-block;
width: 50%;
.gift-info {
display: inline-block;
margin: 0 5px 0 7px;
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
}
}
}
.gift-content:last-child {
border-bottom: 0px;
}
}
}
// 发放员工
.sale-select {
display: flex;
align-items: center;
}
.input-tag-wrapper-detail {
max-height: 68px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
// border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px 5px 0px 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 567px;
display: flex;
align-items: center;
// margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
// background: #fff !important;
}
.el-tag.el-tag--info .el-tag__close {
color: #e8e8ea;
background-color: rgba(0, 0, 0, 0) !important;
}
.el-tag.el-tag--info .el-tag__close:hover {
background-color: #5f5efb !important;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
}
</style>
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
<div>礼包明细</div> <div>礼包明细</div>
<div>{{ scope.scope }}</div> <div>{{ scope.scope }}</div>
</div> </div>
<div slot="name" slot-scope="scope">
<el-button :size="size" type="text" @click="handleDetail(scope.scope)">{{ scope.scope.name }}</el-button>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> <el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
<!-- <GLButton type="text" fn="删除" @click="handleDelete(scope.scope)">删除</GLButton> --> <!-- <GLButton type="text" fn="删除" @click="handleDelete(scope.scope)">删除</GLButton> -->
...@@ -45,7 +48,7 @@ ...@@ -45,7 +48,7 @@
<script> <script>
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant' import { aToExport } from '@/common/constant'
export default { export default {
name: 'giftList', name: 'giftList',
data() { data() {
...@@ -62,7 +65,7 @@ export default { ...@@ -62,7 +65,7 @@ export default {
searchFormData: [ searchFormData: [
{ {
label: '礼包名称', label: '礼包名称',
name: 'orderCode', name: 'name',
type: 'input', type: 'input',
maxlength: 30, maxlength: 30,
placeholder: '请输入礼包名称或备注名称', placeholder: '请输入礼包名称或备注名称',
...@@ -70,7 +73,7 @@ export default { ...@@ -70,7 +73,7 @@ export default {
}, },
{ {
label: '发放员工', label: '发放员工',
name: 'orderCode', name: 'staffName',
type: 'input', type: 'input',
maxlength: 30, maxlength: 30,
isClear: true isClear: true
...@@ -84,7 +87,7 @@ export default { ...@@ -84,7 +87,7 @@ export default {
} }
], ],
// 表格 // 表格
getListApi: this.$apis.orderComment.getListApi, getListApi: this.$apis.giftBag.getListApi,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true, tableOption: true,
...@@ -99,32 +102,36 @@ export default { ...@@ -99,32 +102,36 @@ export default {
}, },
{ {
label: '序号', label: '序号',
prop: 'idx' prop: 'idx',
width: '60'
}, },
{ {
label: '礼包名称', label: '礼包名称',
prop: 'orderCode' prop: 'name',
addHtml: 'name'
}, },
{ {
label: '备注名称', label: '备注名称',
prop: 'orderCode', prop: 'remarkName',
width: '200' width: '200'
}, },
{ {
label: '预估成本/元', label: '预估成本/元',
prop: 'orderCode' prop: 'anticipatedCost',
formatter: cellValue => {
return (cellValue.anticipatedCost / 100).toFixed(2)
}
}, },
{ {
label: '发放员工', label: '发放员工',
prop: 'orderCode' prop: 'staffList',
}, formatter: cellValue => {
{ return cellValue.staffList.map(item => item.staffName).join(',')
label: '预估成本/元', }
prop: 'orderCode'
}, },
{ {
label: '赠送原因', label: '赠送原因',
prop: 'orderCode' prop: 'giveReason'
}, },
{ {
label: '创建时间', label: '创建时间',
...@@ -160,8 +167,8 @@ export default { ...@@ -160,8 +167,8 @@ export default {
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) { if (this.searchForm.createDate.length) {
params.createStartDateStr = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createEndDateStr = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59' params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} }
delete params.createDate delete params.createDate
return params return params
...@@ -169,7 +176,6 @@ export default { ...@@ -169,7 +176,6 @@ export default {
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve() resolve()
}) })
}, },
...@@ -195,25 +201,26 @@ export default { ...@@ -195,25 +201,26 @@ export default {
} }
}) })
}, },
// 查看
// handleDetail(row) {
// this.$router.push({
// path: '/orderComment/commentDetail',
// query: {
// id: row.id
// }
// })
// },
handleExport() { handleExport() {
var params = this.getParams() var params = this.getParams()
// this.$apis.couponManage.couponExportApi(params).then(res => { this.$apis.giftBag.giftExportApi(params).then(res => {
// exportFn(res) aToExport(res)
// }) })
}, },
handleDelete(row) { handleDelete(row) {
// this.secondConfirm('删除', '是否确认删除该评论?', 'orderComment', 'deleteCommentApi', { id: row.id }) this.secondConfirm('删除', '是否确认删除该礼包?', 'giftBag', 'deleteGiftApi', { id: row.id })
},
// 查看
handleDetail(row) {
this.$router.push({
path: '/giftBag/giftDetail',
query: {
id: row.id
}
})
}, },
// add-新增;edit-编辑 // add-新增;edit-编辑
......
<template>
<div>
</div>
</template>
<script>
export default {
name: 'selectGiftDialog',
data() {
return {
}
},
mounted() {
},
methods: {
}
}
</script>
<style scoped>
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!