微信小程序
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  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 app = getApp();
  6. Page({
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. isIPX: app.globalData.isIPX,
  12. option1: [],
  13. option2: [],
  14. option3: [],
  15. value1: '',
  16. value2: '',
  17. value3: '',
  18. showPopup:false,
  19. result1:'',
  20. result2:'',
  21. result3:'',
  22. beginApplyDate:'' , //申请开始时间
  23. endApplyDate: '' , //申请结束时间
  24. txnamtMin: '' , //金额范围 最小
  25. xnamtMax: '' , //金额范围最大
  26. showDialog:false,
  27. beforeClose(action) {
  28. return new Promise((resolve) => {
  29. setTimeout(() => {
  30. if (action === 'confirm') {
  31. // 拦截确认操作
  32. resolve(false);
  33. } else {
  34. resolve(true);
  35. }
  36. }, 0);
  37. });
  38. },
  39. projectId:'',
  40. projectValue:''
  41. },
  42. /**
  43. * 生命周期函数--监听页面加载
  44. */
  45. onLoad(options) {
  46. var that = this;
  47. // 对账状态字典查询
  48. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'check_status', {method:'GET'}, {
  49. success: (res) => {
  50. that.setData({
  51. checkStatusOptions:res.data,
  52. })
  53. }
  54. })
  55. // 业务类型字典查询
  56. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'trans_type', {method:'GET'}, {
  57. success: (res) => {
  58. let option2 = [{
  59. text: '业务类型', value: ''
  60. }];
  61. res.data.map(rr=>{
  62. option2.push({
  63. text: rr.dictLabel, value: rr.dictValue
  64. })
  65. })
  66. that.setData({
  67. option2:option2,
  68. transTypeOptions:res.data,
  69. })
  70. }
  71. })
  72. // 来往账标识字典查询
  73. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'direction', {method:'GET'}, {
  74. success: (res) => {
  75. let option3 = [];
  76. res.data.map(rr=>{
  77. option3.push({
  78. text: rr.dictLabel, value: rr.dictValue
  79. })
  80. })
  81. option3[0].text = '来往账标识';
  82. that.setData({
  83. option3:option3,
  84. value3:res.data[0].dictValue,
  85. result3:res.data[0].dictValue,
  86. directionOptions:res.data,
  87. })
  88. }
  89. })
  90. var sendData = {
  91. pageNum:'1',
  92. pageSize:'100',
  93. accountName:'',
  94. bankAccountNumber:'',
  95. status:'N',
  96. method:'GET',
  97. accountType:102
  98. }
  99. UTIL.httpRequest(API.URL_GET_ACCOUNTLIST, sendData,{
  100. success: (res) => {
  101. console.log(res.rows)
  102. let option1 = [];
  103. res.rows.map(rr=>{
  104. console.log(rr);
  105. option1.push({
  106. text: rr.accountName, value: rr.bankAccountNumber
  107. })
  108. })
  109. that.setData({
  110. option1:option1,
  111. value1:res.rows[0].bankAccountNumber,
  112. result1:res.rows[0].bankAccountNumber,
  113. accountList:res.rows
  114. })
  115. let perames = {method:'POST',actacn:res.rows[0].bankAccountNumber,pageSize:'10'}
  116. //交易明细列表
  117. UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , perames, {
  118. success: (res) => {
  119. res.rows.map(rrr=>{
  120. rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
  121. })
  122. that.setData({
  123. list:res.rows
  124. })
  125. }
  126. })
  127. }
  128. })
  129. },
  130. goSubmit(){
  131. var that = this ;
  132. let form = {
  133. actacn:that.data.result1 , //付款账户
  134. payeeActacn: '' , //收款账号
  135. payeeToname:'' , //收款人
  136. transtype:that.data.result2 ,// 业务类型 数据字典:trans_type
  137. direction:that.data.result3 ,// 来往账标识 数据字典:direction
  138. params:{
  139. beginTxnDate:that.data.beginApplyDate,
  140. endTxnDate:that.data.endApplyDate,
  141. txnamtMin:that.data.txnamtMin,
  142. txnamtMax:that.data.xnamtMax,
  143. },
  144. pageSize:'10',
  145. method:'POST',
  146. }
  147. console.log(form);
  148. UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , form, {
  149. success: (res) => {
  150. res.rows.map(rrr=>{
  151. rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
  152. })
  153. let actacnName = (that.data.option1).filter(function (e) { return e.value == that.data.result1; });
  154. that.setData({
  155. value1:that.data.result1,
  156. value2:that.data.result2,
  157. value3:that.data.result3,
  158. actacnName:actacnName[0].text,
  159. list:res.rows,
  160. showPopup:false
  161. })
  162. }
  163. })
  164. },
  165. bindDateBeginChange: function(e) {
  166. console.log('picker发送选择改变,携带值为', e.detail.value)
  167. this.setData({
  168. beginApplyDate: e.detail.value
  169. })
  170. },
  171. bindDateEndChange: function(e) {
  172. console.log('picker发送选择改变,携带值为', e.detail.value)
  173. this.setData({
  174. endApplyDate: e.detail.value
  175. })
  176. },
  177. reset(){
  178. this.setData({
  179. result2:'',
  180. txnamtMin:'',
  181. xnamtMax:'',
  182. beginApplyDate:'',
  183. endApplyDate:''
  184. })
  185. this.onLoad();
  186. },
  187. back:function(){
  188. wx.navigateBack({
  189. delta: 1
  190. })
  191. },
  192. showPopup(){
  193. var that = this;
  194. that.setData({
  195. showPopup:true
  196. })
  197. },
  198. onClose() {
  199. this.setData({ showPopup: false });
  200. },
  201. onChangeZH(event) {
  202. console.log(event.detail);
  203. this.setData({
  204. result1: event.detail,
  205. });
  206. },
  207. onChangeLX(event) {
  208. console.log(event.detail);
  209. this.setData({
  210. result2: event.detail,
  211. });
  212. },
  213. onChangeBS(event) {
  214. console.log(event.detail);
  215. this.setData({
  216. result3: event.detail,
  217. });
  218. },
  219. changeTab1(event){
  220. var that = this ;
  221. let actacnName = (that.data.option1).filter(function (e) { return e.value == event.detail; });
  222. console.log(actacnName);
  223. this.setData({
  224. result1: event.detail,
  225. value1: event.detail,
  226. actacnName:actacnName[0].text
  227. });
  228. let form = {
  229. actacn:that.data.result1 , //付款账户
  230. transtype:that.data.result2 ,// 业务类型 数据字典:trans_type
  231. direction:that.data.result3 ,// 来往账标识 数据字典:direction
  232. pageNum:'1',
  233. pageSize:'10',
  234. method:'POST',
  235. }
  236. console.log(form);
  237. UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , form, {
  238. success: (res) => {
  239. res.rows.map(rrr=>{
  240. rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
  241. })
  242. that.setData({
  243. list:res.rows,
  244. showPopup:false
  245. })
  246. }
  247. })
  248. // UTIL.httpRequest(API.URL_GET_GETRECONCILIATIONMOBILE , form, {
  249. // success: (res) => {
  250. // res.rows.map(rrr=>{
  251. // rrr.checkStatusText = UTIL.getTransform(rrr.checkStatus,that.data.checkStatusOptions);
  252. // })
  253. // that.setData({
  254. // list:res.rows,
  255. // showPopup:false
  256. // })
  257. // }
  258. // })
  259. },
  260. changeTab2(event){
  261. this.setData({
  262. result2: event.detail,
  263. value2: event.detail
  264. });
  265. var that = this ;
  266. let form = {
  267. actacn:that.data.result1 , //付款账户
  268. transtype:that.data.result2 ,// 业务类型 数据字典:trans_type
  269. direction:that.data.result3 ,// 来往账标识 数据字典:direction
  270. pageSize:'10',
  271. method:'POST',
  272. }
  273. console.log(form);
  274. UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , form, {
  275. success: (res) => {
  276. res.rows.map(rrr=>{
  277. rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
  278. })
  279. that.setData({
  280. list:res.rows,
  281. showPopup:false
  282. })
  283. }
  284. })
  285. },
  286. changeTab3(event){
  287. this.setData({
  288. result3: event.detail,
  289. value3: event.detail
  290. });
  291. var that = this ;
  292. let form = {
  293. actacn:that.data.result1 , //付款账户
  294. transtype:that.data.result2 ,// 业务类型 数据字典:trans_type
  295. direction:that.data.result3 ,// 来往账标识 数据字典:direction
  296. pageSize:'10',
  297. method:'POST',
  298. }
  299. console.log(form);
  300. UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , form, {
  301. success: (res) => {
  302. res.rows.map(rrr=>{
  303. rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
  304. })
  305. that.setData({
  306. list:res.rows,
  307. showPopup:false
  308. })
  309. }
  310. })
  311. },
  312. minInput(e){
  313. var that = this ;
  314. that.setData({
  315. txnamtMin: e.detail.value, //金额范围 最小
  316. })
  317. },
  318. maxInput(e){
  319. var that = this ;
  320. that.setData({
  321. xnamtMax: e.detail.value, //金额范围最大
  322. })
  323. },
  324. openDZ(e){
  325. var that = this;
  326. that.setData({
  327. projectId:'',
  328. projectValue:''
  329. })
  330. var id = e.currentTarget.dataset.id;
  331. that.setData({
  332. showDialog:true,
  333. projectId:id
  334. })
  335. },
  336. goDZ(e){
  337. var that = this ;
  338. var form = {
  339. manualRemark:that.data.projectValue,
  340. id:that.data.projectId,
  341. method:'POST'
  342. }
  343. console.log(form);
  344. UTIL.httpRequest(API.URL_GET_GETTRANSFEREDIT , form, {
  345. success: (res) => {
  346. that.setData({
  347. showDialog:false
  348. })
  349. wx.showToast({
  350. title: '保存成功',
  351. icon: 'success',
  352. duration: 2000,
  353. })
  354. }
  355. })
  356. },
  357. bindNameInput(e){
  358. var that = this;
  359. var value = e.detail.value;
  360. that.setData({
  361. projectValue:value
  362. })
  363. },
  364. toPayDetail(e){
  365. let id = e.currentTarget.dataset.id;
  366. wx.navigateTo({
  367. url: 'transactionDetail/transactionDetail?id='+id,
  368. })
  369. },
  370. goHD(e){
  371. let url = e.currentTarget.dataset.url;
  372. let alternateField1 = e.currentTarget.dataset.field1;
  373. let alternateField4 = e.currentTarget.dataset.field4;
  374. let alternateField9 = e.currentTarget.dataset.field9;
  375. let id = e.currentTarget.dataset.id;
  376. console.log(alternateField1);
  377. console.log(alternateField4);
  378. console.log(alternateField9);
  379. if (alternateField1=='3') {
  380. if (url==null) {
  381. UTIL.httpRequest(API.URL_GET_GETDIANZIHUIDAN1 + id , {method:'GET'}, {
  382. success: (res) => {
  383. console.log(res);
  384. url = res.data.alternateField2;
  385. wx.navigateTo({
  386. url: 'receipt/receipt?url='+url,
  387. })
  388. }
  389. })
  390. }else if(url.indexOf('失败')>-1){
  391. UTIL.showToastNoneIcon(url);
  392. }else{
  393. wx.navigateTo({
  394. url: 'receipt/receipt?url='+url,
  395. })
  396. }
  397. }
  398. if (alternateField4!=null) {
  399. console.log('aaa');
  400. if (url==null) {
  401. UTIL.httpRequest(API.URL_GET_GETDIANZIHUIDAN2 + id , {method:'GET'}, {
  402. success: (res) => {
  403. console.log(res);
  404. url = res.data.alternateField2;
  405. wx.navigateTo({
  406. url: 'receipt/receipt?url='+url,
  407. })
  408. }
  409. })
  410. }else if(url.indexOf('失败')>-1){
  411. UTIL.showToastNoneIcon(url);
  412. }else{
  413. wx.navigateTo({
  414. url: 'receipt/receipt?url='+url,
  415. })
  416. }
  417. }
  418. if (alternateField1=='2' && alternateField9!='' && alternateField9!=null) {
  419. if (url==null) {
  420. UTIL.httpRequest(API.URL_GET_GETDIANZIHUIDAN3 + id , {method:'GET'}, {
  421. success: (res) => {
  422. console.log(res);
  423. url = res.data.alternateField2;
  424. wx.navigateTo({
  425. url: 'receipt/receipt?url='+url,
  426. })
  427. }
  428. })
  429. }else if(url.indexOf('失败')>-1){
  430. UTIL.showToastNoneIcon(url);
  431. }else{
  432. wx.navigateTo({
  433. url: 'receipt/receipt?url='+url,
  434. })
  435. }
  436. }
  437. },
  438. showTransactionDialog(){
  439. wx.navigateTo({
  440. url: 'receipt/receipt',
  441. })
  442. },
  443. goSearch(e){
  444. console.log(e);
  445. var that = this;
  446. let form = {
  447. actacn:that.data.result1 , //付款账户
  448. payeeActacn: '' , //收款账号
  449. payeeToname:e.detail , //收款人
  450. transtype:that.data.result2 ,// 业务类型 数据字典:trans_type
  451. direction:that.data.result3 ,// 来往账标识 数据字典:direction
  452. params:{
  453. beginTxnDate:that.data.beginApplyDate,
  454. endTxnDate:that.data.endApplyDate,
  455. txnamtMin:that.data.txnamtMin,
  456. txnamtMax:that.data.xnamtMax,
  457. },
  458. pageSize:'10',
  459. method:'POST',
  460. }
  461. UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , form, {
  462. success: (res) => {
  463. res.rows.map(rrr=>{
  464. rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
  465. })
  466. that.setData({
  467. list:res.rows,
  468. showPopup:false
  469. })
  470. }
  471. })
  472. },
  473. /**
  474. * 生命周期函数--监听页面初次渲染完成
  475. */
  476. onReady() {
  477. },
  478. /**
  479. * 生命周期函数--监听页面显示
  480. */
  481. onShow() {
  482. },
  483. /**
  484. * 生命周期函数--监听页面隐藏
  485. */
  486. onHide() {
  487. },
  488. /**
  489. * 生命周期函数--监听页面卸载
  490. */
  491. onUnload() {
  492. },
  493. /**
  494. * 页面相关事件处理函数--监听用户下拉动作
  495. */
  496. onPullDownRefresh() {
  497. },
  498. /**
  499. * 页面上拉触底事件的处理函数
  500. */
  501. onReachBottom() {
  502. },
  503. /**
  504. * 用户点击右上角分享
  505. */
  506. onShareAppMessage() {
  507. }
  508. })