index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <template>
  2. <Water></Water>
  3. <view class="nav" :style="{ paddingTop: statusBarHeight + 'px' }">
  4. <text class="nav-back" :style="{ top: statusBarHeight + 'px' }" @click="onBack"></text>
  5. <view class="nav-title">{{ title }}</view>
  6. </view>
  7. <view class="page">
  8. <view class="header-card" :style="{ paddingTop: statusBarHeight + 60 + 'px' }">
  9. <view class="meta">
  10. <view class="dot"></view>
  11. <text class="meta-text">所在省份:{{ regionName }}</text>
  12. </view>
  13. <view class="meta">
  14. <view class="dot"></view>
  15. <text class="meta-text">客户等级:{{
  16. scanType == 1 ? "VIP" : scanType == 2 ? "二级" : "三级"
  17. }}客户</text>
  18. </view>
  19. <view class="meta">
  20. <view class="dot"></view>
  21. <text class="meta-text">客户性质:{{ customerType || '--' }}</text>
  22. </view>
  23. <view class="meta">
  24. <view class="dot"></view>
  25. <text class="meta-text">责任经理:{{ managerName || '--' }}</text>
  26. </view>
  27. <view class="meta">
  28. <view class="dot"></view>
  29. <text class="meta-text">累计预警次数:{{ warningCount || warningCount == 0 ? warningCount : '--' }}</text>
  30. </view>
  31. </view>
  32. <view class="section-title">流转信息</view>
  33. <view class="card table-card">
  34. <scroll-view scroll-x="true" class="table-scroll">
  35. <view class="flow-table">
  36. <view class="flow-header">
  37. <view class="th col-time">单据时间</view>
  38. <view class="th col-type">单据类型</view>
  39. <view class="th col-product">产品名称</view>
  40. <view class="th col-batch">批号</view>
  41. <view class="th col-source">货源地</view>
  42. <view class="th col-qty">数量</view>
  43. <view class="th col-chain">链路</view>
  44. </view>
  45. <view class="flow-body">
  46. <view class="flow-row" v-for="(item, index) in flowList" :key="index">
  47. <view class="td col-time">{{ item.billTime }}</view>
  48. <view class="td col-type">{{ item.billType }}</view>
  49. <view class="td col-product">{{ item.productName }}</view>
  50. <view class="td-group">
  51. <view class="sub-row" v-for="(sub, sIdx) in item.items" :key="sIdx">
  52. <view class="td col-batch">{{ sub.batchNo }}</view>
  53. <view class="td col-source">{{ sub.source }}</view>
  54. <view class="td col-qty">{{ sub.quantity }}</view>
  55. </view>
  56. </view>
  57. <view class="td col-chain">{{ item.chain }}</view>
  58. </view>
  59. </view>
  60. </view>
  61. </scroll-view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. import Water from "@/components/water/water.vue";
  67. export default {
  68. components: {
  69. Water,
  70. },
  71. data() {
  72. return {
  73. title: '',
  74. managerName: '夜神月',
  75. warningCount: 0,
  76. scanType: "",
  77. statusBarHeight: 20,
  78. regionName: "广东",
  79. customerType: "协议客户",
  80. flowList: [
  81. {
  82. billTime: '2023-01-01 12:00',
  83. billType: '销售出库',
  84. productName: '感冒灵颗粒',
  85. items: [
  86. { batchNo: 'A20230101', source: '广州工厂', quantity: '1000' },
  87. { batchNo: 'A20230102', source: '深圳工厂', quantity: '500' }
  88. ],
  89. chain: '经销商A -> 药店B'
  90. },
  91. {
  92. billTime: '2023-01-02 14:30',
  93. billType: '调拨入库',
  94. productName: '三九胃泰',
  95. items: [
  96. { batchNo: 'B20230105', source: '北京仓库', quantity: '200' },
  97. { batchNo: 'B20230106', source: '上海仓库', quantity: '300' },
  98. { batchNo: 'B20230107', source: '武汉仓库', quantity: '150' }
  99. ],
  100. chain: '总仓 -> 分仓'
  101. }
  102. ]
  103. }
  104. },
  105. onLoad(options) {
  106. const info = uni.getSystemInfoSync();
  107. this.statusBarHeight = info.statusBarHeight || 20;
  108. this.title =
  109. options && options.name ? decodeURIComponent(options.name) : "报表详情";
  110. },
  111. methods: {
  112. onBack() {
  113. try {
  114. uni.navigateBack();
  115. } catch (e) { }
  116. },
  117. },
  118. }
  119. </script>
  120. <style scoped>
  121. .nav {
  122. position: fixed;
  123. top: 0;
  124. left: 0;
  125. right: 0;
  126. height: 44px;
  127. background-color: #2c69ff;
  128. display: flex;
  129. align-items: center;
  130. justify-content: center;
  131. }
  132. .nav-title {
  133. font-size: 36rpx;
  134. color: #fff;
  135. font-weight: 700;
  136. }
  137. .nav-back {
  138. position: absolute;
  139. left: 40rpx;
  140. top: 12rpx;
  141. width: 20rpx;
  142. height: 20rpx;
  143. color: #fff;
  144. border-left: 3rpx solid #fff;
  145. border-bottom: 3rpx solid #fff;
  146. transform: rotate(45deg) translateY(56rpx);
  147. margin-left: 40rpx;
  148. margin-top: -6rpx;
  149. }
  150. .page {
  151. height: 100vh;
  152. }
  153. .card {
  154. margin: 24rpx;
  155. background: #fff;
  156. border-radius: 16rpx;
  157. font-size: 32rpx;
  158. }
  159. .header-card {
  160. background: #2c69ff;
  161. border-bottom-left-radius: 32rpx;
  162. border-bottom-right-radius: 32rpx;
  163. padding: 36rpx;
  164. color: #fff;
  165. }
  166. .meta {
  167. display: flex;
  168. align-items: center;
  169. margin: 14rpx 0;
  170. }
  171. .dot {
  172. width: 8rpx;
  173. height: 8rpx;
  174. border-radius: 50%;
  175. background: #fff;
  176. margin-right: 20rpx;
  177. }
  178. .meta-text {
  179. font-size: 32rpx;
  180. }
  181. /* .section-title {
  182. font-size: 32rpx;
  183. font-weight: bold;
  184. color: #333;
  185. margin: 30rpx 24rpx 20rpx;
  186. padding-left: 16rpx;
  187. border-left: 8rpx solid #2c69ff;
  188. line-height: 1;
  189. } */
  190. .section-title {
  191. position: relative;
  192. font-size: 32rpx;
  193. font-weight: bold;
  194. color: #333;
  195. margin: 30rpx 30rpx 20rpx;
  196. }
  197. .section-title::after {
  198. content: "";
  199. position: absolute;
  200. left: -20rpx;
  201. bottom: 8rpx;
  202. width: 8rpx;
  203. height: 50%;
  204. background: #2c69ff;
  205. border-radius: 10px;
  206. }
  207. .table-card {
  208. padding: 0;
  209. overflow: hidden;
  210. }
  211. .table-scroll {
  212. width: 100%;
  213. }
  214. .flow-table {
  215. min-width: 1300rpx;
  216. border-top: 1rpx solid #eee;
  217. border-left: 1rpx solid #eee;
  218. }
  219. .flow-header {
  220. display: flex;
  221. background: #f5f7fa;
  222. font-size: 26rpx;
  223. font-weight: bold;
  224. color: #333;
  225. }
  226. .flow-body {
  227. font-size: 26rpx;
  228. color: #666;
  229. }
  230. .flow-row {
  231. display: flex;
  232. border-bottom: 1rpx solid #eee;
  233. }
  234. .th,
  235. .td {
  236. padding: 16rpx 10rpx;
  237. border-right: 1rpx solid #eee;
  238. display: flex;
  239. align-items: center;
  240. justify-content: center;
  241. text-align: center;
  242. word-break: break-all;
  243. box-sizing: border-box;
  244. flex-shrink: 0;
  245. }
  246. .th {
  247. border-bottom: 1rpx solid #eee;
  248. }
  249. .col-time {
  250. width: 220rpx;
  251. }
  252. .col-type {
  253. width: 160rpx;
  254. }
  255. .col-product {
  256. width: 200rpx;
  257. }
  258. .col-batch {
  259. width: 180rpx;
  260. }
  261. .col-source {
  262. width: 180rpx;
  263. }
  264. .col-qty {
  265. width: 120rpx;
  266. }
  267. .col-chain {
  268. width: 240rpx;
  269. }
  270. .td-group {
  271. display: flex;
  272. flex-direction: column;
  273. width: 480rpx;
  274. flex-shrink: 0;
  275. }
  276. .sub-row {
  277. display: flex;
  278. flex: 1;
  279. border-bottom: 1rpx solid #eee;
  280. }
  281. .sub-row:last-child {
  282. border-bottom: none;
  283. }
  284. </style>