Explorar el Código

Merge branch 'master' of http://116.255.223.226:3000/zhangzl/nsgk_wechat

# Conflicts:
#	utils/API.js
master
yujk hace 3 años
padre
commit
8087515c50
Se han modificado 29 ficheros con 1779 adiciones y 314 borrados
  1. +6
    -4
      env/env.js
  2. BIN
      image/apply/ABC.png
  3. BIN
      image/apply/CCB.png
  4. BIN
      image/apply/ICBC.png
  5. BIN
      image/apply/RCB.png
  6. BIN
      image/apply/icon_ABC.png
  7. BIN
      image/apply/icon_CCB.png
  8. BIN
      image/apply/icon_RCB.png
  9. BIN
      image/apply/icon_other.png
  10. +14
    -4
      pages/apply/index.js
  11. +17
    -54
      pages/apply/index.wxml
  12. +35
    -5
      pages/apply/index.wxss
  13. +828
    -54
      pages/apply/paymentTemplate/add/add.js
  14. +5
    -1
      pages/apply/paymentTemplate/add/add.json
  15. +284
    -125
      pages/apply/paymentTemplate/add/add.wxml
  16. +27
    -10
      pages/apply/paymentTemplate/add/add.wxss
  17. +98
    -3
      pages/apply/paymentTemplate/paymentTemplate.js
  18. +22
    -18
      pages/apply/paymentTemplate/paymentTemplate.wxml
  19. +1
    -0
      pages/apply/paymentTemplate/paymentTemplate.wxss
  20. +121
    -2
      pages/payee/add/add.js
  21. +14
    -1
      pages/payee/add/add.json
  22. +57
    -9
      pages/payee/add/add.wxml
  23. +116
    -4
      pages/payee/index.js
  24. +3
    -1
      pages/payee/index.json
  25. +15
    -10
      pages/payee/index.wxml
  26. +11
    -3
      pages/payee/index.wxss
  27. +17
    -2
      project.private.config.json
  28. +44
    -3
      utils/API.js
  29. +44
    -1
      utils/util.js

+ 6
- 4
env/env.js Ver fichero

@@ -1,12 +1,14 @@
module.exports = {
DEV: {
URL_PREFIX: 'http://192.168.31.228:8080',
URL_PREFIX: 'http://192.168.31.178/api',
},
PRE: {
URL_PREFIX: 'http://192.168.31.228:8080',
URL_PREFIX: 'http://192.168.31.178:8080/api',
},
PROD: {
URL_PREFIX: 'http://192.168.31.228:8080',

URL_PREFIX: 'http://192.168.31.178:8080/api',
},
IMGURL: {
URL_PREFIX: 'http://192.168.31.178:8080',
}
}

BIN
image/apply/ABC.png Ver fichero

Antes Después
Anchura: 22  |  Altura: 22  |  Tamaño: 833 B

BIN
image/apply/CCB.png Ver fichero

Antes Después
Anchura: 22  |  Altura: 22  |  Tamaño: 706 B

BIN
image/apply/ICBC.png Ver fichero

Antes Después
Anchura: 22  |  Altura: 22  |  Tamaño: 795 B

BIN
image/apply/RCB.png Ver fichero

Antes Después
Anchura: 22  |  Altura: 22  |  Tamaño: 824 B

BIN
image/apply/icon_ABC.png Ver fichero

Antes Después
Anchura: 22  |  Altura: 22  |  Tamaño: 712 B

BIN
image/apply/icon_CCB.png Ver fichero

Antes Después
Anchura: 22  |  Altura: 23  |  Tamaño: 590 B

BIN
image/apply/icon_RCB.png Ver fichero

Antes Después
Anchura: 22  |  Altura: 21  |  Tamaño: 853 B

BIN
image/apply/icon_other.png Ver fichero

Antes Después
Anchura: 22  |  Altura: 22  |  Tamaño: 706 B

+ 14
- 4
pages/apply/index.js Ver fichero

@@ -47,9 +47,9 @@ swichPaymentApply:function(e){
show: false,
})
},
goTemplate:function(){
goTemplate:function(e){
wx.navigateTo({
url: 'paymentTemplate/paymentTemplate'
url: 'paymentTemplate/paymentTemplate?id='+e.currentTarget.dataset.id
})
},

@@ -88,13 +88,16 @@ swichPaymentApply:function(e){
UTIL.httpRequest(API.URL_GET_APPROVALITEMSLIST, {method:'GET',dataType:'1'}, {
success: (res) => {
if (res.code == API.SUCCESS_CODE) {
that.setData({
approvalItemsOptions : res.rows
})
}
}
})
UTIL.httpRequest(API.URL_GET_ACCOUNTLIST, sendData,{
success: (res) => {
for (let i = 0; i < res.rows.length; i++) {
if(res.rows[i].bankAccountNumber==null){continue;}
res.rows[i].bankAccountNumber = res.rows[i].bankAccountNumber.replace(/(\d{4})(?=\d)/g, "$1 ")
}
console.log(res.rows)
@@ -104,7 +107,14 @@ swichPaymentApply:function(e){
}
})
},

delete(e){
console.log(e);
UTIL.httpRequest(API.URL_GET_REMOVEAPPROVAL + e.currentTarget.dataset.id, {method:'GET'},{
success: (res) => {
UTIL.showToastNoneIcon('删除成功!');
}
})
},
/**
* 生命周期函数--监听页面隐藏
*/


+ 17
- 54
pages/apply/index.wxml Ver fichero

@@ -13,31 +13,22 @@
<view class="main">
<van-tabs sticky color="#000">
<van-tab title="银行账户">
<view class="bank_box">
<view class="bank_box" wx:for="{{accountList}}" wx:key="index">
<text class="zt">一般户</text>
<image src="../../image/apply/jsyh_bg2.png" style="width: 100%;position: absolute;bottom:0;z-index: 9;" mode="widthFix"></image>
<image src="../../image/apply/bgt.png" style="width: 100%;position: absolute;top:0;right:0;z-index: 9;height: 100%;"></image>
<view class="bank_content">
<image src="../../image/apply/jsyh_icon.png" style="width: 28%;" mode="widthFix"></image>
<view style="margin-bottom: 2vh;">6217 0021 9000 7972 186<text>卡号</text></view>
<view class="bank_content {{item.bankType == 1 ? 'ICBC':item.bankType == 2 ? 'RCB':item.bankType == 3 ? 'ABC':item.bankType == 4 ? 'CCB':''}}">
<view class="bankName">
<image src="../../image/apply/{{item.bankType == 1 ? 'ICBC':item.bankType == 2 ? 'RCB':item.bankType == 3 ? 'ABC':item.bankType == 4 ? 'CCB':''}}.png" style="width: 25px" mode="widthFix"></image>
<text>{{item.bankType == 1 ? '中国银行':item.bankType == 2 ? '农商行(山东省)':item.bankType == 3 ? '农业银行':item.bankType == 4 ? '建设银行':''}}</text>
</view>
<view style="margin-top: 2vh;">{{item.bankAccountNumber}}<text>卡号</text></view>
<view>可用余额</view>
<view style="font-weight: bold;font-size: 22px;margin-top: 2vh;">10,288.83</view>
<view style="font-weight: bold;font-size: 22px;margin-top: 2vh;">{{item.balance}}</view>
</view>
</view>

<view class="bank_box">
<text class="zt">一般户</text>
<image src="../../image/apply/jsyh_bg2.png" style="width: 100%;position: absolute;bottom:0;z-index: 9;" mode="widthFix"></image>
<image src="../../image/apply/bgt.png" style="width: 100%;position: absolute;top:0;right:0;z-index: 9;height: 100%;"></image>
<view class="bank_content">
<image src="../../image/apply/jsyh_icon.png" style="width: 28%;" mode="widthFix"></image>
<view style="margin-bottom: 2vh;">6217 0021 9000 7972 186<text>卡号</text></view>
<view>可用余额</view>
<view style="font-weight: bold;font-size: 22px;margin-top: 2vh;">10,288.83</view>
</view>
</view>

</van-tab>

<van-tab title="公务卡">
<view class="bank_box">
@@ -61,47 +52,19 @@
</view>

<van-action-sheet show="{{show}}" title="支付模板" bind:close="closeBox">
<van-swipe-cell right-width="{{ 65 }}">
<van-swipe-cell right-width="{{ 65 }}" wx:for="{{approvalItemsOptions}}" wx:key="index">
<van-cell-group>
<van-cell label="支付水电、网费、房租" bindtap="goTemplate" >
<van-cell label="{{item.approvalItems}}" bindtap="goTemplate" data-id="{{item.id}}" >
<view slot="title">
<view class="van-cell-text">日常支付水电模板<van-tag plain type="danger" color="#FC9A55" style="margin-left:10px;">默认</van-tag></view>
<view class="van-cell-text">{{item.templateName}}<van-tag plain type="danger" color="#FC9A55" style="margin-left:10px;" wx:if="{{index == 0}}">默认</van-tag></view>
</view>
<van-icon slot="icon" name="https://636c-cloud1-8gya17a31667774d-1310628902.tcb.qcloud.la/icon_mrmb.png?sign=5e5df640777f6a7993c45e1a559dd998&t=1648619865" class="custom-icon" size="40" style="margin-right: 10px;" />
</van-cell>
</van-cell-group>
<view slot="right" class="deleteBox">
<image src="../../image/apply/icon_delete.png" style="width: 25px;height: 25px;margin: 0 auto;"></image>
</view>
</van-swipe-cell>
<van-swipe-cell right-width="{{ 65 }}">
<van-cell-group>
<van-cell title="日常支付水电模板" label="支付水电、网费、房租" >
<van-icon slot="icon" name="https://636c-cloud1-8gya17a31667774d-1310628902.tcb.qcloud.la/icon_mb.png?sign=2a8bbe2cb4d4e0f28a99fddbe042d26c&t=1648620032" class="custom-icon" size="40" style="margin-right: 10px;" />
</van-cell>
</van-cell-group>
<view slot="right" class="deleteBox">
<image src="../../image/apply/icon_delete.png" style="width: 25px;height: 25px;margin: 0 auto;"></image>
</view>
</van-swipe-cell>
<van-swipe-cell right-width="{{ 65 }}">
<van-cell-group>
<van-cell title="日常支付水电模板" label="支付水电、网费、房租" >
<van-icon slot="icon" name="https://636c-cloud1-8gya17a31667774d-1310628902.tcb.qcloud.la/icon_mb.png?sign=2a8bbe2cb4d4e0f28a99fddbe042d26c&t=1648620032" class="custom-icon" size="40" style="margin-right: 10px;" />
</van-cell>
</van-cell-group>
<view slot="right" class="deleteBox">
<image src="../../image/apply/icon_delete.png" style="width: 25px;height: 25px;margin: 0 auto;"></image>
</view>
</van-swipe-cell>
<van-swipe-cell right-width="{{ 65 }}">
<van-cell-group>
<van-cell title="日常支付水电模板" label="支付水电、网费、房租" >
<van-icon slot="icon" name="https://636c-cloud1-8gya17a31667774d-1310628902.tcb.qcloud.la/icon_mb.png?sign=2a8bbe2cb4d4e0f28a99fddbe042d26c&t=1648620032" class="custom-icon" size="40" style="margin-right: 10px;" />
<van-icon wx:if="{{index == 0}}" slot="icon" name="https://636c-cloud1-8gya17a31667774d-1310628902.tcb.qcloud.la/icon_mrmb.png?sign=5e5df640777f6a7993c45e1a559dd998&t=1648619865" class="custom-icon" size="40" style="margin-right: 10px;" />
<van-icon wx:else slot="icon" name="https://636c-cloud1-8gya17a31667774d-1310628902.tcb.qcloud.la/icon_mb.png?sign=2a8bbe2cb4d4e0f28a99fddbe042d26c&t=1648620032" class="custom-icon" size="40" style="margin-right: 10px;" />
</van-cell>
</van-cell-group>
<view slot="right" class="deleteBox">
<view slot="right" class="deleteBox" data-id="{{item.id}}" data-index="{{index}}" bindtap="delete">
<image src="../../image/apply/icon_delete.png" style="width: 25px;height: 25px;margin: 0 auto;"></image>
</view>
</van-swipe-cell>
</van-action-sheet>

+ 35
- 5
pages/apply/index.wxss Ver fichero

@@ -26,7 +26,7 @@
color: #fff;
}
.main{
width: 94%;
width: 100%;
margin: 0 auto;
margin-top: 3vw;
}
@@ -37,13 +37,38 @@

.bank_content{
color: #fff;
background:linear-gradient(to right, #176AB7, #318DE5);
width: 100%;
border-radius: 10px;
/* height: 100%; */
padding: 2vh 2vh 3vh;
padding: 2vh;
}

.ICBC{
background:url('http://192.168.31.196:81/bj/bg_ICBC.png') no-repeat center;
background-size: 100% 100%;
}
.ABC{
background:url('http://192.168.31.196:81/bj/bg_ABC.png') no-repeat center;
background-size: 100% 100%;
}
.CCB{
background:url('http://192.168.31.196:81/bj/bg_CCB.png') no-repeat center;
background-size: 100% 100%;
}
.RCB{
background:url('http://192.168.31.196:81/bj/bg_RCB.png') no-repeat center;
background-size: 100% 100%;
}

.bankName{
margin-top: 0!important;
}
.bankName image{
vertical-align: middle;
margin-right: 5px;
}
.bankName text{
margin: 0!important;
display: inline-block;
}
.bank_content view{
margin-top: 1vh;
}
@@ -55,6 +80,11 @@

.bank_box{
position: relative;
box-shadow: 0px 5px 9px #ccc;
overflow: hidden;
border-radius: 15px;
width: 94%;
margin: 0 auto;
margin-top: 20px;
}
.zt {


+ 828
- 54
pages/apply/paymentTemplate/add/add.js Ver fichero

@@ -1,6 +1,11 @@
// pages/apply/paymentTemplate/add/add.js
import * as UTIL from '../../../../utils/util.js';
import * as API from '../../../../utils/API.js';
let EVN_CONFIG = require('../../../../env/env');
const DISTRIBUTE_ENVIROMENT = 'IMGURL';
let {
URL_PREFIX,
} = EVN_CONFIG[DISTRIBUTE_ENVIROMENT];
const app = getApp();
Page({

@@ -10,68 +15,339 @@ Page({
data: {
isIPX: app.globalData.isIPX,
radio:'1',
steps: [
{
assigneeName: '同意',
activityName: '测试测试',
durationInMillis: '描述信息',
endTime: '2022-01-02',
comment: '同意',
type: '1'
active:0,
projectText:'',
balance:0,
showCapitalExpenditureType:false,
showApplyDate:false,
showTransferType:false,
showProject:false,
showProjectFundType:false,
showAccount:false,
showDialog:false,
capitalExpenditureTypeOptions:[],
transferTypeOptions:[],
projectOptions:[],
projectFundTypeOptions:[],
contractionOptions:[],
accountOptions:[],
moneyorderOptions:[],
form:{
approvalItemTemplate:{
approvalItems:'',//审批事项
submitCompany:'',//提交单位
submitDate:'',//提交日期
submitter:'',//提交人
telephone:'',//联系方式
totalAmount:0,//合计金额
templateName:'',//模板名称 选择保存模板的时候添加
dataType:'',//数据类型
},
{
assigneeName: '申请中',
activityName: '测试测试',
durationInMillis: '描述信息',
endTime: '2022-01-02',
comment: '同意',
type: '2'
},
{
assigneeName: '驳回',
activityName: '测试测试',
durationInMillis: '描述信息',
endTime: '2022-01-02',
comment: '同意',
type: '3'
},
{
assigneeName: '步骤四',
activityName: '测试测试',
durationInMillis: '描述信息',
endTime: '2022-01-02',
comment: '同意'
},
],
active:0
transfers:[{//事项信息集合以下是List对象信息
num:"一",
capitalExpenditureType:'',//资金支出类别
capitalExpenditureTypeText:'',//资金支出类别(展示用)
succeedAmount:'',//成功支付金额
payer:'',//付款方
payerAccount:'',//付款方账户
bankType:'',//所属银行
bankTypeText:'',//所属银行(展示用)
isPeers:'',//是否同行
operatorCode:'',//操作员代码
enterpriseCode:'',//企业编码
expenditureAmount:'',//支出总金额
applyDate:'',//申请时间
transferStatus:'',//转账状态
auditStatus:'0',//审批状态
paymentState:'',//支付状态
approvalMode:'1',//审批模式
paymentTime:'',//支付时间
bankPriority:'',//银行处理优先级
clientPriority:'',//客户处理优先级
transferType:'',//付款方式
transferTypeText:'',//付款方式(展示用)
requiredTransferTime:'',//要求转账时间
remark:'',//付款事由
startTime:'',//开票日期
endTime:'',//到期日期
orderType:'',//汇票类型
bankAccountType:'',//账户类别1 公户2私户
villageAccountType:'',//账户分类
payeeList:[{//收款方账户集合
payeeId:'0',//收款方id
payee:'',//收款方
bankDeposit:'',//开户行
incomeAmount:'',//收入金额
bankType:'',//所属银行0其他银行1中国银行2农商行(山东省)3农业银行4建设银行5工商银行
payeeAccount:'',//收款账户
}],
}],
},
projectForm:{
projectId:'',
projectName:'',
projectContractor:'',
projectAmount:'',
projectBillNum:'',
projectFundType:'',
outId:'',
ynType:'1',
},
contractionForm:{
id:'',
name:'',
code:'',
totalAmount:'',
},
accountForm:{},
fileForm:[],
isUpdate:false,
SJimage: [],
FPimage: [],
QTimage: [],
imgcount:0
},

/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {

},
back:function(){
wx.navigateBack({
delta: 1
})
},
//跳转支出申请
goApproval:function(e){
console.log(e.currentTarget.dataset.current);
// let cur = e.currentTarget.dataset.current;
// if (this.data.currentTaB == cur) {
// return false;
// }else{
// wx.navigateTo({
// url: '../inCome/index?id=' + id,
// })
// }
wx.navigateTo({
url: '/pages/apply/approval/approval',
})
var that = this;
if(options.id){
setTimeout(function(){
UTIL.httpRequest(API.URL_GET_APPROVALITEMS+options.id, {method:'GET'}, {
success: (res) => {
if (res.code == API.SUCCESS_CODE) {
console.log(that.data.capitalExpenditureTypeOptions);
if(res.data.approvalItemTemplate == null){return;}
res.data.transfers.forEach( (item,index) => {
res.data.transfers[index].capitalExpenditureTypeText = UTIL.getTransform(item.capitalExpenditureType,that.data.capitalExpenditureTypeOptions);
res.data.transfers[index].transferTypeText = UTIL.getTransform(item.transferType,that.data.transferTypeOptions);
res.data.transfers[index].bankTypeText = UTIL.getTransform(item.bankType,that.data.bankTypeOptions);
res.data.transfers[index].payeeList.forEach( (response,i) => {
res.data.transfers[index].payeeList[i].bankTypeText = UTIL.getTransform(response.bankType,that.data.bankTypeOptions);
})
})
that.setData({
form:res.data
})
//收据附件
UTIL.httpRequest(
API.URL_GET_FINDLIST,
{
method:'GET',
tableName:'t_yinnong_transfer',
tableId:res.data.approvalItemTemplate.id,
fileType:1
},
{
success: (res) => {
let list = [];
res.data.forEach(item=>{
list.push({
tempFilePath:URL_PREFIX+item.fileUrl
})
})
that.setData({
SJimage:list
});
}
})
//发票
UTIL.httpRequest(
API.URL_GET_FINDLIST,
{
method:'GET',
tableName:'t_yinnong_transfer',
tableId:res.data.approvalItemTemplate.id,
fileType:2
},
{
success: (res) => {
let list = [];
res.data.forEach(item=>{
list.push({
tempFilePath:URL_PREFIX+item.fileUrl
})
})
that.setData({
FPimage:list
});
}
})
//其他
UTIL.httpRequest(
API.URL_GET_FINDLIST,
{
method:'GET',
tableName:'t_yinnong_transfer',
tableId:res.data.approvalItemTemplate.id,
fileType:3
},
{
success: (res) => {
let list = [];
res.data.forEach(item=>{
list.push({
tempFilePath:URL_PREFIX+item.fileUrl
})
})
that.setData({
QTimage:list
});
}
})
}
}
})
},1000)
}else if(options.type == 'update'&!options.id){
console.log(options);
setTimeout(function(){
let array = JSON.parse(options.array);
array.transfers.forEach( (item,index) => {
item.capitalExpenditureTypeText = UTIL.getTransform(item.capitalExpenditureType,that.data.capitalExpenditureTypeOptions);
item.transferTypeText = UTIL.getTransform(item.transferType,that.data.transferTypeOptions);
item.bankTypeText = UTIL.getTransform(item.bankType,that.data.bankTypeOptions);
item.payeeList.forEach( (response,i) => {
item.payeeList[i].bankTypeText = UTIL.getTransform(response.bankType,that.data.bankTypeOptions);
})
//收据附件
UTIL.httpRequest(
API.URL_GET_FINDLIST,
{
method:'GET',
tableName:'t_yinnong_transfer',
tableId:item.id,
fileType:1
},
{
success: (res) => {
let list = [];
res.data.forEach((item2,index2)=>{
wx.downloadFile({
url: URL_PREFIX+item2.fileUrl, //仅为示例,并非真实的资源
success (response) {
if (response.statusCode === 200) {
let fileForm = item.fileForm?item.fileForm:[];
fileForm.push({
file: response.tempFilePath,
fileType:'1',
bizPath:'transfer',
tableName:'t_yinnong_transfer',
tableId:''
})
console.log("--------------fileForm2 start----------------");
console.log(fileForm);
console.log("--------------fileForm2 end----------------");
list.push({
tempFilePath:response.tempFilePath
})
that.setData({
["form.transfers["+index+"].SJimage"]:list,
["form.transfers["+index+"].fileForm"]:fileForm
});
}
}
})
})
}
})
//发票
UTIL.httpRequest(
API.URL_GET_FINDLIST,
{
method:'GET',
tableName:'t_yinnong_transfer',
tableId:item.id,
fileType:2
},
{
success: (res) => {
let list = [];
res.data.forEach((item2,index2)=>{
wx.downloadFile({
url: URL_PREFIX+item2.fileUrl, //仅为示例,并非真实的资源
success (response) {
if (response.statusCode === 200) {
let fileForm = item.fileForm?item.fileForm:[];
fileForm.push({
file: response.tempFilePath,
fileType:'2',
bizPath:'transfer',
tableName:'t_yinnong_transfer',
tableId:item.id
})
list.push({
tempFilePath:response.tempFilePath
})
that.setData({
["form.transfers["+index+"].FPimage"]:list,
["form.transfers["+index+"].fileForm"]:fileForm
});
}
}
})
})
}
})
//其他
UTIL.httpRequest(
API.URL_GET_FINDLIST,
{
method:'GET',
tableName:'t_yinnong_transfer',
tableId:item.id,
fileType:3
},
{
success: (res) => {
let list = [];
let fileForm = item.fileForm?item.fileForm:[];
res.data.forEach((item2,index2)=>{
wx.downloadFile({
url: URL_PREFIX+item2.fileUrl, //仅为示例,并非真实的资源
success (response) {
if (response.statusCode === 200) {
let fileForm = item.fileForm?item.fileForm:[];
fileForm.push({
file: response.tempFilePath,
fileType:'3',
bizPath:'transfer',
tableName:'t_yinnong_transfer',
tableId:item.id
})
list.push({
tempFilePath:response.tempFilePath
})
that.setData({
["form.transfers["+index+"].QTimage"]:list,
["form.transfers["+index+"].fileForm"]:fileForm
});
}
}
})
})
}
})
})
that.setData({
form : array,
isUpdate : true
})
},1000)
}
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
@@ -83,9 +359,507 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
var that = this;

UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, {
success: (res) => {
if (res.code == API.SUCCESS_CODE) {
that.setData({
["form.approvalItemTemplate.submitCompany"]:res.user.bookName,
["form.approvalItemTemplate.submitDate"]:UTIL.js_date_time(new Date()),
["form.approvalItemTemplate.submitter"]:res.user.nickName,
["form.approvalItemTemplate.telephone"]:res.user.phonenumber,
})

}
}
})
//所属银行
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
success: (res) => {
this.setData({
bankTypeOptions:res.data
});
}
})
// 资金支出类别字典查询
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'capital_expenditure_type', {method:'GET'}, {
success: (res) => {
that.setData({
capitalExpenditureTypeOptions:res.data,
})
}
})
// 付款方式类型字典查询
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'transfer_type', {method:'GET'}, {
success: (res) => {
that.setData({
transferTypeOptions:res.data,
})
}
})
// 项目工程列表
UTIL.httpRequest(API.URL_GET_GETPROJECTLIST , {method:'GET'}, {
success: (res) => {
that.setData({
projectOptions:res.rows,
})
}
})
// 工程款类型字典查询
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'project_fund_type', {method:'GET'}, {
success: (res) => {
that.setData({
projectFundTypeOptions:res.data,
})
}
})
// 获取合同信息列表
UTIL.httpRequest(API.URL_GET_CONTRACTIONLIST , {method:'GET'}, {
success: (res) => {
that.setData({
contractionOptions:res.rows,
})
}
})
},
openBox(even){
this.setData({
[even.currentTarget.dataset.name]:true
})
},
closeBox(even){
console.log(even.currentTarget.dataset.name);
this.setData({
[even.currentTarget.dataset.name]:false
})
},
onConfirm(event) {
this.setData({
[event.currentTarget.dataset.name]: false,
[event.currentTarget.dataset.value]: UTIL.formatDate(event.detail),
});
},
onConfirmPick(event) {
console.log(event);
this.setData({
[event.currentTarget.dataset.name]: false,
[event.currentTarget.dataset.value]: event.detail.value.dictValue,
[event.currentTarget.dataset.value+'Text']: event.detail.value.dictLabel,
});
},
onConfirmAccount(event) {
console.log(event);
var that = this;
// 所属银行字典查询
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
success: (res) => {
let array = res.data.filter(function (e) { return e.dictValue == event.detail.value.bankType; });
this.setData({
[event.currentTarget.dataset.name]: false,
[event.currentTarget.dataset.value+'.payer']: event.detail.value.accountName,
[event.currentTarget.dataset.value+'.cashierId']: event.detail.value.id,
[event.currentTarget.dataset.value+'.payerAccount']: event.detail.value.bankAccountNumber,
[event.currentTarget.dataset.value+'.bankTypeText']: array[0].dictLabel,
[event.currentTarget.dataset.value+'.bankType']: event.detail.value.bankType,
balance:event.detail.value.balance,
});
}
})
},
onConfirmaTransfer(event) {
console.log(event);
var that = this;
let perames = {};
this.setData({
[event.currentTarget.dataset.value+'.payer']: '',
[event.currentTarget.dataset.value+'.payerAccount']: '',
[event.currentTarget.dataset.value+'.bankTypeText']: '',
[event.currentTarget.dataset.value+'.bankType']: '',
[event.currentTarget.dataset.value+'.bankAccountType']: '',
[event.currentTarget.dataset.value+'.isPeers']: '',
balance:0,
});
if(event.detail.value.dictValue == 1){//村账户查询参数
perames = {
pageNum:1,
pageSize:999,
accountType:'102',
method:'post',
  params: {
         "townAccountType":"0"
    }
}
// 付款方列表
UTIL.httpRequest(API.URL_GET_SELECTACCOUNTLIST , perames, {
success: (res) => {
that.setData({
accountOptions:res.rows,
})
}
})
}
if(event.detail.value.dictValue == 2 || event.detail.value.dictValue == 10){//公务卡和现金提现查询参数
perames = {
pageNum:1,
pageSize:999,
accountType:'102',
method:'GET',
villageAccountType:''
}
// 付款方列表
UTIL.httpRequest(API.URL_GET_ACCOUNTLIST , perames, {
success: (res) => {
that.setData({
accountOptions:res.rows,
})
}
})
}
if(event.detail.value.dictValue == 11){//现金使用查询参数
perames = {
pageNum:1,
pageSize:999,
accountType:'101',
method:'GET'
}
// 付款方列表
UTIL.httpRequest(API.URL_GET_ACCOUNTLIST , perames, {
success: (res) => {
that.setData({
accountOptions:res.rows
})
}
})
}
if(event.detail.value.dictValue == 4){//代管账户查询参数
perames = {
pageNum:1,
pageSize:999,
accountType:'102',
method:'GET',
villageAccountType:'1'
}
// 付款方列表
UTIL.httpRequest(API.URL_GET_ACCOUNTLIST , perames, {
success: (res) => {
that.setData({
accountOptions:res.rows,
})
}
})
}
if(event.detail.value.dictValue == 12){//汇票支出查询参数
perames = {
pageNum:1,
pageSize:999,
}
// 付款方列表
UTIL.httpRequest(API.URL_GET_MONEYORDERLIST , perames, {
success: (res) => {
that.setData({
moneyorderOptions:res.rows,
})
}
})
}
this.setData({
[event.currentTarget.dataset.name]: false,
[event.currentTarget.dataset.value+'.transferType']: event.detail.value.dictValue,
[event.currentTarget.dataset.value+'.transferTypeText']: event.detail.value.dictLabel,
});
},
onConfirmProject(event) {
console.log(event);
this.setData({
[event.currentTarget.dataset.name]: false,
[event.currentTarget.dataset.value]: event.detail.value.projectName,
['projectForm.projectId']: event.detail.value.id,
['projectForm.projectContractor']: event.detail.value.projectContractor,
['projectForm.projectAmount']: event.detail.value.projectAmount,
});
},
onConfirmContraction(event) {
console.log(event);
this.setData({
[event.currentTarget.dataset.name]: false,
[event.currentTarget.dataset.value]: event.detail.value.name,
['contractionForm.code']: event.detail.value.code,
['contractionForm.totalAmount']: event.detail.value.totalAmount,
['contractionForm.id']: event.detail.value.id,
});
},
onConfirmMoneyorder(event) {
console.log(event);
this.setData({
[event.currentTarget.dataset.name]: false,
[event.currentTarget.dataset.value]: event.detail.value.name,
['contractionForm.code']: event.detail.value.code,
['contractionForm.totalAmount']: event.detail.value.totalAmount,
['contractionForm.id']: event.detail.value.id,
});
},
goPayeeList(event){
console.log(event);
wx.navigateTo({
url: '/pages/payee/index?isPeers='+event.currentTarget.dataset.ispeers+'&bankType='+event.currentTarget.dataset.banktype+'&accountType='+event.currentTarget.dataset.accounttype+'&transferType='+event.currentTarget.dataset.transfertype + '&index='+event.currentTarget.dataset.index,
})
},
onChange(event){
console.log(event);
this.setData({
[event.currentTarget.dataset.value]: event.detail,
})
},
onChangeMoney(event){
console.log(event);
var that = this;
this.setData({
["form.transfers["+event.currentTarget.dataset.index+"].payeeList["+event.currentTarget.dataset.childrenindex+"].incomeAmount"]: event.detail,
["form.transfers["+event.currentTarget.dataset.index+"].expenditureAmount"]:event.detail,
})
},
back:function(){
wx.navigateBack({
delta: 1
})
},
goSubmitMB(){
this.setData({
showDialog:true
})
},
onClose(){
this.setData({
showDialog:false
})
},
bindNameInput(even){
this.setData({
["form.approvalItemTemplate.templateName"]:even.detail.value
})
},
goSubmit(e){
var that = this;
if(e.currentTarget.dataset.type == 1){
if(that.data.form.approvalItemTemplate.templateName == ''){
UTIL.showToastNoneIcon('请输入模板名称!');
return;
}
}
if(e.currentTarget.dataset.type == 3){
for (let i = 0; i < that.data.form.transfers.length; i++) {
that.data.form.transfers[i].approvalMode = '2';
}
that.data.form.approvalItemTemplate.dataType = e.currentTarget.dataset.type
}
that.data.form.method = 'POST';
that.data.form.approvalItemTemplate.dataType = e.currentTarget.dataset.type;

let totalAmount = 0 ;
for (let i = 0; i < that.data.form.transfers.length; i++) {
totalAmount += parseInt(that.data.form.transfers[i].expenditureAmount);
}
that.data.form.approvalItemTemplate.totalAmount = totalAmount;
UTIL.httpRequest(API.URL_GET_SAVE, that.data.form, {
success: (res) => {
if (res.code == API.SUCCESS_CODE) {
for (let j = 0; j < res.data.transfers.length; j++) {
for (let i = 0; i < that.data.form.transfers[j].fileForm.length; i++) {
that.data.form.transfers[j].fileForm[i].tableId = res.data.transfers[j].id
const element = that.data.form.transfers[j].fileForm[i];
wx.uploadFile({
url: API.URL_GET_UPLOAD,
filePath: element.file,
name: 'file',
header: {
"Content-Type": "multipart/form-data",//记得设置
"chartset":"utf-8",
'Authorization':'Bearer '+getApp().globalData.userInfo.token
},
formData:element,
success (response){
console.log(res);
if((j+1) == that.data.form.transfers[j].length && (i+1) == that.data.form.transfers[j].fileForm[i].length && e.currentTarget.dataset.type == 0){
wx.navigateTo({
url: '/pages/apply/approval/approval?id='+res.data.id,
})
}
},
fail(res){
console.log(res)
}
})
}
}
}
}
})
},
bindKeyInput(even){
this.setData({
["form.approvalItemTemplate.approvalItems"]: even.detail.value,
})
},
SJtakephoto(e){
var that = this;
let fileForm = that.data.form.transfers[e.currentTarget.dataset.index].fileForm?that.data.form.transfers[e.currentTarget.dataset.index].fileForm:[];
wx.chooseMedia({
count: 9,
mediaType: ['image','video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success(res) {
console.log(res);
res.tempFiles.forEach(item => {
fileForm.push({
file: item.tempFilePath,
fileType:'1',
bizPath:'transfer',
tableName:'t_yinnong_transfer',
tableId:''
})
})
console.log(fileForm);
that.setData({
["form.transfers["+e.currentTarget.dataset.index+"].SJimage"]:res.tempFiles,
["form.transfers["+e.currentTarget.dataset.index+"].fileForm"]:fileForm
})
}
})
},
FPtakephoto(e){
var that = this;
let fileForm = that.data.form.transfers[e.currentTarget.dataset.index].fileForm?that.data.form.transfers[e.currentTarget.dataset.index].fileForm:[];
wx.chooseMedia({
count: 9,
mediaType: ['image','video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success(res) {
console.log(res);
res.tempFiles.forEach(item => {
fileForm.push({
file: item.tempFilePath,
fileType:'2',
bizPath:'transfer',
tableName:'t_yinnong_transfer',
tableId:''
})
})
console.log(fileForm);
that.setData({
["form.transfers["+e.currentTarget.dataset.index+"].FPimage"]:res.tempFiles,
["form.transfers["+e.currentTarget.dataset.index+"].fileForm"]:fileForm
})
}
})
},
QTtakephoto(e){
var that = this;
let fileForm = that.data.form.transfers[e.currentTarget.dataset.index].fileForm?that.data.form.transfers[e.currentTarget.dataset.index].fileForm:[];
wx.chooseMedia({
count: 9,
mediaType: ['image','video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success(res) {
console.log(res);
res.tempFiles.forEach(item => {
fileForm.push({
file: item.tempFilePath,
fileType:'3',
bizPath:'transfer',
tableName:'t_yinnong_transfer',
tableId:''
})
})
console.log(fileForm);
that.setData({
["form.transfers["+e.currentTarget.dataset.index+"].QTimage"]:res.tempFiles,
["form.transfers["+e.currentTarget.dataset.index+"].fileForm"]:fileForm
})
}
})
},
addList(){
let transList = this.data.form.transfers;
transList.push({
num:UTIL.convertToChinaNum(transList.length+1),
capitalExpenditureType:'',//资金支出类别
capitalExpenditureTypeText:'',//资金支出类别(展示用)
succeedAmount:'',//成功支付金额
payer:'',//付款方
payerAccount:'',//付款方账户
bankType:'',//所属银行
bankTypeText:'',//所属银行(展示用)
isPeers:'',//是否同行
operatorCode:'',//操作员代码
enterpriseCode:'',//企业编码
expenditureAmount:'',//支出总金额
applyDate:'',//申请时间
transferStatus:'',//转账状态
auditStatus:'0',//审批状态
paymentState:'',//支付状态
approvalMode:'1',//审批模式
paymentTime:'',//支付时间
bankPriority:'',//银行处理优先级
clientPriority:'',//客户处理优先级
transferType:'',//付款方式
transferTypeText:'',//付款方式(展示用)
requiredTransferTime:'',//要求转账时间
remark:'',//付款事由
startTime:'',//开票日期
endTime:'',//到期日期
orderType:'',//汇票类型
bankAccountType:'',//账户类别1 公户2私户
villageAccountType:'',//账户分类
payeeList:[{//收款方账户集合
payeeId:'0',//收款方id
payee:'',//收款方
bankDeposit:'',//开户行
incomeAmount:'',//收入金额
bankType:'',//所属银行0其他银行1中国银行2农商行(山东省)3农业银行4建设银行5工商银行
payeeAccount:'',//收款账户
}],
});
this.setData({
["form.transfers"] : transList
})
},
openPreview(e){
let array = [];
console.log(e);
e.currentTarget.dataset.option.forEach(item=>{
array.push(item.tempFilePath)
})
console.log(array);
wx.previewImage({
urls: array,
showmenu:true,
current:array[e.currentTarget.dataset.index]
})
},
goKeep(){
var that = this;
let pages = getCurrentPages();
let currentPage = null; //当前页面
let prevPage = null; //上一个页面
currentPage = pages[pages.length - 1]; //获取当前页面,将其赋值
prevPage = pages[pages.length - 2]; //获取上一个页面,将其赋值
console.log(that.data.form);
if (prevPage) {
prevPage.setData({
form : that.data.form,//将想要传的信息赋值给上一个页面data中的值
})
that.back()
}
},
/**
* 生命周期函数--监听页面隐藏
*/


+ 5
- 1
pages/apply/paymentTemplate/add/add.json Ver fichero

@@ -11,6 +11,10 @@
"van-button": "@vant/weapp/button/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-field": "@vant/weapp/field/index"
"van-field": "@vant/weapp/field/index",
"van-popup": "@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index",
"van-calendar": "@vant/weapp/calendar/index",
"van-dialog": "@vant/weapp/dialog/index"
}
}

+ 284
- 125
pages/apply/paymentTemplate/add/add.wxml Ver fichero

@@ -6,159 +6,318 @@
<view class="pure_top" style="top:{{isIPX?'88px':'64px'}};"></view>
<view class="main-box top-box" style="margin-top:{{isIPX?'100px':'75px'}};">
<text class="box-title">审批事项</text>
<input class="input_tit" placeholder="请输入审批事项"/>
<text>提交单位:龙华村联合社</text>
<text>提交日期:2022年1月18日</text>
<text>提 交 人:报账员</text>
<text>联系电话:13906311234</text>
<input class="input_tit" placeholder="请输入审批事项" value="{{form.approvalItemTemplate.approvalItems}}" bindinput="bindKeyInput"/>
<text>提交单位:{{form.approvalItemTemplate.submitCompany}}</text>
<text>提交日期:{{form.approvalItemTemplate.submitDate}}</text>
<text>提 交 人:{{form.approvalItemTemplate.submitter}}</text>
<text>联系电话:{{form.approvalItemTemplate.telephone}}</text>
</view>
<view class="main-title">事项一</view>
<view class="center">
<text class="title">基础信息</text>
<view class="main-box table-box">
<van-field label="申请流水号" value="{{ value }}" placeholder="请输入申请流水号" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field label="申请时间" value="{{ value }}" placeholder="请输入申请时间" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field label="合计支出" value="{{ value }}" placeholder="请输入合计支出" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field label="支出原因" value="{{ value }}" placeholder="请输入支出原因" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field label="资金支出类别" value="{{ value }}" placeholder="请输入资金支出类别" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down"/>
</view>
<text class="title">关联项目</text>
<view class="main-box table-box">
<van-field label="项目名称" value="{{ value }}" placeholder="请输入项目名称" border="{{ false }}" bind:change="onChange" input-align="right" is-link/>
</view>
<text class="title">付款方信息</text>
<view class="main-box table-box">
<van-field label="付款方式" value="{{ value }}" placeholder="请输入付款方式" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down"/>

<van-field value="{{ value }}" placeholder="请输入付款方名称" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down">
<view slot="label">
付款方名称<van-tag plain type="danger" color="red" round style="margin-left:10px;">必填</van-tag>
</view>
</van-field>
<van-field label="付款方账号" value="{{ value }}" placeholder="请输入付款方账号" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field label="所属银行" value="{{ value }}" placeholder="请输入所属银行" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field label="转账附言" value="{{ value }}" placeholder="请输入转账附言" border="{{ false }}" bind:change="onChange" input-align="right"/>
</view>
<text class="title">收款方信息</text>
<view class="center-box">
<block wx:for="{{form.transfers}}" wx:key="index">
<view class="main-title">事项{{form.transfers[index].num}}</view>
<view class="center">
<text class="title">基础信息</text>
<view class="main-box table-box">
<van-cell title="收款账户类型" center border="{{false}}">
<view>
<van-radio-group
value="{{ radio }}"
bind:change="onChange"
direction="horizontal"XX
>
<van-radio name="1" checked-color="#2C8E68" disabled>公户</van-radio>
<van-radio name="2" checked-color="#2C8E68" disabled>私户</van-radio>
</van-radio-group>
</view>
</van-cell>
<!-- <van-field label="申请流水号" value="{{ form.approvalItemTemplate.telephone }}" placeholder="请输入申请流水号" border="{{ false }}" bind:change="onChange" input-align="right"/> -->
<van-field label="申请时间" readonly is-link value="{{ form.transfers[index].applyDate }}" placeholder="请选择申请时间" border="{{ false }}" bind:change="onChange" input-align="right" bindtap="openBox" data-name="showApplyDate" />
<van-calendar show="{{ showApplyDate }}" bind:close="closeBox" data-name="showApplyDate" bind:confirm="onConfirm" data-value="form.transfers[{{index}}].applyDate" show-confirm="{{ false }}" />

<van-field readonly label="合计支出" value="{{ form.transfers[index].expenditureAmount }}" placeholder="(自动计算)" border="{{ false }}" data-formname="form.transfers[{{index}}].expenditureAmount" input-align="right"/>
<van-field label="支出原因" value="{{ form.transfers[index].remark }}" placeholder="请输入支出原因" border="{{ false }}" bind:change="onChange" input-align="right" data-formname="form.transfers[{{index}}].remark" data-value="form.transfers[{{index}}].remark"/>
<van-popup show="{{showCapitalExpenditureType}}" round position="bottom" bind:close="closeBox" data-name="showCapitalExpenditureType">
<van-picker
columns="{{capitalExpenditureTypeOptions}}"
show-toolbar
value-key="dictLabel"
bind:cancel="closeBox"
bind:confirm="onConfirmPick"
data-name="showCapitalExpenditureType"
data-value="form.transfers[{{index}}].capitalExpenditureType"
/>
</van-popup>
<van-field label="资金支出类别" readonly value="{{ form.transfers[index].capitalExpenditureTypeText }}" placeholder="请选择资金支出类别" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down" bindtap="openBox" data-name="showCapitalExpenditureType"/>
</view>
<block wx:if="{{form.transfers[index].capitalExpenditureType == 2}}">
<text class="title">关联项目</text>
<view class="main-box table-box">
<van-popup show="{{showProject}}" round position="bottom" bind:close="closeBox" data-name="showProject">
<van-picker
columns="{{projectOptions}}"
show-toolbar
value-key="projectName"
bind:cancel="closeBox"
bind:confirm="onConfirmProject"
data-name="showProject"
data-value="projectForm.projectName"
/>
</van-popup>
<van-field label="项目名称" readonly value="{{ projectForm.projectName }}" placeholder="请输入项目名称" border="{{ false }}" bind:change="onChange" input-align="right" is-link bindtap="openBox" data-name="showProject"/>
<van-field label="承建单位" readonly value="{{ projectForm.projectContractor }}" placeholder="请输入承建单位" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field label="合同价款(元)" readonly value="{{ projectForm.projectAmount }}" placeholder="请输入合同价款(元)" border="{{ false }}" bind:change="onChange" input-align="right"/>

<van-popup show="{{showProjectFundType}}" round position="bottom" bind:close="closeBox" data-name="showProjectFundType">
<van-picker
columns="{{projectFundTypeOptions}}"
show-toolbar
value-key="dictLabel"
bind:cancel="closeBox"
bind:confirm="onConfirmPick"
data-name="showProjectFundType"
data-value="projectForm.projectFundType"
/>
</van-popup>
<van-field label="工程款类型" readonly value="{{ projectForm.projectFundTypeText }}" placeholder="请选择工程款类型" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down" bindtap="openBox" data-name="showProjectFundType"/>

<van-field label="工程发票号" value="{{ projectForm.projectBillNum }}" placeholder="请输入工程发票号" border="{{ false }}" bind:change="onChange" input-align="right"/>
</view>
</block>

<block wx:if="{{form.transfers[index].capitalExpenditureType == 4}}">
<text class="title">关联合同</text>
<view class="main-box table-box">
<van-popup show="{{showContraction}}" round position="bottom" bind:close="closeBox" data-name="showContraction">
<van-picker
columns="{{contractionOptions}}"
show-toolbar
value-key="name"
bind:cancel="closeBox"
bind:confirm="onConfirmContraction"
data-name="showContraction"
data-value="contractionForm.name"
/>
</van-popup>
<van-field label="合同名称" readonly value="{{ contractionForm.name }}" placeholder="请选择合同名称" border="{{ false }}" bind:change="onChange" input-align="right" is-link bindtap="openBox" data-name="showContraction"/>
<van-field label="合同编码" value="{{ contractionForm.code }}" placeholder="请输入合同编码" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field label="合同价款(元)" readonly value="{{ contractionForm.totalAmount }}" placeholder="请输入合同价款(元)" border="{{ false }}" bind:change="onChange" input-align="right"/>
</view>
</block>


<text class="title">付款方信息</text>
<view class="main-box table-box">
<van-field value="{{ value }}" placeholder="请输入姓名" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down">
<van-popup show="{{showTransferType}}" round position="bottom" bind:close="closeBox" data-name="showTransferType">
<van-picker
columns="{{transferTypeOptions}}"
show-toolbar
value-key="dictLabel"
bind:cancel="closeBox"
bind:confirm="onConfirmaTransfer"
data-name="showTransferType"
data-value="form.transfers[{{index}}]"
/>
</van-popup>
<van-field label="付款方式" readonly value="{{ form.transfers[index].transferTypeText }}" placeholder="请输入付款方式" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down" bindtap="openBox" data-name="showTransferType"/>

<van-popup show="{{showAccount}}" round position="bottom" bind:close="closeBox" data-name="showAccount">
<van-picker
columns="{{accountOptions}}"
show-toolbar
value-key="accountName"
bind:cancel="closeBox"
bind:confirm="onConfirmAccount"
data-name="showAccount"
data-value="form.transfers[{{index}}]"
/>
</van-popup>
<van-field wx:if="{{form.transfers[index].transferType != 12}}" readonly value="{{ form.transfers[index].payer }}" placeholder="请选择付款方名称" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down" bindtap="openBox" data-name="showAccount">
<view slot="label">
姓名<van-tag plain type="danger" color="#5CAE77" round style="margin-left:10px;">收款方</van-tag>
付款方<van-tag plain type="danger" color="red" round style="margin-left:10px;">必填</van-tag>
</view>
</van-field>
<van-field label="收款账户" value="{{ value }}" placeholder="请输入收款账户" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field label="开户银行" value="{{ value }}" placeholder="请输入开户银行" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down"/>
<van-field label="收入金额" value="{{ value }}" placeholder="请输入收入金额" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field label="所属银行" value="{{ value }}" placeholder="请输入所属银行" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down"/>
</view>
</view>

<view class="main-box">
<van-cell>
<!-- <view slot="icon">
<van-icon class-prefix="my-icon" name="extra" />
</view> -->
<view slot="title">
<view class="van-cell-text">附件<van-tag type="danger" style="margin-left: 10px;">可拍照</van-tag></view>
</view>
<view>
<view class="van-cell-text">总数<van-tag round color="#5CAE77" plain style="margin-left: 10px;"> 0张 </van-tag></view>
</view>
</van-cell>
<view class="fj-box">
<view class="fj-li">
<text>
</text>
<image src="/image/apply/fj_upload.png" mode="widthFix"></image>
<van-field readonly wx:if="{{form.transfers[index].transferType == 11}}" label="可用余额(元)" value="{{ balance }}" placeholder="可用余额" border="{{ false }}" bind:change="onChange" input-align="right"/>
<block wx:elif="{{form.transfers[index].transferType == 12}}">
<van-popup show="{{showAccount}}" round position="bottom" bind:close="closeBox" data-name="showMoneyorder">
<van-picker
columns="{{moneyorderOptions}}"
show-toolbar
value-key="accountName"
bind:cancel="closeBox"
bind:confirm="onConfirmMoneyorder"
data-name="showMoneyorder"
data-value="form.transfers[{{index}}]"
/>
</van-popup>
<van-field readonly label="出票方" value="{{ form.transfers[index].payerAccount }}" placeholder="请选择出票方" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down" bindtap="openBox" data-name="showMoneyorder"/>

<van-field readonly label="汇票号码" value="{{ form.transfers[index].bankTypeText }}" placeholder="汇票号码" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field readonly label="出票金额(元)" value="{{ form.transfers[index].bankTypeText }}" placeholder="出票金额(元)" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field readonly label="汇票类型" value="{{ form.transfers[index].bankTypeText }}" placeholder="汇票类型" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field readonly label="开票日" value="{{ form.transfers[index].bankTypeText }}" placeholder="开票日" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field readonly label="到期日" value="{{ form.transfers[index].bankTypeText }}" placeholder="到期日" border="{{ false }}" bind:change="onChange" input-align="right"/>
</block>
<block wx:else>
<van-field readonly label="付款方账号" value="{{ form.transfers[index].payerAccount }}" placeholder="请输入付款方账号" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field readonly label="所属银行" value="{{ form.transfers[index].bankTypeText }}" placeholder="请输入所属银行" border="{{ false }}" bind:change="onChange" input-align="right"/>
</block>

</view>
<text class="title">收款方信息</text>
<view class="center-box">
<view class="main-box table-box" wx:if="{{form.transfers[index].bankType == 1 && form.transfers[index].transferType != 10 && form.transfers[index].transferType != 11 && form.transfers[index].transferType != 12}}">
<van-cell title="收款账户类型" center border="{{false}}">
<view style="float: right;">
<van-radio-group
value="{{ form.transfers[index].bankAccountType }}"
bind:change="onChange"
direction="horizontal"
data-value="form.transfers[{{index}}].bankAccountType"
>
<van-radio name="1" checked-color="#2C8E68">公户</van-radio>
<van-radio name="2" checked-color="#2C8E68">私户</van-radio>
</van-radio-group>
</view>
</van-cell>
</view>
<view class="fj-li">
<text>
</text>
<image src="/image/apply/fj_upload.png" mode="widthFix"></image>
<view class="main-box table-box" wx:if="{{(form.transfers[index].bankType == 2 || form.transfers[index].bankType == 3 || form.transfers[index].bankType == 4) && (form.transfers[index].transferType != 10 && form.transfers[index].transferType != 11 && form.transfers[index].transferType != 12)}}">
<van-cell title="是否同行" center border="{{false}}">
<view style="float: right;">
<van-radio-group
value="{{ form.transfers[index].isPeers }}"
bind:change="onChange"
direction="horizontal"
data-value="form.transfers[{{index}}].isPeers"
>
<van-radio name="Y" checked-color="#2C8E68">是</van-radio>
<van-radio name="N" checked-color="#2C8E68">否</van-radio>
</van-radio-group>
</view>
</van-cell>
</view>
<view class="fj-li">
<text>
</text>
<image src="/image/apply/fj_upload.png" mode="widthFix"></image>

<view class="main-box table-box" wx:for="{{form.transfers[index].payeeList}}" wx:for-index="childrenIndex" wx:key="payeeId">
<van-field readonly value="{{ form.transfers[index].payeeList[childrenIndex].payee }}" placeholder="请输入姓名" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down" bindtap="goPayeeList" data-index="{{index}}" data-isPeers="{{ form.transfers[index].isPeers }}" data-bankType="{{ form.transfers[index].bankType }}" data-accountType="{{ form.transfers[index].bankAccountType }}" data-transferType="{{ form.transfers[index].transferType }}">
<view slot="label">
姓名<van-tag plain type="danger" color="#5CAE77" round style="margin-left:10px;">收款方</van-tag>
</view>
</van-field>
<van-field readonly label="收款账户" value="{{ form.transfers[index].payeeList[childrenIndex].payeeAccount }}" placeholder="请输入收款账户" border="{{ false }}" bind:change="onChange" input-align="right"/>
<van-field readonly label="开户银行" value="{{ form.transfers[index].payeeList[childrenIndex].bankDeposit }}" placeholder="请输入开户银行" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down"/>
<van-field label="收入金额" value="{{ form.transfers[index].payeeList[childrenIndex].incomeAmount }}" placeholder="请输入收入金额" border="{{ false }}" bind:change="onChangeMoney" input-align="right" data-formname="form.transfers[{{index}}].payeeList[{{childrenIndex}}]" data-index="{{index}}" data-childrenIndex="{{childrenIndex}}"/>

<van-field readonly label="所属银行" value="{{ form.transfers[index].payeeList[childrenIndex].bankTypeText }}" placeholder="请输入所属银行" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction ="down"/>
</view>
</view>
</view>

<!-- <view class="main-box steps-box">
<view class="steps-tit">审批流程</view>
<van-row wx:for="{{steps}}" wx:key="index">
<van-col span="3">
<view class="index">{{index+1}}</view>
<block wx:if="{{index==0}}">
<view class="indexBorder">
<view class="ssT" wx:if="{{index>0}}"></view>
<view class="yq"></view>
<view class="ss" wx:if="{{steps.length != index+1}}"></view>
<view class="main-box">
<van-cell>
<!-- <view slot="icon">
<van-icon class-prefix="my-icon" name="extra" />
</view> -->
<view slot="title">
<view class="van-cell-text">附件<van-tag type="danger" style="margin-left: 10px;">可拍照</van-tag></view>
</view>
<view>
<view class="van-cell-text">总数<van-tag round color="#5CAE77" plain style="margin-left: 10px;"> {{form.transfers[index].imgcount}}张 </van-tag></view>
</view>
</van-cell>
<view class="fj-box">
<view class="fj-li">
<view>
<text>收\n据</text>
</view>
</block>
<block wx:else>
<view class="indexBorder indexCenter">
<view class="ssT" wx:if="{{index>0}}"></view>
<view class="yq"></view>
<view class="ss" wx:if="{{steps.length != index+1}}"></view>
<view class="img_box">
<image wx:for="{{form.transfers[index].SJimage}}" src="{{item.tempFilePath}}" wx:key="index" data-option="{{form.transfers[index].SJimage}}" data-index="{{index}}" bindtap="openPreview"></image>
<image src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="SJtakephoto"></image>
</view>
</block>
</van-col>
<van-col span="21">
<van-cell title="{{item.activityName}}" center="{{true}}" border="{{false}}">
<view class="agree" wx:if="{{item.type=='1'}}">{{ item.assigneeName }}</view>
<view class="in" wx:if="{{item.type=='2'}}">{{ item.assigneeName }}</view>
<view class="disagree" wx:if="{{item.type=='3'}}">{{ item.assigneeName }}</view>
</van-cell>

<van-cell center border="{{false}}">
<view slot="title">
<view style="color: #999999;">{{ item.durationInMillis }}</view>
</view>
<view class="fj-li">
<view>
<text>发\n票</text>
</view>
<view style="color: #999999;font-size: 12px;">{{ item.endTime }}</view>
</van-cell>
</van-col>
</van-row>
</view> -->
<view class="img_box">
<image wx:for="{{form.transfers[index].FPimage}}" src="{{item.tempFilePath}}" data-option="{{form.transfers[index].FPimage}}" data-index="{{index}}" bindtap="openPreview" wx:key="index"></image>
<image src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="FPtakephoto"></image>
</view>
</view>
<view class="fj-li">
<view>
<text>其\n他</text>
</view>
<view class="img_box">
<image wx:for="{{form.transfers[index].QTimage}}" src="{{item.tempFilePath}}" data-option="{{form.transfers[index].QTimage}}" data-index="{{index}}" bindtap="openPreview" wx:key="index"></image>
<image src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="QTtakephoto"></image>
</view>
</view>
</view>
</view>

<!-- <view class="main-box steps-box">
<view class="steps-tit">审批流程</view>
<van-row wx:for="{{steps}}" wx:key="index">
<van-col span="3">
<view class="index">{{index+1}}</view>
<block wx:if="{{index==0}}">
<view class="indexBorder">
<view class="ssT" wx:if="{{index>0}}"></view>
<view class="yq"></view>
<view class="ss" wx:if="{{steps.length != index+1}}"></view>
</view>
</block>
<block wx:else>
<view class="indexBorder indexCenter">
<view class="ssT" wx:if="{{index>0}}"></view>
<view class="yq"></view>
<view class="ss" wx:if="{{steps.length != index+1}}"></view>
</view>
</block>
</van-col>
<van-col span="21">
<van-cell title="{{item.activityName}}" center="{{true}}" border="{{false}}">
<view class="agree" wx:if="{{item.type=='1'}}">{{ item.assigneeName }}</view>
<view class="in" wx:if="{{item.type=='2'}}">{{ item.assigneeName }}</view>
<view class="disagree" wx:if="{{item.type=='3'}}">{{ item.assigneeName }}</view>
</van-cell>

<van-cell center border="{{false}}">
<view slot="title">
<view style="color: #999999;">{{ item.durationInMillis }}</view>
</view>
<view style="color: #999999;font-size: 12px;">{{ item.endTime }}</view>
</van-cell>
</van-col>
</van-row>
</view> -->
</view>
</block>

<block wx:if="{{!isUpdate}}">
<view class="bottomBtn">
<view bindtap="showPopup">
<view bindtap="goSubmitMB">
<image src="/image/apply/icon_pres.png"></image>
<text>保存模板</text>
</view>
<view>
<view bindtap="addList">
<image src="/image/apply/icon_add.png"></image>
<text>新增事项</text>
</view>
</view>

<view class="bottom">
<view class="btn1" bindtap="openBox">保存</view>
<view class="btn2" bindtap="goApproval">下一步</view>
<view class="btn1" data-type="3" bindtap="goSubmit">提交复核</view>
<view class="btn2" data-type="0" bindtap="goSubmit">下一步</view>
</view>
</view>

</block>
<block wx:if="{{isUpdate}}">
<view class="bottom">
<view class="btn3" data-type="0" bindtap="goKeep">保存</view>
</view>
</block>
<!-- <view class="bottom">
<button type="warn" plain class="btnDis">驳回</button>
<button type="primary" class="btnAgree">同意</button>
</view> -->
<van-dialog
use-slot
title="支付模板"
show="{{ showDialog }}"
bind:close="onClose"
theme='round-button'
confirmButtonText="保存"
data-type="1"
bind:confirm="goSubmit"
closeOnClickOverlay="{{ true }}"
>
<input class="input_tit" placeholder="请输入模板名称" style="width: 90%;margin: 0 auto;margin-top: 15px;margin-bottom: 10px;text-align: center;" value="{{form.approvalItemTemplate.templateName}}" bindinput="bindNameInput"/>
</van-dialog>

+ 27
- 10
pages/apply/paymentTemplate/add/add.wxss Ver fichero

@@ -33,7 +33,7 @@ text{display: block;}
z-index: -1;
}
.center{
padding-bottom: 50px;
padding-bottom: 28px;
}
.main-title{
background-image: linear-gradient(to right, #2C8E68 , #B3DB62);
@@ -109,23 +109,21 @@ text{display: block;}
.fj-box text{
background-color: #5CAE77;
color: #ffffff;
display: inline-block;
text-align: center;
border-radius: 5px;
white-space:pre-wrap
white-space:pre-wrap;
padding: 22px 15px;
}
.fj-li{
margin-top: 20px;
display: flex;
flex-wrap: wrap;
/* flex-wrap: wrap; */
}
.fj-li image{
width: 22%;
width: 25%;
height: 18.5vw;
margin-left: 5%;
}
.fj-li image:nth-child(4n+1){
margin-left: 0;
}
.fj-li image:nth-child(n+5){
margin-top: 15px;
}
@@ -133,7 +131,6 @@ text{display: block;}
display: flex;
width: 94%;
margin: 0 auto;
margin-top: 25px;
justify-content:space-between;
}
.bottomBtn view{
@@ -185,6 +182,13 @@ text{display: block;}
margin-left: 6%;
color: #fff;
}
.bottom .btn3{
border: 1px solid transparent;
padding: 8px 0px;
background-image: linear-gradient(to right, #2C8E68, #5CAE77);
color: #fff;
width: 100%;
}
.steps-box{
padding: 0;
margin-top: 15px;
@@ -306,7 +310,7 @@ text{display: block;}
margin: 0 auto;
text-align: center;
margin-top: 30px;
margin-bottom: 30px;
margin-bottom: 80px;
}

.bottom button {
@@ -320,4 +324,17 @@ text{display: block;}
border: 1px solid transparent;
background-image: linear-gradient(to right, #2C8E68, #5CAE77);
margin-left: 6%;
}

.input_tit{
border: 1px solid #DCDCDC;
padding: 0px 10px;
height: 32px;
line-height: 32px;
border-radius: 5px;
margin-bottom: 15px;
}
.img_box{
position: relative;
width: 100%;
}

+ 98
- 3
pages/apply/paymentTemplate/paymentTemplate.js Ver fichero

@@ -1,4 +1,6 @@
// pages/apply/paymentTemplate/paymentTemplate.js
import * as UTIL from '../../../utils/util.js';
import * as API from '../../../utils/API.js';
const app = getApp();
Page({

@@ -7,12 +9,83 @@ Page({
*/
data: {
isIPX: app.globalData.isIPX,
show: false
show: false,
countMoney:0,
form:{},
SJimage: [],
FPimage: [],
QTimage: [],
fileForm:[],
},
showPopup() {
this.setData({ show: true });
},

bindNameInput(even){
this.setData({
["form.approvalItemTemplate.templateName"]:even.detail.value
})
},
goSubmit(e){
var that = this;
if(e.currentTarget.dataset.type == 1){
if(that.data.form.approvalItemTemplate.templateName == ''){
UTIL.showToastNoneIcon('请输入模板名称!');
return;
}
}
if(e.currentTarget.dataset.type == 3){
for (let i = 0; i < that.data.form.transfers.length; i++) {
that.data.form.transfers[i].approvalMode = '2';
}
that.data.form.approvalItemTemplate.dataType = e.currentTarget.dataset.type
}
that.data.form.method = 'POST';
that.data.form.approvalItemTemplate.dataType = e.currentTarget.dataset.type;
that.data.form.approvalItemTemplate.id = null;
for (let i = 0; i < that.data.form.transfers.length; i++) {
that.data.form.transfers[i].id = null;
}
console.log(that.data.form);
UTIL.httpRequest(API.URL_GET_SAVE, that.data.form, {
success: (res) => {
if (res.code == API.SUCCESS_CODE) {
for (let j = 0; j < res.data.transfers.length; j++) {
for (let i = 0; i < that.data.form.transfers[j].fileForm.length; i++) {
that.data.form.transfers[j].fileForm[i].tableId = res.data.transfers[j].id
const element = that.data.form.transfers[j].fileForm[i];
wx.uploadFile({
url: API.URL_GET_UPLOAD,
filePath: element.file,
name: 'file',
header: {
"Content-Type": "multipart/form-data",//记得设置
"chartset":"utf-8",
'Authorization':'Bearer '+getApp().globalData.userInfo.token
},
formData:element,
success (response){
console.log(res);
if((j+1) == that.data.form.transfers.length && (i+1) == that.data.form.transfers[j].fileForm.length && e.currentTarget.dataset.type == 0){
wx.navigateTo({
url: '/pages/apply/approval/approval?id='+res.data.id,
})
}
if((j+1) == that.data.form.transfers.length && (i+1) == that.data.form.transfers[j].fileForm.length && e.currentTarget.dataset.type != 0){
UTIL.showToastNoneIcon('操作成功!');
that.back();
}
},
fail(res){
console.log(res)
}
})
}
}
}
}
})
},
onClose() {
this.setData({ show: false });
},
@@ -27,11 +100,33 @@ Page({
url: 'see/see',
})
},
goUpdate(){
let array = JSON.stringify(this.data.form)
wx.navigateTo({
url: 'add/add?type=update&array='+array,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {

var that = this ;
UTIL.httpRequest(API.URL_GET_APPROVALITEMS + options.id, {method:'GET'}, {
success: (res) => {
let transList = res.data.transfers;
let countMoney = that.data.countMoney
transList.forEach((item,index) => {
item.num = UTIL.convertToChinaNum(index+1)
countMoney += parseInt(item.expenditureAmount);
});
res.data.transfers = transList
that.setData({
form:res.data,
countMoney:countMoney
});
}
})
},

/**


+ 22
- 18
pages/apply/paymentTemplate/paymentTemplate.wxml Ver fichero

@@ -6,53 +6,55 @@
<view class="pure_top" style="top:{{isIPX?'88px':'64px'}};"></view>
<view class="main-box top-box" style="margin-top:{{isIPX?'100px':'75px'}};">
<text class="box-title">审批事项</text>
<input class="input_tit" placeholder="房屋出租整年费用"/>
<input class="input_tit" placeholder="房屋出租整年费用" readonly value="{{form.approvalItemTemplate.approvalItems}}"/>
<text>支出总金额</text>
<view class="money_box">¥<input class="input_money" placeholder="总金额" placeholder-style="color:#E90000;"/></view>
<text>提交单位:龙华村联合社</text>
<text>提交日期:2022年1月18日</text>
<text>提 交 人:报账员</text>
<text>联系电话:13906311234</text>
<view class="money_box">¥<input class="input_money" readonly placeholder="总金额" placeholder-style="color:#E90000;" value="{{countMoney}}"/></view>
<text>提交单位:{{form.approvalItemTemplate.submitCompany}}</text>
<text>提交日期:{{form.approvalItemTemplate.submitDate}}</text>
<text>提 交 人:{{form.approvalItemTemplate.submitter}}</text>
<text>联系电话:{{form.approvalItemTemplate.telephone}}</text>
</view>
<text class="title">事项</text>
<block wx:for="{{form.transfers}}" wx:key="index">
<text class="title">事项{{item.num}}</text>

<view class="main-box top-box">
<text>支出金额</text>
<view class="money_box">¥<input class="input_money" placeholder="金额" placeholder-style="color:#E90000;"/></view>
<view class="money_box">¥<input class="input_money" readonly placeholder="金额" placeholder-style="color:#E90000;" value="{{item.expenditureAmount}}"/></view>
<van-cell-group border="{{ false }}">
<van-cell title="支付联合社办公室12月份租金" border="{{ false }}" >
<van-cell title="{{item.remark}}" border="{{ false }}" >
<view slot="icon" style="width: 15%;">事由:</view>
</van-cell>
<van-cell title="龙华村联合社华" border="{{ false }}" center >
<van-cell title="{{item.payer}}" border="{{ false }}" center >
<view slot="icon" style="width: 15%;"><image src="/image/apply/icon_fu.png" style="width: 20px;height: 20px;"></image></view>
</van-cell>
<van-cell title="龙华村联合社龙华村联合社龙华龙华村联合社" center border="{{ false }}" >
<van-cell title="{{item.payeeList[0].payee}}" center border="{{ false }}" >
<view slot="icon" style="width: 15%;"><image src="/image/apply/icon_shou.png" style="width: 20px;height: 20px;"></image></view>
</van-cell>
<view class="btnBox">
<image src="/image/apply/down.png" class="down" bindtap="goSee"></image>
<image src="/image/apply/icon_update.png" class="update"></image>
<image src="/image/apply/icon_delete.png" class="delete"></image>
<image src="/image/apply/icon_update.png" class="update" bindtap="goUpdate"></image>
<image src="/image/apply/icon_delete.png" class="delete" bindtap="goDelete"></image>
</view>
</van-cell-group>
</view>

</block>

<view class="bottomBtn">
<view bindtap="showPopup">
<image src="/image/apply/icon_pres.png"></image>
<text>保存模板</text>
</view>
<view>
<view bindtap="goUpdate">
<image src="/image/apply/icon_add.png"></image>
<text>新增事项</text>
</view>
</view>

<view class="bottom">
<view class="btn1" bindtap="openBox">提交复核</view>
<view class="btn2" bindtap="goApproval">下一步</view>
<view class="btn1" data-type="3" bindtap="goSubmit">提交复核</view>
<view class="btn2" data-type="0" bindtap="goSubmit">下一步</view>
</view>

<van-dialog
@@ -62,7 +64,9 @@
bind:close="onClose"
theme='round-button'
confirmButtonText="保存"
data-type="1"
bind:confirm="goSubmit"
closeOnClickOverlay="{{ true }}"
>
<input class="input_tit" placeholder="请输入模板名称" style="width: 90%;margin: 0 auto;margin-top: 15px;margin-bottom: 10px;text-align: center;"/>
<input class="input_tit" placeholder="请输入模板名称" style="width: 90%;margin: 0 auto;margin-top: 15px;margin-bottom: 10px;text-align: center;" value="{{form.approvalItemTemplate.templateName}}" bindinput="bindNameInput"/>
</van-dialog>

+ 1
- 0
pages/apply/paymentTemplate/paymentTemplate.wxss Ver fichero

@@ -90,6 +90,7 @@ text{display: block;}
font-size: 26px;
display: inline-block;
width: 50%;
text-align: center;
}

.money_box{


+ 121
- 2
pages/payee/add/add.js Ver fichero

@@ -1,4 +1,6 @@
// pages/payee/add/add.js
import * as UTIL from '../../../utils/util.js';
import * as API from '../../../utils/API.js';
const app = getApp();
Page({

@@ -7,6 +9,23 @@ Page({
*/
data: {
isIPX: app.globalData.isIPX,
form:{
payee:'',
payeeAccount:'',
bankType:'',
bankDeposit:'',
accountType:'',
payeeType:'',
payeePaymentLines:'',
status:'0',
},
showBankType:false,
showAccountType:false,
bankTypeOptions:[],
bankTypeText:'',
accountTypeOptions:[],
payeeTypeOptions:[],
accountTypeText:'',
},

/**
@@ -27,9 +46,109 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {

var that = this;
// 所属银行字典查询
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
success: (res) => {
// let array = res.data.filter(function (e) { return e.dictValue == event.detail.value.bankType; });
this.setData({
bankTypeOptions:res.data
});
}
})
// 付款方式类型字典查询
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'account_type', {method:'GET'}, {
success: (res) => {
that.setData({
accountTypeOptions:res.data,
})
}
})
// 付款方式类型字典查询
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'payee_type', {method:'GET'}, {
success: (res) => {
that.setData({
payeeTypeOptions:res.data,
})
}
})
},
back:function(){
wx.navigateBack({
delta: 1
})
},
openBox(even){
console.log(even);
var that = this ;
if(even.currentTarget.dataset.name == "showDeposit"){
if(that.data.form.bankType == ''){
UTIL.showToastNoneIcon('请先选择所属银行!');
that.setData({
[even.currentTarget.dataset.name]:false,
})
return;
}
}
this.setData({
[even.currentTarget.dataset.name]:true
})
},
onConfirm(even){
console.log(even);
var that = this ;
if(even.currentTarget.dataset.name == "showBankType"){
// 付款方式类型字典查询
UTIL.httpRequest(API.URL_GET_DEPOSITLIST, {method:'GET',bankType:even.detail.value.dictValue,status:'0'}, {
success: (res) => {
that.setData({
depositOptions:res.rows,
})
}
})
}
this.setData({
[even.currentTarget.dataset.value]:even.detail.value.dictValue,
[even.currentTarget.dataset.value+"Text"]:even.detail.value.dictLabel,
[even.currentTarget.dataset.name]:false,
})
},
onConfirmDeposit(even){
this.setData({
[even.currentTarget.dataset.value]:even.detail.value.id,
[even.currentTarget.dataset.value+"Text"]:even.detail.value.bankDeposit,
[even.currentTarget.dataset.name]:false,
})
},
closeBox(even){
console.log(even.currentTarget.dataset.name);
this.setData({
[even.currentTarget.dataset.name]:false
})
},
goSubmit(){
console.log(this.data.form);
var that = this;
that.setData({
['form.method']:'POST'
})
UTIL.httpRequest(API.URL_GET_PAYEEADD, that.data.form, {
success: (res) => {
if (res.code == API.SUCCESS_CODE) {
wx.navigateBack({
delta:1
})
}
}
})
},
onChange(even){
console.log(even);
this.setData({
[even.currentTarget.dataset.formname]:even.detail
})
},

/**
* 生命周期函数--监听页面隐藏
*/


+ 14
- 1
pages/payee/add/add.json Ver fichero

@@ -1,6 +1,19 @@
{
"navigationStyle": "custom",
"usingComponents": {
"van-field": "@vant/weapp/field/index"
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-tag": "@vant/weapp/tag/index",
"van-icon": "@vant/weapp/icon/index",
"van-steps": "@vant/weapp/steps/index",
"van-button": "@vant/weapp/button/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-field": "@vant/weapp/field/index",
"van-popup": "@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index",
"van-calendar": "@vant/weapp/calendar/index"
}
}

+ 57
- 9
pages/payee/add/add.wxml Ver fichero

@@ -1,16 +1,64 @@
<!--pages/payee/add/add.wxml-->
<view class="ns" style="height:{{isIPX?'88px':'64px'}};">
<image src="../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image>
<text style="top:{{isIPX?'54px':'30px'}};">支出申请</text>
<image src="/image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image>
<text style="top:{{isIPX?'54px':'30px'}};">新增收款人</text>
</view>
<view class="main-box table-box" style="margin-top:{{isIPX?'100px':'75px'}};">
<van-field label="所属银行" value="{{ value }}" placeholder="请选择" border="{{ false }}" bind:change="onChange" input-align="right" required is-link arrow-direction ="down"/>
<van-field label="户名" value="{{ value }}" placeholder="请输入姓名" border="{{ false }}" bind:change="onChange" input-align="right" required/>
<van-field label="卡号" value="{{ value }}" placeholder="请输入收款账号" border="{{ false }}" bind:change="onChange" input-align="right" required/>
<van-field label="账户类型" value="{{ value }}" placeholder="请选择" border="{{ false }}" bind:change="onChange" input-align="right" required is-link arrow-direction ="down"/>
<van-field label="开户行" value="{{ value }}" placeholder="请选择" border="{{ false }}" bind:change="onChange" input-align="right" required is-link arrow-direction ="down" />
<van-field label="联行号" value="{{ value }}" placeholder="请输入" border="{{ false }}" bind:change="onChange" input-align="right" required/>
<van-popup show="{{showBankType}}" round position="bottom" bind:close="closeBox" data-name="showBankType">
<van-picker
columns="{{bankTypeOptions}}"
show-toolbar
value-key="dictLabel"
bind:cancel="closeBox"
bind:confirm="onConfirm"
data-name="showBankType"
data-value="form.bankType"
/>
</van-popup>
<van-field label="所属银行" value="{{ form.bankTypeText }}" placeholder="请选择" border="{{ false }}" bind:change="onChange" input-align="right" required is-link arrow-direction ="down" bindtap="openBox" data-name="showBankType"/>
<van-field label="户名" value="{{ form.payee }}" placeholder="请输入姓名" border="{{ false }}" bind:change="onChange" input-align="right" required data-formname="form.payee"/>
<van-field label="卡号" value="{{ form.payeeAccount }}" placeholder="请输入收款账号" border="{{ false }}" bind:change="onChange" input-align="right" required data-formname="form.payeeAccount"/>

<van-popup show="{{showPayeeType}}" round position="bottom" bind:close="closeBox" data-name="showPayeeType">
<van-picker
columns="{{payeeTypeOptions}}"
show-toolbar
value-key="dictLabel"
bind:cancel="closeBox"
bind:confirm="onConfirm"
data-name="showPayeeType"
data-value="form.payeeType"
/>
</van-popup>
<van-field label="收款人类型" value="{{ form.payeeTypeText }}" placeholder="请选择" border="{{ false }}" bind:change="onChange" input-align="right" required is-link arrow-direction ="down" bindtap="openBox" data-name="showPayeeType" />

<van-popup show="{{showAccountType}}" round position="bottom" bind:close="closeBox" data-name="showAccountType">
<van-picker
columns="{{accountTypeOptions}}"
show-toolbar
value-key="dictLabel"
bind:cancel="closeBox"
bind:confirm="onConfirm"
data-name="showAccountType"
data-value="form.accountType"
/>
</van-popup>
<van-field label="账户类型" value="{{ form.accountTypeText }}" placeholder="请选择" border="{{ false }}" bind:change="onChange" input-align="right" required is-link arrow-direction ="down" bindtap="openBox" data-name="showAccountType"/>

<van-popup show="{{showDeposit}}" round position="bottom" bind:close="closeBox" data-name="showDeposit">
<van-picker
columns="{{depositOptions}}"
show-toolbar
value-key="bankDeposit"
bind:cancel="closeBox"
bind:confirm="onConfirmDeposit"
data-name="showDeposit"
data-value="form.bankDeposit"
/>
</van-popup>
<van-field label="开户行" value="{{ form.bankDepositText }}" placeholder="请选择" border="{{ false }}" bind:change="onChange" input-align="right" required is-link arrow-direction ="down" bindtap="openBox" data-name="showDeposit" />
<van-field label="联行号" value="{{ form.payeePaymentLines }}" placeholder="请输入" border="{{ false }}" bind:change="onChange" input-align="right" required data-formname="form.payeePaymentLines"/>
</view>
<view class="bottom">
<view class="btn2" bindtap="swichPaymentApply">确认</view>
<view class="btn2" bindtap="goSubmit">确认</view>
</view>

+ 116
- 4
pages/payee/index.js Ver fichero

@@ -1,4 +1,6 @@
// pages/payee/index.js
import * as UTIL from '../../utils/util.js';
import * as API from '../../utils/API.js';
const app = getApp();
Page({

@@ -7,17 +9,101 @@ Page({
*/
data: {
isIPX: app.globalData.isIPX,
list: ['a', 'b', 'c'],
result: ['a', 'b'],
list: {},
result: "",
bankTypeOptions:[]
},

/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {

console.log(options)
var that = this;
that.setData({
isPeers:options.isPeers,//是否同行
bankType:options.bankType,//所属银行
accountType:options.accountType,//账户类型
payeeType:options.transferType,//申请转帐类型
index:options.index
})

// 获取收款账号列表
let prames = {
pageNum:1,
pageSize:999,
orderByColumn:'id',
isAsc:'asc',
isPeers:options.isPeers,//是否同行
bankType:options.bankType,//所属银行
accountType:options.accountType,//账户类型
payeeType:options.transferType,//申请转帐类型
status:'0',
method:'GET'
}
console.log(prames);
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
success: (res) => {
that.setData({
bankTypeOptions:res.data,
})
}
})
UTIL.httpRequest(API.URL_GET_SELECTLIST , prames, {
success: (res) => {
let array = res.rows ;
for (let i = 0; i < array.length; i++) {
array[i].payeeAccountText = array[i].payeeAccount.replace(/^(.{6})(?:\d+)(.{4})$/,"\$1****\$2");
array[i].bankTypeText = (that.data.bankTypeOptions.filter(function (e) { return e.dictValue == array[i].bankType; }))[0].dictLabel;
}
that.setData({
list:array,
})
}
})
},
goAdd(){
wx.navigateTo({
url: 'add/add',
})
},
goSearch(e){
var that = this;
// 获取收款账号列表
let prames = {
pageNum:1,
pageSize:999,
orderByColumn:'id',
isAsc:'asc',
isPeers:that.data.isPeers,//是否同行
bankType:that.data.bankType,//所属银行
accountType:that.data.accountType,//账户类型
payeeType:that.data.payeeType,//申请转帐类型
status:'0',
name:e.detail,
method:'GET'
}
console.log(prames);
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
success: (res) => {
that.setData({
bankTypeOptions:res.data,
})
}
})
UTIL.httpRequest(API.URL_GET_PAYEESELECTLIST , prames, {
success: (res) => {
let array = res.rows ;
for (let i = 0; i < array.length; i++) {
array[i].payeeAccountText = array[i].payeeAccount.replace(/^(.{6})(?:\d+)(.{4})$/,"\$1****\$2");
array[i].bankTypeText = (that.data.bankTypeOptions.filter(function (e) { return e.dictValue == array[i].bankType; }))[0].dictLabel;
}
that.setData({
list:array,
})
}
})
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
@@ -32,6 +118,7 @@ Page({

},
onChange(event) {
console.log(event);
this.setData({
result: event.detail,
});
@@ -42,7 +129,32 @@ Page({
const checkbox = this.selectComponent(`.checkboxes-${index}`);
checkbox.toggle();
},
back:function(){
wx.navigateBack({
delta: 1
})
},
noop() {},
goSubmit(){
var that = this;
if(that.data.result == ''){
UTIL.showToastNoneIcon('请选择一个收款人!');
return;
}
let array = that.data.list.filter(function (e) { return e.id == that.data.result; });
console.log(array);
let pages = getCurrentPages();
let currentPage = null; //当前页面
let prevPage = null; //上一个页面
currentPage = pages[pages.length - 1]; //获取当前页面,将其赋值
prevPage = pages[pages.length - 2]; //获取上一个页面,将其赋值
if (prevPage) {
prevPage.setData({
["form.transfers["+that.data.index+"].payeeList[0]"]: array[0]//将想要传的信息赋值给上一个页面data中的值
})
that.back()
}
},
/**
* 生命周期函数--监听页面隐藏
*/


+ 3
- 1
pages/payee/index.json Ver fichero

@@ -4,6 +4,8 @@
"van-checkbox-group": "@vant/weapp/checkbox-group/index",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-search": "@vant/weapp/search/index"
"van-search": "@vant/weapp/search/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index"
}
}

+ 15
- 10
pages/payee/index.wxml Ver fichero

@@ -9,11 +9,13 @@
shape="round"
background="transparent"
placeholder="请输入搜索关键词"
clearable
bind:change="goSearch"
/>
<view class="add_btn"><text>新增</text></view>
<view class="add_btn" bindtap="goAdd"><text>新增</text></view>
</view>

<van-checkbox-group value="{{ result }}" bind:change="onChange">
<van-radio-group value="{{ result }}" bind:change="onChange">
<van-cell-group>
<van-cell
wx:for="{{ list }}"
@@ -23,26 +25,29 @@
data-index="{{ index }}"
bind:click="toggle"
use-label-slot
center
>
<view slot="icon" style="margin-right: 10px;">
<image src="/image/apply/icon_icbc.png" style="width: 20px;height: 20px;vertical-align: middle;"></image>
<image wx:if="{{item.bankType == 0}}" src="/image/apply/icon_other.png" style="width: 20px;height: 20px;vertical-align: middle;"></image>
<image wx:if="{{item.bankType == 1}}" src="/image/apply/icon_icbc.png" style="width: 20px;height: 20px;vertical-align: middle;"></image>
<image wx:if="{{item.bankType == 2}}" src="/image/apply/icon_RCB.png" style="width: 20px;height: 20px;vertical-align: middle;"></image>
<image wx:if="{{item.bankType == 3}}" src="/image/apply/icon_ABC.png" style="width: 20px;height: 20px;vertical-align: middle;"></image>
<image wx:if="{{item.bankType == 4}}" src="/image/apply/icon_CCB.png" style="width: 20px;height: 20px;vertical-align: middle;"></image>
</view>
<view slot="title">
张亮亮
{{item.payee}}
</view>
<view slot="label">
6217****2186 中国银行
<text decode = "{{true}}">{{item.payeeAccountText}}&emsp;&emsp;&emsp;&emsp;{{item.bankTypeText}}</text>
</view>
<van-checkbox
<van-radio
catch:tap="noop"
checked-color="#2C8E68"
class="checkboxes-{{ index }}"
name="{{ item }}"
name="{{ item.id }}"
/>
</van-cell>
</van-cell-group>
</van-checkbox-group>
</van-radio-group>
<view class="bottom">
<view class="btn2" bindtap="swichPaymentApply">确认</view>
<view class="btn2" bindtap="goSubmit">确认</view>
</view>

+ 11
- 3
pages/payee/index.wxss Ver fichero

@@ -31,12 +31,16 @@ van-search {
box-shadow: 0px 5px 5px #ddd;
}
.bottom{
width: 84%;
width: 100%;
margin: 0 auto;
text-align: center;
margin-top: 30px;
margin-bottom: 30px;
padding-top: 30px;
padding-bottom: 30px;
display: flex;
position: fixed;
bottom: 0;
background: #FFF;
box-shadow: 0px -5px 9px #eee;
}

.bottom view {
@@ -51,4 +55,8 @@ van-search {
padding: 8px 0px;
background-image: linear-gradient(to right, #2C8E68, #5CAE77);
color: #fff;
}

.van-radio-group{
padding-bottom: 100px;
}

+ 17
- 2
project.private.config.json Ver fichero

@@ -35,7 +35,7 @@
{
"name": "支出模板查看",
"pathName": "pages/apply/paymentTemplate/paymentTemplate",
"query": "",
"query": "id=32",
"launchMode": "default",
"scene": null
},
@@ -59,10 +59,25 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "收款人列表",
"pathName": "pages/payee/index",
"query": "isPeers=N",
"launchMode": "default",
"scene": null
},
{
"name": "新增收款人",
"pathName": "pages/payee/add/add",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
},
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "WXMB"
"projectname": "WXMB",
"libVersion": "2.23.3"
}

+ 44
- 3
utils/API.js Ver fichero

@@ -67,9 +67,12 @@ const URL_GET_GETPROJECTLIST = `${URL_PREFIX}/yinnong/project/list`;
const URL_GET_CONTRACTIONLIST = `${URL_PREFIX}/contraction/info/list`;

//查询收款账号列表
const URL_GET_SELECTLIST = `${URL_PREFIX}/yinnong/payee/selectList`;
const URL_GET_SELECTLIST = `${URL_PREFIX}/yinnong/payee/selectlist`;

//查询收款账号列表
//查询收款账号列表2
const URL_GET_PAYEESELECTLIST = `${URL_PREFIX}/yinnong/payee/list`;

//当前账套付款账户列表
const URL_GET_SELECTACCOUNTLIST = `${URL_PREFIX}/cashier/account/accountList`;
//查询审批流模板列表
const URL_GET_TEMPLATELIST = `${URL_PREFIX}/service/template/list`;
@@ -94,6 +97,34 @@ const URL_POST_TEMPLATEEDIT = `${URL_PREFIX}/service/templateDetail/editBatch`;
const URL_POST_APPROVALITEMSSUBMIT = `${URL_PREFIX}/yinnong/approvalItems/approvalItemsSubmit/`;
//附件上传配置列表
const URL_GET_SYSCONFIG = `${URL_PREFIX}/system/config/list`;

//汇票列表
const URL_GET_MONEYORDERLIST = `${URL_PREFIX}/yinnong/moneyorder/list`;

//通过所属银行查询开户行信息
const URL_GET_DEPOSITLIST = `${URL_PREFIX}/yinnong/deposit/list`;

//新增收款方账户
const URL_GET_PAYEEADD = `${URL_PREFIX}/yinnong/payee/add`;

//增加支出申请/模板
const URL_GET_SAVE = `${URL_PREFIX}/yinnong/approvalItems/save`;

//附件上传
const URL_GET_UPLOAD = `${URL_PREFIX}/common/attach`;

//获取当前用户的审批事项信息
const URL_GET_USERAPPRO = `${URL_PREFIX}/yinnong/approvalItems/getUserApprovalItems`;

//查看附件列表
const URL_GET_FINDLIST = `${URL_PREFIX}/system/attachment/find`;

//查看附件列表
const URL_GET_APPROVALITEMS = `${URL_PREFIX}/yinnong/approvalItems/getApprovalItem/`;

//通过审批事项id删除审批模板
const URL_GET_REMOVEAPPROVAL = `${URL_PREFIX}/yinnong/approvalItems/remove/`;

/****************接口地址end****************/

export {
@@ -138,5 +169,15 @@ export {
URL_POST_APPROVALITEMSEDIT,
URL_POST_TEMPLATEEDIT,
URL_POST_APPROVALITEMSSUBMIT,
URL_GET_SYSCONFIG
URL_GET_SYSCONFIG,
URL_GET_MONEYORDERLIST,
URL_GET_PAYEESELECTLIST,
URL_GET_DEPOSITLIST,
URL_GET_PAYEEADD,
URL_GET_SAVE,
URL_GET_UPLOAD,
URL_GET_USERAPPRO,
URL_GET_FINDLIST,
URL_GET_APPROVALITEMS,
URL_GET_REMOVEAPPROVAL
}

+ 44
- 1
utils/util.js Ver fichero

@@ -383,6 +383,47 @@ function formatDate(unixtime) {
// return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;//年月日时分秒
return y + '-' + m + '-' + d;
}
/**
* 将数字(整数)转为汉字
* @param num
* @description 从零到一亿亿,需要小数的可自行截取小数点后面的数字直接替换对应arr1的读法就行了
*/
function convertToChinaNum (num) {
var arr1 = new Array('零', '一', '二', '三', '四', '五', '六', '七', '八', '九');
var arr2 = new Array('', '十', '百', '千', '万', '十', '百', '千', '亿', '十', '百', '千','万', '十', '百', '千','亿');//可继续追加更高位转换值
if(!num || isNaN(num)){
return "零";
}
var english = num.toString().split("")
var result = "";
for (var i = 0; i < english.length; i++) {
var des_i = english.length - 1 - i;//倒序排列设值
result = arr2[i] + result;
var arr1_index = english[des_i];
result = arr1[arr1_index] + result;
}
//将【零千、零百】换成【零】 【十零】换成【十】
result = result.replace(/零(千|百|十)/g, '零').replace(/十零/g, '十');
//合并中间多个零为一个零
result = result.replace(/零+/g, '零');
//将【零亿】换成【亿】【零万】换成【万】
result = result.replace(/零亿/g, '亿').replace(/零万/g, '万');
//将【亿万】换成【亿】
result = result.replace(/亿万/g, '亿');
//移除末尾的零
result = result.replace(/零+$/, '')
//将【零一十】换成【零十】
//result = result.replace(/零一十/g, '零十');//貌似正规读法是零一十
//将【一十】换成【十】
result = result.replace(/^一十/g, '十');
return result;
}
function getTransform(dictValue,options){
var dictLabel = "";
console.log(options);
dictLabel = (options.filter(function (e) { return e.dictValue == dictValue; }))[0].dictLabel;
return dictLabel;
}
export {
getCurrentPageUrl,
getCurrentPageUrlWithArgs,
@@ -399,5 +440,7 @@ export {
convert_length,
isIPhoneX,
js_date_time,
formatDate
formatDate,
convertToChinaNum,
getTransform
}

Cargando…
Cancelar
Guardar