|
@@ -113,7 +113,7 @@
|
|
|
</template>
|
|
|
<dialog-add-tag-purchase
|
|
|
ref="addTagPurchaseDialog"
|
|
|
- :optionGroup="optionGroup"
|
|
|
+ :optionGroup="optionGroup1"
|
|
|
@saved="loadTag"
|
|
|
></dialog-add-tag-purchase>
|
|
|
</el-dialog>
|
|
@@ -131,6 +131,11 @@ export default {
|
|
|
api: {
|
|
|
required: true,
|
|
|
type: Function
|
|
|
+ },
|
|
|
+ // 为区分BaseCurdList里面optionGroup 而定义
|
|
|
+ optionGroup1: {
|
|
|
+ required: true,
|
|
|
+ type: Object
|
|
|
}
|
|
|
},
|
|
|
data: () => ({
|
|
@@ -181,9 +186,17 @@ export default {
|
|
|
this.close()
|
|
|
},
|
|
|
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(() => {})
|
|
|
},
|
|
|
handleInput (value) {
|
|
@@ -199,7 +212,7 @@ export default {
|
|
|
if (data.number > 0) {
|
|
|
const currentTag = this.list.filter(item => item.tagTypeId === data.tagTypeId)
|
|
|
if (currentTag.length <= 0) {
|
|
|
- const providerConfig = this.optionGroup.TagType
|
|
|
+ const providerConfig = this.optionGroup1.TagType
|
|
|
const tag = providerConfig.list.find(item => item.id === data.tagTypeId)
|
|
|
if (tag) {
|
|
|
const amount = (data.number * tag.price).toFixed(2)
|
|
@@ -217,6 +230,10 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ // 重写方法否则接口会调用2次
|
|
|
+ setOptionGroup () {
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|