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.

931 lines
38 KiB

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
3 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 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
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
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
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 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 ref="tableRef" :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="130">
  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, nextTick } 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 tableRef = ref(null)
  364. const scrollTableTop = () => {
  365. tableRef.value?.setScrollTop?.(0)
  366. }
  367. const showAudit = ref(false)
  368. const auditRow = ref({})// 审核回显
  369. const showSteps = ref(false)
  370. const uploadRef = ref(null)
  371. const submitter = ref('')// 提交人
  372. const areaFinance = ref('')// 地区财务
  373. const areaCharge = ref('')// 地区负责人
  374. const headFinance = ref('')// 总部财务
  375. const executor = ref('')// 指定执行人
  376. const exportListVisible = ref(false)
  377. const exportList = ref([])
  378. // 导出列表加载状态
  379. const exportListLoading = ref(false)
  380. const statusStepMap = {
  381. 10: [1, false],
  382. 12: [2, true],
  383. 20: [3, false],
  384. 22: [4, true],
  385. 30: [5, false],
  386. 32: [6, true],
  387. 40: [7, false],
  388. 41: [8, false]
  389. }
  390. const currencies = computed(() => [
  391. t('cash.currency.usd'),
  392. t('cash.currency.hkd'),
  393. t('cash.currency.sgd'),
  394. t('cash.currency.myr'),
  395. t('cash.currency.thb'),
  396. t('cash.currency.cad'),
  397. t('cash.currency.vnd'),
  398. t('cash.currency.krw')
  399. ])
  400. const channelOptions = computed(() => [
  401. t('cash.payMethods.stripe'),
  402. t('cash.payMethods.paymentAsia'),
  403. t('cash.payMethods.ipay88'),
  404. t('cash.payMethods.bankTransfer'),
  405. t('cash.payMethods.card'),
  406. t('cash.payMethods.cash'),
  407. t('cash.payMethods.check'),
  408. t('cash.payMethods.grabpay'),
  409. t('cash.payMethods.nets'),
  410. t('cash.payMethods.transfer'),
  411. t('cash.payMethods.iotPay'),
  412. t('cash.payMethods.stripe3'),
  413. t('cash.payMethods.paypal')
  414. ])
  415. const statusList = computed(() => [
  416. t('cash.statusList.pending'),
  417. t('cash.statusList.passed'),
  418. t('cash.statusList.rejected'),
  419. t('cash.refundSuccess')
  420. ])
  421. // 查全部
  422. const getRefund = async function () {
  423. if (!hasMenuPermission(menuTree.value, permissionMapping.view_area_finance_refund)) {
  424. ElMessage.error(t('elmessage.noPermission'))
  425. return
  426. }
  427. try {
  428. const statusParam = ref([10, 12, 20, 22, 30, 32, 40, 41])
  429. if (searchForm.value.statuses === t('cash.statusList.passed')) {
  430. statusParam.value = [20, 30, 40]
  431. } else if (searchForm.value.statuses === t('cash.statusList.rejected')) {
  432. statusParam.value = [12, 22, 32]
  433. } else if (searchForm.value.statuses === t('cash.statusList.pending')) {
  434. statusParam.value = [10]
  435. } else if (searchForm.value.statuses === t('cash.refundSuccess')) {
  436. statusParam.value = [41]
  437. } else {
  438. statusParam.value = [10, 12, 20, 22, 30, 32, 40, 41]
  439. }
  440. const goodsName = searchForm.value.goodsName && searchForm.value.goodsName.length > 0
  441. ? searchForm.value.goodsName[searchForm.value.goodsName.length - 1] : ''
  442. if (searchForm.value.jwcode) {
  443. const isPositiveInteger = /^[1-9]\d*$/.test(searchForm.value.jwcode);
  444. if (!isPositiveInteger) {
  445. ElMessage.error(t('elmessage.checkJwcodeFormat'))
  446. return;
  447. }
  448. }
  449. // 增加精网号长度限制,防止后端400错误
  450. if (searchForm.value.jwcode.length > 8) {
  451. ElMessage.error(t('elmessage.limitJwcodeLength'))
  452. return;
  453. }
  454. const params = {
  455. pageNum: pagination.value.pageNum,
  456. pageSize: pagination.value.pageSize,
  457. cashRecordDTO: {
  458. jwcode: searchForm.value.jwcode,//精网号
  459. name: searchForm.value.name,//姓名
  460. markets: searchForm.value.markets && searchForm.value.markets.length > 0 ? [searchForm.value.markets[searchForm.value.markets.length - 1]] : [],
  461. goodsName: goodsName,//商品名
  462. statuses: statusParam.value,//10:地区财务待审核;12:地区财务驳回;
  463. // 20:地区负责人待审核;22:地区负责人驳回;
  464. // 30:总部财务待审核;32:总部财务驳回;
  465. // 40:执行人待处理;41:执行人已处理,退款完成;
  466. paymentCurrency: CurrencyForId(searchForm.value.paymentCurrency),//付款币种
  467. payType: searchForm.value.payType,//支付方式
  468. startTime: dateRange.value && dateRange.value[0] ? dayjs(dateRange.value[0]).format('YYYY-MM-DD HH:mm:ss') : "",
  469. endTime: dateRange.value && dateRange.value[1] ? dayjs(dateRange.value[1]).format('YYYY-MM-DD HH:mm:ss') : "",
  470. adminId: adminData.value.id
  471. }
  472. }
  473. const result = await API({
  474. url: '/Money/select',
  475. method: 'POST',
  476. data: params
  477. })
  478. tableData.value = result.data.list || []
  479. await nextTick()
  480. scrollTableTop()
  481. pagination.value.total = result.data.total || 0
  482. } catch (error) {
  483. ElMessage.error(error.message || t('elmessage.searchFailed'))
  484. }
  485. }
  486. // 审核通过
  487. const handlePass = async function () {
  488. if (!hasMenuPermission(menuTree.value, permissionMapping.audit_area_finance_refund)) {
  489. ElMessage.error(t('elmessage.noPermission'))
  490. return
  491. }
  492. try {
  493. const params = {
  494. id: auditRow.value.id,
  495. status: 20,
  496. areaFinance: adminData.value.adminName,
  497. auditId: auditRow.value.auditId,
  498. relatedId: auditRow.value.relatedId
  499. }
  500. const result = await API({
  501. url: '/Money/review',
  502. data: params
  503. })
  504. if (result.code === 200) {
  505. ElMessage.success(t('elmessage.approveSuccess'))
  506. showAudit.value = false
  507. getRefund()
  508. }
  509. } catch (error) {
  510. ElMessage.error(error.message || t('elmessage.approveFailed'))
  511. }
  512. }
  513. // 审核驳回
  514. const handleReject = async function () {
  515. if (!hasMenuPermission(menuTree.value, permissionMapping.audit_area_finance_refund)) {
  516. ElMessage.error(t('elmessage.noPermission'))
  517. return
  518. }
  519. try {
  520. const params = {
  521. id: auditRow.value.id,
  522. status: 12,
  523. rejectReason: addForm.value.remark,
  524. areaFinance: adminData.value.adminName,
  525. auditId: auditRow.value.auditId,
  526. orderCode: auditRow.value.orderCode,
  527. relatedId: auditRow.value.relatedId
  528. }
  529. const result = await API({
  530. url: '/Money/review',
  531. data: params
  532. })
  533. if (result.code === 200) {
  534. ElMessage.success(t('elmessage.rejectSuccess'))
  535. showAudit.value = false
  536. getRefund()
  537. addForm.value.remark = ''
  538. showReject.value = false
  539. }
  540. } catch (error) {
  541. ElMessage.error(error.message || t('elmessage.approveFailed'))
  542. }
  543. }
  544. const getMarket = async function () {
  545. try {
  546. const result = await API({
  547. url: '/market/selectMarket',
  548. })
  549. console.log('看看地区树', result)
  550. const transformTree = (nodes) => {
  551. const allChildren = nodes.flatMap(node => node.children || []);
  552. return allChildren.map(child => {
  553. const grandchildren = child.children && child.children.length
  554. ? transformTree([child])
  555. : null;
  556. return {
  557. value: child.id,
  558. label: child.name,
  559. children: grandchildren
  560. };
  561. });
  562. };
  563. market.value = transformTree(result.data)
  564. console.log('转换后的地区树==============', market.value)
  565. } catch (error) {
  566. console.log('请求失败', error)
  567. }
  568. }
  569. const rejectReason = ref('')
  570. const showStep = function (row) {
  571. if (!hasMenuPermission(menuTree.value, permissionMapping.track_area_finance_refund_progress)) {
  572. ElMessage.error(t('elmessage.noPermission'))
  573. return
  574. }
  575. rejectReason.value = row.rejectReason || ''
  576. isReject.value = false
  577. submitter.value = row.submitter || ''
  578. areaFinance.value = row.areaFinance || ''
  579. areaCharge.value = row.areaCharge || ''
  580. headFinance.value = row.headFinance || ''
  581. executor.value = row.executorName || ''
  582. currentStep.value = 1
  583. const status = row.status
  584. if (statusStepMap[status]) {
  585. const [step, reject] = statusStepMap[status]
  586. currentStep.value = step
  587. isReject.value = reject
  588. }
  589. console.log('步骤条状态', currentStep.value)
  590. showSteps.value = true
  591. }
  592. const exportExcel = async function () {
  593. const statusParam = ref([10, 20, 22, 30, 32, 40, 41])
  594. if (searchForm.value.statuses === t('cash.statusList.passed')) {
  595. statusParam.value = [20, 30, 40]
  596. } else if (searchForm.value.statuses === t('cash.statusList.rejected')) {
  597. statusParam.value = [12, 22, 32]
  598. } else if (searchForm.value.statuses === t('cash.statusList.pending')) {
  599. statusParam.value = [10]
  600. } else if (searchForm.value.statuses === t('cash.refundSuccess')) {
  601. statusParam.value = [41]
  602. } else {
  603. statusParam.value = [10,12, 20, 22, 30, 32, 40, 41]
  604. }
  605. const goodsName = searchForm.value.goodsName && searchForm.value.goodsName.length > 0
  606. ? searchForm.value.goodsName[searchForm.value.goodsName.length - 1] : '';
  607. if (searchForm.value.jwcode) {
  608. const isPositiveInteger = /^[1-9]\d*$/.test(searchForm.value.jwcode);
  609. if (!isPositiveInteger) {
  610. ElMessage.error(t('elmessage.checkJwcodeFormat'))
  611. return;
  612. }
  613. }
  614. // 增加精网号长度限制,防止后端400错误
  615. if (searchForm.value.jwcode.length > 8) {
  616. ElMessage.error(t('elmessage.limitJwcodeLength'))
  617. return;
  618. }
  619. const params = {
  620. pageNum: pagination.value.pageNum,
  621. pageSize: pagination.value.pageSize,
  622. cashRecordDTO: {
  623. jwcode: searchForm.value.jwcode,//精网号
  624. name: searchForm.value.name,//姓名
  625. markets: searchForm.value.markets && searchForm.value.markets.length > 0 ? [searchForm.value.markets[searchForm.value.markets.length - 1]] : [],
  626. goodsName: goodsName,//商品名
  627. statuses: statusParam.value,//10:地区财务待审核;12:地区财务驳回;
  628. // 20:地区负责人待审核;22:地区负责人驳回;
  629. // 30:总部财务待审核;32:总部财务驳回;
  630. // 40:执行人待处理;41:执行人已处理,退款完成;
  631. paymentCurrency: CurrencyForId(searchForm.value.paymentCurrency),//付款币种
  632. payType: searchForm.value.payType,//支付方式
  633. startTime: dateRange.value && dateRange.value[0] ? dayjs(dateRange.value[0]).format('YYYY-MM-DD HH:mm:ss') : "",
  634. endTime: dateRange.value && dateRange.value[1] ? dayjs(dateRange.value[1]).format('YYYY-MM-DD HH:mm:ss') : "",
  635. adminId: adminData.value.id
  636. }
  637. }
  638. const res = await API({ url: '/export/exportFinance', data: params })
  639. if (res.code === 200) {
  640. ElMessage.success(t('elmessage.exportSuccess'))
  641. } else {
  642. ElMessage.error(res.msg || t('elmessage.exportFailed'))
  643. }
  644. }
  645. const openExportList = () => {
  646. getExportList()
  647. exportListVisible.value = true
  648. }
  649. const getExportList = async () => {
  650. exportListLoading.value = true
  651. try {
  652. const result = await API({ url: '/export/export' })
  653. if (result.code === 200) {
  654. const filteredData = result.data.filter(item => {
  655. return item.type === 12
  656. })
  657. exportList.value = filteredData
  658. } else {
  659. ElMessage.error(result.msg || t('elmessage.getExportListError'))
  660. }
  661. } catch (error) {
  662. console.error('获取导出列表出错:', error)
  663. ElMessage.error(t('elmessage.getExportListError'))
  664. } finally {
  665. exportListLoading.value = false
  666. }
  667. }
  668. const downloadExportFile = (item) => {
  669. if (item.state === 2) {
  670. const link = document.createElement('a')
  671. link.href = item.url
  672. link.download = item.fileName
  673. link.click()
  674. } else {
  675. ElMessage.warning(t('elmessage.exportingInProgress'))
  676. }
  677. }
  678. //根据状态返回对应的标签类型
  679. const getTagType = (state) => {
  680. switch (state) {
  681. case 0:
  682. return 'info';
  683. case 1:
  684. return 'primary';
  685. case 2:
  686. return 'success';
  687. case 3:
  688. return 'danger';
  689. default:
  690. return 'info';
  691. }
  692. }
  693. //根据状态返回对应的标签文案
  694. const getTagText = (state) => {
  695. switch (state) {
  696. case 0:
  697. return t('elmessage.pendingExecution');
  698. case 1:
  699. return t('elmessage.executing');
  700. case 2:
  701. return t('elmessage.executed');
  702. case 3:
  703. return t('elmessage.errorExecution');
  704. default:
  705. return t('elmessage.unknownStatus');
  706. }
  707. }
  708. const showAudit2 = function (row) {
  709. auditRow.value = row
  710. showAudit.value = true
  711. }
  712. const reset = function () {
  713. searchForm.value = {
  714. jwcode: '',
  715. markets: [],
  716. statuses: []
  717. }
  718. // 重置页码
  719. pagination.value.pageNum = 1
  720. dateRange.value = []
  721. getRefund()
  722. }
  723. const hideReject = function () {
  724. showReject.value = false
  725. addForm.value.remark = ''
  726. }
  727. const defaultTime = [
  728. new Date(2000, 1, 1, 0, 0, 0),
  729. new Date(2000, 2, 1, 23, 59, 59),
  730. ]
  731. const disabledDate = (time) => {
  732. const limitDate = new Date(2025, 0, 1);
  733. return time.getTime() < limitDate.getTime();
  734. }
  735. const handlePageSizeChange = function (val) {
  736. pagination.value.pageSize = val
  737. getRefund()
  738. }
  739. const handleCurrentChange = function (val) {
  740. pagination.value.pageNum = val
  741. getRefund()
  742. }
  743. onMounted(() => {
  744. console.log('???????????????????', adminData.value)
  745. getRefund()
  746. getMarket()
  747. })
  748. </script>
  749. <style scoped lang="scss">
  750. :deep(.el-table__header-wrapper),
  751. :deep(.el-table__body-wrapper),
  752. :deep(.el-table__cell),
  753. :deep(.el-table__body td) {
  754. background-color: #F3FAFE !important;
  755. }
  756. :deep(.el-table__header th) {
  757. background-color: #F3FAFE !important;
  758. }
  759. .condition {
  760. width: 90vw;
  761. display: flex;
  762. flex-direction: column;
  763. align-items: flex-start;
  764. gap: 0.8vh;
  765. .item1 {
  766. width: 16%;
  767. display: flex;
  768. align-items: center;
  769. margin-right: 1vw;
  770. }
  771. .item2 {
  772. width: 18%;
  773. display: flex;
  774. align-items: center;
  775. margin-right: 0.5vw;
  776. }
  777. .condition-row {
  778. display: flex;
  779. align-items: center;
  780. width: 100%;
  781. }
  782. .condition-actions {
  783. margin-left: 2vw;
  784. display: flex;
  785. align-items: center;
  786. gap: 0.5vw;
  787. }
  788. }
  789. .audit {
  790. display: flex;
  791. justify-content: center;
  792. height: auto;
  793. min-height: 40vh;
  794. .top {
  795. width: 30vw;
  796. height: 22vh;
  797. .top-item {
  798. display: flex;
  799. align-items: center;
  800. margin-bottom: 1vh;
  801. }
  802. }
  803. .smallTitle {
  804. background-color: white;
  805. color: rgb(64, 158, 255);
  806. border-color: rgb(64, 158, 255);
  807. margin-bottom: 0.5vh;
  808. }
  809. .center {
  810. display: flex;
  811. width: 30vw;
  812. height: 35vh;
  813. .dialog-item {
  814. display: flex;
  815. align-items: center;
  816. margin-bottom: 1vh;
  817. }
  818. .center-left {
  819. width: 60%;
  820. height: 35vh;
  821. .image {
  822. width: 4vw !important;
  823. height: 4vw !important;
  824. }
  825. :deep(.el-upload--picture-card) {
  826. width: 4vw !important;
  827. height: 4vw !important;
  828. padding: 0 !important;
  829. }
  830. .center-item {
  831. display: flex;
  832. align-items: center;
  833. margin-bottom: 1vh;
  834. }
  835. }
  836. .center-right {
  837. height: 35vh;
  838. .right-item {
  839. display: flex;
  840. align-items: center;
  841. margin-bottom: 1vh;
  842. }
  843. }
  844. }
  845. .bottom {
  846. width: 30vw;
  847. height: auto;
  848. padding-bottom: 1vh;
  849. .bottom-item {
  850. display: flex;
  851. align-items: center;
  852. margin-bottom: 1vh;
  853. }
  854. }
  855. }
  856. .steps {
  857. .steps-content {
  858. padding-top: 15vw;
  859. }
  860. .steps-status {
  861. display: flex;
  862. align-items: center;
  863. justify-content: center;
  864. }
  865. .reject-reason {
  866. margin-top: 2vh;
  867. width: 40%;
  868. margin-left: 30%;
  869. background-color: white;
  870. padding: 1vh;
  871. border-radius: 10px;
  872. margin-bottom: 10vh;
  873. }
  874. .steps-btn {
  875. height: 15vh;
  876. display: flex;
  877. justify-content: center;
  878. align-items: center;
  879. }
  880. }
  881. </style>