projectSettlement.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <template>
  2. <!-- 项目结项 -->
  3. <div class="projectSettlement" v-loading="loading">
  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=''></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=""></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=""></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.person" @change="getData" placeholder="请选择">
  50. <el-option label="所有负责人" value=""></el-option>
  51. <el-option
  52. v-for="(item,index) in options.person"
  53. :key="index"
  54. :label="item.pro_leader"
  55. :value="item.pro_leader">
  56. </el-option>
  57. </el-select>
  58. </div>
  59. <div class="selectsBlock">
  60. <span class="selectLabel">状态</span>
  61. <el-select v-model="selectInp.state" @change="getData" placeholder="请选择">
  62. <el-option
  63. v-for="item in options.state"
  64. :key="item.value"
  65. :label="item.label"
  66. :value="item.value">
  67. </el-option>
  68. </el-select>
  69. </div>
  70. </div>
  71. <div class="ProjectManagementQuery">
  72. <el-input v-model="input" placeholder="请输入项目名称/编号"></el-input>
  73. <el-button type="primary" class="btn" size="mini" @click="getData">查询</el-button>
  74. </div>
  75. </div>
  76. <!-- 搜索栏结束 -->
  77. <!-- 表格开始 -->
  78. <div>
  79. <el-table
  80. ref="multipleTable"
  81. :data="tableData"
  82. tooltip-effect="dark"
  83. class="fontSize"
  84. :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
  85. @cell-click="cellProjectClick"
  86. @selection-change="handleSelectionChange">
  87. <!-- <el-table-column
  88. type="selection"
  89. >
  90. </el-table-column> -->
  91. <el-table-column
  92. prop="ProjectNo"
  93. label="项目编号"
  94. align="center"
  95. min-width="7%">
  96. </el-table-column>
  97. <el-table-column
  98. prop="title"
  99. label="项目名称"
  100. align="center"
  101. min-width="10%">
  102. </el-table-column>
  103. <el-table-column
  104. prop="pro_leader"
  105. align="center"
  106. label="项目负责人"
  107. min-width="10%">
  108. </el-table-column>
  109. <el-table-column
  110. prop="name"
  111. label="所在部门"
  112. align="center"
  113. min-width="10%">
  114. </el-table-column>
  115. <el-table-column
  116. prop="fund"
  117. label="预算总经费(万)"
  118. align="center"
  119. min-width="10%">
  120. </el-table-column>
  121. <el-table-column
  122. prop="time"
  123. label="结项时间"
  124. align="center"
  125. min-width="12%">
  126. </el-table-column>
  127. <el-table-column
  128. prop="phone"
  129. label="联系电话"
  130. align="center"
  131. min-width="10%">
  132. <template #default="scope">
  133. <div>
  134. {{ scope.row.phone==''||scope.row.phone==null?'-':scope.row.phone }}
  135. </div>
  136. </template>
  137. </el-table-column>
  138. <el-table-column
  139. prop="endProject"
  140. label="状态"
  141. align="center"
  142. min-width="8%">
  143. <template #default="scope">
  144. <div>
  145. <span v-if="scope.row.isupload == 3">待结项</span>
  146. <span v-if="scope.row.isupload == 4">已结项</span>
  147. </div>
  148. </template>
  149. </el-table-column>
  150. <el-table-column
  151. prop="operation"
  152. label="操作"
  153. width="300"
  154. align="center"
  155. >
  156. <template #default="scope">
  157. <div class="operations">
  158. <el-button type="primary" size="mini" @click="details(scope.row)">查看详情</el-button>
  159. <el-button type="primary" v-if="scope.row.isupload==3" style="width: 73.3px;" @click="audit(scope.row.courseId,scope.row.title)" size="mini">确认结项</el-button>
  160. <el-button type="info" disabled v-if="scope.row.isupload==4" style="background-color: #c8c9cc;border-color: #c8c9cc;cursor: no-drop;" size="mini">已完结</el-button>
  161. <!-- <el-button type="primary" disabled v-if="scope.row.isupload==0" style="width: 73.3px;background-color: #c8c9cc;border-color: #c8c9cc;cursor: no-drop;" @click="audit(scope.row.courseId,scope.row.title)" size="mini">审核</el-button> -->
  162. <el-button type="primary" size="mini" @click="edit(scope.row.courseId,scope.row.typeid)">成果查看</el-button>
  163. <!-- <el-button v-show="scope.row.isupload!=2" type="info" disabled="" size="mini">成果查看</el-button> -->
  164. </div>
  165. </template>
  166. </el-table-column>
  167. </el-table>
  168. </div>
  169. <!-- 表格结束 -->
  170. <!-- 分页 -->
  171. <el-pagination
  172. @current-change="handleCurrentChange"
  173. :current-page="table.currentPage"
  174. :page-size="table.packageSize"
  175. layout=" prev, pager, next"
  176. background
  177. class="paginations"
  178. :total="table.total">
  179. </el-pagination>
  180. <!-- 分页结束 -->
  181. <!-- 提交对话框开始 -->
  182. <el-dialog
  183. title="提示"
  184. :visible.sync="submitHint"
  185. width="600px"
  186. class="projectApplicationfundAddDialog"
  187. :before-close="init">
  188. <div class="deleteContent">确定提交“{{tit?tit:''}}”结项吗?提交后将不能修改内容,等待管理员审核结项结果。 </div>
  189. <span slot="footer" class="dialog-footer">
  190. <el-button type="primary" @click="submitAll" class="AllDialogBtn">确认</el-button>
  191. <el-button @click="init" size="small" class="AllDialogBtn">取消</el-button>
  192. </span>
  193. </el-dialog>
  194. <!-- 提交对话框结束 -->
  195. </div>
  196. </template>
  197. <script>
  198. // import { threadId } from 'worker_threads'
  199. export default {
  200. data() {
  201. return {
  202. submitHint:false,
  203. loading:false,
  204. input:"",//查询输入框
  205. iid:'',
  206. tit:'',
  207. options:{ //头部搜索框下拉框数据
  208. projectFilter:[],//项目筛选
  209. department:[],//部门
  210. sort:[],//分类
  211. person:[],//负责人
  212. state:[//状态
  213. {
  214. value:'',
  215. label:'全部'
  216. },
  217. {
  218. value:3,
  219. label:'待结项'
  220. },
  221. {
  222. value:4,
  223. label:'已结项'
  224. },
  225. ],
  226. },
  227. // 分页数据
  228. table:{
  229. total:0,
  230. packageSize:8,
  231. currentPage:1
  232. },
  233. tableData:[], //结项数据表
  234. selectInp:{
  235. filter:'',
  236. department:'',
  237. sort:'',
  238. person:'',
  239. state:'',
  240. }
  241. }
  242. },
  243. methods:{
  244. init(){
  245. this.submitHint=false
  246. },
  247. audit(cid,tit){
  248. this.iid=cid;
  249. this.tit=tit;
  250. this.submitHint=true;
  251. },
  252. submitAll(){ //提交结项审核
  253. let param={
  254. uid:this.$store.state.userInfo.userid,
  255. pid:this.iid
  256. }
  257. this.ajax
  258. .post(this.$store.state.api+'/UpdateSettlementEndProject',param)
  259. .then(res=>{
  260. this.$message.success("结项成功")
  261. this.submitHint=false;
  262. this.getData();
  263. },err=>{
  264. console.log(err);
  265. })
  266. },
  267. handleCurrentChange(val) { //当页数发生改变的时候调用获取列表数据请求
  268. this.table.currentPage=val
  269. this.getData()
  270. },
  271. getData(){ //获取表格数据
  272. if(this.loading)return;
  273. this.loading = true;
  274. let param={
  275. uid:this.$store.state.userInfo.userid,
  276. pid:this.selectInp.filter, //筛选
  277. did:this.selectInp.department, //部门
  278. tid:this.selectInp.sort, //分类
  279. leader:this.selectInp.person, //负责人
  280. st:this.selectInp.state, //审核状态
  281. inp:encodeURIComponent(this.input),
  282. page:this.table.currentPage, //当前页
  283. lim:this.table.packageSize //限制获取几条数据
  284. }
  285. this.ajax
  286. .get(this.$store.state.api+'/SelectAllProjectSettlement',param)
  287. .then(res=>{
  288. let data=res.data;
  289. let a=this.options;
  290. console.log(data)
  291. this.tableData=data[0];
  292. a.projectFilter=data[1];
  293. a.department=data[2];
  294. a.sort=data[3];
  295. a.person=data[4];
  296. this.table.total=data[5][0].total
  297. this.loading = false;
  298. },err=>{
  299. console.log(err);
  300. })
  301. },
  302. edit(cid,tid){
  303. // console.log(rowId)
  304. window.open(`/resultShowDetail?pid=${cid}&tid=${tid}`)
  305. },
  306. details(val){
  307. this.$router.push(`/projectSettlementDetailMain?pid=${val['courseId']}&tid=${val['typeid']}`);
  308. },
  309. handleSelectionChange(val) {
  310. this.multipleSelection = val;
  311. },
  312. // 单元格被点击
  313. cellProjectClick(row, column, cell, event){
  314. if(column.property!="operation"){
  315. this.details(row)
  316. }
  317. },
  318. },
  319. mounted(){
  320. // this.getData();
  321. },
  322. activated(){
  323. this.getData()
  324. }
  325. }
  326. </script>
  327. <style lang="less" scoped>
  328. .projectSettlement{
  329. /deep/.el-table__row{
  330. .el-table__cell{
  331. cursor: pointer;
  332. }
  333. .el-table__cell:nth-last-child(1){
  334. cursor: default;
  335. }
  336. }
  337. .pagination{ //分页
  338. float: right;
  339. margin: 20px 35px 10px;
  340. }
  341. //提交对话框开始
  342. .projectApplicationfundAddDialog{
  343. .el-dialog__header{
  344. border-radius: 10px 10px 0 0;
  345. }
  346. .el-dialog{
  347. border-radius:10px ;
  348. top: 10%;
  349. }
  350. .deleteContent{
  351. width: 100%;
  352. text-align: center;
  353. font-size: 22px;
  354. color: #000;
  355. }
  356. .addDialogLogo{
  357. width: 60px;
  358. height: 30px;
  359. display: flex;
  360. justify-content: center;
  361. line-height: 30px;
  362. border-radius: 5px;
  363. background: #f2f2f2;
  364. position: absolute;
  365. left: 20px; top: 15px;
  366. }
  367. .el-dialog__header{
  368. background: #32455b;
  369. }
  370. .el-dialog__title{
  371. position: relative;
  372. top: -2px;
  373. font-size: 18px;
  374. margin-left:250px;
  375. font-size: 18px;
  376. color:rgb(246, 247, 246);
  377. }
  378. .dialog-footer{
  379. display: flex;
  380. justify-content: center;
  381. }
  382. }
  383. //提交对话框结束
  384. // .selects{
  385. // width: 100%;
  386. // margin-top: 20px;
  387. // display: flex;
  388. // flex-wrap: wrap;
  389. // margin-bottom: 20px;
  390. // .selectsBlock{
  391. // display: flex;
  392. // margin-right: 30px;
  393. // margin-bottom: 20px;
  394. // }
  395. // .selectLabel{
  396. // width: 64px;
  397. // font-size: 16px;
  398. // margin-right: 10px;
  399. // display: inline-block;
  400. // font-weight:bolder;
  401. // text-align: justify;
  402. // text-justify:distribute-all-lines;
  403. // text-align-last: justify;
  404. // transform: translate(0,22%);
  405. // }
  406. // }
  407. label{
  408. color: #000;
  409. }
  410. }
  411. </style>