index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <!-- 提现账号审批 -->
  3. <div class="taskMessagePage flex-col">
  4. <s-header :name="$t('taskMessage.withdrawalAccountApproval')" :noback="false"></s-header>
  5. <div class="taskMessageBox">
  6. <div class="searchRow flex-row justify-between">
  7. <div class="flex-col">
  8. <div class="flex-row justify-between bd3">
  9. <div class="flex-col outer4 joinPayMchCheckIcon"></div>
  10. <span class="flex-col txt2">{{ $t('taskMessage.total') }}<span class="discountNumber">{{ alarmHistoryTotal }}</span>{{ $t('taskMessage.recordsInTotal') }}</span>
  11. </div>
  12. </div>
  13. <div class="l-flex-RC">
  14. <div @click="noticeClk" class="main5 l-flex-RC">
  15. <img class="label2 o-mr-5" src="../../../assets/device/searchIcon.png" />
  16. <span class="txt3">{{ $t('taskMessage.search') }}</span>
  17. </div>
  18. </div>
  19. </div>
  20. <kTabs ref="kTabsRef" tabWidth="100%" @tabclk="tabClk" :tabList="tabList"></kTabs>
  21. <div class="flex-col">
  22. <van-list v-model:loading="loading" v-model:error="error" :error-text="$t('common.reqFailClkReload')"
  23. :finished="finished" :finished-text="$t('common.noMoreTxt')" offset="300" :immediate-check="false" @load="onLoad">
  24. <div class="listBox">
  25. <div v-for="(item, index) in alarmHistoryList" :key="index" class="listItem" @click="pushInfo(item)">
  26. <div class="itemBox">
  27. <div class="itemRow l-flex-between">
  28. <div class="l-flex-RC">
  29. <span class="itemTitle">{{ $t('taskMessage.merchantName') }}:&nbsp;</span>{{ payType==0 ? item.altMchName:item.regName }}
  30. </div>
  31. <van-icon color="#B9BAD0" name="arrow" />
  32. </div>
  33. <div class="itemRow">
  34. <span class="itemTitle">{{ $t('taskMessage.contactName') }}:&nbsp;</span>{{ payType==0 ? item.busiContactName:item.name }}
  35. </div>
  36. <div class="itemRow">
  37. <span class="itemTitle">{{ $t('taskMessage.contactPhoneNumber') }}:&nbsp;</span>{{ payType==0 ? item.busiContactMobileNo:item.phone }}
  38. </div>
  39. <div class="itemRow">
  40. <span class="itemTitle">{{ $t('taskMessage.applicationTime') }}:&nbsp;</span>{{ showDateTime(item.createDate) }}
  41. </div>
  42. <div class="itemRow">
  43. <span class="itemTitle">{{ $t('taskMessage.approvalTime') }}:&nbsp;</span>{{ showDateTime(item.modifyDate) }}
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </van-list>
  49. </div>
  50. </div>
  51. <!-- 筛选弹窗 -->
  52. <kDialog :dialogTitle="$t('taskMessage.equipmentInit.searchPop.title')"
  53. :confirmBtnTxt="$t('taskMessage.equipmentInit.searchPop.filterBtn')" ref="kDialogRef" @confirmclk="confirmClk">
  54. <template #content>
  55. <div class="cust_vantBorder">
  56. <van-field clearable v-model="searchForm.merchantName" :placeholder="
  57. $t('taskMessage.equipmentInit.searchPop.merchantNamePlace')
  58. " :label="$t('taskMessage.equipmentInit.searchPop.merchantName')" />
  59. <van-field @click-input="busiInpClk" readonly clearable v-model="searchForm.stateName"
  60. :placeholder="$t('taskMessage.equipmentInit.searchPop.statePlace')"
  61. :label="$t('taskMessage.equipmentInit.searchPop.state')">
  62. <template #right-icon>
  63. <div class="l-flex-RC">
  64. <van-icon v-if="searchForm.stateName" @click="searchForm.state = ''; searchForm.stateName = ''"
  65. class="o-mr-6" name="clear" />
  66. <van-icon @click="busiInpClk" name="arrow-down" />
  67. </div>
  68. </template>
  69. </van-field>
  70. </div>
  71. </template>
  72. </kDialog>
  73. <!-- 状态选择框 -->
  74. <van-popup v-model:show="busiPopShow" position="bottom">
  75. <van-picker :title="$t('taskMessage.equipmentInit.searchPop.statePlace')" :columns="tabList"
  76. :columns-field-names="busiPopFieldName" @confirm="busiPopConfirm" @cancel="busiPopShow = false" />
  77. </van-popup>
  78. </div>
  79. </template>
  80. <script>
  81. import { Toast } from "vant";
  82. import { useRouter } from "vue-router";
  83. import dateUtil from "@/utils/dateUtil";
  84. import { onMounted, reactive, ref } from "vue";
  85. import sHeader from "@/components/SimpleHeader";
  86. import { getLoginUser, styleUrl } from "@/common/js/utils";
  87. import { getTaskJoinpayMchCheckList } from "@/service/taskMessage";
  88. import kDialog from "@/components/commom/kDialog/index.vue";
  89. import kTabs from "@/components/commom/kTabs/index.vue";
  90. import { useI18n } from "vue-i18n";
  91. export default {
  92. components: { sHeader, kDialog, kTabs },
  93. setup() {
  94. // 筛选弹窗
  95. const busiPopFieldName = reactive({
  96. text: "name",
  97. value: "id",
  98. });
  99. const kDialogRef = ref(null);
  100. const busiPopShow = ref(false);
  101. const payType = ref(0); // 支付平台,0为汇聚,1为汇付;
  102. const searchForm = reactive({
  103. merchantName: "",
  104. state: "",
  105. stateName: '',
  106. });
  107. // 点击商家输入框
  108. const busiInpClk = () => {
  109. busiPopShow.value = true;
  110. };
  111. // 点击状态弹窗确定按钮
  112. const busiPopConfirm = (e) => {
  113. busiPopShow.value = false;
  114. searchForm.state = e.id;
  115. searchForm.stateName = e.name;
  116. };
  117. // 点击筛选
  118. const noticeClk = () => {
  119. kDialogRef.value.openDialog();
  120. };
  121. // 如果是点击筛选的确定按钮
  122. const isSearchConfirm = ref(false);
  123. // tab的组件
  124. const kTabsRef = ref(null);
  125. // 点击右侧按钮
  126. const confirmClk = () => {
  127. isSearchConfirm.value = true;
  128. // 如果什么筛选条件都没,要默认一个,不然会报错
  129. if (searchForm.state === '') {
  130. searchParams.type = '0';
  131. } else {
  132. searchParams.type = searchForm.state;
  133. }
  134. // 改变tab状态
  135. kTabsRef.value.chgActive(searchParams.type);
  136. searchGetList();
  137. };
  138. const { t } = useI18n();
  139. // tabs组件
  140. const tabList = ref([
  141. {
  142. name: t('taskMessage.joinpayMchCheck.convergence'),
  143. icon: "",
  144. id: 0,
  145. },
  146. {
  147. name: t('taskMessage.joinpayMchCheck.huifu'),
  148. icon: "",
  149. id: 1,
  150. },
  151. ]);
  152. // 点击tab
  153. const tabClk = (e) => {
  154. isSearchConfirm.value = false;
  155. if (!isSearchConfirm.value) {
  156. searchParams.type = e.name;
  157. searchGetList()
  158. }
  159. payType.value = e.name;
  160. console.log(e, 'e11111111')
  161. }
  162. const router = useRouter();
  163. const user = getLoginUser();
  164. const loading = ref(false); // 加载状态
  165. const error = ref(false); // 错误状态
  166. const finished = ref(false); // 结束翻页状态
  167. const alarmHistoryList = ref([]); // 列表集合
  168. const alarmHistoryTotal = ref(0); // 列表总数
  169. let searchParams = reactive({
  170. adminId: "", // 当前登录账户的id
  171. type: "0", // 类型 汇聚: 0, 杉德: 1
  172. current: 1, // 当前页
  173. size: 20, // 页大小
  174. });
  175. // 滚动加载
  176. const onLoad = () => {
  177. if (!finished.value) {
  178. searchParams.current = searchParams.current + 1;
  179. getList();
  180. }
  181. };
  182. // 查询列表
  183. const searchGetList = () => {
  184. alarmHistoryList.value = [];
  185. searchParams.current = 1;
  186. getList();
  187. };
  188. // 获取设备初始化审批列表数据
  189. const getList = async () => {
  190. searchParams.userName = searchForm.merchantName;
  191. const { data } = await getTaskJoinpayMchCheckList(
  192. Object.assign({}, searchParams)
  193. );
  194. if (data.code === "00000") {
  195. // 列表值叠加
  196. alarmHistoryList.value = alarmHistoryList.value.concat(
  197. data.data.records
  198. );
  199. alarmHistoryTotal.value = data.data.total;
  200. if (alarmHistoryList.value.length === data.data.total) {
  201. finished.value = true;
  202. }
  203. loading.value = false;
  204. } else {
  205. Toast.fail(data.message);
  206. }
  207. };
  208. // 初始化页面获取列表
  209. onMounted(async () => {
  210. // 加载样式
  211. styleUrl('taskMessage');
  212. if (user) {
  213. searchParams.adminId = user.id;
  214. searchGetList();
  215. }
  216. });
  217. const showDateTime = (date) => {
  218. return date
  219. ? dateUtil.formateDate(new Date(date), "yyyy-MM-dd hh:mm:ss")
  220. : "";
  221. };
  222. const pushInfo = (item) => {
  223. router.push({
  224. path: "taskJoinPayMchCheckInfo",
  225. query: { infoId: item.id, infoType: searchParams.type },
  226. });
  227. };
  228. return {
  229. loading,
  230. error,
  231. finished,
  232. onLoad,
  233. alarmHistoryList,
  234. alarmHistoryTotal,
  235. showDateTime,
  236. pushInfo,
  237. kDialogRef,
  238. noticeClk,
  239. confirmClk,
  240. busiInpClk,
  241. busiPopConfirm,
  242. busiPopShow,
  243. searchForm,
  244. busiPopFieldName,
  245. tabList,
  246. kTabsRef,
  247. tabClk,
  248. payType,
  249. };
  250. },
  251. };
  252. </script>
  253. <style lang="less" scoped>
  254. @import "../../../common/style/common.less";
  255. </style>