瀏覽代碼

销售订单 添加产品 显示价格字段与添加价格字段修改

xiaohaizhao 2 年之前
父節點
當前提交
fd831a8e7e

+ 16 - 12
packageA/orderForm/modules/product/index.js

@@ -188,18 +188,22 @@ Component({
         },
         /* 去添加产品 */
         addProduct() {
-            let detail = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/detail').data.detail;
-            let id = ''
+            let detail = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/detail').data.detail,
+                id = '',
+                query = "&newprice=contractprice";
             switch (detail.type) {
                 case '项目订单':
-                    id = 20230103155002
+                    id = 20230103155002;
                     break;
                 case '促销订单':
-                    id = 20230107182302
+                    id = 20230107182302;
                     break;
-                default:
-                    //标准、工具
-                    id = 20221109153502
+                case '工具订单':
+                    id = 20221109153502;
+                    query = '';
+                    break;
+                case '标准订单':
+                    id = 20221109153502;
                     break;
             }
             wx.navigateTo({
@@ -208,16 +212,16 @@ Component({
 					"content": {
 						nocache:true,
 						"sa_orderid": this.data.sa_orderid, //订单ID
-						"pageNumber": 1,
-						"pageTotal": 1,
 						"total": 0,
-						"pageSize": 20,
 						"where": {
 							"condition": ""
 						}
 					}
-				})}`
+				})+query}`
             });
+            this.setData({
+                type: detail.type
+            })
             getApp().globalData.handleSelect = this.handleSelect.bind(this);
         },
         /* 处理新增产品 */
@@ -236,7 +240,7 @@ Component({
                                     sa_orderitemsid: 0,
                                     "itemid": v.itemid, //商品ID
                                     "qty": 1, //数量
-                                    price: v.contractprice
+                                    price: this.data.type == '工具订单' ? v.marketprice : v.contractprice
                                 }
                             })
                         }

+ 0 - 1
packageA/orderForm/modules/product/index.wxml

@@ -11,5 +11,4 @@
     </navigator>
   </view>
 </view>
-
 <List list='{{list}}' disabled='{{disabled}}' bindchangeProduct='changeProduct' binddeleteItem="deleteItem" />

+ 0 - 1
packageA/orderForm/modules/progress/index.wxml

@@ -1,6 +1,5 @@
 <view class="progress">
     <view class="count">共有{{total}}条记录</view>
-
     <navigator url="#" wx:for="{{list}}" wx:key="rowindex">
         <view class="time">
             {{item.actiondate}}

+ 11 - 10
select/product/index.js

@@ -11,20 +11,22 @@ Page({
 		showName: "itemname"
 	},
 	onLoad(options) {
-		if (options.item) {
-			let item = JSON.parse(options.item);
+		if (options.params) {
+			let params = JSON.parse(options.params);
+			if (!params.content.pageNumber || !params.content.pageTotal) {
+				params.content.pageNumber = 1;
+				params.content.pageTotal = 1;
+			}
 			this.setData({
-				item,
-				params: item.params
+				params
 			});
-		}
-		if (options.params) this.setData({
-			params: JSON.parse(options.params)
-		});
+		};
 		this.setData({
 			radio: options.radio ? true : false,
 			idname: options.idname || this.data.idname,
 			showName: options.showName || this.data.showName,
+			newPrice: options.newprice || "marketprice", //红色价格
+			oldPrice: options.oldprice || "oldprice" //对比老价格
 		});
 		this.getList()
 	},
@@ -55,7 +57,6 @@ Page({
 				value.tradefields = value.tradefield.map(name => name.tradefield)
 				return value;
 			})
-
 			this.setData({
 				'params.content.pageNumber': res.pageNumber + 1,
 				'params.content.pageTotal': res.pageTotal,
@@ -139,6 +140,6 @@ Page({
 	onUnload() {
 		//回收数据
 		getApp().globalData.handleSelect = null;
-		
+
 	}
 })

+ 1 - 1
select/product/index.wxml

@@ -24,7 +24,7 @@
                     领域:{{item.tradefields}}
                 </view>
                 <view class="price line-1">
-                    价格:<text class="num">¥{{item.marketprice}}元</text><text wx:if="{{item.marketprice<item.oldprice}}" style="text-decoration:line-through; color:#999;">/{{item.oldprice}}</text>
+                    价格:<text class="num">¥{{item[newPrice]}}元</text><text wx:if="{{item[newPrice]<item[oldPrice]}}" style="text-decoration:line-through; color:#999;">/{{item[oldPrice]}}</text>
                 </view>
             </view>
         </view>