Browse Source

经销/直销项目协议,详情-产品明细折扣tab,增加【自产品档案添加】功能

xiaohaizhao 1 year ago
parent
commit
6fde96e09d

+ 8 - 1
packageA/contract/detail.js

@@ -245,12 +245,19 @@ Page({
             label: "作废"
         })
 
-
         this.setData({
             isLeader,
             tabbarList,
             editdataleader
         });
+        
+        if (detail.typemx && (isLeader || this.data.appAuth.options.includes("app")) && status != '审核') {
+            setTimeout(() => {
+                this.selectComponent("#Product").setData({
+                    directAddition: true
+                })
+            });
+        }
     },
     /* 设置详情信息 */
     setDetail(data) {

+ 44 - 0
packageA/contract/modules/product/index.js

@@ -21,6 +21,8 @@ Component({
         }, //是否同步按钮显示
     },
     data: {
+        directAddition: false,
+        actionSheet: false,
         sa_contractid: 0,
         "content": {
             nocache: true,
@@ -28,6 +30,13 @@ Component({
             pageTotal: 1,
             total: null
         },
+        actions: [{
+            name: '自报价单添加',
+            value: 0
+        }, {
+            name: '自产品档案添加',
+            value: 1
+        }],
     },
     lifetimes: {
         detached: function () {
@@ -142,6 +151,41 @@ Component({
                 getApp().globalData.handleSelect = this.handleSelectProduct.bind(this);
             }
         },
+        actionSheetOnSelected({
+            detail
+        }) {
+            if (detail.value == 0) {
+                this.addProduct();
+            } else {
+                wx.navigateTo({
+                    url: '/packageA/select/product/select?params=' + JSON.stringify({
+                        "id": 20221124093602,
+                        "version": 1,
+                        "content": {
+                            nocache: true,
+                            sa_contractid: this.data.sa_contractid,
+                            total: null,
+                            where: {
+                                condition: "",
+                                "istool": 0 //是否是工具
+                            }
+                        }
+                    })
+                });
+                getApp().globalData.handleSelect = this.handleSelectProduct.bind(this);
+            }
+            this.closeActionSheet()
+        },
+        openActionSheet() {
+            this.setData({
+                actionSheet: true
+            })
+        },
+        closeActionSheet() {
+            this.setData({
+                actionSheet: false
+            })
+        },
         selectOffers({
             item
         }) {

+ 4 - 2
packageA/contract/modules/product/index.wxml

@@ -4,11 +4,13 @@
         <navigator wx:if="{{synchronous}}" url="#" class="but" bindtap="openSynchronous">
             <text class="iconfont icon-tongbuhezuoxieyi" />
         </navigator>
-        <navigator wx:if="{{disabled}}" url="#" class="but" bindtap="addProduct">
+        <navigator wx:if="{{disabled}}" url="#" class="but" bindtap="{{directAddition ? 'openActionSheet' : 'addProduct'}}">
             <van-icon name="plus" />
         </navigator>
     </view>
 </view>
 <List list='{{list}}' disabled='{{!disabled}}' bind:deleteItem='deleteItems' bindchangeQueue='changeQueue' />
 
-<synchronous id="synchronous" bind:confirm='confirm' />
+<synchronous id="synchronous" bind:confirm='confirm' />
+
+<van-action-sheet show="{{ actionSheet }}" z-index='999999999' actions="{{ actions }}" bind:select='actionSheetOnSelected' bind:cancel='closeActionSheet' bind:click-overlay='closeActionSheet' cancel-text="取消" />