freight_setting_approval.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view class="warp">
  3. <view class="transaction">
  4. <u-form :model="purchaseOrder" ref="uForm" class="uForm">
  5. <u-form-item label="合同编号" prop="receivingAddress" label-width="140">
  6. <u-input v-model="purchaseOrder.receivingAddress" input-align="right" placeholder="" disabled/>
  7. </u-form-item>
  8. <u-form-item label="任务编号" prop="receivingAddress" label-width="140">
  9. <u-input v-model="purchaseOrder.receivingAddress" input-align="right" placeholder="" disabled/>
  10. </u-form-item>
  11. <u-form-item label="货名" prop="receivingAddress" label-width="140">
  12. <u-input v-model="purchaseOrder.receivingAddress" input-align="right" placeholder="" disabled/>
  13. </u-form-item>
  14. <u-form-item label="发货地址" prop="receivingAddress" label-width="140" label-position='top'>
  15. <u-input v-model="purchaseOrder.receivingAddress" input-align="left" placeholder="" disabled/>
  16. </u-form-item>
  17. <u-form-item label="收货地址" prop="receivingAddress" label-width="140" label-position='top'>
  18. <u-input v-model="purchaseOrder.receivingAddress" input-align="left" placeholder="请输入收货地址" disabled/>
  19. </u-form-item>
  20. <u-form-item label="运费(元/吨)" prop="freightUnitPrice" label-width="250">
  21. <u-input v-model="purchaseOrder.freightUnitPrice" input-align="right" placeholder="请输入运费单价" />
  22. </u-form-item>
  23. </u-form>
  24. </view>
  25. <u-toast ref="uToast" />
  26. <view class="bottom-btn">
  27. <u-button type="primary" class="submit" hover-class="none" @click="rejectSubmit()">驳回</u-button>
  28. <u-button type="primary" class="submit" hover-class="none" @click="passSubmit()">通过</u-button>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. purchaseOrder: {
  37. freightUnitPrice: "123",
  38. receivingAddress:'444'
  39. },
  40. rules: {
  41. freightUnitPrice: [{
  42. validator: (rule, value, callback) => {
  43. return !this.$u.test.isEmpty(value)
  44. },
  45. message: '运费不能为空',
  46. trigger: ['change', 'blur']
  47. },
  48. {
  49. validator: (rule, value, callback) => {
  50. return this.$u.test.amount(value)
  51. },
  52. message: '数值类型,最多保留两位小数',
  53. trigger: ['change', 'blur'],
  54. }
  55. ]
  56. }
  57. }
  58. },
  59. onLoad() {
  60. this.getList()
  61. },
  62. methods: {
  63. getList(){
  64. },
  65. passSubmit(){
  66. this.$refs.uForm.validate(valid => {
  67. if (valid) {
  68. uni.showLoading({
  69. title: '正在加载',
  70. mask: true
  71. })
  72. console.log('验证通过');
  73. this.$api.doRequest('post',
  74. '/freightReceivingDispatching/api/insertFreightReceivingDispatching',
  75. this
  76. .purchaseOrder).then(res => {
  77. if (res.data.code == 200) {
  78. uni.showToast({
  79. title: '提交成功',
  80. icon: 'none',
  81. duration: 2000,
  82. success: function() {
  83. uni.navigateTo({
  84. url: `/pageA/freightTransport/index`
  85. })
  86. }
  87. })
  88. }
  89. }).catch(res => {
  90. // uni.showToast({
  91. // title: res.data.message,
  92. // icon: 'none',
  93. // duration: 2000
  94. // })
  95. })
  96. } else {
  97. console.log('验证失败');
  98. }
  99. });
  100. }
  101. }
  102. }
  103. </script>
  104. <style scoped lang="scss">
  105. .transaction {
  106. background-color: #FFFFFF;
  107. margin: 10rpx;
  108. padding-bottom: 10rpx;
  109. border-radius: 20rpx;
  110. }
  111. .uForm {
  112. padding: 0 40rpx;
  113. }
  114. .u-form-item{
  115. padding: 0;
  116. }
  117. .bottom-btn {
  118. width: 100%;
  119. position: fixed;
  120. bottom: 40rpx;
  121. display: flex;
  122. z-index: 2;
  123. }
  124. .submit {
  125. width: 40%;
  126. background: #22C572;
  127. border-radius: 10rpx;
  128. }
  129. </style>