index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <div class="problem-item">
  3. <NavBar />
  4. <div class="page-container">
  5. <van-search v-model="query.searchKey" class="van-hairline--bottom" placeholder="请输入搜索关键词" />
  6. <org-tree v-model="query.orgId" @change="refreshData"></org-tree>
  7. <div class="search-flex">
  8. <select-cell
  9. style="border-right: 1px solid #f5f5f5;"
  10. title="状态"
  11. :isAll="true"
  12. :border="false"
  13. v-model="query.confirmStatus"
  14. :data-list="getDictItem('question_confirm_status')"
  15. @change="refreshData"/>
  16. <div class="btn-box">
  17. <van-button plain type="warning" size="small" @click="clickAdd">录入介绍信</van-button>
  18. </div>
  19. </div>
  20. <div class="card-list">
  21. <Scroll
  22. ref="Scroll"
  23. @refresh="refreshData"
  24. @loadMore="getDataList"
  25. :pullup="pullup">
  26. <empty v-if="!dataList || dataList.length === 0" />
  27. <card v-else v-for="(v,i) in dataList" :key="v.id">
  28. <van-cell :title="v.orgName">
  29. <template #extra>
  30. <van-button
  31. style="width: 60px;"
  32. v-if="v.orgId==orgId && v.confirmStatus==0"
  33. hairline
  34. size="mini"
  35. type="info"
  36. @click.stop="clickItem(v.id,'confirm')">
  37. 隐患确认
  38. </van-button>
  39. <van-button
  40. style="width: 60px;"
  41. v-else-if="v.submitorId== id && v.confirmStatus==1"
  42. hairline
  43. size="mini"
  44. type="info"
  45. @click.stop="clickItem(v.id,'confirmDissent')">
  46. 异议审批
  47. </van-button>
  48. <van-button
  49. style="width: 60px;"
  50. v-else-if="v.orgId==orgId && v.confirmStatus==2 && v.reformStatus!=11"
  51. hairline
  52. size="mini"
  53. type="info"
  54. @click.stop="clickItem(v.id,'reform')">
  55. 整改
  56. </van-button>
  57. <van-button
  58. style="display: block;width: 60px;"
  59. v-else
  60. hairline
  61. size="mini"
  62. type="info"
  63. @click.stop="clickItem(v.id,'detail')">
  64. 详情
  65. </van-button>
  66. </template>
  67. <template #label>
  68. <div class="info-box">
  69. <div class="info-desc">创建机构:<span>{{v.questionDesc}}</span></div>
  70. <div class="info-desc">接待机构:<span>{{v.questionDesc}}</span></div>
  71. <div class="info-item">介绍信有效期:<span>{{v.submitTime}}~{{v.submitTime}}</span></div>
  72. </div>
  73. </template>
  74. </van-cell>
  75. </card>
  76. </Scroll>
  77. </div>
  78. </div>
  79. </div>
  80. </template>
  81. <script>
  82. import NavBar from '@/components/NavBar'
  83. import OrgTree from '@/components/orgTree'
  84. import Scroll from '@/components/scroll/scroll'
  85. import Card from '@/components/card'
  86. import dateCell from '@/components/dateCell'
  87. import selectCell from '@/components/selectCell'
  88. import {dataList} from './api'
  89. import {mapGetters} from "vuex";
  90. import {formatDate} from "@/filters/filter";
  91. export default {
  92. components: {
  93. NavBar,
  94. OrgTree,
  95. Scroll,
  96. Card,
  97. dateCell,
  98. selectCell,
  99. },
  100. data() {
  101. return {
  102. query:{
  103. submitTime:`${formatDate(new Date(),'YYYY-MM-DD')}`,
  104. orgId:null,
  105. confirmStatus:null,
  106. pageSize:10,
  107. pageNum:1,
  108. },
  109. planList:[],
  110. loading:false,
  111. finished:false,
  112. columns:[
  113. {
  114. field: "index",
  115. key: "index",
  116. title: "序号",
  117. width: 50,
  118. align: "center",
  119. renderBodyCell: ({ row, column, rowIndex }, h) => {
  120. return ++rowIndex;
  121. },
  122. },
  123. { field: "orgName", key: "a", title: "单位名称",align: "center"},
  124. { field: "shouldFinish", key: "b", title: "应完成数", align: "center" },
  125. { field: "finish", key: "c", title: "已完成数",align: "center" },
  126. { field: "finishRate", key: "d", title: "完成率", align: "center" },
  127. ],
  128. dataList:[],
  129. pullup:false,
  130. dicts:['question_confirm_status','question_reform_status']
  131. }
  132. },
  133. mounted() {
  134. this.initData();
  135. },
  136. computed:{
  137. ...mapGetters(['orgId','id','dictionary']),
  138. },
  139. methods: {
  140. clickAdd(){
  141. this.$router.push({
  142. path:'/introAdd',
  143. query:{type:'add'}
  144. });
  145. },
  146. refreshData(){
  147. this.pullup = true;
  148. this.query.pageNum = 1;
  149. this.total = 0;
  150. this.dataList = [];
  151. this.getDataList();
  152. },
  153. //初始化数据
  154. initData(){
  155. this.query.orgId = this.orgId;
  156. this.query.submitTime = formatDate(new Date(),'YYYY-MM-DD');
  157. this.getDataList();
  158. },
  159. //获取数据列表
  160. getDataList(){
  161. if(!this.query.orgId) return this.$toast('请选择机构');
  162. if( this.dataList.length !== 0 && this.dataList.length >= this.total) {
  163. this.pullup = false;
  164. this.$toast('已加载完毕');
  165. return;
  166. }
  167. let data = {
  168. ...this.query,
  169. }
  170. dataList(data).then(res=>{
  171. if(res.total === '0'){
  172. this.pullup = false;
  173. this.$toast('已加载完毕');
  174. return
  175. }
  176. this.total = res.total;
  177. if(this.dataList.length < res.total) {
  178. this.dataList = [...this.dataList,...res.rows] ;
  179. this.pullup = true;
  180. this.query.pageNum++;
  181. this.$refs.Scroll.refresh();
  182. }
  183. })
  184. },
  185. clickItem(id,type){
  186. this.$router.push({
  187. path:'/problemDetail',
  188. query:{id,type}
  189. });
  190. }
  191. }
  192. }
  193. </script>
  194. <style lang="scss">
  195. .card {
  196. >.van-cell{
  197. padding: 0;
  198. }
  199. }
  200. .van-cell-group{
  201. margin-bottom: 20px;
  202. }
  203. .van-cell-group:last-child{
  204. margin-bottom: 0;
  205. }
  206. .vue-table-root{
  207. tr,td,th{
  208. font-size: 25px!important;
  209. color:#666!important;
  210. }
  211. }
  212. </style>
  213. <style lang="scss" scoped>
  214. .problem-item{
  215. }
  216. .app-container{
  217. }
  218. .card-list{
  219. padding:0 20px 20px 20px;
  220. height: calc(100vh - 514px);
  221. overflow: auto;
  222. }
  223. .card-num{
  224. display: flex;
  225. align-items: center;
  226. font-size: 28px;
  227. color: #009dff;
  228. }
  229. .search-flex{
  230. display: flex;
  231. align-items: center;
  232. justify-content: space-between;
  233. border-bottom: 1px solid #f5f5f5;
  234. >div{
  235. width: 50%;
  236. }
  237. }
  238. .btn-box{
  239. width: 100%;
  240. height: 100%;
  241. padding: 30px;
  242. background-color: #fff;
  243. display: flex;
  244. align-items: center;
  245. justify-content: center;
  246. }
  247. .info-box{
  248. color:#555;
  249. }
  250. .info-desc{
  251. padding-top: 10px;
  252. min-height: 50px;
  253. line-height: 36px;
  254. max-height: 250px;
  255. display: -webkit-box;
  256. -webkit-line-clamp: 3; /* 限制显示为3行 */
  257. -webkit-box-orient: vertical;
  258. overflow: hidden;
  259. text-overflow: ellipsis;
  260. >span{
  261. color:#999;
  262. }
  263. }
  264. .info-item{
  265. height: 50px;
  266. line-height: 50px;
  267. >span{
  268. color:#999;
  269. }
  270. }
  271. </style>