orderDetail.vue 11 KB

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