choosePartResult.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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(item,index){
  182. const _this = this
  183. uni.showModal({
  184. title: '提示',
  185. content: '确认一键取货吗?',
  186. success: (ret) => {
  187. if(ret.confirm){
  188. _this.loading = true
  189. takeGoods({sn:_this.shelfOrderSn}).then(res => {
  190. if(res.status == 200){
  191. uni.navigateBack()
  192. }
  193. uni.showToast({
  194. title: res.message,
  195. icon:"none"
  196. })
  197. _this.loading = false
  198. })
  199. }
  200. }
  201. })
  202. },
  203. // 去结算
  204. toSettle(){
  205. uni.redirectTo({
  206. url:"/pages/digitalShelf/settlementManage/settlementManage"
  207. })
  208. },
  209. message(title){
  210. uni.showToast({
  211. icon:'none',
  212. title: title
  213. })
  214. },
  215. }
  216. }
  217. </script>
  218. <style lang="less">
  219. page{
  220. height: 100%;
  221. }
  222. .choosePartResult{
  223. height: 100%;
  224. .order-body{
  225. flex-grow: 1;
  226. overflow: auto;
  227. }
  228. .contHead {
  229. background-color: white;
  230. margin-top: -20rpx;
  231. .statusH{
  232. > view{
  233. padding: 10upx 12%;
  234. font-size: 34upx;
  235. }
  236. .status-row{
  237. font-size: 42upx;
  238. text{
  239. margin-left: 10rpx;
  240. }
  241. }
  242. .messageText{
  243. font-size: 30upx;
  244. text-align: center;
  245. text{
  246. color: #ffaa00;
  247. }
  248. padding: 10rpx 0;
  249. }
  250. .button-group{
  251. padding: 20rpx 0;
  252. button{
  253. background: none;
  254. margin: 0 30rpx;
  255. border-radius: 100rpx;
  256. font-size: 32rpx;
  257. }
  258. .back{
  259. background: #fff;
  260. color: #0485F6;
  261. }
  262. .action{
  263. background: #fff;
  264. color: #0485F6;
  265. }
  266. .actionFail{
  267. background: #fff;
  268. color: #FF5728;
  269. }
  270. }
  271. }
  272. }
  273. .info{
  274. background-color: #FFFFFF;
  275. padding: 10rpx 30upx;
  276. font-size: 32rpx;
  277. margin-bottom: 20rpx;
  278. .infoList{
  279. display: flex;
  280. align-items: center;
  281. justify-content: space-between;
  282. padding:20rpx 0;
  283. border-bottom: 2rpx solid #f2f2f2;
  284. .title{
  285. color: #999;
  286. font-size: 28rpx;
  287. }
  288. > text{
  289. &:first-child{
  290. color: #666E75;
  291. }
  292. &:last-child{
  293. width: 80%;
  294. text-align: right;
  295. }
  296. }
  297. .redText{
  298. color: red;
  299. }
  300. }
  301. .item-list{
  302. border-bottom: 2rpx solid #f2f2f2;
  303. &:last-child{
  304. border: none;
  305. }
  306. > view{
  307. padding: 20rpx 0;
  308. &:first-child{
  309. margin-right: 20rpx;
  310. margin-top: 18rpx;
  311. }
  312. &:last-child{
  313. flex-grow: 1;
  314. }
  315. }
  316. .item-name{
  317. word-wrap: break-word;
  318. font-size: 32rpx;
  319. color: #333;
  320. font-weight: bold;
  321. margin-top: 10rpx;
  322. }
  323. .item-nums{
  324. padding: 10rpx 0;
  325. color: #999;
  326. font-size: 24rpx;
  327. text{
  328. font-size: 32rpx;
  329. color: #666E75;
  330. margin-left: 10rpx;
  331. }
  332. }
  333. .item-head{
  334. display: flex;
  335. align-items: center;
  336. justify-content: space-between;
  337. font-size: 32rpx;
  338. color: #666;
  339. .item-no{
  340. background: rgba(3, 54, 146, 0.15);
  341. color: #033692;
  342. border-radius: 100rpx;
  343. padding: 2rpx 30rpx;
  344. margin-right: 20rpx;
  345. display: block;
  346. }
  347. }
  348. }
  349. }
  350. }
  351. </style>