index.vue 68 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131
  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. emailAddress: "hezhijie@dotouch.tech",
  1465. path: "reportExport/index.vue",
  1466. }).then((res) => {
  1467. uni.hideLoading();
  1468. if (res.code === 200) {
  1469. uni.showToast({
  1470. title: "发送成功",
  1471. icon: "none",
  1472. duration: 2000,
  1473. });
  1474. } else {
  1475. uni.showToast({
  1476. title: res?.msg || "发送失败",
  1477. icon: "none",
  1478. duration: 2000,
  1479. });
  1480. }
  1481. });
  1482. },
  1483. onScrollToLower() {
  1484. // if (this.isLoading) return;
  1485. // if (this.list.length >= this.totalCount) return;
  1486. // this.isLoading = true;
  1487. // const remain = this.totalCount - this.list.length;
  1488. // const toAdd = Math.min(10, remain);
  1489. // setTimeout(() => {
  1490. // const more = this.genItems(toAdd);
  1491. // this.list = this.list.concat(more);
  1492. // this.animateNew(more);
  1493. // this.isLoading = false;
  1494. // }, 800);
  1495. this.fetchList();
  1496. },
  1497. genItems(n) {
  1498. const res = [];
  1499. const base = this.list.length;
  1500. for (let i = 0; i < n; i++) {
  1501. const idx = base + i + 1;
  1502. const statusIdx = idx % 3;
  1503. const target = [60, 0, 100][statusIdx];
  1504. const sText = ["导出进行中", "导出待开始", "导出已完成"][statusIdx];
  1505. const sClass = ["ing", "wait", "done"][statusIdx];
  1506. const action = ["", "start", "done"][statusIdx];
  1507. res.push({
  1508. title: `第${idx}条公司报表`,
  1509. product: "感冒灵",
  1510. range: "2025-11-27—2025-12-27",
  1511. statusText: sText,
  1512. statusClass: sClass,
  1513. showProgress: statusIdx !== 1,
  1514. progress: 0,
  1515. progressTarget: target,
  1516. action,
  1517. });
  1518. }
  1519. return res;
  1520. },
  1521. // animateAll() {
  1522. // this.list.forEach((it) => this.animateItem(it));
  1523. // },
  1524. // animateNew(arr) {
  1525. // arr.forEach((it) => this.animateItem(it));
  1526. // },
  1527. // animateItem(item) {
  1528. // if (!item.showProgress) return;
  1529. // item.progress = 60;
  1530. // const target = Number(item.progressTarget) || 0;
  1531. // const step = Math.max(1, Math.round(target / 60));
  1532. // const timer = setInterval(() => {
  1533. // item.progress += step;
  1534. // if (item.progress >= target) {
  1535. // item.progress = target;
  1536. // clearInterval(timer);
  1537. // }
  1538. // }, 16);
  1539. // },
  1540. },
  1541. };
  1542. </script>
  1543. <style>
  1544. .report-export-page {
  1545. position: relative;
  1546. box-sizing: border-box;
  1547. /* padding: 170rpx 0 calc(50rpx + env(safe-area-inset-bottom)); */
  1548. padding-top: 290rpx;
  1549. }
  1550. .report-export-search-bar-container {
  1551. position: fixed;
  1552. top: 100rpx;
  1553. left: 0;
  1554. padding: 24rpx 24rpx 16rpx;
  1555. background-color: #f3f6f9;
  1556. z-index: 10;
  1557. box-sizing: border-box;
  1558. width: 100%;
  1559. }
  1560. .report-export-search-bar {
  1561. display: flex;
  1562. align-items: center;
  1563. background: #fff;
  1564. border-radius: 16rpx;
  1565. padding: 16rpx;
  1566. }
  1567. .report-export-search-input-wrap {
  1568. flex: 1;
  1569. position: relative;
  1570. background: #f3f6f9;
  1571. border-radius: 40rpx;
  1572. display: flex;
  1573. align-items: center;
  1574. height: 90rpx;
  1575. padding: 0 12rpx;
  1576. }
  1577. .report-export-search-icon {
  1578. width: 28rpx;
  1579. height: 28rpx;
  1580. margin-left: 16rpx;
  1581. }
  1582. .report-export-search-input {
  1583. flex: 1;
  1584. height: 90rpx;
  1585. padding: 0 16rpx;
  1586. font-size: 28rpx;
  1587. }
  1588. .report-export-search-btn {
  1589. height: 72rpx;
  1590. line-height: 72rpx;
  1591. padding: 0 34rpx;
  1592. border-radius: 36rpx;
  1593. background: #2c69ff;
  1594. color: #fff;
  1595. font-size: 34rpx;
  1596. margin-left: 12rpx;
  1597. }
  1598. .report-export-filter-btn {
  1599. margin-left: 12rpx;
  1600. display: flex;
  1601. flex-direction: column;
  1602. align-items: center;
  1603. justify-content: center;
  1604. }
  1605. .report-export-filter-icon {
  1606. width: 40rpx;
  1607. height: 40rpx;
  1608. }
  1609. .report-export-filter-text {
  1610. margin-top: 8rpx;
  1611. font-size: 24rpx;
  1612. color: #2c69ff;
  1613. }
  1614. .scan-rate-ranges-container {
  1615. position: fixed;
  1616. top: 262rpx;
  1617. left: 0;
  1618. width: 100%;
  1619. height: 120rpx;
  1620. background: #f3f6f9;
  1621. z-index: 6;
  1622. }
  1623. .scan-rate-ranges {
  1624. padding: 0rpx 24rpx 20rpx;
  1625. }
  1626. .scan-rate-ranges-content {
  1627. display: flex;
  1628. background: #fff;
  1629. padding: 20rpx 30rpx;
  1630. border-radius: 16rpx;
  1631. justify-content: space-between;
  1632. }
  1633. .scan-rate-range {
  1634. padding: 12rpx 35rpx;
  1635. border-radius: 5rpx;
  1636. background: rgb(240, 240, 240);
  1637. font-size: 26rpx;
  1638. }
  1639. .scan-rate-range.scan-rate-active {
  1640. background: #2c69ff;
  1641. color: #fff;
  1642. }
  1643. .report-export-list-scroll {
  1644. position: fixed;
  1645. top: 380rpx;
  1646. left: 0;
  1647. box-sizing: border-box;
  1648. width: 100%;
  1649. padding: 0 24rpx;
  1650. padding-bottom: calc(env(safe-area-inset-bottom) + 50rpx);
  1651. box-sizing: border-box;
  1652. }
  1653. .report-export-item-card {
  1654. background: #fff;
  1655. border-radius: 16rpx;
  1656. padding: 24rpx;
  1657. margin-bottom: 16rpx;
  1658. }
  1659. .report-export-item-header {
  1660. width: 100%;
  1661. display: flex;
  1662. align-items: flex-start;
  1663. flex-wrap: wrap;
  1664. }
  1665. .report-export-item-title {
  1666. flex: 1;
  1667. width: 0;
  1668. word-break: break-word;
  1669. margin-right: 20rpx;
  1670. font-size: 38rpx;
  1671. color: #2c69ff;
  1672. display: -webkit-box;
  1673. -webkit-box-orient: vertical;
  1674. -webkit-line-clamp: 2;
  1675. overflow: hidden;
  1676. text-decoration: underline;
  1677. }
  1678. .report-export-status {
  1679. flex-shrink: 0;
  1680. padding: 2rpx 10rpx;
  1681. border-radius: 6rpx;
  1682. font-size: 22rpx;
  1683. border: 1rpx solid transparent;
  1684. }
  1685. .report-export-status.report-export-status-2 {
  1686. background: rgba(103, 194, 58, 0.1);
  1687. border-color: rgba(103, 194, 58, 0.2);
  1688. color: #67c23a;
  1689. }
  1690. .report-export-status.report-export-status-1 {
  1691. background: rgba(136, 136, 136, 0.1);
  1692. border-color: rgba(136, 136, 136, 0.2);
  1693. color: #888;
  1694. }
  1695. .report-export-status.report-export-status-3,
  1696. .report-export-status.report-export-status-4 {
  1697. background: rgba(44, 105, 255, 0.1);
  1698. border-color: rgba(44, 105, 255, 0.2);
  1699. color: #2c69ff;
  1700. }
  1701. .report-export-item-row {
  1702. margin-top: 12rpx;
  1703. font-size: 28rpx;
  1704. color: #999;
  1705. }
  1706. .report-export-progress-wrap {
  1707. margin-top: 20rpx;
  1708. }
  1709. .report-export-progress {
  1710. margin-top: 8rpx;
  1711. height: 32rpx;
  1712. background: #e6ebf5;
  1713. border-radius: 999rpx;
  1714. overflow: hidden;
  1715. position: relative;
  1716. }
  1717. .report-export-progress-fill {
  1718. position: absolute;
  1719. left: 0;
  1720. top: 0;
  1721. height: 100%;
  1722. background: #2c69ff;
  1723. border-radius: 999rpx;
  1724. width: 0;
  1725. transition: width 0.2s linear;
  1726. }
  1727. .report-export-progress-text {
  1728. position: absolute;
  1729. left: 50%;
  1730. top: 50%;
  1731. transform: translate(-50%, -50%);
  1732. font-size: 26rpx;
  1733. color: #fff;
  1734. z-index: 2;
  1735. }
  1736. .report-export-action-row {
  1737. margin-top: 16rpx;
  1738. display: flex;
  1739. align-items: center;
  1740. justify-content: flex-end;
  1741. }
  1742. .report-export-action-btn {
  1743. height: 50rpx;
  1744. line-height: 50rpx;
  1745. padding: 0 28rpx;
  1746. border-radius: 12rpx;
  1747. font-size: 30rpx;
  1748. margin: 0;
  1749. }
  1750. .report-export-action-btn+.report-export-action-btn {
  1751. margin-left: 12rpx;
  1752. }
  1753. .report-export-action-btn.report-export-primary {
  1754. background: #2c69ff;
  1755. color: #fff;
  1756. }
  1757. .report-export-action-btn.report-export-info {
  1758. background: #67c23a;
  1759. color: #fff;
  1760. }
  1761. .report-export-loading-row {
  1762. justify-content: center;
  1763. }
  1764. .report-export-loading-wrapper {
  1765. width: 100%;
  1766. height: 76rpx;
  1767. display: flex;
  1768. align-items: center;
  1769. justify-content: center;
  1770. }
  1771. .report-export-loading-icon {
  1772. width: 40rpx;
  1773. height: 40rpx;
  1774. animation: spin 1s linear infinite;
  1775. }
  1776. @keyframes spin {
  1777. from {
  1778. transform: rotate(0deg);
  1779. }
  1780. to {
  1781. transform: rotate(360deg);
  1782. }
  1783. }
  1784. .report-export-footer {
  1785. position: fixed;
  1786. left: 0;
  1787. right: 0;
  1788. bottom: 0;
  1789. padding: 12rpx 30rpx calc(50rpx + env(safe-area-inset-bottom));
  1790. background: #fff;
  1791. }
  1792. .report-export-footer-btn {
  1793. height: 86rpx;
  1794. border-radius: 999rpx;
  1795. background: #2c69ff;
  1796. color: #fff;
  1797. display: flex;
  1798. align-items: center;
  1799. justify-content: center;
  1800. font-size: 30rpx;
  1801. box-shadow: 0 8rpx 24rpx rgba(44, 105, 255, 0.35);
  1802. }
  1803. .report-export-create-modal-mask {
  1804. position: fixed;
  1805. left: 0;
  1806. right: 0;
  1807. top: 0;
  1808. bottom: 0;
  1809. background: rgba(0, 0, 0, 0.35);
  1810. z-index: 90;
  1811. }
  1812. .report-export-create-modal {
  1813. position: fixed;
  1814. left: 0;
  1815. right: 0;
  1816. bottom: -100%;
  1817. width: 100%;
  1818. background: #fff;
  1819. border-top-left-radius: 45rpx;
  1820. border-top-right-radius: 45rpx;
  1821. z-index: 92;
  1822. box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.12);
  1823. /* transform: translateY(100%); */
  1824. transition: bottom 0.25s ease-out;
  1825. }
  1826. .report-export-create-modal--open {
  1827. /* transform: translateY(0) !important; */
  1828. bottom: 0 !important;
  1829. }
  1830. .report-export-create-modal-title {
  1831. position: relative;
  1832. padding: 28rpx 28rpx 12rpx;
  1833. font-size: 34rpx;
  1834. color: #333;
  1835. text-align: center;
  1836. line-height: 60rpx;
  1837. font-weight: 500;
  1838. }
  1839. .report-export-create-modal-close {
  1840. position: absolute;
  1841. right: 32rpx;
  1842. top: 50%;
  1843. transform: translateY(-50%);
  1844. padding: 10rpx;
  1845. color: #909399;
  1846. font-size: 55rpx;
  1847. line-height: 1;
  1848. }
  1849. .report-export-create-modal-body {
  1850. padding: 0 32rpx 100rpx;
  1851. }
  1852. .report-export-create-modal-row {
  1853. display: flex;
  1854. flex-direction: column;
  1855. margin-top: 32rpx;
  1856. position: relative;
  1857. }
  1858. .report-export-create-modal-label {
  1859. width: auto;
  1860. font-size: 28rpx;
  1861. color: #333;
  1862. margin-bottom: 16rpx;
  1863. font-weight: 500;
  1864. }
  1865. .report-export-create-modal-inputwrap {
  1866. flex: 1;
  1867. position: relative;
  1868. border: 1rpx solid #dcdfe6;
  1869. border-radius: 12rpx;
  1870. display: flex;
  1871. align-items: center;
  1872. min-height: 80rpx;
  1873. padding: 0 24rpx;
  1874. background-color: #fff;
  1875. }
  1876. .report-export-create-modal-static {
  1877. position: relative;
  1878. flex: 1;
  1879. max-height: 115rpx;
  1880. font-size: 28rpx;
  1881. color: #606266;
  1882. line-height: 40rpx;
  1883. padding: 20rpx 0;
  1884. overflow-y: auto;
  1885. padding-right: 20rpx;
  1886. }
  1887. .report-export-input-simulator {
  1888. display: flex;
  1889. justify-content: center;
  1890. align-items: center;
  1891. }
  1892. .report-export-create-modal-input {
  1893. flex: 1;
  1894. height: 80rpx;
  1895. font-size: 28rpx;
  1896. color: #606266;
  1897. }
  1898. .report-export-dropdown-other-customer-input {
  1899. color: #666;
  1900. }
  1901. /* .report-export-create-modal-select-arrow {
  1902. width: 18rpx;
  1903. height: 18rpx;
  1904. border: 5rpx solid #999;
  1905. border-top: none;
  1906. border-left: none;
  1907. transform: rotate(45deg);
  1908. margin: 0 8rpx 10rpx 12rpx;
  1909. }
  1910. .report-export-create-modal-select-arrow.disabled {
  1911. opacity: 0.4;
  1912. pointer-events: none;
  1913. } */
  1914. .report-export-create-modal-dropdown {
  1915. position: absolute;
  1916. left: 0;
  1917. right: 0;
  1918. background: #fff;
  1919. border: 1rpx solid #eef0f4;
  1920. border-radius: 12rpx;
  1921. box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08);
  1922. z-index: 6;
  1923. max-height: 510rpx;
  1924. overflow-y: auto;
  1925. -webkit-overflow-scrolling: touch;
  1926. }
  1927. .report-export-create-modal-dropdown-list {
  1928. max-height: 350rpx;
  1929. }
  1930. .report-export-dropdown-search-row {
  1931. padding: 10rpx;
  1932. }
  1933. .report-export-dropdown-search-input {
  1934. width: 100%;
  1935. height: 60rpx;
  1936. border: 1rpx solid #eaeef4;
  1937. border-radius: 8rpx;
  1938. box-sizing: border-box;
  1939. padding: 0 16rpx;
  1940. font-size: 28rpx;
  1941. }
  1942. .report-export-create-modal-dropdown-item {
  1943. padding: 16rpx 20rpx;
  1944. font-size: 28rpx;
  1945. color: #333;
  1946. }
  1947. .report-export-selected {
  1948. background: #f0f5ff;
  1949. }
  1950. .report-export-input-arrow {
  1951. width: 16rpx;
  1952. height: 16rpx;
  1953. border-right: 3rpx solid #c0c4cc;
  1954. border-bottom: 3rpx solid #c0c4cc;
  1955. transform: rotate(45deg);
  1956. margin-top: -6rpx;
  1957. }
  1958. .customer-chip {
  1959. display: inline-block;
  1960. position: relative;
  1961. line-height: 50rpx;
  1962. border: 1rpx solid #eaeef4;
  1963. border-radius: 8rpx;
  1964. padding: 0rpx 44rpx 0rpx 16rpx;
  1965. margin-right: 8rpx;
  1966. margin-bottom: 8rpx;
  1967. font-size: 22rpx;
  1968. color: #333;
  1969. }
  1970. .customer-chip-close {
  1971. position: absolute;
  1972. right: 6rpx;
  1973. top: 0;
  1974. color: #666;
  1975. font-size: 28rpx;
  1976. padding: 0 8rpx;
  1977. border-radius: 6rpx;
  1978. }
  1979. .customer-clear-all {
  1980. position: absolute;
  1981. right: 6rpx;
  1982. top: 50%;
  1983. transform: translateY(-50%);
  1984. line-height: 50rpx;
  1985. padding: 8rpx 10rpx;
  1986. font-size: 40rpx;
  1987. }
  1988. .report-export-create-modal-estimated {
  1989. font-size: 28rpx;
  1990. color: #666;
  1991. }
  1992. .report-export-create-modal-footer {
  1993. padding: 18rpx 28rpx calc(50rpx + env(safe-area-inset-bottom));
  1994. }
  1995. .report-export-create-modal-btn {
  1996. line-height: 90rpx;
  1997. border-radius: 20rpx;
  1998. background: #2c69ff;
  1999. color: #fff;
  2000. text-align: center;
  2001. font-size: 30rpx;
  2002. }
  2003. .report-export-create-email-modal {
  2004. /* transform: translateY(200%); */
  2005. height: 420rpx;
  2006. top: 30%;
  2007. bottom: auto;
  2008. border-radius: 16rpx;
  2009. width: 600rpx;
  2010. left: 75rpx;
  2011. }
  2012. .report-export-email-input-wrap {
  2013. display: flex;
  2014. align-items: center;
  2015. background: #f5f7fa;
  2016. border-radius: 8rpx;
  2017. padding: 0 20rpx;
  2018. height: 80rpx;
  2019. border: 1rpx solid transparent;
  2020. }
  2021. .report-export-input-error {
  2022. border-color: #ff4d4f;
  2023. }
  2024. .report-export-email-input {
  2025. flex: 1;
  2026. font-size: 28rpx;
  2027. color: #333;
  2028. height: 100%;
  2029. }
  2030. .report-export-email-suffix {
  2031. font-size: 28rpx;
  2032. color: #333;
  2033. margin-left: 10rpx;
  2034. }
  2035. .report-export-error-text {
  2036. font-size: 24rpx;
  2037. color: #ff4d4f;
  2038. margin-top: 10rpx;
  2039. display: block;
  2040. }
  2041. .report-export-input-disabled {
  2042. background-color: #f5f7fa;
  2043. cursor: not-allowed;
  2044. opacity: 0.7;
  2045. }
  2046. </style>