From 00d1a771adb136642f67ce281c09d7c32cb1f697 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 29 三月 2024 11:44:17 +0800
Subject: [PATCH] 发货数量限制大于0

---
 src/views/orderManageModule/orderManage/components/DeliveryDialog.vue |   45 ++++++++++++++++++++++++++++-----------------
 src/views/other/login/index.vue                                       |   13 ++++++++-----
 2 files changed, 36 insertions(+), 22 deletions(-)

diff --git a/src/views/orderManageModule/orderManage/components/DeliveryDialog.vue b/src/views/orderManageModule/orderManage/components/DeliveryDialog.vue
index 0420997..333a494 100644
--- a/src/views/orderManageModule/orderManage/components/DeliveryDialog.vue
+++ b/src/views/orderManageModule/orderManage/components/DeliveryDialog.vue
@@ -173,26 +173,37 @@
       this.$refs[formName].validate((valid) => {
         if (valid) {
           console.log(this.ruleForm, "淇濆瓨鍐呭澶勭悊", this.tableData)
-          let deliveryList = this.tableData.map((item) => {
-            return {
-              outsourcingOrderProductID: item.id,
-              sendAmount: item.deliveryAmount
+          let isDeliveryCount = false
+          this.tableData.map((item) => {
+            if (item.deliveryAmount == 0) {
+              isDeliveryCount = true
+              return
             }
           })
-          let params = {
-            carrier: this.ruleForm.carrier,
-            deliveryList: deliveryList,
-            number: this.ruleForm.number,
-            outsourcingOrderID: this.editRow.infomation.id,
-            waybillNumber: this.ruleForm.waybillNumber
+          if (isDeliveryCount) {
+            this.$message.error("鍙戣揣鏁伴噺蹇呴』澶т簬0")
+          } else {
+            let deliveryList = this.tableData.map((item) => {
+              return {
+                outsourcingOrderProductID: item.id,
+                sendAmount: item.deliveryAmount
+              }
+            })
+            let params = {
+              carrier: this.ruleForm.carrier,
+              deliveryList: deliveryList,
+              number: this.ruleForm.number,
+              outsourcingOrderID: this.editRow.infomation.id,
+              waybillNumber: this.ruleForm.waybillNumber
+            }
+            saveDelivery(params).then((res) => {
+              if (res.code == 200) {
+                this.handleClose()
+                this.$message.success("鍙戣揣鎴愬姛")
+                this.$emit("reRreshData")
+              }
+            })
           }
-          saveDelivery(params).then((res) => {
-            if (res.code == 200) {
-              this.handleClose()
-              this.$message.success("鍙戣揣鎴愬姛")
-              this.$emit("reRreshData")
-            }
-          })
         }
       })
     },
diff --git a/src/views/other/login/index.vue b/src/views/other/login/index.vue
index dd4d2f1..19b2ca1 100644
--- a/src/views/other/login/index.vue
+++ b/src/views/other/login/index.vue
@@ -145,10 +145,10 @@
      */
     // 鎻愪氦鐧诲綍淇℃伅
     submit() {
-      this.$refs.loginForm.validate(async (valid) => {
+      this.$refs.loginForm.validate((valid) => {
         if (valid) {
           // 鐧诲綍
-          await login({
+          login({
             username: this.formLogin.username,
             password: this.formLogin.password,
             captcha: this.formLogin.code,
@@ -159,9 +159,12 @@
               localStorage.setItem("token", res.data.token)
               localStorage.setItem("username", res.data.user.username)
               localStorage.setItem("uuid", res.data.user.id)
-              setTimeout(() => {
-                this.$router.push({ path: "/orderManageModule/orderManage" })
-              }, 1000)
+              this.$router.push({ path: "/orderManageModule/orderManage" })
+              // if (Object.keys(res.data).length > 0) {
+              //   setTimeout(() => {
+              //     this.$router.push({ path: "/orderManageModule/orderManage" })
+              //   }, 1000)
+              // }
             } else {
               this.$message.warning(res.msg)
               if (res.msg == "楠岃瘉鐮侀敊璇�") {

--
Gitblit v1.8.0