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.

1610 lines
65 KiB

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