Sfoglia il codice sorgente

设置产品统一交期

zhaoxiaohai 2 anni fa
parent
commit
c287d8429e

+ 31 - 2
packageA/orderForm/modules/product/index.js

@@ -65,6 +65,35 @@ Component({
 				})
 				})
 			})
 			})
 		},
 		},
+		/* 统一交期 */
+		dateChange(e) {
+			let that = this;
+			wx.showModal({
+				title: '提示',
+				content: `是否确定将当前产品列表交期统一设置为:${e.detail.value}`,
+				complete: (res) => {
+					if (res.confirm) _Http.basic({
+						"id": 20230104143802,
+						"content": {
+							"sa_orderid": that.data.sa_orderid,
+							"needdate": e.detail.value
+						}
+					}).then(res => {
+						console.log('统一设置交期', res)
+						wx.showToast({
+							title: res.msg == '成功' ? '设置成功' : res.msg,
+							icon: "none"
+						})
+						if (res.msg == '成功') that.setData({
+							list: that.data.list.map(v => {
+								v.needdate = e.detail.value;
+								return v
+							})
+						})
+					})
+				}
+			})
+		},
 		/* 修改 */
 		/* 修改 */
 		changeProduct({
 		changeProduct({
 			detail
 			detail
@@ -181,10 +210,10 @@ Component({
 					}).then(s => {
 					}).then(s => {
 						console.log('新增产品', s)
 						console.log('新增产品', s)
 						wx.showToast({
 						wx.showToast({
-							title: res.msg == '成功' ? '添加成功' : res.msg,
+							title: s.msg == '成功' ? '添加成功' : s.msg,
 							icon: "none"
 							icon: "none"
 						});
 						});
-						if (res.msg == '成功') setTimeout(() => {
+						if (s.msg == '成功') setTimeout(() => {
 							that.getList(that.data.sa_orderid, true);
 							that.getList(that.data.sa_orderid, true);
 							wx.navigateBack();
 							wx.navigateBack();
 						}, 300)
 						}, 300)

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

@@ -1,6 +1,11 @@
 <view class="head">
 <view class="head">
   <view class="count">产品明细</view>
   <view class="count">产品明细</view>
   <view class="expand">
   <view class="expand">
+    <picker wx:if="{{!disabled && list.length!=0}}" mode="date" bindchange='dateChange'>
+      <navigator url="#" class="but">
+        <van-icon name="clock-o" />
+      </navigator>
+    </picker>
     <navigator wx:if="{{!disabled}}" url="#" class="but" bindtap="addProduct">
     <navigator wx:if="{{!disabled}}" url="#" class="but" bindtap="addProduct">
       <van-icon name="plus" />
       <van-icon name="plus" />
     </navigator>
     </navigator>