list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. <template>
  2. <view class="pb50" :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <!-- <uni-nav-bar color="#ffffff" rightWidth="150rpx" title="政协提案" @clickLeft="getBack" @clickRight="getChFn" :background-color="backgroundColor" :border="false" statusBar='true' fixed="true">
  5. <block slot="left">
  6. <view class="topl">
  7. <image :src="backimg" ></image>
  8. </view>
  9. </block>
  10. <block slot="right">
  11. <view class="topr">
  12. <image :src="ccicoimg"></image>
  13. <view>提案查重</view>
  14. </view>
  15. </block>
  16. </uni-nav-bar> -->
  17. <view class="plr12 mt18">
  18. <view class="search flex0 mb10">
  19. <image :src="searchimg"></image>
  20. <input placeholder="输入关键字进行查询" v-model="title" @confirm="getConfirm"/>
  21. </view>
  22. </view>
  23. <view class="tablists flexc mb20">
  24. <block v-for="(ite,idx) in tabList" :key="idx">
  25. <view v-if="!ite.limit||ite.limit&&checkPermi([ite.limit])" @click="getTabFn(ite.val)" :class="{act:tabidx==ite.val}" >{{ite.tit}}</view>
  26. </block>
  27. </view>
  28. <view style="height: 56rpx;"></view>
  29. <view class="lbtab flexc">
  30. <image :src="lbicoimg" class="limg"></image>
  31. <view class="lbtabs flexc">
  32. <view class="lbtabp" v-if="tabidx!='hdtz'">
  33. <picker mode="date" :value="time" @change='bindDateChangeb'>
  34. <view :class="time?'':'f16 co80'">{{time || "会议日期"}}</view>
  35. </picker>
  36. <image :src="upimg" class="upimg"></image>
  37. </view>
  38. <view class="lbtabp" v-if="tabidx=='hdtz'">
  39. <picker mode="date" :value="time" @change='bindDateChangeb'>
  40. <view :class="time?'':'f16 co80'">{{time || "活动日期"}}</view>
  41. </picker>
  42. <image :src="upimg" class="upimg"></image>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <!-- 列表 -->
  48. <view class="mbox">
  49. <meet-list :datalist="list" :wtdt="wtdt" :hdlxlist="hdlxlist" :fylxlist='fylxlist' :qjlxlist="aqjlxlist" :type='tabidx' @getDetail="getDetail" @getReadFn="getReadFn" @getTuiFn="getTuiFn"></meet-list>
  50. </view>
  51. <view v-if="checkPermi(['zxConference:conference:add'])&&tabidx=='hyhd'||checkPermi(['zx:speak:add'])&&tabidx=='wdfy'||checkPermi(['zxActivity:activity:add'])&&tabidx=='hdtz'">
  52. <view style="height: 100rpx;"></view>
  53. <view class="fwbtns" @click="getAddMeet" v-if="checkPermi(['zxConference:conference:add'])&&tabidx=='hyhd'">创建会议</view>
  54. <view class="fwbtns" @click="getAddSpeak" v-if="checkPermi(['zx:speak:add'])&&tabidx=='wdfy'">录入发言</view>
  55. <view class="fwbtns" @click="getAddActive" v-if="checkPermi(['zxActivity:activity:add'])&&tabidx=='hdtz'">创建活动</view>
  56. <!-- -->
  57. </view>
  58. <!-- 弹窗 -->
  59. <pop-up :type='ptype' :codeQr="codeQr" @getClose="getClose" @getupSubmit="getupSubmit" :qjlxlist="qjlxlist"></pop-up>
  60. </view>
  61. </template>
  62. <script>
  63. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  64. import {getMeetListFn,getSpeakListFn,getupdateReplyFn,getzxActivityListFn,getzxActivityReplyFn} from "@/api/mine/meeting.js"
  65. import popUp from "@/work/components/popup/popup.vue"
  66. import meetList from "@/work/components/meeting/list.vue"
  67. import {getDictionaryFn} from "@/api/mine/register.js"
  68. export default{
  69. components:{meetList,popUp},
  70. data(){
  71. return{
  72. searchimg: require("@/work/static/images/search.png"),
  73. ccicoimg:require("@/work/static/images/ccico.png"),
  74. lbicoimg:require("@/work/static/images/lbico.png"),
  75. backimg:require("@/work/static/images/back.png"),
  76. upimg:require("@/work/static/images/up.png"),
  77. backgroundColor:"#1D64E2",
  78. tabidx:'hytz',
  79. // 会议活动 管理员看的{tit:'会议发言',val:'hyfy',limit:'zx:speak:list'},
  80. tabList:[{tit:'会议通知',val:'hytz',limit:'zxConference:conference:list'},{tit:'会议活动',val:'hyhd',limit:'zxConference:conference:alllist'},{tit:'我的发言',val:'wdfy',limit:'zx:speak:list'},{tit:'会议发言',val:'hyfy',limit:'zx:speak:alllist'},
  81. {tit:'活动通知',val:'hdtz',limit:'zxActivity:activity:list'}
  82. ],
  83. litablist:[{tit:'会议日期',val:0},],
  84. nvaHeight:44,
  85. talbList:[{},],
  86. taztList:[{label:'是',value:'0'},{label:'否',value:'1'}],
  87. talbidx:'',
  88. datainfo:{
  89. talb:'',
  90. },
  91. ptype:'',//弹窗类型
  92. list:[],
  93. pageSize: 10,
  94. pageNum: 1,
  95. reachflag: true,
  96. wtdt:'',
  97. qjlxlist:[],
  98. fylxlist:[],
  99. hdlxlist:[],
  100. aqjlxlist:[],
  101. userId:this.$store.state.user.userId,
  102. id:'',
  103. title:'',//关键词
  104. time:"",
  105. codeQr:""
  106. }
  107. },
  108. onUnload(){
  109. uni.$off('refreshlist')
  110. },
  111. onLoad(e) {
  112. this.getDataFn()
  113. this.init()
  114. uni.$on('refreshlist', (e) => {
  115. this.getDataFn()
  116. })
  117. },
  118. // 上拉触底加载更多触发事件
  119. onReachBottom() {
  120. if (this.reachflag) {
  121. this.pageNum++
  122. this.getDataFn()
  123. }
  124. },
  125. mounted() {
  126. this.getHeightFn()
  127. },
  128. methods:{
  129. checkPermi, checkRole,
  130. init(){
  131. // 请假类型
  132. getDictionaryFn('leave').then(res=>{
  133. if(res.code==200&&res.data.length){
  134. this.qjlxlist = res.data.map(v => {
  135. return {
  136. text: v.dictLabel,
  137. value: v.dictValue
  138. }
  139. })
  140. this.aqjlxlist = res.data.map(v => {
  141. return {
  142. label: v.dictLabel,
  143. value: v.dictValue
  144. }
  145. })
  146. }
  147. })
  148. // 发言类型
  149. getDictionaryFn('speak_type').then(res=>{
  150. if(res.code==200&&res.data.length){
  151. this.fylxlist = res.data.map(v => {
  152. return {
  153. label: v.dictLabel,
  154. value: v.dictValue
  155. }
  156. })
  157. }
  158. })
  159. //活动类型
  160. getDictionaryFn('activity_type').then(res=>{
  161. if(res.code==200&&res.data.length){
  162. this.hdlxlist = res.data.map(v => {
  163. return {
  164. label: v.dictLabel,
  165. value: v.dictValue
  166. }
  167. })
  168. }
  169. })
  170. },
  171. bindDateChangeb(e){
  172. var val=e.detail.value;
  173. this.time=val;
  174. this.getConfirm()
  175. },
  176. getConfirm(){
  177. this.pageNum=1;
  178. this.list=[];
  179. this.reachflag=true;
  180. this.getDataFn()
  181. },
  182. getHeightFn(){
  183. var s=uni.getSystemInfoSync().statusBarHeight;
  184. let query = uni.createSelectorQuery().in(this);
  185. //需要给黄色区域设置一个id标识,在这里是demo
  186. query.select('.navbox').boundingClientRect(data => {
  187. // this.nvaHeight =s? data.height:Number(data.height)-20//赋值,待会要用
  188. this.nvaHeight =Number(data.height)//赋值,待会要用
  189. }).exec();
  190. },
  191. getClose(){
  192. this.ptype=""
  193. },
  194. getTabFn(idx){
  195. this.tabidx=idx;
  196. this.pageNum=1;
  197. this.list=[],
  198. this.reachflag=true;
  199. // this.tabtype=ite.jd||"";
  200. this.getDataFn()
  201. },
  202. getBack(){
  203. uni.navigateBack({
  204. delta:1
  205. })
  206. },
  207. bindDateChangea(e){
  208. console.log(e,2)
  209. },
  210. getReadFn(e){
  211. if(this.tabidx=='hyhd'||this.tabidx=='hdtz'){
  212. this.$tab.navigateTo('/work/pages/meeting/readdetail?id='+e+'&a='+this.tabidx)
  213. }else if(this.tabidx=='hyfy'){
  214. this.$tab.navigateTo('/work/pages/meeting/speaklist?id='+e)
  215. }
  216. },
  217. getTuiFn(ite){
  218. if(ite.type=='hyqd'){
  219. this.$tab.navigateTo('/work/pages/meeting/signin?id='+ite.id)
  220. }else{
  221. this.codeQr=ite.item.conferenceQr
  222. this.ptype=ite.type;
  223. this.id=ite.id
  224. }
  225. },
  226. getDetail(data){
  227. var type=this.tabidx;
  228. if(type=='hyhd'||type=='hytz'){
  229. this.$tab.navigateTo('/work/pages/meeting/details?id='+data+"&pt="+type)
  230. }else if(type=='wdfy'||type=='hyfy'){
  231. this.$tab.navigateTo('/work/pages/meeting/speakdetails?id='+data)
  232. }else if(type=='hdtz'){
  233. this.$tab.navigateTo('/work/pages/meeting/activedetails?id='+data)
  234. }
  235. },
  236. getAddMeet(){
  237. this.$tab.navigateTo('/work/pages/meeting/add')
  238. },
  239. getAddSpeak(){
  240. this.$tab.navigateTo('/work/pages/meeting/addspeak')
  241. },
  242. getAddActive(){
  243. this.$tab.navigateTo('/work/pages/meeting/addactive')
  244. },
  245. getupSubmit(e){
  246. var that=this;
  247. var type=this.type;
  248. var params=JSON.parse(JSON.stringify(e))
  249. params.userId=this.userId;
  250. if(this.tabidx=='hdtz'){
  251. params.activityId=this.id;
  252. getzxActivityReplyFn(params).then(res=>{
  253. if(res.code==200){
  254. this.$toast("答复成功");
  255. setTimeout(function(){
  256. that.ptype='';
  257. that.pageNum=1;
  258. that.list=[];
  259. that.reachflag=true;
  260. that.getDataFn()
  261. },1200)
  262. }
  263. })
  264. }else {
  265. params.conferenceId=this.id;
  266. getupdateReplyFn(params).then(res=>{
  267. if(res.code==200){
  268. this.$toast("答复成功");
  269. setTimeout(function(){
  270. that.ptype='';
  271. that.pageNum=1;
  272. that.list=[];
  273. that.reachflag=true;
  274. that.getDataFn()
  275. },1200)
  276. }
  277. })
  278. }
  279. },
  280. getDataFn(){
  281. var params={
  282. pageSize:this.pageSize,
  283. pageNum: this.pageNum,
  284. // visitType:3
  285. }
  286. if(this.tabidx=='wdfy'){
  287. params.userId=this.userId;
  288. params.conferenceTitle=this.title
  289. getSpeakListFn(params).then(res=>{
  290. if(res.code==200){
  291. if (res.rows.length < this.pageSize) {
  292. this.reachflag = false
  293. this.wtdt = '到底了~';
  294. } else {
  295. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  296. if (num < res.total) {
  297. this.reachflag = true
  298. this.wtdt = '上拉加载更多'
  299. } else {
  300. this.reachflag = false
  301. this.wtdt = '到底了~';
  302. }
  303. }
  304. if (this.pageNum == 1) {
  305. this.list = res.rows;
  306. } else {
  307. this.list = this.list.concat(res.rows)
  308. }
  309. }else{
  310. this.$toast(res.msg)
  311. }
  312. })
  313. }else if(this.tabidx=='hyfy'){
  314. params.conferenceTitle=this.title
  315. getSpeakListFn(params).then(res=>{
  316. if(res.code==200){
  317. if (res.rows.length < this.pageSize) {
  318. this.reachflag = false
  319. this.wtdt = '到底了~';
  320. } else {
  321. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  322. if (num < res.total) {
  323. this.reachflag = true
  324. this.wtdt = '上拉加载更多'
  325. } else {
  326. this.reachflag = false
  327. this.wtdt = '到底了~';
  328. }
  329. }
  330. if (this.pageNum == 1) {
  331. this.list = res.rows;
  332. } else {
  333. this.list = this.list.concat(res.rows)
  334. }
  335. }else{
  336. this.$toast(res.msg)
  337. }
  338. })
  339. }else if(this.tabidx=='hdtz'){
  340. if(this.time){
  341. params.activityDate=this.time
  342. }
  343. params.activityTitle=this.title
  344. getzxActivityListFn(params).then(res=>{
  345. if(res.code==200){
  346. if (res.rows.length < this.pageSize) {
  347. this.reachflag = false
  348. this.wtdt = '到底了~';
  349. } else {
  350. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  351. if (num < res.total) {
  352. this.reachflag = true
  353. this.wtdt = '上拉加载更多'
  354. } else {
  355. this.reachflag = false
  356. this.wtdt = '到底了~';
  357. }
  358. }
  359. if (this.pageNum == 1) {
  360. this.list = res.rows;
  361. } else {
  362. this.list = this.list.concat(res.rows)
  363. }
  364. }else{
  365. this.$toast(res.msg)
  366. }
  367. })
  368. }else{
  369. if(this.tabidx=='hytz'){
  370. params.userId=this.userId
  371. }
  372. if(this.time){
  373. params.conferenceDate=this.time
  374. }
  375. params.conferenceTitle=this.title
  376. getMeetListFn(params).then(res=>{
  377. if(res.code==200){
  378. if (res.rows.length < this.pageSize) {
  379. this.reachflag = false
  380. this.wtdt = '到底了~';
  381. } else {
  382. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  383. if (num < res.total) {
  384. this.reachflag = true
  385. this.wtdt = '上拉加载更多'
  386. } else {
  387. this.reachflag = false
  388. this.wtdt = '到底了~';
  389. }
  390. }
  391. if (this.pageNum == 1) {
  392. this.list = res.rows;
  393. } else {
  394. this.list = this.list.concat(res.rows)
  395. }
  396. }else{
  397. this.$toast(res.msg)
  398. }
  399. })
  400. }
  401. },
  402. }
  403. }
  404. </script>
  405. <style scoped lang="scss">
  406. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;background-color: $com-cd3;
  407. .topl{width: 60rpx;height: 60rpx;display: flex;align-items: center;justify-content: center;
  408. image{width: 40rpx;height: 30rpx;}
  409. }
  410. .topr{display: flex;align-items: center;
  411. image{width: 26rpx;height: 26rpx;margin-right: 12rpx;}
  412. view{font-weight: 500;font-size: 26rpx;color: #FFFFFF;}
  413. }
  414. .tablists{
  415. overflow: auto;flex-wrap: nowrap;
  416. view{font-weight: bold;font-size: 26rpx;color: #FFFFFF;position: relative;flex: 1 0 auto;padding: 22rpx 24rpx;margin-right: 6rpx;box-sizing: border-box;text-align: center;
  417. &:last-child{margin-right: 0;}
  418. &.act{font-size: 30rpx;
  419. &::after{content: '';width: 62rpx;height: 10rpx;background: #FFFFFF;border-radius: 4rpx;left: 50%;margin-left: -31rpx;bottom: 0rpx;position: absolute;}
  420. }
  421. }
  422. }
  423. .lbtab{height: 114rpx;background: #FFFFFF;border-radius: 30rpx;padding-left: 24rpx;position: absolute;left:24rpx;right: 24rpx;bottom: -58rpx;
  424. .limg{width: 40rpx;height: 34rpx;margin-right: 10rpx;flex:0 0 auto;}
  425. .lbtabs{overflow: auto;flex-wrap: nowrap;
  426. .lbtabp{display: flex;align-items: center;flex: 0 0 auto;margin-right: 24rpx;}
  427. .upimg{width: 18rpx;height: 10rpx;}
  428. }
  429. }
  430. }
  431. .mbox{padding:58rpx 24rpx 28rpx;}
  432. .lbtabs /deep/ picker{padding: 0 18rpx;}
  433. </style>