微信小程序
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

escrowAccount.js 7.3 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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. showTransactionDialog:'',
  42. form:{
  43. datescopeFrom:'',
  44. datescopeTo:'',
  45. amountscopeFrom:'',
  46. amountscopeTo:'',
  47. }
  48. },
  49. /**
  50. * 生命周期函数--监听页面加载
  51. */
  52. onLoad(options) {
  53. var that = this;
  54. // 所属银行 字典查询
  55. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
  56. success: (res) => {
  57. that.setData({
  58. bankTypeOptions:res.data,
  59. })
  60. }
  61. })
  62. // 账户分类 字典查询
  63. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'town_account_type', {method:'GET'}, {
  64. success: (res) => {
  65. that.setData({
  66. townAccountTypeOptions:res.data,
  67. })
  68. }
  69. })
  70. // 账户分类 字典查询
  71. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'sys_normal_disable', {method:'GET'}, {
  72. success: (res) => {
  73. that.setData({
  74. statusOptions:res.data,
  75. })
  76. }
  77. })
  78. },
  79. goSearch(e){
  80. var that = this ;
  81. var sendData = {
  82. pageNum:'1',
  83. pageSize:'100',
  84. bankType:'',
  85. townAccountType:'',
  86. payee:e.detail,
  87. method:'GET',
  88. accountType:''
  89. }
  90. //转账列表
  91. UTIL.httpRequest(API.URL_GET_GETTACCOUNTLIST , sendData, {
  92. success: (res) => {
  93. res.rows.map(rrr=>{
  94. rrr.bankTypeText = UTIL.getTransform(rrr.bankType,that.data.bankTypeOptions);
  95. rrr.townAccountTypeText = UTIL.getTransform(rrr.townAccountType,that.data.townAccountTypeOptions);
  96. rrr.statusText = UTIL.getTransform(rrr.status,that.data.statusOptions);
  97. rrr.balance = rrr.balance == null ? '0.00' : parseFloat(rrr.balance).toFixed(2);
  98. })
  99. that.setData({
  100. list:res.rows
  101. })
  102. }
  103. })
  104. },
  105. back:function(){
  106. wx.navigateBack({
  107. delta: 1
  108. })
  109. },
  110. onClose() {
  111. this.setData({ showPopup: false });
  112. },
  113. minInput(e){
  114. var that = this ;
  115. that.setData({
  116. ["form.amountscopeFrom"]: e.detail, //金额范围 最小
  117. })
  118. },
  119. maxInput(e){
  120. var that = this ;
  121. that.setData({
  122. ["form.amountscopeTo"]: e.detail, //金额范围最大
  123. })
  124. },
  125. toPayDetail(e){
  126. let options = JSON.stringify(e.currentTarget.dataset.options);
  127. wx.navigateTo({
  128. url: 'detail/detail?options='+options,
  129. })
  130. },
  131. goEdit(e){
  132. let options = JSON.stringify(e.currentTarget.dataset.options);
  133. wx.navigateTo({
  134. url: 'edit/edit?options='+options,
  135. })
  136. },
  137. goAdd(e){
  138. wx.navigateTo({
  139. url: 'add/add',
  140. })
  141. },
  142. goRemove(e){
  143. let id = e.currentTarget.dataset.id;
  144. wx.showModal({
  145. title: '提示',
  146. content: '是否删除?',
  147. success (res) {
  148. if (res.confirm) {
  149. //转账列表
  150. UTIL.httpRequest(API.URL_GET_GETTACCOUNTREMOVE + id , {} , {
  151. success: (res) => {
  152. wx.showToast({
  153. title: '删除成功',
  154. icon: 'success',
  155. duration: 2000
  156. })
  157. this.onLoad();
  158. }
  159. })
  160. } else if (res.cancel) {
  161. console.log('用户点击取消')
  162. }
  163. }
  164. })
  165. },
  166. showTransactionDialog(e){
  167. var that = this ;
  168. console.log(e);
  169. that.setData({
  170. form:{
  171. datescopeFrom:'',
  172. datescopeTo:'',
  173. amountscopeFrom:'',
  174. amountscopeTo:'',
  175. accountId:e.currentTarget.dataset.id
  176. },
  177. })
  178. that.setData({
  179. showTransactionDialog:true,
  180. })
  181. },
  182. selectAccount(){
  183. var that = this ;
  184. console.log(that.data.form);
  185. if (that.data.form.datescopeFrom == '') {
  186. UTIL.showToastNoneIcon('请选择开始日期!');
  187. return;
  188. }
  189. if (that.data.form.datescopeTo == '') {
  190. UTIL.showToastNoneIcon('请选择截止日期!');
  191. return;
  192. }
  193. that.data.form.method = 'POST';
  194. //转账列表
  195. UTIL.httpRequest(API.URL_GET_GETTACCOUNTADDRECORD , that.data.form, {
  196. success: (res) => {
  197. if (res.code == API.SUCCESS_CODE) {
  198. wx.showToast({
  199. title: '查询成功!',
  200. icon: 'success',
  201. duration: 2000
  202. })
  203. that.setData({
  204. showTransactionDialog : false
  205. })
  206. }else{
  207. UTIL.showToastNoneIcon(res.msg);
  208. that.setData({
  209. showTransactionDialog : false
  210. })
  211. }
  212. }
  213. })
  214. },
  215. bindDatescopeFromPickerChange: function(e) {
  216. console.log(e);
  217. var that = this;
  218. that.setData({
  219. ["form.datescopeFrom"]: e.detail.value,
  220. })
  221. },
  222. bindDatescopeToPickerChange: function(e) {
  223. console.log(e);
  224. var that = this;
  225. that.setData({
  226. ["form.datescopeTo"]: e.detail.value,
  227. })
  228. },
  229. goBalance(e){
  230. let id = e.currentTarget.dataset.id;
  231. UTIL.httpRequest(API.URL_GET_GETTACCOUNTENQUIRY+id, {method:'GET'}, {
  232. success: (res2) => {
  233. if (res2.code == 200) {
  234. wx.navigateTo({
  235. url: 'balance/balance?id='+e.currentTarget.dataset.id,
  236. })
  237. }else{
  238. UTIL.showToastNoneIcon(res2.msg);
  239. }
  240. }
  241. })
  242. },
  243. /**
  244. * 生命周期函数--监听页面初次渲染完成
  245. */
  246. onReady() {
  247. },
  248. /**
  249. * 生命周期函数--监听页面显示
  250. */
  251. onShow() {
  252. var that = this;
  253. var sendData = {
  254. pageNum:'1',
  255. pageSize:'100',
  256. bankType:'',
  257. townAccountType:'',
  258. payee:'',
  259. method:'GET',
  260. accountType:''
  261. }
  262. setTimeout(function(){
  263. //转账列表
  264. UTIL.httpRequest(API.URL_GET_GETTACCOUNTLIST , sendData, {
  265. success: (res) => {
  266. res.rows.map(rrr=>{
  267. rrr.bankTypeText = UTIL.getTransform(rrr.bankType,that.data.bankTypeOptions);
  268. rrr.townAccountTypeText = UTIL.getTransform(rrr.townAccountType,that.data.townAccountTypeOptions);
  269. rrr.statusText = UTIL.getTransform(rrr.status,that.data.statusOptions);
  270. rrr.balance = rrr.balance == null ? '0.00' : parseFloat(rrr.balance).toFixed(2);
  271. })
  272. that.setData({
  273. list:res.rows
  274. })
  275. }
  276. })
  277. },1000)
  278. },
  279. /**
  280. * 生命周期函数--监听页面隐藏
  281. */
  282. onHide() {
  283. },
  284. /**
  285. * 生命周期函数--监听页面卸载
  286. */
  287. onUnload() {
  288. },
  289. /**
  290. * 页面相关事件处理函数--监听用户下拉动作
  291. */
  292. onPullDownRefresh() {
  293. },
  294. /**
  295. * 页面上拉触底事件的处理函数
  296. */
  297. onReachBottom() {
  298. },
  299. /**
  300. * 用户点击右上角分享
  301. */
  302. onShareAppMessage() {
  303. }
  304. })