Commit 899b2036 by 胡悦

Merge branch 'v1.2.0' of http://192.168.3.233:8090/saas/scrm-micro-marketing into v1.2.0

2 parents 8e39720c f55383b9
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1", "eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.14.1", "node-sass": "^4.12.0",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
"vue-cli-plugin-element": "^1.0.1", "vue-cli-plugin-element": "^1.0.1",
......
...@@ -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;
} }
...@@ -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 {
......
...@@ -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,7 +19,8 @@ module.exports = { ...@@ -19,7 +19,8 @@ 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://192.168.2.42:8064/',
baseURL: 'http://scrm.dev.glsx.com.cn/',
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
......
...@@ -13,11 +13,11 @@ import { Http } from 'glsx-common' ...@@ -13,11 +13,11 @@ import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) { export const fetchConfig = function(isEnv = true) {
// console.log(1111111) // console.log(1111111)
// if (isEnv) { if (isEnv) {
// let { request } = cfg let { request } = cfg
// 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')
......
...@@ -28,5 +28,6 @@ export async function start() { ...@@ -28,5 +28,6 @@ export async function start() {
Vue.prototype.$http2 = new Http({ response, request: request2, sign, secret, alert: message.error, headers: { token } }) Vue.prototype.$http2 = new Http({ response, request: request2, sign, secret, alert: message.error, headers: { token } })
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } }) Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
Vue.prototype.$common = { utils: utils }
render('/', routes) render('/', routes)
} }
...@@ -33,6 +33,10 @@ ...@@ -33,6 +33,10 @@
<el-radio v-model="editForm.useChannel" label="1" :disabled="apear != 'couponAdd'">线上商品</el-radio> <el-radio v-model="editForm.useChannel" label="1" :disabled="apear != 'couponAdd'">线上商品</el-radio>
<el-radio v-model="editForm.useChannel" label="2" :disabled="apear != 'couponAdd'">到店核销</el-radio> <el-radio v-model="editForm.useChannel" label="2" :disabled="apear != 'couponAdd'">到店核销</el-radio>
</template> </template>
<template slot="directionalFlagHtml">
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">否</el-radio>
<el-radio v-model="editForm.directionalFlag" label="2" :disabled="apear != 'couponAdd'">是</el-radio>
</template>
<template slot="effectiveHtml"> <template slot="effectiveHtml">
<el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">无有效期</el-radio> <el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">无有效期</el-radio>
<br /> <br />
...@@ -86,12 +90,15 @@ ...@@ -86,12 +90,15 @@
</GLTable> </GLTable>
</div> </div>
<template slot="useDescriptionHtml"> <template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="apear == 'couponSee'" /> <el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template>
<template slot="editHtml">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template> </template>
</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" v-if="apear != 'couponSee'" @click="handleConfirm">确定</el-button> <el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button>
<el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button> <el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button>
<el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button> <el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button>
</div> </div>
...@@ -105,6 +112,8 @@ export default { ...@@ -105,6 +112,8 @@ export default {
name: 'editCashCoupon', name: 'editCashCoupon',
data() { data() {
return { return {
showSubmit: true,
userDisable: false,
size: 'small', size: 'small',
title: '创建', title: '创建',
titleObj: { titleObj: {
...@@ -134,6 +143,7 @@ export default { ...@@ -134,6 +143,7 @@ export default {
isMutiSelectVisible: false, isMutiSelectVisible: false,
editForm: { editForm: {
couponName: '', couponName: '',
anticipatedCost: '',
useChannel: '1', useChannel: '1',
effectiveType: '3', effectiveType: '3',
effectiveTime: [], effectiveTime: [],
...@@ -141,7 +151,8 @@ export default { ...@@ -141,7 +151,8 @@ export default {
useBarriers: '1', useBarriers: '1',
full: '', full: '',
goods: '1', goods: '1',
goodsRefList: [] goodsRefList: [],
directionalFlag: '1'
}, },
//商品列表 //商品列表
tableParams: { tableParams: {
...@@ -178,6 +189,7 @@ export default { ...@@ -178,6 +189,7 @@ export default {
selectedProList: [], selectedProList: [],
editRule: { editRule: {
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }], couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }], effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }], effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'change' }], effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'change' }],
...@@ -195,49 +207,80 @@ export default { ...@@ -195,49 +207,80 @@ export default {
width: '320px', width: '320px',
type: 'input', type: 'input',
maxlength: 20 maxlength: 20
// index:0
},
{
label: '预估成本',
name: 'anticipatedCost',
width: '320px',
type: 'input',
isDisabled: false
// index:1
}, },
{ {
label: '使用途径', label: '使用途径',
name: 'useChannel', name: 'useChannel',
addHtml: 'useChannelHtml' addHtml: 'useChannelHtml'
// index:2
}, },
{ {
label: '有效期', label: '有效期',
name: 'effectiveType', name: 'effectiveType',
addHtml: 'effectiveHtml' addHtml: 'effectiveHtml'
// index:3
}, },
{ {
label: '使用限制', label: '使用限制',
name: 'useBarriers', name: 'useBarriers',
addHtml: 'useBarriersHtml' addHtml: 'useBarriersHtml'
// index:4
},
{
label: '定制礼包专用',
name: 'directionalFlag',
addHtml: 'directionalFlagHtml',
isHide: false
// index:5
}, },
{ {
label: '适用商品', label: '适用商品',
name: 'goods', name: 'goods',
addHtml: 'goodsHtml', addHtml: 'goodsHtml',
isHide: false isHide: false
// index:6
}, },
{ {
// label: '门店', // label: '门店',
name: '', name: '',
addHtml: 'proTable', addHtml: 'proTable',
isHide: true isHide: true
// index:7
}, },
{ {
label: '面值', label: '面值',
name: 'denomination', name: 'denomination',
addHtml: 'denominationHtml' addHtml: 'denominationHtml'
// index:8
}, },
{ {
label: '库存', label: '库存',
name: 'stock', name: 'stock',
width: '150px', width: '150px',
type: 'input' type: 'input'
// index:9
}, },
{ {
label: '使用说明', label: '使用说明',
name: 'useDescription', name: 'useDescription',
addHtml: 'useDescriptionHtml' addHtml: 'useDescriptionHtml'
// index:10
},
{
name: '',
addHtml: 'editHtml',
isHide: true
// index:11
} }
] ]
} }
...@@ -255,13 +298,17 @@ export default { ...@@ -255,13 +298,17 @@ export default {
if (id) { if (id) {
if (addOrEdit == 3) { if (addOrEdit == 3) {
this.apear = 'couponSee' this.apear = 'couponSee'
this.showSubmit = false
this.title = '查看' this.title = '查看'
this.editFormData[11].isHide = false
} else if (addOrEdit == 2) { } else if (addOrEdit == 2) {
this.apear = 'couponEdit' this.apear = 'couponEdit'
this.title = '编辑' this.title = '编辑'
} }
this.editFormData[0].isDisabled = true this.editFormData[0].isDisabled = true
this.editFormData[7].isDisabled = true this.editFormData[1].isDisabled = true
this.editFormData[9].isDisabled = true
this.userDisable = true
} else { } else {
this.apear = 'couponAdd' this.apear = 'couponAdd'
this.title = '创建' this.title = '创建'
...@@ -278,6 +325,9 @@ export default { ...@@ -278,6 +325,9 @@ export default {
'editForm.effectiveDays'(newValue, oldValue) { 'editForm.effectiveDays'(newValue, oldValue) {
this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0) this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0)
}, },
'editForm.anticipatedCost'(newValue, oldValue) {
this.editForm.anticipatedCost = limitPrice(newValue, oldValue, 4, 2, 0, 10000)
},
'editForm.full'(newValue, oldValue) { 'editForm.full'(newValue, oldValue) {
this.editForm.full = limitPrice(newValue, oldValue, 5, 2) this.editForm.full = limitPrice(newValue, oldValue, 5, 2)
}, },
...@@ -300,28 +350,31 @@ export default { ...@@ -300,28 +350,31 @@ export default {
} }
}, },
'editForm.useChannel'(newValue, oldValue) { 'editForm.useChannel'(newValue, oldValue) {
let goodHtmlIndex = this.editFormData.findIndex(item => item.name == 'goods')
let proTableIndex = this.editFormData.findIndex(item => item.addHtml == 'proTable')
if (newValue == 1) { if (newValue == 1) {
this.editFormData[4].isHide = false this.editFormData[goodHtmlIndex].isHide = false
if (this.editForm.goodsRefList.length) { if (this.editForm.goodsRefList.length) {
this.editFormData[5].isHide = false this.editFormData[proTableIndex].isHide = false
} }
} else { } else {
this.editForm.useBarriers = '1' this.editForm.useBarriers = '1'
this.editForm.full = '' this.editForm.full = ''
this.editFormData[4].isHide = true this.editFormData[goodHtmlIndex].isHide = true
this.editFormData[5].isHide = true this.editFormData[proTableIndex].isHide = true
} }
}, },
'editForm.goods'(newValue, oldValue) { 'editForm.goods'(newValue, oldValue) {
let proTableIndex = this.editFormData.findIndex(item => item.addHtml == 'proTable')
if (newValue == 1) { if (newValue == 1) {
//全部商品 //全部商品
this.minPirce = this.minPirceForAll this.minPirce = this.minPirceForAll
this.editFormData[5].isHide = true this.editFormData[proTableIndex].isHide = true
} else { } else {
//指定商品 //指定商品
this.minPirce = this.minPirceForPart this.minPirce = this.minPirceForPart
if (this.editForm.goodsRefList.length) { if (this.editForm.goodsRefList.length) {
this.editFormData[5].isHide = false this.editFormData[proTableIndex].isHide = false
} }
} }
if (this.editForm.denomination && this.minPirce && this.editForm.denomination * 100 > this.minPirce) { if (this.editForm.denomination && this.minPirce && this.editForm.denomination * 100 > this.minPirce) {
...@@ -332,10 +385,12 @@ export default { ...@@ -332,10 +385,12 @@ export default {
}, },
'editForm.goodsRefList'(newValue, oldValue) { 'editForm.goodsRefList'(newValue, oldValue) {
let goodHtmlIndex = this.editFormData.findIndex(item => item.name == 'goods')
let proTableIndex = this.editFormData.findIndex(item => item.addHtml == 'proTable')
if (newValue.length) { if (newValue.length) {
this.editFormData[5].isHide = false this.editFormData[proTableIndex].isHide = false
} else { } else {
this.editFormData[5].isHide = true this.editFormData[proTableIndex].isHide = true
} }
}, },
...@@ -358,6 +413,13 @@ export default { ...@@ -358,6 +413,13 @@ export default {
}, },
methods: { methods: {
// 编辑按钮
editMessage() {
let anticipatedCostIndex = this.editFormData.findIndex(item => item.name == 'anticipatedCost')
this.editFormData[anticipatedCostIndex].isDisabled = false
this.userDisable = false
this.showSubmit = true
},
setDateString(objField, special) { setDateString(objField, special) {
var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日') var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日')
return value return value
...@@ -458,9 +520,10 @@ export default { ...@@ -458,9 +520,10 @@ export default {
this.editForm = this.$common.utils.deepClone(res) this.editForm = this.$common.utils.deepClone(res)
this.editForm.effectiveTime = [] this.editForm.effectiveTime = []
this.editForm.useChannel = this.editForm.useChannel + '' this.editForm.useChannel = this.editForm.useChannel + ''
this.editForm.directionalFlag = this.editForm.directionalFlag + ''
this.editForm.effectiveType = this.editForm.effectiveType + '' this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.useBarriers = this.editForm.useBarriers + '' this.editForm.useBarriers = this.editForm.useBarriers + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) { if (this.editForm.effectiveType == 2) {
...@@ -544,7 +607,10 @@ export default { ...@@ -544,7 +607,10 @@ export default {
//满多少减 //满多少减
obj.full = form.full obj.full = form.full
} }
//是否定制礼包专用
obj.directionalFlag = form.directionalFlag
//预估成本
obj.anticipatedCost = form.anticipatedCost * 100
//面值 //面值
obj.denomination = form.denomination obj.denomination = form.denomination
//库存 //库存
...@@ -593,6 +659,7 @@ export default { ...@@ -593,6 +659,7 @@ export default {
} else { } else {
method = 'createCouponApi' //后台创建优惠券 method = 'createCouponApi' //后台创建优惠券
} }
console.log(params)
this.$apis.couponManage[method](params).then(res => { this.$apis.couponManage[method](params).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : '操作失败', message: res.code == '0' ? '操作成功' : '操作失败',
......
...@@ -64,12 +64,15 @@ ...@@ -64,12 +64,15 @@
</el-form-item> </el-form-item>
</template> </template>
<template slot="useDescriptionHtml"> <template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="apear == 'couponSee'" /> <el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template>
<template slot="editHtml">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template> </template>
</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" v-if="apear != 'couponSee'" @click="handleConfirm">确定</el-button> <el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button>
<el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button> <el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button>
<el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button> <el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button>
</div> </div>
...@@ -82,6 +85,8 @@ export default { ...@@ -82,6 +85,8 @@ export default {
name: 'editDiscountCoupon', name: 'editDiscountCoupon',
data() { data() {
return { return {
showSubmit: true,
userDisable: false,
size: 'small', size: 'small',
title: '创建', title: '创建',
titleObj: { titleObj: {
...@@ -121,9 +126,11 @@ export default { ...@@ -121,9 +126,11 @@ export default {
couponName: '', couponName: '',
effectiveType: '2', effectiveType: '2',
effectiveTime: [], effectiveTime: [],
effectiveDays: '' effectiveDays: '',
anticipatedCost: ''
}, },
editRule: { editRule: {
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }], couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }], effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }], effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
...@@ -140,6 +147,13 @@ export default { ...@@ -140,6 +147,13 @@ export default {
maxlength: 20 maxlength: 20
}, },
{ {
label: '预估成本',
name: 'anticipatedCost',
width: '320px',
type: 'input',
isDisabled: false
},
{
label: '发放数量', label: '发放数量',
name: 'stock', name: 'stock',
width: '180px', width: '180px',
...@@ -155,6 +169,11 @@ export default { ...@@ -155,6 +169,11 @@ export default {
label: '使用说明', label: '使用说明',
name: 'useDescription', name: 'useDescription',
addHtml: 'useDescriptionHtml' addHtml: 'useDescriptionHtml'
},
{
name: '',
addHtml: 'editHtml',
isHide: true
} }
] ]
} }
...@@ -171,7 +190,9 @@ export default { ...@@ -171,7 +190,9 @@ export default {
if (id) { if (id) {
if (addOrEdit == 3) { if (addOrEdit == 3) {
this.apear = 'couponSee' this.apear = 'couponSee'
this.showSubmit = false
this.title = '查看' this.title = '查看'
this.editFormData[5].isHide = false
} else if (addOrEdit == 2) { } else if (addOrEdit == 2) {
this.apear = 'couponEdit' this.apear = 'couponEdit'
this.title = '编辑' this.title = '编辑'
...@@ -179,6 +200,8 @@ export default { ...@@ -179,6 +200,8 @@ export default {
this.isDisabled = true this.isDisabled = true
this.editFormData[0].isDisabled = this.isDisabled this.editFormData[0].isDisabled = this.isDisabled
this.editFormData[1].isDisabled = this.isDisabled this.editFormData[1].isDisabled = this.isDisabled
this.editFormData[2].isDisabled = this.isDisabled
this.userDisable = true
} else { } else {
this.apear = 'couponAdd' this.apear = 'couponAdd'
this.title = '创建' this.title = '创建'
...@@ -196,6 +219,9 @@ export default { ...@@ -196,6 +219,9 @@ export default {
'editForm.effectiveDays'(newValue, oldValue) { 'editForm.effectiveDays'(newValue, oldValue) {
this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0) this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0)
}, },
'editForm.anticipatedCost'(newValue, oldValue) {
this.editForm.anticipatedCost = limitPrice(newValue, oldValue, 4, 2, 0, 10000)
},
'editForm.stock'(newValue, oldValue) { 'editForm.stock'(newValue, oldValue) {
this.editForm.stock = limitPrice(newValue, oldValue, 6, 0, 1) this.editForm.stock = limitPrice(newValue, oldValue, 6, 0, 1)
}, },
...@@ -216,6 +242,13 @@ export default { ...@@ -216,6 +242,13 @@ export default {
}, },
methods: { methods: {
// 编辑按钮
editMessage() {
let anticipatedCostIndex = this.editFormData.findIndex(item => item.name == 'anticipatedCost')
this.editFormData[anticipatedCostIndex].isDisabled = false
this.userDisable = false
this.showSubmit = true
},
setDateString(objField, special) { setDateString(objField, special) {
var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日') var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日')
return value return value
...@@ -225,13 +258,13 @@ export default { ...@@ -225,13 +258,13 @@ export default {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => { this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => {
this.editForm = this.$common.utils.deepClone(res) this.editForm = this.$common.utils.deepClone(res)
this.editForm.effectiveType = this.editForm.effectiveType + '' this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) { if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime] this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime]
} }
this.$nextTick(()=>{ this.$nextTick(() => {
this.editStatus = false this.editStatus = false
}) })
}) })
...@@ -265,7 +298,9 @@ export default { ...@@ -265,7 +298,9 @@ export default {
obj.couponName = form.couponName obj.couponName = form.couponName
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务 //优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj.discountType = '2' obj.discountType = '2'
obj.directionalFlag = '1'
//预估成本
obj.anticipatedCost = form.anticipatedCost * 100
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj.effectiveType = form.effectiveType obj.effectiveType = form.effectiveType
...@@ -327,7 +362,8 @@ export default { ...@@ -327,7 +362,8 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { })
.then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => {}) .catch(() => {})
......
<!-- 编辑兑换券 --> <!-- 编辑兑换券 -->
<template> <template>
<div class="edit-share marketing p-t-20 edit-box"> <div class="edit-share marketing p-t-20 edit-box">
<div class="container edit-container" style="height: 630px;position: relative;"> <div class="container edit-container" style="height: 630px; position: relative">
<div class="right_show"> <div class="right_show">
<div class="card-top"></div> <div class="card-top"></div>
<div class="card_one"> <div class="card_one">
...@@ -29,26 +29,29 @@ ...@@ -29,26 +29,29 @@
<p class="edit-title">{{ title }}兑换券</p> <p class="edit-title">{{ title }}兑换券</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="effectiveHtml"> <template slot="effectiveHtml">
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px;display: block;"> <el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-date-picker v-model="editForm.effectiveTime" type="daterange" style="width:295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker> <el-date-picker v-model="editForm.effectiveTime" type="daterange" style="width: 295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio> </el-radio>
</el-form-item> </el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays"> <el-form-item prop="effectiveDays" ref="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'">
领取后 领取后
<el-input v-model="editForm.effectiveDays" style="width: 100px;margin-left:5px;margin-right:5px" :disabled="apear != 'couponAdd' || editForm.effectiveType != 1" /> <el-input v-model="editForm.effectiveDays" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.effectiveType != 1" />
天内有效 天内有效
</el-radio> </el-radio>
</el-form-item> </el-form-item>
</template> </template>
<template slot="useDescriptionHtml"> <template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="apear == 'couponSee'" /> <el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template>
<template slot="editHtml">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template> </template>
</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" v-if="apear != 'couponSee'" @click="handleConfirm">确定</el-button> <el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button>
<el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button> <el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button>
<el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button> <el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button>
</div> </div>
...@@ -61,6 +64,8 @@ export default { ...@@ -61,6 +64,8 @@ export default {
name: 'editDiscountCoupon', name: 'editDiscountCoupon',
data() { data() {
return { return {
showSubmit: true,
userDisable: false,
size: 'small', size: 'small',
title: '创建', title: '创建',
titleObj: { titleObj: {
...@@ -100,9 +105,11 @@ export default { ...@@ -100,9 +105,11 @@ export default {
couponName: '', couponName: '',
effectiveType: '2', effectiveType: '2',
effectiveTime: [], effectiveTime: [],
effectiveDays: '' effectiveDays: '',
anticipatedCost: ''
}, },
editRule: { editRule: {
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }], couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }], effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }], effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
...@@ -119,6 +126,13 @@ export default { ...@@ -119,6 +126,13 @@ export default {
maxlength: 20 maxlength: 20
}, },
{ {
label: '预估成本',
name: 'anticipatedCost',
width: '320px',
type: 'input',
isDisabled: false
},
{
label: '发放数量', label: '发放数量',
name: 'stock', name: 'stock',
width: '180px', width: '180px',
...@@ -134,6 +148,11 @@ export default { ...@@ -134,6 +148,11 @@ export default {
label: '使用说明', label: '使用说明',
name: 'useDescription', name: 'useDescription',
addHtml: 'useDescriptionHtml' addHtml: 'useDescriptionHtml'
},
{
name: '',
addHtml: 'editHtml',
isHide: true
} }
] ]
} }
...@@ -150,6 +169,8 @@ export default { ...@@ -150,6 +169,8 @@ export default {
if (id) { if (id) {
if (addOrEdit == 3) { if (addOrEdit == 3) {
this.apear = 'couponSee' this.apear = 'couponSee'
this.editFormData[5].isHide = false
this.showSubmit = false
this.title = '查看' this.title = '查看'
} else if (addOrEdit == 2) { } else if (addOrEdit == 2) {
this.apear = 'couponEdit' this.apear = 'couponEdit'
...@@ -158,6 +179,7 @@ export default { ...@@ -158,6 +179,7 @@ export default {
this.isDisabled = true this.isDisabled = true
this.editFormData[0].isDisabled = this.isDisabled this.editFormData[0].isDisabled = this.isDisabled
this.editFormData[1].isDisabled = this.isDisabled this.editFormData[1].isDisabled = this.isDisabled
this.userDisable = true
} else { } else {
this.apear = 'couponAdd' this.apear = 'couponAdd'
this.title = '创建' this.title = '创建'
...@@ -172,6 +194,9 @@ export default { ...@@ -172,6 +194,9 @@ export default {
}, },
deep: true deep: true
}, },
'editForm.anticipatedCost'(newValue, oldValue) {
this.editForm.anticipatedCost = limitPrice(newValue, oldValue, 4, 2, 0, 10000)
},
'editForm.effectiveDays'(newValue, oldValue) { 'editForm.effectiveDays'(newValue, oldValue) {
this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0) this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0)
}, },
...@@ -195,6 +220,13 @@ export default { ...@@ -195,6 +220,13 @@ export default {
}, },
methods: { methods: {
// 编辑按钮
editMessage() {
let anticipatedCostIndex = this.editFormData.findIndex(item => item.name == 'anticipatedCost')
this.editFormData[anticipatedCostIndex].isDisabled = false
this.userDisable = false
this.showSubmit = true
},
setDateString(objField, special) { setDateString(objField, special) {
var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日') var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日')
return value return value
...@@ -204,13 +236,13 @@ export default { ...@@ -204,13 +236,13 @@ export default {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => { this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => {
this.editForm = this.$common.utils.deepClone(res) this.editForm = this.$common.utils.deepClone(res)
this.editForm.effectiveType = this.editForm.effectiveType + '' this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) { if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime] this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime]
} }
this.$nextTick(()=>{ this.$nextTick(() => {
this.editStatus = false this.editStatus = false
}) })
}) })
...@@ -244,7 +276,9 @@ export default { ...@@ -244,7 +276,9 @@ export default {
obj.couponName = form.couponName obj.couponName = form.couponName
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务 //优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj.discountType = '4' obj.discountType = '4'
obj.directionalFlag = '1'
//预估成本
obj.anticipatedCost = form.anticipatedCost * 100
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj.effectiveType = form.effectiveType obj.effectiveType = form.effectiveType
...@@ -306,7 +340,8 @@ export default { ...@@ -306,7 +340,8 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { })
.then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => {}) .catch(() => {})
......
...@@ -127,6 +127,13 @@ export default { ...@@ -127,6 +127,13 @@ export default {
} }
}, },
{ {
label: '预估成本',
prop: 'anticipatedCost ',
formatter: cellValue => {
return cellValue.anticipatedCost / 100
}
},
{
label: '已领取', label: '已领取',
prop: 'getAmount' prop: 'getAmount'
}, },
......
<!-- 编辑专区 --> <!-- 编辑礼包 -->
<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 => {
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
}, },
};
</script>
<style lang="scss" scoped> // 计算预估成本
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> </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-编辑
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<gift-list></gift-list> <gift-list></gift-list>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="已领取" name="receivedGiftList"> <el-tab-pane label="已领取" name="receivedGiftList">
<div class="p-t-20">已领取</div> <receivedGiftList></receivedGiftList>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<script> <script>
import giftList from './giftList.vue' import giftList from './giftList.vue'
import receivedGiftList from './receivedGiftList.vue'
export default { export default {
name: 'gitfBag', name: 'gitfBag',
data() { data() {
...@@ -23,7 +24,8 @@ export default { ...@@ -23,7 +24,8 @@ export default {
}, },
components: { components: {
giftList giftList,
receivedGiftList
}, },
mounted() { }, mounted() { },
......
<!-- 已领取-->
<template>
<div class="marketing p-t-20">
<div class="container">
<div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData"></glsx-combi-form>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData1">
<span slot="footer">
<el-button :size="size" type="default" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
<glsx-combi-form ref="showSearch">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="default" @click="handleExport">导出</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :hasNum="false" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="giftInfo" slot-scope="scope">
<div>礼包明细</div>
<div>{{ scope.scope }}</div>
<GLTable ref="giftListRef" :getListApi="getGiftListApi" :hasNum="false" :noDataImg="url" :searchForm="giftSearchForm" :tableParams="giftParams" :pageConf="giftPageConf"></GLTable>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
name: 'giftList',
data() {
return {
size: 'small',
url: url,
searchForm: {
whether: '',
orderCode: '',
commentStatus: '',
createDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '领用客户',
name: 'customer',
type: 'input'
},
{
label: '礼包名称',
name: 'giftName',
type: 'input'
},
{
label: '是否为企微客户',
name: 'whether',
type: 'select',
optionList: [],
optionId: 'Id',
optionLabel: 'Name',
optionsName: 'List'
}
],
searchFormData1: [
{
label: '发放员工',
name: 'staff',
type: 'input'
},
{
label: '领用日期',
name: 'receiveDate',
type: 'datePicker',
pickerOptions: 'beforeRangePickerOptions'
}
],
baseData: {
List: [
{
Id: '1',
Name: '是'
},
{
id: '2',
Name: '否'
}
]
},
//礼包表格
getGiftListApi: this.$apis.orderComment.getListApi,
giftParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '礼包明细',
prop: 'couponName'
},
{
label: '礼包数量',
name: 'discountType',
width: '100px',
formatter: cellValue => {
return 'X' + cellValue.numBer
}
},
{
label: '已核销',
prop: 'anticipatedCost ',
formatter: cellValue => {
return 'X' + cellValue.numBer
}
},
{
label: '可使用',
prop: 'getAmount',
formatter: cellValue => {
return 'X' + cellValue.numBer
}
}
]
},
giftPageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 表格
getListApi: this.$apis.orderComment.getListApi,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '',
prop: '',
columnattrs: {
type: 'expand'
},
addHtml: 'giftInfo'
},
{
label: '序号',
prop: 'idx'
},
{
label: '领取客户',
prop: 'orderCode'
},
{
label: '是否为企微客户',
prop: 'orderCode',
width: '200'
},
{
label: '礼包名称',
prop: 'orderCode',
width: '200'
},
{
label: '备注名称',
prop: 'orderCode',
width: '200'
},
{
label: '预估成本/元',
prop: 'orderCode'
},
{
label: '已核销成本',
prop: 'orderCode'
},
{
label: '发放员工',
prop: 'orderCode'
},
{
label: '创建时间',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
}
},
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
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'
}
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
// 查看
// 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)
// })
},
handleDelete(row) {
// this.secondConfirm('删除', '是否确认删除该评论?', 'orderComment', 'deleteCommentApi', { id: row.id })
},
// add-新增;edit-编辑
handleEdit(addOrEdit, row) {
// addOrEdit == 1 ? this.$router.push('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + addOrEdit + '/' + row.id)
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新增信息' : '编辑信息')
}
addOrEdit != 'add' && (params.id = row.id)
this.$router.push({
path: '/giftBag/editGift',
query: params
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
setTableFinishFun() {
var page = this.$refs.giftListRef.page
// 添加序号
this.$refs.giftListRef.data.forEach((item, index) => {
item.idx = index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1
})
//接收到的数据为空
this.$refs.giftListRef.data.length ? (this.$refs.giftListRef.tableHeightValues = '') : this.$refs.giftListRef.setTableHeightFun()
},
handleSearch() {
this.$refs.giftListRef.refreshTable()
},
handleReset() {
this.searchForm = {
orderCode: '',
commentStatus: '',
createDate: []
}
this.handleSearch()
}
}
}
</script>
<style scoped></style>
<template>
<div>
</div>
</template>
<script>
export default {
name: 'selectGiftDialog',
data() {
return {
}
},
mounted() {
},
methods: {
}
}
</script>
<style scoped>
</style>
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<!-- //提示面板组件 --> <!-- //提示面板组件 -->
<tip-panel panelWidth="616px" panelMinHeight="60px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel> <tip-panel panelWidth="616px" panelMinHeight="60px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel>
<div class="live-room container"> <div class="live-room container">
<el-form :inline="true" style="width:100%" :model="searchForm" label-width="70px" label-position="right"> <el-form :inline="true" style="width: 100%" :model="searchForm" label-width="70px" label-position="right">
<el-row> <el-row>
<!-- <el-form-item size="small"> --> <!-- <el-form-item size="small"> -->
<!-- <el-button :size="size" type="primary" icon="el-icon-plus" @click="handleCreate">创建服务</el-button>display="disabled" --> <!-- <el-button :size="size" type="primary" icon="el-icon-plus" @click="handleCreate">创建服务</el-button>display="disabled" -->
<GLButton type="primary" @click="handleCreate" style="margin-right:30px" size="small" icon="el-icon-plus" fn="创建服务" mode="el-button">创建服务</GLButton> <GLButton type="primary" @click="handleCreate" style="margin-right: 30px" size="small" icon="el-icon-plus" fn="创建服务" mode="el-button">创建服务</GLButton>
<!-- </el-form-item> --> <!-- </el-form-item> -->
<el-form-item size="small" label="服务名称"> <el-form-item size="small" label="服务名称">
<el-input :size="size" v-model="searchForm.couponName" placeholder="请输入服务名称" clearable></el-input> <el-input :size="size" v-model="searchForm.couponName" placeholder="请输入服务名称" clearable></el-input>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> --> <el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<GLButton type="text" @click="handleLossOption(scope.scope)" fn="失效">失效</GLButton> <GLButton type="text" @click="handleLossOption(scope.scope)" fn="失效">失效</GLButton>
<GLButton type="text" @click="handleLook(scope.scope)" fn="查看服务" >查看</GLButton> <GLButton type="text" @click="handleLook(scope.scope)" fn="查看服务">查看</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton> <GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
</template> </template>
<template v-else-if="scope.scope.status == 3"> <template v-else-if="scope.scope.status == 3">
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
</template> </template>
<script> <script>
import { getServiceListApi, effectiveService, deleteService,getLoginCount } from '@/api/modules/service' import { getServiceListApi, effectiveService, deleteService, getLoginCount } from '@/api/modules/service'
import url from "@/assets/empty.png" import url from '@/assets/empty.png'
import { serviceStatusList } from '@/common/constant' import { serviceStatusList } from '@/common/constant'
import tipPanel from '@/components/tipPanel/index.vue' import tipPanel from '@/components/tipPanel/index.vue'
export default { export default {
...@@ -67,8 +67,8 @@ export default { ...@@ -67,8 +67,8 @@ export default {
}, },
data() { data() {
return { return {
url:url, url: url,
isReload:true, isReload: true,
isFirstShow: false, isFirstShow: false,
panelContent: '会员服务:是由门店根据自店服务项目创建的线上服务券,如“一年十二次洗车券”、“陶瓷镀膜”等,客户购买后可到店出示服务券享受服务,门店扫码进行次数核销。', panelContent: '会员服务:是由门店根据自店服务项目创建的线上服务券,如“一年十二次洗车券”、“陶瓷镀膜”等,客户购买后可到店出示服务券享受服务,门店扫码进行次数核销。',
size: 'small', size: 'small',
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
searchForm: { searchForm: {
couponName: '', couponName: '',
merchantId: 44184606, merchantId: 44184606,
discountType:7//6:商品折扣券,7:会员服务 discountType: 7 //6:商品折扣券,7:会员服务
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数 // 表格参数
...@@ -99,6 +99,13 @@ export default { ...@@ -99,6 +99,13 @@ export default {
line: 1 line: 1
}, },
{ {
label: '预估成本/元',
prop: 'anticipatedCost ',
formatter: cellValue => {
return cellValue.anticipatedCost/100
}
},
{
label: '有效期', label: '有效期',
prop: 'effectiveType', prop: 'effectiveType',
addHtml: 'effectiveType' addHtml: 'effectiveType'
...@@ -125,7 +132,7 @@ export default { ...@@ -125,7 +132,7 @@ export default {
{ {
label: '创建时间', label: '创建时间',
prop: 'createdDate', prop: 'createdDate',
width:95 width: 95
} }
] ]
}, },
...@@ -139,13 +146,11 @@ export default { ...@@ -139,13 +146,11 @@ export default {
if (window.__POWERED_BY_QIANKUN__) { if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中 //运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId this.merchantId = this.$globalState.session.merchantId
this.searchForm.merchantId=this.merchantId this.searchForm.merchantId = this.merchantId
} }
this.getLoginCountFun() this.getLoginCountFun()
}, },
mounted () { mounted() {},
},
methods: { methods: {
getLoginCountFun() { getLoginCountFun() {
//loginType:4是查会员服务浏览次数 //loginType:4是查会员服务浏览次数
...@@ -179,13 +184,12 @@ export default { ...@@ -179,13 +184,12 @@ export default {
}, },
handleReset() { handleReset() {
this.isReload=false this.isReload = false
this.searchForm = { couponName: '', merchantId: this.merchantId, discountType:7 } this.searchForm = { couponName: '', merchantId: this.merchantId, discountType: 7 }
// this.handleSearch() // this.handleSearch()
this.$nextTick(()=>{ this.$nextTick(() => {
this.isReload=true this.isReload = true
}) })
}, },
handleSearch() { handleSearch() {
this.$refs.memberServiceRef.refreshTable() this.$refs.memberServiceRef.refreshTable()
...@@ -202,8 +206,8 @@ export default { ...@@ -202,8 +206,8 @@ export default {
handleCreate() { handleCreate() {
this.$router.push({ this.$router.push({
path: '/memberCenter/serviceAddUpdateLook', path: '/memberCenter/serviceAddUpdateLook',
query:{ query: {
$title:encodeURI('创建服务') $title: encodeURI('创建服务')
} }
}) })
}, },
...@@ -246,7 +250,7 @@ export default { ...@@ -246,7 +250,7 @@ export default {
query: { query: {
couponId: row.id, couponId: row.id,
title: '编辑', title: '编辑',
$title:encodeURI('编辑服务') $title: encodeURI('编辑服务')
} }
}) })
}, },
...@@ -256,7 +260,7 @@ export default { ...@@ -256,7 +260,7 @@ export default {
query: { query: {
couponId: row.id, couponId: row.id,
title: '查看', title: '查看',
$title:encodeURI('查看服务') $title: encodeURI('查看服务')
} }
}) })
}, },
...@@ -285,8 +289,7 @@ export default { ...@@ -285,8 +289,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/.el-input--small .el-input__inner {
/deep/.el-input--small .el-input__inner{
width: 215px; width: 215px;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!