|
@@ -7,7 +7,7 @@
|
|
title="规则设置"
|
|
title="规则设置"
|
|
v-model="isShow"
|
|
v-model="isShow"
|
|
@cancel="isShow=false"
|
|
@cancel="isShow=false"
|
|
- width="80%">
|
|
|
|
|
|
+ width="70%">
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
<a-form-model
|
|
<a-form-model
|
|
id="promotionList-basicInfo-form"
|
|
id="promotionList-basicInfo-form"
|
|
@@ -16,111 +16,113 @@
|
|
:rules="rules"
|
|
:rules="rules"
|
|
:label-col="formItemLayout.labelCol"
|
|
:label-col="formItemLayout.labelCol"
|
|
:wrapper-col="formItemLayout.wrapperCol" >
|
|
:wrapper-col="formItemLayout.wrapperCol" >
|
|
- <a-form-model-item label="规则门槛" prop="supplierSn">
|
|
|
|
- <a-radio-group v-model="form.supplierSn" button-style="solid" size="small">
|
|
|
|
- <a-radio-button value="a">
|
|
|
|
|
|
+ <a-form-model-item label="规则门槛" prop="gateFlag">
|
|
|
|
+ <a-radio-group v-model="form.gateFlag" button-style="solid" size="small" @change="changeGateFlag">
|
|
|
|
+ <a-radio-button value="1">
|
|
有
|
|
有
|
|
</a-radio-button>
|
|
</a-radio-button>
|
|
- <a-radio-button value="b">
|
|
|
|
|
|
+ <a-radio-button value="0">
|
|
无
|
|
无
|
|
</a-radio-button>
|
|
</a-radio-button>
|
|
</a-radio-group>
|
|
</a-radio-group>
|
|
- <div class="ruleDescList">
|
|
|
|
|
|
+ <div class="ruleDescList" v-if="form.gateFlag && form.gateFlag === '1'">
|
|
购买满
|
|
购买满
|
|
- <a-input-number v-model="form.starAmount" :min="0" :precision="2" size="small"/>
|
|
|
|
|
|
+ <a-input-number v-model="form.gateAmount" :min="0" :precision="2" size="small"/>
|
|
元门槛产品,可使用
|
|
元门槛产品,可使用
|
|
- <a-input-number v-model="form.endAmount" :min="0" :precision="2" size="small"/>
|
|
|
|
|
|
+ <a-input-number v-model="form.quotaAmount" :min="0" :precision="2" size="small"/>
|
|
元配额,采购规则中的正价商品(配额算销售额)
|
|
元配额,采购规则中的正价商品(配额算销售额)
|
|
</div>
|
|
</div>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item label="满赠规则" prop="supplierSn">
|
|
|
|
|
|
+ <a-form-model-item label="满赠规则" prop="regularSameFlag">
|
|
<div class="ruleDescList">
|
|
<div class="ruleDescList">
|
|
- <a-select default-value="a" style="width: 100px" size="small">
|
|
|
|
- <a-select-option value="a">
|
|
|
|
|
|
+ <a-select default-value="0" :value="form.regularSameFlag" style="width: 100px" size="small">
|
|
|
|
+ <a-select-option value="1">
|
|
同款
|
|
同款
|
|
</a-select-option>
|
|
</a-select-option>
|
|
- <a-select-option value="b">
|
|
|
|
|
|
+ <a-select-option value="0">
|
|
不同款
|
|
不同款
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
产品购买满
|
|
产品购买满
|
|
- <a-input-number v-model="form.starAmount" :min="0" :step="1" :precision="0" size="small"/>
|
|
|
|
|
|
+ <a-input-number v-model="form.regularQty" :min="0" :step="1" :precision="0" size="small"/>
|
|
个正价产品,送
|
|
个正价产品,送
|
|
- <a-input-number v-model="form.endAmount" :min="0" :step="1" :precision="0" size="small"/>
|
|
|
|
|
|
+ <a-input-number v-model="form.promotionQty" :min="0" :step="1" :precision="0" size="small"/>
|
|
个促销产品
|
|
个促销产品
|
|
</div>
|
|
</div>
|
|
<div class="ruleDescList">
|
|
<div class="ruleDescList">
|
|
- <a-checkbox size="small">
|
|
|
|
|
|
+ <a-checkbox size="small" :value="form.restrictFlag">
|
|
限制正价产品款数
|
|
限制正价产品款数
|
|
</a-checkbox>
|
|
</a-checkbox>
|
|
- <a-input-number v-model="form.endAmount" :min="0" :step="1" :precision="0" size="small"/>
|
|
|
|
|
|
+ <a-input-number v-model="form.restrictCategory" :min="0" :step="1" :precision="0" size="small"/>
|
|
</div>
|
|
</div>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item label="数量叠加" prop="returnReason">
|
|
|
|
- <a-radio-group v-model="form.supperSn" button-style="solid" size="small">
|
|
|
|
- <a-radio-button value="a">
|
|
|
|
|
|
+ <a-form-model-item label="数量叠加" prop="accrualFlag">
|
|
|
|
+ <a-radio-group v-model="form.accrualFlag" button-style="solid" size="small">
|
|
|
|
+ <a-radio-button value="1">
|
|
是
|
|
是
|
|
</a-radio-button>
|
|
</a-radio-button>
|
|
- <a-radio-button value="b">
|
|
|
|
|
|
+ <a-radio-button value="0">
|
|
否
|
|
否
|
|
</a-radio-button>
|
|
</a-radio-button>
|
|
</a-radio-group>
|
|
</a-radio-group>
|
|
<span style="color:gray;">(如:满10送2,数量叠加则:满20送4,满30送6)</span>
|
|
<span style="color:gray;">(如:满10送2,数量叠加则:满20送4,满30送6)</span>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item prop="supplierSn" v-bind="formItemLayout">
|
|
|
|
|
|
+ <a-form-model-item prop="minOrderFlag">
|
|
<span slot="label">
|
|
<span slot="label">
|
|
<a-tooltip title="What do you want others to call you?">
|
|
<a-tooltip title="What do you want others to call you?">
|
|
<a-icon type="info-circle" />
|
|
<a-icon type="info-circle" />
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
订单起订金额
|
|
订单起订金额
|
|
</span>
|
|
</span>
|
|
- <a-select default-value="b" style="width: 160px" size="small">
|
|
|
|
- <a-select-option value="a">
|
|
|
|
|
|
+ <a-select default-value="1" :value="form.minOrderFlag" style="width: 160px" size="small">
|
|
|
|
+ <a-select-option value="0">
|
|
不限
|
|
不限
|
|
</a-select-option>
|
|
</a-select-option>
|
|
- <a-select-option value="b">
|
|
|
|
|
|
+ <a-select-option value="1">
|
|
限制
|
|
限制
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
<a-input-number
|
|
<a-input-number
|
|
|
|
+ v-show="form.minOrderFlag && form.minOrderFlag=='1'"
|
|
size="small"
|
|
size="small"
|
|
style="margin-left:10px;width:300px;"
|
|
style="margin-left:10px;width:300px;"
|
|
- v-model="form.endAmount"
|
|
|
|
|
|
+ v-model="form.minOrderAmount"
|
|
:min="0"
|
|
:min="0"
|
|
:step="1"
|
|
:step="1"
|
|
:precision="2"
|
|
:precision="2"
|
|
placeholder="请输入金额"/>
|
|
placeholder="请输入金额"/>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item prop="supplierSn" v-bind="formItemLayout">
|
|
|
|
|
|
+ <a-form-model-item prop="upperLimitFlag">
|
|
<span slot="label">
|
|
<span slot="label">
|
|
<a-tooltip title="What do you want others to call you?">
|
|
<a-tooltip title="What do you want others to call you?">
|
|
<a-icon type="info-circle" />
|
|
<a-icon type="info-circle" />
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
活动经费上限
|
|
活动经费上限
|
|
</span>
|
|
</span>
|
|
- <a-select default-value="b" style="width: 160px" size="small">
|
|
|
|
- <a-select-option value="a">
|
|
|
|
|
|
+ <a-select default-value="1" :value="form.upperLimitFlag" style="width: 160px" size="small">
|
|
|
|
+ <a-select-option value="0">
|
|
不限
|
|
不限
|
|
</a-select-option>
|
|
</a-select-option>
|
|
- <a-select-option value="b">
|
|
|
|
|
|
+ <a-select-option value="1">
|
|
限制
|
|
限制
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
<a-input-number
|
|
<a-input-number
|
|
|
|
+ v-show="form.upperLimitFlag&&form.upperLimitFlag=='1'"
|
|
size="small"
|
|
size="small"
|
|
style="margin-left:10px;width:300px;"
|
|
style="margin-left:10px;width:300px;"
|
|
- v-model="form.endAmount"
|
|
|
|
|
|
+ v-model="form.upperLimitAmount"
|
|
:min="0"
|
|
:min="0"
|
|
:step="1"
|
|
:step="1"
|
|
:precision="2"
|
|
:precision="2"
|
|
placeholder="请输入金额"/>
|
|
placeholder="请输入金额"/>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item label="促销品与正品一致" prop="returnReason">
|
|
|
|
- <a-radio-group v-model="form.supplier" button-style="solid" size="small">
|
|
|
|
- <a-radio-button value="a">
|
|
|
|
|
|
+ <a-form-model-item label="促销品与正品一致" prop="regularPromotionSameFlag">
|
|
|
|
+ <a-radio-group v-model="form.regularPromotionSameFlag" button-style="solid" size="small">
|
|
|
|
+ <a-radio-button value="1">
|
|
是
|
|
是
|
|
</a-radio-button>
|
|
</a-radio-button>
|
|
- <a-radio-button value="b">
|
|
|
|
|
|
+ <a-radio-button value="0">
|
|
否
|
|
否
|
|
</a-radio-button>
|
|
</a-radio-button>
|
|
</a-radio-group>
|
|
</a-radio-group>
|
|
@@ -129,13 +131,13 @@
|
|
<a-card size="small" :bordered="false" class="pages-wrap">
|
|
<a-card size="small" :bordered="false" class="pages-wrap">
|
|
<div class="flex">
|
|
<div class="flex">
|
|
<a-radio-group v-model="chooseVal" button-style="solid" size="small">
|
|
<a-radio-group v-model="chooseVal" button-style="solid" size="small">
|
|
- <a-radio-button value="a">
|
|
|
|
|
|
+ <a-radio-button value="a" v-show="form.gateFlag==='1'">
|
|
门槛产品
|
|
门槛产品
|
|
</a-radio-button>
|
|
</a-radio-button>
|
|
<a-radio-button value="b">
|
|
<a-radio-button value="b">
|
|
正价产品
|
|
正价产品
|
|
</a-radio-button>
|
|
</a-radio-button>
|
|
- <a-radio-button value="c">
|
|
|
|
|
|
+ <a-radio-button value="c" v-show="form.regularPromotionSameFlag==='0'">
|
|
促销产品
|
|
促销产品
|
|
</a-radio-button>
|
|
</a-radio-button>
|
|
</a-radio-group>
|
|
</a-radio-group>
|
|
@@ -145,7 +147,9 @@
|
|
class="button-info"
|
|
class="button-info"
|
|
id="promotionList-edit-btn">+导入产品</a-button>
|
|
id="promotionList-edit-btn">+导入产品</a-button>
|
|
</div>
|
|
</div>
|
|
- <tableType1></tableType1>
|
|
|
|
|
|
+ <div v-show="chooseVal=='a'"><tableType1 ref="cillProduct" selectType="gateProduct"></tableType1></div>
|
|
|
|
+ <div v-show="chooseVal=='b'"><tableType1 ref="normalPriceProduct" selectType="regularProduct"></tableType1></div>
|
|
|
|
+ <div v-show="chooseVal=='c'"><tableType2 ref="offerProduct" selectType="specialProductList"></tableType2></div>
|
|
</a-card>
|
|
</a-card>
|
|
<div class="btn-cont">
|
|
<div class="btn-cont">
|
|
<a-button id="promotionList-basicInfo-modal-back" @click="isShow = false">取消</a-button>
|
|
<a-button id="promotionList-basicInfo-modal-back" @click="isShow = false">取消</a-button>
|
|
@@ -159,17 +163,18 @@
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { VSelect } from '@/components'
|
|
import { VSelect } from '@/components'
|
|
import tableType1 from './tableType1.vue'
|
|
import tableType1 from './tableType1.vue'
|
|
-import { sparePartsReturnSave, sparePartsReturnInfo } from '@/api/sparePartsReturn'
|
|
|
|
|
|
+import tableType2 from './tableType2.vue'
|
|
|
|
+import { promotionSave, sparePartsReturnInfo } from '@/api/promotion'
|
|
export default {
|
|
export default {
|
|
name: 'PromotionListBasicInfoModal',
|
|
name: 'PromotionListBasicInfoModal',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
- components: { VSelect, tableType1 },
|
|
|
|
|
|
+ components: { VSelect, tableType1, tableType2 },
|
|
props: {
|
|
props: {
|
|
openModal: { // 弹框显示状态
|
|
openModal: { // 弹框显示状态
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: false
|
|
default: false
|
|
},
|
|
},
|
|
- itemSn: {
|
|
|
|
|
|
+ promotionSn: {
|
|
type: [Number, String],
|
|
type: [Number, String],
|
|
default: ''
|
|
default: ''
|
|
}
|
|
}
|
|
@@ -183,75 +188,57 @@ export default {
|
|
wrapperCol: { span: 17 }
|
|
wrapperCol: { span: 17 }
|
|
},
|
|
},
|
|
form: {
|
|
form: {
|
|
- promotionName: '',
|
|
|
|
- activeDate: undefined,
|
|
|
|
- supplierSn: 'b', // 供应商
|
|
|
|
- returnReason: '', // 退货原因
|
|
|
|
- explainInfo: '', // 补充说明
|
|
|
|
- warehouseSn: undefined,
|
|
|
|
- attachmentList: ''
|
|
|
|
|
|
+ promotionRuleType: 'BUY_PROD_GIVE_PROD', // 买产品送产品
|
|
|
|
+ gateFlag: '0', // 门槛
|
|
|
|
+ gateAmount: '',
|
|
|
|
+ quotaAmount: '',
|
|
|
|
+ regularSameFlag: '0', // 满赠规则 不同款商品
|
|
|
|
+ regularQty: '',
|
|
|
|
+ promotionQty: '',
|
|
|
|
+ restrictFlag: undefined, // 限制正价产品款数
|
|
|
|
+ restrictCategory: '',
|
|
|
|
+ accrualFlag: '1', // 数量叠加
|
|
|
|
+ minOrderFlag: '1', // 起订金额
|
|
|
|
+ minOrderAmount: '',
|
|
|
|
+ upperLimitFlag: '1', // 活动经费上限
|
|
|
|
+ upperLimitAmount: '',
|
|
|
|
+ regularPromotionSameFlag: undefined
|
|
},
|
|
},
|
|
- openDealerModal: false,
|
|
|
|
- chooseDealerList: [],
|
|
|
|
- attachList: [], // 附件
|
|
|
|
- dateFormat: 'YYYY-MM-DD',
|
|
|
|
rules: {
|
|
rules: {
|
|
- supplierSn: [
|
|
|
|
- { required: true, message: '请选择供应商名称', trigger: 'change' }
|
|
|
|
- ],
|
|
|
|
- returnReason: [
|
|
|
|
- { required: true, message: '请选择退货原因', trigger: 'change' }
|
|
|
|
- ],
|
|
|
|
- warehouseSn: [{ required: true, message: '请选择退货仓库', trigger: 'change' }]
|
|
|
|
|
|
+ gateFlag: [ { required: true, message: '请选择规则门槛', trigger: 'change' } ],
|
|
|
|
+ regularSameFlag: [{ required: true, message: '请选择满赠规则', trigger: 'change' }],
|
|
|
|
+ accrualFlag: [{ required: true, message: '请选择数量是否叠加', trigger: 'change' }],
|
|
|
|
+ minOrderFlag: [{ required: true, message: '请选择订单起订金额', trigger: 'change' }],
|
|
|
|
+ upperLimitFlag: [{ required: true, message: '请选择活动经费上限', trigger: 'change' }],
|
|
|
|
+ regularPromotionSameFlag: [{ required: true, message: '请选择促销品与正品是否一致', trigger: 'change' }]
|
|
},
|
|
},
|
|
- chooseVal: 'a',
|
|
|
|
- attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo'
|
|
|
|
|
|
+ chooseVal: 'a'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 附件上传
|
|
|
|
- changeAttach (file) {
|
|
|
|
- this.attachList = JSON.parse(file)
|
|
|
|
- this.attachList.map(item => {
|
|
|
|
- item.fileType = item.extName
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 选择参与客户
|
|
|
|
- handleDealerModal () {
|
|
|
|
- this.openDealerModal = true
|
|
|
|
- const _this = this
|
|
|
|
- if (_this.chooseDealerList.length == 0) {
|
|
|
|
- _this.form.promoBuyerList = []
|
|
|
|
- }
|
|
|
|
- const arr = _this.chooseDealerList.map(item => {
|
|
|
|
- return item.buyerSn
|
|
|
|
- })
|
|
|
|
- // 选择经销商回显
|
|
|
|
- _this.$nextTick(() => {
|
|
|
|
- _this.$refs.dealerChoose.pageInit(arr)
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 添加经销商
|
|
|
|
- handleAddDealer (list) {
|
|
|
|
- this.chooseDealerList = list.map(con => {
|
|
|
|
- return {
|
|
|
|
- buyerSn: con.dealerSn,
|
|
|
|
- buyerName: con.dealerName
|
|
|
|
|
|
+ // 门槛切换 tab 按钮默认显示问题
|
|
|
|
+ changeGateFlag (e) {
|
|
|
|
+ if (this.chooseVal != 'c') {
|
|
|
|
+ if (e.target.value == '0') {
|
|
|
|
+ this.chooseVal = 'b'
|
|
|
|
+ } else {
|
|
|
|
+ this.chooseVal = 'a'
|
|
}
|
|
}
|
|
- })
|
|
|
|
- this.openDealerModal = false
|
|
|
|
- // 移除表单必填项
|
|
|
|
- this.$refs.ruleForm.clearValidate('promoBuyerList')
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 保存
|
|
// 保存
|
|
handleSave () {
|
|
handleSave () {
|
|
const _this = this
|
|
const _this = this
|
|
|
|
+ const tableData = this.$refs.cillProduct.getResultVal()
|
|
|
|
+ const newtableData = this.$refs.normalPriceProduct.getResultVal()
|
|
|
|
+ const newtableData1 = this.$refs.offerProduct.getResultVal()
|
|
|
|
+ debugger
|
|
this.$refs.ruleForm.validate(valid => {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
const form = JSON.parse(JSON.stringify(_this.form))
|
|
const form = JSON.parse(JSON.stringify(_this.form))
|
|
form.attachmentList = _this.attachList
|
|
form.attachmentList = _this.attachList
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
- sparePartsReturnSave(form).then(res => {
|
|
|
|
|
|
+ promotionSave(form).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.$message.success(res.message)
|
|
_this.$message.success(res.message)
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -289,10 +276,6 @@ export default {
|
|
this.detailsData = null
|
|
this.detailsData = null
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- },
|
|
|
|
- // 不可选日期
|
|
|
|
- disabledDate (date, dateStrings) {
|
|
|
|
- return date && date.valueOf('day') < moment().subtract(1, 'day') // 今天以后,包含今天
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -314,8 +297,7 @@ export default {
|
|
if (this.itemSn) {
|
|
if (this.itemSn) {
|
|
this.getDetail()
|
|
this.getDetail()
|
|
} else {
|
|
} else {
|
|
- // 默认仓库
|
|
|
|
- this.form.warehouseSn = this.isShowWarehouse ? undefined : this.defWarehouse && this.defWarehouse.warehouseSn
|
|
|
|
|
|
+ this.chooseVal = this.form.gateFlag == '0' ? 'b' : 'a'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|