orderInfo.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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="../../../substaticpages/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.vehicleType=='101'">
  35. <u--image width="100rpx" height="88rpx" v-if="orderInfo.loadFlag == 2"
  36. src="/substaticpages/static/czzn-img/state/deliver.png"></u--image>
  37. <u--image width="100rpx" height="88rpx" v-if="orderInfo.loadFlag != 2"
  38. src="/substaticpages/static/czzn-img/state/not-deliver.png"></u--image>
  39. </view>
  40. <view class="orderStatus-info" v-if="orderInfo.vehicleType=='102'">
  41. <u--image width="100rpx" height="88rpx" v-if="orderInfo.isCheck == 1"
  42. src="/substaticpages/static/czzn-img/state/accept.png"></u--image>
  43. <u--image width="100rpx" height="88rpx" v-if="orderInfo.isCheck != 1"
  44. src="/substaticpages/static/czzn-img/state/not-accept.png"></u--image>
  45. </view>
  46. </view>
  47. <view class="order-card-info">
  48. <p class="cell">
  49. <text class="label">{{ $t('order.orderDate') }}</text>
  50. <text class="info">{{ orderInfo.setDate || '' }}</text>
  51. </p>
  52. <p class="cell">
  53. <text class="label">{{ $t('order.vehicleType') }}</text>
  54. <text class="info"
  55. v-if="orderInfo.vehicleType == '101'">{{ $t('order.saleOrder') }}</text>
  56. <text class="info"
  57. v-if="orderInfo.vehicleType == '102'">{{ $t('order.purchaseOrder') }}</text>
  58. <text class="info"
  59. v-if="orderInfo.vehicleType == '103'">{{ $t('order.materialsOrder') }}</text>
  60. <text class="info"
  61. v-if="orderInfo.vehicleType == '104'">{{ $t('order.transferOrder') }}</text>
  62. </p>
  63. <p class="cell">
  64. <text class="label">{{ $t('order.companyName') }}</text>
  65. <text class="info">{{ orderInfo.companyName || '' }}</text>
  66. </p>
  67. <view class="cell">
  68. <text class="label">{{ $t('order.materialName') }}</text>
  69. <text class="info">{{ orderInfo.materialName || '' }}</text>
  70. </view>
  71. <view class="cell">
  72. <text class="label">{{ $t('order.orderNumber') }}</text>
  73. <!-- <text class="info">{{ orderInfo.orderNumber || '0' }}{{orderInfo.orderType ==
  74. '4' ? $t('customer_meter.unitN') : $t('customer_meter.unitT') }}</text> -->
  75. <text class="info"
  76. :style="'font-size: 9pt;font-weight: bold;'+(orderInfo.companyClientType=='109'?'color: green;':'color: red;')">
  77. {{ orderInfo.orderNumber || '0' }}{{ orderInfo.materialKind=='101' && orderInfo.companyClientType=='109'?$t('customer_meter.unitB') :(orderInfo.orderType ==
  78. '4' ? $t('customer_meter.unitN') : $t('customer_meter.unitT')) }}</text>
  79. </view>
  80. <!-- <p class="cell">
  81. <text class="label">{{ $t('order.driver') }}</text>
  82. <text class="info">{{ orderInfo.driver || '' }}</text>
  83. </p> -->
  84. <p class="cell">
  85. <text class="label">{{ $t('order.vehicle') }}</text>
  86. <text class="info">{{ orderInfo.vehicle || '' }}</text>
  87. </p>
  88. <template
  89. v-if="orderInfo.orderStatus != 0 && orderInfo.weighingStatus != 0 && orderInfo.materialKind!='101'">
  90. <p class="cell">
  91. <text class="label">{{ $t('order.tareWeight') }}</text>
  92. <text class="info">{{ orderInfo.tareWeight || '0' }}</text>
  93. </p>
  94. <p class="cell" v-if="orderInfo.loadFlag==2">
  95. <text class="label">{{ $t('order.grossWeight') }}</text>
  96. <text class="info">{{ orderInfo.grossWeight || '0' }}</text>
  97. </p>
  98. </template>
  99. <template
  100. v-if="orderInfo.orderStatus != 0 && orderInfo.weighingStatus != 0 && orderInfo.materialKind!='101' && orderInfo.loadFlag==2">
  101. <p class="cell">
  102. <text class="label">{{ $t('order.netWeight') }}</text>
  103. <text class="info">{{ orderInfo.netWeight || '0' }}</text>
  104. </p>
  105. </template>
  106. <template v-if="orderInfo.orderStatus != 0 && orderInfo.weighingStatus == 1">
  107. <p class="cell">
  108. <text class="label">{{ $t('order.inTime') }}</text>
  109. <text class="info">{{ orderInfo.inTime || '' }}</text>
  110. </p>
  111. </template>
  112. <template v-if="orderInfo.orderStatus != 0 && orderInfo.weighingStatus == 2">
  113. <p class="cell">
  114. <text class="label">{{ $t('order.outTime') }}</text>
  115. <text class="info">{{ orderInfo.outTime || '' }}</text>
  116. </p>
  117. </template>
  118. <template v-if="orderInfo.orderStatus == 2">
  119. <p class="cell">
  120. <text class="label">{{ $t('order.outDate') }}</text>
  121. <text class="info">{{ orderInfo.outDoorTime || '' }}</text>
  122. </p>
  123. </template>
  124. <template v-if="orderInfo.orderStatus == 2">
  125. <p class="cell" v-if="orderInfo.vehicleType=='101'||orderInfo.vehicleType=='102'">
  126. <text class="label"
  127. v-if="orderInfo.vehicleType=='101'">{{ $t('order.isBack') }}</text>
  128. <text class="label"
  129. v-if="orderInfo.vehicleType=='102'">{{ $t('order.isReturn') }}</text>
  130. <text class="info"
  131. :style="orderInfo.backFlag&&orderInfo.backFlag=='1'?'color:#3275F5;font-weight:bold':''">{{ orderInfo.backFlag&&orderInfo.backFlag=='1'?$t('driver.yes'):$t('driver.no') }}</text>
  132. </p>
  133. </template>
  134. <!-- <template>
  135. <p class="cell">
  136. <text class="label">{{ $t('order.endDate') }}</text>
  137. <text class="info">{{ orderInfo.orderValidDate || '永久' }}</text>
  138. </p>
  139. </template> -->
  140. <template v-if="orderInfo.vehicleType=='101' && orderInfo.loadFlag==2">
  141. <view class="row">
  142. <p class="cell">
  143. <text class="label">{{ $t('deliver.deliverUserName') }}</text>
  144. <text class="info">{{ orderInfo.loadUserName || '' }}</text>
  145. </p>
  146. </view>
  147. <view class="row">
  148. <p class="cell">
  149. <text class="label">{{ $t('deliver.deliverTime') }}</text>
  150. <text class="info">{{ orderInfo.loadTime || '' }}</text>
  151. </p>
  152. </view>
  153. </template>
  154. <template v-if="orderInfo.vehicleType=='102' && orderInfo.isCheck==1">
  155. <view class="row">
  156. <p class="cell">
  157. <text class="label">{{ $t('accept.acceptUserName') }}</text>
  158. <text class="info">{{ orderInfo.checkUserName || '' }}</text>
  159. </p>
  160. </view>
  161. <view class="row">
  162. <p class="cell">
  163. <text class="label">{{ $t('accept.acceptTime') }}</text>
  164. <text class="info">{{ orderInfo.checkDate || '' }}</text>
  165. </p>
  166. </view>
  167. </template>
  168. <template v-if="operationType==1 || operationType==2">
  169. <view class="row">
  170. <p class="cell">
  171. <text class="label">{{ $t('deliver.shipNumber') }}</text>
  172. <u-input v-model="orderInfo.shipNumber" border="none"
  173. inputAlign="right"
  174. :placeholder="$t('base.common.placeholderI')+$t('deliver.shipNumber')"
  175. @focus="onShipNumberFocus">
  176. </u-input>
  177. </p>
  178. </view>
  179. <view class="row">
  180. <p class="cell">
  181. <text class="label">{{ $t('deliver.orderNumber') }}</text>
  182. <u-input v-model="orderInfo.orderNumber" border="none" type='digit'
  183. inputAlign="right"
  184. :placeholder="$t('base.common.placeholderI')+$t('deliver.orderNumber')"
  185. @focus="onActualNumberFocus">
  186. </u-input>
  187. </p>
  188. </view>
  189. <view class="row">
  190. <p class="cell">
  191. <text class="label">{{ $t('deliver.tonBales') }}</text>
  192. <u-input v-model="orderInfo.tonBales" border="none" type='digit'
  193. inputAlign="right"
  194. :placeholder="$t('base.common.placeholderI')+$t('deliver.tonBales')"
  195. @focus="onTonBalesFocus">
  196. </u-input>
  197. </p>
  198. </view>
  199. <p class="cell">
  200. <u--textarea class="info" v-model="orderInfo.remark" :height="50"
  201. placeholder="请输入备注"></u--textarea>
  202. </p>
  203. </template>
  204. <template v-else>
  205. <view class="row">
  206. <p class="cell">
  207. <text class="label">{{ $t('deliver.shipNumber') }}</text>
  208. <text class="info">{{ orderInfo.shipNumber || '' }}</text>
  209. </p>
  210. </view>
  211. <view class="row">
  212. <p class="cell">
  213. <text class="label">{{ $t('deliver.tonBales') }}</text>
  214. <text class="info">{{ orderInfo.tonBales || '' }}</text>
  215. </p>
  216. </view>
  217. <view class="row">
  218. <p class="cell">
  219. <text class="label">{{ $t('deliver.orderNumber') }}</text>
  220. <text class="info">{{ orderInfo.orderNumber || '' }}</text>
  221. </p>
  222. </view>
  223. <p class="cell deliver" >
  224. <text class="label">{{ $t('order.remark') }}</text>
  225. <text
  226. class="info">{{ (orderInfo.vehicleType=='102'?orderInfo.checkRemark:orderInfo.remark) || '' }}</text>
  227. </p>
  228. <p class="cell deliver">
  229. <text class="label">{{ $t('deliver.deliverRemark') }}</text>
  230. <text
  231. class="info">{{ orderInfo.loadRemark|| '' }}</text>
  232. </p>
  233. </template>
  234. </view>
  235. <template v-if="(operationType==1 || operationType==2) && isOperate==true">
  236. <template v-if="orderInfo.vehicleType=='102'">
  237. <p class="cell">
  238. <u-button type="primary" @click="$noMultipleClicks(onOrderAcceptClick)"
  239. :text="$t('order.accept')"></u-button>
  240. </p>
  241. </template>
  242. <template v-if="orderInfo.vehicleType=='101'">
  243. <p class="cell">
  244. <u-button type="primary" @click="$noMultipleClicks(onOrderDeliverClick)"
  245. :text="$t('order.deliver')"></u-button>
  246. </p>
  247. </template>
  248. </template>
  249. </view>
  250. </view>
  251. </view>
  252. <u-toast ref="loadingToast"></u-toast>
  253. </view>
  254. </template>
  255. <script>
  256. import {
  257. getOrderInfo,
  258. acceptOrder,
  259. deliverOrder
  260. } from '../../../api/order'
  261. import {
  262. isPermission
  263. } from '../../../utils/util.js'
  264. export default {
  265. data() {
  266. return {
  267. noClick: true,
  268. orderInfo: {},
  269. operationType: '', //0 查看,1,验收或发货列表里验收,2:扫码里验收或发货
  270. view: '1',
  271. rect: undefined,
  272. statusBarHeight: null,
  273. isOperate: false,
  274. }
  275. },
  276. onLoad(options) {
  277. this.operationType = options.operationType
  278. this.bindOrderInfo(options)
  279. // #ifdef APP-PLUS || MP-WEIXIN
  280. let sysInfo = uni.getSystemInfoSync(); //状态栏的高度
  281. this.statusBarHeight = sysInfo.statusBarHeight;
  282. // #endif
  283. // #ifdef MP-WEIXIN
  284. this.rect = wx.getMenuButtonBoundingClientRect();
  285. // #endif
  286. console.log(this.rect, this.statusBarHeight);
  287. },
  288. methods: {
  289. onShipNumberFocus() {
  290. if (this.orderInfo.shipNumber == 0) {
  291. this.orderInfo.shipNumber = null
  292. }
  293. },
  294. onActualNumberFocus() {
  295. if (this.orderInfo.orderNumber == 0) {
  296. this.orderInfo.orderNumber = null
  297. }
  298. },
  299. onTonBalesFocus(){
  300. if (this.orderInfo.orderNumber == 0) {
  301. this.orderInfo.tonBales = null
  302. }
  303. },
  304. onOrderAcceptClick() {
  305. this.$refs.loadingToast.show({
  306. type: "loading",
  307. message: this.$t('base.common.loading'),
  308. duration: "1000000"
  309. })
  310. let data = {
  311. orderId: this.orderInfo.id,
  312. tenantId: this.orderInfo.tenantId,
  313. remark: this.orderInfo.remark
  314. }
  315. acceptOrder(data).then(res => {
  316. this.$refs.loadingToast.hide()
  317. if (res.statusCode == 200 && res.data.code == 0) {
  318. console.log("验收成功、", this.orderInfo);
  319. uni.redirectTo({
  320. url: '/substaticpages/cargoOperator/accept/orderAcceptList?isCheck=1'
  321. })
  322. }
  323. }).catch(err => {
  324. console.log('err', err);
  325. this.$refs.loadingToast.hide()
  326. })
  327. },
  328. onOrderDeliverClick() {
  329. this.$refs.loadingToast.show({
  330. type: "loading",
  331. message: this.$t('base.common.loading'),
  332. duration: "1000000"
  333. })
  334. let data = {
  335. orderId: this.orderInfo.id,
  336. tenantId: this.orderInfo.tenantId,
  337. remark: this.orderInfo.remark,
  338. shipNumber: this.orderInfo.shipNumber,
  339. orderNumber: this.orderInfo.orderNumber,
  340. tonBales:this.orderInfo.tonBales,
  341. }
  342. deliverOrder(data).then(res => {
  343. this.$refs.loadingToast.hide()
  344. if (res.statusCode == 200 && res.data.code == 0) {
  345. uni.redirectTo({
  346. url: '/substaticpages/cargoOperator/deliver/orderDeliverList?isDeliver=1'
  347. })
  348. console.log("验收成功、", this.orderInfo);
  349. }
  350. }).catch(err => {
  351. console.log('err', err);
  352. this.$refs.loadingToast.hide()
  353. })
  354. },
  355. bindOrderInfo(data) {
  356. if (!data.tenantId) {
  357. console.log("订单业务租户信息");
  358. return;
  359. }
  360. getOrderInfo(data).then(res => {
  361. if (res.statusCode == 200) {
  362. this.orderInfo = res.data.data
  363. console.log("当前订单信息、", this.orderInfo);
  364. var permissionKey = "none";
  365. if (this.orderInfo.vehicleType == "101") {
  366. permissionKey = "app_home_enterprise_deliver";
  367. } else if (this.orderInfo.vehicleType == "102") {
  368. permissionKey = "app_home_enterprise_accept";
  369. }
  370. debugger
  371. this.isOperate = isPermission(permissionKey);
  372. console.log("当前判断的key和结果值,", permissionKey, this.isOperate);
  373. if (this.isOperate == false) {
  374. uni.showModal({
  375. showCancel: false,
  376. // title: '提示',
  377. content: this.$t("base.common.noOperatePermission"),
  378. success: function(res) {
  379. uni.navigateBack({
  380. delta: 1
  381. })
  382. }
  383. })
  384. }
  385. }
  386. })
  387. },
  388. pageBack() {
  389. uni.navigateBack({
  390. delta: 1
  391. })
  392. }
  393. }
  394. }
  395. </script>
  396. <style>
  397. /* #ifndef APP-NVUE */
  398. view {
  399. display: flex;
  400. box-sizing: border-box;
  401. flex-direction: column;
  402. }
  403. page {
  404. box-sizing: border-box;
  405. /* padding: 40rpx 40rpx 80rpx; */
  406. height: 100%;
  407. background: url('../../../subpages/static/czzn-img/order/orderInfo-bg.jpg') no-repeat;
  408. background-size: 750rpx auto;
  409. background-color: #f5f7fa;
  410. }
  411. /* #endif*/
  412. </style>
  413. <style lang="scss" scoped>
  414. @import '../../../common/css/public.scss';
  415. .deliver{
  416. .info{
  417. white-space: normal;
  418. word-wrap: break-word;
  419. max-width: 100%; /* Adjust as needed */
  420. }
  421. }
  422. </style>