| @@ -11,6 +11,7 @@ Page({ | |||
| isIPX: app.globalData.isIPX, | |||
| show:false, | |||
| accountList:[], | |||
| approvalItemsOptions:[], | |||
| bookName:'' | |||
| }, | |||
| @@ -109,9 +110,16 @@ swichPaymentApply:function(e){ | |||
| }, | |||
| delete(e){ | |||
| console.log(e); | |||
| var that = this; | |||
| UTIL.httpRequest(API.URL_GET_REMOVEAPPROVAL + e.currentTarget.dataset.id, {method:'GET'},{ | |||
| success: (res) => { | |||
| UTIL.showToastNoneIcon('删除成功!'); | |||
| if (res.code == API.SUCCESS_CODE) { | |||
| that.data.approvalItemsOptions.splice(e.currentTarget.dataset.index, 1); | |||
| that.setData({ | |||
| approvalItemsOptions : that.data.approvalItemsOptions | |||
| }) | |||
| UTIL.showToastNoneIcon('删除成功!'); | |||
| } | |||
| } | |||
| }) | |||
| }, | |||
| @@ -602,6 +602,9 @@ Page({ | |||
| }, | |||
| goPayeeList(event){ | |||
| console.log(event); | |||
| if(event.currentTarget.dataset.accounttype == null ){ | |||
| event.currentTarget.dataset.accounttype = '' | |||
| } | |||
| 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, | |||
| }) | |||
| @@ -1,6 +1,11 @@ | |||
| // pages/apply/paymentTemplate/paymentTemplate.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({ | |||
| @@ -118,6 +123,129 @@ Page({ | |||
| transList.forEach((item,index) => { | |||
| item.num = UTIL.convertToChinaNum(index+1) | |||
| countMoney += parseInt(item.expenditureAmount); | |||
| //收据附件 | |||
| 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 | |||
| }); | |||
| } | |||
| } | |||
| }) | |||
| }) | |||
| } | |||
| }) | |||
| }); | |||
| res.data.transfers = transList | |||
| @@ -125,6 +253,7 @@ Page({ | |||
| form:res.data, | |||
| countMoney:countMoney | |||
| }); | |||
| } | |||
| }) | |||
| }, | |||
| @@ -135,7 +264,22 @@ Page({ | |||
| onReady() { | |||
| }, | |||
| goDelete(e){ | |||
| var that = this; | |||
| if(that.data.form.transfers.length<2){ | |||
| UTIL.showToastNoneIcon('最少保留一条事项'); | |||
| return; | |||
| } | |||
| let countMoney = that.data.countMoney; | |||
| console.log(that.data.form); | |||
| countMoney -= parseInt(that.data.form.transfers[e.currentTarget.dataset.index].expenditureAmount); | |||
| that.data.form.transfers.splice(e.currentTarget.dataset.index, 1); | |||
| that.setData({ | |||
| form : that.data.form, | |||
| countMoney:countMoney | |||
| }) | |||
| UTIL.showToastNoneIcon('删除成功!'); | |||
| }, | |||
| back:function(){ | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| @@ -34,7 +34,7 @@ | |||
| <view class="btnBox"> | |||
| <image src="/image/apply/down.png" class="down" bindtap="goSee"></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> | |||
| <image src="/image/apply/icon_delete.png" class="delete" data-index="{{index}}" bindtap="goDelete"></image> | |||
| </view> | |||
| </van-cell-group> | |||
| </view> | |||
| @@ -27,40 +27,6 @@ Page({ | |||
| 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({ | |||
| @@ -115,7 +81,42 @@ Page({ | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow() { | |||
| var that = this; | |||
| setTimeout(function(){ | |||
| // 获取收款账号列表 | |||
| 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', | |||
| 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, | |||
| }) | |||
| } | |||
| }) | |||
| },1000) | |||
| }, | |||
| onChange(event) { | |||
| console.log(event); | |||