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.

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