zuozhengqing
2023-10-16 9e81895b192f38d1bedfb9054a90b4c0c46042ea
src/views/client/salesLead/DetailSalesLead.vue
@@ -3,7 +3,7 @@
    <el-drawer :visible.sync="detailConfig.visible" size="80%" :before-close="handleClose" :wrapperClosable="false">
      <template slot="title">
        <div class="header">
          <span class="header-label">客户名称</span>
          <span class="header-label">销售线索</span>
          <span class="header-title">{{ detailConfig.infomation.name }}</span>
        </div>
      </template>
@@ -34,7 +34,7 @@
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div v-if="item.rightStr && item.rightStr.length > 0" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-title">{{ item.rightStr + ":" }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
@@ -56,11 +56,15 @@
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div v-if="item.rightStr && item.rightStr.length > 0" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-title">{{ item.rightStr + ":" }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
              <div class="business_scope">
                <div class="content-title">{{ "最新进展:" }}</div>
                <div class="content-data">{{ record ? record : "--" }}</div>
              </div>
            </div>
          </div>
          <!-- 地址信息 -->
@@ -97,7 +101,7 @@
                <li>
                  <div class="left remark">
                    <div class="content-title">{{ "备注:" }}</div>
                    <div class="content-data">{{ detailConfig.desc }}</div>
                    <div class="content-data">{{ detailConfig.infomation.desc }}</div>
                  </div>
                </li>
              </ul>
@@ -145,95 +149,102 @@
      addressInfoList: [],
      isRemarkExpand: true, // 备注信息
      remarkInfoList: [],
      addConfig: {}
      addConfig: {},
      record: "", // 最新进展
      noContactDays: 0,
      newContactDays: ""
    }
  },
  created() {
    this.setData()
    this.setData(this.detailConfig.infomation)
    this.addConfig = {
      id_name: "sales_leads_id",
      id: this.detailConfig.infomation.id,
      common_name: this.detailConfig.infomation.id,
      sales_leads_name: this.detailConfig.infomation.name,
      sales_leads_id: this.detailConfig.infomation.id
    }
  },
  mounted() {},
  methods: {
    setData() {
    setData(item) {
      if (item.FollowRecord && item.FollowRecord.length > 0) {
        this.record = item.FollowRecord[0].record
        console.log(item.FollowRecord[0].follow_time)
        if (item.FollowRecord[0].follow_time && item.FollowRecord[0].follow_time.length > 0) {
          let follow_time = item.FollowRecord[0].follow_time
          this.newContactDays = follow_time.substring(0, 10)
          this.noContactDays = this.getDiffDay(Date.now(), this.newContactDays)
        }
      }
      this.basicInfoList = [
        {
          leftStr: "客户名称",
          leftValue: this.detailConfig.infomation.name,
          leftStr: "意向客户名称",
          leftValue: item.name,
          rightStr: "销售线索编号",
          rightValue: this.detailConfig.infomation.number
          rightValue: item.number
        },
        {
          leftStr: "联系人姓名",
          leftValue: this.detailConfig.infomation.contact_name,
          leftValue: item.contact_name,
          rightStr: "联系人职务",
          rightValue: this.detailConfig.infomation.contact_position
          rightValue: item.contact_position
        },
        {
          leftStr: "手机号码",
          leftValue: this.detailConfig.infomation.contact_phone,
          rightStr: "商机状态",
          leftValue: item.contact_phone,
          rightStr: "线索状态",
          rightValue: "新建"
        },
        {
          leftStr: "商机来源",
          leftValue: this.detailConfig.infomation.sales_sources_id,
          leftStr: "线索来源",
          leftValue: item.sales_resources,
          rightStr: "负责人",
          rightValue: this.detailConfig.infomation.member_id
          rightValue: item.member_name
        },
        {
          leftStr: "分配日期",
          leftValue: "",
          rightStr: "公海状态",
          // rightStr: "公海状态",
          // rightValue: ""
          rightStr: "创建时间",
          rightValue: ""
        },
        {
          leftStr: "创建时间",
          // leftStr: "创建时间",
          // leftValue: "",
          // rightStr: "创建人",
          // rightValue: ""
          leftStr: "创建人",
          leftValue: "",
          rightStr: "创建人",
          rightStr: "",
          rightValue: ""
        },
        {
          leftStr: "关闭原因",
          leftValue: "",
          rightStr: "签到",
          rightValue: ""
        }
        // {
        //   leftStr: "关闭原因",
        //   leftValue: "",
        //   rightStr: "",
        //   rightValue: ""
        // }
      ]
      this.dynamicInfoList = [
        {
          leftStr: "未联系天数",
          leftValue: "",
          rightStr: "最新推进时间",
          rightValue: ""
        },
        {
          leftStr: "最新进展",
          leftValue: "",
          leftValue: this.noContactDays,
          rightStr: "最新联系日期",
          rightValue: ""
          rightValue: this.newContactDays
        }
      ]
      this.addressInfoList = [
        {
          leftStr: "国家",
          leftValue: "",
          leftValue: "中国",
          rightStr: "省份",
          rightValue: ""
          rightValue: item.Province.name
        },
        {
          leftStr: "城市",
          leftValue: "",
          rightStr: "区域",
          rightValue: ""
        },
        {
          leftStr: "地址",
          leftValue: "",
          leftValue: item.City.name,
          rightStr: "",
          rightValue: ""
        }
@@ -255,7 +266,22 @@
        this.isDynamicExpand = !this.isDynamicExpand
      } else if (value === "address") {
        this.isAddressExpand = !this.isAddressExpand
      } else if (value === "remark") {
        this.isRemarkExpand = !this.isRemarkExpand
      }
    },
    // 计算两个日期之间的差值
    getDiffDay(date_1, date_2) {
      let totalDays, diffDate
      let myDate_1 = date_1
      let myDate_2 = Date.parse(date_2)
      // 将两个日期都转换为毫秒格式,然后做差
      diffDate = Math.abs(myDate_1 - myDate_2) // 取相差毫秒数的绝对值
      totalDays = Math.floor(diffDate / (1000 * 3600 * 24)) // 向下取整
      // console.log(totalDays)
      return totalDays // 相差的天数
    }
  }
}
@@ -324,7 +350,7 @@
              align-items: center;
              height: 40px;
              .content-title {
                width: 220px;
                width: 320px;
                text-align: right;
                color: #555;
              }
@@ -338,6 +364,24 @@
              width: 100%;
            }
          }
          .business_scope {
            display: flex;
            align-items: center;
            font-size: 14px;
            min-height: 40px;
            .content-title {
              width: 320px;
              text-align: right;
              color: #555;
            }
            .content-data {
              flex: 1;
              padding: 5px;
              text-align: left;
              margin-left: 25px;
              color: #333;
            }
          }
        }
      }
    }