Commit cf86c7f9 by 前端

Merge branch 'v3.13.1' into 'master'

V3.13.1

See merge request !521
2 parents e31572c7 bff27f9f
......@@ -53,15 +53,15 @@ export default {
}
},
created() {
document.onkeydown = function() {
var evt = window.event || arguments[0]
if (evt && evt.keyCode == 13) {
if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true
if (typeof evt.stopPropagation == 'function') evt.stopPropagation()
return false
}
return true
}
// document.onkeydown = function() {
// var evt = window.event || arguments[0]
// if (evt && evt.keyCode == 13) {
// if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true
// if (typeof evt.stopPropagation == 'function') evt.stopPropagation()
// return false
// }
// return true
// }
this.myMsg = this.msg
this.myMessage = this.message
}
......
......@@ -128,7 +128,8 @@ const orderSourceList = [
{ confId: '1', confName: '商城订单' },
{ confId: '2', confName: '直播订单' },
{ confId: '3', confName: '秒杀订单' },
{ confId: '4', confName: '众筹订单' }
{ confId: '4', confName: '众筹订单' },
{ confId: '6', confName: '配置升级订单' }
]
const deliveryTypeList = [
......@@ -212,6 +213,14 @@ const memberTypeList = [
{
confId: 2,
confName: '试用会员'
},
{
confId: 3,
confName: '金卡会员'
},
{
confId: 4,
confName: '银卡会员'
}
]
const stateList = [
......
......@@ -88,7 +88,7 @@ export default {
getList(page, isMounted = false) {
var params = {
goodsStatus: 1,
goodsSource: 1,
goodsSources: [1,4],
currentPage: 1,
pageNum: 1,
pageSize: 100000,
......
......@@ -38,7 +38,8 @@ export async function bootstrap({history, common, messenger, globalState, router
secret,
sign_common,
request_common,
request_merchant
request_merchant,
merchantId
} = await fetchConfig(false)
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
......@@ -46,6 +47,7 @@ export async function bootstrap({history, common, messenger, globalState, router
Vue.prototype.$common = common
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
Vue.prototype.$hmdMerchantId = merchantId
// 集团版集团账号
Vue.prototype.$isGroupUp = globalState.session.accountLevel != 4
Vue.prototype.$http = new common.Http({
......
......@@ -117,6 +117,7 @@ export default {
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'
}
params.merchantId = this.$globalState.session.merchantId
delete params.createDate
return params
},
......
......@@ -24,9 +24,7 @@
<div :class="editForm.status == 3 ? 'darkColor' : ''" class="ctime">
<!-- <span class="ctime_name">使用限制:</span> -->
<span v-show="editForm.denomination" style="font-size: 12px;">¥</span>
<span class="ctime_content" style="font-size: 20px;font-weight: 600;" v-show="editForm.denomination">{{
editForm.denomination
}}</span>
<span class="ctime_content" style="font-size: 20px;font-weight: 600;" v-show="editForm.denomination">{{ editForm.denomination }}</span>
<span class="ctime_content">{{ editForm.useBarriers == 1 ? '无门槛' : '满' + editForm.full + '元可用' }}</span>
</div>
<div class="ccode">
......@@ -81,9 +79,9 @@
<br />
<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-date-picker v-model="editForm.effectiveTime" @change="haveChange" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOption" :default-time="defaultTime" :format="format" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable>
</el-date-picker>
<el-date-picker v-model="editForm.effectiveTime" @click="getStartTime" @change="haveChange" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOption" :default-time="defaultTime" :format="format" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio>
<div class="el-form-item__error" v-if="isEffective">开始时间需大于当前时间</div>
</el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'">
......@@ -106,16 +104,15 @@
<template slot="denominationHtml">
<el-input v-model="editForm.denomination" id="denomination" placeholder="请输入面值" :disabled="apear != 'couponAdd'" @blur.native.capture="editForm.useChannel == 1 && denominationBlur($event)"></el-input>
元
<span style="color: red; margin-left: 15px" v-if="priceFlag && editForm.useChannel == 1">{{
selectedAllProList.length ? '存在零售价低于代金券的商品' : '系统暂无已创建的商品,请先创建好商品后再配置代金券'
}}</span>
<span style="color: red; margin-left: 15px" v-if="priceFlag && editForm.useChannel == 1">{{ selectedAllProList.length ? '存在零售价低于代金券的商品' : '系统暂无已创建的商品,请先创建好商品后再配置代金券' }}</span>
</template>
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span>
<div v-else>
<el-input :disabled="apear != 'couponAdd'" class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
<el-input :disabled="apear != 'couponAdd' || isLimitStock" class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
张
<el-checkbox style="margin-left:10px;" v-if="!isHmd" v-model="isLimitStock" :disabled="disabledContent" @change="updateStock">不限制库存</el-checkbox>
</div>
</template>
<!-- 只有使用途径为线上商品时才有效,到店核销时屏蔽 -->
......@@ -165,6 +162,9 @@ export default {
name: 'editCashCoupon',
data() {
return {
isHmd: true,
isEffective:false,
isLimitStock: false,
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: 'yyyy-MM-dd HH:mm:ss', // 日期显示格式
showSubmit: true,
......@@ -303,7 +303,7 @@ export default {
},
{
label: '库存',
name: 'stock',
name: !this.isLimitStock ? 'stock' : '',
addHtml: 'stock'
// width: '150px',
// type: 'input'
......@@ -324,7 +324,7 @@ export default {
addHtml: 'editHtml',
isHide: true
}
],
]
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
......@@ -353,6 +353,13 @@ export default {
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
this.editRule.stock[0].required = !this.$isGroupUp
},
......@@ -466,11 +473,13 @@ export default {
'editForm.effectiveType'(newValue, oldValue) {
if (newValue == 3) {
this.isEffective = false
this.$refs['effectiveTime'].resetField()
this.$refs['effectiveDays'].resetField()
} else if (newValue == 2) {
this.$refs['effectiveDays'].resetField()
} else if (newValue == 1) {
this.isEffective = false
this.$refs['effectiveTime'].resetField()
}
},
......@@ -483,10 +492,15 @@ export default {
},
methods: {
updateStock(e) {
this.editRule.stock[0].required = !e
this.editForm.stock = ''
},
setAllDisabled(editName) {
this[editName].forEach(item => {
item.isDisabled = true
})
this[editName] &&
this[editName].forEach(item => {
item.isDisabled = true
})
},
editCoupon(attribute) {
attribute.forEach(item => {
......@@ -495,10 +509,12 @@ export default {
})
},
haveChange() {
this.isEffective = false
let oDateOne = new Date(this.editForm.effectiveTime[0]).getTime()
let timeStamp = new Date().getTime()
if (oDateOne < timeStamp) {
this.editForm.effectiveTime = []
this.isEffective = true
// this.editForm.effectiveTime = []
}
},
// 编辑按钮
......@@ -520,7 +536,7 @@ export default {
pageSize: 100000,
pageStart: 0,
goodsStatus: 1,
goodsSource: 1,
goodsSources: [1, 4],
goodsName: ''
}
if (goodsName) {
......@@ -627,6 +643,10 @@ export default {
// if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// }
if (res.limitStockFlag == 2) {
this.isLimitStock = true
this.editRule.stock[0].required = false
}
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
if (this.editForm.effectiveType == 2) {
......@@ -720,8 +740,8 @@ export default {
//面值
obj.denomination = form.denomination
//库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
obj.limitStockFlag = this.$isGroupUp || this.isLimitStock ? 2 : 1
if (!this.$isGroupUp || !this.isLimitStock) {
obj.stock = form.stock
}
// else {
......@@ -767,6 +787,9 @@ export default {
// merchantErrorObj = errorObj
// })
// }
if(this.isEffective){
return
}
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
}
......@@ -796,15 +819,16 @@ export default {
}
console.log(params)
this.loading = true
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
this.$apis.couponManage[method](params)
.then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
......@@ -826,7 +850,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => { })
.catch(() => {})
} else {
this.cancelJump()
}
......
......@@ -98,8 +98,11 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span>
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
张
<template v-else>
<el-input :disabled="apear != 'couponAdd' || isLimitStock" class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
张
<el-checkbox style="margin-left:10px;" v-if="!isHmd" v-model="isLimitStock" :disabled="apear != 'couponAdd'" @change="updateStock">不限制库存</el-checkbox>
</template>
</template>
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
......@@ -126,6 +129,8 @@ export default {
name: 'editDiscountCoupon',
data() {
return {
isHmd: true,
isLimitStock: false,
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: 'yyyy-MM-dd HH:mm:ss', // 日期显示格式
showSubmit: true,
......@@ -242,7 +247,7 @@ export default {
addHtml: 'editHtml',
isHide: true
}
],
]
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
......@@ -271,6 +276,13 @@ export default {
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
this.editRule.stock[0].required = !this.$isGroupUp
},
......@@ -348,10 +360,15 @@ export default {
}
},
methods: {
updateStock(e) {
this.editRule.stock[0].required = !e
this.editForm.stock = ''
},
setAllDisabled(editName) {
this[editName].forEach(item => {
item.isDisabled = true
})
this[editName] &&
this[editName].forEach(item => {
item.isDisabled = true
})
},
editCoupon(attribute) {
attribute.forEach(item => {
......@@ -399,6 +416,10 @@ export default {
// if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// }
if (res.limitStockFlag == 2) {
this.isLimitStock = true
this.editRule.stock[0].required = false
}
//使用限制,满多少元可用
if (this.editForm.useBarriers == 2) {
this.editForm.full = this.editForm.full
......@@ -475,8 +496,8 @@ export default {
obj.full = form.full
}
//库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
obj.limitStockFlag = this.$isGroupUp || this.isLimitStock ? 2 : 1
if (!this.$isGroupUp || !this.isLimitStock) {
obj.stock = form.stock
}
// else {
......@@ -529,15 +550,16 @@ export default {
method = 'createCouponApi' //后台创建优惠券
}
this.loading = true
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
this.$apis.couponManage[method](params)
.then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
......@@ -559,7 +581,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => { })
.catch(() => {})
} else {
this.cancelJump()
}
......
......@@ -57,9 +57,12 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span>
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
<!-- <span slot="suffix">张</span> -->
</el-input>
<template v-else>
<el-input :disabled="apear != 'couponAdd' || isLimitStock" class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
<!-- <span slot="suffix">张</span> -->
</el-input>
<el-checkbox style="margin-left:10px;" v-if="!isHmd" v-model="isLimitStock" :disabled="apear != 'couponAdd'" @change="updateStock">不限制库存</el-checkbox>
</template>
</template>
<template slot="directionalFlagHtml">
<div>
......@@ -114,6 +117,8 @@ export default {
name: 'editDiscountCoupon',
data() {
return {
isHmd: true,
isLimitStock: false,
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: 'yyyy-MM-dd HH:mm:ss', // 日期显示格式
showSubmit: true,
......@@ -213,7 +218,7 @@ export default {
addHtml: 'editHtml',
isHide: true
}
],
]
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
......@@ -242,6 +247,13 @@ export default {
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
this.editRule.stock[0].required = !this.$isGroupUp
},
......@@ -307,10 +319,15 @@ export default {
},
methods: {
updateStock(e) {
this.editRule.stock[0].required = !e
this.editForm.stock = ''
},
setAllDisabled(editName) {
this[editName].forEach(item => {
item.isDisabled = true
})
this[editName] &&
this[editName].forEach(item => {
item.isDisabled = true
})
},
editCoupon(attribute) {
attribute.forEach(item => {
......@@ -347,6 +364,10 @@ export default {
// if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// }
if (res.limitStockFlag == 2) {
this.isLimitStock = true
this.editRule.stock[0].required = false
}
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
if (this.editForm.effectiveType == 2) {
......@@ -406,8 +427,8 @@ export default {
}
//库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
obj.limitStockFlag = this.$isGroupUp || this.isLimitStock ? 2 : 1
if (!this.$isGroupUp || !this.isLimitStock) {
obj.stock = form.stock
}
// else {
......@@ -458,15 +479,16 @@ export default {
method = 'createCouponApi' //后台创建优惠券
}
this.loading = true
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
this.$apis.couponManage[method](params)
.then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
......@@ -488,7 +510,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => { })
.catch(() => {})
} else {
this.cancelJump()
}
......
......@@ -18,11 +18,19 @@
<!-- effectiveType:1, effectiveDays:5 -->
<el-radio :label="1" id="effectiveDays">
领取后
<el-input v-model="ruleForm.effectiveDays" maxlength="4" @input="
<el-input
v-model="ruleForm.effectiveDays"
maxlength="4"
@input="
val => {
ruleForm.effectiveDays = val.replace(/[^\d]/g, '')
}
" :disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 1" placeholder="请输入" size="small" style="width: 100px"></el-input>
"
:disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 1"
placeholder="请输入"
size="small"
style="width: 100px"
></el-input>
天内有效
</el-radio>
<!-- effectiveStartTime effectiveEndTime +具体时间 -->
......@@ -46,11 +54,19 @@
</el-radio>
<el-radio :label="2" id="limitDays">
有效期内每
<el-input v-model="ruleForm.limitDays" maxlength="4" @input="
<el-input
v-model="ruleForm.limitDays"
maxlength="4"
@input="
val => {
ruleForm.limitDays = val.replace(/[^\d]/g, '')
}
" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2" placeholder="请输入" size="small" style="width: 100px"></el-input>
"
:disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2"
placeholder="请输入"
size="small"
style="width: 100px"
></el-input>
天内可使用
<el-button @click.stop="sub2" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2">-</el-button>
<span class="numWrap">{{ ruleForm.limitTime2 }}</span>
......@@ -69,12 +85,13 @@
元
</el-form-item>
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<el-form-item size="small" label="库存:" prop="stock">
<el-form-item size="small" label="库存:" :prop="!isLimitStock ? 'stock' : ''">
<!-- <el-input size="small" :disabled="title == '查看'" maxlength="6" v-model.number="ruleForm.stock" placeholder="请输入"></el-input> -->
<span v-if="$isGroupUp">无库存限制</span>
<div v-else>
<el-input :disabled="title == '查看'" class="w-150" v-model="ruleForm.stock" placeholder="请输入库存"></el-input>
<el-input :disabled="title == '查看' || isLimitStock" class="w-150" v-model="ruleForm.stock" placeholder="请输入库存"></el-input>
张
<el-checkbox style="margin-left:10px;" v-if="!isHmd" v-model="isLimitStock" :disabled="title == '查看'" @change="updateStock">不限制库存</el-checkbox>
</div>
</el-form-item>
<el-form-item size="small" label="使用说明:" prop="useDescription">
......@@ -190,7 +207,7 @@ export default {
return callback(new Error('库存不能为空或负数'))
}
setTimeout(() => {
if (!(/^[0-9]*$/.test(value))) {
if (!/^[0-9]*$/.test(value)) {
callback(new Error('请输入数字值'))
} else {
if (value < 0) {
......@@ -202,7 +219,9 @@ export default {
}, 1000)
}
return {
isHmd: true,
timer: Function,
isLimitStock: false,
isEdit: false,
showSubmit: true,
disabledDescription: false,
......@@ -228,7 +247,8 @@ export default {
shopPrice: '',
stock: '',
useDescription: '',
daterange: []
daterange: [],
limitStockFlag: 1
// scopeApplication: ''
},
copyRuleForm: {},
......@@ -254,7 +274,7 @@ export default {
},
merchantId: '',
merchantName: '',
title: this.$route.query.title || '',
title: this.$route.query.title || ''
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
......@@ -317,6 +337,8 @@ export default {
this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
if (this.title == '编辑' || this.title == '查看') {
this.isEdit = true
var breadcrumbTitle = this.title
......@@ -340,6 +362,9 @@ export default {
}
},
methods: {
updateStock(e) {
this.ruleForm.stock = ''
},
setAllDisabled(editName) {
this[editName].forEach(item => {
item.isDisabled = true
......@@ -357,9 +382,9 @@ export default {
this.ruleForm = res
this.ruleForm.anticipatedCost = (res.anticipatedCost / 100).toFixed(2)
this.ruleForm.customUseLimit = res.useType
// if (this.$isGroupUp) {
// this.ruleForm.scopeApplication = res.scopeApplication + ''
// }
if (res.limitStockFlag == 2) {
this.isLimitStock = true
}
if (res.effectiveType == 1) {
this.ruleForm.effectiveDays = res.effectiveDays
}
......@@ -467,8 +492,8 @@ export default {
params.shopPrice = this.ruleForm.shopPrice
// params.stock = this.ruleForm.stock
//库存
params.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
params.limitStockFlag = this.$isGroupUp || this.isLimitStock ? 2 : 1
if (!this.$isGroupUp || !this.isLimitStock) {
params.stock = this.ruleForm.stock
}
// else {
......
......@@ -18,7 +18,10 @@
<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="giftNameSlot" class="gift-name-slot">{{editForm.name}} <div class="group-label" v-if="editForm.merchantType==2">集团</div></div>
<div slot="giftNameSlot" class="gift-name-slot">
{{ editForm.name }}
<div class="group-label" v-if="editForm.merchantType == 2">集团</div>
</div>
<div slot="couponListBlock" class="gift-block" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-title">
预估成本:
......@@ -45,11 +48,15 @@
<div slot="receiveDetails" :class="editForm.receiveRule == 4 ? 'user' : ''">
<span v-if="editForm.receiveRule == 2 && editForm.receiveWay && editForm.receiveDetails">{{ `${editForm.receiveWay == '1' ? '手机号:' : '车架号后6位:'}${editForm.receiveDetails}` }}</span>
<span v-if="editForm.receiveRule == 1">{{ editForm.receiveWay == '1' ? '指定手机号' : '指定车架号后6位' }}:</span>
<span v-if="editForm.receiveRule == 4"><span style="color: #f56c6c;margin-right: 4px;">*</span>用户手机号:</span>
<span v-if="editForm.receiveRule == 4">
<span style="color: #f56c6c;margin-right: 4px;">*</span>
用户手机号:
</span>
<div v-if="editForm.receiveRule == 1 || editForm.receiveRule == 4" class="phone-wrap">
<span :class="['phone', editForm.receiveWay == 1 ? 'realTel' : 'realNum']" v-for="(item, id) in receiveDetailList" :key="id">{{ item }}</span>
</div>
</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)">
......@@ -58,6 +65,10 @@
</el-tag>
</div>
</div>
<div slot="giveMemberFlag" v-if="isHmd">
<span class="form-label">会员赠送:</span>
{{ editForm.giveMemberType == 1 ? '普通会员' : editForm.giveMemberType == 2 ? '银卡会员' : '金卡会员' }}
</div>
</glsx-combi-form>
<div class="approval_note_container">
<div class="line"></div>
......@@ -85,6 +96,7 @@ export default {
name: 'giftDetail',
data() {
return {
isHmd: true,
size: 'small',
title: '礼包详情',
loading: false,
......@@ -150,7 +162,7 @@ export default {
staffList: [{ required: true, message: '请选择发放员工', trigger: 'change' }],
approveFlag: [{ required: true, message: '请选择审批要求', trigger: 'change' }],
stock: [{ required: true, message: '请选择库存数量', trigger: 'change' }],
receiveRule: [{ required: true, message: '请选择领取规则设置', trigger: 'change' }],
receiveRule: [{ required: true, message: '请选择领取规则设置', trigger: 'change' }]
},
isEdit: true,
editFormData: [
......@@ -181,7 +193,7 @@ export default {
addHtml: 'approveFlagBlock',
isHide: false
},
{
{
label: '领取规则设置',
name: 'receiveRule',
type: 'radio',
......@@ -209,13 +221,19 @@ export default {
confName: '直接发送到小程序卡包',
suffixSonSlot: 'cardHolder'
}
]},
]
},
{
label: '',
name: 'receiveWay',
addHtml: 'receiveDetails'
},
{
label: '',
name: 'giveMemberFlag',
addHtml: 'giveMemberFlag'
},
{
label: '发放员工',
name: 'staffList',
addHtml: 'staffListBlock'
......@@ -232,7 +250,14 @@ export default {
approvalStatusColor: ['#FF6D00', '#2CCA74', '#EB4E4E', '#999999', '#999999']
}
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
},
mounted() {
this.setMinHeight()
this.routeInfo = this.$route.query
......@@ -249,13 +274,14 @@ export default {
res.data.createdDate = dayjs(res.data.createdDate).format('YYYY-MM-DD HH:mm:ss')
res.data.updatedDate = dayjs(res.data.updatedDate).format('YYYY-MM-DD HH:mm:ss')
this.editForm = res.data
if(res?.data?.receiveRule == 4){
console.log(this.editForm)
if (res?.data?.receiveRule == 4) {
let target = this.editFormData.find(item => item.name == 'stock')
let targets = this.editFormData.find(item => item.name == 'approveFlag')
target.isHide = true
targets.isHide = true
}
if(res?.data?.receiveRule == 1){
if (res?.data?.receiveRule == 1) {
let targetss = this.editFormData.find(item => item.name == 'receiveWay')
targetss.label = '领取条件'
}
......@@ -321,38 +347,38 @@ export default {
border: 1px solid #e5e5e5;
}
.detail-page {
#receiveRule{
.el-radio-group{
#receiveRule {
.el-radio-group {
.is-checked {
.el-radio__input.is-checked .el-radio__inner{
border-color:#5850ff;
&::after{
background-color: #5850ff;
}
.el-radio__input.is-checked .el-radio__inner {
border-color: #5850ff;
&::after {
background-color: #5850ff;
}
}
}
.el-radio__label{
color: #333333!important;
.el-radio__label {
color: #333333 !important;
}
}
}
}
.marketing.edit-gift {
// 礼包
.gift-name-slot{
.gift-name-slot {
display: flex;
align-items: center;
.group-label{
.group-label {
width: 42px;
height: 20px;
line-height: 20px;
text-align: center;
background: rgba(255,101,61,0.15);
background: rgba(255, 101, 61, 0.15);
border-radius: 4px;
margin-left: 4px;
font-size: 12px;
display: inline-block;
color: #FF653D;
color: #ff653d;
}
}
.gift-block {
......@@ -531,4 +557,10 @@ export default {
.user {
margin-left: 144px;
}
.form-label {
width: 154px;
color: #666666;
display: inline-block;
text-align: right;
}
</style>
......@@ -29,6 +29,12 @@
</div>
<div class="el-form-item__error" v-if="setmealContentRules">请选择套餐</div>
</el-form-item>
<el-form-item size="small" label="会员专享:" v-if="isHmd" prop="memberPayFlags">
<el-checkbox-group v-model="ruleForm.memberPayFlags">
<el-checkbox v-for="(item, index) in memberList" :key="index" :label="item.name">{{ item.label }}</el-checkbox>
</el-checkbox-group>
<span class="give-tip" style=" margin: -15px 0 0 154px;">仅勾选的等级用户方可购买会员套餐</span>
</el-form-item>
<el-form-item label="赠送金卡会员:" prop="giveGoldFlag" v-if="showGh && accountLevel == 4">
<el-radio-group v-model="ruleForm.giveGoldFlag">
<el-radio :label="2">赠送</el-radio>
......@@ -113,6 +119,7 @@ export default {
}
}
return {
isHmd: true,
memberPrice: '', //会员卡价格
sloading: false,
ruleForm: {
......@@ -122,13 +129,15 @@ export default {
// couponList:[],
notes: '',
giveGoldFlag: '',
packageImg: ''
packageImg: '',
memberPayFlags: []
},
copyRuleForm: {}, //用于检查页面信息是否改动
rules: {
packageName: [{ required: true, message: '请输入套餐名称', trigger: 'blur' }],
packagePrice: [{ required: true, validator: validatePrice, trigger: 'blur' }],
giveGoldFlag: [{ required: true, message: '请选择金卡会员', trigger: 'change' }]
giveGoldFlag: [{ required: true, message: '请选择金卡会员', trigger: 'change' }],
memberPayFlags: [{ required: true, message: '请选择会员专享', trigger: 'change' }]
},
picOptions: {
width: '104px',
......@@ -142,8 +151,26 @@ export default {
key: 'sharePosterImg',
isClose: true
},
memberList: [
{
label: '普通用户',
name: 2
},
{
label: '普通会员',
name: 3
},
{
label: '银卡会员',
name: 4
},
{
label: '金卡用户',
name: 5
}
],
packageImgArr: [],
sharePosterImgArr:[],
sharePosterImgArr: [],
allItemList: [],
choseItemList: [], //['一年12次洗车券×1', '车身打蜡×2', '全车镀膜×1'],
copyChoseItemList: [], //用于检查页面信息是否改动
......@@ -223,6 +250,8 @@ export default {
this.merchantName = this.$globalState.session.merchantName
this.accountLevel = this.$globalState.session.accountLevel
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
this.showGh = window.location.host.indexOf('cgacar') != -1
if (this.showGh) {
this.getCardContentFun()
......@@ -312,8 +341,9 @@ export default {
item.couponAmount = item.serviceQuantity
item.id = item.serviceId
})
this.packageImgArr =res.data.packageImg? [res.data.packageImg]:[]
this.sharePosterImgArr =res.data.sharePosterImg? [res.data.sharePosterImg]:[]
!res.data.memberPayFlags ? (this.ruleForm.memberPayFlags = []) : ''
this.packageImgArr = res.data.packageImg ? [res.data.packageImg] : []
this.sharePosterImgArr = res.data.sharePosterImg ? [res.data.sharePosterImg] : []
this.recoveryCoupon()
this.copyTotalPrice = this.totalPrice
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
......@@ -363,12 +393,12 @@ export default {
param.packagePrice = this.ruleForm.packagePrice
param.notes = this.ruleForm.notes
param.switchStatus = this.ruleForm.switchStatus ? 1 : 0
if (this.isHmd) param.memberPayFlags = this.ruleForm.memberPayFlags
if (this.showGh) {
param.giveGoldFlag = this.ruleForm.giveGoldFlag
if (this.accountLevel == 4) {
param.packageImg = this.ruleForm.packageImg
param.sharePosterImg = this.ruleForm.sharePosterImg
}
}
let lists = this.choseItemList
......@@ -406,12 +436,13 @@ export default {
params.packagePrice = this.ruleForm.packagePrice
params.notes = this.ruleForm.notes
params.switchStatus = this.ruleForm.switchStatus ? 1 : 0
// 海马刀传参
if (this.isHmd) params.memberPayFlags = this.ruleForm.memberPayFlags
if (this.showGh) {
params.giveGoldFlag = this.ruleForm.giveGoldFlag
if (this.accountLevel == 4) {
params.packageImg = this.ruleForm.packageImg
params.sharePosterImg = this.ruleForm.sharePosterImg
}
}
let list = this.choseItemList
......
......@@ -402,7 +402,7 @@ export default {
this.$refs.proGroupRef.tableHeightValues = ''
this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
if (item.specificationDetailList&&item.specificationDetailList.length > 1) {
let retailPriceList = JSON.parse(JSON.stringify(item.specificationDetailList))
retailPriceList.sort((a, b) => {
return a.retailPrice - b.retailPrice
......@@ -418,7 +418,7 @@ export default {
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
} else if (item.specificationDetailList&&item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
......
......@@ -523,7 +523,7 @@ export default {
this.$refs.proGroupRef.tableHeightValues = ''
this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
if (item.specificationDetailList&&item.specificationDetailList.length > 1) {
let retailPriceList = JSON.parse(JSON.stringify(item.specificationDetailList))
retailPriceList.sort((a, b) => {
return a.retailPrice - b.retailPrice
......@@ -539,7 +539,7 @@ export default {
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
} else if (item.specificationDetailList&&item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
......
......@@ -86,10 +86,10 @@ export default {
handleRates() {
const {marketingCustomerCount, reachCustomerCount, potentialCustomerCount, dealCustomerCount} = this.list
this.rates.reachRate = parseFloat(((reachCustomerCount / marketingCustomerCount) * 100).toFixed(2))
this.rates.reachRate = !marketingCustomerCount ? '-' : parseFloat(((reachCustomerCount / marketingCustomerCount) * 100).toFixed(2))
this.rates.percentConversion
= parseFloat(((potentialCustomerCount / reachCustomerCount)*100).toFixed(2))
this.rates.turnoverRatio = parseFloat(((dealCustomerCount / potentialCustomerCount)*100).toFixed(2))
= !reachCustomerCount ? '-' : parseFloat(((potentialCustomerCount / reachCustomerCount) * 100).toFixed(2))
this.rates.turnoverRatio = !potentialCustomerCount ? '-' : parseFloat(((dealCustomerCount / potentialCustomerCount) * 100).toFixed(2))
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!