yangfeng
2024-03-23 12cf68ea971e5c39e884474734ef51cbc52bec8d
src/views/other/commonDialog/EditDropdownDialog.vue
@@ -55,7 +55,7 @@
</template>
<script>
import { getSupplierTypeList, updateSupplierType, updateIndustry, getIndustryList } from "@/api/supplierManage/supplier"
// import { getSupplierTypeList, updateSupplierType, updateIndustry, getIndustryList } from "@/api/supplierManage/supplier"
export default {
  name: "EditDropdownDialog",
  props: {
@@ -95,26 +95,7 @@
        this.getIndustryList()
      }
    },
    // 供应商类型
    async getSupplierTypeList() {
      await getSupplierTypeList({
        page: 1,
        pageSize: 100
      }).then((res) => {
        console.log(res.data)
        this.tableData = res.data.list
      })
    },
    // 所属行业
    async getIndustryList() {
      await getIndustryList({
        page: 1,
        pageSize: 100
      }).then((res) => {
        console.log(res.data)
        this.tableData = res.data.list
      })
    },
    handleClose() {
      this.editConfig.editVisible = false
    },
@@ -186,29 +167,9 @@
          ite.ID = 0
          return { ...ite }
        })
        if (this.editConfig.title === "供应商类型") {
          updateSupplierType({
            supplierTypes: this.tableData
          }).then((res) => {
            console.log(res)
            if (res.code === 200) {
              this.$message.success("编辑成功")
              this.$parent.getSupplierTypeList()
              this.handleClose()
            }
          })
        } else if (this.editConfig.title === "所属行业") {
          updateIndustry({
            industries: this.tableData
          }).then((res) => {
            console.log(res)
            if (res.code === 200) {
              this.$message.success("编辑成功")
              this.$parent.getIndustryList()
              this.handleClose()
            }
          })
        }
        // if (this.editConfig.title === "供应商类型") {
        // } else if (this.editConfig.title === "所属行业") {
        // }
      }
    }
  }