briefDetails.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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="100"
  12. :model="formData"
  13. :rules="rules">
  14. <u-form-item
  15. label="托运人/公司"
  16. required
  17. prop="shipper"
  18. borderBottom>
  19. <u-input
  20. v-model="formData.shipper"
  21. inputAlign="right"
  22. placeholder="请输入托运人/公司"
  23. border="none"/>
  24. </u-form-item>
  25. <u-form-item
  26. label="经办人"
  27. required
  28. prop="operator"
  29. borderBottom>
  30. <u-input
  31. v-model="formData.operator"
  32. inputAlign="right"
  33. placeholder="请输入经办人"
  34. border="none"/>
  35. </u-form-item>
  36. <u-form-item
  37. label="运单号"
  38. required
  39. prop="waybillNumber"
  40. borderBottom>
  41. <u-input
  42. v-model="formData.waybillNumber"
  43. inputAlign="right"
  44. placeholder="请输入运单号"
  45. border="none"/>
  46. </u-form-item>
  47. <u-form-item
  48. label="始发地"
  49. required
  50. prop="beginningPlace"
  51. borderBottom>
  52. <u-input
  53. v-model="formData.beginningPlace"
  54. inputAlign="right"
  55. placeholder="请输入始发地"
  56. border="none"/>
  57. </u-form-item>
  58. <u-form-item
  59. label="目的地"
  60. required
  61. prop="destination"
  62. borderBottom>
  63. <u-input
  64. v-model="formData.destination"
  65. inputAlign="right"
  66. placeholder="请输入目的地"
  67. border="none"/>
  68. </u-form-item>
  69. <u-form-item
  70. label="可疑物品"
  71. required
  72. prop="suspiciousItems"
  73. borderBottom>
  74. <u-input
  75. v-model="formData.suspiciousItems"
  76. inputAlign="right"
  77. placeholder="请输入可疑物品"
  78. border="none"/>
  79. </u-form-item>
  80. <u-form-item
  81. label="违法嫌疑点"
  82. required
  83. prop="suspectedIllegalPoints"
  84. borderBottom>
  85. <u-input
  86. v-model="formData.suspectedIllegalPoints"
  87. inputAlign="right"
  88. placeholder="请输入违法嫌疑点"
  89. border="none"/>
  90. </u-form-item>
  91. </u-form>
  92. </view>
  93. </template>
  94. <script>
  95. import TitleStatus from '@/components/title-status/title-status'
  96. import HNavbar from '@/components/h-navbar/h-navbar.vue'
  97. import NavButton from '@/components/nav-bottom/nav-button.vue'
  98. export default {
  99. components: {
  100. TitleStatus,
  101. HNavbar,
  102. NavButton
  103. },
  104. data() {
  105. return {
  106. labelStyle: {
  107. fontSize: '30rpx',
  108. color: '#606266',
  109. fontWeight: '400'
  110. },
  111. menuDatas: [
  112. {
  113. title: '确定',
  114. plain: false,
  115. disabled: false,
  116. bgColor: '#4983FB'
  117. }
  118. ],
  119. formData: {
  120. // 始发地
  121. beginningPlace: null,
  122. // 目的地
  123. destination: null,
  124. // 经办人
  125. operator: null,
  126. // 托运人
  127. shipper: null,
  128. // 违法嫌疑点
  129. suspectedIllegalPoints: null,
  130. // 可疑物品
  131. suspiciousItems: null,
  132. // 运单号
  133. waybillNumber: null
  134. },
  135. rules: {
  136. beginningPlace: [
  137. {
  138. required: true,
  139. whitespace: true,
  140. message: '请输入始发地',
  141. trigger: ['change','blur'],
  142. }
  143. ],
  144. destination: [
  145. {
  146. required: true,
  147. whitespace: true,
  148. message: '请输入目的地',
  149. trigger: ['change','blur'],
  150. }
  151. ],
  152. operator: [
  153. {
  154. required: true,
  155. whitespace: true,
  156. message: '请输入经办人',
  157. trigger: ['change','blur'],
  158. }
  159. ],
  160. shipper: [
  161. {
  162. required: true,
  163. whitespace: true,
  164. message: '请输入托运人/公司',
  165. trigger: ['change','blur'],
  166. }
  167. ],
  168. suspectedIllegalPoints: [
  169. {
  170. required: true,
  171. whitespace: true,
  172. message: '请输入违法嫌疑点',
  173. trigger: ['change','blur'],
  174. }
  175. ],
  176. suspiciousItems: [
  177. {
  178. required: true,
  179. whitespace: true,
  180. message: '请输入可疑物品',
  181. trigger: ['change','blur'],
  182. }
  183. ],
  184. waybillNumber: [
  185. {
  186. required: true,
  187. whitespace: true,
  188. message: '请输入运单号',
  189. trigger: ['change','blur'],
  190. }
  191. ]
  192. }
  193. }
  194. },
  195. onLoad(options) {
  196. if(options && options.obj && Object.keys(options.obj).length > 0) {
  197. this.formData = JSON.parse(decodeURIComponent(options.obj))
  198. }
  199. },
  200. methods: {
  201. menuClick() {
  202. this.$refs.uForm.validate().then(res => {
  203. this.getOpenerEventChannel().emit('changeSuccess', this.formData)
  204. this.$navigate.navigateBack()
  205. }).catch(errors => {
  206. // console.log('addSubmit', errors)
  207. // uni.$u.toast('校验失败')
  208. })
  209. }
  210. }
  211. }
  212. </script>
  213. <style lang="scss" scoped>
  214. @import "@/common/css/form.scss";
  215. .container {
  216. display: flex;
  217. flex-direction: column;
  218. }
  219. </style>