projectSettlement.vue 12 KB

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