123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684 |
- <template>
- <div>
- <div class="title">
- <p>巡查人员设置</p>
- </div>
- <table class="border">
- <tr>
- <td class="th">巡查人员</td>
- <td>
- <div class="xcryFlex">
- <el-select
- v-model="xcryModel"
- collapse-tags
- multiple
- placeholder="请选择"
- :popper-append-to-body="false"
- >
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- <div class="btn" @click="xcryAddDk">
- <img src="@/assets/images/bjybz/save2.png" alt="" />
- <p>保存</p>
- </div>
- </div>
- </td>
- </tr>
- </table>
- <div class="title">
- <p>巡查信息</p>
- </div>
- <table class="border">
- <tr>
- <td class="th">巡查时间</td>
- <td>
- <el-input
- size="medium"
- v-model="sumbitObj.xcsj"
- placeholder="请输入"
- disabled
- ></el-input>
- </td>
- </tr>
- <tr>
- <td class="th">巡查人员</td>
- <td>
- <el-input
- size="medium"
- v-model="sumbitObj.xcryName"
- placeholder="请输入"
- disabled
- ></el-input>
- </td>
- </tr>
- <tr>
- <td class="th">联系电话</td>
- <td>
- <!-- <el-input size="medium" v-model="sumbitObj.dkwz" placeholder="请输入"></el-input> -->
- <el-input
- size="medium"
- v-model="sumbitObj.xcryMobile"
- placeholder="请输入"
- disabled
- ></el-input>
- </td>
- </tr>
- <tr>
- <td class="th">现状描述</td>
- <td class="tdHeight">
- <el-input
- type="textarea"
- :autosize="true"
- v-model="sumbitObj.xzms"
- placeholder="请输入"
- disabled
- ></el-input>
- </td>
- </tr>
- </table>
- <div class="title">
- <p>现场照片(3)</p>
- </div>
- <div class="xzzpBox" v-if="carouselImgs.length > 0">
- <el-carousel type="card" :autoplay="false">
- <el-carousel-item v-for="(item, index) in carouselImgs" :key="index">
- <div class="imageFlex">
- <img :src="item" preview="1" />
- </div>
- </el-carousel-item>
- </el-carousel>
- </div>
- <div class="xzzpBox xzzpBoxFlex" v-else>
- <p>暂无</p>
- </div>
- <div v-if="true">
- <div class="title">
- <p>历史巡查记录</p>
- </div>
- <div class="xcjl">
- <el-collapse v-model="activeName" accordion @change="collapseChange">
- <el-collapse-item
- v-for="(item, index) in collapseList"
- :name="index"
- :key="index"
- >
- <template slot="title">
- <div class="headTitle">
- <h4>
- 巡查时间:<span>{{ item.xcsj }}</span>
- </h4>
- </div>
- </template>
- <div class="collapseContent">
- <table>
- <tr>
- <td>联系人</td>
- <td>{{ item.xcryName }}</td>
- </tr>
- <tr>
- <td>联系电话</td>
- <td>{{ item.xcryMobile }}</td>
- </tr>
- <tr>
- <td>现状描述</td>
- <td>{{ item.xzms }}</td>
- </tr>
- <tr style="height:68px">
- <td>现场照片</td>
- <td>
- <div class="xczpFlex">
- <img
- v-for="l in item.imgList"
- :src="l.imgSrc"
- preview="2"
- />
- </div>
- </td>
- </tr>
- </table>
- </div>
- </el-collapse-item>
- </el-collapse>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: 'Td1',
- components: {},
- props: {
- obj: {
- type: Object,
- default() {
- return {};
- },
- },
- },
- data() {
- return {
- xcryModel: [],
- options: [],
- srcList: [],
- carouselImgs: [],
- activeName: 0,
- collapseList: [],
- sumbitObj: {},
- };
- },
- mounted() {
- let users = JSON.parse(localStorage.getItem('userInfo'));
- this.initTableList(users.nickName);
- this.initAjax();
- this.xcryXcryInit();
- },
- methods: {
- initAjax() {
- let url = '/api/xcjl/getListByDksyh';
- let params = {
- dksyh: this.obj.dksyh,
- };
- this.$ajax.get(url, params, this, false).then((res) => {
- if (res.data) {
- if (res.data.length > 0) {
- this.sumbitObj = res.data[0];
- this.initImgs(res.data[0].imgList);
- }
- this.collapseList = res.data;
- this.collapseList.forEach((item, index) => {
- item.imgList.forEach((l, i) => {
- this.exportUrl(l.fileId).then((result) => {
- const imageUrl =
- 'data:image/png;base64,' +
- Buffer.from(result['data'], 'base64').toString('base64');
- // l.imgSrc = imageUrl;
- this.collapseList[index].imgList[i].imgSrc = imageUrl;
- this.$forceUpdate();
- this.$previewRefresh();
- });
- });
- });
- }
- });
- },
- initImgs(data) {
- let list = JSON.parse(JSON.stringify(data));
- list.forEach((item) => {
- this.exportUrl(item.fileId).then((result) => {
- const imageUrl =
- 'data:image/png;base64,' +
- Buffer.from(result['data'], 'base64').toString('base64');
- item.imgSrc = imageUrl;
- this.carouselImgs.push(imageUrl);
- this.$previewRefresh();
- });
- });
- },
- async exportUrl(fileId) {
- var params = new FormData();
- let url = '/api/oss/download?id' + '=' + fileId;
- return await this.$ajax.downFileByGet(url, params, this, true, false);
- },
- xcryAddDk() {
- let url = '/api/xcry/add-dk';
- let params = {
- dksyh: this.obj.dksyh,
- xcryId: this.xcryModel.join(','),
- };
- this.$ajax.get(url, params, this, false).then((res) => {
- if (res.data) {
- this.$message.success('保存成功!');
- }
- });
- },
- xcryXcryInit() {
- let url = '/api/xcry/getXcryByDksyh';
- let params = {
- dksyh: this.obj.dksyh,
- };
- this.$ajax.get(url, params, this, false).then((res) => {
- if (res.data) {
- let arr = [];
- for (let i = 0; i < res.data.length; i++) {
- arr.push(res.data[i].xcry);
- }
- this.xcryModel = arr;
- }
- });
- },
- initTableList(gddw) {
- let url = '/api/xcry/listByGddw?gddw=' + gddw;
- this.$ajax.get(url, {}, this, false).then((res) => {
- if (res.data) {
- for (let i = 0; i < res.data.length; i++) {
- let obj = {
- label: res.data[i].xcry,
- value: res.data[i].id,
- };
- this.options.push(obj);
- }
- }
- });
- },
- collapseChange(array) {},
- yjsqClick() {
- this.$refs.yjsqRef.yjsqDetailShow = true;
- },
- },
- };
- </script>
- <style scoped lang="scss">
- .title {
- margin-bottom: 10px;
- p {
- color: #1bf1ff;
- font-size: 16px;
- }
- }
- .xzzpBox {
- width: 100%;
- height: 170px;
- border: 1px solid #2c64a1;
- margin-bottom: 10px;
- ::v-deep .imageFlex {
- display: flex;
- align-items: center;
- justify-content: center;
- img {
- width: 100%;
- height: 100%;
- }
- }
- }
- .xzzpBoxFlex {
- display: flex;
- align-items: center;
- justify-content: center;
- p {
- color: #fff;
- font-size: 16px;
- }
- }
- .xcjl {
- width: 100%;
- height: calc(200px);
- overflow-y: auto;
- }
- table {
- width: 100%;
- margin: 5px 0;
- position: relative;
- &.border {
- border-right: 1px solid #2b6da7;
- border-bottom: 1px solid #2b6da7;
- tr {
- .th {
- text-align: center;
- color: #a5daff;
- background: #0e4380;
- width: 146px;
- padding-left: 0px;
- }
- td {
- color: #fff;
- border-left: 1px solid #2b6da7;
- border-top: 1px solid #2b6da7;
- // padding-left: 10px;
- position: relative;
- ::v-deep .el-input {
- input {
- border: none;
- }
- }
- .file-item-wrapper {
- display: inline-block;
- margin: 0 10px;
- position: relative;
- width: 65px;
- border-radius: 5px;
- vertical-align: top;
- .img-wrapper {
- width: 65px;
- height: 58px;
- text-align: center;
- img {
- width: 50px;
- height: 50px;
- margin-top: 5px;
- }
- }
- .filename {
- text-align: center;
- width: 65px;
- }
- .mask-hover-wrapper {
- display: none;
- position: absolute;
- top: 0;
- left: 0;
- width: 65px;
- height: 58px;
- background: rgba(0, 0, 0, 0.6);
- border-radius: 5px;
- cursor: pointer;
- text-align: center;
- line-height: 58px;
- padding-top: 5px;
- .el-icon-delete {
- font-size: 25px;
- color: #fff;
- &:hover {
- color: #409eff;
- }
- }
- }
- &:hover .mask-hover-wrapper {
- display: inline-block;
- }
- }
- ::v-deep .avatar-uploader {
- display: inline-block;
- margin-top: 10px;
- // vertical-align: super;
- .el-upload {
- border: 1px dashed #d9d9d9;
- border-radius: 5px;
- cursor: pointer;
- position: relative;
- overflow: hidden;
- &:hover {
- border-color: #409eff;
- }
- .avatar-uploader-icon {
- font-size: 24px;
- color: #fff;
- width: 50px;
- height: 50px;
- line-height: 50px;
- text-align: center;
- }
- }
- }
- }
- }
- }
- tr {
- height: 40px;
- th {
- font-size: 16px;
- color: rgba(135, 193, 255, 1);
- }
- td {
- ::v-deep .el-input {
- input {
- color: rgba(135, 193, 255, 1);
- background: transparent;
- border: 1px solid #4f91d7;
- &::-webkit-input-placeholder {
- /* WebKit browsers,webkit内核浏览器 */
- color: rgba(135, 193, 255, 0.8);
- }
- &:-moz-placeholder {
- /* Mozilla Firefox 4 to 18 */
- color: rgba(135, 193, 255, 0.8);
- }
- &::-moz-placeholder {
- /* Mozilla Firefox 19+ */
- color: rgba(135, 193, 255, 0.8);
- }
- &:-ms-input-placeholder {
- /* Internet Explorer 10+ */
- color: rgba(135, 193, 255, 0.8);
- }
- }
- }
- ::v-deep .el-radio-group {
- label {
- color: rgba(135, 193, 255, 1);
- }
- }
- }
- }
- }
- ::v-deep .tdHeight {
- textarea {
- white-space: pre-wrap;
- color: rgba(135, 193, 255, 1) !important;
- word-break: break-all;
- background-color: transparent !important;
- border: 0;
- &::-webkit-input-placeholder {
- /* WebKit browsers,webkit内核浏览器 */
- color: rgba(135, 193, 255, 0.8);
- }
- &:-moz-placeholder {
- /* Mozilla Firefox 4 to 18 */
- color: rgba(135, 193, 255, 0.8);
- }
- &::-moz-placeholder {
- /* Mozilla Firefox 19+ */
- color: rgba(135, 193, 255, 0.8);
- }
- &:-ms-input-placeholder {
- /* Internet Explorer 10+ */
- color: rgba(135, 193, 255, 0.8);
- }
- }
- }
- ::v-deep .el-input {
- input {
- color: rgba(135, 193, 255, 1) !important;
- background: transparent !important;
- border: 1px solid #4f91d7;
- &::-webkit-input-placeholder {
- /* WebKit browsers,webkit内核浏览器 */
- color: rgba(135, 193, 255, 0.8) !important;
- }
- &:-moz-placeholder {
- /* Mozilla Firefox 4 to 18 */
- color: rgba(135, 193, 255, 0.8) !important;
- }
- &::-moz-placeholder {
- /* Mozilla Firefox 19+ */
- color: rgba(135, 193, 255, 0.8) !important;
- }
- &:-ms-input-placeholder {
- /* Internet Explorer 10+ */
- color: rgba(135, 193, 255, 0.8) !important;
- }
- }
- }
- .is-disabled {
- input {
- background-color: transparent;
- }
- }
- ::v-deep .xzzpBox {
- .el-carousel {
- height: 100%;
- .el-carousel__container {
- height: calc(100% - 30px);
- }
- }
- }
- .el-carousel__item h3 {
- color: #475669;
- font-size: 14px;
- opacity: 0.75;
- line-height: 200px;
- margin: 0;
- }
- .el-carousel__item:nth-child(2n) {
- background-color: #99a9bf;
- }
- .el-carousel__item:nth-child(2n + 1) {
- background-color: #d3dce6;
- }
- ::v-deep .xcjl {
- .el-collapse {
- color: #fff;
- border-top: 1px solid #2c64a1;
- border-bottom: 1px solid #2c64a1;
- border: 1px solid #2c64a1;
- .el-icon-arrow-right {
- }
- .el-collapse-item__arrow {
- color: #fff;
- }
- .headTitle {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- h4 {
- font-size: 16px;
- font-weight: 400;
- color: #afdcff;
- span {
- color: #fff;
- }
- }
- p {
- color: #fff;
- }
- }
- .el-collapse-item__header {
- background-color: transparent;
- border-bottom: 1px solid #2c64a1;
- padding: 0 20px;
- }
- .el-collapse-item__wrap {
- background-color: transparent;
- border-bottom: 1px solid #2c64a1;
- }
- .el-collapse-item__content {
- padding-bottom: 0;
- }
- .collapseContent {
- width: 100%;
- height: 100%;
- padding: 15px;
- table {
- border: none;
- border-collapse: collapse;
- tr {
- td {
- color: #fff;
- border: 1px solid #2c64a1;
- }
- td:nth-child(1) {
- text-align: right;
- padding-right: 15px;
- background-color: #0d4582;
- color: #afdcff;
- width: 120px;
- }
- td:nth-child(2) {
- text-align: left;
- padding-left: 15px;
- }
- }
- }
- .xczpFlex {
- width: 100%;
- height: 50px;
- overflow: hidden;
- display: flex;
- align-items: center;
- overflow-x: auto;
- img {
- width: 50px;
- height: 50px;
- margin: 5px 10px;
- }
- }
- }
- span {
- color: #fff;
- }
- h4 {
- color: #fff;
- }
- }
- }
- ::v-deep .el-select {
- width: 75%;
- .el-tag--info {
- background-color: #409eff;
- border: 1px solid #0d4582;
- color: #fff;
- .el-tag__close {
- color: #fff;
- }
- }
- }
- .btn {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 0 4px;
- height: 26px;
- background: #177fde;
- border-radius: 4px 4px 4px 4px;
- opacity: 1;
- border: 1px solid #25b0ec;
- cursor: pointer;
- p {
- color: #fff;
- margin-left: 5px;
- }
- }
- .xcryFlex {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- ::v-deep .el-select-dropdown {
- background-color: #264584;
- border: 1px solid #2c64a1;
- .el-select-dropdown__item {
- span {
- color: #1bf1ff;
- }
- }
- .selected {
- background-color: #2363ae !important;
- span {
- color: #1bf1ff;
- }
- }
- .hover {
- background-color: #2363ae !important;
- }
- .popper__arrow {
- border-bottom-color: #2c64a1;
- }
- .popper__arrow::after {
- border-bottom-color: #264584;
- }
- }
- </style>
|