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.

1758 lines
71 KiB

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