dai_ruku.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <view class="RuKuContainer">
  3. <view class="orderList">
  4. <view
  5. v-for="item in list"
  6. :key="item.id"
  7. class="orderItem"
  8. >
  9. <view
  10. class="Header"
  11. :class="item.toggle ? 'open' : ''"
  12. @click="item.toggle = !item.toggle"
  13. >
  14. <view class="num">第{{ item.number }}次发货,共{{ item.get_express.length }}箱</view>
  15. <view class="type">{{ item.express_com }}</view>
  16. <view class="time">{{ item.created_at | dateFormatter('yyyy/MM/dd') }}</view>
  17. </view>
  18. <view v-if="item.toggle" class="hideBody">
  19. <view
  20. v-for="(btem,i) in item.get_express"
  21. :key="i"
  22. class="hideItem"
  23. >
  24. <view class="box_fix" v-if="btem.is_gift === 1"></view>
  25. <view class="hideNum">
  26. <view class="num">第{{ i+1 }}箱</view>
  27. <view class="orderNum">单号:{{ btem.express_number }}</view>
  28. </view>
  29. <view class="control" v-if="btem.is_gift === 0">
  30. <view
  31. class="textBtn"
  32. @click="toInfo(btem)"
  33. >
  34. 货物详情
  35. </view>
  36. <view
  37. class="textBtn"
  38. @click="logisticsQuery(btem)"
  39. >
  40. 物流查询
  41. </view>
  42. <view
  43. class="btn"
  44. :class="!(item.is_per && !btem.put_status) ? 'disable' : ''"
  45. @click="toRuKu(item, btem)"
  46. >
  47. 入库
  48. </view>
  49. </view>
  50. <view class="control" v-if="btem.is_gift === 1">
  51. <view class="searche" @click="giftsList(btem)">礼品详情</view>
  52. <view class="searcht" @click="logisticsQuery(btem)">物流查询</view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import { goodsInfo } from "@/apis/stock.js"
  62. export default {
  63. data() {
  64. return {
  65. list: [],
  66. order_id: '',
  67. initOpenId: ''
  68. }
  69. },
  70. onShow() {
  71. let page = getCurrentPages().pop()
  72. this.order_id = page.options.order_id
  73. this.getOrderInfo()
  74. },
  75. methods: {
  76. giftsList(btem) {
  77. if (btem.remark === null) {
  78. btem.remark = ''
  79. }
  80. var obj = eval(btem.notes); //由JSON字符串转换为JSON对象
  81. uni.navigateTo({
  82. url: `../gifts_list/gifts_list?remark=${btem.remark}&item=${encodeURIComponent(JSON.stringify(obj))}`,
  83. });
  84. },
  85. // 获取详情
  86. getOrderInfo() {
  87. uni.showLoading()
  88. const _this = this
  89. goodsInfo({ id: _this.order_id }).then(res => {
  90. uni.hideLoading()
  91. if(res.code === 200) {
  92. let openId = uni.getStorageSync('rukuOpenId')
  93. _this.list = res.data.list.map((item, idx) => {
  94. item.toggle = openId && Number(openId) === Number(item.id)
  95. idx == 0 ? this.$set(item, 'toggle', true) : this.$set(item, 'toggle', false);
  96. return item
  97. })
  98. } else {
  99. uni.showModal({
  100. content: res.message || "获取货物详情失败",
  101. showCancel: false
  102. })
  103. }
  104. }).catch(() => {
  105. uni.hideLoading()
  106. uni.showModal({
  107. content:"获取货物详情失败",
  108. showCancel: false
  109. })
  110. })
  111. },
  112. // 详情
  113. toInfo(data) {
  114. if (data.remark === null) {
  115. data.remark = ''
  116. }
  117. this.toUrlLink('stock/ing_ruku?status=0&order_id='+data.id + '&remark='+ data.remark)
  118. },
  119. // 物流查询
  120. logisticsQuery(item){
  121. uni.navigateTo({
  122. url: '../logistics-details/logistics-details?id=' + item.id + '&express_com=' + item.express_com + '&express_number=' + item.express_number
  123. });
  124. },
  125. // 入库
  126. toRuKu(item, btem) {
  127. if(!(item.is_per && !btem.put_status)) return false
  128. const _this = this
  129. uni.setStorage({
  130. key: 'rukuOpenId',
  131. data: item.id,
  132. success() {
  133. _this.toUrlLink('stock/ing_ruku?status=1&order_id='+btem.id)
  134. }
  135. })
  136. },
  137. toUrlLink(url) {
  138. if(!url) return false
  139. uni.navigateTo({
  140. url: `../${url}`
  141. })
  142. }
  143. }
  144. }
  145. </script>
  146. <style lang="scss" scoped>
  147. page{
  148. display: flex;
  149. flex-direction: column;
  150. }
  151. .RuKuContainer {
  152. width: 100%;
  153. flex: 1;
  154. background-color: #F9F9FB;
  155. .btn {
  156. width: 140rpx;
  157. height: 56rpx;
  158. border-radius: 8rpx;
  159. background-color: #EA4A41;
  160. color: #FFFFFF;
  161. font-size: 28rpx;
  162. line-height: 56rpx;
  163. text-align: center;
  164. text-align: center;
  165. }
  166. .orderList {
  167. width: 100%;
  168. .orderItem {
  169. width: 100%;
  170. margin-bottom: 30rpx;
  171. background-color: #ffffff;
  172. .Header {
  173. width: 100%;
  174. height: 104rpx;
  175. background-color: #ffffff;
  176. padding: 0 30rpx;
  177. box-sizing: border-box;
  178. display: flex;
  179. align-items: center;
  180. justify-content: space-between;
  181. .num {
  182. color: #333333;
  183. font-size: 32rpx;
  184. line-height: 44rpx;
  185. font-weight: bold;
  186. }
  187. .type, .time {
  188. color: #999999;
  189. font-size: 28rpx;
  190. line-height: 40rpx;
  191. }
  192. &::after {
  193. content: "";
  194. display: block;
  195. width: 30rpx;
  196. height: 30rpx;
  197. background-image: url(../../static/new_my/arrow.png);
  198. background-position: center;
  199. background-size: cover;
  200. background-repeat: no-repeat;
  201. }
  202. &.open {
  203. &::after {
  204. transform: rotate(90deg) !important;
  205. }
  206. }
  207. }
  208. .hideBody {
  209. width: 100%;
  210. padding-bottom: 30rpx;
  211. .hideItem {
  212. width: calc(100% - 60rpx);
  213. margin: 0 auto 30rpx auto;
  214. padding: 30rpx;
  215. box-sizing: border-box;
  216. background-color: #F9F9FB;
  217. border-radius: 24rpx;
  218. position: relative;
  219. &:nth-last-of-type(1) {
  220. margin-bottom: 0;
  221. }
  222. .box_fix {
  223. width: 6rpx;
  224. height: 84rpx;
  225. background: #FB231F;
  226. position: absolute;
  227. top: 56rpx;
  228. left: 0;
  229. }
  230. .hideNum {
  231. display: flex;
  232. align-items: center;
  233. justify-content: space-between;
  234. padding-bottom: 20rpx;
  235. border-bottom: 1px solid #EEEEEE;
  236. margin-bottom: 26rpx;
  237. color: #333333;
  238. font-size: 32rpx;
  239. line-height: 44rpx;
  240. .num {
  241. width: 120rpx;
  242. text-align: left;
  243. }
  244. .orderNum {
  245. flex: 1;
  246. min-width: 0;
  247. }
  248. }
  249. .control {
  250. width: 100%;
  251. display: flex;
  252. align-items: center;
  253. justify-content: space-between;
  254. .textBtn, .btn {
  255. width: calc((100% - 120rpx) / 3);
  256. }
  257. .searcht {
  258. color: $base-color;
  259. width: 100%;
  260. text-align: center;
  261. font-size: 28rpx;
  262. }
  263. .searche {
  264. color: $base-color;
  265. width: 100%;
  266. text-align: center;
  267. font-size: 28rpx;
  268. border-right: 2rpx solid #eee;
  269. }
  270. .textBtn {
  271. color: #EA4A41;
  272. font-size: 32rpx;
  273. line-height: 44rpx;
  274. text-align: left;
  275. position: relative;
  276. margin-right: 60rpx;
  277. &::after {
  278. content: "";
  279. display: block;
  280. width: 1px;
  281. height: 26rpx;
  282. background-color: #EEEEEE;
  283. position: absolute;
  284. top: 50%;
  285. right: 0;
  286. transform: translateY(-50%);
  287. }
  288. }
  289. .btn {
  290. &.disable {
  291. background-color: #F9F9FB !important;
  292. color: #999999 !important;
  293. border: 1px solid #EEEEEE;
  294. box-sizing: border-box;
  295. }
  296. }
  297. }
  298. }
  299. }
  300. }
  301. }
  302. }
  303. </style>