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.

924 lines
34 KiB

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