Commit f9d3f554 by 王志慧

fixed

1 parent 2de7f921
......@@ -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,8 +79,7 @@
<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" @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>
</el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays">
......@@ -106,16 +103,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-model="isLimitStock" :disabled="disabledContent" @change="updateStock">不限制库存</el-checkbox>
</div>
</template>
<!-- 只有使用途径为线上商品时才有效,到店核销时屏蔽 -->
......@@ -165,6 +161,7 @@ export default {
name: 'editCashCoupon',
data() {
return {
isLimitStock: false,
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: 'yyyy-MM-dd HH:mm:ss', // 日期显示格式
showSubmit: true,
......@@ -303,7 +300,7 @@ export default {
},
{
label: '库存',
name: 'stock',
name: !this.isLimitStock ? 'stock' : '',
addHtml: 'stock'
// width: '150px',
// type: 'input'
......@@ -324,7 +321,7 @@ export default {
addHtml: 'editHtml',
isHide: true
}
],
]
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
......@@ -483,10 +480,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 => {
......@@ -520,7 +522,7 @@ export default {
pageSize: 100000,
pageStart: 0,
goodsStatus: 1,
goodsSources: [1,4],
goodsSources: [1, 4],
goodsName: ''
}
if (goodsName) {
......@@ -627,6 +629,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 +726,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 {
......@@ -796,15 +802,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 +833,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => { })
.catch(() => {})
} else {
this.cancelJump()
}
......
......@@ -98,8 +98,9 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<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>
<el-input :disabled="apear != 'couponAdd' || isLimitStock" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
张
<el-checkbox style="margin-left:10px;" v-model="isLimitStock" :disabled="apear != 'couponAdd'" @change="updateStock">不限制库存</el-checkbox>
</template>
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
......@@ -126,6 +127,7 @@ export default {
name: 'editDiscountCoupon',
data() {
return {
isLimitStock: false,
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: 'yyyy-MM-dd HH:mm:ss', // 日期显示格式
showSubmit: true,
......@@ -242,7 +244,7 @@ export default {
addHtml: 'editHtml',
isHide: true
}
],
]
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
......@@ -348,8 +350,12 @@ export default {
}
},
methods: {
updateStock(e) {
this.editRule.stock[0].required = !e
this.editForm.stock =''
},
setAllDisabled(editName) {
this[editName].forEach(item => {
this[editName]&&this[editName].forEach(item => {
item.isDisabled = true
})
},
......@@ -399,6 +405,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 +485,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 +539,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 +570,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => { })
.catch(() => {})
} else {
this.cancelJump()
}
......
......@@ -57,9 +57,10 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<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 :disabled="apear != 'couponAdd'||isLimitStock" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
<!-- <span slot="suffix">张</span> -->
</el-input>
<el-checkbox style="margin-left:10px;" v-model="isLimitStock" :disabled="apear != 'couponAdd'" @change="updateStock">不限制库存</el-checkbox>
</template>
<template slot="directionalFlagHtml">
<div>
......@@ -114,6 +115,7 @@ export default {
name: 'editDiscountCoupon',
data() {
return {
isLimitStock: false,
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: 'yyyy-MM-dd HH:mm:ss', // 日期显示格式
showSubmit: true,
......@@ -213,7 +215,7 @@ export default {
addHtml: 'editHtml',
isHide: true
}
],
]
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
......@@ -307,8 +309,12 @@ export default {
},
methods: {
updateStock(e) {
this.editRule.stock[0].required = !e
this.editForm.stock =''
},
setAllDisabled(editName) {
this[editName].forEach(item => {
this[editName]&&this[editName].forEach(item => {
item.isDisabled = true
})
},
......@@ -347,6 +353,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 +416,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 +468,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 +499,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => { })
.catch(() => {})
} else {
this.cancelJump()
}
......
......@@ -91,7 +91,7 @@
<div v-else>
<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>
<el-checkbox style="margin-left:10px;" v-model="isLimitStock" :disabled="title == '查看'" @change="updateStock">不限制库存</el-checkbox>
</div>
</el-form-item>
<el-form-item size="small" label="使用说明:" prop="useDescription">
......@@ -359,6 +359,9 @@ export default {
}
},
methods: {
updateStock(e) {
this.ruleForm.stock = ''
},
setAllDisabled(editName) {
this[editName].forEach(item => {
item.isDisabled = true
......@@ -486,8 +489,8 @@ export default {
params.shopPrice = this.ruleForm.shopPrice
// params.stock = this.ruleForm.stock
//库存
params.limitStockFlag = this.$isGroupUp ||this.isLimitStock? 2 : 1
if (!this.$isGroupUp||!this.isLimitStock) {
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!