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

3 anni fa
3 anni fa
3 anni fa
3 anni fa
3 anni fa
3 anni fa
3 anni fa
3 anni fa
3 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. import * as UTIL from '../../utils/util.js';
  2. import * as API from '../../utils/API.js';
  3. Page({
  4. data: {
  5. //顶部胶囊按钮位置信息rect
  6. CustomMenuButton: null,
  7. wrokScrollHeight:0,
  8. userInfoObj:{}, //用户信息,
  9. item:"",
  10. active:1,
  11. // 待办列表
  12. todoList:[],
  13. // 已办列表
  14. doneList:[],
  15. // 已发起
  16. yfqList:[],
  17. // 已制单
  18. yzdList:[],
  19. //待办数量
  20. todoNum:0,
  21. //已办数量
  22. doneNum:0,
  23. //已发起数量
  24. yfqNum:0,
  25. //已制单数量
  26. yzdNum:0,
  27. //字典
  28. transferType:[
  29. {"dictVale":1,"dictLabel":"村账户转账"},
  30. {"dictVale":2,"dictLabel":"公务卡转账"},
  31. {"dictVale":3,"dictLabel":"虚拟挂账"},
  32. {"dictVale":4,"dictLabel":"代管账户转账"},
  33. {"dictVale":5,"dictLabel":"母子转账"},
  34. {"dictVale":10,"dictLabel":"现金提现"},
  35. {"dictVale":11,"dictLabel":"现金使用"},
  36. {"dictVale":12,"dictLabel":"汇票支出"}
  37. ]
  38. },
  39. onLoad: function (options) {
  40. //获取用户信息
  41. this.getUserInfo()
  42. //获取滚动条高度
  43. this.computeBarLocation();
  44. //查询待办
  45. this.getTaskList();
  46. //查询已办
  47. this.getTaskDoneList();
  48. //查询已发起
  49. this.getTransferList();
  50. this.getTransferList1();
  51. //查询已制单
  52. this.getTransferList2();
  53. },
  54. switchTab:function(e){
  55. this.setData({
  56. active:e.currentTarget.dataset.gid
  57. })
  58. },
  59. dictTranslate(d,value){
  60. let val = ""
  61. for(var index in d){
  62. if(d[index].dictVale==value){
  63. return val = d[index].dictLabel
  64. }
  65. }
  66. },
  67. getTaskList:function(e){
  68. let data = {
  69. pageNum:1,
  70. pageSize:10,
  71. orderByColumn:"A.ID_",
  72. isAsc:"desc",
  73. systemType:4,
  74. method:"GET"
  75. }
  76. UTIL.httpRequest(API.URL_GET_TASKLIST,data, {
  77. success: (res) => {
  78. if (res.code == API.SUCCESS_CODE) {
  79. this.setData({todoNum:res.total})
  80. if(res.rows!=null&&res.rows!=""){
  81. for(let i = 0;i<res.total;i++){
  82. let d = this.dictTranslate(this.data.transferType,res.rows[i].formData.transferType)
  83. res.rows[i].formData.transferType = d
  84. }
  85. this.setData({todoList:res.rows})
  86. }
  87. }
  88. }, fail: (res) => {
  89. console.log(res);
  90. },
  91. complete: (res) => {
  92. console.log(res);
  93. }
  94. })
  95. },
  96. getTaskDoneList:function(e){
  97. let data = {
  98. pageNum:1,
  99. pageSize:10,
  100. orderByColumn:"A.ID_",
  101. isAsc:"desc",
  102. systemType:4,
  103. method:"GET"
  104. }
  105. UTIL.httpRequest(API.URL_GET_TASKDONELIST,data, {
  106. success: (res) => {
  107. if (res.code == API.SUCCESS_CODE) {
  108. this.setData({doneNum:res.total})
  109. if(res.rows!=null&&res.rows!=""){
  110. for(var index in res.rows){
  111. let d = this.dictTranslate(this.data.transferType,res.rows[index].formData.transferType)
  112. res.rows[index].formData.transferType = d
  113. }
  114. this.setData({doneList:res.rows})
  115. }
  116. }
  117. }, fail: (res) => {
  118. console.log(res);
  119. },
  120. complete: (res) => {
  121. console.log(res);
  122. }
  123. })
  124. },
  125. getTransferList:function(e){
  126. let data = {
  127. // pageNum:1,
  128. // pageSize:10,
  129. transferType:"1",
  130. auditStatus:"2",
  131. method:"GET"
  132. }
  133. UTIL.httpRequest(API.URL_GET_TRANSFERLIST,data, {
  134. success: (res) => {
  135. if (res.code == API.SUCCESS_CODE) {
  136. console.log(res);
  137. let a = this.data.yfqNum+res.total
  138. this.setData({yfqNum:a})
  139. this.setData({yfqList:res.rows})
  140. }
  141. }, fail: (res) => {
  142. console.log(res);
  143. },
  144. complete: (res) => {
  145. console.log(res);
  146. }
  147. })
  148. },
  149. getTransferList1:function(e){
  150. let data = {
  151. // pageNum:1,
  152. // pageSize:10,
  153. transferType:"1",
  154. auditStatus:"3",
  155. method:"GET"
  156. }
  157. UTIL.httpRequest(API.URL_GET_TRANSFERLIST,data, {
  158. success: (res) => {
  159. if (res.code == API.SUCCESS_CODE) {
  160. console.log();
  161. let a = this.data.yfqNum+res.total
  162. this.setData({yfqNum:a})
  163. this.setData({yfqList:res.rows})
  164. }
  165. }, fail: (res) => {
  166. console.log(res);
  167. },
  168. complete: (res) => {
  169. console.log(res);
  170. }
  171. })
  172. },
  173. //已制单
  174. getTransferList2:function(e){
  175. let data = {
  176. // pageNum:1,
  177. // pageSize:10,
  178. transferType:"1",
  179. auditStatus:"0",
  180. method:"GET"
  181. }
  182. UTIL.httpRequest(API.URL_GET_TRANSFERLIST,data, {
  183. success: (res) => {
  184. if (res.code == API.SUCCESS_CODE) {
  185. this.setData({yzdNum:res.total})
  186. this.setData({yzdList:res.rows})
  187. }
  188. }, fail: (res) => {
  189. console.log(res);
  190. },
  191. complete: (res) => {
  192. console.log(res);
  193. }
  194. })
  195. },
  196. //跳转收入登记
  197. swichInCome:function(e){
  198. wx.navigateTo({
  199. url: '../inCome/inCome?',
  200. })
  201. },
  202. //跳转支出申请
  203. swichPayment:function(e){
  204. wx.navigateTo({
  205. url: '../apply/index?',
  206. })
  207. },
  208. //跳转个人设置
  209. swichSettle:function(e){
  210. // console.log(e.currentTarget.dataset.current);
  211. // let cur = e.currentTarget.dataset.current;
  212. // if (this.data.currentTaB == cur) {
  213. // return false;
  214. // }else{
  215. // wx.navigateTo({
  216. // url: '../inCome/index?id=' + id,
  217. // })
  218. // }
  219. wx.navigateTo({
  220. url: 'settle/index?',
  221. })
  222. },
  223. /* 计算bar 高度*/
  224. computeBarLocation() {
  225. var that = this;
  226. let CustomMenuButton = wx.getMenuButtonBoundingClientRect();
  227. let CustomWidows = wx.getSystemInfoSync();
  228. // 根据文档,先创建一个SelectorQuery对象实例
  229. let query = wx.createSelectorQuery().in(this);
  230. query.select('.top_title').boundingClientRect();
  231. query.select('.information_header').boundingClientRect();
  232. query.select('.navList_main').boundingClientRect();
  233. query.select('.child_function').boundingClientRect();
  234. query.select('.work_plan').boundingClientRect();
  235. query.exec((res) => {
  236. let wrokScrollHeight = CustomWidows.windowHeight;
  237. res.forEach((v)=>{
  238. wrokScrollHeight = wrokScrollHeight - v.height;
  239. })
  240. wrokScrollHeight = wrokScrollHeight-CustomMenuButton.top-CustomMenuButton.bottom -15;
  241. that.setData({
  242. wrokScrollHeight: wrokScrollHeight,
  243. });
  244. })
  245. that.setData({
  246. CustomMenuButton: CustomMenuButton,
  247. });
  248. },
  249. /* 获取用户信息*/
  250. getUserInfo(){
  251. UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, {
  252. success: (res) => {
  253. if (res.code == API.SUCCESS_CODE) {
  254. this.setData({userInfoObj:res.user})
  255. this.setData({item:JSON.stringify(res.user)})
  256. }
  257. }
  258. })
  259. }
  260. })