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.

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