choosePartResult.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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="back" class="back" size="mini">返回首页</button>
  14. <button :hover-stop-propagation="true" @click="toScan" v-if="state == 1" 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. <view class="infoList">
  23. <view class="title">配件列表</view>
  24. <view>
  25. {{partList.length}}款,共<text class="redText">{{totalNums}}</text>件
  26. </view>
  27. </view>
  28. <view v-for="item in partList" :key="item.id" class="flex align-center item-list">
  29. <view>
  30. <u-image border-radius="16" width="130" height="130" bg-color="#EBEBEB" ></u-image>
  31. </view>
  32. <view>
  33. <view class="item-name">
  34. <text>{{item.productName}}</text>
  35. </view>
  36. <view class="item-nums">
  37. X <text>{{item.totalQty}}{{item.unit||''}}</text>
  38. </view>
  39. <view class="item-head">
  40. <text>{{item.productCode}}</text>
  41. <text class="item-no">{{item.shelfPlaceCode}}</text>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="info" v-if="info && state == 1">
  47. <view class="infoList">
  48. <view class="title">单据信息</view>
  49. <view class="statu"></view>
  50. </view>
  51. <view class="infoList">
  52. <text>订单编号</text>
  53. <text>{{info.shelfOrderNo||'--'}}</text>
  54. </view>
  55. <view class="infoList">
  56. <text>下单时间</text>
  57. <text>{{info.createDate||'--'}}</text>
  58. </view>
  59. <view class="infoList">
  60. <text>下单人员</text>
  61. <text>{{info.orderPersonName || '--'}}</text>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import uniIcons from "@/components/uni-icons/uni-icons.vue"
  69. import moment from 'moment'
  70. import { findBySnShelfOrder } from '@/api/shelf'
  71. import { clzConfirm } from '@/libs/tools.js'
  72. export default {
  73. name: 'choosePartResult',
  74. components: {
  75. uniIcons,
  76. },
  77. data() {
  78. return {
  79. info: null,
  80. statusText: '',
  81. statusIcon: '', // 结算状态icon
  82. partList: [], // 配件列表
  83. state: null
  84. }
  85. },
  86. onLoad(option) {
  87. console.log(option,'option')
  88. this.info = JSON.parse(decodeURIComponent(option.data.replace(/%/g, '%25')))
  89. this.state = option.state
  90. if(option.state==1){
  91. this.statusText = '提交成功'
  92. this.statusIcon = 'checkmark-circle'
  93. // 获取配件列表
  94. this.partList = this.info.shelfOrderDetailList
  95. }else{
  96. this.statusText = '提交失败'
  97. this.statusIcon = 'close-circle'
  98. }
  99. },
  100. computed: {
  101. totalNums(){
  102. let ret = 0
  103. this.partList.map(item => {
  104. ret += item.totalQty
  105. })
  106. return ret
  107. }
  108. },
  109. methods: {
  110. back(){
  111. uni.navigateBack()
  112. },
  113. // 扫码取货
  114. toScan(){
  115. uni.redirectTo({
  116. url:"/pages/digitalShelf/scanBarcode/scanBarcode?shelfOrderSn="+this.info.shelfOrderSn
  117. })
  118. },
  119. // 去结算
  120. toSettle(){
  121. uni.redirectTo({
  122. url:"/pages/digitalShelf/settlementManage/settlementManage"
  123. })
  124. },
  125. message(title){
  126. uni.showToast({
  127. icon:'none',
  128. title: title
  129. })
  130. },
  131. }
  132. }
  133. </script>
  134. <style lang="less">
  135. page{
  136. height: 100%;
  137. }
  138. .choosePartResult{
  139. height: 100%;
  140. .order-body{
  141. flex-grow: 1;
  142. overflow: auto;
  143. }
  144. .contHead {
  145. background-color: white;
  146. margin-top: -20rpx;
  147. .statusH{
  148. > view{
  149. padding: 10upx 12%;
  150. font-size: 34upx;
  151. }
  152. .status-row{
  153. font-size: 42upx;
  154. text{
  155. margin-left: 10rpx;
  156. }
  157. }
  158. .messageText{
  159. font-size: 30upx;
  160. text-align: center;
  161. text{
  162. color: #ffaa00;
  163. }
  164. padding: 10rpx 0;
  165. }
  166. .button-group{
  167. padding: 20rpx 0;
  168. button{
  169. background: none;
  170. margin: 0 30rpx;
  171. border-radius: 100rpx;
  172. font-size: 32rpx;
  173. }
  174. .back{
  175. color: #fff;
  176. border:2rpx solid #fff;
  177. }
  178. .action{
  179. background: #fff;
  180. color: #0485F6;
  181. }
  182. .actionFail{
  183. background: #fff;
  184. color: #FF5728;
  185. }
  186. }
  187. }
  188. }
  189. .info{
  190. background-color: #FFFFFF;
  191. padding: 10rpx 30upx;
  192. font-size: 32rpx;
  193. margin-bottom: 20rpx;
  194. .infoList{
  195. display: flex;
  196. align-items: center;
  197. justify-content: space-between;
  198. padding:20rpx 0;
  199. border-bottom: 2rpx solid #f2f2f2;
  200. .title{
  201. font-weight: bold;
  202. }
  203. > text{
  204. &:first-child{
  205. color: #666E75;
  206. }
  207. &:last-child{
  208. width: 80%;
  209. text-align: right;
  210. }
  211. }
  212. .redText{
  213. color: red;
  214. }
  215. }
  216. .item-list{
  217. border-bottom: 2rpx solid #f2f2f2;
  218. &:last-child{
  219. border: none;
  220. }
  221. > view{
  222. padding: 20rpx 0;
  223. &:first-child{
  224. margin-right: 20rpx;
  225. margin-top: 18rpx;
  226. }
  227. &:last-child{
  228. flex-grow: 1;
  229. }
  230. }
  231. .item-name{
  232. word-wrap: break-word;
  233. font-size: 32rpx;
  234. color: #333;
  235. font-weight: bold;
  236. margin-top: 10rpx;
  237. }
  238. .item-nums{
  239. padding: 10rpx 0;
  240. color: #999;
  241. font-size: 24rpx;
  242. text{
  243. font-size: 32rpx;
  244. color: #666E75;
  245. margin-left: 10rpx;
  246. }
  247. }
  248. .item-head{
  249. display: flex;
  250. align-items: center;
  251. justify-content: space-between;
  252. font-size: 32rpx;
  253. color: #666;
  254. .item-no{
  255. background: rgba(3, 54, 146, 0.15);
  256. color: #033692;
  257. border-radius: 100rpx;
  258. padding: 2rpx 30rpx;
  259. margin-right: 20rpx;
  260. display: block;
  261. }
  262. }
  263. }
  264. }
  265. }
  266. </style>