behaviorThingsPlaceVo.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // 查获位置 - 货代
  2. <template>
  3. <view class="container">
  4. <title-status />
  5. <h-navbar title="查获位置" />
  6. <nav-button :menus="menuDatas" @itemClick="menuClick"></nav-button>
  7. <u-form
  8. labelPosition="left"
  9. ref="uForm"
  10. :labelStyle="labelStyle"
  11. labelWidth="130"
  12. :model="formData"
  13. :rules="rules">
  14. <u-form-item
  15. label="检查通道(号)"
  16. required
  17. prop="checkPoint"
  18. borderBottom>
  19. <u-input
  20. v-model="formData.checkPoint"
  21. inputAlign="right"
  22. placeholder="请输入几号检查通道"
  23. border="none"/>
  24. </u-form-item>
  25. <u-form-item
  26. label="岗位"
  27. required
  28. prop="postName"
  29. borderBottom>
  30. <u-input
  31. v-model="formData.postName"
  32. inputAlign="right"
  33. placeholder="请输入岗位"
  34. border="none"/>
  35. </u-form-item>
  36. </u-form>
  37. </view>
  38. </template>
  39. <script>
  40. import TitleStatus from '@/components/title-status/title-status'
  41. import HNavbar from '@/components/h-navbar/h-navbar.vue'
  42. import NavButton from '@/components/nav-bottom/nav-button.vue'
  43. export default {
  44. components: {
  45. TitleStatus,
  46. HNavbar,
  47. NavButton
  48. },
  49. data() {
  50. return {
  51. labelStyle: {
  52. fontSize: '30rpx',
  53. color: '#606266',
  54. fontWeight: '400'
  55. },
  56. menuDatas: [
  57. {
  58. title: '确定',
  59. plain: false,
  60. disabled: false,
  61. bgColor: '#4983FB'
  62. }
  63. ],
  64. formData: {
  65. checkPoint: null,
  66. postName: null
  67. },
  68. rules: {
  69. checkPoint: [
  70. {
  71. required: true,
  72. whitespace: true,
  73. message: '请输入检查通道',
  74. trigger: ['change','blur'],
  75. }
  76. ],
  77. postName: [
  78. {
  79. required: true,
  80. whitespace: true,
  81. message: '请输入岗位',
  82. trigger: ['change','blur'],
  83. }
  84. ]
  85. }
  86. }
  87. },
  88. onLoad(options) {
  89. if(options && options.obj && Object.keys(options.obj).length > 0) {
  90. this.formData = JSON.parse(decodeURIComponent(options.obj))
  91. }
  92. },
  93. methods: {
  94. menuClick() {
  95. this.$refs.uForm.validate().then(res => {
  96. this.getOpenerEventChannel().emit('changeSuccess', this.formData)
  97. this.$navigate.navigateBack()
  98. }).catch(errors => {
  99. // console.log('addSubmit', errors)
  100. // uni.$u.toast('校验失败')
  101. })
  102. }
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. @import "@/common/css/form.scss";
  108. .container {
  109. display: flex;
  110. flex-direction: column;
  111. }
  112. </style>