ProjectManagement.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <!-- 项目管理页面 -->
  3. <div class="ProjectManagement">
  4. <div class="pAHeader">
  5. <div class="pAHeader1">项目管理</div>
  6. </div>
  7. <hr>
  8. <!-- 搜索栏开始 -->
  9. <div class="selectInp">
  10. <div class="manageSelects">
  11. <div class="selectsBlock">
  12. <span class="selectLabel">项目筛选</span>
  13. <el-select v-model="selectInp.filter" @change="getData" placeholder="我的项目">
  14. <el-option label="所有项目" :value="0"></el-option>
  15. <el-option
  16. v-for="item in options.projectFilter"
  17. :key="item.courseId"
  18. :label="item.title"
  19. :value="item.courseId">
  20. </el-option>
  21. </el-select>
  22. </div>
  23. <div class="selectsBlock">
  24. <span class="selectLabel">部门</span>
  25. <el-select v-model="selectInp.department" @change="getData" placeholder="请选择">
  26. <el-option label="所有部门" :value="0"></el-option>
  27. <el-option
  28. v-for="item in options.department"
  29. :key="item.classid"
  30. :label="item.name"
  31. :value="item.classid">
  32. </el-option>
  33. </el-select>
  34. </div>
  35. <div class="selectsBlock">
  36. <span class="selectLabel">分类</span>
  37. <el-select v-model="selectInp.sort" @change="getData" placeholder="请选择">
  38. <el-option label="所有分类" :value="0"></el-option>
  39. <el-option
  40. v-for="item in options.sort"
  41. :key="item.typeid"
  42. :label="item.name"
  43. :value="item.typeid">
  44. </el-option>
  45. </el-select>
  46. </div>
  47. <div class="selectsBlock">
  48. <span class="selectLabel">结题状态</span>
  49. <el-select v-model="selectInp.state" @change="getData" placeholder="请选择">
  50. <el-option
  51. v-for="item in options.state"
  52. :key="item.value"
  53. :label="item.label"
  54. :value="item.value">
  55. </el-option>
  56. </el-select>
  57. </div>
  58. <div class="selectsBlock">
  59. <span class="selectLabel">负责人</span>
  60. <el-select v-model="selectInp.leader" @change="getData" placeholder="请选择">
  61. <el-option label="所有负责人" :value="''"></el-option>
  62. <el-option
  63. v-for="(item,index) in options.person"
  64. :key="index"
  65. :label="item.pro_leader"
  66. :value="item.pro_leader">
  67. </el-option>
  68. </el-select>
  69. </div>
  70. </div>
  71. <div class="ProjectManagementQuery">
  72. <el-input v-model="selectText" style="340px" placeholder="请输入项目名称"></el-input>
  73. <el-button type="primary" class="btn" size="mini">查询</el-button>
  74. </div>
  75. </div>
  76. <!-- 搜索栏结束 -->
  77. <!-- 循环展示框列表开始 -->
  78. <div class="projectBlock core_dialogue">
  79. <div class="classBlock" v-for="(item,index) in items" :key="index">
  80. <div class="projectBlockPosition">
  81. <!-- {{ item.isupload }} -->
  82. <span v-if="item.isupload==0">未结题</span>
  83. <span v-if="item.isupload==1">进行中</span>
  84. <span v-if="item.isupload==2">已结题</span>
  85. </div>
  86. <img :src="item.image" alt="">
  87. <div class="classBlock1">
  88. <div class="classBlock2">{{ item.title }}</div>
  89. <div class="classBlock3">
  90. <div>{{ item.pro_leader }}</div>
  91. <div>{{ item.name }}</div>
  92. </div>
  93. <div class="classBlock3 classBlock4">
  94. <div style="color:#9e9e9e">{{ item.typeName }}</div>
  95. <div>项目编号{{ index }}</div>
  96. </div>
  97. </div>
  98. <div class="classBlockBtn">
  99. <el-button type="primary" class="bt1" size="mini" @click="scheduleDetail(item.courseId)">进度详情</el-button>
  100. <el-button type="primary" class="bt1" size="mini" @click="fundStatus(item.courseId)">资金情况</el-button>
  101. <el-button type="primary" class="bt1" size="mini" @click="finish">结项</el-button>
  102. </div>
  103. </div>
  104. </div>
  105. <!-- 循环展示框列表结束 -->
  106. <!-- 分页 -->
  107. <el-pagination
  108. @current-change="handleCurrentChange"
  109. :current-page="table.currentPage"
  110. :page-size="table.packageSize"
  111. layout=" prev, pager, next"
  112. background
  113. class="pagination"
  114. :total="table.total">
  115. </el-pagination>
  116. <!-- 分页结束 -->
  117. </div>
  118. </template>
  119. <script>
  120. export default {
  121. data() {
  122. return {
  123. selectText:'',
  124. items:[], //项目列表数据
  125. table:{ // 分页数据
  126. total:0,
  127. packageSize:8,
  128. currentPage:1
  129. },
  130. options:{ //头部搜索框下拉框数据
  131. projectFilter:[],//项目筛选
  132. department:[],//部门
  133. sort:[],//分类
  134. person:[],//负责人
  135. state:[//状态
  136. {
  137. value:99,
  138. label:'全部'
  139. },
  140. {
  141. value:0,
  142. label:'未审核'
  143. },
  144. {
  145. value:1,
  146. label:'正在审核'
  147. },
  148. {
  149. value:2,
  150. label:"已审核"
  151. },
  152. ],
  153. },
  154. selectInp:{ //select选定所显示的值
  155. filter:0, //不要带引号,select框是根据id来选择下面数据的
  156. department:0,
  157. sort:0,
  158. state:99,
  159. leader:'',
  160. }
  161. }
  162. },
  163. methods:{
  164. scheduleDetail(val){ //进度详情
  165. console.log(val);
  166. localStorage.setItem('pid',JSON.stringify(val))
  167. this.$router.push(`/ProjectManagement1`)
  168. },
  169. fundStatus(Id){ //资金情况
  170. this.$router.push(`/ProjectManagementFund1`)
  171. },
  172. init(){ //对话框重置
  173. },
  174. finish(){ //结项
  175. },
  176. handleCurrentChange(val) { //当页数发生改变的时候调用获取列表数据请求
  177. // console.log(`当前页: ${val}`);
  178. this.table.currentPage=val
  179. this.getData()
  180. },
  181. getData(){ //获取渲染数据
  182. let param={
  183. uid:this.$store.state.userInfo.userid, //当前账号id
  184. pid:this.selectInp.filter, //筛选
  185. did:this.selectInp.department, //部门
  186. tid:this.selectInp.sort, //分类
  187. leader:this.selectInp.leader, //负责人
  188. st:this.selectInp.state, //审核状态
  189. textInp:this.selectText,
  190. page:this.table.currentPage, //当前页
  191. lim:this.table.packageSize, //限制获取几条数据
  192. }
  193. // return console.log(param);
  194. // console.log(param)
  195. this.ajax
  196. .get(this.$store.state.api+'/SelectAllProject',param)
  197. .then(res=>{
  198. // console.log(res);
  199. let data=res.data;
  200. // console.log(res);
  201. let a=this.options;
  202. this.items=data[0];
  203. // console.log(this.items);
  204. a.projectFilter=data[1];
  205. a.department=data[2];
  206. a.sort=data[3];
  207. a.person=data[4];
  208. this.table.total=data[5][0].total
  209. },err=>{
  210. console.log(err);
  211. })
  212. }
  213. },
  214. watch:{ //监视选择框的变化,实施刷新表格数据
  215. selectText:{
  216. handler(){
  217. immediate:true
  218. deep:true
  219. this.getData()
  220. }
  221. }
  222. },
  223. mounted(){
  224. this.getData() //页面加载完成后自动获取渲染数据
  225. }
  226. }
  227. </script>
  228. <style lang="less">
  229. .ProjectManagement{
  230. .pagination{
  231. float: right;
  232. margin: 0px 85px 10px;
  233. }
  234. .projectBlock{ //大框
  235. width: 100%;
  236. height: 560px;
  237. display: flex;
  238. overflow: hidden;
  239. flex-wrap: wrap;
  240. overflow:auto;
  241. .classBlock{ //每个独立小框
  242. flex-shrink: 0;
  243. overflow: hidden;
  244. position: relative;
  245. margin-right: 20px;
  246. margin-bottom: 5px;
  247. width: 320px;height: 260px;
  248. background-color: rgb(255, 255, 255);
  249. box-shadow: 1px 2px 3px #ccc;
  250. border: 1px solid #ccc;
  251. border-radius: 5px;
  252. display: flex;
  253. flex-direction: column;
  254. .projectBlockPosition{ //完成状态
  255. border-radius: 30px;
  256. position: absolute;
  257. top: 5px;
  258. left: 5px;
  259. width: 80px;
  260. height: 30px;
  261. display: flex;
  262. justify-content: center;
  263. align-items: center;
  264. background: #000;
  265. opacity: 0.7;
  266. font-size: 16px;
  267. color:#fff;
  268. // font-size: 14px;
  269. }
  270. img{
  271. width: 100%;height: 125px;
  272. }
  273. .classBlock1{ //中间栏
  274. margin-bottom: 10px;
  275. margin-top: 0px;
  276. box-sizing: border-box;
  277. padding: 0 5px;
  278. .classBlock2{ //项目名称
  279. margin-left: 5px;
  280. margin-bottom: 4px;
  281. margin-top: 4px;
  282. text-align: left;
  283. font-size: 18px;
  284. }
  285. .classBlock3{ //学校、姓名
  286. box-sizing: border-box;
  287. padding: 0 5px;
  288. font-size: 16px;
  289. width: 100%;
  290. margin-top: 4px;
  291. display: flex;
  292. justify-content: space-between;
  293. }
  294. .classBlock4{ //博客、编号
  295. margin-top: 4px;
  296. }
  297. }
  298. .classBlockBtn{ //按钮栏
  299. box-sizing: border-box;
  300. padding:0 6px;
  301. display: flex;
  302. flex: 1;
  303. width: 100%;
  304. justify-content: center;
  305. align-items: center;
  306. background-color:#F5F4F4 ;
  307. .bt1{
  308. width: 100px;
  309. height: 35px;
  310. font-size: 14px;
  311. }
  312. }
  313. }
  314. }
  315. }
  316. </style>