choosePartResult.vue 9.9 KB

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