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.

1729 lines
70 KiB

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