index.vue 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237
  1. <template>
  2. <view class="report-export-page">
  3. <view class="report-export-search-bar-container">
  4. <view class="report-export-search-bar">
  5. <view class="report-export-search-input-wrap">
  6. <image
  7. src="../../../static/images/search.png"
  8. mode="scaleToFill"
  9. class="report-export-search-icon"
  10. />
  11. <input
  12. class="report-export-search-input"
  13. v-model="keyword"
  14. placeholder="搜索公司"
  15. />
  16. <view class="report-export-search-btn" @click="onSearch">搜索</view>
  17. </view>
  18. <view class="report-export-filter-btn" @click="onFilter">
  19. <image
  20. src="../../../static/images/filter.png"
  21. mode="scaleToFill"
  22. class="report-export-filter-icon"
  23. />
  24. <text class="report-export-filter-text">筛选</text>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="scan-rate-ranges-container">
  29. <view class="scan-rate-ranges">
  30. <view class="scan-rate-ranges-content">
  31. <view
  32. v-for="(value, i) in options.status"
  33. :key="value"
  34. class="scan-rate-range"
  35. :class="{
  36. 'scan-rate-active': filterForm.status == value,
  37. }"
  38. @click.stop="pickFilterOption('status', value)"
  39. >{{ value }}</view
  40. >
  41. </view>
  42. </view>
  43. </view>
  44. <view
  45. v-if="loading"
  46. class="report-export-list-scroll"
  47. :style="{ height: 'auto' }"
  48. >
  49. <view class="report-export-loading-row">
  50. <view class="report-export-loading-wrapper">
  51. <image
  52. class="report-export-loading-icon"
  53. src="../../../static/images/loading.png"
  54. />
  55. </view>
  56. </view>
  57. </view>
  58. <scroll-view
  59. v-else-if="list.length > 0"
  60. class="report-export-list-scroll"
  61. scroll-y="true"
  62. :style="{ height: listViewHeight }"
  63. @scrolltolower="onScrollToLower"
  64. >
  65. <view
  66. class="report-export-item-card"
  67. v-for="(item, i) in list"
  68. :key="item.id"
  69. >
  70. <view class="report-export-item-header">
  71. <text class="report-export-item-title" @click="showModal(item)"
  72. >{{ getCustomerName(item) }}报表</text
  73. >
  74. <text
  75. class="report-export-status"
  76. :class="'report-export-status-' + item.status"
  77. >{{ getStatusText(item.status) }}</text
  78. >
  79. </view>
  80. <view class="report-export-item-row"
  81. >品种:{{ item.physicName || "" }}</view
  82. >
  83. <view class="report-export-item-row"
  84. >规格:{{ item.pkgSpec || "" }}</view
  85. >
  86. <view class="report-export-item-row"
  87. >时间:{{ formatDate(item.beginTime) }}--{{
  88. formatDate(item.endTime)
  89. }}</view
  90. >
  91. <view v-if="item.status == 2" class="report-export-progress-wrap">
  92. <view class="report-export-progress">
  93. <view
  94. class="report-export-progress-fill"
  95. :style="{ width: item.progress || 0 + '%' }"
  96. ></view>
  97. <text class="report-export-progress-text">{{
  98. item.progress || 0
  99. }}</text>
  100. </view>
  101. </view>
  102. <view v-if="item.status == 1" class="report-export-action-row">
  103. <view
  104. class="report-export-action-btn report-export-primary"
  105. @click="onStart(item)"
  106. >
  107. 确认开始计算
  108. </view>
  109. </view>
  110. <view v-else-if="item.status == 3" class="report-export-action-row">
  111. <view
  112. class="report-export-action-btn report-export-info"
  113. @click="toDetail(item)"
  114. >查看</view
  115. >
  116. <view
  117. class="report-export-action-btn report-export-primary"
  118. @click="onSend(item)"
  119. >
  120. 导出
  121. </view>
  122. </view>
  123. </view>
  124. <view class="report-export-loading-row" v-if="hasmore">
  125. <view class="report-export-loading-wrapper">
  126. <image
  127. class="report-export-loading-icon"
  128. src="../../../static/images/loading.png"
  129. />
  130. </view>
  131. </view>
  132. </scroll-view>
  133. <EmptyView v-else text="暂无导出任务" />
  134. <view class="report-export-footer">
  135. <view class="report-export-footer-btn" @click="onCreate">新建任务</view>
  136. </view>
  137. <view
  138. v-show="createModalOpen || filterModalOpen || emailModalOpen"
  139. class="report-export-create-modal-mask"
  140. @click="closeCreate"
  141. >
  142. </view>
  143. <view
  144. class="report-export-create-modal"
  145. :class="{ 'report-export-create-modal--open': createModalOpen }"
  146. >
  147. <view class="report-export-create-modal-title" @click="closeDropdownAll">
  148. <text>{{ taskTitle }}</text>
  149. <view class="report-export-create-modal-close" @click.stop="closeCreate"
  150. >×</view
  151. >
  152. </view>
  153. <view
  154. class="report-export-create-modal-body"
  155. :style="{ paddingBottom: 0 }"
  156. @click="closeDropdownAll"
  157. >
  158. <scroll-view
  159. scroll-y="true"
  160. :style="{
  161. height: '750rpx',
  162. paddingBottom: '20rpx',
  163. }"
  164. >
  165. <view class="report-export-create-modal-row">
  166. <text class="report-export-create-modal-label">省份</text>
  167. <view
  168. class="report-export-create-modal-inputwrap"
  169. @click.stop="modalType !== 'read' && openDropdown('region')"
  170. >
  171. <view class="report-export-create-modal-static">{{
  172. form.region && form.region.regionName
  173. ? form.region.regionName
  174. : "请选择省份"
  175. }}</view>
  176. <view
  177. class="report-export-input-arrow"
  178. v-if="modalType !== 'read'"
  179. ></view>
  180. <view
  181. class="report-export-create-modal-dropdown"
  182. v-if="dropdown.region"
  183. @click.stop
  184. :style="dropdownPosStyle()"
  185. >
  186. <view class="report-export-dropdown-search-row">
  187. <input
  188. class="report-export-dropdown-search-input"
  189. v-model="searchForm.region"
  190. :disabled="modalType === 'read'"
  191. @input="modalType !== 'read' && onInput('region')"
  192. @focus="onSearchFocus"
  193. @blur="onSearchBlur"
  194. />
  195. </view>
  196. <scroll-view
  197. class="report-export-create-modal-dropdown-list"
  198. scroll-y
  199. >
  200. <view
  201. class="report-export-create-modal-dropdown-item"
  202. v-for="(op, i) in filteredOptions('region')"
  203. :key="'r-' + i"
  204. @click.stop="
  205. modalType !== 'read' && pickOption('region', op)
  206. "
  207. >{{ op.regionName }}
  208. </view>
  209. <view
  210. v-if="
  211. !filteredOptions('region') ||
  212. filteredOptions('region').length === 0
  213. "
  214. class="report-export-create-modal-dropdown-item"
  215. >
  216. 未查找到该省份</view
  217. >
  218. </scroll-view>
  219. </view>
  220. </view>
  221. </view>
  222. <view class="report-export-create-modal-row">
  223. <text class="report-export-create-modal-label">客户类型</text>
  224. <view
  225. class="report-export-create-modal-inputwrap"
  226. @click.stop="modalType !== 'read' && openDropdown('customerType')"
  227. >
  228. <view class="report-export-create-modal-static">{{
  229. form.customerType || "请选择客户类型"
  230. }}</view>
  231. <view
  232. class="report-export-input-arrow"
  233. v-if="modalType !== 'read'"
  234. ></view>
  235. <view
  236. class="report-export-create-modal-dropdown"
  237. v-if="dropdown.customerType"
  238. @click.stop
  239. :style="dropdownPosStyle()"
  240. >
  241. <view
  242. class="report-export-create-modal-dropdown-item"
  243. v-for="(op, i) in filteredOptions('customerType')"
  244. :key="'t-' + i"
  245. @click.stop="
  246. modalType !== 'read' && pickOption('customerType', op)
  247. "
  248. >{{ op }}</view
  249. >
  250. <view
  251. v-if="filteredOptions('customerType').length === 0"
  252. class="report-export-create-modal-dropdown-item"
  253. >未查找到该客户类型</view
  254. >
  255. </view>
  256. </view>
  257. </view>
  258. <view class="report-export-create-modal-row">
  259. <text class="report-export-create-modal-label">客户</text>
  260. <view
  261. class="report-export-create-modal-inputwrap"
  262. @click.stop="modalType !== 'read' && openDropdown('customer')"
  263. >
  264. <view
  265. class="report-export-create-modal-static"
  266. :style="{ maxHeight: 'auto', overflowY: 'visible' }"
  267. >
  268. <block
  269. v-if="Array.isArray(form.customer) && form.customer.length"
  270. >
  271. <view
  272. :style="{
  273. maxHeight: '100rpx',
  274. overflowY: 'auto',
  275. paddingRight: '40rpx',
  276. }"
  277. >
  278. <text
  279. v-for="(op, i) in form.customer"
  280. :key="'cust-tag-' + i"
  281. class="customer-chip"
  282. >
  283. {{ op.customerName }}
  284. <text
  285. class="customer-chip-close"
  286. @click.stop="
  287. modalType !== 'read' &&
  288. removeCustomer(op.customerName)
  289. "
  290. >×</text
  291. >
  292. </text>
  293. </view>
  294. </block>
  295. <text v-else>请选择客户</text>
  296. <text
  297. v-if="
  298. form.customer &&
  299. form.customer.length &&
  300. modalType !== 'read'
  301. "
  302. class="customer-clear-all"
  303. @click.stop="modalType !== 'read' && clearAllCustomers()"
  304. >×</text
  305. >
  306. </view>
  307. <view
  308. class="report-export-input-arrow"
  309. v-if="modalType !== 'read'"
  310. ></view>
  311. <view
  312. class="report-export-create-modal-dropdown"
  313. v-if="dropdown.customer"
  314. @click.stop
  315. :style="[
  316. dropdownPosStyle(),
  317. { maxHeight: 'none', overflow: 'visible' },
  318. ]"
  319. >
  320. <view class="report-export-dropdown-search-row">
  321. <input
  322. class="report-export-dropdown-search-input"
  323. v-model="customerSearch"
  324. :disabled="modalType === 'read'"
  325. @input="modalType !== 'read' && onInput('customer')"
  326. @focus="onSearchFocus"
  327. @blur="onSearchBlur"
  328. />
  329. </view>
  330. <scroll-view
  331. class="report-export-create-modal-dropdown-list"
  332. scroll-y
  333. lower-threshold="20"
  334. @scrolltolower="getCustomerOptions"
  335. >
  336. <view
  337. class="report-export-create-modal-dropdown-item"
  338. :class="{
  339. 'report-export-selected': isCustomerSelected(
  340. op.customerName,
  341. ),
  342. }"
  343. v-for="(op, i) in customers"
  344. :key="'cust-' + i"
  345. @click.stop="
  346. modalType !== 'read' && pickOption('customer', op)
  347. "
  348. >{{ op.customerName }}</view
  349. >
  350. <view
  351. v-if="customers.length === 0 && !customerHasMore"
  352. class="report-export-create-modal-dropdown-item"
  353. >未查找到该客户</view
  354. >
  355. <view
  356. v-if="customerHasMore"
  357. class="report-export-loading-row"
  358. >
  359. <view class="report-export-loading-wrapper">
  360. <image
  361. class="report-export-loading-icon"
  362. src="../../../static/images/loading.png"
  363. />
  364. </view>
  365. </view>
  366. </scroll-view>
  367. </view>
  368. </view>
  369. </view>
  370. <view class="report-export-create-modal-row">
  371. <text class="report-export-create-modal-label">其它客户</text>
  372. <view class="report-export-create-modal-inputwrap">
  373. <input
  374. class="report-export-dropdown-search-input"
  375. v-model="form.otherCustomer"
  376. placeholder="请填写(多个客户用半角逗号隔开)"
  377. placeholder-class="report-export-dropdown-other-customer-input"
  378. :disabled="modalType === 'read'"
  379. :style="{ color: '#666', padding: 0, border: 'none' }"
  380. />
  381. </view>
  382. </view>
  383. <view class="report-export-create-modal-row">
  384. <text class="report-export-create-modal-label">品种</text>
  385. <view
  386. class="report-export-create-modal-inputwrap"
  387. @click.stop="modalType !== 'read' && openDropdown('product')"
  388. >
  389. <view class="report-export-create-modal-static">{{
  390. form.product?.physicName || "请选择品种"
  391. }}</view>
  392. <view
  393. class="report-export-input-arrow"
  394. v-if="modalType !== 'read'"
  395. ></view>
  396. <view
  397. class="report-export-create-modal-dropdown"
  398. :style="[{ top: 'auto', bottom: '84rpx' }]"
  399. v-if="dropdown.product"
  400. @click.stop
  401. >
  402. <view class="report-export-dropdown-search-row">
  403. <input
  404. class="report-export-dropdown-search-input"
  405. v-model="searchForm.product"
  406. :disabled="modalType === 'read'"
  407. @input="modalType !== 'read' && onInput('product')"
  408. @focus="onSearchFocus"
  409. @blur="onSearchBlur"
  410. />
  411. </view>
  412. <scroll-view
  413. class="report-export-create-modal-dropdown-list"
  414. scroll-y
  415. @scrolltolower="loadMoreProducts('create')"
  416. >
  417. <view
  418. class="report-export-create-modal-dropdown-item"
  419. v-for="(op, i) in displayProducts"
  420. :key="'p-' + i"
  421. @click.stop="
  422. modalType !== 'read' && pickOption('product', op)
  423. "
  424. >{{ op.physicName }}
  425. </view>
  426. <view
  427. v-if="displayProducts?.length === 0"
  428. class="report-export-create-modal-dropdown-item"
  429. >
  430. 未查找到该品种</view
  431. >
  432. </scroll-view>
  433. </view>
  434. </view>
  435. </view>
  436. <view class="report-export-create-modal-row">
  437. <text class="report-export-create-modal-label">规格</text>
  438. <view
  439. class="report-export-create-modal-inputwrap"
  440. :class="{
  441. 'report-export-input-disabled':
  442. !form.product?.drugEntBaseInfoId,
  443. }"
  444. @click.stop="
  445. modalType !== 'read' &&
  446. form.product?.drugEntBaseInfoId &&
  447. openDropdown('pkgSpec')
  448. "
  449. >
  450. <view class="report-export-create-modal-static">{{
  451. form.pkgSpec || "请选择规格(请先选择品种)"
  452. }}</view>
  453. <view
  454. class="report-export-input-arrow"
  455. v-if="modalType !== 'read'"
  456. ></view>
  457. <view
  458. class="report-export-create-modal-dropdown"
  459. v-if="dropdown.pkgSpec"
  460. @click.stop
  461. :style="[{ top: 'auto', bottom: '84rpx' }]"
  462. >
  463. <view
  464. class="report-export-create-modal-dropdown-item"
  465. v-for="(op, i) in filteredOptions('pkgSpec')"
  466. :key="'t-' + i"
  467. @click.stop="
  468. modalType !== 'read' && pickOption('pkgSpec', op)
  469. "
  470. >{{ op }}</view
  471. >
  472. <view
  473. v-if="filteredOptions('pkgSpec')?.length === 0"
  474. class="report-export-create-modal-dropdown-item"
  475. >
  476. 未查找到该品种规格</view
  477. >
  478. </view>
  479. </view>
  480. </view>
  481. <view class="report-export-create-modal-row">
  482. <text class="report-export-create-modal-label">时间</text>
  483. <view
  484. class="report-export-create-modal-inputwrap"
  485. @click="openDatePicker"
  486. >
  487. <view
  488. class="report-export-create-modal-static report-export-input-simulator"
  489. :style="{
  490. color: dateRange && dateRange.length ? '#333' : '#606266',
  491. }"
  492. >
  493. <uni-icons
  494. type="calendar"
  495. size="22"
  496. color="#c0c4cc"
  497. ></uni-icons>
  498. <view style="flex: 1; text-align: center"
  499. >{{
  500. dateRange && dateRange.length ? dateRange[0] : "开始时间"
  501. }}
  502. </view>
  503. <view>-</view>
  504. <view style="flex: 1; text-align: center"
  505. >{{
  506. dateRange && dateRange.length ? dateRange[1] : "结束时间"
  507. }}
  508. </view>
  509. </view>
  510. <view
  511. class="report-export-input-simulator-clear"
  512. v-if="dateRange && dateRange.length"
  513. @click.stop="dateRange = []"
  514. >
  515. <uni-icons type="clear" size="22" color="#c0c4cc"></uni-icons>
  516. </view>
  517. </view>
  518. </view>
  519. </scroll-view>
  520. <!-- Hidden Picker for API access -->
  521. <view style="position: absolute; left: -10000px; top: 0">
  522. <uni-datetime-picker
  523. ref="datePicker"
  524. type="daterange"
  525. v-model="dateRange"
  526. @change="onDateChange"
  527. />
  528. </view>
  529. </view>
  530. <view class="report-export-create-modal-footer" @click="closeDropdownAll">
  531. <view
  532. class="report-export-create-modal-btn"
  533. @click.stop="confirmCreate"
  534. v-if="modalType !== 'read'"
  535. >{{ modalType === "create" ? "新建任务" : "修改任务" }}</view
  536. >
  537. <view
  538. :style="{ display: 'flex', 'justify-content': 'space-between' }"
  539. v-else
  540. >
  541. <view
  542. class="report-export-create-modal-btn"
  543. :style="{ flex: '0 0 40%' }"
  544. @click.stop="closeCreate"
  545. >关闭</view
  546. >
  547. <view
  548. class="report-export-create-modal-btn"
  549. :style="{ background: 'red', flex: '0 0 40%' }"
  550. @click.stop="confirmDelete"
  551. >删除</view
  552. >
  553. </view>
  554. </view>
  555. </view>
  556. <view
  557. class="report-export-create-modal"
  558. :class="{ 'report-export-create-modal--open': filterModalOpen }"
  559. >
  560. <view class="report-export-create-modal-title" @click="closeDropdownAll"
  561. >筛选条件</view
  562. >
  563. <view class="report-export-create-modal-body" @click="closeDropdownAll">
  564. <view class="report-export-create-modal-row">
  565. <text class="report-export-create-modal-label">品种:</text>
  566. <view
  567. class="report-export-create-modal-inputwrap"
  568. @click.stop="openFilterDropdown('product')"
  569. >
  570. <view class="report-export-create-modal-static">{{
  571. filterForm.product?.physicName || "请选择品种"
  572. }}</view>
  573. <view
  574. class="report-export-create-modal-dropdown"
  575. :style="[{ top: 'auto', bottom: '84rpx' }]"
  576. v-if="filterDropdown.product"
  577. @click.stop
  578. >
  579. <view class="report-export-dropdown-search-row">
  580. <input
  581. class="report-export-dropdown-search-input"
  582. v-model="filterSearchForm.product"
  583. @input="onFilterInput('product')"
  584. @focus="onSearchFocus"
  585. @blur="onSearchBlur"
  586. />
  587. </view>
  588. <scroll-view
  589. class="report-export-create-modal-dropdown-list"
  590. scroll-y
  591. @scrolltolower="loadMoreProducts('filter')"
  592. >
  593. <view
  594. class="report-export-create-modal-dropdown-item"
  595. v-for="(op, i) in filterDisplayProducts"
  596. :key="'prd-' + i"
  597. @click.stop="pickFilterOption('product', op)"
  598. >{{ op.physicName }}</view
  599. >
  600. <view
  601. v-if="filterDisplayProducts?.length === 0"
  602. class="report-export-create-modal-dropdown-item"
  603. >
  604. 未查找到该品种
  605. </view>
  606. </scroll-view>
  607. </view>
  608. </view>
  609. </view>
  610. <!-- <view class="report-export-create-modal-row">
  611. <text class="report-export-create-modal-label">规格</text>
  612. <view class="report-export-create-modal-inputwrap"
  613. :class="{ 'report-export-input-disabled': !filterForm.product?.drugEntBaseInfoId }"
  614. @click.stop="filterForm.product?.drugEntBaseInfoId && openFilterDropdown('pkgSpec')">
  615. <view class="report-export-create-modal-static">{{
  616. filterForm.pkgSpec || "请选择品种规格(请先选择品种)"
  617. }}</view>
  618. <view class="report-export-input-arrow"></view>
  619. <view class="report-export-create-modal-dropdown" v-if="filterDropdown.pkgSpec" @click.stop
  620. :style="[{ top: 'auto', bottom: '84rpx' }]">
  621. <view class="report-export-create-modal-dropdown-item" v-for="(op, i) in filteredOptions('pkgSpec')"
  622. :key="'t-' + i" @click.stop="
  623. pickFilterOption('pkgSpec', op)
  624. ">{{ op }}</view>
  625. <view v-if="filteredOptions('pkgSpec')?.length === 0" class="report-export-create-modal-dropdown-item">
  626. 未查找到该品种规格</view>
  627. </view>
  628. </view>
  629. </view> -->
  630. <view class="report-export-create-modal-row">
  631. <text class="report-export-create-modal-label">时间:</text>
  632. <view
  633. class="report-export-create-modal-inputwrap"
  634. v-if="filterModalOpen"
  635. >
  636. <uni-datetime-picker
  637. type="daterange"
  638. :border="false"
  639. v-model="filterDateRange"
  640. @change="onFilterDateChange"
  641. />
  642. </view>
  643. </view>
  644. </view>
  645. <view
  646. class="report-export-create-modal-footer"
  647. @click="closeDropdownAll"
  648. :style="{ display: 'flex', justifyContent: 'space-between' }"
  649. >
  650. <view
  651. class="report-export-create-modal-btn"
  652. :style="{
  653. background: '#fff',
  654. color: '#666',
  655. border: '1rpx solid #dcdfe6',
  656. flex: '0 0 45%',
  657. }"
  658. @click.stop="resetFilter"
  659. >重置</view
  660. >
  661. <view
  662. class="report-export-create-modal-btn"
  663. :style="{ flex: '0 0 45%' }"
  664. @click.stop="confirmFilter"
  665. >确认</view
  666. >
  667. </view>
  668. </view>
  669. <view
  670. class="report-export-create-modal report-export-create-email-modal"
  671. :class="{ 'report-export-create-modal--open': emailModalOpen }"
  672. :style="{ transform: 'translateY(1000%)' }"
  673. >
  674. <view class="report-export-create-modal-title">
  675. <text>发送至邮箱</text>
  676. <view
  677. class="report-export-create-modal-close"
  678. @click.stop="closeEmailModal"
  679. >×</view
  680. >
  681. </view>
  682. <view
  683. class="report-export-create-modal-body"
  684. :style="{ padding: '40rpx' }"
  685. >
  686. <!-- <view class="report-export-email-input-wrap" :class="{ 'report-export-input-error': emailError }">
  687. <input class="report-export-email-input" v-model="emailForm.email" placeholder="请填写邮箱"
  688. placeholder-style="color: #c0c4cc" @input="emailError = false" />
  689. <text class="report-export-email-suffix">@999.com.cn</text>
  690. </view> -->
  691. <up-input
  692. v-model="emailForm.email"
  693. border="none"
  694. :customStyle="{
  695. backgroundColor: '#ebf3fb',
  696. height: '80rpx',
  697. paddingLeft: '20rpx',
  698. }"
  699. placeholder="请填写邮箱"
  700. >
  701. <template #suffix style="margin-right: 30rpx"> @999.com.cn </template>
  702. </up-input>
  703. <text v-if="emailError" class="report-export-error-text"
  704. >请输入邮箱</text
  705. >
  706. </view>
  707. <view
  708. class="report-export-create-modal-footer"
  709. :style="{
  710. padding: '20rpx 40rpx 40rpx',
  711. display: 'flex',
  712. 'justify-content': 'space-between',
  713. }"
  714. >
  715. <view
  716. class="report-export-create-modal-btn"
  717. :style="{
  718. background: '#fff',
  719. color: '#666',
  720. border: '1rpx solid #dcdfe6',
  721. flex: '0 0 45%',
  722. }"
  723. @click.stop="closeEmailModal"
  724. >取消</view
  725. >
  726. <view
  727. class="report-export-create-modal-btn"
  728. :style="{ flex: '0 0 45%' }"
  729. @click.stop="handleSendEmail"
  730. >发送
  731. </view>
  732. </view>
  733. </view>
  734. </view>
  735. </template>
  736. <script>
  737. import EmptyView from "../../../wigets/empty.vue";
  738. import { formatDate, getPaginatedList } from "../../../utils/utils.js";
  739. import request from "../../../request/index.js";
  740. const customerTypeMap = {
  741. VIP客户: "VIP",
  742. 二级客户: "二级",
  743. 三级客户: "三级",
  744. };
  745. const customerTypeReverseMap = {
  746. VIP: "VIP客户",
  747. 二级: "二级客户",
  748. 三级: "三级客户",
  749. };
  750. const statusMap = {
  751. 全部: 0,
  752. 待开始: 1,
  753. 进行中: 2,
  754. 已完成: 3,
  755. };
  756. export default {
  757. components: {
  758. EmptyView,
  759. },
  760. data() {
  761. return {
  762. keyword: "",
  763. totalCount: 0,
  764. loading: true,
  765. hasmore: true,
  766. fetchLoading: false,
  767. pageNum: 1,
  768. pageSize: 10,
  769. list: [],
  770. listViewHeight: "400px",
  771. createModalOpen: false,
  772. form: {
  773. region: { regionName: "" },
  774. customerType: "",
  775. customer: [],
  776. product: { physicName: "" },
  777. otherCustomer: "",
  778. },
  779. dateRange: [],
  780. computeTimer: null,
  781. dropdown: {
  782. region: false,
  783. customerType: false,
  784. customer: false,
  785. product: false,
  786. pkgSpec: false,
  787. },
  788. options: {
  789. region: [],
  790. customerType: ["VIP客户", "二级客户", "三级客户"],
  791. product: [],
  792. pkgSpec: [],
  793. status: ["全部", "已完成", "待开始", "进行中"],
  794. },
  795. // dropdown search inputs (create modal)
  796. searchForm: {
  797. region: "",
  798. product: "",
  799. },
  800. // Pagination state for products
  801. productPage: 0,
  802. productPageSize: 10,
  803. displayProducts: [], // Currently displayed products
  804. // dropdown search inputs (filter modal)
  805. filterSearchForm: {
  806. product: "",
  807. },
  808. // Pagination state for filter products
  809. filterProductPage: 0,
  810. filterDisplayProducts: [],
  811. customers: [],
  812. customerPage: 1,
  813. customerPageSize: 10,
  814. customerTotal: null,
  815. customerHasMore: true,
  816. customerLoading: false,
  817. customerDebounceTimer: null,
  818. taskTitle: "创建任务",
  819. filterModalOpen: false,
  820. filterForm: {
  821. product: { physicName: "" },
  822. status: "全部",
  823. pkgSpec: "",
  824. },
  825. filterDropdown: { product: false, pkgSpec: false },
  826. filterDateRange: [],
  827. modalType: "",
  828. dropdownUpward: false,
  829. customerSearch: "",
  830. currentItem: {},
  831. emailModalOpen: false,
  832. emailForm: {
  833. email: "",
  834. },
  835. emailError: false,
  836. };
  837. },
  838. created() {
  839. const userInfo = uni.getStorageSync("userInfo");
  840. const staffEmail = userInfo?.staffEmail || "";
  841. this.emailForm.email = staffEmail.split("@")[0];
  842. console.log("reportExport\index.vue,storage,userInfo", userInfo);
  843. this.initList();
  844. this.getProviceList();
  845. this.getDrugInfoName();
  846. this.fetchList();
  847. try {
  848. uni.onKeyboardHeightChange(({ height }) => {
  849. this.dropdownUpward = height > 0;
  850. });
  851. } catch (e) {}
  852. },
  853. computed: {
  854. taskTitle() {
  855. if (this.modalType === "create") {
  856. return "创建任务";
  857. } else if (this.modalType == "edit") {
  858. return "修改任务";
  859. } else if (this.modalType == "read") {
  860. return "查看任务";
  861. }
  862. },
  863. },
  864. watch: {
  865. "form.customerType"(val) {
  866. this.customerPage = 1;
  867. this.customerTotal = null;
  868. this.customerHasMore = true;
  869. this.customers = [];
  870. if (this.customerDebounceTimer) clearTimeout(this.customerDebounceTimer);
  871. this.getCustomerOptions();
  872. },
  873. "form.region": {
  874. handler() {
  875. this.customerPage = 1;
  876. this.customerTotal = null;
  877. this.customerHasMore = true;
  878. this.customers = [];
  879. if (this.customerDebounceTimer)
  880. clearTimeout(this.customerDebounceTimer);
  881. this.getCustomerOptions();
  882. },
  883. deep: true,
  884. },
  885. "emailForm.email": {
  886. handler(newVal, oldVal) {
  887. if (!oldVal && !newVal && newVal !== oldVal) {
  888. this.emailError = false;
  889. } else {
  890. this.emailError = !newVal;
  891. }
  892. },
  893. deep: true,
  894. },
  895. "filterForm.status"(val) {
  896. this.resetFetch();
  897. },
  898. },
  899. methods: {
  900. getCustomerName(data = {}) {
  901. const { customerName = "", otherCustomer = "" } = data;
  902. let name = customerName || "";
  903. if (otherCustomer) {
  904. if (name) {
  905. name += `,${otherCustomer}`;
  906. } else {
  907. name = otherCustomer;
  908. }
  909. }
  910. const arr = name.split(",");
  911. if (arr.length == 0) return "--";
  912. return arr.length == 1
  913. ? arr[0].trim()
  914. : `${arr[0].trim()}等${arr.length}个公司`;
  915. },
  916. formatDate(date) {
  917. return formatDate({ date }, "YYYY-MM-DD");
  918. },
  919. normalizeDateToYMD(value) {
  920. if (!value) return "";
  921. if (typeof value === "string") {
  922. const trimmed = value.trim();
  923. if (trimmed.length >= 10) return trimmed.slice(0, 10);
  924. return trimmed;
  925. }
  926. return this.formatDate(value);
  927. },
  928. getStatusText(status) {
  929. if (status == "1") {
  930. return "导出待开始";
  931. } else if (status == "2") {
  932. return "导出进行中";
  933. } else if (status == "3" || status == "4") {
  934. return "导出已完成";
  935. }
  936. return "未知状态";
  937. },
  938. getDrugInfoName() {
  939. request("/bills/getDrugInfoName", {
  940. path: "/reportExport/index.vue",
  941. }).then((res) => {
  942. if (res.code == 200) {
  943. const _data = res.data;
  944. this.options.product = _data;
  945. }
  946. });
  947. },
  948. getGuigeList(physicName) {
  949. if (!physicName) return;
  950. request("/report/getDrugSpec", {
  951. physicName,
  952. path: "/reportExport/index.vue",
  953. }).then((res) => {
  954. if (res.code == 200) {
  955. this.options.pkgSpec = res.data || [];
  956. }
  957. });
  958. },
  959. getProviceList() {
  960. request("/common/getProviceList", {
  961. path: "/reportExport/index.vue",
  962. }).then((res) => {
  963. if (res.code == 200) {
  964. const _data = res.data;
  965. this.options.region = _data;
  966. }
  967. });
  968. },
  969. getCustomerOptions() {
  970. if (!this.customerHasMore || this.customerLoading) return;
  971. this.customerLoading = true;
  972. request("/customer/info/getCustomerInfo", {
  973. pageNum: this.customerPage,
  974. pageSize: this.customerPageSize,
  975. customerName: this.customerSearch || "",
  976. customerLevel: customerTypeMap?.[this.form.customerType] || undefined,
  977. provinceCode: this.form?.region?.regionCode || undefined,
  978. path: "/reportExport/index.vue",
  979. }).then((res) => {
  980. if (res.code == 200) {
  981. const _data = res.data || {};
  982. this.customerTotal = _data.total || 0;
  983. const list = Array.isArray(_data.list) ? _data.list : [];
  984. this.customers = [...this.customers, ...list];
  985. if (this.customers.length >= this.customerTotal) {
  986. this.customerHasMore = false;
  987. } else {
  988. this.customerPage++;
  989. this.customerHasMore = true;
  990. }
  991. }
  992. this.customerLoading = false;
  993. });
  994. },
  995. initList() {
  996. const info = uni.getSystemInfoSync();
  997. const h = info.windowHeight || 800;
  998. this.listViewHeight = Math.max(0, h - 280) + "px";
  999. // this.list = this.genItems(Math.min(10, this.totalCount));
  1000. // this.animateAll();
  1001. },
  1002. onFilter() {
  1003. this.filterModalOpen = true;
  1004. },
  1005. showModal(item = {}) {
  1006. const map = {
  1007. 1: "edit",
  1008. 2: "read",
  1009. 3: "read",
  1010. };
  1011. this.modalType = map[item?.status] || "create";
  1012. if (this.modalType === "create") {
  1013. this.taskTitle = "创建任务";
  1014. } else {
  1015. if (this.modalType == "edit") {
  1016. this.taskTitle = "修改任务";
  1017. } else if (this.modalType == "read") {
  1018. this.taskTitle = "查看任务";
  1019. }
  1020. const cNames = item.customerName.split(",");
  1021. const cCodes = (item.customerId || "").split(",");
  1022. const regionCode = item.regionCode || item.provinceCode || "";
  1023. let regionName = item.regionName || item.provinceName || "";
  1024. if (!regionName && regionCode && Array.isArray(this.options.region)) {
  1025. const regionItem = this.options.region.find(
  1026. (r) => r.regionCode === regionCode || r.provinceCode === regionCode,
  1027. );
  1028. if (regionItem) {
  1029. regionName = regionItem.regionName || regionItem.name || "";
  1030. }
  1031. }
  1032. let customerTypeLabel = "";
  1033. const cType = item.customerType;
  1034. if (cType === 1 || cType === "1") {
  1035. customerTypeLabel = "VIP客户";
  1036. } else if (cType === 2 || cType === "2") {
  1037. customerTypeLabel = "二级客户";
  1038. } else if (cType === 3 || cType === "3") {
  1039. customerTypeLabel = "三级客户";
  1040. } else if (typeof cType === "string" && cType) {
  1041. customerTypeLabel = customerTypeReverseMap[cType] || cType;
  1042. }
  1043. this.form = {
  1044. customer: cCodes.map((i, index) => ({
  1045. customerName: cNames[index],
  1046. customerCode: i,
  1047. })),
  1048. region: {
  1049. regionCode,
  1050. regionName,
  1051. },
  1052. customerType: customerTypeLabel,
  1053. product: {
  1054. physicName: item.physicName,
  1055. drugEntBaseInfoId: item.drugEntBaseInfoId,
  1056. },
  1057. pkgSpec: item?.pkgSpec || "",
  1058. otherCustomer: item?.otherCustomer || "",
  1059. };
  1060. if (item.physicName) {
  1061. this.getGuigeList(item.physicName);
  1062. }
  1063. this.dateRange = [
  1064. this.normalizeDateToYMD(item.beginTime),
  1065. this.normalizeDateToYMD(item.endTime),
  1066. ];
  1067. }
  1068. this.createModalOpen = true;
  1069. this.currentItem = item;
  1070. },
  1071. fetchList() {
  1072. // this.list = [];
  1073. // setTimeout(() => {
  1074. // const n = Math.min(10, this.totalCount || 10);
  1075. // this.list = this.genItems(n);
  1076. // if (!this.totalCount) this.totalCount = this.list.length;
  1077. // this.animateAll();
  1078. // this.fetchLoading = false;
  1079. // }, 1000);
  1080. if (!this.hasmore) {
  1081. setTimeout(() => {
  1082. this.fetchLoading = false;
  1083. this.loading = false;
  1084. }, 500);
  1085. return;
  1086. }
  1087. if (this.fetchLoading) return;
  1088. this.fetchLoading = true;
  1089. request("/report/getReportTaskPage", {
  1090. reportType: 2,
  1091. taskType: statusMap?.[this.filterForm?.status] || "",
  1092. drugEntBaseInfoId: this.filterForm?.product?.drugEntBaseInfoId,
  1093. pkgSpec: this.filterForm?.pkgSpec || "",
  1094. beginTime: this.filterDateRange[0],
  1095. endTime: this.filterDateRange[1],
  1096. customerName: this.keyword || "",
  1097. pageNum: this.pageNum,
  1098. pageSize: this.pageSize,
  1099. path: "reportExport/index.vue",
  1100. }).then((res) => {
  1101. if (res.code == 200) {
  1102. const _data = res.data || {};
  1103. const { list, total } = _data;
  1104. this.totalCount = total || 0;
  1105. const incoming = Array.isArray(list) ? list : [];
  1106. const existingIds = new Set(this.list.map((v) => v?.id));
  1107. const merged = incoming.filter((v) => {
  1108. const id = v?.id;
  1109. return id === undefined ? true : !existingIds.has(id);
  1110. });
  1111. if (merged.length === 0 && incoming.length > 0) {
  1112. this.hasmore = false;
  1113. } else {
  1114. this.list = [...this.list, ...merged];
  1115. }
  1116. if (this.list.length < this.totalCount) {
  1117. this.hasmore = true;
  1118. this.pageNum++;
  1119. } else {
  1120. this.hasmore = false;
  1121. }
  1122. // this.list.push({
  1123. // ...this.list[1],
  1124. // status: 3,
  1125. // });
  1126. // this.list.push({
  1127. // ...this.list[0],
  1128. // finishTime: "2025-12-15",
  1129. // status: 3,
  1130. // });
  1131. // this.animateAll();
  1132. }
  1133. this.fetchLoading = false;
  1134. this.loading = false;
  1135. });
  1136. },
  1137. resetFetch() {
  1138. this.loading = true;
  1139. this.list = [];
  1140. this.pageNum = 1;
  1141. this.hasmore = true;
  1142. this.fetchList();
  1143. },
  1144. toDetail(item) {
  1145. uni.navigateTo({
  1146. url: `/traceCodePackages/traceabilityReport/pages/reportExport/detail/index?id=${
  1147. item.id
  1148. }&title=${encodeURIComponent(this.getCustomerName(item.customerName))}`,
  1149. });
  1150. },
  1151. onSearch() {
  1152. this.resetFetch();
  1153. },
  1154. onCreate() {
  1155. this.modalType = "create";
  1156. this.taskTitle = "创建任务";
  1157. this.createModalOpen = true;
  1158. },
  1159. closeCreate() {
  1160. this.filterModalOpen = false;
  1161. this.createModalOpen = false;
  1162. this.closeDropdownAll();
  1163. this.form = {
  1164. region: { regionName: "" },
  1165. customerType: "",
  1166. customer: [],
  1167. product: { physicName: "" },
  1168. otherCustomer: "",
  1169. };
  1170. this.searchForm = {
  1171. region: "",
  1172. product: "",
  1173. };
  1174. this.dateRange = [];
  1175. if (this.computeTimer) {
  1176. clearTimeout(this.computeTimer);
  1177. this.computeTimer = null;
  1178. }
  1179. },
  1180. confirmCreate() {
  1181. let flag = false;
  1182. Object.values(this.dropdown).forEach((v) => {
  1183. if (v) {
  1184. flag = true;
  1185. }
  1186. });
  1187. if (flag) {
  1188. this.closeDropdownAll();
  1189. return;
  1190. }
  1191. if (!this.isFormComplete()) {
  1192. // uni.showToast({ title: "请完整填写任务内容", icon: "none" });
  1193. return;
  1194. }
  1195. // uni.showToast({ title: "已创建", icon: "none" });
  1196. uni.showLoading({
  1197. title: this.modalType === "create" ? "创建中..." : "修改中...",
  1198. });
  1199. const url =
  1200. this.modalType === "create" ? `/report/save` : `/report/update`;
  1201. const customerId = (this.form?.customer || [])
  1202. .map((v) => v?.customerCode || "")
  1203. .join(",");
  1204. const customerName = (this.form?.customer || [])
  1205. .map((v) => v?.customerName || "")
  1206. .join(",");
  1207. request(url, {
  1208. id:
  1209. this.modalType === "create" ? undefined : this.currentItem?.id || "",
  1210. reportType: 2,
  1211. regionCode: this.form?.region?.regionCode || "",
  1212. customerType: customerTypeMap?.[this.form?.customerType] || "",
  1213. customerId,
  1214. customerName,
  1215. otherCustomer: this.form?.otherCustomer || "",
  1216. drugEntBaseInfoId: this.form?.product?.drugEntBaseInfoId || "",
  1217. pkgSpec: this.form?.pkgSpec || "",
  1218. physicName: this.form?.product?.physicName || "",
  1219. beginTime: this.formatDate(this.dateRange[0], "YYYY-MM-DD"),
  1220. endTime: this.formatDate(this.dateRange[1], "YYYY-MM-DD"),
  1221. path: "",
  1222. }).then((res) => {
  1223. if (res.code == 200) {
  1224. uni.hideLoading();
  1225. uni.showToast({
  1226. title: this.modalType === "create" ? "已创建" : "已修改",
  1227. icon: "none",
  1228. });
  1229. this.resetFetch();
  1230. this.closeCreate();
  1231. }
  1232. });
  1233. },
  1234. isFormComplete() {
  1235. const f = this.form;
  1236. const drOk =
  1237. Array.isArray(this.dateRange) &&
  1238. this.dateRange.length === 2 &&
  1239. this.dateRange[0] &&
  1240. this.dateRange[1];
  1241. let customerOk = Array.isArray(f.customer)
  1242. ? f.customer.length > 0
  1243. : !!f.customer;
  1244. customerOk = customerOk || f.otherCustomer;
  1245. if (!customerOk) {
  1246. uni.showToast({ title: "请选择至少一个客户或其他客户", icon: "none" });
  1247. return false;
  1248. }
  1249. if (!f.product?.physicName) {
  1250. uni.showToast({ title: "请选择品种", icon: "none" });
  1251. return false;
  1252. }
  1253. if (!drOk) {
  1254. uni.showToast({ title: "请选择时间范围", icon: "none" });
  1255. return false;
  1256. }
  1257. return true;
  1258. // return (
  1259. // f.region?.regionName &&
  1260. // f.customerType &&
  1261. // customerOk &&
  1262. // f.product?.physicName &&
  1263. // drOk
  1264. // );
  1265. },
  1266. confirmDelete() {
  1267. uni.showModal({
  1268. title: "确认删除吗?",
  1269. success: (res) => {
  1270. if (res.confirm) {
  1271. uni.showLoading();
  1272. request("/report/delete", {
  1273. id: this.currentItem?.id || "",
  1274. path: "reportExport/index.vue",
  1275. }).then((res) => {
  1276. uni.hideLoading();
  1277. if (res.code == 200) {
  1278. uni.showToast({
  1279. title: "删除成功",
  1280. icon: "none",
  1281. duration: 2000,
  1282. });
  1283. this.resetFetch();
  1284. this.closeCreate();
  1285. } else {
  1286. uni.showToast({
  1287. title: res?.msg || "删除失败",
  1288. icon: "none",
  1289. duration: 2000,
  1290. });
  1291. }
  1292. });
  1293. }
  1294. },
  1295. });
  1296. },
  1297. onInput(k) {
  1298. this.closeDropdownAll();
  1299. this.dropdown[k] = true;
  1300. if (k === "customer") {
  1301. this.customerPage = 1;
  1302. this.customerTotal = null;
  1303. this.customerHasMore = true;
  1304. this.customers = [];
  1305. if (this.customerDebounceTimer)
  1306. clearTimeout(this.customerDebounceTimer);
  1307. this.customerDebounceTimer = setTimeout(() => {
  1308. this.getCustomerOptions();
  1309. }, 500);
  1310. return;
  1311. }
  1312. if (k === "product") {
  1313. this.initProductList("create");
  1314. }
  1315. },
  1316. closeDropdownAll() {
  1317. this.dropdown = {
  1318. region: false,
  1319. customerType: false,
  1320. customer: false,
  1321. product: false,
  1322. pkgSpec: false,
  1323. };
  1324. this.filterDropdown.product = false;
  1325. this.filterDropdown.pkgSpec = false;
  1326. },
  1327. openFilterDropdown(k) {
  1328. this.closeDropdownAll();
  1329. this.filterDropdown[k] = true;
  1330. if (k === "product") {
  1331. this.initProductList("filter");
  1332. }
  1333. },
  1334. toggleFilterDropdown(k) {
  1335. this.filterDropdown[k] = !this.filterDropdown[k];
  1336. },
  1337. onFilterInput(k) {
  1338. this.closeDropdownAll();
  1339. this.filterDropdown[k] = true;
  1340. if (k === "product") {
  1341. this.initProductList("filter");
  1342. }
  1343. },
  1344. pickFilterOption(k, v) {
  1345. if (!["status"].includes(k) && this.filterForm[k] === v) {
  1346. this.filterForm[k] = "";
  1347. this.filterDropdown[k] = false;
  1348. return;
  1349. }
  1350. this.filterForm[k] = v;
  1351. if (k === "product") {
  1352. this.filterForm.pkgSpec = "";
  1353. this.getGuigeList(v.physicName);
  1354. }
  1355. this.filterDropdown[k] = false;
  1356. },
  1357. filteredFilterOptions(k) {
  1358. const arr = k === "product" ? this.products || [] : [];
  1359. const q = String(this.filterForm[k] || "").trim();
  1360. if (!q) return arr;
  1361. return arr.filter((it) => it.indexOf(q) !== -1);
  1362. },
  1363. onFilterDateChange() {},
  1364. confirmFilter() {
  1365. this.filterModalOpen = false;
  1366. this.resetFetch();
  1367. },
  1368. resetFilter() {
  1369. this.filterForm = {
  1370. product: { physicName: "" },
  1371. status: "全部",
  1372. pkgSpec: "",
  1373. };
  1374. this.filterSearchForm.product = "";
  1375. this.filterProductPage = 0;
  1376. this.filterDisplayProducts = [];
  1377. this.filterDropdown = { product: false, pkgSpec: false };
  1378. this.filterDateRange = [];
  1379. this.resetFetch();
  1380. },
  1381. openDropdown(k) {
  1382. this.closeDropdownAll();
  1383. this.dropdown[k] = true;
  1384. if (k === "customer") {
  1385. if (!this.customers || this.customers.length === 0) {
  1386. this.customerPage = 1;
  1387. this.customerTotal = null;
  1388. this.customerHasMore = true;
  1389. this.getCustomerOptions();
  1390. }
  1391. }
  1392. if (k === "product") {
  1393. this.initProductList("create");
  1394. }
  1395. },
  1396. toggleDropdown(k) {
  1397. this.dropdown[k] = !this.dropdown[k];
  1398. },
  1399. pickOption(k, v) {
  1400. if (k === "customer") {
  1401. if (!Array.isArray(this.form.customer)) this.form.customer = [];
  1402. const idx = this.form.customer.indexOf(v);
  1403. if (idx === -1) {
  1404. this.form.customer.push(v);
  1405. } else {
  1406. this.form.customer.splice(idx, 1);
  1407. }
  1408. return;
  1409. }
  1410. this.form[k] = v;
  1411. if (k === "product") {
  1412. this.form.pkgSpec = "";
  1413. this.getGuigeList(v.physicName);
  1414. }
  1415. this.dropdown[k] = false;
  1416. },
  1417. isCustomerSelected(name) {
  1418. const arr = this.form.customer;
  1419. if (!Array.isArray(arr)) return false;
  1420. return arr.some((i) => i.customerName === name);
  1421. },
  1422. removeCustomer(name) {
  1423. if (!Array.isArray(this.form.customer)) return;
  1424. const idx = this.form.customer.findIndex((i) => i.customerName === name);
  1425. if (idx !== -1) this.form.customer.splice(idx, 1);
  1426. },
  1427. clearAllCustomers() {
  1428. this.form.customer = [];
  1429. },
  1430. filteredOptions(k, type) {
  1431. const arr = this.options[k] || [];
  1432. let q = "";
  1433. if (type === "filter") {
  1434. q = this.filterSearchForm[k] || "";
  1435. } else {
  1436. q = this.searchForm[k] || "";
  1437. }
  1438. q = String(q).trim().toLocaleLowerCase();
  1439. if (!q) return arr;
  1440. return arr.filter((it) => {
  1441. if (typeof it === "string")
  1442. return it.toLocaleLowerCase().indexOf(q) !== -1;
  1443. if (it && typeof it === "object") {
  1444. const name =
  1445. k === "region"
  1446. ? it.regionName || it.name || ""
  1447. : it.physicName || it.productName || "";
  1448. return String(name).toLocaleLowerCase().indexOf(q) !== -1;
  1449. }
  1450. return false;
  1451. });
  1452. },
  1453. // Initialize product list for pagination
  1454. initProductList(mode) {
  1455. const allProducts = this.filteredOptions(
  1456. "product",
  1457. mode === "filter" ? "filter" : undefined,
  1458. );
  1459. const res = getPaginatedList({
  1460. page: 0,
  1461. size: 10,
  1462. initData: allProducts,
  1463. data: [],
  1464. });
  1465. if (mode === "filter") {
  1466. this.filterProductPage = res.page;
  1467. this.filterDisplayProducts = res.data;
  1468. } else {
  1469. this.productPage = res.page;
  1470. this.displayProducts = res.data;
  1471. }
  1472. },
  1473. // Load more products on scroll
  1474. loadMoreProducts(mode) {
  1475. const allProducts = this.filteredOptions(
  1476. "product",
  1477. mode === "filter" ? "filter" : undefined,
  1478. );
  1479. const isFilter = mode === "filter";
  1480. const currentPage = isFilter ? this.filterProductPage : this.productPage;
  1481. const currentData = isFilter
  1482. ? this.filterDisplayProducts
  1483. : this.displayProducts;
  1484. const res = getPaginatedList({
  1485. page: currentPage,
  1486. size: 10,
  1487. initData: allProducts,
  1488. data: currentData,
  1489. });
  1490. if (res.data) {
  1491. if (isFilter) {
  1492. this.filterProductPage = res.page;
  1493. this.filterDisplayProducts = res.data;
  1494. } else {
  1495. this.productPage = res.page;
  1496. this.displayProducts = res.data;
  1497. }
  1498. }
  1499. },
  1500. onSearchFocus() {
  1501. this.dropdownUpward = true;
  1502. },
  1503. onSearchBlur() {
  1504. this.dropdownUpward = false;
  1505. },
  1506. dropdownPosStyle() {
  1507. // if (this.dropdownUpward) {
  1508. // return { bottom: "84rpx" };
  1509. // }
  1510. return { top: "84rpx" };
  1511. },
  1512. openDatePicker() {
  1513. if (this.modalType === "read") return;
  1514. this.$refs.datePicker.show();
  1515. },
  1516. onDateChange(val) {
  1517. const arr = Array.isArray(val) ? val : this.dateRange;
  1518. if (!Array.isArray(arr) || arr.length !== 2) return;
  1519. this.dateRange = [
  1520. this.normalizeDateToYMD(arr[0]),
  1521. this.normalizeDateToYMD(arr[1]),
  1522. ];
  1523. },
  1524. onStart(item) {
  1525. uni.showModal({
  1526. title: "是否开始导出报表?",
  1527. success: (res) => {
  1528. if (res.confirm) {
  1529. uni.showLoading();
  1530. request("/report/confirm", {
  1531. id: item?.id || "",
  1532. path: "reportExport/index.vue",
  1533. }).then((res) => {
  1534. uni.hideLoading();
  1535. if (res.code == 200) {
  1536. uni.showToast({
  1537. title: "已开始导出",
  1538. icon: "none",
  1539. duration: 2000,
  1540. });
  1541. this.resetFetch();
  1542. this.closeCreate();
  1543. } else {
  1544. uni.showToast({
  1545. title: res?.msg || "请求失败",
  1546. icon: "none",
  1547. duration: 2000,
  1548. });
  1549. }
  1550. });
  1551. }
  1552. },
  1553. });
  1554. },
  1555. onSend(item) {
  1556. this.currentItem = item;
  1557. this.emailError = false;
  1558. this.emailModalOpen = true;
  1559. },
  1560. closeEmailModal() {
  1561. this.emailModalOpen = false;
  1562. },
  1563. handleSendEmail() {
  1564. const email = String(this.emailForm.email || "").trim();
  1565. if (!email) {
  1566. this.emailError = true;
  1567. return;
  1568. }
  1569. this.closeEmailModal();
  1570. uni.showLoading({
  1571. title: "发送中...",
  1572. });
  1573. const url = "/report/sendEmail";
  1574. request(url, {
  1575. taskId: this.currentItem?.id,
  1576. emailAddress: email + "@999.com.cn",
  1577. path: "reportExport/index.vue",
  1578. }).then((res) => {
  1579. uni.hideLoading();
  1580. if (res.code === 200) {
  1581. uni.showToast({
  1582. title: "发送成功",
  1583. icon: "none",
  1584. duration: 2000,
  1585. });
  1586. } else {
  1587. uni.showToast({
  1588. title: res?.msg || "发送失败",
  1589. icon: "none",
  1590. duration: 2000,
  1591. });
  1592. }
  1593. });
  1594. },
  1595. onScrollToLower() {
  1596. // if (this.isLoading) return;
  1597. // if (this.list.length >= this.totalCount) return;
  1598. // this.isLoading = true;
  1599. // const remain = this.totalCount - this.list.length;
  1600. // const toAdd = Math.min(10, remain);
  1601. // setTimeout(() => {
  1602. // const more = this.genItems(toAdd);
  1603. // this.list = this.list.concat(more);
  1604. // this.animateNew(more);
  1605. // this.isLoading = false;
  1606. // }, 800);
  1607. this.fetchList();
  1608. },
  1609. genItems(n) {
  1610. const res = [];
  1611. const base = this.list.length;
  1612. for (let i = 0; i < n; i++) {
  1613. const idx = base + i + 1;
  1614. const statusIdx = idx % 3;
  1615. const target = [60, 0, 100][statusIdx];
  1616. const sText = ["导出进行中", "导出待开始", "导出已完成"][statusIdx];
  1617. const sClass = ["ing", "wait", "done"][statusIdx];
  1618. const action = ["", "start", "done"][statusIdx];
  1619. res.push({
  1620. title: `第${idx}条公司报表`,
  1621. product: "感冒灵",
  1622. range: "2025-11-27—2025-12-27",
  1623. statusText: sText,
  1624. statusClass: sClass,
  1625. showProgress: statusIdx !== 1,
  1626. progress: 0,
  1627. progressTarget: target,
  1628. action,
  1629. });
  1630. }
  1631. return res;
  1632. },
  1633. // animateAll() {
  1634. // this.list.forEach((it) => this.animateItem(it));
  1635. // },
  1636. // animateNew(arr) {
  1637. // arr.forEach((it) => this.animateItem(it));
  1638. // },
  1639. // animateItem(item) {
  1640. // if (!item.showProgress) return;
  1641. // item.progress = 60;
  1642. // const target = Number(item.progressTarget) || 0;
  1643. // const step = Math.max(1, Math.round(target / 60));
  1644. // const timer = setInterval(() => {
  1645. // item.progress += step;
  1646. // if (item.progress >= target) {
  1647. // item.progress = target;
  1648. // clearInterval(timer);
  1649. // }
  1650. // }, 16);
  1651. // },
  1652. },
  1653. };
  1654. </script>
  1655. <style>
  1656. .report-export-page {
  1657. position: relative;
  1658. box-sizing: border-box;
  1659. /* padding: 170rpx 0 calc(50rpx + env(safe-area-inset-bottom)); */
  1660. padding-top: 290rpx;
  1661. }
  1662. .report-export-search-bar-container {
  1663. position: fixed;
  1664. top: 100rpx;
  1665. left: 0;
  1666. padding: 24rpx 24rpx 16rpx;
  1667. background-color: #f3f6f9;
  1668. z-index: 10;
  1669. box-sizing: border-box;
  1670. width: 100%;
  1671. }
  1672. .report-export-search-bar {
  1673. display: flex;
  1674. align-items: center;
  1675. background: #fff;
  1676. border-radius: 16rpx;
  1677. padding: 16rpx;
  1678. }
  1679. .report-export-search-input-wrap {
  1680. flex: 1;
  1681. position: relative;
  1682. background: #f3f6f9;
  1683. border-radius: 40rpx;
  1684. display: flex;
  1685. align-items: center;
  1686. height: 90rpx;
  1687. padding: 0 12rpx;
  1688. }
  1689. .report-export-search-icon {
  1690. width: 28rpx;
  1691. height: 28rpx;
  1692. margin-left: 16rpx;
  1693. }
  1694. .report-export-search-input {
  1695. flex: 1;
  1696. height: 90rpx;
  1697. padding: 0 16rpx;
  1698. font-size: 28rpx;
  1699. }
  1700. .report-export-search-btn {
  1701. height: 72rpx;
  1702. line-height: 72rpx;
  1703. padding: 0 34rpx;
  1704. border-radius: 36rpx;
  1705. background: #2c69ff;
  1706. color: #fff;
  1707. font-size: 34rpx;
  1708. margin-left: 12rpx;
  1709. }
  1710. .report-export-filter-btn {
  1711. margin-left: 12rpx;
  1712. display: flex;
  1713. flex-direction: column;
  1714. align-items: center;
  1715. justify-content: center;
  1716. }
  1717. .report-export-filter-icon {
  1718. width: 40rpx;
  1719. height: 40rpx;
  1720. }
  1721. .report-export-filter-text {
  1722. margin-top: 8rpx;
  1723. font-size: 24rpx;
  1724. color: #2c69ff;
  1725. }
  1726. .scan-rate-ranges-container {
  1727. position: fixed;
  1728. top: 262rpx;
  1729. left: 0;
  1730. width: 100%;
  1731. height: 120rpx;
  1732. background: #f3f6f9;
  1733. z-index: 6;
  1734. }
  1735. .scan-rate-ranges {
  1736. padding: 0rpx 24rpx 20rpx;
  1737. }
  1738. .scan-rate-ranges-content {
  1739. display: flex;
  1740. background: #fff;
  1741. padding: 20rpx 30rpx;
  1742. border-radius: 16rpx;
  1743. justify-content: space-between;
  1744. }
  1745. .scan-rate-range {
  1746. padding: 12rpx 35rpx;
  1747. border-radius: 5rpx;
  1748. background: rgb(240, 240, 240);
  1749. font-size: 26rpx;
  1750. }
  1751. .scan-rate-range.scan-rate-active {
  1752. background: #2c69ff;
  1753. color: #fff;
  1754. }
  1755. .report-export-list-scroll {
  1756. position: fixed;
  1757. top: 380rpx;
  1758. left: 0;
  1759. box-sizing: border-box;
  1760. width: 100%;
  1761. padding: 0 24rpx;
  1762. padding-bottom: calc(env(safe-area-inset-bottom) + 50rpx);
  1763. box-sizing: border-box;
  1764. }
  1765. .report-export-item-card {
  1766. background: #fff;
  1767. border-radius: 16rpx;
  1768. padding: 24rpx;
  1769. margin-bottom: 16rpx;
  1770. }
  1771. .report-export-item-header {
  1772. width: 100%;
  1773. display: flex;
  1774. align-items: flex-start;
  1775. flex-wrap: wrap;
  1776. }
  1777. .report-export-item-title {
  1778. flex: 1;
  1779. width: 0;
  1780. word-break: break-word;
  1781. margin-right: 20rpx;
  1782. font-size: 38rpx;
  1783. color: #2c69ff;
  1784. display: -webkit-box;
  1785. -webkit-box-orient: vertical;
  1786. -webkit-line-clamp: 2;
  1787. overflow: hidden;
  1788. text-decoration: underline;
  1789. }
  1790. .report-export-status {
  1791. flex-shrink: 0;
  1792. padding: 8rpx 12rpx;
  1793. border-radius: 10rpx;
  1794. font-size: 22rpx;
  1795. color: #fff;
  1796. }
  1797. .report-export-status.report-export-status-2 {
  1798. background: #67c23a;
  1799. }
  1800. .report-export-status.report-export-status-1 {
  1801. background: #888;
  1802. }
  1803. .report-export-status.report-export-status-3,
  1804. .report-export-status.report-export-status-4 {
  1805. background: #2c69ff;
  1806. }
  1807. .report-export-item-row {
  1808. margin-top: 12rpx;
  1809. font-size: 28rpx;
  1810. color: #999;
  1811. }
  1812. .report-export-progress-wrap {
  1813. margin-top: 20rpx;
  1814. }
  1815. .report-export-progress {
  1816. margin-top: 8rpx;
  1817. height: 32rpx;
  1818. background: #e6ebf5;
  1819. border-radius: 999rpx;
  1820. overflow: hidden;
  1821. position: relative;
  1822. }
  1823. .report-export-progress-fill {
  1824. position: absolute;
  1825. left: 0;
  1826. top: 0;
  1827. height: 100%;
  1828. background: #2c69ff;
  1829. border-radius: 999rpx;
  1830. width: 0;
  1831. transition: width 0.2s linear;
  1832. }
  1833. .report-export-progress-text {
  1834. position: absolute;
  1835. left: 50%;
  1836. top: 50%;
  1837. transform: translate(-50%, -50%);
  1838. font-size: 26rpx;
  1839. color: #fff;
  1840. z-index: 2;
  1841. }
  1842. .report-export-action-row {
  1843. margin-top: 16rpx;
  1844. display: flex;
  1845. align-items: center;
  1846. justify-content: flex-end;
  1847. }
  1848. .report-export-action-btn {
  1849. height: 50rpx;
  1850. line-height: 50rpx;
  1851. padding: 0 28rpx;
  1852. border-radius: 12rpx;
  1853. font-size: 30rpx;
  1854. margin: 0;
  1855. }
  1856. .report-export-action-btn + .report-export-action-btn {
  1857. margin-left: 12rpx;
  1858. }
  1859. .report-export-action-btn.report-export-primary {
  1860. background: #2c69ff;
  1861. color: #fff;
  1862. }
  1863. .report-export-action-btn.report-export-info {
  1864. background: #67c23a;
  1865. color: #fff;
  1866. }
  1867. .report-export-loading-row {
  1868. justify-content: center;
  1869. }
  1870. .report-export-loading-wrapper {
  1871. width: 100%;
  1872. height: 76rpx;
  1873. display: flex;
  1874. align-items: center;
  1875. justify-content: center;
  1876. }
  1877. .report-export-loading-icon {
  1878. width: 40rpx;
  1879. height: 40rpx;
  1880. animation: spin 1s linear infinite;
  1881. }
  1882. @keyframes spin {
  1883. from {
  1884. transform: rotate(0deg);
  1885. }
  1886. to {
  1887. transform: rotate(360deg);
  1888. }
  1889. }
  1890. .report-export-footer {
  1891. position: fixed;
  1892. left: 0;
  1893. right: 0;
  1894. bottom: 0;
  1895. padding: 12rpx 30rpx calc(50rpx + env(safe-area-inset-bottom));
  1896. background: #fff;
  1897. }
  1898. .report-export-footer-btn {
  1899. height: 86rpx;
  1900. border-radius: 999rpx;
  1901. background: #2c69ff;
  1902. color: #fff;
  1903. display: flex;
  1904. align-items: center;
  1905. justify-content: center;
  1906. font-size: 30rpx;
  1907. box-shadow: 0 8rpx 24rpx rgba(44, 105, 255, 0.35);
  1908. }
  1909. .report-export-create-modal-mask {
  1910. position: fixed;
  1911. left: 0;
  1912. right: 0;
  1913. top: 0;
  1914. bottom: 0;
  1915. background: rgba(0, 0, 0, 0.35);
  1916. z-index: 90;
  1917. }
  1918. .report-export-create-modal {
  1919. position: fixed;
  1920. left: 0;
  1921. right: 0;
  1922. bottom: -100%;
  1923. width: 100%;
  1924. background: #fff;
  1925. border-top-left-radius: 45rpx;
  1926. border-top-right-radius: 45rpx;
  1927. z-index: 92;
  1928. box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.12);
  1929. /* transform: translateY(100%); */
  1930. transition: bottom 0.25s ease-out;
  1931. }
  1932. .report-export-create-modal--open {
  1933. /* transform: translateY(0) !important; */
  1934. bottom: 0 !important;
  1935. }
  1936. .report-export-create-modal-title {
  1937. position: relative;
  1938. padding: 28rpx 28rpx 12rpx;
  1939. font-size: 34rpx;
  1940. color: #333;
  1941. text-align: center;
  1942. line-height: 60rpx;
  1943. font-weight: 500;
  1944. }
  1945. .report-export-create-modal-close {
  1946. position: absolute;
  1947. right: 32rpx;
  1948. top: 50%;
  1949. transform: translateY(-50%);
  1950. padding: 10rpx;
  1951. color: #909399;
  1952. font-size: 55rpx;
  1953. line-height: 1;
  1954. }
  1955. .report-export-create-modal-body {
  1956. padding: 0 32rpx 100rpx;
  1957. }
  1958. .report-export-create-modal-row {
  1959. display: flex;
  1960. flex-direction: column;
  1961. margin-top: 32rpx;
  1962. position: relative;
  1963. }
  1964. .report-export-create-modal-label {
  1965. width: auto;
  1966. font-size: 28rpx;
  1967. color: #333;
  1968. margin-bottom: 16rpx;
  1969. font-weight: 500;
  1970. }
  1971. .report-export-create-modal-inputwrap {
  1972. flex: 1;
  1973. position: relative;
  1974. border: 1rpx solid #dcdfe6;
  1975. border-radius: 12rpx;
  1976. display: flex;
  1977. align-items: center;
  1978. min-height: 80rpx;
  1979. padding: 0 24rpx;
  1980. background-color: #fff;
  1981. }
  1982. .report-export-create-modal-static {
  1983. position: relative;
  1984. flex: 1;
  1985. max-height: 115rpx;
  1986. font-size: 28rpx;
  1987. color: #606266;
  1988. line-height: 40rpx;
  1989. padding: 20rpx 0;
  1990. overflow-y: auto;
  1991. padding-right: 20rpx;
  1992. }
  1993. .report-export-input-simulator {
  1994. display: flex;
  1995. justify-content: center;
  1996. align-items: center;
  1997. }
  1998. .report-export-create-modal-input {
  1999. flex: 1;
  2000. height: 80rpx;
  2001. font-size: 28rpx;
  2002. color: #606266;
  2003. }
  2004. .report-export-dropdown-other-customer-input {
  2005. color: #666;
  2006. }
  2007. /* .report-export-create-modal-select-arrow {
  2008. width: 18rpx;
  2009. height: 18rpx;
  2010. border: 5rpx solid #999;
  2011. border-top: none;
  2012. border-left: none;
  2013. transform: rotate(45deg);
  2014. margin: 0 8rpx 10rpx 12rpx;
  2015. }
  2016. .report-export-create-modal-select-arrow.disabled {
  2017. opacity: 0.4;
  2018. pointer-events: none;
  2019. } */
  2020. .report-export-create-modal-dropdown {
  2021. position: absolute;
  2022. left: 0;
  2023. right: 0;
  2024. background: #fff;
  2025. border: 1rpx solid #eef0f4;
  2026. border-radius: 12rpx;
  2027. box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08);
  2028. z-index: 6;
  2029. max-height: 510rpx;
  2030. overflow-y: auto;
  2031. -webkit-overflow-scrolling: touch;
  2032. }
  2033. .report-export-create-modal-dropdown-list {
  2034. max-height: 350rpx;
  2035. }
  2036. .report-export-dropdown-search-row {
  2037. padding: 10rpx;
  2038. }
  2039. .report-export-dropdown-search-input {
  2040. width: 100%;
  2041. height: 60rpx;
  2042. border: 1rpx solid #eaeef4;
  2043. border-radius: 8rpx;
  2044. box-sizing: border-box;
  2045. padding: 0 16rpx;
  2046. font-size: 28rpx;
  2047. }
  2048. .report-export-create-modal-dropdown-item {
  2049. padding: 16rpx 20rpx;
  2050. font-size: 28rpx;
  2051. color: #333;
  2052. }
  2053. .report-export-selected {
  2054. background: #f0f5ff;
  2055. }
  2056. .report-export-input-arrow {
  2057. width: 16rpx;
  2058. height: 16rpx;
  2059. border-right: 3rpx solid #c0c4cc;
  2060. border-bottom: 3rpx solid #c0c4cc;
  2061. transform: rotate(45deg);
  2062. margin-top: -6rpx;
  2063. }
  2064. .customer-chip {
  2065. display: inline-block;
  2066. position: relative;
  2067. line-height: 50rpx;
  2068. border: 1rpx solid #eaeef4;
  2069. border-radius: 8rpx;
  2070. padding: 0rpx 44rpx 0rpx 16rpx;
  2071. margin-right: 8rpx;
  2072. margin-bottom: 8rpx;
  2073. font-size: 22rpx;
  2074. color: #333;
  2075. }
  2076. .customer-chip-close {
  2077. position: absolute;
  2078. right: 6rpx;
  2079. top: 0;
  2080. color: #666;
  2081. font-size: 28rpx;
  2082. padding: 0 8rpx;
  2083. border-radius: 6rpx;
  2084. }
  2085. .customer-clear-all {
  2086. position: absolute;
  2087. right: 6rpx;
  2088. top: 50%;
  2089. transform: translateY(-50%);
  2090. line-height: 50rpx;
  2091. padding: 8rpx 10rpx;
  2092. font-size: 40rpx;
  2093. }
  2094. .report-export-create-modal-estimated {
  2095. font-size: 28rpx;
  2096. color: #666;
  2097. }
  2098. .report-export-create-modal-footer {
  2099. padding: 18rpx 28rpx calc(50rpx + env(safe-area-inset-bottom));
  2100. }
  2101. .report-export-create-modal-btn {
  2102. line-height: 90rpx;
  2103. border-radius: 20rpx;
  2104. background: #2c69ff;
  2105. color: #fff;
  2106. text-align: center;
  2107. font-size: 30rpx;
  2108. }
  2109. .report-export-create-email-modal {
  2110. transform: translateY(200%);
  2111. height: auto;
  2112. top: 30%;
  2113. bottom: auto;
  2114. border-radius: 16rpx;
  2115. width: 600rpx;
  2116. left: 75rpx;
  2117. }
  2118. .report-export-email-input-wrap {
  2119. display: flex;
  2120. align-items: center;
  2121. background: #f5f7fa;
  2122. border-radius: 8rpx;
  2123. padding: 0 20rpx;
  2124. height: 80rpx;
  2125. border: 1rpx solid transparent;
  2126. }
  2127. .report-export-input-error {
  2128. border-color: #ff4d4f;
  2129. }
  2130. .report-export-email-input {
  2131. flex: 1;
  2132. font-size: 28rpx;
  2133. color: #333;
  2134. height: 100%;
  2135. }
  2136. .report-export-email-suffix {
  2137. font-size: 28rpx;
  2138. color: #333;
  2139. margin-left: 10rpx;
  2140. }
  2141. .report-export-error-text {
  2142. font-size: 24rpx;
  2143. color: #ff4d4f;
  2144. margin-top: 10rpx;
  2145. display: block;
  2146. }
  2147. .report-export-input-disabled {
  2148. background-color: #f5f7fa;
  2149. cursor: not-allowed;
  2150. opacity: 0.7;
  2151. }
  2152. </style>