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.

1073 lines
37 KiB

1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
2 months ago
1 month ago
2 months ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 weeks ago
1 month ago
2 months ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
2 weeks ago
2 months ago
1 month ago
2 months ago
2 weeks ago
2 months ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
1 month ago
1 month ago
1 month ago
2 weeks ago
1 month ago
2 months ago
2 months ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
1 month ago
2 months ago
2 months ago
1 month ago
2 months ago
2 weeks ago
1 month ago
2 months ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
4 weeks ago
2 months ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
1 month ago
1 month ago
2 months ago
1 month ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
1 month ago
2 months ago
1 month ago
4 weeks ago
2 months ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
1 month ago
2 months ago
4 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
4 weeks ago
1 month ago
1 month ago
1 month ago
2 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
1 month ago
1 month ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
  1. <!-- 各地财务 -->
  2. <template>
  3. <el-card style="margin-bottom: 0.5vh;background-color: rgb(243,250,254);">
  4. <div class="condition">
  5. <div class="item1">
  6. <el-text size="large" style="width:4vw;">精网号</el-text>
  7. <el-input v-model="searchForm.jwcode" placeholder="请输入精网号" style="width:9vw;" clearable />
  8. </div>
  9. <div class="item1">
  10. <el-text size="large" style="width:4vw;">客户姓名</el-text>
  11. <el-input v-model="searchForm.name" placeholder="请输入客户姓名" style="width:9vw;" clearable />
  12. </div>
  13. <div class="item1">
  14. <el-text size="large" style="width:4vw;">所属地区</el-text>
  15. <el-cascader style="width: 9vw;" v-model="searchForm.markets" :options="market" placeholder="请选择所属地区"
  16. clearable @change="handleMarketChange" />
  17. </div>
  18. <div class="item1">
  19. <el-text size="large" style="width:4vw;">产品名称</el-text>
  20. <el-cascader v-model="searchForm.goodsName" :options="productList" style="width: 10vw;" clearable />
  21. </div>
  22. <div class="item1">
  23. <el-text size="large" style="width:4vw;">订单状态</el-text>
  24. <el-select v-model="searchForm.statuses" style="width:9vw;" clearable>
  25. <el-option v-for="item in statusList" :label="item" :value="item" :key="item" />
  26. </el-select>
  27. </div>
  28. </div>
  29. <div class="condition">
  30. <div class="item2">
  31. <el-text size="large" style="width:4vw;">付款币种</el-text>
  32. <el-select v-model="searchForm.paymentCurrency" style="width:9vw;" clearable>
  33. <el-option v-for="item in currencies" :key="item.value" :label="item.label" :value="item.value" />
  34. </el-select>
  35. </div>
  36. <div class="item2">
  37. <el-text size="large" style="width:4vw;">支付方式</el-text>
  38. <el-select v-model="searchForm.payType" style="width:9vw;" clearable>
  39. <el-option v-for="item in channelOptions" :key="item.value" :label="item.label"
  40. :value="item.value" />
  41. </el-select>
  42. </div>
  43. <div class="item2" style="width: 28.5vw;">
  44. <el-text size="large" style="width:4vw;">付款时间</el-text>
  45. <el-date-picker v-model="dateRange" type="datetimerange" range-separator="" start-placeholder="起始时间"
  46. end-placeholder="结束时间" style="width:22vw;" @change="handleDatePickerChange" clearable
  47. :disabled-date="disabledDate" :default-time="defaultTime" />
  48. </div>
  49. <div>
  50. <el-button type="primary" @click="getRefund">查询</el-button>
  51. <el-button type="warning" @click="exportExcel()">导出excel</el-button>
  52. <el-button type="primary" @click="openExportList">查看导出列表</el-button>
  53. <el-button type="success" @click="reset">重置</el-button>
  54. </div>
  55. </div>
  56. </el-card>
  57. <el-card style="margin-top: 0.5vh;background-color: rgb(231,244,253);">
  58. <el-table :data="tableData" style="height:64vh;width:82vw">
  59. <el-table-column type="index" label="序号" width="60" fixed="left" />
  60. <el-table-column prop="jwcode" label="Homily ID" width="120" fixed="left" />
  61. <el-table-column prop="name" label="姓名" width="120" fixed="left" show-overflow-tooltip />
  62. <el-table-column prop="marketName" label="所属地区" width="120" />
  63. <el-table-column prop="goodsName" label="产品名称" width="130" show-overflow-tooltip />
  64. <el-table-column prop="goodsNum" label="产品数量" width="120" />
  65. <el-table-column prop="refundModel" label="退款方式" width="120">
  66. <template #default="scope">
  67. {{ scope.row.refundModel === 1 ? '部分退款' : '全部退款' }}
  68. </template>
  69. </el-table-column>
  70. <el-table-column prop="submitter" label="提交人" width="120" />
  71. <el-table-column prop="refundReason" label="退款理由" width="120" show-overflow-tooltip />
  72. <el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip />
  73. <el-table-column prop="status" label="订单状态" width="120">
  74. <template #default="scope">
  75. {{
  76. [10].includes(scope.row.status) ? '待审核' :
  77. [20, 30, 40].includes(scope.row.status) ? '审核通过' :
  78. [12, 22, 32].includes(scope.row.status) ? '已驳回' :
  79. [41].includes(scope.row.status) ? '退款成功' : scope.row.status
  80. }}
  81. </template>
  82. </el-table-column>
  83. <el-table-column prop="operation" label="操作" fixed="right" width="100px">
  84. <template #default="scope">
  85. <div class="operation">
  86. <el-button v-if="scope.row.status === 10" type="primary" text @click="showAudit2(scope.row)">
  87. 审核
  88. </el-button>
  89. <el-button v-else type="primary" text @click="showStep(scope.row)">
  90. 查看进度
  91. </el-button>
  92. </div>
  93. </template>
  94. </el-table-column>
  95. </el-table>
  96. <el-pagination v-model:current-page="pagination.pageNum" v-model:page-size="pagination.pageSize"
  97. layout="total, sizes, prev, pager, next, jumper" :total="pagination.total"
  98. @size-change="handlePageSizeChange" @current-change="handleCurrentChange"
  99. style="margin-top: 1vh;"></el-pagination>
  100. </el-card>
  101. <el-dialog v-model="showAudit" title="审核" class="audit" width="35vw" overflow draggable>
  102. <div class="top">
  103. <el-button @click="" class="smallTitle" size="small">退款申请信息</el-button>
  104. <div class="top-item">
  105. <el-text style="width:4vw;" size="small">退款方式</el-text>
  106. <el-select v-model="auditRow.refundModel" size="small" style="width:10vw;" disabled>
  107. <el-option label="全部退款" :value="0"></el-option>
  108. <el-option label="部分退款" :value="1"></el-option>
  109. </el-select>
  110. </div>
  111. <div class="top-item">
  112. <el-text style="width:4vw;" size="small">退款理由</el-text>
  113. <el-input v-model="auditRow.refundReason" size="small" style="width:10vw;" :rows="3" maxlength="100"
  114. show-word-limit type="textarea" disabled />
  115. </div>
  116. </div>
  117. <el-button @click="" class="smallTitle" size="small">原订单信息</el-button>
  118. <div class="center">
  119. <div class="center-left">
  120. <div class="center-item">
  121. <el-text style="width:4vw;" size="small">精网号</el-text>
  122. <el-input v-model="auditRow.jwcode" size="small" style="width:10vw;" disabled />
  123. </div>
  124. <div class="center-item">
  125. <el-text style="width:4vw;" size="small">所属地区</el-text>
  126. <el-input v-model="auditRow.marketName" size="small" style="width:10vw;" disabled />
  127. </div>
  128. <div class="center-item">
  129. <el-text style="width:4vw;" size="small">产品名称</el-text>
  130. <el-input v-model="auditRow.goodsName" size="small" style="width:10vw;" disabled />
  131. </div>
  132. <div class="center-item">
  133. <el-text style="width:4vw;" size="small">付款金额</el-text>
  134. <el-input v-model="auditRow.paymentAmount" size="small" style="width:10vw;" disabled />
  135. </div>
  136. <div class="center-item">
  137. <el-text style="width:4vw;" size="small">到账金额</el-text>
  138. <el-input v-model="auditRow.receivedAmount" size="small" style="width:10vw;" disabled />
  139. </div>
  140. <div class="center-item">
  141. <el-text style="width:4vw;" size="small">支付方式</el-text>
  142. <el-input v-model="auditRow.payType" size="small" style="width:10vw;" disabled />
  143. </div>
  144. <div class="center-item">
  145. <el-text style="width:4vw;">转账凭证</el-text>
  146. <img v-if="auditRow.voucher" :src="auditRow.voucher"
  147. style="width: 80px; height: 80px; object-fit: cover;">
  148. <div v-else>
  149. 无转账凭证
  150. </div>
  151. </div>
  152. </div>
  153. <div class="center-right">
  154. <div class="right-item">
  155. <el-text style="width:4vw;" size="small">客户姓名</el-text>
  156. <el-input v-model="auditRow.name" size="small" style="width:10vw;" disabled />
  157. </div>
  158. <div class="right-item">
  159. <el-text style="width:4vw;" size="small">活动名称</el-text>
  160. <el-input v-model="auditRow.activity" size="small" style="width:10vw;" disabled />
  161. </div>
  162. <div class="right-item">
  163. <el-text style="width:4vw;" size="small">付款币种</el-text>
  164. <el-input v-model="auditRow.paymentCurrency" size="small" style="width:10vw;" disabled />
  165. </div>
  166. <div class="right-item">
  167. <el-text style="width:4vw;" size="small">到账币种</el-text>
  168. <el-input v-model="auditRow.receivedCurrency" size="small" style="width:10vw;" disabled />
  169. </div>
  170. <div class="right-item">
  171. <el-text style="width:4vw;" size="small">手续费</el-text>
  172. <el-input v-model="auditRow.handlingCharge" size="small" style="width:10vw;" disabled />
  173. </div>
  174. <div class="right-item">
  175. <el-text style="width:4vw;" size="small">付款时间</el-text>
  176. <el-input v-model="auditRow.payTime" size="small" style="width:10vw;" disabled />
  177. </div>
  178. <div class="right-item">
  179. <el-text style="width:4vw;" size="small">提交人</el-text>
  180. <el-input v-model="auditRow.submitter" size="small" style="width:10vw;" disabled />
  181. </div>
  182. <div class="right-item">
  183. <el-text style="width:4vw;" size="small">到账时间</el-text>
  184. <el-input v-model="auditRow.receivedTime" size="small" style="width:10vw;" disabled />
  185. </div>
  186. <div class="right-item">
  187. <el-text style="width:4vw;" size="small">备注</el-text>
  188. <el-input v-model="auditRow.remark" size="small" style="width:10vw;" :row="3" maxlength="100"
  189. type="textarea" show-word-limit disabled />
  190. </div>
  191. </div>
  192. </div>
  193. <div class="bottom">
  194. <el-button class="smallTitle" size="small" v-show="showReject">驳回信息</el-button>
  195. <div class="bottom-item" v-show="showReject">
  196. <el-text style="width:4vw;" size="small">驳回备注</el-text>
  197. <el-input v-model="addForm.remark" placeholder="请输入驳回备注" size="small" style="width:10vw;" :row="3"
  198. maxlength="100" type="textarea" show-word-limit clearable />
  199. </div>
  200. <div style="text-align: center;" v-show="!showReject">
  201. <el-button type="default" @click="showReject = true">驳回</el-button>
  202. <el-button type="primary" @click="handlePass">通过</el-button>
  203. </div>
  204. <div style="text-align: center;" v-show="showReject">
  205. <el-button type="default" @click="hideReject">取消</el-button>
  206. <el-button type="primary" @click="handleReject">确定</el-button>
  207. </div>
  208. </div>
  209. </el-dialog>
  210. <el-dialog v-model="showSteps" title="退款进度" overflow draggable width="1206px" height="506px" :style="{
  211. backgroundImage: `url(${RefundFinanceBackground})`,
  212. backgroundSize: 'cover',
  213. backgroundPosition: 'center'
  214. }">
  215. <div class="steps">
  216. <div class="steps-content">
  217. <el-steps :active="currentStep" align-center>
  218. <el-step>
  219. <template #title>
  220. <div>
  221. 提交人<br>{{ submitter || '未知提交人' }}
  222. </div>
  223. </template>
  224. <template #icon>
  225. <img src="@/assets/images/refund-approved.png" alt="已完成">
  226. </template>
  227. </el-step>
  228. <el-step>
  229. <template #title>
  230. <div>
  231. 地区财务<br>{{ areaFinance || '未记录审核人' }}
  232. </div>
  233. </template>
  234. <template #icon>
  235. <img v-if="currentStep === 2" src="@/assets/images/refund-rejected.png" alt="已驳回">
  236. <img v-else-if="currentStep === 1" src="@/assets/images/refund-approving.png" alt="待审核">
  237. <img v-else-if="currentStep > 2" src="@/assets/images/refund-approved.png" alt="已审核">
  238. </template>
  239. </el-step>
  240. <el-step>
  241. <template #title>
  242. <div>
  243. 地区负责人<br>{{ areaCharge || '未记录审核人' }}
  244. </div>
  245. </template>
  246. <template #icon>
  247. <img v-if="currentStep === 4" src="@/assets/images/refund-rejected.png" alt="已驳回">
  248. <img v-else-if="currentStep === 3" src="@/assets/images/refund-approving.png" alt="待审核">
  249. <img v-else-if="currentStep > 3 && currentStep != 4" src="@/assets/images/refund-approved.png" alt="已审核">
  250. <img v-else-if="currentStep < 3" src="@/assets/images/refund-waiting.png" alt="未开始">
  251. </template>
  252. </el-step>
  253. <el-step>
  254. <template #title>
  255. <div>
  256. 总部财务<br>{{ headFinance || '未记录审核人' }}
  257. </div>
  258. </template>
  259. <template #icon>
  260. <img v-if="currentStep === 6" src="@/assets/images/refund-rejected.png" alt="已驳回">
  261. <img v-else-if="currentStep === 5" src="@/assets/images/refund-approving.png" alt="待审核">
  262. <img v-else-if="currentStep > 5 && currentStep != 6" src="@/assets/images/refund-approved.png" alt="已审核">
  263. <img v-else-if="currentStep < 5" src="@/assets/images/refund-waiting.png" alt="未开始">
  264. </template>
  265. </el-step>
  266. <el-step>
  267. <template #title>
  268. <div>
  269. 指定执行人<br>{{ executor || '未记录执行人' }}
  270. </div>
  271. </template>
  272. <template #icon>
  273. <img v-if="currentStep === 7" src="@/assets/images/refund-approving.png" alt="待处理">
  274. <img v-else-if="currentStep === 8" src="@/assets/images/refund-approved.png" alt="已完成">
  275. <img v-else-if="currentStep < 7" src="@/assets/images/refund-waiting.png" alt="未开始">
  276. </template>
  277. </el-step>
  278. </el-steps>
  279. </div>
  280. <div class="steps-btn">
  281. <el-button type="primary" @click="showSteps = false">确定</el-button>
  282. </div>
  283. </div>
  284. </el-dialog>
  285. <el-dialog v-model="exportListVisible" title="导出列表" width="80%">
  286. <el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading">
  287. <el-table-column prop="fileName" label="文件名" />
  288. <el-table-column prop="state" label="状态">
  289. <template #default="scope">
  290. <el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
  291. {{ getTagText(scope.row.state) }}
  292. </el-tag>
  293. </template>
  294. </el-table-column>
  295. <el-table-column prop="createTime" label="创建时间">
  296. <template #default="scope">
  297. {{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
  298. </template>
  299. </el-table-column>
  300. <el-table-column label="操作">
  301. <template #default="scope">
  302. <el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
  303. :disabled="scope.row.state !== 2">
  304. 下载
  305. </el-button>
  306. </template>
  307. </el-table-column>
  308. </el-table>
  309. <template #footer>
  310. <div class="dialog-footer">
  311. <el-button text @click="exportListVisible = false">关闭</el-button>
  312. </div>
  313. </template>
  314. </el-dialog>
  315. </template>
  316. <script setup>
  317. import { ref, onMounted } from 'vue'
  318. import { ElMessage } from 'element-plus'
  319. import API from '@/util/http.js'
  320. const uploadUrl = 'https://api.homilychart.com/hljw/api/aws/upload'
  321. import { useAdminStore } from "@/store/index.js"
  322. import { storeToRefs } from "pinia"
  323. import dayjs from 'dayjs'
  324. const adminStore = useAdminStore()
  325. const { adminData, menuTree } = storeToRefs(adminStore)
  326. import { permissionMapping, findMenuById, hasMenuPermission } from "@/utils/menuTreePermission.js"
  327. import moment from 'moment'
  328. import RefundFinanceBackground from '@/assets/images/refund-progress.png'
  329. const currentStep = ref(0)// 进度图
  330. const searchForm = ref({
  331. jwcode: '',
  332. markets: []
  333. })
  334. const dateRange = ref([])
  335. const addForm = ref({
  336. remark: ''
  337. })
  338. const auditForm = ref({
  339. refundType: ''
  340. })
  341. const isReject = ref(false)// 进度图有没有驳回状态
  342. const showReject = ref(false)
  343. const pagination = ref({
  344. pageNum: 1,
  345. pageSize: 50,
  346. total: 0
  347. })
  348. const market = ref([])
  349. const tableData = ref([])
  350. const showAudit = ref(false)
  351. const auditRow = ref({})// 审核回显
  352. const showSteps = ref(false)
  353. const uploadRef = ref(null)
  354. const submitter = ref('')// 提交人
  355. const areaFinance = ref('')// 地区财务
  356. const areaCharge = ref('')// 地区负责人
  357. const headFinance = ref('')// 总部财务
  358. const executor = ref('')// 指定执行人
  359. const exportListVisible = ref(false)
  360. const exportList = ref([])
  361. // 导出列表加载状态
  362. const exportListLoading = ref(false)
  363. const payments = ref([{
  364. value: '银行转账',
  365. label: '银行转账'
  366. },
  367. {
  368. value: '现金',
  369. label: '现金'
  370. },
  371. {
  372. value: '支票',
  373. label: '支票'
  374. },
  375. {
  376. value: '刷卡',
  377. label: '刷卡'
  378. },
  379. {
  380. value: 'Grabpay',
  381. label: 'Grabpay'
  382. },
  383. {
  384. value: 'Nets',
  385. label: 'Nets'
  386. },
  387. {
  388. value: 'PayPal',
  389. label: 'PayPal'
  390. },
  391. {
  392. value: 'Stripe-链接收款',
  393. label: 'Stripe-链接收款'
  394. },
  395. {
  396. value: 'Ipay88-链接收款',
  397. label: 'Ipay88-链接收款'
  398. },
  399. {
  400. value: 'PaymentAsia-链接收款',
  401. label: 'PaymentAsia-链接收款'
  402. },
  403. {
  404. value: 'Stripe-Link平台',
  405. label: 'Stripe-Link平台'
  406. },
  407. {
  408. value: 'PaymentAsia-Link平台',
  409. label: 'PaymentAsia-Link平台'
  410. },
  411. {
  412. value: 'FirstData-Link平台-Link平台',
  413. label: 'FirstData-Link平台-Link平台'
  414. },
  415. {
  416. value: 'IOS-Link平台',
  417. label: 'IOS-Link平台'
  418. },
  419. {
  420. value: 'Ipay88-Link平台',
  421. label: 'Ipay88-Link平台'
  422. }
  423. ])
  424. const statusStepMap = {
  425. 10: [1, false],
  426. 12: [2, true],
  427. 20: [3, false],
  428. 22: [4, true],
  429. 30: [5, false],
  430. 32: [6, true],
  431. 40: [7, false],
  432. 41: [8, false]
  433. }
  434. const statusList = ref(['待审核','审核通过','已驳回','退款成功'])
  435. // 查全部
  436. const getRefund = async function () {
  437. if (!hasMenuPermission(menuTree.value, permissionMapping.view_area_finance_refund)) {
  438. ElMessage.error('无此权限')
  439. return
  440. }
  441. try {
  442. const statusParam = ref([10,20,22,30,32,40,41])
  443. if (searchForm.value.statuses === '审核通过') {
  444. statusParam.value = [20, 30, 40]
  445. } else if (searchForm.value.statuses === '已驳回') {
  446. statusParam.value = [12, 22, 32]
  447. } else if (searchForm.value.statuses === '待审核') {
  448. statusParam.value = [10]
  449. } else if (searchForm.value.statuses === '退款成功') {
  450. statusParam.value = [41]
  451. } else {
  452. statusParam.value = [10,20,22,30,32,40,41]
  453. }
  454. const params = {
  455. pageNum: pagination.value.pageNum,
  456. pageSize: pagination.value.pageSize,
  457. cashRecordDTO: {
  458. jwcode: searchForm.value.jwcode,//精网号
  459. name: searchForm.value.name,//姓名
  460. markets: searchForm.value.markets,//地区
  461. goodsNames: searchForm.value.goodsName,//商品名
  462. statuses: statusParam.value,//10:地区财务待审核;12:地区财务驳回;
  463. // 20:地区负责人待审核;22:地区负责人驳回;
  464. // 30:总部财务待审核;32:总部财务驳回;
  465. // 40:执行人待处理;41:执行人已处理,退款完成;
  466. paymentCurrency: searchForm.value.paymentCurrency,//付款币种
  467. payType: searchForm.value.payType,//支付方式
  468. startTime: dateRange.value && dateRange.value[0] ? dayjs(dateRange.value[0]).format('YYYY-MM-DD HH:mm:ss') : "",
  469. endTime: dateRange.value && dateRange.value[1] ? dayjs(dateRange.value[1]).format('YYYY-MM-DD HH:mm:ss') : "",
  470. adminId: adminData.value.id
  471. }
  472. }
  473. const result = await API({
  474. url: '/Money/select',
  475. method: 'POST',
  476. data: params
  477. })
  478. tableData.value = result.data.list || []
  479. pagination.value.total = result.data.total || 0
  480. } catch (error) {
  481. ElMessage.error(error.message || '查询失败')
  482. }
  483. }
  484. // 审核通过
  485. const handlePass = async function () {
  486. if (!hasMenuPermission(menuTree.value, permissionMapping.audit_area_finance_refund)) {
  487. ElMessage.error('无此权限')
  488. return
  489. }
  490. try {
  491. const params = {
  492. id: auditRow.value.id,
  493. status: 20,
  494. areaFinance: adminData.value.adminName,
  495. auditId: auditRow.value.auditId
  496. }
  497. const result = await API({
  498. url: '/Money/review',
  499. data: params
  500. })
  501. if (result.code === 200) {
  502. ElMessage.success('审核通过')
  503. showAudit.value = false
  504. getRefund()
  505. }
  506. } catch (error) {
  507. ElMessage.error(error.message || '审核失败')
  508. }
  509. }
  510. // 审核驳回
  511. const handleReject = async function () {
  512. if (!hasMenuPermission(menuTree.value, permissionMapping.audit_area_finance_refund)) {
  513. ElMessage.error('无此权限')
  514. return
  515. }
  516. try {
  517. const params = {
  518. id: auditRow.value.id,
  519. status: 12,
  520. rejectReason: addForm.value.remark,
  521. areaFinance: adminData.value.adminName,
  522. auditId: auditRow.value.auditId,
  523. orderCode: auditRow.value.orderCode
  524. }
  525. const result = await API({
  526. url: '/Money/review',
  527. data: params
  528. })
  529. if (result.code === 200) {
  530. ElMessage.success('审核驳回')
  531. showAudit.value = false
  532. getRefund()
  533. addForm.value.remark = ''
  534. showReject.value = false
  535. }
  536. } catch (error) {
  537. ElMessage.error(error.message || '审核失败')
  538. }
  539. }
  540. const currencies = ref([
  541. {
  542. value: '新币',
  543. label: '新币'
  544. },
  545. {
  546. value: '港币',
  547. label: '港币'
  548. },
  549. {
  550. value: '马币',
  551. label: '马币'
  552. },
  553. {
  554. value: '加币',
  555. label: '加币'
  556. },
  557. {
  558. value: '泰铢',
  559. label: '泰铢'
  560. },
  561. {
  562. value: '越南盾',
  563. label: '越南盾'
  564. }
  565. ])
  566. const channelOptions = ref([{
  567. value: '银行转账',
  568. label: '银行转账'
  569. },
  570. {
  571. value: '刷卡',
  572. label: '刷卡'
  573. },
  574. {
  575. value: '现金',
  576. label: '现金'
  577. },
  578. {
  579. value: '支票',
  580. label: '支票'
  581. },
  582. {
  583. value: 'Grabpay',
  584. label: 'Grabpay'
  585. },
  586. {
  587. value: 'Nets',
  588. label: 'Nets'
  589. },
  590. {
  591. value: 'E-Transfer',
  592. label: 'E-Transfer'
  593. },
  594. {
  595. value: 'PayPal',
  596. label: 'PayPal'
  597. },
  598. {
  599. value: 'Stripe-链接收款',
  600. label: 'Stripe-链接收款'
  601. },
  602. {
  603. value: 'PaymentAsia-链接收款',
  604. label: 'PaymentAsia-链接收款'
  605. },
  606. {
  607. value: 'Ipay88-链接收款',
  608. label: 'Ipay88-链接收款'
  609. }
  610. ])
  611. const productList = [
  612. {
  613. "value": "金币产品",
  614. "label": "金币产品",
  615. "children": [
  616. {
  617. "value": "金币充值",
  618. "label": "金币充值",
  619. }
  620. ]
  621. },
  622. {
  623. "value": "软件产品",
  624. "label": "软件产品",
  625. "children": [
  626. {
  627. "value": "美股",
  628. "label": "美股",
  629. "children": [
  630. {
  631. "value": "美股软件",
  632. "label": "美股软件"
  633. }
  634. ]
  635. },
  636. {
  637. "value": "港股",
  638. "label": "港股",
  639. "children": [
  640. {
  641. "value": "港股软件",
  642. "label": "港股软件"
  643. }
  644. ]
  645. },
  646. {
  647. "value": "A股",
  648. "label": "A股",
  649. "children": [
  650. {
  651. "value": "A股软件",
  652. "label": "A股软件"
  653. }
  654. ]
  655. },
  656. {
  657. "value": "新加坡股",
  658. "label": "新加坡股",
  659. "children": [
  660. {
  661. "value": "新加坡股软件",
  662. "label": "新加坡股软件"
  663. }
  664. ]
  665. },
  666. {
  667. "value": "马股",
  668. "label": "马股",
  669. "children": [
  670. {
  671. "value": "马股软件",
  672. "label": "马股软件"
  673. }
  674. ]
  675. },
  676. {
  677. "value": "日本股",
  678. "label": "日本股",
  679. "children": [
  680. {
  681. "value": "日本股软件",
  682. "label": "日本股软件"
  683. }
  684. ]
  685. },
  686. {
  687. "value": "泰股",
  688. "label": "泰股",
  689. "children": [
  690. {
  691. "value": "泰股软件",
  692. "label": "泰股软件"
  693. }
  694. ]
  695. },
  696. {
  697. "value": "越南股",
  698. "label": "越南股",
  699. "children": [
  700. {
  701. "value": "越南股软件",
  702. "label": "越南股软件"
  703. }
  704. ]
  705. },
  706. {
  707. "value": "印尼股",
  708. "label": "印尼股",
  709. "children": [
  710. {
  711. "value": "印尼股软件",
  712. "label": "印尼股软件"
  713. }
  714. ]
  715. },
  716. {
  717. "value": "韩国股",
  718. "label": "韩国股",
  719. "children": [
  720. {
  721. "value": "韩国股软件",
  722. "label": "韩国股软件"
  723. }
  724. ]
  725. },
  726. {
  727. "value": "台湾股",
  728. "label": "台湾股",
  729. "children": [
  730. {
  731. "value": "台湾股软件",
  732. "label": "台湾股软件"
  733. }
  734. ]
  735. }
  736. ]
  737. },
  738. ]
  739. const getMarket = async function () {
  740. try {
  741. const result = await API({
  742. url: '/market/selectMarket',
  743. })
  744. console.log('看看地区树', result)
  745. const transformTree = (nodes) => {
  746. const allChildren = nodes.flatMap(node => node.children || []);
  747. return allChildren.map(child => {
  748. const grandchildren = child.children && child.children.length
  749. ? transformTree([child])
  750. : null;
  751. return {
  752. value: child.id,
  753. label: child.name,
  754. children: grandchildren
  755. };
  756. });
  757. };
  758. market.value = transformTree(result.data)
  759. console.log('转换后的地区树==============', market.value)
  760. } catch (error) {
  761. console.log('请求失败', error)
  762. }
  763. }
  764. const showStep = function (row) {
  765. if (!hasMenuPermission(menuTree.value, permissionMapping.track_area_finance_refund_progress)) {
  766. ElMessage.error('无此权限')
  767. return
  768. }
  769. isReject.value = false
  770. submitter.value = row.submitter || ''
  771. areaFinance.value = row.areaFinance || ''
  772. areaCharge.value = row.areaCharge || ''
  773. headFinance.value = row.headFinance || ''
  774. executor.value = row.executorName || ''
  775. currentStep.value = 1
  776. const status = row.status
  777. if (statusStepMap[status]) {
  778. const [step, reject] = statusStepMap[status]
  779. currentStep.value = step
  780. isReject.value = reject
  781. }
  782. console.log('步骤条状态', currentStep.value)
  783. showSteps.value = true
  784. }
  785. const exportExcel = async function () {
  786. const statusParam = ref([10,20,22,30,32,40,41])
  787. if (searchForm.value.statuses === '审核通过') {
  788. statusParam.value = [20, 30, 40]
  789. } else if (searchForm.value.statuses === '已驳回') {
  790. statusParam.value = [12, 22, 32]
  791. } else if (searchForm.value.statuses === '待审核') {
  792. statusParam.value = [10]
  793. } else if (searchForm.value.statuses === '退款成功') {
  794. statusParam.value = [41]
  795. } else {
  796. statusParam.value = [10,20,22,30,32,40,41]
  797. }
  798. const params = {
  799. pageNum: pagination.value.pageNum,
  800. pageSize: pagination.value.pageSize,
  801. cashRecordDTO: {
  802. jwcode: searchForm.value.jwcode,//精网号
  803. name: searchForm.value.name,//姓名
  804. markets: searchForm.value.markets,//地区
  805. goodsNames: searchForm.value.goodsName,//商品名
  806. statuses: statusParam.value,//10:地区财务待审核;12:地区财务驳回;
  807. // 20:地区负责人待审核;22:地区负责人驳回;
  808. // 30:总部财务待审核;32:总部财务驳回;
  809. // 40:执行人待处理;41:执行人已处理,退款完成;
  810. paymentCurrency: searchForm.value.paymentCurrency,//付款币种
  811. payType: searchForm.value.payType,//支付方式
  812. startTime: dateRange.value && dateRange.value[0] ? dayjs(dateRange.value[0]).format('YYYY-MM-DD HH:mm:ss') : "",
  813. endTime: dateRange.value && dateRange.value[1] ? dayjs(dateRange.value[1]).format('YYYY-MM-DD HH:mm:ss') : "",
  814. adminId: adminData.value.id
  815. }
  816. }
  817. const res = await API({ url: '/export/exportFinance', data: params })
  818. if (res.code === 200) {
  819. ElMessage.success('导出成功')
  820. }else{
  821. ElMessage.error(res.msg || '导出失败')
  822. }
  823. }
  824. const openExportList = () => {
  825. getExportList()
  826. exportListVisible.value = true
  827. }
  828. const getExportList = async () => {
  829. exportListLoading.value = true
  830. try {
  831. const result = await API({ url: '/export/export' })
  832. if (result.code === 200) {
  833. const filteredData = result.data.filter(item => {
  834. return item.type === 12
  835. })
  836. exportList.value = filteredData
  837. } else {
  838. ElMessage.error(result.msg || '获取导出列表失败')
  839. }
  840. } catch (error) {
  841. console.error('获取导出列表出错:', error)
  842. ElMessage.error('获取导出列表失败,请稍后重试')
  843. } finally {
  844. exportListLoading.value = false
  845. }
  846. }
  847. const downloadExportFile = (item) => {
  848. if (item.state === 2) {
  849. const link = document.createElement('a')
  850. link.href = item.url
  851. link.download = item.fileName
  852. link.click()
  853. } else {
  854. ElMessage.warning('文件还在导出中,请稍后再试')
  855. }
  856. }
  857. //根据状态返回对应的标签类型
  858. const getTagType = (state) => {
  859. switch (state) {
  860. case 0:
  861. return 'info';
  862. case 1:
  863. return 'primary';
  864. case 2:
  865. return 'success';
  866. case 3:
  867. return 'danger';
  868. default:
  869. return 'info';
  870. }
  871. }
  872. //根据状态返回对应的标签文案
  873. const getTagText = (state) => {
  874. switch (state) {
  875. case 0:
  876. return '待执行';
  877. case 1:
  878. return '执行中';
  879. case 2:
  880. return '执行完成';
  881. case 3:
  882. return '执行出错';
  883. default:
  884. return '未知状态';
  885. }
  886. }
  887. const showAudit2 = function (row) {
  888. auditRow.value = row
  889. showAudit.value = true
  890. }
  891. const reset = function () {
  892. searchForm.value = {
  893. jwcode: '',
  894. markets: [],
  895. statuses: []
  896. }
  897. // 重置页码
  898. pagination.value.pageNum = 1
  899. dateRange.value = []
  900. getRefund()
  901. }
  902. const hideReject = function () {
  903. showReject.value = false
  904. addForm.value.remark = ''
  905. }
  906. const defaultTime = [
  907. new Date(2000, 1, 1, 0, 0, 0),
  908. new Date(2000, 2, 1, 23, 59, 59),
  909. ]
  910. const disabledDate = (time) => {
  911. const limitDate = new Date(2025, 0, 1);
  912. return time.getTime() < limitDate.getTime();
  913. }
  914. onMounted(() => {
  915. console.log('???????????????????', adminData.value)
  916. getRefund()
  917. getMarket()
  918. })
  919. </script>
  920. <style scoped lang="scss">
  921. :deep(.el-table__header-wrapper),
  922. :deep(.el-table__body-wrapper),
  923. :deep(.el-table__cell),
  924. :deep(.el-table__body td) {
  925. background-color: #F3FAFE !important;
  926. }
  927. :deep(.el-table__header th) {
  928. background-color: #F3FAFE !important;
  929. }
  930. .condition {
  931. width: 82vw;
  932. display: flex;
  933. align-items: center;
  934. height: 4vh;
  935. .item1 {
  936. width: 18%;
  937. display: flex;
  938. align-items: center;
  939. margin-bottom: 1vh;
  940. margin-right: 0.5vw;
  941. }
  942. .item2 {
  943. width: 18%;
  944. display: flex;
  945. align-items: center;
  946. margin-right: 0.5vw;
  947. }
  948. }
  949. .audit {
  950. display: flex;
  951. justify-content: center;
  952. height: auto;
  953. min-height: 40vh;
  954. .top {
  955. width: 30vw;
  956. height: 17vh;
  957. .top-item {
  958. display: flex;
  959. align-items: center;
  960. margin-bottom: 1vh;
  961. }
  962. }
  963. .smallTitle {
  964. background-color: white;
  965. color: rgb(64, 158, 255);
  966. border-color: rgb(64, 158, 255);
  967. margin-bottom: 0.5vh;
  968. }
  969. .center {
  970. display: flex;
  971. width: 30vw;
  972. height: 35vh;
  973. .dialog-item {
  974. display: flex;
  975. align-items: center;
  976. margin-bottom: 1vh;
  977. }
  978. .center-left {
  979. width: 60%;
  980. height: 35vh;
  981. .image {
  982. width: 4vw !important;
  983. height: 4vw !important;
  984. }
  985. :deep(.el-upload--picture-card) {
  986. width: 4vw !important;
  987. height: 4vw !important;
  988. padding: 0 !important;
  989. }
  990. .center-item {
  991. display: flex;
  992. align-items: center;
  993. margin-bottom: 1vh;
  994. }
  995. }
  996. .center-right {
  997. height: 35vh;
  998. .right-item {
  999. display: flex;
  1000. align-items: center;
  1001. margin-bottom: 1vh;
  1002. }
  1003. }
  1004. }
  1005. .bottom {
  1006. width: 30vw;
  1007. height: auto;
  1008. padding-bottom: 1vh;
  1009. .bottom-item {
  1010. display: flex;
  1011. align-items: center;
  1012. margin-bottom: 1vh;
  1013. }
  1014. }
  1015. }
  1016. .steps {
  1017. .steps-content {
  1018. padding-top: 15vw;
  1019. }
  1020. .steps-status {
  1021. display: flex;
  1022. align-items: center;
  1023. justify-content: center;
  1024. }
  1025. .steps-btn {
  1026. height: 15vh;
  1027. display: flex;
  1028. justify-content: center;
  1029. align-items: center;
  1030. }
  1031. }
  1032. </style>