Browse Source

调整空状态下边距 增加操作按钮

zhaoxiaohai 2 years ago
parent
commit
969833a87a

+ 5 - 1
components/Yl_Attachment/index.wxml

@@ -17,4 +17,8 @@
 </view>
 
 <Yl_Files id="Yl_Files" delete='{{admin}}' binddeleteCallBack='deleteFiles' />
-<Yl_Empty wx:if="{{content.total==0}}" />
+
+<block wx:if="{{list.length==0}}">
+	<Yl_Empty />
+	<view style="height: 150rpx;" />
+</block>

+ 93 - 0
packageA/orderForm/detail.js

@@ -147,4 +147,97 @@ Page({
 			"detail.accountclass.rebate_used": this.data.detail.accountclass.rebate_used == 0 ? 1 : 0
 		});
 	},
+	/* 删除订单 */
+	deleteItem() {
+		let that = this;
+		wx.showModal({
+			title: '提示',
+			content: '是否确认删除订单?',
+			complete: (res) => {
+				if (res.confirm) _Http.basic({
+					"id": 20221108152102,
+					"content": {
+						"sa_orderids": [
+							that.data.sa_orderid
+						]
+					}
+				}).then(s => {
+					console.log("删除订单", s)
+					if (s.msg != '成功') return wx.showToast({
+						title: s.msg,
+						icon: "none"
+					});
+					wx.showToast({
+						title: `成功删除${that.data.detail.sonum}订单`,
+						icon: "none"
+					});
+					setTimeout(() => {
+						let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/index');
+						if (page) page.setData({
+							list: page.data.list.filter(v => v.sa_orderid != that.data.sa_orderid),
+							"content.total": page.data.content.total - 1,
+							amount: (page.data.amount - that.data.detail.amount).toFixed(2)
+						});
+						wx.navigateBack()
+					}, 500)
+				})
+			}
+		})
+	},
+	/* 提交订单 */
+	submit() {
+		let that = this,
+			sys_enterpriseid = that.data.detail.sys_enterpriseid,
+			sa_accountclassid = that.data.detail.accountclass.sa_accountclassid;
+		if (!sys_enterpriseid) return wx.showToast({
+			title: '还未选择开票单位',
+			icon: "none"
+		});
+		if (!sa_accountclassid) return wx.showToast({
+			title: '还完成支付信息',
+			icon: "none"
+		});
+		wx.showModal({
+			title: '提示',
+			content: '是否确认提交订单?',
+			complete: (res) => {
+				if (res.confirm) _Http.basic({
+					"id": 20221108153402,
+					"content": {
+						sa_orderid: that.data.sa_orderid,
+						sys_enterpriseid,
+						sa_accountclassid
+					},
+				}).then(s => {
+					console.log("提交订单", s)
+					wx.showToast({
+						title: s.msg != '成功' ? s.msg : '提交成功',
+						icon: "none"
+					});
+				})
+			}
+		})
+	},
+	/* 确认订单交期 */
+	notarize() {
+		let that = this;
+		wx.showModal({
+			title: '提示',
+			content: '是否确认交期?',
+			complete: (res) => {
+				if (res.confirm) _Http.basic({
+					"id": 20221230094802,
+					"content": {
+						sa_orderid: that.data.sa_orderid
+					},
+				}).then(s => {
+					console.log("确认交期", s)
+					wx.showToast({
+						title: s.msg != '成功' ? s.msg : '提交成功',
+						icon: "none"
+					});
+				})
+			}
+		})
+	}
 })

+ 21 - 14
packageA/orderForm/detail.scss

@@ -146,11 +146,9 @@
     font-size: 24rpx !important;
 }
 
-
 .footer {
     display: flex;
     justify-content: space-between;
-    align-items: center;
     padding: 0 30rpx;
     position: fixed;
     width: 100vw;
@@ -160,21 +158,30 @@
     bottom: 0;
     box-sizing: border-box;
     z-index: 9999;
+    padding-top: 10rpx;
 
     .count {
-        font-size: 28rpx;
-        font-family: PingFang SC-Regular, PingFang SC;
-        color: #333333;
-    }
-
-    .but {
-        width: 156rpx;
         height: 90rpx;
-        background: #3874F6;
-        border-radius: 8rpx;
-        font-size: 28rpx;
-        font-family: PingFang SC-Bold, PingFang SC;
+        line-height: 90rpx;
+        font-size: 32rpx;
         font-weight: bold;
-        color: #FFFFFF;
+        color: var(--error);
+    }
+
+    .but-box {
+        .but {
+            min-width: 156rpx;
+            height: 90rpx;
+            background: #3874F6;
+            border-radius: 8rpx;
+            font-size: 28rpx;
+            font-family: PingFang SC-Bold, PingFang SC;
+            font-weight: bold;
+            color: #FFFFFF;
+        }
+
+        .delete {
+            background: var(--error);
+        }
     }
 }

+ 6 - 2
packageA/orderForm/detail.wxml

@@ -90,7 +90,11 @@
 <view style="height: 130rpx;" />
 <view class="footer">
     <view class="count">
-        999
+        ¥{{detail.amount}}
+    </view>
+    <view class="but-box">
+        <van-button custom-class='but delete' wx:if="{{detail.status=='新建'}}" bind:click="deleteItem">删除订单</van-button>
+        <van-button custom-class='but' wx:if="{{detail.status=='新建'}}" bind:click="submit">提交订单</van-button>
+        <van-button custom-class='but' wx:if="{{detail.status=='交期待确认'}}" bind:click="notarize">确认交期</van-button>
     </view>
-    <van-button custom-class='but' disabled='{{result.length==0}}' bind:click="submit">提交</van-button>
 </view>

+ 1 - 1
packageA/orderForm/index.js

@@ -42,7 +42,7 @@ Page({
                 "content.sort": res.sort,
                 "content.total": res.total,
                 loading: false,
-                amount: res.tips.amount
+                amount: res.tips.amount||0
             })
         })
     },

+ 3 - 0
packageA/orderForm/modules/list/index.wxml

@@ -32,6 +32,9 @@
     </view>
 </navigator>
 
+<Yl_Empty wx:if="{{list.length==0}}" />
+
+
 <wxs module="set">
     module.exports = {
         color: function (statu) {

+ 4 - 1
packageA/orderForm/modules/product/list/index.wxml

@@ -71,4 +71,7 @@
 		</view>
 	</view>
 </view>
-<Yl_Empty wx:if="{{list.length==0}}" />
+<block wx:if="{{list.length==0}}">
+	<Yl_Empty />
+	<view style="height: 150rpx;" />
+</block>

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

@@ -9,4 +9,7 @@
 		<view class="content">{{item.remarks}}</view>
 	</navigator>
 </view>
-<Yl_Empty wx:if="{{list.length==0}}" />
+<block wx:if="{{list.length==0}}">
+	<Yl_Empty />
+	<view style="height: 150rpx;" />
+</block>