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.

994 lines
39 KiB

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