|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529 |
- // pages/regular/index.js
- import * as UTIL from '../../utils/util.js';
- import * as API from '../../utils/API.js';
- let EVN_CONFIG = require('../../env/env');
-
- const app = getApp();
- Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- isIPX: app.globalData.isIPX,
- option1: [],
- option2: [],
- option3: [],
- value1: '',
- value2: '',
- value3: '',
- showPopup:false,
- result1:'',
- result2:'',
- result3:'',
- beginApplyDate:'' , //申请开始时间
- endApplyDate: '' , //申请结束时间
- txnamtMin: '' , //金额范围 最小
- xnamtMax: '' , //金额范围最大
- showDialog:false,
- beforeClose(action) {
- return new Promise((resolve) => {
- setTimeout(() => {
- if (action === 'confirm') {
- // 拦截确认操作
- resolve(false);
- } else {
- resolve(true);
- }
- }, 0);
- });
- },
- projectId:'',
- projectValue:''
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- var that = this;
- // 对账状态字典查询
- UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'check_status', {method:'GET'}, {
- success: (res) => {
- that.setData({
- checkStatusOptions:res.data,
- })
- }
- })
- // 业务类型字典查询
- UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'trans_type', {method:'GET'}, {
- success: (res) => {
- let option2 = [{
- text: '业务类型', value: ''
- }];
- res.data.map(rr=>{
- option2.push({
- text: rr.dictLabel, value: rr.dictValue
- })
- })
- that.setData({
- option2:option2,
- transTypeOptions:res.data,
- })
- }
- })
- // 来往账标识字典查询
- UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'direction', {method:'GET'}, {
- success: (res) => {
- let option3 = [];
- res.data.map(rr=>{
- option3.push({
- text: rr.dictLabel, value: rr.dictValue
- })
- })
- option3[0].text = '来往账标识';
- that.setData({
- option3:option3,
- value3:res.data[0].dictValue,
- result3:res.data[0].dictValue,
- directionOptions:res.data,
- })
- }
- })
- var sendData = {
- pageNum:'1',
- pageSize:'100',
- accountName:'',
- bankAccountNumber:'',
- status:'N',
- method:'GET',
- accountType:102
- }
-
- UTIL.httpRequest(API.URL_GET_ACCOUNTLIST, sendData,{
- success: (res) => {
- console.log(res.rows)
-
- let option1 = [];
- res.rows.map(rr=>{
- console.log(rr);
- option1.push({
- text: rr.accountName, value: rr.bankAccountNumber
- })
- })
-
- that.setData({
- option1:option1,
- value1:res.rows[0].bankAccountNumber,
- result1:res.rows[0].bankAccountNumber,
- accountList:res.rows
- })
- let perames = {method:'POST',actacn:res.rows[0].bankAccountNumber,pageSize:'10'}
- //交易明细列表
- UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , perames, {
- success: (res) => {
- res.rows.map(rrr=>{
- rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
- })
- that.setData({
- list:res.rows
- })
- }
- })
- }
- })
- },
- goSubmit(){
- var that = this ;
- let form = {
- actacn:that.data.result1 , //付款账户
- payeeActacn: '' , //收款账号
- payeeToname:'' , //收款人
- transtype:that.data.result2 ,// 业务类型 数据字典:trans_type
- direction:that.data.result3 ,// 来往账标识 数据字典:direction
- params:{
- beginTxnDate:that.data.beginApplyDate,
- endTxnDate:that.data.endApplyDate,
- txnamtMin:that.data.txnamtMin,
- txnamtMax:that.data.xnamtMax,
- },
- pageSize:'10',
- method:'POST',
- }
- console.log(form);
- UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , form, {
- success: (res) => {
- res.rows.map(rrr=>{
- rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
- })
- let actacnName = (that.data.option1).filter(function (e) { return e.value == that.data.result1; });
- that.setData({
- value1:that.data.result1,
- value2:that.data.result2,
- value3:that.data.result3,
- actacnName:actacnName[0].text,
- list:res.rows,
- showPopup:false
- })
- }
- })
- },
- bindDateBeginChange: function(e) {
- console.log('picker发送选择改变,携带值为', e.detail.value)
- this.setData({
- beginApplyDate: e.detail.value
- })
- },
- bindDateEndChange: function(e) {
- console.log('picker发送选择改变,携带值为', e.detail.value)
- this.setData({
- endApplyDate: e.detail.value
- })
- },
- reset(){
- this.setData({
- result2:'',
- txnamtMin:'',
- xnamtMax:'',
- beginApplyDate:'',
- endApplyDate:''
- })
- this.onLoad();
- },
- back:function(){
- wx.navigateBack({
- delta: 1
- })
- },
- showPopup(){
- var that = this;
- that.setData({
- showPopup:true
- })
- },
- onClose() {
- this.setData({ showPopup: false });
- },
- onChangeZH(event) {
- console.log(event.detail);
- this.setData({
- result1: event.detail,
- });
- },
- onChangeLX(event) {
- console.log(event.detail);
- this.setData({
- result2: event.detail,
- });
- },
- onChangeBS(event) {
- console.log(event.detail);
- this.setData({
- result3: event.detail,
- });
- },
- changeTab1(event){
- var that = this ;
- let actacnName = (that.data.option1).filter(function (e) { return e.value == event.detail; });
- console.log(actacnName);
- this.setData({
- result1: event.detail,
- value1: event.detail,
- actacnName:actacnName[0].text
- });
- let form = {
- actacn:that.data.result1 , //付款账户
- transtype:that.data.result2 ,// 业务类型 数据字典:trans_type
- direction:that.data.result3 ,// 来往账标识 数据字典:direction
- pageNum:'1',
- pageSize:'10',
- method:'POST',
- }
- console.log(form);
- UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , form, {
- success: (res) => {
- res.rows.map(rrr=>{
- rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
- })
- that.setData({
- list:res.rows,
- showPopup:false
- })
- }
- })
- // UTIL.httpRequest(API.URL_GET_GETRECONCILIATIONMOBILE , form, {
- // success: (res) => {
- // res.rows.map(rrr=>{
- // rrr.checkStatusText = UTIL.getTransform(rrr.checkStatus,that.data.checkStatusOptions);
- // })
- // that.setData({
- // list:res.rows,
- // showPopup:false
- // })
- // }
- // })
- },
- changeTab2(event){
- this.setData({
- result2: event.detail,
- value2: event.detail
- });
- var that = this ;
- let form = {
- actacn:that.data.result1 , //付款账户
- transtype:that.data.result2 ,// 业务类型 数据字典:trans_type
- direction:that.data.result3 ,// 来往账标识 数据字典:direction
- pageSize:'10',
- method:'POST',
- }
- console.log(form);
- UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , form, {
- success: (res) => {
- res.rows.map(rrr=>{
- rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
- })
- that.setData({
- list:res.rows,
- showPopup:false
- })
- }
- })
- },
- changeTab3(event){
- this.setData({
- result3: event.detail,
- value3: event.detail
- });
- var that = this ;
- let form = {
- actacn:that.data.result1 , //付款账户
- transtype:that.data.result2 ,// 业务类型 数据字典:trans_type
- direction:that.data.result3 ,// 来往账标识 数据字典:direction
- pageSize:'10',
- method:'POST',
- }
- console.log(form);
- UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , form, {
- success: (res) => {
- res.rows.map(rrr=>{
- rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
- })
- that.setData({
- list:res.rows,
- showPopup:false
- })
- }
- })
- },
- minInput(e){
- var that = this ;
- that.setData({
- txnamtMin: e.detail.value, //金额范围 最小
- })
- },
- maxInput(e){
- var that = this ;
- that.setData({
- xnamtMax: e.detail.value, //金额范围最大
- })
- },
- openDZ(e){
- var that = this;
- that.setData({
- projectId:'',
- projectValue:''
- })
- var id = e.currentTarget.dataset.id;
- that.setData({
- showDialog:true,
- projectId:id
- })
- },
- goDZ(e){
- var that = this ;
- var form = {
- manualRemark:that.data.projectValue,
- id:that.data.projectId,
- method:'POST'
- }
- console.log(form);
- UTIL.httpRequest(API.URL_GET_GETTRANSFEREDIT , form, {
- success: (res) => {
- that.setData({
- showDialog:false
- })
- wx.showToast({
- title: '保存成功',
- icon: 'success',
- duration: 2000,
- })
- }
- })
- },
- bindNameInput(e){
- var that = this;
- var value = e.detail.value;
- that.setData({
- projectValue:value
- })
- },
- toPayDetail(e){
- let id = e.currentTarget.dataset.id;
- wx.navigateTo({
- url: 'transactionDetail/transactionDetail?id='+id,
- })
- },
- goHD(e){
- let url = e.currentTarget.dataset.url;
- let alternateField1 = e.currentTarget.dataset.field1;
- let alternateField4 = e.currentTarget.dataset.field4;
- let alternateField9 = e.currentTarget.dataset.field9;
- let id = e.currentTarget.dataset.id;
- console.log(alternateField1);
- console.log(alternateField4);
- console.log(alternateField9);
- if (alternateField1=='3') {
- if (url==null) {
- UTIL.httpRequest(API.URL_GET_GETDIANZIHUIDAN1 + id , {method:'GET'}, {
- success: (res) => {
- console.log(res);
- url = res.data.alternateField2;
- wx.navigateTo({
- url: 'receipt/receipt?url='+url,
- })
- }
- })
- }else if(url.indexOf('失败')>-1){
- UTIL.showToastNoneIcon(url);
- }else{
- wx.navigateTo({
- url: 'receipt/receipt?url='+url,
- })
- }
- }
- if (alternateField4!=null) {
- console.log('aaa');
- if (url==null) {
- UTIL.httpRequest(API.URL_GET_GETDIANZIHUIDAN2 + id , {method:'GET'}, {
- success: (res) => {
- console.log(res);
- url = res.data.alternateField2;
- wx.navigateTo({
- url: 'receipt/receipt?url='+url,
- })
- }
- })
- }else if(url.indexOf('失败')>-1){
- UTIL.showToastNoneIcon(url);
- }else{
- wx.navigateTo({
- url: 'receipt/receipt?url='+url,
- })
- }
- }
- if (alternateField1=='2' && alternateField9!='' && alternateField9!=null) {
- if (url==null) {
- UTIL.httpRequest(API.URL_GET_GETDIANZIHUIDAN3 + id , {method:'GET'}, {
- success: (res) => {
- console.log(res);
- url = res.data.alternateField2;
- wx.navigateTo({
- url: 'receipt/receipt?url='+url,
- })
- }
- })
- }else if(url.indexOf('失败')>-1){
- UTIL.showToastNoneIcon(url);
- }else{
- wx.navigateTo({
- url: 'receipt/receipt?url='+url,
- })
- }
- }
-
-
- },
- showTransactionDialog(){
- wx.navigateTo({
- url: 'receipt/receipt',
- })
- },
- goSearch(e){
- console.log(e);
- var that = this;
- let form = {
- actacn:that.data.result1 , //付款账户
- payeeActacn: '' , //收款账号
- payeeToname:e.detail , //收款人
- transtype:that.data.result2 ,// 业务类型 数据字典:trans_type
- direction:that.data.result3 ,// 来往账标识 数据字典:direction
- params:{
- beginTxnDate:that.data.beginApplyDate,
- endTxnDate:that.data.endApplyDate,
- txnamtMin:that.data.txnamtMin,
- txnamtMax:that.data.xnamtMax,
- },
- pageSize:'10',
- method:'POST',
- }
- UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , form, {
- success: (res) => {
- res.rows.map(rrr=>{
- rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
- })
- that.setData({
- list:res.rows,
- showPopup:false
- })
- }
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
-
- }
- })
|