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.

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