|
@@ -505,26 +505,6 @@ export default {
|
|
// 验证组件必填项
|
|
// 验证组件必填项
|
|
_this.$refs.ruleForm.validate(valid => {
|
|
_this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- _this.form.promoType = _this.pageType
|
|
|
|
- _this.form.productNum = _this.$refs.chooseProductList.getChooseProductNum()
|
|
|
|
-
|
|
|
|
- if (!_this.form.productNum) {
|
|
|
|
- _this.$message.warning('请选择返券产品!')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (_this.form.promoType === 'BUY_PROD_GIVE_VALID') {
|
|
|
|
- if (_this.form.validType === 'FIXED') {
|
|
|
|
- if (!_this.form.validStartDate || !_this.form.validEndDate) {
|
|
|
|
- _this.$message.warning('请输入券有效期!')
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (!_this.form.validDays) {
|
|
|
|
- _this.$message.warning('请输入券有效期!')
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
_this.savePartInfo(type)
|
|
_this.savePartInfo(type)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -532,9 +512,30 @@ export default {
|
|
// 保存
|
|
// 保存
|
|
savePartInfo (type) {
|
|
savePartInfo (type) {
|
|
const _this = this
|
|
const _this = this
|
|
|
|
+ _this.form.promoType = _this.pageType
|
|
var formData = JSON.parse(JSON.stringify(_this.form))
|
|
var formData = JSON.parse(JSON.stringify(_this.form))
|
|
|
|
+ if (type === 'all') {
|
|
|
|
+ formData.productNum = _this.$refs.chooseProductList.getChooseProductNum()
|
|
|
|
+ if (!formData.productNum) {
|
|
|
|
+ _this.$message.warning('请选择返券产品!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (formData.promoType === 'BUY_PROD_GIVE_VALID') {
|
|
|
|
+ if (formData.validType === 'FIXED') {
|
|
|
|
+ if (!formData.validStartDate || !formData.validEndDate) {
|
|
|
|
+ _this.$message.warning('请输入券有效期!')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (!formData.validDays) {
|
|
|
|
+ _this.$message.warning('请输入券有效期!')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ delete formData.productNum
|
|
|
|
+ }
|
|
delete formData.time
|
|
delete formData.time
|
|
- delete formData.productNum
|
|
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
saveShopPromo(formData).then(res => {
|
|
saveShopPromo(formData).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|