bianform.vue 27.9 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755
<template>
  <!-- <el-dialog :title="steat == false?'详情':'编辑'" :visible.sync="showBian" custom-class='XDD_css' style="padding: 0;" width="65%" center
      :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false">
      <div style="padding:15px 10px 10px 10px;background-color:#fff">
     <el-form label-position="right" ref="jibenFrom" :model="ruleForm" :rules="rules" label-width="140px"
       style="position: relative">
              <el-form-item label="招商方案名称" class="grid-content bg-purple device-from" prop="planName" >
                <el-input v-model="ruleForm.planName" placeholder="请输入" :disabled="steat == false?true:false" maxlength="100"/>
              </el-form-item>
              <el-form-item label="规划方案" class="grid-content bg-purple device-from" prop="planningScheme">
                <el-select v-model="ruleForm.planningScheme"  style="width: 100%" :disabled="steat == false?true:false">
                  <el-option :label="item.planningName" :value="item.id" v-for="(item,index) in guihuaDate "></el-option>
                </el-select>
              </el-form-item>

              <el-form-item label="招商政策与条件" class="grid-content bg-purple" prop="investmentPolicy">
                <wang-editor v-model="ruleForm.investmentPolicy"   ref="editor" :height="200" v-if="steat"></wang-editor>
                <div style="border: 1px solid #dddfe5;padding:20px;" v-html="ruleForm.investmentPolicy" v-if="steat == false"></div>
              </el-form-item>
              <el-form-item label="方案概述" prop="summary" class="grid-content bg-purple">
                <wang-editor v-model="ruleForm.summary"  v-if="steat"  ref="editor" :height="200"></wang-editor>
                <div style="border: 1px solid #dddfe5;padding:20px;" v-html="ruleForm.summary" v-if="steat == false"></div>
              </el-form-item>
                <el-form-item label="财务分析与投资回报" prop="financialAnalysis" class="grid-content bg-purple">
                  <wang-editor v-model="ruleForm.financialAnalysis" v-if="steat"  ref="editor" :height="200"></wang-editor>
                  <div style="border: 1px solid #dddfe5;padding:20px;" v-html="ruleForm.financialAnalysis" v-if="steat == false"></div>
                </el-form-item>


         </el-form>
        <div style="display: flex;justify-content: flex-end;padding: 10px 20px 10px 0">

        </div>
      </div>

    </el-dialog> -->
  <div class="zhuti" v-if='showBian'>
    <div style="height:58px;line-height:58px;">
      <div style="color:#0006"> <span>招商方案管理</span> <span style="padding:0 5px;">></span> <span
          style="color:#000000e6">{{steat?'编辑':'查看'}}</span></div>
    </div>
    <!-- <el-tabs v-model="xiangTab">
              <el-tab-pane label="基础信息" name="first">

              </el-tab-pane>

            </el-tabs> -->
    <div style="margin-top: 30px;" class="editcss">
      <div class="titles">
        基础信息
      </div>
      <div style="padding: 20px;">
        <el-form label-position="right" ref="jibenFrom" :model="ruleForm" :rules="rules" label-width="140px"
          style="position: relative">
          <!-- <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="招商方案名称" class="grid-content bg-purple device-from" prop="planName">
                <div class="duiqi" v-if="steat == false">{{ruleForm.planName}}</div>
                <el-input v-model="ruleForm.planName" placeholder="请输入" style="margin-top: 5px;" maxlength="100"
                  v-else></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="规划方案" class="grid-content bg-purple device-from" prop="planningScheme">
                <div class="duiqi" v-if="steat == false">{{ruleForm.planningScheme}}</div>
                <el-select v-model="ruleForm.planningScheme" style="width: 100%" v-else>
                  <el-option :label="item.planningName" :value="item.id"
                    v-for="(item,index) in guihuaDate "></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row> -->
          <el-form-item label="招商方案名称" class="grid-content bg-purple device-from" prop="planName">
                <div class="duiqi" v-if="steat == false">{{ruleForm.planName}}</div>
                <el-input v-model="ruleForm.planName" placeholder="请输入" style="margin-top: 5px;" maxlength="100"
                  v-else></el-input>
              </el-form-item>
          <el-row :gutter="20">
            <el-col :span="24">
              <el-form-item label="招商政策与条件" class="grid-content bg-purple" prop="investmentPolicy">
                <wang-editor v-model="ruleForm.investmentPolicy" ref="editor" :height="200" v-if="steat"></wang-editor>
                <div class="duiqi" v-html="ruleForm.investmentPolicy" v-else></div>
              </el-form-item>


            </el-col>

          </el-row>
          <el-row :gutter="20">
            <el-col :span="24">
              <el-form-item label="方案概述" prop="summary" class="grid-content bg-purple">
                <wang-editor v-model="ruleForm.summary" v-if="steat" ref="editor" :height="200"></wang-editor>
                <div class="duiqi" v-html="ruleForm.summary" v-else></div>
              </el-form-item>
            </el-col>

          </el-row>

          <el-row :gutter="20">
            <el-col :span="24">
              <el-form-item label="财务分析与投资回报" prop="financialAnalysis" class="grid-content bg-purple">
                <wang-editor v-model="ruleForm.financialAnalysis" v-if="steat" ref="editor" :height="200"></wang-editor>
                <div class="duiqi" v-html="ruleForm.financialAnalysis" v-else></div>
              </el-form-item>
            </el-col>

          </el-row>
          <el-row :gutter="20">
            <el-col :span="24">
              <el-form-item label="招商资源管理" class="grid-content bg-purple">
                <div style="border: 1px solid #E5E5E5;padding: 1px" id="huodong">
                  <div
                    style="padding: 0px 13px;font-size: 14px;border-bottom: 1px solid #E5E5E5;display: flex;justify-content: flex-end;">
                    <div style="color: #2d8a58;margin-left: 10px;" @click="addziyuan" v-if="steat">
                      添加
                    </div>
                  </div>
                  <div style="padding: 15px;">
                    <div style="padding: 0px 20px 0px 0px">
                      <el-table :data="ruleForm.cereResourceStrategy"
                        :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
                        style="width: 100%">
                        <el-table-column label="序号" width="auto" min-width="8%">
                          <template slot-scope="scope">
                            {{scope.$index + 1}}
                          </template>
                        </el-table-column>
                        <el-table-column label="资源编号" prop="id" width="auto" min-width="22%">

                        </el-table-column>
                        <el-table-column label="资源名称" width="auto" min-width="15%">
                          <template slot-scope="scope">
                            {{scope.row.resources.shopIds[0]?scope.row.resources.shopIds[0].shopName:scope.row.resources.siteIds[0]?scope.row.resources.siteIds[0].venueName:scope.row.resources.advIds[0].advertisingName}}
                          </template>
                        </el-table-column>
                        <el-table-column label="资源类型" width="auto" min-width="15%">
                          <template slot-scope="scope">
                            {{scope.row.resources.shopIds[0]?'商铺':scope.row.resources.siteIds[0]?'场地':'广告位'}}
                          </template>
                        </el-table-column>
                        <el-table-column prop="notes" label="策略描述" width="auto" min-width="15%">
                        </el-table-column>
                        <el-table-column label="策略名称" width="auto" min-width="15%">
                          <template slot-scope="scope">
                            {{scope.row.resources.cereRentalPolicies.policyName}}
                          </template>
                        </el-table-column>
                        <!-- <el-table-column label="操作" width="auto" min-width="18%" v-if="steat">
                                                                       <template slot-scope="scope">
                                                                         <div @click="ceSel(scope.$index)" class="tableBtn greens">策略选择</div>

                                                                         <div @click="MingDelete(scope.row.id,scope.$index)" class="tableBtn greens">删除</div>
                                                                       </template>
                                                                     </el-table-column> -->
                      </el-table>
                    </div>
                  </div>
                </div>
              </el-form-item>

            </el-col>

          </el-row>
          <!-- <el-form-item v-if="steat" label="附件信息" prop="attachmentInfo">
            <upfile filePath="cd" :value="ruleForm.attachmentInfo" fileSize="50" :fileType="['doc','pdf']" @changimg="e=>changimg(e,'attachmentInfo')"></upfile>
          </el-form-item> -->
          <!-- <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="附件信息" prop="mainPurpose" class="grid-content bg-purple">
                <el-upload class="upload-demo" ref="upload" :on-preview="handlePreview" :on-remove="handleRemove"
                  :action="uploadFileUrl" :on-success="handleUploadSuccess" :file-list="fileData" :auto-upload="true"
                  v-if="steat">
                  <el-button style="background-color: #fff;color: #3F9B6A;border: 1px solid #dcdfe6;"
                    class="buttonHover" v-if="fileData.length ==0">+点击上传</el-button>
                </el-upload>

                <div class="duiqi" style="padding:10px 0;line-height:20px;color:#3F9B6A"
                  v-if="steat == false && ruleForm.attachmentInfo">{{ruleForm.attachmentInfo.name}}<a
                    style="margin-left:20px;color:#3F9B6A" :href="ruleForm.attachmentInfo.url" target="_blank"
                    v-if="ruleForm.attachmentInfo.name">下载</a></div>
              </el-form-item>
            </el-col>

          </el-row> -->

        </el-form>
      </div>
    </div>
    <el-row :gutter="20">
      <el-col :span="12">
        <div style="padding-left:160px;">
          <el-button @click="onSubmit" style="background-color: #3F9B6A;color: #fff;" v-if="steat">确定
          </el-button>

          <el-button @click="close" class="buttonHover"
            style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消
          </el-button>


        </div>

      </el-col>
    </el-row>
    <el-dialog :visible.sync="addMing" title="添加" style="padding: 0;" width="65%" custom-class='tian_dialog'
      append-to-body center :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false">

      <div style="padding:20px;max-height: calc(100vh - 200px);
                        overflow-y: auto;">
        <div style="border: 1px solid #E5E5E5;padding: 1px" id="huodong">
          <div
            style="padding: 10px 13px;font-size: 14px;border-bottom: 1px solid #E5E5E5;display: flex;justify-content: space-between;">
            <div style="line-height:200%">选择资源</div>
            <div style="display: flex">
              <el-input placeholder="请输入" suffix-icon="el-icon-search" style="wdith:40%;margin-right:15px;"
                v-model="pageziyuan.findLike">
              </el-input>
              <el-button @click="onSearch" style="background-color: #3F9B6A;color: #fff">查询
              </el-button>
              <el-button @click="resetting" class="buttonHover"
                style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">重置
              </el-button>
            </div>
          </div>
          <div style="padding: 15px;">
            <div style="padding: 0px 20px 0px 0px">
              <el-table :data="ziyuanData" tooltip-effect="dark" @selection-change="handleSelectionChange"
                :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}">
                <el-table-column label="选择" type="selection" width="55">
                </el-table-column>
                <el-table-column label="序号" min-width="8%">
                  <template slot-scope="scope">
                    {{scope.$index + 1}}
                  </template>
                </el-table-column>
                <el-table-column label="编号" prop="id" min-width="8%">

                </el-table-column>
                <el-table-column label="资源名称" min-width="25%">
                  <template slot-scope="scope">
                    {{scope.row.shopName ? scope.row.shopName :  scope.row.advertisingName?scope.row.advertisingName:scope.row.venueName}}
                  </template>
                </el-table-column>
                <el-table-column label="资源类型" min-width="12%">
                  <template slot-scope="scope">
                    {{scope.row.shopName ? '商铺' : scope.row.advertisingType?scope.row.advertisingType:'场地'}}
                  </template>
                </el-table-column>
                <el-table-column prop="notes" label="对应策略" min-width="15%">
                </el-table-column>
              </el-table>
            </div>
          </div>
        </div>
      </div>
      <template #footer>
        <div style="display: flex; justify-content: flex-end; align-items: center;">
          <el-button @click="minSev" style="background-color: #3F9B6A;color: #fff;">确定
          </el-button>
          <el-button @click="mingClose" class="buttonHover"
            style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消
          </el-button>

        </div>
      </template>

    </el-dialog>
    <!-- 策略选择 -->
    <el-dialog :visible.sync="celueMing" custom-class='XDD_css' style="padding: 0;" width="50%" append-to-body center
      :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false">
      <div
        style="padding: 10px 13px;font-size: 14px;border-bottom: 1px solid #E5E5E5;display: flex;justify-content: space-between;">
        <div>策略添加</div>
      </div>
      <div style="padding: 15px;width:100%">
        <div style="border: 1px solid #E5E5E5;padding: 1px" id="huodong">
          <div
            style="padding: 10px 13px;font-size: 14px;border-bottom: 1px solid #E5E5E5;display: flex;justify-content: space-between;">
            <div>选择策略</div>
          </div>
          <div style="padding: 15px;">
            <div style="padding: 0px 20px 0px 0px">
              <el-table :data="celueData" highlight-current-row @current-change="celueChenge" tooltip-effect="dark"
                :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}">
                <el-table-column label="序号" min-width="80">
                  <template slot-scope="scope">
                    {{scope.$index + 1}}
                  </template>
                </el-table-column>
                <el-table-column label="策略名称" prop="policyName" min-width="200">
                </el-table-column>
                <el-table-column label="适用资源" prop="applicableResources" min-width="100">
                </el-table-column>
                <el-table-column label="经营类型" prop="businessType" min-width="150">

                </el-table-column>
                <el-table-column label="租金价格" prop="rentalPrice" min-width="150">
                </el-table-column>
                <el-table-column label="租期" prop="leaseTerm" min-width="100">
                </el-table-column>
                <el-table-column label="是否出租" prop="planningObjectives" min-width="100">
                  <template slot-scope="scope">
                    {{scope.row.isrental == '0'?'否':'是'}}
                  </template>
                </el-table-column>
                <el-table-column label="是否自营" prop="planningObjectives" min-width="100">
                  <template slot-scope="scope">
                    {{scope.row.isSelfOperated == '0'?'否':'是'}}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
        </div>
      </div>
      <div style="display: flex;justify-content: flex-end;padding: 10px 20px 10px 0">
        <el-button @click="ceClose" class="buttonHover"
          style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消
        </el-button>
        <el-button @click="ceSev" style="background-color: #3F9B6A;color: #fff;">确定
        </el-button>

      </div>
    </el-dialog>
  </div>
</template>

<script>
  import {
    fangGetAll,
    fangGetId,
    fangAdd,
    fangEdit,
    fangDel,
  } from '../../../api/fangli'
  import {
    contractGetAll
  } from '../../../api/planningBz.js'
  import {
    getAlls as map1
  } from '../../../api/map1'
  import {
    ceGetAll
  } from '../../../api/sam.js'
  import {
    getAlls,
    changAlls
  } from '../../../api/information.js'
  import {
    duiyingAll,
    duiyingAdd
  } from '../../../api/newZiyuan.js'
  // import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
  import wangEditor from "@/components/editor/index"
  import upimg from "@/components/ImageUpload/index"
  import {
    uploadUrl
  } from '@/utils/request'
  import html2canvas from 'html2canvas'
  import jsPDF from 'jspdf'
  import upfile from "@/components/fujianUpload/fujianList"
  export default {
    props: {
      showBian: {
        type: Boolean,
        default: false
      },
      steat: {
        type: Boolean,
        default: false
      },
      list: {
        type: Object,
        default: function() {
          return {}; // 返回一个空数组作为默认值
        },
      }
    },
    components: {
      wangEditor,
      upimg,
      upfile
    },
    data() {
      return {
        uploadFileUrl: uploadUrl, // 请求地址
        isLoading: false,
        editTrue: false,
        addMing: false,
        input: "",
        ruleForm: {},
        MingID: [],
        time: '',
        tableData: [],
        fileData: [],
        currentTime: '',
        ActiveName: 0,
        multipleSelection: [],
        guihuaDate: [],
        pageindex: {
          pageNumber: 1,
          pageSize: 10,
        },
        index: 0,
        celueMing: false,
        celueSel: null,
        celueData: [],
        index: null,
        rules: {
          planName: [{
            required: true,
            message: '请输入方案名称',
            trigger: 'blur'
          }],
          planningScheme: [{
            required: true,
            message: '请选择规划方案',
            trigger: 'change'
          }],
        },
        xiangTab: 'first',
        pageziyuan: {
          pageNumber: 1,
          pageSize: 10,
          findLike: ''
        },
        ziyuanData: []
      }
    },
    watch: {
      list: {

        handler(newValue) {

          this.fileData = []
          // 当 list 发生变化时,更新 secondData
          this.ruleForm = {
            ...newValue
          };

          // console.log(this.ruleForm)
          // if(this.ruleForm.resourceManagement != ''){
          //   this.ruleForm.resourceManagement = JSON.parse(this.ruleForm.resourceManagement)
          // }
          // if ( this.ruleForm.attachmentInfo != '' && typeof this.ruleForm.attachmentInfo === 'string') {
          //     this.ruleForm.attachmentInfo = JSON.parse(this.ruleForm.attachmentInfo)
          //     this.fileData.push(this.ruleForm.attachmentInfo)
          // }

        },
        // immediate: false // 立即执行一次处理函数
      }
    },
    created() {
      //  this.fileData=[]

      this.ruleForm = {
        ...this.list
      };
      // if ( this.ruleForm.attachmentInfo != '' && typeof this.ruleForm.attachmentInfo === 'string') {
      //     this.ruleForm.attachmentInfo = JSON.parse(this.ruleForm.attachmentInfo)
      //     this.fileData.push(this.ruleForm.attachmentInfo)
      // }


    },
    mounted() {
      this.editTrue = true
      this.getAll()
    },
    methods: {
      changimg(e,type) {
        this.ruleForm[type] = e
      },
      //获取当前时间
      updateCurrentTime() {
        const now = new Date();
        const year = now.getFullYear();
        const month = (now.getMonth() + 1).toString().padStart(2, '0');
        const day = now.getDate().toString().padStart(2, '0');
        const hours = now.getHours().toString().padStart(2, '0');
        const minutes = now.getMinutes().toString().padStart(2, '0');
        const seconds = now.getSeconds().toString().padStart(2, '0');

        this.currentTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
      },
      async getAll() {
        const res = await contractGetAll(this.pageindex)
        this.guihuaDate = res.data.content
        const celue = await ceGetAll(this.pageindex)
        this.celueData = celue.data.content
      },
      //上传
      submitUpload() {
        this.$refs.upload.submit();
      },
      handleUploadSuccess(response, file, fileList) {

        const fileMsg = {
          name: file.name,
          url: file.response.data.url,
        }
        // 将文件地址存储在 uploadedFiles 数组中
        this.fileData.push(fileMsg);

      },
      handleRemove(file, fileList) {
        this.fileData = []
      },
      handlePreview(file) {

      },
      fileDelete(val) {
        this.fileData.splice(val, 1);
      },
      //保存
      onSubmit() {

        // if (this.fileData.length != 0) {
        //   this.ruleForm.attachmentInfo = JSON.stringify(this.fileData[0])
        // }
        // if(this.ruleForm.resourceManagement.length !=0){
        //   this.ruleForm.resourceManagement = JSON.stringify(this.ruleForm.resourceManagement)
        // }

        // const { pageNumber, pageSize, ...rest } = this.ruleForm
        // this.ruleForm = rest
        //   console.log(this.ruleForm)
        //   return
        // 将剩余的字段存储到this.zhong对象中

        fangEdit(this.ruleForm).then(res => {
          this.$message({
            message: '保存成功',
            type: 'success'
          })

          this.$emit('bianClose', false)
        })

      },
      dateFormat() {
        this.ruleForm.eventStartTime = this.ruleForm.plan_Time[0]
        this.ruleForm.eventEndTime = this.ruleForm.plan_Time[1]

      },
      close() {
        this.$emit('bianClose', false);
        // this.$refs.editor.html = '<p><br></p>'
        // this.ruleForm = {}
      },
      MingEd(item) {

      },
      minSev() {
        console.log(this.ruleForm.cereResourceStrategy, this.multipleSelection)
        const existingIds = new Set(this.ruleForm.cereResourceStrategy.map(item => item.id));

        // 过滤出 multipleSelection 中 id 不在 existingIds 中的元素
        const newElements = this.multipleSelection.filter(item =>
          !existingIds.has(item.id)
        );

        // 将新元素添加到 cereResourceStrategy 数组中
        this.ruleForm.cereResourceStrategy.push(...newElements);
        // this.tableData = this.multipleSelection
        this.addMing = false
        this.multipleSelection = []

      },
      MingDelete(items, index) {

        let arr = []
        const h = this.$createElement;
        this.$msgbox({
          title: '消息',
          message: h('p', null, [
            h('span', null, '是否删除 '),
          ]),
          showCancelButton: true,
          showClose: false,
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          customClass: 'oe-dialog-btn',
          beforeClose: (action, instance, done) => {
            if (action === 'confirm') {

              if (typeof this.ruleForm.resourceManagement == 'string') {
                arr = this.ruleForm.resourceManagement.split(",")
              }
              arr = arr.filter(item => item !== items);

              this.ruleForm.resourceManagement = arr.join(',')

              this.ruleForm.cereResourceStrategy.splice(index, 1);
              done();
            } else {
              done();
            }
          }
        })



      },
      fenleiChange(value) {
        this.ruleForm.classificationCode = value[value.length - 1]
      },
      handleSelectionChange(val) {
        this.multipleSelection = val
      },
      mingClose() {
        this.addMing = false
      },
      ceSel(val) {
        this.index = val
        this.celueMing = true
      },
      ceClose() {
        this.celueMing = false
        this.celueSel = null
        this.index = null
      },
      ceSev() {
        this.$set(this.ruleForm.resourceManagement[this.index], 'ceid', this.celueSel.id);
        this.$set(this.ruleForm.resourceManagement[this.index], 'policyName', this.celueSel.policyName);
        this.celueMing = false
        this.celueSel = null
        this.index = null

      },
      celueChenge(val) {
        this.celueSel = val;
      },
      async addziyuan() {
        const ziyuan = await getAlls({...this.pageindex,pageNumber:0})
        const ggw = await map1(this.pageindex)
        const changdi = await changAlls(this.pageindex)
        this.ziyuanData = [...ziyuan.data.content, ...ggw.data.content, ...changdi.data.content]
        this.addMing = true
      },
      async ziyuan() {
        const ziyuan = await getAlls(this.pageindex)
        const ggw = await map1(this.pageindex)
        const changdi = await changAlls(this.pageindex)
        this.ziyuanData = [...ziyuan.data.content, ...ggw.data.content, ...changdi.data.content]
      },
      onSearch() {
        this.ziyuan()
      },
      resetting() {

        this.pageindex = {
          pageNumber: 1,
          pageSize: 10,
          findLike: '',
        }
        this.ziyuan()
      },

    }
  }
</script>

<style lang="scss" scoped>
  

  .greens {
    color: #3f9b6a;
  }

  ::v-deep .XDD_css {
    margin-top: 10vh;
    margin-left: 20%;
    max-height: 550px;
    overflow-y: auto;

    /* 当内容超出容器高度时,显示垂直滚动条 */
    .el-dialog__body {
      padding: 0px;
      background-color: #fff;
    }

    .el-dialog__header {
      background-color: #fff;
      padding: 10px 20px 10px 20px;
      border-bottom: 1px solid #EFEFEF;
    }

    .el-dialog__title {
      font-size: 14px;
      color: #000000e6;
    }
  }

  ::v-deep .el-tabs--border-card {
    border: none;
    -webkit-box-shadow: none;
    box-shadow: none;

    .el-tabs__content {
      border: 1px solid #E4E7ED;
      padding: 0;
    }

    .el-tabs__header {
      background-color: #fff;
      border-bottom: none;
    }

    .el-tabs__content {
      border: none;
    }

    .el-tabs__header .el-tabs__item {
      border: none;
      margin-right: 10px;
      background-color: #F2F2F2;
      font-size: 14px;
      border-top-left-radius: 8px;
      border-top-right-radius: 8px;
      padding: 0 15px;
    }

    .el-tabs__header .el-tabs__item.is-active {
      color: #fff;
      background-color: #3F9B6A;
    }

    .el-tabs__header .el-tabs__item:not(.is-disabled):hover {
      color: #3F9B6A;
    }
  }

  ::v-deep .el-date-table td.end-date span,
  .el-date-table td.start-date span {
    background-color: #3F9B6A;
  }

  ::v-deep .el-date-table td.available:hover {
    color: #3F9B6A;
  }

  ::v-deep .el-button.is-:focus,
  .el-button.is-:hover {
    border-color: fff;
    color: #3F9B6A;
  }

  ::v-deep .buttonHover:hover {
    color: #3f9b6a !important;
    border-color: #c5e1d2 !important;
    background-color: #ecf5f0 !important;
    outline: none;
  }
</style>