index.vue 6.8 KB

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