meetingroom.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. <template>
  2. <div class="peripheral">
  3. <van-tabs :active="active" @change="getActive" title-active-color="#1D18BC">
  4. <van-tab title="待办" name="待办">
  5. <div class="tabs-box">
  6. <div class="part-2">
  7. <div
  8. class="card-item white-card"
  9. v-for="item in list1"
  10. :key="item.id"
  11. >
  12. <div class="card-top" @click="goViewInfo(item)">
  13. <div class="card-left">
  14. <p class="tit">{{ item.subject ? item.subject : "暂无" }}</p>
  15. <div class="date">
  16. <p>
  17. 预约时间:{{
  18. item.appointtime ? item.appointtime : "暂无"
  19. }}
  20. </p>
  21. <p>
  22. 经办时间:{{
  23. item.handlerTime ? item.handlerTime : "暂无"
  24. }}
  25. </p>
  26. <p v-if="item.cancelReason">
  27. 取消原因:{{ item.cancelReason }}
  28. </p>
  29. </div>
  30. </div>
  31. <div class="card-right">
  32. <span class="z" v-if="item.state == '1'">等待审核</span>
  33. <span class="y" v-if="item.state == '2'"> 等待付费</span>
  34. <span class="y" v-if="item.state == '3'">等待确认</span>
  35. <span class="g" v-if="item.state == '4'">预定成功</span>
  36. <span class="h" v-if="item.state == '5'">已取消</span>
  37. </div>
  38. </div>
  39. <div class="card-bottom">
  40. <span
  41. class="normal-button-app z-bt"
  42. @click.stop="goViewInfo(item)"
  43. >{{ item.state == "1" ? "审核" : "确认" }}</span
  44. >
  45. <span
  46. class="normal-button-app y-bt"
  47. @click.stop="cancelApple(item)"
  48. >取消</span
  49. >
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </van-tab>
  55. <van-tab title="已办" name="已办">
  56. <div class="tabs-box">
  57. <div class="part-2">
  58. <!-- @click="goNavigator('meetingRoom-audit-app')" -->
  59. <div
  60. class="card-item white-card"
  61. v-for="item in list1"
  62. :key="item.id"
  63. @click="goViewInfoDetial(item)"
  64. >
  65. <div class="card-top">
  66. <div class="card-left">
  67. <p class="tit">{{ item.subject ? item.subject : "暂无" }}</p>
  68. <div class="date">
  69. <p>
  70. 预约时间:{{
  71. item.appointtime ? item.appointtime : "暂无"
  72. }}
  73. </p>
  74. <p>
  75. 经办时间:{{
  76. item.examineTime ? item.examineTime : "暂无"
  77. }}
  78. </p>
  79. <p v-if="item.cancelReason">
  80. 取消原因:{{ item.cancelReason }}
  81. </p>
  82. </div>
  83. </div>
  84. <div class="card-right">
  85. <span class="z" v-if="item.state == '1'">等待审核</span>
  86. <span class="y" v-if="item.state == '2'"> 等待付费</span>
  87. <span class="y" v-if="item.state == '3'">等待确认</span>
  88. <span class="g" v-if="item.state == '4'">预定成功</span>
  89. <span class="h" v-if="item.state == '5'">已取消</span>
  90. </div>
  91. </div>
  92. <div class="card-bottom">
  93. <!-- <span
  94. class="normal-button-app z-bt"
  95. @click.stop="goNavigator('meetingRoom-paymentVoucher')"
  96. >确认</span
  97. >
  98. <span class="normal-button-app y-bt">取消</span> -->
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </van-tab>
  104. </van-tabs>
  105. </div>
  106. </template>
  107. <script>
  108. // import auth from "@/service/auth";
  109. import { listApp, cancelAppoint } from "@/js_sdk/venueRoom";
  110. export default {
  111. data() {
  112. return {
  113. active: 0,
  114. currUser: {},
  115. list1: [
  116. {
  117. title: "指数基金投资培训会 ",
  118. timeStart: "2021/3/21 下午2:00",
  119. timeEnd: "2021/3/21 下午2:00",
  120. type: "1",
  121. text: "",
  122. },
  123. {
  124. title: "会议主题XXXXXXXXX ",
  125. timeStart: "2021/3/21 下午2:00",
  126. timeEnd: "2021/3/21 下午2:00",
  127. type: "2",
  128. text: "",
  129. },
  130. {
  131. title: "会议主题XXXXXXXXX ",
  132. timeStart: "2021/3/21 下午2:00",
  133. timeEnd: "2021/3/21 下午2:00",
  134. type: "3",
  135. text: "天气不好",
  136. },
  137. {
  138. title: "会议主题XXXXXXXXX ",
  139. timeStart: "2021/3/21 下午2:00",
  140. timeEnd: "2021/3/21 下午2:00",
  141. type: "4",
  142. text: "天气不好",
  143. },
  144. {
  145. title: "会议主题XXXXXXXXX ",
  146. timeStart: "2021/3/21 下午2:00",
  147. timeEnd: "2021/3/21 下午2:00",
  148. type: "5",
  149. text: "",
  150. },
  151. ],
  152. };
  153. },
  154. // onLoad() {
  155. // // this.currUser = auth.currUser();
  156. // console.log(123123);
  157. // // this.activeClick();
  158. // this.getAppointList("1,3");
  159. // },
  160. onShow() {
  161. console.log(this.active);
  162. if (this.active == 0) {
  163. this.getAppointList("1,3");
  164. } else {
  165. this.getAppointList("2,4,5");
  166. }
  167. },
  168. methods: {
  169. getActive(event) {
  170. this.active = event.detail.index;
  171. if (event.detail.index == 0) {
  172. this.getAppointList("1,3");
  173. } else {
  174. this.getAppointList("2,4,5");
  175. }
  176. },
  177. cancelApple(item) {
  178. console.log(item);
  179. let that = this;
  180. uni.showModal({
  181. title: "提示!",
  182. content: `是否确认取消【${item.subject}】的预约`,
  183. success(res) {
  184. if (res.confirm) {
  185. const reqData = {
  186. id: item.id,
  187. };
  188. cancelAppoint(reqData).then((res) => {
  189. if (res.key == 200) {
  190. that.$showToast("取消成功!");
  191. that.activeClick();
  192. }
  193. });
  194. }
  195. },
  196. });
  197. },
  198. activeClick() {
  199. if (this.active == 0) {
  200. this.getAppointList("1,3");
  201. } else {
  202. this.getAppointList("2,4,5");
  203. }
  204. },
  205. // 获取预约列表
  206. getAppointList(state) {
  207. this.list1 = [];
  208. const token = uni.getStorageSync("laocui_user_info");
  209. const reqData = {
  210. states: state,
  211. };
  212. if (this.active != 0) {
  213. // reqData.userId = JSON.parse(token).user.id;
  214. }
  215. listApp(reqData).then((res) => {
  216. res.data.forEach((e) => {
  217. console.log(e.handlerTime);
  218. console.log(this.$common.transDate(e.handlerTime));
  219. e.appointtime = this.$common.transDate(e.appointtime);
  220. e.examineTime = this.$common.transDate(e.examineTime);
  221. e.handlerTime = this.$common.transDate(e.handlerTime);
  222. });
  223. this.list1 = res.data;
  224. });
  225. },
  226. // 操作跳转页面
  227. goViewInfo(item) {
  228. console.log(item.state);
  229. if (item.state == "1") {
  230. uni.navigateTo({
  231. url:
  232. "/pages/subPackages/venueRoom/audit?id=" +
  233. item.id +
  234. "&readOnlyType=" +
  235. 1,
  236. });
  237. // this.goNavigator("meetingRoom-audit-app", {
  238. // id: item.id,
  239. // readOnlyType: false,
  240. // });
  241. } else {
  242. uni.navigateTo({
  243. url:
  244. "/pages/subPackages/venueRoom/confirm?id=" +
  245. item.id +
  246. "&readOnlyType=" +
  247. 1,
  248. });
  249. }
  250. },
  251. // 操作跳转页面
  252. goViewInfoDetial(item) {
  253. if (item.state == "1") {
  254. uni.navigateTo({
  255. url:
  256. "/pages/subPackages/venueRoom/audit?id=" +
  257. item.id +
  258. "&readOnlyType=" +
  259. 0,
  260. });
  261. } else {
  262. console.log(123123);
  263. uni.navigateTo({
  264. url:
  265. "/pages/subPackages/venueRoom/confirm?id=" +
  266. item.id +
  267. "&readOnlyType=" +
  268. 0,
  269. success: (success) => {},
  270. fail: (fail) => {
  271. console.log(fail);
  272. },
  273. });
  274. }
  275. },
  276. },
  277. };
  278. </script>
  279. <style lang="scss" >
  280. .normal-button-app {
  281. font-size: 26rpx;
  282. padding: 13rpx 35rpx;
  283. border-radius: 30rpx;
  284. margin-left: 26rpx;
  285. // 紫色
  286. &.z-bt {
  287. border: 1px solid #6600ff;
  288. background: #ecdfff;
  289. color: #6600ff;
  290. }
  291. // 黄色
  292. &.y-bt {
  293. border: 1px solid #ffa913;
  294. background: #fff7e8;
  295. color: #ffa913;
  296. }
  297. //绿色
  298. &.l-bt {
  299. border: 1px solid #54d478;
  300. background: #9bd8ac4d;
  301. color: #54d478;
  302. }
  303. //红色
  304. &.r-bt {
  305. border: 1px solid #f61212;
  306. background: #ffebeb;
  307. color: #e80f0f;
  308. }
  309. // 灰色
  310. &.h-bt {
  311. border: 1px solid #888888;
  312. background: #fafafa;
  313. color: #555555;
  314. }
  315. }
  316. .white-card {
  317. padding: 30rpx;
  318. background: #fff;
  319. box-shadow: 0px 0px 30rpx 0px rgba(0, 0, 0, 0.1);
  320. border-radius: 20rpx;
  321. }
  322. .peripheral {
  323. .tabs-box {
  324. margin: 40rpx 0;
  325. .part-2 {
  326. overflow-y: auto;
  327. height: calc(100vh - 240rpx);
  328. box-sizing: border-box;
  329. .card-item {
  330. margin: 0 30rpx 15rpx;
  331. .card-top {
  332. // @include flex;
  333. display: flex;
  334. .card-left {
  335. display: flex;
  336. justify-content: space-between;
  337. flex-direction: column;
  338. width: 80%;
  339. .tit {
  340. width: 100%;
  341. font-size: 32rpx;
  342. color: #333;
  343. font-weight: bold;
  344. // @include line-over;
  345. margin-bottom: 30rpx;
  346. }
  347. .date {
  348. line-height: 1.4;
  349. font-size: 28rpx;
  350. color: #999;
  351. }
  352. }
  353. .card-right {
  354. align-self: flex-start;
  355. span {
  356. font-size: 28rpx;
  357. }
  358. .z {
  359. color: #976dec;
  360. }
  361. .y {
  362. color: #ffb41f;
  363. }
  364. .g {
  365. color: #54d478;
  366. }
  367. .h {
  368. color: #999999;
  369. }
  370. }
  371. }
  372. }
  373. .card-bottom {
  374. height: 80rpx;
  375. display: flex;
  376. justify-content: flex-end;
  377. align-items: center;
  378. }
  379. }
  380. }
  381. }
  382. </style>