list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  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'&&tabidx!='zxhd'">
  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'||tabidx=='zxhd'">
  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=='zxhd'">
  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=='zxhd'">创建活动</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'},{tit:'政协活动',val:'zxhd',limit:'zxActivity:activity:alllist'},
  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.pageNum=1;
  116. this.list=[];
  117. this.reachflag=true;
  118. this.getDataFn()
  119. })
  120. },
  121. // 上拉触底加载更多触发事件
  122. onReachBottom() {
  123. if (this.reachflag) {
  124. this.pageNum++
  125. this.getDataFn()
  126. }
  127. },
  128. mounted() {
  129. this.getHeightFn()
  130. },
  131. methods:{
  132. checkPermi, checkRole,
  133. init(){
  134. // 请假类型
  135. getDictionaryFn('leave').then(res=>{
  136. if(res.code==200&&res.data.length){
  137. this.qjlxlist = res.data.map(v => {
  138. return {
  139. text: v.dictLabel,
  140. value: v.dictValue
  141. }
  142. })
  143. this.aqjlxlist = res.data.map(v => {
  144. return {
  145. label: v.dictLabel,
  146. value: v.dictValue
  147. }
  148. })
  149. }
  150. })
  151. // 发言类型
  152. getDictionaryFn('speak_type').then(res=>{
  153. if(res.code==200&&res.data.length){
  154. this.fylxlist = res.data.map(v => {
  155. return {
  156. label: v.dictLabel,
  157. value: v.dictValue
  158. }
  159. })
  160. }
  161. })
  162. //活动类型
  163. getDictionaryFn('activity_type').then(res=>{
  164. if(res.code==200&&res.data.length){
  165. this.hdlxlist = res.data.map(v => {
  166. return {
  167. label: v.dictLabel,
  168. value: v.dictValue
  169. }
  170. })
  171. }
  172. })
  173. },
  174. bindDateChangeb(e){
  175. var val=e.detail.value;
  176. this.time=val;
  177. this.getConfirm()
  178. },
  179. getConfirm(){
  180. this.pageNum=1;
  181. this.list=[];
  182. this.reachflag=true;
  183. this.getDataFn()
  184. },
  185. getHeightFn(){
  186. var s=uni.getSystemInfoSync().statusBarHeight;
  187. let query = uni.createSelectorQuery().in(this);
  188. //需要给黄色区域设置一个id标识,在这里是demo
  189. query.select('.navbox').boundingClientRect(data => {
  190. // this.nvaHeight =s? data.height:Number(data.height)-20//赋值,待会要用
  191. this.nvaHeight =Number(data.height)//赋值,待会要用
  192. }).exec();
  193. },
  194. getClose(){
  195. this.ptype=""
  196. },
  197. getTabFn(idx){
  198. this.tabidx=idx;
  199. this.pageNum=1;
  200. this.list=[],
  201. this.reachflag=true;
  202. // this.tabtype=ite.jd||"";
  203. this.getDataFn()
  204. },
  205. getBack(){
  206. uni.navigateBack({
  207. delta:1
  208. })
  209. },
  210. bindDateChangea(e){
  211. console.log(e,2)
  212. },
  213. getReadFn(e){
  214. if(this.tabidx=='hyhd'||this.tabidx=='hdtz'||this.tabidx=='zxhd'){
  215. this.$tab.navigateTo('/work/pages/meeting/readdetail?id='+e+'&a='+this.tabidx)
  216. }else if(this.tabidx=='hyfy'){
  217. this.$tab.navigateTo('/work/pages/meeting/speaklist?id='+e)
  218. }
  219. },
  220. getTuiFn(ite){
  221. if(ite.type=='hyqd'){
  222. this.$tab.navigateTo('/work/pages/meeting/signin?id='+ite.id)
  223. }else{
  224. this.codeQr=ite.item.conferenceQr
  225. this.ptype=ite.type;
  226. this.id=ite.id
  227. }
  228. },
  229. getDetail(data){
  230. var type=this.tabidx;
  231. if(type=='hyhd'||type=='hytz'){
  232. this.$tab.navigateTo('/work/pages/meeting/details?id='+data+"&pt="+type)
  233. }else if(type=='wdfy'||type=='hyfy'){
  234. this.$tab.navigateTo('/work/pages/meeting/speakdetails?id='+data)
  235. }else if(type=='hdtz'||type=='zxhd'){
  236. this.$tab.navigateTo('/work/pages/meeting/activedetails?id='+data+"&pt="+type)
  237. }
  238. },
  239. getAddMeet(){
  240. this.$tab.navigateTo('/work/pages/meeting/add')
  241. },
  242. getAddSpeak(){
  243. this.$tab.navigateTo('/work/pages/meeting/addspeak')
  244. },
  245. getAddActive(){
  246. this.$tab.navigateTo('/work/pages/meeting/addactive')
  247. },
  248. getupSubmit(e){
  249. var that=this;
  250. var type=this.type;
  251. var params=JSON.parse(JSON.stringify(e))
  252. params.userId=this.userId;
  253. if(this.tabidx=='hdtz'){
  254. params.activityId=this.id;
  255. getzxActivityReplyFn(params).then(res=>{
  256. if(res.code==200){
  257. this.$toast("答复成功");
  258. setTimeout(function(){
  259. that.ptype='';
  260. that.pageNum=1;
  261. that.list=[];
  262. that.reachflag=true;
  263. that.getDataFn()
  264. },1200)
  265. }
  266. })
  267. }else {
  268. params.conferenceId=this.id;
  269. getupdateReplyFn(params).then(res=>{
  270. if(res.code==200){
  271. this.$toast("答复成功");
  272. setTimeout(function(){
  273. that.ptype='';
  274. that.pageNum=1;
  275. that.list=[];
  276. that.reachflag=true;
  277. that.getDataFn()
  278. },1200)
  279. }
  280. })
  281. }
  282. },
  283. getDataFn(){
  284. var params={
  285. pageSize:this.pageSize,
  286. pageNum: this.pageNum,
  287. // visitType:3
  288. }
  289. if(this.tabidx=='wdfy'){
  290. params.userId=this.userId;
  291. params.conferenceTitle=this.title
  292. getSpeakListFn(params).then(res=>{
  293. if(res.code==200){
  294. if (res.rows.length < this.pageSize) {
  295. this.reachflag = false
  296. this.wtdt = '到底了~';
  297. } else {
  298. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  299. if (num < res.total) {
  300. this.reachflag = true
  301. this.wtdt = '上拉加载更多'
  302. } else {
  303. this.reachflag = false
  304. this.wtdt = '到底了~';
  305. }
  306. }
  307. if (this.pageNum == 1) {
  308. this.list = res.rows;
  309. } else {
  310. this.list = this.list.concat(res.rows)
  311. }
  312. }else{
  313. this.$toast(res.msg)
  314. }
  315. })
  316. }else if(this.tabidx=='hyfy'){
  317. params.conferenceTitle=this.title
  318. getSpeakListFn(params).then(res=>{
  319. if(res.code==200){
  320. if (res.rows.length < this.pageSize) {
  321. this.reachflag = false
  322. this.wtdt = '到底了~';
  323. } else {
  324. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  325. if (num < res.total) {
  326. this.reachflag = true
  327. this.wtdt = '上拉加载更多'
  328. } else {
  329. this.reachflag = false
  330. this.wtdt = '到底了~';
  331. }
  332. }
  333. if (this.pageNum == 1) {
  334. this.list = res.rows;
  335. } else {
  336. this.list = this.list.concat(res.rows)
  337. }
  338. }else{
  339. this.$toast(res.msg)
  340. }
  341. })
  342. }else if(this.tabidx=='hdtz'||this.tabidx=='zxhd'){
  343. if(this.time){
  344. params.activityDate=this.time
  345. }
  346. if(this.tabidx=='hdtz'){
  347. params.userId=this.userId
  348. }
  349. params.activityTitle=this.title
  350. getzxActivityListFn(params).then(res=>{
  351. if(res.code==200){
  352. if (res.rows.length < this.pageSize) {
  353. this.reachflag = false
  354. this.wtdt = '到底了~';
  355. } else {
  356. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  357. if (num < res.total) {
  358. this.reachflag = true
  359. this.wtdt = '上拉加载更多'
  360. } else {
  361. this.reachflag = false
  362. this.wtdt = '到底了~';
  363. }
  364. }
  365. if (this.pageNum == 1) {
  366. this.list = res.rows;
  367. } else {
  368. this.list = this.list.concat(res.rows)
  369. }
  370. }else{
  371. this.$toast(res.msg)
  372. }
  373. })
  374. }else{
  375. if(this.tabidx=='hytz'){
  376. params.userId=this.userId
  377. }
  378. if(this.time){
  379. params.conferenceDate=this.time
  380. }
  381. params.conferenceTitle=this.title
  382. getMeetListFn(params).then(res=>{
  383. if(res.code==200){
  384. if (res.rows.length < this.pageSize) {
  385. this.reachflag = false
  386. this.wtdt = '到底了~';
  387. } else {
  388. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  389. if (num < res.total) {
  390. this.reachflag = true
  391. this.wtdt = '上拉加载更多'
  392. } else {
  393. this.reachflag = false
  394. this.wtdt = '到底了~';
  395. }
  396. }
  397. if (this.pageNum == 1) {
  398. this.list = res.rows;
  399. } else {
  400. this.list = this.list.concat(res.rows)
  401. }
  402. }else{
  403. this.$toast(res.msg)
  404. }
  405. })
  406. }
  407. },
  408. }
  409. }
  410. </script>
  411. <style scoped lang="scss">
  412. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;background-color: $com-cd3;
  413. .topl{width: 60rpx;height: 60rpx;display: flex;align-items: center;justify-content: center;
  414. image{width: 40rpx;height: 30rpx;}
  415. }
  416. .topr{display: flex;align-items: center;
  417. image{width: 26rpx;height: 26rpx;margin-right: 12rpx;}
  418. view{font-weight: 500;font-size: 26rpx;color: #FFFFFF;}
  419. }
  420. .tablists{
  421. overflow: auto;flex-wrap: nowrap;
  422. 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;
  423. &:last-child{margin-right: 0;}
  424. &.act{font-size: 30rpx;
  425. &::after{content: '';width: 62rpx;height: 10rpx;background: #FFFFFF;border-radius: 4rpx;left: 50%;margin-left: -31rpx;bottom: 0rpx;position: absolute;}
  426. }
  427. }
  428. }
  429. .lbtab{height: 114rpx;background: #FFFFFF;border-radius: 30rpx;padding-left: 24rpx;position: absolute;left:24rpx;right: 24rpx;bottom: -58rpx;
  430. .limg{width: 40rpx;height: 34rpx;margin-right: 10rpx;flex:0 0 auto;}
  431. .lbtabs{overflow: auto;flex-wrap: nowrap;
  432. .lbtabp{display: flex;align-items: center;flex: 0 0 auto;margin-right: 24rpx;}
  433. .upimg{width: 18rpx;height: 10rpx;}
  434. }
  435. }
  436. }
  437. .mbox{padding:58rpx 24rpx 28rpx;}
  438. .lbtabs /deep/ picker{padding: 0 18rpx;}
  439. </style>