confirmUnloading.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <!-- 确认装车 -->
  2. <template>
  3. <view class="content">
  4. <view class="level1-title">
  5. 任务信息
  6. </view>
  7. <view class="content1">
  8. <view class='row-between'>
  9. <view class="">订单编号</view>
  10. <view>CY20220210666666</view>
  11. </view>
  12. <view class='row-between'>
  13. <view class="">货主</view>
  14. <view>张三</view>
  15. </view>
  16. <view class='row-between'>
  17. <view class="">货主单位</view>
  18. <view>黑龙江中天昊元贸易有限公司</view>
  19. </view>
  20. <view class='row-between'>
  21. <view class="">发货地</view>
  22. <view>鲅鱼圈</view>
  23. </view>
  24. <view class='row-between'>
  25. <view class="">卸货地</view>
  26. <view>黑龙江省齐齐哈尔市梅里斯达斡尔族区杜尔门沁达斡尔乡53农场</view>
  27. </view>
  28. <view class='row-between'>
  29. <view class="">货名</view>
  30. <view>玉米</view>
  31. </view>
  32. <view class='row-between'>
  33. <view class="">运费</view>
  34. <view>100元/吨</view>
  35. </view>
  36. </view>
  37. <view class="level1-title">
  38. 卸车信息
  39. </view>
  40. <view class="content2">
  41. <view class='row-between'>
  42. <view class="">车牌号</view>
  43. <view>辽H12345</view>
  44. </view>
  45. <view class='row-between'>
  46. <view class="">卸车时间</view>
  47. <view>2022-02-10 16:13:15</view>
  48. </view>
  49. <view class='row-between'>
  50. <view class="">卸车净重</view>
  51. </view>
  52. <view class='s-flex'>
  53. <view class="">上传卸车照片</view>
  54. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="3"
  55. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  56. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  57. </view>
  58. <view class='s-flex'>
  59. <view class="">上传卸车磅单</view>
  60. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  61. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  62. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  63. </view>
  64. </view>
  65. <view class="content3 flex">
  66. <u-button text="暂存" type="primary" @click="submit(0)"></u-button>
  67. <u-button text="提交" type="primary" @click="submit(1)"></u-button>
  68. </view>
  69. <u-toast ref="uToast"></u-toast>
  70. <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true' :showCancelButton='true' confirmColor='#22C572' @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal>
  71. </view>
  72. </template>
  73. <script>
  74. import upload from '@/components/upload.vue';
  75. export default {
  76. components: {
  77. upload
  78. },
  79. data() {
  80. return {
  81. detailData: {
  82. addressUrl: ''
  83. },
  84. action: this.$helper.ossUploadUrl,
  85. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  86. isAdd: true,
  87. isShowAlert: false,
  88. alertContent: '',
  89. alertTitle: '',
  90. }
  91. },
  92. onLoad(options) {
  93. console.log(options)
  94. },
  95. methods: {
  96. alertBtn() {
  97. // uni.navigateTo({
  98. // url: '/pages/public/login'
  99. // })
  100. },
  101. cancelClick() {
  102. this.isShowAlert = false
  103. },
  104. getImgUrl(res) {
  105. this.detailData.addressUrl = res
  106. console.log(res)
  107. console.log('------------res-----------')
  108. },
  109. onError(error) {
  110. alert(error)
  111. console.log('------------error-----------')
  112. console.log(error)
  113. },
  114. onRemove(index) {},
  115. filterFileType(index, lists) {
  116. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  117. lists.splice(index, 1);
  118. // 当前文件不支持
  119. uni.showModal({
  120. title: '暂不支持当前图片类型',
  121. showCancel: false
  122. });
  123. } else {
  124. this.isAdd = false;
  125. }
  126. },
  127. onProgress(e) {
  128. console.log(e)
  129. },
  130. submit(type) {
  131. console.log(type)
  132. let params = {
  133. type: 'success',
  134. title: '成功主题(带图标)',
  135. message: "庄生晓梦迷蝴蝶",
  136. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  137. }
  138. if(type==0){
  139. }else{
  140. this.alertContent='确定提交装车信息?'
  141. this.alertTitle='提示'
  142. this.isShowAlert = true
  143. }
  144. // this.$refs.uToast.show({
  145. // ...params,
  146. // complete() {
  147. // params.url && uni.navigateTo({
  148. // url: params.url
  149. // })
  150. // }
  151. // })
  152. },
  153. confirmClick(){
  154. console.log('提交')
  155. }
  156. },
  157. }
  158. </script>
  159. <style>
  160. </style>