projectSettlement.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  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="0"></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="0"></el-option>
  26. <el-option
  27. v-for="item in options.department"
  28. :key="item.id"
  29. :label="item.name"
  30. :value="item.id">
  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="0"></el-option>
  38. <el-option
  39. v-for="item in options.sort"
  40. :key="item.id"
  41. :label="item.name"
  42. :value="item.id">
  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 type="primary" size="mini" @click="resultShow(scope.row.id,scope.row.status)">成果查看</el-button>
  147. </div>
  148. </template>
  149. </el-table-column>
  150. </el-table>
  151. </div>
  152. <!-- 表格结束 -->
  153. <!-- 分页 -->
  154. <el-pagination
  155. @current-change="handleCurrentChange"
  156. :current-page="table.currentPage"
  157. :page-size="table.packageSize"
  158. layout=" prev, pager, next"
  159. background
  160. class="paginations"
  161. :total="table.total">
  162. </el-pagination>
  163. <!-- 分页结束 -->
  164. <!-- 提交对话框开始 -->
  165. <el-dialog
  166. title="提示"
  167. :visible.sync="submitHint"
  168. width="600px"
  169. class="projectApplicationfundAddDialog"
  170. :before-close="init">
  171. <div class="addDialogLogo">LOGO</div>
  172. <div class="deleteContent">确定“{{tit}}”完结?</div>
  173. <span slot="footer" class="dialog-footer">
  174. <el-button type="primary" @click="submitAll" class="btn5">确认提交</el-button>
  175. <el-button @click="init" class="btn5" style="background:#cccccc" size="small">取消</el-button>
  176. </span>
  177. </el-dialog>
  178. <!-- 提交对话框结束 -->
  179. </div>
  180. </template>
  181. <script>
  182. // import { threadId } from 'worker_threads'
  183. export default {
  184. data() {
  185. return {
  186. submitHint:false,
  187. iid:'',
  188. tit:'',
  189. options:{ //头部搜索框下拉框数据
  190. projectFilter:[],//项目筛选
  191. department:[],//部门
  192. sort:[],//分类
  193. person:[],//负责人
  194. state:[//状态
  195. {
  196. value:99,
  197. label:'全部'
  198. },
  199. {
  200. value:0,
  201. label:'未审核'
  202. },
  203. {
  204. value:1,
  205. label:'进行中'
  206. },
  207. {
  208. value:2,
  209. label:"已审核"
  210. },
  211. ],
  212. },
  213. // 分页数据
  214. table:{
  215. total:0,
  216. packageSize:8,
  217. currentPage:1
  218. },
  219. tableData:[], //结项数据表
  220. selectInp:{
  221. filter:0,
  222. department:0,
  223. sort:0,
  224. person:'',
  225. state:99,
  226. }
  227. }
  228. },
  229. methods:{
  230. init(){
  231. this.submitHint=false
  232. },
  233. audit(cid,tit){
  234. this.iid=cid;
  235. this.tit=tit;
  236. this.submitHint=true;
  237. },
  238. submitAll(){ //提交结项审核
  239. let param={
  240. uid:this.$store.state.userInfo.userid,
  241. cid:this.iid
  242. }
  243. console.log(param);
  244. this.ajax
  245. .post(this.$store.state.api+'/UpdateSettlementIsUpload',param)
  246. .then(res=>{
  247. console.log(res);
  248. this.submitHint=false;
  249. this.getData();
  250. },err=>{
  251. console.log(err);
  252. })
  253. },
  254. handleCurrentChange(val) { //当页数发生改变的时候调用获取列表数据请求
  255. // console.log(`当前页: ${val}`);
  256. this.table.currentPage=val
  257. this.getData()
  258. },
  259. getData(){ //获取表格数据
  260. let param={
  261. uid:this.$store.state.userInfo.userid,
  262. pid:this.selectInp.filter, //筛选
  263. did:this.selectInp.department, //部门
  264. tid:this.selectInp.sort, //分类
  265. leader:this.selectInp.person, //负责人
  266. st:this.selectInp.state, //审核状态
  267. page:this.table.currentPage, //当前页
  268. lim:this.table.packageSize //限制获取几条数据
  269. }
  270. // return console.log(param);
  271. // console.log(param)
  272. this.ajax
  273. .get(this.$store.state.api+'/SelectSettlement',param)
  274. .then(res=>{
  275. console.log(res.data);
  276. let data=res.data;
  277. let a=this.options;
  278. this.tableData=data[0];
  279. a.projectFilter=data[1];
  280. a.department=data[2];
  281. a.sort=data[3];
  282. a.person=data[4];
  283. this.table.total=data[5][0].total
  284. },err=>{
  285. console.log(err);
  286. })
  287. },
  288. resultShow(){
  289. },
  290. details(val){
  291. localStorage.setItem('pid',JSON.stringify(val))
  292. this.$router.push('/projectSettlement1')
  293. },
  294. handleSelectionChange(val) {
  295. this.multipleSelection = val;
  296. }
  297. },
  298. mounted(){
  299. this.getData();
  300. }
  301. }
  302. </script>
  303. <style lang="less">
  304. .projectSettlement{
  305. .pagination{ //分页
  306. float: right;
  307. margin: 20px 35px 10px;
  308. }
  309. //提交对话框开始
  310. .projectApplicationfundAddDialog{
  311. .el-dialog__header{
  312. border-radius: 10px 10px 0 0;
  313. }
  314. .el-dialog{
  315. border-radius:10px ;
  316. top: 10%;
  317. }
  318. .deleteContent{
  319. width: 100%;
  320. text-align: center;
  321. font-size: 22px;
  322. color: #000;
  323. }
  324. .addDialogLogo{
  325. width: 60px;
  326. height: 30px;
  327. line-height: 30px;
  328. border-radius: 5px;
  329. background: #f2f2f2;
  330. position: absolute;
  331. left: 10px;
  332. top: 10px;
  333. text-align: center;
  334. }
  335. .el-dialog__header{
  336. background: #32455b;
  337. }
  338. .el-dialog__title{
  339. position: relative;
  340. top: -2px;
  341. font-size: 18px;
  342. margin-left:250px;
  343. font-size: 18px;
  344. color:rgb(246, 247, 246);
  345. }
  346. .addDialogMid{
  347. box-sizing: border-box;
  348. padding:0 60px 0 10px;
  349. .addDialogTit{
  350. display: flex;
  351. span{
  352. width: 80px;
  353. line-height: 40px;
  354. text-align: left;
  355. }
  356. }
  357. .addDialogTit1{
  358. display: flex;
  359. justify-content: space-between;
  360. margin-bottom: 15px;
  361. }
  362. .addDialogTit2{
  363. margin-top: 10px;
  364. font-size: 18px;
  365. color: #000;
  366. text-indent: 2em;
  367. }
  368. .addDialogCon{
  369. margin-top: 20px;
  370. }
  371. }
  372. .dialog-footer{
  373. display: flex;
  374. justify-content: center;
  375. .btn5{
  376. height: 40px;
  377. font-size: 16px;
  378. background: #0e72e6;
  379. width: 200px;
  380. }
  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>