choosePartResult.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <template>
  2. <view class="choosePartResult flex flex_column">
  3. <view class="contHead" :style="{background:state==1?'#1283d4':'#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.remindMessage||''"></view>
  12. <view class="button-group">
  13. <button :hover-stop-propagation="true" @click="toScan" v-if="state == 1&&partList.length" class="back" size="mini">扫码取货</button>
  14. <button :hover-stop-propagation="true" @click="onceQh" v-if="state == 1&&partList.length" class="action" size="mini">一键取货</button>
  15. <button :hover-stop-propagation="true" @click="toSettle" v-if="state == 0" class="actionFail" size="mini">去结算</button>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="order-body">
  21. <view class="info partList" v-if="state == 1">
  22. <u-tabs :list="[{name:'货架订单',value:0},{name:'临配订单',value:1}]" :is-scroll="false" :current="current" @change="changeTab"></u-tabs>
  23. <view v-if="current==0">
  24. <view class="infoList" v-if="partList.length">
  25. <view class="title">请在货架上按照指定位置拿取配件</view>
  26. <view>
  27. {{partList.length}}款,共<text class="redText">{{totalNums}}</text>件
  28. </view>
  29. </view>
  30. <view v-else>
  31. <u-empty :src="`/static/nodata.png`" icon-size="180" text="暂无货架订单" mode="list" :margin-top="30"></u-empty>
  32. </view>
  33. <view v-for="item in partList" :key="item.id" class="flex align-center item-list">
  34. <view>
  35. <u-image border-radius="16" width="130" height="130" bg-color="#EBEBEB" ></u-image>
  36. </view>
  37. <view>
  38. <view class="item-name">
  39. <text>{{item.productName}}</text>
  40. </view>
  41. <view class="item-nums">
  42. X <text>{{item.totalQty}}{{item.unit||''}}</text>
  43. </view>
  44. <view class="item-head">
  45. <text>{{item.productCode}}</text>
  46. <text class="item-no">{{item.shelfPlaceCode}}</text>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view v-if="current==1">
  52. <view class="infoList" v-if="tempPartList.length">
  53. <view class="title">请耐心等待汽配经销商进行配送</view>
  54. <view>
  55. {{tempPartList.length}}款,共<text class="redText">{{totalTempNums}}</text>件
  56. </view>
  57. </view>
  58. <view v-else>
  59. <u-empty :src="`/static/nodata.png`" icon-size="180" text="暂无临配订单" mode="list" :margin-top="30"></u-empty>
  60. </view>
  61. <view v-for="item in tempPartList" :key="item.id" class="flex align-center item-list">
  62. <view>
  63. <u-image border-radius="16" width="130" height="130" bg-color="#EBEBEB" ></u-image>
  64. </view>
  65. <view>
  66. <view class="item-name">
  67. <text>{{item.productName}}</text>
  68. </view>
  69. <view class="item-nums">
  70. X <text>{{item.qty}}{{item.unit||''}}</text>
  71. </view>
  72. <view class="item-head">
  73. <text>{{item.productCode}}</text>
  74. <text class="item-no">{{item.shelfPlaceCode}}</text>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="info" v-if="info && info.shelfOrder && state == 1">
  81. <view class="infoList">
  82. <view class="title">单据信息</view>
  83. <view class="statu"></view>
  84. </view>
  85. <view class="infoList">
  86. <text>订单编号</text>
  87. <text>{{info.shelfOrder.shelfOrderNo||'--'}}</text>
  88. </view>
  89. <view class="infoList">
  90. <text>下单时间</text>
  91. <text>{{info.shelfOrder.createDate||'--'}}</text>
  92. </view>
  93. <view class="infoList">
  94. <text>下单人员</text>
  95. <text>{{info.shelfOrder.orderPersonName || '--'}}</text>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. </template>
  101. <script>
  102. import uniIcons from "@/components/uni-icons/uni-icons.vue"
  103. import moment from 'moment'
  104. import { findBySnShelfOrder } from '@/api/shelf'
  105. import { clzConfirm } from '@/libs/tools.js'
  106. export default {
  107. name: 'choosePartResult',
  108. components: {
  109. uniIcons,
  110. },
  111. data() {
  112. return {
  113. info: null,
  114. statusText: '',
  115. statusIcon: '', // 结算状态icon
  116. partList: [], // 配件列表
  117. tempPartList: [],
  118. state: null,
  119. current: 0,
  120. shelfOrderSn: ''
  121. }
  122. },
  123. onLoad(option) {
  124. this.info = option.data?JSON.parse(decodeURIComponent(option.data)):null
  125. this.state = option.state
  126. if(option.state==1){
  127. this.statusText = '提交成功'
  128. this.statusIcon = 'checkmark-circle'
  129. // 获取配件列表
  130. this.partList = this.info.shelfOrder ? this.info.shelfOrder.shelfOrderDetailList : []
  131. this.tempPartList = this.info.shelfTempBill ? this.info.shelfTempBill.detailList : [],
  132. this.shelfOrderSn = this.info.shelfOrder ? this.info.shelfOrder.shelfOrderSn : ''
  133. this.current = this.partList.length ? 0 : 1
  134. }else{
  135. this.statusText = '提交失败'
  136. this.statusIcon = 'close-circle'
  137. }
  138. // 更改标题栏背景色
  139. uni.setNavigationBarColor({
  140. frontColor: '#ffffff',
  141. backgroundColor: option.state==1 ? '#1283d4':'#ff5500',
  142. })
  143. },
  144. computed: {
  145. totalNums(){
  146. let ret = 0
  147. if(this.partList){
  148. this.partList.map(item => {
  149. ret += item.totalQty
  150. })
  151. }
  152. return ret
  153. },
  154. totalTempNums(){
  155. let ret = 0
  156. if(this.tempPartList){
  157. this.tempPartList.map(item => {
  158. ret += item.qty
  159. })
  160. }
  161. return ret
  162. }
  163. },
  164. methods: {
  165. back(){
  166. uni.navigateBack()
  167. },
  168. changeTab(index){
  169. this.current = index
  170. },
  171. // 扫码取货
  172. toScan(){
  173. uni.redirectTo({
  174. url:"/pages/digitalShelf/scanBarcode/scanBarcode?shelfOrderSn="+this.shelfOrderSn
  175. })
  176. },
  177. // 一键取货
  178. onceQh(){
  179. },
  180. // 去结算
  181. toSettle(){
  182. uni.redirectTo({
  183. url:"/pages/digitalShelf/settlementManage/settlementManage"
  184. })
  185. },
  186. message(title){
  187. uni.showToast({
  188. icon:'none',
  189. title: title
  190. })
  191. },
  192. }
  193. }
  194. </script>
  195. <style lang="less">
  196. page{
  197. height: 100%;
  198. }
  199. .choosePartResult{
  200. height: 100%;
  201. .order-body{
  202. flex-grow: 1;
  203. overflow: auto;
  204. }
  205. .contHead {
  206. background-color: white;
  207. margin-top: -20rpx;
  208. .statusH{
  209. > view{
  210. padding: 10upx 12%;
  211. font-size: 34upx;
  212. }
  213. .status-row{
  214. font-size: 42upx;
  215. text{
  216. margin-left: 10rpx;
  217. }
  218. }
  219. .messageText{
  220. font-size: 30upx;
  221. text-align: center;
  222. text{
  223. color: #ffaa00;
  224. }
  225. padding: 10rpx 0;
  226. }
  227. .button-group{
  228. padding: 20rpx 0;
  229. button{
  230. background: none;
  231. margin: 0 30rpx;
  232. border-radius: 100rpx;
  233. font-size: 32rpx;
  234. }
  235. .back{
  236. background: #fff;
  237. color: #0485F6;
  238. }
  239. .action{
  240. background: #fff;
  241. color: #0485F6;
  242. }
  243. .actionFail{
  244. background: #fff;
  245. color: #FF5728;
  246. }
  247. }
  248. }
  249. }
  250. .info{
  251. background-color: #FFFFFF;
  252. padding: 10rpx 30upx;
  253. font-size: 32rpx;
  254. margin-bottom: 20rpx;
  255. .infoList{
  256. display: flex;
  257. align-items: center;
  258. justify-content: space-between;
  259. padding:20rpx 0;
  260. border-bottom: 2rpx solid #f2f2f2;
  261. .title{
  262. color: #999;
  263. font-size: 28rpx;
  264. }
  265. > text{
  266. &:first-child{
  267. color: #666E75;
  268. }
  269. &:last-child{
  270. width: 80%;
  271. text-align: right;
  272. }
  273. }
  274. .redText{
  275. color: red;
  276. }
  277. }
  278. .item-list{
  279. border-bottom: 2rpx solid #f2f2f2;
  280. &:last-child{
  281. border: none;
  282. }
  283. > view{
  284. padding: 20rpx 0;
  285. &:first-child{
  286. margin-right: 20rpx;
  287. margin-top: 18rpx;
  288. }
  289. &:last-child{
  290. flex-grow: 1;
  291. }
  292. }
  293. .item-name{
  294. word-wrap: break-word;
  295. font-size: 32rpx;
  296. color: #333;
  297. font-weight: bold;
  298. margin-top: 10rpx;
  299. }
  300. .item-nums{
  301. padding: 10rpx 0;
  302. color: #999;
  303. font-size: 24rpx;
  304. text{
  305. font-size: 32rpx;
  306. color: #666E75;
  307. margin-left: 10rpx;
  308. }
  309. }
  310. .item-head{
  311. display: flex;
  312. align-items: center;
  313. justify-content: space-between;
  314. font-size: 32rpx;
  315. color: #666;
  316. .item-no{
  317. background: rgba(3, 54, 146, 0.15);
  318. color: #033692;
  319. border-radius: 100rpx;
  320. padding: 2rpx 30rpx;
  321. margin-right: 20rpx;
  322. display: block;
  323. }
  324. }
  325. }
  326. }
  327. }
  328. </style>