procureOrder.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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"><text>{{statusMessage}}</text></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. 产品列表
  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.id" class="flex align-center item-list">
  26. <view style="height: 150rpx;">
  27. <u-image :src="item.product.images" border-radius="16" width="200" height="150" bg-color="#EBEBEB" ></u-image>
  28. <view class="back-price" v-if="item.giveAmount"><text>{{item.giveAmount}}</text></view>
  29. </view>
  30. <view>
  31. <view class="item-name">
  32. <text>{{item.product.productName}}</text>
  33. </view>
  34. <view class="item-nums">
  35. <text>{{item.product.origCode}}</text>
  36. </view>
  37. <view class="item-head">
  38. <view>
  39. 数量:<text class="redText">{{item.qty}}</text>{{item.product&&item.product.unit||''}}
  40. </view>
  41. <view><text class="redText">{{item.price}}</text></view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="info" v-if="info">
  47. <view class="infoList" v-if="state=='FINISH'">
  48. <text>代金券</text>
  49. <text class="redText">{{info.totalGiveAmount}}</text>
  50. </view>
  51. <view class="infoList">
  52. <text>总金额</text>
  53. <text class="redText">{{info.totalAmount}}</text>
  54. </view>
  55. </view>
  56. <view class="info" v-if="info">
  57. <view class="infoList">
  58. <view class="title">单据信息</view>
  59. <view class="statu"></view>
  60. </view>
  61. <view class="infoList dju">
  62. <text>订单号</text>
  63. <text>{{info.purchaseNo||'--'}}</text>
  64. </view>
  65. <view class="infoList">
  66. <text>下单时间</text>
  67. <text>{{info.purchaseDate||'--'}}</text>
  68. </view>
  69. <view class="infoList">
  70. <text>下单人员</text>
  71. <text>{{info.purchaserName || '--'}}</text>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import { purchaseQueryDetailPage } from '@/api/purchase.js'
  79. export default {
  80. name: 'procureDetailOrder',
  81. data() {
  82. return {
  83. loading: false,
  84. info: null,
  85. statusText: '',
  86. statusIcon: '', // 结算状态icon
  87. statusMessage: '请耐心等待汽配经销商进行配送',
  88. partList: [], // 配件列表
  89. state: 'success'
  90. }
  91. },
  92. onLoad(option) {
  93. // 从采购单列表来
  94. if(option.purchaseSn){
  95. this.state = option.state
  96. uni.setNavigationBarTitle({
  97. title: '采购订单详情'
  98. })
  99. const stateText = {'WAIT_AUDIT':'待审核','AUDIT_REJECT':'审核不通过','WAIT_OUT_WAREHOUSE':'待收货','FINISH':'已完结'}
  100. this.statusText = stateText[option.state]
  101. this.statusIcon = option.state == 'FINISH' ? 'checkmark-circle' : 'hourglass'
  102. this.info = this.$store.state.vuex_tempData
  103. this.statusMessage = option.state == 'FINISH' || option.state == 'AUDIT_REJECT' ? '' : '请耐心等待汽配经销商进行配送'
  104. // 获取明细
  105. this.getDetailList(option.purchaseSn)
  106. }else{
  107. const data = this.$store.state.vuex_tempData
  108. if(data){
  109. this.info = data
  110. this.partList = data.detailList||[]
  111. }
  112. uni.setNavigationBarTitle({
  113. title: ''
  114. })
  115. this.statusText = '提交成功'
  116. this.statusIcon = 'checkmark-circle'
  117. }
  118. // 更改标题栏背景色
  119. uni.setNavigationBarColor({
  120. frontColor: '#ffffff',
  121. backgroundColor: this.state!= 'error'&&this.state!= 'AUDIT_REJECT' ? '#066cff':'#ff5500',
  122. })
  123. },
  124. onUnload() {
  125. this.$store.state.vuex_tempData = null
  126. },
  127. computed: {
  128. totalNums(){
  129. let ret = 0
  130. this.partList.map(item => {
  131. ret += item.qty
  132. })
  133. return ret
  134. }
  135. },
  136. methods: {
  137. getDetailList(sn){
  138. uni.showLoading({
  139. title: '加载中'
  140. })
  141. purchaseQueryDetailPage({purchaseSn: sn,pageNo:1,pageSize:9000}).then(res => {
  142. uni.hideLoading()
  143. if(res.status == 200){
  144. this.partList = res.data ? res.data.list : []
  145. }
  146. })
  147. },
  148. message(title){
  149. uni.showToast({
  150. icon:'none',
  151. title: title
  152. })
  153. },
  154. }
  155. }
  156. </script>
  157. <style lang="less">
  158. page{
  159. height: 100%;
  160. }
  161. .orderDetail-digitalShel{
  162. height: 100%;
  163. .redText{
  164. color: #FB1E1E;
  165. }
  166. .order-body{
  167. flex-grow: 1;
  168. overflow: auto;
  169. .partList{
  170. margin-top: 20rpx;
  171. }
  172. }
  173. .contHead {
  174. .statusH{
  175. > view{
  176. padding: 10upx 12%;
  177. font-size: 34upx;
  178. }
  179. .status-row{
  180. font-size: 42upx;
  181. text{
  182. margin-left: 10rpx;
  183. }
  184. }
  185. .messageText{
  186. font-size: 28upx;
  187. text-align: center;
  188. text{
  189. color: #f3e781;
  190. }
  191. padding: 20rpx 0;
  192. }
  193. }
  194. }
  195. .info{
  196. background-color: #FFFFFF;
  197. padding: 10rpx 30upx;
  198. font-size: 32rpx;
  199. margin-bottom: 20rpx;
  200. .infoList{
  201. display: flex;
  202. justify-content: space-between;
  203. align-items: center;
  204. padding: 20rpx 0;
  205. border-bottom: 2rpx solid #f2f2f2;
  206. &:last-child{
  207. border: none;
  208. }
  209. .title{
  210. font-weight: bold;
  211. > text{
  212. color: #ff9808;
  213. font-size: 24upx;
  214. }
  215. }
  216. > text{
  217. &:first-child{
  218. color: #666E75;
  219. }
  220. }
  221. }
  222. .item-list{
  223. border-bottom: 2rpx solid #f2f2f2;
  224. padding: 20rpx 0;
  225. &:last-child{
  226. border: none;
  227. }
  228. > view{
  229. &:first-child{
  230. margin-right: 20rpx;
  231. margin-top: 18rpx;
  232. position: relative;
  233. overflow: hidden;
  234. width: 200rpx;
  235. }
  236. .back-price{
  237. zoom: calc(0.8);
  238. padding: 6rpx 65rpx;
  239. background: rgba(255 ,87 ,34 , 1);
  240. position: absolute;
  241. top: 20rpx;
  242. right: -55rpx;
  243. color: #fff;
  244. z-index: 2;
  245. font-size: 20rpx;
  246. text-align: center;
  247. transform: rotate(40deg);
  248. display: flex;
  249. align-items: center;
  250. text{
  251. font-size: 28rpx;
  252. margin: 0 5rpx;
  253. }
  254. }
  255. &:last-child{
  256. flex-grow: 1;
  257. width: 60%;
  258. }
  259. }
  260. .item-name{
  261. word-wrap: break-word;
  262. font-size: 32rpx;
  263. color: #333;
  264. font-weight: bold;
  265. margin-top: 10rpx;
  266. }
  267. .item-nums{
  268. padding: 10rpx 0;
  269. text{
  270. font-size: 32rpx;
  271. color: #222222;
  272. }
  273. }
  274. .item-head{
  275. display: flex;
  276. align-items: center;
  277. justify-content: space-between;
  278. color: #666;
  279. > view{
  280. font-size: 28rpx;
  281. text{
  282. margin-right: 10rpx;
  283. }
  284. }
  285. }
  286. }
  287. }
  288. .footer{
  289. padding: 20upx 60upx;
  290. background: #FFFFFF;
  291. button{
  292. &:after{
  293. border: 0;
  294. }
  295. color: #585858;
  296. font-size: 32rpx;
  297. margin: 0 20rpx;
  298. }
  299. }
  300. }
  301. </style>