list.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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. <view v-for="(ite,idx) in tabList" @click="getTabFn(ite.val)" :class="{act:tabidx==ite.val}" :key="idx">{{ite.tit}}</view>
  25. </view>
  26. <view style="height: 56rpx;"></view>
  27. <view class="lbtab flexc">
  28. <image :src="lbicoimg" class="limg"></image>
  29. <view class="lbtabs flexc">
  30. <view class="lbtabp" v-for="(ite,idx) in litablist" :key="idx">
  31. <picker range-key='label' :value="talbidx" :range="taztList" @change='bindDateChangea'>
  32. <view :class="datainfo.dqjz?'':'f16 co80'">{{datainfo.talb || ite.tit}}</view>
  33. </picker>
  34. <image :src="upimg" class="upimg"></image>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <!-- 列表 -->
  40. <view class="mbox">
  41. <meet-list :datalist="list" :wtdt="wtdt" :fylxlist='fylxlist' :type='tabidx' @getDetail="getDetail" @getReadFn="getReadFn" @getTuiFn="getTuiFn"></meet-list>
  42. </view>
  43. <view v-if="checkPermi(['zxConference:conference:add'])&&tabidx=='hyhd'||checkPermi(['zx:speak:add'])&&tabidx=='wdfy'">
  44. <view style="height: 100rpx;"></view>
  45. <view class="fwbtns" @click="getAddMeet" v-if="checkPermi(['zxConference:conference:add'])&&tabidx=='hyhd'">创建会议</view>
  46. <view class="fwbtns" @click="getAddSpeak" v-if="checkPermi(['zx:speak:add'])&&tabidx=='wdfy'">录入发言</view>
  47. </view>
  48. <!-- 弹窗 -->
  49. <pop-up :type='ptype' @getClose="getClose" @getupSubmit="getupSubmit" :qjlxlist="qjlxlist"></pop-up>
  50. </view>
  51. </template>
  52. <script>
  53. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  54. import {getMeetListFn,getSpeakListFn,getupdateReplyFn} from "@/api/mine/meeting.js"
  55. import popUp from "@/work/components/popup/popup.vue"
  56. import meetList from "@/work/components/meeting/list.vue"
  57. import {getDictionaryFn} from "@/api/mine/register.js"
  58. export default{
  59. components:{meetList,popUp},
  60. data(){
  61. return{
  62. searchimg: require("@/work/static/images/search.png"),
  63. ccicoimg:require("@/work/static/images/ccico.png"),
  64. lbicoimg:require("@/work/static/images/lbico.png"),
  65. backimg:require("@/work/static/images/back.png"),
  66. upimg:require("@/work/static/images/up.png"),
  67. backgroundColor:"#1D64E2",
  68. tabidx:'hyhd',
  69. // 会议活动 管理员看的{tit:'会议发言',val:'hyfy',limit:'zx:speak:list'},
  70. tabList:[{tit:'会议活动',val:'hyhd',limit:'zxConference:conference:add'},{tit:'我的发言',val:'wdfy',limit:'zx:speak:list'},{tit:'会议通知',val:'hytz',limit:'zxConference:conference:list'}],
  71. litablist:[{tit:'会议日期',val:0},],
  72. nvaHeight:44,
  73. talbList:[{},],
  74. taztList:[{label:'是',value:'0'},{label:'否',value:'1'}],
  75. talbidx:'',
  76. datainfo:{
  77. talb:'',
  78. },
  79. ptype:'',//弹窗类型
  80. list:[],
  81. pageSize: 10,
  82. pageNum: 1,
  83. reachflag: true,
  84. wtdt:'',
  85. qjlxlist:[],
  86. fylxlist:[],
  87. userId:this.$store.state.user.userId,
  88. id:'',
  89. title:'',//关键词
  90. }
  91. },
  92. onUnload(){
  93. uni.$off('refreshlist')
  94. },
  95. onLoad(e) {
  96. this.getDataFn()
  97. this.init()
  98. uni.$on('refreshlist', (e) => {
  99. this.getDataFn()
  100. })
  101. },
  102. mounted() {
  103. this.getHeightFn()
  104. },
  105. methods:{
  106. checkPermi, checkRole,
  107. // 请假类型
  108. init(){
  109. getDictionaryFn('leave').then(res=>{
  110. if(res.code==200&&res.data.length){
  111. this.qjlxlist = res.data.map(v => {
  112. return {
  113. text: v.dictLabel,
  114. value: v.dictValue
  115. }
  116. })
  117. }
  118. })
  119. // 发言类型
  120. getDictionaryFn('speak_type').then(res=>{
  121. if(res.code==200&&res.data.length){
  122. this.fylxlist = res.data.map(v => {
  123. return {
  124. label: v.dictLabel,
  125. value: v.dictValue
  126. }
  127. })
  128. }
  129. })
  130. },
  131. getConfirm(){
  132. this.pageNum=1;
  133. this.list=[];
  134. this.reachflag=true;
  135. this.getDataFn()
  136. },
  137. getHeightFn(){
  138. var s=uni.getSystemInfoSync().statusBarHeight;
  139. let query = uni.createSelectorQuery().in(this);
  140. //需要给黄色区域设置一个id标识,在这里是demo
  141. query.select('.navbox').boundingClientRect(data => {
  142. // this.nvaHeight =s? data.height:Number(data.height)-20//赋值,待会要用
  143. this.nvaHeight =Number(data.height)//赋值,待会要用
  144. }).exec();
  145. },
  146. getClose(){
  147. this.ptype=""
  148. },
  149. getTabFn(idx){
  150. this.tabidx=idx;
  151. this.pageNum=1;
  152. this.list=[],
  153. this.reachflag=true;
  154. // this.tabtype=ite.jd||"";
  155. this.getDataFn()
  156. },
  157. getBack(){
  158. uni.navigateBack({
  159. delta:1
  160. })
  161. },
  162. bindDateChangea(e){
  163. console.log(e,2)
  164. },
  165. getChFn(){
  166. this.$tab.navigateTo('/work/pages/case/tacheck')
  167. },
  168. getReadFn(e){
  169. if(this.tabidx=='hyhd'){
  170. this.$tab.navigateTo('/work/pages/meeting/readdetail?id='+e)
  171. }else if(this.tabidx=='hyfy'){
  172. this.$tab.navigateTo('/work/pages/meeting/speaklist?id='+e)
  173. }
  174. },
  175. getTuiFn(ite){
  176. if(ite.type=='hyqd'){
  177. this.$tab.navigateTo('/work/pages/meeting/signin?id='+ite.id)
  178. }else{
  179. this.ptype=ite.type;
  180. this.id=ite.id
  181. }
  182. },
  183. getDetail(data){
  184. this.$tab.navigateTo('/work/pages/case/details?id='+data)
  185. },
  186. getAddMeet(){
  187. this.$tab.navigateTo('/work/pages/meeting/add')
  188. },
  189. getAddSpeak(){
  190. this.$tab.navigateTo('/work/pages/meeting/addspeak')
  191. },
  192. getupSubmit(e){
  193. var that=this;
  194. var type=this.type;
  195. var params=JSON.parse(JSON.stringify(e))
  196. params.conferenceId=this.id;
  197. params.userId=this.userId;
  198. getupdateReplyFn(params).then(res=>{
  199. if(res.code==200){
  200. this.$toast("答复成功");
  201. setTimeout(function(){
  202. that.ptype='';
  203. that.pageNum=1;
  204. that.list=[];
  205. that.reachflag=true;
  206. that.getDataFn()
  207. },1200)
  208. }
  209. })
  210. },
  211. getDataFn(){
  212. var params={
  213. pageSize:this.pageSize,
  214. pageNum: this.pageNum,
  215. // visitType:3
  216. }
  217. params.conferenceTitle=this.title
  218. if(this.tabidx=='wdfy'){
  219. params.userId=this.userId;
  220. getSpeakListFn(params).then(res=>{
  221. if(res.code==200){
  222. if (res.rows.length < this.pageSize) {
  223. this.reachflag = false
  224. this.wtdt = '到底了~';
  225. } else {
  226. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  227. if (num < res.total) {
  228. this.reachflag = true
  229. this.wtdt = '上拉加载更多'
  230. } else {
  231. this.reachflag = false
  232. this.wtdt = '到底了~';
  233. }
  234. }
  235. if (this.pageNum == 1) {
  236. this.list = res.rows;
  237. } else {
  238. this.list = this.list.concat(res.rows)
  239. }
  240. }else{
  241. this.$toast(res.msg)
  242. }
  243. })
  244. }else if(this.tabidx=='hyfy'){
  245. getSpeakListFn(params).then(res=>{
  246. if(res.code==200){
  247. if (res.rows.length < this.pageSize) {
  248. this.reachflag = false
  249. this.wtdt = '到底了~';
  250. } else {
  251. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  252. if (num < res.total) {
  253. this.reachflag = true
  254. this.wtdt = '上拉加载更多'
  255. } else {
  256. this.reachflag = false
  257. this.wtdt = '到底了~';
  258. }
  259. }
  260. if (this.pageNum == 1) {
  261. this.list = res.rows;
  262. } else {
  263. this.list = this.list.concat(res.rows)
  264. }
  265. }else{
  266. this.$toast(res.msg)
  267. }
  268. })
  269. }else{
  270. if(this.tabidx=='hytz'){
  271. params.userId=this.userId
  272. }
  273. getMeetListFn(params).then(res=>{
  274. if(res.code==200){
  275. if (res.rows.length < this.pageSize) {
  276. this.reachflag = false
  277. this.wtdt = '到底了~';
  278. } else {
  279. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  280. if (num < res.total) {
  281. this.reachflag = true
  282. this.wtdt = '上拉加载更多'
  283. } else {
  284. this.reachflag = false
  285. this.wtdt = '到底了~';
  286. }
  287. }
  288. if (this.pageNum == 1) {
  289. this.list = res.rows;
  290. } else {
  291. this.list = this.list.concat(res.rows)
  292. }
  293. }else{
  294. this.$toast(res.msg)
  295. }
  296. })
  297. }
  298. },
  299. }
  300. }
  301. </script>
  302. <style scoped lang="scss">
  303. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;background-color: $com-cd3;
  304. .topl{width: 60rpx;height: 60rpx;display: flex;align-items: center;justify-content: center;
  305. image{width: 40rpx;height: 30rpx;}
  306. }
  307. .topr{display: flex;align-items: center;
  308. image{width: 26rpx;height: 26rpx;margin-right: 12rpx;}
  309. view{font-weight: 500;font-size: 26rpx;color: #FFFFFF;}
  310. }
  311. .tablists{
  312. overflow: auto;flex-wrap: nowrap;
  313. 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;
  314. &:last-child{margin-right: 0;}
  315. &.act{font-size: 30rpx;
  316. &::after{content: '';width: 62rpx;height: 10rpx;background: #FFFFFF;border-radius: 4rpx;left: 50%;margin-left: -31rpx;bottom: 0rpx;position: absolute;}
  317. }
  318. }
  319. }
  320. .lbtab{height: 114rpx;background: #FFFFFF;border-radius: 30rpx;padding-left: 24rpx;position: absolute;left:24rpx;right: 24rpx;bottom: -58rpx;
  321. .limg{width: 40rpx;height: 34rpx;margin-right: 10rpx;flex:0 0 auto;}
  322. .lbtabs{overflow: auto;flex-wrap: nowrap;
  323. .lbtabp{display: flex;align-items: center;flex: 0 0 auto;margin-right: 24rpx;}
  324. .upimg{width: 18rpx;height: 10rpx;}
  325. }
  326. }
  327. }
  328. .mbox{padding:58rpx 24rpx 28rpx;}
  329. .lbtabs /deep/ picker{padding: 0 18rpx;}
  330. </style>