info.vue 10 KB

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