codeMan 3 лет назад
Родитель
Сommit
85f483885a

+ 291 - 0
packageA/remitVoucher/detail.js

@@ -0,0 +1,291 @@
+const _Http = getApp().globalData.http,
+	getTime = require("../../utils/getTime")
+
+Page({
+	data: {
+		loading: true,
+		sa_paybillid: null,
+		tabsActive: 1,
+		currentDate: new Date().getTime(),
+		formatter(type, value) {
+			if (type === 'year') {
+				return `${value}年`;
+			}
+			if (type === 'month') {
+				return `${value}月`;
+			}
+			return value;
+		},
+		show:false,
+		tabsList: [{
+			label: "详细信息",
+			icon: "icon-tabchanpin"
+		}, {
+			label: "打款明细",
+			icon: "icon-tabcaozuojilu1",
+			model: "#remitVoucher"
+		}],
+		tabbarsList: [{
+            label: "编辑",
+            icon: "icon-tabxiangxixinxi1"
+        }, {
+            label: "提交",
+            icon: "icon-tabxiansuo"
+        }, {
+            label: "审核",
+            icon: "icon-tabcaozuojilu1"
+        }, {
+            label: "退回",
+            icon: "icon-tabgenjinjilu"
+		}, {
+            label: "删除",
+            icon: "icon-tabgenjinjilu"
+		},]
+	},
+	onLoad(options) {
+		this.setData({
+			sa_paybillid: options.id
+		});
+		this.getDetail(true);
+	},
+	/* 获取详情 */
+	getDetail(init = false, show = true) {
+		_Http.basic({
+			"id": 20221226153404,
+			"content": {
+				nocache: true,
+				"sa_paybillid": this.data.sa_paybillid
+			}
+		}, show).then(res => {
+			console.log("出货详情", res)
+			if (res.msg != '成功') return wx.showToast({
+				title: res.msg,
+				icon: "none"
+			});
+			this.setPreview(res.data);
+			this.setData({
+				detail: res.data,
+				loading: false
+			});
+			if (init) this.partialRenewal(true)
+		})
+	},
+	/* 设置详情信息 */
+	setPreview(data) {
+		let list1 = [{
+				label: "凭证单号",
+				value: data.billno
+			}, {
+				label: "状态",
+				value: data.status
+			}, {
+				label: "经销商编号",
+				value: data.agentnum
+			}, {
+				label: "经销商简称",
+				value: data.enterprisename
+			},{
+				label: "回款归属月份",
+				value: data.period
+			}, {
+				label: "打款金额",
+				value: data.amount
+			}],
+			list2 = [{
+				label: "创建人",
+				value: data.createby
+			}, {
+				label: "创建时间",
+				value: data.createdate
+			}, {
+				label: "审核人",
+				value: data.checkby
+			}, {
+				label: "审核时间",
+				value: data.checkdate
+			}, {
+				label: "付款人",
+				value: data.payer
+			}, {
+				label: "付款时间",
+				value: data.paydate
+			}];
+		this.setData({
+			list1,
+			list2
+		})
+	},
+	/* 审核选择弹出框关闭 */
+	onClose () {
+		this.setData({
+			show: false
+		})
+	},
+	/* 审核提交 */
+	async checkSubmit ({
+		detail
+	}) {
+		let res = await _Http.basic({
+			 "id": "20221226153304",
+			"content": {
+				"sa_paybillid":this.data.sa_paybillid,
+				"period":getTime.formatTime(new Date(detail), '-').split(' ')[0]
+			}
+		})
+		console.log(res);
+		if (res.msg == '成功') {
+			this.setData({
+				show:false
+			})
+			this.getDetail(true)
+		}
+	},
+	tabbarOnClick({
+        detail
+    }) {
+		switch (detail.label) {
+			case "编辑":
+				wx.navigateTo({
+					url: `/packageA/remitVoucher/update?rowData=${JSON.stringify(this.data.detail)}`,
+				})
+				break;
+			case "提交":
+				wx.showModal({
+					title: '提示',
+					content: `是否确认提交该打款凭证?`,
+					complete: ({
+						confirm
+					}) => {
+						if (confirm) _Http.basic({
+							"id": "20221226153204",
+							"content": {
+								"sa_paybillid":this.data.sa_paybillid
+							}
+						}).then(res => {
+							wx.showToast({
+								title: res.msg == '成功' ? `已提交改打款凭证` : res.msg,
+								icon: "none"
+							});
+							if (res.msg == '成功') {
+								this.getDetail()
+								let pages = getCurrentPages(),
+									page = pages[pages.length - 2]
+								page.getList(true)
+							}
+						})
+					}
+				})
+				break;
+			case "审核":
+				wx.showToast({
+					title:'请选择回款日期',
+					icon:'none'
+				})
+				this.setData({
+					show:true
+				})
+				break;
+			case "退回":
+				wx.showModal({
+					title: '提示',
+					content: `是否确认退回该打款凭证?`,
+					complete: ({
+						confirm
+					}) => {
+						if (confirm) _Http.basic({
+							"id":20221227110104,
+							"content": {
+								sa_paybillid:this.data.sa_paybillid
+							}
+						}).then(res => {
+							wx.showToast({
+								title: res.msg == '成功' ? `已退回该凭证` : res.msg,
+								icon: "none"
+							});
+							if (res.msg == '成功') {
+								this.getDetail()
+							}
+						})
+					}
+				})
+				break;
+			case "删除":
+			wx.showModal({
+				title: '提示',
+				content: `是否删除该凭证?`,
+				complete: ({
+					confirm
+				}) => {
+					if (confirm) _Http.basic({
+						"id":20221226153104,
+						"content": {
+							sa_paybillids:[this.data.sa_paybillid]
+						}
+					}).then(res => {
+						wx.showToast({
+							title: res.msg == '成功' ? `已删除该凭证` : res.msg,
+							icon: "none"
+						});
+						if (res.msg == '成功') {
+							setTimeout(() => {
+								wx.navigateBack()
+								getCurrentPages()[getCurrentPages().length - 2].getList(true)
+							},300)
+						}
+					})
+				}
+			})
+			break;
+        }
+	},
+	onInput (detail) {
+
+	},
+	//tabs 切换
+	tabsChange({
+		detail
+	}) {
+		this.setData({
+			tabsActive: detail
+        });
+        console.log(this.data.tabsActive);
+		this.partialRenewal();
+	},
+	//局部数据更新 tabs
+	partialRenewal(init = false) {
+		let model = this.data.tabsList[this.data.tabsActive].model;
+		if (model) {
+			let Component = this.selectComponent(model),
+				{
+					total,
+					pageNumber,
+					pageTotal
+				} = Component.data.content,
+                id = this.data.detail.sa_paybillid;
+			if (total == null || init) {
+				Component.getList(id, init);
+			} else if (pageNumber < pageTotal) {
+				Component.getList(id, false);
+			}
+		}
+	},
+	onReachBottom() {
+		this.partialRenewal();
+	},
+	onUnload() {
+		console.log("更新列表数据")
+		let page = getCurrentPages().find(v => v.__route__ == 'packageA/remitVoucher/index');
+		let content = JSON.parse(JSON.stringify(page.data.content));
+		content.pageNumber = 1;
+		content.pageSize = page.data.list.length;
+		_Http.basic({
+			"id": 20230111141104,
+			content
+		}).then(res => {
+			console.log("更新订单列表", res)
+			if (res.msg == '成功') page.setData({
+				list: res.data
+			})
+		})
+	},
+})

+ 8 - 0
packageA/remitVoucher/detail.json

@@ -0,0 +1,8 @@
+{
+  "usingComponents": {
+    "Preview":"/packageA/shipment/modules/preview/index",
+    "remitVoucher":"/packageA/remitVoucher/modules/remitDetail",
+    "van-datetime-picker": "@vant/weapp/datetime-picker/index",
+    "van-popup": "@vant/weapp/popup/index"
+  }
+}

+ 96 - 0
packageA/remitVoucher/detail.scss

@@ -0,0 +1,96 @@
+.intr {
+    position: relative;
+    width: 100vw;
+    box-sizing: border-box;
+    background-color: #fff;
+    padding: 20rpx 30rpx;
+
+    .num {
+        height: 40rpx;
+        line-height: 40rpx;
+        font-size: 32rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #333333;
+        margin-bottom: 10rpx;
+    }
+
+    .exp {
+        height: 34rpx;
+        line-height: 34rpx;
+        font-size: 26rpx;
+        margin-bottom: 8rpx;
+        color: #666;
+    }
+
+    .copy {
+        position: absolute;
+        right: 30rpx;
+        top: 20rpx;
+        background-color: #FF9933;
+        border-radius: 12rpx;
+        padding: 0 10rpx;
+        color: #fff;
+        border: none;
+        height: 70rpx;
+    }
+
+}
+
+.box {
+    width: 100vw;
+    padding: 20rpx 30rpx;
+    box-sizing: border-box;
+    background-color: #fff;
+    margin-top: 10rpx;
+
+    .row {
+        display: flex;
+        justify-content: space-between;
+        min-height: 60rpx;
+        align-items: center;
+
+        .label {
+            font-size: 28rpx;
+        }
+
+        checkbox {
+            width: 36rpx;
+            height: 36rpx;
+            margin-right: 6rpx;
+        }
+
+        checkbox .wx-checkbox-input {
+            width: 36rpx;
+            height: 36rpx;
+        }
+    }
+}
+
+
+.footer {
+    display: flex;
+    justify-content: 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;
+    z-index: 9999;
+    padding-top: 10rpx;
+
+    .but {
+        width: 690rpx;
+        height: 90rpx;
+        background: var(--warning);
+        border-radius: 16rpx;
+        font-size: 28rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #fff;
+    }
+
+}

+ 38 - 0
packageA/remitVoucher/detail.wxml

@@ -0,0 +1,38 @@
+<view class="intr">
+	<view class="num">
+		{{detail.billno}}
+	</view>
+	<view class="exp">状态:{{detail.status}}</view>
+	<view class="exp">经销商编号:{{detail.agentnum}}</view>
+	<view class="exp">经销商简称:{{detail.enterprisename}}</view>
+	<view class="exp">付款人:{{ detail.payer}}</view>
+	<view class="exp">付款时间:{{ detail.paydate}}</view>
+	<view class="exp">回款归属月份:{{ detail.period}}</view>
+	<view class="exp">打款金额:{{ detail.amount}}</view>
+</view>
+<Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+	<Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
+    <remitVoucher detail="{{detail}}" slot="打款明细" id="remitVoucher" bind:onSuccess="getDetail"></remitVoucher>
+	<view style="height: 140rpx;" />
+</Yl_FunTabs>
+
+<!-- 底部 -->
+<Yl_Tabbar list='{{tabbarsList}}' bind:callback="tabbarOnClick" />
+
+
+<van-popup
+  show="{{ show }}"
+  position="bottom"
+  custom-style="height: 50%;"
+  bind:close="onClose"
+  bind:click-overlay="onClose"
+  z-index="9999"
+>
+	<van-datetime-picker
+		type="date"
+		value="{{ currentDate }}"
+		formatter="{{ formatter }}"
+		bind:confirm="checkSubmit"
+		bind:cancel="onClose"
+	/>
+</van-popup>

+ 98 - 0
packageA/remitVoucher/index.js

@@ -0,0 +1,98 @@
+const _Http = getApp().globalData.http;
+
+Page({
+  data: {
+    loading: true,
+    active: "",
+    "content": {
+      nocache: true,
+      "pageNumber": 1,
+      "pageTotal": 1,
+      "pageSize": 20,
+      total: 0,
+      "where": {
+        "condition": "",
+      },
+      sort: []
+    },
+    filter: [{
+      label: "品牌",
+      index: null,
+      showName: "brandname", //显示字段
+      valueKey: "brandname", //返回Key
+      selectKey: "brandname", //传参 代表选着字段 不传参返回整个选择对象
+      value: "", //选中值
+      list: []
+    }, {
+      label: "领域",
+      index: null,
+      showName: "tradefield", //显示字段
+      valueKey: "tradefield", //返回Key
+      selectKey: "tradefield", //传参 代表选着字段 不传参返回整个选择对象
+      value: "", //选中值
+      list: []
+    }]
+  },
+  onLoad(options) {
+    this.getList(true)
+  },
+  /* 处理筛选 */
+  handleFilter({
+    detail
+  }) {
+    console.log(detail)
+  },
+  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.where.status = this.data.active;
+    _Http.basic({
+      "id": 20221226152904,
+      "version": 1,
+      content
+    }).then(res => {
+      console.log("开票申请列表", res)
+      this.selectComponent('#ListBox').RefreshToComplete();
+      this.setData({
+        list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+        "content.pageNumber": res.pageNumber + 1,
+        "content.pageTotal": res.pageTotal,
+        "content.sort": res.sort,
+        "content.total": res.total,
+        loading: false
+      })
+    })
+  },
+  /* 去新增 */
+  toAdd(){
+    wx.navigateTo({
+      url: '/packageA/remitVoucher/update'
+    })
+  },
+  /* 搜索 */
+  onSearch({
+    detail
+  }) {
+    this.setData({
+      "content.where.condition": detail
+    });
+    this.getList(true)
+  },
+  /* 切换tabs */
+  tabsChange(e) {
+    this.setData({
+      "content.where.status": e.detail.name,
+      active: e.detail.name
+    });
+    this.getList(true);
+  },
+  onReady() {
+    this.setListHeight()
+  },
+  /* 设置页面高度 */
+  setListHeight() {
+    this.selectComponent("#ListBox").setHeight(".total", this);
+  },
+})

+ 5 - 0
packageA/remitVoucher/index.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "List":"./modules/list"
+  }
+}

+ 1 - 0
packageA/remitVoucher/index.scss

@@ -0,0 +1 @@
+/* packageA/remitVoucher/index.wxss */

+ 17 - 0
packageA/remitVoucher/index.wxml

@@ -0,0 +1,17 @@
+<import src="index.skeleton.wxml" />
+<template is="skeleton" wx:if="{{loading}}" />
+<Yl_HeadNav styleType="1" sort='{{content.sort}}' placeholder='搜索' bindonSearch="onSearch" />
+<van-tabs active="{{ active }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
+	<van-tab title="全部" name='' />
+	<van-tab title="新建" name='新建' />
+	<van-tab title="提交" name='提交' />
+	<van-tab title="审核" name='审核' />
+</van-tabs>
+<view class="total" style="height: 20rpx;" />
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+	<List list="{{list}}" />
+</Yl_ListBox>
+<!-- 新建浮动按钮 -->
+<Yl_FloatingButton bindtap="toAdd" />
+<!-- 筛选条件 -->
+<Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />

+ 23 - 0
packageA/remitVoucher/modules/list.js

@@ -0,0 +1,23 @@
+// packageA/remitVoucher/modules/list.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    list: Array
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+
+  }
+})

+ 4 - 0
packageA/remitVoucher/modules/list.json

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

+ 54 - 0
packageA/remitVoucher/modules/list.scss

@@ -0,0 +1,54 @@
+.item {
+	width: 100vw;
+
+	margin-bottom: 20rpx;
+	background-color: #ffffff;
+
+
+	.top {
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			height: 80rpx;
+			width: 100%;
+			border-bottom: 1rpx solid #ddd;
+			box-sizing: border-box;
+			padding-right: 30rpx;
+			font-size: 28rpx;
+			padding-left: 30rpx;
+			box-sizing: border-box;
+
+			text{
+					color: var(--assist);
+			}
+	}
+
+	.content {
+			position: relative;
+			padding-bottom: 20rpx;
+			padding-left: 30rpx;
+			box-sizing: border-box;
+
+			.num {
+					height: 40rpx;
+					line-height: 40rpx;
+					font-size: 28rpx;
+					color: #333333;
+					padding: 20rpx 0;
+			}
+
+			.exp {
+					height: 34rpx;
+					font-size: 24rpx;
+					margin-bottom: 8rpx;
+					color: #999999;
+			}
+	}
+}
+
+/* 文本行数限制 */
+.line-1 {
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+}

+ 26 - 0
packageA/remitVoucher/modules/list.wxml

@@ -0,0 +1,26 @@
+<navigator url="/packageA/remitVoucher/detail?id={{item.sa_paybillid}}" class="item" wx:for="{{list}}" wx:key="billno">
+    <view class="top">
+        付款时间 : {{item.paydate || ' --'}} <text>{{item.status}}</text>
+    </view>
+    <view class="content">
+        <view class="num">
+            凭证单号:{{item.billno}}
+        </view>
+        <view class="exp">
+            经销商编号:{{item.agentnum || ' --'}}
+        </view>
+        <view class="exp">
+            经销商简称:{{item.enterprisename || ' --'}}
+        </view>
+        <view class="exp">
+            付款人:{{item.payer || ' --'}}
+        </view>
+        <view class="exp">
+            回款归属月份:{{item.period || ' --'}}
+        </view>
+        <view class="exp">
+            打款金额:{{item.amount || ' --'}}
+        </view>
+    </view>
+</navigator>
+<Yl_Empty wx:if="{{list.length==0}}" />

+ 155 - 0
packageA/remitVoucher/modules/remitDetail.js

@@ -0,0 +1,155 @@
+// packageA/remitVoucher/modules/remitDetail.js
+const _Http = getApp().globalData.http
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    detail: {
+      type: Object
+    }
+  },
+  options: {
+    addGlobalClass:true
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    content: {
+      nocache: true,
+      pageNumber: 1,
+      pageTotal: 1,
+      total: null
+    }
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    getList(id, init) {
+      let content = this.data.content;
+      content.sa_paybillid = id;
+      if (init) content.pageNumber = 1;
+      _Http.basic({
+        "id": "20221227092804",
+        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,
+          "content.total": res.total,
+          sa_paybillid: id
+        })
+      })
+    },
+    /* 添加明细 */
+    addProduct () {
+      wx.navigateTo({
+        url: `/packageA/remitVoucher/modules/selectAccount/index?params=${
+          JSON.stringify({
+            "id": 20221228085004,
+            "content": {
+              "pageNumber": 1,
+              "pageSize": 20,
+              "sa_paybillid":getCurrentPages()[getCurrentPages().length - 1].data.sa_paybillid,
+              "where": {
+                  "condition": ""
+              }
+            }
+          })
+        }`,
+      })
+      getApp().globalData.handleSelect = this.handleSelect.bind(this)
+    },
+    /* 操作选中的账户信息 */
+    async handleSelect (data) {
+      wx.navigateBack()
+      let paybilldetails = data.list.map(item => {
+        return {
+          "sa_paybilldetailid": 0,
+          "sa_accountclassid": item.sa_accountclassid,
+          "amount": item.amount
+        }
+      }),page = getCurrentPages()[getCurrentPages().length - 2]
+      let res = await _Http.basic({
+        "id":20221227092904,
+        "content": {
+          sa_paybillid:page.data.sa_paybillid,
+          paybilldetails
+        }
+      })
+      if( res.msg == '成功' ) {
+        this.getList(page.data.sa_paybillid,true)
+      }
+    },
+    /* 金额改变 */
+    async priceChange (e) {
+      console.log(e);
+      let data = e.currentTarget.dataset.data
+      if (e.detail.value == data.amount) return
+      let res = await _Http.basic({
+        "id":20221227092904,
+        "content": {
+          sa_paybillid:data.sa_paybillid,
+          paybilldetails: [
+            {
+              "sa_paybilldetailid": data.sa_paybilldetailid,
+                "sa_accountclassid":data.sa_accountclassid,
+                "amount":e.detail.value,
+            }
+          ]
+        }
+      })
+      if (res.msg == '成功') {
+        this.triggerEvent('onSuccess')
+      } else {
+        wx.showToast({
+          title: res.msg,
+          icon:'none'
+        })
+      }
+    },
+    /* 删除明细 */
+    deleteProduct (e) {
+      if (this.properties.detail.status != '新建') return wx.showToast({
+        title: '非新建状态无法删除',
+        icon:'none'
+      })
+      wx.showModal({
+        title:'提示',
+        content:'是否删除当前打款明细?',
+        complete: async (res) => {
+          console.log(res);
+          if (res.confirm) {
+            let res = await _Http.basic({
+              "id": 20221227093004,
+              "content": {
+                  "sa_paybillid":e.currentTarget.dataset.data.sa_paybillid,
+                  "sa_paybilldetailids":[e.currentTarget.dataset.data.sa_paybilldetailid]
+              }
+            })
+            if ( res.msg == '成功' ) {
+              this.getList(getCurrentPages()[getCurrentPages().length - 1].data.sa_paybillid,true)
+            } else {
+              console.log('出发');
+              wx.showToast({
+                title: res.msg,
+                icon:'none'
+              })
+            }
+          }
+        }
+      })
+    }
+  }
+})

+ 4 - 0
packageA/remitVoucher/modules/remitDetail.json

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

+ 32 - 0
packageA/remitVoucher/modules/remitDetail.scss

@@ -0,0 +1,32 @@
+@import "../../../static/common-head.scss";
+.item {
+	background: #ffffff;
+	width: 100vw;
+	border-bottom: 1px solid #cccccc;
+	padding: 10rpx 20rpx;
+	font-size: 24rpx;
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	.input {
+		height: 54rpx;
+		background: #FFFFFF;
+		border-radius: 8rpx;
+		border: 1rpx solid #CCCCCC;
+		font-size: 28rpx;
+		font-family: PingFang SC-Regular, PingFang SC;
+		color: #333333;
+		line-height: 44px;
+		text-align: center;
+		margin-left: 20rpx;
+	}
+	.delete {
+		width: 68rpx;
+		height: 68rpx;
+		line-height: 68rpx;
+		text-align: center;
+		font-size: 32rpx;
+		color: #999;
+		margin-right: 20rpx;
+	}
+}

+ 24 - 0
packageA/remitVoucher/modules/remitDetail.wxml

@@ -0,0 +1,24 @@
+<view class="head">
+  <view class="count">产品明细</view>
+  <view class="expand">
+    <navigator url="#" class="but" bindtap="addProduct">
+      <van-icon name="plus" />
+    </navigator>
+  </view>
+</view>
+
+<view wx:for="{{ list }}" wx:key="{{ index }}" class="item">
+	<view class="content">
+		<view style="margin-bottom:20rpx">账户名称:{{item.accountname}}</view>
+		<view style="display:flex;align-items: center;">
+			金额
+			<input type="text" disabled="{{detail.status != '新建'}}" class="input" value="{{item.amount}}" data-data="{{item}}" bindblur="priceChange"/>
+		</view>
+	</view>
+	<view class="delete" data-data="{{item}}" catchtap="deleteProduct">
+		<text class="iconfont icon-guanlian-shanchu" />
+	</view>
+</view> 
+<block wx:if="{{list.length==0}}">
+	<Yl_Empty />
+</block>

+ 124 - 0
packageA/remitVoucher/modules/selectAccount/index.js

@@ -0,0 +1,124 @@
+const _Http = getApp().globalData.http;
+
+Page({
+    data: {
+        loading: true,
+        params: {}, //请求体
+        result: [], //返回结果
+        radio: false, //是否为单选
+        idname: "sa_accountclassid", //idkey
+        showName: "enterprisename",
+        list:[]
+    },
+    onLoad(options) {
+        if (options.params) {
+            let params = JSON.parse(options.params);
+            if (!params.content.pageNumber || !params.content.pageTotal) {
+                params.content.pageNumber = 1;
+                params.content.pageTotal = 1;
+            }
+            this.setData({
+                params
+            });
+        }
+        this.setData({
+            radio: options.radio ? true : false,
+            idname: options.idname || this.data.idname,
+            showName: options.showName || this.data.showName,
+        });
+        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.forEach(item => item.amount = 0)
+            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
+            })
+        })
+    },
+    /*金额改变 */
+    amountChange (e) {
+      e.currentTarget.dataset.item.amount = e.detail.value
+      let index = this.data.list.findIndex(item => item.sa_accountclassid == e.currentTarget.dataset.item.sa_accountclassid)
+      let list = this.data.list
+      list[index] = e.currentTarget.dataset.item
+      this.setData({
+        list
+      })
+    },
+    /* 选中 */
+    changeResult(e) {
+        let {
+            id
+        } = e.currentTarget.dataset, result = this.data.result;
+        if (this.data.radio) {
+            result = [id];
+        } else {
+            result.some(v => v == id) ? result = result.filter(v => v != id) : result.push(id)
+        }
+        this.setData({
+            result
+        });
+        if (this.data.radio) this.submit();
+    },
+    /* 提交 */
+    submit() {
+        let result = this.data.result,
+            obj = this.data.radio ? {
+                id: result,
+                item: this.data.list.find(value => value[this.data.idname] == result),
+                value: [this.data.list.find(value => value[this.data.idname] == result)[this.data.showName], result]
+            } : {
+                result,
+                list: result.map(v => this.data.list.find(value => value[this.data.idname] == v)),
+                value: [result.map(v => {
+                    let data = this.data.list.find(value => value[this.data.idname] == v);
+                    return data ? data[this.data.showName] : ""
+                }), result]
+            }
+        getApp().globalData.handleSelect && getApp().globalData.handleSelect(obj)
+    },
+    /* 开始搜索 */
+    startSearch({
+        detail
+    }) {
+        let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
+        if (detail == condition) return;
+        this.setData({
+            'content.where.condition': detail,
+            'params.content.where.condition': detail
+        });
+        this.getList(true);
+    },
+    /* 取消搜索 */
+    onClear() {
+        this.setData({
+            'content.where.condition': "",
+            'params.content.where.condition': ""
+        });
+        this.getList(true);
+    },
+    onReady() {
+        this.selectComponent("#ListBox").setHeight(".total", this);
+    },
+    onUnload() {
+        //回收数据
+        getApp().globalData.handleSelect = null;
+        getApp().globalData.savePage = null;
+    }
+})

+ 3 - 0
packageA/remitVoucher/modules/selectAccount/index.json

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

+ 92 - 0
packageA/remitVoucher/modules/selectAccount/index.scss

@@ -0,0 +1,92 @@
+page {
+	height: 100vh;
+	overflow: hidden;
+}
+
+.total {
+	height: 60rpx;
+	line-height: 60rpx;
+	font-size: 24rpx;
+	font-family: PingFang SC-Regular, PingFang SC;
+	color: #666666;
+	padding-left: 30rpx;
+}
+
+.input {
+    height: 54rpx;
+    background: #FFFFFF;
+    border-radius: 8rpx;
+    border: 1rpx solid #CCCCCC;
+    font-size: 28rpx;
+    font-family: PingFang SC-Regular, PingFang SC;
+    color: #333333;
+    line-height: 44px;
+    text-align: center;
+    margin-left: 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;
+	}
+}

+ 39 - 0
packageA/remitVoucher/modules/selectAccount/index.wxml

@@ -0,0 +1,39 @@
+<import src="index.skeleton.wxml" />
+<template is="skeleton" wx:if="{{loading}}" />
+
+<van-search class="search" value="{{ params.content.where.condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
+<view class="total">共{{params.content.total}}个</view>
+
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+	<navigator class="item" url="#" wx:for="{{list}}" wx:key="{{item.sa_accountclassid}}" data-id="{{item.sa_accountclassid}}" bindtap="changeResult">
+		<van-checkbox wx:if="{{!radio}}" value="{{ handle.isCheck(item.sa_accountclassid,result) }}" shape="square" icon-size='28rpx' />
+		<view class="main" style="padding-left: {{!radio?'10rpx':''}};">
+			<view class="title line-1">账户名称:{{item.accountname}}</view>
+			<view class="title" style="display:flex;margin:20rpx 0;align-items: center;">
+                金额:
+                <input type="text" class="input" value="{{item.amount}}" data-item="{{item}}" bindinput="amountChange"/>
+            </view>
+
+		</view>
+	</navigator>
+	<view wx:if="{{!radio}}" style="height: 130rpx;" />
+	<Yl_Empty wx:if="{{list.length==0}}" />
+</Yl_ListBox>
+
+<block wx:if="{{!radio}}">
+	<view class="footer">
+		<view class="count">
+			已选:{{result.length}}
+		</view>
+		<van-button custom-class='but' disabled='{{result.length==0}}' bind:click="submit">确定</van-button>
+	</view>
+	<wxs module="handle">
+		module.exports = {
+			isCheck: function (id, list) {
+				return list.some(function (v) {
+					return v == id
+				});
+			},
+		}
+	</wxs>
+</block>

+ 225 - 0
packageA/remitVoucher/update.js

@@ -0,0 +1,225 @@
+const _Http = getApp().globalData.http,
+    getTime = require("../../utils/getTime");
+
+Page({
+    data: {
+        showAll: false,
+        disabled: true,
+        content: {
+            "sa_paybillid": 0,
+            "sys_enterpriseid": '',
+            "payer": "",
+            "paydate": "",
+            "amount": "",
+            "remarks": "",
+            "bank": "",
+            "bankcardno": ""
+        },
+        form: [{
+                label: "经销商",
+                error: false,
+                errMsg: "",
+                type: "route",
+                url: "/select/agent/index",
+                params: {
+                    "classname": "webmanage.sale.agents.agents",
+                    "method": "query_agentList",
+                    "content": {
+                        "pageNumber": 1,
+                        "pageSize": 20,
+                        "where": {
+                            "condition": ""
+                        }
+                    }
+                  },
+                query: '&radio=true',
+                value: "",
+                placeholder: "选择经销商信息",
+                valueName: "sys_enterpriseid",
+                checking: "base",
+                required: true,
+                interrupt:true
+            },
+            {
+                label: "付款人",
+                error: false,
+                errMsg: "",
+                type: "text",
+                value: "",
+                placeholder: "付款人",
+                valueName: "payer",
+                required: false,
+                disabled:true
+            },{
+                label: "银行账号",
+                error: false,
+                errMsg: "",
+                type: "text",
+                value: "",
+                placeholder: "银行账号",
+                valueName: "bankcardno",
+                required: false,
+                disabled:true
+
+            },{
+                label: "银行",
+                error: false,
+                errMsg: "",
+                type: "text",
+                value: "",
+                placeholder: "银行",
+                valueName: "bank",
+                required: false,
+                disabled:true
+            },{
+                label: "付款时间",
+                error: false,
+                errMsg: "",
+                type: "date",
+                value: getTime.formatTime(new Date(),'-').split(' ')[0],
+                placeholder: "请选择付款时间",
+                valueName: "paydate",
+                required: true,
+            },{
+                label: "打款总金额",
+                error: false,
+                errMsg: "",
+                type: "number",
+                value: "",
+                placeholder: "请输入打款总金额",
+                valueName: "amount",
+                required: true,
+
+            },{
+                label: "转入银行",
+                error: false,
+                errMsg: "",
+                type: "text",
+                value: "",
+                placeholder: "请输入转入银行",
+                valueName: "inbank",
+                required: false,
+            },
+            {
+                label: "转入账户",
+                error: false,
+                errMsg: "",
+                type: "text",
+                value: "",
+                placeholder: "请输入转入账户",
+                valueName: "inbankcardno",
+                required: false,
+            },
+            {
+                label: "备注",
+                error: false,
+                errMsg: "",
+                type: "text",
+                value: "",
+                placeholder: "请输入备注",
+                valueName: "remarks",
+                required: false,
+            },
+        ]
+    },
+    onLoad(options) {
+        if (options.rowData) {
+            // wx.setNavigationBarTitle({
+            //   title: 'title',
+            // })
+            let data = JSON.parse(options.rowData);
+            console.log(data);
+            this.setData({
+                form: this.data.form.map(v => {
+                    if (v.valueName != 'region') {
+                        if (v.valueName == 'enterprisename') {
+                            v.value = [data[v.valueName]]
+                        } else {
+                            v.value = data[v.valueName];
+                        }
+                    } else {
+                        v.value = data.province ? [data.province, data.city, data.county] : []
+                    }
+                    return v
+                }),
+                'form[0].value': [data.enterprisename,[data.sys_enterpriseid]],
+                'content.sa_paybillid':data.sa_paybillid
+            })
+            this.selectComponent('#Form').confirm()
+            console.log(this.data.form);
+        }
+    },
+    /* 打断处理form */
+    interrupt({
+        detail
+    }) {
+        console.log("打断", detail)
+        detail.form[1].value = ''
+        detail.form[2].value = ''
+        detail.form[3].value = ''
+        detail.form[detail.temporary.index].value = detail.data.value
+        this.queryMoneyInfo(detail.data.id[0],detail.form)
+
+        this.selectComponent('#Form').confirm()
+        wx.navigateBack()
+    },
+    /* 获取财务信息 */
+    async queryMoneyInfo (id,form) {
+        let res = await _Http.basic({
+            "id": 20221013160602,
+            "content": {
+                "sys_enterpriseid":id,
+                "pageNumber": 1,
+                "pageSize": 20,
+                "where": {
+                    "condition": ""
+                }
+            },
+        })
+        form[1].value = res.data[0].enterprisename
+        form[2].value = res.data[0].bank
+        form[3].value = res.data[0].bankcardno
+        this.setData({
+            form:form
+        })
+        console.log(this.data.form);
+    },
+    async submit() {
+        let content = {
+            ...this.data.content,
+            ...this.selectComponent("#Form").submit()
+        }
+        content.sys_enterpriseid = content.sys_enterpriseid[1][0] || ''
+        let res = await _Http.basic({
+            "id": "20221226153004",
+            content
+        })
+        console.log(res);
+        if (res.msg == '成功') {
+            wx.navigateBack()
+            getCurrentPages().forEach(item => {
+                if (item.__route__ == 'packageA/remitVoucher/index') {
+                    item.getList(true)
+                } else if (item.__route__ == 'packageA/remitVoucher/detail') {
+                    item.getDetail(true)
+                }
+            })
+        }
+    },
+    // 是否显示全部
+    onChange({
+        detail
+    }) {
+        this.setData({
+            showAll: detail
+        })
+    },
+    /* 表单必填项是否完成 */
+    onConfirm({
+        detail
+    }) {
+        this.setData({
+            disabled: detail
+        })
+    }
+})

+ 5 - 0
packageA/remitVoucher/update.json

@@ -0,0 +1,5 @@
+{
+	"usingComponents": {
+		"Yl_Headline": "/components/Yl_Headline/index"
+	}
+}

+ 26 - 0
packageA/remitVoucher/update.scss

@@ -0,0 +1,26 @@
+.footer {
+	display: flex;
+	justify-content: 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;
+	z-index: 9999;
+	padding-top: 10rpx;
+
+	.but {
+			width: 690rpx;
+			height: 90rpx;
+			background: var(--warning);
+			border-radius: 16rpx;
+			font-size: 28rpx;
+			font-family: PingFang SC-Bold, PingFang SC;
+			font-weight: bold;
+			color: #fff;
+	}
+
+}

+ 7 - 0
packageA/remitVoucher/update.wxml

@@ -0,0 +1,7 @@
+<Yl_Headline title='基本信息' type='switch' switchLabel='仅显示必填信息' switch='{{showAll}}' bind:callBack='onChange' />
+<Yl_Field id='Form' form='{{form}}' showAll='{{!showAll}}' bind:onConfirm='onConfirm' bind:interrupt="interrupt">
+	<view slot='discountrate' style="margin-right: 36rpx;">%</view>
+</Yl_Field>
+<view class="footer">
+	<van-button custom-class='but' disabled="{{disabled}}" bind:click="submit">提交</van-button>
+</view>