procureOrder.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <view class="orderDetail-digitalShel flex flex_column">
  3. <view class="contHead" :style="{background:state!= 'CLOSE' ? '#066cff':'#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">{{statusMessage}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="order-body">
  16. <view class="info partList" v-if="partList.length">
  17. <view class="infoList">
  18. <view class="title">
  19. <u-icon name="info-circle" color="#ffaa00" size="28"></u-icon><text>请耐心等待汽配经销商进行配送</text>
  20. </view>
  21. <view>
  22. {{partList.length}}款,共<text class="redText">{{totalNums}}</text>
  23. </view>
  24. </view>
  25. <view v-for="item in partList" :key="item.productSn" class="flex align-center item-list">
  26. <view style="height: 150rpx;">
  27. <u-image :src="item.images" border-radius="16" width="200" height="150" bg-color="#EBEBEB" ></u-image>
  28. <view class="back-price"><text>¥15</text></view>
  29. </view>
  30. <view>
  31. <view class="item-name">
  32. <text>{{item.productName}}</text>
  33. </view>
  34. <view class="item-nums">
  35. <text>{{item.productCode}}</text>
  36. </view>
  37. <view class="item-head">
  38. <view>
  39. 数量:<text class="redText">{{item.qty}}</text>{{item.unit}}
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="info" v-if="info">
  46. <view class="infoList">
  47. <view class="title">单据信息</view>
  48. <view class="statu"></view>
  49. </view>
  50. <view class="infoList dju">
  51. <text>订单号</text>
  52. <text>{{info.shelfOrderNo||'--'}}</text>
  53. </view>
  54. <view class="infoList">
  55. <text>下单时间</text>
  56. <text>{{info.shelfOrderDate||'--'}}</text>
  57. </view>
  58. <view class="infoList">
  59. <text>下单人员</text>
  60. <text>{{info.orderPersonName || '--'}}</text>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import carNo from '@/components/carNo.vue'
  68. import uniIcons from "@/components/uni-icons/uni-icons.vue"
  69. import moment from 'moment'
  70. import { findBySnShelfOrder, cancelShelfOrder, takeGoods } from '@/api/shelf.js'
  71. export default {
  72. name: 'orderDetail-digitalShel',
  73. components: {
  74. uniIcons,
  75. carNo
  76. },
  77. data() {
  78. return {
  79. loading: false,
  80. info: null,
  81. statusText: '',
  82. statusIcon: '', // 结算状态icon
  83. statusMessage: '',
  84. partList: [], // 配件列表
  85. shelfOrderSn: null,
  86. state: ''
  87. }
  88. },
  89. onReady() {
  90. },
  91. onLoad(option) {
  92. this.shelfOrderSn = option.shelfOrderSn
  93. this.state = option.state
  94. uni.setNavigationBarTitle({
  95. title: ''
  96. })
  97. // 更改标题栏背景色
  98. uni.setNavigationBarColor({
  99. frontColor: '#ffffff',
  100. backgroundColor: option.state!= 'error' ? '#066cff':'#ff5500',
  101. })
  102. },
  103. onShow() {
  104. // this.getDetail()
  105. this.info = {
  106. orderPersonName: '张三',
  107. shelfOrderDate: moment().format('YYYY-MM-DD HH:mm:ss'),
  108. shelfOrderNo: '12345678901234567890',
  109. billState: 'success'
  110. }
  111. this.statusText = '提交成功'
  112. this.statusIcon = 'checkmark-circle'
  113. this.partList = [
  114. {
  115. id: new Date().getTime(),
  116. productName: '长安回望绣成堆,山顶千门次第开,一骑红尘妃子笑,无人知是荔枝来',
  117. images: 'https://cdn.uviewui.com/uview/common/logo.png',
  118. productCode:'432-ddsaf-jjj',
  119. qty: 5,
  120. unit: '个'
  121. }
  122. ]
  123. },
  124. computed: {
  125. totalNums(){
  126. let ret = 0
  127. this.partList.map(item => {
  128. ret += item.qty
  129. })
  130. return ret
  131. }
  132. },
  133. methods: {
  134. message(title){
  135. uni.showToast({
  136. icon:'none',
  137. title: title
  138. })
  139. },
  140. // 获取详情
  141. getDetail(){
  142. findBySnShelfOrder({sn: this.shelfOrderSn}).then(res => {
  143. if(res.status == 200){
  144. this.info = res.data
  145. this.partList = res.data.shelfOrderDetailList || []
  146. if(this.info.billState == 'success'){
  147. this.statusText = '提交成功'
  148. this.statusIcon = 'checkmark-circle'
  149. this.statusMessage = ''
  150. }
  151. if(this.info.billState == 'error'){
  152. this.statusText = '提交失败'
  153. this.statusIcon = 'close-circle'
  154. this.statusMessage = ''
  155. }
  156. }
  157. })
  158. },
  159. }
  160. }
  161. </script>
  162. <style lang="less">
  163. page{
  164. height: 100%;
  165. }
  166. .orderDetail-digitalShel{
  167. height: 100%;
  168. .redText{
  169. color: #FB1E1E;
  170. }
  171. .order-body{
  172. flex-grow: 1;
  173. overflow: auto;
  174. .partList{
  175. margin-top: 20rpx;
  176. }
  177. }
  178. .contHead {
  179. .statusH{
  180. > view{
  181. padding: 10upx 12%;
  182. font-size: 34upx;
  183. }
  184. .status-row{
  185. font-size: 42upx;
  186. text{
  187. margin-left: 10rpx;
  188. }
  189. }
  190. .messageText{
  191. font-size: 30upx;
  192. text-align: center;
  193. text{
  194. color: #ffaa00;
  195. }
  196. padding: 10rpx 0;
  197. }
  198. }
  199. .orderTj{
  200. padding: 0 20rpx 20rpx;
  201. background-color: #fff;
  202. > view{
  203. text-align: center;
  204. border-right: 2rpx solid #eee;
  205. width: 50%;
  206. color: #666E75;
  207. .redText{
  208. color: #FB1E1E;
  209. }
  210. &:last-child{
  211. border: 0;
  212. }
  213. > view{
  214. color: #666E75;
  215. &:first-child{
  216. font-size: 56rpx;
  217. }
  218. }
  219. }
  220. border-radius: 20rpx 20rpx 0 0;
  221. }
  222. }
  223. .info{
  224. background-color: #FFFFFF;
  225. padding: 10rpx 30upx;
  226. font-size: 32rpx;
  227. margin-bottom: 20rpx;
  228. .infoList{
  229. display: flex;
  230. justify-content: space-between;
  231. align-items: center;
  232. padding: 20rpx 0;
  233. border-bottom: 2rpx solid #f2f2f2;
  234. &:last-child{
  235. border: none;
  236. }
  237. .title{
  238. font-weight: bold;
  239. > text{
  240. color: #ff9808;
  241. font-size: 24upx;
  242. }
  243. }
  244. > text{
  245. &:first-child{
  246. color: #666E75;
  247. }
  248. }
  249. }
  250. .item-list{
  251. border-bottom: 2rpx solid #f2f2f2;
  252. padding: 20rpx 0;
  253. &:last-child{
  254. border: none;
  255. }
  256. > view{
  257. &:first-child{
  258. margin-right: 20rpx;
  259. margin-top: 18rpx;
  260. position: relative;
  261. overflow: hidden;
  262. width: 200rpx;
  263. }
  264. .back-price{
  265. zoom: calc(0.8);
  266. padding: 6rpx 55rpx;
  267. background: rgb(255 87 34 / 0.6);
  268. position: absolute;
  269. top: 16rpx;
  270. left: -50rpx;
  271. color: #fff;
  272. z-index: 2;
  273. font-size: 20rpx;
  274. text-align: center;
  275. transform: rotate(-40deg);
  276. display: flex;
  277. align-items: center;
  278. text{
  279. font-size: 28rpx;
  280. }
  281. }
  282. &:last-child{
  283. flex-grow: 1;
  284. width: 60%;
  285. }
  286. }
  287. .item-name{
  288. word-wrap: break-word;
  289. font-size: 32rpx;
  290. color: #333;
  291. font-weight: bold;
  292. margin-top: 10rpx;
  293. }
  294. .item-nums{
  295. padding: 10rpx 0;
  296. text{
  297. font-size: 32rpx;
  298. color: #222222;
  299. }
  300. }
  301. .item-head{
  302. display: flex;
  303. align-items: center;
  304. justify-content: space-between;
  305. color: #666;
  306. > view{
  307. &:first-child{
  308. font-size: 28rpx;
  309. text{
  310. margin-right: 30rpx;
  311. }
  312. }
  313. }
  314. .item-no{
  315. font-size: 28rpx;
  316. background: rgba(3, 54, 146, 0.15);
  317. color: #033692;
  318. border-radius: 100rpx;
  319. padding: 2rpx 30rpx;
  320. margin-right: 20rpx;
  321. display: block;
  322. }
  323. }
  324. }
  325. }
  326. .footer{
  327. padding: 20upx 60upx;
  328. background: #FFFFFF;
  329. button{
  330. &:after{
  331. border: 0;
  332. }
  333. color: #585858;
  334. font-size: 32rpx;
  335. margin: 0 20rpx;
  336. }
  337. }
  338. }
  339. </style>