xiaohaizhao před 5 měsíci
rodič
revize
dbc68ab236

+ 2 - 1
app.json

@@ -63,7 +63,8 @@
         "repair/index",
         "repair/detail",
         "repair/insert",
-        "repair/select"
+        "repair/select",
+        "orderForm/frozenList"
       ]
     },
     {

+ 37 - 9
packageA/orderForm/detail.js

@@ -10,10 +10,6 @@ Page({
 			label: "产品明细",
 			icon: "icon-tabchanpin",
 			model: "#Product"
-		}, {
-			label: "订单进度",
-			icon: "icon-tabcaozuojilu1",
-			model: "#Progress"
 		}, {
 			label: "出库单",
 			icon: "icon-tabrenwu",
@@ -61,11 +57,10 @@ Page({
 				symbol: "¥",
 				precision: 2
 			}).format();
-			if (res.data.sa_accountclassinfos) res.data.sa_accountclassinfos = res.data.sa_accountclassinfos.map(v => {
-				v.amount = CNY(v.amount)
-				v.text = `\n(实时余额:${CNY(v.realbalance)},当时余额:${CNY(v.balance)},信用额度:${CNY(v.creditquota)})`
-				return v
-			})
+			if (res.data.sa_accountclassinfos) {
+				res.data.sa_accountclassinfos = res.data.sa_accountclassinfos[0]
+				this.getAccount(res.data.sys_enterpriseid, res.data.accountclass.accountno)
+			}
 			this.setData({
 				detail: res.data,
 				loading: false,
@@ -94,6 +89,39 @@ Page({
 			}
 		})
 	},
+	getAccount(sys_enterpriseid, accountno) {
+		_Http.basic({
+			id: 20221008145903,
+			"content": {
+				"pageNumber": 1,
+				"pageSize": 20,
+				"where": {
+					"condition": "",
+					sys_enterpriseid: sys_enterpriseid,
+					accountno: accountno
+				},
+			},
+		}).then(res => {
+			console.log("res", res)
+			if (res.code != 1) return;
+			let CNY = value => currency(value, {
+				symbol: "¥",
+				precision: 2
+			}).format();
+			let item = Object.assign(this.data.detail.sa_accountclassinfos, res.data[0]);
+			['amount', 'freezamount', 'discountamount', 'creditguota', 'balance'].forEach(v => item[v] = CNY(item[v]))
+			this.setData({
+				"detail.sa_accountclassinfos": item
+			})
+		})
+
+	},
+
+	frozenList(e) {
+		wx.navigateTo({
+			url: '/packageA/orderForm/frozenList?id=' + this.data.detail.sa_accountclassinfos.sa_accountbalanceid,
+		})
+	},
 	/* 特殊订单使用,获取产品数量 */
 	getProductCount({
 		detail

+ 0 - 1
packageA/orderForm/detail.json

@@ -2,7 +2,6 @@
     "usingComponents": {
         "Product": "./modules/product/index",
         "Yl_Attachment": "/components/Yl_Attachment/index",
-        "Progress": "./modules/progress/index",
         "Consignment": "./modules/consignment/index",
         "Shipments": "./modules/shipments/index"
     }

+ 1 - 0
packageA/orderForm/detail.scss

@@ -66,6 +66,7 @@
         justify-content: space-between;
         min-height: 60rpx;
         align-items: center;
+        padding-top: 10rpx;
 
         .label {
             font-size: 28rpx;

+ 12 - 21
packageA/orderForm/detail.wxml

@@ -8,7 +8,6 @@
     <view class="tags">
         <text wx:if="{{detail.brandname}}" style="background-color: #0079FE;">{{detail.brandname}}</text>
         <text wx:if="{{detail.tradefield}}" style="background-color: #4BD863;">{{detail.tradefield}}</text>
-        <!-- <text wx:if="{{detail.status=='新建' && detail.type=='项目订单'}}" style="background-color: #4BD863;" bindtap="setBraned">设置品牌/领域</text> -->
     </view>
     <view class="exp" wx:if="{{userrole!='经销商'}}">经销商:{{detail.enterprisename || ' --'}}</view>
     <view class="exp" wx:if="{{detail.type=='项目订单'}}">关联项目:{{detail.projectname || '暂无'}}</view>
@@ -16,19 +15,7 @@
     <view class="exp">订单状态:{{detail.status}}</view>
     <view class="exp">单据日期:{{detail.billdate || '暂无'}}</view>
     <view class="exp">创建日期:{{detail.createdate}}</view>
-    <!-- <van-button wx:if="{{userrole=='经销商'}}" custom-class='copy' bindtap="copyItem">一键复制订单</van-button> -->
 </view>
-<!-- <navigator url="#" class="box location" bindtap="selectFinance">
-    <view class="content">
-        <view class="name">
-            开票单位
-        </view>
-        <view class="address">
-            {{detail.finance.enterprisename || '暂无'}}
-        </view>
-    </view>
-    <view class="iconfont icon-dibu-bianji" />
-</navigator> -->
 <view class="box pay">
     <view class="title">
         支付信息
@@ -40,15 +27,20 @@
             <van-icon name="arrow" />
         </view>
     </navigator>
-    <view class="row" style="align-items: flex-start;" bindtap="changeAccount">
-        <view class="label" style="padding-top: 20rpx;">支付账户</view>
-        <view>
-            <view wx:for="{{detail.sa_accountclassinfos}}" wx:key="sa_accountclassid" style="font-size: 28rpx; text-align: right;">
-                <text style="font-weight: 600;">{{item.accountname}}:<text style="color: #DA0A23;">-{{handleHide.verify(item.amount,'详情金额',privacyFieldC)}}</text></text>
-                <text style="font-size: 22rpx;"> {{handleHide.verify(item.text,'详情金额',privacyFieldC)}}</text>
-            </view>
+    <!-- bindtap="changeAccount" -->
+    <view class="row" style="align-items: flex-start;">
+        <view class="label">支付账户</view>
+        <view style="font-weight: 600;">
+            {{detail.sa_accountclassinfos.accountname}}:<text style="color: #DA0A23;">-{{handleHide.verify(detail.sa_accountclassinfos.amount,'详情金额',privacyFieldC)}}</text>
         </view>
     </view>
+    <view class="row" style="margin-top: -20rpx;">
+        (<text style="font-size: 22rpx;">信用余额{{handleHide.verify(detail.sa_accountclassinfos.creditguota,'详情金额',privacyFieldC)}}</text>
+        <text style="font-size: 22rpx;">优惠余额{{handleHide.verify(detail.sa_accountclassinfos.discountamount,'详情金额',privacyFieldC)}}</text>
+        <text style="font-size: 22rpx;" catchtap='frozenList'>冻结金额<text style="color:#0079FE">{{handleHide.verify(detail.sa_accountclassinfos.freezamount,'详情金额',privacyFieldC)}}</text></text>
+        <text style="font-size: 22rpx;">可用金额{{handleHide.verify(detail.sa_accountclassinfos.balance,'详情金额',privacyFieldC)}}</text>)
+    </view>
+
 </view>
 <view class="box" style="padding: 10rpx 30rpx;">
     <view class="row">
@@ -67,7 +59,6 @@
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Product slot='产品明细' privacyFieldC='{{privacyFieldC}}' sa_promotionid="{{detail.sa_promotionid}}" packagetypemxrows="{{detail.packagetypemxrows}}" id='Product' disabled="{{detail.status!='新建'}}" packagetype='{{detail.packagetype}}' sa_order_v='{{detail.sa_order_v}}' bind:returnProductCount='getProductCount' />
     <Yl_Attachment slot='附件' id='Yl_Attachment' ownertable="sa_order" ownerid="{{detail.sa_orderid}}" disabled="{{detail.status!='新建'}}" />
-    <Progress slot='订单进度' id='Progress' hidePrice='{{hidePrice.hidePrice("订单进度",privacyFieldC)}}' />
     <Consignment slot='出库单' id='Consignment' />
     <Shipments slot='物流单' id='Shipments' />
 </Yl_FunTabs>

+ 69 - 0
packageA/orderForm/frozenList.js

@@ -0,0 +1,69 @@
+const _Http = getApp().globalData.http;
+import currency from "../../utils/currency";
+let CNY = value => currency(value, {
+  symbol: "¥",
+  precision: 2
+}).format();
+Page({
+  data: {
+    params: {
+      "id": 2025070310561403,
+      "content": {
+        "isExport": 0,
+        "pageNumber": 1,
+        "pageSize": 20,
+        "sa_accountbalanceid": 106561,
+        "where": {
+          "condition": ""
+        }
+      },
+    }
+
+  },
+  onLoad(options) {
+    this.data.params.content.sa_accountbalanceid = options.id;
+    try {
+      let privacyFieldC = wx.getStorageSync('auth').worderform.forms.selectaccount.formcols.map(v => v.title);
+      this.setData({
+        privacyFieldC
+      })
+    } catch (error) {
+      console.error(error)
+    }
+
+    this.getList()
+  },
+  getList(init = false) {
+    //init 用于初始化分页
+    if (init.detail != undefined) init = init.detail;
+    let params = this.data.params;
+    if (init) params.content.pageNumber = 1
+    if (params.content.pageNumber > params.content.pageTotal) return;
+    _Http.basic(params).then(res => {
+      console.log("冻结金额", res)
+      this.selectComponent('#ListBox').RefreshToComplete();
+      if (res.msg != '成功') return wx.showToast({
+        title: res.msg,
+        icon: "none"
+      })
+      res.data = res.data.map(v => {
+        v.amount = CNY(v.amount)
+        return v
+      })
+      this.setData({
+        'params.content.pageNumber': res.pageNumber + 1,
+        'params.content.pageTotal': res.pageTotal,
+        'params.content.total': res.total,
+        list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+        loading: false
+      })
+    })
+  },
+  onReady() {
+    this.selectComponent("#ListBox").setHeight(".total", this);
+  },
+  onUnload() {
+    //回收数据
+    getApp().globalData.handleSelect = null;
+  }
+})

+ 4 - 0
packageA/orderForm/frozenList.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "冻结金额明细"
+}

+ 74 - 0
packageA/orderForm/frozenList.scss

@@ -0,0 +1,74 @@
+page {
+	height: 100vh;
+	overflow: hidden;
+}
+
+.total {
+	height: 20rpx;
+}
+
+.item {
+	display: flex;
+	align-items: center;
+	width: 100vw;
+	padding: 20rpx 30rpx;
+	background-color: #FFFFFF;
+	box-sizing: border-box;
+	border-bottom: 1rpx solid #DDDDDD;
+	margin-bottom: 20rpx;
+	overflow: hidden;
+
+	.main {
+		width: 100%;
+		padding-right: 20rpx;
+		box-sizing: border-box;
+
+		.title {
+			height: 40rpx;
+			line-height: 40rpx;
+			font-size: 28rpx;
+			font-family: PingFang SC-Semibold, PingFang SC;
+			font-weight: 600;
+			color: #333333;
+		}
+
+		.subfield {
+			margin-top: 6rpx;
+			height: 34rpx;
+			line-height: 34rpx;
+			font-size: 24rpx;
+			color: #999999;
+		}
+	}
+}
+
+.footer {
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	padding: 0 30rpx;
+	position: fixed;
+	width: 100vw;
+	height: 130rpx;
+	background: #FFFFFF;
+	box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+	bottom: 0;
+	box-sizing: border-box;
+
+	.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;
+		font-weight: bold;
+		color: #FFFFFF;
+	}
+}

+ 20 - 0
packageA/orderForm/frozenList.wxml

@@ -0,0 +1,20 @@
+<view class="total" />
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+	<navigator class="item" url="#" wx:for="{{list}}" wx:key="sonum" bindtap="changeResult">
+		<view class="main">
+			<view class="title line-1">{{item.remarks || ' --'}}</view>
+			<view class="subfield line-1">
+				冻结余额:{{handleHide.verify(item.amount,"余额和信用额度",privacyFieldC)}}
+			</view>
+			<view class="subfield line-1">
+				订单状态:{{item.status}}
+			</view>
+			<view class="subfield line-1">
+				订单号:{{item.sonum}}
+			</view>
+		</view>
+	</navigator>
+	<Yl_Empty wx:if="{{list.length==0}}" />
+</Yl_ListBox>
+
+<wxs src="/utils/hidePrice.wxs" module="handleHide" />

+ 4 - 0
packageA/orderForm/index.js

@@ -109,6 +109,7 @@ Page({
         break;
     }
     content.where.tablefilter.status = status;
+    content.where.status = status;
     this.getList(true);
   },
   /* 搜索 */
@@ -152,6 +153,9 @@ Page({
         title: res.msg,
         icon: "none",
       });
+      this.handleAdd(res.data.find(v => v.accountname == '现金账户').sa_accountclassid)
+
+      return
       if (res.data.length == 1) {
         this.handleAdd(res.data[0].sa_accountclassid)
       } else {

+ 0 - 1
packageA/orderForm/index.wxml

@@ -3,7 +3,6 @@
     <van-tabs color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
         <van-tab title="全部" />
         <van-tab title="新建" />
-        <van-tab title="预提交" />
         <van-tab title="提交" />
         <van-tab title="确认" />
         <van-tab title="审核" />

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

@@ -30,7 +30,7 @@ Component({
             type: Array,
             value: []
         },
-        sa_promotionid:{
+        sa_promotionid: {
             type: String
         }
     },
@@ -104,6 +104,10 @@ Component({
                 data = this.data.list[index];
             if (data.qty == obj.qty && data.remarks == obj.remarks && data.needdate == obj.needdate) return;
             detail.sa_order_v = this.data.sa_order_v - 0;
+            detail.custamount = 0;
+            detail.customcheek = '';
+            detail.customcolors = '';
+            detail.custommaterial = '';
             _Http.basic({
                 "id": 20221109093602,
                 "content": {
@@ -317,7 +321,11 @@ Component({
                                 spec: v.spec,
                                 custom: v.custom,
                                 price: this.data.type == '工具订单' ? v.marketprice : v.contractprice,
-                                sa_promotion_itemsid: v.sa_promotion_itemsid || 0
+                                sa_promotion_itemsid: v.sa_promotion_itemsid || 0,
+                                custamount: 0,
+                                customcheek: '',
+                                customcolors: '',
+                                custommaterial: '',
                             }
                         })
                     }

+ 0 - 43
packageA/orderForm/modules/progress/index.js

@@ -1,43 +0,0 @@
-const _Http = getApp().globalData.http;
-Component({
-    properties: {
-        hidePrice: {
-            type: Boolean
-        }
-    },
-    data: {
-        sa_orderid: 0,
-        total: 0,
-        content: {
-            nocache: true,
-            pageNumber: 1,
-            pageTotal: 1,
-            total: null
-        }
-    },
-    methods: {
-        getList(id, init) {
-            let content = this.data.content;
-            content.sa_orderid = id;
-            if (init) content.pageNumber = 1;
-            _Http.basic({
-                "id": "20221229093602",
-                content
-            }).then(res => {
-                console.log("订单进度", res)
-                if (res.msg != '成功') return wx.showToast({
-                    title: res.msg,
-                    icon: "none"
-                })
-                this.setData({
-                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
-                    "content.pageNumber": res.pageNumber + 1,
-                    "content.pageSize": res.pageSize,
-                    "content.pageTotal": res.pageTotal,
-                    "total": res.total,
-                    sa_orderid: id
-                })
-            })
-        }
-    }
-})

+ 0 - 4
packageA/orderForm/modules/progress/index.json

@@ -1,4 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {}
-}

+ 0 - 37
packageA/orderForm/modules/progress/index.scss

@@ -1,37 +0,0 @@
-.count {
-	font-size: 28rpx;
-	color: #333333;
-	margin: 20rpx;
-}
-
-.progress {
-	navigator {
-		width: 100vw;
-		background-color: #fff;
-		box-sizing: border-box;
-		padding: 20rpx 30rpx;
-		margin-bottom: 10rpx;
-
-		.time {
-			height: 34rpx;
-			line-height: 34rpx;
-			font-size: 24rpx;
-			color: #666666;
-		}
-
-		.label {
-			font-size: 28rpx;
-			color: #666;
-			margin-top: 20rpx;
-		}
-
-		.content {
-			background: #F5F5F5;
-			border-radius: 16rpx;
-			padding: 20rpx 30rpx;
-			font-size: 28rpx;
-			color: #333333;
-			margin-top: 20rpx;
-		}
-	}
-}

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

@@ -1,15 +0,0 @@
-<view class="progress">
-    <view class="count">共有{{total}}条记录</view>
-    <navigator url="#" wx:for="{{list}}" wx:key="rowindex">
-        <view class="time">
-            {{item.actiondate}}
-        </view>
-        <view class="label">{{item.actionby}} <text style="color: var(--success);">{{item.action + item.type}}</text> </view>
-        <view class="content">{{handleHide.query(item.remarks,hidePrice)}}</view>
-    </navigator>
-    <block wx:if="{{list.length==0}}">
-        <Yl_Empty />
-        <view style="height: 150rpx;" />
-    </block>
-</view>
-<wxs src="/utils/hidePrice.wxs" module="handleHide" />

+ 1 - 1
pages/index/collect/index.js

@@ -150,7 +150,7 @@ Component({
 						istool: 0,
 						type: "标准订单",
 						"tradefield": data.type, //必选
-						sa_accountclassid: list.length ? list[0].sa_accountclassid : 0,
+						sa_accountclassid: list.length ? list.find(v => v.accountname == '现金账户').sa_accountclassid : 0,
 						"items": data.list.map(v => {
 							return {
 								"sa_orderitemsid": 0,

+ 7 - 0
project.private.config.json

@@ -30,6 +30,13 @@
           "query": "",
           "scene": null,
           "launchMode": "default"
+        },
+        {
+          "name": "pages/index/index",
+          "pathName": "pages/index/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
         }
       ]
     }