select-data-dictionary.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. const Constants = require('@/utils/Constants.js')
  2. const mixins = require('@/mixins/index.js')
  3. Page({
  4. mixins: [mixins],
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. // 路由
  10. routeObjName: 'common',
  11. // 列表区(内容)
  12. contentList: [
  13. { name: 'dataCode', title: '数据编码' },
  14. { name: 'dictCode', title: '字典项目' },
  15. ],
  16. },
  17. /**
  18. * @desc : 点击事件-返回数据
  19. * @author : 姜永辉
  20. * @date : 2022/5/23 15:16
  21. */
  22. toDetail(e) {
  23. let item = e.detail.item
  24. const eventChannel = this.getOpenerEventChannel();
  25. eventChannel.emit('bindData', {
  26. data: {
  27. id: item.dataId,
  28. name: item.dataValue,
  29. dictCode: item.dictCode,
  30. dataCode: item.dataCode,
  31. flgDefault: item.flgDefault,
  32. }
  33. })
  34. wx.navigateBack({
  35. delta: 1
  36. })
  37. },
  38. /**
  39. * @desc : 查询 入库单
  40. * @date : 2024年3月8日
  41. * @author : 姜永辉
  42. */
  43. getData(params) {
  44. // 从上一个页面的urlkeypara传入
  45. params.dictCode = this.data.item.urlKeyParam
  46. return this.excute(this.data.service, this.data.service.getDictionaryData, params);
  47. },
  48. /**
  49. * @desc : 加载数据
  50. * @date : 2024/2/1 15:49
  51. * @author : 姜永辉
  52. */
  53. loadInit() {
  54. // 销售出库
  55. if (this.data.item.outType == Constants.outType.sale) {
  56. wx.setNavigationBarTitle({
  57. title: mixins.$t('saleOutBound'),
  58. })
  59. } else if (this.data.item.outType == Constants.outType.other) {
  60. // 其他出库
  61. wx.setNavigationBarTitle({
  62. title: mixins.$t('otherOutWh'),
  63. })
  64. } else {
  65. wx.setNavigationBarTitle({
  66. title: mixins.$t('purReturnOutBound'),
  67. })
  68. }
  69. },
  70. })