| | |
| | | }, |
| | | async created() { |
| | | if (this.setting.id) { |
| | | await goodsDetail(this.setting.id).then(res => { |
| | | await goodsDetail({'id': this.setting.id}).then(res => { |
| | | this.formData = res |
| | | if (!this.formData.agencyId) { |
| | | this.formData.agencyId = this.userInfo.tenantId |
| | |
| | | } else { |
| | | this.$message.error('保存失败') |
| | | } |
| | | }).catch((err) => { |
| | | this.$message.warning(err.msg) |
| | | this.loading = false |
| | | }); |
| | | }) |
| | | } else { |
| | | params.orgId = this.setting.orgId |
| | | addGoods(params).then(res => { |
| | |
| | | } else { |
| | | this.$message.error('保存失败') |
| | | } |
| | | }).catch(() => { |
| | | this.$message.warning(err.msg) |
| | | this.loading = false |
| | | }); |
| | | }) |
| | | } |
| | | } else { |
| | | this.$message.error('校验未通过,请检查。') |