index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. <template>
  2. <div id="orderManage">
  3. <search-box-new
  4. ref="searchBox"
  5. :formData="formData"
  6. :formList="formList"
  7. @search="search"
  8. @init="search(2)"
  9. :remarkStatus="true"
  10. />
  11. <picture-list
  12. ref="pictureList"
  13. :info="info"
  14. :list="showTabList"
  15. @backFunc="pictureFunc"
  16. ></picture-list>
  17. <table-list
  18. :tableSets="tableSet"
  19. :tableData="tableData"
  20. :navText="navText"
  21. :loading="loading"
  22. >
  23. <template slot="customize">
  24. <el-button type="primary" @click="collection">收款信息</el-button>
  25. </template>
  26. <template slot="applyFor" slot-scope="props">
  27. <p>
  28. 创建时间:{{ $methodsTools.onlyForma(props.scope.row.createTime) }}
  29. </p>
  30. <p>通过时间:{{ $methodsTools.onlyForma(props.scope.row.payTime) }}</p>
  31. <p>订单编号:{{ props.scope.row.handleOrderSn }}</p>
  32. <p>经办姓名:{{ props.scope.row.createUsername }}</p>
  33. <p>经办身份:{{ props.scope.row.idCard }}</p>
  34. <p>经办手机:{{ props.scope.row.telphone }}</p>
  35. </template>
  36. <template slot="invoice" slot-scope="props">
  37. <p>
  38. 商品类型:{{
  39. props.scope.row.goodsType == 1
  40. ? "课程"
  41. : props.scope.row.goodsType == 2
  42. ? "题库"
  43. : "-"
  44. }}
  45. </p>
  46. <p>教育类型:{{ props.scope.row.educationName }}</p>
  47. <p>
  48. 培训项目:{{
  49. props.scope.row.projectName + " - " + props.scope.row.businessName
  50. }}
  51. </p>
  52. <!-- <p>订购人数:{{ props.scope.row.userNum || 0 }}位</p>
  53. <p>订购数量:{{ props.scope.row.goodsNum || 0 }}个</p> -->
  54. </template>
  55. <template slot="invoice1" slot-scope="props">
  56. <p>下单金额:¥{{ props.scope.row.orderPrice | formatPrice }}</p>
  57. <p>退款金额:¥{{ props.scope.row.goodsRefund | formatPrice }}</p>
  58. <p>实际金额:¥{{ props.scope.row.realPrice | formatPrice }}</p>
  59. </template>
  60. <template slot="invoice2" slot-scope="props">
  61. <el-button
  62. v-if="
  63. (props.scope.row.payStatus == 1 ||
  64. props.scope.row.payStatus == 2 ||
  65. props.scope.row.payStatus == -2) &&
  66. props.scope.row.payType == 2
  67. "
  68. type="text"
  69. @click="seeZZ(props.scope.row.handleOrderSn)"
  70. >查看</el-button
  71. >
  72. </template>
  73. <template slot="invoice3" slot-scope="props">
  74. <span v-if="!props.scope.row.invoiceStatus">未开票</span>
  75. <span v-if="props.scope.row.invoiceStatus == 1">待审核</span>
  76. <span v-if="props.scope.row.invoiceStatus == 2">已开票</span>
  77. <span v-if="props.scope.row.invoiceStatus == 3">不通过</span>
  78. <span v-if="props.scope.row.invoiceStatus == 4">已失效</span>
  79. <span v-if="props.scope.row.invoiceUrl && props.scope.row.invoiceStatus == 2"
  80. >({{ props.scope.row.invoiceUrl.split(",").length }}张)
  81. </span>
  82. <div v-if="props.scope.row.invoiceUrl && props.scope.row.invoiceStatus == 2">
  83. <el-button
  84. type="text"
  85. @click="downinvoice(props.scope.row.invoiceUrl.split(','))"
  86. >下载</el-button
  87. >
  88. </div>
  89. </template>
  90. <template slot="btn" slot-scope="props">
  91. <el-button type="text" @click="orderDetail(props.scope.row)"
  92. >查看详情</el-button
  93. ><el-button
  94. type="text"
  95. @click="orderSH(props.scope.row)"
  96. :disabled="props.scope.row.payStatus !== 2"
  97. >订单审核</el-button
  98. ><el-button
  99. type="text"
  100. :disabled="props.scope.row.refundStatus !== 0"
  101. @click="refundFunc(props.scope.row)"
  102. >退款审核</el-button
  103. >
  104. </template>
  105. </table-list>
  106. <pagination
  107. :total="total"
  108. :pageSize="formData.pageSize"
  109. :currentPage="formData.pageNum"
  110. @handleSizeChange="handleSizeChange"
  111. @handleCurrentChange="handleCurrentChange"
  112. />
  113. <public-transfer ref="publicTransfer" />
  114. <dialogHandleBank ref="dialogHandleBank" />
  115. <orderDetail ref="orderDetail" />
  116. <refundFunc ref="refundFunc" />
  117. </div>
  118. </template>
  119. <script>
  120. import publicTransfer from "./publicTransfer.vue";
  121. import dialogHandleBank from "./dialogHandleBank.vue";
  122. import orderDetail from "./orderDetail.vue";
  123. import refundFunc from "./refundFunc.vue";
  124. import pictureList from "@/components/Comon/pictureList.vue";
  125. import searchBoxNew from "@/components/searchBoxNew";
  126. import tableList from "@/components/tableList";
  127. import pagination from "@/components/pagination";
  128. export default {
  129. name: "",
  130. components: {
  131. searchBoxNew,
  132. tableList,
  133. pagination,
  134. pictureList,
  135. dialogHandleBank,
  136. orderDetail,
  137. refundFunc,
  138. publicTransfer,
  139. },
  140. data() {
  141. return {
  142. loading: false, //当前表单加载是否加载动画
  143. navText: {
  144. title: "经办订单",
  145. index: 0,
  146. ch: "条",
  147. num: true,
  148. choice: false,
  149. addHide: true,
  150. backFatherBtn: {
  151. status: false,
  152. title: "未定义",
  153. },
  154. },
  155. info: {},
  156. showTabList: [
  157. {
  158. label: "下单金额",
  159. img: "ContractAmount",
  160. prop: "payPrice",
  161. },
  162. {
  163. label: "退款金额",
  164. img: "Refunded",
  165. prop: "refundPrice",
  166. },
  167. {
  168. label: "实际金额",
  169. img: "PaymentHasBeenReceived",
  170. prop: "orderPrice",
  171. },
  172. // {
  173. // label: "订单数量",
  174. // img: "NumberOfOrders2",
  175. // prop: "orderNum",
  176. // num: true,
  177. // },
  178. // {
  179. // label: "订单人数",
  180. // img: "NumberOfOrders",
  181. // prop: "orderUserNum",
  182. // num: true,
  183. // },
  184. {
  185. label: "待审订单",
  186. img: "PendingOrder",
  187. prop: "unCheckOrderNum",
  188. num: true,
  189. color: "#ff7a38",
  190. hover: false,
  191. },
  192. {
  193. label: "待审退款",
  194. img: "PendingRefund",
  195. prop: "unRefundNum",
  196. num: true,
  197. color: "#ff7a38",
  198. hover: false,
  199. },
  200. ],
  201. //搜索
  202. formList: [
  203. {
  204. prop: "goodsType",
  205. placeholder: "商品类型",
  206. scope: "select",
  207. options: [
  208. { label: "课程", value: 1 },
  209. { label: "题库", value: 2 },
  210. ],
  211. },
  212. {
  213. prop: "educationTypeId",
  214. placeholder: "教育类型",
  215. scope: "educationType",
  216. },
  217. {
  218. prop: "businessId",
  219. placeholder: "业务层次",
  220. scope: "businessLevel",
  221. edu: "educationTypeId",
  222. },
  223. {
  224. prop: "payStatus",
  225. placeholder: "订单状态",
  226. scope: "select",
  227. options: [
  228. { label: "待支付", value: 0 },
  229. { label: "已支付", value: 1 },
  230. { label: "已关闭", value: -1 },
  231. { label: "审核中", value: 2 },
  232. { label: "不通过", value: -2 },
  233. ],
  234. },
  235. {
  236. prop: "refundStatus",
  237. placeholder: "退款状态",
  238. scope: "select",
  239. options: [
  240. { label: "待审核", value: 0 },
  241. { label: "已退款", value: 1 },
  242. { label: "不通过", value: 2 },
  243. ],
  244. },
  245. {
  246. prop: "invoiceStatus",
  247. placeholder: "发票状态",
  248. scope: "select",
  249. options: [
  250. { label: "待审核", value: 1 },
  251. { label: "已开票", value: 2 },
  252. { label: "不通过", value: 3 },
  253. { label: "已失效", value: 4 },
  254. { label: "未开票", value: 5 },
  255. ],
  256. },
  257. {
  258. prop1: "startTime",
  259. prop2: "endTime",
  260. placeholder1: "通过开始时间",
  261. placeholder2: "通过结束时间",
  262. scope: "moreDataPicker",
  263. Diszing: true,
  264. },
  265. {
  266. prop: "handleOrderSn",
  267. placeholder: "输入订单编号",
  268. },
  269. {
  270. prop: "telphone",
  271. placeholder: "输入经办手机",
  272. },
  273. {
  274. prop: "createUsername",
  275. placeholder: "输入经办姓名",
  276. },
  277. {
  278. prop: "idCard",
  279. placeholder: "输入经办身份证号",
  280. }
  281. ],
  282. formData: {
  283. pageSize: 10,
  284. pageNum: 1,
  285. payStatus: "",
  286. refundStatus: "",
  287. },
  288. // 表单
  289. tableSet: [
  290. {
  291. label: "订单状态",
  292. prop: "payStatus",
  293. hidden: true,
  294. scope: "isOptions",
  295. options: [
  296. { label: "待支付", value: 0 },
  297. { label: "已支付", value: 1 },
  298. { label: "已关闭", value: -1 },
  299. { label: "审核中", value: 2 },
  300. { label: "不通过", value: -2 },
  301. ],
  302. },
  303. {
  304. label: "订单信息",
  305. hidden: true,
  306. scope: "slot",
  307. slotName: "applyFor",
  308. dontCenter: true,
  309. },
  310. {
  311. label: "商品信息",
  312. hidden: true,
  313. scope: "slot",
  314. slotName: "invoice",
  315. dontCenter: true,
  316. },
  317. {
  318. label: "订单金额",
  319. hidden: true,
  320. scope: "slot",
  321. slotName: "invoice1",
  322. dontCenter: true,
  323. },
  324. {
  325. label: "支付方式",
  326. prop: "payType",
  327. hidden: true,
  328. scope: "isOptions",
  329. options: [
  330. { label: "微信支付", value: 1 },
  331. { label: "对公转账", value: 2 },
  332. ],
  333. },
  334. {
  335. label: "转账凭证",
  336. hidden: true,
  337. scope: "slot",
  338. slotName: "invoice2",
  339. },
  340. {
  341. label: "发票状态",
  342. hidden: true,
  343. scope: "slot",
  344. slotName: "invoice3",
  345. },
  346. {
  347. label: "退款状态",
  348. prop: "refundStatus",
  349. hidden: true,
  350. scope: "isOptions",
  351. options: [
  352. { label: "待审核", value: 0 },
  353. { label: "已退款", value: 1 },
  354. { label: "不通过", value: 2 },
  355. ],
  356. },
  357. ],
  358. tableData: [], //表单数据
  359. total: 0, //一共多少条
  360. };
  361. },
  362. mounted() {
  363. this.search();
  364. },
  365. methods: {
  366. pictureFunc(item) {
  367. if (item.prop == "unCheckOrderNum") {
  368. this.formData = {
  369. pageSize: 10,
  370. pageNum: 1,
  371. payStatus: 2,
  372. refundStatus: "",
  373. };
  374. this.search();
  375. }
  376. if (item.prop == "unRefundNum") {
  377. this.formData = {
  378. pageSize: 10,
  379. pageNum: 1,
  380. payStatus: "",
  381. refundStatus: 0,
  382. };
  383. this.search();
  384. }
  385. },
  386. seeZZ(sn) {
  387. this.$refs.publicTransfer.openBoxs(sn);
  388. },
  389. collection() {
  390. this.$refs.dialogHandleBank.openBoxs();
  391. },
  392. //退款审核
  393. refundFunc(row) {
  394. this.$refs.refundFunc.openBoxs(row.handleOrderSn);
  395. },
  396. orderSH(row) {
  397. this.$refs.orderDetail.openBoxs(row.handleOrderSn, true);
  398. },
  399. //查看详情
  400. orderDetail(row) {
  401. this.$refs.orderDetail.openBoxs(row.handleOrderSn);
  402. },
  403. search(int) {
  404. this.loading = true;
  405. if (int === 1) {
  406. this.formData.pageNum = 1;
  407. }
  408. if (int === 2) {
  409. this.formData = {
  410. pageSize: 10,
  411. pageNum: 1,
  412. payStatus: "",
  413. refundStatus: "",
  414. };
  415. }
  416. this.$api
  417. .orderhandlelist(this.formData)
  418. .then((res) => {
  419. this.tableData = res.rows;
  420. this.total = res.total;
  421. this.navText.index = res.total;
  422. })
  423. .finally(() => {
  424. this.loading = false;
  425. });
  426. let obj = JSON.parse(JSON.stringify(this.formData));
  427. delete obj.pageNum;
  428. delete obj.pageSize;
  429. this.$api.orderhandlestatistics(obj).then((res) => {
  430. this.info = res.data || {};
  431. });
  432. },
  433. handleSizeChange(v) {
  434. this.formData.pageSize = v;
  435. this.formData.pageNum = 1;
  436. this.search();
  437. },
  438. handleCurrentChange(v) {
  439. this.formData.pageNum = v;
  440. this.search();
  441. },
  442. downinvoice(ary) {
  443. for (let i = 0; i < ary.length; i++) {
  444. this.download(this.$methodsTools.splitImgHost(ary[i]));
  445. }
  446. },
  447. //下载
  448. download(url, fileName = "") {
  449. let xhr = new XMLHttpRequest();
  450. xhr.open("get", url, true);
  451. xhr.setRequestHeader("Content-Type", `application/pdf`);
  452. xhr.responseType = "blob";
  453. let that = this;
  454. xhr.onload = function () {
  455. if (this.status == 200) {
  456. //接受二进制文件流
  457. var blob = this.response;
  458. that.downloadExportFile(blob, fileName);
  459. }
  460. };
  461. xhr.send();
  462. },
  463. downloadExportFile(blob, tagFileName) {
  464. let downloadElement = document.createElement("a");
  465. let href = "";
  466. if (typeof blob == "string") {
  467. downloadElement.target = "_blank";
  468. } else {
  469. href = window.URL.createObjectURL(blob); //创建下载的链接
  470. }
  471. downloadElement.href = href;
  472. downloadElement.download = tagFileName;
  473. //下载后文件名
  474. document.body.appendChild(downloadElement);
  475. downloadElement.click(); //点击下载
  476. document.body.removeChild(downloadElement); //下载完成移除元素
  477. if (typeof blob != "string") {
  478. window.URL.revokeObjectURL(href); //释放掉blob对象
  479. }
  480. },
  481. },
  482. };
  483. </script>
  484. <style lang="less" scoped></style>