paySuccess.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093
  1. <template>
  2. <div class="content-box">
  3. <div class="left">
  4. <!-- <el-icon :size="23" class="camera"><VideoCameraFilled /></el-icon> -->
  5. <span class="cameratxt">支付成功订单</span>
  6. </div>
  7. <div class="middle">
  8. <div class="filter">
  9. <div class="condition">
  10. <span>关键字 : </span>
  11. <el-input clearable v-model="searchInput.keyWord" @clear="getList" class="w-50 m-2" placeholder="请输入名字或工单号"
  12. style="width: 210px" />
  13. </div>
  14. <div class="condition">
  15. <span>交易时间 : </span>
  16. <el-date-picker v-model="searchInput.createTime" type="daterange" range-separator="-" start-placeholder="起始时间"
  17. end-placeholder="结束时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" :prefix-icon="Calendar"
  18. placeholder="请选择日期" />
  19. </div>
  20. <el-button style="margin-left: 20px" color="rgba(111, 182, 184, 1)" type="primary" class="search"
  21. @click="searchBtn"><el-icon>
  22. <Search />
  23. </el-icon> <span>查询</span></el-button>
  24. </div>
  25. <!-- 按钮列表 -->
  26. <div class="gongneng">
  27. <el-button color="rgba(111, 182, 184, 1)" class="import" type="primary" @click="importExcel"><img
  28. src="@/assets/import.png" style="width: 14px; height: 14px; margin-right: 4px" alt="" />
  29. <span>导出表单</span></el-button>
  30. </div>
  31. </div>
  32. <div class="footer">
  33. <el-table :row-class-name="tableRowClassName" :data="tableData.list" style="width: 100%" :header-cell-style="{
  34. background: 'rgba(240, 243, 247, 1)',
  35. height: '50px',
  36. border: 0,
  37. }">
  38. <!-- <el-table-column align="center" type="selection" width="80" /> -->
  39. <el-table-column align="center " type="index" label="序号" />
  40. <el-table-column align="center" prop="payTime" width="200" label="交易时间" />
  41. <el-table-column align="center" prop="recordNo" width="200" label="工单号" />
  42. <el-table-column align="center" prop="payNo" width="330" label="交易流水号" />
  43. <el-table-column align="center" prop="userName" label="报修人" />
  44. <el-table-column align="center" prop="payPrice" label="交易总金额" />
  45. <el-table-column align="center" prop="refundTotalPrice" label="实退" />
  46. <el-table-column align="center" prop="officialPrice" label="实收" />
  47. <el-table-column align="center" label="状态">
  48. <template #default="{ row }">
  49. <span v-if="row.state == 0">已支付</span>
  50. <span v-if="row.state == 1">部分退款</span>
  51. <span v-if="row.state == 2">已退款</span>
  52. <span v-if="row.state == 3">退款申请中</span>
  53. <span v-if="row.state == 4">退款中</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column align="center" label="操作" width="220">
  57. <template #default="scope">
  58. <div class="edit">
  59. <div class="look" @click="refundInfo(scope.row)">详情</div>
  60. <div class="look" @click="refund(scope.row)">申请退款</div>
  61. <div class="look" @click=applyRefund(scope.row) v-if="scope.row.isApprove == 1">审核</div>
  62. <!-- <div class="look" @click="refund(scope.row)" v-if="schoolId == 0">退款</div> -->
  63. </div>
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. <!-- 详情弹窗 -->
  68. <el-dialog class="refundInfo" v-model="refundInfoVisible" :close-on-click-modal="false"
  69. :close-on-press-escape="false" title="支付订单信息" align-center width="760" :before-close="cancelRefundInfo">
  70. <div class="order_info">
  71. <!-- 工单详情 工单信息 -->
  72. <div class="title">
  73. <img src="@/assets/orderInfo.png" alt="" />
  74. <span>订单信息</span>
  75. </div>
  76. <div class="workNum">
  77. <span class="titles">工单号 :</span><span>{{ refundInfolist.list.recordId }}</span>
  78. </div>
  79. <div class="workNum">
  80. <span class="titles">报修人 :</span><span>{{ refundInfolist.list.userName }}</span>
  81. </div>
  82. <div class="workNum">
  83. <span class="titles">流水账号 :</span><span>{{ refundInfolist.list.payNo }}</span>
  84. </div>
  85. <div class="workNum">
  86. <span class="titles">支付时间 :</span><span>{{ refundInfolist.list.payTime }}</span>
  87. </div>
  88. <div class="workNum">
  89. <span class="titles" style="width: 100px">交易总金额 :</span><span>{{ refundInfolist.list.payPrice }} 元</span>
  90. </div>
  91. <div class="workNum">
  92. <span class="titles">实退 :</span><span>{{ refundInfolist.list.refundTotalPrice }} 元</span>
  93. </div>
  94. <div class="workNum">
  95. <span class="titles">实收 :</span><span>{{ refundInfolist.list.officialPrice }} 元</span>
  96. </div>
  97. <div class="workNum">
  98. <span class="titles">状态 :</span>
  99. <span v-if="refundInfolist.list.state == 0">已支付</span>
  100. <span v-if="refundInfolist.list.state == 1">部分退款</span>
  101. <span v-if="refundInfolist.list.state == 2">已退款</span>
  102. </div>
  103. <!-- 工单详情 报修进度 -->
  104. <div class="title">
  105. <img src="@/assets/refund.png" alt="" style="width: 25px; height: 25px" />
  106. <span>退款进度</span>
  107. </div>
  108. <div class="steps" v-if="refundRecord.list">
  109. <el-steps direction="vertical" :active="refundRecord.list.length">
  110. <el-step v-for="(i, index) in refundRecord.list">
  111. <template v-slot:icon>
  112. <img style="width: 20px; height: 20px" src="@/assets/refundPrice.png" alt="" />
  113. </template>
  114. <template v-slot:title>
  115. <span style="font-size: 15px" v-if="i.approve == 0">待审批</span>
  116. <span style="font-size: 15px" v-if="i.approve == 1">通过</span>
  117. <span style="font-size: 15px" v-if="i.approve == 2">驳回</span>
  118. </template>
  119. <template v-slot:description>
  120. <div class="content">
  121. <span>退款时间 : {{ i.createTime }}</span>
  122. </div>
  123. <div class="content">
  124. <span>
  125. {{
  126. `第${index + 1}次 ` +
  127. "退款金额 : " +
  128. i.refundPrice +
  129. " 元"
  130. }}
  131. </span>
  132. <span v-if="i.isSuccess == 0" style="color:rgb(60, 234, 240)">( 退款中 )</span>
  133. <span v-if="i.isSuccess == 1" style="color:green">( 退款成功 )</span>
  134. <!-- <span v-if="i.isSuccess == 2" style="color:red">( 退款失败 )</span> -->
  135. <span v-if="i.isSuccess == 2" style="color:red">( 驳回退款 )</span>
  136. </div>
  137. </template>
  138. </el-step>
  139. </el-steps>
  140. </div>
  141. </div>
  142. </el-dialog>
  143. <!-- 退款弹窗 -->
  144. <el-dialog class="refund" v-model="refundVisible" :close-on-click-modal="false" :close-on-press-escape="false"
  145. title="申请退款" align-center width="500" :before-close="cancelRefund">
  146. <div class="priceContent">
  147. <span>申请人 : </span>
  148. <span>{{ refundName }}</span>
  149. </div>
  150. <div class="priceContent">
  151. <span>退款金额 : </span>
  152. <el-input
  153. oninput="value=value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3').replace(/^0+(\d)/, '$1') .replace(/^\./, '0.').match(/^\d*(\.?\d{0,2})/g)[0] || ''"
  154. clearable v-model="refundPrice" class="w-50 m-2" placeholder="请输入退款金额" style="width: 180px" />
  155. </div>
  156. <div class="priceContent">
  157. <span>剩余金额 : </span>
  158. <span style="color: red">{{ restrictPrice }}元</span>
  159. </div>
  160. <!-- <ul>
  161. <li v-for="(i, index) in refundRecord.list">
  162. <span>{{ `第${index + 1}次实退` }}</span>
  163. <span style="margin: 0 20px">{{ i.createTime }}</span>
  164. <span>{{ i.refundPrice + " 元" }}</span>
  165. <span v-if="i.isSuccess == 0" style="color:rgb(60, 234, 240)">( 退款中 )</span>
  166. <span v-if="i.isSuccess == 1" style="color:green">( 退款成功 )</span>
  167. <span v-if="i.isSuccess == 2" style="color:red">( 退款失败 )</span>
  168. </li>
  169. </ul> -->
  170. <div class="priceContent" style="display:flex">
  171. <div style="margin-bottom: 15px;width:50px">备注 : </div>
  172. <el-input v-model="refundRemark" :rows="4" type="textarea" show-word-limit placeholder="此处为备注内容" />
  173. </div>
  174. <div class="options">
  175. <el-button color="rgba(111, 182, 184, 1)" class="queding" type="primary" @click="refundYes">
  176. 提交
  177. </el-button>
  178. <el-button @click="cancelRefund">取消</el-button>
  179. </div>
  180. </el-dialog>
  181. <!-- 退款 -->
  182. <!-- <el-dialog class="refund" v-model="refundVisible" :close-on-click-modal="false" :close-on-press-escape="false"
  183. title="退款" align-center width="500" :before-close="cancelRefund">
  184. <div class="priceContent">
  185. <div style="margin-bottom: 15px;">备注 : </div>
  186. <el-input v-model="refundRemark" :rows="4" type="textarea" show-word-limit placeholder="此处为备注内容" />
  187. </div>
  188. <div class="priceContent">
  189. <span>退款金额 : </span>
  190. <span style="color: red">{{ refundPrice }}元</span>
  191. </div>
  192. <div class="options">
  193. <el-button color="rgba(111, 182, 184, 1)" class="queding" type="primary" @click="refundYes">
  194. 同意
  195. </el-button>
  196. <el-button @click="cancelRefund">驳回</el-button>
  197. </div>
  198. </el-dialog> -->
  199. <!-- 审核退款 -->
  200. <el-dialog class="refund" v-model="applyRefundVisible" :close-on-click-modal="false" :close-on-press-escape="false"
  201. title="审核" align-center width="500" :before-close="cancelApplyRefund">
  202. <div class="priceContent">
  203. <span>申请人 : </span>
  204. <span>{{ applyRefundList[0].approveUser }}</span>
  205. </div>
  206. <div class="priceContent">
  207. <span>退款金额 : {{ applyRefundList[0].refundPrice }} 元</span>
  208. <!-- <el-input clearable v-model="applyRefundList[0].refundPrice" class="w-50 m-2" placeholder="请输入退款金额"
  209. style="width: 180px" /> -->
  210. </div>
  211. <!-- <div class="priceContent">
  212. <span>退款描述 : {{ applyRefundList[0].remark }} </span>
  213. </div> -->
  214. <div class="priceContent" style="display:flex">
  215. <div style="width:80px">退款描述 : </div>
  216. <el-input disabled v-model="applyRefundList[0].remark" :rows="4" type="textarea" show-word-limit
  217. placeholder="此处为备注内容" />
  218. </div>
  219. <div class="options">
  220. <el-button color="rgba(111, 182, 184, 1)" class="queding" type="primary" @click="applyRefundYes(1)">
  221. 同意
  222. </el-button>
  223. <el-button @click="applyRefundYes(0)">驳回</el-button>
  224. </div>
  225. </el-dialog>
  226. </div>
  227. <!-- 分页组件 -->
  228. <div class="pageSize">
  229. <span>合计 : 共{{ tablePrice.count }}笔,交易总金额{{
  230. tablePrice.totalPrice
  231. }}元,实退{{ tablePrice.refundTotalPrice }}元 &nbsp;&nbsp;&nbsp;实收{{
  232. tablePrice.officialPrice
  233. }}元</span>
  234. <el-pagination background :current-page="currentPage" :page-size="pageSize"
  235. layout="total, prev, pager, next, jumper, slot" :total="total" @update:current-page="handleCurrentChange" />
  236. </div>
  237. </div>
  238. </template>
  239. <script setup>
  240. import {
  241. ref,
  242. reactive,
  243. watch,
  244. nextTick,
  245. onBeforeMount,
  246. onUnmounted,
  247. } from "vue";
  248. import { useRouter } from "vue-router";
  249. import { ElMessage, ElMessageBox } from "element-plus";
  250. import { Calendar } from "@element-plus/icons-vue";
  251. import vidiconsApi from "@/api/vidicons.js";
  252. import { dayjs } from "element-plus";
  253. import lodash from "lodash";
  254. import axios from "axios";
  255. import { useStore } from "vuex";
  256. const store = useStore();
  257. const api = ref("");
  258. const router = useRouter();
  259. // 表格数据
  260. const schoolId = ref() // 判断是否为超级管理员
  261. const tableData = reactive({ list: [] });
  262. const tablePrice = ref({
  263. count: "",
  264. refundTotalPrice: "",
  265. officialPrice: "",
  266. totalPrice: "",
  267. });
  268. const searchInput = reactive({
  269. keyWord: "",
  270. createTime: "",
  271. }); // 搜索按钮数据
  272. watch(
  273. () => searchInput.createTime,
  274. (newVal, oldVal) => {
  275. console.log("监听时间:", newVal);
  276. if (newVal == null) {
  277. getList();
  278. }
  279. }
  280. );
  281. // 详情(----------------------)
  282. const refundInfoVisible = ref(false);
  283. const refundInfolist = reactive({
  284. list: [
  285. {
  286. payNo: "",
  287. id: "",
  288. payPrice: "",
  289. payTime: "",
  290. recordId: "",
  291. state: "",
  292. userName: "",
  293. refundTotalPrice: "",
  294. officialPrice: "",
  295. },
  296. ],
  297. });
  298. // 退款(----------------------)
  299. // const refundVisible = ref(false); // 控制退款弹窗
  300. // const refundPrice = ref(); // 退款费用
  301. // const refundRecord = reactive({ list: [] }); // 退款记录
  302. // const refundId = ref(); // 退款id
  303. // const restrictPrice = ref(); // 限制退款金额
  304. // 退款
  305. const refundRecord = reactive({ list: [] }); // 退款记录
  306. const refundVisible = ref(false) // 退款弹窗
  307. const refundRemark = ref() // 备注
  308. const refundPrice = ref() // 退款的金额
  309. const refundId = ref(); // 退款id
  310. const restrictPrice = ref(); // 限制退款金额
  311. const refundName = ref() // 申请人
  312. // 审核退款
  313. const applyRefundVisible = ref(false)// 申请退款弹窗
  314. const applyRefundList = ref() // 审核信息
  315. const applyRefundPrice = ref() // 退款金额
  316. const applyRefundPriceRemark = ref() // 退款备注
  317. const currentPage = ref(1); // 当前页
  318. const pageSize = ref(10);
  319. const total = ref(); // 当前总数
  320. // 查看车辆管理列表
  321. const getList = async () => {
  322. let data = {
  323. currentPage: currentPage.value,
  324. pageCount: pageSize.value,
  325. keyWord: searchInput.keyWord,
  326. };
  327. if (searchInput.createTime) {
  328. data.startTime = searchInput.createTime[0];
  329. data.endTime = searchInput.createTime[1];
  330. }
  331. let res = await axios({
  332. method: "get",
  333. url: api.value + "/repairPayRecord/queryProsperityRepairPayRecords",
  334. headers: {
  335. token: sessionStorage.getItem("token"),
  336. user_head: sessionStorage.getItem("userhead"),
  337. },
  338. params: data,
  339. });
  340. console.log(res, "支付成功数据");
  341. if (res.data.code == 200) {
  342. tableData.list = res.data.data.list;
  343. total.value = res.data.data.totalCount;
  344. } else {
  345. ElMessage({
  346. type: "error",
  347. showClose: true,
  348. message: res.data.message,
  349. center: true,
  350. });
  351. if (res.data.code == 570) {
  352. sessionStorage.removeItem("token")
  353. router.push({
  354. path: `/login`,
  355. });
  356. }
  357. }
  358. // 合计接口
  359. {
  360. if (searchInput.createTime) {
  361. data.startTime = searchInput.createTime[0];
  362. data.endTime = searchInput.createTime[1];
  363. }
  364. let res = await axios({
  365. method: "get",
  366. url: api.value + "/repairPayRecord/statistics",
  367. headers: {
  368. token: sessionStorage.getItem("token"),
  369. user_head: sessionStorage.getItem("userhead"),
  370. },
  371. });
  372. console.log(res, "合计");
  373. if (res.data.code == 200) {
  374. tablePrice.value.count = res.data.data.count;
  375. tablePrice.value.refundTotalPrice = res.data.data.refundTotalPrice;
  376. tablePrice.value.totalPrice = res.data.data.totalPrice;
  377. tablePrice.value.officialPrice = res.data.data.officialPrice;
  378. } else {
  379. ElMessage({
  380. type: "error",
  381. showClose: true,
  382. message: res.data.message,
  383. center: true,
  384. });
  385. }
  386. }
  387. };
  388. // 搜索功能
  389. const searchBtn = lodash.debounce(async () => {
  390. getList();
  391. }, 300);
  392. // 详情(----------------------)
  393. const refundInfo = (row) => {
  394. refundInfoVisible.value = true;
  395. refundRecord.list = row.repairRefundRecordList;
  396. refundInfolist.list.payNo = row.payNo;
  397. refundInfolist.list.id = row.id;
  398. refundInfolist.list.payPrice = row.payPrice;
  399. refundInfolist.list.payTime = row.payTime;
  400. refundInfolist.list.recordId = row.recordNo;
  401. refundInfolist.list.state = row.state;
  402. refundInfolist.list.userName = row.userName;
  403. refundInfolist.list.refundTotalPrice = row.refundTotalPrice;
  404. refundInfolist.list.officialPrice = row.officialPrice;
  405. };
  406. // 关闭详情
  407. const cancelRefundInfo = () => {
  408. refundInfoVisible.value = false;
  409. };
  410. //退款按钮 (-------------------------------------------)
  411. const refund = async (row) => {
  412. refundVisible.value = true;
  413. refundId.value = row.id;
  414. refundRecord.list = row.repairRefundRecordList;
  415. restrictPrice.value = row.officialPrice;
  416. // let data = {
  417. // payRecordId: refundId.value,
  418. // };
  419. // let res = await axios({
  420. // method: "get",
  421. // url: api.value + "/repairPayRecord/restrict",
  422. // headers: {
  423. // token: sessionStorage.getItem("token"),
  424. // user_head: sessionStorage.getItem("userhead"),
  425. // },
  426. // params: data,
  427. // });
  428. // restrictPrice.value = res.data.data;
  429. // console.log(res, "退款限制金额");
  430. };
  431. // 确定退款
  432. const refundYes = async () => {
  433. var reg = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^0$)|(^\d\.\d{1,2}$)/;
  434. console.log(reg.test(refundPrice.value));
  435. if (refundPrice.value > restrictPrice.value) {
  436. ElMessage({
  437. type: "error",
  438. showClose: true,
  439. message: "退款金额不能大于剩余金额",
  440. center: true,
  441. });
  442. return false;
  443. } else if (restrictPrice.value == 0) {
  444. ElMessage({
  445. type: "error",
  446. showClose: true,
  447. message: "金额已全部退款",
  448. center: true,
  449. });
  450. return false;
  451. } else if (refundPrice.value <= 0) {
  452. ElMessage({
  453. type: "error",
  454. showClose: true,
  455. message: "输入的退款金额必须大于0",
  456. center: true,
  457. });
  458. return false;
  459. } else if (!reg.test(refundPrice.value)) {
  460. ElMessage({
  461. type: "error",
  462. showClose: true,
  463. message: "退款金额为正数(小数位不超过2位)",
  464. center: true,
  465. });
  466. return false;
  467. } else {
  468. console.log("金额允许");
  469. if (!refundRemark.value) {
  470. ElMessage({
  471. type: "error",
  472. showClose: true,
  473. message: "备注不能为空",
  474. center: true,
  475. });
  476. return false;
  477. }
  478. }
  479. let data = {
  480. repairPayRecordId: refundId.value,
  481. refundPrice: refundPrice.value,
  482. remark: refundRemark.value
  483. };
  484. let res = await axios({
  485. method: "post",
  486. url: api.value + "/repairPayRecord/RefundableAmount",
  487. headers: {
  488. token: sessionStorage.getItem("token"),
  489. user_head: sessionStorage.getItem("userhead"),
  490. },
  491. data: data,
  492. });
  493. console.log(res, "退款");
  494. if (res.data.code == 200) {
  495. refundVisible.value = false;
  496. refundPrice.value = "";
  497. refundRemark.value = ""
  498. getList();
  499. ElMessage({
  500. type: "success",
  501. showClose: true,
  502. message: res.data.message,
  503. center: true,
  504. });
  505. } else {
  506. ElMessage({
  507. type: "error",
  508. showClose: true,
  509. message: res.data.message,
  510. center: true,
  511. });
  512. }
  513. };
  514. // 取消按钮
  515. const cancelRefund = () => {
  516. refundVisible.value = false;
  517. refundPrice.value = ""
  518. refundRemark.value = ""
  519. };
  520. // 审核退款 (----------------------------------------------------)
  521. const applyRefund = (row) => {
  522. applyRefundVisible.value = true
  523. applyRefundList.value = row.approveRefunds
  524. }
  525. // 确定审核
  526. const applyRefundYes = async (flag) => {
  527. console.log(applyRefundList.value, "确定申请退款");
  528. let data = {
  529. id: applyRefundList.value[0].id,
  530. state: flag,
  531. };
  532. let res = await axios({
  533. method: "post",
  534. url: api.value + "/repairPayRecord/refundReview",
  535. headers: {
  536. token: sessionStorage.getItem("token"),
  537. user_head: sessionStorage.getItem("userhead"),
  538. },
  539. data: data,
  540. });
  541. if (res.data.code == 200) {
  542. applyRefundVisible.value = false
  543. getList();
  544. ElMessage({
  545. type: "success",
  546. showClose: true,
  547. message: res.data.message,
  548. center: true,
  549. });
  550. } else {
  551. ElMessage({
  552. type: "error",
  553. showClose: true,
  554. message: res.data.message,
  555. center: true,
  556. });
  557. }
  558. }
  559. // 驳回审核
  560. const cancelApplyRefund = () => {
  561. applyRefundVisible.value = false
  562. }
  563. //导出功能
  564. const importExcel = async () => {
  565. let data = {
  566. keyWord: searchInput.keyWord,
  567. };
  568. if (searchInput.createTime) {
  569. data.startTime = searchInput.createTime[0];
  570. data.endTime = searchInput.createTime[1];
  571. }
  572. let res = await axios({
  573. method: "get",
  574. url: api.value + "/repairPayRecord/queryExport",
  575. headers: {
  576. token: sessionStorage.getItem("token"),
  577. user_head: sessionStorage.getItem("userhead"),
  578. },
  579. responseType: "blob",
  580. params: data,
  581. });
  582. console.log(res, "导出支付订单");
  583. if (res.status == 200) {
  584. let name = `支付成功订单数据`;
  585. var content = res.data;
  586. var datas = new Blob([content]);
  587. var downloadUrl = window.URL.createObjectURL(datas);
  588. var anchor = document.createElement("a");
  589. anchor.href = downloadUrl;
  590. anchor.download = name + ".xlsx";
  591. anchor.click();
  592. window.URL.revokeObjectURL(datas);
  593. ElMessage({
  594. type: "success",
  595. showClose: true,
  596. message: "导出成功",
  597. center: true,
  598. });
  599. } else {
  600. ElMessage({
  601. type: "error",
  602. showClose: true,
  603. message: "导出失败",
  604. center: true,
  605. });
  606. }
  607. };
  608. // 表格斑马纹颜色修改
  609. const tableRowClassName = ({ row, rowIndex }) => {
  610. if (rowIndex % 2 === 0) {
  611. return "even";
  612. } else if (rowIndex % 2 !== 0) {
  613. return "odd";
  614. }
  615. return "";
  616. };
  617. // 耗材管理分页
  618. const handleCurrentChange = (value) => {
  619. // console.log(value);
  620. currentPage.value = value;
  621. getList();
  622. };
  623. onBeforeMount(() => {
  624. api.value = store.state.user.api;
  625. if (sessionStorage.getItem("schoolId") == "null") {
  626. schoolId.value = 0;
  627. } else {
  628. schoolId.value = Number(sessionStorage.getItem("schoolId"));
  629. }
  630. refundName.value = sessionStorage.getItem("username")
  631. getList();
  632. });
  633. onUnmounted(() => {
  634. // document.removeEventListener("keyup", Enters);
  635. });
  636. </script>
  637. <style scoped lang="scss">
  638. .content-box {
  639. width: 97.5%;
  640. height: 89%;
  641. margin: 20px auto;
  642. background-color: #fff;
  643. color: #fff;
  644. display: flex;
  645. flex-direction: column;
  646. box-shadow: 0px 3px 10px rgba(213, 228, 252, 1);
  647. .left {
  648. // width: calc(100wh - 40px);
  649. display: flex;
  650. align-items: center;
  651. height: 60px;
  652. margin: 0 30px;
  653. border-bottom: 1px solid #ccc;
  654. color: rgb(0, 0, 0);
  655. font-size: 18px;
  656. font-weight: 600;
  657. span {
  658. margin-right: 20px;
  659. cursor: pointer;
  660. }
  661. .is_active {
  662. color: rgba(111, 182, 184, 1);
  663. }
  664. }
  665. .middle {
  666. width: 96%;
  667. margin: 0 auto;
  668. color: #000;
  669. // border-bottom: 1px solid rgb(231, 231, 231);
  670. .filter {
  671. display: flex;
  672. flex-wrap: wrap;
  673. align-items: center;
  674. margin: 10px 0 0 0;
  675. .search {
  676. color: #fff;
  677. }
  678. .condition {
  679. display: flex;
  680. align-items: center;
  681. margin: 10px 30px 10px 0;
  682. :deep(.el-input .el-input__inner) {
  683. font-size: 16px;
  684. }
  685. span {
  686. margin: 0 10px 0 0;
  687. }
  688. }
  689. }
  690. .gongneng {
  691. margin: 10px 0 10px 0;
  692. span {
  693. color: #fff;
  694. }
  695. }
  696. :deep(.cont) {
  697. width: 60%;
  698. margin: 20px auto;
  699. }
  700. :deep(.download) {
  701. display: flex;
  702. align-items: center;
  703. margin: 10px;
  704. }
  705. :deep(.download span) {
  706. font-size: 16px;
  707. margin-left: 20px;
  708. }
  709. :deep(.cont .el-button) {
  710. margin-left: 60px;
  711. margin-bottom: 30px;
  712. }
  713. :deep(.cont .accomplish) {
  714. width: 100%;
  715. display: flex;
  716. justify-content: center;
  717. }
  718. :deep(.cont .accomplish .el-button) {
  719. width: 50%;
  720. margin: 0;
  721. }
  722. }
  723. .footer {
  724. width: 96%;
  725. height: 550px;
  726. margin: 10px auto 25px;
  727. .el-table--fit {
  728. height: 100%;
  729. :deep(.el-table__header-wrapper) {
  730. background-color: #000;
  731. font-size: 16px;
  732. tr {
  733. color: #000;
  734. }
  735. }
  736. :deep(.el-table__row) {
  737. height: 50px;
  738. font-size: 16px;
  739. color: #000;
  740. }
  741. :deep(.el-table__row td) {
  742. padding: 0;
  743. border: 0;
  744. }
  745. .el-button--primary {
  746. margin-left: 5px;
  747. }
  748. :deep(.el-table__body .even) {
  749. background-color: #fff;
  750. }
  751. :deep(.el-table__body .odd) {
  752. background-color: rgba(240, 243, 247, 1);
  753. }
  754. :deep(.edit) {
  755. display: flex;
  756. align-items: center;
  757. justify-content: center;
  758. color: rgba(111, 182, 184, 1);
  759. }
  760. :deep(.look) {
  761. padding: 0 10px;
  762. cursor: pointer;
  763. }
  764. // :deep(.look):hover {
  765. // color: red;
  766. // }
  767. }
  768. // 添加员工弹窗样式
  769. :deep(.addStaff) {
  770. // height: 420px;
  771. border-radius: 11px;
  772. .el-dialog__header {
  773. border-radius: 11px 11px 0 0;
  774. background: rgba(237, 241, 245, 1);
  775. font-weight: 600;
  776. margin: 0;
  777. .el-dialog__headerbtn {
  778. outline: none;
  779. }
  780. }
  781. .el-dialog__body {
  782. padding: 30px 20px 10px 20px;
  783. .el-input {
  784. width: 200px;
  785. }
  786. .checkbox {
  787. .el-form-item__content {
  788. display: flex;
  789. flex-direction: column;
  790. align-items: flex-start;
  791. .el-checkbox-group {
  792. display: flex;
  793. flex-direction: column;
  794. }
  795. }
  796. }
  797. .options {
  798. .el-form-item__content {
  799. .queding {
  800. margin-left: 20px;
  801. color: #fff;
  802. }
  803. display: flex;
  804. flex-direction: row-reverse;
  805. }
  806. }
  807. }
  808. }
  809. }
  810. // 详情样式
  811. :deep(.refundInfo) {
  812. height: 800px;
  813. overflow: hidden;
  814. border-radius: 11px;
  815. .el-dialog__header {
  816. border-radius: 11px 11px 0 0;
  817. background: rgba(237, 241, 245, 1);
  818. font-weight: 600;
  819. margin: 0;
  820. .el-dialog__headerbtn {
  821. outline: none;
  822. }
  823. }
  824. .el-dialog__body {
  825. height: 720px;
  826. overflow: auto;
  827. padding: 0px 20px 10px 20px;
  828. .order_info {
  829. .title {
  830. display: flex;
  831. align-items: center;
  832. margin: 25px 0 20px 0;
  833. img {
  834. width: 20px;
  835. height: 20px;
  836. margin-right: 10px;
  837. }
  838. span {
  839. color: #000;
  840. font-size: 18px;
  841. font-weight: 600;
  842. }
  843. }
  844. // 工单详情 排列模式样式
  845. .workNum {
  846. display: flex;
  847. align-items: center;
  848. margin-bottom: 12px;
  849. font-size: 16px;
  850. .titles {
  851. color: rgba(128, 128, 128, 1);
  852. margin-right: 8px;
  853. font-weight: 400;
  854. width: 76px;
  855. }
  856. span {
  857. color: #000;
  858. font-weight: 600;
  859. }
  860. }
  861. // 工单详情 步骤条样式
  862. .steps {
  863. .el-step {
  864. // margin: 15px 0;
  865. .el-step__main {
  866. display: flex;
  867. margin-bottom: 25px;
  868. span {
  869. font-size: 16px;
  870. }
  871. .el-step__title {
  872. display: inline;
  873. padding: 0 15px 0 0;
  874. span {
  875. background-color: rgba(111, 182, 184, 1);
  876. color: #fff;
  877. padding: 1px 3px;
  878. border-radius: 3px;
  879. }
  880. }
  881. }
  882. .el-step__description {
  883. .content {
  884. margin-top: 7px;
  885. color: #000;
  886. }
  887. }
  888. }
  889. }
  890. }
  891. }
  892. }
  893. //退款弹窗样式
  894. :deep(.refund) {
  895. // height: 320px;
  896. border-radius: 11px;
  897. .el-dialog__header {
  898. border-radius: 11px 11px 0 0;
  899. background: rgba(237, 241, 245, 1);
  900. font-weight: 600;
  901. margin: 0;
  902. .el-dialog__headerbtn {
  903. outline: none;
  904. }
  905. }
  906. .el-dialog__body {
  907. padding: 25px 20px 10px 20px;
  908. .el-form-item__label {
  909. color: #000;
  910. }
  911. .priceContent {
  912. margin-bottom: 20px;
  913. .el-input {
  914. margin: 0 15px;
  915. }
  916. // .el-input__suffix {
  917. // width: 20px;
  918. // margin: 0 0 0 10px;
  919. // padding: 0;
  920. // }
  921. }
  922. ul {
  923. li {
  924. margin: 5px 0;
  925. }
  926. }
  927. .options {
  928. display: flex;
  929. flex-direction: row-reverse;
  930. width: 100%;
  931. margin: 20px 20px 20px 0;
  932. .queding {
  933. margin-left: 20px;
  934. color: #fff;
  935. }
  936. }
  937. }
  938. }
  939. .pageSize {
  940. display: flex;
  941. align-items: center;
  942. justify-content: space-between;
  943. margin: 0 30px;
  944. span {
  945. color: #000;
  946. }
  947. .el-pagination {
  948. // width: 1600px;
  949. :deep(.el-pagination__total) {
  950. color: #000;
  951. }
  952. :deep(.el-pagination__goto) {
  953. color: #000;
  954. }
  955. :deep(.el-pagination__classifier) {
  956. color: #000;
  957. }
  958. :deep(.el-input__wrapper) {
  959. border: 1px solid rgba(0, 0, 0, 1);
  960. border-radius: 5px;
  961. box-shadow: none;
  962. }
  963. :deep(.el-pager li) {
  964. margin: 0 5px;
  965. border: 1px solid rgba(0, 0, 0, 1);
  966. border-radius: 5px;
  967. background-color: transparent;
  968. }
  969. :deep(.el-pager li.is-active) {
  970. background-color: rgba(111, 182, 184, 1);
  971. }
  972. :deep(.btn-prev) {
  973. margin-right: 5px;
  974. border: 1px solid rgba(0, 0, 0, 1);
  975. border-radius: 5px;
  976. background-color: transparent;
  977. }
  978. :deep(.btn-next) {
  979. margin-left: 5px;
  980. border: 1px solid rgba(0, 0, 0, 1);
  981. border-radius: 5px;
  982. background-color: transparent;
  983. }
  984. }
  985. }
  986. }
  987. .el-input {
  988. width: 192px;
  989. }
  990. </style>