outbound-processing.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. /*******************************************************************************
  2. * Copyright(c) 2022 dongke All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称: 出库办理列表
  5. * 编辑履历:
  6. * 作者 日期 版本 修改内容
  7. * jyh 2024-03-12 1.00
  8. *******************************************************************************/
  9. const Constants = require('@/utils/Constants.js');
  10. const mixins = require('@/mixins/index.js')
  11. Page({
  12. mixins: [mixins],
  13. /**
  14. * 页面的初始数据
  15. */
  16. data: {
  17. tagList: [
  18. { title: mixins.$t('outboundProcessing') },
  19. { title: mixins.$t('checkouted') }
  20. ],
  21. // 查询条件
  22. searchContent: [{
  23. code: 'createtime',
  24. title: mixins.$t('pastThirthtyDays'),
  25. defaultValue: 5,
  26. searchType: Constants.searchType.date
  27. }, {
  28. code: 'choose',
  29. title: mixins.$t('choose'),
  30. searchType: Constants.searchType.pick
  31. }],
  32. // 查询条件-筛选
  33. pullMenuList: [
  34. {
  35. code: 'outType',
  36. pullType: 'mSelect',
  37. typeName: 'outboundType'
  38. },
  39. {
  40. code: 'outReason',
  41. pullType: 'mSelect',
  42. typeName: 'outboundReason'
  43. },
  44. {
  45. code: 'cusName',
  46. },
  47. {
  48. code: 'cusPhone',
  49. },
  50. {
  51. code: 'addressFull',
  52. },
  53. {
  54. code: 'outDate',
  55. dataType: 'date'
  56. },
  57. {
  58. code: 'staffName',
  59. },
  60. {
  61. code: 'orgName',
  62. },
  63. {
  64. code: 'supplierName',
  65. },
  66. ],
  67. // 列表区(脚部金额)
  68. footerAmount: {
  69. name: 'outingAmt',
  70. title: mixins.$t('totalAmount')
  71. },
  72. // 列表区(脚部信息)
  73. footerInfo: [{ prefix: mixins.$t('together'),
  74. name: 'outingQty', title: mixins.$t('piece') }],
  75. // 列表区(内容)
  76. contentList: [],
  77. contentObj: {
  78. '采退出库': [{
  79. name: 'orderNo',
  80. title: mixins.$t('orderNo')
  81. }, {
  82. name: 'addressFull',
  83. title: mixins.$t('returnAddress')
  84. }, {
  85. name: [{
  86. name: 'orgName',
  87. title: ''
  88. }, {
  89. name: 'staffName',
  90. title: mixins.$t('staffId')
  91. }],
  92. title: mixins.$t('returnInfo')
  93. }, {
  94. name: 'outDate',
  95. title: mixins.$t('outDate')
  96. }],
  97. '销售出库': [{
  98. name: 'outNo',
  99. title: mixins.$t('outOrderNo')
  100. }, {
  101. name: 'cusPhone',
  102. title: mixins.$t('cusPhone')
  103. }, {
  104. name: 'addressFull',
  105. title: mixins.$t('addressFull')
  106. }, {
  107. name: [{
  108. name: 'orgName',
  109. title: ''
  110. }, {
  111. name: 'staffName',
  112. title: mixins.$t('staffId')
  113. }],
  114. title: mixins.$t('storeInformation')
  115. }, {
  116. name: 'outDate',
  117. title: mixins.$t('outDate')
  118. }],
  119. '其他出库': [{
  120. name: 'outNo',
  121. title: mixins.$t('outDoutOrderNoate')
  122. }, {
  123. name: 'outReasonName',
  124. title: mixins.$t('reasonOutbound')
  125. }, {
  126. name: [{
  127. name: 'orgName',
  128. title: ''
  129. }, {
  130. name: 'staffName',
  131. title: mixins.$t('staffId')
  132. }],
  133. title: mixins.$t('cpManager')
  134. }, {
  135. name: 'outObject',
  136. title: mixins.$t('outObject')
  137. }, {
  138. name: 'outDate',
  139. title: mixins.$t('outDate')
  140. }],
  141. },
  142. // 弹出按钮
  143. buttonList: [
  144. {
  145. name: 'customerRefundList',
  146. title: mixins.$t('invaidOrder'),
  147. }, {
  148. name: 'customerRefundList',
  149. title: mixins.$t('ticketPirnt'),
  150. }
  151. ],
  152. // 底部保存按钮
  153. buttonFootList: [{
  154. name: 'addOther',
  155. title: mixins.$t('otherOutWh'),
  156. }],
  157. contentnFootList: [
  158. {
  159. title:mixins.$t('totalAmount'),
  160. code: 'intoingAmt',
  161. content: 0,
  162. type: 'number'
  163. }, {
  164. type: 'count',
  165. code: 'count',
  166. bill: 1,
  167. quantity: 2
  168. }
  169. ],
  170. btnFormData: null,
  171. // 路由
  172. routeObjName: 'outbound',
  173. active: 0,
  174. // 主键Id
  175. primaryKey: 'outId',
  176. },
  177. /**
  178. * 切换 已出库 未出库
  179. */
  180. onChangeTabs(e) {
  181. let index = e.detail.detail.index
  182. this.setData({
  183. active: index,
  184. })
  185. this.searchData()
  186. },
  187. /**
  188. * @desc : addOther
  189. * @date : 2024年3月8日
  190. * @author : 姜永辉
  191. */
  192. addOther() {
  193. wx.navigateTo({
  194. url: this.data.route.addOther.url,
  195. success: function (res) {
  196. // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
  197. res.eventChannel.emit('params', {})
  198. }
  199. })
  200. },/**
  201. * @desc : 设置查询参数
  202. * @date : 2024年3月8日
  203. * @author : 姜永辉
  204. */
  205. setSearchParams(params) {
  206. if (this.data.active == 0) {
  207. //待出库的查询参数
  208. params.outStatus = Constants.outStatus.outBounding
  209. }
  210. if (this.data.active == 1) {
  211. //已出库的查询参数
  212. params.outStatus = Constants.outStatus.outBounded
  213. }
  214. return params;
  215. },
  216. /**
  217. * @desc : 查询 出库单
  218. * @date : 2024年3月8日
  219. * @author : 姜永辉
  220. */
  221. getData(params) {
  222. return this.excute(this.data.service, this.data.service.selectByCond, params);
  223. },
  224. /**
  225. * @desc : 处理接口返回数据
  226. * @date : 2024年3月8日
  227. * @author : 姜永辉
  228. */
  229. handleSearchData(tableData) {
  230. let temp = tableData
  231. temp.forEach(it => {
  232. it.makeTime = it.makeTime.substring(0, 10)
  233. // 出库对象
  234. if (it.outType == Constants.outType.other) {
  235. it.outObject = it.cusName != null ? it.cusName : it.supplierName
  236. }
  237. })
  238. this.setData({
  239. tableData:temp
  240. })
  241. },
  242. })