orderDetail.vue 10 KB

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