Browse Source

添加凭证明细

xiaohaizhao 8 months ago
parent
commit
350162808b

+ 2 - 1
app.json

@@ -58,7 +58,8 @@
         "returnOne/update",
         "market/selected/index",
         "receivables/index",
-        "receivables/detail"
+        "receivables/detail",
+        "account/detail"
       ]
     },
     {

+ 75 - 0
packageA/account/detail.js

@@ -0,0 +1,75 @@
+const _Http = getApp().globalData.http,
+  currency = require("../../utils/currency"),
+  CNY = value => currency(value, {
+    symbol: "¥",
+    precision: 2
+  }).format();
+
+Page({
+  data: {
+    detail: {},
+    list: [],
+    "content": {
+      "where": {
+        "condition": ""
+      },
+      "pageNumber": 1,
+      "pageTotal": 1,
+      "pageSize": 20
+    }
+  },
+  onLoad(options) {
+    let item = JSON.parse(options.item);
+    this.setData({
+      detail: item
+    })
+    this.getList(true);
+  },
+  getList(init = false) {
+    if (init.detail != undefined) init = init.detail;
+    let content = this.data.content;
+    if (init) content.pageNumber = 1;
+    if (content.pageNumber > content.pageTotal) return;
+    content.sa_hrcashbillid = this.data.detail.sa_hrcashbillid;
+    _Http.basic({
+      "id": 20240111131304,
+      content
+    }).then(res => {
+      console.log("凭证明细列表", res)
+      this.selectComponent('#ListBox').RefreshToComplete();
+      res.data = res.data.map(v => {
+        v.showOrderprice = CNY(v.orderprice) //订单单价
+        v.showPrice = CNY(v.price) //提成单价
+        v.showAmount = CNY(v.amount) // 支出的“调整金额”;收入的“提成金额”
+        v.showCashbilldetailamount = CNY(v.cashbilldetailamount) // 支出的“提成金额”
+        v.showOrderExpectedamount = CNY(v.orderExpectedamount) //预计提成金额
+        v.showRewardamount = CNY(v.rewardamount) //已提成金额
+        v.showPayapplyamount = CNY(v.payapplyamount) //已发放金额
+        v.showUnpayapplyamount = CNY(v.unpayapplyamount) //未发放金额
+        return v
+      })
+      this.setData({
+        list: res.pageNumber == 1 ? res.data : this.data.list.concat(this.data.list),
+        "content.pageNumber": res.pageNumber + 1,
+        "content.pageTotal": res.pageTotal,
+        "content.sort": res.sort
+      })
+    })
+  },
+  startSearch({
+    detail
+  }) {
+    console.log(detail)
+    this.setData({
+      'content.where.condition': detail
+    })
+    this.getList(true);
+  },
+  onReady() {
+    this.setListHeight()
+  },
+  /* 设置页面高度 */
+  setListHeight() {
+    this.selectComponent("#ListBox").setHeight(".search", this);
+  },
+})

+ 4 - 0
packageA/account/detail.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "明细"
+}

+ 100 - 0
packageA/account/detail.scss

@@ -0,0 +1,100 @@
+.head {
+	width: 100vw;
+	background: #FFFFFF;
+	padding: 20rpx 30rpx;
+	box-sizing: border-box;
+
+	.title {
+		line-height: 44rpx;
+		font-family: PingFang SC, PingFang SC;
+		font-weight: bold;
+		font-size: 32rpx;
+		color: #333333;
+	}
+
+	.amount {
+		color: #666666;
+		font-size: 24rpx;
+		line-height: 34rpx;
+		margin-top: 8rpx;
+
+		text {
+			color: #FF3B30;
+			font-weight: bold;
+		}
+	}
+
+	.date {
+		color: #666666;
+		font-size: 24rpx;
+		line-height: 34rpx;
+		margin-top: 8rpx;
+
+		.value {
+			color: #333;
+		}
+	}
+}
+
+.search {
+	display: flex;
+	height: 100rpx;
+	align-items: center;
+	overflow: hidden;
+
+	.label {
+		width: 114rpx;
+		font-family: PingFang SC, PingFang SC;
+		font-size: 28rpx;
+		color: #666666;
+		flex-shrink: 0;
+		font-weight: bold;
+		padding: 0 30rpx;
+		margin: 0;
+	}
+
+	.box {
+		flex: 1;
+
+		.custom-class {
+			--search-background-color: #fff !important;
+		}
+	}
+}
+
+.item {
+	width: 100vw;
+	background-color: #fff;
+	padding: 30rpx;
+	box-sizing: border-box;
+
+	.row {
+		line-height: 34rpx;
+		font-family: PingFang SC, PingFang SC;
+		font-size: 24rpx;
+		color: #333333;
+		margin-top: 8rpx;
+	}
+
+	.row:first-child {
+		margin-top: 0;
+	}
+
+	.two-lines {
+		display: flex;
+
+		>view {
+			width: 50%;
+		}
+
+		.left {
+			padding-right: 6rpx;
+			box-sizing: border-box;
+		}
+	}
+
+	.price {
+		color: #FF3B30;
+		font-weight: bold;
+	}
+}

+ 100 - 0
packageA/account/detail.wxml

@@ -0,0 +1,100 @@
+<view class="head">
+	<view class="title">
+		{{detail.billno}}_{{detail.type==0?'支出':'收入'}}凭证明细
+	</view>
+	<view class="amount">金额:<text>{{detail.amount}}</text></view>
+	<!-- <view class="date">查询日期:<text class="value">{{detail.begindate||'开始日期'}}<text style="padding: 0 10rpx;">至</text>{{detail.enddate||'结束日期'}}</text></view> -->
+</view>
+<view class="search">
+	<view class="label">
+		凭证明细
+	</view>
+	<view class="box">
+		<van-search custom-class='custom-class' value="{{ content.where.condition }}" background='#F4F5F7' shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='startSearch' />
+	</view>
+</view>
+
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+	<view class="item" wx:for="{{list}}" wx:key="sa_hrcashbilldetailid">
+		<view class="row">
+			订单号:{{item.sonum || '--'}}
+		</view>
+		<view class="row">
+			客户名称:{{item.enterprisename || '--'}}
+		</view>
+		<view class="row">
+			项目名称:{{item.projectname || '--'}}
+		</view>
+		<view class="row">
+			产品名称:{{item.itemname || '--'}}
+		</view>
+		<view class="row two-lines">
+			<view class="left">
+				行号:{{item.rowindex}}
+			</view>
+			<view>
+				产品编码:{{item.itemno}}
+			</view>
+		</view>
+
+		<view class="row two-lines">
+			<view class="left">
+				型号:{{item.model}}
+			</view>
+			<view>
+				规格:{{item.spec}}
+			</view>
+		</view>
+
+		<view class="row two-lines">
+			<view class="left">
+				订单单价:{{item.showOrderprice}}
+			</view>
+			<view>
+				提成单价:{{item.showPrice}}
+			</view>
+		</view>
+
+		<view class="row two-lines">
+			<view class="left">
+				提成比例:{{item.rate * 100}}%
+			</view>
+			<view>
+				分配比例:{{item.allocation_rate * 100}}%
+			</view>
+		</view>
+
+		<view class="row two-lines">
+			<view class="left">
+				提成金额:{{detail.type==0 ? item.showCashbilldetailamount : item.showAmount}}
+			</view>
+			<view>
+				预计提成金额:{{item.showOrderExpectedamount}}
+			</view>
+		</view>
+
+		<view class="row two-lines">
+			<view class="left">
+				已提成金额:{{item.showRewardamount }}
+			</view>
+			<view>
+				已发放金额:{{item.showPayapplyamount}}
+			</view>
+		</view>
+
+		<view wx:if="{{detail.type==0}}" class="row two-lines">
+			<view class="left">
+				未发放金额:{{item.showUnpayapplyamount}}
+			</view>
+			<view>
+				本次调整金额:<text class="price">{{item.showAmount}}</text>
+			</view>
+		</view>
+
+		<view wx:else class="row">
+			未发放金额:{{item.showUnpayapplyamount}}
+		</view>
+
+	</view>
+	<Yl_Empty wx:if="{{list.length === 0}}" />
+</Yl_ListBox>

+ 11 - 0
packageA/account/index.js

@@ -123,6 +123,7 @@ Page({
                     recordList: res.data.rows.map(v => {
                         v.amount = CNY(v.amount)
                         v.showBalance = CNY(v.balance)
+                        v.showRemarks = wx.getStorageSync('userMsg').usertype == 1 ? v.allremarks : v.remarks
                         return v
                     }),
                     expend,
@@ -134,4 +135,14 @@ Page({
     onReady() {
 
     },
+    toDetail(e) {
+        let {
+            item
+        } = e.currentTarget.dataset;
+        item.enddate = this.data.enddate;
+        item.begindate = this.data.begindate;
+        wx.navigateTo({
+            url: '/packageA/account/detail?item=' + JSON.stringify(item)
+        })
+    }
 })

+ 6 - 5
packageA/account/index.wxml

@@ -55,16 +55,17 @@
     收入总计:{{expend}},支出总计:{{earning}}
 </view>
 
-<navigator url="#" class="record" wx:for="{{recordList}}" wx:key="sa_accountclassid">
+<view hover-class="navigator-hover" class="record" wx:for="{{recordList}}" wx:key="sa_accountclassid" data-item="{{item}}" bind:tap="toDetail">
     <view class="content">
         <view class="title">{{item.type==0?'支出':'收入'}}{{item.source?'-'+item.source:""}}</view>
-        <view class="exp">{{item.accountname || item.hraccountname}}:{{item.showBalance}}</view>
-        <view class="exp">交易备注:{{item.remarks || ' --'}}</view>
-        <view class="exp">{{item.createdate}}</view>
+        <!-- <view class="exp">{{item.accountname || item.hraccountname}}:{{item.showBalance}}</view> -->
+        <view class="exp">凭证单号:{{item.billno || ' --'}}</view>
+        <view class="exp">备注:{{item.showRemarks || ' --'}}</view>
+        <!-- <view class="exp">{{item.createdate}}</view> -->
     </view>
     <view class="price" style="color:{{item.balance>=0?'#DB0D27':'var(--success)'}} ;">
         {{item. amount}}
     </view>
-</navigator>
+</view>
 
 <Yl_Empty wx:if="{{recordList.length==0}}" />

+ 7 - 0
project.private.config.json

@@ -9,6 +9,13 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "账户",
+          "pathName": "packageA/account/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
         {
           "name": "工单详情",
           "pathName": "Eservice/workOrderDetail/index",