index.vue 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430
  1. <template>
  2. <Water></Water>
  3. <scroll-view
  4. class="detail-page"
  5. :style="{ height: pageHeight }"
  6. :scroll-top="scrollTopValue"
  7. :scroll-into-view="scrollIntoViewId"
  8. scroll-y="true"
  9. scroll-with-animation
  10. lower-threshold="80"
  11. @scroll="onPageScroll"
  12. @scrolltolower="onTimelineScrollToLower"
  13. v-if="!!data && !loading">
  14. <view id="detailPageTopAnchor"></view>
  15. <view class="detail-card detail-bg" :style="{ backgroundImage: 'url(' + bg + ')' }">
  16. <view class="detail-drug-title">{{ data.physicName }}</view>
  17. <view class="detail-row detail-traceability">
  18. <view class="detail-label">追溯码:</view>
  19. <view class="detail-value detail-wrap">{{ formatTraceCode(traceCode) }}</view>
  20. <view class="detail-copy-btn" @click="copy(traceCode)">
  21. <image src="../../../static/images/copy.png" mode="scaleToFill" :style="{ width: '30rpx', height: '30rpx' }" />
  22. </view>
  23. </view>
  24. <view class="detail-row">
  25. <view class="detail-label">生产企业:</view>
  26. <view
  27. class="detail-value detail-wrap detail-company-value"
  28. :class="{ 'detail-clamp': !companyExpanded }"
  29. :style="{ marginBottom: needCompanyToggle ? '40rpx' : undefined }"
  30. id="companyValue">
  31. <text>{{ data.produceEntName }}</text>
  32. </view>
  33. <text v-if="needCompanyToggle" class="detail-expand-tag" @click="toggleCompanyExpand">{{ companyExpanded ? "收起" : "展开" }}</text>
  34. </view>
  35. <view class="detail-row">
  36. <view class="detail-label">批准文号:</view>
  37. <view class="detail-value">{{ data.approveNo }}</view>
  38. </view>
  39. <view class="detail-row">
  40. <view class="detail-label">生产日期:</view>
  41. <view class="detail-value">{{ data.produceDate }}</view>
  42. </view>
  43. <view class="detail-row" v-show="cardExpanded">
  44. <view class="detail-label">产品批号:</view>
  45. <view class="detail-value">{{ data.produceBatchNo }}</view>
  46. </view>
  47. <view class="detail-row" v-show="cardExpanded">
  48. <view class="detail-label"> 剂<text :style="{ opacity: 0 }">剂型</text>型:</view>
  49. <view class="detail-value">{{ data.prepnDesc }}</view>
  50. </view>
  51. <view class="detail-row" v-show="cardExpanded">
  52. <view class="detail-label">包装规格:</view>
  53. <view class="detail-value">{{ data.prepnSpec }}</view>
  54. </view>
  55. <view class="detail-row" v-show="cardExpanded">
  56. <view class="detail-label">有效期至:</view>
  57. <view class="detail-value">{{ data.validEndDate }}</view>
  58. </view>
  59. <view class="detail-card-toggle" @click="toggleCardExpand">
  60. <uni-icons :type="cardExpanded ? 'up' : 'down'" size="18" color="#9aa4b2"></uni-icons>
  61. </view>
  62. </view>
  63. <view class="detail-timeline detail-bg" :style="{ backgroundImage: 'url(' + bg + ')' }">
  64. <view class="detail-section-header">
  65. <view class="detail-section-title">扫码跟踪</view>
  66. <!-- <view class="detail-section-actions">
  67. <view class="detail-section-action" @tap="toggleTimelineView">
  68. <uni-icons
  69. :type="timelineView === 'text' ? 'image' : 'list'"
  70. size="20"
  71. color="#59a8f2"
  72. ></uni-icons>
  73. <text>{{ timelineView === "text" ? "查看图形" : "查看文字" }}</text>
  74. </view>
  75. <view class="detail-section-action" @tap="onSetDefaultView">
  76. <uni-icons type="gear" size="20" color="#59a8f2"></uni-icons>
  77. <text>设置默认</text>
  78. </view>
  79. </view> -->
  80. </view>
  81. <!-- <view class="detail-graph-panel" v-if="timelineView === 'graph'">
  82. <view class="graph-mode-row">
  83. <view class="graph-mode-left">
  84. <view class="graph-mode-title">货权流向模式</view>
  85. <view class="graph-mode-desc"
  86. >开启后则会按照码的实际实物货权关系,将委托企业(若有)还原到收发货企业上并绘制流向图。</view
  87. >
  88. </view>
  89. <switch
  90. :checked="ownershipFlowMode"
  91. color="#2c69ff"
  92. @change="onOwnershipModeChange"
  93. />
  94. </view>
  95. <view
  96. :style="{
  97. width: graphViewWidth + 'px',
  98. height: graphViewHeight + 'px',
  99. }"
  100. v-if="isShowGraph"
  101. >
  102. <l-echart
  103. ref="chartRef"
  104. :beforeDelay="180"
  105. :lStyle="`width:${graphViewWidth}px;height:${graphViewHeight}px;`"
  106. @finished="initChart"
  107. ></l-echart>
  108. </view>
  109. <view
  110. :style="{
  111. width: graphViewWidth + 'px',
  112. height: graphViewHeight + 'px',
  113. display: 'flex',
  114. alignItems: 'center',
  115. justifyContent: 'center',
  116. }"
  117. v-else
  118. >
  119. 链路过长无法展示
  120. </view>
  121. </view> -->
  122. <view class="detail-timeline-toolbar" v-if="timelineView === 'text'">
  123. <view class="detail-toolbar-btn" @tap.stop="setAllTimelineDetail(true)">全部展示详情</view>
  124. <view class="detail-toolbar-btn" @tap.stop="setAllTimelineDetail(false)">全部展示概要</view>
  125. </view>
  126. <view
  127. v-if="timelineView === 'text'"
  128. class="detail-timeline-item"
  129. :class="{ 'detail-timeline-item-first': i === 0 }"
  130. v-for="(value, i) in visibleBillDetailList"
  131. :key="i">
  132. <view class="detail-left">
  133. <view class="detail-dot" :class="{ 'detail-fill': false }"></view>
  134. <view class="detail-line" v-if="i < visibleBillDetailList.length - 1 || hasMoreTimelineItems"></view>
  135. </view>
  136. <view class="detail-right">
  137. <view class="detail-title-row">
  138. <view class="detail-title" :class="{ 'detail-bold': true }"> {{ value.billTypeName || "--" }} {{ value.billCode || "" }} </view>
  139. <view class="detail-item-toggle" @tap.stop="toggleTimelineItem(i)">
  140. {{ value._showDetail ? "概要" : "详情" }}
  141. <uni-icons :type="value._showDetail ? 'up' : 'down'" size="14" color="#888"></uni-icons>
  142. </view>
  143. </view>
  144. <view class="detail-info-row">
  145. <text class="detail-info-label">发货企业:</text>
  146. <text class="detail-info-value">{{ value.fromEntName || "--" }}</text>
  147. </view>
  148. <view class="detail-tag-row" v-if="value._showDetail && value.fromEntType !== '1'">
  149. <text class="detail-tag" v-if="value.fromCustomerNature">{{ value.fromCustomerNature }}</text>
  150. <text class="detail-tag" v-if="value.fromCustomerLevel">{{ value.fromCustomerLevel }}</text>
  151. <text class="detail-tag" v-if="value.fromResponsibleManager">{{ value.fromResponsibleManager }}</text>
  152. </view>
  153. <view class="detail-tag-row" v-if="value._showDetail">
  154. <text class="detail-tag" :style="getTagColorStyle(value.fromEntTypeName)" v-if="value.fromEntTypeName">{{ value.fromEntTypeName }}</text>
  155. <text class="detail-tag detail-tag-region" v-if="getRegionByPrefix(value, 'from')">{{ getRegionByPrefix(value, "from") }}</text>
  156. </view>
  157. <view class="detail-info-row">
  158. <text class="detail-info-label">收货企业:</text>
  159. <text class="detail-info-value">{{ value.toEntName || "--" }}</text>
  160. </view>
  161. <view class="detail-tag-row" v-if="value._showDetail && value.toEntType !== '1'">
  162. <text class="detail-tag" v-if="value.toCustomerNature">{{ value.toCustomerNature }}</text>
  163. <text class="detail-tag" v-if="value.toCustomerLevel">{{ value.toCustomerLevel }}</text>
  164. <text class="detail-tag" v-if="value.toResponsibleManager">{{ value.toResponsibleManager }}</text>
  165. </view>
  166. <view class="detail-tag-row" v-if="value._showDetail">
  167. <text class="detail-tag" :style="getTagColorStyle(value.toEntTypeName)" v-if="value.toEntTypeName">{{ value.toEntTypeName }}</text>
  168. <text class="detail-tag detail-tag-region" v-if="getRegionByPrefix(value, 'to')">{{ getRegionByPrefix(value, "to") }}</text>
  169. </view>
  170. <view class="detail-info-row">
  171. <text class="detail-info-label">入出库时间:</text>
  172. <text class="detail-info-value">{{ value.billTime || "--" }}</text>
  173. </view>
  174. <view class="detail-info-row" v-if="value._showDetail && value.uploadEntName">
  175. <text class="detail-info-label">上传企业:</text>
  176. <text class="detail-info-value">{{ value.uploadEntName }}</text>
  177. </view>
  178. <view class="detail-tag-row" v-if="value._showDetail && value.uploadEntName && value.uploadEntType !== '1'">
  179. <text class="detail-tag" v-if="value.uploadCustomerNature">{{ value.uploadCustomerNature }}</text>
  180. <text class="detail-tag" v-if="value.uploadCustomerLevel">{{ value.uploadCustomerLevel }}</text>
  181. <text class="detail-tag" v-if="value.uploadResponsibleManager">{{ value.uploadResponsibleManager }}</text>
  182. </view>
  183. <view class="detail-tag-row" v-if="value._showDetail && value.uploadEntName">
  184. <text class="detail-tag" :style="getTagColorStyle(value.uploadEntTypeName)" v-if="value.uploadEntTypeName">{{ value.uploadEntTypeName }}</text>
  185. <text class="detail-tag detail-tag-region" v-if="getRegionByPrefix(value, 'upload')">{{ getRegionByPrefix(value, "upload") }}</text>
  186. </view>
  187. <view class="detail-info-row" v-if="value._showDetail && value.uploadEntName">
  188. <text class="detail-info-label">上传时间:</text>
  189. <text class="detail-info-value">{{ value.uploadTime || "--" }}</text>
  190. </view>
  191. <view class="detail-info-row" v-if="value._showDetail && value.disEntName">
  192. <text class="detail-info-label">配送企业:</text>
  193. <text class="detail-info-value">{{ value.disEntName }}</text>
  194. </view>
  195. <view class="detail-tag-row" v-if="value._showDetail && value.disEntName && !value.disEntName.includes(',') && value.disEntType !== '1'">
  196. <text class="detail-tag" v-if="value.disCustomerNature">{{ value.disCustomerNature }}</text>
  197. <text class="detail-tag" v-if="value.disCustomerLevel">{{ value.disCustomerLevel }}</text>
  198. <text class="detail-tag" v-if="value.disResponsibleManager">{{ value.disResponsibleManager }}</text>
  199. </view>
  200. <view class="detail-tag-row" v-if="value._showDetail && value.disEntName && !value.disEntName.includes(',')">
  201. <text class="detail-tag" :style="getTagColorStyle(value.disEntTypeName)" v-if="value.disEntTypeName">{{ value.disEntTypeName }}</text>
  202. <text class="detail-tag detail-tag-region" v-if="getRegionByPrefix(value, 'dis')">{{ getRegionByPrefix(value, "dis") }}</text>
  203. </view>
  204. <view class="detail-info-row" v-if="value._showDetail && value.assEntName">
  205. <text class="detail-info-label">委托企业:</text>
  206. <text class="detail-info-value">{{ value.assEntName }}</text>
  207. </view>
  208. <view class="detail-tag-row" v-if="value._showDetail && value.assEntName && value.assEntType !== '1'">
  209. <text class="detail-tag" v-if="value.assCustomerNature">{{ value.assCustomerNature }}</text>
  210. <text class="detail-tag" v-if="value.assCustomerLevel">{{ value.assCustomerLevel }}</text>
  211. <text class="detail-tag" v-if="value.assResponsibleManager">{{ value.assResponsibleManager }}</text>
  212. </view>
  213. <view class="detail-tag-row" v-if="value._showDetail && value.assEntName">
  214. <text class="detail-tag" :style="getTagColorStyle(value.assEntTypeName)" v-if="value.assEntTypeName">{{ value.assEntTypeName }}</text>
  215. <text class="detail-tag detail-tag-region" v-if="getRegionByPrefix(value, 'ass')">{{ getRegionByPrefix(value, "ass") }}</text>
  216. </view>
  217. </view>
  218. </view>
  219. <view v-if="timelineView === 'text' && hasMoreTimelineItems" class="detail-timeline-loadmore">
  220. 上拉加载更多({{ visibleBillDetailList.length }}/{{ timelineTotalCount }})
  221. </view>
  222. </view>
  223. </scroll-view>
  224. <transition name="back-top-fade">
  225. <view v-if="!!data && !loading && showBackTopButton" class="detail-back-top-btn" @tap="backToTop">
  226. <view class="detail-back-top-arrow"></view>
  227. </view>
  228. </transition>
  229. <view class="detail-page-empty" :style="{ height: pageHeight }" v-if="!data && !loading">
  230. <image src="../../../static/images/empty.png" mode="scaleToFill" :style="{ width: '264rpx', height: '200rpx' }" />
  231. <text
  232. :style="{
  233. fontSize: '24rpx',
  234. color: '#99a1ad',
  235. marginTop: '60rpx',
  236. textAlign: 'center',
  237. }"
  238. >所查询药品所在生产企业尚未纳入扫码范围,后续将进一步扩大,敬请期待</text
  239. >
  240. </view>
  241. <view class="detail-page-empty" :style="{ height: pageHeight }" v-if="loading">
  242. <image src="../../../static/images/loading.png" mode="scaleToFill" :style="{ width: '50rpx', height: '50rpx' }" class="detail-loading" />
  243. </view>
  244. </template>
  245. <script>
  246. import bg from "../../../static/images/bg.png";
  247. import { formatDate } from "../../../utils/utils.js";
  248. import request from "../../../request/index.js";
  249. import Water from "@/components/water/water.vue";
  250. // import lEchart from "../../../uni_modules/lime-echart/components/l-echart/l-echart.vue";
  251. // const echarts = require("../../../static/js/echarts.min.js");
  252. export default {
  253. components: {
  254. Water,
  255. // lEchart,
  256. },
  257. data() {
  258. return {
  259. data: null,
  260. loading: true,
  261. statusBarHeight: 20,
  262. traceCode: "",
  263. pageHeight: 0,
  264. bg,
  265. companyExpanded: true,
  266. needCompanyToggle: false,
  267. cardExpanded: false,
  268. allTimelineDetail: false,
  269. timelineView: "text",
  270. defaultTimelineViewKey: "traceabilityCodeQuery.detail.timelineDefaultView",
  271. imageData: [],
  272. graphViewWidth: 300,
  273. graphViewHeight: 480,
  274. chartInstance: null,
  275. chartOption: {},
  276. ownershipFlowMode: false,
  277. timelinePageSize: 20,
  278. timelineVisibleCount: 20,
  279. scrollTopValue: 0,
  280. scrollIntoViewId: "",
  281. backTopThreshold: 0,
  282. showBackTopButton: false,
  283. backTopHideTimer: null,
  284. };
  285. },
  286. onLoad(options) {
  287. const info = uni.getSystemInfoSync();
  288. this.statusBarHeight = info.statusBarHeight || 20;
  289. this.pageHeight = (info.windowHeight && info.windowHeight + "px") || "100%";
  290. this.backTopThreshold = info.windowHeight || 667;
  291. this.graphViewWidth = Math.max((info.windowWidth || 375) - 36, 280);
  292. this.graphViewHeight = Math.max((info.windowHeight || 667) - 200, 420);
  293. if (options.traceCode) {
  294. this.traceCode = options.traceCode;
  295. }
  296. // const defaultView = uni.getStorageSync(this.defaultTimelineViewKey);
  297. // if (defaultView === "graph" || defaultView === "text") {
  298. // this.timelineView = defaultView;
  299. // }
  300. // this.getData(options.traceCode);
  301. this.getData2(options.traceCode);
  302. },
  303. onReady() {
  304. this.$nextTick(() => {
  305. const info = uni.getSystemInfoSync();
  306. const lineHeightPx = (info.windowWidth / 750) * 40;
  307. this.companyExpanded = true; // 展开测量高度
  308. uni
  309. .createSelectorQuery()
  310. .in(this)
  311. .select("#companyValue")
  312. .boundingClientRect((rect) => {
  313. if (!rect || !lineHeightPx) return;
  314. const lines = Math.round(rect.height / lineHeightPx);
  315. this.needCompanyToggle = lines > 2;
  316. this.companyExpanded = !this.needCompanyToggle;
  317. })
  318. .exec();
  319. });
  320. },
  321. onReachBottom() {
  322. if (this.timelineView !== "text") return;
  323. this.loadMoreTimelineItems();
  324. },
  325. // 页面卸载时销毁图表实例
  326. // beforeUnmount() {
  327. // if (this.backTopHideTimer) {
  328. // clearTimeout(this.backTopHideTimer);
  329. // this.backTopHideTimer = null;
  330. // }
  331. // if (this.$refs.chartRef) {
  332. // this.$refs.chartRef.dispose();
  333. // }
  334. // },
  335. computed: {
  336. isShowGraph() {
  337. return this.data.billDetailList.length < 30;
  338. },
  339. timelineTotalCount() {
  340. if (!this.data || !Array.isArray(this.data.billDetailList)) return 0;
  341. return this.data.billDetailList.length;
  342. },
  343. visibleBillDetailList() {
  344. if (!this.data || !Array.isArray(this.data.billDetailList)) return [];
  345. const maxCount = Math.min(this.timelineVisibleCount, this.timelineTotalCount);
  346. return this.data.billDetailList.slice(0, maxCount);
  347. },
  348. hasMoreTimelineItems() {
  349. return this.visibleBillDetailList.length < this.timelineTotalCount;
  350. },
  351. },
  352. methods: {
  353. getTagColorStyle(tag) {
  354. let color = "#57bfe1";
  355. if (tag.includes("生产")) color = "#f5c269";
  356. if (tag.includes("零售")) color = "#91c76d";
  357. return {
  358. color,
  359. borderColor: color + "80",
  360. };
  361. },
  362. // 初始化图表
  363. // async initChart() {
  364. // if (
  365. // !this.$refs.chartRef ||
  366. // !this.isShowGraph ||
  367. // this.timelineView !== "graph"
  368. // )
  369. // return;
  370. // let option = {};
  371. // const data = [];
  372. // const links = [];
  373. // const selfCurveness = 0.5;
  374. // const curveness = 0.7;
  375. // const lineWidth = 2;
  376. // const length = this.imageData.length;
  377. // const x = 350;
  378. // const offset = 200;
  379. // let i = 0;
  380. // this.imageData.forEach((item, index) => {
  381. // const { name, to } = item;
  382. // const toLen = to.length;
  383. // const y = index * 250 + 100;
  384. // const color = name.includes("生产")
  385. // ? "#fde58f"
  386. // : name.includes("零售")
  387. // ? "#b5ea8e"
  388. // : name.includes("消费者")
  389. // ? "#e0d3fe"
  390. // : "#a3e6ff";
  391. // data.push({
  392. // name,
  393. // x,
  394. // y,
  395. // itemStyle: {
  396. // color,
  397. // },
  398. // });
  399. // to.forEach((toItem, toIndex) => {
  400. // const { name: toName, text: toText } = toItem;
  401. // if (name.includes(toName)) {
  402. // data.push({
  403. // name: toText,
  404. // x,
  405. // y: y - 200,
  406. // itemStyle: {
  407. // color: "rgba(0,0,0,0)",
  408. // },
  409. // label: {
  410. // show: true,
  411. // color: "#c6c6c6",
  412. // },
  413. // tooltip: {
  414. // show: false,
  415. // },
  416. // });
  417. // links.push(
  418. // {
  419. // source: name,
  420. // target: toText,
  421. // label: {
  422. // show: false,
  423. // },
  424. // lineStyle: {
  425. // color: "#c6c6c6",
  426. // width: lineWidth,
  427. // curveness: selfCurveness,
  428. // },
  429. // },
  430. // {
  431. // source: toText,
  432. // target: name,
  433. // label: {
  434. // show: false,
  435. // },
  436. // lineStyle: {
  437. // color: "#c6c6c6",
  438. // width: lineWidth,
  439. // curveness: selfCurveness,
  440. // },
  441. // },
  442. // );
  443. // } else {
  444. // const isOut = toText.includes("出库");
  445. // links.push({
  446. // source: name,
  447. // target: toName,
  448. // label: {
  449. // show: true,
  450. // formatter: (params) => {
  451. // const text = toText;
  452. // if (!text) return "";
  453. // return text.split(/\s+/).filter(Boolean).join("\n");
  454. // },
  455. // color: isOut ? "#80a6fd" : "#aaaaaa",
  456. // fontSize: 12,
  457. // rotate: 0,
  458. // width: 100,
  459. // overflow: "breakAll",
  460. // },
  461. // lineStyle: {
  462. // color: isOut ? "#80a6fd" : "#aaaaaa",
  463. // width: lineWidth,
  464. // curveness: isOut ? curveness : -curveness,
  465. // },
  466. // });
  467. // }
  468. // });
  469. // });
  470. // console.log("this.imageData", this.imageData);
  471. // console.log("data", data);
  472. // console.log("links", links);
  473. // option = {
  474. // tooltip: {},
  475. // animationDurationUpdate: 1500,
  476. // animationEasingUpdate: "quinticInOut",
  477. // series: [
  478. // {
  479. // type: "graph",
  480. // layout: "none",
  481. // symbolSize: 80,
  482. // roam: true,
  483. // label: {
  484. // show: true,
  485. // formatter: (params) => {
  486. // const text = String((params && params.name) || "");
  487. // if (!text) return "";
  488. // return text.split(/\s+/).filter(Boolean).join("\n");
  489. // },
  490. // },
  491. // edgeSymbol: ["circle", "arrow"],
  492. // edgeSymbolSize: [4, 10],
  493. // data,
  494. // links,
  495. // lineStyle: {
  496. // opacity: 0.9,
  497. // width: 2,
  498. // curveness: 0,
  499. // },
  500. // },
  501. // ],
  502. // };
  503. // try {
  504. // await this.$nextTick();
  505. // // if (this.chartInstance) {
  506. // // this.chartInstance.setOption(option, true);
  507. // // return;
  508. // // }
  509. // this.chartInstance = await this.$refs.chartRef.init(echarts);
  510. // this.chartInstance.setOption(option, true);
  511. // } catch (error) {
  512. // console.error("图表初始化失败:", error);
  513. // }
  514. // },
  515. // 更新图表数据
  516. updateChart(newOption) {
  517. if (this.chartInstance) {
  518. this.chartInstance.setOption(newOption);
  519. } else if (this.$refs.chartRef) {
  520. this.$refs.chartRef.setOption(newOption);
  521. }
  522. },
  523. // 调整图表大小
  524. resizeChart() {
  525. if (this.$refs.chartRef) {
  526. this.$refs.chartRef.resize();
  527. }
  528. },
  529. formatDate(date) {
  530. return formatDate({ date }, "YYYY-MM-DD");
  531. },
  532. getRegion(value = {}) {
  533. const { provinceDesc, cityDesc, areaDesc } = value;
  534. return [provinceDesc, cityDesc, areaDesc].filter(Boolean).join(",") || "";
  535. },
  536. getRegionByPrefix(value = {}, prefix = "from") {
  537. const province = value[`${prefix}ProvinceDesc`];
  538. const city = value[`${prefix}CityDesc`];
  539. const area = value[`${prefix}AreaDesc`];
  540. return [province, city, area].filter(Boolean).join("-") || "";
  541. },
  542. initTimelineVisibleCount() {
  543. this.timelineVisibleCount = this.timelinePageSize;
  544. },
  545. onPageScroll(e) {
  546. const top = Number((e && e.detail && e.detail.scrollTop) || 0);
  547. if (top < this.backTopThreshold) {
  548. this.showBackTopButton = false;
  549. if (this.backTopHideTimer) {
  550. clearTimeout(this.backTopHideTimer);
  551. this.backTopHideTimer = null;
  552. }
  553. return;
  554. }
  555. this.showBackTopButton = true;
  556. if (this.backTopHideTimer) {
  557. clearTimeout(this.backTopHideTimer);
  558. }
  559. this.backTopHideTimer = setTimeout(() => {
  560. this.showBackTopButton = false;
  561. this.backTopHideTimer = null;
  562. }, 3000);
  563. },
  564. backToTop() {
  565. this.scrollTopValue = 0;
  566. this.scrollIntoViewId = "detailPageTopAnchor";
  567. this.showBackTopButton = false;
  568. if (this.backTopHideTimer) {
  569. clearTimeout(this.backTopHideTimer);
  570. this.backTopHideTimer = null;
  571. }
  572. this.$nextTick(() => {
  573. this.scrollIntoViewId = "";
  574. });
  575. },
  576. onTimelineScrollToLower() {
  577. if (this.timelineView !== "text") return;
  578. this.loadMoreTimelineItems();
  579. },
  580. loadMoreTimelineItems() {
  581. if (!this.hasMoreTimelineItems) return;
  582. this.timelineVisibleCount = Math.min(this.timelineVisibleCount + this.timelinePageSize, this.timelineTotalCount);
  583. },
  584. toggleTimelineItem(index) {
  585. if (!this.data || !Array.isArray(this.data.billDetailList)) return;
  586. const item = this.data.billDetailList[index];
  587. if (!item) return;
  588. this.$set(item, "_showDetail", !item._showDetail);
  589. },
  590. setAllTimelineDetail(showDetail) {
  591. this.allTimelineDetail = !!showDetail;
  592. if (!this.data || !Array.isArray(this.data.billDetailList)) return;
  593. this.data.billDetailList.forEach((item) => {
  594. if (item) this.$set(item, "_showDetail", !!showDetail);
  595. });
  596. },
  597. toggleTimelineView() {
  598. this.timelineView = this.timelineView === "text" ? "graph" : "text";
  599. if (this.timelineView === "text") {
  600. this.initTimelineVisibleCount();
  601. }
  602. if (this.timelineView === "graph" && this.data && Array.isArray(this.data.billDetailList)) {
  603. this.imageData = this.ownershipFlowMode ? this.buildImageData2(this.data.billDetailList) : this.buildImageData(this.data.billDetailList);
  604. this.updateGraphCanvasSize();
  605. this.$nextTick(() => this.initChart());
  606. }
  607. },
  608. onOwnershipModeChange(e) {
  609. this.ownershipFlowMode = !!(e && e.detail && e.detail.value);
  610. if (!this.data || !Array.isArray(this.data.billDetailList)) return;
  611. this.imageData = this.ownershipFlowMode ? this.buildImageData2(this.data.billDetailList) : this.buildImageData(this.data.billDetailList);
  612. this.updateGraphCanvasSize();
  613. if (this.timelineView === "graph") {
  614. this.$nextTick(() => this.initChart());
  615. }
  616. },
  617. onSetDefaultView() {
  618. uni.setStorageSync(this.defaultTimelineViewKey, this.timelineView);
  619. uni.showToast({
  620. title: "已设为默认",
  621. icon: "none",
  622. });
  623. },
  624. buildImageData2(data) {
  625. if (!data || !Array.isArray(data)) return [];
  626. const list = [];
  627. const buildTime = (time) => {
  628. return time.split(" ")[0];
  629. };
  630. const buildTo = (to, item) => {
  631. const hasAss = !!item.assEntName;
  632. const hasType = item.billTypeName && item.billTypeName !== "****";
  633. if (item.billTypeName === "使用出库") {
  634. to.push({
  635. name: "消费者",
  636. text: !hasType ? "****" : buildTime(item.billTime) + " " + item.billTypeName,
  637. });
  638. } else if (item.toEntName) {
  639. const address = [item.toProvinceDesc, item.toCityDesc, item.toAreaDesc].filter(Boolean).join(",");
  640. to.push({
  641. name: item.toEntTypeName + " " + item.toEntName + " " + address,
  642. text: !hasType ? "****" : buildTime(item.billTime) + " " + item.billTypeName,
  643. });
  644. if (hasAss && hasType) {
  645. to[to.length - 1].text += " 被委托:" + item.fromEntName;
  646. }
  647. }
  648. return to;
  649. };
  650. data.forEach((item, i) => {
  651. const hasAss = !!item.assEntName;
  652. const index = list.findIndex((i) => i.name.includes(hasAss ? item.assEntName : item.fromEntName));
  653. let to = [];
  654. if (index !== -1) {
  655. to = list[index].to;
  656. }
  657. to = buildTo(to, item);
  658. if (index === -1) {
  659. const address = (hasAss ? [item.assProvinceDesc, item.assCityDesc, item.assAreaDesc] : [item.fromProvinceDesc, item.fromCityDesc, item.fromAreaDesc])
  660. .filter(Boolean)
  661. .join(",");
  662. const name = hasAss ? item.assEntTypeName + " " + item.assEntName + " " + address : item.fromEntTypeName + " " + item.fromEntName + " " + address;
  663. list.push({
  664. num: i,
  665. name,
  666. to,
  667. });
  668. } else {
  669. list[index].to = to;
  670. }
  671. if (item.toEntName && list.findIndex((i) => i.name.includes(item.toEntName)) === -1) {
  672. const address = [item.toProvinceDesc, item.toCityDesc, item.toAreaDesc].filter(Boolean).join(",");
  673. list.push({
  674. num: i + 9999,
  675. name: item.toEntTypeName + " " + item.toEntName + " " + address,
  676. to: [],
  677. });
  678. }
  679. });
  680. const lastItem = list[list.length - 1];
  681. if (lastItem?.to?.[0]?.name === "消费者") {
  682. list.push({
  683. num: 99999,
  684. name: "消费者",
  685. to: [],
  686. });
  687. }
  688. list.sort((a, b) => a.num - b.num);
  689. return list;
  690. },
  691. buildImageData(data) {
  692. if (!data || !Array.isArray(data)) return [];
  693. const list = [];
  694. const buildTime = (time) => {
  695. return time.split(" ")[0];
  696. };
  697. const buildTo = (to, item) => {
  698. const hasType = item.billTypeName && item.billTypeName !== "****";
  699. if (item.billTypeName === "使用出库") {
  700. to.push({
  701. name: "消费者",
  702. text: !hasType ? "****" : buildTime(item.billTime) + " " + item.billTypeName,
  703. });
  704. } else if (item.toEntName) {
  705. const address = [item.toProvinceDesc, item.toCityDesc, item.toAreaDesc].filter(Boolean).join(",");
  706. to.push({
  707. name: item.toEntTypeName + " " + item.toEntName + " " + address,
  708. text: !hasType ? "****" : buildTime(item.billTime) + " " + item.billTypeName,
  709. });
  710. if (item.assEntName && hasType) {
  711. to[to.length - 1].text += " 委托:" + item.assEntName;
  712. }
  713. }
  714. return to;
  715. };
  716. data.forEach((item, i) => {
  717. const index = list.findIndex((i) => i.name.includes(item.fromEntName));
  718. let to = [];
  719. if (index !== -1) {
  720. to = list[index].to;
  721. }
  722. to = buildTo(to, item);
  723. if (index === -1) {
  724. const address = [item.fromProvinceDesc, item.fromCityDesc, item.fromAreaDesc].filter(Boolean).join(",");
  725. list.push({
  726. num: i,
  727. name: item.fromEntTypeName + " " + item.fromEntName + " " + address,
  728. to,
  729. });
  730. } else {
  731. list[index].to = to;
  732. }
  733. if (item.toEntName && list.findIndex((i) => i.name.includes(item.toEntName)) === -1) {
  734. const address = [item.toProvinceDesc, item.toCityDesc, item.toAreaDesc].filter(Boolean).join(",");
  735. list.push({
  736. num: i + 9999,
  737. name: item.toEntTypeName + " " + item.toEntName + " " + address,
  738. to: [],
  739. });
  740. }
  741. });
  742. const lastItem = list[list.length - 1];
  743. if (lastItem?.to?.[0]?.name === "消费者") {
  744. list.push({
  745. num: 99999,
  746. name: "消费者",
  747. to: [],
  748. });
  749. }
  750. list.sort((a, b) => a.num - b.num);
  751. return list;
  752. },
  753. updateGraphCanvasSize() {
  754. if (!this.isShowGraph) {
  755. this.graphViewHeight = 50;
  756. return;
  757. }
  758. const list = this.imageData || [];
  759. const top = 90;
  760. const bottom = 90;
  761. const vGap = 170;
  762. const nodeCount = list.length || 1;
  763. this.graphViewHeight = Math.max(520, top + bottom + (nodeCount - 1) * vGap);
  764. },
  765. getData2(traceCode) {
  766. request("/bills/scanCode2", {
  767. tracCode: traceCode,
  768. path: "/traceabilityCodeQuery/pages/detail/index.vue",
  769. }).then((res) => {
  770. if (res.code == 200) {
  771. const _data = res.data;
  772. this.data = _data || null;
  773. if (this.data && Array.isArray(this.data.billDetailList)) {
  774. this.data.billDetailList = this.data.billDetailList.map((item) => ({
  775. ...item,
  776. _showDetail: !!this.allTimelineDetail,
  777. }));
  778. // this.initTimelineVisibleCount();
  779. // if (this.isShowGraph) {
  780. // this.imageData = this.ownershipFlowMode
  781. // ? this.buildImageData2(this.data.billDetailList)
  782. // : this.buildImageData(this.data.billDetailList);
  783. // }
  784. // this.updateGraphCanvasSize();
  785. // this.initChart();
  786. }
  787. if (typeof _data === "object" && Object.values(_data).filter((i) => !!i).length == 0) {
  788. this.data = null;
  789. }
  790. this.loading = false;
  791. } else {
  792. uni.showToast({ title: "查询失败", icon: "none" });
  793. }
  794. });
  795. },
  796. getData(traceCode) {
  797. request("/bills/scanCode", {
  798. tracCode: traceCode,
  799. path: "/traceabilityCodeQuery/pages/detail/index.vue",
  800. }).then((res) => {
  801. if (res.code == 200) {
  802. // const _data = res.data;
  803. // this.data = _data || null;
  804. // const defaultData = [
  805. // {
  806. // billTypeName: "生产入库",
  807. // billCode: "SYS_IN_2025041410194699357",
  808. // fromEntId: "00000000000000959808",
  809. // fromEntName: "惠州市九惠制药股份有限公司",
  810. // fromEntType: "1",
  811. // fromEntTypeName: "生产企业",
  812. // fromProvinceDesc: "广东省",
  813. // fromCityDesc: "惠州市",
  814. // fromAreaDesc: "惠城区",
  815. // toEntId: "00000000000000959808",
  816. // toEntName: "惠州市九惠制药股份有限公司",
  817. // toEntType: "1",
  818. // toEntTypeName: "生产企业",
  819. // toProvinceDesc: "广东省",
  820. // toCityDesc: "惠州市",
  821. // toAreaDesc: "惠城区",
  822. // billTime: "2025-04-12 00:00:00",
  823. // uploadEntId: "00000000000000959808",
  824. // uploadEntName: "惠州市九惠制药股份有限公司",
  825. // uploadEntType: "1",
  826. // uploadEntTypeName: "生产企业",
  827. // uploadProvinceDesc: "广东省",
  828. // uploadCityDesc: "惠州市",
  829. // uploadAreaDesc: "惠城区",
  830. // uploadTime: "2025-04-14 10:19:47",
  831. // },
  832. // {
  833. // billTypeName: "销售出库",
  834. // billCode: "20250414093811017995",
  835. // fromEntId: "00000000000000959808",
  836. // fromEntName: "惠州市九惠制药股份有限公司",
  837. // fromEntType: "1",
  838. // fromEntTypeName: "生产企业",
  839. // fromProvinceDesc: "广东省",
  840. // fromCityDesc: "惠州市",
  841. // fromAreaDesc: "惠城区",
  842. // toEntId: "00000000000012618117",
  843. // toEntName: "深圳华润三九医药贸易有限公司",
  844. // toEntType: "2",
  845. // toEntTypeName: "批发企业",
  846. // toProvinceDesc: "广东省",
  847. // toCityDesc: "深圳市",
  848. // toAreaDesc: "龙华区",
  849. // billTime: "2025-04-14 09:38:11",
  850. // uploadEntId: "00000000000000592642",
  851. // uploadEntName: "华润三九医药股份有限公司",
  852. // uploadEntType: "1",
  853. // uploadEntTypeName: "生产企业",
  854. // uploadProvinceDesc: "广东省",
  855. // uploadCityDesc: "深圳市",
  856. // uploadAreaDesc: "龙华区",
  857. // uploadTime: "2025-10-31 17:29:36",
  858. // },
  859. // {
  860. // billTypeName: "销售出库",
  861. // billCode: "2504032G-2",
  862. // fromEntId: "00000000000012618117",
  863. // fromEntName: "深圳华润三九医药贸易有限公司",
  864. // fromEntType: "2",
  865. // fromEntTypeName: "批发企业",
  866. // fromProvinceDesc: "广东省",
  867. // fromCityDesc: "深圳市",
  868. // fromAreaDesc: "龙华区",
  869. // toEntId: "8b63aa19a9a94cb6aa472ee69d309bb5",
  870. // toEntName: "国药控股福建有限公司",
  871. // toEntType: "5",
  872. // toEntTypeName: "物流企业",
  873. // toProvinceDesc: "福建省",
  874. // toCityDesc: "厦门市",
  875. // toAreaDesc: "思明区",
  876. // billTime: "2025-09-27 00:00:00",
  877. // uploadEntId: "00000000000012618117",
  878. // uploadEntName: "深圳华润三九医药贸易有限公司",
  879. // uploadEntType: "2",
  880. // uploadEntTypeName: "批发企业",
  881. // uploadProvinceDesc: "广东省",
  882. // uploadCityDesc: "深圳市",
  883. // uploadAreaDesc: "龙华区",
  884. // uploadTime: "2025-09-28 10:04:12",
  885. // },
  886. // {
  887. // billTypeName: "采购入库",
  888. // billCode: "2504032G-1",
  889. // fromEntId: "00000000000000592642",
  890. // fromEntName: "华润三九医药股份有限公司",
  891. // fromEntType: "1",
  892. // fromEntTypeName: "生产企业",
  893. // fromProvinceDesc: "广东省",
  894. // fromCityDesc: "深圳市",
  895. // fromAreaDesc: "龙华区",
  896. // toEntId: "00000000000012618117",
  897. // toEntName: "深圳华润三九医药贸易有限公司",
  898. // toEntType: "2",
  899. // toEntTypeName: "批发企业",
  900. // toProvinceDesc: "广东省",
  901. // toCityDesc: "深圳市",
  902. // toAreaDesc: "龙华区",
  903. // billTime: "2025-09-27 00:00:00",
  904. // uploadEntId: "00000000000000592642",
  905. // uploadEntName: "华润三九医药股份有限公司",
  906. // uploadEntType: "1",
  907. // uploadEntTypeName: "生产企业",
  908. // uploadProvinceDesc: "广东省",
  909. // uploadCityDesc: "深圳市",
  910. // uploadAreaDesc: "龙华区",
  911. // uploadTime: "2025-09-28 10:04:06",
  912. // },
  913. // {
  914. // billTypeName: "采购入库",
  915. // billCode: "FJASNP2509280580393",
  916. // fromEntId: "00000000000012618117",
  917. // fromEntName: "深圳华润三九医药贸易有限公司",
  918. // fromEntType: "2",
  919. // fromEntTypeName: "批发企业",
  920. // fromProvinceDesc: "广东省",
  921. // fromCityDesc: "深圳市",
  922. // fromAreaDesc: "龙华区",
  923. // toEntId: "8b63aa19a9a94cb6aa472ee69d309bb5",
  924. // toEntName: "国药控股福建有限公司",
  925. // toEntType: "5",
  926. // toEntTypeName: "物流企业",
  927. // toProvinceDesc: "福建省",
  928. // toCityDesc: "厦门市",
  929. // toAreaDesc: "思明区",
  930. // billTime: "2025-10-30 00:00:00",
  931. // uploadEntId: "00000000000012618117",
  932. // uploadEntName: "深圳华润三九医药贸易有限公司",
  933. // uploadEntType: "2",
  934. // uploadEntTypeName: "批发企业",
  935. // uploadProvinceDesc: "广东省",
  936. // uploadCityDesc: "深圳市",
  937. // uploadAreaDesc: "龙华区",
  938. // uploadTime: "2025-10-30 17:05:35",
  939. // },
  940. // {
  941. // billTypeName: "销售出库",
  942. // billCode: "FJS0CFFPHL",
  943. // fromEntId: "8b63aa19a9a94cb6aa472ee69d309bb5",
  944. // fromEntName: "国药控股福建有限公司",
  945. // fromEntType: "5",
  946. // fromEntTypeName: "物流企业",
  947. // fromProvinceDesc: "福建省",
  948. // fromCityDesc: "厦门市",
  949. // fromAreaDesc: "思明区",
  950. // toEntId: "00000000000001312166",
  951. // toEntName: "国药控股厦门有限公司",
  952. // toEntType: "2",
  953. // toEntTypeName: "批发企业",
  954. // toProvinceDesc: "福建省",
  955. // toCityDesc: "厦门市",
  956. // toAreaDesc: "同安区",
  957. // billTime: "2025-10-31 00:00:00",
  958. // uploadEntId: "8b63aa19a9a94cb6aa472ee69d309bb5",
  959. // uploadEntName: "国药控股福建有限公司",
  960. // uploadEntType: "5",
  961. // uploadEntTypeName: "物流企业",
  962. // uploadProvinceDesc: "福建省",
  963. // uploadCityDesc: "厦门市",
  964. // uploadAreaDesc: "思明区",
  965. // uploadTime: "2025-11-01 00:03:29",
  966. // },
  967. // {
  968. // billTypeName: "采购入库",
  969. // billCode: "XMASNP2510310469890",
  970. // fromEntId: "8b63aa19a9a94cb6aa472ee69d309bb5",
  971. // fromEntName: "国药控股福建有限公司",
  972. // fromEntType: "5",
  973. // fromEntTypeName: "物流企业",
  974. // fromProvinceDesc: "福建省",
  975. // fromCityDesc: "厦门市",
  976. // fromAreaDesc: "思明区",
  977. // toEntId: "00000000000001312166",
  978. // toEntName: "国药控股厦门有限公司",
  979. // toEntType: "2",
  980. // toEntTypeName: "批发企业",
  981. // toProvinceDesc: "福建省",
  982. // toCityDesc: "厦门市",
  983. // toAreaDesc: "同安区",
  984. // billTime: "2025-11-03 00:00:00",
  985. // uploadEntId: "8b63aa19a9a94cb6aa472ee69d309bb5",
  986. // uploadEntName: "国药控股福建有限公司",
  987. // uploadEntType: "5",
  988. // uploadEntTypeName: "物流企业",
  989. // uploadProvinceDesc: "福建省",
  990. // uploadCityDesc: "厦门市",
  991. // uploadAreaDesc: "思明区",
  992. // uploadTime: "2025-11-03 17:14:48",
  993. // },
  994. // ];
  995. // this.imageData = this.buildImageData(defaultData);
  996. // this.updateGraphCanvasSize();
  997. // this.initChart();
  998. // if (
  999. // typeof _data === "object" &&
  1000. // Object.values(_data).filter((i) => !!i).length == 0
  1001. // ) {
  1002. // this.data = null;
  1003. // }
  1004. // this.loading = false;
  1005. // } else {
  1006. // uni.showToast({ title: "查询失败", icon: "none" });
  1007. // }
  1008. }
  1009. });
  1010. },
  1011. copy(text) {
  1012. const data = String(text || this.traceCode);
  1013. uni.setClipboardData({
  1014. data,
  1015. success: () => {
  1016. console.log("packages/traceabilityCodeQuery/pages/detail/index.vue" + "storage" + "clipboardData");
  1017. uni.showToast({
  1018. title: "已复制追溯码",
  1019. icon: "none",
  1020. duration: 2000,
  1021. });
  1022. },
  1023. });
  1024. },
  1025. toggleCompanyExpand() {
  1026. if (!this.needCompanyToggle) return;
  1027. this.companyExpanded = !this.companyExpanded;
  1028. },
  1029. toggleCardExpand() {
  1030. this.cardExpanded = !this.cardExpanded;
  1031. },
  1032. formatTraceCode(traceCode) {
  1033. return String(traceCode || "")
  1034. .replace(/(.{5})/g, "$1 ")
  1035. .trim();
  1036. },
  1037. },
  1038. };
  1039. </script>
  1040. <style>
  1041. .detail-bg {
  1042. background-position: center top;
  1043. background-size: 100% auto;
  1044. }
  1045. .detail-page {
  1046. box-sizing: border-box;
  1047. background: rgb(226 226 226);
  1048. padding-bottom: 50rpx;
  1049. overflow: auto;
  1050. }
  1051. .detail-page-empty {
  1052. box-sizing: border-box;
  1053. display: flex;
  1054. flex-direction: column;
  1055. align-items: center;
  1056. justify-content: center;
  1057. padding: 0 136rpx 280rpx;
  1058. }
  1059. .detail-back-top-btn {
  1060. position: fixed;
  1061. right: 28rpx;
  1062. bottom: 110rpx;
  1063. width: 84rpx;
  1064. height: 84rpx;
  1065. border-radius: 50%;
  1066. background: #fff;
  1067. display: flex;
  1068. align-items: center;
  1069. justify-content: center;
  1070. box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.18);
  1071. z-index: 999;
  1072. }
  1073. .back-top-fade-enter-active,
  1074. .back-top-fade-leave-active {
  1075. transition:
  1076. opacity 0.28s ease,
  1077. transform 0.28s ease;
  1078. }
  1079. .back-top-fade-enter-from,
  1080. .back-top-fade-leave-to {
  1081. opacity: 0;
  1082. transform: translateY(16rpx) scale(0.92);
  1083. }
  1084. .detail-back-top-arrow {
  1085. width: 20rpx;
  1086. height: 20rpx;
  1087. border-top: 4rpx solid #5f6773;
  1088. border-left: 4rpx solid #5f6773;
  1089. transform: rotate(45deg);
  1090. margin-top: 8rpx;
  1091. }
  1092. .detail-card {
  1093. padding: 40rpx;
  1094. }
  1095. .detail-drug-title {
  1096. font-size: 45rpx;
  1097. font-weight: 800;
  1098. color: #000;
  1099. margin-bottom: 16rpx;
  1100. }
  1101. .detail-row {
  1102. position: relative;
  1103. display: flex;
  1104. margin-top: 12rpx;
  1105. align-items: baseline;
  1106. }
  1107. .detail-label {
  1108. flex-shrink: 0;
  1109. display: inline-block;
  1110. vertical-align: baseline;
  1111. width: 150rpx;
  1112. font-size: 28rpx;
  1113. }
  1114. .detail-value {
  1115. display: inline-block;
  1116. vertical-align: baseline;
  1117. font-size: 28rpx;
  1118. }
  1119. .detail-company-value {
  1120. line-height: 40rpx;
  1121. }
  1122. .detail-company-value.detail-clamp {
  1123. display: -webkit-box;
  1124. -webkit-box-orient: vertical;
  1125. -webkit-line-clamp: 2;
  1126. overflow: hidden;
  1127. }
  1128. .detail-expand-tag {
  1129. position: absolute;
  1130. left: 150rpx;
  1131. bottom: 0;
  1132. color: #2c69ff;
  1133. font-size: 28rpx;
  1134. }
  1135. .detail-value.detail-wrap {
  1136. word-break: break-all;
  1137. white-space: normal;
  1138. }
  1139. .detail-copy-btn {
  1140. margin-left: 16rpx;
  1141. display: flex;
  1142. align-items: center;
  1143. color: #2c69ff;
  1144. }
  1145. .detail-copy-text {
  1146. margin-left: 6rpx;
  1147. font-size: 26rpx;
  1148. }
  1149. .detail-traceability {
  1150. font-size: 24rpx;
  1151. margin: -10rpx 0 45rpx;
  1152. }
  1153. .detail-card-toggle {
  1154. display: flex;
  1155. justify-content: center;
  1156. align-items: center;
  1157. padding-top: 18rpx;
  1158. }
  1159. .detail-traceability .detail-label {
  1160. width: auto;
  1161. }
  1162. .detail-section-header {
  1163. padding: 30rpx 24rpx 20rpx 46rpx;
  1164. border-bottom: 1rpx solid #55555526;
  1165. display: flex;
  1166. justify-content: space-between;
  1167. align-items: center;
  1168. }
  1169. .detail-section-title {
  1170. font-size: 35rpx;
  1171. font-weight: 900;
  1172. }
  1173. .detail-section-actions {
  1174. display: flex;
  1175. align-items: center;
  1176. gap: 12rpx;
  1177. }
  1178. .detail-section-action {
  1179. font-size: 26rpx;
  1180. color: #59a8f2;
  1181. padding: 4rpx 6rpx;
  1182. display: flex;
  1183. align-items: center;
  1184. gap: 6rpx;
  1185. }
  1186. .detail-section-action.active {
  1187. color: #2c69ff;
  1188. font-weight: 600;
  1189. }
  1190. .detail-timeline {
  1191. margin-top: 20rpx;
  1192. padding-bottom: 50rpx;
  1193. }
  1194. .detail-graph-placeholder {
  1195. margin: 16rpx 20rpx 0;
  1196. background: #fff;
  1197. border-radius: 14rpx;
  1198. font-size: 24rpx;
  1199. text-align: center;
  1200. color: #97a0ae;
  1201. padding: 120rpx 20rpx;
  1202. }
  1203. .detail-graph-panel {
  1204. margin: 16rpx 20rpx 0;
  1205. background: #fff;
  1206. border-radius: 14rpx;
  1207. padding: 16rpx;
  1208. }
  1209. .graph-mode-row {
  1210. display: flex;
  1211. align-items: flex-start;
  1212. justify-content: space-between;
  1213. gap: 18rpx;
  1214. margin-bottom: 18rpx;
  1215. padding: 4rpx 6rpx 0;
  1216. }
  1217. .graph-mode-left {
  1218. flex: 1;
  1219. }
  1220. .graph-mode-title {
  1221. font-size: 30rpx;
  1222. color: #333;
  1223. font-weight: 600;
  1224. }
  1225. .graph-mode-desc {
  1226. margin-top: 8rpx;
  1227. font-size: 24rpx;
  1228. color: #8d96a0;
  1229. line-height: 1.45;
  1230. }
  1231. .detail-graph-canvas {
  1232. width: 100%;
  1233. height: 920rpx;
  1234. background: #f8fafc;
  1235. border-radius: 10rpx;
  1236. }
  1237. .detail-timeline-toolbar {
  1238. display: flex;
  1239. gap: 16rpx;
  1240. padding: 20rpx 32rpx 10rpx;
  1241. }
  1242. .detail-toolbar-btn {
  1243. padding: 8rpx 18rpx;
  1244. border: 1rpx solid #d8dbe0;
  1245. border-radius: 999rpx;
  1246. color: #666;
  1247. font-size: 24rpx;
  1248. background: #fff;
  1249. }
  1250. .detail-timeline-item {
  1251. position: relative;
  1252. display: flex;
  1253. margin-left: 36rpx;
  1254. }
  1255. .detail-timeline-item-first {
  1256. margin-top: 20rpx;
  1257. }
  1258. .detail-timeline-loadmore {
  1259. text-align: center;
  1260. color: #8f98a3;
  1261. font-size: 24rpx;
  1262. padding: 18rpx 0 8rpx;
  1263. }
  1264. .detail-left {
  1265. position: absolute;
  1266. top: 34rpx;
  1267. left: 0;
  1268. height: 100%;
  1269. display: flex;
  1270. align-items: center;
  1271. flex-direction: column;
  1272. }
  1273. .detail-dot {
  1274. width: 16rpx;
  1275. height: 16rpx;
  1276. border-radius: 50%;
  1277. border: 2rpx solid #2c69ff;
  1278. }
  1279. .detail-dot.detail-fill {
  1280. background: #2c69ff;
  1281. border-color: #2c69ff;
  1282. }
  1283. .detail-line {
  1284. width: 2rpx;
  1285. flex: 1;
  1286. background: #8face68f;
  1287. margin-right: 2rpx;
  1288. }
  1289. .detail-right {
  1290. flex: 1;
  1291. padding: 20rpx 0;
  1292. margin-left: 45rpx;
  1293. border-bottom: 1rpx solid #55555526;
  1294. }
  1295. .detail-title-row {
  1296. display: flex;
  1297. justify-content: space-between;
  1298. align-items: flex-start;
  1299. gap: 16rpx;
  1300. }
  1301. .detail-title {
  1302. font-size: 32rpx;
  1303. color: #333;
  1304. }
  1305. .detail-title.detail-bold {
  1306. font-weight: 800;
  1307. }
  1308. .detail-item-toggle {
  1309. flex-shrink: 0;
  1310. padding: 6rpx 12rpx;
  1311. border: 1rpx solid #d8dbe0;
  1312. border-radius: 999rpx;
  1313. font-size: 22rpx;
  1314. color: #666;
  1315. display: flex;
  1316. align-items: center;
  1317. gap: 6rpx;
  1318. margin-right: 16rpx;
  1319. }
  1320. .detail-info-row {
  1321. display: flex;
  1322. margin-top: 10rpx;
  1323. font-size: 28rpx;
  1324. color: #444;
  1325. }
  1326. .detail-info-label {
  1327. color: #666;
  1328. flex-shrink: 0;
  1329. }
  1330. .detail-info-value {
  1331. color: #333;
  1332. word-break: break-all;
  1333. }
  1334. .detail-tag-row {
  1335. display: flex;
  1336. flex-wrap: wrap;
  1337. gap: 10rpx;
  1338. margin-top: 8rpx;
  1339. padding-left: 130rpx;
  1340. }
  1341. .detail-tag {
  1342. color: #57bfe1;
  1343. border-radius: 8rpx;
  1344. padding: 5rpx 14rpx;
  1345. font-size: 22rpx;
  1346. border: 1rpx solid #57bfe180;
  1347. }
  1348. .detail-tag-region {
  1349. color: #999;
  1350. border: 1rpx solid #d8dbe0;
  1351. }
  1352. .detail-text-red {
  1353. color: red;
  1354. }
  1355. .detail-loading {
  1356. animation: spin 1s linear infinite;
  1357. }
  1358. @keyframes spin {
  1359. from {
  1360. transform: rotate(0deg);
  1361. }
  1362. to {
  1363. transform: rotate(360deg);
  1364. }
  1365. }
  1366. </style>