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.

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