list.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058
  1. <template>
  2. <el-container class="pro-container">
  3. <el-header class="search-box">
  4. <div class="search-box-item-title">
  5. <el-input v-model="searchForm.name" placeholder="请输入内容" clearable size="small"></el-input>
  6. </div>
  7. <div class="ml-10">
  8. <el-button type="primary" @click="searchChange" class="custom-primary-btn" size="small">查询</el-button>
  9. </div>
  10. <div class="ml-10">
  11. <el-select v-model="searchForm.status" placeholder="项目状态" style="width: 120px;" size="small" clearable>
  12. <el-option
  13. v-for="item in proStatusItems"
  14. :key="item.value"
  15. :label="item.label"
  16. :value="item.value">
  17. </el-option>
  18. </el-select>
  19. </div>
  20. <div class="ml-10">
  21. <el-select v-model="searchForm.sort" placeholder="默认排序" style="width: 120px;" size="small" clearable v-if="searchForm.isCollect">
  22. <el-option
  23. v-for="item in sortOptions"
  24. :key="item.value"
  25. :label="item.label"
  26. :value="item.value">
  27. </el-option>
  28. </el-select>
  29. <el-select v-model="searchForm.sort" placeholder="默认排序" style="width: 120px;" size="small" clearable v-else>
  30. <el-option
  31. v-for="item in sortOptions1"
  32. :key="item.value"
  33. :label="item.label"
  34. :value="item.value">
  35. </el-option>
  36. </el-select>
  37. </div>
  38. <div class="ml-10">
  39. <el-button type="warning" icon="el-icon-sort" size="small" @click="sortPro">排序</el-button>
  40. </div>
  41. <div class="ml-10" @click="searchByCollect">
  42. <el-button type="warning" icon="el-icon-star-off" size="small" class="custom-primary-btn" v-if="!searchForm.isCollect">收藏夹</el-button>
  43. <el-button type="success" icon="el-icon-arrow-left" size="small" v-else>所有项目</el-button>
  44. </div>
  45. </el-header>
  46. <el-main class="main-box">
  47. <div class="project-list-container" v-if="projectPageList.length>0" v-loading="getPageLoading">
  48. <el-card class="project-card" v-for="item in projectPageList"
  49. :key="item.id">
  50. <div class="project-top">
  51. <div class="project-tag" >
  52. <template v-if="item.wbsTypes.length>0 " >
  53. <el-tag
  54. size="small"
  55. v-for="item in generateTagItems(item.wbsTypes)"
  56. :key="item.label"
  57. :type="item.type"
  58. effect="dark"
  59. class="mr-3 custom-ellipse-tag"
  60. :class="`custom-tag-type-${item.type}`"
  61. >
  62. <i class=" el-icon-success"></i>
  63. {{ item.label }}
  64. </el-tag>
  65. </template>
  66. <el-tag type="info"effect="dark" v-else class="custom-ellipse-tag">未关联WBS</el-tag>
  67. </div>
  68. <div class="project-like" @click="toggleLike(item)" v-loading="item.load">
  69. <i class="ri-heart-fill" v-if="item.isCollect" style="color: red;" ></i>
  70. <i class="ri-heart-line" v-else></i>
  71. </div>
  72. </div>
  73. <div class="project-title" >
  74. <el-tooltip
  75. v-if="item.projectAlias.length > 20"
  76. :content="item.projectAlias"
  77. placement="top"
  78. >
  79. <span>{{ item.projectAlias }}</span>
  80. </el-tooltip>
  81. <span v-else>{{ item.projectAlias }}</span>
  82. </div>
  83. <div class="project-info">
  84. <div><span class="info-label"><i class="el-icon-user"></i>负责人:</span>{{ item.projectLeaderName }}</div>
  85. <div><span class="info-label"><i class="el-icon-edit-outline"></i>电签类别:</span>{{ item.remarkType===1?'安心签':'东方中讯' }}</div>
  86. <div><span class="info-label"><i class="el-icon-coordinate"></i>电签方式:</span>{{ item.approvalType===1?'垂直审批':'平行审批' }}</div>
  87. </div>
  88. <div class="project-actions">
  89. <el-link type="primary" size="small" @click="projectClick(item)">
  90. 查看详情 <i class="el-icon-right"></i>
  91. </el-link>
  92. <el-tag
  93. v-for="status in proStatusItems"
  94. :key="status.value"
  95. :type="status.type"
  96. size="small"
  97. class="custom-ellipse-tag1"
  98. v-if="status.value === item.projectStatus"
  99. >
  100. {{ status.label }}
  101. </el-tag>
  102. </div>
  103. </el-card>
  104. <!-- 其他项目卡片... -->
  105. </div>
  106. <el-empty description="暂无数据" v-else ></el-empty>
  107. </el-main>
  108. <el-footer class="footer-box">
  109. <el-pagination
  110. layout="prev, pager, next"
  111. @current-change="handleCurrentChange"
  112. :current-page.sync="page.currentPage"
  113. :total="page.total"
  114. :page-size="page.pageSize"
  115. class="transparent-pagination"
  116. >
  117. </el-pagination>
  118. </el-footer>
  119. <!-- 项目信息 -->
  120. <el-dialog
  121. class="project-dialog"
  122. :visible.sync="projectVisible"
  123. width="65%"
  124. append-to-body
  125. >
  126. <span slot="title">
  127. <i class="el-icon-s-cooperation" style="color: #2550A2;"></i>项目信息
  128. </span>
  129. <div class="mg-b-15">
  130. <!-- <el-tag size="small" type="danger" class="custom-ellipse-tag1" >进行中</el-tag> -->
  131. <el-tag
  132. v-for="status in proStatusItems"
  133. :key="status.value"
  134. :type="status.type"
  135. size="small"
  136. class="custom-ellipse-tag1"
  137. v-if="status.value === curProjiect.projectStatus"
  138. >
  139. {{ status.label }}
  140. </el-tag>
  141. <span>{{curProjiect.projectName}}</span>
  142. </div>
  143. <div class="mg-b-15">
  144. <span>项目配置</span>
  145. </div>
  146. <div class="flex jc-sb pd-b-10">
  147. <div >
  148. <el-button
  149. v-for="wbsBtn in wbsButtons"
  150. :key="wbsBtn.type"
  151. :style="wbsBtn.style"
  152. size="small"
  153. @click="handleWbsClick(wbsBtn.type)"
  154. >
  155. <i :class="wbsBtn.icon"></i> {{ wbsBtn.label }}
  156. </el-button>
  157. <el-button
  158. size="small"
  159. @click="editProject"
  160. style=" background-color: #2550A2;border-color: #2550A2 ;color: white;"
  161. ><i class="el-icon-edit"></i> 编辑项目信息</el-button>
  162. <el-button
  163. size="small"
  164. @click="addContract"
  165. style=" background-color: #2550A2;border-color: #2550A2 ;color: white;"
  166. ><i class="el-icon-circle-plus"></i> 创建新合同段</el-button>
  167. <el-button
  168. size="small"
  169. @click="sortContract"
  170. style=" background-color: #FF7D43;border-color: #FF7D43 ;color: white;"
  171. ><i class="el-icon-sort"></i> 合同段排序</el-button>
  172. <el-button
  173. size="small"
  174. @click="dellProject"
  175. type="danger"
  176. ><i class="el-icon-delete"></i> 删除项目</el-button>
  177. </div>
  178. </div>
  179. <div
  180. class="mt-15"
  181. v-if="contractList.length > 0"
  182. >
  183. <el-table
  184. :data="contractList"
  185. height="400"
  186. style="width: 100%"
  187. header-cell-class-name="custom-header"
  188. >
  189. <el-table-column
  190. prop="contractName"
  191. label="合同段名称"
  192. >
  193. </el-table-column>
  194. <el-table-column
  195. prop="contractNumber"
  196. label="合同段编号"
  197. >
  198. </el-table-column>
  199. <el-table-column
  200. prop="contractType"
  201. label="合同段类型"
  202. width="100px"
  203. >
  204. <template slot-scope="scope">
  205. <el-tag size="small" :type=" scope.row.contractType===1?'warning':scope.row.contractType===2?'primary':'success'" class="custom-ellipse-tag1" >{{ scope.row.contractType===1?'施工':scope.row.contractType===2?'监理':'指挥' }}</el-tag>
  206. </template>
  207. </el-table-column>
  208. <el-table-column
  209. prop=""
  210. label="合同段权限">
  211. <template slot-scope="scope">
  212. <el-tooltip
  213. v-for="item in scope.row.relationContractInfo"
  214. :key="item.id"
  215. :content="item.contractName"
  216. placement="top"
  217. :disabled="true"
  218. >
  219. <el-tag
  220. size="small"
  221. :type="item.contractType===1?'warning':item.contractType===2?'primary':'success'"
  222. class="custom-ellipse-tag1 ellipsis-tag1"
  223. >
  224. {{item.contractName}}
  225. </el-tag>
  226. </el-tooltip>
  227. </template>
  228. </el-table-column>
  229. <el-table-column
  230. width="180px"
  231. prop="address"
  232. label="操作">
  233. <template slot-scope="scope">
  234. <el-link
  235. type="primary"
  236. size="mini"
  237. @click="editContract(scope.row)">编辑合同段信息</el-link>
  238. <el-link
  239. size="mini"
  240. type="danger"
  241. class="ml-10"
  242. @click="delContract(scope.row,sortOptionscope.$index)">删除</el-link>
  243. </template>
  244. </el-table-column>
  245. </el-table>
  246. </div>
  247. <div
  248. class="text-align-c pd-t-20"
  249. v-else
  250. >
  251. 暂无合同段,请先创建合同段
  252. </div>
  253. </el-dialog>
  254. <!-- 合同段排序弹窗 -->
  255. <ContractSort
  256. ref="contractSortRef"
  257. :title="sortTitle"
  258. :sortProLoad="sortProLoad"
  259. @confirm="handleSortConfirm"
  260. />
  261. </el-container>
  262. </template>
  263. <script>
  264. import { collectProject, removeProject,getProjectListPage,sortProject,sortProjectCollect,sortContract } from "@/api/manager/projectinfo";
  265. import { findContractByProjectId, removeContractInfo } from "@/api/manager/contractinfo";
  266. // import {getDictionary} from "@/api/system/dict";
  267. import { mapGetters } from "vuex";
  268. import { getStore, setStore } from "@/util/store";
  269. import ContractSort from './ContractSort.vue'
  270. export default {
  271. data () {
  272. return {
  273. showTooltip: false, // 控制 tooltip 显示
  274. searchForm: {
  275. name: '',
  276. status: '',
  277. sort:0.,
  278. isCollect: 0,
  279. },
  280. sortOptions:[
  281. { value: 0, label: '默认排序' },
  282. { value: 1, label: '收藏优先' },
  283. { value: 2, label: '创建时间' },
  284. { value: 3, label: '我负责的' },
  285. ],
  286. sortOptions1:[
  287. { value: 0, label: '默认排序' },
  288. { value: 2, label: '创建时间' },
  289. { value: 3, label: '我负责的' },
  290. ],
  291. proStatusItems: [
  292. { type:'info', label: '未开始',value: 0 },
  293. { type: 'primary', label: '配置中' ,value: 1 },
  294. { type: 'warning', label: '进行中' ,value: 2 },
  295. { type: 'success', label: '已完成' ,value: 3 },
  296. ],
  297. projectId: '',
  298. curProjiect: {},
  299. projectList: [],
  300. projectPageList: [],
  301. getPageLoading: false,
  302. projectVisible: false,
  303. contractList: [],
  304. page: {
  305. currentPage: 1,
  306. pageSize: 12,
  307. total: 0
  308. },
  309. wbsButtons: [
  310. {
  311. label: '质检WBS',
  312. type: 'quality',
  313. style: {
  314. backgroundColor: '#3B83F6',
  315. borderColor: '#3B83F6',
  316. color: 'white'
  317. },
  318. icon: 'el-icon-s-order'
  319. },
  320. {
  321. label: '试验WBS',
  322. type: 'test',
  323. style: {
  324. backgroundColor: '#A856F8',
  325. borderColor: '#A856F8',
  326. color: 'white'
  327. },
  328. icon: 'el-icon-guide'
  329. },
  330. {
  331. label: '日志WBS',
  332. type: 'log',
  333. style: {
  334. backgroundColor: '#6367F1',
  335. borderColor: '#6367F1',
  336. color: 'white'
  337. },
  338. icon: 'el-icon-notebook-1'
  339. },
  340. {
  341. label: '计量WBS',
  342. type: 'measure',
  343. style: {
  344. backgroundColor: '#E7B214',
  345. borderColor: '#E7B214',
  346. color: 'white'
  347. },
  348. icon: 'el-icon-files'
  349. },
  350. {
  351. label: '征拆WBS',
  352. type: 'split',
  353. style: {
  354. backgroundColor: '#EC489A',
  355. borderColor: '#EC489A',
  356. color: 'white'
  357. },
  358. icon: 'el-icon-s-order'
  359. }
  360. ],
  361. sortContractVisible: false, // 合同段排序弹窗
  362. sortContractList: [],
  363. sortTitle: '合同段排序',
  364. sortProLoad: false,
  365. }
  366. },
  367. computed: {
  368. ...mapGetters(["userInfo"]),
  369. },
  370. components: {
  371. ContractSort
  372. },
  373. created () {
  374. this.init();
  375. //console.log(this.userInfo)
  376. },
  377. methods: {
  378. init () {
  379. this.getProjectList();
  380. this.getProjectPageList();
  381. },
  382. searchChange () {
  383. this.page.currentPage = 1;
  384. this.getProjectPageList();
  385. },
  386. generateTagItems(wbsTypes){
  387. const typeToLabelMap = {
  388. 1: '质检',
  389. 2: '试验',
  390. 3: '日志',
  391. 4: '计量',
  392. 5: '征拆',
  393. };
  394. let tagItems = [];
  395. wbsTypes.forEach(type => {
  396. // 检查type是否在映射关系中存在
  397. if (typeToLabelMap.hasOwnProperty(type)) {
  398. // 如果存在,则创建一个新的对象并添加到tagItems数组中
  399. tagItems.push({
  400. type: type,
  401. label: typeToLabelMap[type]
  402. });
  403. }
  404. });
  405. return tagItems;
  406. },
  407. handleWbsClick(type) {
  408. switch (type) {
  409. case 'quality':
  410. this.editTree();
  411. break;
  412. case 'test':
  413. this.testTree();
  414. break;
  415. case 'log':
  416. this.editLogTree();
  417. break;
  418. case 'measure':
  419. this.measureTree();
  420. break;
  421. case 'split':
  422. this.splitTree();
  423. break;
  424. }
  425. },
  426. getProjectList () {
  427. getProjectListPage({
  428. current:1,
  429. size:999,
  430. ...this.searchForm
  431. }).then((res) => {
  432. this.projectList = res.data.data.records;
  433. })
  434. },
  435. getProjectPageList () {
  436. this.getPageLoading = true;
  437. getProjectListPage(
  438. {
  439. ...this.searchForm,
  440. current: this.page.currentPage,
  441. size: this.page.pageSize,
  442. }
  443. ).then((res) => {
  444. this.getPageLoading = false;
  445. this.projectPageList = res.data.data.records;
  446. this.page.total = res.data.data.total;
  447. })
  448. },
  449. projectClick (item) {
  450. this.curProjiect = item;
  451. findContractByProjectId(this.curProjiect.id).then((res) => {
  452. this.contractList = res.data.data;
  453. })
  454. this.projectVisible = true;
  455. },
  456. handleCurrentChange (val) {
  457. this.getProjectPageList();
  458. this.page.currentPage = val;
  459. },
  460. addContract () {
  461. this.$router.push({
  462. path: '/contract/detail',
  463. query: { pid: this.curProjiect.id }
  464. });
  465. },
  466. editContract (item) {
  467. this.$router.push({
  468. path: '/contract/detail1',
  469. query: {
  470. pid: item.pid,
  471. cid: item.id,
  472. contractType: item.contractType
  473. }
  474. });
  475. },
  476. editProject () {
  477. this.$router.push({
  478. path: '/manager/projectinfo/detail',
  479. query: {
  480. id: this.curProjiect.id
  481. }
  482. });
  483. },
  484. contractDetail (item, type, contractType) {
  485. this.$router.push({
  486. path: '/contract/detail',
  487. query: {
  488. pid: item.pid,
  489. cid: item.id,
  490. type,
  491. contractType
  492. }
  493. })
  494. },
  495. testTree () {
  496. this.$router.push({
  497. path: '/project/tree',
  498. query: {
  499. pid: this.curProjiect.id,
  500. wbsid: this.curProjiect.referenceWbsTemplateIdTrial,
  501. projectName:this.curProjiect.projectName,
  502. type: 2
  503. }
  504. });
  505. },
  506. splitTree () {
  507. this.$router.push({
  508. path: '/project/tree',
  509. query: {
  510. pid: this.curProjiect.id,
  511. wbsid: this.curProjiect.referenceWbsTemplateIdLar,
  512. projectName:this.curProjiect.projectName,
  513. type: 5
  514. }
  515. });
  516. },
  517. measureTree(){
  518. this.$router.push({
  519. path: '/project/tree',
  520. query: {
  521. pid: this.curProjiect.id,
  522. wbsid: this.curProjiect.referenceWbsTemplateIdMeter,
  523. projectName:this.curProjiect.projectName,
  524. type: 3
  525. }
  526. });
  527. },
  528. editTree () {
  529. this.$router.push({
  530. path: '/project/tree',
  531. query: {
  532. pid: this.curProjiect.id,
  533. wbsid: this.curProjiect.referenceWbsTemplateId,
  534. projectName:this.curProjiect.projectName
  535. }
  536. });
  537. },
  538. editLogTree () {
  539. this.$router.push({
  540. path: '/project/tree',
  541. query: {
  542. pid: this.curProjiect.id,
  543. wbsid: this.curProjiect.referenceLogWbsTemplateId,
  544. projectName:this.curProjiect.projectName,
  545. type: 4
  546. }
  547. });
  548. },
  549. delContract (item, index) {
  550. this.$confirm('是否删除【' + item.contractName + '】?', '提示', {
  551. confirmButtonText: '确定',
  552. cancelButtonText: '取消',
  553. type: 'warning'
  554. }).then(() => {
  555. removeContractInfo(item.id).then(() => {
  556. this.$message({
  557. type: "success",
  558. message: "删除成功!"
  559. });
  560. this.contractList.splice(index, 1);
  561. })
  562. })
  563. },
  564. dellProject () {
  565. if (this.contractList.length) {
  566. this.$message({
  567. type: "warning",
  568. message: "只能删除下面无合同段的项目!"
  569. });
  570. return;
  571. }
  572. this.$confirm('是否删除【' + this.curProjiect.projectName + '】?', '提示', {
  573. confirmButtonText: '确定',
  574. cancelButtonText: '取消',
  575. type: 'warning'
  576. }).then(() => {
  577. removeProject(this.curProjiect.id).then(() => {
  578. this.$message({
  579. type: "success",
  580. message: "删除成功!"
  581. });
  582. //删除后当前列表为空,且不是第一页,往前翻一页
  583. if(this.projectPageList.length == 1 && this.page.currentPage >1){
  584. this.page.currentPage--;
  585. }
  586. this.getProjectPageList();
  587. this.projectVisible = false;
  588. })
  589. })
  590. },
  591. getFont (type) {
  592. if (type == 1) {
  593. return '施';
  594. } else if (type == 2) {
  595. return '监';
  596. } else if (type == 3) {
  597. return '业';
  598. }
  599. return '';
  600. },
  601. getAvatarBg (type) {
  602. if (type == 1) {
  603. return { 'abg1': true };
  604. } else if (type == 2) {
  605. return { 'abg2': true };
  606. } else if (type == 3) {
  607. return { 'abg3': true };
  608. }
  609. return {};
  610. },
  611. getBg (index) {
  612. let num = Math.trunc(index / 4);
  613. if ((num % 2) === 0) {//判定条件余数为0时为偶数
  614. return {
  615. 'bg1': true
  616. }
  617. } else {
  618. return {
  619. 'bg2': true
  620. }
  621. }
  622. },
  623. wbsManage () {//wbs树管理按钮
  624. this.$router.push('/manager/privateWBS/' + 111)
  625. },
  626. //同步
  627. syncLedger () {
  628. this.$router.push('/manager/projectinfo/ledger' )
  629. },
  630. toggleLike(item){
  631. collectProject({projectId:item.id}).then((res) => {
  632. console.log(res,'res');
  633. item.load=false
  634. if(res.data.code==200){
  635. this.$message.success(res.data.msg)
  636. this.getProjectPageList();
  637. }else{
  638. this.$message.error(res.data.msg)
  639. }
  640. })
  641. },
  642. searchByCollect(){
  643. if(this.searchForm.isCollect){
  644. this.searchForm.isCollect = 0
  645. }else{
  646. this.searchForm.isCollect = 1
  647. }
  648. this.getProjectPageList();
  649. this.getProjectList();
  650. },
  651. //合同段排序
  652. sortContract(){
  653. // this.sortContractVisible = true;
  654. this.sortContractList = JSON.parse(JSON.stringify(this.contractList));
  655. this.sortTitle = '合同段排序';
  656. this.$nextTick(() => {
  657. this.$refs.contractSortRef.show(this.sortContractList);
  658. });
  659. },
  660. // 处理排序确认
  661. handleSortConfirm(sortedList) {
  662. // 这里处理排序后的数据
  663. console.log('排序后的列表:', sortedList);
  664. // TODO: 调用接口保存排序结果
  665. this.contractList = [...sortedList];
  666. const ids = this.contractList.map(item => item.id);
  667. this. saveSort(ids);
  668. },
  669. sortPro(){
  670. this.sortContractList = JSON.parse(JSON.stringify(this.projectList));
  671. if(this.searchForm.isCollect===0){
  672. this.sortTitle = '收藏项目排序';
  673. }else{
  674. this.sortTitle = '项目排序';
  675. }
  676. this.$nextTick(() => {
  677. this.$refs.contractSortRef.show(this.sortContractList);
  678. });
  679. },
  680. saveSort(ids){
  681. if(this.sortTitle==='项目排序'){
  682. this.sortProLoad= true;
  683. if(this.searchForm.isCollect===0){
  684. sortProject(ids).then((res) => {
  685. this.sortProLoad= false;
  686. if(res.data.code==200){
  687. this.$message.success(res.data.msg)
  688. this.getProjectPageList();
  689. }else{
  690. this.$message.error(res.data.msg)
  691. }
  692. })
  693. }else{
  694. sortProjectCollect(ids).then((res) => {
  695. this.sortProLoad= false;
  696. if(res.data.code==200){
  697. this.$message.success(res.data.msg)
  698. this.getProjectPageList();
  699. }else{
  700. this.$message.error(res.data.msg)
  701. }
  702. })
  703. }
  704. }else {
  705. sortContract(ids).then((res) => {
  706. this.sortProLoad= false;
  707. if(res.data.code==200){
  708. this.$message.success(res.data.msg)
  709. // this.getProjectPageList();
  710. findContractByProjectId(this.curProjiect.id).then((res) => {
  711. this.contractList = res.data.data;
  712. })
  713. }else{
  714. this.$message.error(res.data.msg)
  715. }
  716. })
  717. }
  718. }
  719. }
  720. };
  721. </script>
  722. <style scoped lang="scss">
  723. .pro-container {
  724. height: 100%;
  725. width: 100%;
  726. display: flex;
  727. flex-direction: column;
  728. .search-box {
  729. // padding: 0 !important; /* 取消内边距 */
  730. height: auto !important; /* 取消固定高度 */
  731. min-height: auto !important; /* 取消最小高度 */
  732. display: flex;
  733. align-items: center; /* 垂直居中 */
  734. flex-wrap: wrap; /* 允许换行 */
  735. .search-box-item-title {
  736. flex: 1; /* 输入框占据剩余空间 */
  737. min-width: 200px; /* 最小宽度 */
  738. }
  739. .ml-10 {
  740. margin-left: 10px;
  741. }
  742. }
  743. .footer-box{
  744. display: flex;
  745. align-items: center; /* 垂直居中 */
  746. justify-content: center;
  747. }
  748. }
  749. /* 自定义按钮样式 */
  750. .custom-primary-btn {
  751. background-color: #2550A2 !important;
  752. border-color: #2550A2 !important;
  753. }
  754. /* 项目列表容器样式 */
  755. .project-list-container {
  756. display: grid;
  757. grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  758. gap: 20px;
  759. padding: 15px;
  760. }
  761. /* 项目卡片样式 */
  762. .project-card {
  763. cursor: pointer;
  764. transition: all 0.3s ease;
  765. border-radius: 8px;
  766. }
  767. .project-card:hover {
  768. transform: translateY(-5px);
  769. box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  770. }
  771. .project-top{
  772. display: flex;
  773. justify-content: space-between; /* 左右对齐 */
  774. align-items: center; /* 垂直居中 */
  775. margin-bottom: 10px;
  776. }
  777. .project-title {
  778. font-size: 16px;
  779. font-weight: bold;
  780. color: #333;
  781. white-space: nowrap;
  782. overflow: hidden;
  783. text-overflow: ellipsis;
  784. width: 100%; /* 确保宽度限制 */
  785. }
  786. .project-info {
  787. font-size: 14px;
  788. color: black;
  789. }
  790. .info-label {
  791. //font-weight: bold;
  792. color: black;
  793. display: inline-block;
  794. margin-bottom: 5px;
  795. }
  796. .project-actions{
  797. display: flex;
  798. align-items: center;
  799. justify-content: space-between;
  800. }
  801. /* 搜索框样式 */
  802. .search-box {
  803. display: flex;
  804. align-items: center;
  805. padding: 15px;
  806. background-color: #f5f7fa;
  807. border-bottom: 1px solid #e6e6e6;
  808. }
  809. .ml-10 {
  810. margin-left: 10px;
  811. }
  812. .mr-5 {
  813. margin-right: 5px;
  814. }
  815. .mr-3 {
  816. margin-right: 3px;
  817. }
  818. .mt-15 {
  819. margin-top: 15px;
  820. }
  821. .mg-b-15 {
  822. margin-bottom: 15px;
  823. }
  824. /* 更彻底的透明效果 */
  825. </style>
  826. <style lang="scss">
  827. /* 自定义按钮样式 */
  828. .custom-primary-btn {
  829. background-color: #2550A2 !important;
  830. border-color: #2550A2 !important;
  831. }
  832. .ellipsis-tag {
  833. // max-width:220px; /* 设置最大宽度 */
  834. overflow: hidden;
  835. margin-right: 4px;
  836. .el-tag__content {
  837. display: inline-block;
  838. max-width: 100%;
  839. overflow: hidden;
  840. text-overflow: ellipsis;
  841. white-space: nowrap;
  842. }
  843. }
  844. .ellipsis-tag1 {
  845. max-width:220px; /* 设置最大宽度 */
  846. overflow: hidden;
  847. margin-right: 4px;
  848. .el-tag__content {
  849. display: inline-block;
  850. max-width: 100%;
  851. overflow: hidden;
  852. text-overflow: ellipsis;
  853. white-space: nowrap;
  854. }
  855. }
  856. /* 确保 tooltip 的最大宽度 */
  857. .el-tooltip__popper {
  858. max-width: 300px;
  859. word-break: break-all;
  860. }
  861. /* 完全透明分页样式 */
  862. .footer-box {
  863. display: flex;
  864. justify-content: center;
  865. align-items: center;
  866. padding: 10px 0;
  867. background: transparent;
  868. }
  869. /* 移除所有按钮和页码的背景色 */
  870. .transparent-pagination .btn-prev,
  871. .transparent-pagination .btn-next,
  872. .transparent-pagination .el-pager li {
  873. background: transparent !important;
  874. border: none !important;
  875. }
  876. /* 移除鼠标悬停时的背景色 */
  877. .transparent-pagination .btn-prev:hover,
  878. .transparent-pagination .btn-next:hover,
  879. .transparent-pagination .el-pager li:hover {
  880. background: transparent !important;
  881. }
  882. /* 移除当前选中页的背景色,仅保留文字颜色 */
  883. .transparent-pagination .el-pager li.active {
  884. background: transparent !important;
  885. color: #409EFF; /* 选中页的文字颜色 */
  886. }
  887. /* 移除整个分页组件的背景 */
  888. .transparent-pagination {
  889. background: transparent !important;
  890. }
  891. .custom-ellipse-tag {
  892. border-radius: 15px !important;
  893. padding: 0 8px !important;
  894. margin-right: 8px !important;
  895. height: 24px;
  896. line-height: 24px;
  897. display: inline-flex;
  898. align-items: center;
  899. color: white !important; /* 文字颜色统一为白色 */
  900. border: none !important;
  901. }
  902. .custom-ellipse-tag1{
  903. border-radius: 15px !important;
  904. padding: 8px 8px !important;
  905. margin-right: 8px !important;
  906. height: 24px;
  907. line-height: 24px;
  908. display: inline-flex;
  909. align-items: center;
  910. border: none !important;
  911. }
  912. /* 根据 type 设置背景色 */
  913. .custom-tag-type-1 {
  914. background-color: #3B83F6 !important; /* 质检 - 蓝色 */
  915. }
  916. .custom-tag-type-2 {
  917. background-color: #A856F8 !important; /* 试验 - 紫色 */
  918. }
  919. .custom-tag-type-3 {
  920. background-color: #6367F1 !important; /* 日志 - 靛蓝 */
  921. }
  922. .custom-tag-type-4 {
  923. background-color: #E7B214 !important; /* 计量 - 黄色 */
  924. }
  925. .custom-tag-type-5 {
  926. background-color: #EC489A !important; /* 征拆 - 粉色 */
  927. }
  928. .custom-tag-type-6 {
  929. background-color: blue !important; /* 征拆 - 粉色 */
  930. }
  931. /* 图标样式 */
  932. .custom-ellipse-tag .el-icon-success {
  933. margin-right: 4px;
  934. font-size: 12px;
  935. }
  936. /* 图标样式 */
  937. .custom-ellipse-tag .el-icon-success {
  938. margin-right: 4px;
  939. font-size: 12px;
  940. }
  941. .project-dialog {
  942. .el-dialog__body {
  943. color: black;
  944. padding: 10px 20px 20px 20px !important;
  945. }
  946. .el-dialog__header {
  947. border-bottom: 1px solid #e6e6e6;
  948. }
  949. }
  950. .custom-header {
  951. background-color: #F2F3F5 !important;
  952. }
  953. </style>