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.

926 lines
36 KiB

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