Commit 7787b966 by 王志慧

门店服务券添加不限制库存功能

1 parent ee554797
......@@ -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-model="isLimitStock" :disabled="disabledContent">不限制库存</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) {
......@@ -203,6 +220,7 @@ export default {
}
return {
timer: Function,
isLimitStock: false,
isEdit: false,
showSubmit: true,
disabledDescription: false,
......@@ -228,7 +246,8 @@ export default {
shopPrice: '',
stock: '',
useDescription: '',
daterange: []
daterange: [],
limitStockFlag: 1
// scopeApplication: ''
},
copyRuleForm: {},
......@@ -254,7 +273,7 @@ export default {
},
merchantId: '',
merchantName: '',
title: this.$route.query.title || '',
title: this.$route.query.title || ''
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
......@@ -357,9 +376,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 +486,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 {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!