info.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <template>
  2. <view :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" v-if="checkPermi(['zxBonus:bonus:add'])">
  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 mb24">
  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" >
  25. <view v-if="!ite.limit||ite.limit&&checkPermi([ite.limit])" @click="getTabFn(ite)" :class="{act:tabidx==ite.val}" :key="idx">{{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">
  33. <picker range-key='label' :range="jblist" @change='bindDateChangea'>
  34. <view :class="jbtxt?'':'f16 co80'">{{jbtxt || '选择界别'}}</view>
  35. </picker>
  36. <image :src="upimg" class="upimg"></image>
  37. </view>
  38. <view class="lbtabp" v-if="tabidx!='jfju'">
  39. <picker range-key='label' :range="dplist" @change='bindDateChangeb'>
  40. <view :class="dptxt?'':'f16 co80'">{{dptxt || '选择党派'}}</view>
  41. </picker>
  42. <image :src="upimg" class="upimg"></image>
  43. </view>
  44. <view class="lbtabp" @click="getReafFn" v-if="checkPermi(['member:info:assessmentScore'])&&tabidx!='jfju'">
  45. <image :src="reashimg" class="reashimg"></image>
  46. <view :class="dptxt?'':'f16 co80'">刷新排名</view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- 列表 -->
  52. <view class="mbox">
  53. <report-list :type="tabidx" :datalist="list" :wtdt="wtdt" :jcList="jcList" :khlxList='khlxList' :jflxList="jflxList" :dplist="dplist" :jblist='jblist' @getDetail="getDetail" @getTuiFn="getTuiFn"></report-list>
  54. </view>
  55. <view style="height: 100rpx;" v-if="checkPermi(['member:info:add'])&&tabidx=='lzxx'"></view>
  56. <view class="fwbtns" @click="getAddFn" v-if="checkPermi(['member:info:add'])&&tabidx=='lzxx'">履职档案</view>
  57. <!-- 弹窗 -->
  58. <pop-up :type='ptype' @getClose="getClose"></pop-up>
  59. </view>
  60. </template>
  61. <script>
  62. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  63. import {getInfojopList,getBonusListFn,getBonusDelFn,getInfojopDel,getinfoScoreFn} from "@/api/mine/report.js"
  64. import popUp from "@/work/components/popup/popup.vue"
  65. import reportList from "@/work/components/report/list.vue"
  66. import {getDictionaryFn} from "@/api/mine/register.js"
  67. export default{
  68. components:{reportList,popUp},
  69. data(){
  70. return{
  71. searchimg: require("@/work/static/images/search.png"),
  72. ccicoimg:require("@/work/static/images/ccico.png"),
  73. lbicoimg:require("@/work/static/images/lbico.png"),
  74. backimg:require("@/work/static/images/back.png"),
  75. upimg:require("@/work/static/images/up.png"),
  76. reashimg:require("@/work/static/images/sxicon.png"),
  77. backgroundColor:"#1D64E2",
  78. tabidx:'lzxx',
  79. tabList:[{tit:'履职信息',val:'lzxx',limit:'member:info:list'},{tit:'加分记录',val:'jfju',limit:'zxBonus:bonus:list'}
  80. ],
  81. nvaHeight:44,
  82. taztList:[{label:'是',value:'0'},{label:'否',value:'1'}],
  83. talbidx:'',
  84. datainfo:{
  85. talb:'',
  86. },
  87. ptype:'',//弹窗类型
  88. list:[],
  89. pageSize: 10,
  90. pageNum: 1,
  91. reachflag: true,
  92. wtdt:'',
  93. jblist:[],
  94. dplist:[],
  95. jbtxt:'',
  96. dptxt:"",
  97. jbval:'',
  98. dpval:'',
  99. title:'',
  100. jflxList:[],
  101. khlxList:[],
  102. jcList:[],
  103. userId:this.$store.state.user.userId,
  104. }
  105. },
  106. onUnload(){
  107. uni.$off('lzrefreshlist')
  108. },
  109. onLoad(e) {
  110. var that=this;
  111. this.getDataFn()
  112. this.init()
  113. uni.$on('lzrefreshlist', (e) => {
  114. console.log(23)
  115. that.getrefreshData()
  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('circles').then(res=>{
  133. if(res.code==200&&res.data.length){
  134. this.jblist = res.data.map(v => {
  135. return {
  136. label: v.dictLabel,
  137. value:v.dictValue
  138. }
  139. })
  140. }
  141. })
  142. // 党派
  143. getDictionaryFn('political_parties').then(res=>{
  144. if(res.code==200&&res.data.length){
  145. this.dplist = res.data.map(v => {
  146. return {
  147. label: v.dictLabel,
  148. value: v.dictValue
  149. }
  150. })
  151. }
  152. })
  153. //界别
  154. getDictionaryFn('circles').then(res=>{
  155. if(res.code==200&&res.data.length){
  156. this.jcList = res.data.map(v => {
  157. return {
  158. label: v.dictLabel,
  159. value: v.dictValue
  160. }
  161. })
  162. }
  163. })
  164. // 考核类型
  165. getDictionaryFn('check_type').then(res=>{
  166. if(res.code==200&&res.data.length){
  167. this.khlxList = res.data.map(v => {
  168. return {
  169. label: v.dictLabel,
  170. value: v.dictValue
  171. }
  172. })
  173. }
  174. })
  175. // 加分类型
  176. getDictionaryFn('bonus_type').then(res=>{
  177. if(res.code==200&&res.data.length){
  178. this.jflxList = res.data.map(v => {
  179. return {
  180. label: v.dictLabel,
  181. value: v.dictValue
  182. }
  183. })
  184. }
  185. })
  186. },
  187. getReafFn(){
  188. var that=this;
  189. getinfoScoreFn().then(res=>{
  190. if(res.code==200){
  191. that.getrefreshData()
  192. }
  193. })
  194. },
  195. getHeightFn(){
  196. var s=uni.getSystemInfoSync().statusBarHeight;
  197. let query = uni.createSelectorQuery().in(this);
  198. //需要给黄色区域设置一个id标识,在这里是demo
  199. query.select('.navbox').boundingClientRect(data => {
  200. this.nvaHeight =s? data.height:Number(data.height)-20//赋值,待会要用
  201. }).exec();
  202. },
  203. getClose(){
  204. this.ptype=""
  205. },
  206. getTabFn(ite){
  207. this.tabidx=ite.val;
  208. this.pageNum=1;
  209. this.list=[],
  210. this.reachflag=true;
  211. this.getDataFn()
  212. },
  213. getBack(){
  214. uni.navigateBack({
  215. delta:1
  216. })
  217. },
  218. bindDateChangea(e){
  219. var val=e.detail.value;
  220. this.jbtxt=this.jblist[val].label;
  221. this.jbval=this.jblist[val].value;
  222. this.getrefreshData()
  223. },
  224. bindDateChangeb(e){
  225. var val=e.detail.value;
  226. this.dptxt=this.dplist[val].label;
  227. this.dpval=this.dplist[val].value;
  228. this.getrefreshData()
  229. },
  230. getrefreshData(){
  231. this.pageNum=1;
  232. this.list=[];
  233. this.reachflag=true;
  234. this.getDataFn()
  235. },
  236. getConfirm(){
  237. this.pageNum=1;
  238. this.list=[];
  239. this.reachflag=true;
  240. this.getDataFn()
  241. },
  242. getChFn(){
  243. if(checkPermi(['zxBonus:bonus:add'])){
  244. this.$tab.navigateTo('/work/pages/report/addscore')
  245. }
  246. },
  247. getTuiFn(ite){
  248. var type=ite.type;
  249. var that=this;
  250. if(type=='del'){
  251. uni.showModal({
  252. title: '确认删除',
  253. content: "是否确认删除",
  254. cancelText: '取消',
  255. confirmText: '确认',
  256. success: function(res) {
  257. if (res.confirm) {
  258. if(that.tabidx=='jfju'){
  259. getBonusDelFn(ite.id).then(res=>{
  260. if(res.code==200){
  261. that.$toast('删除成功'),
  262. setTimeout(function(){
  263. that.getrefreshData()
  264. },1200)
  265. }
  266. })
  267. }else if(that.tabidx=='lzxx'){
  268. getInfojopDel(ite.id).then(res=>{
  269. if(res.code==200){
  270. that.$toast('删除成功'),
  271. setTimeout(function(){
  272. that.getrefreshData()
  273. },1200)
  274. }
  275. })
  276. }
  277. } else if (res.cancel) {
  278. }
  279. }
  280. });
  281. }else if(type=='edit'){
  282. if(this.tabidx=='jfju'){
  283. this.$tab.navigateTo('/work/pages/report/addscore?type=edit&id='+ite.id)
  284. }else if(this.tabidx=='lzxx'){
  285. this.$tab.navigateTo('/work/pages/report/mineinfo?type=edit&id='+ite.id)
  286. }
  287. }
  288. // this.ptype=ite.type
  289. },
  290. getAddFn(){
  291. this.$tab.navigateTo('/work/pages/report/mineinfo?type=add')
  292. },
  293. getDetail(data){
  294. this.$tab.navigateTo('/work/pages/report/details?id='+data)
  295. },
  296. getDataFn(){
  297. var params={
  298. pageSize:this.pageSize,
  299. pageNum: this.pageNum,
  300. }
  301. params.boundary=this.jbval
  302. params.partyAffiliation=this.dpval
  303. if(this.title){
  304. params.name=this.title
  305. }
  306. if(this.tabidx=='lzxx'){
  307. if(checkPermi(['member:info:alllist'])){
  308. }else {
  309. params.userId=this.userId
  310. }
  311. getInfojopList(params).then(res=>{
  312. if(res.code==200){
  313. if (res.rows.length < this.pageSize) {
  314. this.reachflag = false
  315. this.wtdt = '到底了~';
  316. } else {
  317. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  318. if (num < res.total) {
  319. this.reachflag = true
  320. this.wtdt = '上拉加载更多'
  321. } else {
  322. this.reachflag = false
  323. this.wtdt = '到底了~';
  324. }
  325. }
  326. if (this.pageNum == 1) {
  327. this.list = res.rows;
  328. } else {
  329. this.list = this.list.concat(res.rows)
  330. }
  331. }else{
  332. this.$toast(res.msg)
  333. }
  334. })
  335. }else if(this.tabidx=='jfju'){
  336. if(checkPermi(['zxBonus:bonus:alllist'])){
  337. }else {
  338. params.userId=this.userId
  339. }
  340. getBonusListFn(params).then(res=>{
  341. if(res.code==200){
  342. if (res.rows.length < this.pageSize) {
  343. this.reachflag = false
  344. this.wtdt = '到底了~';
  345. } else {
  346. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  347. if (num < res.total) {
  348. this.reachflag = true
  349. this.wtdt = '上拉加载更多'
  350. } else {
  351. this.reachflag = false
  352. this.wtdt = '到底了~';
  353. }
  354. }
  355. if (this.pageNum == 1) {
  356. this.list = res.rows;
  357. } else {
  358. this.list = this.list.concat(res.rows)
  359. }
  360. }else{
  361. this.$toast(res.msg)
  362. }
  363. })
  364. }
  365. },
  366. }
  367. }
  368. </script>
  369. <style scoped lang="scss">
  370. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;background-color: $com-cd3;
  371. .topl{width: 60rpx;height: 60rpx;display: flex;align-items: center;justify-content: center;
  372. image{width: 40rpx;height: 30rpx;}
  373. }
  374. .topr{display: flex;align-items: center;
  375. image{width: 26rpx;height: 26rpx;margin-right: 12rpx;}
  376. view{font-weight: 500;font-size: 26rpx;color: #FFFFFF;}
  377. }
  378. .tablists{
  379. overflow: auto;flex-wrap: nowrap;
  380. view{font-weight: bold;font-size: 26rpx;color: #FFFFFF;position: relative;flex: 0 0 auto;padding: 22rpx 24rpx;margin-right: 6rpx;box-sizing: border-box;
  381. &:last-child{margin-right: 0;}
  382. &.act{font-size: 30rpx;
  383. &::after{content: '';width: 62rpx;height: 10rpx;background: #FFFFFF;border-radius: 4rpx;left: 50%;margin-left: -31rpx;bottom: 0rpx;position: absolute;}
  384. }
  385. }
  386. }
  387. .lbtab{height: 114rpx;background: #FFFFFF;border-radius: 30rpx;padding-left: 24rpx;position: absolute;left:24rpx;right: 24rpx;bottom: -58rpx;
  388. .limg{width: 40rpx;height: 34rpx;margin-right: 10rpx;flex:0 0 auto;}
  389. .lbtabs{overflow: auto;flex-wrap: nowrap;flex: 1;
  390. .lbtabp{display: flex;align-items: center;flex:1;margin-right: 24rpx;}
  391. .upimg{width: 18rpx;height: 10rpx;}
  392. }
  393. }
  394. }
  395. .reashimg{width: 26rpx;height: 22rpx; margin-right: 18rpx;}
  396. .mbox{padding:58rpx 24rpx 28rpx;}
  397. .lbtabs /deep/ picker{padding: 0 18rpx;}
  398. </style>