微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

261 lines
5.6 KiB

  1. // pages/regular/index.js
  2. import * as UTIL from '../../utils/util.js';
  3. import * as API from '../../utils/API.js';
  4. let EVN_CONFIG = require('../../env/env');
  5. const DISTRIBUTE_ENVIROMENT = 'IMGURL';
  6. let {
  7. URL_PREFIX,
  8. } = EVN_CONFIG[DISTRIBUTE_ENVIROMENT];
  9. const app = getApp();
  10. Page({
  11. /**
  12. * 页面的初始数据
  13. */
  14. data: {
  15. isIPX: app.globalData.isIPX,
  16. option1: [],
  17. option2: [],
  18. option3: [],
  19. value1: '',
  20. value2: '',
  21. value3: '',
  22. showPopup:false,
  23. result1:'',
  24. result2:'',
  25. result3:'',
  26. beginApplyDate:'' , //申请开始时间
  27. endApplyDate: '' , //申请结束时间
  28. txnamtMin: '' , //金额范围 最小
  29. xnamtMax: '' , //金额范围最大
  30. },
  31. /**
  32. * 生命周期函数--监听页面加载
  33. */
  34. onLoad(options) {
  35. var that = this;
  36. // 业务类型字典查询
  37. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'trans_type', {method:'GET'}, {
  38. success: (res) => {
  39. let option2 = [{
  40. text: '业务类型', value: ''
  41. }];
  42. res.data.map(rr=>{
  43. option2.push({
  44. text: rr.dictLabel, value: rr.dictValue
  45. })
  46. })
  47. that.setData({
  48. option2:option2,
  49. transTypeOptions:res.data,
  50. })
  51. }
  52. })
  53. // 来往账标识字典查询
  54. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'direction', {method:'GET'}, {
  55. success: (res) => {
  56. let option3 = [];
  57. res.data.map(rr=>{
  58. option3.push({
  59. text: rr.dictLabel, value: rr.dictValue
  60. })
  61. })
  62. option3[0].text = '来往账标识';
  63. that.setData({
  64. option3:option3,
  65. value3:res.data[0].dictValue,
  66. result3:res.data[0].dictValue,
  67. directionOptions:res.data,
  68. })
  69. }
  70. })
  71. var sendData = {
  72. pageNum:'1',
  73. pageSize:'100',
  74. accountName:'',
  75. bankAccountNumber:'',
  76. status:'N',
  77. method:'GET',
  78. accountType:102
  79. }
  80. UTIL.httpRequest(API.URL_GET_ACCOUNTLIST, sendData,{
  81. success: (res) => {
  82. console.log(res.rows)
  83. let option1 = [];
  84. res.rows.map(rr=>{
  85. console.log(rr);
  86. option1.push({
  87. text: rr.accountName, value: rr.bankAccountNumber
  88. })
  89. })
  90. that.setData({
  91. option1:option1,
  92. value1:res.rows[0].bankAccountNumber,
  93. result1:res.rows[0].bankAccountNumber,
  94. accountList:res.rows
  95. })
  96. let perames = {method:'GET',actacn:res.rows[0].bankAccountNumber}
  97. //转账列表
  98. UTIL.httpRequest(API.URL_GET_GETRECONCILIATION , perames, {
  99. success: (res) => {
  100. that.setData({
  101. list:res.rows
  102. })
  103. }
  104. })
  105. }
  106. })
  107. },
  108. goSubmit(){
  109. var that = this ;
  110. let form = {
  111. actacn:that.data.result1 , //付款账户
  112. payeeActacn: '' , //收款账号
  113. payeeToname:'' , //收款人
  114. transtype:that.data.result2 ,// 业务类型 数据字典:trans_type
  115. direction:that.data.result3 ,// 来往账标识 数据字典:direction
  116. params:new Map([
  117. ['beginApplyDate', that.data.beginApplyDate],
  118. ['endApplyDate', that.data.endApplyDate],
  119. ['txnamtMin', that.data.txnamtMin],
  120. ['xnamtMax', that.data.xnamtMax],
  121. ]),
  122. method:'POST',
  123. }
  124. console.log(form);
  125. UTIL.httpRequest(API.URL_GET_GETRECONCILIATIONMOBILE , form, {
  126. success: (res) => {
  127. that.setData({
  128. list:res.rows,
  129. showPopup:false
  130. })
  131. }
  132. })
  133. },
  134. bindDateBeginChange: function(e) {
  135. console.log('picker发送选择改变,携带值为', e.detail.value)
  136. this.setData({
  137. beginApplyDate: e.detail.value
  138. })
  139. },
  140. bindDateEndChange: function(e) {
  141. console.log('picker发送选择改变,携带值为', e.detail.value)
  142. this.setData({
  143. endApplyDate: e.detail.value
  144. })
  145. },
  146. back:function(){
  147. wx.navigateBack({
  148. delta: 1
  149. })
  150. },
  151. showPopup(){
  152. var that = this;
  153. that.setData({
  154. showPopup:true
  155. })
  156. },
  157. onClose() {
  158. this.setData({ showPopup: false });
  159. },
  160. onChangeZH(event) {
  161. console.log(event.detail);
  162. this.setData({
  163. result1: event.detail,
  164. });
  165. },
  166. onChangeLX(event) {
  167. console.log(event.detail);
  168. this.setData({
  169. result2: event.detail,
  170. });
  171. },
  172. onChangeBS(event) {
  173. console.log(event.detail);
  174. this.setData({
  175. result3: event.detail,
  176. });
  177. },
  178. changeTab1(event){
  179. this.setData({
  180. result1: event.detail,
  181. value1: event.detail
  182. });
  183. },
  184. changeTab2(event){
  185. this.setData({
  186. result2: event.detail,
  187. value2: event.detail
  188. });
  189. },
  190. changeTab3(event){
  191. this.setData({
  192. result3: event.detail,
  193. value3: event.detail
  194. });
  195. },
  196. minInput(e){
  197. var that = this ;
  198. that.setData({
  199. txnamtMin: e.detail.value, //金额范围 最小
  200. })
  201. },
  202. maxInput(e){
  203. var that = this ;
  204. that.setData({
  205. xnamtMax: e.detail.value, //金额范围最大
  206. })
  207. },
  208. /**
  209. * 生命周期函数--监听页面初次渲染完成
  210. */
  211. onReady() {
  212. },
  213. /**
  214. * 生命周期函数--监听页面显示
  215. */
  216. onShow() {
  217. },
  218. /**
  219. * 生命周期函数--监听页面隐藏
  220. */
  221. onHide() {
  222. },
  223. /**
  224. * 生命周期函数--监听页面卸载
  225. */
  226. onUnload() {
  227. },
  228. /**
  229. * 页面相关事件处理函数--监听用户下拉动作
  230. */
  231. onPullDownRefresh() {
  232. },
  233. /**
  234. * 页面上拉触底事件的处理函数
  235. */
  236. onReachBottom() {
  237. },
  238. /**
  239. * 用户点击右上角分享
  240. */
  241. onShareAppMessage() {
  242. }
  243. })