zhaoxiaohai 2 年 前
コミット
e770553b99
2 ファイル変更33 行追加1 行削除
  1. 32 0
      packageA/orderForm/detail.js
  2. 1 1
      packageA/orderForm/detail.wxml

+ 32 - 0
packageA/orderForm/detail.js

@@ -418,6 +418,38 @@ Page({
 		});
 		return this.data.detail.status != '新建';
 	},
+	/* 拷贝订单 */
+	copyItem() {
+		let item = this.data.detail;
+		wx.showModal({
+			title: '提示',
+			content: `是否确认复制${item.type}“${item.sonum}”`,
+			complete: (res) => {
+				if (res.confirm) _Http.basic({
+					"id": 20230102144502,
+					"content": {
+						"sa_orderid": item.sa_orderid
+					}
+				}).then(res => {
+					console.log("复制订单", res)
+					if (res.msg != '成功') return wx.showToast({
+						title: res.msg,
+						icon: "none"
+					});
+					wx.showModal({
+						title: '提示',
+						content: `${item.type}复制成功 是否立即前往`,
+						complete: (s) => {
+							if (s.confirm) wx.redirectTo({
+								url: '/packageA/orderForm/detail?id=' + res.data.sa_orderid,
+							})
+						}
+					})
+
+				})
+			}
+		})
+	},
 	onUnload() {
 		let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/index');
 		let content = page.data.content;

+ 1 - 1
packageA/orderForm/detail.wxml

@@ -15,7 +15,7 @@
     <view class="exp">创建日期:{{detail.createdate}}</view>
     <view class="exp">核销状态:{{detail.writeoffstatus}}</view>
     <view class="exp">开票状态:{{detail.invoicestatus}}</view>
-    <van-button custom-class='copy'>一键复制订单</van-button>
+    <van-button custom-class='copy' bindtap="copyItem">一键复制订单</van-button>
 </view>
 
 <navigator url="#" class="box location" bindtap="selectConsignee">