choosePartResult.vue 9.0 KB

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