orderDetail.vue 11 KB

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