yangfeng
2023-08-26 7da8d51d212f96b2d419d4f22617827ea4df9e3d
src/views/productManage/product/AddProduct.vue
@@ -161,7 +161,6 @@
<script>
let inputElement = null
import { getAddContact, getUpdateContact } from "@/api/client/contacts"
import EditDropdownDialog from "@/views/other/commonDialog/EditDropdownDialog"
export default {
  name: "AddProductDialog",
@@ -216,37 +215,25 @@
          const params = this.saveParams()
          console.log(params)
          if (this.editConfig.title === "新建") {
            getAddContact(params)
              .then((res) => {
                console.log(res)
                this.editConfig.visible = false
                if (res.code === 200) {
                  this.$message({
                    message: "添加成功",
                    type: "success"
                  })
                  this.$parent.getData()
                }
              })
              .catch((err) => {
                console.log(err)
              })
            // getAddContact(params)
            //   .then((res) => {
            //     console.log(res)
            //     this.editConfig.visible = false
            //     if (res.code === 200) {
            //       this.$message.success("添加成功")
            //       this.$parent.getData()
            //     }
            //   })
          } else {
            getUpdateContact(params)
              .then((res) => {
                console.log(res)
                this.editConfig.visible = false
                if (res.code === 200) {
                  this.$message({
                    message: "编辑成功",
                    type: "success"
                  })
                  this.$parent.getData()
                }
              })
              .catch((err) => {
                console.log(err)
              })
            // getUpdateContact(params)
            //   .then((res) => {
            //     console.log(res)
            //     this.editConfig.visible = false
            //     if (res.code === 200) {
            //       this.$message.success("编辑成功")
            //       this.$parent.getData()
            //     }
            //   })
          }
        } else {
          console.log("error submit")