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.userName || "" }}</view>
  41. <view class="report-export-item-row">品种:{{ item.physicName || "" }}</view>
  42. <view class="report-export-item-row">规格:{{ item.pkgSpec || "" }}</view>
  43. <view class="report-export-item-row">时间:{{ formatDate(item.beginTime) }}~{{
  44. formatDate(item.endTime)
  45. }}</view>
  46. <!-- <view
  47. class="report-export-item-row"
  48. style="color: red"
  49. v-if="item.remark !== ''"
  50. >任务失败:{{ item.remark || "" }}</view
  51. > -->
  52. <view v-if="item.status == 2" class="report-export-progress-wrap">
  53. <view class="report-export-progress">
  54. <view class="report-export-progress-fill" :style="{ width: `${item.progress || 10}%` }"></view>
  55. <text class="report-export-progress-text">{{
  56. item.progress || 10
  57. }}</text>
  58. </view>
  59. </view>
  60. <view v-if="item.status == 1" class="report-export-action-row">
  61. <view class="report-export-action-btn report-export-primary" @click="onStart(item)">
  62. 确认开始计算
  63. </view>
  64. </view>
  65. <view v-else-if="item.status == 3" class="report-export-action-row">
  66. <view class="report-export-action-btn report-export-info" @click="toDetail(item)">查看</view>
  67. <view class="report-export-action-btn report-export-primary" @click="onSend(item)">
  68. 导出
  69. </view>
  70. </view>
  71. </view>
  72. <view class="report-export-loading-row" v-if="hasmore">
  73. <view class="report-export-loading-wrapper">
  74. <image class="report-export-loading-icon" src="../../../static/images/loading.png" />
  75. </view>
  76. </view>
  77. </scroll-view>
  78. <EmptyView v-else text="暂无导出任务" />
  79. <view class="report-export-footer">
  80. <view class="report-export-footer-btn" @click="onCreate">新建任务</view>
  81. </view>
  82. <view v-show="createModalOpen || filterModalOpen || emailModalOpen" class="report-export-create-modal-mask"
  83. @click="closeCreate">
  84. </view>
  85. <view class="report-export-create-modal" :class="{ 'report-export-create-modal--open': createModalOpen }">
  86. <view class="report-export-create-modal-title" @click="closeDropdownAll">
  87. <text>{{ taskTitle }}</text>
  88. <view class="report-export-create-modal-close" @click.stop="closeCreate">×</view>
  89. </view>
  90. <view class="report-export-create-modal-body" :style="{ paddingBottom: 0 }" @click="closeDropdownAll">
  91. <scroll-view scroll-y="true" :style="{
  92. height: '750rpx',
  93. paddingBottom: '20rpx',
  94. }">
  95. <view class="report-export-create-modal-row">
  96. <text class="report-export-create-modal-label">省份</text>
  97. <view class="report-export-create-modal-inputwrap"
  98. @click.stop="modalType !== 'read' && openDropdown('region')">
  99. <view class="report-export-create-modal-static">{{
  100. form.region && form.region.regionName
  101. ? form.region.regionName
  102. : "请选择省份"
  103. }}</view>
  104. <view class="report-export-input-arrow" v-if="modalType !== 'read'"></view>
  105. <view class="report-export-create-modal-dropdown" v-if="dropdown.region" @click.stop
  106. :style="dropdownPosStyle()">
  107. <view class="report-export-dropdown-search-row">
  108. <input class="report-export-dropdown-search-input" v-model="searchForm.region"
  109. :disabled="modalType === 'read'" @input="modalType !== 'read' && onInput('region')"
  110. @focus="onSearchFocus" @blur="onSearchBlur" />
  111. </view>
  112. <scroll-view class="report-export-create-modal-dropdown-list" scroll-y>
  113. <view class="report-export-create-modal-dropdown-item" v-for="(op, i) in filteredOptions('region')"
  114. :key="'r-' + i" @click.stop="
  115. modalType !== 'read' && pickOption('region', op)
  116. ">{{ op.regionName }}
  117. </view>
  118. <view v-if="
  119. !filteredOptions('region') ||
  120. filteredOptions('region').length === 0
  121. " class="report-export-create-modal-dropdown-item">
  122. 未查找到该省份</view>
  123. </scroll-view>
  124. </view>
  125. </view>
  126. </view>
  127. <view class="report-export-create-modal-row">
  128. <text class="report-export-create-modal-label">客户性质</text>
  129. <view class="report-export-create-modal-inputwrap"
  130. @click.stop="modalType !== 'read' && openDropdown('customerType')">
  131. <view class="report-export-create-modal-static">{{
  132. form.customerType || "请选择客户性质"
  133. }}</view>
  134. <view class="report-export-input-arrow" v-if="modalType !== 'read'"></view>
  135. <view class="report-export-create-modal-dropdown" v-if="dropdown.customerType" @click.stop
  136. :style="dropdownPosStyle()">
  137. <view class="report-export-create-modal-dropdown-item"
  138. v-for="(op, i) in filteredOptions('customerType')" :key="'t-' + i" @click.stop="
  139. modalType !== 'read' && pickOption('customerType', op)
  140. ">{{ op }}</view>
  141. <view v-if="filteredOptions('customerType').length === 0"
  142. class="report-export-create-modal-dropdown-item">未查找到该客户性质</view>
  143. </view>
  144. </view>
  145. </view>
  146. <view class="report-export-create-modal-row">
  147. <text class="report-export-create-modal-label">客户</text>
  148. <view class="report-export-create-modal-inputwrap"
  149. @click.stop="modalType !== 'read' && openDropdown('customer')">
  150. <view class="report-export-create-modal-static" :style="{ maxHeight: 'auto', overflowY: 'visible' }">
  151. <block v-if="Array.isArray(form.customer) && form.customer.length">
  152. <view :style="{
  153. maxHeight: '100rpx',
  154. overflowY: 'auto',
  155. paddingRight: '40rpx',
  156. }">
  157. <text v-for="(op, i) in form.customer" :key="'cust-tag-' + i" class="customer-chip">
  158. {{ op.customerName }}
  159. <text class="customer-chip-close" @click.stop="
  160. modalType !== 'read' &&
  161. removeCustomer(op.customerName)
  162. ">×</text>
  163. </text>
  164. </view>
  165. </block>
  166. <text v-else>请选择客户</text>
  167. <text v-if="
  168. form.customer &&
  169. form.customer.length &&
  170. modalType !== 'read'
  171. " class="customer-clear-all" @click.stop="modalType !== 'read' && clearAllCustomers()">×</text>
  172. </view>
  173. <view class="report-export-input-arrow" v-if="modalType !== 'read'"></view>
  174. <view class="report-export-create-modal-dropdown" v-if="dropdown.customer" @click.stop :style="[
  175. dropdownPosStyle(),
  176. { maxHeight: 'none', overflow: 'visible' },
  177. ]">
  178. <view class="report-export-dropdown-search-row">
  179. <input class="report-export-dropdown-search-input" v-model="customerSearch"
  180. :disabled="modalType === 'read'" @input="modalType !== 'read' && onInput('customer')"
  181. @focus="onSearchFocus" @blur="onSearchBlur" />
  182. </view>
  183. <scroll-view class="report-export-create-modal-dropdown-list" scroll-y lower-threshold="20"
  184. @scrolltolower="getCustomerOptions">
  185. <view class="report-export-create-modal-dropdown-item" :class="{
  186. 'report-export-selected': isCustomerSelected(
  187. op.customerName,
  188. ),
  189. }" v-for="(op, i) in customers" :key="'cust-' + i" @click.stop="
  190. modalType !== 'read' && pickOption('customer', op)
  191. ">{{ op.customerName }}</view>
  192. <view v-if="customers.length === 0 && !customerHasMore"
  193. class="report-export-create-modal-dropdown-item">未查找到该客户</view>
  194. <view v-if="customerHasMore" class="report-export-loading-row">
  195. <view class="report-export-loading-wrapper">
  196. <image class="report-export-loading-icon" src="../../../static/images/loading.png" />
  197. </view>
  198. </view>
  199. </scroll-view>
  200. </view>
  201. </view>
  202. </view>
  203. <view class="report-export-create-modal-row">
  204. <text class="report-export-create-modal-label">其它客户</text>
  205. <view
  206. class="report-export-create-modal-inputwrap"
  207. @click.stop="modalType !== 'read' && openDropdown('otherCustomer')"
  208. >
  209. <view class="report-export-create-modal-static" :style="{ maxHeight: 'auto', overflowY: 'visible' }">
  210. <block v-if="getOtherCustomerArray().length">
  211. <view :style="{
  212. maxHeight: '100rpx',
  213. overflowY: 'auto',
  214. paddingRight: '40rpx',
  215. }">
  216. <text
  217. v-for="(name, i) in getOtherCustomerArray()"
  218. :key="'other-cust-tag-' + i"
  219. class="customer-chip"
  220. >
  221. {{ name }}
  222. <text
  223. class="customer-chip-close"
  224. @click.stop="
  225. modalType !== 'read' &&
  226. removeOtherCustomer(name)
  227. "
  228. >×</text>
  229. </text>
  230. </view>
  231. </block>
  232. <text v-else>请选择其它客户</text>
  233. <text
  234. v-if="
  235. getOtherCustomerArray().length &&
  236. modalType !== 'read'
  237. "
  238. class="customer-clear-all"
  239. @click.stop="modalType !== 'read' && clearAllOtherCustomers()"
  240. >×</text>
  241. </view>
  242. <view class="report-export-input-arrow" v-if="modalType !== 'read'"></view>
  243. <view
  244. class="report-export-create-modal-dropdown"
  245. v-if="dropdown.otherCustomer"
  246. @click.stop
  247. :style="[
  248. dropdownPosStyle(),
  249. { maxHeight: 'none', overflow: 'visible' },
  250. ]"
  251. >
  252. <view class="report-export-dropdown-search-row">
  253. <input
  254. class="report-export-dropdown-search-input"
  255. v-model="otherCustomerSearch"
  256. :disabled="modalType === 'read'"
  257. @input="modalType !== 'read' && onInput('otherCustomer')"
  258. @focus="onSearchFocus"
  259. @blur="onSearchBlur"
  260. placeholder="请输入客户名称"
  261. />
  262. </view>
  263. <scroll-view class="report-export-create-modal-dropdown-list" scroll-y>
  264. <view
  265. class="report-export-create-modal-dropdown-item"
  266. :class="{
  267. 'report-export-selected': isOtherCustomerSelected(op),
  268. }"
  269. v-for="(op, i) in otherCustomers"
  270. :key="'other-cust-' + i"
  271. @click.stop="
  272. modalType !== 'read' && pickOption('otherCustomer', op)
  273. "
  274. >{{ op }}</view>
  275. <view
  276. v-if="!otherCustomerSearch.trim()"
  277. class="report-export-create-modal-dropdown-item"
  278. >请输入客户名称以搜索客户</view>
  279. <view
  280. v-else-if="otherCustomers.length === 0 && !otherCustomerLoading"
  281. class="report-export-create-modal-dropdown-item"
  282. >未查找到该客户</view>
  283. <view v-if="otherCustomerLoading" class="report-export-loading-row">
  284. <view class="report-export-loading-wrapper">
  285. <image class="report-export-loading-icon" src="../../../static/images/loading.png" />
  286. </view>
  287. </view>
  288. </scroll-view>
  289. </view>
  290. </view>
  291. </view>
  292. <view class="report-export-create-modal-row">
  293. <text class="report-export-create-modal-label">其它客户信用代码</text>
  294. <view class="report-export-create-modal-inputwrap">
  295. <input class="report-export-dropdown-search-input" v-model="form.otherCustomerCode"
  296. placeholder="请填写信用代码(依照其他客户填写顺序用半角逗号隔开)" placeholder-class="report-export-dropdown-other-customer-input"
  297. :disabled="modalType === 'read'" :style="{ color: '#666', padding: 0, border: 'none' }" />
  298. </view>
  299. </view>
  300. <view class="report-export-create-modal-row">
  301. <text class="report-export-create-modal-label">品种</text>
  302. <view class="report-export-create-modal-inputwrap"
  303. @click.stop="modalType !== 'read' && openDropdown('product')">
  304. <view class="report-export-create-modal-static">{{
  305. form.product?.physicName || "请选择品种"
  306. }}</view>
  307. <view class="report-export-input-arrow" v-if="modalType !== 'read'"></view>
  308. <view class="report-export-create-modal-dropdown" :style="[{ top: 'auto', bottom: '84rpx' }]"
  309. v-if="dropdown.product" @click.stop>
  310. <view class="report-export-dropdown-search-row">
  311. <input class="report-export-dropdown-search-input" v-model="searchForm.product"
  312. :disabled="modalType === 'read'" @input="modalType !== 'read' && onInput('product')"
  313. @focus="onSearchFocus" @blur="onSearchBlur" />
  314. </view>
  315. <scroll-view class="report-export-create-modal-dropdown-list" scroll-y
  316. @scrolltolower="loadMoreProducts('create')">
  317. <view class="report-export-create-modal-dropdown-item" v-for="(op, i) in displayProducts"
  318. :key="'p-' + i" @click.stop="
  319. modalType !== 'read' && pickOption('product', op)
  320. ">{{ op.physicName }}
  321. </view>
  322. <view v-if="displayProducts?.length === 0" class="report-export-create-modal-dropdown-item">
  323. 未查找到该品种</view>
  324. </scroll-view>
  325. </view>
  326. </view>
  327. </view>
  328. <view class="report-export-create-modal-row">
  329. <text class="report-export-create-modal-label">规格</text>
  330. <view class="report-export-create-modal-inputwrap" :class="{
  331. 'report-export-input-disabled':
  332. !form.product?.drugEntBaseInfoId,
  333. }" @click.stop="
  334. modalType !== 'read' &&
  335. form.product?.drugEntBaseInfoId &&
  336. openDropdown('pkgSpec')
  337. ">
  338. <view class="report-export-create-modal-static">{{
  339. form.pkgSpec || "请选择规格(请先选择品种)"
  340. }}</view>
  341. <view class="report-export-input-arrow" v-if="modalType !== 'read'"></view>
  342. <view class="report-export-create-modal-dropdown" v-if="dropdown.pkgSpec" @click.stop
  343. :style="[{ top: 'auto', bottom: '84rpx' }]">
  344. <view class="report-export-create-modal-dropdown-item" v-for="(op, i) in filteredOptions('pkgSpec')"
  345. :key="'t-' + i" @click.stop="
  346. modalType !== 'read' && pickOption('pkgSpec', op)
  347. ">{{ op }}</view>
  348. <view v-if="filteredOptions('pkgSpec')?.length === 0" class="report-export-create-modal-dropdown-item">
  349. 未查找到该品种规格</view>
  350. </view>
  351. </view>
  352. </view>
  353. <view class="report-export-create-modal-row">
  354. <text class="report-export-create-modal-label">时间</text>
  355. <view class="report-export-create-modal-inputwrap" @click="openDatePicker">
  356. <view class="report-export-create-modal-static report-export-input-simulator" :style="{
  357. color: dateRange && dateRange.length ? '#333' : '#606266',
  358. }">
  359. <uni-icons type="calendar" size="22" color="#c0c4cc"></uni-icons>
  360. <view style="flex: 1; text-align: center">{{
  361. dateRange && dateRange.length ? dateRange[0] : "开始时间"
  362. }}
  363. </view>
  364. <view>-</view>
  365. <view style="flex: 1; text-align: center">{{
  366. dateRange && dateRange.length ? dateRange[1] : "结束时间"
  367. }}
  368. </view>
  369. </view>
  370. <view class="report-export-input-simulator-clear" v-if="dateRange && dateRange.length"
  371. @click.stop="dateRange = []">
  372. <uni-icons type="clear" size="22" color="#c0c4cc"></uni-icons>
  373. </view>
  374. </view>
  375. </view>
  376. </scroll-view>
  377. <!-- Hidden Picker for API access -->
  378. <view style="position: absolute; left: -10000px; top: 0">
  379. <uni-datetime-picker ref="datePicker" type="daterange" v-model="dateRange" @change="onDateChange" />
  380. </view>
  381. </view>
  382. <view class="report-export-create-modal-footer" @click="closeDropdownAll">
  383. <view class="report-export-create-modal-btn" @click.stop="confirmCreate" v-if="modalType !== 'read'">{{
  384. modalType === "create" ? "新建任务" : "修改任务" }}</view>
  385. <view :style="{ display: 'flex', 'justify-content': 'space-between' }" v-else>
  386. <view class="report-export-create-modal-btn" :style="currentItem.status !== '2'
  387. ? { flex: '0 0 40%' }
  388. : { flex: '0 0 100%' }
  389. " @click.stop="closeCreate">关闭</view>
  390. <view class="report-export-create-modal-btn" :style="{ background: 'red', flex: '0 0 40%' }"
  391. @click.stop="confirmDelete" v-if="currentItem.status !== '2'">删除</view>
  392. </view>
  393. </view>
  394. </view>
  395. <view class="report-export-create-modal" :class="{ 'report-export-create-modal--open': filterModalOpen }">
  396. <view class="report-export-create-modal-title" @click="closeDropdownAll">筛选条件</view>
  397. <view class="report-export-create-modal-body" @click="closeDropdownAll">
  398. <view class="report-export-create-modal-row">
  399. <text class="report-export-create-modal-label">品种:</text>
  400. <view class="report-export-create-modal-inputwrap" @click.stop="openFilterDropdown('product')">
  401. <view class="report-export-create-modal-static">{{
  402. filterForm.product?.physicName || "请选择品种"
  403. }}</view>
  404. <view class="report-export-create-modal-dropdown" :style="[{ top: 'auto', bottom: '84rpx' }]"
  405. v-if="filterDropdown.product" @click.stop>
  406. <view class="report-export-dropdown-search-row">
  407. <input class="report-export-dropdown-search-input" v-model="filterSearchForm.product"
  408. @input="onFilterInput('product')" @focus="onSearchFocus" @blur="onSearchBlur" />
  409. </view>
  410. <scroll-view class="report-export-create-modal-dropdown-list" scroll-y
  411. @scrolltolower="loadMoreProducts('filter')">
  412. <view class="report-export-create-modal-dropdown-item" v-for="(op, i) in filterDisplayProducts"
  413. :key="'prd-' + i" @click.stop="pickFilterOption('product', op)">{{ op.physicName }}</view>
  414. <view v-if="filterDisplayProducts?.length === 0" class="report-export-create-modal-dropdown-item">
  415. 未查找到该品种
  416. </view>
  417. </scroll-view>
  418. </view>
  419. </view>
  420. </view>
  421. <!-- <view class="report-export-create-modal-row">
  422. <text class="report-export-create-modal-label">规格</text>
  423. <view class="report-export-create-modal-inputwrap"
  424. :class="{ 'report-export-input-disabled': !filterForm.product?.drugEntBaseInfoId }"
  425. @click.stop="filterForm.product?.drugEntBaseInfoId && openFilterDropdown('pkgSpec')">
  426. <view class="report-export-create-modal-static">{{
  427. filterForm.pkgSpec || "请选择品种规格(请先选择品种)"
  428. }}</view>
  429. <view class="report-export-input-arrow"></view>
  430. <view class="report-export-create-modal-dropdown" v-if="filterDropdown.pkgSpec" @click.stop
  431. :style="[{ top: 'auto', bottom: '84rpx' }]">
  432. <view class="report-export-create-modal-dropdown-item" v-for="(op, i) in filteredOptions('pkgSpec')"
  433. :key="'t-' + i" @click.stop="
  434. pickFilterOption('pkgSpec', op)
  435. ">{{ op }}</view>
  436. <view v-if="filteredOptions('pkgSpec')?.length === 0" class="report-export-create-modal-dropdown-item">
  437. 未查找到该品种规格</view>
  438. </view>
  439. </view>
  440. </view> -->
  441. <view class="report-export-create-modal-row">
  442. <text class="report-export-create-modal-label">时间:</text>
  443. <view class="report-export-create-modal-inputwrap" v-if="filterModalOpen">
  444. <uni-datetime-picker type="daterange" :border="false" v-model="filterDateRange"
  445. @change="onFilterDateChange" />
  446. </view>
  447. </view>
  448. </view>
  449. <view class="report-export-create-modal-footer" @click="closeDropdownAll"
  450. :style="{ display: 'flex', justifyContent: 'space-between' }">
  451. <view class="report-export-create-modal-btn" :style="{
  452. background: '#fff',
  453. color: '#666',
  454. border: '1rpx solid #dcdfe6',
  455. flex: '0 0 45%',
  456. }" @click.stop="resetFilter">重置</view>
  457. <view class="report-export-create-modal-btn" :style="{ flex: '0 0 45%' }" @click.stop="confirmFilter">确认</view>
  458. </view>
  459. </view>
  460. <view class="report-export-create-modal report-export-create-email-modal"
  461. :class="{ 'report-export-create-modal--open': emailModalOpen }" v-if="emailModalOpen">
  462. <view class="report-export-create-modal-title">
  463. <text>发送至邮箱</text>
  464. <view class="report-export-create-modal-close" @click.stop="closeEmailModal">×</view>
  465. </view>
  466. <view class="report-export-create-modal-body" :style="{ padding: '40rpx' }">
  467. <!-- <view class="report-export-email-input-wrap" :class="{ 'report-export-input-error': emailError }">
  468. <input class="report-export-email-input" v-model="emailForm.email" placeholder="请填写邮箱"
  469. placeholder-style="color: #c0c4cc" @input="emailError = false" />
  470. <text class="report-export-email-suffix">@999.com.cn</text>
  471. </view> -->
  472. <up-input v-model="emailForm.email" border="none" :customStyle="{
  473. backgroundColor: '#ebf3fb',
  474. height: '80rpx',
  475. paddingLeft: '20rpx',
  476. }" placeholder="请填写邮箱" disabled>
  477. <template #suffix style="margin-right: 30rpx"> @999.com.cn </template>
  478. </up-input>
  479. <text v-if="emailError" class="report-export-error-text">请输入邮箱</text>
  480. </view>
  481. <view class="report-export-create-modal-footer" :style="{
  482. padding: '20rpx 40rpx 40rpx',
  483. display: 'flex',
  484. 'justify-content': 'space-between',
  485. }">
  486. <view class="report-export-create-modal-btn" :style="{
  487. background: '#fff',
  488. color: '#666',
  489. border: '1rpx solid #dcdfe6',
  490. flex: '0 0 45%',
  491. }" @click.stop="closeEmailModal">取消</view>
  492. <view class="report-export-create-modal-btn" :style="{ flex: '0 0 45%' }" @click.stop="handleSendEmail">发送
  493. </view>
  494. </view>
  495. </view>
  496. </view>
  497. </template>
  498. <script>
  499. import EmptyView from "../../../wigets/empty.vue";
  500. import { formatDate, getPaginatedList } from "../../../utils/utils.js";
  501. import request from "../../../request/index.js";
  502. const customerTypeMap = {
  503. VIP客户: "VIP",
  504. 二级客户: "二级",
  505. 三级客户: "三级",
  506. };
  507. const customerTypeReverseMap = {
  508. VIP: "VIP客户",
  509. 二级: "二级客户",
  510. 三级: "三级客户",
  511. };
  512. const statusMap = {
  513. 全部: 0,
  514. 待开始: 1,
  515. 进行中: 2,
  516. 已完成: 3,
  517. };
  518. export default {
  519. components: {
  520. EmptyView,
  521. },
  522. data() {
  523. return {
  524. keyword: "",
  525. totalCount: 0,
  526. loading: true,
  527. hasmore: true,
  528. fetchLoading: false,
  529. pageNum: 1,
  530. pageSize: 10,
  531. list: [],
  532. listViewHeight: "400px",
  533. createModalOpen: false,
  534. form: {
  535. region: { regionName: "" },
  536. customerType: "",
  537. customer: [],
  538. product: { physicName: "" },
  539. otherCustomer: "",
  540. otherCustomerCode: "",
  541. },
  542. dateRange: [],
  543. computeTimer: null,
  544. dropdown: {
  545. region: false,
  546. customerType: false,
  547. customer: false,
  548. otherCustomer: false,
  549. product: false,
  550. pkgSpec: false,
  551. },
  552. options: {
  553. region: [],
  554. customerType: ["VIP客户", "二级客户", "三级客户"],
  555. product: [],
  556. pkgSpec: [],
  557. status: ["全部", "已完成", "待开始", "进行中"],
  558. },
  559. // dropdown search inputs (create modal)
  560. searchForm: {
  561. region: "",
  562. product: "",
  563. },
  564. // Pagination state for products
  565. productPage: 0,
  566. productPageSize: 10,
  567. displayProducts: [], // Currently displayed products
  568. // dropdown search inputs (filter modal)
  569. filterSearchForm: {
  570. product: "",
  571. },
  572. // Pagination state for filter products
  573. filterProductPage: 0,
  574. filterDisplayProducts: [],
  575. customers: [],
  576. customerPage: 1,
  577. customerPageSize: 10,
  578. customerTotal: null,
  579. customerHasMore: true,
  580. customerLoading: false,
  581. customerDebounceTimer: null,
  582. taskTitle: "创建任务",
  583. filterModalOpen: false,
  584. filterForm: {
  585. product: { physicName: "" },
  586. status: "全部",
  587. pkgSpec: "",
  588. },
  589. filterDropdown: { product: false, pkgSpec: false },
  590. filterDateRange: [],
  591. modalType: "",
  592. dropdownUpward: false,
  593. customerSearch: "",
  594. otherCustomerSearch: "",
  595. otherCustomers: [],
  596. otherCustomerLoading: false,
  597. otherCustomerDebounceTimer: null,
  598. currentItem: {},
  599. emailModalOpen: false,
  600. emailForm: {
  601. email: "",
  602. },
  603. emailError: false,
  604. };
  605. },
  606. created() {
  607. const userInfo = uni.getStorageSync("userInfo");
  608. // const staffEmail = userInfo?.ldap || "";
  609. // this.emailForm.email = staffEmail.split("@")[0];
  610. const userEmail = uni.getStorageSync('traceCode_useremail')
  611. this.emailForm.email = userEmail
  612. console.log("reportExport\index.vue,storage,userInfo", userInfo);
  613. this.initList();
  614. this.getProviceList();
  615. this.getDrugInfoName();
  616. this.fetchList();
  617. try {
  618. uni.onKeyboardHeightChange(({ height }) => {
  619. this.dropdownUpward = height > 0;
  620. });
  621. } catch (e) { }
  622. },
  623. computed: {
  624. taskTitle() {
  625. if (this.modalType === "create") {
  626. return "创建任务";
  627. } else if (this.modalType == "edit") {
  628. return "修改任务";
  629. } else if (this.modalType == "read") {
  630. return "查看任务";
  631. }
  632. },
  633. },
  634. watch: {
  635. "form.customerType"(val) {
  636. this.customerPage = 1;
  637. this.customerTotal = null;
  638. this.customerHasMore = true;
  639. this.customers = [];
  640. if (this.customerDebounceTimer) clearTimeout(this.customerDebounceTimer);
  641. this.getCustomerOptions();
  642. },
  643. "form.region": {
  644. handler() {
  645. this.customerPage = 1;
  646. this.customerTotal = null;
  647. this.customerHasMore = true;
  648. this.customers = [];
  649. if (this.customerDebounceTimer)
  650. clearTimeout(this.customerDebounceTimer);
  651. this.getCustomerOptions();
  652. },
  653. deep: true,
  654. },
  655. "emailForm.email": {
  656. handler(newVal, oldVal) {
  657. if (!oldVal && !newVal && newVal !== oldVal) {
  658. this.emailError = false;
  659. } else {
  660. this.emailError = !newVal;
  661. }
  662. },
  663. deep: true,
  664. },
  665. "filterForm.status"(val) {
  666. this.resetFetch();
  667. },
  668. },
  669. methods: {
  670. getCustomerName(data = {}) {
  671. const { customerName = "", otherCustomer = "" } = data;
  672. let name = customerName || "";
  673. if (otherCustomer) {
  674. if (name) {
  675. name += `,${otherCustomer}`;
  676. } else {
  677. name = otherCustomer;
  678. }
  679. }
  680. const arr = name?.split(",");
  681. if (arr.length == 0) return "--";
  682. return arr.length == 1
  683. ? arr[0].trim()
  684. : `${arr[0].trim()}等${arr.length - 1}家公司`;
  685. },
  686. formatDate(date) {
  687. return formatDate({ date }, "YYYY-MM-DD");
  688. },
  689. normalizeDateToYMD(value) {
  690. if (!value) return "";
  691. if (typeof value === "string") {
  692. const trimmed = value.trim();
  693. if (trimmed.length >= 10) return trimmed.slice(0, 10);
  694. return trimmed;
  695. }
  696. return this.formatDate(value);
  697. },
  698. getStatusText(status) {
  699. if (status == "1") {
  700. return "导出待开始";
  701. } else if (status == "2") {
  702. return "导出进行中";
  703. } else if (status == "3" || status == "4") {
  704. return "导出已完成";
  705. }
  706. return "未知状态";
  707. },
  708. getDrugInfoName() {
  709. request("/bills/getDrugInfoName", {
  710. path: "/reportExport/index.vue",
  711. }).then((res) => {
  712. if (res.code == 200) {
  713. const _data = res.data;
  714. this.options.product = _data;
  715. }
  716. });
  717. },
  718. getGuigeList(physicName) {
  719. if (!physicName) return;
  720. request("/report/getDrugSpec", {
  721. physicName,
  722. path: "/reportExport/index.vue",
  723. }).then((res) => {
  724. if (res.code == 200) {
  725. this.options.pkgSpec = res.data || [];
  726. }
  727. });
  728. },
  729. getProviceList() {
  730. request("/common/getProviceList", {
  731. path: "/reportExport/index.vue",
  732. }).then((res) => {
  733. if (res.code == 200) {
  734. const _data = res.data;
  735. this.options.region = _data;
  736. }
  737. });
  738. },
  739. getCustomerOptions() {
  740. if (!this.customerHasMore || this.customerLoading) return;
  741. this.customerLoading = true;
  742. request("/customer/info/getCustomerInfo", {
  743. pageNum: this.customerPage,
  744. pageSize: this.customerPageSize,
  745. customerName: this.customerSearch || "",
  746. customerLevel: customerTypeMap?.[this.form.customerType] || undefined,
  747. provinceCode: this.form?.region?.regionCode || undefined,
  748. path: "/reportExport/index.vue",
  749. }).then((res) => {
  750. if (res.code == 200) {
  751. const _data = res.data || {};
  752. this.customerTotal = _data.total || 0;
  753. const list = Array.isArray(_data.list) ? _data.list : [];
  754. this.customers = [...this.customers, ...list];
  755. if (this.customers.length >= this.customerTotal) {
  756. this.customerHasMore = false;
  757. } else {
  758. this.customerPage++;
  759. this.customerHasMore = true;
  760. }
  761. }
  762. this.customerLoading = false;
  763. });
  764. },
  765. getOtherCustomerOptions() {
  766. const keyword = String(this.otherCustomerSearch || "").trim();
  767. if (!keyword) {
  768. if (!keyword) this.otherCustomers = [];
  769. return;
  770. }
  771. this.otherCustomerLoading = true;
  772. request(
  773. "/report/getEntName?entName=" + encodeURIComponent(keyword),
  774. {
  775. entName: keyword,
  776. path: "/reportExport/index.vue",
  777. },
  778. "get",
  779. ).then((res) => {
  780. if (res.code == 200) {
  781. const raw = Array.isArray(res.data)
  782. ? res.data
  783. : Array.isArray(res.data?.list)
  784. ? res.data.list
  785. : [];
  786. const names = raw
  787. .map((item) =>
  788. typeof item === "string" ? item : item?.entName || item?.customerName || "",
  789. )
  790. .map((name) => String(name || "").trim())
  791. .filter(Boolean);
  792. this.otherCustomers = Array.from(new Set(names));
  793. } else {
  794. this.otherCustomers = [];
  795. }
  796. this.otherCustomerLoading = false;
  797. });
  798. },
  799. initList() {
  800. const info = uni.getSystemInfoSync();
  801. const h = info.windowHeight || 800;
  802. this.listViewHeight = Math.max(0, h - 280) + "px";
  803. // this.list = this.genItems(Math.min(10, this.totalCount));
  804. // this.animateAll();
  805. },
  806. onFilter() {
  807. this.filterModalOpen = true;
  808. },
  809. showModal(item = {}) {
  810. const map = {
  811. 1: "edit",
  812. 2: "read",
  813. 3: "read",
  814. };
  815. this.modalType = map[item?.status] || "create";
  816. if (this.modalType === "create") {
  817. this.taskTitle = "创建任务";
  818. } else {
  819. if (this.modalType == "edit") {
  820. this.taskTitle = "修改任务";
  821. } else if (this.modalType == "read") {
  822. this.taskTitle = "查看任务";
  823. }
  824. const cNames = item.customerName ? item.customerName.split(",") : [];
  825. const cCodes = item.customerId
  826. ? String(item.customerId).split(",")
  827. : [];
  828. const regionCode = item.regionCode || item.provinceCode || "";
  829. let regionName = item.regionName || item.provinceName || "";
  830. if (!regionName && regionCode && Array.isArray(this.options.region)) {
  831. const regionItem = this.options.region.find(
  832. (r) => r.regionCode === regionCode || r.provinceCode === regionCode,
  833. );
  834. if (regionItem) {
  835. regionName = regionItem.regionName || regionItem.name || "";
  836. }
  837. }
  838. let customerTypeLabel = "";
  839. const cType = item.customerType;
  840. if (cType === 1 || cType === "1") {
  841. customerTypeLabel = "VIP客户";
  842. } else if (cType === 2 || cType === "2") {
  843. customerTypeLabel = "二级客户";
  844. } else if (cType === 3 || cType === "3") {
  845. customerTypeLabel = "三级客户";
  846. } else if (typeof cType === "string" && cType) {
  847. customerTypeLabel = customerTypeReverseMap[cType] || cType;
  848. }
  849. this.form = {
  850. customer: cCodes.map((i, index) => ({
  851. customerName: cNames[index],
  852. customerCode: i,
  853. })),
  854. region: {
  855. regionCode,
  856. regionName,
  857. },
  858. customerType: customerTypeLabel,
  859. product: {
  860. physicName: item.physicName,
  861. drugEntBaseInfoId: item.drugEntBaseInfoId,
  862. },
  863. pkgSpec: item?.pkgSpec || "",
  864. otherCustomer: item?.otherCustomer || "",
  865. otherCustomerCode: item?.otherCustomerCode || "",
  866. };
  867. if (item.physicName) {
  868. this.getGuigeList(item.physicName);
  869. }
  870. this.dateRange = [
  871. this.normalizeDateToYMD(item.beginTime),
  872. this.normalizeDateToYMD(item.endTime),
  873. ];
  874. }
  875. this.createModalOpen = true;
  876. this.currentItem = item;
  877. },
  878. fetchList() {
  879. // this.list = [];
  880. // setTimeout(() => {
  881. // const n = Math.min(10, this.totalCount || 10);
  882. // this.list = this.genItems(n);
  883. // if (!this.totalCount) this.totalCount = this.list.length;
  884. // this.animateAll();
  885. // this.fetchLoading = false;
  886. // }, 1000);
  887. if (!this.hasmore) {
  888. setTimeout(() => {
  889. this.fetchLoading = false;
  890. this.loading = false;
  891. }, 500);
  892. return;
  893. }
  894. if (this.fetchLoading) return;
  895. this.fetchLoading = true;
  896. request("/report/getReportTaskPage", {
  897. reportType: 2,
  898. taskType: statusMap?.[this.filterForm?.status] || "",
  899. drugEntBaseInfoId: this.filterForm?.product?.drugEntBaseInfoId,
  900. pkgSpec: this.filterForm?.pkgSpec || "",
  901. beginTime: this.filterDateRange[0],
  902. endTime: this.filterDateRange[1],
  903. customerName: this.keyword || "",
  904. pageNum: this.pageNum,
  905. pageSize: this.pageSize,
  906. path: "reportExport/index.vue",
  907. }).then((res) => {
  908. if (res.code == 200) {
  909. const _data = res.data || {};
  910. const { list, total } = _data;
  911. this.totalCount = total || 0;
  912. const incoming = Array.isArray(list) ? list : [];
  913. const existingIds = new Set(this.list.map((v) => v?.id));
  914. const merged = incoming.filter((v) => {
  915. const id = v?.id;
  916. return id === undefined ? true : !existingIds.has(id);
  917. });
  918. if (merged.length === 0 && incoming.length > 0) {
  919. this.hasmore = false;
  920. } else {
  921. this.list = [...this.list, ...merged];
  922. }
  923. if (this.list.length < this.totalCount) {
  924. this.hasmore = true;
  925. this.pageNum++;
  926. } else {
  927. this.hasmore = false;
  928. }
  929. // this.list.push({
  930. // ...this.list[1],
  931. // status: 3,
  932. // });
  933. // this.list.push({
  934. // ...this.list[0],
  935. // finishTime: "2025-12-15",
  936. // status: 3,
  937. // });
  938. // this.animateAll();
  939. }
  940. this.fetchLoading = false;
  941. this.loading = false;
  942. });
  943. },
  944. resetFetch() {
  945. this.loading = true;
  946. this.list = [];
  947. this.pageNum = 1;
  948. this.hasmore = true;
  949. this.fetchList();
  950. },
  951. toDetail(item) {
  952. uni.navigateTo({
  953. url: `/traceCodePackages/traceabilityReport/pages/reportExport/detail/index?id=${item.id
  954. }&title=${encodeURIComponent(this.getCustomerName(item))}`,
  955. });
  956. },
  957. onSearch() {
  958. this.resetFetch();
  959. },
  960. onCreate() {
  961. this.modalType = "create";
  962. this.taskTitle = "创建任务";
  963. this.createModalOpen = true;
  964. },
  965. closeCreate() {
  966. this.filterModalOpen = false;
  967. this.createModalOpen = false;
  968. this.closeDropdownAll();
  969. this.form = {
  970. region: { regionName: "" },
  971. customerType: "",
  972. customer: [],
  973. product: { physicName: "" },
  974. otherCustomer: "",
  975. otherCustomerCode: "",
  976. };
  977. this.searchForm = {
  978. region: "",
  979. product: "",
  980. };
  981. this.otherCustomerSearch = "";
  982. this.otherCustomers = [];
  983. this.otherCustomerLoading = false;
  984. if (this.otherCustomerDebounceTimer) {
  985. clearTimeout(this.otherCustomerDebounceTimer);
  986. this.otherCustomerDebounceTimer = null;
  987. }
  988. this.dateRange = [];
  989. if (this.computeTimer) {
  990. clearTimeout(this.computeTimer);
  991. this.computeTimer = null;
  992. }
  993. },
  994. confirmCreate() {
  995. let flag = false;
  996. Object.values(this.dropdown).forEach((v) => {
  997. if (v) {
  998. flag = true;
  999. }
  1000. });
  1001. if (flag) {
  1002. this.closeDropdownAll();
  1003. return;
  1004. }
  1005. if (!this.isFormComplete()) {
  1006. // uni.showToast({ title: "请完整填写任务内容", icon: "none" });
  1007. return;
  1008. }
  1009. // uni.showToast({ title: "已创建", icon: "none" });
  1010. uni.showLoading({
  1011. title: this.modalType === "create" ? "创建中..." : "修改中...",
  1012. });
  1013. const url =
  1014. this.modalType === "create" ? `/report/save` : `/report/update`;
  1015. const customerId = (this.form?.customer || [])
  1016. .map((v) => v?.customerCode || "")
  1017. .join(",");
  1018. const customerName = (this.form?.customer || [])
  1019. .map((v) => v?.customerName || "")
  1020. .join(",");
  1021. request(url, {
  1022. id:
  1023. this.modalType === "create" ? undefined : this.currentItem?.id || "",
  1024. reportType: 2,
  1025. regionCode: this.form?.region?.regionCode || "",
  1026. customerType: customerTypeMap?.[this.form?.customerType] || "",
  1027. customerId,
  1028. customerName,
  1029. otherCustomer: this.form?.otherCustomer || "",
  1030. otherCustomerCode: this.form?.otherCustomerCode || "",
  1031. drugEntBaseInfoId: this.form?.product?.drugEntBaseInfoId || "",
  1032. pkgSpec: this.form?.pkgSpec || "",
  1033. physicName: this.form?.product?.physicName || "",
  1034. beginTime: this.formatDate(this.dateRange[0], "YYYY-MM-DD"),
  1035. endTime: this.formatDate(this.dateRange[1], "YYYY-MM-DD"),
  1036. path: "",
  1037. }).then((res) => {
  1038. if (res.code == 200) {
  1039. uni.hideLoading();
  1040. uni.showToast({
  1041. title: this.modalType === "create" ? "已创建" : "已修改",
  1042. icon: "none",
  1043. });
  1044. this.resetFetch();
  1045. this.closeCreate();
  1046. }
  1047. });
  1048. },
  1049. isFormComplete() {
  1050. const f = this.form;
  1051. const drOk =
  1052. Array.isArray(this.dateRange) &&
  1053. this.dateRange.length === 2 &&
  1054. this.dateRange[0] &&
  1055. this.dateRange[1];
  1056. const hasSelectedCustomer = Array.isArray(f.customer)
  1057. ? f.customer.length > 0
  1058. : !!f.customer;
  1059. const hasOtherCustomer = !!String(f.otherCustomer || "").trim();
  1060. const hasOtherCustomerCode = !!String(f.otherCustomerCode || "").trim();
  1061. const customerOk =
  1062. hasSelectedCustomer || hasOtherCustomer || hasOtherCustomerCode;
  1063. if (!customerOk) {
  1064. uni.showToast({
  1065. title: "请至少填写客户、其它客户、其它客户信用代码中的一项",
  1066. icon: "none",
  1067. });
  1068. return false;
  1069. }
  1070. if (!f.product?.physicName) {
  1071. uni.showToast({ title: "请选择品种", icon: "none" });
  1072. return false;
  1073. }
  1074. if (!drOk) {
  1075. uni.showToast({ title: "请选择时间范围", icon: "none" });
  1076. return false;
  1077. }
  1078. return true;
  1079. // return (
  1080. // f.region?.regionName &&
  1081. // f.customerType &&
  1082. // customerOk &&
  1083. // f.product?.physicName &&
  1084. // drOk
  1085. // );
  1086. },
  1087. confirmDelete() {
  1088. uni.showModal({
  1089. title: "确认删除吗?",
  1090. success: (res) => {
  1091. if (res.confirm) {
  1092. uni.showLoading();
  1093. request("/report/delete", {
  1094. id: this.currentItem?.id || "",
  1095. path: "reportExport/index.vue",
  1096. }).then((res) => {
  1097. uni.hideLoading();
  1098. if (res.code == 200) {
  1099. uni.showToast({
  1100. title: "删除成功",
  1101. icon: "none",
  1102. duration: 2000,
  1103. });
  1104. this.resetFetch();
  1105. this.closeCreate();
  1106. } else {
  1107. uni.showToast({
  1108. title: res?.msg || "删除失败",
  1109. icon: "none",
  1110. duration: 2000,
  1111. });
  1112. }
  1113. });
  1114. }
  1115. },
  1116. });
  1117. },
  1118. onInput(k) {
  1119. this.closeDropdownAll();
  1120. this.dropdown[k] = true;
  1121. if (k === "customer") {
  1122. this.customerPage = 1;
  1123. this.customerTotal = null;
  1124. this.customerHasMore = true;
  1125. this.customers = [];
  1126. if (this.customerDebounceTimer)
  1127. clearTimeout(this.customerDebounceTimer);
  1128. this.customerDebounceTimer = setTimeout(() => {
  1129. this.getCustomerOptions();
  1130. }, 500);
  1131. return;
  1132. }
  1133. if (k === "product") {
  1134. this.initProductList("create");
  1135. return;
  1136. }
  1137. if (k === "otherCustomer") {
  1138. const keyword = String(this.otherCustomerSearch || "").trim();
  1139. if (!keyword) {
  1140. this.otherCustomers = [];
  1141. this.otherCustomerLoading = false;
  1142. if (this.otherCustomerDebounceTimer) {
  1143. clearTimeout(this.otherCustomerDebounceTimer);
  1144. this.otherCustomerDebounceTimer = null;
  1145. }
  1146. return;
  1147. }
  1148. // 输入后先进入 loading,避免先闪“未查找到该客户”
  1149. this.otherCustomerLoading = true;
  1150. if (this.otherCustomerDebounceTimer)
  1151. clearTimeout(this.otherCustomerDebounceTimer);
  1152. this.otherCustomerDebounceTimer = setTimeout(() => {
  1153. this.getOtherCustomerOptions();
  1154. }, 500);
  1155. }
  1156. },
  1157. closeDropdownAll() {
  1158. this.dropdown = {
  1159. region: false,
  1160. customerType: false,
  1161. customer: false,
  1162. otherCustomer: false,
  1163. product: false,
  1164. pkgSpec: false,
  1165. };
  1166. this.filterDropdown.product = false;
  1167. this.filterDropdown.pkgSpec = false;
  1168. },
  1169. openFilterDropdown(k) {
  1170. this.closeDropdownAll();
  1171. this.filterDropdown[k] = true;
  1172. if (k === "product") {
  1173. this.initProductList("filter");
  1174. }
  1175. },
  1176. toggleFilterDropdown(k) {
  1177. this.filterDropdown[k] = !this.filterDropdown[k];
  1178. },
  1179. onFilterInput(k) {
  1180. this.closeDropdownAll();
  1181. this.filterDropdown[k] = true;
  1182. if (k === "product") {
  1183. this.initProductList("filter");
  1184. }
  1185. },
  1186. pickFilterOption(k, v) {
  1187. if (!["status"].includes(k) && this.filterForm[k] === v) {
  1188. this.filterForm[k] = "";
  1189. this.filterDropdown[k] = false;
  1190. return;
  1191. }
  1192. this.filterForm[k] = v;
  1193. if (k === "product") {
  1194. this.filterForm.pkgSpec = "";
  1195. this.getGuigeList(v.physicName);
  1196. }
  1197. this.filterDropdown[k] = false;
  1198. },
  1199. filteredFilterOptions(k) {
  1200. const arr = k === "product" ? this.products || [] : [];
  1201. const q = String(this.filterForm[k] || "").trim();
  1202. if (!q) return arr;
  1203. return arr.filter((it) => it.indexOf(q) !== -1);
  1204. },
  1205. onFilterDateChange() { },
  1206. confirmFilter() {
  1207. this.filterModalOpen = false;
  1208. this.resetFetch();
  1209. },
  1210. resetFilter() {
  1211. this.filterForm = {
  1212. product: { physicName: "" },
  1213. status: "全部",
  1214. pkgSpec: "",
  1215. };
  1216. this.filterSearchForm.product = "";
  1217. this.filterProductPage = 0;
  1218. this.filterDisplayProducts = [];
  1219. this.filterDropdown = { product: false, pkgSpec: false };
  1220. this.filterDateRange = [];
  1221. this.resetFetch();
  1222. },
  1223. openDropdown(k) {
  1224. this.closeDropdownAll();
  1225. this.dropdown[k] = true;
  1226. if (k === "customer") {
  1227. if (!this.customers || this.customers.length === 0) {
  1228. this.customerPage = 1;
  1229. this.customerTotal = null;
  1230. this.customerHasMore = true;
  1231. this.getCustomerOptions();
  1232. }
  1233. }
  1234. if (k === "product") {
  1235. this.initProductList("create");
  1236. }
  1237. if (k === "otherCustomer" && !String(this.otherCustomerSearch || "").trim()) {
  1238. this.otherCustomers = [];
  1239. }
  1240. },
  1241. toggleDropdown(k) {
  1242. this.dropdown[k] = !this.dropdown[k];
  1243. },
  1244. pickOption(k, v) {
  1245. if (k === "customer") {
  1246. if (!Array.isArray(this.form.customer)) this.form.customer = [];
  1247. const idx = this.form.customer.indexOf(v);
  1248. if (idx === -1) {
  1249. this.form.customer.push(v);
  1250. } else {
  1251. this.form.customer.splice(idx, 1);
  1252. }
  1253. return;
  1254. }
  1255. if (k === "otherCustomer") {
  1256. const name =
  1257. typeof v === "string"
  1258. ? v
  1259. : v?.entName || v?.customerName || "";
  1260. const selected = this.getOtherCustomerArray();
  1261. const idx = selected.findIndex((item) => item === name);
  1262. if (idx === -1) {
  1263. selected.push(name);
  1264. } else {
  1265. selected.splice(idx, 1);
  1266. }
  1267. this.form.otherCustomer = selected.join(",");
  1268. return;
  1269. }
  1270. this.form[k] = v;
  1271. if (k === "product") {
  1272. this.form.pkgSpec = "";
  1273. this.getGuigeList(v.physicName);
  1274. }
  1275. this.dropdown[k] = false;
  1276. },
  1277. isCustomerSelected(name) {
  1278. const arr = this.form.customer;
  1279. if (!Array.isArray(arr)) return false;
  1280. return arr.some((i) => i.customerName === name);
  1281. },
  1282. removeCustomer(name) {
  1283. if (!Array.isArray(this.form.customer)) return;
  1284. const idx = this.form.customer.findIndex((i) => i.customerName === name);
  1285. if (idx !== -1) this.form.customer.splice(idx, 1);
  1286. },
  1287. clearAllCustomers() {
  1288. this.form.customer = [];
  1289. },
  1290. getOtherCustomerArray() {
  1291. return String(this.form.otherCustomer || "")
  1292. .split(",")
  1293. .map((i) => i.trim())
  1294. .filter(Boolean);
  1295. },
  1296. isOtherCustomerSelected(name) {
  1297. return this.getOtherCustomerArray().includes(name);
  1298. },
  1299. removeOtherCustomer(name) {
  1300. const arr = this.getOtherCustomerArray().filter((i) => i !== name);
  1301. this.form.otherCustomer = arr.join(",");
  1302. },
  1303. clearAllOtherCustomers() {
  1304. this.form.otherCustomer = "";
  1305. },
  1306. filteredOptions(k, type) {
  1307. const arr = this.options[k] || [];
  1308. let q = "";
  1309. if (type === "filter") {
  1310. q = this.filterSearchForm[k] || "";
  1311. } else {
  1312. q = this.searchForm[k] || "";
  1313. }
  1314. q = String(q).trim().toLocaleLowerCase();
  1315. if (!q) return arr;
  1316. return arr.filter((it) => {
  1317. if (typeof it === "string")
  1318. return it.toLocaleLowerCase().indexOf(q) !== -1;
  1319. if (it && typeof it === "object") {
  1320. const name =
  1321. k === "region"
  1322. ? it.regionName || it.name || ""
  1323. : it.physicName || it.productName || "";
  1324. return String(name).toLocaleLowerCase().indexOf(q) !== -1;
  1325. }
  1326. return false;
  1327. });
  1328. },
  1329. // Initialize product list for pagination
  1330. initProductList(mode) {
  1331. const allProducts = this.filteredOptions(
  1332. "product",
  1333. mode === "filter" ? "filter" : undefined,
  1334. );
  1335. const res = getPaginatedList({
  1336. page: 0,
  1337. size: 10,
  1338. initData: allProducts,
  1339. data: [],
  1340. });
  1341. if (mode === "filter") {
  1342. this.filterProductPage = res.page;
  1343. this.filterDisplayProducts = res.data;
  1344. } else {
  1345. this.productPage = res.page;
  1346. this.displayProducts = res.data;
  1347. }
  1348. },
  1349. // Load more products on scroll
  1350. loadMoreProducts(mode) {
  1351. const allProducts = this.filteredOptions(
  1352. "product",
  1353. mode === "filter" ? "filter" : undefined,
  1354. );
  1355. const isFilter = mode === "filter";
  1356. const currentPage = isFilter ? this.filterProductPage : this.productPage;
  1357. const currentData = isFilter
  1358. ? this.filterDisplayProducts
  1359. : this.displayProducts;
  1360. const res = getPaginatedList({
  1361. page: currentPage,
  1362. size: 10,
  1363. initData: allProducts,
  1364. data: currentData,
  1365. });
  1366. if (res.data) {
  1367. if (isFilter) {
  1368. this.filterProductPage = res.page;
  1369. this.filterDisplayProducts = res.data;
  1370. } else {
  1371. this.productPage = res.page;
  1372. this.displayProducts = res.data;
  1373. }
  1374. }
  1375. },
  1376. onSearchFocus() {
  1377. this.dropdownUpward = true;
  1378. },
  1379. onSearchBlur() {
  1380. this.dropdownUpward = false;
  1381. },
  1382. dropdownPosStyle() {
  1383. // if (this.dropdownUpward) {
  1384. // return { bottom: "84rpx" };
  1385. // }
  1386. return { top: "84rpx" };
  1387. },
  1388. openDatePicker() {
  1389. if (this.modalType === "read") return;
  1390. this.$refs.datePicker.show();
  1391. },
  1392. onDateChange(val) {
  1393. const arr = Array.isArray(val) ? val : this.dateRange;
  1394. if (!Array.isArray(arr) || arr.length !== 2) return;
  1395. const startDate = new Date(arr[0].replace(/-/g, "/"));
  1396. const endDate = new Date(arr[1].replace(/-/g, "/"));
  1397. const diff = endDate.getTime() - startDate.getTime();
  1398. const limit = 183 * 24 * 3600 * 1000; // Approx 6 months
  1399. if (diff > limit) {
  1400. uni.showToast({
  1401. title: "时间范围不能超过半年",
  1402. icon: "none",
  1403. });
  1404. this.dateRange = [];
  1405. return;
  1406. }
  1407. this.dateRange = [
  1408. this.normalizeDateToYMD(arr[0]),
  1409. this.normalizeDateToYMD(arr[1]),
  1410. ];
  1411. },
  1412. onStart(item) {
  1413. uni.showModal({
  1414. title: "是否开始导出报表?",
  1415. success: (res) => {
  1416. if (res.confirm) {
  1417. uni.showLoading();
  1418. request("/report/confirm", {
  1419. id: item?.id || "",
  1420. path: "reportExport/index.vue",
  1421. }).then((res) => {
  1422. uni.hideLoading();
  1423. if (res.code == 200) {
  1424. uni.showToast({
  1425. title: "已开始导出",
  1426. icon: "none",
  1427. duration: 2000,
  1428. });
  1429. this.resetFetch();
  1430. this.closeCreate();
  1431. } else {
  1432. uni.showToast({
  1433. title: res?.msg || "请求失败",
  1434. icon: "none",
  1435. duration: 2000,
  1436. });
  1437. }
  1438. });
  1439. }
  1440. },
  1441. });
  1442. },
  1443. onSend(item) {
  1444. this.currentItem = item;
  1445. this.emailError = false;
  1446. this.emailModalOpen = true;
  1447. },
  1448. closeEmailModal() {
  1449. this.emailModalOpen = false;
  1450. },
  1451. handleSendEmail() {
  1452. const email = String(this.emailForm.email || "").trim();
  1453. if (!email) {
  1454. this.emailError = true;
  1455. return;
  1456. }
  1457. this.closeEmailModal();
  1458. uni.showLoading({
  1459. title: "发送中...",
  1460. });
  1461. const url = "/report/sendemail";
  1462. request(url, {
  1463. taskId: this.currentItem?.id,
  1464. emailAddress: email + "@999.com.cn",
  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>