list.vue 31 KB

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