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.

1065 lines
37 KiB

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