index.vue 67 KB

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