yangfeng
2023-07-19 4898b385886794bf0663ec2d883ea808b78ae522
src/views/sales/salesOpportunity/index.vue
@@ -27,6 +27,7 @@
<script>
import AddSalesOpportunityDialog from "@/views/sales/salesOpportunity/AddSalesOpportunityDialog"
import { getSaleChanceList } from "@/api/sales/salesOpportunity"
export default {
  name: "SalesOpportunity",
@@ -77,24 +78,12 @@
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [
          {
            opportunityName: "123123",
            customName: "上海铃铛",
            salesOpportunityNo: "POT205",
            contactName: "刘总",
            saleStage: "初期沟通",
            possible: "A类客户",
            expectDealDate: "50",
            expectContractAmount: "2023-05-28",
            budgetAbsoluteValue: "¥200,000.00",
            salesHead: "系统管理员"
          }
        ],
        tableInfomation: [],
        tableColumn: [
          { label: "机会名称", prop: "opportunityName", min: 120 }, // 机会名称
          { label: "客户名称", prop: "customName", min: 90 }, // 客户名称
@@ -114,6 +103,34 @@
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
      }
    },
    // 请求数据
    async getData() {
      this.loading = true
      await getSaleChanceList()
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
            if (res.data.list && res.data.list.length > 0) {
              const list = res.data.list.map((item) => {
                return {
                  ...item
                }
              })
              this.tableList.tableInfomation = list || []
            } else {
              this.tableList.tableInfomation = []
            }
          } else {
            this.tableList.tableInfomation = []
          }
          this.loading = false
        })
        .catch((err) => {
          console.log(err)
          this.tableList.tableInfomation = []
          this.loading = false
        })
    },
    // 新建
    addBtnClick() {
      this.editConfig.visible = true