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.

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