orderDetail.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <template>
  2. <view class="orderDetail-digitalShel flex flex_column">
  3. <view class="contHead" :style="{background:state== 0?'#1283d4':'#06ab50',color:'#fff'}">
  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="#ffffff">
  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. export default {
  86. name: 'orderDetail-digitalShel',
  87. components: {
  88. uniIcons,
  89. carNo
  90. },
  91. data() {
  92. return {
  93. info: null,
  94. statusText: '',
  95. statusIcon: '', // 结算状态icon
  96. statusMessage: '',
  97. partList: [], // 配件列表
  98. shelfOrderSn: null,
  99. state: ''
  100. }
  101. },
  102. onReady() {
  103. },
  104. onLoad(option) {
  105. this.shelfOrderSn = option.orderSn
  106. this.state = option.state
  107. // 更改标题栏背景色
  108. uni.setNavigationBarColor({
  109. frontColor: '#ffffff',
  110. backgroundColor: option.state== 0 ? '#1283d4':'#06ab50',
  111. })
  112. },
  113. onShow() {
  114. this.getDetail()
  115. },
  116. computed: {
  117. totalNums(){
  118. let ret = 0
  119. this.partList.map(item => {
  120. ret += item.qty
  121. })
  122. return ret
  123. }
  124. },
  125. methods: {
  126. // 复制
  127. copyVin(){
  128. uni.setClipboardData({
  129. data: this.info.vin||'',
  130. })
  131. },
  132. message(title){
  133. uni.showToast({
  134. icon:'none',
  135. title: title
  136. })
  137. },
  138. // 打开扫描拿货
  139. sanCodeRow () {
  140. uni.navigateTo({
  141. url:"/pagesA/digitalShelf/scanBarcode/scanBarcode?shelfOrderSn="+this.shelfOrderSn
  142. })
  143. },
  144. // 获取详情
  145. getDetail(){
  146. getShelfTempBillDetail({sn: this.shelfOrderSn}).then(res => {
  147. console.log(res,'++++++++')
  148. if(res.status == 200){
  149. this.info = res.data
  150. this.partList = res.data.detailList || []
  151. if(this.info.billState == 'WAIT_AUDIT'){
  152. this.statusText = '待审核'
  153. this.statusIcon = 'hourglass-half-fill'
  154. this.statusMessage = ''
  155. }
  156. if(this.info.billState == 'AUDIT_REJECT'){
  157. this.statusText = '审核不通过'
  158. this.statusIcon = 'close-circle'
  159. this.statusMessage = ''
  160. }
  161. if(this.info.billState == 'WAIT_OUT_WAREHOUSE'){
  162. this.statusText = '待收货'
  163. this.statusIcon = 'hourglass-half-fill'
  164. this.statusMessage = ''
  165. }
  166. if(this.info.billState == 'FINISH'){
  167. this.statusText = '已完结'
  168. this.statusIcon = 'checkmark-circle'
  169. this.statusMessage = ''
  170. }
  171. }
  172. })
  173. },
  174. }
  175. }
  176. </script>
  177. <style lang="less">
  178. page{
  179. height: 100%;
  180. }
  181. .orderDetail-digitalShel{
  182. height: 100%;
  183. .redText{
  184. color: #FB1E1E;
  185. }
  186. .order-body{
  187. flex-grow: 1;
  188. overflow: auto;
  189. .cpb_header{
  190. margin-top: 20rpx;
  191. background-color: #FFFFFF;
  192. padding: 30rpx 15rpx;
  193. > div{
  194. padding: 0 10rpx;
  195. &:first-child{
  196. padding-right: 10rpx;
  197. align-items: center;
  198. }
  199. > div{
  200. &:first-child{
  201. padding-right: 20rpx;
  202. flex-grow: 1;
  203. color: #818b94;
  204. font-size: 24rpx;
  205. }
  206. }
  207. }
  208. .copyText{
  209. background-color: #EBEBEB;
  210. border-radius: 100rpx;
  211. padding: 0 20rpx;
  212. color: #033692;
  213. font-size: 20rpx;
  214. display: flex;
  215. align-items: center;
  216. justify-content: center;
  217. margin-left: 20rpx;
  218. }
  219. .carTits{
  220. font-size: 32rpx;
  221. font-weight: bold;
  222. color: #222222;
  223. line-height: normal;
  224. margin-bottom: 10rpx;
  225. flex-grow: 1;
  226. }
  227. .qhbtns{
  228. display: flex;
  229. align-items: center;
  230. justify-content: center;
  231. font-size: 20rpx;
  232. color: #0485F6;
  233. border:2rpx solid #0485F6;
  234. border-radius: 50rpx;
  235. background: rgba(88, 177, 255, 0.2);
  236. width: 200rpx;
  237. height: 36rpx;
  238. margin-left: 10rpx;
  239. }
  240. }
  241. .partList{
  242. margin-top: 20rpx;
  243. }
  244. }
  245. .contHead {
  246. .statusH{
  247. > view{
  248. padding: 10upx 12%;
  249. font-size: 34upx;
  250. }
  251. .status-row{
  252. font-size: 42upx;
  253. text{
  254. margin-left: 10rpx;
  255. }
  256. }
  257. .messageText{
  258. font-size: 30upx;
  259. text-align: center;
  260. text{
  261. color: #ffaa00;
  262. }
  263. padding: 10rpx 0;
  264. }
  265. }
  266. .orderTj{
  267. padding: 0 20rpx 20rpx;
  268. background-color: #fff;
  269. > view{
  270. text-align: center;
  271. border-right: 2rpx solid #eee;
  272. width: 50%;
  273. color: #666E75;
  274. .redText{
  275. color: #FB1E1E;
  276. }
  277. &:last-child{
  278. border: 0;
  279. }
  280. > view{
  281. color: #666E75;
  282. &:first-child{
  283. font-size: 56rpx;
  284. }
  285. }
  286. }
  287. border-radius: 20rpx 20rpx 0 0;
  288. }
  289. }
  290. .info{
  291. background-color: #FFFFFF;
  292. padding: 10rpx 30upx;
  293. font-size: 32rpx;
  294. margin-bottom: 20rpx;
  295. .infoList{
  296. display: flex;
  297. justify-content: space-between;
  298. align-items: center;
  299. padding: 20rpx 0;
  300. border-bottom: 2rpx solid #f2f2f2;
  301. &:last-child{
  302. border: none;
  303. }
  304. .title{
  305. font-weight: bold;
  306. }
  307. > text{
  308. &:first-child{
  309. color: #666E75;
  310. }
  311. }
  312. }
  313. .item-list{
  314. border-bottom: 2rpx solid #f2f2f2;
  315. &:last-child{
  316. border: none;
  317. }
  318. > view{
  319. padding: 20rpx 0;
  320. &:first-child{
  321. margin-right: 20rpx;
  322. margin-top: 18rpx;
  323. }
  324. &:last-child{
  325. flex-grow: 1;
  326. }
  327. }
  328. .item-name{
  329. word-wrap: break-word;
  330. font-size: 32rpx;
  331. color: #333;
  332. font-weight: bold;
  333. margin-top: 10rpx;
  334. }
  335. .item-nums{
  336. padding: 10rpx 0;
  337. text{
  338. font-size: 32rpx;
  339. color: #222222;
  340. }
  341. }
  342. .item-head{
  343. display: flex;
  344. align-items: center;
  345. justify-content: space-between;
  346. color: #666;
  347. > view{
  348. &:first-child{
  349. font-size: 28rpx;
  350. text{
  351. margin-right: 30rpx;
  352. }
  353. }
  354. }
  355. .item-no{
  356. font-size: 28rpx;
  357. background: rgba(3, 54, 146, 0.15);
  358. color: #033692;
  359. border-radius: 100rpx;
  360. padding: 2rpx 30rpx;
  361. margin-right: 20rpx;
  362. display: block;
  363. }
  364. }
  365. }
  366. }
  367. .footer{
  368. padding: 20upx 60upx;
  369. background: #FFFFFF;
  370. button{
  371. &:after{
  372. border: 0;
  373. }
  374. color: #585858;
  375. font-size: 32rpx;
  376. margin: 0 20rpx;
  377. width: 320rpx;
  378. }
  379. }
  380. }
  381. </style>