index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. <template>
  2. <div id="orderList">
  3. <search-box ref="search_box" :formList="formList" @search="search" @init="init" />
  4. <table-list
  5. :tableSets="tableSet"
  6. :tableData="tableData"
  7. :navText="navText"
  8. @addClick="addClick"
  9. :loading="loading"
  10. >
  11. <template slot="btn" slot-scope="props">
  12. <el-button type="text" @click="addClick(props.scope.row)"
  13. >详情订单</el-button
  14. >
  15. </template>
  16. </table-list>
  17. <pagination
  18. :total="total"
  19. :pageSize="pageSize"
  20. :currentPage="currentPage"
  21. @handleSizeChange="handleSizeChange"
  22. @handleCurrentChange="handleCurrentChange"
  23. />
  24. <el-dialog
  25. :visible.sync="dialogBox"
  26. width="920px"
  27. :show-close="false"
  28. :destroy-on-close="true"
  29. :before-close="closeBefore"
  30. :fullscreen="fullscreen"
  31. >
  32. <div slot="title" class="hearders">
  33. <div class="leftTitle">详情</div>
  34. <div class="rightBoxs">
  35. <img
  36. src="@/assets/images/Max@2x.png"
  37. alt=""
  38. @click="fullscreen = !fullscreen"
  39. />
  40. <img src="@/assets/images/Close@2x.png" alt="" @click="closeBefore" />
  41. </div>
  42. </div>
  43. <el-row class="contentBox" :span="24">
  44. <el-steps
  45. :active="
  46. poppleData.orderStatus === -2
  47. ? 1
  48. : poppleData.orderStatus === -1
  49. ? 1
  50. : poppleData.orderStatus === 0
  51. ? 1
  52. : poppleData.orderStatus === 1
  53. ? 2
  54. : poppleData.orderStatus === 3
  55. ? 2
  56. : 1
  57. "
  58. style="width: 480px; margin: 0px auto"
  59. align-center
  60. >
  61. <el-step
  62. title="确定订单"
  63. :description="$methodsTools.onlyForma(poppleData.createTime)"
  64. ></el-step>
  65. <el-step
  66. title="支付订单"
  67. :description="
  68. poppleData.payTime === null
  69. ? '未支付'
  70. : $methodsTools.onlyForma(poppleData.payTime)
  71. "
  72. ></el-step>
  73. </el-steps>
  74. <div class="statusBox" style="padding-left: 20px">
  75. 当前订单状态:
  76. {{
  77. poppleData.orderStatus === -2
  78. ? "超时关闭"
  79. : poppleData.orderStatus === -1
  80. ? "手动关闭"
  81. : poppleData.orderStatus === 0
  82. ? "待付款"
  83. : poppleData.orderStatus === 1
  84. ? "已付款"
  85. : poppleData.orderStatus === 3
  86. ? "订单完成"
  87. : "未知"
  88. }}
  89. </div>
  90. <div style="margin-bottom: 10px">
  91. <header style="margin-bottom: 10px">基本信息</header>
  92. <el-table :data="tableData1" border>
  93. <el-table-column
  94. v-for="(item, index) in tableSet1"
  95. :key="index"
  96. align="center"
  97. header-align="center"
  98. :label="item.label"
  99. >
  100. <template slot-scope="scope">
  101. <span v-if="item.scope === 'typeStatus'">{{
  102. scope.row[item.prop] === 1
  103. ? "微信"
  104. : scope.row[item.prop] === 2
  105. ? "支付宝"
  106. : scope.row[item.prop] === 3
  107. ? "金币"
  108. : "未知"
  109. }}</span>
  110. <span v-else-if="item.scope === 'activeInfo'">
  111. {{ tableData1[0].orderInfos }}
  112. </span>
  113. <span v-else>{{ scope.row[item.prop] }}</span>
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. </div>
  118. <!-- <div style="margin-bottom: 10px;">
  119. <header style="margin-bottom: 10px;">发票信息</header>
  120. <el-table :data="tableData2" border>
  121. <template slot-scope="scope">
  122. <el-table-column
  123. v-for="(item, index) in tableSet2"
  124. :key="index"
  125. align="center"
  126. header-align="center"
  127. :label="item.label"
  128. >
  129. <span v-if="item.scope === 'asd'">123</span>
  130. <span v-else>123123</span>
  131. </el-table-column>
  132. </template>
  133. </el-table>
  134. </div> -->
  135. <div style="margin-bottom: 10px">
  136. <header style="margin-bottom: 10px">费用信息</header>
  137. <table
  138. style="width: 100%; border-color: #f2f6fc"
  139. border="1"
  140. cellpadding="0"
  141. cellspacing="0"
  142. >
  143. <tr class="trs">
  144. <th>商品图片</th>
  145. <th>商品名称</th>
  146. <th>价格</th>
  147. <th>属性</th>
  148. <th>数量</th>
  149. <th>小计</th>
  150. </tr>
  151. <tr class="trs" v-for="(items, indexs) in tableData3" :key="indexs">
  152. <td style="width: 160px; heigth: 90px">
  153. <img
  154. style="width: 100%; heigth: 100%"
  155. :src="$methodsTools.splitImgHost(items.coverUrl)"
  156. alt="加载失败..."
  157. />
  158. </td>
  159. <td>{{ items.goodsName }}</td>
  160. <td>¥{{ items.goodsPrice }}</td>
  161. <td>类型:{{ items.categoryName }}</td>
  162. <td>{{ items.num }}</td>
  163. <td>¥{{ items.goodsPrice }}</td>
  164. </tr>
  165. <tr class="yh">
  166. <td style="text-align: right" colspan="5">优惠</td>
  167. <td style="text-align: center">
  168. ¥{{
  169. Number(poppleData.payPrice) - Number(poppleData.orderPrice)
  170. }}
  171. </td>
  172. </tr>
  173. <tr class="yh" style="background-color: rgb(249, 250, 252)">
  174. <td style="text-align: right" colspan="6">
  175. 合计:<span style="font-weight: bold; color: red"
  176. >¥{{ poppleData.payPrice }}</span
  177. >
  178. </td>
  179. </tr>
  180. </table>
  181. </div>
  182. </el-row>
  183. <div slot="footer" class="dialog-footer">
  184. <el-button @click="closeBefore">关闭</el-button>
  185. </div>
  186. </el-dialog>
  187. </div>
  188. </template>
  189. <script>
  190. import searchBox from "@/components/searchBox";
  191. import tableList from "@/components/tableList";
  192. import pagination from "@/components/pagination";
  193. export default {
  194. components: { searchBox, tableList, pagination },
  195. data() {
  196. return {
  197. loading: false, //当前表单加载是否加载动画
  198. navText: {
  199. title: "订单列表",
  200. index: 0,
  201. ch: "条",
  202. num: true,
  203. choice: true,
  204. addHide: true,
  205. backFatherBtn: {
  206. status: false,
  207. title: "未定义",
  208. },
  209. },
  210. poppleData: {},
  211. statusPop: 0,
  212. fullscreen: false,
  213. dialogBox: false,
  214. //搜索
  215. formList: [
  216. {
  217. label: "订单编号",
  218. prop: "oderSn",
  219. placeholder: "请输入订单编号",
  220. },
  221. {
  222. label: "订单状态",
  223. prop: "orderStatus",
  224. placeholder: "请选择订单状态",
  225. scope: "select",
  226. options: [
  227. {
  228. label: "超时关闭",
  229. value: -2,
  230. },
  231. {
  232. label: "手动关闭",
  233. value: -1,
  234. },
  235. {
  236. label: "待付款",
  237. value: 0,
  238. },
  239. {
  240. label: "已付款",
  241. value: 1,
  242. },
  243. ],
  244. },
  245. {
  246. label: "确定时间",
  247. prop: "finishTime",
  248. scope: "datePicker",
  249. },
  250. {
  251. label: "姓名",
  252. prop: "nickname",
  253. placeholder: "请输入姓名",
  254. },
  255. {
  256. label: "手机号",
  257. prop: "telphone",
  258. placeholder: "请输入手机号",
  259. },
  260. {
  261. label: "订单金额",
  262. prop: "payType",
  263. placeholder: "请输入订单金额",
  264. },
  265. ],
  266. // 表单
  267. tableSet: [
  268. {
  269. label: "确定时间",
  270. prop: "finishTime",
  271. hidden: true,
  272. scope: "aTimeList",
  273. },
  274. {
  275. label: "姓名",
  276. prop: "nickname",
  277. hidden: true,
  278. },
  279. {
  280. label: "用户手机号",
  281. prop: "telphone",
  282. hidden: true,
  283. },
  284. {
  285. label: "订单金额",
  286. prop: "orderPrice",
  287. hidden: true,
  288. },
  289. {
  290. label: "订单状态",
  291. prop: "orderStatus",
  292. hidden: true,
  293. scope: "statusOrder",
  294. },
  295. ],
  296. //基本信息表格
  297. tableSet1: [
  298. {
  299. label: "订单编号",
  300. prop: "oderSn",
  301. },
  302. {
  303. label: "用户账号",
  304. prop: "telphone",
  305. },
  306. {
  307. label: "支付方式",
  308. prop: "payType",
  309. scope: "typeStatus",
  310. },
  311. {
  312. label: "活动信息",
  313. prop: "orderInfos",
  314. scope: "activeInfo",
  315. },
  316. ],
  317. //发票信息
  318. tableSet2: [
  319. {
  320. label: "发票类型",
  321. prop: "finishTime",
  322. },
  323. {
  324. label: "发票抬头",
  325. prop: "telphone",
  326. },
  327. {
  328. label: "发票内容",
  329. prop: "orderPrice",
  330. },
  331. {
  332. label: "收票人信息",
  333. prop: "orderStatus",
  334. },
  335. ],
  336. //费用信息
  337. tableSet3: [
  338. // {
  339. // label: "商品图片",
  340. // prop: "finishTime",
  341. // },
  342. {
  343. label: "商品名称",
  344. prop: "goodsName",
  345. },
  346. {
  347. label: "价格",
  348. prop: "goodsPrice",
  349. },
  350. {
  351. label: "属性",
  352. prop: "categoryName",
  353. scope: "type",
  354. },
  355. {
  356. label: "数量",
  357. prop: "num",
  358. },
  359. {
  360. label: "小计",
  361. prop: "goodsPrice",
  362. },
  363. ],
  364. tableData: [], //表单数据
  365. tableData1: [],
  366. tableData2: [],
  367. tableData3: [],
  368. total: 0, //一共多少条
  369. pageSize: 10, //每页多少条数据
  370. currentPage: 1, //当前页码
  371. };
  372. },
  373. mounted() {
  374. this.search();
  375. },
  376. methods: {
  377. rulesTableSumbit() {},
  378. closeBefore() {
  379. this.dialogBox = false;
  380. this.fullscreen = false;
  381. this.poppleData = {};
  382. },
  383. search(v,os) {
  384. this.loading = true;
  385. if(os){
  386. this.currentPage = 1
  387. }
  388. if(v === undefined){
  389. v = {}
  390. }
  391. var data = {
  392. oderSn: v.oderSn,
  393. orderStatus: v.orderStatus || "",
  394. startTime: v.finishTime ? (v.finishTime[0] / 1000).toFixed(0) : "",
  395. endTime: v.finishTime ? (v.finishTime[1] / 1000).toFixed(0) : "",
  396. pageSize: this.pageSize,
  397. pageNum: this.currentPage,
  398. };
  399. this.$api.inquireorderlistAll(data).then((res) => {
  400. this.tableData = res.rows;
  401. this.total = res.total;
  402. this.navText.index = res.total;
  403. });
  404. this.loading = false;
  405. },
  406. init() {
  407. this.search();
  408. },
  409. async addClick(v) {
  410. console.log(v);
  411. var self = this;
  412. this.poppleData = v;
  413. var tableDatalist = [];
  414. tableDatalist.push(v);
  415. const awizti = await this.$api.ordercouponlist({ orderSn: v.oderSn });
  416. if (awizti.data.length) {
  417. console.log(123);
  418. var ins = awizti.data[0].couponType === 0 ? "元" : "折";
  419. tableDatalist[0].orderInfos =
  420. awizti.data[0].activityName + awizti.data[0].price + ins;
  421. this.tableData1 = tableDatalist;
  422. } else {
  423. this.tableData1 = tableDatalist;
  424. }
  425. this.$api.ordergoodslist({ orderSn: v.oderSn }).then((res) => {
  426. if (res.code === 200) {
  427. this.tableData3 = res.data;
  428. }
  429. });
  430. this.dialogBox = true;
  431. },
  432. handleSizeChange(v) {
  433. this.pageSize = v;
  434. this.currentPage = 1;
  435. this.search(this.$refs.search_box.formData);
  436. },
  437. handleCurrentChange(v) {
  438. this.currentPage = v;
  439. this.search(this.$refs.search_box.formData);
  440. },
  441. },
  442. };
  443. </script>
  444. <style lang="less" scoped>
  445. .trs {
  446. height: 40px;
  447. td {
  448. text-align: center;
  449. overflow: hidden;
  450. white-space: nowrap;
  451. text-overflow: ellipsis;
  452. max-width: 150px;
  453. padding: 6px;
  454. }
  455. th {
  456. background-color: rgb(249, 250, 252);
  457. }
  458. }
  459. .yh {
  460. height: 40px;
  461. td {
  462. padding: 0px 6px;
  463. }
  464. }
  465. .statusBox {
  466. height: 60px;
  467. line-height: 60px;
  468. color: red;
  469. background-color: #eee;
  470. margin: 20px 0px;
  471. }
  472. /deep/.el-button {
  473. border-radius: 8px;
  474. }
  475. /deep/.el-dialog {
  476. border-radius: 8px;
  477. .el-dialog__header {
  478. padding: 0;
  479. .hearders {
  480. height: 40px;
  481. display: flex;
  482. align-items: center;
  483. justify-content: space-between;
  484. padding: 0px 18px 0px 20px;
  485. border-bottom: 1px solid #e2e2e2;
  486. .leftTitle {
  487. font-size: 14px;
  488. font-weight: bold;
  489. color: #2f4378;
  490. }
  491. .rightBoxs {
  492. display: flex;
  493. align-items: center;
  494. img {
  495. width: 14px;
  496. height: 14px;
  497. margin-left: 13px;
  498. cursor: pointer;
  499. }
  500. }
  501. }
  502. }
  503. .el-dialog__body {
  504. padding: 0;
  505. .contentBox {
  506. padding: 20px 20px 5px;
  507. .el-col {
  508. padding: 0px 20px;
  509. margin-bottom: 30px;
  510. header {
  511. margin-bottom: 6px;
  512. color: #2f4378;
  513. font-size: 14px;
  514. }
  515. }
  516. }
  517. }
  518. .el-dialog__footer {
  519. padding: 0;
  520. .dialog-footer {
  521. padding: 0px 40px;
  522. height: 70px;
  523. border-top: 1px solid #e2e2e2;
  524. display: flex;
  525. align-items: center;
  526. justify-content: flex-end;
  527. }
  528. }
  529. }
  530. .imgBox {
  531. width: 100%;
  532. // height: 210px;
  533. border: 1px solid #e2e2e2;
  534. border-radius: 8px;
  535. padding: 8px 8px 3px;
  536. display: flex;
  537. flex-direction: column;
  538. align-items: center;
  539. .imgLabel {
  540. flex: 1;
  541. width: 100%;
  542. border: 1px dotted #e2e2e2;
  543. color: #999;
  544. font-size: 14px;
  545. cursor: pointer;
  546. border-radius: 8px;
  547. .msPhoto {
  548. display: flex;
  549. justify-content: center;
  550. align-items: center;
  551. max-width: 100%;
  552. max-height: 270px;
  553. img {
  554. max-width: 100%;
  555. max-height: 270px;
  556. }
  557. }
  558. .imgbbx {
  559. display: flex;
  560. flex-direction: column;
  561. align-items: center;
  562. justify-content: center;
  563. width: 100%;
  564. height: 100%;
  565. i {
  566. font-weight: bold;
  567. margin: 14px 0;
  568. font-size: 24px;
  569. }
  570. }
  571. }
  572. p {
  573. margin: 5px 0px;
  574. }
  575. }
  576. .avatar-uploader .el-upload {
  577. border: 1px dashed #d9d9d9;
  578. border-radius: 6px;
  579. cursor: pointer;
  580. position: relative;
  581. overflow: hidden;
  582. }
  583. .avatar-uploader .el-upload:hover {
  584. border-color: #409eff;
  585. }
  586. .avatar-uploader-icon {
  587. font-size: 28px;
  588. color: #8c939d;
  589. width: 178px;
  590. height: 178px;
  591. line-height: 178px;
  592. text-align: center;
  593. }
  594. .avatar {
  595. width: 178px;
  596. height: 178px;
  597. display: block;
  598. }
  599. </style>