| | |
| | | if (this.editConfig.title === "添加") { |
| | | createProduct({ |
| | | list: this.tableData |
| | | }).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功") |
| | | this.$parent.getProductList() |
| | | } |
| | | }).catch(e=>{ |
| | | console.log(e) |
| | | }) |
| | | .then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功") |
| | | this.$parent.getProductList() |
| | | } |
| | | }) |
| | | .catch((e) => { |
| | | console.log(e) |
| | | }) |
| | | } else { |
| | | const params = this.saveParams() |
| | | updateProduct(params).then((res) => { |
| | |
| | | this.productTableList = { |
| | | tableData: this.tableData, |
| | | tableColumn: [ |
| | | { label: "产品名称", prop: "name", productName: true, isRequird: true }, |
| | | { label: "产品名称", prop: "name", productName: true, isRequird: true, width: 250 }, |
| | | { label: "产品编码", prop: "number" }, |
| | | { label: "计量单位", prop: "unit" }, |
| | | { label: "规格型号", prop: "specifications" }, |