Td1.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. <template>
  2. <div>
  3. <div class="title">
  4. <p>巡查人员设置</p>
  5. </div>
  6. <table class="border">
  7. <tr>
  8. <td class="th">巡查人员</td>
  9. <td>
  10. <div class="xcryFlex">
  11. <el-select
  12. v-model="xcryModel"
  13. collapse-tags
  14. multiple
  15. placeholder="请选择"
  16. :popper-append-to-body="false"
  17. >
  18. <el-option
  19. v-for="item in options"
  20. :key="item.value"
  21. :label="item.label"
  22. :value="item.value"
  23. >
  24. </el-option>
  25. </el-select>
  26. <div class="btn" @click="xcryAddDk">
  27. <img src="@/assets/images/bjybz/save2.png" alt="" />
  28. <p>保存</p>
  29. </div>
  30. </div>
  31. </td>
  32. </tr>
  33. </table>
  34. <div class="title">
  35. <p>巡查信息</p>
  36. </div>
  37. <table class="border">
  38. <tr>
  39. <td class="th">巡查时间</td>
  40. <td>
  41. <el-input
  42. size="medium"
  43. v-model="sumbitObj.xcsj"
  44. placeholder="请输入"
  45. disabled
  46. ></el-input>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td class="th">巡查人员</td>
  51. <td>
  52. <el-input
  53. size="medium"
  54. v-model="sumbitObj.xcryName"
  55. placeholder="请输入"
  56. disabled
  57. ></el-input>
  58. </td>
  59. </tr>
  60. <tr>
  61. <td class="th">联系电话</td>
  62. <td>
  63. <!-- <el-input size="medium" v-model="sumbitObj.dkwz" placeholder="请输入"></el-input> -->
  64. <el-input
  65. size="medium"
  66. v-model="sumbitObj.xcryMobile"
  67. placeholder="请输入"
  68. disabled
  69. ></el-input>
  70. </td>
  71. </tr>
  72. <tr>
  73. <td class="th">现状描述</td>
  74. <td class="tdHeight">
  75. <el-input
  76. type="textarea"
  77. :autosize="true"
  78. v-model="sumbitObj.xzms"
  79. placeholder="请输入"
  80. disabled
  81. ></el-input>
  82. </td>
  83. </tr>
  84. </table>
  85. <div class="title">
  86. <p>现场照片(3)</p>
  87. </div>
  88. <div class="xzzpBox" v-if="carouselImgs.length > 0">
  89. <el-carousel type="card" :autoplay="false">
  90. <el-carousel-item v-for="(item, index) in carouselImgs" :key="index">
  91. <div class="imageFlex">
  92. <img :src="item" preview="1" />
  93. </div>
  94. </el-carousel-item>
  95. </el-carousel>
  96. </div>
  97. <div class="xzzpBox xzzpBoxFlex" v-else>
  98. <p>暂无</p>
  99. </div>
  100. <div v-if="true">
  101. <div class="title">
  102. <p>历史巡查记录</p>
  103. </div>
  104. <div class="xcjl">
  105. <el-collapse v-model="activeName" accordion @change="collapseChange">
  106. <el-collapse-item
  107. v-for="(item, index) in collapseList"
  108. :name="index"
  109. :key="index"
  110. >
  111. <template slot="title">
  112. <div class="headTitle">
  113. <h4>
  114. 巡查时间:<span>{{ item.xcsj }}</span>
  115. </h4>
  116. </div>
  117. </template>
  118. <div class="collapseContent">
  119. <table>
  120. <tr>
  121. <td>联系人</td>
  122. <td>{{ item.xcryName }}</td>
  123. </tr>
  124. <tr>
  125. <td>联系电话</td>
  126. <td>{{ item.xcryMobile }}</td>
  127. </tr>
  128. <tr>
  129. <td>现状描述</td>
  130. <td>{{ item.xzms }}</td>
  131. </tr>
  132. <tr style="height:68px">
  133. <td>现场照片</td>
  134. <td>
  135. <div class="xczpFlex">
  136. <img
  137. v-for="l in item.imgList"
  138. :src="l.imgSrc"
  139. preview="2"
  140. />
  141. </div>
  142. </td>
  143. </tr>
  144. </table>
  145. </div>
  146. </el-collapse-item>
  147. </el-collapse>
  148. </div>
  149. </div>
  150. </div>
  151. </template>
  152. <script>
  153. export default {
  154. name: 'Td1',
  155. components: {},
  156. props: {
  157. obj: {
  158. type: Object,
  159. default() {
  160. return {};
  161. },
  162. },
  163. },
  164. data() {
  165. return {
  166. xcryModel: [],
  167. options: [],
  168. srcList: [],
  169. carouselImgs: [],
  170. activeName: 0,
  171. collapseList: [],
  172. sumbitObj: {},
  173. };
  174. },
  175. mounted() {
  176. let users = JSON.parse(localStorage.getItem('userInfo'));
  177. this.initTableList(users.nickName);
  178. this.initAjax();
  179. this.xcryXcryInit();
  180. },
  181. methods: {
  182. initAjax() {
  183. let url = '/api/xcjl/getListByDksyh';
  184. let params = {
  185. dksyh: this.obj.dksyh,
  186. };
  187. this.$ajax.get(url, params, this, false).then((res) => {
  188. if (res.data) {
  189. if (res.data.length > 0) {
  190. this.sumbitObj = res.data[0];
  191. this.initImgs(res.data[0].imgList);
  192. }
  193. this.collapseList = res.data;
  194. this.collapseList.forEach((item, index) => {
  195. item.imgList.forEach((l, i) => {
  196. this.exportUrl(l.fileId).then((result) => {
  197. const imageUrl =
  198. 'data:image/png;base64,' +
  199. Buffer.from(result['data'], 'base64').toString('base64');
  200. // l.imgSrc = imageUrl;
  201. this.collapseList[index].imgList[i].imgSrc = imageUrl;
  202. this.$forceUpdate();
  203. this.$previewRefresh();
  204. });
  205. });
  206. });
  207. }
  208. });
  209. },
  210. initImgs(data) {
  211. let list = JSON.parse(JSON.stringify(data));
  212. list.forEach((item) => {
  213. this.exportUrl(item.fileId).then((result) => {
  214. const imageUrl =
  215. 'data:image/png;base64,' +
  216. Buffer.from(result['data'], 'base64').toString('base64');
  217. item.imgSrc = imageUrl;
  218. this.carouselImgs.push(imageUrl);
  219. this.$previewRefresh();
  220. });
  221. });
  222. },
  223. async exportUrl(fileId) {
  224. var params = new FormData();
  225. let url = '/api/oss/download?id' + '=' + fileId;
  226. return await this.$ajax.downFileByGet(url, params, this, true, false);
  227. },
  228. xcryAddDk() {
  229. let url = '/api/xcry/add-dk';
  230. let params = {
  231. dksyh: this.obj.dksyh,
  232. xcryId: this.xcryModel.join(','),
  233. };
  234. this.$ajax.get(url, params, this, false).then((res) => {
  235. if (res.data) {
  236. this.$message.success('保存成功!');
  237. }
  238. });
  239. },
  240. xcryXcryInit() {
  241. let url = '/api/xcry/getXcryByDksyh';
  242. let params = {
  243. dksyh: this.obj.dksyh,
  244. };
  245. this.$ajax.get(url, params, this, false).then((res) => {
  246. if (res.data) {
  247. let arr = [];
  248. for (let i = 0; i < res.data.length; i++) {
  249. arr.push(res.data[i].xcry);
  250. }
  251. this.xcryModel = arr;
  252. }
  253. });
  254. },
  255. initTableList(gddw) {
  256. let url = '/api/xcry/listByGddw?gddw=' + gddw;
  257. this.$ajax.get(url, {}, this, false).then((res) => {
  258. if (res.data) {
  259. for (let i = 0; i < res.data.length; i++) {
  260. let obj = {
  261. label: res.data[i].xcry,
  262. value: res.data[i].id,
  263. };
  264. this.options.push(obj);
  265. }
  266. }
  267. });
  268. },
  269. collapseChange(array) {},
  270. yjsqClick() {
  271. this.$refs.yjsqRef.yjsqDetailShow = true;
  272. },
  273. },
  274. };
  275. </script>
  276. <style scoped lang="scss">
  277. .title {
  278. margin-bottom: 10px;
  279. p {
  280. color: #1bf1ff;
  281. font-size: 16px;
  282. }
  283. }
  284. .xzzpBox {
  285. width: 100%;
  286. height: 170px;
  287. border: 1px solid #2c64a1;
  288. margin-bottom: 10px;
  289. ::v-deep .imageFlex {
  290. display: flex;
  291. align-items: center;
  292. justify-content: center;
  293. img {
  294. width: 100%;
  295. height: 100%;
  296. }
  297. }
  298. }
  299. .xzzpBoxFlex {
  300. display: flex;
  301. align-items: center;
  302. justify-content: center;
  303. p {
  304. color: #fff;
  305. font-size: 16px;
  306. }
  307. }
  308. .xcjl {
  309. width: 100%;
  310. height: calc(200px);
  311. overflow-y: auto;
  312. }
  313. table {
  314. width: 100%;
  315. margin: 5px 0;
  316. position: relative;
  317. &.border {
  318. border-right: 1px solid #2b6da7;
  319. border-bottom: 1px solid #2b6da7;
  320. tr {
  321. .th {
  322. text-align: center;
  323. color: #a5daff;
  324. background: #0e4380;
  325. width: 146px;
  326. padding-left: 0px;
  327. }
  328. td {
  329. color: #fff;
  330. border-left: 1px solid #2b6da7;
  331. border-top: 1px solid #2b6da7;
  332. // padding-left: 10px;
  333. position: relative;
  334. ::v-deep .el-input {
  335. input {
  336. border: none;
  337. }
  338. }
  339. .file-item-wrapper {
  340. display: inline-block;
  341. margin: 0 10px;
  342. position: relative;
  343. width: 65px;
  344. border-radius: 5px;
  345. vertical-align: top;
  346. .img-wrapper {
  347. width: 65px;
  348. height: 58px;
  349. text-align: center;
  350. img {
  351. width: 50px;
  352. height: 50px;
  353. margin-top: 5px;
  354. }
  355. }
  356. .filename {
  357. text-align: center;
  358. width: 65px;
  359. }
  360. .mask-hover-wrapper {
  361. display: none;
  362. position: absolute;
  363. top: 0;
  364. left: 0;
  365. width: 65px;
  366. height: 58px;
  367. background: rgba(0, 0, 0, 0.6);
  368. border-radius: 5px;
  369. cursor: pointer;
  370. text-align: center;
  371. line-height: 58px;
  372. padding-top: 5px;
  373. .el-icon-delete {
  374. font-size: 25px;
  375. color: #fff;
  376. &:hover {
  377. color: #409eff;
  378. }
  379. }
  380. }
  381. &:hover .mask-hover-wrapper {
  382. display: inline-block;
  383. }
  384. }
  385. ::v-deep .avatar-uploader {
  386. display: inline-block;
  387. margin-top: 10px;
  388. // vertical-align: super;
  389. .el-upload {
  390. border: 1px dashed #d9d9d9;
  391. border-radius: 5px;
  392. cursor: pointer;
  393. position: relative;
  394. overflow: hidden;
  395. &:hover {
  396. border-color: #409eff;
  397. }
  398. .avatar-uploader-icon {
  399. font-size: 24px;
  400. color: #fff;
  401. width: 50px;
  402. height: 50px;
  403. line-height: 50px;
  404. text-align: center;
  405. }
  406. }
  407. }
  408. }
  409. }
  410. }
  411. tr {
  412. height: 40px;
  413. th {
  414. font-size: 16px;
  415. color: rgba(135, 193, 255, 1);
  416. }
  417. td {
  418. ::v-deep .el-input {
  419. input {
  420. color: rgba(135, 193, 255, 1);
  421. background: transparent;
  422. border: 1px solid #4f91d7;
  423. &::-webkit-input-placeholder {
  424. /* WebKit browsers,webkit内核浏览器 */
  425. color: rgba(135, 193, 255, 0.8);
  426. }
  427. &:-moz-placeholder {
  428. /* Mozilla Firefox 4 to 18 */
  429. color: rgba(135, 193, 255, 0.8);
  430. }
  431. &::-moz-placeholder {
  432. /* Mozilla Firefox 19+ */
  433. color: rgba(135, 193, 255, 0.8);
  434. }
  435. &:-ms-input-placeholder {
  436. /* Internet Explorer 10+ */
  437. color: rgba(135, 193, 255, 0.8);
  438. }
  439. }
  440. }
  441. ::v-deep .el-radio-group {
  442. label {
  443. color: rgba(135, 193, 255, 1);
  444. }
  445. }
  446. }
  447. }
  448. }
  449. ::v-deep .tdHeight {
  450. textarea {
  451. white-space: pre-wrap;
  452. color: rgba(135, 193, 255, 1) !important;
  453. word-break: break-all;
  454. background-color: transparent !important;
  455. border: 0;
  456. &::-webkit-input-placeholder {
  457. /* WebKit browsers,webkit内核浏览器 */
  458. color: rgba(135, 193, 255, 0.8);
  459. }
  460. &:-moz-placeholder {
  461. /* Mozilla Firefox 4 to 18 */
  462. color: rgba(135, 193, 255, 0.8);
  463. }
  464. &::-moz-placeholder {
  465. /* Mozilla Firefox 19+ */
  466. color: rgba(135, 193, 255, 0.8);
  467. }
  468. &:-ms-input-placeholder {
  469. /* Internet Explorer 10+ */
  470. color: rgba(135, 193, 255, 0.8);
  471. }
  472. }
  473. }
  474. ::v-deep .el-input {
  475. input {
  476. color: rgba(135, 193, 255, 1) !important;
  477. background: transparent !important;
  478. border: 1px solid #4f91d7;
  479. &::-webkit-input-placeholder {
  480. /* WebKit browsers,webkit内核浏览器 */
  481. color: rgba(135, 193, 255, 0.8) !important;
  482. }
  483. &:-moz-placeholder {
  484. /* Mozilla Firefox 4 to 18 */
  485. color: rgba(135, 193, 255, 0.8) !important;
  486. }
  487. &::-moz-placeholder {
  488. /* Mozilla Firefox 19+ */
  489. color: rgba(135, 193, 255, 0.8) !important;
  490. }
  491. &:-ms-input-placeholder {
  492. /* Internet Explorer 10+ */
  493. color: rgba(135, 193, 255, 0.8) !important;
  494. }
  495. }
  496. }
  497. .is-disabled {
  498. input {
  499. background-color: transparent;
  500. }
  501. }
  502. ::v-deep .xzzpBox {
  503. .el-carousel {
  504. height: 100%;
  505. .el-carousel__container {
  506. height: calc(100% - 30px);
  507. }
  508. }
  509. }
  510. .el-carousel__item h3 {
  511. color: #475669;
  512. font-size: 14px;
  513. opacity: 0.75;
  514. line-height: 200px;
  515. margin: 0;
  516. }
  517. .el-carousel__item:nth-child(2n) {
  518. background-color: #99a9bf;
  519. }
  520. .el-carousel__item:nth-child(2n + 1) {
  521. background-color: #d3dce6;
  522. }
  523. ::v-deep .xcjl {
  524. .el-collapse {
  525. color: #fff;
  526. border-top: 1px solid #2c64a1;
  527. border-bottom: 1px solid #2c64a1;
  528. border: 1px solid #2c64a1;
  529. .el-icon-arrow-right {
  530. }
  531. .el-collapse-item__arrow {
  532. color: #fff;
  533. }
  534. .headTitle {
  535. width: 100%;
  536. display: flex;
  537. align-items: center;
  538. justify-content: space-between;
  539. h4 {
  540. font-size: 16px;
  541. font-weight: 400;
  542. color: #afdcff;
  543. span {
  544. color: #fff;
  545. }
  546. }
  547. p {
  548. color: #fff;
  549. }
  550. }
  551. .el-collapse-item__header {
  552. background-color: transparent;
  553. border-bottom: 1px solid #2c64a1;
  554. padding: 0 20px;
  555. }
  556. .el-collapse-item__wrap {
  557. background-color: transparent;
  558. border-bottom: 1px solid #2c64a1;
  559. }
  560. .el-collapse-item__content {
  561. padding-bottom: 0;
  562. }
  563. .collapseContent {
  564. width: 100%;
  565. height: 100%;
  566. padding: 15px;
  567. table {
  568. border: none;
  569. border-collapse: collapse;
  570. tr {
  571. td {
  572. color: #fff;
  573. border: 1px solid #2c64a1;
  574. }
  575. td:nth-child(1) {
  576. text-align: right;
  577. padding-right: 15px;
  578. background-color: #0d4582;
  579. color: #afdcff;
  580. width: 120px;
  581. }
  582. td:nth-child(2) {
  583. text-align: left;
  584. padding-left: 15px;
  585. }
  586. }
  587. }
  588. .xczpFlex {
  589. width: 100%;
  590. height: 50px;
  591. overflow: hidden;
  592. display: flex;
  593. align-items: center;
  594. overflow-x: auto;
  595. img {
  596. width: 50px;
  597. height: 50px;
  598. margin: 5px 10px;
  599. }
  600. }
  601. }
  602. span {
  603. color: #fff;
  604. }
  605. h4 {
  606. color: #fff;
  607. }
  608. }
  609. }
  610. ::v-deep .el-select {
  611. width: 75%;
  612. .el-tag--info {
  613. background-color: #409eff;
  614. border: 1px solid #0d4582;
  615. color: #fff;
  616. .el-tag__close {
  617. color: #fff;
  618. }
  619. }
  620. }
  621. .btn {
  622. display: flex;
  623. align-items: center;
  624. justify-content: center;
  625. padding: 0 4px;
  626. height: 26px;
  627. background: #177fde;
  628. border-radius: 4px 4px 4px 4px;
  629. opacity: 1;
  630. border: 1px solid #25b0ec;
  631. cursor: pointer;
  632. p {
  633. color: #fff;
  634. margin-left: 5px;
  635. }
  636. }
  637. .xcryFlex {
  638. display: flex;
  639. align-items: center;
  640. justify-content: space-between;
  641. }
  642. ::v-deep .el-select-dropdown {
  643. background-color: #264584;
  644. border: 1px solid #2c64a1;
  645. .el-select-dropdown__item {
  646. span {
  647. color: #1bf1ff;
  648. }
  649. }
  650. .selected {
  651. background-color: #2363ae !important;
  652. span {
  653. color: #1bf1ff;
  654. }
  655. }
  656. .hover {
  657. background-color: #2363ae !important;
  658. }
  659. .popper__arrow {
  660. border-bottom-color: #2c64a1;
  661. }
  662. .popper__arrow::after {
  663. border-bottom-color: #264584;
  664. }
  665. }
  666. </style>