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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. // pages/transaction/transactionDetail/transactionDetail.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. bankTypeOptions:[],
  13. form:{
  14. accountType:'1',
  15. status:'0'
  16. }
  17. },
  18. /**
  19. * 生命周期函数--监听页面加载
  20. */
  21. onLoad(options) {
  22. var that = this;
  23. // 所属银行 字典查询
  24. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
  25. success: (res) => {
  26. that.setData({
  27. bankTypeOptions:res.data,
  28. })
  29. }
  30. })
  31. // 账户分类 字典查询
  32. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'town_account_type', {method:'GET'}, {
  33. success: (res) => {
  34. that.setData({
  35. townAccountTypeOptions:res.data,
  36. })
  37. }
  38. })
  39. // 管控类型 字典查询
  40. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'cashier_account_management_control_type', {method:'GET'}, {
  41. success: (res) => {
  42. that.setData({
  43. managementControlTypeOptions:res.data,
  44. })
  45. }
  46. })
  47. //中心账套查询
  48. UTIL.httpRequest(API.URL_GET_GETTACCOUNTCENTRAL, {method:'GET'}, {
  49. success: (res2) => {
  50. that.setData({
  51. centralBookIdOptions:res2.data,
  52. })
  53. }
  54. })
  55. },
  56. /**
  57. * 显示弹窗
  58. */
  59. showPopup(e){
  60. var that = this ;
  61. that.setData({
  62. [e.currentTarget.dataset.name]:true
  63. })
  64. },
  65. /**
  66. * 隐藏弹窗
  67. */
  68. closePopup(e){
  69. var that = this ;
  70. that.setData({
  71. [e.currentTarget.dataset.name]:false
  72. })
  73. },
  74. /**
  75. * 弹窗选择
  76. */
  77. onConfirm(e){
  78. console.log(e);
  79. var that = this ;
  80. that.setData({
  81. [e.currentTarget.dataset.formname]:e.detail.value.dictValue,
  82. [e.currentTarget.dataset.formname+'Text']:e.detail.value.dictLabel,
  83. [e.currentTarget.dataset.name]:false
  84. })
  85. },
  86. onConfirmBank(e){
  87. console.log(e);
  88. var that = this ;
  89. that.setData({
  90. [e.currentTarget.dataset.formname]:e.detail.value.dictValue,
  91. [e.currentTarget.dataset.formname+'Text']:e.detail.value.dictLabel,
  92. [e.currentTarget.dataset.name]:false,
  93. ["form.bankDeposit"]:'',
  94. ["form.payeePaymentLines"]:'',
  95. })
  96. //开户行查询
  97. UTIL.httpRequest(API.URL_GET_DEPOSITLIST, {method:'GET',bankType:e.detail.value.dictValue,status:'0'}, {
  98. success: (res2) => {
  99. that.setData({
  100. depositOptions:res2.rows,
  101. })
  102. }
  103. })
  104. },
  105. onConfirmaDeposit(e){
  106. console.log(e);
  107. var that = this ;
  108. that.setData({
  109. [e.currentTarget.dataset.formname]:e.detail.value.bankDeposit,
  110. [e.currentTarget.dataset.name]:false,
  111. ["form.payeePaymentLines"]:e.detail.value.payeePaymentLines
  112. })
  113. },
  114. /**
  115. * 中心账套弹窗选择
  116. */
  117. onConfirmBook(e){
  118. console.log(e);
  119. var that = this ;
  120. that.setData({
  121. [e.currentTarget.dataset.formname]:e.detail.value.id,
  122. [e.currentTarget.dataset.formname+'Text']:e.detail.value.bookName,
  123. [e.currentTarget.dataset.name]:false
  124. })
  125. //会计科目查询
  126. UTIL.httpRequest(API.URL_GET_GETACCOUNTCENTRAL, {method:'GET',bookId:e.detail.value.id}, {
  127. success: (res2) => {
  128. that.setData({
  129. centralSubjectIdOptions:res2.data,
  130. })
  131. }
  132. })
  133. },
  134. /**
  135. * 会计科目弹窗选择
  136. */
  137. onConfirmSubjectId(e){
  138. console.log(e);
  139. var that = this ;
  140. that.setData({
  141. [e.currentTarget.dataset.formname]:e.detail.value.subjectId,
  142. [e.currentTarget.dataset.formname+'Text']:e.detail.value.subjectName,
  143. [e.currentTarget.dataset.name]:false
  144. })
  145. },
  146. /**
  147. * 输入框change
  148. */
  149. inputChange(e){
  150. var that = this ;
  151. that.setData({
  152. [e.currentTarget.dataset.formname]:e.detail
  153. })
  154. },
  155. /**
  156. * 提交修改
  157. */
  158. goSubmit(e){
  159. var that = this ;
  160. console.log(that.data.form);
  161. that.data.form.method = 'POST';
  162. UTIL.httpRequest(API.URL_GET_GETTACCOUNTADD, that.data.form, {
  163. success: (res) => {
  164. console.log(res);
  165. wx.showToast({
  166. title: "提交成功!",
  167. duration: 2000,
  168. icon:"success",
  169. mask:true
  170. })
  171. setTimeout(function(){
  172. that.back()
  173. },2000)
  174. }
  175. })
  176. },
  177. onChange(even){
  178. console.log(even);
  179. this.setData({
  180. [even.currentTarget.dataset.formname]:even.detail
  181. })
  182. },
  183. back:function(){
  184. wx.navigateBack({
  185. delta: 1
  186. })
  187. },
  188. /**
  189. * 生命周期函数--监听页面初次渲染完成
  190. */
  191. onReady() {
  192. },
  193. /**
  194. * 生命周期函数--监听页面显示
  195. */
  196. onShow() {
  197. },
  198. /**
  199. * 生命周期函数--监听页面隐藏
  200. */
  201. onHide() {
  202. },
  203. /**
  204. * 生命周期函数--监听页面卸载
  205. */
  206. onUnload() {
  207. },
  208. /**
  209. * 页面相关事件处理函数--监听用户下拉动作
  210. */
  211. onPullDownRefresh() {
  212. },
  213. /**
  214. * 页面上拉触底事件的处理函数
  215. */
  216. onReachBottom() {
  217. },
  218. /**
  219. * 用户点击右上角分享
  220. */
  221. onShareAppMessage() {
  222. }
  223. })