Commit 7787b966 by 王志慧

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

1 parent ee554797
...@@ -18,11 +18,19 @@ ...@@ -18,11 +18,19 @@
<!-- effectiveType:1, effectiveDays:5 --> <!-- effectiveType:1, effectiveDays:5 -->
<el-radio :label="1" id="effectiveDays"> <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 => { val => {
ruleForm.effectiveDays = val.replace(/[^\d]/g, '') 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> </el-radio>
<!-- effectiveStartTime effectiveEndTime +具体时间 --> <!-- effectiveStartTime effectiveEndTime +具体时间 -->
...@@ -46,11 +54,19 @@ ...@@ -46,11 +54,19 @@
</el-radio> </el-radio>
<el-radio :label="2" id="limitDays"> <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 => { val => {
ruleForm.limitDays = val.replace(/[^\d]/g, '') 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> <el-button @click.stop="sub2" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2">-</el-button>
<span class="numWrap">{{ ruleForm.limitTime2 }}</span> <span class="numWrap">{{ ruleForm.limitTime2 }}</span>
...@@ -69,12 +85,13 @@ ...@@ -69,12 +85,13 @@
元 元
</el-form-item> </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> --> <!-- <el-input size="small" :disabled="title == '查看'" maxlength="6" v-model.number="ruleForm.stock" placeholder="请输入"></el-input> -->
<span v-if="$isGroupUp">无库存限制</span> <span v-if="$isGroupUp">无库存限制</span>
<div v-else> <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> </div>
</el-form-item> </el-form-item>
<el-form-item size="small" label="使用说明:" prop="useDescription"> <el-form-item size="small" label="使用说明:" prop="useDescription">
...@@ -190,7 +207,7 @@ export default { ...@@ -190,7 +207,7 @@ export default {
return callback(new Error('库存不能为空或负数')) return callback(new Error('库存不能为空或负数'))
} }
setTimeout(() => { setTimeout(() => {
if (!(/^[0-9]*$/.test(value))) { if (!/^[0-9]*$/.test(value)) {
callback(new Error('请输入数字值')) callback(new Error('请输入数字值'))
} else { } else {
if (value < 0) { if (value < 0) {
...@@ -203,6 +220,7 @@ export default { ...@@ -203,6 +220,7 @@ export default {
} }
return { return {
timer: Function, timer: Function,
isLimitStock: false,
isEdit: false, isEdit: false,
showSubmit: true, showSubmit: true,
disabledDescription: false, disabledDescription: false,
...@@ -228,7 +246,8 @@ export default { ...@@ -228,7 +246,8 @@ export default {
shopPrice: '', shopPrice: '',
stock: '', stock: '',
useDescription: '', useDescription: '',
daterange: [] daterange: [],
limitStockFlag: 1
// scopeApplication: '' // scopeApplication: ''
}, },
copyRuleForm: {}, copyRuleForm: {},
...@@ -254,7 +273,7 @@ export default { ...@@ -254,7 +273,7 @@ export default {
}, },
merchantId: '', merchantId: '',
merchantName: '', merchantName: '',
title: this.$route.query.title || '', title: this.$route.query.title || ''
// 适用门店 // 适用门店
// merchantRule: { // merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }] // scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
...@@ -357,9 +376,9 @@ export default { ...@@ -357,9 +376,9 @@ export default {
this.ruleForm = res this.ruleForm = res
this.ruleForm.anticipatedCost = (res.anticipatedCost / 100).toFixed(2) this.ruleForm.anticipatedCost = (res.anticipatedCost / 100).toFixed(2)
this.ruleForm.customUseLimit = res.useType this.ruleForm.customUseLimit = res.useType
// if (this.$isGroupUp) { if (res.limitStockFlag == 2) {
// this.ruleForm.scopeApplication = res.scopeApplication + '' this.isLimitStock = true
// } }
if (res.effectiveType == 1) { if (res.effectiveType == 1) {
this.ruleForm.effectiveDays = res.effectiveDays this.ruleForm.effectiveDays = res.effectiveDays
} }
...@@ -467,8 +486,8 @@ export default { ...@@ -467,8 +486,8 @@ export default {
params.shopPrice = this.ruleForm.shopPrice params.shopPrice = this.ruleForm.shopPrice
// params.stock = this.ruleForm.stock // params.stock = this.ruleForm.stock
//库存 //库存
params.limitStockFlag = this.$isGroupUp ? 2 : 1 params.limitStockFlag = this.$isGroupUp ||this.isLimitStock? 2 : 1
if (!this.$isGroupUp) { if (!this.$isGroupUp||!this.isLimitStock) {
params.stock = this.ruleForm.stock params.stock = this.ruleForm.stock
} }
// else { // else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!