index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template>
  2. <div
  3. id="review_Email"
  4. v-loading="pictLoading"
  5. class="view"
  6. element-loading-background="rgba(43, 48, 67, 0.65)"
  7. element-loading-spinner="el-icon-loading"
  8. >
  9. <div class="crm_search">
  10. <el-form ref="formRef" :model="search" label-width="">
  11. <el-row>
  12. <el-col :span="24" :md="24" :lg="24">
  13. <el-form-item>
  14. <el-select
  15. v-model="search.tag"
  16. class="crm_search_down crm-border-radius-no"
  17. :placeholder="$t('Placeholder.Choose')"
  18. >
  19. <el-option
  20. v-for="option in searchTagOptions"
  21. :key="option.value"
  22. :label="$t(option.label)"
  23. :value="option.value"
  24. ></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item style="margin-right: 10px">
  28. <el-input
  29. v-if="search.tag == 1"
  30. v-model.trim="search.cId"
  31. class="crm-border-left-no crm-border-radius-no"
  32. clearable
  33. :placeholder="$t('Placeholder.Input')"
  34. @keyup.enter="toSearch"
  35. ></el-input>
  36. <el-input
  37. v-if="search.tag == 2"
  38. v-model.trim="search.mobile"
  39. class="crm-border-left-no crm-border-radius-no"
  40. clearable
  41. :placeholder="$t('Placeholder.Input')"
  42. @keyup.enter="toSearch"
  43. ></el-input>
  44. <el-input
  45. v-if="search.tag == 3"
  46. v-model.trim="search.email"
  47. class="crm-border-left-no crm-border-radius-no"
  48. clearable
  49. :placeholder="$t('Placeholder.Input')"
  50. @keyup.enter="toSearch"
  51. ></el-input>
  52. </el-form-item>
  53. <el-form-item style="margin-right: 10px">
  54. <el-select
  55. v-model="search.type"
  56. filterable
  57. clearable
  58. class="crm-border-radius-no select_down"
  59. :placeholder="$t('card.Form.f52')"
  60. @change="toSearch"
  61. >
  62. <el-option :label="$t('card.Status.t22')" :value="null"></el-option>
  63. <el-option
  64. v-for="(label, key) in options"
  65. :key="key"
  66. :label="$t(label)"
  67. :value="key"
  68. ></el-option>
  69. </el-select>
  70. </el-form-item>
  71. <el-form-item style="margin-right: 10px">
  72. <el-select
  73. v-model="search.status"
  74. filterable
  75. clearable
  76. class="crm-border-radius-no select_down"
  77. :placeholder="$t('Label.State')"
  78. @change="toSearch"
  79. >
  80. <el-option
  81. v-for="option in statusOptions"
  82. :key="option.value"
  83. :label="$t(option.label)"
  84. :value="option.value"
  85. ></el-option>
  86. </el-select>
  87. </el-form-item>
  88. <el-form-item>
  89. <el-date-picker
  90. v-model="search.date"
  91. class="crm_date_pick crm-border-radius-no"
  92. type="daterange"
  93. unlink-panels
  94. value-format="yyyy-MM-dd"
  95. range-separator="-"
  96. :start-placeholder="$t('Placeholder.Start')"
  97. :end-placeholder="$t('Placeholder.End')"
  98. >
  99. </el-date-picker>
  100. </el-form-item>
  101. <el-form-item>
  102. <el-button class="crm-border-radius-no crm-border-left-no" @click="toSearch">
  103. <el-icon><Search /></el-icon>
  104. </el-button>
  105. </el-form-item>
  106. </el-col>
  107. </el-row>
  108. <el-form-item>
  109. <el-button
  110. v-if="display['R-UserOrder-Export'] && display['R-UserOrder-Export'].show"
  111. type="primary"
  112. style="margin-left: 8px"
  113. @click="exportAgents"
  114. >{{ $t('Btn.Export') }}</el-button
  115. >
  116. </el-form-item>
  117. </el-form>
  118. <div class="card-mock-demo" style="margin: 30px 0">
  119. <el-table :data="mock_tableData" stripe style="margin-top: 20px; width: 100%">
  120. <el-table-column prop="cId" align="left" :label="$t('Ucard.UserOrder.item1')">
  121. <template #default="scope">
  122. <span>{{ scope.row.cId || '--' }}</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column :label="$t('Ucard.UserOrder.item14')">
  126. <template #default="scope">
  127. {{ scope.row.lastName }}{{ scope.row.firstName }}
  128. </template>
  129. </el-table-column>
  130. <el-table-column prop="email" align="left" :label="$t('Ucard.UserOrder.item15')" />
  131. <el-table-column prop="mobile" align="left" :label="$t('Ucard.UserOrder.item16')">
  132. <template #default="scope"> {{ scope.row.areaCode }} {{ scope.row.mobile }} </template>
  133. </el-table-column>
  134. <el-table-column prop="type" align="left" :label="$t('card.Form.f52')">
  135. <template #default="scope">
  136. <span v-if="scope.row.type && options[scope.row.type]">
  137. {{ $t(options[scope.row.type]) }}
  138. </span>
  139. <span v-else>--</span>
  140. </template>
  141. </el-table-column>
  142. <el-table-column prop="amount" align="left" :label="$t('card.Form.f55')" />
  143. <el-table-column prop="fee" align="left" :label="$t('card.Form.f30')" />
  144. <el-table-column prop="addTime" align="left" :label="$t('card.Form.f51')" />
  145. <el-table-column prop="status" align="left" :label="$t('Label.State')">
  146. <template #default="scope">
  147. <span v-if="scope.row.status == '2'" class="state crm_state_blue">{{
  148. $t('card.Status.t1')
  149. }}</span>
  150. <span v-else-if="scope.row.status == '3'" class="state crm_state_gray">{{
  151. $t('card.Status.t2')
  152. }}</span>
  153. <span v-else class="state crm_state_orange">
  154. {{ $t('card.Status.t3') }}
  155. </span>
  156. </template>
  157. </el-table-column>
  158. </el-table>
  159. </div>
  160. </div>
  161. <trading-info-add
  162. :dialog-info-trading-add="dialogInfoTradingAdd"
  163. :editor="editor"
  164. :add-type="addType"
  165. :my-info="myInfo"
  166. :form-list="formList"
  167. @confirm-to-reload="confirmToReload"
  168. @close-add="closeAdd"
  169. ></trading-info-add>
  170. <PagePagination
  171. :pager-info="pagerInfo"
  172. @size-change="handleSizeChange"
  173. @current-change="handleCurrentChange"
  174. />
  175. <detailed-info-cid
  176. :dialog-info-cid="dialogInfoCid"
  177. :form-info="formInfo"
  178. :is-trading="true"
  179. @close="closeCidDialog"
  180. />
  181. </div>
  182. </template>
  183. <script setup>
  184. import { ref, reactive, computed, watch, onMounted, inject } from 'vue'
  185. import { useRouter } from 'vue-router'
  186. import Service from '@/service/ucard'
  187. import PagePagination from '@/components/pagePagination'
  188. import Config from '@/config/index'
  189. import TradingInfoAdd from '@/views/components/PaymentTransfer'
  190. import DetailedInfoCid from '@/views/components/DetailedInfoCid'
  191. import { exportExcel } from '@/utils/export'
  192. import { options, searchTagOptions, statusOptions } from './const'
  193. import { useI18n } from 'vue-i18n'
  194. const { Code } = Config
  195. const router = useRouter()
  196. const Session = inject('session')
  197. const pigeon = inject('pigeon')
  198. const { t } = useI18n()
  199. // 响应式数据
  200. const pictLoading = ref(false)
  201. const dialogInfoTradingAdd = ref(false)
  202. const dialogInfoCid = ref(false)
  203. const formInfo = ref({})
  204. const editor = ref('')
  205. const addType = ref('')
  206. const formList = ref({})
  207. const myInfo = ref({})
  208. const mock_tableData = ref([])
  209. const pagerInfo = reactive({ row: 10, current: 1, pageTotal: 0, rowTotal: 0 })
  210. const banksData = ref([])
  211. const formRef = ref()
  212. // 搜索数据
  213. const search = reactive({
  214. tag: 1,
  215. cId: '',
  216. mobile: '',
  217. email: '',
  218. currency: '',
  219. amount: '',
  220. type: '',
  221. startDate: '',
  222. endDate: '',
  223. date: null,
  224. })
  225. // 计算属性
  226. const display = computed(() => {
  227. return JSON.parse(Session.Get('display', true))
  228. })
  229. // 方法
  230. // 导出
  231. const exportAgents = async () => {
  232. if (search.date == null) {
  233. search.startDate = ''
  234. search.endDate = ''
  235. } else if (search.date.length == 0) {
  236. search.startDate = ''
  237. search.endDate = ''
  238. } else {
  239. search.startDate = search.date[0]
  240. search.endDate = search.date[1]
  241. }
  242. exportExcel(pigeon, '/wasabi/card/wallet/record/export', { ...search }, 'Wallet_Balance_Record')
  243. }
  244. const closeAdd = (val) => {
  245. dialogInfoTradingAdd.value = val
  246. }
  247. const closeDiaAdd = () => {
  248. dialogInfoTradingAdd.value = false
  249. }
  250. const confirmToReload = () => {
  251. closeDiaAdd()
  252. searchFunc()
  253. }
  254. const toSearch = () => {
  255. pagerInfo.current = 1
  256. searchFunc()
  257. }
  258. // 列表
  259. const searchFunc = async () => {
  260. if (!display.value['R-UserOrder-Search']?.show) {
  261. pigeon.warning(t('Msg.NotDisplay'))
  262. return
  263. }
  264. if (search.date == null) {
  265. search.startDate = ''
  266. search.endDate = ''
  267. } else if (search.date.length == 0) {
  268. search.startDate = ''
  269. search.endDate = ''
  270. } else {
  271. search.startDate = search.date[0]
  272. search.endDate = search.date[1]
  273. }
  274. pictLoading.value = true
  275. try {
  276. const res = await Service.getRecordPage({
  277. ...search,
  278. page: {
  279. current: pagerInfo.current,
  280. row: pagerInfo.row,
  281. },
  282. })
  283. if (res.code === Code.StatusOK) {
  284. mock_tableData.value = res.data || []
  285. pagerInfo.rowTotal = res.page?.rowTotal || 0
  286. pagerInfo.pageTotal = res.page?.pageTotal || 0
  287. pigeon.success(t('Msg.SearchSuccess'))
  288. } else {
  289. pigeon.error(res.msg)
  290. }
  291. } catch (error) {
  292. pigeon.error(t('Msg.SearchFailed'))
  293. } finally {
  294. pictLoading.value = false
  295. }
  296. }
  297. const handleSizeChange = (val) => {
  298. pagerInfo.row = val
  299. searchFunc()
  300. }
  301. const handleCurrentChange = (val) => {
  302. pagerInfo.current = val
  303. searchFunc()
  304. }
  305. const closeCidDialog = (val) => {
  306. dialogInfoCid.value = val
  307. }
  308. // 监听器
  309. watch(
  310. () => search.tag,
  311. () => {
  312. search.cId = ''
  313. search.mobile = ''
  314. search.email = ''
  315. search.currency = ''
  316. search.amount = ''
  317. search.type = ''
  318. }
  319. )
  320. // 生命周期
  321. onMounted(() => {
  322. searchFunc()
  323. })
  324. </script>
  325. <style scoped lang="scss">
  326. #review_Email {
  327. .crm_search {
  328. .search_action_btn {
  329. .delete {
  330. background-color: #a1a1a1;
  331. }
  332. .delete.active {
  333. background-color: #368fec;
  334. }
  335. }
  336. }
  337. .el-table .state {
  338. display: inline-block;
  339. min-width: 80px;
  340. max-width: 150px;
  341. box-sizing: border-box;
  342. line-height: 1.5;
  343. border-radius: 2px;
  344. padding: 2px 10px;
  345. color: #ffffff;
  346. }
  347. }
  348. </style>
  349. <style lang="scss">
  350. #review_Email {
  351. .dialog_header_w {
  352. .crm_search_down {
  353. width: 400px;
  354. }
  355. }
  356. }
  357. </style>