index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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. billTime: "2023-01-02 14:30",
  125. billType: "调拨入库",
  126. productName: "三九胃泰",
  127. items: [
  128. { batchNo: "B20230105", source: "北京仓库", quantity: "200" },
  129. { batchNo: "B20230106", source: "上海仓库", quantity: "300" },
  130. { batchNo: "B20230107", source: "武汉仓库", quantity: "150" },
  131. ],
  132. chain: "总仓 -> 分仓",
  133. },
  134. ],
  135. };
  136. },
  137. onLoad(options) {
  138. const info = uni.getSystemInfoSync();
  139. this.statusBarHeight = info.statusBarHeight || 20;
  140. this.title =
  141. options && options.name ? decodeURIComponent(options.name) : "报表详情";
  142. },
  143. methods: {
  144. onBack() {
  145. try {
  146. uni.navigateBack();
  147. } catch (e) {}
  148. },
  149. },
  150. };
  151. </script>
  152. <style scoped>
  153. .nav {
  154. position: fixed;
  155. top: 0;
  156. left: 0;
  157. right: 0;
  158. height: 44px;
  159. background-color: #2c69ff;
  160. display: flex;
  161. align-items: center;
  162. justify-content: center;
  163. }
  164. .nav-title {
  165. font-size: 36rpx;
  166. color: #fff;
  167. font-weight: 700;
  168. }
  169. .nav-back {
  170. position: absolute;
  171. left: 40rpx;
  172. top: 12rpx;
  173. width: 20rpx;
  174. height: 20rpx;
  175. color: #fff;
  176. border-left: 3rpx solid #fff;
  177. border-bottom: 3rpx solid #fff;
  178. transform: rotate(45deg) translateY(56rpx);
  179. margin-left: 40rpx;
  180. margin-top: -6rpx;
  181. }
  182. .page {
  183. height: 100vh;
  184. }
  185. .card {
  186. margin: 24rpx;
  187. background: #fff;
  188. border-radius: 16rpx;
  189. font-size: 32rpx;
  190. }
  191. .header-card {
  192. background: #2c69ff;
  193. border-bottom-left-radius: 32rpx;
  194. border-bottom-right-radius: 32rpx;
  195. padding: 36rpx;
  196. color: #fff;
  197. }
  198. .meta {
  199. display: flex;
  200. align-items: center;
  201. margin: 14rpx 0;
  202. }
  203. .dot {
  204. width: 8rpx;
  205. height: 8rpx;
  206. border-radius: 50%;
  207. background: #fff;
  208. margin-right: 20rpx;
  209. }
  210. .meta-text {
  211. font-size: 32rpx;
  212. }
  213. .section-title {
  214. position: relative;
  215. font-size: 32rpx;
  216. font-weight: bold;
  217. color: #333;
  218. margin: 30rpx 30rpx 20rpx;
  219. }
  220. .section-title::after {
  221. content: "";
  222. position: absolute;
  223. left: -20rpx;
  224. bottom: 8rpx;
  225. width: 8rpx;
  226. height: 50%;
  227. background: #2c69ff;
  228. border-radius: 10px;
  229. }
  230. .table-card {
  231. padding: 0;
  232. overflow: hidden;
  233. }
  234. .table-scroll {
  235. width: 100%;
  236. }
  237. .flow-table {
  238. min-width: 1300rpx;
  239. border-top: 1rpx solid #ccc;
  240. border-left: 1rpx solid #ccc;
  241. }
  242. .flow-header {
  243. display: flex;
  244. background: #f5f7fa;
  245. font-size: 26rpx;
  246. font-weight: bold;
  247. color: #2c69ff;
  248. }
  249. .flow-body {
  250. font-size: 26rpx;
  251. color: #666;
  252. }
  253. .flow-row {
  254. display: flex;
  255. border-bottom: 1rpx solid #ccc;
  256. }
  257. .flow-row:nth-child(even) {
  258. background-color: #f7f7f7;
  259. }
  260. .th,
  261. .td {
  262. padding: 16rpx 10rpx;
  263. border-right: 1rpx solid #ccc;
  264. display: flex;
  265. align-items: center;
  266. justify-content: center;
  267. text-align: center;
  268. word-break: break-all;
  269. box-sizing: border-box;
  270. flex-shrink: 0;
  271. }
  272. .th {
  273. border-bottom: 1rpx solid #ccc;
  274. }
  275. .col-time {
  276. width: 220rpx;
  277. }
  278. .col-type {
  279. width: 160rpx;
  280. }
  281. .col-product {
  282. width: 200rpx;
  283. }
  284. .col-batch {
  285. width: 180rpx;
  286. }
  287. .col-source {
  288. width: 180rpx;
  289. }
  290. .col-qty {
  291. width: 120rpx;
  292. }
  293. .col-chain {
  294. width: 240rpx;
  295. }
  296. .td-group {
  297. display: flex;
  298. flex-direction: column;
  299. width: 480rpx;
  300. flex-shrink: 0;
  301. }
  302. .sub-row {
  303. display: flex;
  304. flex: 1;
  305. border-bottom: 1rpx solid #ccc;
  306. }
  307. .sub-row:last-child {
  308. border-bottom: none;
  309. }
  310. </style>