index.vue 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283
  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. const userEmail = uni.getStorageSync('traceCode_useremail')
  870. this.emailForm.email = userEmail
  871. console.log("reportExport\index.vue,storage,userInfo", userInfo);
  872. this.initList();
  873. this.getProviceList();
  874. this.getDrugInfoName();
  875. this.fetchList();
  876. try {
  877. uni.onKeyboardHeightChange(({ height }) => {
  878. this.dropdownUpward = height > 0;
  879. });
  880. } catch (e) {}
  881. },
  882. computed: {
  883. taskTitle() {
  884. if (this.modalType === "create") {
  885. return "创建任务";
  886. } else if (this.modalType == "edit") {
  887. return "修改任务";
  888. } else if (this.modalType == "read") {
  889. return "查看任务";
  890. }
  891. },
  892. },
  893. watch: {
  894. "form.customerType"(val) {
  895. this.customerPage = 1;
  896. this.customerTotal = null;
  897. this.customerHasMore = true;
  898. this.customers = [];
  899. if (this.customerDebounceTimer) clearTimeout(this.customerDebounceTimer);
  900. this.getCustomerOptions();
  901. },
  902. "form.region": {
  903. handler() {
  904. this.customerPage = 1;
  905. this.customerTotal = null;
  906. this.customerHasMore = true;
  907. this.customers = [];
  908. if (this.customerDebounceTimer)
  909. clearTimeout(this.customerDebounceTimer);
  910. this.getCustomerOptions();
  911. },
  912. deep: true,
  913. },
  914. "emailForm.email": {
  915. handler(newVal, oldVal) {
  916. if (!oldVal && !newVal && newVal !== oldVal) {
  917. this.emailError = false;
  918. } else {
  919. this.emailError = !newVal;
  920. }
  921. },
  922. deep: true,
  923. },
  924. "filterForm.status"(val) {
  925. this.resetFetch();
  926. },
  927. },
  928. methods: {
  929. getCustomerName(data = {}) {
  930. const { customerName = "", otherCustomer = "" } = data;
  931. let name = customerName || "";
  932. if (otherCustomer) {
  933. if (name) {
  934. name += `,${otherCustomer}`;
  935. } else {
  936. name = otherCustomer;
  937. }
  938. }
  939. const arr = name?.split(",");
  940. if (arr.length == 0) return "--";
  941. return arr.length == 1
  942. ? arr[0].trim()
  943. : `${arr[0].trim()}等${arr.length - 1}家公司`;
  944. },
  945. formatDate(date) {
  946. return formatDate({ date }, "YYYY-MM-DD");
  947. },
  948. normalizeDateToYMD(value) {
  949. if (!value) return "";
  950. if (typeof value === "string") {
  951. const trimmed = value.trim();
  952. if (trimmed.length >= 10) return trimmed.slice(0, 10);
  953. return trimmed;
  954. }
  955. return this.formatDate(value);
  956. },
  957. getStatusText(status) {
  958. if (status == "1") {
  959. return "导出待开始";
  960. } else if (status == "2") {
  961. return "导出进行中";
  962. } else if (status == "3" || status == "4") {
  963. return "导出已完成";
  964. }
  965. return "未知状态";
  966. },
  967. getDrugInfoName() {
  968. request("/bills/getDrugInfoName", {
  969. path: "/reportExport/index.vue",
  970. }).then((res) => {
  971. if (res.code == 200) {
  972. const _data = res.data;
  973. this.options.product = _data;
  974. }
  975. });
  976. },
  977. getGuigeList(physicName) {
  978. if (!physicName) return;
  979. request("/report/getDrugSpec", {
  980. physicName,
  981. path: "/reportExport/index.vue",
  982. }).then((res) => {
  983. if (res.code == 200) {
  984. this.options.pkgSpec = res.data || [];
  985. }
  986. });
  987. },
  988. getProviceList() {
  989. request("/common/getProviceList", {
  990. path: "/reportExport/index.vue",
  991. }).then((res) => {
  992. if (res.code == 200) {
  993. const _data = res.data;
  994. this.options.region = _data;
  995. }
  996. });
  997. },
  998. getCustomerOptions() {
  999. if (!this.customerHasMore || this.customerLoading) return;
  1000. this.customerLoading = true;
  1001. request("/customer/info/getCustomerInfo", {
  1002. pageNum: this.customerPage,
  1003. pageSize: this.customerPageSize,
  1004. customerName: this.customerSearch || "",
  1005. customerLevel: customerTypeMap?.[this.form.customerType] || undefined,
  1006. provinceCode: this.form?.region?.regionCode || undefined,
  1007. path: "/reportExport/index.vue",
  1008. }).then((res) => {
  1009. if (res.code == 200) {
  1010. const _data = res.data || {};
  1011. this.customerTotal = _data.total || 0;
  1012. const list = Array.isArray(_data.list) ? _data.list : [];
  1013. this.customers = [...this.customers, ...list];
  1014. if (this.customers.length >= this.customerTotal) {
  1015. this.customerHasMore = false;
  1016. } else {
  1017. this.customerPage++;
  1018. this.customerHasMore = true;
  1019. }
  1020. }
  1021. this.customerLoading = false;
  1022. });
  1023. },
  1024. initList() {
  1025. const info = uni.getSystemInfoSync();
  1026. const h = info.windowHeight || 800;
  1027. this.listViewHeight = Math.max(0, h - 280) + "px";
  1028. // this.list = this.genItems(Math.min(10, this.totalCount));
  1029. // this.animateAll();
  1030. },
  1031. onFilter() {
  1032. this.filterModalOpen = true;
  1033. },
  1034. showModal(item = {}) {
  1035. const map = {
  1036. 1: "edit",
  1037. 2: "read",
  1038. 3: "read",
  1039. };
  1040. this.modalType = map[item?.status] || "create";
  1041. if (this.modalType === "create") {
  1042. this.taskTitle = "创建任务";
  1043. } else {
  1044. if (this.modalType == "edit") {
  1045. this.taskTitle = "修改任务";
  1046. } else if (this.modalType == "read") {
  1047. this.taskTitle = "查看任务";
  1048. }
  1049. const cNames = item.customerName ? item.customerName.split(",") : [];
  1050. const cCodes = item.customerId
  1051. ? String(item.customerId).split(",")
  1052. : [];
  1053. const regionCode = item.regionCode || item.provinceCode || "";
  1054. let regionName = item.regionName || item.provinceName || "";
  1055. if (!regionName && regionCode && Array.isArray(this.options.region)) {
  1056. const regionItem = this.options.region.find(
  1057. (r) => r.regionCode === regionCode || r.provinceCode === regionCode,
  1058. );
  1059. if (regionItem) {
  1060. regionName = regionItem.regionName || regionItem.name || "";
  1061. }
  1062. }
  1063. let customerTypeLabel = "";
  1064. const cType = item.customerType;
  1065. if (cType === 1 || cType === "1") {
  1066. customerTypeLabel = "VIP客户";
  1067. } else if (cType === 2 || cType === "2") {
  1068. customerTypeLabel = "二级客户";
  1069. } else if (cType === 3 || cType === "3") {
  1070. customerTypeLabel = "三级客户";
  1071. } else if (typeof cType === "string" && cType) {
  1072. customerTypeLabel = customerTypeReverseMap[cType] || cType;
  1073. }
  1074. this.form = {
  1075. customer: cCodes.map((i, index) => ({
  1076. customerName: cNames[index],
  1077. customerCode: i,
  1078. })),
  1079. region: {
  1080. regionCode,
  1081. regionName,
  1082. },
  1083. customerType: customerTypeLabel,
  1084. product: {
  1085. physicName: item.physicName,
  1086. drugEntBaseInfoId: item.drugEntBaseInfoId,
  1087. },
  1088. pkgSpec: item?.pkgSpec || "",
  1089. otherCustomer: item?.otherCustomer || "",
  1090. otherCustomerCode: item?.otherCustomerCode || "",
  1091. };
  1092. if (item.physicName) {
  1093. this.getGuigeList(item.physicName);
  1094. }
  1095. this.dateRange = [
  1096. this.normalizeDateToYMD(item.beginTime),
  1097. this.normalizeDateToYMD(item.endTime),
  1098. ];
  1099. }
  1100. this.createModalOpen = true;
  1101. this.currentItem = item;
  1102. },
  1103. fetchList() {
  1104. // this.list = [];
  1105. // setTimeout(() => {
  1106. // const n = Math.min(10, this.totalCount || 10);
  1107. // this.list = this.genItems(n);
  1108. // if (!this.totalCount) this.totalCount = this.list.length;
  1109. // this.animateAll();
  1110. // this.fetchLoading = false;
  1111. // }, 1000);
  1112. if (!this.hasmore) {
  1113. setTimeout(() => {
  1114. this.fetchLoading = false;
  1115. this.loading = false;
  1116. }, 500);
  1117. return;
  1118. }
  1119. if (this.fetchLoading) return;
  1120. this.fetchLoading = true;
  1121. request("/report/getReportTaskPage", {
  1122. reportType: 2,
  1123. taskType: statusMap?.[this.filterForm?.status] || "",
  1124. drugEntBaseInfoId: this.filterForm?.product?.drugEntBaseInfoId,
  1125. pkgSpec: this.filterForm?.pkgSpec || "",
  1126. beginTime: this.filterDateRange[0],
  1127. endTime: this.filterDateRange[1],
  1128. customerName: this.keyword || "",
  1129. pageNum: this.pageNum,
  1130. pageSize: this.pageSize,
  1131. path: "reportExport/index.vue",
  1132. }).then((res) => {
  1133. if (res.code == 200) {
  1134. const _data = res.data || {};
  1135. const { list, total } = _data;
  1136. this.totalCount = total || 0;
  1137. const incoming = Array.isArray(list) ? list : [];
  1138. const existingIds = new Set(this.list.map((v) => v?.id));
  1139. const merged = incoming.filter((v) => {
  1140. const id = v?.id;
  1141. return id === undefined ? true : !existingIds.has(id);
  1142. });
  1143. if (merged.length === 0 && incoming.length > 0) {
  1144. this.hasmore = false;
  1145. } else {
  1146. this.list = [...this.list, ...merged];
  1147. }
  1148. if (this.list.length < this.totalCount) {
  1149. this.hasmore = true;
  1150. this.pageNum++;
  1151. } else {
  1152. this.hasmore = false;
  1153. }
  1154. // this.list.push({
  1155. // ...this.list[1],
  1156. // status: 3,
  1157. // });
  1158. // this.list.push({
  1159. // ...this.list[0],
  1160. // finishTime: "2025-12-15",
  1161. // status: 3,
  1162. // });
  1163. // this.animateAll();
  1164. }
  1165. this.fetchLoading = false;
  1166. this.loading = false;
  1167. });
  1168. },
  1169. resetFetch() {
  1170. this.loading = true;
  1171. this.list = [];
  1172. this.pageNum = 1;
  1173. this.hasmore = true;
  1174. this.fetchList();
  1175. },
  1176. toDetail(item) {
  1177. uni.navigateTo({
  1178. url: `/traceCodePackages/traceabilityReport/pages/reportExport/detail/index?id=${
  1179. item.id
  1180. }&title=${encodeURIComponent(this.getCustomerName(item))}`,
  1181. });
  1182. },
  1183. onSearch() {
  1184. this.resetFetch();
  1185. },
  1186. onCreate() {
  1187. this.modalType = "create";
  1188. this.taskTitle = "创建任务";
  1189. this.createModalOpen = true;
  1190. },
  1191. closeCreate() {
  1192. this.filterModalOpen = false;
  1193. this.createModalOpen = false;
  1194. this.closeDropdownAll();
  1195. this.form = {
  1196. region: { regionName: "" },
  1197. customerType: "",
  1198. customer: [],
  1199. product: { physicName: "" },
  1200. otherCustomer: "",
  1201. otherCustomerCode: "",
  1202. };
  1203. this.searchForm = {
  1204. region: "",
  1205. product: "",
  1206. };
  1207. this.dateRange = [];
  1208. if (this.computeTimer) {
  1209. clearTimeout(this.computeTimer);
  1210. this.computeTimer = null;
  1211. }
  1212. },
  1213. confirmCreate() {
  1214. let flag = false;
  1215. Object.values(this.dropdown).forEach((v) => {
  1216. if (v) {
  1217. flag = true;
  1218. }
  1219. });
  1220. if (flag) {
  1221. this.closeDropdownAll();
  1222. return;
  1223. }
  1224. if (!this.isFormComplete()) {
  1225. // uni.showToast({ title: "请完整填写任务内容", icon: "none" });
  1226. return;
  1227. }
  1228. // uni.showToast({ title: "已创建", icon: "none" });
  1229. uni.showLoading({
  1230. title: this.modalType === "create" ? "创建中..." : "修改中...",
  1231. });
  1232. const url =
  1233. this.modalType === "create" ? `/report/save` : `/report/update`;
  1234. const customerId = (this.form?.customer || [])
  1235. .map((v) => v?.customerCode || "")
  1236. .join(",");
  1237. const customerName = (this.form?.customer || [])
  1238. .map((v) => v?.customerName || "")
  1239. .join(",");
  1240. request(url, {
  1241. id:
  1242. this.modalType === "create" ? undefined : this.currentItem?.id || "",
  1243. reportType: 2,
  1244. regionCode: this.form?.region?.regionCode || "",
  1245. customerType: customerTypeMap?.[this.form?.customerType] || "",
  1246. customerId,
  1247. customerName,
  1248. otherCustomer: this.form?.otherCustomer || "",
  1249. otherCustomerCode: this.form?.otherCustomerCode || "",
  1250. drugEntBaseInfoId: this.form?.product?.drugEntBaseInfoId || "",
  1251. pkgSpec: this.form?.pkgSpec || "",
  1252. physicName: this.form?.product?.physicName || "",
  1253. beginTime: this.formatDate(this.dateRange[0], "YYYY-MM-DD"),
  1254. endTime: this.formatDate(this.dateRange[1], "YYYY-MM-DD"),
  1255. path: "",
  1256. }).then((res) => {
  1257. if (res.code == 200) {
  1258. uni.hideLoading();
  1259. uni.showToast({
  1260. title: this.modalType === "create" ? "已创建" : "已修改",
  1261. icon: "none",
  1262. });
  1263. this.resetFetch();
  1264. this.closeCreate();
  1265. }
  1266. });
  1267. },
  1268. isFormComplete() {
  1269. const f = this.form;
  1270. const drOk =
  1271. Array.isArray(this.dateRange) &&
  1272. this.dateRange.length === 2 &&
  1273. this.dateRange[0] &&
  1274. this.dateRange[1];
  1275. let customerOk = Array.isArray(f.customer)
  1276. ? f.customer.length > 0
  1277. : !!f.customer;
  1278. customerOk = customerOk || f.otherCustomer;
  1279. if (!customerOk) {
  1280. uni.showToast({ title: "请选择至少一个客户或其他客户", icon: "none" });
  1281. return false;
  1282. }
  1283. if (!f.product?.physicName) {
  1284. uni.showToast({ title: "请选择品种", icon: "none" });
  1285. return false;
  1286. }
  1287. if (!drOk) {
  1288. uni.showToast({ title: "请选择时间范围", icon: "none" });
  1289. return false;
  1290. }
  1291. return true;
  1292. // return (
  1293. // f.region?.regionName &&
  1294. // f.customerType &&
  1295. // customerOk &&
  1296. // f.product?.physicName &&
  1297. // drOk
  1298. // );
  1299. },
  1300. confirmDelete() {
  1301. uni.showModal({
  1302. title: "确认删除吗?",
  1303. success: (res) => {
  1304. if (res.confirm) {
  1305. uni.showLoading();
  1306. request("/report/delete", {
  1307. id: this.currentItem?.id || "",
  1308. path: "reportExport/index.vue",
  1309. }).then((res) => {
  1310. uni.hideLoading();
  1311. if (res.code == 200) {
  1312. uni.showToast({
  1313. title: "删除成功",
  1314. icon: "none",
  1315. duration: 2000,
  1316. });
  1317. this.resetFetch();
  1318. this.closeCreate();
  1319. } else {
  1320. uni.showToast({
  1321. title: res?.msg || "删除失败",
  1322. icon: "none",
  1323. duration: 2000,
  1324. });
  1325. }
  1326. });
  1327. }
  1328. },
  1329. });
  1330. },
  1331. onInput(k) {
  1332. this.closeDropdownAll();
  1333. this.dropdown[k] = true;
  1334. if (k === "customer") {
  1335. this.customerPage = 1;
  1336. this.customerTotal = null;
  1337. this.customerHasMore = true;
  1338. this.customers = [];
  1339. if (this.customerDebounceTimer)
  1340. clearTimeout(this.customerDebounceTimer);
  1341. this.customerDebounceTimer = setTimeout(() => {
  1342. this.getCustomerOptions();
  1343. }, 500);
  1344. return;
  1345. }
  1346. if (k === "product") {
  1347. this.initProductList("create");
  1348. }
  1349. },
  1350. closeDropdownAll() {
  1351. this.dropdown = {
  1352. region: false,
  1353. customerType: false,
  1354. customer: false,
  1355. product: false,
  1356. pkgSpec: false,
  1357. };
  1358. this.filterDropdown.product = false;
  1359. this.filterDropdown.pkgSpec = false;
  1360. },
  1361. openFilterDropdown(k) {
  1362. this.closeDropdownAll();
  1363. this.filterDropdown[k] = true;
  1364. if (k === "product") {
  1365. this.initProductList("filter");
  1366. }
  1367. },
  1368. toggleFilterDropdown(k) {
  1369. this.filterDropdown[k] = !this.filterDropdown[k];
  1370. },
  1371. onFilterInput(k) {
  1372. this.closeDropdownAll();
  1373. this.filterDropdown[k] = true;
  1374. if (k === "product") {
  1375. this.initProductList("filter");
  1376. }
  1377. },
  1378. pickFilterOption(k, v) {
  1379. if (!["status"].includes(k) && this.filterForm[k] === v) {
  1380. this.filterForm[k] = "";
  1381. this.filterDropdown[k] = false;
  1382. return;
  1383. }
  1384. this.filterForm[k] = v;
  1385. if (k === "product") {
  1386. this.filterForm.pkgSpec = "";
  1387. this.getGuigeList(v.physicName);
  1388. }
  1389. this.filterDropdown[k] = false;
  1390. },
  1391. filteredFilterOptions(k) {
  1392. const arr = k === "product" ? this.products || [] : [];
  1393. const q = String(this.filterForm[k] || "").trim();
  1394. if (!q) return arr;
  1395. return arr.filter((it) => it.indexOf(q) !== -1);
  1396. },
  1397. onFilterDateChange() {},
  1398. confirmFilter() {
  1399. this.filterModalOpen = false;
  1400. this.resetFetch();
  1401. },
  1402. resetFilter() {
  1403. this.filterForm = {
  1404. product: { physicName: "" },
  1405. status: "全部",
  1406. pkgSpec: "",
  1407. };
  1408. this.filterSearchForm.product = "";
  1409. this.filterProductPage = 0;
  1410. this.filterDisplayProducts = [];
  1411. this.filterDropdown = { product: false, pkgSpec: false };
  1412. this.filterDateRange = [];
  1413. this.resetFetch();
  1414. },
  1415. openDropdown(k) {
  1416. this.closeDropdownAll();
  1417. this.dropdown[k] = true;
  1418. if (k === "customer") {
  1419. if (!this.customers || this.customers.length === 0) {
  1420. this.customerPage = 1;
  1421. this.customerTotal = null;
  1422. this.customerHasMore = true;
  1423. this.getCustomerOptions();
  1424. }
  1425. }
  1426. if (k === "product") {
  1427. this.initProductList("create");
  1428. }
  1429. },
  1430. toggleDropdown(k) {
  1431. this.dropdown[k] = !this.dropdown[k];
  1432. },
  1433. pickOption(k, v) {
  1434. if (k === "customer") {
  1435. if (!Array.isArray(this.form.customer)) this.form.customer = [];
  1436. const idx = this.form.customer.indexOf(v);
  1437. if (idx === -1) {
  1438. this.form.customer.push(v);
  1439. } else {
  1440. this.form.customer.splice(idx, 1);
  1441. }
  1442. return;
  1443. }
  1444. this.form[k] = v;
  1445. if (k === "product") {
  1446. this.form.pkgSpec = "";
  1447. this.getGuigeList(v.physicName);
  1448. }
  1449. this.dropdown[k] = false;
  1450. },
  1451. isCustomerSelected(name) {
  1452. const arr = this.form.customer;
  1453. if (!Array.isArray(arr)) return false;
  1454. return arr.some((i) => i.customerName === name);
  1455. },
  1456. removeCustomer(name) {
  1457. if (!Array.isArray(this.form.customer)) return;
  1458. const idx = this.form.customer.findIndex((i) => i.customerName === name);
  1459. if (idx !== -1) this.form.customer.splice(idx, 1);
  1460. },
  1461. clearAllCustomers() {
  1462. this.form.customer = [];
  1463. },
  1464. filteredOptions(k, type) {
  1465. const arr = this.options[k] || [];
  1466. let q = "";
  1467. if (type === "filter") {
  1468. q = this.filterSearchForm[k] || "";
  1469. } else {
  1470. q = this.searchForm[k] || "";
  1471. }
  1472. q = String(q).trim().toLocaleLowerCase();
  1473. if (!q) return arr;
  1474. return arr.filter((it) => {
  1475. if (typeof it === "string")
  1476. return it.toLocaleLowerCase().indexOf(q) !== -1;
  1477. if (it && typeof it === "object") {
  1478. const name =
  1479. k === "region"
  1480. ? it.regionName || it.name || ""
  1481. : it.physicName || it.productName || "";
  1482. return String(name).toLocaleLowerCase().indexOf(q) !== -1;
  1483. }
  1484. return false;
  1485. });
  1486. },
  1487. // Initialize product list for pagination
  1488. initProductList(mode) {
  1489. const allProducts = this.filteredOptions(
  1490. "product",
  1491. mode === "filter" ? "filter" : undefined,
  1492. );
  1493. const res = getPaginatedList({
  1494. page: 0,
  1495. size: 10,
  1496. initData: allProducts,
  1497. data: [],
  1498. });
  1499. if (mode === "filter") {
  1500. this.filterProductPage = res.page;
  1501. this.filterDisplayProducts = res.data;
  1502. } else {
  1503. this.productPage = res.page;
  1504. this.displayProducts = res.data;
  1505. }
  1506. },
  1507. // Load more products on scroll
  1508. loadMoreProducts(mode) {
  1509. const allProducts = this.filteredOptions(
  1510. "product",
  1511. mode === "filter" ? "filter" : undefined,
  1512. );
  1513. const isFilter = mode === "filter";
  1514. const currentPage = isFilter ? this.filterProductPage : this.productPage;
  1515. const currentData = isFilter
  1516. ? this.filterDisplayProducts
  1517. : this.displayProducts;
  1518. const res = getPaginatedList({
  1519. page: currentPage,
  1520. size: 10,
  1521. initData: allProducts,
  1522. data: currentData,
  1523. });
  1524. if (res.data) {
  1525. if (isFilter) {
  1526. this.filterProductPage = res.page;
  1527. this.filterDisplayProducts = res.data;
  1528. } else {
  1529. this.productPage = res.page;
  1530. this.displayProducts = res.data;
  1531. }
  1532. }
  1533. },
  1534. onSearchFocus() {
  1535. this.dropdownUpward = true;
  1536. },
  1537. onSearchBlur() {
  1538. this.dropdownUpward = false;
  1539. },
  1540. dropdownPosStyle() {
  1541. // if (this.dropdownUpward) {
  1542. // return { bottom: "84rpx" };
  1543. // }
  1544. return { top: "84rpx" };
  1545. },
  1546. openDatePicker() {
  1547. if (this.modalType === "read") return;
  1548. this.$refs.datePicker.show();
  1549. },
  1550. onDateChange(val) {
  1551. const arr = Array.isArray(val) ? val : this.dateRange;
  1552. if (!Array.isArray(arr) || arr.length !== 2) return;
  1553. const startDate = new Date(arr[0].replace(/-/g, "/"));
  1554. const endDate = new Date(arr[1].replace(/-/g, "/"));
  1555. const diff = endDate.getTime() - startDate.getTime();
  1556. const limit = 183 * 24 * 3600 * 1000; // Approx 6 months
  1557. if (diff > limit) {
  1558. uni.showToast({
  1559. title: "时间范围不能超过半年",
  1560. icon: "none",
  1561. });
  1562. this.dateRange = [];
  1563. return;
  1564. }
  1565. this.dateRange = [
  1566. this.normalizeDateToYMD(arr[0]),
  1567. this.normalizeDateToYMD(arr[1]),
  1568. ];
  1569. },
  1570. onStart(item) {
  1571. uni.showModal({
  1572. title: "是否开始导出报表?",
  1573. success: (res) => {
  1574. if (res.confirm) {
  1575. uni.showLoading();
  1576. request("/report/confirm", {
  1577. id: item?.id || "",
  1578. path: "reportExport/index.vue",
  1579. }).then((res) => {
  1580. uni.hideLoading();
  1581. if (res.code == 200) {
  1582. uni.showToast({
  1583. title: "已开始导出",
  1584. icon: "none",
  1585. duration: 2000,
  1586. });
  1587. this.resetFetch();
  1588. this.closeCreate();
  1589. } else {
  1590. uni.showToast({
  1591. title: res?.msg || "请求失败",
  1592. icon: "none",
  1593. duration: 2000,
  1594. });
  1595. }
  1596. });
  1597. }
  1598. },
  1599. });
  1600. },
  1601. onSend(item) {
  1602. this.currentItem = item;
  1603. this.emailError = false;
  1604. this.emailModalOpen = true;
  1605. },
  1606. closeEmailModal() {
  1607. this.emailModalOpen = false;
  1608. },
  1609. handleSendEmail() {
  1610. const email = String(this.emailForm.email || "").trim();
  1611. if (!email) {
  1612. this.emailError = true;
  1613. return;
  1614. }
  1615. this.closeEmailModal();
  1616. uni.showLoading({
  1617. title: "发送中...",
  1618. });
  1619. const url = "/report/sendemail";
  1620. request(url, {
  1621. taskId: this.currentItem?.id,
  1622. emailAddress: email + "@999.com.cn",
  1623. path: "reportExport/index.vue",
  1624. }).then((res) => {
  1625. uni.hideLoading();
  1626. if (res.code === 200) {
  1627. uni.showToast({
  1628. title: "发送成功",
  1629. icon: "none",
  1630. duration: 2000,
  1631. });
  1632. } else {
  1633. uni.showToast({
  1634. title: res?.msg || "发送失败",
  1635. icon: "none",
  1636. duration: 2000,
  1637. });
  1638. }
  1639. });
  1640. },
  1641. onScrollToLower() {
  1642. // if (this.isLoading) return;
  1643. // if (this.list.length >= this.totalCount) return;
  1644. // this.isLoading = true;
  1645. // const remain = this.totalCount - this.list.length;
  1646. // const toAdd = Math.min(10, remain);
  1647. // setTimeout(() => {
  1648. // const more = this.genItems(toAdd);
  1649. // this.list = this.list.concat(more);
  1650. // this.animateNew(more);
  1651. // this.isLoading = false;
  1652. // }, 800);
  1653. this.fetchList();
  1654. },
  1655. genItems(n) {
  1656. const res = [];
  1657. const base = this.list.length;
  1658. for (let i = 0; i < n; i++) {
  1659. const idx = base + i + 1;
  1660. const statusIdx = idx % 3;
  1661. const target = [60, 0, 100][statusIdx];
  1662. const sText = ["导出进行中", "导出待开始", "导出已完成"][statusIdx];
  1663. const sClass = ["ing", "wait", "done"][statusIdx];
  1664. const action = ["", "start", "done"][statusIdx];
  1665. res.push({
  1666. title: `第${idx}条公司报表`,
  1667. product: "感冒灵",
  1668. range: "2025-11-27—2025-12-27",
  1669. statusText: sText,
  1670. statusClass: sClass,
  1671. showProgress: statusIdx !== 1,
  1672. progress: 0,
  1673. progressTarget: target,
  1674. action,
  1675. });
  1676. }
  1677. return res;
  1678. },
  1679. // animateAll() {
  1680. // this.list.forEach((it) => this.animateItem(it));
  1681. // },
  1682. // animateNew(arr) {
  1683. // arr.forEach((it) => this.animateItem(it));
  1684. // },
  1685. // animateItem(item) {
  1686. // if (!item.showProgress) return;
  1687. // item.progress = 60;
  1688. // const target = Number(item.progressTarget) || 0;
  1689. // const step = Math.max(1, Math.round(target / 60));
  1690. // const timer = setInterval(() => {
  1691. // item.progress += step;
  1692. // if (item.progress >= target) {
  1693. // item.progress = target;
  1694. // clearInterval(timer);
  1695. // }
  1696. // }, 16);
  1697. // },
  1698. },
  1699. };
  1700. </script>
  1701. <style>
  1702. .report-export-page {
  1703. position: relative;
  1704. box-sizing: border-box;
  1705. /* padding: 170rpx 0 calc(50rpx + env(safe-area-inset-bottom)); */
  1706. padding-top: 290rpx;
  1707. }
  1708. .report-export-search-bar-container {
  1709. position: fixed;
  1710. top: 100rpx;
  1711. left: 0;
  1712. padding: 24rpx 24rpx 16rpx;
  1713. background-color: #f3f6f9;
  1714. z-index: 10;
  1715. box-sizing: border-box;
  1716. width: 100%;
  1717. }
  1718. .report-export-search-bar {
  1719. display: flex;
  1720. align-items: center;
  1721. background: #fff;
  1722. border-radius: 16rpx;
  1723. padding: 16rpx;
  1724. }
  1725. .report-export-search-input-wrap {
  1726. flex: 1;
  1727. position: relative;
  1728. background: #f3f6f9;
  1729. border-radius: 40rpx;
  1730. display: flex;
  1731. align-items: center;
  1732. height: 90rpx;
  1733. padding: 0 12rpx;
  1734. }
  1735. .report-export-search-icon {
  1736. width: 28rpx;
  1737. height: 28rpx;
  1738. margin-left: 16rpx;
  1739. }
  1740. .report-export-search-input {
  1741. flex: 1;
  1742. height: 90rpx;
  1743. padding: 0 16rpx;
  1744. font-size: 28rpx;
  1745. }
  1746. .report-export-search-btn {
  1747. height: 72rpx;
  1748. line-height: 72rpx;
  1749. padding: 0 34rpx;
  1750. border-radius: 36rpx;
  1751. background: #2c69ff;
  1752. color: #fff;
  1753. font-size: 34rpx;
  1754. margin-left: 12rpx;
  1755. }
  1756. .report-export-filter-btn {
  1757. margin-left: 12rpx;
  1758. display: flex;
  1759. flex-direction: column;
  1760. align-items: center;
  1761. justify-content: center;
  1762. }
  1763. .report-export-filter-icon {
  1764. width: 40rpx;
  1765. height: 40rpx;
  1766. }
  1767. .report-export-filter-text {
  1768. margin-top: 8rpx;
  1769. font-size: 24rpx;
  1770. color: #2c69ff;
  1771. }
  1772. .scan-rate-ranges-container {
  1773. position: fixed;
  1774. top: 262rpx;
  1775. left: 0;
  1776. width: 100%;
  1777. height: 120rpx;
  1778. background: #f3f6f9;
  1779. z-index: 6;
  1780. }
  1781. .scan-rate-ranges {
  1782. padding: 0rpx 24rpx 20rpx;
  1783. }
  1784. .scan-rate-ranges-content {
  1785. display: flex;
  1786. background: #fff;
  1787. padding: 20rpx 30rpx;
  1788. border-radius: 16rpx;
  1789. justify-content: space-between;
  1790. }
  1791. .scan-rate-range {
  1792. padding: 12rpx 35rpx;
  1793. border-radius: 5rpx;
  1794. background: rgb(240, 240, 240);
  1795. font-size: 26rpx;
  1796. }
  1797. .scan-rate-range.scan-rate-active {
  1798. background: #2c69ff;
  1799. color: #fff;
  1800. }
  1801. .report-export-list-scroll {
  1802. position: fixed;
  1803. top: 380rpx;
  1804. left: 0;
  1805. box-sizing: border-box;
  1806. width: 100%;
  1807. padding: 0 24rpx;
  1808. padding-bottom: calc(env(safe-area-inset-bottom) + 50rpx);
  1809. box-sizing: border-box;
  1810. }
  1811. .report-export-item-card {
  1812. background: #fff;
  1813. border-radius: 16rpx;
  1814. padding: 24rpx;
  1815. margin-bottom: 16rpx;
  1816. }
  1817. .report-export-item-header {
  1818. width: 100%;
  1819. display: flex;
  1820. align-items: flex-start;
  1821. flex-wrap: wrap;
  1822. }
  1823. .report-export-item-title {
  1824. flex: 1;
  1825. width: 0;
  1826. word-break: break-word;
  1827. margin-right: 20rpx;
  1828. font-size: 38rpx;
  1829. color: #2c69ff;
  1830. display: -webkit-box;
  1831. -webkit-box-orient: vertical;
  1832. -webkit-line-clamp: 2;
  1833. overflow: hidden;
  1834. text-decoration: underline;
  1835. }
  1836. .report-export-status {
  1837. flex-shrink: 0;
  1838. padding: 8rpx 12rpx;
  1839. border-radius: 10rpx;
  1840. font-size: 22rpx;
  1841. color: #fff;
  1842. }
  1843. .report-export-status.report-export-status-2 {
  1844. background: #67c23a;
  1845. }
  1846. .report-export-status.report-export-status-1 {
  1847. background: #888;
  1848. }
  1849. .report-export-status.report-export-status-3,
  1850. .report-export-status.report-export-status-4 {
  1851. background: #2c69ff;
  1852. }
  1853. .report-export-item-row {
  1854. margin-top: 12rpx;
  1855. font-size: 28rpx;
  1856. color: #999;
  1857. }
  1858. .report-export-progress-wrap {
  1859. margin-top: 20rpx;
  1860. }
  1861. .report-export-progress {
  1862. margin-top: 8rpx;
  1863. height: 32rpx;
  1864. background: #e6ebf5;
  1865. border-radius: 999rpx;
  1866. overflow: hidden;
  1867. position: relative;
  1868. }
  1869. .report-export-progress-fill {
  1870. position: absolute;
  1871. left: 0;
  1872. top: 0;
  1873. height: 100%;
  1874. background: #2c69ff;
  1875. border-radius: 999rpx;
  1876. width: 0;
  1877. transition: width 0.2s linear;
  1878. }
  1879. .report-export-progress-text {
  1880. position: absolute;
  1881. left: 50%;
  1882. top: 50%;
  1883. transform: translate(-50%, -50%);
  1884. font-size: 26rpx;
  1885. color: #fff;
  1886. z-index: 2;
  1887. }
  1888. .report-export-action-row {
  1889. margin-top: 16rpx;
  1890. display: flex;
  1891. align-items: center;
  1892. justify-content: flex-end;
  1893. }
  1894. .report-export-action-btn {
  1895. height: 50rpx;
  1896. line-height: 50rpx;
  1897. padding: 0 28rpx;
  1898. border-radius: 12rpx;
  1899. font-size: 30rpx;
  1900. margin: 0;
  1901. }
  1902. .report-export-action-btn + .report-export-action-btn {
  1903. margin-left: 12rpx;
  1904. }
  1905. .report-export-action-btn.report-export-primary {
  1906. background: #2c69ff;
  1907. color: #fff;
  1908. }
  1909. .report-export-action-btn.report-export-info {
  1910. background: #67c23a;
  1911. color: #fff;
  1912. }
  1913. .report-export-loading-row {
  1914. justify-content: center;
  1915. }
  1916. .report-export-loading-wrapper {
  1917. width: 100%;
  1918. height: 76rpx;
  1919. display: flex;
  1920. align-items: center;
  1921. justify-content: center;
  1922. }
  1923. .report-export-loading-icon {
  1924. width: 40rpx;
  1925. height: 40rpx;
  1926. animation: spin 1s linear infinite;
  1927. }
  1928. @keyframes spin {
  1929. from {
  1930. transform: rotate(0deg);
  1931. }
  1932. to {
  1933. transform: rotate(360deg);
  1934. }
  1935. }
  1936. .report-export-footer {
  1937. position: fixed;
  1938. left: 0;
  1939. right: 0;
  1940. bottom: 0;
  1941. padding: 12rpx 30rpx calc(50rpx + env(safe-area-inset-bottom));
  1942. background: #fff;
  1943. }
  1944. .report-export-footer-btn {
  1945. height: 86rpx;
  1946. border-radius: 999rpx;
  1947. background: #2c69ff;
  1948. color: #fff;
  1949. display: flex;
  1950. align-items: center;
  1951. justify-content: center;
  1952. font-size: 30rpx;
  1953. box-shadow: 0 8rpx 24rpx rgba(44, 105, 255, 0.35);
  1954. }
  1955. .report-export-create-modal-mask {
  1956. position: fixed;
  1957. left: 0;
  1958. right: 0;
  1959. top: 0;
  1960. bottom: 0;
  1961. background: rgba(0, 0, 0, 0.35);
  1962. z-index: 90;
  1963. }
  1964. .report-export-create-modal {
  1965. position: fixed;
  1966. left: 0;
  1967. right: 0;
  1968. bottom: -100%;
  1969. width: 100%;
  1970. background: #fff;
  1971. border-top-left-radius: 45rpx;
  1972. border-top-right-radius: 45rpx;
  1973. z-index: 92;
  1974. box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.12);
  1975. /* transform: translateY(100%); */
  1976. transition: bottom 0.25s ease-out;
  1977. }
  1978. .report-export-create-modal--open {
  1979. /* transform: translateY(0) !important; */
  1980. bottom: 0 !important;
  1981. }
  1982. .report-export-create-modal-title {
  1983. position: relative;
  1984. padding: 28rpx 28rpx 12rpx;
  1985. font-size: 34rpx;
  1986. color: #333;
  1987. text-align: center;
  1988. line-height: 60rpx;
  1989. font-weight: 500;
  1990. }
  1991. .report-export-create-modal-close {
  1992. position: absolute;
  1993. right: 32rpx;
  1994. top: 50%;
  1995. transform: translateY(-50%);
  1996. padding: 10rpx;
  1997. color: #909399;
  1998. font-size: 55rpx;
  1999. line-height: 1;
  2000. }
  2001. .report-export-create-modal-body {
  2002. padding: 0 32rpx 100rpx;
  2003. }
  2004. .report-export-create-modal-row {
  2005. display: flex;
  2006. flex-direction: column;
  2007. margin-top: 32rpx;
  2008. position: relative;
  2009. }
  2010. .report-export-create-modal-label {
  2011. width: auto;
  2012. font-size: 28rpx;
  2013. color: #333;
  2014. margin-bottom: 16rpx;
  2015. font-weight: 500;
  2016. }
  2017. .report-export-create-modal-inputwrap {
  2018. flex: 1;
  2019. position: relative;
  2020. border: 1rpx solid #dcdfe6;
  2021. border-radius: 12rpx;
  2022. display: flex;
  2023. align-items: center;
  2024. min-height: 80rpx;
  2025. padding: 0 24rpx;
  2026. background-color: #fff;
  2027. }
  2028. .report-export-create-modal-static {
  2029. position: relative;
  2030. flex: 1;
  2031. max-height: 115rpx;
  2032. font-size: 28rpx;
  2033. color: #606266;
  2034. line-height: 40rpx;
  2035. padding: 20rpx 0;
  2036. overflow-y: auto;
  2037. padding-right: 20rpx;
  2038. }
  2039. .report-export-input-simulator {
  2040. display: flex;
  2041. justify-content: center;
  2042. align-items: center;
  2043. }
  2044. .report-export-create-modal-input {
  2045. flex: 1;
  2046. height: 80rpx;
  2047. font-size: 28rpx;
  2048. color: #606266;
  2049. }
  2050. .report-export-dropdown-other-customer-input {
  2051. color: #666;
  2052. }
  2053. /* .report-export-create-modal-select-arrow {
  2054. width: 18rpx;
  2055. height: 18rpx;
  2056. border: 5rpx solid #999;
  2057. border-top: none;
  2058. border-left: none;
  2059. transform: rotate(45deg);
  2060. margin: 0 8rpx 10rpx 12rpx;
  2061. }
  2062. .report-export-create-modal-select-arrow.disabled {
  2063. opacity: 0.4;
  2064. pointer-events: none;
  2065. } */
  2066. .report-export-create-modal-dropdown {
  2067. position: absolute;
  2068. left: 0;
  2069. right: 0;
  2070. background: #fff;
  2071. border: 1rpx solid #eef0f4;
  2072. border-radius: 12rpx;
  2073. box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08);
  2074. z-index: 6;
  2075. max-height: 510rpx;
  2076. overflow-y: auto;
  2077. -webkit-overflow-scrolling: touch;
  2078. }
  2079. .report-export-create-modal-dropdown-list {
  2080. max-height: 350rpx;
  2081. }
  2082. .report-export-dropdown-search-row {
  2083. padding: 10rpx;
  2084. }
  2085. .report-export-dropdown-search-input {
  2086. width: 100%;
  2087. height: 60rpx;
  2088. border: 1rpx solid #eaeef4;
  2089. border-radius: 8rpx;
  2090. box-sizing: border-box;
  2091. padding: 0 16rpx;
  2092. font-size: 28rpx;
  2093. }
  2094. .report-export-create-modal-dropdown-item {
  2095. padding: 16rpx 20rpx;
  2096. font-size: 28rpx;
  2097. color: #333;
  2098. }
  2099. .report-export-selected {
  2100. background: #f0f5ff;
  2101. }
  2102. .report-export-input-arrow {
  2103. width: 16rpx;
  2104. height: 16rpx;
  2105. border-right: 3rpx solid #c0c4cc;
  2106. border-bottom: 3rpx solid #c0c4cc;
  2107. transform: rotate(45deg);
  2108. margin-top: -6rpx;
  2109. }
  2110. .customer-chip {
  2111. display: inline-block;
  2112. position: relative;
  2113. line-height: 50rpx;
  2114. border: 1rpx solid #eaeef4;
  2115. border-radius: 8rpx;
  2116. padding: 0rpx 44rpx 0rpx 16rpx;
  2117. margin-right: 8rpx;
  2118. margin-bottom: 8rpx;
  2119. font-size: 22rpx;
  2120. color: #333;
  2121. }
  2122. .customer-chip-close {
  2123. position: absolute;
  2124. right: 6rpx;
  2125. top: 0;
  2126. color: #666;
  2127. font-size: 28rpx;
  2128. padding: 0 8rpx;
  2129. border-radius: 6rpx;
  2130. }
  2131. .customer-clear-all {
  2132. position: absolute;
  2133. right: 6rpx;
  2134. top: 50%;
  2135. transform: translateY(-50%);
  2136. line-height: 50rpx;
  2137. padding: 8rpx 10rpx;
  2138. font-size: 40rpx;
  2139. }
  2140. .report-export-create-modal-estimated {
  2141. font-size: 28rpx;
  2142. color: #666;
  2143. }
  2144. .report-export-create-modal-footer {
  2145. padding: 18rpx 28rpx calc(50rpx + env(safe-area-inset-bottom));
  2146. }
  2147. .report-export-create-modal-btn {
  2148. line-height: 90rpx;
  2149. border-radius: 20rpx;
  2150. background: #2c69ff;
  2151. color: #fff;
  2152. text-align: center;
  2153. font-size: 30rpx;
  2154. }
  2155. .report-export-create-email-modal {
  2156. /* transform: translateY(200%); */
  2157. height: 420rpx;
  2158. top: 30%;
  2159. bottom: auto;
  2160. border-radius: 16rpx;
  2161. width: 600rpx;
  2162. left: 75rpx;
  2163. }
  2164. .report-export-email-input-wrap {
  2165. display: flex;
  2166. align-items: center;
  2167. background: #f5f7fa;
  2168. border-radius: 8rpx;
  2169. padding: 0 20rpx;
  2170. height: 80rpx;
  2171. border: 1rpx solid transparent;
  2172. }
  2173. .report-export-input-error {
  2174. border-color: #ff4d4f;
  2175. }
  2176. .report-export-email-input {
  2177. flex: 1;
  2178. font-size: 28rpx;
  2179. color: #333;
  2180. height: 100%;
  2181. }
  2182. .report-export-email-suffix {
  2183. font-size: 28rpx;
  2184. color: #333;
  2185. margin-left: 10rpx;
  2186. }
  2187. .report-export-error-text {
  2188. font-size: 24rpx;
  2189. color: #ff4d4f;
  2190. margin-top: 10rpx;
  2191. display: block;
  2192. }
  2193. .report-export-input-disabled {
  2194. background-color: #f5f7fa;
  2195. cursor: not-allowed;
  2196. opacity: 0.7;
  2197. }
  2198. </style>