From fec7909e8552e98c60f3e14efc7d208e109dc4f8 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Fri, 26 Aug 2022 11:07:41 +0800
Subject: [PATCH] 增加秧苗

---
 src/views/task/task.vue |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/views/task/task.vue b/src/views/task/task.vue
index b4b0e60..b815e06 100644
--- a/src/views/task/task.vue
+++ b/src/views/task/task.vue
@@ -102,6 +102,7 @@
         refreshBtn:false,
         columnBtn:false,
         searchShowBtn:false,
+        menuWidth:300,
         column: [
           {
             label: "任务名称",
@@ -164,7 +165,7 @@
             // dicUrl: `/api/soldr/soldr/selectSol`,
             props: {
               label: "spn",
-              value: "id"
+              value: "stockId1"
             },
             change: function (value) {
               console.log(value.value)
@@ -176,7 +177,7 @@
             hide: true,
             span: 6,
             type: "number",
-            labelWidth: 110,
+            // labelWidth: 110,
             display: false,
           },
           {
@@ -273,6 +274,7 @@
         viewBtn: true,
         selection: true,
         dialogClickModal: false,
+        emptyBtn:false,
         column: [
           {
             label: "任务名称",
@@ -337,7 +339,7 @@
             dicUrl: `/api/soldr/soldr/selectSol`,
             props: {
               label: "spn",
-              value: "id"
+              value: "stockId1"
             },
             change: function (value) {
               console.log(value.value)
@@ -348,7 +350,7 @@
             prop: "stockNum",
             hide: true,
             disabled: true,
-            span: 6,
+            span: 7,
             type: "number",
             labelWidth: 110,
           },
@@ -575,7 +577,6 @@
   watch: {
     "form.stockId": {
       handler(val) {
-        console.log(val)
         var stockIdcolumn = this.findObject(this.option.column, "stockNum");
         if (val != "") {
           stockIdcolumn.display = true;
@@ -657,7 +658,6 @@
       //获取农资
       selectStockFa(this.$farmId).then((res) => {
         if (res.data.code == 200) {
-          console.log(res,1111111111111)
           var stockIdcolumn = that.findObject(that.option.column, "stockId");
           stockIdcolumn.dicData = res.data.data;
         }
@@ -680,6 +680,14 @@
       });
     },
     rowUpdate(row, index, done, loading) {
+      if(row.stockNum<0){
+        this.$message({
+          type: "warning",
+          message: "农资量不能为负数!"
+        });
+        done();
+        return
+      }
       update(row).then(() => {
         this.onLoad(this.page);
         this.$message({
@@ -732,6 +740,9 @@
         });
     },
     beforeOpen(done, type) {
+      if(["add"].includes(type)){
+        this.option.disabled=false
+      }
       if (["edit", "view"].includes(type)) {
         getDetail(this.form.id).then(res => {
           this.form = res.data.data;

--
Gitblit v1.9.3