yangfeng
2023-08-11 78cf30802189becef2725af73f37b5d2cb28600f
src/views/sales/contractManage/index.vue
@@ -1,43 +1,52 @@
<template>
  <div class="contract-manage">
    <SearchCommonView
      ref="searchCommonView"
      :label-search="true"
      :query-class-options="queryClassOptions"
      :search-options="searchOptions"
    />
    <div class="btn-pager">
      <PublicFunctionBtnView
        :receive="false"
        :submit-approval="true"
        ::statistics="true"
        :operates-list="operatesList"
    <div class="top">
      <SearchCommonView
        ref="searchCommonView"
        :label-search="true"
        :query-class-options="queryClassOptions"
        :search-options="searchOptions"
      />
      <PagerView class="page" />
      <div class="btn-pager">
        <PublicFunctionBtnView
          :receive="false"
          :submit-approval="true"
          ::statistics="true"
          :operates-list="operatesList"
        />
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
      </div>
    </div>
    <TableCommonView ref="tableListRef" :table-list="tableList">
    <TableCommonView ref="tableListRef" :table-list="tableList" @selCommonClick="selCommonClick">
      <template slot="tableButton">
        <el-table-column label="操作" width="100">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
            <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button>
          </template>
        </el-table-column>
      </template>
    </TableCommonView>
    <!-- 新建/编辑 -->
    <AddContractManageDialog v-if="editConfig.visible" :edit-common-config="editConfig" />
    <!-- 机会详情 -->
    <DetailContractManage v-if="contractDetail.visible" :contract-detail="contractDetail" />
  </div>
</template>
<script>
import AddContractManageDialog from "@/views/sales/contractManage/AddContractManageDialog"
import { getContractList } from "@/api/sales/contractManage"
import { getContractList, getDelContract } from "@/api/sales/contractManage"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import DetailContractManage from "@/views/sales/contractManage/DetailContractManage"
export default {
  name: "ContractManage",
  props: {},
  mixins: [pageMixin],
  components: {
    AddContractManageDialog
    AddContractManageDialog,
    DetailContractManage
  },
  computed: {
    searchCommonHeight() {
@@ -70,6 +79,10 @@
        visible: false,
        title: "新建",
        infomation: {}
      },
      contractDetail: {
        visible: false,
        infomation: {}
      }
    }
  },
@@ -82,7 +95,7 @@
      this.tableList = {
        tableInfomation: [],
        tableColumn: [
          { label: "单据编号", prop: "number", min: 120 },
          { label: "单据编号", prop: "number", min: 120, isCommonClick: true },
          { label: "负责人", prop: "memberId", min: 90 },
          { label: "审批状态", prop: "approvalStatus" },
          { label: "创建人", prop: "creator", min: 100 },
@@ -98,7 +111,11 @@
    // 请求数据
    async getData() {
      this.loading = true
      await getContractList()
      await getContractList({
        keyword: "",
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
@@ -109,6 +126,7 @@
                }
              })
              this.tableList.tableInfomation = list || []
              this.pagerOptions.totalCount = res.data.count
            } else {
              this.tableList.tableInfomation = []
            }
@@ -127,34 +145,43 @@
    addBtnClick() {
      this.editConfig.visible = true
      this.editConfig.title = "新建"
      this.editConfig.infomation = {
        customName: "",
        documentNumber: "ZDYBD01-3",
        owner: "",
        contractStatus: "",
        salesQuotation: "",
        approvalWorkflow: "",
        approvalSteps: "",
        approvalPerson: "",
        approvalOpinion: ""
      }
      this.editConfig.infomation = {}
    },
    // 编辑
    handleClick(row) {
      console.log(row)
      this.editConfig.visible = true
      this.editConfig.title = "编辑"
      this.editConfig.infomation = {
        customName: "",
        documentNumber: "TKD20230521-12",
        owner: "",
        contractStatus: "",
        salesQuotation: "",
        approvalWorkflow: "",
        approvalSteps: "",
        approvalPerson: "",
        approvalOpinion: ""
      }
      this.editConfig.infomation = { ...row }
    },
    // 删除
    delClick(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(function () {
          return getDelContract({ id: id })
        })
        .then((response) => {
          if (response.code === 200) {
            this.$message.success("删除成功")
            this.getData()
          } else {
            this.$message.warning("删除失败")
          }
        })
        .catch(function () {})
    },
    getSelectArray(val) {
      console.log(val)
    },
    // 合同管理详情
    selCommonClick(row) {
      console.log(row)
      this.contractDetail.visible = true
      this.contractDetail.infomation = { ...row }
    }
  }
}
@@ -163,10 +190,13 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.contract-manage {
  .btn-pager {
    display: flex;
    .page {
      margin-left: auto;
  .top {
    margin-bottom: 20px;
    .btn-pager {
      display: flex;
      .page {
        margin-left: auto;
      }
    }
  }
}