FlowManage.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275
  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="common-title-box">
  16. <h3>交易流水</h3>
  17. <div class="btn-box">
  18. <ul class="quick-search">
  19. <li v-for="(itemq, indexq) in quickList" :key="indexq">
  20. <a
  21. @click="qucikSearch(itemq, indexq)"
  22. :class="[quickIndex === indexq ? 'active' : '']"
  23. >{{ itemq.name }}</a
  24. >
  25. <span
  26. class="border"
  27. :class="[
  28. indexq !== quickList.length - 1 &&
  29. quickIndex !== indexq &&
  30. quickIndex - 1 !== indexq
  31. ? ''
  32. : 'border-no',
  33. ]"
  34. ></span>
  35. </li>
  36. </ul>
  37. <el-button
  38. type="primary"
  39. size="small"
  40. @click="handleExport()"
  41. :loading="exportLoading"
  42. v-if="exportFlag"
  43. >导出报表</el-button
  44. >
  45. </div>
  46. </div>
  47. <div class="proceeds-box">
  48. <div>
  49. <h6>
  50. 收款<span>({{ total_count }}单)</span>
  51. </h6>
  52. <label v-if="proceedsPriceArr.length == 2"
  53. >¥{{ proceedsPriceArr[0] }}.<b>{{ proceedsPriceArr[1] }}</b
  54. ><span>元</span></label
  55. >
  56. </div>
  57. <div>
  58. <h6>退款</h6>
  59. <label v-if="refundPriceArr.length == 2"
  60. >¥{{ refundPriceArr[0] }}.<b>{{ refundPriceArr[1] }}</b
  61. ><span>元</span></label
  62. >
  63. </div>
  64. </div>
  65. <div class="search-box">
  66. <div class="search-item">
  67. <label>搜索</label>
  68. <el-input
  69. placeholder="商品名称、购买者、交易单号"
  70. v-model="searchInput"
  71. maxlength="200"
  72. >
  73. <i
  74. slot="suffix"
  75. class="el-input__icon el-icon-search"
  76. @click="getList(1)"
  77. style="cursor: pointer"
  78. ></i>
  79. </el-input>
  80. </div>
  81. <div class="search-item">
  82. <label>交易时间</label>
  83. <el-date-picker
  84. v-model="validity"
  85. type="daterange"
  86. size="small"
  87. range-separator="-"
  88. start-placeholder="开始日期"
  89. end-placeholder="结束日期"
  90. value-format="yyyy-MM-dd"
  91. @change="
  92. quickIndex = null;
  93. getList(1);
  94. "
  95. >
  96. </el-date-picker>
  97. </div>
  98. <div class="search-item">
  99. <label>学段</label>
  100. <el-select
  101. v-model="searchStudy"
  102. @change="getList(1)"
  103. placeholder="请选择"
  104. >
  105. <el-option
  106. v-for="item in $studyTypeAll"
  107. :key="item.study_phase"
  108. :label="item.study_phase_name"
  109. :value="item.study_phase"
  110. >
  111. </el-option>
  112. </el-select>
  113. </div>
  114. <div class="search-item">
  115. <label>商品类型</label>
  116. <el-select
  117. v-model="searchGoodsType"
  118. @change="getList(1)"
  119. placeholder="请选择"
  120. >
  121. <el-option
  122. v-for="item in goodsTypeList"
  123. :key="item.value"
  124. :label="item.goods_name"
  125. :value="item.value"
  126. >
  127. </el-option>
  128. </el-select>
  129. </div>
  130. <div class="search-item">
  131. <label>是否使用兑换码</label>
  132. <el-select
  133. v-model="searchIsCDKEY"
  134. @change="getList(1)"
  135. placeholder="请选择"
  136. >
  137. <el-option
  138. v-for="item in isCDKEYList"
  139. :key="item.value"
  140. :label="item.label"
  141. :value="item.value"
  142. >
  143. </el-option>
  144. </el-select>
  145. </div>
  146. <div class="search-item">
  147. <label>交易状态</label>
  148. <el-select
  149. v-model="searchStatus"
  150. @change="getList(1)"
  151. placeholder="请选择"
  152. >
  153. <el-option
  154. v-for="item in transactionList"
  155. :key="item.status"
  156. :label="item.status_name"
  157. :value="item.status"
  158. >
  159. </el-option>
  160. </el-select>
  161. </div>
  162. <div class="search-item">
  163. <label>客户所在机构</label>
  164. <el-select
  165. v-model="searchOrgid"
  166. @change="getList(1)"
  167. placeholder="请选择"
  168. >
  169. <el-option
  170. v-for="item in orgList"
  171. :key="item.id"
  172. :label="item.name"
  173. :value="item.id"
  174. >
  175. </el-option>
  176. </el-select>
  177. </div>
  178. <div class="search-item">
  179. <label>客户所在省市</label>
  180. <el-cascader
  181. size="medium"
  182. :options="$provinceCityListAll"
  183. v-model="searchArea"
  184. :props="props"
  185. collapse-tags
  186. clearable
  187. @change="getList(1)"
  188. >
  189. </el-cascader>
  190. </div>
  191. <div class="search-item">
  192. <label>支付渠道</label>
  193. <el-select
  194. v-model="searchChannel"
  195. @change="getList(1)"
  196. placeholder="请选择"
  197. >
  198. <el-option
  199. v-for="item in channelList"
  200. :key="item.value"
  201. :label="item.label"
  202. :value="item.value"
  203. >
  204. </el-option>
  205. </el-select>
  206. </div>
  207. </div>
  208. <el-table
  209. class="search-table"
  210. :data="tableData"
  211. style="width: 100%"
  212. @sort-change="handleSort"
  213. :default-sort="dataSort"
  214. :max-height="tableHeight"
  215. v-loading="tableLoading"
  216. >
  217. <el-table-column
  218. type="index"
  219. label="#"
  220. sortable
  221. width="54"
  222. :index="(pageNumber - 1) * pageSize + 1"
  223. >
  224. </el-table-column>
  225. <el-table-column
  226. prop="sn"
  227. label="交易单号"
  228. width="190"
  229. class-name="user-info"
  230. >
  231. </el-table-column>
  232. <el-table-column
  233. prop="pay_time"
  234. label="交易时间"
  235. sortable="custom"
  236. width="165"
  237. >
  238. </el-table-column>
  239. <el-table-column prop="name" label="购买商品" min-width="220">
  240. </el-table-column>
  241. <el-table-column prop="goods_type" label="商品类型" width="128">
  242. <template slot-scope="scope">
  243. <span
  244. class="items-type"
  245. :style="{
  246. background: goodsTypeListCss[scope.row.goods_type]
  247. ? goodsTypeListCss[scope.row.goods_type].bg
  248. : '',
  249. color: goodsTypeListCss[scope.row.goods_type]
  250. ? goodsTypeListCss[scope.row.goods_type].color
  251. : '',
  252. }"
  253. >{{ scope.row.goods_type_name }}</span
  254. >
  255. </template>
  256. </el-table-column>
  257. <el-table-column prop="is_reservation" label="是否预定" width="80">
  258. <template slot-scope="scope">
  259. {{ scope.row.is_reservation === "true" ? "是" : "否" }}
  260. </template>
  261. </el-table-column>
  262. <el-table-column
  263. prop="goods_study_phase_name"
  264. label="学段"
  265. width="64"
  266. >
  267. </el-table-column>
  268. <el-table-column prop="goods_price" label="价格" width="140">
  269. <template slot-scope="scope">
  270. <span class="currectPrice"
  271. >¥{{ scope.row.goods_price_discount | cutMoneyFiter }}</span
  272. >
  273. <span
  274. class="oldPrice"
  275. v-if="
  276. scope.row.goods_price !== scope.row.goods_price_discount
  277. "
  278. >(¥{{ scope.row.goods_price | cutMoneyFiter }})</span
  279. >
  280. </template>
  281. </el-table-column>
  282. <el-table-column prop="discount_code" label="兑换码" width="194">
  283. <template slot-scope="scope">
  284. <template v-if="scope.row.is_use_discount_code == 'false'">
  285. 未使用
  286. </template>
  287. <template v-else>
  288. <template v-if="scope.row.discount_code">
  289. <span
  290. class="code"
  291. :id="'copy-' + scope.row.discount_code"
  292. >{{ scope.row.discount_code }}</span
  293. >
  294. <svg-icon
  295. icon-class="copy"
  296. class="copy"
  297. @click="
  298. CopyToClipboard('copy-' + scope.row.discount_code)
  299. "
  300. ></svg-icon>
  301. </template>
  302. <template v-else> - </template>
  303. </template>
  304. </template>
  305. </el-table-column>
  306. <el-table-column prop="order_amount" label="支付金额" width="104">
  307. <template slot-scope="scope">
  308. <span class="currectPrice"
  309. >¥{{ scope.row.order_amount | cutMoneyFiter }}</span
  310. >
  311. </template>
  312. </el-table-column>
  313. <el-table-column prop="pay_type_name" label="支付渠道" width="104">
  314. </el-table-column>
  315. <el-table-column prop="transaction_sn" label="支付流水" width="260">
  316. </el-table-column>
  317. <el-table-column
  318. prop="person_name"
  319. label="购买者"
  320. sortable="custom"
  321. width="109"
  322. >
  323. </el-table-column>
  324. <el-table-column prop="person_user_name" label="用户名" width="109">
  325. </el-table-column>
  326. <el-table-column prop="person_phone" label="手机号" width="109">
  327. </el-table-column>
  328. <el-table-column
  329. prop="person_city_name"
  330. label="客户所在省市"
  331. width="164"
  332. >
  333. <template slot-scope="scope">
  334. {{
  335. scope.row.person_province_name +
  336. "/" +
  337. scope.row.person_city_name
  338. }}
  339. </template>
  340. </el-table-column>
  341. <el-table-column
  342. prop="person_org_name"
  343. label="客户所在机构"
  344. sortable="custom"
  345. width="200"
  346. >
  347. </el-table-column>
  348. <el-table-column prop="order_status" label="交易状态" width="112">
  349. <template slot-scope="scope">
  350. <div class="status-box">
  351. <span
  352. :style="{
  353. background: transactionListCss[scope.row.order_status]
  354. ? transactionListCss[scope.row.order_status].bg
  355. : '',
  356. }"
  357. ></span>
  358. <b>{{
  359. transactionListCss[scope.row.order_status]
  360. ? transactionListCss[scope.row.order_status].text
  361. : "-"
  362. }}</b>
  363. </div>
  364. </template>
  365. </el-table-column>
  366. <el-table-column
  367. prop="refund_apply_status"
  368. label="退款申请状态"
  369. width="112"
  370. >
  371. <template
  372. slot-scope="scope"
  373. v-if="scope.row.is_has_refund_apply === 'true'"
  374. >
  375. <div class="status-box">
  376. <span
  377. :style="{
  378. background:
  379. refundStatusList[scope.row.refund_apply_status].bg,
  380. }"
  381. ></span>
  382. <b
  383. :style="{
  384. color:
  385. refundStatusList[scope.row.refund_apply_status]
  386. .textColor,
  387. }"
  388. >{{
  389. refundStatusList[scope.row.refund_apply_status].text
  390. }}</b
  391. >
  392. </div>
  393. </template>
  394. </el-table-column>
  395. <el-table-column
  396. prop="refund_apply_submit_time"
  397. label="退款申请提交时间"
  398. width="180"
  399. >
  400. </el-table-column>
  401. <el-table-column prop="refund_amount" label="退款金额" width="144">
  402. <template
  403. slot-scope="scope"
  404. v-if="scope.row.refund_apply_status === 2"
  405. >
  406. <span class="currectPrice"
  407. >¥{{ scope.row.refund_amount | cutMoneyFiter }}</span
  408. >
  409. </template>
  410. </el-table-column>
  411. <el-table-column
  412. prop="refund_transaction_sn"
  413. label="退款交易流水号"
  414. width="260"
  415. >
  416. </el-table-column>
  417. <el-table-column fixed="right" label="操作" width="70">
  418. <template slot-scope="scope">
  419. <el-button
  420. type="text"
  421. size="small"
  422. class="red-btn"
  423. @click.native.prevent="handleRefund(scope.row, scope.$index)"
  424. v-if="scope.row.is_use_discount_code == 'false'"
  425. >
  426. 退款
  427. </el-button>
  428. <el-button
  429. @click.native.prevent="handleUp(scope.row, scope.$index)"
  430. type="text"
  431. size="small"
  432. class="red-btn"
  433. v-if="scope.row.order_status === 2"
  434. >
  435. 撤回
  436. </el-button>
  437. <el-button
  438. type="text"
  439. size="small"
  440. class="gray-btn"
  441. v-if="scope.row.order_status === 3"
  442. >
  443. 已退款
  444. </el-button>
  445. <el-button
  446. type="text"
  447. size="small"
  448. class="gray-btn"
  449. v-if="scope.row.order_status === 4"
  450. >
  451. 已撤回
  452. </el-button>
  453. </template>
  454. </el-table-column>
  455. </el-table>
  456. <el-pagination
  457. background
  458. @size-change="handleSizeChange"
  459. @current-change="handleCurrentChange"
  460. :current-page="pageNumber"
  461. :page-sizes="[10, 20, 30, 40]"
  462. :page-size="pageSize"
  463. layout="total, prev, pager, next, sizes, jumper"
  464. :total="total_count"
  465. >
  466. </el-pagination>
  467. </div>
  468. </div>
  469. </div>
  470. <el-dialog title="退款信息" :visible.sync="dialogVisible" width="500px">
  471. <template v-if="ktjeInfo">
  472. <span style="margin-right: 5px">退款金额:</span>
  473. <el-input v-model="ktje"></el-input>
  474. <p>商品信息</p>
  475. <div class="item-info">
  476. <label>物品类型:</label><span>{{ ktjeInfo.goods_type_name }}</span>
  477. </div>
  478. <div class="item-info">
  479. <label>物品学段:</label
  480. ><span>{{ ktjeInfo.goods_study_phase_name }}</span>
  481. </div>
  482. <div class="item-info">
  483. <label>购买商品:</label><span>{{ ktjeInfo.name }}</span>
  484. </div>
  485. <div class="item-info">
  486. <label>订单金额:</label
  487. ><span>¥{{ ktjeInfo.order_amount | cutMoneyFiter }}</span>
  488. </div>
  489. <!-- 物品实体 -->
  490. <template v-if="ktjeInfo.order_sale_model === 0">
  491. <div
  492. class="item-info"
  493. v-if="ktjeInfo.is_reservation_order === 'true'"
  494. >
  495. <label>订阅期数:</label
  496. ><span>{{
  497. ktjeInfo.period_count === -1 ? "年刊" : ktjeInfo.period_count
  498. }}</span>
  499. </div>
  500. <div
  501. class="item-info"
  502. v-if="
  503. ktjeInfo.is_reservation_order === 'true' &&
  504. ktjeInfo.period_count !== -1
  505. "
  506. >
  507. <label>订阅列表:</label
  508. ><span>{{ ktjeInfo.issue_no_list_reservation.join("、") }}</span>
  509. </div>
  510. <div
  511. class="item-info"
  512. v-if="
  513. ktjeInfo.is_reservation_order === 'true' &&
  514. ktjeInfo.issue_no_list_my_goods.length > 0
  515. "
  516. >
  517. <label>已上架:</label
  518. ><span>{{ ktjeInfo.issue_no_list_my_goods.join("、") }}</span>
  519. </div>
  520. <div
  521. class="item-info"
  522. v-if="
  523. ktjeInfo.is_reservation_order === 'true' &&
  524. ktjeInfo.period_count === -1
  525. "
  526. >
  527. <label>开始日期:</label
  528. ><span>{{ ktjeInfo.valid_period_begin_date }}</span>
  529. </div>
  530. <div
  531. class="item-info"
  532. v-if="
  533. ktjeInfo.is_reservation_order === 'true' &&
  534. ktjeInfo.period_count === -1
  535. "
  536. >
  537. <label>截止日期:</label
  538. ><span>{{ ktjeInfo.valid_period_end_date }}</span>
  539. </div>
  540. <div
  541. class="item-info"
  542. v-if="
  543. ktjeInfo.is_reservation_order === 'true' &&
  544. ktjeInfo.period_count === -1
  545. "
  546. >
  547. <label>当前日期:</label><span>{{ ktjeInfo.cur_date }}</span>
  548. </div>
  549. </template>
  550. <!-- 使用期限 -->
  551. <template v-if="ktjeInfo.order_sale_model === 1">
  552. <div class="item-info">
  553. <label>订单日期:</label><span>{{ ktjeInfo.order_date }}</span>
  554. </div>
  555. <div class="item-info">
  556. <label>有效期天数:</label
  557. ><span>{{ ktjeInfo.valid_period_day_count }}</span>
  558. </div>
  559. <div class="item-info">
  560. <label>截止日期:</label
  561. ><span>{{ ktjeInfo.valid_period_end_date }}</span>
  562. </div>
  563. <div class="item-info">
  564. <label>当前日期:</label><span>{{ ktjeInfo.cur_date }}</span>
  565. </div>
  566. </template>
  567. </template>
  568. <span slot="footer" class="dialog-footer">
  569. <el-button size="small" @click="dialogVisible = false">取 消</el-button>
  570. <el-button size="small" type="primary" @click="sureRefund"
  571. >确 定</el-button
  572. >
  573. </span>
  574. </el-dialog>
  575. </div>
  576. </template>
  577. <script>
  578. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  579. //例如:import 《组件名称》from ‘《组件路径》';
  580. import Header from "../../components/Header.vue";
  581. import NavMenu from "../../components/NavMenu.vue";
  582. import Breadcrumb from "../../components/Breadcrumb.vue";
  583. import { getLogin } from "@/api/ajax";
  584. import { mapState } from "vuex";
  585. import { cutMoneyFiter } from "@/utils/defined";
  586. import { getToken } from "@/utils/auth";
  587. export default {
  588. //import引入的组件需要注入到对象中才能使用
  589. components: { Header, NavMenu, Breadcrumb },
  590. props: {},
  591. filters: {
  592. cutMoneyFiter,
  593. },
  594. data() {
  595. //这里存放数据
  596. return {
  597. activeMenuIndex: "flow_manage",
  598. breadcrumbList: [
  599. {
  600. icon: "money-cny-box-line",
  601. url: "",
  602. text: "",
  603. },
  604. {
  605. icon: "",
  606. url: "",
  607. notLink: true,
  608. text: "财务中心",
  609. },
  610. {
  611. icon: "",
  612. url: "",
  613. text: "交易管理",
  614. },
  615. ],
  616. quickList: [], // 快速查询
  617. searchInput: "",
  618. searchQuick: null,
  619. quickIndex: null, // 快速搜索的索引
  620. proceedsNumber: "", // 收款单数
  621. proceedsPrice: null, // 收款金额
  622. proceedsPriceArr: [],
  623. refundPriceArr: [],
  624. searchType: -1,
  625. validity: "",
  626. searchStudy: -1,
  627. searchStatus: -1,
  628. searchGoodsType: -1,
  629. searchIsCDKEY: -1,
  630. searchOrgid: "",
  631. searchArea: [],
  632. searchChannel: -1,
  633. channelList: [
  634. {
  635. label: "全部",
  636. value: -1,
  637. },
  638. {
  639. label: "支付宝",
  640. value: 4,
  641. },
  642. {
  643. label: "微信支付",
  644. value: 3,
  645. },
  646. ],
  647. orgList: [
  648. {
  649. name: "全部",
  650. id: "",
  651. },
  652. ],
  653. isCDKEYList: [
  654. {
  655. label: "全部",
  656. value: -1,
  657. },
  658. {
  659. label: "已使用",
  660. value: 1,
  661. },
  662. {
  663. label: "未使用",
  664. value: 0,
  665. },
  666. ], // 是否使用兑换码
  667. transactionList: [
  668. {
  669. status_name: "全部",
  670. status: -1,
  671. },
  672. {
  673. status_name: "支付成功",
  674. status: 1,
  675. },
  676. {
  677. status_name: "兑换成功",
  678. status: 2,
  679. },
  680. {
  681. status_name: "已退款",
  682. status: 3,
  683. },
  684. {
  685. status_name: "已撤回",
  686. status: 4,
  687. },
  688. ], //交易状态列表
  689. transactionListCss: {
  690. 0: {
  691. bg: "rgb(245, 63, 63)",
  692. text: "未支付",
  693. },
  694. 1: {
  695. bg: "#00B42A",
  696. text: "支付成功",
  697. },
  698. 2: {
  699. bg: "#165DFF",
  700. text: "兑换成功",
  701. },
  702. 3: {
  703. bg: "#F7BA1E",
  704. text: "已退款",
  705. },
  706. 4: {
  707. bg: "#FF7D00",
  708. text: "已撤回",
  709. },
  710. },
  711. goodsTypeList: [
  712. {
  713. goods_name: "全部",
  714. value: -1,
  715. },
  716. {
  717. goods_name: "报纸",
  718. value: 2,
  719. },
  720. {
  721. goods_name: "精读",
  722. value: 3,
  723. },
  724. {
  725. goods_name: "录播课",
  726. value: 0,
  727. },
  728. {
  729. goods_name: "画刊",
  730. value: 4,
  731. },
  732. ], // 商品类型
  733. goodsTypeListCss: {
  734. 2: {
  735. text: "报纸",
  736. color: "#165DFF",
  737. bg: "#E8F7FF",
  738. },
  739. 4: {
  740. text: "画刊",
  741. color: "#F53F3F",
  742. bg: "#FFECE8",
  743. },
  744. 3: {
  745. text: "精读",
  746. color: "#0FC6C2",
  747. bg: "#E8FFFB",
  748. },
  749. 0: {
  750. text: "课程",
  751. color: "#722ED1",
  752. bg: "#F5E8FF",
  753. },
  754. 1: {
  755. text: "课程",
  756. color: "#722ED1",
  757. bg: "#F5E8FF",
  758. },
  759. 10: {
  760. text: "课程",
  761. color: "#722ED1",
  762. bg: "#F5E8FF",
  763. },
  764. // '5':{
  765. // text:'报纸专辑',
  766. // color:'#165DFF',
  767. // bg:'#E8F7FF'
  768. // },
  769. // '6':{
  770. // text:'画刊专辑',
  771. // color:'#F53F3F',
  772. // bg:'#FFECE8'
  773. // }
  774. },
  775. typeList: [
  776. {
  777. account_type: -1,
  778. account_type_name: "全部",
  779. },
  780. ],
  781. statusList: {
  782. 1: {
  783. text: "正常",
  784. bg: "#165DFF",
  785. color: "",
  786. },
  787. 0: {
  788. text: "停用",
  789. bg: "#F53F3F",
  790. color: "#F53F3F",
  791. },
  792. },
  793. tableData: [],
  794. pageSize: window.localStorage.getItem("pageSize")
  795. ? Number(window.localStorage.getItem("pageSize"))
  796. : 10,
  797. pageNumber: window.localStorage.getItem("pageNumber")
  798. ? Number(window.localStorage.getItem("pageNumber"))
  799. : 1,
  800. tableHeight: "", // 表格高度
  801. total_count: 0,
  802. dataSort: {},
  803. props: { multiple: true },
  804. tableLoading: false,
  805. exportLoading: false,
  806. exportFlag:
  807. getToken() && JSON.parse(getToken())
  808. ? JSON.parse(getToken()).popedom_code_list.indexOf(40002) > -1
  809. : false,
  810. refundStatusList: {
  811. 2: {
  812. text: "审核通过",
  813. bg: "#00B42A",
  814. textColor: "#1D2129",
  815. },
  816. 0: {
  817. text: "待审核",
  818. bg: "#165DFF",
  819. textColor: "#1D2129",
  820. },
  821. 1: {
  822. text: "驳回",
  823. bg: "#FF7D00",
  824. textColor: "#1D2129",
  825. },
  826. },
  827. dialogVisible: false,
  828. ktje: 0,
  829. refundId: "",
  830. ktjeInfo: null,
  831. };
  832. },
  833. //计算属性 类似于data概念
  834. computed: {
  835. ...mapState(["$studyTypeAll", "$provinceCityListAll"]),
  836. },
  837. //监控data中数据变化
  838. watch: {},
  839. //方法集合
  840. methods: {
  841. qucikSearch(value, index) {
  842. (this.validity = [value.date_begin, value.date_end]),
  843. (this.quickIndex = index);
  844. this.getList();
  845. },
  846. handleSort(value) {
  847. let dataSort = {
  848. prop: value.prop,
  849. order: value.order,
  850. };
  851. this.dataSort = dataSort;
  852. this.getList();
  853. },
  854. // 查询列表
  855. getList(page) {
  856. this.tableLoading = true;
  857. if (page) {
  858. this.pageNumber = page;
  859. }
  860. let MethodName = "/ShopServer/Manager/FinanceManager/PageQueryOrderList";
  861. let order_column_list = [];
  862. if (this.dataSort != {}) {
  863. if (this.dataSort.order == "descending") {
  864. order_column_list = [this.dataSort.prop + ":desc"];
  865. } else if (this.dataSort.order == "ascending") {
  866. // 升序不传值
  867. order_column_list = [this.dataSort.prop];
  868. } else {
  869. order_column_list = ["order_time:desc"]; //用pay_time的话有未支付的订单会排在最前面
  870. }
  871. } else {
  872. order_column_list = ["order_time:desc"];
  873. }
  874. let province_id_list = null;
  875. let city_id_list = [];
  876. if (this.searchArea.length > 0) {
  877. if (this.searchArea[0][0] && this.searchArea[0][0] === "0") {
  878. province_id_list = "-1";
  879. } else {
  880. province_id_list = [];
  881. this.searchArea.forEach((item) => {
  882. if (province_id_list.indexOf(item[0]) === -1) {
  883. province_id_list.push(item[0]);
  884. }
  885. city_id_list.push(item[1] ? item[1] : "");
  886. });
  887. }
  888. }
  889. let data = {
  890. content: this.searchInput.trim(),
  891. page_capacity: this.pageSize,
  892. cur_page: this.pageNumber,
  893. order_column_list: order_column_list,
  894. pay_status: 1,
  895. order_status: this.searchStatus,
  896. pay_date_begin: this.validity ? this.validity[0] : "",
  897. pay_date_end: this.validity ? this.validity[1] : "",
  898. goods_study_phase: this.searchStudy,
  899. goods_type: this.searchGoodsType,
  900. discount_code_use_status: this.searchIsCDKEY,
  901. person_org_id_list: this.searchOrgid ? [this.searchOrgid] : null,
  902. person_province_city_id_list: city_id_list,
  903. pay_type: this.searchChannel,
  904. };
  905. getLogin(MethodName, data)
  906. .then((res) => {
  907. this.tableLoading = false;
  908. if (res.status === 1) {
  909. this.tableData = res.order_list;
  910. this.total_count = res.total_count;
  911. this.proceedsPriceArr = cutMoneyFiter(
  912. res.sum_info.order_amount
  913. ).split(".");
  914. this.refundPriceArr = cutMoneyFiter(
  915. res.sum_info.refund_amount
  916. ).split(".");
  917. }
  918. })
  919. .catch(() => {
  920. this.tableLoading = false;
  921. });
  922. },
  923. // 导出报表
  924. handleExport() {
  925. let _this = this;
  926. _this.exportLoading = true;
  927. let MethodName =
  928. "/ShopServer/Manager/FinanceManager/StartCreateOrderExportFile";
  929. let order_column_list = [];
  930. if (this.dataSort != {}) {
  931. if (this.dataSort.order == "descending") {
  932. order_column_list = [this.dataSort.prop + ":desc"];
  933. } else if (this.dataSort.order == "ascending") {
  934. // 升序不传值
  935. order_column_list = [this.dataSort.prop];
  936. } else {
  937. order_column_list = ["create_time:desc"];
  938. }
  939. } else {
  940. order_column_list = ["create_time:desc"];
  941. }
  942. let province_id_list = null;
  943. let city_id_list = [];
  944. if (this.searchArea.length > 0) {
  945. if (this.searchArea[0][0] && this.searchArea[0][0] === "0") {
  946. province_id_list = "-1";
  947. } else {
  948. province_id_list = [];
  949. this.searchArea.forEach((item) => {
  950. if (province_id_list.indexOf(item[0]) === -1) {
  951. province_id_list.push(item[0]);
  952. }
  953. city_id_list.push(item[1] ? item[1] : "");
  954. });
  955. }
  956. }
  957. let data = {
  958. content: this.searchInput.trim(),
  959. page_capacity: this.pageSize,
  960. cur_page: this.pageNumber,
  961. order_column_list: order_column_list,
  962. pay_status: 1,
  963. order_status: this.searchStatus,
  964. pay_date_begin: this.validity ? this.validity[0] : "",
  965. pay_date_end: this.validity ? this.validity[1] : "",
  966. goods_study_phase: this.searchStudy,
  967. goods_type: this.searchGoodsType,
  968. discount_code_use_status: this.searchIsCDKEY,
  969. person_org_id_list: this.searchOrgid ? [this.searchOrgid] : null,
  970. person_province_city_id_list: city_id_list,
  971. pay_type: this.searchChannel,
  972. };
  973. getLogin(MethodName, data)
  974. .then((res) => {
  975. let MethodName2 =
  976. "/ShopServer/Manager/FinanceManager/GetOrderExportFileTaskProgress";
  977. let timer = setInterval(() => {
  978. getLogin(MethodName2, {
  979. order_export_file_task_id: res.id,
  980. })
  981. .then((res) => {
  982. if (res.is_finish === "true") {
  983. clearInterval(timer);
  984. timer = null;
  985. _this.exportLoading = false;
  986. location.href = res.order_export_file_url;
  987. }
  988. })
  989. .catch((res) => {
  990. this.loading = false;
  991. });
  992. }, 1000);
  993. })
  994. .catch((res) => {
  995. this.loading = false;
  996. });
  997. },
  998. // 停用 启用
  999. handleUp(row, index) {
  1000. let Mname = "/OrgServer/Manager/SysUserManager/EnableSysUser";
  1001. let updataData = JSON.parse(JSON.stringify(row));
  1002. let data = {
  1003. id: row.id,
  1004. };
  1005. if (row.status === 0) {
  1006. // 下架状态
  1007. data.is_enable = "true";
  1008. updataData.status = 1;
  1009. } else if (row.status === 1) {
  1010. data.is_enable = "false";
  1011. updataData.status = 0;
  1012. }
  1013. getLogin(Mname, data).then((res) => {
  1014. this.$message.success("操作成功");
  1015. this.$set(this.tableData, index, updataData);
  1016. });
  1017. },
  1018. handleSizeChange(val) {
  1019. this.pageSize = val;
  1020. this.pageNumber = 1;
  1021. this.getList();
  1022. },
  1023. handleCurrentChange(val) {
  1024. this.pageNumber = val;
  1025. this.getList();
  1026. },
  1027. //计算table高度(动态设置table高度)
  1028. getTableHeight() {
  1029. let tableH = 570; //距离页面下方的高度
  1030. let tableHeightDetil = window.innerHeight - tableH;
  1031. if (tableHeightDetil <= 300) {
  1032. this.tableHeight = 300;
  1033. } else {
  1034. this.tableHeight = window.innerHeight - tableH;
  1035. }
  1036. },
  1037. // 用户类型列表
  1038. getOrgList() {
  1039. let MethodName = "/OrgServer/Client/OrgManager/GetOrgIndexList";
  1040. let data = {
  1041. name: "",
  1042. status: 1,
  1043. sn: "",
  1044. };
  1045. getLogin(MethodName, data)
  1046. .then((res) => {
  1047. if (res.status === 1) {
  1048. this.orgList = [
  1049. {
  1050. name: "全部",
  1051. id: "",
  1052. },
  1053. ];
  1054. this.orgList = this.orgList.concat(res.org_index_list);
  1055. }
  1056. })
  1057. .catch(() => {
  1058. this.loading = false;
  1059. });
  1060. },
  1061. // 快捷时间按钮列表
  1062. getQuickList() {
  1063. this.quickList = [];
  1064. let MethodName =
  1065. "/ShopServer/Manager/FinanceManager/GetQueryCritDateSpaceList";
  1066. let data = {};
  1067. getLogin(MethodName, data).then((res) => {
  1068. if (res.status === 1) {
  1069. this.quickList = res.date_space_list;
  1070. }
  1071. });
  1072. },
  1073. CopyToClipboard(element) {
  1074. var doc = document,
  1075. text = doc.getElementById(element),
  1076. range,
  1077. selection;
  1078. if (doc.body.createTextRange) {
  1079. range = doc.body.createTextRange();
  1080. range.moveToElementText(text);
  1081. range.select();
  1082. } else if (window.getSelection) {
  1083. selection = window.getSelection();
  1084. range = doc.createRange();
  1085. range.selectNodeContents(text);
  1086. selection.removeAllRanges();
  1087. selection.addRange(range);
  1088. }
  1089. document.execCommand("copy");
  1090. this.$message({
  1091. message: "复制成功",
  1092. type: "success",
  1093. });
  1094. window.getSelection().removeAllRanges();
  1095. },
  1096. // 退款
  1097. handleRefund(row, index) {
  1098. this.ktjeInfo = null;
  1099. let Mnames = "/ShopServer/Manager/FinanceManager/GetOrderInfo";
  1100. let datas = {
  1101. id: row.id,
  1102. };
  1103. getLogin(Mnames, datas).then((res) => {
  1104. if (res.status === 1) {
  1105. this.ktje = res.order_info.order_amount;
  1106. this.ktjeInfo = res.order_info;
  1107. this.refundId = row.id;
  1108. this.dialogVisible = true;
  1109. }
  1110. });
  1111. },
  1112. // 确定退款
  1113. sureRefund() {
  1114. this.$confirm("确定要退款吗?", "提示", {
  1115. confirmButtonText: "确定",
  1116. cancelButtonText: "取消",
  1117. type: "warning",
  1118. }).then(() => {
  1119. let Mname = "/ShopServer/Manager/FinanceManager/OrderRefund";
  1120. let data = {
  1121. id: this.refundId,
  1122. refund_amount: this.ktje,
  1123. };
  1124. getLogin(Mname, data).then((res) => {
  1125. this.$message.success("操作成功");
  1126. this.getList();
  1127. this.dialogVisible = false;
  1128. });
  1129. });
  1130. },
  1131. },
  1132. //生命周期 - 创建完成(可以访问当前this实例)
  1133. created() {
  1134. this.getTableHeight();
  1135. this.getQuickList();
  1136. this.getOrgList();
  1137. this.getList();
  1138. },
  1139. //生命周期 - 挂载完成(可以访问DOM元素)
  1140. mounted() {
  1141. let _this = this;
  1142. let input = document.querySelector("input");
  1143. input.addEventListener("keyup", function (event) {
  1144. // 判断是否按下回车键
  1145. if (event.keyCode === 13) {
  1146. // 回车键被按下,执行你想要的操作
  1147. _this.getList(1);
  1148. }
  1149. });
  1150. },
  1151. //生命周期-创建之前
  1152. beforeCreated() {},
  1153. //生命周期-挂载之前
  1154. beforeMount() {},
  1155. //生命周期-更新之前
  1156. beforUpdate() {},
  1157. //生命周期-更新之后
  1158. updated() {},
  1159. //生命周期-销毁之前
  1160. beforeDestory() {},
  1161. //生命周期-销毁完成
  1162. destoryed() {},
  1163. //如果页面有keep-alive缓存功能,这个函数会触发
  1164. activated() {},
  1165. };
  1166. </script>
  1167. <style lang="scss" scoped>
  1168. /* @import url(); 引入css类 */
  1169. </style>
  1170. <style lang="scss">
  1171. .btn-box {
  1172. display: flex;
  1173. }
  1174. .quick-search {
  1175. display: flex;
  1176. list-style: none;
  1177. padding: 3px;
  1178. margin: 0 24px;
  1179. align-items: center;
  1180. border-radius: 2px;
  1181. background: #f2f3f5;
  1182. li {
  1183. display: flex;
  1184. align-items: center;
  1185. a {
  1186. padding: 2px 12px;
  1187. color: #4e5969;
  1188. font-size: 14px;
  1189. font-weight: 400;
  1190. line-height: 22px;
  1191. border-radius: 2px;
  1192. cursor: pointer;
  1193. &.active {
  1194. background: #fff;
  1195. color: #165dff;
  1196. font-weight: 500;
  1197. }
  1198. }
  1199. span {
  1200. height: 14px;
  1201. width: 1px;
  1202. background: #e5e6eb;
  1203. &.border-no {
  1204. background: #f2f3f5;
  1205. }
  1206. }
  1207. }
  1208. }
  1209. .proceeds-box {
  1210. border-radius: 2px;
  1211. background: #f7f8fa;
  1212. padding: 16px;
  1213. margin-top: 24px;
  1214. display: flex;
  1215. width: 100%;
  1216. gap: 40px;
  1217. h6 {
  1218. color: #1d2129;
  1219. font-size: 16px;
  1220. font-weight: 400;
  1221. line-height: 22px;
  1222. margin: 0 0 8px 0;
  1223. span {
  1224. color: #86909c;
  1225. font-size: 12px;
  1226. font-weight: 400;
  1227. line-height: 20px;
  1228. }
  1229. }
  1230. label {
  1231. color: #1d2129;
  1232. font-size: 22px;
  1233. font-weight: 700;
  1234. line-height: 24px;
  1235. b {
  1236. font-size: 14px;
  1237. font-weight: 700;
  1238. line-height: 24px;
  1239. }
  1240. span {
  1241. color: #4e5969;
  1242. font-size: 12px;
  1243. font-weight: 400;
  1244. line-height: 20px;
  1245. }
  1246. }
  1247. }
  1248. .el-range-editor--small .el-range-input {
  1249. background: #f2f3f5;
  1250. }
  1251. .search-item {
  1252. margin-bottom: 20px;
  1253. }
  1254. .search-table {
  1255. margin-top: 0;
  1256. }
  1257. .items-type {
  1258. padding: 1px 8px;
  1259. font-weight: 500;
  1260. font-size: 14px;
  1261. line-height: 22px;
  1262. border-radius: 2px;
  1263. }
  1264. .code {
  1265. color: #175dff;
  1266. }
  1267. .copy {
  1268. color: #c9cdd4;
  1269. margin-left: 8px;
  1270. cursor: pointer;
  1271. }
  1272. </style>