yangfeng
2023-07-19 23d80c1b64f23ede237ab8e89ebc2ee2aaf43f26
src/views/service/serviceContract/index.vue
@@ -1,5 +1,5 @@
<template>
  <div class="sales-lead">
  <div class="service-contract">
    <SearchCommonView ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" />
    <div class="btn-pager">
      <PublicFunctionBtnView :submit-approval="true" :operates-list="operatesList" />
@@ -14,26 +14,19 @@
        </el-table-column>
      </template>
    </TableCommonView>
    <!-- 新建/编辑销售线索 -->
    <!-- 新建/编辑 -->
    <AddServiceContractDialog v-if="editConfig.visible" :edit-common-config="editConfig" />
  </div>
</template>
<script>
import SearchCommonView from "@/components/makepager/SearchCommonView"
import PublicFunctionBtnView from "@/components/makepager/PublicFunctionBtnView"
import PagerView from "@/components/makepager/PagerView"
import TableCommonView from "@/components/makepager/TableCommonView"
import AddServiceContractDialog from "@/views/service/serviceContract/AddServiceContractDialog"
import { getServiceContractList } from "@/api/serviceManage/serviceContract"
export default {
  name: "SalesLead",
  name: "ServiceContract",
  props: {},
  components: {
    SearchCommonView,
    PublicFunctionBtnView,
    PagerView,
    TableCommonView,
    AddServiceContractDialog
  },
  computed: {
@@ -72,34 +65,22 @@
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [
          {
            serviceContractNumber: "FWHT20230703123",
            customName: "上海铃铛信息科技有限公司",
            signDate: "2023-06-26",
            contractType: "按年",
            contractStatus: "已创建",
            owner: "Boss",
            productName: "软件",
            startDate: "2023-06-26",
            endDate: "2024-06-25",
            priceTax: "¥5,000.00"
          }
        ],
        tableInfomation: [],
        tableColumn: [
          { label: "服务合同编号", prop: "serviceContractNumber", min: 100 }, // 服务合同编号
          { label: "客户名称", prop: "customName", min: 120 }, // 客户名称
          { label: "签约日期", prop: "signDate" }, // 签约日期
          { label: "合同类型", prop: "contractType" }, // 合同类型
          { label: "合同状态", prop: "contractStatus" }, // 合同状态
          { label: "负责人", prop: "owner" }, // 负责人
          { label: "服务合同编号", prop: "number", min: 100 }, // 服务合同编号
          { label: "客户名称", prop: "clientId", min: 120 }, // 客户名称
          { label: "签约日期", prop: "signTime" }, // 签约日期
          { label: "合同类型", prop: "typeId" }, // 合同类型
          { label: "合同状态", prop: "statusId" }, // 合同状态
          { label: "负责人", prop: "memberId" }, // 负责人
          { label: "产品名称", prop: "productName" }, // 产品名称
          { label: "服务开始日", prop: "startDate" }, // 服务开始日
          { label: "服务到期日", prop: "endDate" }, // 服务到期日
          { label: "服务开始日", prop: "startTime" }, // 服务开始日
          { label: "服务到期日", prop: "endTime" }, // 服务到期日
          { label: "价税合计", prop: "priceTax" } // 价税合计
        ]
      }
@@ -108,6 +89,34 @@
        const label = this.tableList.tableColumn[i].label
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
      }
    },
    // 请求数据
    async getData() {
      this.loading = true
      await getServiceContractList()
        .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() {
@@ -125,37 +134,13 @@
        signDate: "",
        startDate: "",
        endDate: "",
        customType: "",
        customSource: "",
        importantLevel: "",
        serviceAgent: "",
        nextFollowupDate: "",
        latestServiceDate: "",
        customStatus: "",
        phoneNumber: "",
        duties: "",
        wechat: "1",
        contactsEmail: "",
        industry: "",
        legalPerson: "",
        registerTime: "",
        registerCapital: "",
        companyNature: "",
        customerSize: "",
        operateRange: "",
        position: "",
        map: "",
        country: "1",
        province: "1",
        city: "1",
        region: "1",
        contractStatus: "",
        serviceNumber: "",
        termsTreaty: "",
        notes: "",
        approvalWorkflow: "",
        approvalSteps: "",
        approvalPerson: "",
        approvalUrgent: "",
        approvalOpinion: ""
      }
    },
@@ -165,21 +150,25 @@
      this.editSalesLeadConfig.visible = true
      this.editSalesLeadConfig.title = "编辑"
      this.editSalesLeadConfig.infomation = {
        customName: row.customName,
        saleLeadNumber: row.saleLeadNumber,
        contactName: row.contactName,
        contactDuties: row.contactDuties,
        phoneNumber: row.phoneNumber,
        businessStatus: "新建",
        businessSource: row.businessSource,
        owner: row.owner,
        position: "",
        map: "",
        country: "1",
        province: "1",
        city: "1",
        region: "1",
        address: ""
        customName: "",
        serviceContractNumber: "AC6521",
        owner: "5",
        contactName: "",
        salesOpportunity: "",
        contractOrder: "",
        quotation: "",
        contractType: "",
        signDate: "",
        startDate: "",
        endDate: "",
        contractStatus: "",
        serviceNumber: "",
        termsTreaty: "",
        notes: "",
        approvalWorkflow: "",
        approvalSteps: "",
        approvalPerson: "",
        approvalOpinion: ""
      }
    }
  }
@@ -188,7 +177,7 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.sales-lead {
.service-contract {
  .btn-pager {
    display: flex;
    .page {