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.

922 lines
38 KiB

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