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.

968 lines
39 KiB

5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
3 months ago
1 month ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
5 months ago
4 months ago
4 months ago
5 months ago
3 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
3 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
3 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
3 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
5 months ago
5 months ago
4 months ago
3 months ago
3 months ago
4 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
4 months ago
4 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
4 months ago
5 months ago
3 months ago
5 months ago
3 months ago
3 months ago
3 months ago
3 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
4 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
5 months ago
4 months ago
4 months ago
5 months ago
5 months ago
3 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 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="condition-row">
  6. <div class="item1">
  7. <el-text size="large" style="width:6vw;">{{ t('common.jwcode') }}</el-text>
  8. <el-input v-model="searchForm.jwcode" :placeholder="t('common.jwcodePlaceholder')" style="width:9vw;"
  9. clearable />
  10. </div>
  11. <div class="item1">
  12. <el-text size="large" style="width:6vw;">{{ t('common.customerName') }}</el-text>
  13. <el-input v-model="searchForm.name" :placeholder="t('common.customerNamePlaceholder')"
  14. style="width:9vw;" clearable />
  15. </div>
  16. <div class="item1">
  17. <el-text size="large" style="width:6vw;">{{ t('common.productName') }}</el-text>
  18. <el-cascader v-model="searchForm.goodsName" :options="productList" style="width: 10vw;"
  19. :placeholder="t('common.productNamePlaceholder')" clearable />
  20. </div>
  21. </div>
  22. <div class="condition-row">
  23. <div class="item1" v-if="isHeadquarters">
  24. <el-text size="large" style="width:6vw;">{{ t('common.market') }}</el-text>
  25. <el-cascader style="width: 9vw;" v-model="searchForm.markets" :options="market"
  26. :placeholder="t('common.marketPlaceholder')" clearable @change="handleMarketChange" />
  27. </div>
  28. <div class="item1">
  29. <el-text size="large" style="width:6vw;">{{ t('common.orderStatus') }}</el-text>
  30. <el-select v-model="searchForm.statuses" style="width:9vw;"
  31. :placeholder="t('common.orderStatusPlaceholder')" clearable>
  32. <el-option v-for="item in statusList" :label="item" :value="item" :key="item" />
  33. </el-select>
  34. </div>
  35. <div class="condition-actions">
  36. <el-button type="primary" @click="getRefund">{{ t('common.search') }}</el-button>
  37. <el-button type="warning" @click="exportExcel()">{{ t('common.exportExcel') }}</el-button>
  38. <el-button type="primary" @click="openExportList">{{ t('common.viewExportList') }}</el-button>
  39. <el-button type="success" @click="reset">{{ t('common.reset') }}</el-button>
  40. </div>
  41. </div>
  42. </div>
  43. </el-card>
  44. <el-card style="margin-top: 0.5vh;background-color: rgb(231,244,253);">
  45. <el-table ref="tableRef" :data="tableData" style="height:73vh;width:82vw">
  46. <el-table-column type="index" :label="t('common_list.id')" width="60" fixed="left">
  47. <template #default="scope">
  48. {{ scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize }}
  49. </template>
  50. </el-table-column>
  51. <el-table-column prop="name" :label="t('common_list.name')" width="120" fixed="left" />
  52. <el-table-column prop="jwcode" label="Homily ID" width="120" fixed="left"
  53. show-overflow-tooltip />
  54. <el-table-column prop="marketName" :label="t('common_list.market')" width="120" />
  55. <el-table-column prop="goodsName" :label="t('common_list.productName')" width="130" show-overflow-tooltip />
  56. <el-table-column prop="goodsNum" :label="t('common_list.productNum')" width="130px">
  57. <template #default="scope">
  58. <span v-if="scope.row.goodsName == t('common_list.goldRecharge')">{{
  59. scope.row.permanentGold }} {{ t('cash.unit') }}</span>
  60. <span v-else>{{ scope.row.goodsNum }} {{ scope.row.numUnit }}</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column prop="refundModel" :label="t('common_list.refundModel')" width="120">
  64. <template #default="scope">
  65. {{ scope.row.refundModel === 1 ? t('common_list.refundModelPart') : t('common_list.refundModelAll')
  66. }}
  67. </template>
  68. </el-table-column>
  69. <el-table-column prop="submitter" :label="t('common_list.submitter')" width="120" />
  70. <el-table-column prop="refundReason" :label="t('common_list.refundReason')" width="120"
  71. show-overflow-tooltip />
  72. <el-table-column prop="remark" :label="t('common_list.remark')" width="150" show-overflow-tooltip />
  73. <el-table-column prop="status" :label="t('common_list.orderStatus')" width="130">
  74. <template #default="scope">
  75. {{
  76. [20].includes(scope.row.status) ? t('cash.statusList.pending') :
  77. [30, 40].includes(scope.row.status) ? t('cash.statusList.passed') :
  78. [22, 32].includes(scope.row.status) ? t('cash.statusList.rejected') :
  79. scope.row.status === 41 ? t('cash.refundSuccess') : scope.row.status
  80. }}
  81. </template>
  82. </el-table-column>
  83. <el-table-column prop="operation" :label="t('common_list.operation')" fixed="right" width="140px">
  84. <template #default="scope">
  85. <div class="operation">
  86. <el-button v-if="scope.row.status === 20" type="primary" text @click="showAudit(scope.row)">
  87. {{ t('common.audit') }}
  88. </el-button>
  89. <el-button v-else type="primary" text @click="showStep(scope.row)">
  90. {{ t('common.viewProgress') }}
  91. </el-button>
  92. </div>
  93. </template>
  94. </el-table-column>
  95. </el-table>
  96. <el-pagination v-model:current-page="pagination.pageNum" v-model:page-size="pagination.pageSize"
  97. layout="total, sizes, prev, pager, next, jumper" :total="pagination.total"
  98. @size-change="handlePageSizeChange" @current-change="handleCurrentChange"
  99. style="margin-top: 1vh;"></el-pagination>
  100. </el-card>
  101. <el-dialog v-model="showAudit2" :title="t('common.audit')" class="audit2" width="35vw" overflow draggable
  102. style="background-color: #F3FAFE !important;">
  103. <div class="top">
  104. <el-button @click="" class="smallTitle" size="small">{{ t('common_add.refundApplyInfo') }}</el-button>
  105. <div class="top-item">
  106. <el-text style="width:4vw;" size="small">{{ t('common_add.refundModel') }}</el-text>
  107. <el-select v-model="auditRow.refundModel" size="small" style="width:10vw;" disabled>
  108. <el-option :label="t('common_add.refundModelAll')" :value="0"></el-option>
  109. <el-option :label="t('common_add.refundModelPart')" :value="1"></el-option>
  110. </el-select>
  111. </div>
  112. <div class="top-item">
  113. <el-text style="width:4vw;" size="small">{{ t('common_add.permanentGold') }}</el-text>
  114. <el-input v-model="auditRow.permanentGold" size="small" style="width:10vw;" disabled /><span>&nbsp;{{
  115. t('common.个') }}</span>
  116. </div>
  117. <div class="top-item">
  118. <el-text style="width:4vw;" size="small">{{ t('common_add.freeGold') }}</el-text>
  119. <el-input v-model="auditRow.freeGold" size="small" style="width:10vw;" disabled /><span>&nbsp;{{
  120. t('common.个') }}</span>
  121. </div>
  122. <div class="top-item">
  123. <el-text style="width:4vw;" size="small">{{ t('common_add.refundReason') }}</el-text>
  124. <el-input v-model="auditRow.refundReason" size="small" style="width:10vw;" :rows="3" maxlength="100"
  125. show-word-limit type="textarea" disabled />
  126. </div>
  127. </div>
  128. <el-button @click="" class="smallTitle" size="small">{{ t('common_add.originalOrderInfo') }}</el-button>
  129. <div class="center">
  130. <div class="center-left">
  131. <div class="center-item">
  132. <el-text style="width:4vw;" size="small">{{ t('common_add.jwcode') }}</el-text>
  133. <el-input v-model="auditRow.jwcode" size="small" style="width:10vw;" disabled />
  134. </div>
  135. <div class="center-item">
  136. <el-text style="width:4vw;" size="small">{{ t('common_add.market') }}</el-text>
  137. <el-input v-model="auditRow.marketName" size="small" style="width:10vw;" disabled />
  138. </div>
  139. <div class="center-item">
  140. <el-text style="width:4vw;" size="small">{{ t('common_add.productName') }}</el-text>
  141. <el-input v-model="auditRow.goodsName" size="small" style="width:10vw;" disabled />
  142. </div>
  143. <div class="center-item">
  144. <el-text style="width:4vw;" size="small">{{ t('common_add.payCurrency') }}</el-text>
  145. <el-input v-model="auditRow.paymentCurrency" size="small" style="width:10vw;" disabled />
  146. </div>
  147. <div class="center-item">
  148. <el-text style="width:4vw;" size="small">{{ t('common_add.payAmount') }}</el-text>
  149. <el-input v-model="auditRow.paymentAmount" size="small" style="width:10vw;" disabled />
  150. </div>
  151. <div class="center-item">
  152. <el-text style="width:4vw;" size="small">{{ t('common_add.payTime') }}</el-text>
  153. <el-input v-model="auditRow.payTime" size="small" style="width:10vw;" disabled />
  154. </div>
  155. <div class="center-item">
  156. <el-text style="width:4vw;">{{ t('common_add.transferVoucher') }}</el-text>
  157. <img v-if="auditRow.payVoucher" :src="auditRow.payVoucher"
  158. style="width: 80px; height: 80px; object-fit: cover;">
  159. <div v-else>
  160. {{ t('common_add.noTransferVoucher') }}
  161. </div>
  162. </div>
  163. </div>
  164. <div class="center-right">
  165. <div class="right-item">
  166. <el-text style="width:4vw;" size="small">{{ t('common_add.customerName') }}</el-text>
  167. <el-input v-model="auditRow.name" size="small" style="width:10vw;" disabled />
  168. </div>
  169. <div class="right-item">
  170. <el-text style="width:4vw;" size="small">{{ t('common_add.activity') }}</el-text>
  171. <el-input v-model="auditRow.activity" size="small" style="width:10vw;" disabled />
  172. </div>
  173. <div class="right-item">
  174. <el-text style="width:4vw;" size="small">{{ t('common_add.payMethod') }}</el-text>
  175. <el-input v-model="auditRow.payType" size="small" style="width:10vw;" disabled />
  176. </div>
  177. <div class="right-item">
  178. <el-text style="width:4vw;" size="small">{{ t('common_add.receiveCurrency') }}</el-text>
  179. <el-input v-model="auditRow.receivedCurrency" size="small" style="width:10vw;" disabled />
  180. </div>
  181. <div class="right-item">
  182. <el-text style="width:4vw;" size="small">{{ t('common_add.receiveAmount') }}</el-text>
  183. <el-input v-model="auditRow.receivedAmount" size="small" style="width:10vw;" disabled />
  184. </div>
  185. <div class="right-item">
  186. <el-text style="width:4vw;" size="small">{{ t('common_add.receiveTime') }}</el-text>
  187. <el-input v-model="auditRow.receivedTime" size="small" style="width:10vw;" disabled />
  188. </div>
  189. <div class="right-item">
  190. <el-text style="width:4vw;" size="small">{{ t('common_add.fee') }}</el-text>
  191. <el-input v-model="auditRow.handlingCharge" size="small" style="width:10vw;" disabled />
  192. </div>
  193. <div class="right-item">
  194. <el-text style="width:4vw;" size="small">{{ t('common_add.submitter') }}</el-text>
  195. <el-input v-model="auditRow.submitter" size="small" style="width:10vw;" disabled />
  196. </div>
  197. <div class="right-item">
  198. <el-text style="width:4vw;" size="small">{{ t('common_add.remark') }}</el-text>
  199. <el-input v-model="auditRow.remark" size="small" style="width:10vw;" :row="3" maxlength="100"
  200. type="textarea" show-word-limit disabled />
  201. </div>
  202. </div>
  203. </div>
  204. <div class="bottom">
  205. <el-button class="smallTitle" size="small" v-show="showReject">{{ t('common.rejectInfo') }}</el-button>
  206. <div class="bottom-item" v-show="showReject">
  207. <el-text style="width:4vw;" size="small">{{ t('common_add.rejectRemark') }}</el-text>
  208. <el-input v-model="addForm.remark" :placeholder="t('common_add.rejectRemarkPlaceholder')" size="small"
  209. style="width:10vw;" :row="3" maxlength="100" type="textarea" show-word-limit clearable />
  210. </div>
  211. <div style="text-align: center;" v-show="!showReject">
  212. <el-button type="default" @click="showReject = true">{{ t('common.reject') }}</el-button>
  213. <el-button type="primary" @click="handlePass">{{ t('common.pass') }}</el-button>
  214. </div>
  215. <div style="text-align: center;" v-show="showReject">
  216. <el-button type="default" @click="hideReject">{{ t('common.cancel') }}</el-button>
  217. <el-button type="primary" @click="handleReject">{{ t('common.confirm') }}</el-button>
  218. </div>
  219. </div>
  220. </el-dialog>
  221. <el-dialog v-model="showSteps" overflow draggable width="1206px" height="506px" :style="{
  222. backgroundImage: `url(${RefundChargeBackground})`,
  223. backgroundSize: 'cover',
  224. backgroundPosition: 'center'
  225. }">
  226. <div class="steps">
  227. <div class="steps-content">
  228. <div class="reject-reason" v-if="isReject">{{ t('common_list.rejectReason') }}{{ rejectReason }}</div>
  229. <el-steps :active="currentStep" align-center>
  230. <el-step>
  231. <template #title>
  232. <div>
  233. {{ t('common_list.submitter') }}<br>{{ submitter || t('common.unknownSubmitter') }}
  234. </div>
  235. </template>
  236. <template #icon>
  237. <img src="@/assets/images/refund-approved.png" :alt="t('common.completed')">
  238. </template>
  239. </el-step>
  240. <el-step>
  241. <template #title>
  242. <div>
  243. {{ t('cash.progress.areaFinance') }}<br>{{ areaFinance || t('common.noAuditorRecorded')
  244. }}
  245. </div>
  246. </template>
  247. <template #icon>
  248. <img v-if="currentStep === 2" src="@/assets/images/refund-rejected.png"
  249. :alt="t('common.rejected')">
  250. <img v-else-if="currentStep === 1" src="@/assets/images/refund-approving.png"
  251. :alt="t('common.pendingAudit')">
  252. <img v-else-if="currentStep > 2" src="@/assets/images/refund-approved.png"
  253. :alt="t('common.passed')">
  254. </template>
  255. </el-step>
  256. <el-step>
  257. <template #title>
  258. <div>
  259. {{ t('cash.progress.areaCharge') }}<br>{{ areaCharge || t('common.noAuditorRecorded') }}
  260. </div>
  261. </template>
  262. <template #icon>
  263. <img v-if="currentStep === 4" src="@/assets/images/refund-rejected.png"
  264. :alt="t('common.rejected')">
  265. <img v-else-if="currentStep === 3" src="@/assets/images/refund-approving.png"
  266. :alt="t('common.pendingAudit')">
  267. <img v-else-if="currentStep > 3 && currentStep != 4"
  268. src="@/assets/images/refund-approved.png" :alt="t('common.audited')">
  269. <img v-else-if="currentStep < 3" src="@/assets/images/refund-waiting.png"
  270. :alt="t('common_list.activityStatus.notStarted')">
  271. </template>
  272. </el-step>
  273. <el-step>
  274. <template #title>
  275. <div>
  276. {{ t('cash.progress.headFinance') }}<br>{{ headFinance || t('common.noAuditorRecorded')
  277. }}
  278. </div>
  279. </template>
  280. <template #icon>
  281. <img v-if="currentStep === 6" src="@/assets/images/refund-rejected.png"
  282. :alt="t('common.rejected')">
  283. <img v-else-if="currentStep === 5" src="@/assets/images/refund-approving.png"
  284. :alt="t('common.pendingAudit')">
  285. <img v-else-if="currentStep > 5 && currentStep != 6"
  286. src="@/assets/images/refund-approved.png" :alt="t('common.audited')">
  287. <img v-else-if="currentStep < 5" src="@/assets/images/refund-waiting.png"
  288. :alt="t('common_list.activityStatus.notStarted')">
  289. </template>
  290. </el-step>
  291. <el-step>
  292. <template #title>
  293. <div>
  294. {{ t('cash.progress.executor') }}<br>{{ executor || t('common.noExecutorRecorded') }}
  295. </div>
  296. </template>
  297. <template #icon>
  298. <img v-if="currentStep === 7" src="@/assets/images/refund-approving.png"
  299. :alt="t('common_list.pending')">
  300. <img v-else-if="currentStep === 8" src="@/assets/images/refund-approved.png"
  301. :alt="t('common.completed')">
  302. <img v-else-if="currentStep < 7" src="@/assets/images/refund-waiting.png"
  303. :alt="t('common_list.activityStatus.notStarted')">
  304. </template>
  305. </el-step>
  306. </el-steps>
  307. </div>
  308. <div class="steps-btn">
  309. <el-button type="primary" @click="showSteps = false">{{ t('common.confirm') }}</el-button>
  310. </div>
  311. </div>
  312. </el-dialog>
  313. <el-dialog v-model="exportListVisible" :title="t('common_export.exportList')" width="80%">
  314. <el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading">
  315. <el-table-column prop="fileName" :label="t('common_export.fileName')" />
  316. <el-table-column prop="state" :label="t('common_export.status')">
  317. <template #default="scope">
  318. <el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
  319. {{ getTagText(scope.row.state) }}
  320. </el-tag>
  321. </template>
  322. </el-table-column>
  323. <el-table-column prop="createTime" :label="t('common_export.createTime')">
  324. <template #default="scope">
  325. {{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
  326. </template>
  327. </el-table-column>
  328. <el-table-column :label="t('common_export.operation')">
  329. <template #default="scope">
  330. <el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
  331. :disabled="scope.row.state !== 2">
  332. {{ t('common_export.download') }}
  333. </el-button>
  334. </template>
  335. </el-table-column>
  336. </el-table>
  337. <template #footer>
  338. <div class="dialog-footer">
  339. <el-button text @click="exportListVisible = false">{{ t('common_export.close') }}</el-button>
  340. </div>
  341. </template>
  342. </el-dialog>
  343. </template>
  344. <script setup>
  345. import { ref, onMounted, computed, nextTick } from 'vue'
  346. import { ElMessage } from 'element-plus'
  347. import API from '@/util/http.js'
  348. const uploadUrl = 'https://api.homilychart.com/hljw/api/aws/upload'
  349. import { useAdminStore } from "@/store/index.js"
  350. import { storeToRefs } from "pinia"
  351. import dayjs from 'dayjs'
  352. const adminStore = useAdminStore()
  353. const { adminData, menuTree } = storeToRefs(adminStore)
  354. import { permissionMapping, findMenuById, hasMenuPermission } from "@/utils/menuTreePermission.js"
  355. import moment from 'moment'
  356. import { productList, CurrencyForId } from '@/views/moneyManage/receiveDetail/utils/staticData.js'
  357. import RefundChargeBackground from '@/assets/images/refund-progress.png'
  358. import { isNumber } from 'lodash'
  359. import { useI18n } from 'vue-i18n'
  360. const { t } = useI18n()
  361. const currentStep = ref(0)// 进度图
  362. const searchForm = ref({
  363. jwcode: '',
  364. markets: []
  365. })
  366. const isHeadquarters = computed(() => {
  367. const m = adminData.value.markets
  368. return m === t('common.markets.headquarters') || m === '总部' || m === 'Headquarters'
  369. })
  370. const isReject = ref(false)// 进度图有没有驳回状态
  371. const rejectReason = ref('')// 驳回理由,进度图
  372. const addForm = ref({
  373. remark: ''
  374. })
  375. const showReject = ref(false)
  376. const auditRow = ref({})// 审核回显
  377. const dateRange = ref([])
  378. const pagination = ref({
  379. pageNum: 1,
  380. pageSize: 50,
  381. total: 0
  382. })
  383. const market = ref([])
  384. const showAudit2 = ref(false)
  385. const tableData = ref([])
  386. const tableRef = ref(null)
  387. const scrollTableTop = () => {
  388. tableRef.value?.setScrollTop?.(0)
  389. }
  390. const showSteps = ref(false)
  391. const submitter = ref('')// 提交人
  392. const areaFinance = ref('')// 地区财务
  393. const areaCharge = ref('')// 地区负责人
  394. const headFinance = ref('')// 总部财务
  395. const executor = ref('')// 指定执行人
  396. const uploadRef = ref(null)
  397. const exportListVisible = ref(false)
  398. const exportList = ref([])
  399. // 导出列表加载状态
  400. const exportListLoading = ref(false)
  401. const statusStepMap = {
  402. 10: [1, false],
  403. 12: [2, true],
  404. 20: [3, false],
  405. 22: [4, true],
  406. 30: [5, false],
  407. 32: [6, true],
  408. 40: [7, false],
  409. 41: [8, false]
  410. }
  411. const currencies = computed(() => [
  412. t('cash.currency.usd'),
  413. t('cash.currency.hkd'),
  414. t('cash.currency.sgd'),
  415. t('cash.currency.myr'),
  416. t('cash.currency.thb'),
  417. t('cash.currency.cad'),
  418. t('cash.currency.vnd'),
  419. t('cash.currency.krw')
  420. ])
  421. const channelOptions = computed(() => [
  422. t('cash.payMethods.stripe'),
  423. t('cash.payMethods.paymentAsia'),
  424. t('cash.payMethods.ipay88'),
  425. t('cash.payMethods.bankTransfer'),
  426. t('cash.payMethods.card'),
  427. t('cash.payMethods.cash'),
  428. t('cash.payMethods.check'),
  429. t('cash.payMethods.grabpay'),
  430. t('cash.payMethods.nets'),
  431. t('cash.payMethods.transfer'),
  432. t('cash.payMethods.paypal')
  433. ])
  434. const statusList = computed(() => [
  435. t('cash.statusList.pending'),
  436. t('cash.statusList.passed'),
  437. t('cash.statusList.rejected'),
  438. t('cash.refundSuccess')
  439. ])
  440. // 查全部
  441. const getRefund = async function () {
  442. if (!hasMenuPermission(menuTree.value, permissionMapping.view_area_manager_refund)) {
  443. ElMessage.error(t('elmessage.noPermission'))
  444. return
  445. }
  446. try {
  447. const payCurrencySelect = ref('')
  448. const statuses = ref([20, 22, 30, 32, 40, 41]) // 看不到进度没到这里的
  449. if (searchForm.value.statuses === t('cash.statusList.passed')) {
  450. statuses.value = [30, 40]
  451. } else if (searchForm.value.statuses === t('cash.statusList.rejected')) {
  452. statuses.value = [22, 32]
  453. } else if (searchForm.value.statuses === t('cash.statusList.pending')) {
  454. statuses.value = [20]
  455. } else if (searchForm.value.statuses === t('cash.refundSuccess')) {
  456. statuses.value = [41]
  457. } else {
  458. statuses.value = [20, 22, 30, 32, 40, 41]
  459. }
  460. const goodsName = searchForm.value.goodsName && searchForm.value.goodsName.length > 0
  461. ? searchForm.value.goodsName[searchForm.value.goodsName.length - 1] : ''
  462. if (searchForm.value.jwcode) {
  463. const isPositiveInteger = /^[1-9]\d*$/.test(searchForm.value.jwcode);
  464. if (!isPositiveInteger) {
  465. ElMessage.error(t('elmessage.checkJwcodeFormat'))
  466. return;
  467. }
  468. }
  469. // 增加精网号长度限制,防止后端400错误
  470. if (searchForm.value.jwcode.length > 8) {
  471. ElMessage.error(t('elmessage.limitJwcodeLength'))
  472. return;
  473. }
  474. if (searchForm.value.paymentCurrency) {
  475. payCurrencySelect.value = CurrencyForId(searchForm.value.paymentCurrency)
  476. }
  477. const params = {
  478. pageNum: pagination.value.pageNum,
  479. pageSize: pagination.value.pageSize,
  480. cashRecordDTO: {
  481. jwcode: searchForm.value.jwcode,//精网号
  482. name: searchForm.value.name,//姓名
  483. markets: searchForm.value.markets && searchForm.value.markets.length > 0 ? [searchForm.value.markets[searchForm.value.markets.length - 1]] : [],
  484. goodsName: goodsName,//商品名
  485. statuses: statuses.value,//10:地区财务待审核;12:地区财务驳回;
  486. // 20:地区负责人待审核;22:地区负责人驳回;
  487. // 30:总部财务待审核;32:总部财务驳回;
  488. // 40:执行人待处理;41:执行人已处理,退款完成;
  489. paymentCurrency: payCurrencySelect.value,//付款币种
  490. payType: searchForm.value.payType,//支付方式
  491. startTime: dateRange.value && dateRange.value[0] ? dayjs(dateRange.value[0]).format('YYYY-MM-DD HH:mm:ss') : "",
  492. endTime: dateRange.value && dateRange.value[1] ? dayjs(dateRange.value[1]).format('YYYY-MM-DD HH:mm:ss') : "",
  493. adminId: adminData.value.id
  494. }
  495. }
  496. const result = await API({
  497. url: '/Money/select',
  498. method: 'POST',
  499. data: params
  500. })
  501. tableData.value = result.data.list || []
  502. await nextTick()
  503. scrollTableTop()
  504. pagination.value.total = result.data.total || 0
  505. } catch (error) {
  506. ElMessage.error(error.message || t('elmessage.searchFailed'))
  507. }
  508. }
  509. // 审核通过
  510. const handlePass = async function () {
  511. if (!hasMenuPermission(menuTree.value, permissionMapping.audit_area_manager_refund)) {
  512. ElMessage.error(t('elmessage.noPermission'))
  513. return
  514. }
  515. try {
  516. const params = {
  517. id: auditRow.value.id,
  518. status: 30,
  519. rejectReason: addForm.value.remark,
  520. areaCharge: adminData.value.adminName,
  521. auditId: auditRow.value.auditId,
  522. relatedId: auditRow.value.relatedId
  523. }
  524. const result = await API({
  525. url: '/Money/review',
  526. data: params
  527. })
  528. if (result.code === 200) {
  529. ElMessage.success(t('elmessage.approveSuccess'))
  530. showAudit2.value = false
  531. getRefund()
  532. }
  533. } catch (error) {
  534. ElMessage.error(error.message || t('elmessage.approveFailed'))
  535. }
  536. }
  537. // 审核驳回
  538. const handleReject = async function () {
  539. if (!hasMenuPermission(menuTree.value, permissionMapping.audit_area_manager_refund)) {
  540. ElMessage.error(t('elmessage.noPermission'))
  541. return
  542. }
  543. try {
  544. const params = {
  545. id: auditRow.value.id,
  546. status: 22,
  547. rejectReason: addForm.value.remark,
  548. areaCharge: adminData.value.adminName,
  549. auditId: auditRow.value.auditId,
  550. orderCode: auditRow.value.orderCode,
  551. relatedId: auditRow.value.relatedId
  552. }
  553. const result = await API({
  554. url: '/Money/review',
  555. data: params
  556. })
  557. if (result.code === 200) {
  558. ElMessage.success(t('elmessage.rejectSuccess'))
  559. getRefund()
  560. addForm.value.remark = ''
  561. showAudit2.value = false
  562. showReject.value = false
  563. }
  564. } catch (error) {
  565. ElMessage.error(error.message || t('elmessage.approveFailed'))
  566. }
  567. }
  568. const showStep = function (row) {
  569. if (!hasMenuPermission(menuTree.value, permissionMapping.track_area_manager_refund_progress)) {
  570. ElMessage.error(t('elmessage.noPermission'))
  571. return
  572. }
  573. rejectReason.value = row.rejectReason || ''
  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 payCurrencySelect = ref('')
  617. const statuses = ref([20, 22, 30, 32, 40, 41]) // 看不到进度没到这里的
  618. if (searchForm.value.statuses === t('cash.statusList.passed')) {
  619. statuses.value = [30, 40]
  620. } else if (searchForm.value.statuses === t('cash.statusList.rejected')) {
  621. statuses.value = [22, 32]
  622. } else if (searchForm.value.statuses === t('cash.statusList.pending')) {
  623. statuses.value = [20]
  624. } else if (searchForm.value.statuses === t('cash.refundSuccess')) {
  625. statuses.value = [41]
  626. } else {
  627. statuses.value = [20, 22, 30, 32, 40, 41]
  628. }
  629. const goodsName = searchForm.value.goodsName && searchForm.value.goodsName.length > 0
  630. ? searchForm.value.goodsName[searchForm.value.goodsName.length - 1] : ''
  631. if (searchForm.value.jwcode) {
  632. const isPositiveInteger = /^[1-9]\d*$/.test(searchForm.value.jwcode);
  633. if (!isPositiveInteger) {
  634. ElMessage.error(t('elmessage.checkJwcodeFormat'))
  635. return
  636. }
  637. }
  638. // 增加精网号长度限制,防止后端400错误
  639. if (searchForm.value.jwcode.length > 8) {
  640. ElMessage.error(t('elmessage.limitJwcodeLength'))
  641. return;
  642. }
  643. if (searchForm.value.paymentCurrency) {
  644. payCurrencySelect.value = CurrencyForId(searchForm.value.paymentCurrency)
  645. }
  646. const params = {
  647. pageNum: pagination.value.pageNum,
  648. pageSize: pagination.value.pageSize,
  649. cashRecordDTO: {
  650. jwcode: searchForm.value.jwcode,//精网号
  651. name: searchForm.value.name,//姓名
  652. markets: searchForm.value.markets && searchForm.value.markets.length > 0 ? [searchForm.value.markets[searchForm.value.markets.length - 1]] : [],
  653. goodsName: goodsName,//商品名
  654. statuses: statuses.value,//10:地区财务待审核;12:地区财务驳回;
  655. // 20:地区负责人待审核;22:地区负责人驳回;
  656. // 30:总部财务待审核;32:总部财务驳回;
  657. // 40:执行人待处理;41:执行人已处理,退款完成;
  658. paymentCurrency: payCurrencySelect.value,//付款币种
  659. payType: searchForm.value.payType,//支付方式
  660. startTime: dateRange.value && dateRange.value[0] ? dayjs(dateRange.value[0]).format('YYYY-MM-DD HH:mm:ss') : "",
  661. endTime: dateRange.value && dateRange.value[1] ? dayjs(dateRange.value[1]).format('YYYY-MM-DD HH:mm:ss') : "",
  662. adminId: adminData.value.id
  663. }
  664. }
  665. const res = await API({ url: '/export/exportFinance', data: params })
  666. if (res.code === 200) {
  667. ElMessage.success(t('elmessage.exportSuccess'))
  668. }
  669. }
  670. const openExportList = () => {
  671. getExportList()
  672. exportListVisible.value = true
  673. }
  674. const getExportList = async () => {
  675. exportListLoading.value = true
  676. try {
  677. const result = await API({ url: '/export/export' })
  678. if (result.code === 200) {
  679. const filteredData = result.data.filter(item => {
  680. return item.type === 12
  681. })
  682. exportList.value = filteredData
  683. } else {
  684. ElMessage.error(result.msg || t('elmessage.getExportListError'))
  685. }
  686. } catch (error) {
  687. console.error('获取导出列表出错:', error)
  688. ElMessage.error(t('elmessage.getExportListError'))
  689. } finally {
  690. exportListLoading.value = false
  691. }
  692. }
  693. const downloadExportFile = (item) => {
  694. if (item.state === 2) {
  695. const link = document.createElement('a')
  696. link.href = item.url
  697. link.download = item.fileName
  698. link.click()
  699. } else {
  700. ElMessage.warning(t('elmessage.exportingInProgress'))
  701. }
  702. }
  703. //根据状态返回对应的标签类型
  704. const getTagType = (state) => {
  705. switch (state) {
  706. case 0:
  707. return 'info';
  708. case 1:
  709. return 'primary';
  710. case 2:
  711. return 'success';
  712. case 3:
  713. return 'danger';
  714. default:
  715. return 'info';
  716. }
  717. }
  718. //根据状态返回对应的标签文案
  719. const getTagText = (state) => {
  720. switch (state) {
  721. case 0:
  722. return t('elmessage.pendingExecution');
  723. case 1:
  724. return t('elmessage.executing');
  725. case 2:
  726. return t('elmessage.executed');
  727. case 3:
  728. return t('elmessage.errorExecution');
  729. default:
  730. return t('elmessage.unknownStatus');
  731. }
  732. }
  733. const hideReject = function () {
  734. showReject.value = false
  735. addForm.value.remark = ''
  736. }
  737. const reset = function () {
  738. searchForm.value = {
  739. jwcode: '',
  740. markets: [],
  741. statuses: []
  742. }
  743. // 重置页码
  744. pagination.value.pageNum = 1
  745. dateRange.value = []
  746. getRefund()
  747. }
  748. const showAudit = function (row) {
  749. auditRow.value = row
  750. showAudit2.value = true
  751. }
  752. const defaultTime = [
  753. new Date(2000, 1, 1, 0, 0, 0),
  754. new Date(2000, 2, 1, 23, 59, 59),
  755. ]
  756. const disabledDate = (time) => {
  757. const limitDate = new Date(2025, 0, 1);
  758. return time.getTime() < limitDate.getTime();
  759. }
  760. const handlePageSizeChange = function (val) {
  761. pagination.value.pageSize = val
  762. getRefund()
  763. }
  764. const handleCurrentChange = function (val) {
  765. pagination.value.pageNum = val
  766. getRefund()
  767. }
  768. onMounted(() => {
  769. getRefund()
  770. getMarket()
  771. })
  772. </script>
  773. <style scoped lang="scss">
  774. :deep(.el-table__header-wrapper),
  775. :deep(.el-table__body-wrapper),
  776. :deep(.el-table__cell),
  777. :deep(.el-table__body td) {
  778. background-color: #F3FAFE !important;
  779. }
  780. :deep(.el-table__header th) {
  781. background-color: #F3FAFE !important;
  782. }
  783. .condition {
  784. width: 90vw;
  785. display: flex;
  786. flex-direction: column;
  787. align-items: flex-start;
  788. gap: 0.8vh;
  789. .item1 {
  790. width: 16%;
  791. display: flex;
  792. align-items: center;
  793. margin-right: 1vw;
  794. }
  795. .item2 {
  796. width: 18%;
  797. display: flex;
  798. align-items: center;
  799. margin-right: 0.5vw;
  800. }
  801. .condition-row {
  802. display: flex;
  803. align-items: center;
  804. width: 100%;
  805. }
  806. .condition-actions {
  807. margin-left: 2vw;
  808. display: flex;
  809. align-items: center;
  810. gap: 0.5vw;
  811. }
  812. }
  813. .audit1 {
  814. height: 47vh;
  815. .audit-item {
  816. display: flex;
  817. align-items: center;
  818. margin-bottom: 1vh;
  819. }
  820. }
  821. .audit2 {
  822. display: flex;
  823. justify-content: center;
  824. height: auto;
  825. min-height: 40vh;
  826. .top {
  827. width: 30vw;
  828. height: 22vh;
  829. .top-item {
  830. display: flex;
  831. align-items: center;
  832. margin-bottom: 1vh;
  833. }
  834. }
  835. .smallTitle {
  836. background-color: white;
  837. color: rgb(64, 158, 255);
  838. border-color: rgb(64, 158, 255);
  839. margin-bottom: 0.5vh;
  840. }
  841. .center {
  842. display: flex;
  843. width: 30vw;
  844. height: 35vh;
  845. .dialog-item {
  846. display: flex;
  847. align-items: center;
  848. margin-bottom: 1vh;
  849. }
  850. .center-left {
  851. width: 60%;
  852. height: 35vh;
  853. .image {
  854. width: 4vw !important;
  855. height: 4vw !important;
  856. }
  857. :deep(.el-upload--picture-card) {
  858. width: 4vw !important;
  859. height: 4vw !important;
  860. padding: 0 !important;
  861. }
  862. .center-item {
  863. display: flex;
  864. align-items: center;
  865. margin-bottom: 1vh;
  866. }
  867. }
  868. .center-right {
  869. height: 35vh;
  870. .right-item {
  871. display: flex;
  872. align-items: center;
  873. margin-bottom: 1vh;
  874. }
  875. }
  876. }
  877. .bottom {
  878. width: 30vw;
  879. height: 12vh;
  880. .bottom-item {
  881. display: flex;
  882. align-items: center;
  883. margin-bottom: 1vh;
  884. }
  885. }
  886. }
  887. .steps {
  888. .steps-content {
  889. padding-top: 15vw;
  890. }
  891. .steps-status {
  892. display: flex;
  893. align-items: center;
  894. justify-content: center;
  895. }
  896. .reject-reason {
  897. margin-top: 2vh;
  898. width: 40%;
  899. margin-left: 30%;
  900. background-color: white;
  901. padding: 1vh;
  902. border-radius: 10px;
  903. margin-bottom: 10vh;
  904. }
  905. .steps-btn {
  906. height: 15vh;
  907. display: flex;
  908. justify-content: center;
  909. align-items: center;
  910. }
  911. }
  912. </style>