Quellcode durchsuchen

报价单代码修改

xiaohaizhao vor 3 Jahren
Ursprung
Commit
d42591d3d1

+ 3 - 3
packageA/offers/detail.js

@@ -48,9 +48,9 @@ Page({
             isAdmin: wx.getStorageSync('auth').woffer.options.some(v => v == "admin"), //是否具有管理权限
             options: wx.getStorageSync('auth').woffer.options, //权限列表
         });
-        this.getDetail();
+        this.getDetail(true);
     },
-    getDetail() {
+    getDetail(init = false) {
         _Http.basic({
             "id": 20221020165203,
             "version": 1,
@@ -92,7 +92,7 @@ Page({
                 icon: "icon-tabxiangmupinggu",
                 label: '打印'
             }, */
-            tabbarList = [ {
+            tabbarList = [{
                 icon: "icon-guanlian-fuzhi",
                 label: "复制"
             }, {

+ 2 - 2
packageA/offers/modules/product/index.js

@@ -258,6 +258,7 @@ Component({
             }, 300);
         },
         changeItem(items) {
+            console.log(items)
             if (items.length == 0) return;
             _Http.basic({
                 "id": 20221021095403,
@@ -284,8 +285,6 @@ Component({
                 items.forEach(v => {
                     v.discountrate = (v.discountrate * 100).toFixed(2);
                     let i = list.findIndex(value => v.sa_quotedprice_itemsid == value.sa_quotedprice_itemsid);
-                    console.log(list[i])
-                    console.log(v)
                     if (i != -1) {
                         this.data.list[i] = {
                             ...list[i],
@@ -298,6 +297,7 @@ Component({
                         this.data.list[i].amount = v.sum;
                     }
                 });
+                getCurrentPages()[getCurrentPages().length - 1].getDetail();
             })
         }
     }

+ 1 - 4
packageA/offers/modules/product/list/index.js

@@ -16,9 +16,7 @@ Component({
             } = e.currentTarget.dataset,
                 detail = name == 'qty' ? e.detail.value - 0 : (e.detail.value - 0).toFixed(2),
                 item = this.data.list[index];
-                
             item[name] = detail;
-
             if (name == 'price') {
                 if (item.price > item.marketprice) item.price = item.marketprice
                 if (item.price <= 0) item.price = 1
@@ -33,9 +31,8 @@ Component({
             this.setData({
                 [`list[${index}]`]: item
             })
-
             let obj = {};
-            ["sa_quotedprice_itemsid", "itemid", "price", "discountrate", "qty"].forEach(v => obj[v] = item[v]);
+            ["sa_quotedprice_itemsid", "itemid", "price", "discountrate", "qty", "mindiscountrate"].forEach(v => obj[v] = item[v]);
             obj.discountrate = (obj.discountrate / 100).toFixed(4);
             obj.sum = (obj.price * obj.qty).toFixed(2);
             this.triggerEvent("changeQueue", obj)

+ 5 - 1
packageA/offers/modules/product/list/index.wxml

@@ -24,7 +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>item.discountrate?'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(--success)':'var(--error)'}};">{{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>
                 </view>
             </view>
             <view class="delete" wx:if="{{disabled}}" data-item="{{item}}" catchtap="deleteProduct">