From f9512a0896752ef3e4c17a05c871f315041be111 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期一, 27 十一月 2023 11:24:37 +0800
Subject: [PATCH] 采购订单按钮显隐
---
src/views/other/commonDialog/EditDropdownDialog.vue | 73 ++++++++++++++++++++++--------------
1 files changed, 45 insertions(+), 28 deletions(-)
diff --git a/src/views/other/commonDialog/EditDropdownDialog.vue b/src/views/other/commonDialog/EditDropdownDialog.vue
index 61713a6..e67830f 100644
--- a/src/views/other/commonDialog/EditDropdownDialog.vue
+++ b/src/views/other/commonDialog/EditDropdownDialog.vue
@@ -80,7 +80,8 @@
return {
dialogWidth: "20%",
editConfig: this.editDropdownConfig,
- tableData: []
+ tableData: [],
+ isName: false
}
},
created() {
@@ -101,7 +102,7 @@
pageSize: 100
}).then((res) => {
console.log(res.data)
- this.tableData = res.data.data.list
+ this.tableData = res.data.list
})
},
// 鎵�灞炶涓�
@@ -111,7 +112,7 @@
pageSize: 100
}).then((res) => {
console.log(res.data)
- this.tableData = res.data.data.list
+ this.tableData = res.data.list
})
},
handleClose() {
@@ -164,34 +165,50 @@
name: ""
})
},
+ // 鍒ゆ柇娣诲姞name鏄惁涓虹┖
+ determineNameEmpty(data) {
+ for (let i = 0; i < data.length; i++) {
+ if (data[i].name.length === 0) {
+ this.isName = true
+ break
+ } else {
+ this.isName = false
+ }
+ }
+ },
async saveClick() {
console.log(this.tableData)
- this.tableData.map((ite) => {
- 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()
- }
+ this.determineNameEmpty(this.tableData)
+ if (this.isName) {
+ this.$message.error("鍚嶇О涓嶈兘涓虹┖")
+ } else {
+ this.tableData.map((ite) => {
+ ite.ID = 0
+ return { ...ite }
})
- } 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 === "渚涘簲鍟嗙被鍨�") {
+ 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()
+ }
+ })
+ }
}
}
}
--
Gitblit v1.8.0