Commit 0914e56f by 王志慧

fixed

1 parent 0ded8a0f
......@@ -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
}
......
......@@ -79,8 +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'">
......@@ -161,6 +162,7 @@ export default {
name: 'editCashCoupon',
data() {
return {
isEffective:false,
isLimitStock: false,
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: 'yyyy-MM-dd HH:mm:ss', // 日期显示格式
......@@ -463,11 +465,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()
}
},
......@@ -482,7 +486,7 @@ export default {
methods: {
updateStock(e) {
this.editRule.stock[0].required = !e
this.editForm.stock =''
this.editForm.stock = ''
},
setAllDisabled(editName) {
this[editName] &&
......@@ -497,10 +501,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 = []
}
},
// 编辑按钮
......@@ -773,6 +779,9 @@ export default {
// merchantErrorObj = errorObj
// })
// }
if(this.isEffective){
return
}
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
}
......
......@@ -824,7 +824,7 @@ export default {
})
if (this.editForm.receiveRule == 1 || this.editForm.receiveRule == 4) {
params.receiveDetailList = this.phoneList.map(item => item.tel)
let maxLength = 500
let maxLength = 1000
if (params.receiveDetailList && params.receiveDetailList.length > maxLength) {
return this.$message.error(`领取${this.receiveWay == 1 ? '手机号' : '车架号'}不能超过${maxLength}个`)
}
......
......@@ -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>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!