yangfeng
2023-07-19 4898b385886794bf0663ec2d883ea808b78ae522
src/views/client/salesLead/AddSalesLeadDialog.vue
File was renamed from src/views/custom/salesLead/AddSalesLeadDialog.vue
@@ -82,7 +82,7 @@
              <el-col :span="12">
                <el-form-item label="负责人" prop="member_id">
                  <el-select v-model="editConfig.infomation.member_id" placeholder="请选择" size="mini">
                    <el-option v-for="item in ownerOptions" :key="item.value" :label="item.label" :value="item.value">
                    <el-option v-for="item in ownerOptions" :key="item.id" :label="item.username" :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
@@ -108,25 +108,67 @@
            </el-row> -->
            <el-row>
              <el-col :span="12">
                <el-form-item label="国家" prop="country">
                  <CommonSelectView :common-value="editConfig.infomation.country" :common-options="countryOptions" />
                <el-form-item label="国家" prop="country_id">
                  <div class="common-select">
                    <el-select
                      v-model="editConfig.infomation.country_id"
                      placeholder="请选择"
                      class="common-select-sel"
                      size="mini"
                    >
                      <el-option v-for="item in countryOptions" :key="item.id" :label="item.name" :value="item.id">
                      </el-option>
                    </el-select>
                    <div class="common-select-btn"><i class="el-icon-setting"></i></div>
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="省份" prop="province">
                  <CommonSelectView :common-value="editConfig.infomation.province" :common-options="provinceOptions" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="城市" prop="city">
                  <CommonSelectView :common-value="editConfig.infomation.city" :common-options="cityOptions" />
                <el-form-item label="省份" prop="province_id">
                  <div class="common-select">
                    <el-select
                      v-model="editConfig.infomation.province_id"
                      placeholder="请选择"
                      class="common-select-sel"
                      size="mini"
                    >
                      <el-option v-for="item in provinceOptions" :key="item.id" :label="item.name" :value="item.id">
                      </el-option>
                    </el-select>
                    <div class="common-select-btn"><i class="el-icon-setting"></i></div>
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="区域" prop="region">
                  <CommonSelectView :common-value="editConfig.infomation.region" :common-options="regionOptions" />
                <el-form-item label="城市" prop="city_id">
                  <div class="common-select">
                    <el-select
                      v-model="editConfig.infomation.city_id"
                      placeholder="请选择"
                      class="common-select-sel"
                      size="mini"
                    >
                      <el-option v-for="item in cityOptions" :key="item.id" :label="item.name" :value="item.id">
                      </el-option>
                    </el-select>
                    <div class="common-select-btn"><i class="el-icon-setting"></i></div>
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="区域" prop="region_id">
                  <div class="common-select">
                    <el-select
                      v-model="editConfig.infomation.region_id"
                      placeholder="请选择"
                      class="common-select-sel"
                      size="mini"
                    >
                      <el-option v-for="item in regionOptions" :key="item.id" :label="item.name" :value="item.id">
                      </el-option>
                    </el-select>
                    <div class="common-select-btn"><i class="el-icon-setting"></i></div>
                  </div>
                </el-form-item>
              </el-col>
            </el-row>
@@ -178,9 +220,9 @@
</template>
<script>
import CommonSelectView from "@/components/makepager/CommonSelectView"
import EditDropdownDialog from "@/views/other/commonDialog/EditDropdownDialog"
import { getSalesSourcesList, getAddSalesLeads, getUpdateSalesLeads } from "@/api/custom/salesLead"
import { getAddSalesLeads, getUpdateSalesLeads } from "@/api/client/salesLead"
import { getAllData } from "@/api/client/client"
export default {
  name: "AddSalesLeadDialog",
@@ -200,10 +242,10 @@
            businessStatus: "",
            sales_sources_id: "",
            member_id: "",
            country: "",
            province: "",
            city: "",
            region: "",
            country_id: "",
            province_id: "",
            city_id: "",
            region_id: "",
            address: "",
            desc: "",
            id: ""
@@ -212,7 +254,7 @@
      }
    }
  },
  components: { CommonSelectView, EditDropdownDialog },
  components: { EditDropdownDialog },
  computed: {
    searchCommonHeight() {
      return this.$refs.searchCommonView.offsetHeight
@@ -228,16 +270,7 @@
        businessStatus: [{ required: true, message: "请输入商机状态", trigger: "blur" }],
        sales_sources_id: [{ required: true, message: "请选择商机来源", trigger: "change" }]
      },
      businessSourceOptions: [
        { id: "1", name: "后台注册" },
        { id: "2", name: "代理商客户" },
        { id: "3", name: "电话陌生拜访" },
        { id: "4", name: "直接访问" },
        { id: "5", name: "项目合作" },
        { id: "6", name: "个人自找" },
        { id: "7", name: "二次销售" },
        { id: "8", name: "公司电话" }
      ],
      businessSourceOptions: [],
      ownerOptions: [
        { value: "1", label: "BOSS" },
        { value: "2", label: "Mia" },
@@ -247,25 +280,10 @@
        { value: "6", label: "销售" },
        { value: "7", label: "销售总监" }
      ],
      countryOptions: [{ value: "1", label: "中国" }], // 国家
      provinceOptions: [
        { value: "1", label: "北京市" },
        { value: "2", label: "上海市" },
        { value: "3", label: "吉林省" },
        { value: "4", label: "陕西省" }
      ], // 省份
      cityOptions: [
        { value: "1", label: "北京市" },
        { value: "2", label: "上海市" },
        { value: "3", label: "吉林市" },
        { value: "4", label: "西安市" }
      ], // 城市
      regionOptions: [
        { value: "1", label: "朝阳区" },
        { value: "2", label: "海淀区" },
        { value: "3", label: "通州区" },
        { value: "4", label: "西城区" }
      ], // 区域
      countryOptions: [], // 国家
      provinceOptions: [], // 省份
      cityOptions: [], // 城市
      regionOptions: [], // 区域
      unflodCollapseStr: "收起",
      isUnflod: true,
      editDropdownConfig: {
@@ -280,10 +298,14 @@
  },
  methods: {
    getCommonData() {
      getSalesSourcesList()
      getAllData()
        .then((res) => {
          console.log(res)
          this.businessSourceOptions = res.data.list
          this.businessSourceOptions = res.data.sales_source
          this.countryOptions = res.data.country
          this.provinceOptions = res.data.province
          this.cityOptions = res.data.city
          this.regionOptions = res.data.region
        })
        .catch((err) => {
          console.log(err)
@@ -298,18 +320,18 @@
        if (valid) {
          console.log(this.editConfig.infomation)
          let params = {
            city_id: 0,
            city_id: this.editConfig.infomation.city_id || 0,
            contact_name: this.editConfig.infomation.contact_name || "",
            contact_phone: this.editConfig.infomation.contact_phone || "",
            contact_position: this.editConfig.infomation.contact_position || "",
            country_id: 0,
            country_id: this.editConfig.infomation.country_id || 0,
            id: this.editConfig.title === "新建" ? 0 : this.editConfig.infomation.id,
            desc: this.editConfig.infomation.desc || "",
            member_id: parseInt(this.editConfig.infomation.member_id) || 0,
            name: this.editConfig.infomation.name || "",
            number: this.editConfig.infomation.number || "",
            province_id: 0,
            region_id: 0,
            province_id: this.editConfig.infomation.province_id || 0,
            region_id: this.editConfig.infomation.region_id || 0,
            sales_sources_id: this.editConfig.infomation.sales_sources_id || 0
          }
          console.log(params)