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.

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