genjin.vue 20 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
<template>
  <div style="background-color:#f7f7f7;padding:10px 10px;">
    <div class="zhuti" v-if="ontype == '1'">
      <div style="height:58px;line-height:58px;">
        <div style="color:#0006"> <span>商户寻租管理</span> <span style="padding:0 5px;">></span> <span
            style="color:#000000e6">跟进日志</span></div>
      </div>
      <!-- 搜索 -->
      <div class="formSearch">
        <el-form :inline="true" :model="formSel">
          <el-form-item label="年月">
            <el-date-picker style="width: 100%;" v-model="formSel.yytime" value-format="yyyy-MM" type="month"
              placeholder="选择日期">
            </el-date-picker>
          </el-form-item>


        </el-form>
        <div style="width: 17%;">
          <el-button style="background-color: #3F9B6A;color: #fff" @click="onSubmit">查询
          </el-button>
          <el-button class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;"
            @click="resetting">重置
          </el-button>
        </div>

      </div>
      <div style="margin-bottom:20px;">
        <el-button style="background-color: #3F9B6A;color: #fff;padding:8px 15px;" icon="el-icon-circle-plus-outline"
          @click="genad">新增</el-button>
      </div>
      <div>
        <el-calendar v-model="morenCard">
          <template slot="dateCell" slot-scope="{date, data}">
            {{data.day.split("-").slice(2).join("-")}}
            <div style="overflow: auto;height:55px;">
              <div style="width:100%," v-for="(item,index) in tableData" @click="genjinMsg(item)">
                <div style="font-size:12px;margin-top:10px;">
                  {{item.followUpTime == data.day?item.contentFeedback:''}}
                </div>
              </div>
            </div>
          </template>
        </el-calendar>
      </div>
      <div>
        <el-button class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;"
          @click="closeGenjin">返回
        </el-button>
      </div>
    </div>
    <div class="zhuti" v-if="ontype == '2'">
      <div style="height:58px;line-height:58px;">
        <div style="color:#0006"> <span>跟进日志</span> <span style="padding:0 5px;">></span> <span
            style="color:#000000e6">新增</span></div>
      </div>
      <div style="padding: 20px;">
        <el-form ref="genform" :model="formInline" :rules="rulesOne" label-width="120px">
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="跟进时间" prop="followUpTime">
                <el-date-picker  v-model="formInline.followUpTime" type="date" value-format="yyyy-MM-dd"
                  placeholder="选择日期" style="width:100%">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="跟进类型" prop="followUpType" >
                <el-select v-model="formInline.followUpType" placeholder="请选择" style="width:100%">
                  <el-option label="电话跟进" value="电话跟进" />
                  <el-option label="现场跟进" value="现场跟进" />
                  <el-option label="微信跟进" value="微信跟进" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="客户级别" prop="customerLevel" tyle="width: 100%;">
                <el-select v-model="formInline.customerLevel" placeholder="请选择" style="width:100%">
                  <el-option label="A" value="A" />
                  <el-option label="B" value="B" />
                  <el-option label="C" value="C" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="当前阶段" prop="currentStage">
                <el-select v-model="formInline.currentStage" placeholder="请选择" style="width:100%" >
                  <el-option label="继续跟进" value="继续跟进" />
                  <el-option label="达成共识" value="达成共识" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-form-item label="意向资源"  style="width: 100%;">
            <div style="border: 1px solid #E5E5E5;padding: 1px" id="huodong">
              <div v-if="addziyuanData.length != 1"
                style="font-size: 14px;border-bottom: 1px solid #E5E5E5;display: flex;justify-content: space-between;line-height:20px;background:#F2F3F5;">
                <div></div>
                <div style="color: #3F9B6A;padding:10px;" @click="addZi()">
                  添加
                </div>
              </div>
              <div style="padding: 15px;">
                <div style="padding: 0px 20px 0px 0px">
                  <el-table :data="addziyuanData"
                    :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}">
                    <el-table-column label="序号">
                      <template slot-scope="scope">
                        {{scope.$index + 1}}
                      </template>
                    </el-table-column>
                    <el-table-column label="资源编号" prop="id" ></el-table-column>
                    <el-table-column label="意向资源名称"  prop="name"   show-overflow-tooltip>
                      <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="意向资源类型" prop="type" >
                      <template slot-scope="scope">
                        {{scope.row.shopName ? '商铺' : scope.row.advertisingType?scope.row.advertisingType:'场地'}}
                      </template>
                    </el-table-column>
                    <el-table-column label="操作">
                      <template slot-scope="scope">
                        <div @click="MingDelete(scope.$index)" class="tableBtn greens">删除</div>
                      </template>
                    </el-table-column>
                  </el-table>
                </div>
              </div>
            </div>
          </el-form-item>
          <el-form-item label="内容反馈" prop="contentFeedback">
            <el-input type="textarea" v-model="formInline.contentFeedback" :rows="4" ></el-input>
          </el-form-item>
          <el-form-item label="现场照片">
            <upimg filePath="yixiang" inputtype="onSitePhotos" :value="formInline.onSitePhotos"  @changimg="e=>changimg(e,'onSitePhotos')" :limit="3"></upimg>
          </el-form-item>
          <el-form-item label="下次更进时间" prop="plan_Time">
            <el-date-picker style="width: 100%;" v-model="formInline.plan_Time" value-format="yyyy-MM-dd"
               type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
              align="right" @change="changeNext">
            </el-date-picker>
          </el-form-item>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item>
                <div style="margin-top: 20px">
                  <el-button @click="addCheck()" style="background-color: #3F9B6A;color: #fff;">确定</el-button>
                  <el-button @click="closeFn()" class="buttonHover"
                    style="color: #606266;border: 1px solid #DBDBDB;background-color: #fff;">取消</el-button>
                </div>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>

      <!-- <div style="display: flex;">
        <el-button @click="closeFn" class="buttonHover"
          style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">返回</el-button>
        <el-button @click="addCheck" style="background-color: #3F9B6A;color: #fff">确定</el-button>
      </div> -->
    </div>
    <div class="zhuti" v-if="ontype == '3'">
      <div style="height:58px;line-height:58px;">
        <div style="color:#0006"> <span>跟进日志</span> <span style="padding:0 5px;">></span> <span
            style="color:#000000e6">查看</span></div>
      </div>
      <el-form :model="formInline" ref="formInline" label-width="120px" class="demo-ruleForm">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="跟进时间" prop="followUpTime">
              <div class="duiqi">{{formInline.followUpTime  || '无'}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="跟进类型" prop="followUpType" >
              <div class="duiqi">{{formInline.followUpType  || '无'}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="客户级别" prop="customerLevel" style="width: 100%;">
              <div class="duiqi">{{formInline.customerLevel  || '无'}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="当前阶段" prop="currentStage">
              <div class="duiqi">{{formInline.currentStage  || '无'}}</div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="意向资源"  style="width: 100%;">
          <div style="border: 1px solid #E5E5E5;padding: 1px" id="huodong">
            <div style="padding: 15px;">
              <div style="padding: 0px 20px 0px 0px">
                <el-table :data="addziyuanData"
                  :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}">
                  <el-table-column label="序号">
                    <template slot-scope="scope">
                      {{scope.$index + 1}}
                    </template>
                  </el-table-column>
                  <el-table-column label="资源编号" prop="id" ></el-table-column>
                  <el-table-column label="意向资源名称"  prop="name"   show-overflow-tooltip>
                    <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="意向资源类型" prop="type" >
                    <template slot-scope="scope">
                      {{scope.row.shopName ? '商铺' : scope.row.advertisingType?scope.row.advertisingType:'场地'}}
                    </template>
                  </el-table-column>
                </el-table>
              </div>
            </div>
          </div>
        </el-form-item>
        <el-form-item label="内容反馈" prop="contentFeedback">
          <div class="duiqi">{{formInline.contentFeedback  || '无'}}</div>
        </el-form-item>
        <el-form-item label="现场照片">
          <div style="display: flex;">
            <allimg v-if="item" :src="item" fit="contain" v-for="item in imgList"
              style="width: 112px;height: 112px;border: 1px dotted #dcdfe6;border-radius: 2px;overflow: hidden;margin: 0 10px 10px 0;" />
          </div>
        </el-form-item>
        <el-form-item label="下次更进时间" prop="plan_Time">
          <div class="duiqi">{{formInline.plan_Time?formInline.plan_Time.length>0?formInline.plan_Time[0]+' 至 '+formInline.plan_Time[1]:'无':'无'}}</div>
        </el-form-item>
      </el-form>
      <div style="display: flex;">
        <el-button @click="closeFn" class="buttonHover"
          style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">返回</el-button>
      </div>
    </div>
    <!-- 资源选择 -->
    <el-dialog :visible.sync="addziyuan" title="选择资源" width="65%" append-to-body center :close-on-click-modal="false"
      :close-on-press-escape="false" :show-close="false">
      <zy :maxSelection="1" publishStatus="2" v-if="addziyuan" @mingClose="mingClose" @minSev="minSev"></zy>
    </el-dialog>
  </div>
</template>

<script>
  import zy from "@/components/change/zy"
  import {
    genGetAll,
    genAdd,
    genEdit,
    genDel,
    rsaManEdit
  } from '../../../api/followup.js'
  import upimg from "@/components/ImageUpload/index"
  import {
    getAlls
  } from '../../../api/information.js'
  import {
    getAlls as map1
  } from '../../../api/map1'
  import allimg from '@/components/chakan/allimg.vue';
  export default {
    components: {
      upimg,
      allimg,
      zy
    },
    props: {
      message: {
        type: Number, // 指定数据的类型
        required: true, // 指定该数据是必需的
        default: null, // 指定默认值
      }
    },
    data() {
      return {
        ontype: "1",
        formSel: {
          yytime: ''
        },
        formInline: {
          followUpTime: '', //跟进时间
          followUpType: '', //跟进类型
          customerLevel: '',
          potentialCustomer: '', //意向客户
          intendedResource: '', //意向资源
          currentStage: '', //当前阶段
          contentFeedback: '', //内容反馈
          onSitePhotos: '', //现场照片
          plan_Time: null,
          nextFollowUpStartTime: '', //下次跟进开始时间
          nextFollowUpEndTime: '', //下次跟进结束时间
          status: '1' //状态
        },
        addziyuanData: [],
        ziyuanData: [], //资源
        morenCard: new Date(),
        multipleSelection: [],
        addziyuan: false,
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ggXin: false,
        rulesOne: {
          followUpTime: [{
            required: true,
            message: '请选择跟进时间',
            trigger: 'change'
          }, ],
          followUpType: [{
            required: true,
            message: '请选择跟进类型',
            trigger: 'change'
          }],
          customerLevel: [{
            required: true,
            message: '请选择客户级别',
            trigger: 'change'
          }],
          contentFeedback: [{
            required: true,
            message: '请输入内容反馈',
            trigger: 'blur'
          }, ],
          currentStage: [{
            required: true,
            message: '请选择当前阶段',
            trigger: 'change'
          }, ],
          // plan_Time: [{
          //   required: true,
          //   message: '请选择下次跟进时间',
          //   trigger: 'change'
          // }, ],
        },
        pageindex: {
          pageNumber: 0,
          pageSize: 10,
          potentialCustomer: null
        },
        zipageindex: {
          pageNumber: 0,
          pageSize: 10,
        },
        tableData: [],
        msgEit: false,
        imgList: []
      }
    },
    created() {

    },
    mounted() {
      this.pageindex.potentialCustomer = this.message
      this.getAll()
    },
    methods: {
      changimg(e, type) {
        this.formInline[type] = e
        // this.imgList.push(e)
      },
      async getAll() {
        const res = await genGetAll(this.pageindex)
        this.tableData = res.data.content
      },
      genjinMsg(item) {
        this.msgEit = true
        this.formInline = {}
        this.formInline = item
        this.formInline.plan_Time = [item.nextFollowUpStartTime, item.nextFollowUpEndTime]
        if (typeof item.intendedResource == 'string' && item.intendedResource != '') {
          this.addziyuanData = JSON.parse(item.intendedResource)
        }

        if (typeof item.onSitePhotos == 'string') {
          this.imgList = item.onSitePhotos.split(',') || []
        }

        this.ontype = '3'
      },
      onSubmit() {
        this.morenCard = this.formSel.yytime
        this.getAll()
      },
      resetting() {
        this.morenCard = new Date()
        this.formSel.yytime = ''
        this.getAll()
      },
      async addZi() {
        this.addziyuan = true


        // const ziyuan = await getAlls(this.zipageindex)
        // const ggw = await map1(this.zipageindex)
        // this.ziyuanData = [...ziyuan.data.content, ...ggw.data.content]
        // this.addziyuan = true
      },
      genad() {
        // this.msgEit = false
        // this.ggXin = true
        // this.$refs.genform.resetFields()
        this.ontype = '2'
        this.formInline = {
          followUpTime: '', //跟进时间
          followUpType: '', //跟进类型
          customerLevel: '',
          potentialCustomer: '', //意向客户
          intendedResource: '', //意向资源
          currentStage: '', //当前阶段
          contentFeedback: '', //内容反馈
          onSitePhotos: '', //现场照片
          plan_Time: [],
          nextFollowUpStartTime: '', //下次跟进开始时间
          nextFollowUpEndTime: '', //下次跟进结束时间
          status: '1' //状态
        }
      },
      closeGenjin() {
        this.$emit('cancel', false)
      },
      handleSelectionChange(selection) {
        this.multipleSelection = selection[0]
        // 确保只有一行被选中
        if (selection.length > 1) {
          this.$refs.singleTable.clearSelection();
          this.$refs.singleTable.toggleRowSelection(selection[selection.length - 1]);
        }
      },
      minSev(data) {
        // this.multipleSelection.leaseTerm = this.formInline.leaseTerm
        // this.multipleSelection.rent = this.formInline.rent
        // this.addziyuanData.push(this.multipleSelection)
        // this.addziyuan = false
        // this.multipleSelection = []
        // this.formInline.leaseTerm = ''
        // this.formInline.rent = ''
        // this.$refs.singleTable.clearSelection()


        data.leaseTerm = this.formInline.leaseTerm
        data.rent = this.formInline.rent
        console.log('资源选择确认:', data);
        this.addziyuanData = data
        this.multipleSelection = null
        this.formInline.leaseTerm = ''
        this.formInline.rent = ''
  
        this.addziyuan = false; // 关闭资源对话框
      },
      MingDelete(item) {
        this.addziyuanData = []
      },
      changeNext(e) {

        this.formInline.nextFollowUpStartTime = e[0]
        this.formInline.nextFollowUpEndTime = e[1]

      },
      mingClose() {
        this.multipleSelection = []
        this.addziyuan = false
      },
      closemsg(index) {
        this.addziyuanData.splice(index, 1);
      },
      closeFn(val) {
        this.formInline.plan_Time = []
        this.addziyuanData = []
        this.ontype = '1'
      },
      // 新增确定按钮
      addCheck(val) {
        this.$refs.genform.validate((valid) => {
          if (valid) {
            this.formInline.potentialCustomer = this.message
            if (this.addziyuanData.length != 0) {
              this.formInline.intendedResource = JSON.stringify(this.addziyuanData)
            }
            
            // this.formInline.onSitePhotos  =  this.imgList.join(',')
            if (this.formInline.currentStage == '达成共识') {
              this.formInline.status = '2'
            }
            console.log(this.formInline)
            // return
            genAdd(this.formInline).then(() => {
              this.ontype = '1'
              this.addziyuanData = []
              this.getAll()
            })

          } else {
            this.$message({
              message: '请填写完整信息',
              type: 'error'
            })

          }
        })

      },
    }
  }
</script>

<style lang="scss" scoped>
  ::v-deep .el-calendar button-group {
    display: none;
  }

  .zhuti {
    padding: 0 20px 20px 20px;
   min-height: calc(100vh - 50px - 20px);
    background-color: #fff;
    box-sizing: border-box;
  }

  .formSearch {

    display: flex;
    width: 100%;
    font-size: 14px;
    justify-content: space-between;

  }

  ::v-deep .el-calendar-table:not(.is-range)td.next {
    display: none;
  }

  ::v-deep .el-calendar-table:not(.is-range)td.prev {
    visibility: hidden;
  }

  ::v-deep .el-calendar__button-group {
    display: none;
  }
</style>