ScanRateTable.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  1. <template>
  2. <view class="section" :style="{
  3. position: 'relative',
  4. zIndex: dropdownOpen || dropdownRegionOpen ? 9 : 'auto',
  5. }">
  6. <view v-if="showHeader" class="section-header">
  7. <text class="section-title">{{ title }}</text>
  8. <view :style="{ display: 'flex' }">
  9. <view v-if="showSelector && tableType === 'variety'" class="selector-wrap">
  10. <view class="selector" @click.stop="toggleDropdownRegion">
  11. <text class="selector-text">{{
  12. region?.regionCode ? region.regionName : "选择省"
  13. }}</text>
  14. <text class="selector-arrow" :class="{ open: dropdownRegionOpen }"></text>
  15. </view>
  16. <view class="dropdown" v-show="dropdownRegionOpen" :style="dropdownDirection === 'top'
  17. ? { top: 'auto', bottom: '48rpx' }
  18. : {}
  19. " @click.stop>
  20. <view class="dropdown-search-bar">
  21. <input class="dropdown-search-input" v-model="regionSearchText" @input="onRegionSearch"
  22. placeholder="搜索..." />
  23. </view>
  24. <scroll-view scroll-y="true" class="dropdown-scroll-view" lower-threshold="80"
  25. @scrolltolower="loadMoreRegions">
  26. <view class="dropdown-item" v-for="(p, i) in regionList" :key="p.regionCode || i" :style="p.regionCode === region?.regionCode
  27. ? {
  28. backgroundColor: '#2c69ff',
  29. color: '#fff',
  30. }
  31. : {}
  32. " @click.stop="selectProduct('region', p)">{{ p.regionName || p }}</view>
  33. <view v-if="regionList.length === 0" class="dropdown-item" style="text-align: center; color: #999;">暂无数据
  34. </view>
  35. </scroll-view>
  36. </view>
  37. </view>
  38. <view v-if="showSelector" class="selector-wrap">
  39. <view class="selector" @click.stop="toggleDropdown">
  40. <text class="selector-text">{{ product?.drugEntBaseInfoId ? product.physicName : '选择品种' }}</text>
  41. <text class="selector-arrow" :class="{ open: dropdownOpen }"></text>
  42. </view>
  43. <view class="dropdown" v-show="dropdownOpen" :style="dropdownDirection === 'top'
  44. ? {
  45. top: 'auto',
  46. bottom: '48rpx',
  47. }
  48. : {}
  49. " @click.stop>
  50. <view class="dropdown-search-bar">
  51. <input class="dropdown-search-input" v-model="productSearchText" @input="onProductSearch"
  52. placeholder="搜索..." />
  53. </view>
  54. <scroll-view scroll-y="true" class="dropdown-scroll-view" lower-threshold="80"
  55. @scrolltolower="loadMoreProducts">
  56. <view class="dropdown-item" v-for="(p, i) in productList" :key="getUid()" :style="p.drugEntBaseInfoId === product?.drugEntBaseInfoId
  57. ? {
  58. backgroundColor: '#2c69ff',
  59. color: '#fff',
  60. }
  61. : {}
  62. " @click.stop="selectProduct('product', p)">{{ p.physicName }}</view>
  63. <view v-if="productList.length === 0" class="dropdown-item" style="text-align: center; color: #999;">暂无数据
  64. </view>
  65. </scroll-view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="table-scroll-x" :style="{
  71. height: list.length < 7 ? 'auto' : tableBodyHeight + 80 + 'rpx',
  72. }">
  73. <scroll-view class="no-scrollbar" :style="{ height: '100%' }" scroll-x="true" scroll-y="true" enhanced
  74. :show-scrollbar="false" @scrolltolower="onScrollToLower">
  75. <view class="card" :style="{ width: tableWidth }">
  76. <view class="table-header" :style="{
  77. position: 'sticky',
  78. top: '0',
  79. zIndex: 10,
  80. fontWeight: headerBold ? 'bold' : 'normal',
  81. }">
  82. <view v-for="(col, ci) in columns" :key="getUid()" class="cell" :style="{
  83. ...headerCellStyle(ci, col),
  84. }">
  85. <view v-if="isPlainTitle(col.title)" :style="{
  86. display: 'flex',
  87. alignItems: 'center',
  88. position: 'relative',
  89. }">
  90. <text>{{ col.title }}</text>
  91. <uni-icons v-if="col.tooltip" type="help" size="16" color="#2c69ff"
  92. @tap.stop.prevent="toggleHeaderTooltip(ci)"></uni-icons>
  93. <view v-if="headerTooltip[ci]" class="header-tooltip-wrap" @click.stop>
  94. <view class="header-tooltip">{{ col.tooltip }}</view>
  95. <view class="header-tooltip-arrow"></view>
  96. </view>
  97. </view>
  98. <rich-text v-else :nodes="titleNodes(col.title)" />
  99. </view>
  100. </view>
  101. <view v-if="!loading && list && list.length > 0" class="table-body">
  102. <template>
  103. <view class="row" v-for="(item, i) in list" :key="getUid()">
  104. <view v-for="(col, ci) in columns" :key="getUid()" class="cell"
  105. :class="{ underline: col.underline, striped: striped && (i + 1) % 2 === 0 }"
  106. :style="bodyCellStyle(ci, col)" @click="handleClick(item, col)">{{ item[col.key] || "--" }}</view>
  107. </view>
  108. <view class="row loading-row" v-if="hasmore">
  109. <view class="loading-wrapper">
  110. <image class="loading-icon" :src="loadingImg" />
  111. </view>
  112. </view>
  113. <view class="row" v-if="showSummary" :style="{
  114. position: 'sticky',
  115. bottom: '0',
  116. zIndex: 5,
  117. backgroundColor: '#fff',
  118. borderTop: '1rpx solid #eef0f4',
  119. color: summaryFontColor,
  120. }">
  121. <view v-for="(col, ci) in columns" :key="getUid()" class="cell" :style="{
  122. ...bodyCellStyle(ci, col),
  123. fontWeight: summaryBold ? 'bold' : 'normal',
  124. }">{{ getSummary(col, ci) }}</view>
  125. </view>
  126. </template>
  127. </view>
  128. </view>
  129. <view v-if="loading" class="no-data-placeholder" :style="{ height: 'auto' }">
  130. <view class="row loading-row">
  131. <view class="loading-wrapper">
  132. <image class="loading-icon" :src="loadingImg" />
  133. </view>
  134. </view>
  135. </view>
  136. <view v-if="!loading && (!list || list.length === 0)" class="no-data-placeholder">
  137. <EmptyView />
  138. </view>
  139. </scroll-view>
  140. <view v-if="loading" class="no-data" :style="{ height: 'auto', top: cellHeight }">
  141. <view class="row loading-row">
  142. <view class="loading-wrapper">
  143. <image class="loading-icon" :src="loadingImg" />
  144. </view>
  145. </view>
  146. </view>
  147. <view v-if="!loading && (!list || list.length === 0)" class="no-data" :style="{ top: cellHeight }">
  148. <EmptyView />
  149. </view>
  150. </view>
  151. </view>
  152. </template>
  153. <script>
  154. import EmptyView from "../../../../wigets/empty.vue";
  155. import loadingImg from "../../../../static/images/loading.png";
  156. import { getUid } from "../../../../utils/utils.js";
  157. import request from '../../../../request/index.js'
  158. import Select from "../../../../wigets/select.vue";
  159. export default {
  160. name: "ScanRateTable",
  161. components: { EmptyView, Select },
  162. props: {
  163. params: {
  164. type: Object,
  165. default: null,
  166. },
  167. scanType: { type: String, default: "1" },
  168. api: {
  169. type: String,
  170. default: "",
  171. },
  172. tableType: { type: String, default: "customer" },
  173. title: { type: String, default: "客户扫码率" },
  174. showSelector: { type: Boolean, default: true },
  175. showHeader: { type: Boolean, default: true },
  176. dropdownDirection: { type: String, default: "bottom" },
  177. showSummary: { type: Boolean, default: true },
  178. striped: { type: Boolean, default: true },
  179. summaryStructure: {
  180. type: Array,
  181. default: () => [
  182. {
  183. key: "totalInRate",
  184. title: "入库扫码率",
  185. },
  186. {
  187. key: "totalOutRate",
  188. title: "出库扫码率",
  189. },
  190. {
  191. key: "totalSelfExaminationRate",
  192. title: "自验证率",
  193. },
  194. ],
  195. },
  196. summaryBold: { type: Boolean, default: false },
  197. summaryFontColor: {
  198. type: String,
  199. default: "#2c69ff",
  200. },
  201. initial: { type: Array, default: () => [] },
  202. products: { type: Array, default: () => [] },
  203. regions: { type: Array, default: () => [] },
  204. cellHeight: {
  205. type: String,
  206. default: "76rpx",
  207. },
  208. tableWidth: {
  209. type: String,
  210. default: "100%",
  211. },
  212. headerFontSize: {
  213. type: String,
  214. default: "32rpx",
  215. },
  216. headerBold: {
  217. type: Boolean,
  218. default: true,
  219. },
  220. bodyFontSize: {
  221. type: String,
  222. default: "32rpx",
  223. },
  224. bodyFontColor: {
  225. type: String,
  226. default: "#2c69ff",
  227. },
  228. columns: {
  229. type: Array,
  230. default: () => [
  231. {
  232. key: "regionName",
  233. title: "区域",
  234. underline: true,
  235. fixed: false,
  236. width: "",
  237. },
  238. {
  239. key: "outScanRate",
  240. title: "出库扫码率",
  241. fixed: false,
  242. width: "",
  243. tooltip:
  244. "客户出库扫码量(与下游入库单中相同的追溯码)/下游企业入库扫码量",
  245. },
  246. {
  247. key: "inScanRate",
  248. title: "入库扫码率",
  249. fixed: false,
  250. width: "",
  251. tooltip:
  252. "客户入库扫码量(与上游出库单中相同的追溯码)/上游企业出库扫码量",
  253. },
  254. {
  255. key: "selfExaminationRate",
  256. title: "自验证率",
  257. fixed: false,
  258. width: "",
  259. tooltip: "客户出库扫码量(与入库单中相同的追溯码)/入库扫码量",
  260. },
  261. ],
  262. },
  263. },
  264. data() {
  265. return {
  266. dropdownOpen: false,
  267. dropdownRegionOpen: false,
  268. list: [],
  269. totalCount: 20,
  270. hasmore: true,
  271. loading: true,
  272. fetchLoading: false,
  273. loadingImg,
  274. product: null,
  275. region: null,
  276. tablePage: 1,
  277. tablePageSize: 7,
  278. summaryData: [],
  279. headerTooltip: {},
  280. regionSearchText: '',
  281. productSearchText: '',
  282. regionList: [],
  283. productList: [],
  284. };
  285. },
  286. computed: {
  287. filteredRegions() {
  288. if (!this.regionSearchText) return this.regions;
  289. const lower = this.regionSearchText.toLowerCase();
  290. return this.regions.filter(r => (r.regionName || r.name || r || '').toString().toLowerCase().indexOf(lower) > -1);
  291. },
  292. filteredProducts() {
  293. if (!this.productSearchText) return this.products;
  294. const lower = this.productSearchText.toLowerCase();
  295. return this.products.filter(p => (p.physicName || '').toLowerCase().indexOf(lower) > -1);
  296. },
  297. tableBodyHeight() {
  298. return 6.3 * 80;
  299. },
  300. },
  301. watch: {
  302. dropdownRegionOpen(val) {
  303. if (val) {
  304. this.regionSearchText = '';
  305. this.initRegionList();
  306. }
  307. },
  308. dropdownOpen(val) {
  309. if (val) {
  310. this.productSearchText = '';
  311. this.initProductList();
  312. }
  313. },
  314. product(val) {
  315. this.resetFetch();
  316. },
  317. region: {
  318. handler(val) {
  319. this.resetFetch();
  320. },
  321. deep: true,
  322. },
  323. params: {
  324. handler(newVal, oldVal) {
  325. if (newVal !== oldVal && JSON.stringify(newVal) === JSON.stringify(oldVal)) return;
  326. this.resetFetch();
  327. },
  328. deep: true,
  329. },
  330. products: {
  331. handler(newVal, oldVal) {
  332. if (this.dropdownOpen) {
  333. this.initProductList();
  334. }
  335. },
  336. deep: true,
  337. },
  338. regions: {
  339. handler(newVal, oldVal) {
  340. if (this.dropdownRegionOpen) {
  341. this.initRegionList();
  342. }
  343. },
  344. deep: true,
  345. },
  346. },
  347. created() {
  348. // this.fetchLoading = false;
  349. // this.isLoading = false;
  350. // this.loading = false;
  351. // this.list =
  352. // this.initial && this.initial.length ? this.initial : this.genRows(7);
  353. // if (this.list.length > this.totalCount) {
  354. // this.list = this.list.slice(0, this.totalCount);
  355. // }
  356. // if (!this.showHeader) {
  357. // this.fetchList();
  358. // } else {
  359. // Promise.all([this.getProviceList(), this.getDrugInfoName()]).then(
  360. // () => { }
  361. // );
  362. // }
  363. this.fetchList();
  364. },
  365. methods: {
  366. initRegionList() {
  367. this.regionList = this.filteredRegions.slice(0, 10);
  368. },
  369. loadMoreRegions(e) {
  370. if (this.regionList.length >= this.filteredRegions.length) return;
  371. const currentLen = this.regionList.length;
  372. const more = this.filteredRegions.slice(currentLen, currentLen + 10);
  373. this.regionList = this.regionList.concat(more);
  374. },
  375. onRegionSearch() {
  376. this.initRegionList();
  377. },
  378. initProductList() {
  379. this.productList = this.filteredProducts.slice(0, 10);
  380. },
  381. loadMoreProducts() {
  382. if (this.productList.length >= this.filteredProducts.length) return;
  383. const currentLen = this.productList.length;
  384. const more = this.filteredProducts.slice(currentLen, currentLen + 10);
  385. this.productList = this.productList.concat(more);
  386. },
  387. onProductSearch() {
  388. this.initProductList();
  389. },
  390. getUid,
  391. getSummary(col, ci) {
  392. if (ci == 0) return "合计";
  393. return this.summaryData[ci];
  394. },
  395. closeAllTooltip() {
  396. this.headerTooltip = {};
  397. },
  398. toggleHeaderTooltip(i) {
  399. const value = !this.headerTooltip[i];
  400. this.headerTooltip = {};
  401. this.$set(this.headerTooltip, i, value);
  402. },
  403. // getUid(len = 16) {
  404. // const ts = Date.now().toString(36);
  405. // const rand = Math.random().toString(36).slice(2);
  406. // return (ts + rand).slice(0, len);
  407. // },
  408. // getProviceList() {
  409. // request('/common/getProviceList', {
  410. // path: 'customerScanningRate/wigets/ScanRateTable.vue',
  411. // }).then(res => {
  412. // if (res.code == 200) {
  413. // const _data = res.data;
  414. // this.regions = _data;
  415. // this.region = this.regions[0];
  416. // }
  417. // })
  418. // },
  419. // getDrugInfoName() {
  420. // request('/bills/getDrugInfoName', {
  421. // path: 'customerScanningRate/wigets/ScanRateTable.vue',
  422. // }).then(res => {
  423. // if (res.code == 200) {
  424. // const _data = res.data;
  425. // this.products = _data;
  426. // this.product = this.products[0];
  427. // }
  428. // })
  429. // },
  430. toggleDropdown() {
  431. if (this.fetchLoading) return;
  432. const next = !this.dropdownOpen;
  433. if (next) this.$emit("dropdown-open", this);
  434. this.dropdownOpen = next;
  435. },
  436. toggleDropdownRegion() {
  437. if (this.fetchLoading) return;
  438. const next = !this.dropdownRegionOpen;
  439. if (next) this.$emit("dropdown-open", this);
  440. this.dropdownRegionOpen = next;
  441. },
  442. selectProduct(type, p) {
  443. // this.$emit("change-product", p);
  444. if (type === "product") {
  445. this.product = p;
  446. this.dropdownOpen = false;
  447. } else if (type === "region") {
  448. this.region = p;
  449. this.dropdownRegionOpen = false;
  450. }
  451. },
  452. closeDropdown() {
  453. this.dropdownOpen = false;
  454. this.dropdownRegionOpen = false;
  455. },
  456. // genRows(n) {
  457. // const regions = ["广东", "广西", "湖南", "湖北", "四川", "浙江", "江苏"];
  458. // const res = [];
  459. // for (let i = 0; i < n; i++) {
  460. // const r = regions[i % regions.length];
  461. // res.push({
  462. // regionName: r,
  463. // outScanRate: `${(95 + (i % 5) * 0.5).toFixed(1)}%`,
  464. // inScanRate: `${(94 + (i % 5) * 0.6).toFixed(1)}%`,
  465. // });
  466. // }
  467. // return res;
  468. // },
  469. onScrollToLower(e) {
  470. if (e?.detail?.direction === 'right') return
  471. // if (!Array.isArray(this.list)) this.list = [];
  472. // if (this.list.length - 1 >= this.totalCount) return;
  473. // if (this.isLoading) return;
  474. // this.isLoading = true;
  475. // const remain = this.totalCount - this.list.length;
  476. // const toAdd = Math.min(7, remain);
  477. // setTimeout(() => {
  478. // if (this.list.length < this.totalCount) {
  479. // const more = this.genRows(toAdd);
  480. // this.list = this.list.concat(more);
  481. // }
  482. // this.isLoading = false;
  483. // }, 1000);
  484. this.fetchList();
  485. },
  486. resetFetch() {
  487. this.tablePage = 1;
  488. this.list = [];
  489. this.loading = true;
  490. this.hasmore = true;
  491. this.fetchList();
  492. },
  493. fetchList() {
  494. if (this._fetchDebounceTimer) clearTimeout(this._fetchDebounceTimer);
  495. const delay = 500;
  496. this._fetchDebounceTimer = setTimeout(() => {
  497. if (!this.hasmore) {
  498. setTimeout(() => {
  499. this.fetchLoading = false;
  500. this.loading = false;
  501. }, 500);
  502. return;
  503. }
  504. if (this.fetchLoading) return;
  505. this.fetchLoading = true;
  506. request(this.api, {
  507. drugEntBaseInfoId: this.product ? (this.product?.drugEntBaseInfoId || '') : '',
  508. regionCode: this.region ? (this.region?.regionCode || '') : '',
  509. ...(this.params || {}),
  510. pageNum: this.tablePage,
  511. pageSize: this.tablePageSize,
  512. path: 'customerScanningRate/wigets/ScanRateTable.vue',
  513. }).then(res => {
  514. if (res.code == 200) {
  515. const _data = res.data || {};
  516. let pageInfo = _data || {};
  517. if (this.tableType !== "variety") {
  518. this.summaryData = [];
  519. this.summaryData[0] = undefined;
  520. this.summaryStructure.forEach((item) => {
  521. this.summaryData.push(_data[item.key] || "--");
  522. });
  523. pageInfo = _data?.pageInfo || {};
  524. }
  525. const { list, total } = pageInfo;
  526. this.totalCount = total || 0;
  527. if (this.list.length >= this.totalCount) {
  528. this.fetchLoading = false;
  529. this.hasmore = false;
  530. this.loading = false;
  531. return;
  532. }
  533. this.list = Array.isArray(list)
  534. ? [...this.list, ...list]
  535. : [...this.list];
  536. if (this.list.length < this.totalCount) {
  537. this.hasmore = true;
  538. this.pageNum++;
  539. } else {
  540. this.hasmore = false;
  541. }
  542. // this.list.push(this.list[0]);
  543. // this.list.push(this.list[0]);
  544. // this.list.push(this.list[0]);
  545. // this.list.push(this.list[0]);
  546. // this.list.push(this.list[0]);
  547. // this.list.push(this.list[0]);
  548. // this.list.push(this.list[0]);
  549. // this.list.push(this.list[0]);
  550. // this.list.push(this.list[0]);
  551. // this.list.push(this.list[0]);
  552. // this.list.push(this.list[0]);
  553. }
  554. this.fetchLoading = false;
  555. this.loading = false;
  556. })
  557. }, delay);
  558. },
  559. headerCellStyle(ci, col) {
  560. const base = this.cellBaseStyle(ci, col);
  561. base.fontSize = this.headerFontSize;
  562. base.position = "sticky";
  563. base.zIndex = 2;
  564. base.top = "0rpx";
  565. if (ci === 0) {
  566. base.zIndex = 3;
  567. }
  568. if (col.fixed) {
  569. base.left = this.stickyLeft(ci);
  570. base.background = "#eaf2ff";
  571. }
  572. return base;
  573. },
  574. bodyCellStyle(ci, col) {
  575. const base = this.cellBaseStyle(ci, col);
  576. base.fontSize = this.bodyFontSize;
  577. base.color = this.bodyFontColor;
  578. if (col.fixed) {
  579. base.position = "sticky";
  580. base.left = this.stickyLeft(ci);
  581. base.zIndex = 2;
  582. }
  583. return base;
  584. },
  585. cellBaseStyle(ci, col) {
  586. const style = {};
  587. style.height = this.cellHeight;
  588. if (col && col.width) {
  589. style.width = col.width;
  590. style.flex = `0 0 ${col.width}`;
  591. } else {
  592. style.flex = 1;
  593. }
  594. return style;
  595. },
  596. stickyLeft(ci) {
  597. const parts = [];
  598. for (let i = 0; i < ci; i++) {
  599. const c = this.columns[i];
  600. if (c && c.fixed && c.width) parts.push(c.width);
  601. }
  602. if (!parts.length) return "0rpx";
  603. if (parts.length === 1) return parts[0];
  604. return `calc(${parts.join(" + ")})`;
  605. },
  606. isPlainTitle(t) {
  607. return typeof t === "string" ? t.indexOf("<") === -1 : true;
  608. },
  609. titleNodes(t) {
  610. if (typeof t !== "string") return t;
  611. let html = String(t);
  612. html = html
  613. .replace(/<\s*view/g, "<div")
  614. .replace(/<\/\s*view\s*>/g, "</div>");
  615. html = html.replace(
  616. /:style=\"\{\s*textAlign:\s*'center'\s*\}\"/g,
  617. 'style="text-align:center;"'
  618. );
  619. return html;
  620. },
  621. handleClick(data, col) {
  622. if (
  623. this.tableType === "variety" ||
  624. this.tableType === "customerDetail" ||
  625. col.key !== "regionName"
  626. )
  627. return;
  628. uni.navigateTo({
  629. url:
  630. "/traceCodePackages/traceabilityReport/pages/customerScanningRate/detail/index?regionCode=" +
  631. data.regionCode +
  632. "&regionName=" +
  633. encodeURIComponent(data.regionName) +
  634. "&drugEntBaseInfoId=" +
  635. this.product.drugEntBaseInfoId +
  636. "&physicName=" +
  637. encodeURIComponent(this.product.physicName) +
  638. "&scanType=" +
  639. this.scanType +
  640. (this.params.type ? "&type=" + this.params.type : ""),
  641. });
  642. },
  643. },
  644. };
  645. </script>
  646. <style scoped>
  647. .section {
  648. margin-top: 24rpx;
  649. transform: translate3d(0, 0, 0);
  650. }
  651. .section-header {
  652. position: relative;
  653. display: flex;
  654. align-items: center;
  655. justify-content: space-between;
  656. padding: 8rpx 8rpx;
  657. }
  658. .section-title {
  659. position: relative;
  660. font-size: 30rpx;
  661. font-weight: bold;
  662. color: #2c69ff;
  663. }
  664. .section-title::after {
  665. content: "";
  666. position: absolute;
  667. left: -20rpx;
  668. bottom: 13rpx;
  669. width: 8rpx;
  670. height: 50%;
  671. background: #2c69ff;
  672. border-radius: 10px;
  673. }
  674. .selector-wrap {
  675. position: relative;
  676. margin-right: 40rpx;
  677. }
  678. .selector {
  679. position: relative;
  680. display: flex;
  681. align-items: center;
  682. color: #2c69ff;
  683. padding-right: 30rpx;
  684. }
  685. .selector-text {
  686. font-size: 30rpx;
  687. max-width: 180rpx;
  688. overflow: hidden;
  689. white-space: nowrap;
  690. text-overflow: ellipsis;
  691. display: inline-block;
  692. }
  693. .selector-arrow {
  694. position: absolute;
  695. right: 0rpx;
  696. bottom: 14rpx;
  697. font-size: 30rpx;
  698. display: inline-block;
  699. width: 15rpx;
  700. height: 15rpx;
  701. border: 5rpx solid #2c69ff;
  702. border-top: none;
  703. border-left: none;
  704. transform-origin: 50% 50%;
  705. transform: rotate(45deg);
  706. transition: transform 0.2s;
  707. }
  708. .selector-arrow.open {
  709. bottom: 7rpx;
  710. transform: rotate(225deg);
  711. }
  712. .dropdown {
  713. position: absolute;
  714. right: 0rpx;
  715. top: 54rpx;
  716. width: 310rpx;
  717. max-height: 380rpx;
  718. background: #fff;
  719. border: 1rpx solid #eef0f4;
  720. border-radius: 12rpx;
  721. box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08);
  722. z-index: 1000;
  723. overflow: hidden;
  724. }
  725. .dropdown-search-bar {
  726. padding: 10rpx;
  727. border-bottom: 1rpx solid #f0f2f5;
  728. background: #fff;
  729. z-index: 1001;
  730. }
  731. .dropdown-search-input {
  732. width: 100%;
  733. height: 60rpx;
  734. background: #f5f7fa;
  735. border-radius: 8rpx;
  736. padding: 0 20rpx;
  737. font-size: 28rpx;
  738. box-sizing: border-box;
  739. }
  740. .dropdown-scroll-view {
  741. flex: 1;
  742. width: 100%;
  743. max-height: 260rpx;
  744. /* Adjusted height to fit search bar */
  745. overflow-y: auto;
  746. }
  747. .dropdown-item {
  748. padding: 16rpx 24rpx;
  749. font-size: 28rpx;
  750. color: #333;
  751. text-wrap: wrap;
  752. }
  753. .dropdown-item+.dropdown-item {
  754. border-top: 1rpx solid #f0f2f5;
  755. }
  756. .table-scroll-x {
  757. position: relative;
  758. margin-top: 12rpx;
  759. width: 100%;
  760. min-height: 120rpx;
  761. border-radius: 16rpx;
  762. overflow: visible;
  763. }
  764. .card {
  765. background: #fff;
  766. color: #2c69ff;
  767. font-size: 32rpx;
  768. }
  769. .table-header {
  770. display: flex;
  771. background: #eaf2ff;
  772. font-weight: bold;
  773. border-top-left-radius: 16rpx;
  774. border-top-right-radius: 16rpx;
  775. }
  776. /* .table-body {
  777. margin-top: 8rpx;
  778. } */
  779. .row {
  780. display: flex;
  781. align-items: center;
  782. border-bottom: 1rpx solid #eef0f4;
  783. }
  784. .row:last-child,
  785. .row:nth-last-child(2) {
  786. border-bottom: none;
  787. }
  788. .loading-row {
  789. justify-content: flex-start;
  790. }
  791. .loading-wrapper {
  792. width: calc(100vw - 60rpx);
  793. height: 76rpx;
  794. display: flex;
  795. align-items: center;
  796. justify-content: center;
  797. position: sticky;
  798. top: 50%;
  799. left: 0;
  800. }
  801. .loading-icon {
  802. width: 40rpx;
  803. height: 40rpx;
  804. animation: spin 1s linear infinite;
  805. }
  806. @keyframes spin {
  807. from {
  808. transform: rotate(0deg);
  809. }
  810. to {
  811. transform: rotate(360deg);
  812. }
  813. }
  814. .cell {
  815. flex: 1;
  816. display: flex;
  817. align-items: center;
  818. justify-content: center;
  819. height: 76rpx;
  820. }
  821. .table-body .cell {
  822. background-color: #fff;
  823. }
  824. .table-body .striped {
  825. background: #f7f7f7;
  826. }
  827. .underline {
  828. text-decoration: underline;
  829. }
  830. /* hide scrollbars for H5/App while preserving scroll behavior */
  831. .no-scrollbar {
  832. position: relative;
  833. -ms-overflow-style: none;
  834. scrollbar-width: none;
  835. z-index: 2;
  836. }
  837. ::v-deep .no-scrollbar::-webkit-scrollbar {
  838. display: none !important;
  839. width: 0 !important;
  840. height: 0 !important;
  841. -webkit-appearance: none;
  842. background: transparent;
  843. }
  844. .header-tooltip-wrap {
  845. position: absolute;
  846. top: 60rpx;
  847. right: 0rpx;
  848. z-index: 1000;
  849. }
  850. .header-tooltip {
  851. background: #000;
  852. color: #fff;
  853. border-radius: 8rpx;
  854. padding: 8rpx 12rpx;
  855. font-size: 24rpx;
  856. width: 270rpx;
  857. }
  858. .header-tooltip-arrow {
  859. position: absolute;
  860. top: -11rpx;
  861. right: 20rpx;
  862. width: 0;
  863. height: 0;
  864. border-left: 10rpx solid transparent;
  865. border-right: 10rpx solid transparent;
  866. border-bottom: 12rpx solid #000;
  867. margin: 0 auto;
  868. }
  869. .no-data-placeholder {
  870. opacity: 0;
  871. }
  872. .no-data {
  873. position: absolute;
  874. top: 76rpx;
  875. left: 0;
  876. width: 100%;
  877. z-index: 1;
  878. }
  879. </style>