yanjie 4 yıl önce
ebeveyn
işleme
f289b446f8

+ 11 - 5
mini/components/inner-order-item/index.js

xqd xqd xqd xqd xqd
@@ -25,16 +25,16 @@ Component({
    * 组件的方法列表
    */
   methods: {
-    navigate: function(e) {
+    navigate: function (e) {
       wx.navigateTo({
         url: e.currentTarget.dataset.url,
       })
     },
-    doAction: function(e) {
+    doAction: function (e) {
       var type = e.currentTarget.dataset.type
-      if(type == 'edit' || type == 'detail') {
+      if (type == 'edit' || type == 'detail') {
         this.navigate(e)
-      } else if(type == 'confirm') {
+      } else if (type == 'confirm') {
         var that = this
         var order = e.currentTarget.dataset.order
         Dialog.confirm({
@@ -43,8 +43,10 @@ Component({
         })
           .then(() => {
             that.submitCheck(order)
+          }).catch(() => {
+            Dialog.close()
           })
-      } else if(type == 'delete') {
+      } else if (type == 'delete') {
         var that = this
         var order = e.currentTarget.dataset.order
         Dialog.confirm({
@@ -53,6 +55,8 @@ Component({
         })
           .then(() => {
             that.delete(order)
+          }).catch(() => {
+            Dialog.close()
           })
       }
     },
@@ -66,6 +70,7 @@ Component({
         success: function (res) {
           if (res.code == 0) {
             that.triggerEvent("update")
+            Dialog.close()
           }
         }
       })
@@ -82,6 +87,7 @@ Component({
         success: function (res) {
           if (res.code == 0) {
             that.triggerEvent("update")
+            Dialog.close()
           }
         }
       })

+ 6 - 0
mini/components/out-order-item/index.js

xqd xqd xqd xqd
@@ -44,6 +44,8 @@ Component({
         })
           .then(() => {
             that.submitCheck(order)
+          }).catch(()=>{
+            Dialog.close()
           })
       } else if(type == 'delete') {
         Dialog.confirm({
@@ -52,6 +54,8 @@ Component({
         })
           .then(() => {
             that.delete(order)
+          }).catch(()=>{
+            Dialog.close()
           })
       }
     },
@@ -65,6 +69,7 @@ Component({
         success: function (res) {
           if (res.code == 0) {
             that.triggerEvent("update")
+            Dialog.close()
           }
         }
       })
@@ -82,6 +87,7 @@ Component({
         success: function (res) {
           if (res.code == 0) {
             that.triggerEvent('update', {})
+            Dialog.close()
           }
         }
       })

+ 2 - 2
mini/miniprogram_npm/@vant/weapp/dialog/index.js

xqd xqd
@@ -87,7 +87,7 @@ VantComponent({
     },
     close() {
       this.setData({
-        show: true,
+        show: false,
       });
     },
     stopLoading() {
@@ -100,7 +100,7 @@ VantComponent({
     },
     onClose(action) {
       if (!this.data.asyncClose) {
-        this.close();
+        // this.close();
       }
       this.$emit('close', action);
       // 把 dialog 实例传递出去,可以通过 stopLoading() 在外部关闭按钮的 loading

+ 3 - 0
mini/pages/create-order-inner/index.js

xqd xqd
@@ -139,6 +139,8 @@ Page({
       })
       .then(() => {
         that.submitCheck(e)
+      }).catch(()=>{
+        Dialog.close()
       })
   },
   editDate: function (e) {
@@ -209,6 +211,7 @@ Page({
       success: function (res) {
         if (res.code == 0) {
           util.success('操作成功')
+          Dialog.close()
           setTimeout(function () {
             that.init()
           }, 1000)

+ 2 - 1
mini/pages/create-project-role/index.js

xqd
@@ -139,11 +139,12 @@ Page({
     var data = {
       keyword: this.data.keyword
     }
-    if(this.type == 'edit') {
+    if(this.data.type == 'edit') {
       data = {
         keyword: this.data.keyword,
         id: this.data.project_user.user_id
       }
+      console.log(data)
     }
     http({
       url: 'users/search',

+ 5 - 5
mini/pages/filter/index.wxml

xqd xqd
@@ -14,16 +14,16 @@
           <view class="sg-bold sg-text-center sg-center sg-margin-tb">- 请选择筛选项目 - </view>
           <view>
             <view wx:for="{{project_ids}}" wx:key="index" class="sg-flex sg-align-center">
-              <van-dropdown-menu class="sg-flex-grow sg-margin-tb-sm sg-margin-right">
+              <van-dropdown-menu class="sg-flex-grow sg-margin-tb-sm sg-margin-right" active-color="#5992fd">
                 <van-dropdown-item value="{{ item }}" options="{{ projects }}" bind:change="onDropChange"
                   data-name="project_ids" data-index="{{index}}" />
               </van-dropdown-menu>
-              <van-button icon="cross" type="danger" bindtap="delete" data-name="project_ids"
+              <van-button icon="cross" color="#5992fd" type="danger" bindtap="delete" data-name="project_ids"
                 data-index="{{index}}" disabled="{{index == 0}}"></van-button>
             </view>
           </view>
           <view class="sg-margin-tb">
-            <van-button type="primary" block icon="plus" bindtap="add" data-name="project_ids">新增</van-button>
+            <van-button  color="#5992fd" block icon="plus" bindtap="add" data-name="project_ids">新增</van-button>
           </view>
         </view>
       </van-tab>
@@ -55,12 +55,12 @@
             </van-dropdown-menu>
           </view> -->
           <view class="sg-pad-tb-sm">
-            <van-dropdown-menu>
+            <van-dropdown-menu active-color="#5992fd">
               <van-dropdown-item value="{{ device_name_id }}" options="{{ names }}" bind:change="onChange" data-name="device_name_id" />
             </van-dropdown-menu>
           </view>
           <view class="sg-pad-tb-sm">
-            <van-dropdown-menu>
+            <van-dropdown-menu active-color="#5992fd">
               <van-dropdown-item value="{{ spec_id }}" options="{{ specs }}" bind:change="onChange" data-name="spec_id" />
             </van-dropdown-menu>
           </view>

+ 1 - 1
mini/pages/order-inner/index.wxml

xqd
@@ -2,7 +2,7 @@
 <view class="sg-container">
   <view class="sg-top-box sg-fix-top">
     <view class="sg-search-box sg-flex sg-align-center">
-      <van-dropdown-menu>
+      <van-dropdown-menu active-color="#5992fd">
         <van-dropdown-item value="{{ work_point_id }}" options="{{ work_points }}" bind:change="onDropChange" data-name="work_point_id"/>
       </van-dropdown-menu>
       <van-search value="{{ keyword }}" placeholder="请输入订单号或提交人搜索" use-right-icon-slot class="sg-flex-grow" left-icon="none" bind:change="onDropChange" data-name="keyword">

+ 1 - 1
mini/pages/order/index.wxml

xqd
@@ -2,7 +2,7 @@
 <view class="sg-container">
   <view class="sg-top-box sg-fix-top sg-white-bg">
     <view class="sg-search-box sg-flex sg-align-center">
-      <van-dropdown-menu>
+      <van-dropdown-menu active-color="#5992fd">
         <van-dropdown-item value="{{ work_point_id }}" options="{{ work_points }}" bind:change="onDropChange"
           data-name="work_point_id" />
       </van-dropdown-menu>