index.vue 65 KB

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