<!--添加跟进-->
<template>
  <view class="assemble">
    <view class="form-style">
      <fui-form ref="form" top="0" :model="formData" :show="false">
        <view class="input-style">
          <fui-form-item asterisk label="选择线索"  asteriskPosition="right" labelSize='26' prop="" background='#434544'
                         labelColor='#fff' :bottomBorder='false'>
            <view class="input-title" style="margin-right:14rpx;">

              <view class="input-title" style="margin-right:14rpx;" @click="selectCon(`sales_id`)"
                    v-if="!formData.sales_id">点击选择
              </view>
              <view class="input-title" style="margin-right:14rpx;" @click="selectCon(`sales_id`)" v-else>
                {{str_sales_id}}
              </view>

            </view>
          </fui-form-item>

          <fui-form-item
              asterisk
              label="跟进人员"
              asteriskPosition="right"
              labelSize='26'
              prop=""
              background='#434544'
              labelColor='#fff'
              :bottomBorder='false'
          >
            <view class="input-title" style="margin-right:14rpx;">
              <view v-if="!formData.staff_id" class="input-title" style="margin-right:14rpx;" @click="selectCon(`staff_id`)">点击选择
              </view>
              <view v-else class="input-title" style="margin-right:14rpx;" @click="selectCon(`staff_id`)">
                {{ str_staff_id }}
              </view>
            </view>
          </fui-form-item>

          <!--下拉-->
          <fui-form-item
              asterisk
              label="跟进时间"
              asteriskPosition="right"
              labelSize='26'
              prop=""
              background='#434544'
              labelColor='#fff'
              :bottomBorder='false'
          >
            <view class="input-title" style="margin-right:14rpx;">
              <view v-if="!formData.follow_up_time" class="input-title" style="margin-right:14rpx;" @click="selectCon(`follow_up_time`)">点击选择
              </view>
              <view v-else class="input-title" style="margin-right:14rpx;" @click="selectCon(`follow_up_time`)">
                {{ formData.follow_up_time }}
              </view>
            </view>
          </fui-form-item>

          <!-- 需求（手写）-->
          <fui-form-item
              asterisk
              label="需求"
              asteriskPosition="right"
              labelSize='26'
              prop=""
              background='#434544'
              labelColor='#fff'
              :bottomBorder='false'
          >
            <view class="input-title" style="margin-right:14rpx;">
              <fui-input :borderBottom="false" :padding="[0]" placeholder="点击填写" v-model="formData.requirement"
                         backgroundColor="#434544" size="26" color="#fff"></fui-input>
            </view>
          </fui-form-item>

          <fui-form-item
              label="购买力"
              asteriskPosition="right"
              labelSize='26'
              prop=""
              background='#434544'
              labelColor='#fff'
              :bottomBorder='false'
          >
            <view class="input-title" style="margin-right:14rpx;">
              <view v-if="!formData.purchasing_power" class="input-title" style="margin-right:14rpx;" @click="selectCon(`purchasing_power`)">点击选择
              </view>
              <view v-else class="input-title" style="margin-right:14rpx;" @click="selectCon(`purchasing_power`)">
                {{ str_purchasing_power }}
              </view>
            </view>
          </fui-form-item>

          <fui-form-item
              label="认知理念"
              asteriskPosition="right"
              labelSize='26'
              prop=""
              background='#434544'
              labelColor='#fff'
              :bottomBorder='false'
          >
            <view class="input-title" style="margin-right:14rpx;">
              <view v-if="!formData.cognitive_concept" class="input-title" style="margin-right:14rpx;" @click="selectCon(`cognitive_concept`)">点击选择
              </view>
              <view v-else class="input-title" style="margin-right:14rpx;" @click="selectCon(`cognitive_concept`)">
                {{ str_cognitive_concept }}
              </view>
            </view>
          </fui-form-item>

          <fui-form-item
              label="可选上课时间"
              asteriskPosition="right"
              labelSize='26'
              prop=""
              background='#434544'
              labelColor='#fff'
              :bottomBorder='false'
          >
            <view class="input-title" style="margin-right:14rpx;">
              <view v-if="!formData.schooltime" class="input-title" style="margin-right:14rpx;" @click="selectCon(`schooltime`)">点击选择
              </view>
              <view v-else class="input-title" style="margin-right:14rpx;" @click="selectCon(`schooltime`)">
                {{ formData.schooltime }}
              </view>
            </view>
          </fui-form-item>

          <!--（手写）-->
          <fui-form-item
              label="距离"
              asteriskPosition="right"
              labelSize='26'
              prop=""
              background='#434544'
              labelColor='#fff'
              :bottomBorder='false'
          >
            <view class="input-title" style="margin-right:14rpx;">
              <fui-input :borderBottom="false" :padding="[0]" placeholder="点击填写" v-model="formData.distance"
                         backgroundColor="#434544" size="26" color="#fff"></fui-input>
            </view>
          </fui-form-item>

          <!--（手写）-->
          <fui-form-item
              label="决策人"
              asteriskPosition="right"
              labelSize='26'
              prop=""
              background='#434544'
              labelColor='#fff'
              :bottomBorder='false'
          >
            <view class="input-title" style="margin-right:14rpx;">
              <fui-input :borderBottom="false" :padding="[0]" placeholder="点击填写" v-model="formData.decision_maker"
                         backgroundColor="#434544" size="26" color="#fff"></fui-input>
            </view>
          </fui-form-item>

          <!--下拉-->
          <fui-form-item
              label="情感粘度"
              asteriskPosition="right"
              labelSize='26'
              prop=""
              background='#434544'
              labelColor='#fff'
              :bottomBorder='false'
          >
            <view class="input-title" style="margin-right:14rpx;">
              <view v-if="!formData.emotional_intensity" class="input-title" style="margin-right:14rpx;" @click="selectCon(`emotional_intensity`)">点击选择
              </view>
              <view v-else class="input-title" style="margin-right:14rpx;" @click="selectCon(`emotional_intensity`)">
                {{ str_emotional_intensity }}
              </view>
            </view>
          </fui-form-item>
        </view>

        <view class="title" style="margin-top: 20rpx;">初步意向度</view>
        <view class="input-style">
          <!--下拉-->
          <fui-form-item
              label="意向分类"
              asteriskPosition="right"
              labelSize='26'
              prop=""
              background='#434544'
              labelColor='#fff'
              :bottomBorder='false'
          >
            <view class="input-title" style="margin-right:14rpx;">
              <view v-if="!formData.initial_customer_intent" class="input-title" style="margin-right:14rpx;" @click="selectCon(`initial_customer_intent`)">点击选择
              </view>
              <view v-else class="input-title" style="margin-right:14rpx;" @click="selectCon(`initial_customer_intent`)">
                {{ str_initial_customer_intent }}
              </view>
            </view>
          </fui-form-item>

          <!--下拉-->
          <fui-form-item
              label="意向度"
              asteriskPosition="right"
              labelSize='26'
              prop=""
              background='#434544'
              labelColor='#fff'
              :bottomBorder='false'
          >
            <view class="input-title" style="margin-right:14rpx;">
              <view v-if="!formData.initial_relationship_intent" class="input-title" style="margin-right:14rpx;" @click="selectCon(`initial_relationship_intent`)">点击选择
              </view>
              <view v-else class="input-title" style="margin-right:14rpx;" @click="selectCon(`initial_relationship_intent`)">
                {{ str_initial_relationship_intent }}
              </view>
            </view>
          </fui-form-item>

          <!--文本域-->
          <view>
            <fui-form-item label="备注" labelSize='26' asteriskPosition="right" prop="mobile"
                           background='#434544' labelColor='#fff' :bottomBorder='false'>
            </fui-form-item>
            <view style="width: 100%;background: #434544;">
              <view style="margin: auto;width: 92%;padding: 20rpx 0 50rpx;">
                <fui-textarea :padding="['10rpx','10rpx','10rpx','10rpx']" v-model="formData.follow_up_content"
                              backgroundColor="#434544" size="26" color="#fff" :textareaBorder="true" style="text-align: left !important;"></fui-textarea>
              </view>
            </view>
          </view>
        </view>

        <view class="title" style="margin-top: 20rpx;">跟进任务</view>
        <view class="input-style">
          <fui-form-item label="转交跟进任务" labelWidth="250" labelSize='26' asteriskPosition="right"
                         prop="mobile"
                         background='#434544' labelColor='#fff' :bottomBorder='false'>
            <fui-switch @change="switchChange" :checked="formData.is_warn_btn"></fui-switch>
          </fui-form-item>
          <view v-if="formData.is_warn == 1">

            <!--下拉-->
            <fui-form-item
                asterisk
                label="跟进类型"
                asteriskPosition="right"
                labelSize='26'
                prop=""
                background='#434544'
                labelColor='#fff'
                :bottomBorder='false'
            >
              <view class="input-title" style="margin-right:14rpx;">
                <view v-if="!formData.entry_type" class="input-title" style="margin-right:14rpx;" @click="selectCon(`entry_type`)">点击选择
                </view>
                <view v-else class="input-title" style="margin-right:14rpx;" @click="selectCon(`entry_type`)">
                  {{ str_entry_type }}
                </view>
              </view>
            </fui-form-item>

            <!--下拉-->
            <fui-form-item
                asterisk
                label="跟进人员"
                asteriskPosition="right"
                labelSize='26'
                prop=""
                background='#434544'
                labelColor='#fff'
                :bottomBorder='false'
            >
              <view class="input-title" style="margin-right:14rpx;">
                <view v-if="!formData.follow_staff_id" class="input-title" style="margin-right:14rpx;" @click="selectCon(`follow_staff_id`)">点击选择
                </view>
                <view v-else class="input-title" style="margin-right:14rpx;" @click="selectCon(`follow_staff_id`)">
                  {{ str_follow_staff_id }}
                </view>
              </view>
            </fui-form-item>

            <!--下拉-->
            <fui-form-item
                asterisk
                label="跟进时间"
                asteriskPosition="right"
                labelSize='26'
                prop=""
                background='#434544'
                labelColor='#fff'
                :bottomBorder='false'
            >
              <view class="input-title" style="margin-right:14rpx;">
                <view v-if="!formData.reminder_time" class="input-title" style="margin-right:14rpx;" @click="selectCon(`reminder_time`)">点击选择
                </view>
                <view v-else class="input-title" style="margin-right:14rpx;" @click="selectCon(`reminder_time`)">
                  {{ formData.reminder_time }}
                </view>
              </view>
            </fui-form-item>

            <!--手写-->
            <fui-form-item
                label="备注"
                asteriskPosition="right"
                labelSize='26'
                prop=""
                background='#434544'
                labelColor='#fff'
                :bottomBorder='false'
            >
              <view class="input-title" style="margin-right:14rpx;">
                <fui-input :borderBottom="false" :padding="[0]" placeholder="点击填写" v-model="formData.follow_content"
                           backgroundColor="#434544" size="26" color="#fff"></fui-input>
              </view>
            </fui-form-item>


          </view>
        </view>
      </fui-form>
    </view>
    <view class="fui-btn__box">
      <fui-button background="#434544" color="#24BA9F" borderColor="#24BA9F" @click="submit">保存</fui-button>
    </view>


    <!-- 年月日-选择时间 -->
    <fui-date-picker :show="show_date" type="5" @change="change_date" @cancel="cancel_date"></fui-date-picker>

    <!-- 下拉选择器 -->
    <fui-picker :linkage='linkage' :options="options" :layer="1" :show="show" @change="changeOptions"
                @cancel="cancel"></fui-picker>
  </view>
</template>

<script>
import commonApi from '@/api/common.js';
import marketApi from '@/api/market.js';
import memberApi from '@/api/member.js';

const rules = [{
  name: "mobile",
  rule: ["required", "isMobile"],
  msg: ["请输入手机号", "请输入正确的手机号"]
}];
export default {
  data() {
    return {
      rules,

      is_submit: true,//是否提交(防止重复提交)|true=可提交,false=不可提交

      //表单数据
      formData:{
        //##### 基础表单 #####
        sales_id:'',//选择线索(线索id)
        staff_id:'',//跟进人员
        follow_up_time:'',//跟进时间(2025-03-20 16:04:50)
        requirement:'',//需求
        purchasing_power:'',//购买力(1=低,2=中,3=高)
        cognitive_concept:'',//认知理念|1=低,2=中,3=高
        schooltime:'',//可选上课时间(2025-03-20 16:04:50)
        distance:'',//距离
        decision_maker:'',//决策人
        emotional_intensity:'',//情感粘度|1=低,2=中,3=高
        //##### 初步意向 #####
        initial_customer_intent:'',//意向分类(客户初步意向度|A+,A,A-,B+B,B-,C)
        initial_relationship_intent:'',//意向度(客情初步意向度|A,B,C)
        follow_up_content:'',//备注
        //##### 跟进任务 #####
        is_warn:'1',//是否转角跟进任务(是否提醒 1提醒 2不提醒)
        is_warn_btn:true,//是否转角跟进任务(是否提醒 true=提醒 false=不提醒),只做前端按钮展示使用
        entry_type:'',//跟进类型(1=市场人员录入的,2=销售人员录入)
        follow_staff_id:'',//跟进人员
        reminder_time:'',//跟进时间
        follow_content:'',//备注
      },

      //下拉选择器组件
      options_type: undefined,//选择器标识
      show: false,//是否显示下拉选择器
      linkage: true,//是否联动选择
      options: [
        // {
        //   'value': 1,
        //   'text': '类型1'
        // }
      ],//下拉选择器可选值列表

      //时间选择器相关
      show_date: false,//是否显示时间选择器|true=是,false=否

      //选择线索-相关
      //字典-选择线索
      options_sales_id:[],
      //文本展示-选择线索
      str_sales_id:'',

      //跟进类型-相关
      //字典-跟进类型
      options_entry_type:[],
      //文本展示-跟进类型
      str_entry_type:'',

      //跟进人员-相关
      //字典-跟进人员(全部)
      options_staff_id:[],
      //文本展示-跟进人员
      str_staff_id:'',

      //购买力-相关
      //字典-购买力
      options_purchasing_power:[],
      //文本展示-购买力
      str_purchasing_power:'',

      //认知理念-相关
      //字典-认知理念
      options_cognitive_concept:[],
      //文本展示-认知理念
      str_cognitive_concept:'',

      //情感粘度-相关
      //字典-情感粘度
      options_emotional_intensity:[],
      //文本展示-情感粘度
      str_emotional_intensity:'',

      //意向分类-相关
      //字典-意向分类
      options_initial_customer_intent:[],
      //文本展示-意向分类
      str_initial_customer_intent:'',

      //意向度-相关
      //字典-意向度(客情)
      options_initial_relationship_intent:[],
      //文本展示-意向度
      str_initial_relationship_intent:'',

      //跟进任务-跟进人员-相关
      //字典-跟进任务-跟进人员(市场)
      options_follow_staff_id_sc:[],
      //字典-跟进任务-跟进人员(销售)
      options_follow_staff_id_xs:[],
      //文本展示-跟进任务-跟进人员
      str_follow_staff_id:'',
    }
  },
  onLoad(options) {

  },
  onShow() {
    this.init()
  },
  methods: {
    //初始化
    async init() {
      this.getUserInfo()
      //获取字典-选择线索
      this.getSalesList()
      //获取字典-跟进类型
      this.getDic_entry_type()

      //获取字典-购买力
      this.getDic_purchasing_power()
      //获取字典-认知理念
      this.getDic_cognitive_concept()
      //获取字典-情感粘度
      this.getDic_emotional_intensity()
      //获取字典-意向分类
      this.getDic_initial_customer_intent()
      //获取字典-意向度
      this.getDic_initial_relationship_intent()
      //获取字典-跟进人员(全部)
      this.getDic_staff_id('')
      //获取字典-跟进人员(市场)
      this.getDic_staff_id('5')
      //获取字典-跟进人员(销售)
      this.getDic_staff_id('6')
    },

    //获取当前登陆用户信息
    async getUserInfo(){
      let res = await marketApi.member({})
      if (res.code != 1) {
        uni.showToast({
          title: res.msg,
          icon: 'none'
        })
        return
      }
      console.log(111,res.data)
      this.formData.staff_id = res.data.staff_id//基础表单->跟进人员
      this.str_staff_id = res.data.name//基础表单->跟进人员名字
    },


    //获取字典-选择线索
    async getSalesList() {
      let res = await marketApi.salesList({})
      if (res.code != 1) {
        uni.showToast({
          title: res.msg,
          icon: 'none'
        })
        return
      }

      this.options_sales_id = []
      res.data.forEach((v, k) => {
        this.options_sales_id.push({
          value: v.id,
          text: v.title,
        })
      })
    },
    //获取字典-跟进类型
    async getDic_entry_type() {
      //填写人员类型(字典:1=市场人员录入的,2=销售人员录入的)
      this.options_entry_type = [
        {
          value: 1,
          text: '市场人员',
        },
        {
          value: 2,
          text: '销售人员',
        },
      ]
    },
    //获取字典-购买力
    async getDic_purchasing_power() {
      this.options_purchasing_power = [
        {
          value: 1,
          text: '低',
        },
        {
          value: 2,
          text: '中',
        },
        {
          value: 3,
          text: '高',
        },
      ]
    },
    //获取字典-认知理念
    async getDic_cognitive_concept() {
      // 认知理念|1=低,2=中,3=高
      this.options_cognitive_concept = [
        {
          value: 1,
          text: '低',
        },
        {
          value: 2,
          text: '中',
        },
        {
          value: 3,
          text: '高',
        },
      ]
    },
    //获取字典-情感粘度
    async getDic_emotional_intensity() {
      // 情感粘度|1=低,2=中,3=高
      this.options_emotional_intensity = [
        {
          value: 1,
          text: '低',
        },
        {
          value: 2,
          text: '中',
        },
        {
          value: 3,
          text: '高',
        },
      ]
    },
    //获取字典-意向分类
    async getDic_initial_customer_intent() {
      let key = 'initial_customer_intent'
      let res = await commonApi.getDictionary(key)
      if (res.code != 1) {
        uni.showToast({
          title: res.msg,
          icon: 'none'
        })
        return
      }
      this.follow_up_type = res.data.dictionary

      this.options_initial_customer_intent = []
      res.data.dictionary.forEach((v, k) => {
        this.options_initial_customer_intent.push({
          value: v.value,
          text: v.name,
        })
      })
    },
    //获取字典-意向度
    async getDic_initial_relationship_intent() {
      let key = 'initial_relationship_intent'
      let res = await commonApi.getDictionary(key)
      if (res.code != 1) {
        uni.showToast({
          title: res.msg,
          icon: 'none'
        })
        return
      }

      this.options_initial_relationship_intent = []
      res.data.dictionary.forEach((v, k) => {
        this.options_initial_relationship_intent.push({
          value: v.value,
          text: v.name,
        })
      })
    },
    //获取字典-跟进人员(全部)
    //获取人员列表 role_id|5=市场,6=销售
    async getDic_staff_id(role_id=''){
      let res = await memberApi.staffList({
        type: 2,
        role_id:role_id
      })
      if (res.code != 1) {
        uni.showToast({
          title: res.msg,
          icon: 'none'
        })
        return
      }

      let arr = []
      res.data.forEach((v,k)=>{
        arr.push({
          text: v.name,
          value: v.id,
        })
      })

      if(role_id == 5){
        this.options_follow_staff_id_sc = arr
        console.log('市场',arr)
      }else if(role_id == 6){
        this.options_follow_staff_id_xs = arr
        console.log('销售',arr)
      }else{
        //全部
        this.options_staff_id = arr
        console.log('全部',arr)
      }
    },

    //表单验证
    async validatorForm(data) {
      //线索
      if(!data.sales_id){
        uni.showToast({
          title: '线索必填',
          icon: 'none'
        })
        return false
      }
      //跟进人员
      if(!data.staff_id){
        uni.showToast({
          title: '跟进人员必填',
          icon: 'none'
        })
        return false
      }
      //跟进时间标题
      if(!data.follow_up_time){
        uni.showToast({
          title: '跟进时间必填',
          icon: 'none'
        })
        return false
      }
      //需求标题
      if(!data.requirement){
        uni.showToast({
          title: '需求必填',
          icon: 'none'
        })
        return false
      }

      //##### 跟进 #####
      if(data.is_warn == 1){
        //跟进类型
        if(!data.entry_type){
          uni.showToast({
            title: '跟进类型必填',
            icon: 'none'
          })
          return false
        }
        //跟进人员
        if(!data.follow_staff_id){
          uni.showToast({
            title: '跟进人员必填',
            icon: 'none'
          })
          return false
        }
        //跟进时间
        if(!data.reminder_time){
          uni.showToast({
            title: '跟进时间必填',
            icon: 'none'
          })
          return false
        }
      }
      return true
    },
    //提交
    async submit() {
      console.log('提交',this.formData)
      let data = {...this.formData}
      //表单验证
      let validatorForm = await this.validatorForm(data)
      console.log('验证结果',validatorForm)
      if(!validatorForm){
        return
      }

      //防止重复提交
      if (!this.is_submit) {
        return
      }
      this.is_submit = false

      let res = await marketApi.createFollow(data)

      this.is_submit = true

      if(res.code != 1){
        uni.showToast({
          title: res.msg,
          icon: 'none'
        })
        return
      }
      uni.showToast({
        title: res.msg,
        icon: 'success'
      })
      //延迟1s执行
      setTimeout(() => {
        //跳转页面-线索列表
        uni.navigateTo({
          url: `/pages/market/clue/index`
        })
      }, 1000)
    },


    //选择弹窗
    selectCon(type) {
      this.options_type = type
      switch (type) {
          //选择线索
        case 'sales_id':
          this.options = this.options_sales_id
          this.show = true
          this.linkage = true
          break;
          //基础表单->跟进人员
        case 'staff_id':
          this.options = this.options_staff_id
          this.show = true
          this.linkage = true
          break;
          //跟进时间
        case 'follow_up_time':
          this.show_date = true
          break;
          //购买力
        case 'purchasing_power':
          this.options = this.options_purchasing_power
          this.show = true
          this.linkage = true
          break;
          //认知理念
        case 'cognitive_concept':
          this.options = this.options_cognitive_concept
          this.show = true
          this.linkage = true
          break;
          //可选上课时间
        case 'schooltime':
          this.show_date = true
          break;
          //情感粘度
        case 'emotional_intensity':
          this.options = this.options_emotional_intensity
          this.show = true
          this.linkage = true
          break;
          //意向分类
        case 'initial_customer_intent':
          this.options = this.options_initial_customer_intent
          this.show = true
          this.linkage = true
          break;
          //意向度
        case 'initial_relationship_intent':
          this.options = this.options_initial_relationship_intent
          this.show = true
          this.linkage = true
          break;
          //跟进类型
        case 'entry_type':
          this.options = this.options_entry_type
          this.show = true
          this.linkage = true
            //清空跟进任务->跟进人员
            this.formData.follow_staff_id = ''
          break;
          //跟进任务->跟进人员
        case 'follow_staff_id':
          if(!this.formData.entry_type){
            uni.showToast({
              title: '请先选择跟进类型',
              icon: 'none'
            })
            return
          }

          if(this.formData.entry_type == 1){
            //市场人员列表
            this.options = this.options_follow_staff_id_sc
          }else{
            //销售人员列表
            this.options = this.options_follow_staff_id_xs
          }

          this.show = true
          this.linkage = true
          break;
          //跟进任务-跟进时间(跟进任务)
        case 'reminder_time':
          this.show_date = true
          break;
      }
    },
    //监听-下拉选择框
    changeOptions(e) {
      console.log('选择器选中',e)
      this.show = false
      let type = this.options_type
      switch (type) {
          //选择线索
        case 'sales_id':
          this.str_sales_id = e.text//选中的text值
          this.formData.sales_id = e.value//选中value值
          break;
          //跟进人员
        case 'staff_id':
          this.str_staff_id = e.text//选中的text值
          this.formData.staff_id = e.value//选中value值
          break;
          //购买力
        case 'purchasing_power':
          this.str_purchasing_power = e.text//选中的text值
          this.formData.purchasing_power = e.value//选中value值
          break;
          //认知理念
        case 'cognitive_concept':
          this.str_cognitive_concept = e.text//选中的text值
          this.formData.cognitive_concept = e.value//选中value值
          break;
          //情感粘度
        case 'emotional_intensity':
          this.str_emotional_intensity = e.text//选中的text值
          this.formData.emotional_intensity = e.value//选中value值
          break;
          //意向分类
        case 'initial_customer_intent':
          this.str_initial_customer_intent = e.text//选中的text值
          this.formData.initial_customer_intent = e.value//选中value值
          break;
          //意向度
        case 'initial_relationship_intent':
          this.str_initial_relationship_intent = e.text//选中的text值
          this.formData.initial_relationship_intent = e.value//选中value值
          break;
          //跟进类型
        case 'entry_type':
          this.str_entry_type = e.text//选中的text值
          this.formData.entry_type = e.value//选中value值
          break;
          //跟进人员
        case 'follow_staff_id':
          this.str_follow_staff_id = e.text//选中的text值
          this.formData.follow_staff_id = e.value//选中value值
          break;
      }
    },

    //关闭选择框
    cancel() {
      this.show = false
    },

    //监听-时间选择器
    change_date(e) {

      this.show_date = false
      //跟进时间
      let type = this.options_type
      console.log('时间选择器',type,e)
      let val = (e.result ?? '')
      if(val){
        val = val + ':00'
      }

      switch (type) {
          //跟进时间
        case 'follow_up_time':
          this.formData.follow_up_time  = val
          break;
          //可选上课时间
        case 'schooltime':
          this.formData.schooltime = val
          break;
          //跟进任务->跟进时间
        case 'reminder_time':
          this.formData.reminder_time = val
          break;
      }
    },
    //关闭时间选择器
    cancel_date() {
      this.show_date = false
    },


    //监听-转交跟进任务
    switchChange(e){
      console.log('监听-转交跟进任务',e)
      let val = e.detail.value
      if(val){
        this.formData.is_warn = 1//是否提醒 1提醒 2不提醒
      }else{
        this.formData.is_warn = 2//是否提醒 1提醒 2不提醒

        this.formData.entry_type = ''//-跟进类型
        this.formData.follow_staff_id = ''//-跟进人员
        this.formData.reminder_time = ''//-跟进时间
        this.formData.follow_content = ''//-备注
      }
    }

  }
}
</script>

<style lang="less" scoped>
	.assemble {
		width: 100%;
		height: 100vh;
		background: #292929;
		overflow: auto;
	}

	.title {
		font-size: 26rpx;
		color: #fff;
		padding: 26rpx 0 26rpx 32rpx;
	}

	.input-title {
		font-size: 26rpx;
		color: #fff;
	}

	.form-style {
		width: 100%;
		// background: #434544;
	}

	.form-style-vid {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 12rpx 0;
	}

	.input-style {
		text-align: right !important;
	}

	.fui-btn__box {
		margin: 50rpx auto 120rpx;
		width: 92%;
	}
</style>