choosePartResult.vue 9.2 KB

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