|
@@ -113,7 +113,7 @@
|
|
</template>
|
|
</template>
|
|
<dialog-add-tag-purchase
|
|
<dialog-add-tag-purchase
|
|
ref="addTagPurchaseDialog"
|
|
ref="addTagPurchaseDialog"
|
|
- :optionGroup="optionGroup"
|
|
|
|
|
|
+ :optionGroup="optionGroup1"
|
|
@saved="loadTag"
|
|
@saved="loadTag"
|
|
></dialog-add-tag-purchase>
|
|
></dialog-add-tag-purchase>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -131,6 +131,11 @@ export default {
|
|
api: {
|
|
api: {
|
|
required: true,
|
|
required: true,
|
|
type: Function
|
|
type: Function
|
|
|
|
+ },
|
|
|
|
+ // 为区分BaseCurdList里面optionGroup 而定义
|
|
|
|
+ optionGroup1: {
|
|
|
|
+ required: true,
|
|
|
|
+ type: Object
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data: () => ({
|
|
data: () => ({
|
|
@@ -181,9 +186,17 @@ export default {
|
|
this.close()
|
|
this.close()
|
|
},
|
|
},
|
|
onOkBtnClick () {
|
|
onOkBtnClick () {
|
|
- this.$$request(this.api, this.oData).then(() => {
|
|
|
|
- this.close()
|
|
|
|
- this.$emit('saved')
|
|
|
|
|
|
+ this.$$request(this.api, this.oData).then((flag) => {
|
|
|
|
+ if (flag) {
|
|
|
|
+ this.$notify({
|
|
|
|
+ title: '成功',
|
|
|
|
+ message: '操作成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ position: 'bottom-right'
|
|
|
|
+ })
|
|
|
|
+ this.close()
|
|
|
|
+ this.$emit('saved')
|
|
|
|
+ }
|
|
}).catch(console.error).finally(() => {})
|
|
}).catch(console.error).finally(() => {})
|
|
},
|
|
},
|
|
handleInput (value) {
|
|
handleInput (value) {
|
|
@@ -199,7 +212,7 @@ export default {
|
|
if (data.number > 0) {
|
|
if (data.number > 0) {
|
|
const currentTag = this.list.filter(item => item.tagTypeId === data.tagTypeId)
|
|
const currentTag = this.list.filter(item => item.tagTypeId === data.tagTypeId)
|
|
if (currentTag.length <= 0) {
|
|
if (currentTag.length <= 0) {
|
|
- const providerConfig = this.optionGroup.TagType
|
|
|
|
|
|
+ const providerConfig = this.optionGroup1.TagType
|
|
const tag = providerConfig.list.find(item => item.id === data.tagTypeId)
|
|
const tag = providerConfig.list.find(item => item.id === data.tagTypeId)
|
|
if (tag) {
|
|
if (tag) {
|
|
const amount = (data.number * tag.price).toFixed(2)
|
|
const amount = (data.number * tag.price).toFixed(2)
|
|
@@ -217,6 +230,10 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ // 重写方法否则接口会调用2次
|
|
|
|
+ setOptionGroup () {
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|