Browse Source

优化逻辑

zhaoxiaohai 3 years ago
parent
commit
fad2b2aa00

+ 7 - 5
packageA/select/agency/select.js

@@ -2,8 +2,7 @@ const _Http = getApp().globalData.http,
     getHeight = require("../../../utils/getRheRemainingHeight");
 Page({
     data: {
-        item: {},
-
+        item: null,
         result: [],
         radio: true,
     },
@@ -112,16 +111,19 @@ Page({
     startSearch({
         detail
     }) {
-        if (detail == this.data.content.where.condition) return;
+        let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
+        if (detail == condition) return;
         this.setData({
-            'content.where.condition': detail
+            'content.where.condition': detail,
+            'params.content.where.condition': detail
         });
         this.getList(true);
     },
     /* 取消搜索 */
     onClear() {
         this.setData({
-            'content.where.condition': ""
+            'content.where.condition': "",
+            'params.content.where.condition': ""
         });
         this.getList(true);
     },

+ 8 - 4
packageA/select/contacts/select.js

@@ -55,20 +55,24 @@ Page({
         }
     },
     /* 开始搜索 */
-    onSearch({
+    startSearch({
         detail
     }) {
-        if (this.data.params.content.where.condition == detail) return;
+        let condition = this.data.content?this.data.content.where.condition:this.data.params.content.where.condition;
+        if (detail == condition) return;
         this.setData({
+            'content.where.condition': detail,
             'params.content.where.condition': detail
         });
-        this.getList(true)
+        this.getList(true);
     },
+    /* 取消搜索 */
     onClear() {
         this.setData({
+            'content.where.condition': "",
             'params.content.where.condition': ""
         });
-        this.getList(true)
+        this.getList(true);
     },
     /* 选中 */
     onChange(e) {

+ 6 - 3
packageA/select/product/select.js

@@ -77,8 +77,8 @@ Page({
                         "orderamount": 0,
                         "invoiceqty": 0,
                         "invoiceamount": 0,
-                        "outqty": 0,
-                        "outamount": 0
+                        "outqty": 1,
+                        "outamount": v.marketprice
                     }
                 });
                 pages[pages.length - 2].selectComponent("#Project").handleSelectProduct(addList, list)
@@ -162,8 +162,10 @@ Page({
     startSearch({
         detail
     }) {
-        if (detail == this.data.params.content.where.condition) return;
+        let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
+        if (detail == condition) return;
         this.setData({
+            'content.where.condition': detail,
             'params.content.where.condition': detail
         });
         this.getList(true);
@@ -171,6 +173,7 @@ Page({
     /* 取消搜索 */
     onClear() {
         this.setData({
+            'content.where.condition': "",
             'params.content.where.condition': ""
         });
         this.getList(true);

+ 6 - 3
packageA/select/project/select.js

@@ -112,16 +112,19 @@ Page({
     startSearch({
         detail
     }) {
-        if (detail == this.data.content.where.condition) return;
+        let condition = this.data.content?this.data.content.where.condition:this.data.params.content.where.condition;
+        if (detail == condition) return;
         this.setData({
-            'content.where.condition': detail
+            'content.where.condition': detail,
+            'params.content.where.condition': detail
         });
         this.getList(true);
     },
     /* 取消搜索 */
     onClear() {
         this.setData({
-            'content.where.condition': ""
+            'content.where.condition': "",
+            'params.content.where.condition': ""
         });
         this.getList(true);
     },

+ 6 - 3
packageA/select/setclient/select.js

@@ -116,16 +116,19 @@ Page({
     startSearch({
         detail
     }) {
-        if (detail == this.data.content.where.condition) return;
+        let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
+        if (detail == condition) return;
         this.setData({
-            'content.where.condition': detail
+            'content.where.condition': detail,
+            'params.content.where.condition': detail
         });
         this.getList(true);
     },
     /* 取消搜索 */
     onClear() {
         this.setData({
-            'content.where.condition': ""
+            'content.where.condition': "",
+            'params.content.where.condition': ""
         });
         this.getList(true);
     },