info.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  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">
  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'])">
  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:[{tit:"123"}],
  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. mounted() {
  119. this.getHeightFn()
  120. },
  121. methods:{
  122. checkPermi, checkRole,
  123. init(){
  124. // 界别
  125. getDictionaryFn('circles').then(res=>{
  126. if(res.code==200&&res.data.length){
  127. this.jblist = res.data.map(v => {
  128. return {
  129. label: v.dictLabel,
  130. value:v.dictValue
  131. }
  132. })
  133. }
  134. })
  135. // 党派
  136. getDictionaryFn('political_parties').then(res=>{
  137. if(res.code==200&&res.data.length){
  138. this.dplist = res.data.map(v => {
  139. return {
  140. label: v.dictLabel,
  141. value: v.dictValue
  142. }
  143. })
  144. }
  145. })
  146. //界别
  147. getDictionaryFn('circles').then(res=>{
  148. if(res.code==200&&res.data.length){
  149. this.jcList = res.data.map(v => {
  150. return {
  151. label: v.dictLabel,
  152. value: v.dictValue
  153. }
  154. })
  155. }
  156. })
  157. // 考核类型
  158. getDictionaryFn('check_type').then(res=>{
  159. if(res.code==200&&res.data.length){
  160. this.khlxList = res.data.map(v => {
  161. return {
  162. label: v.dictLabel,
  163. value: v.dictValue
  164. }
  165. })
  166. }
  167. })
  168. // 加分类型
  169. getDictionaryFn('bonus_type').then(res=>{
  170. if(res.code==200&&res.data.length){
  171. this.jflxList = res.data.map(v => {
  172. return {
  173. label: v.dictLabel,
  174. value: v.dictValue
  175. }
  176. })
  177. }
  178. })
  179. },
  180. getReafFn(){
  181. var that=this;
  182. getinfoScoreFn().then(res=>{
  183. if(res.code==200){
  184. that.getrefreshData()
  185. }
  186. })
  187. },
  188. getHeightFn(){
  189. var s=uni.getSystemInfoSync().statusBarHeight;
  190. let query = uni.createSelectorQuery().in(this);
  191. //需要给黄色区域设置一个id标识,在这里是demo
  192. query.select('.navbox').boundingClientRect(data => {
  193. this.nvaHeight =s? data.height:Number(data.height)-20//赋值,待会要用
  194. }).exec();
  195. },
  196. getClose(){
  197. this.ptype=""
  198. },
  199. getTabFn(ite){
  200. this.tabidx=ite.val;
  201. this.pageNum=1;
  202. this.list=[],
  203. this.reachflag=true;
  204. this.getDataFn()
  205. },
  206. getBack(){
  207. uni.navigateBack({
  208. delta:1
  209. })
  210. },
  211. bindDateChangea(e){
  212. var val=e.detail.value;
  213. this.jbtxt=this.jblist[val].label;
  214. this.jbval=this.jblist[val].value;
  215. this.getrefreshData()
  216. },
  217. bindDateChangeb(e){
  218. var val=e.detail.value;
  219. this.dptxt=this.dplist[val].label;
  220. this.dpval=this.dplist[val].value;
  221. this.getrefreshData()
  222. },
  223. getrefreshData(){
  224. this.pageNum=1;
  225. this.list=[];
  226. this.reachflag=true;
  227. this.getDataFn()
  228. },
  229. getConfirm(){
  230. this.pageNum=1;
  231. this.list=[];
  232. this.reachflag=true;
  233. this.getDataFn()
  234. },
  235. getChFn(){
  236. if(checkPermi(['zxBonus:bonus:add'])){
  237. this.$tab.navigateTo('/work/pages/report/addscore')
  238. }
  239. },
  240. getTuiFn(ite){
  241. var type=ite.type;
  242. var that=this;
  243. if(type=='del'){
  244. uni.showModal({
  245. title: '确认删除',
  246. content: "是否确认删除",
  247. cancelText: '取消',
  248. confirmText: '确认',
  249. success: function(res) {
  250. if (res.confirm) {
  251. if(that.tabidx=='jfju'){
  252. getBonusDelFn(ite.id).then(res=>{
  253. if(res.code==200){
  254. that.$toast('删除成功'),
  255. setTimeout(function(){
  256. that.getrefreshData()
  257. },1200)
  258. }
  259. })
  260. }else if(that.tabidx=='lzxx'){
  261. getInfojopDel(ite.id).then(res=>{
  262. if(res.code==200){
  263. that.$toast('删除成功'),
  264. setTimeout(function(){
  265. that.getrefreshData()
  266. },1200)
  267. }
  268. })
  269. }
  270. } else if (res.cancel) {
  271. }
  272. }
  273. });
  274. }else if(type=='edit'){
  275. if(this.tabidx=='jfju'){
  276. this.$tab.navigateTo('/work/pages/report/addscore?type=edit&id='+ite.id)
  277. }else if(this.tabidx=='lzxx'){
  278. this.$tab.navigateTo('/work/pages/report/mineinfo?type=edit&id='+ite.id)
  279. }
  280. }
  281. // this.ptype=ite.type
  282. },
  283. getAddFn(){
  284. this.$tab.navigateTo('/work/pages/report/mineinfo?type=add')
  285. },
  286. getDetail(data){
  287. this.$tab.navigateTo('/work/pages/report/details?id='+data)
  288. },
  289. getDataFn(){
  290. var params={
  291. pageSize:this.pageSize,
  292. pageNum: this.pageNum,
  293. }
  294. params.boundary=this.jbval
  295. params.partyAffiliation=this.dpval
  296. if(this.title){
  297. params.name=this.title
  298. }
  299. if(this.tabidx=='lzxx'){
  300. if(checkPermi(['member:info:alllist'])){
  301. }else {
  302. params.userId=this.userId
  303. }
  304. getInfojopList(params).then(res=>{
  305. if(res.code==200){
  306. if (res.rows.length < this.pageSize) {
  307. this.reachflag = false
  308. this.wtdt = '到底了~';
  309. } else {
  310. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  311. if (num < res.total) {
  312. this.reachflag = true
  313. this.wtdt = '上拉加载更多'
  314. } else {
  315. this.reachflag = false
  316. this.wtdt = '到底了~';
  317. }
  318. }
  319. if (this.pageNum == 1) {
  320. this.list = res.rows;
  321. } else {
  322. this.list = this.list.concat(res.rows)
  323. }
  324. }else{
  325. this.$toast(res.msg)
  326. }
  327. })
  328. }else if(this.tabidx=='jfju'){
  329. if(checkPermi(['zxBonus:bonus:list'])){
  330. }else {
  331. params.userId=this.userId
  332. }
  333. getBonusListFn(params).then(res=>{
  334. if(res.code==200){
  335. if (res.rows.length < this.pageSize) {
  336. this.reachflag = false
  337. this.wtdt = '到底了~';
  338. } else {
  339. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  340. if (num < res.total) {
  341. this.reachflag = true
  342. this.wtdt = '上拉加载更多'
  343. } else {
  344. this.reachflag = false
  345. this.wtdt = '到底了~';
  346. }
  347. }
  348. if (this.pageNum == 1) {
  349. this.list = res.rows;
  350. } else {
  351. this.list = this.list.concat(res.rows)
  352. }
  353. }else{
  354. this.$toast(res.msg)
  355. }
  356. })
  357. }
  358. },
  359. }
  360. }
  361. </script>
  362. <style scoped lang="scss">
  363. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;background-color: $com-cd3;
  364. .topl{width: 60rpx;height: 60rpx;display: flex;align-items: center;justify-content: center;
  365. image{width: 40rpx;height: 30rpx;}
  366. }
  367. .topr{display: flex;align-items: center;
  368. image{width: 26rpx;height: 26rpx;margin-right: 12rpx;}
  369. view{font-weight: 500;font-size: 26rpx;color: #FFFFFF;}
  370. }
  371. .tablists{
  372. overflow: auto;flex-wrap: nowrap;
  373. 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;
  374. &:last-child{margin-right: 0;}
  375. &.act{font-size: 30rpx;
  376. &::after{content: '';width: 62rpx;height: 10rpx;background: #FFFFFF;border-radius: 4rpx;left: 50%;margin-left: -31rpx;bottom: 0rpx;position: absolute;}
  377. }
  378. }
  379. }
  380. .lbtab{height: 114rpx;background: #FFFFFF;border-radius: 30rpx;padding-left: 24rpx;position: absolute;left:24rpx;right: 24rpx;bottom: -58rpx;
  381. .limg{width: 40rpx;height: 34rpx;margin-right: 10rpx;flex:0 0 auto;}
  382. .lbtabs{overflow: auto;flex-wrap: nowrap;flex: 1;
  383. .lbtabp{display: flex;align-items: center;flex:1;margin-right: 24rpx;}
  384. .upimg{width: 18rpx;height: 10rpx;}
  385. }
  386. }
  387. }
  388. .reashimg{width: 26rpx;height: 22rpx; margin-right: 18rpx;}
  389. .mbox{padding:58rpx 24rpx 28rpx;}
  390. .lbtabs /deep/ picker{padding: 0 18rpx;}
  391. </style>