Commit f55383b9 by chenwq

定向礼包-详情;联调

1 parent c9a7acde
......@@ -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 {
margin: 0;
padding: 0;
overflow: hidden;
background-color: #F4F5FA;
background-color: #f4f5fa;
}
.el-range-editor.is-active,
......@@ -25,15 +25,15 @@ html {
}
.live-room .container {
background: #FFFFFF;
background: #ffffff;
margin: 20px 0px;
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 {
float: right;
margin-right: 0!important;
margin-right: 0 !important;
}
//输入框后置文字(如 “元”)
......@@ -66,7 +66,7 @@ html {
}
.ellipsis-2-text:after {
content: "...";
content: '...';
position: absolute;
bottom: 0;
right: 15px;
......@@ -84,8 +84,8 @@ html {
padding: 10px 16px;
height: 20px;
line-height: 20px;
background-color: #E6E9FF;
border: 1px solid #5850FF;
background-color: #e6e9ff;
border: 1px solid #5850ff;
margin-bottom: 20px;
border-radius: 4px;
}
......@@ -96,7 +96,7 @@ html {
}
.marketing .list-tips .red-txt {
color: #EB4E4E;
color: #eb4e4e;
}
.marketing .wechat-container {
......@@ -143,7 +143,7 @@ html {
.marketing .table-btns .el-button {
padding: 0 0 0 5px;
margin-left: 5px;
border-left: 1px solid #DCDFE6;
border-left: 1px solid #dcdfe6;
border-radius: 0;
}
......@@ -168,7 +168,7 @@ html {
}
.marketing .m-t-8 {
margin-top: 8px;
margin-top: 8px;
}
.marketing .m-t-10 {
......@@ -208,6 +208,23 @@ html {
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 {
text-align: center;
}
......@@ -248,7 +265,7 @@ html {
font-weight: 600;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #E7EAEC;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
padding: 0 0 0 20px;
}
......@@ -308,8 +325,8 @@ html {
}
.el-tag {
color: #666!important;
font-size: 14px!important;
color: #666 !important;
font-size: 14px !important;
}
.el-tag.el-tag--info {
......@@ -323,7 +340,6 @@ html {
background: transparent !important;
}
/* tab */
.marketing .el-tabs__nav-wrap:after {
......@@ -342,10 +358,10 @@ html {
font-size: 14px;
text-align: center;
border: 0 !important;
background: #FFFFFF;
background: #ffffff;
color: #999999;
border-radius: 0px 4px 0px 0px;
border: 1px solid #F4F6FC;
border: 1px solid #f4f6fc;
padding: 0;
}
......@@ -359,9 +375,9 @@ html {
.marketing .el-tabs__item.is-active {
color: #5850ff;
background: #F4F6FC !important;
background: #f4f6fc !important;
border-radius: 4px 0px 0px 0px;
border: 1px solid #F4F6FC !important;
border: 1px solid #f4f6fc !important;
}
.el-message--info {
......@@ -377,4 +393,4 @@ html {
font-size: 16px;
}
/* tab */
\ No newline at end of file
/* tab */
......@@ -68,14 +68,14 @@ function exportFn(url) {
document.body.appendChild(iframe)
}
// function aToExport(url) {
// var a = document.createElement('a')
// a.setAttribute('id', 'exportToExport')
// a.setAttribute('href', url)
// a.setAttribute('target', '_blank')
// document.body.appendChild(a)
// a.click()
// }
function aToExport(url) {
var a = document.createElement('a')
a.setAttribute('id', 'exportToExport')
a.setAttribute('href', url)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
}
const orderManageStatusList = [
{ confId: '1', confName: '待付款' },
......@@ -204,7 +204,7 @@ export {
limitPrice,
getExplorer,
exportFn,
// aToExport,
aToExport,
orderManageStatusList,
afterSaleStatusList,
orderSourceList,
......
......@@ -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>
<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'">
<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>
......@@ -160,7 +161,7 @@ export default {
},
formObj: {
type: Object,
default: () => {}
default: () => { }
},
hasTitle: {
type: Boolean,
......@@ -168,16 +169,16 @@ export default {
},
formRules: {
type: Object,
default: () => {}
default: () => { }
},
// 搜索+输入框/搜索组合组件,搜索栏绑值
searchSelectObj: {
type: Object,
default: () => {}
default: () => { }
}
},
mounted() {},
mounted() { },
methods: {
// 选择框-添加其他属性
......
......@@ -19,6 +19,7 @@ module.exports = {
},
request: {
// baseURL: 'http://scrm.test.glsx.com.cn/',
// baseURL: 'http://192.168.2.42:8064/',
baseURL: 'http://scrm.dev.glsx.com.cn/',
// 设置超时时间
timeout: 180000,
......
......@@ -18,7 +18,7 @@ export const fetchConfig = function(isEnv = true) {
Object.assign(request, { timeout })
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' })
return new Http().get('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config')
}
......
<!-- 编辑专区 -->
<!-- 编辑礼包 -->
<template>
<div class="edit-gift marketing p-t-20 edit-box">
<div class="container edit-container">
<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">
<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>
<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">
......@@ -19,15 +39,17 @@
</glsx-combi-form>
</div>
<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="primary" @click="handleConfirm">确定</el-button>
</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>
</div>
</template>
<script>
import selectStaffDialog from './selectStaffDialog.vue'
import selectGiftDialog from './selectStaffDialog.vue'
export default {
name: 'editGift',
data() {
......@@ -58,7 +80,61 @@ export default {
receiveWay: '0',
receiveDetails: '',
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: {
name: [{ required: true, message: '请输入礼包名称', trigger: 'change' }],
......@@ -82,7 +158,7 @@ export default {
},
trigger: 'change'
}]
// zoneImg: [{ required: true, message: '请选择专区图片', trigger: 'change' }]
// zoneImg: [{ required: true, message: '请选择礼包图片', trigger: 'change' }]
},
isEdit: true,
editFormData: [
......@@ -102,10 +178,15 @@ export default {
},
{
label: '礼包设置',
name: '',
name: 'couponList',
addHtml: 'selectGiftBtn'
},
{
label: '',
name: '',
addHtml: 'couponListBlock'
},
{
label: '领取条件',
name: 'receiveWay',
type: 'radio',
......@@ -156,7 +237,7 @@ export default {
width: '567px'
}
// {
// label: '专区图片',
// label: '礼包图片',
// name: 'zoneImg',
// type: 'upload',
// limitSize: 10,
......@@ -192,22 +273,31 @@ export default {
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.query
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : ''
this.routeInfo.addOrEdit == 'add' ? '' : this.getInfo()
},
methods: {
getInfo() {
// this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => {
// this.editForm.name = res.name
// this.editForm.zoneImg = res.zoneImg
// this.editForm.merchantList = res.merchantRefList
// this.editForm.merchantList.forEach(item => {
// item.merchantNo = item.merchantId
// })
// this.$nextTick(() => {
// this.editStatus = false
// })
// })
this.$apis.giftBag.getGiftInfoApi({ id: this.routeInfo.id }).then(res => {
this.editForm = res.data
this.editForm.receiveWay = this.editForm.receiveWay + ''
this.recoveryCoupon()
this.recoveryTotalPrice()
this.$nextTick(() => {
this.editStatus = false
this.loading = 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) {
......@@ -216,6 +306,26 @@ export default {
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) {
this.editForm.staffList.splice(idx, 1)
this.hasStaffBlock()
......@@ -313,6 +423,53 @@ export default {
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;
......
<!-- 礼包详情 -->
<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>
</template>
<script>
export default {
name: 'giftDetail',
data() {
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() {
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: {
getInfo() {
this.$apis.giftBag.getGiftInfoApi({ id: this.routeInfo.id }).then(res => {
this.editForm = res.data
this.recoveryCoupon()
this.recoveryTotalPrice()
this.$nextTick(() => {
this.loading = false
})
})
},
},
};
</script>
recoveryCoupon() {
this.orderShow.forEach(item => {
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
// 计算预估成本
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 @@
<div>礼包明细</div>
<div>{{ scope.scope }}</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">
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
<!-- <GLButton type="text" fn="删除" @click="handleDelete(scope.scope)">删除</GLButton> -->
......@@ -45,7 +48,7 @@
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
import { aToExport } from '@/common/constant'
export default {
name: 'giftList',
data() {
......@@ -62,7 +65,7 @@ export default {
searchFormData: [
{
label: '礼包名称',
name: 'orderCode',
name: 'name',
type: 'input',
maxlength: 30,
placeholder: '请输入礼包名称或备注名称',
......@@ -70,7 +73,7 @@ export default {
},
{
label: '发放员工',
name: 'orderCode',
name: 'staffName',
type: 'input',
maxlength: 30,
isClear: true
......@@ -84,7 +87,7 @@ export default {
}
],
// 表格
getListApi: this.$apis.orderComment.getListApi,
getListApi: this.$apis.giftBag.getListApi,
tableParams: {
listName: 'list',
tableOption: true,
......@@ -99,32 +102,36 @@ export default {
},
{
label: '序号',
prop: 'idx'
prop: 'idx',
width: '60'
},
{
label: '礼包名称',
prop: 'orderCode'
prop: 'name',
addHtml: 'name'
},
{
label: '备注名称',
prop: 'orderCode',
prop: 'remarkName',
width: '200'
},
{
label: '预估成本/元',
prop: 'orderCode'
prop: 'anticipatedCost',
formatter: cellValue => {
return (cellValue.anticipatedCost / 100).toFixed(2)
}
},
{
label: '发放员工',
prop: 'orderCode'
},
{
label: '预估成本/元',
prop: 'orderCode'
prop: 'staffList',
formatter: cellValue => {
return cellValue.staffList.map(item => item.staffName).join(',')
}
},
{
label: '赠送原因',
prop: 'orderCode'
prop: 'giveReason'
},
{
label: '创建时间',
......@@ -160,8 +167,8 @@ export default {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) {
params.createStartDateStr = 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.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createDate
return params
......@@ -169,7 +176,6 @@ export default {
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
......@@ -195,25 +201,26 @@ export default {
}
})
},
// 查看
// handleDetail(row) {
// this.$router.push({
// path: '/orderComment/commentDetail',
// query: {
// id: row.id
// }
// })
// },
handleExport() {
var params = this.getParams()
// this.$apis.couponManage.couponExportApi(params).then(res => {
// exportFn(res)
// })
this.$apis.giftBag.giftExportApi(params).then(res => {
aToExport(res)
})
},
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-编辑
......
<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!