confirmUnloading.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <!-- 确认装车 -->
  2. <template>
  3. <view class="content">
  4. <view class="content2">
  5. <view class="level2-title">基本信息</view>
  6. <view class='row-between'>
  7. <view class="row-left-text">订单编号</view>
  8. <view class="row-right-text">{{detailData.orderNo}}</view>
  9. </view>
  10. <view class='row-between'>
  11. <view class="row-left-text">货主</view>
  12. <view class="row-right-text">{{detailData.cargoOwner}}</view>
  13. </view>
  14. <view class='row-between'>
  15. <view class="row-left-text">货主单位</view>
  16. <view class="row-right-text">{{detailData.compName?detailData.compName:'个人货主'}}</view>
  17. </view>
  18. <view class='row-between'>
  19. <view class="row-left-text">发货地</view>
  20. <view class="row-right-text place">
  21. {{detailData.sendPrivate}}{{detailData.sendCity}}{{detailData.sendArea}}{{detailData.sendDetailedAddress}}
  22. </view>
  23. </view>
  24. <view class='row-between'>
  25. <view class="row-left-text">卸货地</view>
  26. <view class="row-right-text place">
  27. {{detailData.unloadPrivate}}{{detailData.unloadCity}}{{detailData.unloadArea}}{{detailData.unloadDetailedAddress}}
  28. </view>
  29. </view>
  30. <view class='row-between'>
  31. <view class="row-left-text">货名</view>
  32. <view class="row-right-text">{{detailData.goodsName}}</view>
  33. </view>
  34. <view class='row-between'>
  35. <view class="row-left-text">运费</view>
  36. <view class="row-right-text">{{detailData.freight}}{{detailData.illingMethod==0?'元/吨':'元/车'}}</view>
  37. </view>
  38. </view>
  39. <view class="content2">
  40. <view class="level2-title">卸车信息</view>
  41. <view class='row-between'>
  42. <view class="row-left-text">车牌号</view>
  43. <view class="row-right-text">{{detailData.carrierInfo.carNo}}</view>
  44. </view>
  45. <view class='row-between'>
  46. <view class="row-left-text">卸车日期</view>
  47. <view class="row-right-text">{{detailData.carrierInfo.unloadingDate}}</view>
  48. </view>
  49. <view class='row-between'>
  50. <view class="row-left-text">合计应付运费(元)</view>
  51. <input type="text" value="" placeholder="输入合计应付运费" v-model="detailData.carrierInfo.totalFreight" />
  52. </view>
  53. <view class='row-between'>
  54. <view class="row-left-text">定位</view>
  55. <view>{{detailData.carrierInfo.unloadCity}}{{detailData.carrierInfo.unloadArea}}</view>
  56. <!-- <view class="row-right-text place">去授权</view> -->
  57. <!-- <view class="row-right-text place">刷新</view> -->
  58. </view>
  59. <view class='s-flex'>
  60. <view class="row-left-text">上传卸车照片(1-3张)</view>
  61. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="3"
  62. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  63. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  64. </view>
  65. </view>
  66. <view class="bottom-btn">
  67. <view class="store" @click="submit(1)">暂存</view>
  68. <view class="submit" @click="submit(3)">提交</view>
  69. </view>
  70. <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
  71. :showCancelButton='true' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
  72. @cancel="cancelClick"></u-modal>
  73. <u-toast ref="uToast"></u-toast>
  74. </view>
  75. </template>
  76. <script>
  77. import upload from '@/components/upload.vue';
  78. export default {
  79. components: {
  80. upload
  81. },
  82. data() {
  83. return {
  84. detailData: {
  85. addressUrl: ''
  86. },
  87. action: this.$helper.ossUploadUrl,
  88. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  89. isAdd: true,
  90. isShowAlert: false,
  91. alertContent: '',
  92. alertTitle: '',
  93. }
  94. },
  95. onLoad(options) {
  96. console.log(options)
  97. this.detailData = options;
  98. this.detailData.contractNo = 'CYHT20220317000001'
  99. this.detailData.carrierInfo = {
  100. carNo: '123',
  101. unloadingDate: '2022-03-17',
  102. estimatedFreight: '100',
  103. unloadingAreaLongitude: '',
  104. unloadingAreaLatitude: '',
  105. unloadCity: '沈阳',
  106. unloadArea: '大东',
  107. unloadingImg: '',
  108. totalFreight: '100'
  109. }
  110. },
  111. methods: {
  112. alertBtn() {
  113. // uni.navigateTo({
  114. // url: '/pages/public/login'
  115. // })
  116. },
  117. cancelClick() {
  118. this.isShowAlert = false
  119. },
  120. getImgUrl(res) {
  121. this.detailData.carrierInfo.unloadingImg += res + ','
  122. console.log(res)
  123. console.log('------------res-----------')
  124. },
  125. onError(error) {
  126. alert(error)
  127. console.log('------------error-----------')
  128. console.log(error)
  129. },
  130. onRemove(index) {},
  131. filterFileType(index, lists) {
  132. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  133. lists.splice(index, 1);
  134. // 当前文件不支持
  135. uni.showModal({
  136. title: '暂不支持当前图片类型',
  137. showCancel: false
  138. });
  139. } else {
  140. this.isAdd = false;
  141. }
  142. },
  143. onProgress(e) {
  144. console.log(e)
  145. },
  146. submit(type) {
  147. console.log(type)
  148. let params = {
  149. type: 'success',
  150. title: '成功主题(带图标)',
  151. message: "庄生晓梦迷蝴蝶",
  152. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  153. }
  154. if (type == 1) {
  155. } else {
  156. this.alertContent = '确定提交卸车信息?'
  157. this.alertTitle = '提示'
  158. this.isShowAlert = true
  159. this.detailData.statusFlag = type
  160. }
  161. // this.$refs.uToast.show({
  162. // ...params,
  163. // complete() {
  164. // params.url && uni.navigateTo({
  165. // url: params.url
  166. // })
  167. // }
  168. // })
  169. },
  170. confirmClick() {
  171. this.$request.baseRequest('post', '/carrierInfo/unLoadingAdd', this.detailData).then(res => {
  172. if (res.code == 200) {
  173. this.$refs.uToast.show({
  174. type: 'success',
  175. message: "提交成功!",
  176. complete() {
  177. uni.switchTab({
  178. url:'/pages/order/index'
  179. })
  180. }
  181. })
  182. }
  183. })
  184. .catch(res => {
  185. uni.$u.toast(res.message);
  186. });
  187. console.log('提交')
  188. }
  189. },
  190. }
  191. </script>
  192. <style scoped lang="scss">
  193. .content {
  194. .row-left-text {
  195. color: #333333;
  196. }
  197. }
  198. .level2-title {
  199. margin: 0 0 20rpx 0;
  200. }
  201. .content1,
  202. .content2 {
  203. background: white;
  204. margin: 20rpx;
  205. border-radius: 20rpx;
  206. padding: 20rpx;
  207. .place {
  208. width: 80%;
  209. text-align: right;
  210. }
  211. }
  212. .upload {}
  213. .bottom-btn {
  214. display: flex;
  215. justify-content: space-around;
  216. margin-bottom: 50rpx;
  217. background: #FFFFFF;
  218. padding: 40rpx 0;
  219. }
  220. .store {
  221. padding: 20rpx 30rpx;
  222. color: #2772FB;
  223. width: 40%;
  224. background: #EEF4FF;
  225. border-radius: 40rpx;
  226. font-size: 36rpx;
  227. text-align: center;
  228. }
  229. .submit {
  230. font-size: 36rpx;
  231. padding: 20rpx 30rpx;
  232. color: white;
  233. width: 40%;
  234. background: #2772FB;
  235. border-radius: 40rpx;
  236. text-align: center;
  237. }
  238. </style>