runOrderInfo.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template>
  2. <view class="order-infos">
  3. <!-- #ifdef MP-WEIXIN -->
  4. <view class="topbar"
  5. :style="rect?'height:'+rect.height+'px;line-height:'+rect.height+'px;margin-top:'+rect.top+'px':''">
  6. <!-- #endif -->
  7. <!-- #ifndef MP-WEIXIN -->
  8. <view class="topbar" :style="statusBarHeight?'margin-top:'+statusBarHeight+'px':''">
  9. <!-- #endif -->
  10. <view class="back-icon" :style="rect?'padding:'+(rect.height-24)+'rpx 20rpx':''">
  11. <u-icon name="arrow-left" size="24" color="#ffffff" @click="pageBack"></u-icon>
  12. </view>
  13. 订单详情
  14. </view>
  15. <view class="after">
  16. <view class="order-info-card">
  17. <view class="order-card">
  18. <view class="order-info-title">
  19. <image class="img" src="../../subpages/static/czzn-img/order/orderInfo-tenant.png"
  20. mode="scaleToFill" />
  21. <view class="mid">
  22. <view class="info">
  23. <span class="label">
  24. {{$t('spare.orderCode')}}
  25. </span>
  26. <span class="type" v-if="orderInfo.orderType == '1'">{{ $t('order.temp') }}</span>
  27. <span class="type" v-if="orderInfo.orderType == '2'">{{ $t('order.fixed') }}</span>
  28. <view class="order-type" v-if="orderInfo.isMain==2">
  29. <u-tag :text="$t('order.mainOrder')" type="success"></u-tag>
  30. </view>
  31. </view>
  32. <text class="code">{{ orderInfo.code || '' }}</text>
  33. </view>
  34. <view class="orderStatus-info" v-if="orderInfo.orderType != '4'">
  35. <u--image width="100rpx" height="88rpx" v-if="orderInfo.orderStatus == 0"
  36. src="/subpages/static/czzn-img/state/not-factory.png"></u--image>
  37. <u--image width="100rpx" height="88rpx"
  38. v-if="orderInfo.orderStatus == 1 && orderInfo.weighingStatus == 0"
  39. src="/subpages/static/czzn-img/state/in-factory.png"></u--image>
  40. <u--image width="100rpx" height="88rpx" v-if="orderInfo.orderStatus == 2"
  41. src="/subpages/static/czzn-img/state/completed.png"></u--image>
  42. <u--image width="100rpx" height="88rpx"
  43. v-if="orderInfo.orderStatus == 1 && orderInfo.weighingStatus != 0"
  44. src="/subpages/static/czzn-img/state/weighed.png"></u--image>
  45. <u--image width="100rpx" height="88rpx" v-if="orderInfo.orderStatus == 4"
  46. src="/subpages/static/czzn-img/state/cancellation.png"></u--image>
  47. </view>
  48. <!-- <span class="type" v-if="orderInfo.orderType == '1'">{{ $t('order.temp') }}</span>
  49. <span class="type" v-if="orderInfo.orderType == '2'">{{ $t('order.fixed') }}</span> -->
  50. <view class="orderStatus-info" v-if="orderInfo.orderType == '4'">
  51. <u--image width="100rpx" height="88rpx" v-if="orderInfo.orderStatus == 0"
  52. src="/subpages/static/czzn-img/state/no-take-order.png"></u--image>
  53. <u--image width="100rpx" height="88rpx" v-if="orderInfo.orderStatus == 1"
  54. src="/subpages/static/czzn-img/state/start-take-order.png"></u--image>
  55. <u--image width="100rpx" height="88rpx" v-if="orderInfo.orderStatus == 2"
  56. src="/subpages/static/czzn-img/state/completed.png"></u--image>
  57. <u--image width="100rpx" height="88rpx"
  58. v-if="orderInfo.enabledMarkType == 1 || orderInfo.orderStatus == 4"
  59. src="/subpages/static/czzn-img/state/cancellation.png"></u--image>
  60. </view>
  61. </view>
  62. <view class="order-card-info">
  63. <p class="cell">
  64. <text class="label">{{ $t('order.orderDate') }}</text>
  65. <text class="info">{{ orderInfo.setDate || '' }}</text>
  66. </p>
  67. <p class="cell">
  68. <text class="label">{{ $t('order.vehicleType') }}</text>
  69. <text class="info"
  70. v-if="orderInfo.vehicleType == '101'">{{ $t('order.saleOrder') }}</text>
  71. <text class="info"
  72. v-if="orderInfo.vehicleType == '102'">{{ $t('order.purchaseOrder') }}</text>
  73. <text class="info"
  74. v-if="orderInfo.vehicleType == '103'">{{ $t('order.materialsOrder') }}</text>
  75. <text class="info"
  76. v-if="orderInfo.vehicleType == '104'">{{ $t('order.transferOrder') }}</text>
  77. </p>
  78. <p class="cell">
  79. <text class="label">{{ $t('order.companyName') }}</text>
  80. <text class="info">{{ orderInfo.companyName || '' }}</text>
  81. </p>
  82. <view class="cell">
  83. <text class="label">{{ $t('order.materialName') }}</text>
  84. <text class="info">{{ orderInfo.materialName || '' }}</text>
  85. </view>
  86. <view class="cell">
  87. <text class="label">{{ $t('order.orderNumber') }}</text>
  88. <!-- <text class="info">{{ orderInfo.orderNumber || '0' }}{{orderInfo.orderType ==
  89. '4' ? $t('customer_meter.unitN') : $t('customer_meter.unitT') }}</text> -->
  90. <text class="info"
  91. :style="'font-size: 9pt;font-weight: bold;'+(orderInfo.companyClientType=='109'?'color: green;':'color: red;')">
  92. {{ orderInfo.orderNumber || '0' }}{{ orderInfo.materialKind=='101' && orderInfo.companyClientType=='109'?$t('customer_meter.unitB') :(orderInfo.orderType ==
  93. '4' ? $t('customer_meter.unitN') : $t('customer_meter.unitT')) }}</text>
  94. </view>
  95. <!-- <view class="cell">
  96. <text class="label">{{ $t('order.driver') }}</text>
  97. <text class="info">{{ orderInfo.driver || '' }}</text>
  98. </view> -->
  99. <view class="cell">
  100. <text class="label">{{ $t('order.vehicle') }}</text>
  101. <text class="info">{{ orderInfo.vehicle || '' }}</text>
  102. </view>
  103. <template v-if="orderInfo.weighingStatus != 0 && orderInfo.materialKind!='101'">
  104. <view class="cell">
  105. <text class="label">{{ $t('order.tareWeight') }}</text>
  106. <text class="info">{{ orderInfo.tareWeight || '0' }}</text>
  107. </view>
  108. <view class="cell">
  109. <text class="label">{{ $t('order.grossWeight') }}</text>
  110. <text class="info">{{ orderInfo.grossWeight || '0' }}</text>
  111. </view>
  112. </template>
  113. <template v-if="orderInfo.weighingStatus != 0 && orderInfo.materialKind!='101'">
  114. <view class="cell">
  115. <text class="label">{{ $t('order.netWeight') }}</text>
  116. <text class="info">{{ orderInfo.netWeight || '0' }}</text>
  117. </view>
  118. </template>
  119. <template v-if="orderInfo.orderStatus != 0">
  120. <view class="cell">
  121. <text class="label">{{ $t('order.inDoorTime') }}</text>
  122. <text class="info">{{ orderInfo.inDoorTime || '' }}</text>
  123. </view>
  124. </template>
  125. <template v-if="orderInfo.orderStatus != 0 && orderInfo.weighingStatus != 0">
  126. <view class="cell">
  127. <text class="label">{{ $t('order.inTime') }}</text>
  128. <text class="info">{{ orderInfo.inTime || '' }}</text>
  129. </view>
  130. </template>
  131. <template v-if="orderInfo.weighingStatus == 2">
  132. <view class="cell">
  133. <text class="label">{{ $t('order.outTime') }}</text>
  134. <text class="info">{{ orderInfo.outTime || '' }}</text>
  135. </view>
  136. <view class="cell">
  137. <text class="label">{{ $t('order.outDate') }}</text>
  138. <text class="info">{{ orderInfo.outDoorTime || '' }}</text>
  139. </view>
  140. <view class="cell">
  141. <text class="label">{{ $t('base.common.arrive') }}</text>
  142. <text :class="'info '+ (orderInfo.arriveFlag=='1'?'use':'used')">
  143. {{orderInfo.arriveFlag=='1'?$t('base.common.arrived'):$t('base.common.noArrive')}}
  144. </text>
  145. </view>
  146. <view class="cell">
  147. <text class="label">{{ $t('base.common.receive') }}</text>
  148. <text :class="'info '+ (orderInfo.receiveFlag=='1'?'use':'used')">
  149. {{orderInfo.receiveFlag=='1'?$t('base.common.received'):$t('base.common.noReceive')}}
  150. </text>
  151. </view>
  152. </template>
  153. </view>
  154. </view>
  155. </view>
  156. <view class="sure-btn" v-if="orderInfo.orderStatus==2 && orderInfo.receiveFlag !=1">
  157. <button class="btn" @click="onArriveClick">{{ $t('base.common.arrive') }}</button>
  158. </view>
  159. </view>
  160. <u-modal :show="showAdd" ref="addModal" closeOnClickOverlay @cancel="showAdd = false"
  161. @close="showAdd = false" @confirm="showAdd = false" stlye="z-index:100"
  162. :cancelText="$t('settings.cancelText')" :confirmText="$t('settings.confirmText')"
  163. :title="$t('driver.pleasePhotograph')">
  164. <view class="invite-box">
  165. <uni-file-picker v-model="imageValue" ref="files" :auto-upload="false" :limit='3'
  166. @select="onFileSelect" @progress="progress" @success="success" @delete="deleteImg" />
  167. </view>
  168. </u-modal>
  169. </view>
  170. </template>
  171. <script>
  172. import {
  173. getDriverLatelyOrderInfo,
  174. } from '../../api/order'
  175. import {
  176. orderArrive,
  177. deleteArriveFile,
  178. } from '../../api/arrive'
  179. import Oss from '../../components/oss/oss'
  180. import {
  181. getTimeInfo
  182. } from '../../utils/util.js'
  183. export default {
  184. data() {
  185. return {
  186. showAdd: false,
  187. orderInfo: {},
  188. rect: undefined,
  189. statusBarHeight: null,
  190. imageValue: [],
  191. arriveId: null
  192. }
  193. },
  194. components: {
  195. Oss
  196. },
  197. onLoad(options) {
  198. this.imageValue = []
  199. this.arriveId = null
  200. this.orderInfo = JSON.parse(options.orderInfo)
  201. console.log("获取到运行订单信息、", this.orderInfo);
  202. if (this.orderInfo.vehicleArriveDetailInfo) {
  203. this.orderInfo.vehicleArriveDetailInfo.forEach(item => {
  204. this.imageValue.push({
  205. "fileID": item.id,
  206. "isAdd": 0,
  207. "name": item.fileName,
  208. "extname": item.fileSuffix,
  209. "url": item.address,
  210. "uri": item.address,
  211. "imageType": "ACCEPT",
  212. })
  213. });
  214. }
  215. console.log("获取到运行订单的签收图片信息、", this.imageValue);
  216. let sysInfo = uni.getSystemInfoSync(); //状态栏的高度
  217. this.statusBarHeight = sysInfo.statusBarHeight;
  218. // #ifdef MP-WEIXIN
  219. this.rect = wx.getMenuButtonBoundingClientRect();
  220. // #endif
  221. console.log(this.rect, this.statusBarHeight);
  222. },
  223. methods: {
  224. onArriveClick() {
  225. var that = this;
  226. if (!that.orderInfo || !that.orderInfo.id) {
  227. uni.showToast({
  228. title: '没有需要签到的订单信息',
  229. icon: 'none'
  230. })
  231. return;
  232. }
  233. let data = {
  234. orderId: that.orderInfo.id
  235. }
  236. orderArrive(data).then(res => {
  237. if (res.data.code == 0) {
  238. that.showAdd = true
  239. that.arriveId = res.data.data.id
  240. }
  241. })
  242. },
  243. pageBack() {
  244. uni.navigateBack({
  245. delta: 1
  246. })
  247. },
  248. onFileSelect(e) {
  249. console.log('选择文件:', e)
  250. var that = this;
  251. if (!that.arriveId) {
  252. uni.showToast({
  253. title: '没有需要签到的订单信息',
  254. icon: 'none'
  255. })
  256. return;
  257. }
  258. uni.uploadFile({
  259. url: '/admin/vehicleArriveDetail/addArrive',
  260. name: 'file',
  261. filePath: e.tempFilePaths[0],
  262. header: {
  263. 'Authorization': 'Bearer ' + uni.getStorageSync('token'),
  264. "Tenant-Id": that.orderInfo.tenantId
  265. },
  266. formData: {
  267. 'tenantId': that.orderInfo.tenantId,
  268. "arriveId": that.arriveId,
  269. "fileLength": 1
  270. },
  271. success: (res) => {
  272. console.log("获取到的上传后文件信息、", res.data);
  273. let response = JSON.parse(res.data)
  274. if (response.code == 0 && response.data) {
  275. uni.showToast({
  276. title: '图片上传成功',
  277. icon: 'none'
  278. })
  279. response.data.forEach(item => {
  280. this.imageValue.push({
  281. "fileID": item.id,
  282. "isAdd": 0,
  283. "name": item.fileName,
  284. "extname": item.fileSuffix,
  285. "url": item.address,
  286. "uri": item.address,
  287. "imageType": "ACCEPT",
  288. })
  289. });
  290. } else {
  291. uni.showToast({
  292. title: '图片上传失败',
  293. icon: 'none'
  294. })
  295. }
  296. },
  297. fail: function(res) {
  298. console.log('图片上传接口失败', res);
  299. uni.showToast({
  300. title: '系统错误,请稍后再试!',
  301. icon: 'none'
  302. })
  303. },
  304. complete: function(res) {
  305. console.log('图片上传接口完成');
  306. // console.log(res);
  307. uni.hideLoading()
  308. }
  309. })
  310. },
  311. progress(e) {
  312. console.log('上传进度:', e)
  313. },
  314. success(e) {
  315. console.log('上传成功', e)
  316. },
  317. deleteImg(e) {
  318. if (!this.arriveId) {
  319. uni.showToast({
  320. title: '没有需要签到的订单信息',
  321. icon: 'none'
  322. })
  323. return;
  324. }
  325. if (e.tempFile.fileID) {
  326. let data = {
  327. id: e.tempFile.fileID,
  328. arriveId: this.arriveId
  329. }
  330. deleteArriveFile(data).then(res => {
  331. if (res.data.code == 0) {
  332. var index = this.imageValue.findIndex(function(item) {
  333. return item.fileID === e.tempFile.fileID;
  334. });
  335. if (index > -1) {
  336. this.imageValue.splice(index, 1)
  337. }
  338. }
  339. console.log("处理后的图片信息、", this.imageValue);
  340. })
  341. }
  342. },
  343. }
  344. }
  345. </script>
  346. <style>
  347. /* #ifndef APP-NVUE */
  348. view {
  349. display: flex;
  350. box-sizing: border-box;
  351. flex-direction: column;
  352. }
  353. page {
  354. box-sizing: border-box;
  355. /* padding: 40rpx 40rpx 80rpx; */
  356. height: 100%;
  357. background: url('../../subpages/static/czzn-img/order/orderInfo-bg.jpg') no-repeat;
  358. background-size: 750rpx auto;
  359. background-color: #f5f7fa;
  360. }
  361. /* #endif*/
  362. </style>
  363. <style lang="scss" scoped>
  364. @import '../../common/css/public.scss';
  365. .invite-box {
  366. width: 100%;
  367. height: 100%;
  368. }
  369. </style>