yangfeng
2023-08-09 acdff03246ce648082192dfb069c3a006a7fbee6
src/views/service/serviceContract/index.vue
@@ -1,11 +1,27 @@
<template>
  <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" />
      <PagerView class="page" />
    <div v-if="isDetail" class="detail-top">
      <DetailListCommonBtn :query-class-options="queryClassOptions" />
      <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
    </div>
    <TableCommonView ref="tableListRef" :table-list="tableList">
    <div v-else class="top">
      <SearchCommonView
        ref="searchCommonView"
        :query-class-options="queryClassOptions"
        :search-options="searchOptions"
      />
      <div class="btn-pager">
        <PublicFunctionBtnView :submit-approval="true" :operates-list="operatesList" />
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
      </div>
    </div>
    <TableCommonView
      ref="tableListRef"
      :table-list="tableList"
      :select-box="!isDetail"
      @selClientClick="selClientClick"
      @selCommonClick="selCommonClick"
    >
      <template slot="tableButton">
        <el-table-column label="操作" width="90">
          <template slot-scope="scope">
@@ -17,18 +33,32 @@
    </TableCommonView>
    <!-- 新建/编辑 -->
    <AddServiceContractDialog v-if="editConfig.visible" :edit-common-config="editConfig" />
    <!-- 服务合同明细 -->
    <DetailServiceContract v-if="serviceContractDetail.visible" :service-contract-detail="serviceContractDetail" />
    <!-- 客户详情 -->
    <DetailClientManage v-if="clientDeail.visible" :client-manage-detail="clientDeail" />
  </div>
</template>
<script>
import AddServiceContractDialog from "@/views/service/serviceContract/AddServiceContractDialog"
import { getServiceContractList, getDelServiceContract } from "@/api/serviceManage/serviceContract"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import DetailServiceContract from "@/views/service/serviceContract/DetailServiceContract"
export default {
  name: "ServiceContract",
  props: {},
  props: {
    isDetail: {
      type: Boolean,
      default: false
    }
  },
  mixins: [pageMixin],
  components: {
    AddServiceContractDialog
    AddServiceContractDialog,
    DetailServiceContract,
    DetailClientManage: () => import("@/views/client/client/DetailClientManage")
  },
  computed: {
    searchCommonHeight() {
@@ -61,6 +91,14 @@
        visible: false,
        title: "新建",
        infomation: {}
      },
      serviceContractDetail: {
        visible: false,
        infomation: {}
      },
      clientDeail: {
        visible: false,
        infomation: {}
      }
    }
  },
@@ -73,11 +111,11 @@
      this.tableList = {
        tableInfomation: [],
        tableColumn: [
          { label: "服务合同编号", prop: "number", min: 100 }, // 服务合同编号
          { label: "客户名称", prop: "clientId", min: 120 }, // 客户名称
          { label: "服务合同编号", prop: "number", min: 100, isCommonClick: true }, // 服务合同编号
          { label: "客户名称", prop: "clientId", min: 120, isClientClick: true }, // 客户名称
          { label: "签约日期", prop: "signTime" }, // 签约日期
          { label: "合同类型", prop: "typeId" }, // 合同类型
          { label: "合同状态", prop: "statusId" }, // 合同状态
          { label: "合同状态", prop: "serviceContractStatusId" }, // 合同状态
          { label: "负责人", prop: "memberId" }, // 负责人
          { label: "产品名称", prop: "productName" }, // 产品名称
          { label: "服务开始日", prop: "startTime" }, // 服务开始日
@@ -94,7 +132,11 @@
    // 请求数据
    async getData() {
      this.loading = true
      await getServiceContractList()
      await getServiceContractList({
        keyword: "",
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
@@ -105,6 +147,7 @@
                }
              })
              this.tableList.tableInfomation = list || []
              this.pagerOptions.totalCount = res.data.count
            } else {
              this.tableList.tableInfomation = []
            }
@@ -154,6 +197,18 @@
    },
    getSelectArray(val) {
      console.log(val)
    },
    // 客户名称详情
    selClientClick(row) {
      console.log(row)
      this.clientDeail.visible = true
      this.clientDeail.infomation = { ...row, client_name: row.name }
    },
    // 服务合同详情
    selCommonClick(row) {
      console.log(row)
      this.serviceContractDetail.visible = true
      this.serviceContractDetail.infomation = { ...row }
    }
  }
}
@@ -162,7 +217,16 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.service-contract {
  .btn-pager {
  .top {
    margin-bottom: 20px;
    .btn-pager {
      display: flex;
      .page {
        margin-left: auto;
      }
    }
  }
  .detail-top {
    display: flex;
    .page {
      margin-left: auto;