procureOrder.vue 9.1 KB

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