yangfeng
2023-07-14 22d4441a8c669185c13d2b6856c51ad550c50ae2
src/views/custom/salesLead/index.vue
@@ -18,18 +18,23 @@
    </TableCommonView>
    <!-- 新建/编辑销售线索 -->
    <AddSalesLeadDialog v-if="editSalesLeadConfig.visible" :edit-sales-lead-config="editSalesLeadConfig" />
    <!-- 导入文件 -->
    <ImportFileDialog v-if="importConfig.visible" :import-file-config="importConfig" />
  </div>
</template>
<script>
import AddSalesLeadDialog from "@/views/custom/salesLead/AddSalesLeadDialog"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import ImportFileDialog from "@/views/other/commonDialog/ImportFileDialog"
import { getSalesLeadsList } from "@/api/custom/salesLead"
export default {
  name: "SalesLead",
  props: {},
  components: {
    AddSalesLeadDialog
    AddSalesLeadDialog,
    ImportFileDialog
  },
  mixins: [pageMixin],
  computed: {},
@@ -57,6 +62,11 @@
        visible: false,
        title: "新建",
        infomation: {}
      },
      importConfig: {
        visible: false,
        title: "新建",
        infomation: {}
      }
    }
  },
@@ -67,24 +77,13 @@
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [
          {
            customName: "上海通用机械有限公司",
            saleLeadNumber: "LEA110",
            contactName: "董奇伟",
            phoneNumber: "15988887777",
            businessSource: "朋友介绍",
            province: "江苏省",
            city: "连云港市",
            owner: "销售总监"
          }
        ],
        tableInfomation: [],
        tableColumn: [
          { label: "客户名称", prop: "customName", min: 190 }, // 客户名称
          { label: "销售线索编号", prop: "saleLeadNumber", min: 190 }, // 销售线索编号
          { label: "联系人姓名", prop: "contactName", min: 190 }, // 联系人姓名
          { label: "手机号码", prop: "phoneNumber", min: 190 }, // 手机号码
          { label: "商机来源", prop: "businessSource", min: 190 }, // 商机来源
          { label: "客户名称", prop: "name", min: 190 }, // 客户名称
          { label: "销售线索编号", prop: "number", min: 190 }, // 销售线索编号
          { label: "联系人姓名", prop: "contact_name", min: 190 }, // 联系人姓名
          { label: "手机号码", prop: "contact_phone", min: 190 }, // 手机号码
          { label: "商机来源", prop: "sales_sources_id", min: 190 }, // 商机来源
          { label: "省份", prop: "province", min: 190 }, // 省份
          { label: "城市", prop: "city", min: 190 }, // 城市
          { label: "负责人", prop: "owner", min: 190 } // 负责人
@@ -97,7 +96,20 @@
      }
    },
    // 请求数据
    async getData() {},
    async getData() {
      await getSalesLeadsList()
        .then((res) => {
          console.log(res)
          this.tableList.tableInfomation = res.data.tableList.map((item) => {
            item.province = item.Province.name
            item.city = item.City.name
            return item
          })
        })
        .catch((err) => {
          console.log(err)
        })
    },
    // 新建
    addBtnClick() {
      this.editSalesLeadConfig.visible = true
@@ -142,6 +154,11 @@
        region: "1",
        address: ""
      }
    },
    // 导入
    importClitk() {
      this.importConfig.visible = true
      this.importConfig.title = "销售线索"
    }
  }
}