choosePartResult.vue 12 KB

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