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.

907 lines
38 KiB

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