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.

950 lines
34 KiB

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