procureOrder.vue 7.8 KB

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