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

liist.js 7.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. // pages/handle/liist.js
  2. import * as UTIL from '../../utils/util.js';
  3. import * as API from '../../utils/API.js';
  4. const app = getApp();
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. isIPX: app.globalData.isIPX,
  11. active:"",
  12. pageTitle:"",
  13. // 待办列表
  14. todoList:[],
  15. // 已办列表
  16. doneList:[],
  17. // 已发起
  18. yfqList:[],
  19. // 已制单
  20. yzdList:[],
  21. //待办数量
  22. todoNum:0,
  23. //已办数量
  24. doneNum:0,
  25. //已发起数量
  26. yfqNum:0,
  27. //已制单数量
  28. yzdNum:0,
  29. index:0,
  30. array:["未提交","待审核","已审核","已挂起"],
  31. //字典
  32. transferType:[
  33. {"dictVale":1,"dictLabel":"村账户转账"},
  34. {"dictVale":2,"dictLabel":"公务卡转账"},
  35. {"dictVale":3,"dictLabel":"虚拟挂账"},
  36. {"dictVale":4,"dictLabel":"代管账户转账"},
  37. {"dictVale":5,"dictLabel":"母子转账"},
  38. {"dictVale":10,"dictLabel":"现金提现"},
  39. {"dictVale":11,"dictLabel":"现金使用"},
  40. {"dictVale":12,"dictLabel":"汇票支出"}
  41. ],
  42. userInfoObj:[]
  43. },
  44. /**
  45. * 生命周期函数--监听页面加载
  46. */
  47. onLoad: function (options) {
  48. this.setData({active:options.active})
  49. if(options.active==1||options.active==2){
  50. this.setData({pageTitle:"待办/已办"})
  51. }else{
  52. this.setData({pageTitle:"发起/制单"})
  53. }
  54. //获取用户信息
  55. this.getUserInfo()
  56. },
  57. /* 获取用户信息*/
  58. getUserInfo(){
  59. UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, {
  60. success: (res) => {
  61. if (res.code == API.SUCCESS_CODE) {
  62. this.setData({userInfoObj:res.user})
  63. this.setData({region:res.user.deptName})
  64. this.setData({item:JSON.stringify(res.user)})
  65. //查询待办
  66. this.getTaskList();
  67. //查询已办
  68. this.getTaskDoneList();
  69. //查询已发起
  70. this.getTransferList();
  71. //查询已制单
  72. this.getTransferList2();
  73. }
  74. }
  75. })
  76. },
  77. bindPickerChange:function(e){zhibob
  78. this.setData({index:e.detail.value});
  79. },
  80. switchTab:function(e){
  81. this.setData({
  82. active:e.currentTarget.dataset.gid
  83. })
  84. },
  85. dictTranslate(d,value){
  86. let val = ""
  87. for(var index in d){
  88. if(d[index].dictVale==value){
  89. return val = d[index].dictLabel
  90. }
  91. }
  92. },
  93. getTaskList:function(e){
  94. let data = {
  95. pageNum:1,
  96. pageSize:10,
  97. orderByColumn:"A.ID_",
  98. isAsc:"desc",
  99. systemType:4,
  100. method:"GET",
  101. taskName:'相关人员审批'
  102. }
  103. UTIL.httpRequest(API.URL_GET_TASKLIST,data, {
  104. success: (res) => {
  105. if (res.code == API.SUCCESS_CODE) {
  106. this.setData({todoNum:res.total})
  107. if(res.rows!=null&&res.rows!=""){
  108. for(let i = 0;i<res.total;i++){
  109. let d = this.dictTranslate(this.data.transferType,res.rows[i].formData.transferType)
  110. res.rows[i].formData.transferType = d
  111. }
  112. this.setData({todoList:res.rows})
  113. }
  114. }
  115. }, fail: (res) => {
  116. console.log(res);
  117. },
  118. complete: (res) => {
  119. }
  120. })
  121. },
  122. getTaskDoneList:function(e){
  123. let data = {
  124. pageNum:1,
  125. pageSize:10,
  126. orderByColumn:"A.ID_",
  127. isAsc:"desc",
  128. systemType:4,
  129. method:"GET",
  130. taskName:'相关人员审批'
  131. }
  132. UTIL.httpRequest(API.URL_GET_TASKDONELIST,data, {
  133. success: (res) => {
  134. if (res.code == API.SUCCESS_CODE) {
  135. this.setData({doneNum:res.total})
  136. if(res.rows!=null&&res.rows!=""){
  137. for(var index in res.rows){
  138. let d = this.dictTranslate(this.data.transferType,res.rows[index].formData.transferType)
  139. res.rows[index].formData.transferType = d
  140. }
  141. this.setData({doneList:res.rows})
  142. }
  143. }
  144. }, fail: (res) => {
  145. console.log(res);
  146. },
  147. complete: (res) => {
  148. }
  149. })
  150. },
  151. getTransferList:function(e){
  152. let data = {
  153. // pageNum:1,
  154. // pageSize:10,
  155. transferType:"1",
  156. status:"5",
  157. method:"GET",
  158. applyUserName:this.data.userInfoObj.nickName
  159. }
  160. UTIL.httpRequest(API.URL_GET_TRANSFERLIST,data, {
  161. success: (res) => {
  162. console.log(res);
  163. if (res.code == API.SUCCESS_CODE) {
  164. let a = this.data.yfqNum+res.total
  165. this.setData({yfqNum:a})
  166. let b = this.data.yfqList
  167. this.setData({yfqList:res.rows.concat(b)})
  168. }
  169. }, fail: (res) => {
  170. },
  171. complete: (res) => {
  172. }
  173. })
  174. },
  175. getTransferList1:function(e){
  176. let data = {
  177. // pageNum:1,
  178. // pageSize:10,
  179. transferType:"1",
  180. auditStatus:"3",
  181. method:"GET"
  182. }
  183. UTIL.httpRequest(API.URL_GET_TRANSFERLIST,data, {
  184. success: (res) => {
  185. console.log(res);
  186. if (res.code == API.SUCCESS_CODE) {
  187. let a = this.data.yfqNum+res.total
  188. this.setData({yfqNum:a})
  189. let b = this.data.yfqList
  190. this.setData({yfqList:res.rows.concat(b)})
  191. }
  192. }, fail: (res) => {
  193. },
  194. complete: (res) => {
  195. }
  196. })
  197. },
  198. getTransferList1:function(e){
  199. let data = {
  200. // pageNum:1,
  201. // pageSize:10,
  202. transferType:"1",
  203. auditStatus:"3",
  204. method:"GET"
  205. }
  206. UTIL.httpRequest(API.URL_GET_TRANSFERLIST,data, {
  207. success: (res) => {
  208. if (res.code == API.SUCCESS_CODE) {
  209. console.log();
  210. let a = this.data.yfqNum+res.total
  211. this.setData({yfqNum:a})
  212. this.setData({yfqList:res.rows})
  213. }
  214. }, fail: (res) => {
  215. console.log(res);
  216. },
  217. complete: (res) => {
  218. console.log(res);
  219. }
  220. })
  221. },
  222. //已制单
  223. getTransferList2:function(e){
  224. console.log(this.data.userInfoObj)
  225. let data = {
  226. // pageNum:1,
  227. // pageSize:10,
  228. transferType:"1",
  229. status:"0",
  230. method:"GET",
  231. submitter:this.data.userInfoObj.nickName
  232. }
  233. UTIL.httpRequest(API.URL_GET_TRANSFERLIST,data, {
  234. success: (res) => {
  235. if (res.code == API.SUCCESS_CODE) {
  236. this.setData({yzdNum:res.total})
  237. this.setData({yzdList:res.rows})
  238. }
  239. }, fail: (res) => {
  240. console.log(res);
  241. },
  242. complete: (res) => {
  243. console.log(res);
  244. }
  245. })
  246. },
  247. back:function(){
  248. wx.navigateBack({
  249. delta: 1
  250. })
  251. },
  252. godetail:function(e){
  253. wx.navigateTo({
  254. url: '/pages/apply/paymentTemplate/add/add?id='+e.currentTarget.dataset.id,
  255. })
  256. },
  257. gosee:function(e){
  258. wx.navigateTo({
  259. url: '/pages/handle/expenditureAudit/expenditureAudit?id='+e.currentTarget.dataset.id+'&taskId='+e.currentTarget.dataset.taskid+'&type='+e.currentTarget.dataset.type,
  260. })
  261. },
  262. goUpdate(e){
  263. wx.navigateTo({
  264. url: '/pages/apply/paymentTemplate/add/add?id='+e.currentTarget.dataset.id,
  265. })
  266. },
  267. /**
  268. * 生命周期函数--监听页面初次渲染完成
  269. */
  270. onReady: function () {
  271. },
  272. /**
  273. * 生命周期函数--监听页面显示
  274. */
  275. onShow: function () {
  276. },
  277. /**
  278. * 生命周期函数--监听页面隐藏
  279. */
  280. onHide: function () {
  281. },
  282. /**
  283. * 生命周期函数--监听页面卸载
  284. */
  285. onUnload: function () {
  286. },
  287. /**
  288. * 页面相关事件处理函数--监听用户下拉动作
  289. */
  290. onPullDownRefresh: function () {
  291. },
  292. /**
  293. * 页面上拉触底事件的处理函数
  294. */
  295. onReachBottom: function () {
  296. },
  297. /**
  298. * 用户点击右上角分享
  299. */
  300. onShareAppMessage: function () {
  301. }
  302. })