choosePartResult.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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" :loading="loading" @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, takeGoods } 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. loading: false,
  114. info: null,
  115. statusText: '',
  116. statusIcon: '', // 结算状态icon
  117. partList: [], // 配件列表
  118. tempPartList: [],
  119. state: null,
  120. current: 0,
  121. shelfOrderSn: ''
  122. }
  123. },
  124. onLoad(option) {
  125. this.info = option.data?JSON.parse(decodeURIComponent(option.data)):null
  126. this.state = option.state
  127. if(option.state==1){
  128. this.statusText = '提交成功'
  129. this.statusIcon = 'checkmark-circle'
  130. // 获取配件列表
  131. this.partList = this.info.shelfOrder ? this.info.shelfOrder.shelfOrderDetailList : []
  132. this.tempPartList = this.info.shelfTempBill ? this.info.shelfTempBill.detailList : [],
  133. this.shelfOrderSn = this.info.shelfOrder ? this.info.shelfOrder.shelfOrderSn : ''
  134. this.current = this.partList.length ? 0 : 1
  135. }else{
  136. this.statusText = '提交失败'
  137. this.statusIcon = 'close-circle'
  138. }
  139. // 更改标题栏背景色
  140. uni.setNavigationBarColor({
  141. frontColor: '#ffffff',
  142. backgroundColor: option.state==1 ? '#1283d4':'#ff5500',
  143. })
  144. },
  145. computed: {
  146. totalNums(){
  147. let ret = 0
  148. if(this.partList){
  149. this.partList.map(item => {
  150. ret += item.totalQty
  151. })
  152. }
  153. return ret
  154. },
  155. totalTempNums(){
  156. let ret = 0
  157. if(this.tempPartList){
  158. this.tempPartList.map(item => {
  159. ret += item.qty
  160. })
  161. }
  162. return ret
  163. }
  164. },
  165. methods: {
  166. back(){
  167. uni.navigateBack()
  168. },
  169. changeTab(index){
  170. this.current = index
  171. },
  172. // 扫码取货
  173. toScan(){
  174. uni.redirectTo({
  175. url:"/pages/digitalShelf/scanBarcode/scanBarcode?shelfOrderSn="+this.shelfOrderSn
  176. })
  177. },
  178. // 一键取货
  179. onceQh(){
  180. this.loading = true
  181. takeGoods({sn:this.shelfOrderSn}).then(res => {
  182. if(res.status == 200){
  183. uni.navigateBack()
  184. }
  185. uni.showToast({
  186. title: res.message,
  187. icon:"none"
  188. })
  189. this.loading = false
  190. })
  191. },
  192. // 去结算
  193. toSettle(){
  194. uni.redirectTo({
  195. url:"/pages/digitalShelf/settlementManage/settlementManage"
  196. })
  197. },
  198. message(title){
  199. uni.showToast({
  200. icon:'none',
  201. title: title
  202. })
  203. },
  204. }
  205. }
  206. </script>
  207. <style lang="less">
  208. page{
  209. height: 100%;
  210. }
  211. .choosePartResult{
  212. height: 100%;
  213. .order-body{
  214. flex-grow: 1;
  215. overflow: auto;
  216. }
  217. .contHead {
  218. background-color: white;
  219. margin-top: -20rpx;
  220. .statusH{
  221. > view{
  222. padding: 10upx 12%;
  223. font-size: 34upx;
  224. }
  225. .status-row{
  226. font-size: 42upx;
  227. text{
  228. margin-left: 10rpx;
  229. }
  230. }
  231. .messageText{
  232. font-size: 30upx;
  233. text-align: center;
  234. text{
  235. color: #ffaa00;
  236. }
  237. padding: 10rpx 0;
  238. }
  239. .button-group{
  240. padding: 20rpx 0;
  241. button{
  242. background: none;
  243. margin: 0 30rpx;
  244. border-radius: 100rpx;
  245. font-size: 32rpx;
  246. }
  247. .back{
  248. background: #fff;
  249. color: #0485F6;
  250. }
  251. .action{
  252. background: #fff;
  253. color: #0485F6;
  254. }
  255. .actionFail{
  256. background: #fff;
  257. color: #FF5728;
  258. }
  259. }
  260. }
  261. }
  262. .info{
  263. background-color: #FFFFFF;
  264. padding: 10rpx 30upx;
  265. font-size: 32rpx;
  266. margin-bottom: 20rpx;
  267. .infoList{
  268. display: flex;
  269. align-items: center;
  270. justify-content: space-between;
  271. padding:20rpx 0;
  272. border-bottom: 2rpx solid #f2f2f2;
  273. .title{
  274. color: #999;
  275. font-size: 28rpx;
  276. }
  277. > text{
  278. &:first-child{
  279. color: #666E75;
  280. }
  281. &:last-child{
  282. width: 80%;
  283. text-align: right;
  284. }
  285. }
  286. .redText{
  287. color: red;
  288. }
  289. }
  290. .item-list{
  291. border-bottom: 2rpx solid #f2f2f2;
  292. &:last-child{
  293. border: none;
  294. }
  295. > view{
  296. padding: 20rpx 0;
  297. &:first-child{
  298. margin-right: 20rpx;
  299. margin-top: 18rpx;
  300. }
  301. &:last-child{
  302. flex-grow: 1;
  303. }
  304. }
  305. .item-name{
  306. word-wrap: break-word;
  307. font-size: 32rpx;
  308. color: #333;
  309. font-weight: bold;
  310. margin-top: 10rpx;
  311. }
  312. .item-nums{
  313. padding: 10rpx 0;
  314. color: #999;
  315. font-size: 24rpx;
  316. text{
  317. font-size: 32rpx;
  318. color: #666E75;
  319. margin-left: 10rpx;
  320. }
  321. }
  322. .item-head{
  323. display: flex;
  324. align-items: center;
  325. justify-content: space-between;
  326. font-size: 32rpx;
  327. color: #666;
  328. .item-no{
  329. background: rgba(3, 54, 146, 0.15);
  330. color: #033692;
  331. border-radius: 100rpx;
  332. padding: 2rpx 30rpx;
  333. margin-right: 20rpx;
  334. display: block;
  335. }
  336. }
  337. }
  338. }
  339. }
  340. </style>