choosePartResult.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <template>
  2. <view class="choosePartResult flex flex_column">
  3. <view class="contHead" v-if="state" :style="{background:state==1?'#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" v-html="info&&info.shelfOrder&&info.shelfOrder.remindMessage||''"></view>
  12. <view class="messageText" v-if="redPacketData&&redPacketData.totalRewardAmount&&!showMask">
  13. 您已获得<text>{{redPacketData.totalRewardAmount}}</text>元红包奖励,可在“更多-红包奖励”中查看
  14. </view>
  15. <!-- <view class="button-group"> -->
  16. <!-- <button :hover-stop-propagation="true" @click="toScan" v-if="state == 1&&partList.length" class="back" size="mini">扫码拿货</button> -->
  17. <!-- <button :hover-stop-propagation="true" :loading="loading" @click="onceQh" v-if="state == 1&&partList.length" class="action" size="mini">一键拿货</button> -->
  18. <!-- <button :hover-stop-propagation="true" @click="toSettle" v-if="state == 0" class="actionFail" size="mini">去结算</button> -->
  19. <!-- </view> -->
  20. </view>
  21. </view>
  22. </view>
  23. <view class="order-body">
  24. <view class="info partList" v-if="state == 1">
  25. <u-tabs :list="[{name:'货架订单',value:0},{name:'急送订单',value:1}]" :is-scroll="false" :current="current" @change="changeTab"></u-tabs>
  26. <view v-if="current==0">
  27. <view class="infoList" v-if="partList.length">
  28. <view class="title"><u-icon name="info-circle"></u-icon> 配件已出库,请按照指定位置取用</view>
  29. <view>
  30. {{partList.length}}款,共<text class="redText">{{totalNums}}</text>件
  31. </view>
  32. </view>
  33. <view v-else>
  34. <u-empty :src="`/static/nodata.png`" icon-size="180" text="暂无货架订单" mode="list" :margin-top="30"></u-empty>
  35. </view>
  36. <view v-for="item in partList" :key="item.id" class="flex align-center item-list">
  37. <view>
  38. <u-image :src="item.images+'?x-oss-process=image/resize,m_fixed,h_120,w_120,color_ffffff'" border-radius="16" width="130" height="130" bg-color="#EBEBEB" ></u-image>
  39. </view>
  40. <view>
  41. <view class="item-name">
  42. <text>{{item.productName}}</text>
  43. </view>
  44. <view class="item-nums">
  45. X <text>{{item.totalQty}}{{item.unit||''}}</text>
  46. </view>
  47. <view class="item-head">
  48. <text>{{item.productCode}}</text>
  49. <text class="item-no">{{item.shelfPlaceCode}}</text>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view v-if="current==1">
  55. <view class="infoList" v-if="tempPartList.length">
  56. <view class="title"><u-icon name="info-circle"></u-icon> 请耐心等待汽配经销商进行配送</view>
  57. <view>
  58. {{tempPartList.length}}款,共<text class="redText">{{totalTempNums}}</text>件
  59. </view>
  60. </view>
  61. <view v-else>
  62. <u-empty :src="`/static/nodata.png`" icon-size="180" text="暂无急送订单" mode="list" :margin-top="30"></u-empty>
  63. </view>
  64. <view v-for="item in tempPartList" :key="item.id" class="flex align-center item-list">
  65. <view>
  66. <u-image :src="item.images+'?x-oss-process=image/resize,m_fixed,h_120,w_120,color_ffffff'" border-radius="16" width="130" height="130" bg-color="#EBEBEB" ></u-image>
  67. </view>
  68. <view>
  69. <view class="item-name">
  70. <text>{{item.productName}}</text>
  71. </view>
  72. <view class="item-nums">
  73. X <text>{{item.qty}}{{item.unit||''}}</text>
  74. </view>
  75. <view class="item-head">
  76. <text>{{item.productCode}}</text>
  77. <span class="item-no" v-if="item.billState == 'WAIT_AUDIT'">待审核</span>
  78. <span class="item-no" v-if="item.billState == 'AUDIT_REJECT'">审核不通过</span>
  79. <span class="item-no" v-if="item.billState == 'WAIT_OUT_WAREHOUSE'">待收货</span>
  80. <span class="item-no" v-if="item.billState == 'FINISH'">已完结</span>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="info" v-if="info && info.shelfOrder && state == 1 && current == 0">
  87. <view class="infoList">
  88. <view class="title">单据信息</view>
  89. <view class="statu"></view>
  90. </view>
  91. <view class="infoList">
  92. <text>订单编号</text>
  93. <text>{{info.shelfOrder.shelfOrderNo||'--'}}</text>
  94. </view>
  95. <view class="infoList">
  96. <text>下单时间</text>
  97. <text>{{info.shelfOrder.createDate||'--'}}</text>
  98. </view>
  99. <view class="infoList">
  100. <text>下单人员</text>
  101. <text>{{info.shelfOrder.orderPersonName || '--'}}</text>
  102. </view>
  103. </view>
  104. <view class="info" v-if="info && info.shelfTempBill && state == 1 && current == 1">
  105. <view class="infoList">
  106. <view class="title">单据信息</view>
  107. <view class="statu"></view>
  108. </view>
  109. <view class="infoList">
  110. <text>订单编号</text>
  111. <text>{{info.shelfTempBill.tempNo||'--'}}</text>
  112. </view>
  113. <view class="infoList">
  114. <text>下单时间</text>
  115. <text>{{info.shelfTempBill.tempDate||'--'}}</text>
  116. </view>
  117. <view class="infoList">
  118. <text>下单人员</text>
  119. <text>{{info.shelfTempBill.personName || '--'}}</text>
  120. </view>
  121. </view>
  122. </view>
  123. <!-- 红包 -->
  124. <u-mask :show="showMask">
  125. <view class="imageWarp flex flex_column justify_center align_center" style="width:100%;height:100vh;">
  126. <view style="position: relative;">
  127. <u-image src="/pagesA/static/hb.png" width="700" height="657" @click="showMask=false"></u-image>
  128. <view style="font-size: 60rpx;color:#fff;position: absolute;top:50%;text-align: center;width: 100%;">
  129. {{redPacketData&&redPacketData.totalRewardAmount||'0.00'}} <text style="font-size: 26rpx;margin-left: 10rpx;">元</text>
  130. </view>
  131. </view>
  132. </view>
  133. </u-mask>
  134. </view>
  135. </template>
  136. <script>
  137. import uniIcons from "@/components/uni-icons/uni-icons.vue"
  138. import moment from 'moment'
  139. import { findBySnShelfOrder, takeGoods, rewardOrderFindBySn } from '@/api/shelf'
  140. export default {
  141. name: 'choosePartResult',
  142. components: {
  143. uniIcons,
  144. },
  145. data() {
  146. return {
  147. loading: false,
  148. info: null,
  149. statusText: '',
  150. statusIcon: '', // 结算状态icon
  151. partList: [], // 配件列表
  152. tempPartList: [],
  153. state: null,
  154. current: 0,
  155. shelfOrderSn: '',
  156. showMask: false,
  157. redPacketData: null
  158. }
  159. },
  160. onLoad(option) {
  161. this.info = option.data?JSON.parse(decodeURIComponent(option.data)):null
  162. this.state = option.state
  163. console.log(this.info,'-------------')
  164. if(option.state==1){
  165. this.statusText = '拿货成功';
  166. this.statusIcon = 'checkmark-circle';
  167. // 获取配件列表
  168. this.partList = this.info.shelfOrder ? this.info.shelfOrder.shelfOrderDetailList : [];
  169. this.tempPartList = this.info.shelfTempBill ? this.info.shelfTempBill.detailList : [];
  170. this.shelfOrderSn = this.info.shelfOrder ? this.info.shelfOrder.shelfOrderSn : '';
  171. this.current = this.partList.length ? 0 : 1;
  172. // 是否有红包活动奖励
  173. this.getOrderRedReward()
  174. }else{
  175. this.statusText = '拿货失败'
  176. this.statusIcon = 'close-circle'
  177. }
  178. // 更改标题栏背景色
  179. uni.setNavigationBarColor({
  180. frontColor: '#ffffff',
  181. backgroundColor: option.state==1 ? '#066cff':'#ff5500',
  182. })
  183. },
  184. computed: {
  185. totalNums(){
  186. let ret = 0
  187. if(this.partList){
  188. this.partList.map(item => {
  189. ret += item.totalQty
  190. })
  191. }
  192. return ret
  193. },
  194. totalTempNums(){
  195. let ret = 0
  196. if(this.tempPartList){
  197. this.tempPartList.map(item => {
  198. ret += item.qty
  199. })
  200. }
  201. return ret
  202. }
  203. },
  204. methods: {
  205. back(){
  206. uni.navigateBack()
  207. },
  208. changeTab(index){
  209. this.current = index
  210. },
  211. // 扫码拿货
  212. toScan(){
  213. uni.redirectTo({
  214. url:"/pagesA/digitalShelf/scanBarcode/scanBarcode?shelfOrderSn="+this.shelfOrderSn
  215. })
  216. },
  217. // 盘点是否有红包奖励
  218. getOrderRedReward(){
  219. rewardOrderFindBySn({orderSn:this.shelfOrderSn}).then(res => {
  220. if(res.status == 200 && res.data){
  221. this.showMask = true
  222. this.redPacketData = res.data
  223. }
  224. })
  225. },
  226. // 一键拿货
  227. onceQh(item,index){
  228. const _this = this
  229. uni.showModal({
  230. title: '提示',
  231. content: '确认一键拿货吗?',
  232. success: (ret) => {
  233. if(ret.confirm){
  234. _this.loading = true
  235. takeGoods({sn:_this.shelfOrderSn}).then(res => {
  236. if(res.status == 200){
  237. uni.navigateBack()
  238. uni.$emit("refreshOrder")
  239. }
  240. uni.showToast({
  241. title: res.message,
  242. icon:"none"
  243. })
  244. _this.loading = false
  245. })
  246. }
  247. }
  248. })
  249. },
  250. // 去结算
  251. toSettle(){
  252. uni.redirectTo({
  253. url:"/pagesA/digitalShelf/settlementManage/settlementManage"
  254. })
  255. },
  256. message(title){
  257. uni.showToast({
  258. icon:'none',
  259. title: title
  260. })
  261. },
  262. }
  263. }
  264. </script>
  265. <style lang="less">
  266. page{
  267. height: 100%;
  268. }
  269. .choosePartResult{
  270. height: 100%;
  271. .order-body{
  272. flex-grow: 1;
  273. overflow: auto;
  274. }
  275. .contHead {
  276. background-color: white;
  277. margin-top: -20rpx;
  278. .statusH{
  279. > view{
  280. padding: 10upx 12%;
  281. font-size: 34upx;
  282. }
  283. .status-row{
  284. font-size: 42upx;
  285. margin-top: 20rpx;
  286. text{
  287. margin-left: 10rpx;
  288. }
  289. }
  290. .messageText{
  291. font-size: 30upx;
  292. text-align: center;
  293. color: #ebef09;
  294. text{
  295. color: #ff9900;
  296. font-size: 38upx;
  297. }
  298. padding: 10rpx 0 10rpx;
  299. }
  300. .button-group{
  301. padding: 20rpx 0;
  302. button{
  303. background: none;
  304. margin: 0 30rpx;
  305. border-radius: 100rpx;
  306. font-size: 32rpx;
  307. }
  308. .back{
  309. background: #fff;
  310. color: #0485F6;
  311. }
  312. .action{
  313. background: #fff;
  314. color: #0485F6;
  315. }
  316. .actionFail{
  317. background: #fff;
  318. color: #FF5728;
  319. }
  320. }
  321. }
  322. }
  323. .info{
  324. background-color: #FFFFFF;
  325. padding: 10rpx 30upx;
  326. font-size: 32rpx;
  327. margin-bottom: 20rpx;
  328. .infoList{
  329. display: flex;
  330. align-items: center;
  331. justify-content: space-between;
  332. padding:20rpx 0;
  333. border-bottom: 2rpx solid #f2f2f2;
  334. .title{
  335. color: #bf660b;
  336. font-size: 28rpx;
  337. }
  338. > text{
  339. &:first-child{
  340. color: #666E75;
  341. }
  342. &:last-child{
  343. width: 80%;
  344. text-align: right;
  345. }
  346. }
  347. .redText{
  348. color: red;
  349. }
  350. }
  351. .item-list{
  352. border-bottom: 2rpx solid #f2f2f2;
  353. &:last-child{
  354. border: none;
  355. }
  356. > view{
  357. padding: 20rpx 0;
  358. &:first-child{
  359. margin-right: 20rpx;
  360. margin-top: 18rpx;
  361. }
  362. &:last-child{
  363. flex-grow: 1;
  364. }
  365. }
  366. .item-name{
  367. word-wrap: break-word;
  368. font-size: 32rpx;
  369. color: #333;
  370. font-weight: bold;
  371. margin-top: 10rpx;
  372. }
  373. .item-nums{
  374. padding: 10rpx 0;
  375. color: #999;
  376. font-size: 24rpx;
  377. text{
  378. font-size: 32rpx;
  379. color: #666E75;
  380. margin-left: 10rpx;
  381. }
  382. }
  383. .item-head{
  384. display: flex;
  385. align-items: center;
  386. justify-content: space-between;
  387. font-size: 32rpx;
  388. color: #666;
  389. .item-no{
  390. background: rgba(3, 54, 146, 0.15);
  391. color: #033692;
  392. border-radius: 100rpx;
  393. padding: 2rpx 30rpx;
  394. margin-right: 20rpx;
  395. display: block;
  396. }
  397. }
  398. }
  399. }
  400. }
  401. </style>