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.

1842 lines
77 KiB

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
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
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
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
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
4 months ago
4 months ago
3 months ago
  1. <template>
  2. <div class="content">
  3. <div class="div-card1">
  4. <el-card class="card1" style="margin-bottom: 0.5vh; min-height: 110px;">
  5. <div class="row1">
  6. <div class="rowItem">
  7. <el-text style="width: 4vw;">{{ t('common.jwcode') }}</el-text>
  8. <el-input v-model="searchData.jwcode" :placeholder="t('common.jwcodePlaceholder')"
  9. style="width:10vw;" clearable></el-input>
  10. </div>
  11. <div class="rowItem">
  12. <el-text style="width: 4vw;">{{ t('common.customerName') }}</el-text>
  13. <el-input v-model="searchData.name" :placeholder="t('common.customerNamePlaceholder')"
  14. style="width:10vw;" clearable></el-input>
  15. </div>
  16. <div class="rowItem">
  17. <el-text style="width: 4vw;">{{ t('common.market') }}</el-text>
  18. <el-cascader style="width: 9vw;" v-model="searchData.markets" :options="market"
  19. :placeholder="t('common.marketPlaceholder')" clearable @change="handleMarketChange" />
  20. </div>
  21. <!-- 地区财务固定显示付款币种删除客服的订单状态 -->
  22. <div class="rowItem">
  23. <el-text style="width: 4vw;">{{ t('common.payCurrency') }}</el-text>
  24. <el-select v-model="searchData.paymentCurrency"
  25. :placeholder="t('common.payCurrencyPlaceholder')" style="width: 10vw;" clearable>
  26. <el-option v-for="item in customOptions" :key="item" :label="item" :value="item" />
  27. </el-select>
  28. </div>
  29. <div class="rowItem">
  30. <el-text style="width: 4vw;">{{ t('common.payModel') }}</el-text>
  31. <el-select v-model="searchData.payType" :placeholder="t('common.payModelPlaceholder')"
  32. style="width: 10vw;" clearable>
  33. <el-option v-for="item in paytypeList" :key="item" :label="item" :value="item" />
  34. </el-select>
  35. </div>
  36. </div>
  37. <div class="row2" style="margin-top: 10px;">
  38. <div class="left">
  39. <div class="rowItem">
  40. <el-text style="width: 4vw;">{{ t('common.activityName') }}</el-text>
  41. <el-select v-model="searchData.activity" :placeholder="t('common.activityNameChoose')"
  42. style="width: 10vw;" clearable>
  43. <el-option v-for="item in activityList" :key="item.id" :label="item.activityName"
  44. :value="item.id" />
  45. </el-select>
  46. </div>
  47. <div class="rowItem">
  48. <el-text style="width: 4vw;">{{ t('common.productName') }}</el-text>
  49. <el-cascader v-model="searchData.goodsName" :options="productList" style="width: 10vw;"
  50. clearable />
  51. </div>
  52. <div class="rowItem" style="width: 25vw">
  53. <el-text style="width: 4vw; margin-left: 0.5vw;">{{ t('common.payTime') }}</el-text>
  54. <el-date-picker v-model="getTime" type="datetimerange" :range-separator="t('common.to')"
  55. :start-placeholder="t('common.startTime')" :end-placeholder="t('common.endTime')"
  56. style="width: 22vw; " @change="handleDatePickerChange" :default-time="defaultTime"
  57. :disabled-date="disabledDate" />
  58. </div>
  59. </div>
  60. <el-button style="width: 3vw;" type="primary" @click="search">{{ t('common.search') }}</el-button>
  61. <el-button style="width: 3vw;" type="success" @click="reset">{{ t('common.reset') }}</el-button>
  62. <el-button v-if="activeTab == 'done'" style="width: 5vw;" type="warning" @click="exportExcel">{{
  63. t('common.exportExcel') }}</el-button>
  64. <el-button v-if="activeTab == 'done'" style="width: 6vw;" type="primary" @click="openExportList">{{
  65. t('common.viewExportList') }}</el-button>
  66. </div>
  67. </el-card>
  68. </div>
  69. <div class="div-card2">
  70. <el-card class="card2">
  71. <div class="btns">
  72. <!-- 地区财务专属标签页待审核/已通过/已完成/已驳回 -->
  73. <div class="tabs">
  74. <el-button-group>
  75. <el-button class="btnItem"
  76. :style="{ backgroundColor: activeTab === 'wait' ? '#2741DE' : '#E5EBFE', color: activeTab === 'wait' ? 'white' : '#666' }"
  77. @click="navigateTo('wait')">
  78. {{ t('common.pendingAudit') }}
  79. </el-button>
  80. <el-button class="btnItem"
  81. :style="{ backgroundColor: activeTab === 'pass' ? '#2741DE' : '#E5EBFE', color: activeTab === 'pass' ? 'white' : '#666' }"
  82. @click="navigateTo('pass')">
  83. {{ t('common.passed') }}
  84. </el-button>
  85. <el-button class="btnItem"
  86. :style="{ backgroundColor: activeTab === 'done' ? '#2741DE' : '#E5EBFE', color: activeTab === 'done' ? 'white' : '#666' }"
  87. @click="navigateTo('done')">
  88. {{ t('common.completed') }}
  89. </el-button>
  90. <el-button class="btnItem"
  91. :style="{ backgroundColor: activeTab === 'reject' ? '#2741DE' : '#E5EBFE', color: activeTab === 'reject' ? 'white' : '#666' }"
  92. @click="navigateTo('reject')">
  93. {{ t('common.rejected') }}
  94. </el-button>
  95. </el-button-group>
  96. <div class="info-tooltip">
  97. <el-popover placement="top" :title="t('cash.receiveCashDataTitle')" :width="260"
  98. trigger="hover" :content="t('cash.receiveCashDataContent')"
  99. popper-class="custom-popover" :show-arrow="false">
  100. <template #reference>
  101. <el-icon class="service-icon">
  102. <Warning />
  103. </el-icon>
  104. </template>
  105. </el-popover>
  106. </div>
  107. </div>
  108. <!-- 删除客服的添加收款按钮 -->
  109. <div class="btnAdd"></div>
  110. </div>
  111. <div class="table">
  112. <el-table :data="tableData" style="width: 80vw;height:64vh;" @sort-change="handleSortChange"
  113. :row-style="{ height: '60px' }" :header-cell-style="{ textAlign: 'center' }"
  114. :cell-style="{ textAlign: 'center' }">
  115. <el-table-column type="index" :label="t('common_list.id')" width="100px" fixed="left">
  116. <template #default="scope">
  117. <span>{{ scope.$index + 1 + (pageInfo.pageNum - 1) * pageInfo.pageSize }}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column fixed="left" prop="jwcode" label="Homily ID" width="110px" />
  121. <el-table-column fixed="left" prop="name" :label="t('common_list.name')" width="110px" />
  122. <el-table-column prop="marketName" :label="t('common_list.market')" width="80px" />
  123. <el-table-column prop="activity" :label="t('common_list.activity')" width="120px"
  124. show-overflow-tooltip />
  125. <el-table-column prop="goodsName" :label="t('common_list.productName')" width="120px" />
  126. <el-table-column prop="goodNum" :label="t('common_list.productNum')" width="130px">
  127. <template #default="scope">
  128. <span v-if="scope.row.goodsName == t('common_list.goldRecharge')">{{
  129. scope.row.permanentGold }}</span>
  130. <span v-else>{{ scope.row.goodNum }}</span>
  131. </template>
  132. </el-table-column>
  133. <el-table-column prop="paymentCurrency" :label="t('common_list.payCurrency')" width="120px" />
  134. <el-table-column prop="paymentAmount" :label="t('common_list.payAmount')" width="120px" />
  135. <!-- 地区财务显示到账币种/金额/手续费已通过/已完成标签页 -->
  136. <el-table-column prop="receivedCurrency" :label="t('common_list.receiveCurrency')"
  137. v-if="activeTab == 'pass' || activeTab == 'done'" width="150px"></el-table-column>
  138. <el-table-column prop="receivedAmount" :label="t('common_list.receiveAmount')"
  139. v-if="activeTab == 'pass' || activeTab == 'done'" width="150px">
  140. <template #default="scope">
  141. <div v-if="!scope.row.receivedAmount">
  142. <text style="color: #FA5A1E;">{{ t('common_list.toSupply') }}</text>
  143. </div>
  144. </template>
  145. </el-table-column>
  146. <el-table-column prop="handlingCharge" :label="t('common_list.fee')"
  147. v-if="activeTab == 'pass' || activeTab == 'done'" width="150px">
  148. <template #default="scope">
  149. <div v-if="scope.row.handlingCharge == null">
  150. <text style="color: #FA5A1E;">{{ t('common_list.toSupply') }}</text>
  151. </div>
  152. </template>
  153. </el-table-column>
  154. <el-table-column prop="payType" :label="t('common_list.payModel')" width="130px" />
  155. <el-table-column prop="payTime" :label="t('common_list.payTime')" width="180px" />
  156. <el-table-column prop="voucher" :label="t('common_list.transferVoucher')" width="110px">
  157. <template #default="scope">
  158. <div v-if="scope.row.voucher"
  159. style="display: flex; justify-content: center; align-items: center; cursor: pointer;"
  160. @click="previewImage(scope.row.voucher)">
  161. <img :src="scope.row.voucher" :alt="t('common_list.payVoucher')"
  162. style="width: auto; height: 40px;">
  163. </div>
  164. <div v-else
  165. style="display: flex; justify-content: center; align-items: center; height: 40px;">
  166. </div>
  167. </template>
  168. </el-table-column>
  169. <el-table-column prop="submitterName" :label="t('common_list.submitter')" width="150px"
  170. show-overflow-tooltip></el-table-column>
  171. <!-- 地区财务显示审核人已通过/已驳回/已完成标签页 -->
  172. <el-table-column prop="auditName" :label="t('common_list.approver')"
  173. v-if="activeTab == 'pass' || activeTab == 'reject' || activeTab == 'done'" width="150px"
  174. show-overflow-tooltip></el-table-column>
  175. <el-table-column prop="receivedTime" :label="t('common_list.receiveTime')"
  176. v-if="activeTab == 'pass' || activeTab == 'done'" width="180px" />
  177. <el-table-column prop="remark" :label="t('common_list.remark')" v-if="activeTab != 'reject'"
  178. width="150px" show-overflow-tooltip></el-table-column>
  179. <el-table-column prop="status" fixed="right" :label="t('common_list.orderStatus')"
  180. v-if="activeTab == 'done'" width="150px" show-overflow-tooltip>
  181. <template #default="scope">
  182. <span style="color: rgb(242, 84, 83);" v-if="scope.row.status == 6">{{
  183. t('common_list.refund') }}</span>
  184. <span style="color: rgb(127,204,133);" v-else>{{ t('common_list.normal') }}</span>
  185. </template>
  186. </el-table-column>
  187. <el-table-column prop="auditTime" :label="t('common_list.rejectTime')"
  188. v-if="activeTab == 'reject'" width="180px" show-overflow-tooltip></el-table-column>
  189. <el-table-column prop="rejectReason" :label="t('common_list.rejectReason')"
  190. v-if="activeTab == 'reject'" width="150px">
  191. <template #default="scope">
  192. <div class="ellipsis-container"
  193. @mouseenter="handleMouseEnter($event, scope.row.rejectReason)"
  194. @mouseleave="handleMouseLeave" @mousemove="handleMouseMove($event)">
  195. <span class="ellipsis-text">
  196. {{ scope.row.rejectReason || '—' }}
  197. </span>
  198. <!-- 自定义提示框 -->
  199. <div v-if="showTooltip && tooltipContent" class="custom-tooltip" :style="{
  200. left: `${tooltipLeft}px`,
  201. top: `${tooltipTop}px`
  202. }">
  203. {{ tooltipContent }}
  204. </div>
  205. </div>
  206. </template>
  207. </el-table-column>
  208. <!-- 地区财务表格操作待审核审核已通过编辑 -->
  209. <el-table-column fixed="right" :label="t('common_list.operation')" width="120px" v-if="activeTab != 'reject'">
  210. <template #default=scope>
  211. <el-link v-if="activeTab == 'wait'" style="color: #2741DE;"
  212. @click="openAuditForm(scope.row)">{{ t('common.audit') }}</el-link>
  213. <el-link
  214. v-else-if="activeTab == 'pass' && !(scope.row.status == 6 || scope.row.status == 4) && scope.row.receivedMarket == adminData.markets"
  215. style="color: #2741DE;" @click="openEditForm(scope.row)">{{ t('common.edit')
  216. }}</el-link>
  217. <el-link
  218. v-else-if="activeTab == 'done' && scope.row.status == 4 && startsWith(scope.row.orderCode, 'GOLDCOIN')"
  219. style="color: rgb(242, 84, 83);" @click="openRefundConfirm(scope.row)">{{
  220. t('common.refund') }}</el-link>
  221. </template>
  222. </el-table-column>
  223. </el-table>
  224. </div>
  225. <div class="pagination">
  226. <el-pagination background :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize"
  227. :page-sizes="[5, 10, 20, 50, 100]" layout="total, sizes, prev, pager, next, jumper"
  228. :total="total" @size-change="handlePagination('size', $event)"
  229. @current-change="handlePagination('page', $event)"></el-pagination>
  230. </div>
  231. </el-card>
  232. </div>
  233. <!-- 退款确认弹窗 -->
  234. <div class="recallDialog" v-show="refundConfirmDialog">
  235. <div class="close">
  236. <button @click="closeConfirmRefund" class="Btn">{{ t('common.close') }}</button>
  237. </div>
  238. <div class="text">
  239. <text class="txt">{{ textContent }}</text>
  240. </div>
  241. <div class="cancle">
  242. <button @click="closeConfirmRefund" class="Btn">{{ t('common.cancel') }}</button>
  243. </div>
  244. <div class="confirm">
  245. <button @click="openRefundDialog" class="Btn">{{ t('common.confirm') }}</button>
  246. </div>
  247. </div>
  248. <!-- 导出列表 -->
  249. <el-dialog v-model="exportListVisible" :title="t('common_export.exportList')" width="60vw">
  250. <el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading">
  251. <el-table-column prop="fileName" :label="t('common_export.fileName')" />
  252. <el-table-column prop="state" :label="t('common_export.status')">
  253. <template #default="scope">
  254. <el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
  255. {{ getTagText(scope.row.state) }}
  256. </el-tag>
  257. </template>
  258. </el-table-column>
  259. <el-table-column prop="createTime" :label="t('common_export.createTime')">
  260. <template #default="scope">
  261. {{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
  262. </template>
  263. </el-table-column>
  264. <el-table-column :label="t('common_export.operation')">
  265. <template #default="scope">
  266. <el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
  267. :disabled="scope.row.state !== 2">
  268. {{ t('common_export.download') }}
  269. </el-button>
  270. </template>
  271. </el-table-column>
  272. </el-table>
  273. <template #footer>
  274. <div class="dialog-footer">
  275. <el-button text @click="exportListVisible = false">{{ t('common_export.close') }}</el-button>
  276. </div>
  277. </template>
  278. </el-dialog>
  279. <!-- 审核弹窗 -->
  280. <el-dialog class="adddialog" v-model="auditFormisible" width="28vw" :before-close="closeAuditForm">
  281. <el-form class="addForm" label-width="4vw" label-position="left">
  282. <el-form-item :label="t('common_add.jwcode')">
  283. <el-input disabled="true" v-model="auditFormData.jwcode"
  284. :placeholder="t('common_add.rejectReasonPlaceholder')" />
  285. </el-form-item>
  286. <el-form-item :label="t('common_add.customerName')">
  287. <el-input disabled="true" v-model="auditFormData.name"
  288. :placeholder="t('common_add.customerNamePlaceholder')" />
  289. </el-form-item>
  290. <el-form-item :label="t('common_add.market')">
  291. <el-input disabled="true" v-model="auditFormData.market" />
  292. </el-form-item>
  293. <el-form-item :label="t('common_add.activity')">
  294. <el-input disabled="true" v-model="auditFormData.activity"
  295. :placeholder="t('common_add.activityPlaceholder')" />
  296. </el-form-item>
  297. <el-form-item :label="t('common_add.productName')">
  298. <el-select disabled="true" v-model="auditFormData.goodsName" />
  299. </el-form-item>
  300. <el-form-item v-if="!isGold" :label="t('common_add.productNum')">
  301. <div style="display: flex;">
  302. <el-input disabled="true" style="padding-right: 30px; flex: 3;" v-model="auditFormData.goodNum"
  303. :placeholder="t('common_add.productNumPlaceholder')" />
  304. <CurrencySelect disabled="true" v-model="auditFormData.numUnit" :items="numUnitList"
  305. style="flex: 1.5;" :placeholder="t('common_add.numUnit')" @change="handleCurrencyChange" />
  306. </div>
  307. </el-form-item>
  308. <div v-show="isGold" style="margin-bottom: 15px; display: flex;">
  309. <div style=" display: flex; ">
  310. <span style="color: #999999; display: flex; white-space: nowrap;align-items: center;">{{
  311. t('common_add.permanentGold') }}</span>
  312. <el-input disabled="true"
  313. style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;"
  314. v-model="auditFormData.permanentGold" />
  315. </div>
  316. <div style="padding-right: 5px; display: flex;">
  317. <span style="color: #999999; display: flex; white-space: nowrap;align-items: center;">{{
  318. t('common_add.freeGold') }}</span>
  319. <el-input disabled="true"
  320. style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;"
  321. v-model="auditFormData.freeGold" />
  322. </div>
  323. </div>
  324. <el-form-item :label="t('common_add.payCurrency')">
  325. <el-select disabled="true" v-model="auditFormData.paymentCurrency"
  326. :placeholder="t('common_add.payCurrencyPlaceholder')" @change="handleCurrencyChange" />
  327. </el-form-item>
  328. <el-form-item :label="t('common_add.payAmount')">
  329. <el-input disabled="true" v-model="auditFormData.paymentAmount"
  330. :placeholder="t('common_add.payAmountPlaceholder')" />
  331. </el-form-item>
  332. <el-form-item :label="t('common_add.payMethod')">
  333. <el-select disabled="true" v-model="auditFormData.payType" :items="paytypeOptions"
  334. :placeholder="t('common_add.payMethodPlaceholder')" />
  335. </el-form-item>
  336. <el-form-item :label="t('common_add.receiveArea')">
  337. <el-select disabled="true" v-model="auditFormData.receivedMarket"
  338. :placeholder="t('common_add.receiveArea')" />
  339. </el-form-item>
  340. <el-form-item :label="t('common_add.payTime')">
  341. <el-date-picker disabled="true" type="datetime" v-model="auditFormData.payTime"
  342. :placeholder="t('common_add.payTimePlaceholder')" />
  343. </el-form-item>
  344. <el-form-item :label="t('common_add.transferVoucher')">
  345. <div class="pic">
  346. <el-upload disabled="true" ref="uploadRef" class="uploader" :show-file-list="false"
  347. list-type="picture-card" :auto-upload="false" :before-upload="beforeUpload"
  348. :on-error="handelImgErr" :on-change="handleImageChange" :http-request="customUpload">
  349. <img v-if="auditFormData.voucher" :src="auditFormData.voucher" class="avatar"
  350. style="height: 100%; width: 100%; object-fit: cover;" />
  351. <el-icon v-else class="avatar-uploader-icon">
  352. <Plus />
  353. </el-icon>
  354. </el-upload>
  355. <el-text class="picText">
  356. {{ t('common_add.transferVoucherPlaceholder') }}
  357. </el-text>
  358. </div>
  359. </el-form-item>
  360. <el-form-item :label="t('common_add.remark')">
  361. <el-input disabled="true" v-model="auditFormData.remark" type="textarea" :rows="3" maxlength="100"
  362. show-word-limit />
  363. </el-form-item>
  364. <el-form-item :label="t('common_add.rejectReason')" v-if="ifReject" required>
  365. <el-input v-model="auditFormData.rejectReason" type="textarea" :rows="3"
  366. :placeholder="t('common_add.rejectReasonPlaceholder')" maxlength="100" show-word-limit />
  367. </el-form-item>
  368. </el-form>
  369. <template #footer>
  370. <span class="dialog-footer" v-if="!ifReject">
  371. <el-button style="background-color: #7E91FF;" @click="ifReject = true">{{ t('common.reject')
  372. }}</el-button>
  373. <el-button :style="{
  374. backgroundColor: isBtnDisabled ? '#E5E5E5FF' : '#2741DEFF',
  375. marginLeft: '60px',
  376. color: isBtnDisabled ? '#8A8A8A' : '#F3FAFE'
  377. }" @click="handelAudit" :disabled="isBtnDisabled">{{ btnText }}</el-button>
  378. </span>
  379. <span class="dialog-footer" v-if="ifReject">
  380. <el-button style="background-color: #7E91FF;" @click="closeAuditForm">{{ t('common.cancel')
  381. }}</el-button>
  382. <el-button style="background-color: #2741DE; margin-left: 2.5vw;" type="primary"
  383. @click="throttledhandelAuditReject">{{ t('common.confirm') }}</el-button>
  384. </span>
  385. </template>
  386. </el-dialog>
  387. <!-- 编辑填手续费弹窗 -->
  388. <el-dialog class="editdialog" v-model="editFormisible" width="28vw" :before-close="closeEditForm">
  389. <div class="content">
  390. <div class="left">
  391. <el-form class="editForm" label-width="6vw" label-position="left">
  392. <el-form-item :label="t('common_add.jwcode')">
  393. <el-input disabled="true" v-model="editFormData.jwcode"
  394. :placeholder="t('common_add.jwcode')" />
  395. </el-form-item>
  396. <el-form-item :label="t('common_add.customerName')">
  397. <el-input disabled="true" v-model="editFormData.name"
  398. :placeholder="t('common_add.customerName')" />
  399. </el-form-item>
  400. <el-form-item :label="t('common_add.market')">
  401. <el-input disabled="true" v-model="editFormData.marketName"
  402. :placeholder="t('common_add.market')" />
  403. </el-form-item>
  404. <el-form-item :label="t('common_add.activity')">
  405. <el-input disabled="true" v-model="editFormData.activity"
  406. :placeholder="t('common_add.activity')" />
  407. </el-form-item>
  408. <el-form-item :label="t('common_add.productName')">
  409. <el-select disabled="true" v-model="editFormData.goodsName"
  410. :placeholder="t('common_add.productName')" clearable></el-select>
  411. </el-form-item>
  412. <!-- 金币产品特殊显示 -->
  413. <el-form-item v-show="!isEditGold" :label="t('common_add.productNum')">
  414. <div style="display: flex;">
  415. <el-input disabled="true" style="padding-right: 30px; flex: 3;"
  416. v-model="editFormData.goodNum"
  417. :placeholder="t('common_add.productNumPlaceholder')" />
  418. <CurrencySelect disabled="true" v-model="editFormData.numUnit" :items="numUnitList"
  419. style="flex: 1.5;" :placeholder="t('common_add.numUnit')"
  420. @change="handleCurrencyChange" />
  421. </div>
  422. </el-form-item>
  423. <div v-show="isEditGold" style="margin-bottom: 15px; display: flex;">
  424. <div style=" display: flex; margin-right: 10px;">
  425. <span style="color: #999999; display: flex; white-space: nowrap;align-items: center;">{{
  426. t('common_add.permanentGold') }}</span>
  427. <el-input disabled="true"
  428. style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;"
  429. v-model="editFormData.permanentGold" />
  430. </div>
  431. <div style="padding-right: 5px; display: flex;">
  432. <span style="color: #999999; display: flex; white-space: nowrap;align-items: center;">{{
  433. t('common_add.freeGold') }}</span>
  434. <el-input disabled="true"
  435. style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;"
  436. v-model="editFormData.freeGold" />
  437. </div>
  438. </div>
  439. <el-form-item :label="t('common_add.payCurrency')">
  440. <CurrencySelect :disabled="!ifOnline" v-model="editFormData.paymentCurrency"
  441. :items="customOptions" :placeholder="t('common_add.payCurrency')" />
  442. </el-form-item>
  443. <el-form-item :label="t('common_add.payAmount')">
  444. <el-input :disabled="!ifOnline" v-model="editFormData.paymentAmount"
  445. :placeholder="t('common_add.payAmount')" />
  446. </el-form-item>
  447. <el-form-item :label="t('common_add.payMethod')">
  448. <el-select disabled="true" v-model="editFormData.payType"
  449. :placeholder="t('common_add.payMethod')" clearable></el-select>
  450. </el-form-item>
  451. <el-form-item :label="t('common_add.receiveArea')">
  452. <el-select disabled="true" v-model="editFormData.receivedMarket"
  453. :placeholder="t('common_add.receiveArea')" clearable></el-select>
  454. </el-form-item>
  455. <el-form-item :label="t('common_add.payTime')">
  456. <el-date-picker disabled="true" type="datetime" v-model="editFormData.payTime"
  457. :placeholder="t('common_add.payTime')" />
  458. </el-form-item>
  459. <el-form-item :label="t('common_add.transferVoucher')">
  460. <div class="pic">
  461. <el-upload disabled="true" ref="uploadRef" class="uploader" :show-file-list="false"
  462. list-type="picture-card" :auto-upload="false" :before-upload="beforeUpload"
  463. :on-error="handelImgErr" :on-change="handleImageChange"
  464. :http-request="customUpload">
  465. <img v-if="editFormData.voucher" :src="editFormData.voucher" class="avatar"
  466. style="height: 100%; width: 100%; object-fit: cover;" />
  467. <el-icon v-else class="avatar-uploader-icon">
  468. <Plus />
  469. </el-icon>
  470. </el-upload>
  471. <el-text class="picText">{{ t('common_add.transferVoucherPlaceholder') }}</el-text>
  472. </div>
  473. </el-form-item>
  474. <el-form-item :label="t('common_add.remark')">
  475. <el-input disabled="true" v-model="editFormData.remark" type="textarea" :rows="4"
  476. :placeholder="t('common_add.remark')" maxlength="100" show-word-limit />
  477. </el-form-item>
  478. </el-form>
  479. </div>
  480. <div class="right">
  481. <el-form ref="editFormRef" :rules="editFormRule" :model="editFormData" class="editFormRighrt"
  482. label-width="6vw" label-position="left">
  483. <el-form-item :label="t('common_add.receiveCurrency')">
  484. <CurrencySelect v-model="editFormData.receivedCurrency" :items="customOptions"
  485. :placeholder="t('common_add.receiveCurrencyPlaceholder')" />
  486. </el-form-item>
  487. <el-form-item :label="t('common_add.receiveAmount')" prop="receivedAmount">
  488. <el-input v-model="editFormData.receivedAmount"
  489. :placeholder="t('common_add.receiveAmountPlaceholder')" type="number" />
  490. </el-form-item>
  491. <el-form-item :label="t('common_add.fee')" prop="handlingCharge">
  492. <el-input v-model="editFormData.handlingCharge"
  493. :placeholder="t('common_add.feePlaceholder')" type="number" />
  494. </el-form-item>
  495. <el-form-item :label="t('common_add.receiveTime')">
  496. <el-date-picker type="datetime" v-model="editFormData.receivedTime"
  497. :placeholder="t('common_add.receiveTimePlaceholder')" />
  498. </el-form-item>
  499. </el-form>
  500. <span class="editBtns">
  501. <button class="editBtn1" @click="closeEditForm">
  502. <text class="txt">{{ t('common.cancel') }}</text>
  503. </button>
  504. <button class="editBtn2" @click="throttledsubmitEditForm">
  505. <text class="txt">{{ t('common.submit') }}</text>
  506. </button>
  507. </span>
  508. </div>
  509. </div>
  510. </el-dialog>
  511. <!-- 新增退款 -->
  512. <el-dialog v-model="refundDialog" :title="t('common_add.refund')" class="refundDialog" overflow draggable style="width: 40vw;"
  513. :before-close="closeRefundForm">
  514. <div style="display: flex;">
  515. <div class="left">
  516. <div class="add-item">
  517. <el-text style="width:4vw;">{{ t('common_add.jwcode') }}</el-text>
  518. <el-input v-model="refundFormData.jwcode" style="width:10vw;" disabled />
  519. </div>
  520. <div class="add-item">
  521. <el-text style="width:4vw;">{{ t('common_add.customerName') }}</el-text>
  522. <el-input v-model="refundFormData.name" style="width:10vw;" disabled />
  523. </div>
  524. <div class="add-item">
  525. <el-text style="width:4vw;">{{ t('common_add.market') }}</el-text>
  526. <el-input v-model="refundFormData.marketName" style="width:10vw;" disabled />
  527. </div>
  528. <div class="add-item">
  529. <el-text style="width:4vw;">{{ t('common_add.activity') }}</el-text>
  530. <el-input v-model="refundFormData.activity" style="width:10vw;" disabled />
  531. </div>
  532. <div class="add-item">
  533. <el-text style="width:4vw;">{{ t('common_add.productName') }}</el-text>
  534. <el-input v-model="refundFormData.goodsName" style="width:10vw;" disabled />
  535. </div>
  536. <div v-show="!isRefundGold" class="add-item">
  537. <el-text style="width:4vw;">{{ t('common_add.productNum') }}</el-text>
  538. <el-input style="padding-right: 10px; width:6.5vw;" v-model="refundFormData.goodNum"
  539. :placeholder="t('common_add.productNumPlaceholder')" disabled />
  540. <CurrencySelect disabled="true" v-model="refundFormData.numUnit" :items="numUnitList"
  541. style=" width: 3.5vw;" :placeholder="t('common_add.numUnit')"
  542. @change="handleCurrencyChange" />
  543. </div>
  544. <div v-show="isRefundGold" style="display: flex; margin-bottom: 10px;">
  545. <div style=" display: flex; align-items: center;justify-content: center; ">
  546. <span style="color: #999999; white-space: nowrap;">{{ t('common_add.permanentGold')
  547. }}</span>
  548. <el-input style="padding-right: 10px; height: 30px; width: 70px;"
  549. v-model="refundFormData.permanentGold" disabled />
  550. </div>
  551. <div style=" display: flex; align-items: center;justify-content: center; ">
  552. <span style="color: #999999; white-space: nowrap;">{{ t('common_add.freeGold') }}</span>
  553. <el-input style="padding-right: 10px; height: 30px; width: 70px;"
  554. v-model="refundFormData.freeGold" disabled />
  555. </div>
  556. </div>
  557. <div class="add-item">
  558. <el-text style="width:4vw;">{{ t('common_add.payCurrency') }}</el-text>
  559. <el-input v-model="refundFormData.paymentCurrency" style="width:10vw;" disabled />
  560. </div>
  561. <div class="add-item">
  562. <el-text style="width:4vw;">{{ t('common_add.payAmount') }}</el-text>
  563. <el-input v-model="refundFormData.paymentAmount" style="width:10vw;" disabled />
  564. </div>
  565. <div class="add-item">
  566. <el-text style="width:4vw;">{{ t('common_add.payMethod') }}</el-text>
  567. <el-input v-model="refundFormData.payType" style="width:10vw;" disabled />
  568. </div>
  569. <div class="add-item">
  570. <el-text style="width:4vw;">{{ t('common_add.payTime') }}</el-text>
  571. <el-date-picker v-model="refundFormData.payTime" type="datetime" style="width:10vw;" disabled />
  572. </div>
  573. <div class="add-item">
  574. <el-text style="width:4vw;" size="small">{{ t('common_add.transferVoucher') }}</el-text>
  575. <el-form-item
  576. :rules="{ required: true, message: t('common_add.uploadPhoto'), trigger: 'change' }">
  577. <el-upload ref="uploadRef" :auto-upload="false" list-type="picture-card"
  578. :show-file-list="false">
  579. <template #default>
  580. <img v-if="refundFormData.voucher" :src="refundFormData.voucher"
  581. style="width: 100%; height: 100%; object-fit: cover;">
  582. <el-icon v-else>
  583. <Plus />
  584. </el-icon>
  585. </template>
  586. </el-upload>
  587. </el-form-item>
  588. </div>
  589. <div class="add-item">
  590. <el-text style="width:4vw;">{{ t('common_add.remark') }}</el-text>
  591. <el-input v-model="refundFormData.remark" style="width:10vw;" :rows="2" type="textarea"
  592. maxLength="100" disabled show-word-limit />
  593. </div>
  594. </div>
  595. <div class="right">
  596. <div class="add-item">
  597. <el-text style="width:4vw;">{{ t('common_add.refundModel') }}</el-text>
  598. <el-radio-group v-model="refundFormData.refundModel">
  599. <el-radio value="0">{{ t('common_add.refundModelAll') }}</el-radio>
  600. <el-radio value="1">{{ t('common_add.refundModelPart') }}</el-radio>
  601. </el-radio-group>
  602. </div>
  603. <div v-show="refundFormData.refundModel == '1'" style="display: flex; margin-bottom: 10px;">
  604. <div style=" display: flex; align-items: center;justify-content: center; ">
  605. <span style="color: #999999; white-space: nowrap;">{{ t('common_add.permanentGold')
  606. }}</span>
  607. <el-input style="padding-right: 10px; height: 30px; width: 70px;"
  608. v-model="refundFormData.partRefundGold" dsabled />
  609. </div>
  610. <div style=" display: flex; align-items: center;justify-content: center; ">
  611. <span style="color: #999999; white-space: nowrap;">{{ t('common_add.freeGold') }}</span>
  612. <el-input style="padding-right: 10px; height: 30px; width: 70px;"
  613. v-model="refundFormData.partRefundFree" />
  614. </div>
  615. </div>
  616. <div class="add-item">
  617. <el-text style="width:4vw;">{{ t('common_add.refundReason') }}</el-text>
  618. <el-input v-model="refundFormData.refundReason" style="width:10vw;" :rows="5" maxlength="150"
  619. show-word-limit type="textarea" />
  620. </div>
  621. <div>{{ t('common_add.tip') }}</div>
  622. <div style="display:flex;justify-content: center;margin-top: 5vh;">
  623. <el-button type="default" @click="resetRefund">{{ t('common.reset') }}</el-button>
  624. <el-button type="primary" @click="throttledsubmitRefund">{{ t('common.submit') }}</el-button>
  625. </div>
  626. </div>
  627. </div>
  628. </el-dialog>
  629. </div>
  630. </template>
  631. <script setup>
  632. // 仅导入地区财务所需依赖
  633. import { ref, watch, onMounted } from 'vue';
  634. import { storeToRefs } from 'pinia';
  635. import { ElMessage, ElMessageBox } from 'element-plus';
  636. import API from '@/util/http.js';
  637. import request from '@/util/http.js';
  638. import moment from 'moment';
  639. import _ from 'lodash';
  640. import { Plus } from '@element-plus/icons-vue';
  641. import { startsWith } from './utils/util.js'
  642. import { isNumber } from 'lodash'
  643. // 地区财务专属组件
  644. import CurrencySelect from '@/components/MoneyManage/CurrencySelect.vue';
  645. // 静态数据与规则(仅保留必要项)
  646. import { editFormRule } from './utils/recriveFormRules.js';
  647. import { productList, MarketNameForId, CurrencyForId, marketList, normalizeSubmitterMarket } from './utils/staticData.js';
  648. import { useAdminStore } from '@/store/index.js';
  649. import { hasMenuPermission } from '@/utils/menuTreePermission.js';
  650. // 国际化
  651. import { useI18n } from 'vue-i18n'
  652. const { t } = useI18n()
  653. // ===================== 1. 核心状态管理(仅地区财务) =====================
  654. const adminStore = useAdminStore();
  655. const { menuTree } = storeToRefs(adminStore);
  656. // 角色固定:地区财务(caiwu=true,其他角色关闭)
  657. const kefu = ref(false);
  658. const caiwu = ref(true);
  659. const HQcaiwu = ref(false);
  660. const superAdmin = ref(false);
  661. // 表格与分页数据
  662. const tableData = ref([]);
  663. const total = ref(0);
  664. const pageInfo = ref({ pageSize: 10, pageNum: 1 });
  665. // 筛选地区树
  666. const market = ref([])
  667. // 搜索条件
  668. const searchData = ref({});
  669. const defaultTime = [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)];
  670. const getTime = ref([]);
  671. // 标签页:默认“待审核”
  672. const activeTab = ref('wait');
  673. // 审核弹窗状态
  674. const auditFormisible = ref(false);
  675. const auditFormData = ref({});
  676. const ifReject = ref(false);
  677. const countdown = ref(0);
  678. const isBtnDisabled = ref(false);
  679. const btnText = ref(t('common.pass') + '(3)');
  680. // 编辑弹窗状态
  681. const editFormisible = ref(false);
  682. const editFormData = ref({});
  683. const editFormRef = ref(null);
  684. const isEditGold = ref(false); // 金币产品标记
  685. const ifOnline = ref(false); // 在线支付标记
  686. // 辅助状态:图片上传、悬浮提示
  687. const uploadRef = ref(null);
  688. const showTooltip = ref(false);
  689. const tooltipContent = ref('');
  690. const tooltipLeft = ref(0);
  691. const tooltipTop = ref(0);
  692. // 退款确认弹窗
  693. const refundConfirmDialog = ref(false)
  694. const textContent = ref('')
  695. //退款弹窗
  696. const refundDialog = ref(false)
  697. const refundFormData = ref({})
  698. const openRefundDialog = () => {
  699. refundDialog.value = true
  700. closeConfirmRefund()
  701. }
  702. const closeRefundForm = () => {
  703. refundDialog.value = false
  704. refundFormData.value = {}
  705. }
  706. const isRefundGold = ref(false)
  707. const ifRefundGold = () => {
  708. if (refundFormData.value.goodsName === t('cash.coinRecharge')) {
  709. isRefundGold.value = true
  710. refundFormData.value.goodNum = 0
  711. } else {
  712. isRefundGold.value = false
  713. }
  714. }
  715. // 基础数据
  716. const adminData = ref({});
  717. const activityList = ref([]);
  718. const customOptions = ref([
  719. t('cash.currency.usd'), // 美元(USD)
  720. t('cash.currency.hkd'), // 港币(HKD)
  721. t('cash.currency.sgd'), // 新币(SGD)
  722. t('cash.currency.myr'), // 马币(MYR)
  723. t('cash.currency.thb'), // 泰铢(THB)
  724. t('cash.currency.cad'), // 加币(CAD)
  725. t('cash.currency.vnd'), // 越南盾(VND)
  726. t('cash.currency.krw'), // 韩元(KRW)
  727. t('cash.currency.rmb'), // 人民币(CNY)
  728. ])
  729. const paytypeList = [
  730. t('cash.payMethods.stripe'),
  731. t('cash.payMethods.paymentAsia'),
  732. t('cash.payMethods.ipay88'),
  733. t('cash.payMethods.bankTransfer'),
  734. t('cash.payMethods.card'),
  735. t('cash.payMethods.cash'),
  736. t('cash.payMethods.check'),
  737. t('cash.payMethods.grabpay'),
  738. t('cash.payMethods.nets'),
  739. t('cash.payMethods.transfer'),
  740. t('cash.payMethods.paypal'),
  741. ];
  742. const paytypeOptions = ref([...paytypeList]);
  743. // ===================== 2. 核心功能函数(仅地区财务) =====================
  744. //确认退款弹窗
  745. const openRefundConfirm = (row) => {
  746. textContent.value = t('common.willRefundOrder') + '?'
  747. refundConfirmDialog.value = true
  748. refundFormData.value = { ...row }
  749. ifRefundGold()
  750. console.log(row);
  751. }
  752. const closeConfirmRefund = () => {
  753. refundConfirmDialog.value = false
  754. textContent.value = ''
  755. }
  756. //导出相关
  757. const exportListVisible = ref(false)
  758. const exportList = ref([])
  759. const exportListLoading = ref(false)
  760. const exportExcel = async function () {
  761. let payCurrencySelect = '';
  762. let goodsName = '';
  763. // 处理时间范围
  764. if (getTime.value && getTime.value.length === 2) {
  765. searchData.value.startTime = moment(getTime.value[0]).format('YYYY-MM-DD HH:mm:ss');
  766. searchData.value.endTime = moment(getTime.value[1]).format('YYYY-MM-DD HH:mm:ss');
  767. } else {
  768. searchData.value.startTime = '';
  769. searchData.value.endTime = '';
  770. }
  771. // 处理产品名称(级联选择取最后一级)
  772. if (searchData.value.goodsName) {
  773. goodsName = searchData.value.goodsName[searchData.value.goodsName.length - 1];
  774. }
  775. // 处理付款币种(转ID)
  776. if (searchData.value.paymentCurrency) {
  777. payCurrencySelect = CurrencyForId(searchData.value.paymentCurrency);
  778. }
  779. // if (searchData.value.jwcode && !isNumber(searchData.value.jwcode)) {
  780. // ElMessage.error('精网号只能是数字')
  781. // return
  782. // }
  783. const cashRoleId = '1';
  784. const submitterMarket = adminData.value.markets;
  785. searchData.value.status = 46;
  786. const params = {
  787. ...pageInfo.value,
  788. cashCollection: {
  789. ...searchData.value,
  790. submitterId: adminData.value.id,
  791. receivedMarket: MarketNameForId(submitterMarket),
  792. cashRoleId: cashRoleId,
  793. paymentCurrency: payCurrencySelect,
  794. submitterMarket: submitterMarket,
  795. goodsName: goodsName,
  796. market: MarketNameForId(searchData.value.market)
  797. }
  798. }
  799. const res = await API({ url: '/export/exportCash', data: params })
  800. if (res.code === 200) {
  801. ElMessage.success(t('elmessage.exportSuccess'))
  802. } else {
  803. ElMessage.error(res.msg || t('elmessage.exportFailed'))
  804. }
  805. }
  806. const openExportList = () => {
  807. getExportList()
  808. exportListVisible.value = true
  809. }
  810. //获取导出列表
  811. const getExportList = async () => {
  812. exportListLoading.value = true
  813. try {
  814. const result = await API({ url: '/export/export' })
  815. if (result.code === 200) {
  816. const filteredData = result.data.filter(item => {
  817. return item.type === 13
  818. })
  819. exportList.value = filteredData
  820. } else {
  821. ElMessage.error(result.msg || t('elmessage.getExportListError'))
  822. }
  823. } catch (error) {
  824. console.error('获取导出列表出错:', error)
  825. ElMessage.error(t('elmessage.getExportListError'))
  826. } finally {
  827. exportListLoading.value = false
  828. }
  829. }
  830. const downloadExportFile = (item) => {
  831. if (item.state === 2) {
  832. const link = document.createElement('a')
  833. link.href = item.url
  834. link.download = item.fileName
  835. link.click()
  836. } else {
  837. ElMessage.warning(t('elmessage.exportingInProgress'))
  838. }
  839. }
  840. //根据状态返回对应的标签类型
  841. const getTagType = (state) => {
  842. switch (state) {
  843. case 0:
  844. return 'info';
  845. case 1:
  846. return 'primary';
  847. case 2:
  848. return 'success';
  849. case 3:
  850. return 'danger';
  851. default:
  852. return 'info';
  853. }
  854. }
  855. //根据状态返回对应的标签文案
  856. const getTagText = (state) => {
  857. switch (state) {
  858. case 0:
  859. return t('elmessage.pendingExecution');
  860. case 1:
  861. return t('elmessage.executing');
  862. case 2:
  863. return t('elmessage.executed');
  864. case 3:
  865. return t('elmessage.errorExecution');
  866. default:
  867. return t('elmessage.unknownStatus');
  868. }
  869. }
  870. // 2.1 数据加载:获取地区财务订单列表
  871. const getlist = async () => {
  872. try {
  873. let payCurrencySelect = '';
  874. let goodsName = '';
  875. // 处理时间范围
  876. if (getTime.value && getTime.value.length === 2) {
  877. searchData.value.startTime = moment(getTime.value[0]).format('YYYY-MM-DD HH:mm:ss');
  878. searchData.value.endTime = moment(getTime.value[1]).format('YYYY-MM-DD HH:mm:ss');
  879. } else {
  880. searchData.value.startTime = '';
  881. searchData.value.endTime = '';
  882. }
  883. // 处理产品名称(级联选择取最后一级)
  884. if (searchData.value.goodsName) {
  885. goodsName = searchData.value.goodsName[searchData.value.goodsName.length - 1];
  886. }
  887. // 处理付款币种(转ID)
  888. if (searchData.value.paymentCurrency) {
  889. payCurrencySelect = CurrencyForId(searchData.value.paymentCurrency);
  890. }
  891. // if (searchData.value.jwcode && !isNumber(searchData.value.jwcode)) {
  892. // ElMessage.error('精网号只能是数字')
  893. // return
  894. // }
  895. // 地区财务固定参数:角色ID=1,按标签页筛选状态
  896. const cashRoleId = '1';
  897. const receivedMarket = normalizeSubmitterMarket(adminData.value.markets);
  898. if (activeTab.value === 'wait') searchData.value.status = 0;
  899. else if (activeTab.value === 'pass') searchData.value.status = 13;
  900. else if (activeTab.value === 'done') searchData.value.status = 46;
  901. else if (activeTab.value === 'reject') searchData.value.status = 2;
  902. // 地区处理
  903. const markets = ref(null)
  904. if (searchData.value.markets) {
  905. markets.value = searchData.value.markets[searchData.value.markets.length - 1]
  906. console.log('地区转换', markets.value)
  907. }
  908. if (searchData.value.jwcode) {
  909. const isPositiveInteger = /^[1-9]\d*$/.test(searchData.value.jwcode);
  910. if (!isPositiveInteger) {
  911. ElMessage.error(t('elmessage.checkJwcodeFormat'))
  912. return;
  913. }
  914. // 添加长度验证,超过8位提示错误
  915. if (searchData.value.jwcode.length > 8) {
  916. ElMessage.error(t('elmessage.limitJwcodeLength'))
  917. return;
  918. }
  919. }
  920. const result = await request({
  921. url: '/cashCollection/selectCollection',
  922. data: {
  923. ...pageInfo.value,
  924. cashCollection: {
  925. ...searchData.value,
  926. submitterId: adminData.value.id,
  927. receivedMarket: MarketNameForId(receivedMarket),
  928. cashRoleId: cashRoleId,
  929. paymentCurrency: payCurrencySelect,
  930. submitterMarket: normalizeSubmitterMarket(receivedMarket),
  931. goodsName: goodsName,
  932. // market: MarketNameForId(searchData.value.market)
  933. market: markets.value
  934. }
  935. }
  936. });
  937. if (result.code === 200) {
  938. tableData.value = result.data.list;
  939. total.value = result.data.total;
  940. } else {
  941. ElMessage.error(t('elmessage.orderDataLoadFailed'));
  942. }
  943. } catch (error) {
  944. console.error('地区财务订单列表请求异常:', error);
  945. ElMessage.error(t('elmessage.inNetworkError'));
  946. }
  947. };
  948. //重置退款
  949. const resetRefund = () => {
  950. refundFormData.value.refundModel = ''
  951. refundFormData.value.refundReason = ''
  952. }
  953. //提交退款
  954. const submitRefund = async () => {
  955. try {
  956. if (refundFormData.value.goodsName != t('cash.coinRecharge')) {
  957. return ElMessage.error(t('elmessage.onlineDataSupport'));
  958. }
  959. if (!refundFormData.value.refundModel) {
  960. return ElMessage.error(t('elmessage.selectRefundModel'));
  961. }
  962. if (!refundFormData.value.refundReason) {
  963. return ElMessage.error(t('elmessage.refundReasonPlaceholder'));
  964. }
  965. // 验证精网号格式和长度
  966. if (refundFormData.value.jwcode) {
  967. const isPositiveInteger = /^[1-9]\d*$/.test(refundFormData.value.jwcode);
  968. if (!isPositiveInteger) {
  969. return ElMessage.error(t('elmessage.checkJwcodeFormat'));
  970. }
  971. if (refundFormData.value.jwcode.length > 8) {
  972. return ElMessage.error(t('elmessage.limitJwcodeLength'));
  973. }
  974. }
  975. if (refundFormData.value.refundModel == 0) {
  976. refundFormData.value.partRefundGold = refundFormData.value.permanentGold,
  977. refundFormData.value.partRefundFree = refundFormData.value.freeGold
  978. }
  979. const result = await request({
  980. url: '/Money/addOnline',
  981. data: {
  982. jwcode: refundFormData.value.jwcode,
  983. name: refundFormData.value.name,
  984. market: refundFormData.value.marketName,
  985. submitterId: adminData.value.id,
  986. submitterMarket: adminData.value.markets,
  987. remark: refundFormData.value.remark,
  988. refundReason: refundFormData.value.refundReason,
  989. refundModel: refundFormData.value.refundModel,
  990. originalOrderId: refundFormData.value.id,
  991. orderCode: refundFormData.value.orderCode,
  992. permanentGold: (refundFormData.value.permanentGold) * 100 || 0,
  993. freeGold: (refundFormData.value.freeGold) * 100 || 0,
  994. partRefundGold: (refundFormData.value.partRefundGold) * 100 || 0,
  995. partRefundFree: (refundFormData.value.partRefundFree) * 100 || 0,
  996. handlingCharge: refundFormData.value.handlingCharge == null ? null : refundFormData.value.handlingCharge * 100,
  997. }
  998. })
  999. if (result.code == 200) {
  1000. ElMessage.success(t('elmessage.addRefundSuccess'))
  1001. getlist()
  1002. closeRefundForm()
  1003. } else {
  1004. ElMessage.error(result.msg)
  1005. getlist()
  1006. }
  1007. console.log('返回参数:', result);
  1008. } catch (error) {
  1009. console.log(error);
  1010. }
  1011. }
  1012. // 2.2 搜索与重置
  1013. const search = () => {
  1014. getlist();
  1015. };
  1016. const reset = () => {
  1017. searchData.value = {};
  1018. // 重置页码
  1019. pageInfo.value.pageNum = 1;
  1020. getTime.value = []
  1021. getlist();
  1022. };
  1023. // 2.3 标签页切换
  1024. const navigateTo = async (tab) => {
  1025. activeTab.value = tab;
  1026. await getlist();
  1027. };
  1028. // 2.4 审核功能
  1029. // 打开审核弹窗
  1030. const openAuditForm = (row) => {
  1031. auditFormData.value = { ...row, market: row.marketName };
  1032. ifGold(auditFormData.value)
  1033. console.log('isGold', isGold.value);
  1034. auditFormisible.value = true;
  1035. };
  1036. // 关闭审核弹窗
  1037. const closeAuditForm = () => {
  1038. ifReject.value = false;
  1039. auditFormisible.value = false;
  1040. auditFormData.value = {};
  1041. };
  1042. // 审核通过
  1043. const handelAudit = async () => {
  1044. try {
  1045. const result = await request({
  1046. url: '/cashAudit/collectionAudit',
  1047. data: {
  1048. orderCode: auditFormData.value.orderCode,
  1049. action: 1,
  1050. auditId: adminData.value.id
  1051. }
  1052. });
  1053. if (result.code === 200) {
  1054. ElMessage.success(t('elmessage.approveSuccess'));
  1055. getlist();
  1056. closeAuditForm();
  1057. } else {
  1058. ElMessage.error(result.msg || t('elmessage.approveFailed'));
  1059. }
  1060. } catch (error) {
  1061. console.error('审核通过请求异常:', error);
  1062. ElMessage.error(t('elmessage.inNetworkError'));
  1063. }
  1064. };
  1065. // 审核驳回
  1066. const handelAuditReject = async () => {
  1067. if (!auditFormData.value.rejectReason) {
  1068. ElMessage.warning(t('elmessage.rejectReasonPlaceholder'));
  1069. return;
  1070. }
  1071. try {
  1072. const result = await request({
  1073. url: '/cashAudit/collectionAudit',
  1074. data: {
  1075. orderCode: auditFormData.value.orderCode,
  1076. rejectReason: auditFormData.value.rejectReason,
  1077. action: 2,
  1078. auditId: adminData.value.id
  1079. }
  1080. });
  1081. if (result.code === 200) {
  1082. ElMessage.success(t('elmessage.rejectSuccess'));
  1083. getlist();
  1084. closeAuditForm();
  1085. } else {
  1086. ElMessage.error(result.msg || t('elmessage.rejectFailed'));
  1087. }
  1088. } catch (error) {
  1089. console.error('审核驳回请求异常:', error);
  1090. ElMessage.error(t('elmessage.inNetworkError'));
  1091. }
  1092. };
  1093. //判断产品类型
  1094. const isGold = ref(false)
  1095. const ifGold = (data) => {
  1096. console.log('data', data);
  1097. if (data.goodsName === t('cash.coinRecharge')) {
  1098. isGold.value = true
  1099. } else {
  1100. isGold.value = false
  1101. }
  1102. }
  1103. // 审核按钮倒计时(防止误操作)
  1104. watch(auditFormisible, (val) => {
  1105. if (val) {
  1106. countdown.value = 3;
  1107. isBtnDisabled.value = true;
  1108. btnText.value = `${t('common.pass')}(${countdown.value})`;
  1109. const timer = setInterval(() => {
  1110. countdown.value--;
  1111. btnText.value = `${t('common.pass')}(${countdown.value})`;
  1112. if (countdown.value <= 0) {
  1113. isBtnDisabled.value = false;
  1114. clearInterval(timer);
  1115. btnText.value = t('common.pass');
  1116. }
  1117. }, 1000);
  1118. }
  1119. });
  1120. // 2.5 编辑手续费功能
  1121. // 打开编辑弹窗
  1122. const openEditForm = (row) => {
  1123. console.log('row.aaa', row.handlingCharge);
  1124. editFormData.value = { ...row };
  1125. // 区分金币产品与普通产品
  1126. if (row.goodsName === t('cash.coinRecharge')) isEditGold.value = true;
  1127. else isEditGold.value = false;
  1128. // 在线支付订单允许修改付款信息
  1129. if (row.status === 3) ifOnline.value = true;
  1130. else ifOnline.value = false;
  1131. editFormisible.value = true;
  1132. };
  1133. // 关闭编辑弹窗
  1134. const closeEditForm = () => {
  1135. editFormisible.value = false;
  1136. editFormData.value = {};
  1137. editFormRef.value.resetFields();
  1138. };
  1139. // 提交编辑(补充手续费)
  1140. const submitEditForm = async () => {
  1141. try {
  1142. await editFormRef.value.validate();
  1143. // 处理时间格式
  1144. if (editFormData.value.receivedTime) {
  1145. editFormData.value.receivedTime = moment(editFormData.value.receivedTime).format('YYYY-MM-DD HH:mm:ss');
  1146. }
  1147. console.log('editFormData.value.handlingCharge', editFormData.value.handlingCharge);
  1148. const result = await request({
  1149. url: '/cashCollection/complete',
  1150. data: {
  1151. orderCode: editFormData.value.orderCode,
  1152. handlingCharge: editFormData.value.handlingCharge == null ? null : editFormData.value.handlingCharge * 100, // 转为分单位
  1153. paymentCurrency: CurrencyForId(editFormData.value.paymentCurrency),
  1154. paymentAmount: editFormData.value.paymentAmount * 100, // 转为分单位
  1155. receivedCurrency: CurrencyForId(editFormData.value.receivedCurrency),
  1156. receivedAmount: editFormData.value.receivedAmount * 100 || null, // 转为分单位
  1157. receivedTime: editFormData.value.receivedTime,
  1158. receivedRemark: editFormData.value.receivedRemark || ''
  1159. }
  1160. });
  1161. if (result.code === 200) {
  1162. ElMessage.success(t('elmessage.editSuccess'));
  1163. getlist();
  1164. closeEditForm();
  1165. } else {
  1166. ElMessage.error(result.msg || t('elmessage.editFailed'));
  1167. }
  1168. } catch (error) {
  1169. console.error('编辑提交请求异常:', error);
  1170. ElMessage.error(t('elmessage.formValidationFailed'));
  1171. }
  1172. };
  1173. // 2.6 辅助功能
  1174. // 图片预览
  1175. const previewImage = (imageUrl) => {
  1176. if (!imageUrl) return;
  1177. const imageElement = document.createElement('img');
  1178. imageElement.src = imageUrl;
  1179. imageElement.style.maxWidth = '80vw';
  1180. imageElement.style.maxHeight = '80vh';
  1181. imageElement.style.objectFit = 'contain';
  1182. const viewer = document.createElement('div');
  1183. viewer.style.position = 'fixed';
  1184. viewer.style.top = '0';
  1185. viewer.style.left = '0';
  1186. viewer.style.width = '100vw';
  1187. viewer.style.height = '100vh';
  1188. viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  1189. viewer.style.display = 'flex';
  1190. viewer.style.justifyContent = 'center';
  1191. viewer.style.alignItems = 'center';
  1192. viewer.style.zIndex = '9999';
  1193. viewer.appendChild(imageElement);
  1194. // 点击关闭预览
  1195. viewer.addEventListener('click', () => {
  1196. document.body.removeChild(viewer);
  1197. });
  1198. document.body.appendChild(viewer);
  1199. };
  1200. // 驳回理由悬浮提示
  1201. const handleMouseEnter = (e, content) => {
  1202. if (!content) return;
  1203. showTooltip.value = true;
  1204. tooltipContent.value = content;
  1205. handleMouseMove(e);
  1206. };
  1207. const handleMouseLeave = () => {
  1208. showTooltip.value = false;
  1209. tooltipContent.value = '';
  1210. };
  1211. const handleMouseMove = (e) => {
  1212. // 提示框显示在鼠标左侧,避免遮挡
  1213. tooltipLeft.value = e.clientX - 210;
  1214. tooltipTop.value = e.clientY - 10;
  1215. };
  1216. // 2.7 基础数据加载(初始化)
  1217. // 获取管理员信息
  1218. const getAdminData = async () => {
  1219. try {
  1220. const result = await API({ url: '/admin/userinfo', data: {} });
  1221. adminData.value = result;
  1222. // 超级管理员判断(仅用于角色切换权限)
  1223. // if (adminData.value.roleId === 2) {
  1224. // superAdmin.value = true;
  1225. // // 管理员所属地区提示
  1226. // if (adminData.value.markets === '总部' || adminData.value.markets === '研发部') {
  1227. // ElMessageBox.alert(
  1228. // '管理员账号仅显示所属地区的财务数据,请确认地区设置',
  1229. // '温馨提示',
  1230. // { type: 'warning' }
  1231. // );
  1232. // }
  1233. // }
  1234. } catch (error) {
  1235. console.error('管理员信息获取失败:', error);
  1236. ElMessage.error(t('elmessage.adminInfoLoadFailed'));
  1237. }
  1238. };
  1239. // 获取活动列表
  1240. const getActivitys = async () => {
  1241. try {
  1242. const result = await API({ url: '/cashCollection/getActivityList', data: {} });
  1243. if (result.code === 200) {
  1244. activityList.value = result.data;
  1245. } else {
  1246. ElMessage.error(t('elmessage.activityLoadFailed'));
  1247. }
  1248. } catch (error) {
  1249. console.error('活动列表获取失败:', error);
  1250. ElMessage.error(t('elmessage.activityLoadFailed'));
  1251. }
  1252. };
  1253. // 2.8 节流函数(防止重复提交)
  1254. const throttledhandelAuditReject = _.throttle(handelAuditReject, 3000, { trailing: false });
  1255. const throttledsubmitEditForm = _.throttle(submitEditForm, 3000, { trailing: false });
  1256. const throttledsubmitRefund = _.throttle(submitRefund, 5000, {
  1257. trailing: false
  1258. })
  1259. // 2.9 页面初始化
  1260. onMounted(async () => {
  1261. await getAdminData();
  1262. await getActivitys();
  1263. // 初始化加载地区财务订单数据
  1264. await getlist();
  1265. // if (!hasMenuPermission(menuTree.value, 67)) {
  1266. // ElMessageBox.alert(
  1267. // '您暂无该页面操作权限,请联系管理员',
  1268. // '权限提示',
  1269. // { type: 'error' }
  1270. // ).then(() => {
  1271. // window.history.back();
  1272. // });
  1273. // }
  1274. //背景预加载
  1275. const bgImg = new Image();
  1276. bgImg.src = '/src/assets/receive-recall.png';
  1277. getMarket()
  1278. });
  1279. // 2.10 未使用函数占位(避免报错)
  1280. const handleCurrencyChange = () => { };
  1281. const beforeUpload = () => true;
  1282. const handelImgErr = () => { };
  1283. const handleImageChange = () => { };
  1284. const customUpload = () => { };
  1285. const handleDatePickerChange = () => { };
  1286. const disabledDate = () => false;
  1287. const handleSortChange = () => { };
  1288. const getMarket = async function () {
  1289. try {
  1290. const result = await API({
  1291. url: '/market/selectMarket',
  1292. })
  1293. console.log('看看地区树', result)
  1294. const transformTree = (nodes) => {
  1295. const allChildren = nodes.flatMap(node => node.children || []);
  1296. return allChildren.map(child => {
  1297. const grandchildren = child.children && child.children.length
  1298. ? transformTree([child])
  1299. : null;
  1300. return {
  1301. value: child.id,
  1302. label: child.name,
  1303. children: grandchildren
  1304. };
  1305. });
  1306. };
  1307. market.value = transformTree(result.data)
  1308. console.log('转换后的地区树==============', market.value)
  1309. } catch (error) {
  1310. console.log('请求失败', error)
  1311. }
  1312. }
  1313. const handlePagination = (type, val) => {
  1314. if (type === 'size') pageInfo.value.pageSize = val;
  1315. else pageInfo.value.pageNum = val;
  1316. getlist();
  1317. };
  1318. </script>
  1319. <style scoped lang="scss">
  1320. .content {
  1321. height: 100%;
  1322. width: 80vw;
  1323. .card1 {
  1324. width: 100%;
  1325. background: #F3FAFE;
  1326. .rowItem {
  1327. display: flex;
  1328. width: 15vw;
  1329. align-items: center;
  1330. justify-content: center;
  1331. margin-right: 0.5vw;
  1332. }
  1333. el-button {
  1334. margin-left: 10px;
  1335. }
  1336. .row1 {
  1337. height: 4vh;
  1338. width: 80vw;
  1339. display: flex;
  1340. min-height: 40px;
  1341. }
  1342. .row2 {
  1343. height: 4vh;
  1344. width: 80vw;
  1345. display: flex;
  1346. align-items: center;
  1347. min-height: 40px;
  1348. .left {
  1349. height: 4vh;
  1350. width: 58vw;
  1351. display: flex;
  1352. min-height: 40px;
  1353. }
  1354. }
  1355. }
  1356. .div-card2 {
  1357. width: 100%;
  1358. margin-top: 2vh;
  1359. .card2 {
  1360. background: #E7F4FD;
  1361. }
  1362. .btns {
  1363. width: 100%;
  1364. display: flex;
  1365. align-items: center;
  1366. justify-content: space-between;
  1367. padding-bottom: 10px;
  1368. .tabs {
  1369. width: 100%;
  1370. min-width: 300px;
  1371. display: flex;
  1372. align-items: center;
  1373. justify-content: space-between;
  1374. .btnItem {
  1375. margin-left: 10px;
  1376. border-radius: 5px;
  1377. }
  1378. .info-tooltip {
  1379. display: flex;
  1380. align-items: center;
  1381. }
  1382. .service-icon {
  1383. color: #666;
  1384. cursor: pointer;
  1385. font-size: 18px;
  1386. transition: all 0.3s ease;
  1387. padding: 4px;
  1388. border-radius: 50%;
  1389. }
  1390. }
  1391. }
  1392. .table {
  1393. margin: 10px;
  1394. border-radius: 20px;
  1395. .ellipsis-container {
  1396. position: relative;
  1397. width: 100%;
  1398. .ellipsis-text {
  1399. display: inline-block;
  1400. width: 100%;
  1401. white-space: nowrap;
  1402. overflow: hidden;
  1403. text-overflow: ellipsis;
  1404. cursor: pointer;
  1405. }
  1406. .custom-tooltip {
  1407. position: fixed;
  1408. z-index: 9999;
  1409. padding: 8px 12px;
  1410. width: 200px;
  1411. background-color: #E4F0FC;
  1412. color: #333333;
  1413. border: 1px solid #e5e7eb;
  1414. border-radius: 4px;
  1415. box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  1416. min-height: 30px;
  1417. max-height: 300px;
  1418. overflow-y: auto;
  1419. font-size: 14px;
  1420. line-height: 1.5;
  1421. }
  1422. }
  1423. }
  1424. .pagination {
  1425. margin-top: 10px;
  1426. padding: 10px 10px;
  1427. }
  1428. }
  1429. :deep(.adddialog) {
  1430. min-width: 500px;
  1431. background-color: #F3FAFE !important;
  1432. margin-top: 8vh;
  1433. border-radius: 8px;
  1434. .addForm {
  1435. padding: 0 60px 1vh 60px;
  1436. .el-date-editor {
  1437. display: flex;
  1438. flex: 1;
  1439. }
  1440. .pic {
  1441. display: flex;
  1442. align-items: center;
  1443. .uploader {
  1444. height: 80px;
  1445. width: 80px;
  1446. .el-upload {
  1447. height: 100%;
  1448. width: 100%;
  1449. }
  1450. }
  1451. .picText {
  1452. color: #999999;
  1453. font-family: "PingFang SC";
  1454. font-size: 10px;
  1455. font-style: normal;
  1456. font-weight: 400;
  1457. line-height: 20px;
  1458. margin-left: 10px;
  1459. }
  1460. }
  1461. }
  1462. .dialog-footer {
  1463. display: flex;
  1464. justify-content: center;
  1465. padding-bottom: 1.5vh;
  1466. }
  1467. }
  1468. :deep(.editdialog) {
  1469. min-width: 990px;
  1470. background-color: #F3FAFE !important;
  1471. margin-top: 8vh;
  1472. border-radius: 8px;
  1473. .editForm {
  1474. padding: 0 60px 1vh 60px;
  1475. .el-date-editor {
  1476. display: flex;
  1477. flex: 1;
  1478. }
  1479. .pic {
  1480. display: flex;
  1481. align-items: center;
  1482. .uploader {
  1483. height: 80px;
  1484. width: 80px;
  1485. .el-upload {
  1486. height: 100%;
  1487. width: 100%;
  1488. }
  1489. }
  1490. .picText {
  1491. color: #999999;
  1492. font-family: "PingFang SC";
  1493. font-size: 10px;
  1494. font-style: normal;
  1495. font-weight: 400;
  1496. line-height: 20px;
  1497. margin-left: 10px;
  1498. }
  1499. }
  1500. }
  1501. .content {
  1502. display: flex;
  1503. height: 100%;
  1504. width: 100%;
  1505. .left {
  1506. min-width: 500px;
  1507. }
  1508. .right {
  1509. flex: 1;
  1510. .editFormRighrt {
  1511. padding: 0 60px 0 40px;
  1512. .el-date-editor {
  1513. display: flex;
  1514. flex: 1;
  1515. }
  1516. }
  1517. .editBtns {
  1518. display: flex;
  1519. justify-content: center;
  1520. margin-top: 60px;
  1521. .txt {
  1522. color: #f3fafe;
  1523. text-align: center;
  1524. font-family: "PingFang SC";
  1525. font-size: 14px;
  1526. font-style: normal;
  1527. font-weight: 700;
  1528. line-height: 22px;
  1529. }
  1530. .editBtn1 {
  1531. min-width: 80px;
  1532. padding: 5px 12px;
  1533. justify-content: center;
  1534. align-items: center;
  1535. gap: 4px;
  1536. border-radius: 4px;
  1537. background: #7E91FF;
  1538. border: none;
  1539. box-shadow: 0 0 4px 0 #00000040;
  1540. }
  1541. .editBtn2 {
  1542. display: flex;
  1543. width: 80px;
  1544. min-width: 80px;
  1545. padding: 5px 12px;
  1546. justify-content: center;
  1547. align-items: center;
  1548. gap: 4px;
  1549. border-radius: 4px;
  1550. background: #2741DE;
  1551. border: none;
  1552. box-shadow: 0 0 4px 0 #00000040;
  1553. margin-left: 60px;
  1554. }
  1555. }
  1556. }
  1557. }
  1558. }
  1559. :deep(.adddialog .el-form-item__label) {
  1560. min-width: 100px;
  1561. width: auto;
  1562. font-weight: 800;
  1563. padding-bottom: 15px;
  1564. }
  1565. .refundDialog {
  1566. .left {
  1567. width: 50%;
  1568. height: 70vh;
  1569. min-height: 700px;
  1570. padding: 0 2vw;
  1571. .add-item {
  1572. display: flex;
  1573. align-items: center;
  1574. margin-bottom: 1vh;
  1575. }
  1576. .image {
  1577. width: 4vw !important;
  1578. height: 4vw !important;
  1579. }
  1580. }
  1581. .right {
  1582. width: 50%;
  1583. height: 50vh;
  1584. .add-item {
  1585. display: flex;
  1586. align-items: center;
  1587. margin-bottom: 1vh;
  1588. }
  1589. }
  1590. }
  1591. }
  1592. // 表格样式统一
  1593. :deep(.el-table__header-wrapper),
  1594. :deep(.el-table__body-wrapper),
  1595. :deep(.el-table__cell),
  1596. :deep(.el-table__body td) {
  1597. background-color: #F3FAFE !important;
  1598. }
  1599. :deep(.el-table__header th) {
  1600. background-color: #F3FAFE !important;
  1601. }
  1602. :deep(.el-table__row:hover > .el-table__cell) {
  1603. background-color: #E5EBFE !important;
  1604. }
  1605. // 驳回理由弹窗样式
  1606. .reject-reason-box {
  1607. --el-message-box-height: 500px;
  1608. }
  1609. .reject-reason-box .el-message-box__content {
  1610. max-height: 350px;
  1611. overflow-y: auto;
  1612. white-space: pre-wrap;
  1613. }
  1614. .recallDialog {
  1615. //撤回弹窗提示
  1616. height: 392px;
  1617. width: 700px;
  1618. background-image: url('/src/assets/receive-recall.png');
  1619. position: fixed; // 固定定位,相对于浏览器窗口
  1620. top: 50%; // 距离顶部50%
  1621. left: 50%; // 距离左侧50%
  1622. transform: translate(-50%, -50%); // 向左、向上平移自身宽高的50%,实现居中
  1623. z-index: 1000; // 确保在其他元素上层显示
  1624. .close {
  1625. position: absolute;
  1626. left: 625px;
  1627. top: 20px;
  1628. height: 38px;
  1629. width: 38px;
  1630. opacity: 0;
  1631. .Btn {
  1632. height: 100%;
  1633. width: 100%;
  1634. border-radius: 10px;
  1635. }
  1636. }
  1637. .text {
  1638. position: absolute;
  1639. left: 185px;
  1640. top: 190px;
  1641. height: 67px;
  1642. width: 500px;
  1643. .txt {
  1644. height: 100%;
  1645. width: 100%;
  1646. color: #001a42;
  1647. font-family: "PingFang SC";
  1648. font-size: 48px;
  1649. font-style: normal;
  1650. font-weight: 900;
  1651. line-height: normal;
  1652. }
  1653. }
  1654. .cancle {
  1655. position: absolute;
  1656. left: 185px;
  1657. top: 304px;
  1658. height: 55px;
  1659. width: 150px;
  1660. opacity: 0;
  1661. .Btn {
  1662. height: 100%;
  1663. width: 100%;
  1664. border-radius: 20px;
  1665. }
  1666. }
  1667. .confirm {
  1668. position: absolute;
  1669. left: 375px;
  1670. top: 304px;
  1671. height: 55px;
  1672. width: 150px;
  1673. opacity: 0;
  1674. .Btn {
  1675. height: 100%;
  1676. width: 100%;
  1677. border-radius: 20px;
  1678. }
  1679. }
  1680. }
  1681. </style>