RefundManager.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924
  1. <template>
  2. <div class="manage-root">
  3. <Header />
  4. <div class="manage-root-contain">
  5. <nav-menu
  6. class="manage-root-contain-left"
  7. :activeMenuIndex="activeMenuIndex"
  8. ></nav-menu>
  9. <div class="manage-root-contain-right">
  10. <breadcrumb
  11. :breadcrumbList="breadcrumbList"
  12. class="breadcrumb-box"
  13. ></breadcrumb>
  14. <div class="personal-inner">
  15. <div class="search-box">
  16. <div class="search-item">
  17. <label>搜索</label>
  18. <el-input
  19. placeholder="退款申请人姓名"
  20. v-model="searchInput"
  21. maxlength="200"
  22. >
  23. <i
  24. slot="suffix"
  25. class="el-input__icon el-icon-search"
  26. @click="getList(1)"
  27. style="cursor: pointer"
  28. ></i>
  29. </el-input>
  30. </div>
  31. <div class="search-item">
  32. <label>退款申请状态</label>
  33. <el-select
  34. v-model="searchStatus"
  35. @change="getList(1)"
  36. placeholder="请选择"
  37. >
  38. <el-option
  39. v-for="item in transactionList"
  40. :key="item.status"
  41. :label="item.status_name"
  42. :value="item.status"
  43. >
  44. </el-option>
  45. </el-select>
  46. </div>
  47. </div>
  48. <el-table
  49. class="search-table"
  50. :data="tableData"
  51. style="width: 100%"
  52. @sort-change="handleSort"
  53. :default-sort="dataSort"
  54. :max-height="tableHeight"
  55. v-loading="tableLoading"
  56. >
  57. <el-table-column
  58. type="index"
  59. label="#"
  60. sortable
  61. width="54"
  62. :index="(pageNumber - 1) * pageSize + 1"
  63. >
  64. </el-table-column>
  65. <el-table-column prop="sn" label="申请单号" width="190">
  66. </el-table-column>
  67. <el-table-column prop="order_sn" label="订单号" width="190">
  68. </el-table-column>
  69. <el-table-column prop="order_name" label="购买商品" min-width="220">
  70. </el-table-column>
  71. <el-table-column prop="goods_type" label="商品类型" width="128">
  72. <template slot-scope="scope">
  73. <span
  74. class="items-type"
  75. :style="{
  76. background: goodsTypeListCss[scope.row.goods_type]
  77. ? goodsTypeListCss[scope.row.goods_type].bg
  78. : '',
  79. color: goodsTypeListCss[scope.row.goods_type]
  80. ? goodsTypeListCss[scope.row.goods_type].color
  81. : '',
  82. }"
  83. >{{ scope.row.goods_type_name }}</span
  84. >
  85. </template>
  86. </el-table-column>
  87. <el-table-column prop="is_reservation" label="是否预定" width="80">
  88. <template slot-scope="scope">
  89. {{ scope.row.is_reservation_order === "true" ? "是" : "否" }}
  90. </template>
  91. </el-table-column>
  92. <el-table-column
  93. prop="goods_study_phase_name"
  94. label="学段"
  95. width="64"
  96. >
  97. </el-table-column>
  98. <el-table-column prop="order_amount" label="订单金额" width="140">
  99. <template slot-scope="scope">
  100. <span class="currectPrice"
  101. >¥{{ scope.row.order_amount | cutMoneyFiter }}</span
  102. >
  103. </template>
  104. </el-table-column>
  105. <el-table-column
  106. prop="order_pay_time"
  107. label="订单支付时间"
  108. sortable="custom"
  109. width="180"
  110. >
  111. </el-table-column>
  112. <el-table-column
  113. prop="person_name"
  114. label="购买者"
  115. sortable="custom"
  116. width="109"
  117. >
  118. </el-table-column>
  119. <el-table-column
  120. prop="person_city_name"
  121. label="客户所在省市"
  122. width="164"
  123. >
  124. <template slot-scope="scope">
  125. {{
  126. scope.row.person_province_name +
  127. "/" +
  128. scope.row.person_city_name
  129. }}
  130. </template>
  131. </el-table-column>
  132. <el-table-column
  133. prop="person_org_name"
  134. label="客户所在机构"
  135. sortable="custom"
  136. width="184"
  137. >
  138. </el-table-column>
  139. <el-table-column
  140. prop="submit_time"
  141. label="提交申请时间"
  142. sortable="custom"
  143. width="180"
  144. >
  145. </el-table-column>
  146. <el-table-column prop="status" label="退款申请状态" width="112">
  147. <template slot-scope="scope">
  148. <div class="status-box">
  149. <span
  150. :style="{
  151. background: refundStatusList[scope.row.status].bg,
  152. }"
  153. ></span>
  154. <b
  155. :style="{
  156. color: refundStatusList[scope.row.status].textColor,
  157. }"
  158. >{{ refundStatusList[scope.row.status].text }}</b
  159. >
  160. </div>
  161. </template>
  162. </el-table-column>
  163. <el-table-column prop="auditor_name" label="审核人" width="104">
  164. </el-table-column>
  165. <el-table-column prop="audit_time" label="审核时间" width="180">
  166. </el-table-column>
  167. <el-table-column prop="refund_amount" label="退款金额" width="144">
  168. <template slot-scope="scope" v-if="scope.row.status === 2">
  169. <span class="currectPrice"
  170. >¥{{ scope.row.refund_amount | cutMoneyFiter }}</span
  171. >
  172. </template>
  173. </el-table-column>
  174. <el-table-column
  175. prop="refund_transaction_sn"
  176. label="退款交易流水号"
  177. width="180"
  178. >
  179. </el-table-column>
  180. <el-table-column fixed="right" label="操作" width="100">
  181. <template slot-scope="scope" v-if="scope.row.status === 0">
  182. <el-button
  183. type="text"
  184. size="small"
  185. class="primary-btn"
  186. @click.native.prevent="handleRefund(scope.row, scope.$index)"
  187. >
  188. 退款
  189. </el-button>
  190. <el-button
  191. @click.native.prevent="handleRefuse(scope.row, scope.$index)"
  192. type="text"
  193. size="small"
  194. class="red-btn"
  195. >
  196. 拒绝
  197. </el-button>
  198. </template>
  199. </el-table-column>
  200. </el-table>
  201. <el-pagination
  202. background
  203. @size-change="handleSizeChange"
  204. @current-change="handleCurrentChange"
  205. :current-page="pageNumber"
  206. :page-sizes="[10, 20, 30, 40]"
  207. :page-size="pageSize"
  208. layout="total, prev, pager, next, sizes, jumper"
  209. :total="total_count"
  210. >
  211. </el-pagination>
  212. </div>
  213. </div>
  214. </div>
  215. <el-dialog title="退款信息" :visible.sync="dialogVisible" width="500px">
  216. <template v-if="ktjeInfo">
  217. <span style="margin-right: 5px">可退金额:</span>
  218. <el-input v-model="ktje"></el-input>
  219. <p>可退商品信息</p>
  220. <div class="item-info">
  221. <label>物品类型:</label><span>{{ ktjeInfo.goods_type_name }}</span>
  222. </div>
  223. <div class="item-info">
  224. <label>物品学段:</label
  225. ><span>{{ ktjeInfo.goods_study_phase_name }}</span>
  226. </div>
  227. <div class="item-info">
  228. <label>订单金额:</label
  229. ><span>¥{{ ktjeInfo.order_amount | cutMoneyFiter }}</span>
  230. </div>
  231. <!-- 物品实体 -->
  232. <template v-if="ktjeInfo.order_sale_model === 0">
  233. <div
  234. class="item-info"
  235. v-if="ktjeInfo.is_reservation_order === 'true'"
  236. >
  237. <label>订阅期数:</label
  238. ><span>{{
  239. ktjeInfo.period_count === -1 ? "年刊" : ktjeInfo.period_count
  240. }}</span>
  241. </div>
  242. <div
  243. class="item-info"
  244. v-if="
  245. ktjeInfo.is_reservation_order === 'true' &&
  246. ktjeInfo.period_count !== -1
  247. "
  248. >
  249. <label>订阅列表:</label
  250. ><span>{{ ktjeInfo.issue_no_list_reservation.join("、") }}</span>
  251. </div>
  252. <div
  253. class="item-info"
  254. v-if="
  255. ktjeInfo.is_reservation_order === 'true' &&
  256. ktjeInfo.issue_no_list_my_goods.length > 0
  257. "
  258. >
  259. <label>已上架:</label
  260. ><span>{{ ktjeInfo.issue_no_list_my_goods.join("、") }}</span>
  261. </div>
  262. <div
  263. class="item-info"
  264. v-if="
  265. ktjeInfo.is_reservation_order === 'true' &&
  266. ktjeInfo.period_count === -1
  267. "
  268. >
  269. <label>开始日期:</label
  270. ><span>{{ ktjeInfo.valid_period_begin_date }}</span>
  271. </div>
  272. <div
  273. class="item-info"
  274. v-if="
  275. ktjeInfo.is_reservation_order === 'true' &&
  276. ktjeInfo.period_count === -1
  277. "
  278. >
  279. <label>截止日期:</label
  280. ><span>{{ ktjeInfo.valid_period_end_date }}</span>
  281. </div>
  282. <div
  283. class="item-info"
  284. v-if="
  285. ktjeInfo.is_reservation_order === 'true' &&
  286. ktjeInfo.period_count === -1
  287. "
  288. >
  289. <label>当前日期:</label><span>{{ ktjeInfo.cur_date }}</span>
  290. </div>
  291. </template>
  292. <!-- 使用期限 -->
  293. <template v-if="ktjeInfo.order_sale_model === 1">
  294. <div class="item-info">
  295. <label>订单日期:</label><span>{{ ktjeInfo.order_date }}</span>
  296. </div>
  297. <div class="item-info">
  298. <label>有效期天数:</label
  299. ><span>{{ ktjeInfo.valid_period_day_count }}</span>
  300. </div>
  301. <div class="item-info">
  302. <label>截止日期:</label
  303. ><span>{{ ktjeInfo.valid_period_end_date }}</span>
  304. </div>
  305. <div class="item-info">
  306. <label>当前日期:</label><span>{{ ktjeInfo.cur_date }}</span>
  307. </div>
  308. </template>
  309. </template>
  310. <span slot="footer" class="dialog-footer">
  311. <el-button size="small" @click="dialogVisible = false">取 消</el-button>
  312. <el-button size="small" type="primary" @click="sureRefund"
  313. >确 定</el-button
  314. >
  315. </span>
  316. </el-dialog>
  317. </div>
  318. </template>
  319. <script>
  320. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  321. //例如:import 《组件名称》from ‘《组件路径》';
  322. import Header from "../../components/Header.vue";
  323. import NavMenu from "../../components/NavMenu.vue";
  324. import Breadcrumb from "../../components/Breadcrumb.vue";
  325. import { getLogin } from "@/api/ajax";
  326. import { mapState } from "vuex";
  327. import { cutMoneyFiter } from "@/utils/defined";
  328. import { getToken } from "@/utils/auth";
  329. export default {
  330. //import引入的组件需要注入到对象中才能使用
  331. components: { Header, NavMenu, Breadcrumb },
  332. props: {},
  333. filters: {
  334. cutMoneyFiter,
  335. },
  336. data() {
  337. //这里存放数据
  338. return {
  339. activeMenuIndex: "refund_manage",
  340. breadcrumbList: [
  341. {
  342. icon: "money-cny-box-line",
  343. url: "",
  344. text: "",
  345. },
  346. {
  347. icon: "",
  348. url: "",
  349. notLink: true,
  350. text: "财务中心",
  351. },
  352. {
  353. icon: "",
  354. url: "",
  355. text: "退款管理",
  356. },
  357. ],
  358. quickList: [], // 快速查询
  359. searchInput: "",
  360. searchQuick: null,
  361. quickIndex: null, // 快速搜索的索引
  362. proceedsNumber: "", // 收款单数
  363. proceedsPrice: null, // 收款金额
  364. proceedsPriceArr: [],
  365. searchType: -1,
  366. validity: "",
  367. searchStudy: -1,
  368. searchStatus: -1,
  369. searchGoodsType: -1,
  370. searchIsCDKEY: -1,
  371. searchOrgid: "",
  372. searchArea: [],
  373. searchChannel: -1,
  374. channelList: [
  375. {
  376. label: "全部",
  377. value: -1,
  378. },
  379. {
  380. label: "支付宝",
  381. value: 4,
  382. },
  383. {
  384. label: "微信支付",
  385. value: 3,
  386. },
  387. ],
  388. orgList: [
  389. {
  390. name: "全部",
  391. id: "",
  392. },
  393. ],
  394. isCDKEYList: [
  395. {
  396. label: "全部",
  397. value: -1,
  398. },
  399. {
  400. label: "已使用",
  401. value: 1,
  402. },
  403. {
  404. label: "未使用",
  405. value: 0,
  406. },
  407. ], // 是否使用兑换码
  408. transactionList: [
  409. {
  410. status_name: "全部",
  411. status: -1,
  412. },
  413. {
  414. status_name: "待审核",
  415. status: 0,
  416. },
  417. {
  418. status_name: "驳回",
  419. status: 1,
  420. },
  421. {
  422. status_name: "审核通过",
  423. status: 2,
  424. },
  425. ], //交易状态列表
  426. transactionListCss: {
  427. 0: {
  428. bg: "rgb(245, 63, 63)",
  429. text: "未支付",
  430. },
  431. 1: {
  432. bg: "#00B42A",
  433. text: "支付成功",
  434. },
  435. 2: {
  436. bg: "#165DFF",
  437. text: "兑换成功",
  438. },
  439. 3: {
  440. bg: "#F7BA1E",
  441. text: "已退款",
  442. },
  443. 4: {
  444. bg: "#FF7D00",
  445. text: "已撤回",
  446. },
  447. },
  448. goodsTypeList: [
  449. {
  450. goods_name: "全部",
  451. value: -1,
  452. },
  453. {
  454. goods_name: "报纸",
  455. value: 2,
  456. },
  457. {
  458. goods_name: "精读",
  459. value: 3,
  460. },
  461. {
  462. goods_name: "课程",
  463. value: 10,
  464. },
  465. ], // 商品类型
  466. goodsTypeListCss: {
  467. 2: {
  468. text: "报纸",
  469. color: "#165DFF",
  470. bg: "#E8F7FF",
  471. },
  472. 4: {
  473. text: "画刊",
  474. color: "#F53F3F",
  475. bg: "#FFECE8",
  476. },
  477. 3: {
  478. text: "精读",
  479. color: "#0FC6C2",
  480. bg: "#E8FFFB",
  481. },
  482. 0: {
  483. text: "课程",
  484. color: "#722ED1",
  485. bg: "#F5E8FF",
  486. },
  487. 1: {
  488. text: "课程",
  489. color: "#722ED1",
  490. bg: "#F5E8FF",
  491. },
  492. 10: {
  493. text: "课程",
  494. color: "#722ED1",
  495. bg: "#F5E8FF",
  496. },
  497. // '5':{
  498. // text:'报纸专辑',
  499. // color:'#165DFF',
  500. // bg:'#E8F7FF'
  501. // },
  502. // '6':{
  503. // text:'画刊专辑',
  504. // color:'#F53F3F',
  505. // bg:'#FFECE8'
  506. // }
  507. },
  508. typeList: [
  509. {
  510. account_type: -1,
  511. account_type_name: "全部",
  512. },
  513. ],
  514. statusList: {
  515. 1: {
  516. text: "正常",
  517. bg: "#165DFF",
  518. color: "",
  519. },
  520. 0: {
  521. text: "停用",
  522. bg: "#F53F3F",
  523. color: "#F53F3F",
  524. },
  525. },
  526. refundStatusList: {
  527. 2: {
  528. text: "审核通过",
  529. bg: "#00B42A",
  530. textColor: "#1D2129",
  531. },
  532. 0: {
  533. text: "待审核",
  534. bg: "#165DFF",
  535. textColor: "#1D2129",
  536. },
  537. 1: {
  538. text: "驳回",
  539. bg: "#FF7D00",
  540. textColor: "#1D2129",
  541. },
  542. },
  543. tableData: [],
  544. pageSize: window.localStorage.getItem("pageSize")
  545. ? Number(window.localStorage.getItem("pageSize"))
  546. : 10,
  547. pageNumber: window.localStorage.getItem("pageNumber")
  548. ? Number(window.localStorage.getItem("pageNumber"))
  549. : 1,
  550. tableHeight: "", // 表格高度
  551. total_count: 0,
  552. dataSort: {},
  553. props: { multiple: true },
  554. tableLoading: false,
  555. exportLoading: false,
  556. exportFlag:
  557. getToken() && JSON.parse(getToken())
  558. ? JSON.parse(getToken()).popedom_code_list.indexOf(40002) > -1
  559. : false,
  560. dialogVisible: false,
  561. ktje: 0,
  562. refundId: "",
  563. ktjeInfo: null,
  564. };
  565. },
  566. //计算属性 类似于data概念
  567. computed: {
  568. ...mapState(["$studyTypeAll", "$provinceCityListAll"]),
  569. },
  570. //监控data中数据变化
  571. watch: {},
  572. //方法集合
  573. methods: {
  574. qucikSearch(value, index) {
  575. (this.validity = [value.date_begin, value.date_end]),
  576. (this.quickIndex = index);
  577. this.getList();
  578. },
  579. handleSort(value) {
  580. let dataSort = {
  581. prop: value.prop,
  582. order: value.order,
  583. };
  584. this.dataSort = dataSort;
  585. this.getList();
  586. },
  587. // 查询列表
  588. getList(page) {
  589. this.tableLoading = true;
  590. if (page) {
  591. this.pageNumber = page;
  592. }
  593. let MethodName =
  594. "/ShopServer/Manager/FinanceManager/PageQueryOrderRefundApplyList";
  595. let order_column_list = [];
  596. if (this.dataSort != {}) {
  597. if (this.dataSort.order == "descending") {
  598. order_column_list = [this.dataSort.prop + ":desc"];
  599. } else if (this.dataSort.order == "ascending") {
  600. // 升序不传值
  601. order_column_list = [this.dataSort.prop];
  602. } else {
  603. order_column_list = ["submit_time:desc"];
  604. }
  605. } else {
  606. order_column_list = ["submit_time:desc"];
  607. }
  608. let data = {
  609. person_name: this.searchInput.trim(),
  610. page_capacity: this.pageSize,
  611. cur_page: this.pageNumber,
  612. order_column_list: order_column_list,
  613. status: this.searchStatus,
  614. };
  615. getLogin(MethodName, data)
  616. .then((res) => {
  617. this.tableLoading = false;
  618. if (res.status === 1) {
  619. this.tableData = res.apply_list;
  620. this.total_count = res.total_count;
  621. }
  622. })
  623. .catch(() => {
  624. this.tableLoading = false;
  625. });
  626. },
  627. // 拒绝
  628. handleRefuse(row, index) {
  629. this.$confirm("确定拒绝退款吗?", "提示", {
  630. confirmButtonText: "确定",
  631. cancelButtonText: "取消",
  632. type: "warning",
  633. })
  634. .then(() => {
  635. let Mname =
  636. "/ShopServer/Manager/FinanceManager/AuditOrderRefundApply";
  637. let updataData = JSON.parse(JSON.stringify(row));
  638. let data = {
  639. id: row.id,
  640. is_pass: "false",
  641. };
  642. getLogin(Mname, data).then((res) => {
  643. this.$message.success("操作成功");
  644. this.getList();
  645. });
  646. })
  647. .catch(() => {});
  648. },
  649. // 退款
  650. handleRefund(row, index) {
  651. this.ktjeInfo = null;
  652. let Mnames =
  653. "/ShopServer/Manager/FinanceManager/GetOrderRefundApplyKTJEInfo";
  654. let datas = {
  655. id: row.id,
  656. };
  657. getLogin(Mnames, datas).then((res) => {
  658. if (res.status === 1) {
  659. this.ktje = res.ktje_info.ktje;
  660. this.ktjeInfo = res.ktje_info;
  661. this.refundId = row.id;
  662. this.dialogVisible = true;
  663. }
  664. });
  665. // this.$prompt("请输入金额", "提示", {
  666. // confirmButtonText: "确定",
  667. // cancelButtonText: "取消",
  668. // })
  669. // .then(({ value }) => {
  670. //
  671. // })
  672. // .catch(() => {
  673. // // this.$message({
  674. // // type: "info",
  675. // // message: "取消输入",
  676. // // });
  677. // });
  678. },
  679. // 确定退款
  680. sureRefund() {
  681. let Mname = "/ShopServer/Manager/FinanceManager/AuditOrderRefundApply";
  682. let data = {
  683. id: this.refundId,
  684. is_pass: "true",
  685. refund_amount: this.ktje,
  686. };
  687. getLogin(Mname, data).then((res) => {
  688. this.$message.success("操作成功");
  689. this.getList();
  690. this.dialogVisible = false;
  691. });
  692. },
  693. handleSizeChange(val) {
  694. this.pageSize = val;
  695. this.pageNumber = 1;
  696. this.getList();
  697. },
  698. handleCurrentChange(val) {
  699. this.pageNumber = val;
  700. this.getList();
  701. },
  702. //计算table高度(动态设置table高度)
  703. getTableHeight() {
  704. let tableH = 370; //距离页面下方的高度
  705. let tableHeightDetil = window.innerHeight - tableH;
  706. if (tableHeightDetil <= 300) {
  707. this.tableHeight = 300;
  708. } else {
  709. this.tableHeight = window.innerHeight - tableH;
  710. }
  711. },
  712. // 用户类型列表
  713. getOrgList() {
  714. let MethodName = "/OrgServer/Client/OrgManager/GetOrgIndexList";
  715. let data = {
  716. name: "",
  717. status: 1,
  718. sn: "",
  719. };
  720. getLogin(MethodName, data)
  721. .then((res) => {
  722. if (res.status === 1) {
  723. this.orgList = [
  724. {
  725. name: "全部",
  726. id: "",
  727. },
  728. ];
  729. this.orgList = this.orgList.concat(res.org_index_list);
  730. }
  731. })
  732. .catch(() => {
  733. this.loading = false;
  734. });
  735. },
  736. // 快捷时间按钮列表
  737. getQuickList() {
  738. this.quickList = [];
  739. let MethodName =
  740. "/ShopServer/Manager/FinanceManager/GetQueryCritDateSpaceList";
  741. let data = {};
  742. getLogin(MethodName, data).then((res) => {
  743. if (res.status === 1) {
  744. this.quickList = res.date_space_list;
  745. }
  746. });
  747. },
  748. CopyToClipboard(element) {
  749. var doc = document,
  750. text = doc.getElementById(element),
  751. range,
  752. selection;
  753. if (doc.body.createTextRange) {
  754. range = doc.body.createTextRange();
  755. range.moveToElementText(text);
  756. range.select();
  757. } else if (window.getSelection) {
  758. selection = window.getSelection();
  759. range = doc.createRange();
  760. range.selectNodeContents(text);
  761. selection.removeAllRanges();
  762. selection.addRange(range);
  763. }
  764. document.execCommand("copy");
  765. this.$message({
  766. message: "复制成功",
  767. type: "success",
  768. });
  769. window.getSelection().removeAllRanges();
  770. },
  771. },
  772. //生命周期 - 创建完成(可以访问当前this实例)
  773. created() {
  774. this.getTableHeight();
  775. this.getQuickList();
  776. this.getOrgList();
  777. this.getList();
  778. },
  779. //生命周期 - 挂载完成(可以访问DOM元素)
  780. mounted() {
  781. let _this = this;
  782. let input = document.querySelector("input");
  783. input.addEventListener("keyup", function (event) {
  784. // 判断是否按下回车键
  785. if (event.keyCode === 13) {
  786. // 回车键被按下,执行你想要的操作
  787. _this.getList(1);
  788. }
  789. });
  790. },
  791. //生命周期-创建之前
  792. beforeCreated() {},
  793. //生命周期-挂载之前
  794. beforeMount() {},
  795. //生命周期-更新之前
  796. beforUpdate() {},
  797. //生命周期-更新之后
  798. updated() {},
  799. //生命周期-销毁之前
  800. beforeDestory() {},
  801. //生命周期-销毁完成
  802. destoryed() {},
  803. //如果页面有keep-alive缓存功能,这个函数会触发
  804. activated() {},
  805. };
  806. </script>
  807. <style lang="scss" scoped>
  808. /* @import url(); 引入css类 */
  809. </style>
  810. <style lang="scss">
  811. .btn-box {
  812. display: flex;
  813. }
  814. .quick-search {
  815. display: flex;
  816. list-style: none;
  817. padding: 3px;
  818. margin: 0 24px;
  819. align-items: center;
  820. border-radius: 2px;
  821. background: #f2f3f5;
  822. li {
  823. display: flex;
  824. align-items: center;
  825. a {
  826. padding: 2px 12px;
  827. color: #4e5969;
  828. font-size: 14px;
  829. font-weight: 400;
  830. line-height: 22px;
  831. border-radius: 2px;
  832. cursor: pointer;
  833. &.active {
  834. background: #fff;
  835. color: #165dff;
  836. font-weight: 500;
  837. }
  838. }
  839. span {
  840. height: 14px;
  841. width: 1px;
  842. background: #e5e6eb;
  843. &.border-no {
  844. background: #f2f3f5;
  845. }
  846. }
  847. }
  848. }
  849. .proceeds-box {
  850. border-radius: 2px;
  851. background: #f7f8fa;
  852. padding: 16px;
  853. margin-top: 24px;
  854. h6 {
  855. color: #1d2129;
  856. font-size: 16px;
  857. font-weight: 400;
  858. line-height: 22px;
  859. margin: 0 0 8px 0;
  860. span {
  861. color: #86909c;
  862. font-size: 12px;
  863. font-weight: 400;
  864. line-height: 20px;
  865. }
  866. }
  867. label {
  868. color: #1d2129;
  869. font-size: 22px;
  870. font-weight: 700;
  871. line-height: 24px;
  872. b {
  873. font-size: 14px;
  874. font-weight: 700;
  875. line-height: 24px;
  876. }
  877. span {
  878. color: #4e5969;
  879. font-size: 12px;
  880. font-weight: 400;
  881. line-height: 20px;
  882. }
  883. }
  884. }
  885. .el-range-editor--small .el-range-input {
  886. background: #f2f3f5;
  887. }
  888. .search-item {
  889. margin-bottom: 20px;
  890. }
  891. .search-table {
  892. margin-top: 0;
  893. }
  894. .items-type {
  895. padding: 1px 8px;
  896. font-weight: 500;
  897. font-size: 14px;
  898. line-height: 22px;
  899. border-radius: 2px;
  900. }
  901. .code {
  902. color: #175dff;
  903. }
  904. .copy {
  905. color: #c9cdd4;
  906. margin-left: 8px;
  907. cursor: pointer;
  908. }
  909. .item-info {
  910. display: flex;
  911. width: 100%;
  912. margin: 10px 0;
  913. label {
  914. width: 90px;
  915. text-align: right;
  916. flex-shrink: 0;
  917. }
  918. }
  919. </style>