unitList.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <template>
  2. <view :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <view class="plr12 mt18">
  5. <view class="search flex0 mb10">
  6. <image :src="searchimg"></image>
  7. <input placeholder="输入关键字进行查询" v-model="title" @confirm="getConfirm"/>
  8. </view>
  9. </view>
  10. <view class="tablists flexc mb20">
  11. <block v-for="(ite,idx) in tabList" >
  12. <view v-if="!ite.limit||ite.limit&&checkPermi([ite.limit])" @click="getTabFn(ite)" :class="{act:tabidx==ite.val}" :key="idx">{{ite.tit}}</view>
  13. </block>
  14. </view>
  15. <view style="height: 56rpx;"></view>
  16. <view class="lbtab flexc">
  17. <image :src="lbicoimg" class="limg"></image>
  18. <view class="lbtabs flexc">
  19. <view class="lbtabp" v-if="tabidx=='tabl'">
  20. <picker range-key='label' :value="tajdidx" :range="tajdlist" @change='bindDateChanged'>
  21. <view :class="tajd?'':'f16 co80'">{{tajd || "办理进度"}}</view>
  22. </picker>
  23. <image :src="upimg" class="upimg"></image>
  24. </view>
  25. <view class="lbtabp" v-if="tabidx=='tabl'">
  26. <picker range-key='label' :value="talbidx" :range="talxList" @change='bindDateChangea'>
  27. <view :class="talx?'':'f16 co80'">{{talx || "提案类型"}}</view>
  28. </picker>
  29. <image :src="upimg" class="upimg"></image>
  30. </view>
  31. <view class="lbtabp">
  32. <picker mode="date" fields="year" range-key='label' :value="talbidx" @change='bindDateChangeb'>
  33. <view :class="year?'':'f16 co80'">{{year || "选择年份"}}</view>
  34. </picker>
  35. <image :src="upimg" class="upimg"></image>
  36. </view>
  37. </view>
  38. <view class="czbtns" @click='getResetFn'>重置</view>
  39. </view>
  40. </view>
  41. <!-- 列表 -->
  42. <view class="mbox">
  43. <single-list :datalist="list" :wtdt="wtdt" :sqtajdlist="sqtajdlist" :ztlxlist="ztlxlist" :tajdlist='tajdlist' :type='tabidx' @getDetail="getDetail" @getTuiFn="getTuiFn"></single-list>
  44. </view>
  45. <!-- 弹窗 -->
  46. <pop-up :type='ptype' :blfsList="matterList" :blcdlist="blcdlist" :mycdlist="mycdlist" @getClose="getClose" @getupSubmit="getupSubmit"></pop-up>
  47. </view>
  48. </template>
  49. <script>
  50. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  51. import {getInfounitListFn,getInfoReplywyFn,getInfoReplyFn} from "@/api/mine/case.js"
  52. import {getsqmyInfounitListFn,getsqmyReplyFn,getsqmyInfoReplywyFn} from "@/api/mine/sqmyInfo.js"
  53. import popUp from "@/work/components/popup/popup.vue"
  54. import singleList from "@/work/components/single/list.vue"
  55. import {getDictionaryFn} from "@/api/mine/register.js"
  56. export default{
  57. components:{singleList,popUp},
  58. data(){
  59. return{
  60. searchimg: require("@/work/static/images/search.png"),
  61. ccicoimg:require("@/work/static/images/ccico.png"),
  62. lbicoimg:require("@/work/static/images/lbico.png"),
  63. backimg:require("@/work/static/images/back.png"),
  64. upimg:require("@/work/static/images/up.png"),
  65. backgroundColor:"#1D64E2",
  66. tabidx:'tabl',
  67. tabtype:'',//进度查询
  68. // {tit:'征集通知',val:0}, 提案催办 目前看所有
  69. tabList:[
  70. {tit:'提案办理',val:'tabl',limit:'proposalInfo:info:unitList'},
  71. {tit:'社情办理',val:'sqtabl',limit:'sqmyInfo:info:unitList'},
  72. ],
  73. litablist:[{tit:'提案类别',val:0},{tit:'提案类型',val:1},{tit:'单位类型',val:2},{tit:'选择年份',val:3},],
  74. // {tit:'开始日期',val:1},{tit:'结束日期',val:2},
  75. // "proposalProgress":"提案进度(0:提交提案,1:提案审查,2:提案立案,3:提案交办,4:办理提案,5:提案反馈,6:办结审核,7:已办结) ",
  76. nvaHeight:44,
  77. talbList:[{},],
  78. taztList:[{label:'是',value:'0'},{label:'否',value:'1'}],
  79. talxList:[{label:'大会提案',value:'0'},{label:'平时提案',value:'1'}],
  80. dwlxList:[{label:'答复单位',value:'1'},{label:'主办单位',value:'2'},{label:'协办单位',value:'3'}],
  81. talbidx:'',
  82. tajd:'',
  83. tajdidx:'',
  84. tajdid:'',
  85. datainfo:{
  86. talb:'',
  87. },
  88. ptype:'',//弹窗类型
  89. list:[],
  90. pageSize: 10,
  91. pageNum: 1,
  92. reachflag: true,
  93. wtdt:'',
  94. tajdlist:[],
  95. talbid:'',//提案类别id
  96. talx:'',//提案类型
  97. talxid:'',
  98. year:'',//提案时间
  99. title:'',
  100. matterList:[],
  101. blcdlist:[],
  102. mycdlist:[],
  103. ztlxlist:[],
  104. sqtajdlist:[],
  105. id:'',
  106. userId:this.$store.state.user.userId,
  107. deptId:this.$store.state.user.deptId,
  108. iteinfo:'',//选择 的数据
  109. }
  110. },
  111. onUnload(){
  112. uni.$off('refreshlist')
  113. },
  114. onLoad(e) {
  115. this.getDataFn()
  116. this.init()
  117. uni.$on('refreshlist', (e) => {
  118. this.pageNum=1;
  119. this.list=[];
  120. this.reachflag=true;
  121. this.getDataFn()
  122. })
  123. },
  124. // 上拉触底加载更多触发事件
  125. onReachBottom() {
  126. if (this.reachflag) {
  127. this.pageNum++
  128. this.getDataFn()
  129. }
  130. },
  131. mounted() {
  132. this.getHeightFn()
  133. },
  134. methods:{
  135. checkPermi, checkRole,
  136. // 提案状态
  137. init(){
  138. getDictionaryFn('proposal_progress').then(res=>{
  139. if(res.code==200&&res.data.length){
  140. this.tajdlist = res.data.map(v => {
  141. return {
  142. label: v.dictLabel,
  143. value: v.dictValue
  144. }
  145. })
  146. }
  147. })
  148. // 社情
  149. getDictionaryFn('sqmy_jd').then(res=>{
  150. if(res.code==200){
  151. this.sqtajdlist = res.data.map(v => {
  152. return {
  153. label: v.dictLabel,
  154. value: v.dictValue
  155. }
  156. })
  157. }
  158. })
  159. // 办理方式
  160. getDictionaryFn('negotiation_mode').then(res=>{
  161. if(res.code==200&&res.data.length){
  162. this.matterList = res.data.map(v => {
  163. return {
  164. label: v.dictLabel,
  165. value: v.dictValue
  166. }
  167. })
  168. }
  169. })
  170. // 办理程度degree
  171. getDictionaryFn('degree').then(res=>{
  172. if(res.code==200&&res.data.length){
  173. this.blcdlist = res.data.map(v => {
  174. return {
  175. text: v.dictLabel,
  176. value: v.dictValue
  177. }
  178. })
  179. }
  180. })
  181. // 满意程度
  182. getDictionaryFn('member_satisfaction').then(res=>{
  183. if(res.code==200&&res.data.length){
  184. this.mycdlist = res.data.map(v => {
  185. return {
  186. text: v.dictLabel,
  187. value: v.dictValue
  188. }
  189. })
  190. }
  191. })
  192. // 主题类型
  193. getDictionaryFn('sqmy_topic_type').then(res=>{
  194. if(res.code==200&&res.data.length){
  195. this.ztlxlist = res.data.map(v => {
  196. return {
  197. label: v.dictLabel,
  198. value: v.dictValue
  199. }
  200. })
  201. }
  202. })
  203. },
  204. getConfirm(){
  205. this.pageNum=1;
  206. this.list=[];
  207. this.reachflag=true;
  208. this.getDataFn()
  209. },
  210. getResetFn(){
  211. var tab=this.tabidx;
  212. if(tab=='tabl'){
  213. this.tajd='';
  214. this.talx='';
  215. this.tajdid="";
  216. }
  217. this.year='';
  218. this.title='';
  219. this.getConfirm()
  220. },
  221. getTuiFn(data){
  222. var sh=data.sh;
  223. this.id=data.id;
  224. this.iteinfo=data.ite;
  225. var type=data.type;
  226. this.ptype=type
  227. },
  228. getupSubmit(e){
  229. var that=this;
  230. var type=this.ptype;
  231. if(type=='dffk'||type=='dwdf'){
  232. var params=JSON.parse(JSON.stringify(e))
  233. if(that.tabidx=='tabl'){
  234. params.proposalId=this.id
  235. if(this.iteinfo.proposalProgress==7){
  236. params.cbdwdfwy=params.content;
  237. getInfoReplywyFn(params).then(res=>{
  238. if(res.code==200){
  239. this.$toast("答复反馈成功");
  240. setTimeout(function(){
  241. that.ptype='';
  242. that.pageNum=1;
  243. that.list=[];
  244. that.reachflag=true;
  245. that.getDataFn()
  246. },1200)
  247. }
  248. })
  249. }else{
  250. getInfoReplyFn(params).then(res=>{
  251. if(res.code==200){
  252. this.$toast("答复反馈成功");
  253. setTimeout(function(){
  254. that.ptype='';
  255. that.pageNum=1;
  256. that.list=[];
  257. that.reachflag=true;
  258. that.getDataFn()
  259. },1200)
  260. }
  261. })
  262. }
  263. }else{
  264. params.sqmyId=this.id
  265. if(this.iteinfo.sqmyProgress==7){
  266. params.cbdwdfwy=params.content;
  267. getsqmyInfoReplywyFn(params).then(res=>{
  268. if(res.code==200){
  269. this.$toast("答复反馈成功");
  270. setTimeout(function(){
  271. that.ptype='';
  272. that.pageNum=1;
  273. that.list=[];
  274. that.reachflag=true;
  275. that.getDataFn()
  276. },1200)
  277. }
  278. })
  279. }else{
  280. getsqmyReplyFn(params).then(res=>{
  281. if(res.code==200){
  282. this.$toast("答复反馈成功");
  283. setTimeout(function(){
  284. that.ptype='';
  285. that.pageNum=1;
  286. that.list=[];
  287. that.reachflag=true;
  288. that.getDataFn()
  289. },1200)
  290. }
  291. })
  292. }
  293. }
  294. }else if(type=='tacb'){
  295. var params=JSON.parse(JSON.stringify(e))
  296. params.scoreId=this.id
  297. params.urgeType=1
  298. getInfourgeFn(params).then(res=>{
  299. if(res.code==200){
  300. this.$toast("催办成功");
  301. setTimeout(function(){
  302. that.ptype='';
  303. that.pageNum=1;
  304. that.list=[];
  305. that.reachflag=true;
  306. that.getDataFn()
  307. },1200)
  308. }
  309. })
  310. }
  311. },
  312. getHeightFn(){
  313. var s=uni.getSystemInfoSync().statusBarHeight;
  314. let query = uni.createSelectorQuery().in(this);
  315. //需要给黄色区域设置一个id标识,在这里是demo
  316. query.select('.navbox').boundingClientRect(data => {
  317. this.nvaHeight =Number(data.height)//赋值,待会要用
  318. }).exec();
  319. },
  320. getClose(){
  321. this.ptype=""
  322. },
  323. getTabFn(ite){
  324. this.tabidx=ite.val;
  325. this.pageNum=1;
  326. this.list=[],
  327. this.reachflag=true;
  328. this.getDataFn()
  329. },
  330. getBack(){
  331. uni.navigateBack({
  332. delta:1
  333. })
  334. },
  335. getrefreshData(){
  336. this.pageNum=1;
  337. this.list=[];
  338. this.reachflag=true;
  339. this.getDataFn()
  340. },
  341. bindDateChangea(e){
  342. var val=e.detail.value;
  343. this.talx=this.talxList[val].label;
  344. this.talxid=this.talxList[val].value;
  345. this.getrefreshData()
  346. },
  347. bindDateChangeb(e){
  348. var val=e.detail.value;
  349. this.year=val;
  350. this.getrefreshData()
  351. },
  352. bindDateChanged(e){
  353. var val=e.detail.value;
  354. this.tajd=this.tajdlist[val].label;
  355. this.tajdid=this.tajdlist[val].value;
  356. this.getrefreshData()
  357. },
  358. getDetail(data){
  359. if(this.tabidx=='tabl'){
  360. this.$tab.navigateTo('/work/pages/case/details?id='+data+'&f=tabl')
  361. }else{
  362. this.$tab.navigateTo('/work/pages/sqmyInfo/details?id='+data+'&f=tabl')
  363. }
  364. },
  365. getDataFn(){
  366. var tab=this.tabidx;
  367. var params={
  368. pageSize:this.pageSize,
  369. pageNum: this.pageNum,
  370. }
  371. if(this.title){
  372. params.title=this.title
  373. }
  374. if(this.year){
  375. params.year=this.year
  376. }
  377. if(this.tabidx=='sqtabl'){
  378. params.sqmyProgress=this.tajdid;
  379. getsqmyInfounitListFn(params).then(res=>{
  380. if(res.code==200){
  381. if (res.rows.length < this.pageSize) {
  382. this.reachflag = false
  383. this.wtdt = '到底了~';
  384. } else {
  385. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  386. if (num < res.total) {
  387. this.reachflag = true
  388. this.wtdt = '上拉加载更多'
  389. } else {
  390. this.reachflag = false
  391. this.wtdt = '到底了~';
  392. }
  393. }
  394. if (this.pageNum == 1) {
  395. this.list = res.rows;
  396. } else {
  397. this.list = this.list.concat(res.rows)
  398. }
  399. }else{
  400. this.$toast(res.msg)
  401. }
  402. })
  403. }else if(this.tabidx=='tabl'){
  404. params.proposalProgress=this.tajdid;
  405. if(this.talx){
  406. params.proposalType=this.talxid
  407. }
  408. getInfounitListFn(params).then(res=>{
  409. if(res.code==200){
  410. if (res.rows.length < this.pageSize) {
  411. this.reachflag = false
  412. this.wtdt = '到底了~';
  413. } else {
  414. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  415. if (num < res.total) {
  416. this.reachflag = true
  417. this.wtdt = '上拉加载更多'
  418. } else {
  419. this.reachflag = false
  420. this.wtdt = '到底了~';
  421. }
  422. }
  423. if (this.pageNum == 1) {
  424. this.list = res.rows;
  425. } else {
  426. this.list = this.list.concat(res.rows)
  427. }
  428. }else{
  429. this.$toast(res.msg)
  430. }
  431. })
  432. }
  433. }
  434. }
  435. }
  436. </script>
  437. <style scoped lang="scss">
  438. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;background-color: $com-cd3;
  439. .topl{width: 60rpx;height: 60rpx;display: flex;align-items: center;justify-content: center;
  440. image{width: 40rpx;height: 30rpx;}
  441. }
  442. .topr{display: flex;align-items: center;
  443. image{width: 26rpx;height: 26rpx;margin-right: 12rpx;}
  444. view{font-weight: 500;font-size: 26rpx;color: #FFFFFF;}
  445. }
  446. .tablists{
  447. overflow: auto;flex-wrap: nowrap;
  448. 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;
  449. &:last-child{margin-right: 0;}
  450. &.act{font-size: 30rpx;
  451. &::after{content: '';width: 62rpx;height: 10rpx;background: #FFFFFF;border-radius: 4rpx;left: 50%;margin-left: -31rpx;bottom: 0rpx;position: absolute;}
  452. }
  453. }
  454. }
  455. .lbtab{height: 114rpx;background: #FFFFFF;border-radius: 30rpx;padding-left: 24rpx;position: absolute;left:24rpx;right: 24rpx;bottom: -58rpx;
  456. .limg{width: 40rpx;height: 34rpx;margin-right: 10rpx;flex:0 0 auto;}
  457. .lbtabs{overflow: auto;flex-wrap: nowrap;flex: 1;
  458. .lbtabp{display: flex;align-items: center;flex: 1 0 auto;margin-right: 24rpx;}
  459. .upimg{width: 18rpx;height: 10rpx;}
  460. }
  461. }
  462. }
  463. .mbox{padding:58rpx 24rpx 28rpx;}
  464. .lbtabs /deep/ picker{padding: 0 18rpx;}
  465. </style>