Przeglądaj źródła

报价单其他费用禁用

xiaohaizhao 3 lat temu
rodzic
commit
bfbafc7ede

+ 23 - 2
packageA/offers/modules/pettyExpense/index.js

@@ -3,7 +3,8 @@ let items = [],
     countDown = null;
 Component({
     properties: {
-        quotedpricenotes: Array
+        quotedpricenotes: Array,
+        disabled: Boolean
     },
     options: {
         addGlobalClass: true
@@ -21,7 +22,6 @@ Component({
         },
     },
     methods: {
-        /* 获取产品列表 */
         getList(id, init) {
             let content = this.data.content;
             content.sa_quotedpriceid = id;
@@ -168,5 +168,26 @@ Component({
                 }
             })
         },
+        handleDetele({
+            detail
+        }) {
+            _Http.basic({
+                "id": 20230211155703,
+                "version": 1,
+                "content": {
+                    "sa_quotedprice_specialitemsids": [detail]
+                }
+            }).then(res => {
+                console.log("删除其他费用", res)
+                wx.showToast({
+                    title: res.msg == '成功' ? '删除成功' : res.msg,
+                    icon: "none",
+                    mask: true
+                })
+                if (res.msg == '成功') this.setData({
+                    list: this.data.list.filter(v => v.sa_quotedprice_specialitemsid != detail)
+                })
+            })
+        }
     }
 })

+ 4 - 5
packageA/offers/modules/pettyExpense/index.wxml

@@ -3,26 +3,25 @@
         <view class="head">
             <view class="count">费用</view>
             <view class="expand">
-                <navigator url="#" class="but" bindtap="addExpense">
+                <navigator wx:if="{{!disabled}}" url="#" class="but" bindtap="addExpense">
                     <van-icon name="plus" />
                 </navigator>
             </view>
         </view>
-        <List list='{{list}}' bindchange='changeExpense' />
+        <List list='{{list}}' disabled='{{!disabled}}' bindchange='changeExpense' bindhandleDetele='handleDetele' />
     </van-tab>
     <van-tab title="报价说明">
         <view class="head">
             <view class="count">报价说明</view>
             <view class="expand">
-                <!-- wx:if="{{disabled}}" -->
-                <navigator url="#" class="but" bindtap="addQuotedpricenotes">
+                <navigator wx:if="{{!disabled}}" url="#" class="but" bindtap="addQuotedpricenotes">
                     <van-icon name="plus" />
                 </navigator>
             </view>
         </view>
         <view class="exprow" wx:for="{{quotedpricenotes}}" wx:key="index">
             <view style="margin-right: {{index>=2?'0':'30rpx'}};">{{item}}</view>
-            <text wx:if="{{index>=2}}" class="iconfont icon-guanlian-shanchu" bindtap="deleteItem" data-index="{{index}}"></text>
+            <text wx:if="{{index>=2}}" wx:if="{{!disabled}}" class="iconfont icon-guanlian-shanchu" bindtap="deleteItem" data-index="{{index}}"></text>
         </view>
     </van-tab>
 </van-tabs>

+ 15 - 1
packageA/offers/modules/pettyExpense/list/index.js

@@ -5,7 +5,8 @@ Component({
             type: Boolean,
             value: true
         },
-        change: Function
+        change: Function,
+        handleDetele: Function
     },
     options: {
         addGlobalClass: true
@@ -42,6 +43,19 @@ Component({
                 item,
                 index
             })
+        },
+        deleteProduct(e) {
+            let that = this;
+            const {
+                item
+            } = e.currentTarget.dataset;
+            wx.showModal({
+                title: '提示',
+                content: '是否确定删除该费用',
+                complete: (res) => {
+                    if (res.confirm) that.triggerEvent("handleDetele", item.sa_quotedprice_specialitemsid)
+                }
+            })
         }
     }
 })

+ 2 - 2
packageA/offers/modules/product/list/index.wxml

@@ -24,11 +24,11 @@
                 </view>
                 <view class="subfield">
                     <text class="line-1" style="margin-right: 6rpx;">牌价:{{item.marketprice||' --'}}</text>
-                    <text class="line-1" style="margin-right: 6rpx;">单价差额:<text style="color: {{(item.mindiscountrate-0)>(item.discountrate-0)?'var(--success)':'var(--error)'}};">{{item.discountDifferenceAmount||' --'}}</text></text>
+                    <text class="line-1" style="margin-right: 6rpx;">单价差额:<text style="color: {{(item.mindiscountrate-0)>(item.discountrate-0)?'var(--error)':'var(--success)'}};">{{item.discountDifferenceAmount||' --'}}</text></text>
                 </view>
                 <view class="subfield">
                     <text class="line-1" style="margin-right: 6rpx;">最低授权折扣:{{item.mindiscountrate}}%</text>
-                    <text class="line-1" style="margin-right: 6rpx;">是否特价:<text style="color: {{(item.mindiscountrate-0)>(item.discountrate-0)?'var(--success)':'var(--error)'}};">{{(item.mindiscountrate-0)>(item.discountrate-0)?'是':'否'}}</text></text>
+                    <text class="line-1" style="margin-right: 6rpx;">是否特价:<text style="color: {{(item.mindiscountrate-0)>(item.discountrate-0)?'var(--error)':'var(--success)'}};">{{(item.mindiscountrate-0)>(item.discountrate-0)?'是':'否'}}</text></text>
                 </view>
             </view>
             <view class="delete" wx:if="{{disabled}}" data-item="{{item}}" catchtap="deleteProduct">