index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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="getDataList"></org-tree>
  7. <div class="search-flex">
  8. <select-cell class="van-hairline--right" title="确认状态" v-model="query.confirmStatus" :data-list="getDictItem('question_confirm_status')" @change="getDataList"/>
  9. <date-cell title="发现日期" v-model="query.submitTime" date-type="date" @change="getDataList"/>
  10. </div>
  11. <div class="card-list">
  12. <!-- <van-list-->
  13. <!-- v-model="loading"-->
  14. <!-- :finished="finished"-->
  15. <!-- finished-text="没有更多了"-->
  16. <!-- @load="getDataList"-->
  17. <!-- >-->
  18. <van-empty description="暂无数据" v-if="!dataList || dataList.length === 0" />
  19. <template v-else>
  20. <van-cell-group v-for="(v,i) in dataList">
  21. <van-cell :title="v.orgName">
  22. <template #extra>
  23. <van-button
  24. style="width: 60px;"
  25. v-if="v.orgId==orgId && v.confirmStatus==0"
  26. hairline
  27. size="mini"
  28. type="info"
  29. @click.stop="clickItem(v.id,'confirm')">
  30. 隐患确认
  31. </van-button>
  32. <van-button
  33. style="width: 60px;"
  34. v-if="v.submitorId== id && v.confirmStatus==1"
  35. hairline
  36. size="mini"
  37. type="info"
  38. @click.stop="clickItem(v.id,'confirmDissent')">
  39. 异议审批
  40. </van-button>
  41. <van-button
  42. style="width: 60px;"
  43. v-if="v.orgId==orgId && v.confirmStatus==2 && v.reformStatus==10"
  44. hairline
  45. size="mini"
  46. type="info"
  47. @click.stop="clickItem(v.id,'reform')">
  48. 整改
  49. </van-button>
  50. <van-button
  51. style="width: 60px;"
  52. v-if="v.confirmStatus ===3"
  53. hairline
  54. size="mini"
  55. type="info"
  56. @click.stop="clickItem(v.id,'detail')">
  57. 详情
  58. </van-button>
  59. </template>
  60. <template #label>
  61. <div class="info-box">
  62. <div class="info-desc">隐患描述:<span>{{v.questionDesc}}</span></div>
  63. <div class="info-item">发现日期:<span>{{v.submitTime}}</span></div>
  64. </div>
  65. </template>
  66. </van-cell>
  67. </van-cell-group>
  68. </template>
  69. <!-- </van-list>-->
  70. </div>
  71. </div>
  72. </div>
  73. </template>
  74. <script>
  75. import NavBar from '@/components/NavBar'
  76. import OrgTree from '@/components/orgTree'
  77. import dateCell from '@/components/dateCell'
  78. import selectCell from '@/components/selectCell'
  79. import {dataList,planList} from './api'
  80. import {mapGetters} from "vuex";
  81. import {formatDate} from "@/filters/filter";
  82. export default {
  83. components: {
  84. NavBar,
  85. OrgTree,
  86. dateCell,
  87. selectCell
  88. },
  89. data() {
  90. return {
  91. query:{
  92. submitTime:null,
  93. orgId:null,
  94. confirmStatus:'0',
  95. pageSize:20,
  96. pageNum:1,
  97. },
  98. planList:[],
  99. loading:false,
  100. finished:false,
  101. columns:[
  102. {
  103. field: "index",
  104. key: "index",
  105. title: "序号",
  106. width: 50,
  107. align: "center",
  108. renderBodyCell: ({ row, column, rowIndex }, h) => {
  109. return ++rowIndex;
  110. },
  111. },
  112. { field: "orgName", key: "a", title: "单位名称",align: "center"},
  113. { field: "shouldFinish", key: "b", title: "应完成数", align: "center" },
  114. { field: "finish", key: "c", title: "已完成数",align: "center" },
  115. { field: "finishRate", key: "d", title: "完成率", align: "center" },
  116. ],
  117. dataList:[],
  118. dicts:['question_confirm_status','question_reform_status']
  119. }
  120. },
  121. mounted() {
  122. this.initData();
  123. },
  124. computed:{
  125. ...mapGetters(['orgId','id','dictionary']),
  126. },
  127. methods: {
  128. //初始化数据
  129. initData(){
  130. this.query.orgId = this.orgId;
  131. this.query.submitTime = formatDate(new Date(),'YYYY-MM-DD');
  132. this.getDataList();
  133. },
  134. //获取数据列表
  135. getDataList(){
  136. let data = {
  137. ...this.query
  138. }
  139. if(!this.query.orgId) return this.$toast('请选择机构');
  140. dataList(data).then(res=>{
  141. this.loading = false;
  142. this.dataList = [...this.dataList,...res.rows];
  143. this.query.pageNum = res.pageNum;
  144. })
  145. },
  146. clickItem(id,type){
  147. this.$router.push({
  148. path:'/problemDetail',
  149. query:{
  150. id,type
  151. }
  152. });
  153. }
  154. }
  155. }
  156. </script>
  157. <style lang="scss">
  158. .van-cell-group{
  159. margin-bottom: 20px;
  160. }
  161. .van-cell-group:last-child{
  162. margin-bottom: 0;
  163. }
  164. .vue-table-root{
  165. tr,td,th{
  166. font-size: 25px!important;
  167. color:#666!important;
  168. }
  169. }
  170. </style>
  171. <style lang="scss" scoped>
  172. .problem-item{
  173. }
  174. .app-container{
  175. }
  176. .card-list{
  177. padding: 20px;
  178. height: calc(100vh - 420px);
  179. overflow: auto;
  180. }
  181. .card-num{
  182. display: flex;
  183. align-items: center;
  184. font-size: 28px;
  185. color: #009dff;
  186. }
  187. .search-flex{
  188. display: flex;
  189. align-items: center;
  190. justify-content: space-between;
  191. >div{
  192. width: 50%;
  193. }
  194. }
  195. .info-box{
  196. color:#555;
  197. }
  198. .info-desc{
  199. padding-top: 10px;
  200. min-height: 50px;
  201. line-height: 36px;
  202. max-height: 250px;
  203. display: -webkit-box;
  204. -webkit-line-clamp: 3; /* 限制显示为3行 */
  205. -webkit-box-orient: vertical;
  206. overflow: hidden;
  207. text-overflow: ellipsis;
  208. >span{
  209. color:#999;
  210. }
  211. }
  212. .info-item{
  213. height: 50px;
  214. line-height: 50px;
  215. >span{
  216. color:#999;
  217. }
  218. }
  219. </style>