Commit bbb19dfe by 李长胜

bugs修复

1 parent 4ca09950
......@@ -3,7 +3,7 @@ import { http } from '@/main'
// const defaultPath = 'scrm.api.live.'
//计算提示面板出现的次数,第一次显示,之后不显示
const getLoginCount =params=>{
params.method='org.ore.api.common.findLoginCount'
params.method='entmicro.api.common.findLoginCount'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
......
......@@ -23,7 +23,7 @@
<div slot="footer">
<slot name="btn-start"></slot>
<el-button :type="typeName" v-if="!noClose" :size="btnSize" @click="handleClose">关闭</el-button>
<el-button :type="typeName" v-if="!noClose" :size="btnSize" @click="handleClose">{{btnCloseLabel}}</el-button>
<el-button type="primary" v-if="!noBtnOk" :size="btnSize" @click="handleConfirm">{{ btnOkLabel }}</el-button>
<el-button type="primary" v-if="!noCancel" :size="btnSize" @click="handleClose">{{ btnCancelLabel }}</el-button>
<slot name="btn-middle"></slot>
......@@ -55,6 +55,10 @@ export default {
type: Boolean,
default: true
},
btnCloseLabel:{
type: String,
default: '关闭'
},
btnOkLabel: {
type: String,
default: '确定'
......
......@@ -7,7 +7,7 @@
<div class="live-room container">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
<el-form-item size="small" label="服务名称" prop="couponName" style="width: 420px">
<el-input size="small" :disabled="disabledContent" v-model="ruleForm.couponName" maxlength="20" placeholder="请输入服务名称,如“精洗轿车”"></el-input>
<el-input size="small" :disabled="disabledContent" v-model.trim="ruleForm.couponName" maxlength="20" placeholder="请输入服务名称,如“精洗轿车”"></el-input>
</el-form-item>
<el-form-item size="small" label="有效期" prop="effectiveType">
......@@ -18,11 +18,11 @@
<el-radio :label="1">
领取后
<el-input
v-model="effectiveDays"
v-model="ruleForm.effectiveDays"
maxlength="4"
@input="
val => {
effectiveDays = val.replace(/[^\d]/g, '')
ruleForm.effectiveDays = val.replace(/[^\d]/g, '')
}
"
:disabled="disabledContent"
......@@ -47,18 +47,18 @@
<el-radio :label="1">
有效期内可使用
<el-button @click="sub1" class="addsubBtn" :disabled="disabledContent">-</el-button>
<span class="numWrap">{{ limitTime1 }}</span>
<span class="numWrap">{{ ruleForm.limitTime1 }}</span>
<el-button @click="add1" class="addsubBtn" :disabled="disabledContent">+</el-button>
次
</el-radio>
<el-radio :label="2">
有效期内每
<el-input
v-model="limitDays"
v-model="ruleForm.limitDays"
maxlength="4"
@input="
val => {
limitDays = val.replace(/[^\d]/g, '')
ruleForm.limitDays = val.replace(/[^\d]/g, '')
}
"
:disabled="disabledContent"
......@@ -68,7 +68,7 @@
></el-input>
天内可使用
<el-button @click.stop="sub2" class="addsubBtn" :disabled="disabledContent">-</el-button>
<span class="numWrap">{{ limitTime2 }}</span>
<span class="numWrap">{{ ruleForm.limitTime2 }}</span>
<el-button @click.stop="add2" class="addsubBtn" :disabled="disabledContent">+</el-button>
次
</el-radio>
......@@ -118,14 +118,24 @@
}"
>
<el-button type="primary" @click="submitForm('ruleForm')" size="small">创建</el-button>
<el-button type="primary" @click="resetForm('ruleForm')" size="small">取消</el-button>
<el-button type="primary" @click="goBack" size="small">取消</el-button>
</div>
<!-- :hasScroll="false" :noBtnOk="true" :noCancel="true" :noClose="false" -->
<glsx-dialog title="" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isDialogVisible" :showClose="false" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<div class="content-body">
当前有内容信息未保存,是否继续取消
</div>
</glsx-dialog>
</div>
</template>
<script>
import glsxDialog from '@/components/glsx-dialog'
import { createService, detailService, updateService } from '@/api/modules/service'
export default {
components: {
glsxDialog
},
data() {
var checkZero = (rule, value, callback) => {
setTimeout(() => {
......@@ -153,6 +163,7 @@ export default {
}, 1000)
}
return {
isDialogVisible:false,
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now()- 8.64e7// 如果没有后面的-8.64e7就是不可以选择今天的
......@@ -167,17 +178,18 @@ export default {
// type: [],
// resource: '',
effectiveType: 3, //有效期(默认无有效期)
effectiveDays: '',
customUseLimit: 0, //使用限制(默认不限制使用次数)
limitTime1: 1,
limitDays: '30',
limitTime2: 5,
vipPrice: '',
shopPrice: '',
stock: '',
useDescription: '',
daterange: []
},
effectiveDays: '',
limitTime1: 1,
limitDays: '30',
limitTime2: 5,
copyRuleForm:{},
rules: {
couponName: [{ required: true, message: '请输入服务名称', trigger: 'blur' }],
// region: [{ required: true, message: '请选择活动区域', trigger: 'change' }],
......@@ -217,15 +229,15 @@ export default {
if (this.ruleForm.customUseLimit == 0) {
return `不限制使用次数`
} else if (this.ruleForm.customUseLimit == 1) {
return `有效期内可使用${this.limitTime1}次`
return `有效期内可使用${this.ruleForm.limitTime1}次`
} else if (this.ruleForm.customUseLimit == 2) {
return `有效期内每${this.limitDays}天内可使用${this.limitTime2}次`
return `有效期内每${this.ruleForm.limitDays}天内可使用${this.ruleForm.limitTime2}次`
}
return '不限制使用次数'
},
effectiveRangeText() {
if (this.ruleForm.effectiveType == 1) {
return `领取后${this.effectiveDays}天内有效`
return `领取后${this.ruleForm.effectiveDays}天内有效`
} else if (this.ruleForm.effectiveType == 2) {
return `${this.ruleForm.daterange[0]}-${this.ruleForm.daterange[1]}`
}
......@@ -234,6 +246,7 @@ export default {
// 有效期内可使用3次
},
created() {
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm))//深拷贝一份数据
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
......@@ -259,21 +272,22 @@ export default {
this.ruleForm.customUseLimit = res.useType
if (res.effectiveType == 1) {
this.effectiveDays = res.effectiveDays
this.ruleForm.effectiveDays = res.effectiveDays
}
if (res.effectiveType == 2) {
this.ruleForm.daterange = [res.effectiveStartTime, res.effectiveEndTime]
}
// this.limitTime1 = ''
// this.limitTime2 = ''
// this.ruleForm.limitTime1 = ''
// this.ruleForm.limitTime2 = ''
// this.limitDays = ''
if (res.useType == 1) {
this.limitTime1 = res.useAmount
this.ruleForm.limitTime1 = res.useAmount
}
if (res.useType == 2) {
this.limitTime2 = res.useAmount
this.limitDays = res.useLimitDays
this.ruleForm.limitTime2 = res.useAmount
this.ruleForm.limitDays = res.useLimitDays
}
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm))//深拷贝一份数据
})
},
submitForm(formName) {
......@@ -302,11 +316,11 @@ export default {
//使用限制
params.useType = this.ruleForm.customUseLimit
//有效期 effectiveType: 3 1 2
if (this.ruleForm.effectiveType == 1 && !parseInt(this.effectiveDays)) {
if (this.ruleForm.effectiveType == 1 && !parseInt(this.ruleForm.effectiveDays)) {
this.$message.error('请输入有效期')
return false
}
params.effectiveDays = this.effectiveDays
params.effectiveDays = this.ruleForm.effectiveDays
if (this.ruleForm.effectiveType == 2) {
if (!this.ruleForm.daterange) {
this.$message.error('请输入有效期')
......@@ -318,20 +332,20 @@ export default {
}
//使用限制
if (this.ruleForm.customUseLimit == 1) {
if (!parseInt(this.limitTime1)) {
if (!parseInt(this.ruleForm.limitTime1)) {
this.$message.error('请输入有效期使用次数')
return false
} else {
params.useAmount = this.limitTime1
params.useAmount = this.ruleForm.limitTime1
}
}
if (this.ruleForm.customUseLimit == 2) {
if (!parseInt(this.limitTime2) || !parseInt(this.limitDays)) {
if (!parseInt(this.ruleForm.limitTime2) || !parseInt(this.ruleForm.limitDays)) {
this.$message.error('请输入有效期使用次数')
return false
} else {
params.useLimitDays = this.limitDays
params.useAmount = this.limitTime2
params.useLimitDays = this.ruleForm.limitDays
params.useAmount = this.ruleForm.limitTime2
}
}
......@@ -377,11 +391,23 @@ export default {
}
})
},
resetForm(formName) {
this.$router.push('/memberCenter/service')
// resetForm(formName) {
// this.$router.push('/memberCenter/service')
// this.$refs[formName].resetFields()
},
// },
goBack() {
if(JSON.stringify(this.ruleForm)==JSON.stringify(this.copyRuleForm)){
this.$router.push('/memberCenter/service')
}else{
// this.$message.error('是否保存信息')
this.isDialogVisible=true
}
},
handleClose(){
this.isDialogVisible=false
},
handleConfirm(){
this.$router.push('/memberCenter/service')
},
oninput(value) {
......@@ -416,22 +442,22 @@ export default {
return str
},
sub1() {
if (this.limitTime1 <= 0) {
if (this.ruleForm.limitTime1 <= 0) {
return
}
this.limitTime1--
this.ruleForm.limitTime1--
},
add1() {
this.limitTime1++
this.ruleForm.limitTime1++
},
sub2() {
if (this.limitTime2 <= 0) {
if (this.ruleForm.limitTime2 <= 0) {
return
}
this.limitTime2--
this.ruleForm.limitTime2--
},
add2() {
this.limitTime2++
this.ruleForm.limitTime2++
}
}
}
......@@ -573,5 +599,19 @@ export default {
z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
/deep/ .el-dialog__body{
border-bottom: 1px solid #e6e6e6;
padding: 20px 25px;
.content-body{
font-size: 18px;
text-align: center;
font-weight: 400;
color: #333333;
}
}
/deep/ .el-dialog__footer {
text-align: center;
}
}
</style>
......@@ -26,7 +26,8 @@
</span>
</GLTable>
</div>
<glsx-dialog title="示例效果" width="1142px" :hasScroll="false" :noBtnOk="true" :noCancel="true" :noClose="false" btnCancelLabel="关闭" btnSize="small" :isVisible="isDialogVisible" :showClose="false" @closeDialog="handleClose" @confirmDialog="handleClose">
<!-- btnCancelLabel="关闭" -->
<glsx-dialog title="示例效果" width="1142px" :hasScroll="false" :noBtnOk="true" :noCancel="true" :noClose="false" btnSize="small" :isVisible="isDialogVisible" :showClose="false" @closeDialog="handleClose" @confirmDialog="handleClose">
<div class="content-body">
<div class="content-item col1">
<div class="subTitle">
......
......@@ -46,7 +46,7 @@
}"
>
<el-button type="primary" @click="submitForm('ruleForm')" size="small">创建</el-button>
<el-button type="primary" @click="resetForm('ruleForm')" size="small">取消</el-button>
<el-button type="primary" @click="goBack" size="small">取消</el-button>
</div>
<glsx-dialog title="套餐服务" width="1142px" :noCancel="true" :noClose="false" btnSize="small" :isVisible="setmealDialogVisible" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<div class="content-body">
......@@ -97,6 +97,11 @@
</div>
</div>
</glsx-dialog>
<glsx-dialog title="" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isTipDialogVisible" :showClose="false" @closeDialog="handleTipClose" @confirmDialog="handleTipConfirm">
<div class="content-body">
当前有内容信息未保存,是否继续取消
</div>
</glsx-dialog>
</div>
</template>
......@@ -126,6 +131,8 @@ export default {
setmealContentRules: false,
//弹窗
setmealDialogVisible: false,
//弹窗2(提示弹窗)
isTipDialogVisible:false,
selectNum: 0,
totalPrice: 0,
id: this.$route.query.id || 0
......@@ -317,10 +324,10 @@ export default {
console.log('配置接口', res.data)
})
},
resetForm(formName) {
// this.$refs[formName].resetFields()
this.$router.go(-1)
},
// resetForm(formName) {
// this.$router.go(-1)
// },
goBack() {
this.$router.go(-1)
},
......@@ -383,6 +390,12 @@ export default {
// return preValue + choseItem.vipPrice * choseItem.serviceQuantity
// }, 0)
this.getSetmealServiceFun()
},
handleTipClose(){
this.isTipDialogVisible=false
},
handleTipConfirm(){
this.$router.go(-1);
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!