Commit d5774cfa by 李伟康

直播验证

1 parent 60dc4431
...@@ -940,7 +940,7 @@ ...@@ -940,7 +940,7 @@
> >
<glsx-combi-form <glsx-combi-form
class="edit-form-container" class="edit-form-container"
ref="liveEditFormRef" ref="liveEditFormRef_1"
:formRef="editChildRef" :formRef="editChildRef"
:isEdit="true" :isEdit="true"
:isBlock="true" :isBlock="true"
...@@ -991,7 +991,7 @@ ...@@ -991,7 +991,7 @@
> >
<glsx-combi-form <glsx-combi-form
class="edit-form-container" class="edit-form-container"
ref="liveEditFormRef" ref="liveEditFormRef_2"
:formRef="editChildRef" :formRef="editChildRef"
:isEdit="true" :isEdit="true"
:isBlock="true" :isBlock="true"
...@@ -1609,10 +1609,10 @@ export default { ...@@ -1609,10 +1609,10 @@ export default {
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
const { dataset: { index } } = event.target || event.srcElement, const { dataset: { index } } = event.target || event.srcElement,
{ selectedProInfo } = this { selectedProInfo } = this
if (typeof index == 'undefined' && value > -1) return callback() if (typeof index == 'undefined' && value > -1) return callback()
if (value < 1) return callback(new Error('请设置活动库存')) if (value < 1) return callback(new Error('请设置活动库存'))
if(value > selectedProInfo[index].goodsStock) return callback(new Error('不能大于商品库存')) if (value > selectedProInfo[index].goodsStock) return callback(new Error('不能大于商品库存'))
}, },
trigger: 'change' trigger: 'change'
} }
...@@ -2813,8 +2813,8 @@ export default { ...@@ -2813,8 +2813,8 @@ export default {
this.selectedProInfo = selectedProInfo this.selectedProInfo = selectedProInfo
//是否限购 //是否限购
if(res.goodsList.length > 1) this.limitPurchaseDisabled = true if (res.goodsList.length > 1) this.limitPurchaseDisabled = true
// 预估销量 // 预估销量
if (info.predictVolume) { if (info.predictVolume) {
this.editForm.predictVolume = (info.predictVolume / 100).toFixed(2) this.editForm.predictVolume = (info.predictVolume / 100).toFixed(2)
...@@ -3181,14 +3181,19 @@ export default { ...@@ -3181,14 +3181,19 @@ export default {
}) })
}) })
} }
if (this.$refs.liveEditFormRef) { if (this.editForm.liveFlag) {
this.$refs.liveEditFormRef.$refs[this.editChildRef].validate((liveValid, liveErrorObj) => { const liveTarget = this.editForm.liveBroadcastMediaType == 1 ?'liveEditFormRef_1':'liveEditFormRef_2'
if (!liveValid) { if (this.$refs[liveTarget]) {
validFlag = false console.log('直播', '============')
this.whereToGo('liveFlag') this.$refs[liveTarget].$refs[this.editChildRef].validate((liveValid, liveErrorObj) => {
} if (!liveValid) {
}) validFlag = false
this.whereToGo('liveFlag')
}
})
}
} }
if (this.$refs.commoditysEditFormRef) { if (this.$refs.commoditysEditFormRef) {
this.$refs.commoditysEditFormRef.forEach(item => { this.$refs.commoditysEditFormRef.forEach(item => {
item.$refs[this.editChildRef].validate((commoditysValid, commoditysErrorObj) => { item.$refs[this.editChildRef].validate((commoditysValid, commoditysErrorObj) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!