recordList.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. <template>
  2. <div class="bgColor">
  3. <div slot="content" class="scroll-wrapper">
  4. <div class="demo">
  5. <!-- <div class="header">留言列表</div> -->
  6. <cube-select
  7. class="stateSearch"
  8. v-model="searchType"
  9. :options="searchsType"
  10. @change="stateChange()"
  11. ></cube-select>
  12. <div class="scroll-list-wrap">
  13. <cube-scroll
  14. ref="scroll"
  15. :data="items"
  16. :options="options"
  17. @pulling-down="onPullingDown"
  18. @pulling-up="onPullingUp"
  19. >
  20. <div class="conentBox">
  21. <div class="conent" v-for="item in items">
  22. <div class="top" @click="operation(item)">
  23. <div class="head">
  24. <p>
  25. <i class="iconfont dsit-icon-test2 newPapir"></i>
  26. 来源:{{item.uud}}
  27. <span :class="{'btn':true,'isValid':item.isValid==0,'noValid':item.isValid==1}">{{item.isValid==0?'有效':'无效'}}</span>
  28. </p>
  29. </div>
  30. <div class="center">
  31. <p class="desc">
  32. <span class="fl">留言电话:</span>
  33. <span class="grayFont">{{item.ano}}</span>
  34. </p>
  35. </div>
  36. <div class="bottom">
  37. <span class="fl">处理状态: {{item.isExcute==0?'未处理':'已处理'}}</span>
  38. <span class="fr">留言时间:{{item.recTime}}</span>
  39. </div>
  40. </div>
  41. <div class="oper" v-show="operShow&&operId==item.id">
  42. <a class="operItem" href="javascript:;" v-if="item.isExcute==0" @click="toNewIncident(item.ano,item.id)">
  43. <i class="iconfont dsit-bianji2"></i>
  44. <span>新建事件</span>
  45. </a>
  46. <a class="operItem" href="javascript:;" v-if="item.isExcute==0" @click="changeValid(item)">
  47. <i class="iconfont dsit-false-circle"></i>
  48. <span>无效</span>
  49. </a>
  50. <a class="operItem" href="javascript:;" @click="showAudio(item.recFileName)">
  51. <i class="iconfont dsit-huifang"></i>
  52. <span>回放</span>
  53. </a>
  54. <a class="operItem" :href="'tel:'+item.ano">
  55. <i class="iconfont dsit-huibo"></i>
  56. <span>回拨</span>
  57. </a>
  58. </div>
  59. </div>
  60. <div class="wushuju" v-show="wushuju">
  61. <img src="./../../static/images/quesheng.png" alt>
  62. <p>暂无留言</p>
  63. </div>
  64. </div>
  65. <template v-if="customPullDown" slot="pulldown" slot-scope="props">
  66. <div
  67. v-if="props.pullDownRefresh"
  68. class="cube-pulldown-wrapper"
  69. :style="props.pullDownStyle"
  70. >
  71. <div
  72. v-show="props.beforePullDown"
  73. class="before-trigger"
  74. :style="{paddingTop: props.bubbleY + 'px'}"
  75. >
  76. <span :class="{rotate: props.bubbleY > pullDownRefreshThreshold - 80}">↓</span>
  77. </div>
  78. <div class="after-trigger" v-show="!props.beforePullDown">
  79. <div v-show="props.isPullingDown" class="loading">
  80. <cube-loading></cube-loading>
  81. </div>
  82. <div v-show="!props.isPullingDown" class="text">
  83. <span class="refresh-text">更新成功</span>
  84. </div>
  85. </div>
  86. </div>
  87. </template>
  88. </cube-scroll>
  89. </div>
  90. </div>
  91. </div>
  92. <load-ing v-show="!items.length&&!wushuju"></load-ing>
  93. <div class="mask" v-if="audioMask" @click="hideAudio()">
  94. <audio controls autoplay="autoplay" id="bgMusic">
  95. <source :src="audioSrc" type="audio/mpeg">
  96. </audio>
  97. </div>
  98. </div>
  99. </template>
  100. <script>
  101. import Vue from "vue";
  102. import CubePage from "../components/cube-page.vue";
  103. import SwitchOption from "../components/switch-option";
  104. import InputOption from "../components/input-option";
  105. import SelectOption from "../components/select-option";
  106. import { formatDate } from "./../components/js/date.js";
  107. import LoadIng from "./../views/loading.vue";
  108. import http from "../request/http"
  109. export default {
  110. data() {
  111. return {
  112. loginUser: JSON.parse(localStorage.getItem("loginUser")),
  113. items: [],
  114. pullDownRefresh: true,
  115. pullDownRefreshThreshold: 60,
  116. pullDownRefreshStop: 40,
  117. pullDownRefreshTxt: "Refresh success",
  118. pullUpLoad: true,
  119. pullUpLoadThreshold: 0,
  120. pullUpLoadMoreTxt: "加载更多",
  121. pullUpLoadNoMoreTxt: "没有更多数据",
  122. customPullDown: true,
  123. wushuju: false,
  124. audioSrc:'',//音频路径
  125. audioMask:false,//音频
  126. searchsType: [
  127. {
  128. text: "全部",
  129. value: "全部"
  130. },
  131. {
  132. text: "主校区",
  133. value: "主校区"
  134. },
  135. {
  136. text: "同济校区",
  137. value: "同济校区"
  138. },
  139. {
  140. text: "校园卡",
  141. value: "校园卡"
  142. }
  143. ],
  144. searchType: "全部",
  145. sum: 10,
  146. idx: 0,
  147. loadShow: true,
  148. operShow:false,//是否展示操作区域
  149. operId:'',//当前点击操作区域的id
  150. };
  151. },
  152. components: {
  153. CubePage,
  154. SwitchOption,
  155. InputOption,
  156. SelectOption,
  157. LoadIng
  158. },
  159. computed: {
  160. options() {
  161. return {
  162. pullDownRefresh: this.pullDownRefreshObj,
  163. pullUpLoad: this.pullUpLoadObj,
  164. scrollbar: true
  165. };
  166. },
  167. pullDownRefreshObj: function() {
  168. return this.pullDownRefresh
  169. ? {
  170. threshold: parseInt(this.pullDownRefreshThreshold),
  171. txt: this.pullDownRefreshTxt
  172. }
  173. : false;
  174. },
  175. pullUpLoadObj: function() {
  176. return this.pullUpLoad
  177. ? {
  178. threshold: parseInt(this.pullUpLoadThreshold),
  179. txt: {
  180. more: this.pullUpLoadMoreTxt,
  181. noMore: this.pullUpLoadNoMoreTxt
  182. }
  183. }
  184. : false;
  185. }
  186. },
  187. methods: {
  188. // 筛选
  189. stateChange() {
  190. var that = this;
  191. this.loadShow = true;
  192. that.items = [];
  193. that.idx = 0;
  194. that.sum = 10;
  195. that.getData();
  196. },
  197. // 获取列表数据
  198. getData() {
  199. var that = this;
  200. var postData=that.searchType=='全部'?{idx: that.idx,
  201. sum: that.sum,
  202. hjzxRecord:{}}:{idx: that.idx,
  203. sum: that.sum,
  204. hjzxRecord:{uud:that.searchType}};
  205. http.bpmFetchDataList('hjzxRecord',postData)
  206. .then(function(res) {
  207. if (res.data.list.length > 0) {
  208. that.wushuju = false;
  209. for (var i = 0; i < res.data.list.length; i++) {
  210. res.data.list[i].recTime = formatDate(
  211. new Date(res.data.list[i].recTime),
  212. "yyyy-MM-dd hh:mm"
  213. );
  214. }
  215. that.items = that.items.concat(res.data.list);
  216. } else if(res.data.list.length <= 0) {
  217. that.wushuju = true;
  218. }
  219. that.loadShow = false;
  220. });
  221. },
  222. // 展开操作区域
  223. operation(data) {
  224. if(data.id==this.operId){
  225. this.operShow=!this.operShow;
  226. }else{
  227. this.operShow=true;
  228. }
  229. this.operId=data.id;
  230. },
  231. // 新建事件
  232. toNewIncident(tel,id){
  233. this.$router.push({name:'NewIncident',params:{
  234. tel:tel,
  235. recordId:id
  236. }})
  237. },
  238. // 点击无效
  239. changeValid(data){
  240. var that=this;
  241. http.recordChangeValid({id:data.id,isValid:1,isExcute:1,field1:1})
  242. .then(function(res){
  243. if(res.data.status==200){
  244. that.dialog = that
  245. .$createDialog({
  246. type: "alert",
  247. title: "该信息状态更改为无效",
  248. content: "",
  249. onConfirm: (e, promptValue) => {
  250. that.$router.go(0)
  251. }
  252. }).show();
  253. }
  254. })
  255. },
  256. // 播放音频
  257. showAudio(src){
  258. this.audioMask=true;
  259. this.audioSrc=http.host+src;
  260. },
  261. // 隐藏音频组件
  262. hideAudio(){
  263. this.audioMask=false;
  264. },
  265. onPullingDown() {
  266. var that = this;
  267. that.idx = 0;
  268. that.sum = 10;
  269. that.items = [];
  270. setTimeout(() => {
  271. that.getData();
  272. }, 1000);
  273. },
  274. onPullingUp() {
  275. var that = this;
  276. that.idx = that.idx + 1;
  277. that.getData();
  278. },
  279. updatePullDownRefresh(val) {
  280. this.pullDownRefresh = val;
  281. },
  282. updatePullDownRefreshThreshold(val) {
  283. this.pullDownRefreshThreshold = val;
  284. },
  285. updatePullDownRefreshTxt(val) {
  286. this.pullDownRefreshTxt = val;
  287. },
  288. updatePullUpLoad(val) {
  289. this.pullUpLoad = val;
  290. },
  291. updatePullUpLoadThreshold(val) {
  292. this.pullUpLoadThreshold = val;
  293. },
  294. updatePullUpLoadMoreTxt(val) {
  295. this.pullUpLoadMoreTxt = val;
  296. },
  297. updatePullUpLoadNoMoreTxt(val) {
  298. this.pullUpLoadNoMoreTxt = val;
  299. },
  300. updateCustomPullDown(val) {
  301. this.customPullDown = val;
  302. },
  303. rebuildScroll() {
  304. Vue.nextTick(() => {
  305. this.$refs.scroll.destroy();
  306. this.$refs.scroll.initScroll();
  307. });
  308. }
  309. },
  310. created() {
  311. var that = this;
  312. // this.getParamsState();
  313. this.getData();
  314. }
  315. };
  316. </script>
  317. <style lang="stylus" rel="stylesheet/stylus" scoped>
  318. .scroll-list-wrap {
  319. /* height: 350px */
  320. height: 87vh;
  321. /* border: 1px solid rgba(0, 0, 0, 0.1) */
  322. border-radius: 5px;
  323. transform: rotate(0deg); // fix 子元素超出边框圆角部分不隐藏的问题
  324. overflow: hidden;
  325. padding-top: .88rem;
  326. }
  327. .foods-wrapper {
  328. .food-item {
  329. display: flex;
  330. /* padding: 18px */
  331. /* border-bottom: 1px solid rgba(7, 17, 27, 0.1) */
  332. /* border-top: 1px solid rgba(7, 17, 27, 0.1)!important */
  333. &:last-child {
  334. border-none();
  335. margin-bottom: 0;
  336. }
  337. .icon {
  338. flex: 0 0 57px;
  339. margin-right: 10px;
  340. }
  341. .food-content {
  342. flex: 1;
  343. .name {
  344. margin: 2px 0 8px 0;
  345. height: 14px;
  346. line-height: 14px;
  347. font-size: 14px;
  348. color: rgb(7, 17, 27);
  349. }
  350. .description, .extra {
  351. line-height: 10px;
  352. font-size: 10px;
  353. color: rgb(147, 153, 159);
  354. }
  355. .description {
  356. line-height: 12px;
  357. margin-bottom: 8px;
  358. }
  359. .extra {
  360. .count {
  361. margin-right: 12px;
  362. }
  363. }
  364. .price {
  365. font-weight: 700;
  366. line-height: 24px;
  367. .now {
  368. margin-right: 8px;
  369. font-size: 14px;
  370. color: rgb(240, 20, 20);
  371. }
  372. .old {
  373. text-decoration: line-through;
  374. font-size: 10px;
  375. color: rgb(147, 153, 159);
  376. }
  377. }
  378. .cartcontrol-wrapper {
  379. position: absolute;
  380. right: 0;
  381. bottom: 12px;
  382. .scroll-wrapper {
  383. .cube-pulldown-wrapper {
  384. .before-trigger {
  385. font-size: 30px;
  386. line-height: 30px;
  387. align-self: flex-end;
  388. span {
  389. display: inline-block;
  390. transition: all 0.3s;
  391. color: #666;
  392. &.rotate {
  393. transform: rotate(180deg);
  394. }
  395. }
  396. }
  397. .after-trigger {
  398. .refresh-text {
  399. color: grey;
  400. }
  401. }
  402. }
  403. }
  404. }
  405. }
  406. }
  407. }
  408. </style>
  409. <style lang='less' scoped>
  410. .cont {
  411. margin-top: 1.86rem;
  412. }
  413. .scroll-list-wrap {
  414. // padding-top: .88rem;
  415. }
  416. // .header {
  417. // width: 100%;
  418. // height: 0.88rem;
  419. // line-height: 0.88rem;
  420. // text-align: center;
  421. // color: #fff;
  422. // font-size: 0.37rem;
  423. // background: linear-gradient(#2e2f32, #414246);
  424. // position: fixed;
  425. // top: 0;
  426. // z-index: 6;
  427. // }
  428. .mask{
  429. width: 100%;
  430. height: 100%;
  431. position: fixed;
  432. top: 0;
  433. background: rgba(0,0,0,.5);
  434. z-index: 999;
  435. display: flex;
  436. align-items: center;
  437. justify-content: center;
  438. }
  439. .stateSearch {
  440. width: 100%;
  441. position: fixed;
  442. // top: 0.88rem;
  443. z-index: 6;
  444. }
  445. .bgColor {
  446. background-color: white;
  447. }
  448. .food-item {
  449. border-top: 0.16rem rgb(238, 238, 238) solid;
  450. }
  451. .food-content {
  452. border-top: 0.01rem rgb(223, 222, 222) solid;
  453. border-bottom: 0.01rem rgb(223, 222, 222) solid;
  454. }
  455. .cube-select {
  456. height: 0.88rem;
  457. line-height: 0.88rem;
  458. padding: 0 0.24rem;
  459. font-size: 0.36rem;
  460. color: #333333;
  461. border-bottom: 0.08rem solid #e5e5e5;
  462. }
  463. .title {
  464. display: flex;
  465. justify-content: space-between;
  466. height: 0.7rem;
  467. line-height: 0.7rem;
  468. border-top: 0.01rem rgb(223, 222, 222) solid;
  469. padding: 0 0.24rem;
  470. border-bottom: 0.01rem rgb(223, 222, 222) solid;
  471. }
  472. .title i {
  473. font-size: 0.32rem;
  474. color: #005395;
  475. }
  476. .title div:nth-child(1) {
  477. font-size: 0.32rem;
  478. }
  479. .title div:nth-child(1) span {
  480. display: inline-block;
  481. margin-left: 0.08rem;
  482. }
  483. .title div:nth-child(2) {
  484. padding: 0.05rem 0.3rem;
  485. /* border: 0.01rem rgb(0,0,255) solid; */
  486. border-radius: 16px;
  487. /* color: rgb(0,0,255); */
  488. height: 0.25rem;
  489. line-height: 0.25rem;
  490. margin-top: 0.15rem;
  491. font-size: 0.24rem;
  492. }
  493. .weishouli {
  494. color: #991f00;
  495. border: 0.01rem #991f00 solid;
  496. background-color: #f4e8e5;
  497. }
  498. .bushouli {
  499. color: #666666;
  500. background-color: #eeeeee;
  501. border: 0.01rem #666666 solid;
  502. }
  503. .chulizhong {
  504. color: #003057;
  505. background-color: #e5eaee;
  506. border: 0.01rem #003057 solid;
  507. }
  508. .daipingjia {
  509. color: #825b00;
  510. background-color: #f2eee5;
  511. border: 0.01rem #825b00 solid;
  512. }
  513. .yijiejue {
  514. color: #40a19c;
  515. background-color: #ebf5f5;
  516. border: 0.01rem #40a19c solid;
  517. }
  518. .yichehui {
  519. color: #48a843;
  520. background-color: #ecf6ec;
  521. border: 0.01rem #48a843 solid;
  522. }
  523. // .conent {
  524. // font-size: 0.28rem;
  525. // line-height: 0.39rem;
  526. // overflow: hidden;
  527. // display: -webkit-box;
  528. // -webkit-line-clamp: 2;
  529. // -webkit-box-orient: vertical;
  530. // word-break: break-all;
  531. // padding: 0 0.64rem;
  532. // margin: 0.24rem 0;
  533. // }
  534. .timeBox {
  535. display: flex;
  536. justify-content: space-between;
  537. font-size: 0.24rem;
  538. color: #999999;
  539. border-top: 0.01rem rgb(223, 222, 222) solid;
  540. height: 0.7rem;
  541. line-height: 0.7rem;
  542. padding: 0 0.24rem 0 0.64rem;
  543. }
  544. .wushuju {
  545. margin-top: 2.4rem;
  546. text-align: center;
  547. color: #999;
  548. }
  549. .wushuju img {
  550. height: 1.68re;
  551. }
  552. .conentBox {
  553. width: 100%;
  554. height: 100%;
  555. .conent {
  556. font-size: 0.32rem;
  557. font-weight: 400;
  558. line-height: 0.45rem;
  559. border-bottom: 0.16rem solid #e5e5e5;
  560. .head {
  561. border-bottom: 0.01rem solid #e6e6e6;
  562. p {
  563. padding: 0.24rem 0.48rem;
  564. i {
  565. color: #00559d;
  566. }
  567. .btn {
  568. float: right;
  569. }
  570. }
  571. }
  572. .center {
  573. color: #333333;
  574. border-bottom: 0.01rem solid #e6e6e6;
  575. padding: 0.24rem 0.48rem;
  576. p {
  577. &.desc{
  578. overflow: hidden;
  579. max-height: .88rem;
  580. }
  581. .grayFont {
  582. overflow-x: scroll;
  583. color: #666;
  584. }
  585. }
  586. }
  587. .bottom {
  588. overflow: hidden;
  589. line-height: 0.86rem;
  590. border-bottom: 0.01rem solid #e6e6e6;
  591. font-size: 0.24rem;
  592. color: #999;
  593. padding: 0 0.24rem 0 0.48rem;
  594. }
  595. .oper{
  596. width: 100%;
  597. height: 1.56rem;
  598. display: flex;
  599. justify-content: space-around;
  600. align-items: center;
  601. .operItem{
  602. text-align: center;
  603. color: #01559d;
  604. .iconfont{
  605. font-size: .5rem;
  606. }
  607. span{
  608. display: block;
  609. }
  610. }
  611. }
  612. }
  613. }
  614. </style>