|
|
|
@ -211,7 +211,8 @@ export default { |
|
|
|
|
listConfigAll: [], |
|
|
|
|
previewVisible: false, |
|
|
|
|
previewHead: [], |
|
|
|
|
previewData: [] |
|
|
|
|
previewData: [], |
|
|
|
|
submited: false, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
@ -489,10 +490,13 @@ export default { |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
confirm(){ |
|
|
|
|
if(this.submited) return false |
|
|
|
|
if(!this.productName) return this.$message.warning('请输入数据产品名称') |
|
|
|
|
if(!this.market) return this.$message.warning('请输入市场价格') |
|
|
|
|
if(isNaN(this.market)) return this.$message.warning('市场价格请输入数字') |
|
|
|
|
if(!this.$refs.type.getCheckedNodes().length) return this.$message.warning('请选择数据') |
|
|
|
|
|
|
|
|
|
this.submited = true |
|
|
|
|
|
|
|
|
|
this.getIds().then(() => { |
|
|
|
|
let tableId = Array.from(new Set(this.tableId)) |
|
|
|
@ -515,13 +519,19 @@ export default { |
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
this.productVisible = false |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
this.submited = false |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.submited = false |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
this.$post(this.api.saveProduct,data).then(res => { |
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
this.productVisible = false |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
this.submited = false |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.submited = false |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|