addAuditUserOtherView.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. (function (vc) {
  2. vc.extends({
  3. propTypes: {
  4. callBackListener: vc.propTypes.string, //父组件名称
  5. callBackFunction: vc.propTypes.string //父组件监听方法
  6. },
  7. data: {
  8. addAuditUserOtherViewInfo: {
  9. flowComponent: 'addAuditUserOtherView',
  10. userId: '',
  11. userName: '',
  12. auditLink: '',
  13. objCode: '',
  14. }
  15. },
  16. watch: {
  17. addAuditUserOtherViewInfo: {
  18. deep: true,
  19. handler: function () {
  20. vc.component.saveAddAuditUserOtherInfo();
  21. }
  22. }
  23. },
  24. _initMethod: function () {
  25. },
  26. _initEvent: function () {
  27. vc.on('addAuditUserOtherViewInfo', 'onIndex', function (_index) {
  28. vc.component.addAuditUserOtherViewInfo.index = _index;
  29. });
  30. vc.on('addAuditUserOtherViewInfo', '_clear', function (_staffInfo) {
  31. vc.component.addAuditUserOtherViewInfo= {
  32. flowComponent: 'addAuditUserOtherView',
  33. userId: _staffInfo.userId,
  34. userName: _staffInfo.name,
  35. auditLink: '',
  36. objCode: '',
  37. };
  38. });
  39. },
  40. methods: {
  41. addAuditUserOtherValidate() {
  42. return vc.validate.validate({
  43. addAuditUserOtherViewInfo: vc.component.addAuditUserOtherViewInfo
  44. }, {
  45. 'addAuditUserOtherViewInfo.userId': [
  46. {
  47. limit: "required",
  48. param: "",
  49. errInfo: "用户ID不能为空"
  50. },
  51. {
  52. limit: "num",
  53. param: "",
  54. errInfo: "用户ID必须为数字"
  55. },
  56. ],
  57. 'addAuditUserOtherViewInfo.userName': [
  58. {
  59. limit: "required",
  60. param: "",
  61. errInfo: "用户名称不能为空"
  62. },
  63. {
  64. limit: "maxin",
  65. param: "2,50",
  66. errInfo: "用户名称必须在2至50字符之间"
  67. },
  68. ],
  69. 'addAuditUserOtherViewInfo.auditLink': [
  70. {
  71. limit: "required",
  72. param: "",
  73. errInfo: "审核环节不能为空"
  74. },
  75. {
  76. limit: "num",
  77. param: "",
  78. errInfo: "审核环节格式错误"
  79. },
  80. ],
  81. 'addAuditUserOtherViewInfo.objCode': [
  82. {
  83. limit: "required",
  84. param: "",
  85. errInfo: "流程对象不能为空"
  86. },
  87. {
  88. limit: "maxLength",
  89. param: "64",
  90. errInfo: "物品库存不能大于64位"
  91. },
  92. ],
  93. });
  94. },
  95. saveAddAuditUserOtherInfo: function () {
  96. if (vc.component.addAuditUserOtherValidate()) {
  97. //侦听回传
  98. vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addAuditUserOtherViewInfo);
  99. return;
  100. }
  101. }
  102. }
  103. });
  104. })(window.vc);