userOrder.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. <template>
  2. <div class="record-warp">
  3. <div class="record-main">
  4. <div class="search-head">
  5. <span class="margin_search">支付状态:</span>
  6. <el-select class="margin_search" v-model="payStatus" placeholder="请选择状态">
  7. <el-option
  8. :label="item.name"
  9. :value="item.id"
  10. v-for="item in payList"
  11. :key="item.id"
  12. ></el-option> </el-select
  13. >&nbsp;&nbsp;&nbsp;&nbsp;
  14. <span class="margin_search">渠道结清状态:</span>
  15. <el-select class="margin_search" v-model="status" placeholder="请选择结清状态">
  16. <el-option
  17. :label="item.name"
  18. :value="item.id"
  19. v-for="item in statusList"
  20. :key="item.id"
  21. ></el-option> </el-select
  22. >&nbsp;&nbsp;&nbsp;&nbsp;
  23. <span class="margin_search">渠道:</span>
  24. <el-select class="margin_search" v-model="channel" placeholder="请选择渠道">
  25. <el-option
  26. :label="item.name"
  27. :value="item.id"
  28. v-for="item in channelList"
  29. :key="item.id"
  30. ></el-option> </el-select
  31. >&nbsp;&nbsp;&nbsp;&nbsp;
  32. <span class="margin_search">类型:</span>
  33. <el-select class="margin_search" v-model="orderType" placeholder="请选择类型">
  34. <el-option
  35. :label="item.name"
  36. :value="item.id"
  37. v-for="item in orderList"
  38. :key="item.id"
  39. ></el-option> </el-select
  40. >&nbsp;&nbsp;&nbsp;&nbsp;
  41. <el-button
  42. type="primary"
  43. class="margin_search"
  44. round
  45. icon="el-icon-search"
  46. @click="searchTarget"
  47. >搜索</el-button
  48. >
  49. <el-button
  50. type="info"
  51. class="margin_search"
  52. round
  53. icon="el-icon-delete-solid"
  54. @click="clearSearch"
  55. >清空</el-button
  56. >
  57. <!-- <el-button type="success" class="add_class" round icon="el-icon-plus" @click="addUser"
  58. >新增</el-button
  59. > -->
  60. </div>
  61. <div class="table-content">
  62. <el-table
  63. :data="tableData"
  64. :row-style="{ height: '0px' }"
  65. :cell-style="{ padding: '5px' }"
  66. >
  67. <!-- <el-table-column prop="channelName" label="渠道" align="center" width="">
  68. </el-table-column> -->
  69. <el-table-column prop="orderNo" label="订单号" align="center" width="">
  70. </el-table-column>
  71. <el-table-column prop="amount" label="金额" align="center" width="">
  72. </el-table-column>
  73. <el-table-column
  74. prop="payStatus"
  75. label="支付状态"
  76. align="center"
  77. width=""
  78. :formatter="formatterPay"
  79. >
  80. </el-table-column>
  81. <el-table-column
  82. prop="status"
  83. label="渠道结清状态"
  84. align="center"
  85. width=""
  86. :formatter="formatterStatus"
  87. >
  88. </el-table-column>
  89. <el-table-column
  90. prop="type"
  91. label="类型"
  92. align="center"
  93. width=""
  94. :formatter="formatterType"
  95. >
  96. </el-table-column>
  97. <el-table-column
  98. prop="effectiveDate"
  99. label="订单起始日期"
  100. align="center"
  101. width=""
  102. >
  103. </el-table-column>
  104. <el-table-column
  105. prop="expirationDate"
  106. label="订单截至日期"
  107. align="center"
  108. width=""
  109. >
  110. </el-table-column>
  111. <!-- <el-table-column
  112. prop="selfPage"
  113. label="自定义首尾页"
  114. align="center"
  115. :formatter="formatterSelfPage"
  116. width=""
  117. >
  118. </el-table-column> -->
  119. <!-- <el-table-column prop="isDelete" label="删除状态" align="center" :formatter="formatterDelete" width="">
  120. </el-table-column> -->
  121. <el-table-column label="操作" width="200px" align="center" fixed="right">
  122. <template slot-scope="scope">
  123. <el-button
  124. @click="viewUser(scope.row)"
  125. v-if="scope.row.state != 0"
  126. type="text"
  127. size="small"
  128. >查看</el-button
  129. >
  130. <!-- <el-button
  131. type="text"
  132. size="small"
  133. v-if="scope.row.state != 0"
  134. @click="editUser(scope.row)"
  135. >编辑</el-button
  136. >
  137. <el-button
  138. type="text"
  139. size="small"
  140. v-if="scope.row.state != 0"
  141. @click="viewPoster(scope.row)"
  142. >查看海报</el-button
  143. > -->
  144. </template>
  145. </el-table-column>
  146. </el-table>
  147. </div>
  148. <el-pagination
  149. small
  150. background
  151. @current-change="handleCurrentChange"
  152. :current-page.sync="pageNum"
  153. layout="total, prev, pager, next"
  154. :page-size="pageSize"
  155. :total="total"
  156. >
  157. </el-pagination>
  158. <!-- <el-pagination small background layout="total prev, pager, next" :total="36">
  159. </el-pagination> -->
  160. </div>
  161. <ContractChannelRegister ref="register" @search="searchTarget" />
  162. <ContractPoster ref="poster" @search="searchTarget" />
  163. <ContractTopUp ref="topUp" @search="searchTarget" />
  164. <el-dialog title="查看" :visible.sync="centerDialogVisible" width="60%" center>
  165. <div>
  166. <el-row>
  167. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  168. <div class="user_out">
  169. <div class="user_out_sub">订单号</div>
  170. <div class="user_out_subNext">
  171. {{ detailObj.orderNo }}
  172. </div>
  173. </div>
  174. </el-col>
  175. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  176. <div class="user_out">
  177. <div class="user_out_sub">金额</div>
  178. <div class="user_out_subNext">
  179. {{ detailObj.amount }}
  180. </div>
  181. </div>
  182. </el-col>
  183. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  184. <div class="user_out">
  185. <div class="user_out_sub">支付状态</div>
  186. <div class="user_out_subNext">
  187. <span v-if="detailObj.payStatus == '0'"> 未支付 </span>
  188. <span v-else-if="(detailObj.payStatus = '1')"> 已支付 </span>
  189. <span v-else-if="(detailObj.payStatus = '2')"> 支付失败 </span>
  190. </div>
  191. </div>
  192. </el-col>
  193. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  194. <div class="user_out">
  195. <div class="user_out_sub">渠道结清状态</div>
  196. <div class="user_out_subNext">
  197. <span v-if="detailObj.status == '1'"> 已结算 </span>
  198. <span v-else-if="detailObj.status == '0'"> 待结算 </span>
  199. <span> </span>
  200. </div>
  201. </div>
  202. </el-col>
  203. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  204. <div class="user_out">
  205. <div class="user_out_sub">类型</div>
  206. <div class="user_out_subNext">
  207. <!-- {{ detailObj.type }} -->
  208. <span v-if="detailObj.type == '1'">
  209. 次卡支付
  210. </span>
  211. <span v-else-if="detailObj.type == '2'">
  212. 时效卡支付
  213. </span>
  214. <span v-else-if="detailObj.type == '3'">
  215. 渠道推荐支付
  216. </span>
  217. </div>
  218. </div>
  219. </el-col>
  220. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  221. <div class="user_out">
  222. <div class="user_out_sub">下单时间</div>
  223. <div class="user_out_subNext">
  224. {{ detailObj.effectiveDate }}
  225. </div>
  226. </div>
  227. </el-col>
  228. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
  229. <div class="user_out">
  230. <div class="user_out_sub">支付时间</div>
  231. <div class="user_out_subNext">
  232. {{ detailObj.expirationDate}}
  233. </div>
  234. </div>
  235. </el-col>
  236. </el-row>
  237. </div>
  238. </el-dialog>
  239. </div>
  240. </template>
  241. <script>
  242. import { oSessionStorage } from "../../../utils/utils";
  243. import contractChannelRegister from "../../../components/ContractChannelRegister.vue";
  244. import contractPoster from "../../../components/ContractPoster.vue";
  245. import contractTopUp from "../../../components/ContractTopUp.vue";
  246. export default {
  247. name: "channelManagement",
  248. components: {
  249. ContractChannelRegister: contractChannelRegister,
  250. ContractPoster: contractPoster,
  251. },
  252. data() {
  253. return {
  254. centerDialogVisible: false,
  255. editUserFlag: false,
  256. startTime: "",
  257. endTime: "",
  258. value1: null,
  259. total: 0,
  260. pageSize: 10,
  261. pageNum: 1,
  262. keyword: "",
  263. tableData: [],
  264. userInfo: {}, //用户信息
  265. userId: "", //用户id
  266. name: "", //根据名称搜索
  267. userName: "", //根据昵称搜索
  268. hospitalOrDepartment: "", //医院科室
  269. invitationCode: "",
  270. roleType: "0",
  271. type: 0,
  272. view: {
  273. name: "",
  274. userName: "",
  275. channelId: "",
  276. role: "",
  277. },
  278. detailObj: {},
  279. channel: "",
  280. channelList: [{ name: "渠道天成", id: "1" }],
  281. payStatus: "",
  282. payList: [
  283. { name: "未支付", id: "0" },
  284. { name: "已支付", id: "1" },
  285. { name: "支付失败", id: "-1" },
  286. ],
  287. status: "",
  288. statusList: [
  289. { name: "已结算", id: "1" },
  290. { name: "待结算", id: "0" },
  291. ],
  292. orderType: "",
  293. orderList: [
  294. { name: "次卡支付", id: "0" },
  295. { name: "时效卡支付", id: "1" },
  296. { name: "渠道推荐支付", id: "2" },
  297. ],
  298. };
  299. },
  300. created() {},
  301. mounted() {
  302. this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
  303. // if (this.userInfo.type == "1") {
  304. // this.channel = "";
  305. // } else if (this.userInfo.type == "0") {
  306. // this.channel = this.userInfo.channelId;
  307. // }
  308. // this.invitationCode = this.userInfo.invitationCode;
  309. this.getChannel();
  310. if (!this.userInfo) {
  311. //如果用户信息不存在跳转登陆页
  312. this.$router.push({ path: "/" });
  313. }
  314. this.searchTarget();
  315. },
  316. methods: {
  317. //格式化类型
  318. formatterType(row) {
  319. if (row.type == "1") {
  320. return "次卡支付";
  321. } else if (row.type == "2") {
  322. return "时效卡";
  323. } else if (row.type == "3") {
  324. return "渠道推荐支付";
  325. }
  326. },
  327. //格式化支付
  328. formatterPay(row) {
  329. if (row.payStatus == "0") {
  330. return "未支付";
  331. } else if (row.payStatus == "1") {
  332. return "已支付";
  333. } else if (row.payStatus == "-1") {
  334. return "支付失败";
  335. }
  336. },
  337. //渠道发生变化
  338. // changeChannel() {
  339. // debugger;
  340. // this.getUserInfo();
  341. // this.searchTarget();
  342. // },
  343. //查看记录
  344. viewRecord(row) {
  345. this.$router.push({ path: "/manage/recordList", query: { id: row.id } });
  346. },
  347. //充值次数
  348. topUpCount(row) {
  349. // console.log(this.$refs.topUp)
  350. this.$refs.topUp.open(row.id);
  351. },
  352. //查看海报
  353. viewPoster(row) {
  354. this.$refs.poster.open(row);
  355. },
  356. //格式化自定义首尾页
  357. formatterSelfPage(row) {
  358. if (row.selfPage == "0") {
  359. return "否";
  360. } else {
  361. return "是";
  362. }
  363. },
  364. //获取员工信息
  365. getUserInfo() {
  366. this.$http.get(`/staff/find/${this.channel}`, {}, (res) => {
  367. // this.$toast.success({message:'成功'});
  368. if (res && res.code == 200) {
  369. debugger;
  370. //将值赋值给list
  371. this.userList = res.data;
  372. } else {
  373. this.$message.error(res.msg);
  374. }
  375. });
  376. },
  377. //获取渠道信息
  378. getChannel() {
  379. this.$http.get(`/channel/findAll`, {}, (res) => {
  380. // this.$toast.success({message:'成功'});
  381. if (res && res.code == 200) {
  382. //将值赋值给list
  383. this.channelList = res.data;
  384. } else {
  385. this.$message.error(res.msg);
  386. }
  387. });
  388. },
  389. //员工管理
  390. userManage(row) {
  391. this.$router.push({ path: "/manage/staff", query: { channelId: row.id } });
  392. },
  393. //格式化状态
  394. formatterStatus(row) {
  395. if (row.status == "1") {
  396. return "已结算";
  397. } else if (row.status == "0") {
  398. return "待结算";
  399. } else {
  400. return "";
  401. }
  402. },
  403. formatterDelete(row) {
  404. if (row.isDelete == 0) {
  405. return "正常";
  406. } else {
  407. return "已删除";
  408. }
  409. },
  410. resetUser(index, val) {
  411. this.$http.get(`/user/reset/${val.id}`, {}, (res) => {
  412. // this.$toast.success({message:'成功'});
  413. if (res && res.code == 200) {
  414. this.$message.success("重置成功");
  415. this.searchTarget();
  416. } else {
  417. this.$message.error(res.msg);
  418. }
  419. });
  420. //重置密码
  421. },
  422. editUser(row) {
  423. this.editRegisterUser(row);
  424. },
  425. viewUser(row) {
  426. this.detailObj = row;
  427. this.centerDialogVisible = true;
  428. },
  429. addUser() {
  430. this.addRegisterUser(true);
  431. },
  432. clearSearch() {
  433. this.channel = "";
  434. this.status = "";
  435. this.payStatus = "";
  436. this.orderType = "";
  437. this.searchTarget();
  438. },
  439. formatterRole(val) {
  440. if (val.type == "1") {
  441. return "超级管理员";
  442. } else {
  443. return "渠道用户";
  444. }
  445. },
  446. forma(val) {
  447. if (val.gender == "0") {
  448. return "男";
  449. } else {
  450. return "女";
  451. }
  452. },
  453. addRegisterUser(val) {
  454. this.$refs.register.open(val);
  455. },
  456. editRegisterUser(val) {
  457. this.$refs.register.edit(val);
  458. },
  459. deleteChannel(index, row) {
  460. this.$http.delete(`/sign/delete/${row.id}`, {}, (res) => {
  461. // this.$toast.success({message:'成功'});
  462. if (res && res.code == 200) {
  463. this.$message.success("删除成功");
  464. this.searchTarget();
  465. } else {
  466. this.$message.error("删除失败");
  467. }
  468. });
  469. },
  470. handleCurrentChange(val) {
  471. this.pageNum = val;
  472. this.searchList();
  473. },
  474. //根据现有情况进行搜索
  475. searchList() {
  476. // let url =``
  477. let data = {};
  478. // this.channel = "";
  479. // this.status = "";
  480. // this.payStatus = '';
  481. data = {
  482. pageNum: this.pageNum,
  483. pageSize: this.pageSize,
  484. channelId: this.channel,
  485. status: this.status,
  486. payStatus: this.payStatus,
  487. type: this.orderType,
  488. };
  489. this.$http.post(`/order/find`, data, (res) => {
  490. // console.log(res,'用户测试记录')
  491. if (res && res.code == 200) {
  492. this.tableData = res.data.data;
  493. this.total = res.data.totalElements;
  494. } else {
  495. // this.$toast.fail(res.msg);
  496. this.$message.error(res.msg);
  497. }
  498. });
  499. },
  500. searchTarget() {
  501. this.pageNum = 1;
  502. this.searchList();
  503. },
  504. //跳转首页
  505. goHome() {
  506. this.$router.push({ path: "/home" });
  507. },
  508. //跳转记录页
  509. goRecord() {
  510. this.$router.push({ path: "/record" });
  511. },
  512. //退出登陆
  513. logout() {
  514. oSessionStorage.removeItem("userInfo");
  515. oSessionStorage.removeItem("token");
  516. this.$router.push({ path: "/" });
  517. },
  518. //点击日历获取日期
  519. getDate(param) {
  520. // console.log(param,"日期。。。")
  521. this.userRecord(param.dateStr);
  522. },
  523. //点击获取月出勤次数
  524. getTimes(param) {
  525. this.monthTimes = param;
  526. },
  527. // 用户测试记录显示
  528. userRecord(date) {
  529. this.$http.get(
  530. `gameRecord/findListByUserIdAndDate/${this.userId}/${date}`,
  531. {},
  532. (res) => {
  533. // console.log(res,'用户测试记录')
  534. if (res && res.code == 200) {
  535. this.listData = res.data;
  536. } else {
  537. this.$toast.fail(res.msg);
  538. }
  539. }
  540. );
  541. },
  542. },
  543. };
  544. </script>
  545. <style lang="less" scoped>
  546. @import "../../../styles/theme.less";
  547. .record-warp {
  548. width: 100%;
  549. height: 80vh;
  550. //background: url(../../assets/img/index/19.png) no-repeat center;
  551. //background-size: 100% 100%;
  552. position: relative;
  553. .record-main {
  554. width: 100%;
  555. height: 100%;
  556. box-sizing: border-box;
  557. overflow-y: auto;
  558. .search-head {
  559. width: 100%;
  560. display: flex;
  561. flex-direction: row;
  562. justify-content: flex-start;
  563. align-items: center;
  564. flex-wrap: wrap;
  565. align-content: space-between;
  566. .margin_search {
  567. margin-bottom: 10px;
  568. }
  569. .zc-title {
  570. color: #606266;
  571. font-size: 14px;
  572. }
  573. }
  574. .table-content {
  575. margin: 10px 0;
  576. }
  577. }
  578. }
  579. .add_user_class {
  580. margin-top: 10px;
  581. }
  582. .user_out {
  583. display: flex;
  584. width: 100%;
  585. align-items: center;
  586. border: 1px solid #eeeeef;
  587. line-height: 50px;
  588. margin-top: 10px;
  589. }
  590. .user_out_sub {
  591. flex: 1;
  592. background-color: #fafafa;
  593. text-align: center;
  594. // color:#ffffff
  595. }
  596. .user_out_subNext {
  597. padding-left: 10px;
  598. flex: 3;
  599. }
  600. </style>