orderDetail.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <template>
  2. <view class="orderDetail-digitalShel flex flex_column">
  3. <view class="contHead">
  4. <view class="statusH">
  5. <view class="flex flex_column align_center">
  6. <view class="status-row">
  7. <u-icon :name="statusIcon" size="42" color="#333">
  8. </u-icon>
  9. <text>{{statusText}}</text>
  10. </view>
  11. <view class="messageText">{{statusMessage}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="order-body">
  16. <!-- 头部车辆信息 -->
  17. <div class="flex align-center cpb_header" v-if="info">
  18. <div>
  19. <u-image :src="info.vehicleLogo" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
  20. </div>
  21. <div class="flex flex_column justify_center align_start">
  22. <view class="carModel flex align-center" v-if="info.vehicleNumber" >
  23. <view><carNo color="#0055ff" :val="info.vehicleNumber"></carNo></view>
  24. <text style="margin-left: 20rpx;" v-if="info.vehicleModel">{{info.vehicleModel.split(' ')[0]}}</text>
  25. </view>
  26. <view class="carModel flex align-center" v-if="!info.vehicleNumber" >
  27. <text>{{info.vehicleModel}}</text>
  28. </view>
  29. <div class="flex align-center">
  30. <div>VIN码:{{info.vin||'暂无'}}</div>
  31. <div v-if="info.vin" class="copyText" @click="copyVin"><span>复制</span></div>
  32. </div>
  33. </div>
  34. </div>
  35. <view class="info partList" v-if="partList.length">
  36. <view class="infoList">
  37. <view class="title">配件列表</view>
  38. <view>
  39. {{partList.length}}款,共<text class="redText">{{totalNums}}</text>件
  40. </view>
  41. </view>
  42. <view v-for="item in partList" :key="item.productSn" class="flex align-center item-list">
  43. <view>
  44. <u-image :src="item.images" border-radius="16" width="130" height="130" bg-color="#EBEBEB" ></u-image>
  45. </view>
  46. <view>
  47. <view class="item-name">
  48. <text>{{item.productName}}</text>
  49. </view>
  50. <view class="item-head">
  51. <text>{{item.productCode}}</text>
  52. <view>
  53. 数量:<text class="redText">{{item.qty}}</text>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="info" v-if="info">
  60. <view class="infoList">
  61. <view class="title">单据信息</view>
  62. <view class="statu"></view>
  63. </view>
  64. <view class="infoList dju">
  65. <text>订单编号</text>
  66. <text>{{info.tempNo||'--'}}</text>
  67. </view>
  68. <view class="infoList">
  69. <text>下单时间</text>
  70. <text>{{info.tempDate||'--'}}</text>
  71. </view>
  72. <view class="infoList">
  73. <text>下单人员</text>
  74. <text>{{info.personName || '--'}}</text>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. import carNo from '@/components/carNo.vue'
  82. import uniIcons from "@/components/uni-icons/uni-icons.vue"
  83. import moment from 'moment'
  84. import { getShelfTempBillDetail } from '@/api/shelf.js'
  85. import clipboard from "@/js_sdk/dc-clipboard/clipboard.js"
  86. export default {
  87. name: 'orderDetail-digitalShel',
  88. components: {
  89. uniIcons,
  90. carNo
  91. },
  92. data() {
  93. return {
  94. info: null,
  95. statusText: '',
  96. statusIcon: '', // 结算状态icon
  97. statusMessage: '',
  98. partList: [], // 配件列表
  99. shelfOrderSn: null
  100. }
  101. },
  102. onReady() {
  103. },
  104. onLoad(option) {
  105. this.shelfOrderSn = option.orderSn
  106. },
  107. onShow() {
  108. this.getDetail()
  109. },
  110. computed: {
  111. totalNums(){
  112. let ret = 0
  113. this.partList.map(item => {
  114. ret += item.qty
  115. })
  116. return ret
  117. }
  118. },
  119. methods: {
  120. // 复制
  121. copyVin(){
  122. clipboard.setText(this.info.vin);
  123. uni.showToast({
  124. icon: 'none',
  125. title: 'vin码已复制成功'
  126. })
  127. },
  128. message(title){
  129. uni.showToast({
  130. icon:'none',
  131. title: title
  132. })
  133. },
  134. // 打开扫描取货
  135. sanCodeRow () {
  136. uni.navigateTo({
  137. url:"/pages/digitalShelf/scanBarcode/scanBarcode?shelfOrderSn="+this.shelfOrderSn
  138. })
  139. },
  140. // 获取详情
  141. getDetail(){
  142. getShelfTempBillDetail({sn: this.shelfOrderSn}).then(res => {
  143. console.log(res,'++++++++')
  144. if(res.status == 200){
  145. this.info = res.data
  146. this.partList = res.data.detailList || []
  147. if(this.info.billState == 'WAIT'){
  148. this.statusText = '待取货'
  149. this.statusIcon = 'hourglass-half-fill'
  150. this.statusMessage = '请及时安排,以免逾期'
  151. }
  152. if(this.info.billState == 'FINISH'){
  153. this.statusText = '已取货'
  154. this.statusIcon = 'checkmark-circle'
  155. this.statusMessage = ''
  156. }
  157. if(this.info.billState == 'CLOSE'){
  158. this.statusText = '已取消'
  159. this.statusIcon = 'close-circle'
  160. this.statusMessage = ''
  161. }
  162. }
  163. })
  164. },
  165. }
  166. }
  167. </script>
  168. <style lang="less">
  169. page{
  170. height: 100%;
  171. }
  172. .orderDetail-digitalShel{
  173. height: 100%;
  174. .redText{
  175. color: #FB1E1E;
  176. }
  177. .order-body{
  178. flex-grow: 1;
  179. overflow: auto;
  180. .cpb_header{
  181. margin-top: 20rpx;
  182. background-color: #FFFFFF;
  183. padding: 30rpx 15rpx;
  184. > div{
  185. padding: 0 10rpx;
  186. &:first-child{
  187. padding-right: 10rpx;
  188. align-items: center;
  189. }
  190. > div{
  191. &:first-child{
  192. padding-right: 20rpx;
  193. flex-grow: 1;
  194. color: #818b94;
  195. font-size: 24rpx;
  196. }
  197. }
  198. }
  199. .copyText{
  200. background-color: #EBEBEB;
  201. border-radius: 100rpx;
  202. padding: 0 20rpx;
  203. color: #033692;
  204. font-size: 20rpx;
  205. display: flex;
  206. align-items: center;
  207. justify-content: center;
  208. margin-left: 20rpx;
  209. }
  210. .carTits{
  211. font-size: 32rpx;
  212. font-weight: bold;
  213. color: #222222;
  214. line-height: normal;
  215. margin-bottom: 10rpx;
  216. flex-grow: 1;
  217. }
  218. .qhbtns{
  219. display: flex;
  220. align-items: center;
  221. justify-content: center;
  222. font-size: 20rpx;
  223. color: #0485F6;
  224. border:2rpx solid #0485F6;
  225. border-radius: 50rpx;
  226. background: rgba(88, 177, 255, 0.2);
  227. width: 200rpx;
  228. height: 36rpx;
  229. margin-left: 10rpx;
  230. }
  231. }
  232. .partList{
  233. margin-top: 20rpx;
  234. }
  235. }
  236. .contHead {
  237. background-color: white;
  238. .statusH{
  239. > view{
  240. padding: 10upx 12%;
  241. font-size: 34upx;
  242. }
  243. .status-row{
  244. font-size: 42upx;
  245. text{
  246. margin-left: 10rpx;
  247. }
  248. }
  249. .messageText{
  250. font-size: 30upx;
  251. text-align: center;
  252. text{
  253. color: #ffaa00;
  254. }
  255. padding: 10rpx 0;
  256. }
  257. }
  258. .orderTj{
  259. padding: 0 20rpx 20rpx;
  260. background-color: #fff;
  261. > view{
  262. text-align: center;
  263. border-right: 2rpx solid #eee;
  264. width: 50%;
  265. color: #666E75;
  266. .redText{
  267. color: #FB1E1E;
  268. }
  269. &:last-child{
  270. border: 0;
  271. }
  272. > view{
  273. color: #666E75;
  274. &:first-child{
  275. font-size: 56rpx;
  276. }
  277. }
  278. }
  279. border-radius: 20rpx 20rpx 0 0;
  280. }
  281. }
  282. .info{
  283. background-color: #FFFFFF;
  284. padding: 10rpx 30upx;
  285. font-size: 32rpx;
  286. margin-bottom: 20rpx;
  287. .infoList{
  288. display: flex;
  289. justify-content: space-between;
  290. align-items: center;
  291. padding: 20rpx 0;
  292. border-bottom: 2rpx solid #f2f2f2;
  293. &:last-child{
  294. border: none;
  295. }
  296. .title{
  297. font-weight: bold;
  298. }
  299. > text{
  300. &:first-child{
  301. color: #666E75;
  302. }
  303. }
  304. }
  305. .item-list{
  306. border-bottom: 2rpx solid #f2f2f2;
  307. &:last-child{
  308. border: none;
  309. }
  310. > view{
  311. padding: 20rpx 0;
  312. &:first-child{
  313. margin-right: 20rpx;
  314. margin-top: 18rpx;
  315. }
  316. &:last-child{
  317. flex-grow: 1;
  318. }
  319. }
  320. .item-name{
  321. word-wrap: break-word;
  322. font-size: 32rpx;
  323. color: #333;
  324. font-weight: bold;
  325. margin-top: 10rpx;
  326. }
  327. .item-nums{
  328. padding: 10rpx 0;
  329. text{
  330. font-size: 32rpx;
  331. color: #222222;
  332. }
  333. }
  334. .item-head{
  335. display: flex;
  336. align-items: center;
  337. justify-content: space-between;
  338. color: #666;
  339. > view{
  340. &:first-child{
  341. font-size: 28rpx;
  342. text{
  343. margin-right: 30rpx;
  344. }
  345. }
  346. }
  347. .item-no{
  348. font-size: 28rpx;
  349. background: rgba(3, 54, 146, 0.15);
  350. color: #033692;
  351. border-radius: 100rpx;
  352. padding: 2rpx 30rpx;
  353. margin-right: 20rpx;
  354. display: block;
  355. }
  356. }
  357. }
  358. }
  359. .footer{
  360. padding: 20upx 60upx;
  361. background: #FFFFFF;
  362. button{
  363. &:after{
  364. border: 0;
  365. }
  366. color: #585858;
  367. font-size: 32rpx;
  368. margin: 0 20rpx;
  369. width: 320rpx;
  370. }
  371. }
  372. }
  373. </style>