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.

1687 lines
68 KiB

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