zhaoxiaohai 2 سال پیش
والد
کامیت
e73e0d7dbf
2فایلهای تغییر یافته به همراه63 افزوده شده و 6 حذف شده
  1. 61 4
      packageA/orderForm/detail.js
  2. 2 2
      packageA/orderForm/detail.wxml

+ 61 - 4
packageA/orderForm/detail.js

@@ -26,13 +26,14 @@ Page({
 		this.setData({
 			sa_orderid: options.id
 		});
-		this.getDetail();
+		this.getDetail(true);
 	},
 	/* 获取详情 */
-	getDetail() {
+	getDetail(init = false) {
 		_Http.basic({
 			"id": 20221108151302,
 			"content": {
+				nocache: true,
 				"sa_orderid": this.data.sa_orderid
 			}
 		}).then(res => {
@@ -45,7 +46,63 @@ Page({
 				detail: res.data,
 				loading: false
 			});
-			this.partialRenewal(true)
+			if (init) this.partialRenewal(true)
+		})
+	},
+	/* 选择结算人 */
+	selectAgent() {
+		console.log(this.isEdit());
+		wx.navigateTo({
+			url: `/select/agent/index?params=${JSON.stringify({ 
+				"id": 20221011144903,
+				"content": {
+					"isExport": 0,
+					"pageNumber": 1, 
+					"pageTotal": 1, 
+					"pageSize": 20,
+					"where": {
+						"condition": "",
+						"tablefilter": {} 
+						}, 
+					"sa_saleareaids": [14],
+					"containssub": 1
+				}
+			 })}&radio=true`,
+		});
+		getApp().globalData.handleSelect = this.setAgeant.bind(this);
+	},
+	/* 设置经销商 */
+	setAgeant({
+		item
+	}) {
+		let that = this;
+		wx.showModal({
+			title: '提示',
+			content: `是否确认设置"${item.enterprisename}"为结算人?`,
+			complete: (res) => {
+				if (res.confirm) {
+					let id = that.data.detail.sys_enterpriseid;
+					that.setData({
+						"detail.sys_enterpriseid": item.sys_enterpriseid
+					});
+					that.changeDetail().then(s => {
+						if (s.msg == '成功') {
+							wx.showToast({
+								title: '设置成功',
+								icon: "none"
+							});
+							setTimeout(() => {
+								wx.navigateBack();
+								that.getDetail();
+							}, 500)
+						} else {
+							that.setData({
+								"detail.sys_enterpriseid": id
+							});
+						}
+					})
+				}
+			}
 		})
 	},
 	//tabs 切换
@@ -252,6 +309,6 @@ Page({
 			title: '当前订单状态不可设置!',
 			icon: "none"
 		});
-		return this.data.detail.status == '新建';
+		return this.data.detail.status != '新建';
 	}
 })

+ 2 - 2
packageA/orderForm/detail.wxml

@@ -47,10 +47,10 @@
     <view class="title">
         支付信息
     </view>
-    <navigator url="#" class="row">
+    <navigator url="#" class="row" bindtap="selectAgent">
         <view class="label">结算人</view>
         <view style="font-size: 28rpx;">
-            {{detail.finance.pay_enterprisename || '暂无'}}
+            {{detail.pay_enterprisename || '暂无'}}
             <van-icon name="arrow" />
         </view>
     </navigator>