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.

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