orderDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. <template>
  2. <view class="orderDetail-digitalShel flex flex_column">
  3. <view class="contHead" :style="{background:state!= 'CLOSE' ? '#066cff':'#ff5500',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="#fff">
  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&&!info.billSource">
  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:'#066cff',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:'#066cff',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. export default {
  109. name: 'orderDetail-digitalShel',
  110. components: {
  111. uniIcons,
  112. carNo
  113. },
  114. data() {
  115. return {
  116. loading: false,
  117. info: null,
  118. statusText: '',
  119. statusIcon: '', // 结算状态icon
  120. statusMessage: '',
  121. partList: [], // 配件列表
  122. shelfOrderSn: null,
  123. state: ''
  124. }
  125. },
  126. onReady() {
  127. },
  128. onLoad(option) {
  129. this.shelfOrderSn = option.shelfOrderSn
  130. this.state = option.state
  131. // 更改标题栏背景色
  132. uni.setNavigationBarColor({
  133. frontColor: '#ffffff',
  134. backgroundColor: option.state!= 'CLOSE' ? '#066cff':'#ff5500',
  135. })
  136. },
  137. onShow() {
  138. this.getDetail()
  139. },
  140. computed: {
  141. totalNums(){
  142. let ret = 0
  143. this.partList.map(item => {
  144. ret += item.totalQty
  145. })
  146. return ret
  147. }
  148. },
  149. methods: {
  150. // 复制
  151. copyVin(){
  152. uni.setClipboardData({
  153. data: this.info.vin||'',
  154. })
  155. },
  156. message(title){
  157. uni.showToast({
  158. icon:'none',
  159. title: title
  160. })
  161. },
  162. // 一键取货
  163. onceQh(item,index){
  164. const _this = this
  165. uni.showModal({
  166. title: '提示',
  167. content: '确认一键取货吗?',
  168. success: (ret) => {
  169. if(ret.confirm){
  170. _this.loading = true
  171. takeGoods({sn:_this.shelfOrderSn}).then(res => {
  172. if(res.status == 200){
  173. uni.navigateBack()
  174. uni.$emit("refreshOrder")
  175. }
  176. uni.showToast({
  177. title: res.message,
  178. icon:"none"
  179. })
  180. _this.loading = false
  181. })
  182. }
  183. }
  184. })
  185. },
  186. // 打开扫描取货
  187. sanCodeRow () {
  188. uni.navigateTo({
  189. url:"/pagesA/digitalShelf/scanBarcode/scanBarcode?shelfOrderSn="+this.shelfOrderSn
  190. })
  191. },
  192. // 获取详情
  193. getDetail(){
  194. findBySnShelfOrder({sn: this.shelfOrderSn}).then(res => {
  195. console.log(res,'++++++++')
  196. if(res.status == 200){
  197. this.info = res.data
  198. this.partList = res.data.shelfOrderDetailList || []
  199. if(this.info.billState == 'WAIT'){
  200. this.statusText = '待取货'
  201. this.statusIcon = 'hourglass-half-fill'
  202. this.statusMessage = '请及时安排,以免逾期'
  203. }
  204. if(this.info.billState == 'FINISH'){
  205. this.statusText = '已取货'
  206. this.statusIcon = 'checkmark-circle'
  207. this.statusMessage = ''
  208. }
  209. if(this.info.billState == 'CLOSE'){
  210. this.statusText = '已取消'
  211. this.statusIcon = 'close-circle'
  212. this.statusMessage = ''
  213. }
  214. }
  215. })
  216. },
  217. // 删除
  218. delOrder(){
  219. cancelShelfOrder({
  220. sn: this.shelfOrderSn
  221. }).then(res => {
  222. console.log(res)
  223. if(res.status == 200){
  224. uni.navigateBack()
  225. uni.$emit("refreshOrder")
  226. }
  227. this.message(res.message)
  228. })
  229. },
  230. // 确认取消订单
  231. deleteRow () {
  232. let _this = this
  233. uni.showModal({
  234. title: '提示',
  235. content: '确认取消订单吗?',
  236. success: (ret) => {
  237. if(ret.confirm){
  238. _this.delOrder()
  239. }
  240. }
  241. })
  242. },
  243. }
  244. }
  245. </script>
  246. <style lang="less">
  247. page{
  248. height: 100%;
  249. }
  250. .orderDetail-digitalShel{
  251. height: 100%;
  252. .redText{
  253. color: #FB1E1E;
  254. }
  255. .order-body{
  256. flex-grow: 1;
  257. overflow: auto;
  258. .cpb_header{
  259. margin-top: 20rpx;
  260. background-color: #FFFFFF;
  261. padding: 30rpx 15rpx;
  262. > div{
  263. padding: 0 10rpx;
  264. &:first-child{
  265. padding-right: 10rpx;
  266. align-items: center;
  267. }
  268. > div{
  269. &:first-child{
  270. padding-right: 20rpx;
  271. flex-grow: 1;
  272. color: #818b94;
  273. font-size: 24rpx;
  274. }
  275. }
  276. }
  277. .copyText{
  278. background-color: #EBEBEB;
  279. border-radius: 100rpx;
  280. padding: 0 20rpx;
  281. color: #033692;
  282. font-size: 20rpx;
  283. display: flex;
  284. align-items: center;
  285. justify-content: center;
  286. margin-left: 20rpx;
  287. }
  288. .carTits{
  289. font-size: 32rpx;
  290. font-weight: bold;
  291. color: #222222;
  292. line-height: normal;
  293. margin-bottom: 10rpx;
  294. flex-grow: 1;
  295. }
  296. .qhbtns{
  297. display: flex;
  298. align-items: center;
  299. justify-content: center;
  300. font-size: 20rpx;
  301. color: #0485F6;
  302. border:2rpx solid #0485F6;
  303. border-radius: 50rpx;
  304. background: rgba(88, 177, 255, 0.2);
  305. width: 200rpx;
  306. height: 36rpx;
  307. margin-left: 10rpx;
  308. }
  309. }
  310. .partList{
  311. margin-top: 20rpx;
  312. }
  313. }
  314. .contHead {
  315. .statusH{
  316. > view{
  317. padding: 10upx 12%;
  318. font-size: 34upx;
  319. }
  320. .status-row{
  321. font-size: 42upx;
  322. text{
  323. margin-left: 10rpx;
  324. }
  325. }
  326. .messageText{
  327. font-size: 30upx;
  328. text-align: center;
  329. text{
  330. color: #ffaa00;
  331. }
  332. padding: 10rpx 0;
  333. }
  334. }
  335. .orderTj{
  336. padding: 0 20rpx 20rpx;
  337. background-color: #fff;
  338. > view{
  339. text-align: center;
  340. border-right: 2rpx solid #eee;
  341. width: 50%;
  342. color: #666E75;
  343. .redText{
  344. color: #FB1E1E;
  345. }
  346. &:last-child{
  347. border: 0;
  348. }
  349. > view{
  350. color: #666E75;
  351. &:first-child{
  352. font-size: 56rpx;
  353. }
  354. }
  355. }
  356. border-radius: 20rpx 20rpx 0 0;
  357. }
  358. }
  359. .info{
  360. background-color: #FFFFFF;
  361. padding: 10rpx 30upx;
  362. font-size: 32rpx;
  363. margin-bottom: 20rpx;
  364. .infoList{
  365. display: flex;
  366. justify-content: space-between;
  367. align-items: center;
  368. padding: 20rpx 0;
  369. border-bottom: 2rpx solid #f2f2f2;
  370. &:last-child{
  371. border: none;
  372. }
  373. .title{
  374. font-weight: bold;
  375. }
  376. > text{
  377. &:first-child{
  378. color: #666E75;
  379. }
  380. }
  381. }
  382. .item-list{
  383. border-bottom: 2rpx solid #f2f2f2;
  384. &:last-child{
  385. border: none;
  386. }
  387. > view{
  388. padding: 20rpx 0;
  389. &:first-child{
  390. margin-right: 20rpx;
  391. margin-top: 18rpx;
  392. }
  393. &:last-child{
  394. flex-grow: 1;
  395. }
  396. }
  397. .item-name{
  398. word-wrap: break-word;
  399. font-size: 32rpx;
  400. color: #333;
  401. font-weight: bold;
  402. margin-top: 10rpx;
  403. }
  404. .item-nums{
  405. padding: 10rpx 0;
  406. text{
  407. font-size: 32rpx;
  408. color: #222222;
  409. }
  410. }
  411. .item-head{
  412. display: flex;
  413. align-items: center;
  414. justify-content: space-between;
  415. color: #666;
  416. > view{
  417. &:first-child{
  418. font-size: 28rpx;
  419. text{
  420. margin-right: 30rpx;
  421. }
  422. }
  423. }
  424. .item-no{
  425. font-size: 28rpx;
  426. background: rgba(3, 54, 146, 0.15);
  427. color: #033692;
  428. border-radius: 100rpx;
  429. padding: 2rpx 30rpx;
  430. margin-right: 20rpx;
  431. display: block;
  432. }
  433. }
  434. }
  435. }
  436. .footer{
  437. padding: 20upx 60upx;
  438. background: #FFFFFF;
  439. button{
  440. &:after{
  441. border: 0;
  442. }
  443. color: #585858;
  444. font-size: 32rpx;
  445. margin: 0 20rpx;
  446. }
  447. }
  448. }
  449. </style>