yangfeng
2023-08-09 acdff03246ce648082192dfb069c3a006a7fbee6
src/views/sales/refundForm/index.vue
@@ -1,11 +1,27 @@
<template>
  <div class="refund-form">
    <SearchCommonView ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" />
    <div class="btn-pager">
      <PublicFunctionBtnView :receive="false" :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 :receive="false" :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="100">
          <template slot-scope="scope">
@@ -17,18 +33,32 @@
    </TableCommonView>
    <!-- 新建/编辑 -->
    <AddRefundFormDialog v-if="editConfig.visible" :edit-common-config="editConfig" />
    <!-- 销售退货单详情 -->
    <DetailRefundForm v-if="refundFormDetail.visible" :refund-form-detail="refundFormDetail" />
    <!-- 客户详情 -->
    <DetailClientManage v-if="clientDeail.visible" :client-manage-detail="clientDeail" />
  </div>
</template>
<script>
import AddRefundFormDialog from "@/views/sales/refundForm/AddRefundFormDialog"
import { getSalesRefundList, getDelSalesRefund } from "@/api/sales/refundForm"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import DetailRefundForm from "@/views/sales/refundForm/DetailRefundForm"
export default {
  name: "RefundForm",
  props: {},
  props: {
    isDetail: {
      type: Boolean,
      default: false
    }
  },
  mixins: [pageMixin],
  components: {
    AddRefundFormDialog
    AddRefundFormDialog,
    DetailRefundForm,
    DetailClientManage: () => import("@/views/client/client/DetailClientManage")
  },
  computed: {
    searchCommonHeight() {
@@ -59,6 +89,14 @@
        visible: false,
        title: "新建",
        infomation: {}
      },
      refundFormDetail: {
        visible: false,
        infomation: {}
      },
      clientDeail: {
        visible: false,
        infomation: {}
      }
    }
  },
@@ -71,8 +109,8 @@
      this.tableList = {
        tableInfomation: [],
        tableColumn: [
          { label: "退款单编号", prop: "number" },
          { label: "客户名称", prop: "clientId", min: 120 },
          { label: "退款单编号", prop: "number", isCommonClick: true },
          { label: "客户名称", prop: "clientId", min: 120, isClientClick: true },
          { label: "退款日期", prop: "refundDate", isTime: true, min: 130 },
          { label: "账户", prop: "accountId" },
          { label: "是否开票", prop: "isInvoice", min: 100 },
@@ -91,7 +129,11 @@
    // 请求数据
    async getData() {
      this.loading = true
      await getSalesRefundList()
      await getSalesRefundList({
        keyword: "",
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
@@ -102,6 +144,7 @@
                }
              })
              this.tableList.tableInfomation = list || []
              this.pagerOptions.totalCount = res.data.count
            } else {
              this.tableList.tableInfomation = []
            }
@@ -142,7 +185,7 @@
        .then((response) => {
          if (response.code === 200) {
            this.$message.success("删除成功")
            this.getUserList()
            this.getData()
          } else {
            this.$message.warning("删除失败")
          }
@@ -151,6 +194,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.refundFormDetail.visible = true
      this.refundFormDetail.infomation = { ...row }
    }
  }
}
@@ -159,7 +214,16 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.refund-form {
  .btn-pager {
  .top {
    margin-bottom: 20px;
    .btn-pager {
      display: flex;
      .page {
        margin-left: auto;
      }
    }
  }
  .detail-top {
    display: flex;
    .page {
      margin-left: auto;