meetingroom.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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/http";
  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. this.list1 = res.data;
  217. });
  218. },
  219. // 操作跳转页面
  220. goViewInfo(item) {
  221. console.log(item.state);
  222. if (item.state == "1") {
  223. uni.navigateTo({
  224. url:
  225. "/pages/subPackages/meetingroom/audit?id=" +
  226. item.id +
  227. "&readOnlyType=" +
  228. 1,
  229. });
  230. // this.goNavigator("meetingRoom-audit-app", {
  231. // id: item.id,
  232. // readOnlyType: false,
  233. // });
  234. } else {
  235. uni.navigateTo({
  236. url:
  237. "/pages/subPackages/meetingroom/confirm?id=" +
  238. item.id +
  239. "&readOnlyType=" +
  240. 1,
  241. });
  242. }
  243. },
  244. // 操作跳转页面
  245. goViewInfoDetial(item) {
  246. if (item.state == "1") {
  247. uni.navigateTo({
  248. url:
  249. "/pages/subPackages/meetingroom/audit?id=" +
  250. item.id +
  251. "&readOnlyType=" +
  252. 0,
  253. });
  254. } else {
  255. console.log(123123);
  256. uni.navigateTo({
  257. url:
  258. "/pages/subPackages/meetingroom/confirm?id=" +
  259. item.id +
  260. "&readOnlyType=" +
  261. 0,
  262. success: (success) => {},
  263. fail: (fail) => {
  264. console.log(fail);
  265. },
  266. });
  267. }
  268. },
  269. },
  270. };
  271. </script>
  272. <style lang="scss" >
  273. .normal-button-app {
  274. font-size: 26rpx;
  275. padding: 13rpx 35rpx;
  276. border-radius: 30rpx;
  277. margin-left: 26rpx;
  278. // 紫色
  279. &.z-bt {
  280. border: 1px solid #6600ff;
  281. background: #ecdfff;
  282. color: #6600ff;
  283. }
  284. // 黄色
  285. &.y-bt {
  286. border: 1px solid #ffa913;
  287. background: #fff7e8;
  288. color: #ffa913;
  289. }
  290. //绿色
  291. &.l-bt {
  292. border: 1px solid #54d478;
  293. background: #9bd8ac4d;
  294. color: #54d478;
  295. }
  296. //红色
  297. &.r-bt {
  298. border: 1px solid #f61212;
  299. background: #ffebeb;
  300. color: #e80f0f;
  301. }
  302. // 灰色
  303. &.h-bt {
  304. border: 1px solid #888888;
  305. background: #fafafa;
  306. color: #555555;
  307. }
  308. }
  309. .white-card {
  310. padding: 30rpx;
  311. background: #fff;
  312. box-shadow: 0px 0px 30rpx 0px rgba(0, 0, 0, 0.1);
  313. border-radius: 20rpx;
  314. }
  315. .peripheral {
  316. .tabs-box {
  317. margin: 40rpx 0;
  318. .part-2 {
  319. overflow-y: auto;
  320. height: calc(100vh - 240rpx);
  321. box-sizing: border-box;
  322. .card-item {
  323. margin: 0 30rpx 15rpx;
  324. .card-top {
  325. // @include flex;
  326. display: flex;
  327. .card-left {
  328. display: flex;
  329. justify-content: space-between;
  330. flex-direction: column;
  331. width: 80%;
  332. .tit {
  333. width: 100%;
  334. font-size: 32rpx;
  335. color: #333;
  336. font-weight: bold;
  337. // @include line-over;
  338. margin-bottom: 30rpx;
  339. }
  340. .date {
  341. line-height: 1.4;
  342. font-size: 28rpx;
  343. color: #999;
  344. }
  345. }
  346. .card-right {
  347. align-self: flex-start;
  348. span {
  349. font-size: 28rpx;
  350. }
  351. .z {
  352. color: #976dec;
  353. }
  354. .y {
  355. color: #ffb41f;
  356. }
  357. .g {
  358. color: #54d478;
  359. }
  360. .h {
  361. color: #999999;
  362. }
  363. }
  364. }
  365. }
  366. .card-bottom {
  367. height: 80rpx;
  368. display: flex;
  369. justify-content: flex-end;
  370. align-items: center;
  371. }
  372. }
  373. }
  374. }
  375. </style>