projectSettlement.vue 12 KB

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