You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

819 lines
29 KiB

  1. <template>
  2. <div class="content">
  3. <!-- 搜索区域删除客服专属的订单状态筛选保留总部财务所需筛选项 -->
  4. <div class="div-card1">
  5. <el-card class="card1" style="margin-bottom: 0.5vh; min-height: 110px;">
  6. <div class="row">
  7. <div class="rowItem">
  8. <el-text style="width: 4vw;">精网号</el-text>
  9. <el-input v-model="searchData.jwcode" placeholder="请输入精网号" style="width:10vw;" clearable></el-input>
  10. </div>
  11. <div class="rowItem">
  12. <el-text style="width: 4vw;">客户姓名</el-text>
  13. <el-input v-model="searchData.name" placeholder="请输入客户姓名" style="width:10vw;" clearable></el-input>
  14. </div>
  15. <div class="rowItem">
  16. <el-text style="width: 4vw;">所属地区</el-text>
  17. <el-select v-model="searchData.market" placeholder="请选择所属地区" style="width:10vw;" clearable>
  18. <el-option v-for="item in marketList" :key="item" :label="item" :value="item"/>
  19. </el-select>
  20. </div>
  21. <!-- 总部财务不显示订单状态显示付款币种 -->
  22. <div class="rowItem">
  23. <el-text style="width: 4vw;">付款币种</el-text>
  24. <el-select v-model="searchData.paymentCurrency" placeholder="请选择付款币种" style="width: 10vw;" clearable>
  25. <el-option v-for="item in customOptions" :key="item" :label="item" :value="item"/>
  26. </el-select>
  27. </div>
  28. <div class="rowItem">
  29. <el-text style="width: 4vw;">支付方式</el-text>
  30. <el-select v-model="searchData.payType" placeholder="请选择支付方式" style="width: 10vw;" clearable>
  31. <el-option v-for="item in paytypeList" :key="item" :label="item" :value="item"/>
  32. </el-select>
  33. </div>
  34. </div>
  35. <div class="row" style="margin-top: 10px;">
  36. <div class="rowItem">
  37. <el-text style="width: 4vw;">活动名称</el-text>
  38. <el-select v-model="searchData.activity" placeholder="请选择活动方式" style="width: 10vw;" clearable>
  39. <el-option v-for="item in activityList" :key="item.id" :label="item.activityName" :value="item.id"/>
  40. </el-select>
  41. </div>
  42. <div class="rowItem">
  43. <el-text style="width: 4vw;">产品名称</el-text>
  44. <el-cascader v-model="searchData.goodsName" :options="productList" style="width: 10vw;" clearable/>
  45. </div>
  46. <div class="rowItem" style="width: 30vw">
  47. <el-text style="width: 4vw; margin-left: 0.5vw;">付款时间</el-text>
  48. <el-date-picker v-model="getTime" type="datetimerange" range-separator=""
  49. start-placeholder="起始时间" end-placeholder="结束时间" style="width: 22vw; "
  50. @change="handleDatePickerChange" :default-time="defaultTime"
  51. :disabled-date="disabledDate"/>
  52. </div>
  53. <!-- 总部财务查询/重置按钮 -->
  54. <div class="buttons">
  55. <el-button type="primary" @click="search">查询</el-button>
  56. <el-button type="success" @click="reset">重置</el-button>
  57. </div>
  58. </div>
  59. </el-card>
  60. </div>
  61. <!-- 数据展示区域仅保留总部财务的已通过/已完成标签 -->
  62. <div class="div-card2">
  63. <el-card class="card2">
  64. <div class="btns">
  65. <!-- 总部财务仅显示已通过/已完成标签 -->
  66. <div class="tabs">
  67. <el-button-group>
  68. <el-button class="btnItem"
  69. :style="{ backgroundColor: activeTab === 'pass' ? '#2741DE' : '#E5EBFE', color: activeTab === 'pass' ? 'white' : '#666' }"
  70. @click="navigateTo('pass')">
  71. 已通过
  72. </el-button>
  73. <el-button class="btnItem"
  74. :style="{ backgroundColor: activeTab === 'done' ? '#2741DE' : '#E5EBFE', color: activeTab === 'done' ? 'white' : '#666' }"
  75. @click="navigateTo('done')">
  76. 已完成
  77. </el-button>
  78. </el-button-group>
  79. </div>
  80. </div>
  81. <!-- 表格删除客服/地区财务专属列 -->
  82. <div class="table">
  83. <el-table :data="tableData" style="width: 80vw;height:54vh;" @sort-change="handleSortChange"
  84. :row-style="{ height: '60px' }" :header-cell-style="{ textAlign: 'center' }"
  85. :cell-style="{ textAlign: 'center' }">
  86. <el-table-column type="index" label="序号" width="100px" fixed="left">
  87. <template #default="scope">
  88. <span>{{ scope.$index + 1 + (pageInfo.pageNum - 1) * pageInfo.pageSize }}</span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column fixed="left" prop="jwcode" label="Homily ID" width="110px"/>
  92. <el-table-column fixed="left" prop="name" label="姓名" width="110px"/>
  93. <el-table-column prop="marketName" label="所属地区" width="80px"/>
  94. <el-table-column prop="activity" label="活动名称" width="120px" show-overflow-tooltip/>
  95. <el-table-column prop="goodsName" label="产品名称" width="120px"/>
  96. <el-table-column prop="goodNum" label="产品数量" width="130px">
  97. <template #default="scope">
  98. <span v-if="scope.row.goodsName == '金币充值'">{{ scope.row.permanentGold }}</span>
  99. <span v-else>{{ scope.row.goodNum }}</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column prop="paymentCurrency" label="付款币种" width="100px"/>
  103. <el-table-column prop="paymentAmount" label="付款金额" width="120px"/>
  104. <!-- 总部财务显示到账币种/金额/手续费 -->
  105. <el-table-column prop="receivedCurrency" label="到账币种"
  106. v-if="activeTab == 'pass' || activeTab == 'done'" width="150px"></el-table-column>
  107. <el-table-column prop="receivedAmount" label="到账金额"
  108. v-if="activeTab == 'pass' || activeTab == 'done'" width="150px">
  109. <template #default="scope">
  110. <div v-if="!scope.row.receivedAmount">
  111. <text style="color: #FA5A1E;">待补充</text>
  112. </div>
  113. </template>
  114. </el-table-column>
  115. <el-table-column prop="handlingCharge" label="手续费"
  116. v-if="activeTab == 'pass' || activeTab == 'done'" width="150px">
  117. <template #default="scope">
  118. <div v-if="!scope.row.handlingCharge == null">
  119. <text style="color: #FA5A1E;">待补充</text>
  120. </div>
  121. </template>
  122. </el-table-column>
  123. <el-table-column prop="payType" label="支付方式" width="130px"/>
  124. <el-table-column prop="payTime" label="付款时间" width="180px"/>
  125. <el-table-column prop="voucher" label="转账凭证" width="110px">
  126. <template #default="scope">
  127. <div v-if="scope.row.voucher"
  128. style="display: flex; justify-content: center; align-items: center; cursor: pointer;"
  129. @click="previewImage(scope.row.voucher)">
  130. <img :src="scope.row.voucher" alt="支付凭证" style="width: auto; height: 40px;">
  131. </div>
  132. <div v-else
  133. style="display: flex; justify-content: center; align-items: center; height: 40px;">
  134. </div>
  135. </template>
  136. </el-table-column>
  137. <el-table-column prop="submitterName" label="提交人" width="150px" show-overflow-tooltip></el-table-column>
  138. <!-- 总部财务显示审核人/到账时间 -->
  139. <el-table-column prop="auditName" label="审核人"
  140. v-if="activeTab == 'pass' || activeTab == 'done'"
  141. width="150px" show-overflow-tooltip></el-table-column>
  142. <el-table-column prop="receivedTime" label="到账时间"
  143. v-if="activeTab == 'pass' || activeTab == 'done'" width="180px"/>
  144. <el-table-column prop="remark" label="备注" width="150px" show-overflow-tooltip></el-table-column>
  145. <!-- 已完成状态显示订单状态正常/退款 -->
  146. <el-table-column prop="status" label="订单状态" v-if="activeTab == 'done'" width="150px"
  147. show-overflow-tooltip>
  148. <template #default="scope">
  149. <span v-if="scope.row.status == 6">退款</span>
  150. <span v-else>正常</span>
  151. </template>
  152. </el-table-column>
  153. <!-- 操作列仅保留总部财务的编辑功能 -->
  154. <el-table-column fixed="right" label="操作" width="120px"
  155. v-if="activeTab != 'reject'">
  156. <template #default=scope>
  157. <el-link
  158. v-if="activeTab == 'pass' && !(scope.row.status == 6 || scope.row.status == 4)"
  159. style="color: #2741DE;" @click="openEditForm(scope.row)">编辑
  160. </el-link>
  161. </template>
  162. </el-table-column>
  163. </el-table>
  164. </div>
  165. <!-- 分页组件 -->
  166. <div class="pagination">
  167. <el-pagination background :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
  168. layout="total, sizes, prev, pager, next, jumper" :total="total"
  169. @size-change="handlePagination('size', $event)"
  170. @current-change="handlePagination('page', $event)"></el-pagination>
  171. </div>
  172. </el-card>
  173. </div>
  174. <!-- 编辑填手续费弹窗 -->
  175. <el-dialog class="editdialog" v-model="editFormisible" width="20vw" :before-close="closeEditForm">
  176. <div class="content">
  177. <div class="left">
  178. <el-form class="editForm" label-width="4.5vw" label-position="left">
  179. <el-form-item label="精网号">
  180. <el-input disabled="true" v-model="editFormData.jwcode" placeholder="请输入驳回理由"/>
  181. </el-form-item>
  182. <el-form-item label="客户姓名">
  183. <el-input disabled="true" v-model="editFormData.name" placeholder="请输入客户姓名"/>
  184. </el-form-item>
  185. <el-form-item label="所属地区">
  186. <el-input disabled="true" v-model="editFormData.marketName" placeholder="请输入所属地区"/>
  187. </el-form-item>
  188. <el-form-item label="活动名称">
  189. <el-input disabled="true" v-model="editFormData.activity" placeholder="请输入活动名称"/>
  190. </el-form-item>
  191. <el-form-item label="产品名称">
  192. <el-select disabled="true" v-model="editFormData.goodsName" placeholder="请选择产品名称"
  193. clearable></el-select>
  194. </el-form-item>
  195. <el-form-item v-show="!isEditGold" label="产品数量">
  196. <div style="padding-right: 50px; display: flex;">
  197. <el-input disabled="true" style="padding-right: 10px;" v-model="editFormData.goodNum"
  198. placeholder="请输入产品数量"/>
  199. <span style="color: #999999;"></span>
  200. </div>
  201. </el-form-item>
  202. <div v-show="isEditGold" style="margin-bottom: 15px; display: flex;">
  203. <div style=" display: flex; ">
  204. <span style="color: #999999; display: flex; white-space: nowrap;align-items: center;">永久金币</span>
  205. <el-input disabled="true"
  206. style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;"
  207. v-model="editFormData.permanentGold"/>
  208. </div>
  209. <div style="padding-right: 5px; display: flex;">
  210. <span style="color: #999999; display: flex; white-space: nowrap;align-items: center;">免费金币</span>
  211. <el-input disabled="true"
  212. style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;"
  213. v-model="editFormData.freeGold"/>
  214. </div>
  215. </div>
  216. <el-form-item label="付款币种">
  217. <CurrencySelect :disabled="!ifOnline" v-model="editFormData.paymentCurrency"
  218. :items="customOptions" placeholder="请选择付款币种"/>
  219. </el-form-item>
  220. <el-form-item label="付款金额">
  221. <el-input :disabled="!ifOnline" v-model="editFormData.paymentAmount"
  222. placeholder="请输入付款金额"/>
  223. </el-form-item>
  224. <el-form-item label="支付方式">
  225. <el-select disabled="true" v-model="editFormData.payType" placeholder="请选择支付方式"
  226. clearable></el-select>
  227. </el-form-item>
  228. <el-form-item label="到账地区">
  229. <el-select disabled="true" v-model="editFormData.receivedMarket" placeholder="请选择到账地区"
  230. clearable></el-select>
  231. </el-form-item>
  232. <el-form-item label="付款时间">
  233. <el-date-picker disabled="true" type="datetime" v-model="editFormData.payTime"
  234. placeholder="请选择付款时间"/>
  235. </el-form-item>
  236. <el-form-item label="转账凭证">
  237. <div class="pic">
  238. <el-upload disabled="true" ref="uploadRef" class="uploader" :show-file-list="false"
  239. list-type="picture-card" :auto-upload="false" :before-upload="beforeUpload"
  240. :on-error="handelImgErr" :on-change="handleImageChange"
  241. :http-request="customUpload">
  242. <img v-if="editFormData.voucher" :src="editFormData.voucher" class="avatar"
  243. style="height: 100%; width: 100%; object-fit: cover;"/>
  244. <el-icon v-else class="avatar-uploader-icon">
  245. <Plus/>
  246. </el-icon>
  247. </el-upload>
  248. <el-text class="picText">
  249. 仅支持.jpg .png格式文件 1 MB
  250. </el-text>
  251. </div>
  252. </el-form-item>
  253. <el-form-item label="备注">
  254. <el-input disabled="true" v-model="editFormData.remark" type="textarea" :rows="4"
  255. placeholder="请输入驳回理由" maxlength="100" show-word-limit/>
  256. </el-form-item>
  257. </el-form>
  258. </div>
  259. <div class="right">
  260. <el-form ref="editFormRef" :rules="editFormRule" :model="editFormData" class="editFormRight"
  261. label-width="4.5vw" label-position="left">
  262. <el-form-item label="到账货币">
  263. <CurrencySelect v-model="editFormData.receivedCurrency" :items="customOptions"
  264. placeholder="请选择到账货币"/>
  265. </el-form-item>
  266. <el-form-item label="到账金额" prop="receivedAmount">
  267. <el-input v-model="editFormData.receivedAmount" placeholder="请输入到账金额"/>
  268. </el-form-item>
  269. <el-form-item label="手续费" prop="handlingCharge">
  270. <el-input v-model="editFormData.handlingCharge" placeholder="请输入手续费"/>
  271. </el-form-item>
  272. <el-form-item label="到账时间">
  273. <el-date-picker type="datetime" v-model="editFormData.receivedTime" placeholder="请输入到账时间"/>
  274. </el-form-item>
  275. </el-form>
  276. <span class="editBtns">
  277. <button class="editBtn1" @click="closeEditForm">
  278. <text class="txt">取消</text>
  279. </button>
  280. <button class="editBtn2" @click="throttledsubmitEditForm">
  281. <text class="txt">提交</text>
  282. </button>
  283. </span>
  284. </div>
  285. </div>
  286. </el-dialog>
  287. <!-- 查看驳回理由弹窗 -->
  288. <el-dialog v-model="showRejectReasonDialog" title="驳回理由" width="30vw" :before-close="closeRejectReasonDialog">
  289. <el-form label-width="80px">
  290. <el-form-item label="驳回原因">
  291. <el-input type="textarea" v-model="rejectReasonContent" disabled :rows="5" placeholder="无驳回理由"/>
  292. </el-form-item>
  293. </el-form>
  294. <template #footer>
  295. <span class="dialog-footer">
  296. <el-button @click="closeRejectReasonDialog">确认</el-button>
  297. </span>
  298. </template>
  299. </el-dialog>
  300. </div>
  301. </template>
  302. <script setup>
  303. import {ref, onMounted} from 'vue';
  304. import {storeToRefs} from 'pinia';
  305. import {ElMessage, ElMessageBox} from 'element-plus'
  306. import API from '@/util/http.js'
  307. import request from '@/util/http.js'
  308. import moment from 'moment'
  309. import {useAdminStore} from '@/store/index.js'
  310. import {hasMenuPermission} from '@/utils/menuTreePermission.js'
  311. import _ from 'lodash'
  312. import {editFormRule} from './utils/recriveFormRules.js'
  313. import {productList, MarketNameForId, CurrencyForId, marketList} from './utils/staticData.js'
  314. import CurrencySelect from '@/components/MoneyManage/CurrencySelect.vue'
  315. import {Plus} from '@element-plus/icons-vue';
  316. // 状态管理
  317. const adminStore = useAdminStore();
  318. const {menuTree} = storeToRefs(adminStore);
  319. const tableData = ref([])
  320. const searchData = ref({})
  321. const defaultTime = [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]
  322. const getTime = ref([])
  323. const activeTab = ref('pass')
  324. const HQcaiwu = ref(true)
  325. const superAdmin = ref(false)
  326. const editFormData = ref({})
  327. const ifOnline = ref(false)
  328. const editFormisible = ref(false)
  329. const editFormRef = ref(null)
  330. const isEditGold = ref(false)
  331. const showRejectReasonDialog = ref(false)
  332. const rejectReasonContent = ref('')
  333. const pageInfo = ref({pageSize: 10, pageNum: 1})
  334. const total = ref(0)
  335. const uploadRef = ref()
  336. const customOptions = ref(['美元(USD)', '港币(HKD)', '新币(SGD)', '马币(MYR)', '泰铢(THB)', '加币(CAD)', '越南盾(VDN)', '韩元(KRW)'])
  337. const paytypeList = ref(["Stripe-链接收款", "PaymentAsia-链接收款", "Ipay88-链接收款", "银行转账", "刷卡", "现金", "支票", "Grabpay", "Nets", "E-Transfer", "Paypal"])
  338. const activityList = ref([])
  339. const adminData = ref({})
  340. // 核心方法
  341. const search = () => {
  342. getlist()
  343. ElMessage.success('查询成功')
  344. }
  345. const reset = () => {
  346. searchData.value = {}
  347. getTime.value = []
  348. pageInfo.value.pageNum = 1
  349. getlist()
  350. }
  351. const getlist = async () => {
  352. try {
  353. let payCurrencySelect = ''
  354. let goodsName = ''
  355. if (getTime.value && getTime.value.length === 2) {
  356. searchData.value.startTime = moment(getTime.value[0]).format('YYYY-MM-DD HH:mm:ss')
  357. searchData.value.endTime = moment(getTime.value[1]).format('YYYY-MM-DD HH:mm:ss')
  358. } else {
  359. searchData.value.startTime = ''
  360. searchData.value.endTime = ''
  361. }
  362. if (searchData.value.goodsName) {
  363. goodsName = searchData.value.goodsName[searchData.value.goodsName.length - 1]
  364. }
  365. if (searchData.value.paymentCurrency) {
  366. payCurrencySelect = CurrencyForId(searchData.value.paymentCurrency)
  367. }
  368. const cashRoleId = '2'
  369. if (activeTab.value === 'pass') {
  370. searchData.value.status = 13
  371. } else if (activeTab.value === 'done') {
  372. searchData.value.status = 46
  373. }
  374. const result = await request({
  375. url: '/cashCollection/selectCollection',
  376. data: {
  377. ...pageInfo.value,
  378. cashCollection: {
  379. ...searchData.value,
  380. submitterId: adminData.value.id,
  381. receivedMarket: MarketNameForId(adminData.value.markets),
  382. cashRoleId: cashRoleId,
  383. paymentCurrency: payCurrencySelect,
  384. submitterMarket: adminData.value.markets,
  385. goodsName: goodsName,
  386. market: MarketNameForId(searchData.value.market)
  387. }
  388. }
  389. })
  390. if (result.code === 200) {
  391. tableData.value = result.data.list
  392. total.value = result.data.total
  393. } else {
  394. ElMessage.error('数据异常')
  395. }
  396. } catch (error) {
  397. console.log(error);
  398. }
  399. }
  400. const navigateTo = async (tab) => {
  401. if (tab === 'pass') {
  402. activeTab.value = 'pass'
  403. await getlist()
  404. } else if (tab === 'done') {
  405. activeTab.value = 'done'
  406. await getlist()
  407. }
  408. }
  409. const EditifGold = () => {
  410. isEditGold.value = editFormData.value.goodsName === '金币充值'
  411. }
  412. const openEditForm = (row) => {
  413. editFormData.value = {...row}
  414. EditifGold()
  415. ifOnline.value = row.status === 3
  416. editFormisible.value = true
  417. }
  418. const closeEditForm = () => {
  419. editFormisible.value = false
  420. editFormData.value = {}
  421. getlist()
  422. }
  423. const submitEditForm = async () => {
  424. try {
  425. await editFormRef.value.validate();
  426. if (editFormData.value.receivedTime) {
  427. editFormData.value.receivedTime = moment(editFormData.value.receivedTime).format('YYYY-MM-DD HH:mm:ss')
  428. }
  429. const result = await request({
  430. url: '/cashCollection/complete',
  431. data: {
  432. orderCode: editFormData.value.orderCode,
  433. handlingCharge: editFormData.value.handlingCharge * 100,
  434. paymentCurrency: CurrencyForId(editFormData.value.paymentCurrency),
  435. paymentAmount: editFormData.value.paymentAmount * 100,
  436. receivedCurrency: CurrencyForId(editFormData.value.receivedCurrency),
  437. receivedAmount: editFormData.value.receivedAmount * 100,
  438. receivedTime: editFormData.value.receivedTime,
  439. receivedRemark: editFormData.value.receivedRemark,
  440. }
  441. })
  442. if (result.code === 200) {
  443. ElMessage.success('提交成功')
  444. getlist()
  445. closeEditForm()
  446. }
  447. } catch (error) {
  448. ElMessage.error('请检查表单数据格式');
  449. }
  450. }
  451. const openRejectReason = (reason) => {
  452. rejectReasonContent.value = reason || '无驳回理由'
  453. showRejectReasonDialog.value = true
  454. }
  455. const closeRejectReasonDialog = () => {
  456. showRejectReasonDialog.value = false
  457. rejectReasonContent.value = ''
  458. }
  459. const previewImage = (imageUrl) => {
  460. const imageElement = document.createElement('img');
  461. imageElement.src = imageUrl;
  462. imageElement.style.maxWidth = '80vw';
  463. imageElement.style.maxHeight = '80vh';
  464. const viewer = document.createElement('div');
  465. viewer.style.position = 'fixed';
  466. viewer.style.top = '0';
  467. viewer.style.left = '0';
  468. viewer.style.width = '100vw';
  469. viewer.style.height = '100vh';
  470. viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  471. viewer.style.display = 'flex';
  472. viewer.style.justifyContent = 'center';
  473. viewer.style.alignItems = 'center';
  474. viewer.style.zIndex = '9999';
  475. viewer.style.overflow = 'auto';
  476. viewer.appendChild(imageElement);
  477. document.body.appendChild(viewer);
  478. viewer.addEventListener('click', () => {
  479. document.body.removeChild(viewer);
  480. });
  481. }
  482. const handlePagination = (type, val) => {
  483. if (type === 'size') {
  484. pageInfo.value.pageSize = val
  485. } else {
  486. pageInfo.value.pageNum = val
  487. }
  488. getlist()
  489. }
  490. const beforeUpload = (rawFile) => {
  491. if (rawFile.type !== 'image/jpeg' && rawFile.type !== 'image/png') {
  492. ElMessage.error('图片必须是jpg或png类型!')
  493. return false
  494. } else if (rawFile.size / 1024 / 1024 > 2) {
  495. ElMessage.error('图片大小不能超过 2MB!')
  496. return false
  497. }
  498. return true
  499. }
  500. const handelImgErr = (err) => {
  501. ElMessage.error("图片加载失败")
  502. }
  503. const handleImageChange = (file) => {
  504. uploadRef.value.submit()
  505. }
  506. const customUpload = async (options) => {
  507. try {
  508. const formData = new FormData()
  509. formData.append('file', options.file)
  510. const response = await API({
  511. url: 'https://api.homilychart.com/hljw/api/aws/upload',
  512. method: 'POST',
  513. data: formData,
  514. headers: {
  515. 'Content-Type': 'multipart/form-data'
  516. }
  517. })
  518. if (response.code === 200 && response.data) {
  519. ElMessage.success('上传成功')
  520. } else {
  521. options.onError(response)
  522. ElMessage.error(response.msg || '上传失败')
  523. }
  524. } catch (error) {
  525. ElMessage.error(`上传失败: ${error.msg || error.message || '网络异常'}`)
  526. }
  527. }
  528. const getAdminData = async function () {
  529. try {
  530. const result = await API({
  531. url: '/admin/userinfo',
  532. data: {}
  533. })
  534. adminData.value = result
  535. } catch (error) {
  536. console.log('管理员信息获取失败', error)
  537. }
  538. }
  539. const getActivitys = async function () {
  540. try {
  541. const result = await API({
  542. url: '/cashCollection/getActivityList',
  543. data: {}
  544. })
  545. if (result.code === 200) {
  546. activityList.value = result.data
  547. } else {
  548. ElMessage.error('活动列表获取失败')
  549. }
  550. } catch (error) {
  551. console.log('活动列表请求失败', error)
  552. }
  553. }
  554. const throttledsubmitEditForm = _.throttle(submitEditForm, 5000, {
  555. trailing: false
  556. })
  557. onMounted(async function () {
  558. await getAdminData()
  559. await getActivitys()
  560. if (adminData.value.roleId === 2) {
  561. superAdmin.value = true
  562. }
  563. await getlist()
  564. })
  565. // 未使用方法占位
  566. const handleSortChange = () => {}
  567. const handleDatePickerChange = () => {}
  568. const disabledDate = () => {}
  569. </script>
  570. <style scoped lang="scss">
  571. .content {
  572. height: 100%;
  573. width: 80vw;
  574. .card1 {
  575. background: #F3FAFE;
  576. width: 100%;
  577. .row {
  578. height: 4vh;
  579. width: 80vw;
  580. display: flex;
  581. min-height: 40px;
  582. .rowItem {
  583. display: flex;
  584. width: 15vw;
  585. align-items: center;
  586. justify-content: center;
  587. margin-right: 0.5vw;
  588. }
  589. .buttons {
  590. display: flex;
  591. justify-content: center;
  592. align-items: center;
  593. margin-left: 10px;
  594. }
  595. }
  596. }
  597. .div-card2 {
  598. width: 100%;
  599. margin-top: 2vh;
  600. .card2 {
  601. background: #E7F4FD;
  602. }
  603. .btns {
  604. display: flex;
  605. align-items: center;
  606. justify-content: space-between;
  607. padding-bottom: 10px;
  608. .tabs {
  609. min-width: 300px;
  610. .btnItem {
  611. margin-left: 10px;
  612. border-radius: 5px;
  613. }
  614. }
  615. }
  616. .table {
  617. margin: 10px;
  618. border-radius: 20px;
  619. .ellipsis-container {
  620. position: relative;
  621. width: 100%;
  622. .ellipsis-text {
  623. display: inline-block;
  624. width: 100%;
  625. white-space: nowrap;
  626. overflow: hidden;
  627. text-overflow: ellipsis;
  628. cursor: pointer;
  629. }
  630. .custom-tooltip {
  631. position: fixed;
  632. z-index: 9999;
  633. padding: 8px 12px;
  634. width: 200px;
  635. background-color: #E4F0FC;
  636. color: #333333;
  637. border: 1px solid #e5e7eb;
  638. border-radius: 4px;
  639. box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  640. min-height: 30px;
  641. max-height: 300px;
  642. overflow-y: auto;
  643. font-size: 14px;
  644. line-height: 1.5;
  645. }
  646. }
  647. }
  648. .pagination {
  649. margin-top: 10px;
  650. padding: 10px 10px;
  651. }
  652. }
  653. :deep(.editdialog) {
  654. min-width: 990px;
  655. background-color: #F3FAFE !important;
  656. margin-top: 8vh;
  657. border-radius: 8px;
  658. .content {
  659. display: flex;
  660. height: 100%;
  661. width: 100%;
  662. .left {
  663. min-width: 500px;
  664. }
  665. .right {
  666. flex: 1;
  667. .editFormRight {
  668. padding: 0 60px 0 40px;
  669. .el-date-editor {
  670. display: flex;
  671. flex: 1;
  672. }
  673. }
  674. .editBtns {
  675. display: flex;
  676. justify-content: center;
  677. margin-top: 60px;
  678. .txt {
  679. color: #f3fafe;
  680. text-align: center;
  681. font-family: "PingFang SC";
  682. font-size: 14px;
  683. font-style: normal;
  684. font-weight: 700;
  685. line-height: 22px;
  686. }
  687. .editBtn1 {
  688. min-width: 80px;
  689. padding: 5px 12px;
  690. justify-content: center;
  691. align-items: center;
  692. gap: 4px;
  693. border-radius: 4px;
  694. background: #7E91FF;
  695. border: none;
  696. box-shadow: 0 0 4px 0 #00000040;
  697. }
  698. .editBtn2 {
  699. display: flex;
  700. width: 80px;
  701. min-width: 80px;
  702. padding: 5px 12px;
  703. justify-content: center;
  704. align-items: center;
  705. gap: 4px;
  706. border-radius: 4px;
  707. background: #2741DE;
  708. border: none;
  709. box-shadow: 0 0 4px 0 #00000040;
  710. margin-left: 60px;
  711. }
  712. }
  713. }
  714. }
  715. .editForm {
  716. padding: 0 60px 1vh 60px;
  717. .el-date-editor {
  718. display: flex;
  719. flex: 1;
  720. }
  721. .pic {
  722. display: flex;
  723. align-items: center;
  724. .uploader {
  725. height: 80px;
  726. width: 80px;
  727. .el-upload {
  728. height: 100%;
  729. width: 100%;
  730. }
  731. }
  732. .picText {
  733. color: #999999;
  734. font-family: "PingFang SC";
  735. font-size: 10px;
  736. font-style: normal;
  737. font-weight: 400;
  738. line-height: 20px;
  739. margin-left: 10px;
  740. }
  741. }
  742. }
  743. }
  744. :deep(.el-table__header-wrapper),
  745. :deep(.el-table__body-wrapper),
  746. :deep(.el-table__cell),
  747. :deep(.el-table__body td) {
  748. background-color: #F3FAFE !important;
  749. }
  750. :deep(.el-table__header th) {
  751. background-color: #F3FAFE !important;
  752. }
  753. :deep(.el-table__row:hover > .el-table__cell) {
  754. background-color: #E5EBFE !important;
  755. }
  756. .reject-reason-box {
  757. --el-message-box-height: 500px;
  758. }
  759. .reject-reason-box .el-message-box__content {
  760. max-height: 350px;
  761. overflow-y: auto;
  762. white-space: pre-wrap;
  763. }
  764. }
  765. </style>