Ver código fonte

应收账款

xiaohaizhao 2 meses atrás
pai
commit
7f81c8e957

+ 3 - 1
app.json

@@ -59,7 +59,9 @@
         "market/selected/index",
         "receivables/index",
         "receivables/detail",
-        "account/detail"
+        "account/detail",
+        "accountReceivable/index",
+        "accountReceivable/detail"
       ]
     },
     {

+ 122 - 0
packageA/accountReceivable/detail.js

@@ -0,0 +1,122 @@
+const _Http = getApp().globalData.http;
+import currency from "../../utils/currency";
+let CNY = value => currency(value, {
+  symbol: "",
+  precision: 2
+}).format();
+Page({
+  data: {
+    sumWidth: 0,
+    "content": {
+      "pageNumber": 1,
+      "pageSize": 30,
+      "dataid": "4222", // 按业务员时 传userid 按客户时传 sa_customersid
+      "querytype": "1", //0按业务员 1按客户
+      "point": "全部", //入账节点
+      "where": {
+        "condition": ""
+      }
+    }
+  },
+  onLoad(options) {
+    let content = JSON.parse(options.content),
+      table = [{
+        title: '客户名',
+        width: 330,
+        key: 'enterprisename',
+        fun: 'toDetail'
+      }, {
+        title: '业务员',
+        width: 200,
+        key: 'name'
+      }, {
+        title: '订单号',
+        width: 300,
+        key: 'sonum'
+      }, {
+        title: '审核时间',
+        width: 300,
+        key: 'checkdate'
+      }, {
+        title: '订单行号',
+        width: 200,
+        key: 'rowno'
+      }, {
+        title: '商品编码',
+        width: 300,
+        key: 'itemno'
+      }, {
+        title: '商品名称',
+        width: 300,
+        key: 'itemname'
+      }, {
+        title: '型号',
+        width: 200,
+        key: 'model'
+      }, {
+        title: '规格',
+        width: 200,
+        key: 'spec'
+      }, {
+        title: '数量',
+        width: 200,
+        key: 'qty'
+      }, {
+        title: '金额',
+        width: 200,
+        key: 'amount'
+      }];
+    content.pageNumber = 1;
+    content.pageTotal = 1;
+    this.data.content = content;
+    table.push({
+      title: content.point == '开票' ? '开票金额' : '出货金额',
+      width: 300,
+      key: 'overdueamount'
+    })
+    this.setData({
+      table
+    })
+    setTimeout(() => {
+      this.setData({
+        sumWidth: this.data.table.reduce((prev, cur) => {
+          return prev.width ? prev.width + cur.width : prev + cur.width
+        })
+      })
+    });
+    this.getList()
+    getApp().globalData.Language.getLanguagePackage(this, 'E-订单');
+  },
+  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;
+    _Http.basic({
+      "id": 20241217135903,
+      content
+    }).then(res => {
+      this.setListHeight()
+      this.selectComponent('#ListBox').RefreshToComplete();
+      console.log("逾期账款明细", res)
+      let list = res.data.map(v => {
+        v.amount = CNY(v.amount)
+        v.overdueamount = CNY(v.overdueamount)
+        return v
+      })
+      this.setData({
+        list: res.pageNumber == 1 ? list : this.data.list.concat(list),
+        "content.pageNumber": res.pageNumber + 1,
+        "content.pageTotal": res.pageTotal,
+        "content.total": res.total,
+      })
+    })
+  },
+  onReady() {
+    this.setListHeight()
+  },
+  /* 设置页面高度 */
+  setListHeight() {
+    this.selectComponent("#ListBox").setHeight(".roof", this);
+  },
+})

+ 3 - 0
packageA/accountReceivable/detail.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 46 - 0
packageA/accountReceivable/detail.scss

@@ -0,0 +1,46 @@
+.table {
+	padding-top: 10rpx;
+	background-color: #fff;
+	text-align: center;
+
+	.table-head {
+		position: sticky;
+		top: 0px;
+		display: flex;
+		color: rgb(129, 129, 129);
+		line-height: 80rpx;
+		font-size: 26rpx;
+		z-index: 9;
+
+		view {
+			flex-shrink: 0;
+			background-color: #F2F2F2;
+		}
+	}
+
+	.line {
+		font-size: 26rpx;
+		color: rgb(129, 129, 129);
+		line-height: 60rpx;
+		display: flex;
+
+		.line-1 {
+			flex-shrink: 0;
+			padding: 0 10rpx;
+			box-sizing: border-box;
+			background-color: #fff;
+		}
+	}
+
+	/* .line view:first-child {
+		color: #13C0C0;
+		text-decoration: underline;
+	} */
+
+	.table-head view:first-child,
+	.line view:first-child {
+		position: sticky;
+		left: 0;
+		z-index: 7;
+	}
+}

+ 16 - 0
packageA/accountReceivable/detail.wxml

@@ -0,0 +1,16 @@
+<view class="table">
+	<view class="roof" />
+	<Yl_ListBox id='ListBox' scrollX='{{true}}' bind:getlist='getList'>
+		<view style="width:{{sumWidth}}rpx;">
+			<view class="table-head">
+				<view wx:for="{{table}}" style="width: {{item.width+'rpx'}};" wx:key="title">{{language[item.title]||item.title}}</view>
+			</view>
+			<Yl_Empty wx:if="{{list.length==0}}" />
+			<view class="line" wx:for="{{list}}" wx:key="rowindex">
+				<view wx:for="{{table}}" style="width: {{col.width+'rpx'}};" hover-class="{{col.fun?'navigator-hover':''}}" bind:tap="{{col.fun||''}}" wx:for-item="col" wx:key="title" class="line-1">
+					{{language[item[col.key]]||item[col.key]||'--'}}
+				</view>
+			</view>
+		</view>
+	</Yl_ListBox>
+</view>

+ 204 - 0
packageA/accountReceivable/index.js

@@ -0,0 +1,204 @@
+const _Http = getApp().globalData.http;
+import currency from "../../utils/currency";
+let CNY = value => currency(value, {
+  symbol: "",
+  precision: 2
+}).format();
+Page({
+  data: {
+    showFiltrate: false,
+    startUsing: false,
+    "content": {
+      "pageNumber": 1,
+      "pageSize": 40,
+      "type": "0", //1按部门 0按人员
+      "dataid": wx.getStorageSync('userMsg').userid, //部门人员id
+      "querytype": "1", //0按业务员 1按客户
+      "point": "开票", // 入账节点
+      "where": {
+        "condition": ""
+      }
+    },
+    querytypes: [{
+      name: getApp().globalData.Language.getMapText('按业务员'),
+      value: 0
+    }, {
+      name: getApp().globalData.Language.getMapText('按客户'),
+      value: 1
+    }],
+    points: ['开票', '出货'],
+    filtratelist: [],
+    table: [{
+      title: '客户名称',
+      width: 330,
+      key: 'enterprisename',
+      fun: 'toDetail'
+    }, {
+      title: '业务员',
+      width: 200,
+      key: 'name'
+    }, {
+      title: '期初余额(2021-12-31)',
+      width: 330,
+      key: 'openingbalance'
+    }, {
+      title: '出货总金额(2022-01-01至今)',
+      width: 400,
+      key: 'sumreceivableamount'
+    }, {
+      title: '收入总金额(2022-01-01至今)',
+      width: 400,
+      key: 'sumrevenueamount'
+    }, {
+      title: '出货总应收',
+      width: 200,
+      key: 'totalamount'
+    }],
+    sumWidth: 0,
+    sumtotalamount: "0.00"
+  },
+  onLoad(options) {
+    this.setData({
+      pointsL: this.data.points.map(v => getApp().globalData.Language.getMapText(v))
+    })
+    this.getList()
+    getApp().globalData.Language.getLanguagePackage(this, 'E-订单');
+    this.setSumWidth()
+  },
+  setSumWidth() {
+    this.setData({
+      sumWidth: this.data.table.reduce((prev, cur) => {
+        return prev.width ? prev.width + cur.width : prev + cur.width
+      })
+    })
+  },
+  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;
+    _Http.basic({
+      "id": 20241217135703,
+      content
+    }).then(res => {
+      if (res.code != '1') return wx.showToast({
+        title: res.msg,
+        icon: "none"
+      })
+      this.setListHeight()
+      this.selectComponent('#ListBox').RefreshToComplete();
+      console.log("应收账款列表", res)
+      let list = res.data.map(v => {
+        v.openingbalance = CNY(v.openingbalance)
+        v.sumreceivableamount = CNY(v.sumreceivableamount)
+        v.sumrevenueamount = CNY(v.sumrevenueamount)
+        v.totalamount = CNY(v.totalamount)
+        return v
+      })
+
+      this.setData({
+        list: res.pageNumber == 1 ? list : this.data.list.concat(list),
+        "content.pageNumber": res.pageNumber + 1,
+        "content.pageTotal": res.pageTotal,
+        "content.total": res.total,
+        sumtotalamount: list.length ? CNY(list[0].sumtotalamount) : '0.00'
+      })
+    })
+  },
+  toDetail(e) {
+    let {
+      item
+    } = e.currentTarget.dataset;
+    let content = {
+      ...this.data.content
+    };
+    content.dataid = item.userid || item.sa_customersid;
+    console.log(content)
+    wx.navigateTo({
+      url: '/packageA/accountReceivable/detail?content=' + JSON.stringify(content),
+    })
+  },
+  querytypeChange(e) {
+    this.setData({
+      "content.querytype": e.detail.value
+    });
+    if (e.detail.value == 0) {
+      this.data.table[0] = {
+        title: '部门',
+        width: 230,
+        key: 'depname',
+        fun: 'toDetail'
+      }
+    } else {
+      this.data.table[0] = {
+        title: '客户名称',
+        width: 330,
+        key: 'enterprisename',
+        fun: 'toDetail'
+      }
+    }
+    this.setData({
+      table: this.data.table
+    })
+    this.getList(true)
+  },
+  pointChange(e) {
+    this.setData({
+      'content.point': this.data.points[e.detail.value]
+    })
+    this.getList(true)
+  },
+  onReady() {
+    this.setListHeight()
+    this.selectComponent("#organization").initDepAndUser();
+  },
+  /* 设置页面高度 */
+  setListHeight() {
+    this.selectComponent("#ListBox").setHeight(".roof", this);
+  },
+  openFiltrate() {
+    this.setData({
+      showFiltrate: true
+    })
+  },
+  handleFilter({
+    detail
+  }) {
+
+    if (detail.name == 'reset') {
+      this.selectComponent("#organization").initDepAndUser()
+      this.setData({
+        'content.dataid': wx.getStorageSync('userMsg').userid,
+        'content.type': 0,
+      })
+    } else {
+      let active = this.selectComponent("#organization").data.result;
+      let type = active.userid ? 0 : 1,
+        dataid = type == 0 ? active.userid : active.departmentid
+      this.setData({
+        'content.dataid': dataid,
+        'content.type': type
+      })
+    }
+
+    this.getList(true)
+  },
+  startSearch({
+    detail
+  }) {
+    this.data.content.where.condition = detail;
+    this.getList(true)
+  },
+  onClear() {
+    this.data.content.where.condition = '';
+    this.getList(true)
+  },
+  showSearch() {
+    this.setData({
+      startUsing: !this.data.startUsing
+    })
+    setTimeout(() => {
+      this.setListHeight()
+    }, 400)
+  },
+})

+ 5 - 0
packageA/accountReceivable/index.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "van-transition": "@vant/weapp/transition/index"
+  }
+}

+ 115 - 0
packageA/accountReceivable/index.scss

@@ -0,0 +1,115 @@
+page {
+	height: 100vh;
+	overflow: hidden;
+}
+
+.nav {
+	display: flex;
+	justify-content: space-between;
+	height: 90rpx;
+	background-color: #fff;
+
+	.item {
+		display: flex;
+		align-items: center;
+		line-height: 90rpx;
+		font-size: 28rpx;
+		color: #414141;
+		padding: 0 30rpx;
+
+		text {
+			font-size: 26rpx;
+			margin-right: 8rpx;
+		}
+	}
+}
+
+.showdata {
+	display: flex;
+	background-color: #fff;
+	border-radius: 18rpx;
+	flex-wrap: wrap;
+	margin-top: 20rpx;
+	overflow: hidden;
+
+	.item:first-child {
+		width: 100%;
+		padding-top: 20rpx;
+
+		.name {
+			font-size: 28rpx;
+		}
+
+		.value {
+			font-size: 46rpx;
+			font-weight: bold;
+		}
+	}
+
+	.item {
+		width: 250rpx;
+		text-align: center;
+
+		.name {
+			font-size: 26rpx;
+		}
+
+		.value {
+			font-size: 38rpx;
+			font-weight: bold;
+			margin-top: 10rpx;
+			padding: 0 10rpx 20rpx;
+		}
+	}
+}
+
+.table {
+	padding-top: 10rpx;
+	background-color: #fff;
+	margin-top: 8rpx;
+	box-sizing: border-box;
+	// text-align: center;
+
+	.table-head {
+		position: sticky;
+		top: 0px;
+		display: flex;
+		color: rgb(129, 129, 129);
+		line-height: 80rpx;
+		font-size: 26rpx;
+		z-index: 9;
+
+		view {
+			flex-shrink: 0;
+			background-color: #F2F2F2;
+			padding: 0 10rpx;
+			box-sizing: border-box;
+		}
+	}
+
+	.line {
+		font-size: 26rpx;
+		color: rgb(129, 129, 129);
+		line-height: 60rpx;
+		display: flex;
+
+		.line-1 {
+			flex-shrink: 0;
+			padding: 0 10rpx;
+			box-sizing: border-box;
+			background-color: #fff;
+		}
+	}
+
+	.line view:first-child {
+		color: #13C0C0;
+		text-decoration: underline;
+	}
+
+	.table-head view:first-child,
+	.line view:first-child {
+		position: sticky;
+		left: 0;
+		z-index: 7;
+	}
+}

+ 54 - 0
packageA/accountReceivable/index.wxml

@@ -0,0 +1,54 @@
+<view class="nav">
+<!-- 	<picker range='{{querytypes}}' range-key='name' value="{{content.querytype}}" bindchange='querytypeChange'>
+		<view class="item" hover-class="navigator-hover">
+			<text class="iconfont icon-daoruxialajiantou" />
+			{{content.querytype == 0 ? language['按业务员']||'按业务员' : language['按客户']||'按客户'}}
+		</view>
+	</picker> -->
+	<picker range='{{pointsL}}' value="{{content.point}}" bindchange='pointChange'>
+		<view class="item" hover-class="navigator-hover">
+			<text class="iconfont icon-daoruxialajiantou" />
+			{{language[content.point]||content.point}}
+		</view>
+	</picker>
+	<view style="flex: 1;" />
+	<view class="item" hover-class="navigator-hover" bind:tap="openFiltrate">
+		<text class="iconfont icon-shaixuan" />
+		{{language['筛选']||'筛选'}}
+	</view>
+	<view class="item" style="padding: 0 30rpx;" hover-class="navigator-hover" bind:tap="showSearch">
+		<text class="iconfont icon-a-sousuolansousuo" />
+	</view>
+</view>
+<van-transition show="{{ startUsing }}" custom-class="block">
+	<van-search custom-class='Yl_search' value="{{ content.condition }}" shape="round" placeholder="{{language['关键字']||'请输入搜索关键词'}}" bind:search='startSearch' bind:clear='onClear' />
+</van-transition>
+
+
+<view class="showdata">
+	<view class="item" wx:key="name">
+		<view class="name">{{language['总应收(元)']||'总应收(元)'}}</view>
+		<view class="value line-1">{{sumtotalamount}}</view>
+	</view>
+</view>
+
+<view class="table">
+	<view class="roof" />
+	<Yl_ListBox id='ListBox' scrollX='{{true}}' bind:getlist='getList'>
+		<view style="width:{{sumWidth}}rpx;">
+			<view class="table-head">
+				<view wx:for="{{table}}" style="width: {{item.width+'rpx'}};" wx:key="title">{{language[item.title]||item.title}}</view>
+			</view>
+			<view class="line" wx:for="{{list}}" wx:key="rowindex">
+				<view wx:for="{{table}}" style="width: {{col.width+'rpx'}};" data-item="{{item}}" hover-class="{{col.fun?'navigator-hover':''}}" bind:tap="{{col.fun||''}}" wx:for-item="col" wx:key="title" class="line-1">
+					{{item[col.key]||'--'}}
+				</view>
+			</view>
+		</view>
+		<Yl_Empty wx:if="{{list.length==0}}" />
+	</Yl_ListBox>
+</view>
+
+<Yl_Filtrate show='{{showFiltrate}}' list="{{[]}}" bindhandle="handleFilter">
+	<organization slot='head' defaultMy id='organization' />
+</Yl_Filtrate>

+ 3 - 3
packageA/receivables/index.js

@@ -98,14 +98,14 @@ Page({
       if (res.data.length) {
         for (const key in obj) {
           showList.push({
-            name: obj[key] + '(元)',
-            value: res.data[0][key] >= 10000 ? (CNY(wx.getStorageSync('languagecode')=='ZH' ? res.data[0][key] / 10000 : res.data[0][key] / 1000) + '万') : res.data[0][key]
+            name:  getApp().globalData.Language.getMapText(obj[key] + '(元)'),
+            value: res.data[0][key] >= 10000 ? (CNY(wx.getStorageSync('languagecode')=='ZH' ? res.data[0][key] / 10000 : res.data[0][key] / 1000) + getApp().globalData.Language.getMapText( '万')) : res.data[0][key]
           })
         }
       } else {
         for (const key in obj) {
           showList.push({
-            name: obj[key] + '(元)',
+            name:  getApp().globalData.Language.getMapText(obj[key] + '(元)'),
             value: CNY(0)
           })
         }

+ 13 - 1
project.private.config.json

@@ -6,5 +6,17 @@
     "urlCheck": false
   },
   "libVersion": "3.7.1",
-  "condition": {}
+  "condition": {
+    "miniprogram": {
+      "list": [
+        {
+          "name": "逾期账款",
+          "pathName": "packageA/accountReceivable/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        }
+      ]
+    }
+  }
 }

+ 5 - 1
utils/work/apps.js

@@ -247,7 +247,11 @@ function getedd() {
 		name: "逾期账款",
 		path: "/packageA/receivables/index",
 		icon: "work-kaipiao",
-	}, {
+	},{
+		name: "应收账款",
+		path: "/packageA/accountReceivable/index",
+		icon: "work-yingshouzhangkuan",
+	},  {
 		name: "工具借用",
 		path: "/packageA/borrow/index",
 		icon: "work-shujuchaxun",

+ 8 - 0
utils/work/work-icon.wxss

@@ -8,6 +8,14 @@
     -moz-osx-font-smoothing: grayscale;
 }
 
+.work-yingshouzhangkuan:before {
+    content: "\e6f1";
+}
+
+.work-webshoucang:before {
+    content: "\e68a";
+}
+
 .work-kehuhuaxiang:before {
     content: "\e699";
 }

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
utils/work/work.wxss


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff