| | |
| | | return { |
| | | loading: false, |
| | | formData: { |
| | | goodsTemplatesId: '', |
| | | modelName: '', |
| | | unit: '', |
| | | states: 1, |
| | |
| | | this.$refs.ruleForm.validate((valid) => { |
| | | if (valid) { |
| | | const params = Object.assign({}, this.formData) |
| | | params.goodsTemplatesId = this.setting.goodsTemplatesId |
| | | if (this.loading) return |
| | | this.loading = true |
| | | addSpecs(params).then(res => { |
| | | this.loading = false |
| | | if (res) { |
| | | this.$message.success('保存成功!') |
| | | this.close() |
| | | this.$emit('search') |
| | | } else { |
| | | this.$message.error('保存失败') |
| | | } |
| | | this.$message.success('保存成功!') |
| | | this.close() |
| | | this.$emit('search') |
| | | }).catch(() => { |
| | | this.loading = false |
| | | }); |