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.

935 lines
36 KiB

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